aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorMark Brown <broonie@opensource.wolfsonmicro.com>2011-08-08 01:56:19 -0400
committerMark Brown <broonie@opensource.wolfsonmicro.com>2011-08-08 01:56:19 -0400
commit18d4ed4342c14ebeebe60d267b171053efcdfa87 (patch)
treef315e77f66cbb70869e2f80cde5c18380a80901e /include
parent722d0daf2b607a32dad1357bf797e3803484af0a (diff)
parent22de4534ae12d61257fc0e53d2571686b03305bc (diff)
Merge branch 'for-3.1' into for-3.2
Conflict due to the fix for the register map failure - taken the for-3.1 version. Conflicts: sound/soc/codecs/sgtl5000.c
Diffstat (limited to 'include')
-rw-r--r--include/acpi/acpi_bus.h2
-rw-r--r--include/acpi/acpi_drivers.h2
-rw-r--r--include/acpi/acpiosxf.h3
-rw-r--r--include/acpi/acpixf.h3
-rw-r--r--include/acpi/apei.h5
-rw-r--r--include/acpi/platform/aclinux.h20
-rw-r--r--include/acpi/processor.h2
-rw-r--r--include/acpi/video.h2
-rw-r--r--include/asm-generic/atomic.h59
-rw-r--r--include/asm-generic/bitops/ext2-atomic-setbit.h11
-rw-r--r--include/asm-generic/bitops/ext2-atomic.h4
-rw-r--r--include/asm-generic/delay.h37
-rw-r--r--include/asm-generic/gpio.h10
-rw-r--r--include/asm-generic/io.h9
-rw-r--r--include/asm-generic/iomap.h12
-rw-r--r--include/asm-generic/local.h2
-rw-r--r--include/asm-generic/local64.h2
-rw-r--r--include/asm-generic/pci-bridge.h62
-rw-r--r--include/asm-generic/pgtable.h2
-rw-r--r--include/asm-generic/system.h2
-rw-r--r--include/asm-generic/unistd.h4
-rw-r--r--include/crypto/if_alg.h1
-rw-r--r--include/drm/drmP.h11
-rw-r--r--include/drm/drm_crtc.h5
-rw-r--r--include/drm/drm_pciids.h13
-rw-r--r--include/drm/i915_drm.h2
-rw-r--r--include/drm/radeon_drm.h1
-rw-r--r--include/drm/ttm/ttm_bo_api.h3
-rw-r--r--include/drm/ttm/ttm_bo_driver.h6
-rw-r--r--include/drm/ttm/ttm_lock.h2
-rw-r--r--include/drm/ttm/ttm_memory.h2
-rw-r--r--include/drm/ttm/ttm_object.h4
-rw-r--r--include/drm/ttm/ttm_page_alloc.h2
-rw-r--r--include/keys/encrypted-type.h13
-rw-r--r--include/linux/Kbuild1
-rw-r--r--include/linux/acpi.h3
-rw-r--r--include/linux/aer.h3
-rw-r--r--include/linux/aio.h2
-rw-r--r--include/linux/amba/pl08x.h9
-rw-r--r--include/linux/amba/serial.h3
-rw-r--r--include/linux/amd-iommu.h35
-rw-r--r--include/linux/anon_inodes.h2
-rw-r--r--include/linux/arcdevice.h1
-rw-r--r--include/linux/ath9k_platform.h2
-rw-r--r--include/linux/atmdev.h2
-rw-r--r--include/linux/atomic.h54
-rw-r--r--include/linux/audit.h7
-rw-r--r--include/linux/backing-dev.h10
-rw-r--r--include/linux/basic_mmio_gpio.h1
-rw-r--r--include/linux/bcma/bcma.h47
-rw-r--r--include/linux/bcma/bcma_driver_chipcommon.h12
-rw-r--r--include/linux/bcma/bcma_driver_pci.h2
-rw-r--r--include/linux/bcma/bcma_regs.h27
-rw-r--r--include/linux/binfmts.h1
-rw-r--r--include/linux/bit_spinlock.h4
-rw-r--r--include/linux/bitmap.h2
-rw-r--r--include/linux/blk_types.h2
-rw-r--r--include/linux/blkdev.h31
-rw-r--r--include/linux/blktrace_api.h3
-rw-r--r--include/linux/buffer_head.h2
-rw-r--r--include/linux/ceph/libceph.h2
-rw-r--r--include/linux/ceph/messenger.h1
-rw-r--r--include/linux/cgroup.h1
-rw-r--r--include/linux/clocksource.h16
-rw-r--r--include/linux/cn_proc.h13
-rw-r--r--include/linux/compat.h11
-rw-r--r--include/linux/configfs.h2
-rw-r--r--include/linux/connector.h4
-rw-r--r--include/linux/cordic.h48
-rw-r--r--include/linux/cpu.h33
-rw-r--r--include/linux/cpufreq.h5
-rw-r--r--include/linux/cpuidle.h4
-rw-r--r--include/linux/cpumask.h14
-rw-r--r--include/linux/crc8.h101
-rw-r--r--include/linux/cred.h14
-rw-r--r--include/linux/crypto.h2
-rw-r--r--include/linux/cryptohash.h7
-rw-r--r--include/linux/cs5535.h60
-rw-r--r--include/linux/ctype.h9
-rw-r--r--include/linux/dcache.h40
-rw-r--r--include/linux/dcbnl.h25
-rw-r--r--include/linux/dccp.h1
-rw-r--r--include/linux/debug_locks.h2
-rw-r--r--include/linux/device-mapper.h43
-rw-r--r--include/linux/device.h11
-rw-r--r--include/linux/device_cgroup.h10
-rw-r--r--include/linux/dio.h2
-rw-r--r--include/linux/dm-ioctl.h4
-rw-r--r--include/linux/dm-kcopyd.h15
-rw-r--r--include/linux/dma-direction.h13
-rw-r--r--include/linux/dma-mapping.h31
-rw-r--r--include/linux/dma_remapping.h4
-rw-r--r--include/linux/dmaengine.h4
-rw-r--r--include/linux/drbd_limits.h4
-rw-r--r--include/linux/dvb/audio.h2
-rw-r--r--include/linux/dw_apb_timer.h56
-rw-r--r--include/linux/ecryptfs.h113
-rw-r--r--include/linux/edac.h2
-rw-r--r--include/linux/eeprom_93xx46.h18
-rw-r--r--include/linux/efi.h40
-rw-r--r--include/linux/elevator.h2
-rw-r--r--include/linux/etherdevice.h2
-rw-r--r--include/linux/ethtool.h41
-rw-r--r--include/linux/ext2_fs.h1
-rw-r--r--include/linux/ext3_fs.h9
-rw-r--r--include/linux/fault-inject.h37
-rw-r--r--include/linux/fb.h3
-rw-r--r--include/linux/fd.h22
-rw-r--r--include/linux/fdtable.h3
-rw-r--r--include/linux/filter.h2
-rw-r--r--include/linux/firewire-cdev.h78
-rw-r--r--include/linux/firewire.h2
-rw-r--r--include/linux/fs.h196
-rw-r--r--include/linux/fscache.h21
-rw-r--r--include/linux/fsl-diu-fb.h6
-rw-r--r--include/linux/fsl_hypervisor.h241
-rw-r--r--include/linux/fsnotify_backend.h2
-rw-r--r--include/linux/ftrace.h7
-rw-r--r--include/linux/ftrace_event.h5
-rw-r--r--include/linux/genalloc.h34
-rw-r--r--include/linux/generic_acl.h1
-rw-r--r--include/linux/genhd.h3
-rw-r--r--include/linux/gfp.h2
-rw-r--r--include/linux/gpio.h11
-rw-r--r--include/linux/gsmmux.h11
-rw-r--r--include/linux/hardirq.h4
-rw-r--r--include/linux/hid.h3
-rw-r--r--include/linux/hrtimer.h1
-rw-r--r--include/linux/hugetlb.h3
-rw-r--r--include/linux/hw_breakpoint.h10
-rw-r--r--include/linux/hw_random.h2
-rw-r--r--include/linux/i2c-omap.h27
-rw-r--r--include/linux/i2c/adp8870.h153
-rw-r--r--include/linux/i2c/twl.h25
-rw-r--r--include/linux/i8253.h29
-rw-r--r--include/linux/idr.h4
-rw-r--r--include/linux/ieee80211.h63
-rw-r--r--include/linux/if.h2
-rw-r--r--include/linux/if_ether.h5
-rw-r--r--include/linux/if_packet.h9
-rw-r--r--include/linux/if_vlan.h116
-rw-r--r--include/linux/inet_lro.h19
-rw-r--r--include/linux/init_task.h1
-rw-r--r--include/linux/input.h8
-rw-r--r--include/linux/input/kxtj9.h70
-rw-r--r--include/linux/input/sh_keysc.h2
-rw-r--r--include/linux/interrupt.h3
-rw-r--r--include/linux/iocontext.h14
-rw-r--r--include/linux/iommu.h2
-rw-r--r--include/linux/ioport.h31
-rw-r--r--include/linux/ipc_namespace.h7
-rw-r--r--include/linux/irq.h14
-rw-r--r--include/linux/irqdomain.h91
-rw-r--r--include/linux/irqreturn.h6
-rw-r--r--include/linux/iscsi_boot_sysfs.h16
-rw-r--r--include/linux/jbd.h1
-rw-r--r--include/linux/jbd2.h8
-rw-r--r--include/linux/journal-head.h2
-rw-r--r--include/linux/jump_label.h2
-rw-r--r--include/linux/kconfig.h32
-rw-r--r--include/linux/kdb.h2
-rw-r--r--include/linux/kernel.h60
-rw-r--r--include/linux/key.h2
-rw-r--r--include/linux/kgdb.h2
-rw-r--r--include/linux/kmod.h8
-rw-r--r--include/linux/kmsg_dump.h1
-rw-r--r--include/linux/kobject.h2
-rw-r--r--include/linux/kobject_ns.h10
-rw-r--r--include/linux/kvm.h20
-rw-r--r--include/linux/kvm_host.h8
-rw-r--r--include/linux/led-lm3530.h5
-rw-r--r--include/linux/lguest.h2
-rw-r--r--include/linux/libata.h68
-rw-r--r--include/linux/llist.h126
-rw-r--r--include/linux/memcontrol.h40
-rw-r--r--include/linux/memory.h2
-rw-r--r--include/linux/memory_hotplug.h11
-rw-r--r--include/linux/mfd/aat2870.h181
-rw-r--r--include/linux/mfd/ab8500.h8
-rw-r--r--include/linux/mfd/ds1wm.h7
-rw-r--r--include/linux/mfd/max8997.h7
-rw-r--r--include/linux/mfd/max8998.h12
-rw-r--r--include/linux/mfd/pm8xxx/rtc.h25
-rw-r--r--include/linux/mfd/stmpe.h3
-rw-r--r--include/linux/mfd/tmio.h8
-rw-r--r--include/linux/mfd/tps65910.h3
-rw-r--r--include/linux/mfd/tps65912.h327
-rw-r--r--include/linux/mfd/twl4030-audio.h (renamed from include/linux/mfd/twl4030-codec.h)16
-rw-r--r--include/linux/mfd/twl6040.h228
-rw-r--r--include/linux/mfd/wm831x/core.h119
-rw-r--r--include/linux/mfd/wm831x/pdata.h3
-rw-r--r--include/linux/mii.h2
-rw-r--r--include/linux/mlx4/cmd.h3
-rw-r--r--include/linux/mlx4/device.h62
-rw-r--r--include/linux/mlx4/qp.h8
-rw-r--r--include/linux/mm.h60
-rw-r--r--include/linux/mm_types.h89
-rw-r--r--include/linux/mman.h2
-rw-r--r--include/linux/mmc/boot.h6
-rw-r--r--include/linux/mmc/card.h15
-rw-r--r--include/linux/mmc/core.h9
-rw-r--r--include/linux/mmc/dw_mmc.h28
-rw-r--r--include/linux/mmc/host.h26
-rw-r--r--include/linux/mmc/ioctl.h2
-rw-r--r--include/linux/mmc/mmc.h17
-rw-r--r--include/linux/mmc/pm.h2
-rw-r--r--include/linux/mmc/sd.h7
-rw-r--r--include/linux/mmc/sdhci-pltfm.h35
-rw-r--r--include/linux/mmc/sdhci-spear.h6
-rw-r--r--include/linux/mmc/sdhci.h6
-rw-r--r--include/linux/mmc/sdio.h7
-rw-r--r--include/linux/mmc/sdio_func.h7
-rw-r--r--include/linux/mmc/sdio_ids.h6
-rw-r--r--include/linux/mmc/sh_mmcif.h6
-rw-r--r--include/linux/mmc/sh_mobile_sdhi.h6
-rw-r--r--include/linux/mmc/tmio.h8
-rw-r--r--include/linux/mmzone.h15
-rw-r--r--include/linux/mnt_namespace.h1
-rw-r--r--include/linux/module.h24
-rw-r--r--include/linux/moduleloader.h7
-rw-r--r--include/linux/mount.h2
-rw-r--r--include/linux/mtd/physmap.h1
-rw-r--r--include/linux/mtd/ubi.h14
-rw-r--r--include/linux/mutex.h4
-rw-r--r--include/linux/namei.h5
-rw-r--r--include/linux/netdevice.h108
-rw-r--r--include/linux/netfilter/ipset/ip_set.h50
-rw-r--r--include/linux/netfilter/ipset/ip_set_ahash.h154
-rw-r--r--include/linux/netfilter/ipset/ip_set_hash.h4
-rw-r--r--include/linux/netfilter/ipset/ip_set_timeout.h5
-rw-r--r--include/linux/netfilter/ipset/pfxlen.h11
-rw-r--r--include/linux/netfilter/nf_conntrack_common.h3
-rw-r--r--include/linux/netfilter/nfnetlink.h3
-rw-r--r--include/linux/netfilter/nfnetlink_queue.h1
-rw-r--r--include/linux/netfilter/xt_set.h15
-rw-r--r--include/linux/netlink.h8
-rw-r--r--include/linux/netpoll.h2
-rw-r--r--include/linux/nfc.h126
-rw-r--r--include/linux/nfs.h2
-rw-r--r--include/linux/nfs4.h4
-rw-r--r--include/linux/nfs_fs.h13
-rw-r--r--include/linux/nfs_fs_sb.h11
-rw-r--r--include/linux/nfs_page.h20
-rw-r--r--include/linux/nfs_xdr.h62
-rw-r--r--include/linux/nfsd/export.h2
-rw-r--r--include/linux/nl80211.h77
-rw-r--r--include/linux/nodemask.h13
-rw-r--r--include/linux/notifier.h82
-rw-r--r--include/linux/nsproxy.h1
-rw-r--r--include/linux/of.h32
-rw-r--r--include/linux/of_address.h5
-rw-r--r--include/linux/of_gpio.h51
-rw-r--r--include/linux/of_irq.h4
-rw-r--r--include/linux/of_net.h1
-rw-r--r--include/linux/of_pci.h5
-rw-r--r--include/linux/of_platform.h40
-rw-r--r--include/linux/oom.h4
-rw-r--r--include/linux/opp.h8
-rw-r--r--include/linux/oprofile.h2
-rw-r--r--include/linux/page-flags.h9
-rw-r--r--include/linux/pagemap.h16
-rw-r--r--include/linux/pci.h47
-rw-r--r--include/linux/pci_ids.h25
-rw-r--r--include/linux/percpu.h3
-rw-r--r--include/linux/perf_event.h91
-rw-r--r--include/linux/phy.h6
-rw-r--r--include/linux/platform_data/fsa9480.h27
-rw-r--r--include/linux/platform_data/ntc_thermistor.h53
-rw-r--r--include/linux/platform_data/pxa_sdhci.h60
-rw-r--r--include/linux/platform_device.h1
-rw-r--r--include/linux/plist.h55
-rw-r--r--include/linux/pm.h13
-rw-r--r--include/linux/pm_domain.h108
-rw-r--r--include/linux/pm_runtime.h38
-rw-r--r--include/linux/pnfs_osd_xdr.h31
-rw-r--r--include/linux/pnp.h2
-rw-r--r--include/linux/poison.h6
-rw-r--r--include/linux/posix_acl.h83
-rw-r--r--include/linux/power/bq20z75.h3
-rw-r--r--include/linux/power/max17042_battery.h91
-rw-r--r--include/linux/preempt.h26
-rw-r--r--include/linux/proc_fs.h8
-rw-r--r--include/linux/pstore.h9
-rw-r--r--include/linux/pti.h3
-rw-r--r--include/linux/ptrace.h104
-rw-r--r--include/linux/quota.h10
-rw-r--r--include/linux/radix-tree.h37
-rw-r--r--include/linux/raid/md_p.h14
-rw-r--r--include/linux/ramoops.h2
-rw-r--r--include/linux/random.h11
-rw-r--r--include/linux/rculist.h2
-rw-r--r--include/linux/rcupdate.h12
-rw-r--r--include/linux/reboot.h5
-rw-r--r--include/linux/regmap.h82
-rw-r--r--include/linux/regulator/consumer.h3
-rw-r--r--include/linux/regulator/driver.h4
-rw-r--r--include/linux/reiserfs_acl.h6
-rw-r--r--include/linux/reiserfs_fs.h2
-rw-r--r--include/linux/reiserfs_xattr.h2
-rw-r--r--include/linux/ring_buffer.h2
-rw-r--r--include/linux/rtmutex.h4
-rw-r--r--include/linux/rtnetlink.h5
-rw-r--r--include/linux/rwsem.h12
-rw-r--r--include/linux/sched.h75
-rw-r--r--include/linux/sdla.h6
-rw-r--r--include/linux/seccomp.h10
-rw-r--r--include/linux/security.h9
-rw-r--r--include/linux/sem.h2
-rw-r--r--include/linux/seq_file.h1
-rw-r--r--include/linux/seqlock.h1
-rw-r--r--include/linux/serial_sci.h75
-rw-r--r--include/linux/sh_clk.h4
-rw-r--r--include/linux/sh_dma.h8
-rw-r--r--include/linux/shm.h7
-rw-r--r--include/linux/shmem_fs.h34
-rw-r--r--include/linux/shrinker.h42
-rw-r--r--include/linux/skbuff.h80
-rw-r--r--include/linux/slab.h20
-rw-r--r--include/linux/slab_def.h52
-rw-r--r--include/linux/slob_def.h10
-rw-r--r--include/linux/slub_def.h26
-rw-r--r--include/linux/smp.h5
-rw-r--r--include/linux/socket.h4
-rw-r--r--include/linux/sonet.h2
-rw-r--r--include/linux/spi/74x164.h2
-rw-r--r--include/linux/spi/mcp23s08.h9
-rw-r--r--include/linux/spinlock.h2
-rw-r--r--include/linux/splice.h2
-rw-r--r--include/linux/ssb/ssb.h4
-rw-r--r--include/linux/ssb/ssb_driver_chipcommon.h2
-rw-r--r--include/linux/stacktrace.h4
-rw-r--r--include/linux/stmmac.h25
-rw-r--r--include/linux/stop_machine.h16
-rw-r--r--include/linux/sunrpc/auth.h2
-rw-r--r--include/linux/sunrpc/bc_xprt.h6
-rw-r--r--include/linux/sunrpc/cache.h11
-rw-r--r--include/linux/sunrpc/gss_krb5_enctypes.h4
-rw-r--r--include/linux/sunrpc/sched.h7
-rw-r--r--include/linux/sunrpc/svc.h5
-rw-r--r--include/linux/sunrpc/timer.h2
-rw-r--r--include/linux/sunrpc/xprt.h34
-rw-r--r--include/linux/suspend.h16
-rw-r--r--include/linux/swap.h33
-rw-r--r--include/linux/swapops.h23
-rw-r--r--include/linux/swiotlb.h1
-rw-r--r--include/linux/sysfs.h9
-rw-r--r--include/linux/tc_ematch/tc_em_meta.h2
-rw-r--r--include/linux/tcp.h1
-rw-r--r--include/linux/thermal.h22
-rw-r--r--include/linux/topology.h2
-rw-r--r--include/linux/tracehook.h385
-rw-r--r--include/linux/tty.h37
-rw-r--r--include/linux/tty_ldisc.h9
-rw-r--r--include/linux/usb/composite.h32
-rw-r--r--include/linux/usb/gadget.h88
-rw-r--r--include/linux/usb/m66592.h2
-rw-r--r--include/linux/usb/r8a66597.h8
-rw-r--r--include/linux/usb/renesas_usbhs.h17
-rw-r--r--include/linux/usb_usual.h4
-rw-r--r--include/linux/uts.h2
-rw-r--r--include/linux/videodev2.h254
-rw-r--r--include/linux/virtio.h9
-rw-r--r--include/linux/virtio_9p.h25
-rw-r--r--include/linux/virtio_balloon.h25
-rw-r--r--include/linux/virtio_blk.h25
-rw-r--r--include/linux/virtio_config.h25
-rw-r--r--include/linux/virtio_console.h26
-rw-r--r--include/linux/virtio_ids.h24
-rw-r--r--include/linux/virtio_net.h26
-rw-r--r--include/linux/virtio_pci.h23
-rw-r--r--include/linux/virtio_ring.h52
-rw-r--r--include/linux/vmstat.h2
-rw-r--r--include/linux/vt.h7
-rw-r--r--include/linux/vt_kern.h2
-rw-r--r--include/linux/watchdog.h78
-rw-r--r--include/linux/wm97xx.h13
-rw-r--r--include/linux/workqueue.h20
-rw-r--r--include/linux/writeback.h55
-rw-r--r--include/linux/zorro.h2
-rw-r--r--include/media/adp1653.h126
-rw-r--r--include/media/atmel-isi.h119
-rw-r--r--include/media/davinci/vpbe.h184
-rw-r--r--include/media/davinci/vpbe_display.h147
-rw-r--r--include/media/davinci/vpbe_osd.h394
-rw-r--r--include/media/davinci/vpbe_types.h91
-rw-r--r--include/media/davinci/vpbe_venc.h45
-rw-r--r--include/media/lirc_dev.h2
-rw-r--r--include/media/m5mols.h4
-rw-r--r--include/media/mmp-camera.h9
-rw-r--r--include/media/ov7670.h20
-rw-r--r--include/media/rc-core.h2
-rw-r--r--include/media/rc-map.h3
-rw-r--r--include/media/sh_mobile_ceu.h10
-rw-r--r--include/media/sh_mobile_csi2.h8
-rw-r--r--include/media/soc_camera.h44
-rw-r--r--include/media/soc_camera_platform.h15
-rw-r--r--include/media/timb_radio.h9
-rw-r--r--include/media/tuner.h2
-rw-r--r--include/media/v4l2-chip-ident.h4
-rw-r--r--include/media/v4l2-ctrls.h72
-rw-r--r--include/media/v4l2-dev.h4
-rw-r--r--include/media/v4l2-event.h84
-rw-r--r--include/media/v4l2-fh.h13
-rw-r--r--include/media/v4l2-mediabus.h63
-rw-r--r--include/media/v4l2-subdev.h34
-rw-r--r--include/net/9p/9p.h193
-rw-r--r--include/net/9p/client.h12
-rw-r--r--include/net/9p/transport.h2
-rw-r--r--include/net/act_api.h6
-rw-r--r--include/net/arp.h31
-rw-r--r--include/net/ax25.h2
-rw-r--r--include/net/bluetooth/bluetooth.h27
-rw-r--r--include/net/bluetooth/hci.h77
-rw-r--r--include/net/bluetooth/hci_core.h96
-rw-r--r--include/net/bluetooth/l2cap.h140
-rw-r--r--include/net/bluetooth/mgmt.h12
-rw-r--r--include/net/bluetooth/rfcomm.h9
-rw-r--r--include/net/bluetooth/smp.h47
-rw-r--r--include/net/caif/caif_hsi.h145
-rw-r--r--include/net/cfg80211.h73
-rw-r--r--include/net/cipso_ipv4.h4
-rw-r--r--include/net/dcbnl.h11
-rw-r--r--include/net/dst.h49
-rw-r--r--include/net/dst_ops.h1
-rw-r--r--include/net/flow.h2
-rw-r--r--include/net/genetlink.h32
-rw-r--r--include/net/inet_hashtables.h2
-rw-r--r--include/net/inet_timewait_sock.h2
-rw-r--r--include/net/inetpeer.h41
-rw-r--r--include/net/ip.h10
-rw-r--r--include/net/ip6_fib.h1
-rw-r--r--include/net/ip_vs.h36
-rw-r--r--include/net/ipv6.h12
-rw-r--r--include/net/lib80211.h2
-rw-r--r--include/net/llc.h2
-rw-r--r--include/net/mac80211.h321
-rw-r--r--include/net/neighbour.h36
-rw-r--r--include/net/net_namespace.h13
-rw-r--r--include/net/netfilter/nf_conntrack.h8
-rw-r--r--include/net/netlabel.h4
-rw-r--r--include/net/netlink.h24
-rw-r--r--include/net/netns/conntrack.h2
-rw-r--r--include/net/nfc.h156
-rw-r--r--include/net/pkt_sched.h4
-rw-r--r--include/net/rtnetlink.h7
-rw-r--r--include/net/sch_generic.h12
-rw-r--r--include/net/sctp/command.h2
-rw-r--r--include/net/sctp/sctp.h15
-rw-r--r--include/net/sctp/structs.h21
-rw-r--r--include/net/sctp/ulpevent.h2
-rw-r--r--include/net/sctp/user.h1
-rw-r--r--include/net/secure_seq.h20
-rw-r--r--include/net/snmp.h86
-rw-r--r--include/net/sock.h6
-rw-r--r--include/net/tcp.h11
-rw-r--r--include/net/wimax.h1
-rw-r--r--include/pcmcia/device_id.h9
-rw-r--r--include/pcmcia/ds.h2
-rw-r--r--include/rdma/ib_pma.h156
-rw-r--r--include/rdma/ib_sa.h2
-rw-r--r--include/rdma/ib_verbs.h5
-rw-r--r--include/rxrpc/types.h2
-rw-r--r--include/scsi/fc_frame.h1
-rw-r--r--include/scsi/iscsi_proto.h78
-rw-r--r--include/scsi/libfc.h8
-rw-r--r--include/scsi/libiscsi.h2
-rw-r--r--include/scsi/osd_initiator.h2
-rw-r--r--include/scsi/osd_ore.h125
-rw-r--r--include/scsi/scsi.h2
-rw-r--r--include/scsi/scsi_device.h2
-rw-r--r--include/sound/pcm.h35
-rw-r--r--include/sound/pcm_params.h16
-rw-r--r--include/sound/rawmidi.h4
-rw-r--r--include/sound/sb16_csp.h9
-rw-r--r--include/sound/soundfont.h2
-rw-r--r--include/sound/tea575x-tuner.h8
-rw-r--r--include/staging/altera.h49
-rw-r--r--include/target/target_core_base.h228
-rw-r--r--include/target/target_core_device.h6
-rw-r--r--include/target/target_core_fabric_ops.h9
-rw-r--r--include/target/target_core_transport.h43
-rw-r--r--include/trace/events/btrfs.h6
-rw-r--r--include/trace/events/ext3.h864
-rw-r--r--include/trace/events/ext4.h270
-rw-r--r--include/trace/events/irq.h3
-rw-r--r--include/trace/events/jbd.h203
-rw-r--r--include/trace/events/jbd2.h36
-rw-r--r--include/trace/events/net.h12
-rw-r--r--include/trace/events/sock.h68
-rw-r--r--include/trace/events/udp.h32
-rw-r--r--include/trace/events/vmscan.h160
-rw-r--r--include/trace/events/writeback.h183
-rw-r--r--include/trace/events/xen.h506
-rw-r--r--include/video/omapdss.h26
-rw-r--r--include/xen/balloon.h14
-rw-r--r--include/xen/events.h2
-rw-r--r--include/xen/hvc-console.h4
-rw-r--r--include/xen/interface/xen.h39
-rw-r--r--include/xen/tmem.h5
-rw-r--r--include/xen/xenbus.h2
500 files changed, 12182 insertions, 3171 deletions
diff --git a/include/acpi/acpi_bus.h b/include/acpi/acpi_bus.h
index 3a10ef5914eb..6cd5b6403a7b 100644
--- a/include/acpi/acpi_bus.h
+++ b/include/acpi/acpi_bus.h
@@ -210,7 +210,7 @@ struct acpi_device_power_state {
210struct acpi_device_power { 210struct acpi_device_power {
211 int state; /* Current state */ 211 int state; /* Current state */
212 struct acpi_device_power_flags flags; 212 struct acpi_device_power_flags flags;
213 struct acpi_device_power_state states[4]; /* Power states (D0-D3) */ 213 struct acpi_device_power_state states[ACPI_D_STATE_COUNT]; /* Power states (D0-D3Cold) */
214}; 214};
215 215
216/* Performance Management */ 216/* Performance Management */
diff --git a/include/acpi/acpi_drivers.h b/include/acpi/acpi_drivers.h
index 3090471b2a5e..e49c36d38d7e 100644
--- a/include/acpi/acpi_drivers.h
+++ b/include/acpi/acpi_drivers.h
@@ -128,7 +128,7 @@ extern int is_dock_device(acpi_handle handle);
128extern int register_dock_notifier(struct notifier_block *nb); 128extern int register_dock_notifier(struct notifier_block *nb);
129extern void unregister_dock_notifier(struct notifier_block *nb); 129extern void unregister_dock_notifier(struct notifier_block *nb);
130extern int register_hotplug_dock_device(acpi_handle handle, 130extern int register_hotplug_dock_device(acpi_handle handle,
131 struct acpi_dock_ops *ops, 131 const struct acpi_dock_ops *ops,
132 void *context); 132 void *context);
133extern void unregister_hotplug_dock_device(acpi_handle handle); 133extern void unregister_hotplug_dock_device(acpi_handle handle);
134#else 134#else
diff --git a/include/acpi/acpiosxf.h b/include/acpi/acpiosxf.h
index a756bc8d866d..4543b6f75867 100644
--- a/include/acpi/acpiosxf.h
+++ b/include/acpi/acpiosxf.h
@@ -98,8 +98,11 @@ acpi_os_table_override(struct acpi_table_header *existing_table,
98/* 98/*
99 * Spinlock primitives 99 * Spinlock primitives
100 */ 100 */
101
102#ifndef acpi_os_create_lock
101acpi_status 103acpi_status
102acpi_os_create_lock(acpi_spinlock *out_handle); 104acpi_os_create_lock(acpi_spinlock *out_handle);
105#endif
103 106
104void acpi_os_delete_lock(acpi_spinlock handle); 107void acpi_os_delete_lock(acpi_spinlock handle);
105 108
diff --git a/include/acpi/acpixf.h b/include/acpi/acpixf.h
index 2ed0a8486c19..f554a9313b43 100644
--- a/include/acpi/acpixf.h
+++ b/include/acpi/acpixf.h
@@ -47,7 +47,7 @@
47 47
48/* Current ACPICA subsystem version in YYYYMMDD format */ 48/* Current ACPICA subsystem version in YYYYMMDD format */
49 49
50#define ACPI_CA_VERSION 0x20110413 50#define ACPI_CA_VERSION 0x20110623
51 51
52#include "actypes.h" 52#include "actypes.h"
53#include "actbl.h" 53#include "actbl.h"
@@ -69,6 +69,7 @@ extern u32 acpi_gbl_trace_flags;
69extern u32 acpi_gbl_enable_aml_debug_object; 69extern u32 acpi_gbl_enable_aml_debug_object;
70extern u8 acpi_gbl_copy_dsdt_locally; 70extern u8 acpi_gbl_copy_dsdt_locally;
71extern u8 acpi_gbl_truncate_io_addresses; 71extern u8 acpi_gbl_truncate_io_addresses;
72extern u8 acpi_gbl_disable_auto_repair;
72 73
73extern u32 acpi_current_gpe_count; 74extern u32 acpi_current_gpe_count;
74extern struct acpi_table_fadt acpi_gbl_FADT; 75extern struct acpi_table_fadt acpi_gbl_FADT;
diff --git a/include/acpi/apei.h b/include/acpi/apei.h
index e67b523a50e1..51a527d24a8a 100644
--- a/include/acpi/apei.h
+++ b/include/acpi/apei.h
@@ -18,6 +18,11 @@
18 18
19extern int hest_disable; 19extern int hest_disable;
20extern int erst_disable; 20extern int erst_disable;
21#ifdef CONFIG_ACPI_APEI_GHES
22extern int ghes_disable;
23#else
24#define ghes_disable 1
25#endif
21 26
22#ifdef CONFIG_ACPI_APEI 27#ifdef CONFIG_ACPI_APEI
23void __init acpi_hest_init(void); 28void __init acpi_hest_init(void);
diff --git a/include/acpi/platform/aclinux.h b/include/acpi/platform/aclinux.h
index 5d2a5e9544d9..f72403c4b51a 100644
--- a/include/acpi/platform/aclinux.h
+++ b/include/acpi/platform/aclinux.h
@@ -59,7 +59,7 @@
59#include <linux/ctype.h> 59#include <linux/ctype.h>
60#include <linux/sched.h> 60#include <linux/sched.h>
61#include <asm/system.h> 61#include <asm/system.h>
62#include <asm/atomic.h> 62#include <linux/atomic.h>
63#include <asm/div64.h> 63#include <asm/div64.h>
64#include <asm/acpi.h> 64#include <asm/acpi.h>
65#include <linux/slab.h> 65#include <linux/slab.h>
@@ -159,6 +159,24 @@ static inline void *acpi_os_acquire_object(acpi_cache_t * cache)
159 } while (0) 159 } while (0)
160#endif 160#endif
161 161
162/*
163 * When lockdep is enabled, the spin_lock_init() macro stringifies it's
164 * argument and uses that as a name for the lock in debugging.
165 * By executing spin_lock_init() in a macro the key changes from "lock" for
166 * all locks to the name of the argument of acpi_os_create_lock(), which
167 * prevents lockdep from reporting false positives for ACPICA locks.
168 */
169#define acpi_os_create_lock(__handle) \
170({ \
171 spinlock_t *lock = ACPI_ALLOCATE(sizeof(*lock)); \
172 \
173 if (lock) { \
174 *(__handle) = lock; \
175 spin_lock_init(*(__handle)); \
176 } \
177 lock ? AE_OK : AE_NO_MEMORY; \
178})
179
162#endif /* __KERNEL__ */ 180#endif /* __KERNEL__ */
163 181
164#endif /* __ACLINUX_H__ */ 182#endif /* __ACLINUX_H__ */
diff --git a/include/acpi/processor.h b/include/acpi/processor.h
index ba4928cae473..67055f180330 100644
--- a/include/acpi/processor.h
+++ b/include/acpi/processor.h
@@ -337,7 +337,7 @@ extern struct cpuidle_driver acpi_idle_driver;
337 337
338/* in processor_thermal.c */ 338/* in processor_thermal.c */
339int acpi_processor_get_limit_info(struct acpi_processor *pr); 339int acpi_processor_get_limit_info(struct acpi_processor *pr);
340extern struct thermal_cooling_device_ops processor_cooling_ops; 340extern const struct thermal_cooling_device_ops processor_cooling_ops;
341#ifdef CONFIG_CPU_FREQ 341#ifdef CONFIG_CPU_FREQ
342void acpi_thermal_cpufreq_init(void); 342void acpi_thermal_cpufreq_init(void);
343void acpi_thermal_cpufreq_exit(void); 343void acpi_thermal_cpufreq_exit(void);
diff --git a/include/acpi/video.h b/include/acpi/video.h
index 0e98e679d3a7..61109f2609fc 100644
--- a/include/acpi/video.h
+++ b/include/acpi/video.h
@@ -5,6 +5,8 @@
5 5
6struct acpi_device; 6struct acpi_device;
7 7
8#define ACPI_VIDEO_CLASS "video"
9
8#define ACPI_VIDEO_DISPLAY_CRT 1 10#define ACPI_VIDEO_DISPLAY_CRT 1
9#define ACPI_VIDEO_DISPLAY_TV 2 11#define ACPI_VIDEO_DISPLAY_TV 2
10#define ACPI_VIDEO_DISPLAY_DVI 3 12#define ACPI_VIDEO_DISPLAY_DVI 3
diff --git a/include/asm-generic/atomic.h b/include/asm-generic/atomic.h
index e994197f84b7..e37963c1df4d 100644
--- a/include/asm-generic/atomic.h
+++ b/include/asm-generic/atomic.h
@@ -1,5 +1,7 @@
1/* 1/*
2 * Generic C implementation of atomic counter operations 2 * Generic C implementation of atomic counter operations. Usable on
3 * UP systems only. Do not include in machine independent code.
4 *
3 * Originally implemented for MN10300. 5 * Originally implemented for MN10300.
4 * 6 *
5 * Copyright (C) 2007 Red Hat, Inc. All Rights Reserved. 7 * Copyright (C) 2007 Red Hat, Inc. All Rights Reserved.
@@ -14,7 +16,11 @@
14#define __ASM_GENERIC_ATOMIC_H 16#define __ASM_GENERIC_ATOMIC_H
15 17
16#ifdef CONFIG_SMP 18#ifdef CONFIG_SMP
17#error not SMP safe 19/* Force people to define core atomics */
20# if !defined(atomic_add_return) || !defined(atomic_sub_return) || \
21 !defined(atomic_clear_mask) || !defined(atomic_set_mask)
22# error "SMP requires a little arch-specific magic"
23# endif
18#endif 24#endif
19 25
20/* 26/*
@@ -32,7 +38,9 @@
32 * 38 *
33 * Atomically reads the value of @v. 39 * Atomically reads the value of @v.
34 */ 40 */
41#ifndef atomic_read
35#define atomic_read(v) (*(volatile int *)&(v)->counter) 42#define atomic_read(v) (*(volatile int *)&(v)->counter)
43#endif
36 44
37/** 45/**
38 * atomic_set - set atomic variable 46 * atomic_set - set atomic variable
@@ -53,6 +61,7 @@
53 * 61 *
54 * Atomically adds @i to @v and returns the result 62 * Atomically adds @i to @v and returns the result
55 */ 63 */
64#ifndef atomic_add_return
56static inline int atomic_add_return(int i, atomic_t *v) 65static inline int atomic_add_return(int i, atomic_t *v)
57{ 66{
58 unsigned long flags; 67 unsigned long flags;
@@ -66,6 +75,7 @@ static inline int atomic_add_return(int i, atomic_t *v)
66 75
67 return temp; 76 return temp;
68} 77}
78#endif
69 79
70/** 80/**
71 * atomic_sub_return - subtract integer from atomic variable 81 * atomic_sub_return - subtract integer from atomic variable
@@ -74,6 +84,7 @@ static inline int atomic_add_return(int i, atomic_t *v)
74 * 84 *
75 * Atomically subtracts @i from @v and returns the result 85 * Atomically subtracts @i from @v and returns the result
76 */ 86 */
87#ifndef atomic_sub_return
77static inline int atomic_sub_return(int i, atomic_t *v) 88static inline int atomic_sub_return(int i, atomic_t *v)
78{ 89{
79 unsigned long flags; 90 unsigned long flags;
@@ -87,6 +98,7 @@ static inline int atomic_sub_return(int i, atomic_t *v)
87 98
88 return temp; 99 return temp;
89} 100}
101#endif
90 102
91static inline int atomic_add_negative(int i, atomic_t *v) 103static inline int atomic_add_negative(int i, atomic_t *v)
92{ 104{
@@ -117,8 +129,8 @@ static inline void atomic_dec(atomic_t *v)
117#define atomic_inc_return(v) atomic_add_return(1, (v)) 129#define atomic_inc_return(v) atomic_add_return(1, (v))
118 130
119#define atomic_sub_and_test(i, v) (atomic_sub_return((i), (v)) == 0) 131#define atomic_sub_and_test(i, v) (atomic_sub_return((i), (v)) == 0)
120#define atomic_dec_and_test(v) (atomic_sub_return(1, (v)) == 0) 132#define atomic_dec_and_test(v) (atomic_dec_return(v) == 0)
121#define atomic_inc_and_test(v) (atomic_add_return(1, (v)) == 0) 133#define atomic_inc_and_test(v) (atomic_inc_return(v) == 0)
122 134
123#define atomic_xchg(ptr, v) (xchg(&(ptr)->counter, (v))) 135#define atomic_xchg(ptr, v) (xchg(&(ptr)->counter, (v)))
124#define atomic_cmpxchg(v, old, new) (cmpxchg(&((v)->counter), (old), (new))) 136#define atomic_cmpxchg(v, old, new) (cmpxchg(&((v)->counter), (old), (new)))
@@ -129,26 +141,51 @@ static inline void atomic_dec(atomic_t *v)
129 141
130#define cmpxchg64_local(ptr, o, n) __cmpxchg64_local_generic((ptr), (o), (n)) 142#define cmpxchg64_local(ptr, o, n) __cmpxchg64_local_generic((ptr), (o), (n))
131 143
132static inline int atomic_add_unless(atomic_t *v, int a, int u) 144static inline int __atomic_add_unless(atomic_t *v, int a, int u)
133{ 145{
134 int c, old; 146 int c, old;
135 c = atomic_read(v); 147 c = atomic_read(v);
136 while (c != u && (old = atomic_cmpxchg(v, c, c + a)) != c) 148 while (c != u && (old = atomic_cmpxchg(v, c, c + a)) != c)
137 c = old; 149 c = old;
138 return c != u; 150 return c;
139} 151}
140 152
141#define atomic_inc_not_zero(v) atomic_add_unless((v), 1, 0) 153/**
142 154 * atomic_clear_mask - Atomically clear bits in atomic variable
143static inline void atomic_clear_mask(unsigned long mask, unsigned long *addr) 155 * @mask: Mask of the bits to be cleared
156 * @v: pointer of type atomic_t
157 *
158 * Atomically clears the bits set in @mask from @v
159 */
160#ifndef atomic_clear_mask
161static inline void atomic_clear_mask(unsigned long mask, atomic_t *v)
144{ 162{
145 unsigned long flags; 163 unsigned long flags;
146 164
147 mask = ~mask; 165 mask = ~mask;
148 raw_local_irq_save(flags); /* Don't trace it in a irqsoff handler */ 166 raw_local_irq_save(flags); /* Don't trace it in a irqsoff handler */
149 *addr &= mask; 167 v->counter &= mask;
150 raw_local_irq_restore(flags); 168 raw_local_irq_restore(flags);
151} 169}
170#endif
171
172/**
173 * atomic_set_mask - Atomically set bits in atomic variable
174 * @mask: Mask of the bits to be set
175 * @v: pointer of type atomic_t
176 *
177 * Atomically sets the bits set in @mask in @v
178 */
179#ifndef atomic_set_mask
180static inline void atomic_set_mask(unsigned int mask, atomic_t *v)
181{
182 unsigned long flags;
183
184 raw_local_irq_save(flags); /* Don't trace it in a irqsoff handler */
185 v->counter |= mask;
186 raw_local_irq_restore(flags);
187}
188#endif
152 189
153/* Assume that atomic operations are already serializing */ 190/* Assume that atomic operations are already serializing */
154#define smp_mb__before_atomic_dec() barrier() 191#define smp_mb__before_atomic_dec() barrier()
@@ -156,7 +193,5 @@ static inline void atomic_clear_mask(unsigned long mask, unsigned long *addr)
156#define smp_mb__before_atomic_inc() barrier() 193#define smp_mb__before_atomic_inc() barrier()
157#define smp_mb__after_atomic_inc() barrier() 194#define smp_mb__after_atomic_inc() barrier()
158 195
159#include <asm-generic/atomic-long.h>
160
161#endif /* __KERNEL__ */ 196#endif /* __KERNEL__ */
162#endif /* __ASM_GENERIC_ATOMIC_H */ 197#endif /* __ASM_GENERIC_ATOMIC_H */
diff --git a/include/asm-generic/bitops/ext2-atomic-setbit.h b/include/asm-generic/bitops/ext2-atomic-setbit.h
new file mode 100644
index 000000000000..5a0997857b34
--- /dev/null
+++ b/include/asm-generic/bitops/ext2-atomic-setbit.h
@@ -0,0 +1,11 @@
1#ifndef _ASM_GENERIC_BITOPS_EXT2_ATOMIC_SETBIT_H_
2#define _ASM_GENERIC_BITOPS_EXT2_ATOMIC_SETBIT_H_
3
4/*
5 * Atomic bitops based version of ext2 atomic bitops
6 */
7
8#define ext2_set_bit_atomic(l, nr, addr) test_and_set_bit_le(nr, addr)
9#define ext2_clear_bit_atomic(l, nr, addr) test_and_clear_bit_le(nr, addr)
10
11#endif /* _ASM_GENERIC_BITOPS_EXT2_ATOMIC_SETBIT_H_ */
diff --git a/include/asm-generic/bitops/ext2-atomic.h b/include/asm-generic/bitops/ext2-atomic.h
index ecf1c9d8a7cc..87f0f109d7f1 100644
--- a/include/asm-generic/bitops/ext2-atomic.h
+++ b/include/asm-generic/bitops/ext2-atomic.h
@@ -1,6 +1,10 @@
1#ifndef _ASM_GENERIC_BITOPS_EXT2_ATOMIC_H_ 1#ifndef _ASM_GENERIC_BITOPS_EXT2_ATOMIC_H_
2#define _ASM_GENERIC_BITOPS_EXT2_ATOMIC_H_ 2#define _ASM_GENERIC_BITOPS_EXT2_ATOMIC_H_
3 3
4/*
5 * Spinlock based version of ext2 atomic bitops
6 */
7
4#define ext2_set_bit_atomic(lock, nr, addr) \ 8#define ext2_set_bit_atomic(lock, nr, addr) \
5 ({ \ 9 ({ \
6 int ret; \ 10 int ret; \
diff --git a/include/asm-generic/delay.h b/include/asm-generic/delay.h
index 4586fec75ddb..0f79054ce7cd 100644
--- a/include/asm-generic/delay.h
+++ b/include/asm-generic/delay.h
@@ -1,9 +1,44 @@
1#ifndef __ASM_GENERIC_DELAY_H 1#ifndef __ASM_GENERIC_DELAY_H
2#define __ASM_GENERIC_DELAY_H 2#define __ASM_GENERIC_DELAY_H
3 3
4/* Undefined functions to get compile-time errors */
5extern void __bad_udelay(void);
6extern void __bad_ndelay(void);
7
4extern void __udelay(unsigned long usecs); 8extern void __udelay(unsigned long usecs);
9extern void __ndelay(unsigned long nsecs);
10extern void __const_udelay(unsigned long xloops);
5extern void __delay(unsigned long loops); 11extern void __delay(unsigned long loops);
6 12
7#define udelay(n) __udelay(n) 13/*
14 * The weird n/20000 thing suppresses a "comparison is always false due to
15 * limited range of data type" warning with non-const 8-bit arguments.
16 */
17
18/* 0x10c7 is 2**32 / 1000000 (rounded up) */
19#define udelay(n) \
20 ({ \
21 if (__builtin_constant_p(n)) { \
22 if ((n) / 20000 >= 1) \
23 __bad_udelay(); \
24 else \
25 __const_udelay((n) * 0x10c7ul); \
26 } else { \
27 __udelay(n); \
28 } \
29 })
30
31/* 0x5 is 2**32 / 1000000000 (rounded up) */
32#define ndelay(n) \
33 ({ \
34 if (__builtin_constant_p(n)) { \
35 if ((n) / 20000 >= 1) \
36 __bad_ndelay(); \
37 else \
38 __const_udelay((n) * 5ul); \
39 } else { \
40 __ndelay(n); \
41 } \
42 })
8 43
9#endif /* __ASM_GENERIC_DELAY_H */ 44#endif /* __ASM_GENERIC_DELAY_H */
diff --git a/include/asm-generic/gpio.h b/include/asm-generic/gpio.h
index fcdcb5d5c995..d494001b1226 100644
--- a/include/asm-generic/gpio.h
+++ b/include/asm-generic/gpio.h
@@ -170,16 +170,6 @@ extern int __gpio_cansleep(unsigned gpio);
170 170
171extern int __gpio_to_irq(unsigned gpio); 171extern int __gpio_to_irq(unsigned gpio);
172 172
173#define GPIOF_DIR_OUT (0 << 0)
174#define GPIOF_DIR_IN (1 << 0)
175
176#define GPIOF_INIT_LOW (0 << 1)
177#define GPIOF_INIT_HIGH (1 << 1)
178
179#define GPIOF_IN (GPIOF_DIR_IN)
180#define GPIOF_OUT_INIT_LOW (GPIOF_DIR_OUT | GPIOF_INIT_LOW)
181#define GPIOF_OUT_INIT_HIGH (GPIOF_DIR_OUT | GPIOF_INIT_HIGH)
182
183/** 173/**
184 * struct gpio - a structure describing a GPIO with configuration 174 * struct gpio - a structure describing a GPIO with configuration
185 * @gpio: the GPIO number 175 * @gpio: the GPIO number
diff --git a/include/asm-generic/io.h b/include/asm-generic/io.h
index e0ffa3ddb02a..912088773a69 100644
--- a/include/asm-generic/io.h
+++ b/include/asm-generic/io.h
@@ -307,7 +307,11 @@ static inline void *phys_to_virt(unsigned long address)
307 307
308/* 308/*
309 * Change "struct page" to physical address. 309 * Change "struct page" to physical address.
310 *
311 * This implementation is for the no-MMU case only... if you have an MMU
312 * you'll need to provide your own definitions.
310 */ 313 */
314#ifndef CONFIG_MMU
311static inline void __iomem *ioremap(phys_addr_t offset, unsigned long size) 315static inline void __iomem *ioremap(phys_addr_t offset, unsigned long size)
312{ 316{
313 return (void __iomem*) (unsigned long)offset; 317 return (void __iomem*) (unsigned long)offset;
@@ -326,7 +330,9 @@ static inline void __iomem *ioremap(phys_addr_t offset, unsigned long size)
326static inline void iounmap(void *addr) 330static inline void iounmap(void *addr)
327{ 331{
328} 332}
333#endif /* CONFIG_MMU */
329 334
335#ifdef CONFIG_HAS_IOPORT
330#ifndef CONFIG_GENERIC_IOMAP 336#ifndef CONFIG_GENERIC_IOMAP
331static inline void __iomem *ioport_map(unsigned long port, unsigned int nr) 337static inline void __iomem *ioport_map(unsigned long port, unsigned int nr)
332{ 338{
@@ -340,9 +346,10 @@ static inline void ioport_unmap(void __iomem *p)
340extern void __iomem *ioport_map(unsigned long port, unsigned int nr); 346extern void __iomem *ioport_map(unsigned long port, unsigned int nr);
341extern void ioport_unmap(void __iomem *p); 347extern void ioport_unmap(void __iomem *p);
342#endif /* CONFIG_GENERIC_IOMAP */ 348#endif /* CONFIG_GENERIC_IOMAP */
349#endif /* CONFIG_HAS_IOPORT */
343 350
344#define xlate_dev_kmem_ptr(p) p 351#define xlate_dev_kmem_ptr(p) p
345#define xlate_dev_mem_ptr(p) ((void *) (p)) 352#define xlate_dev_mem_ptr(p) __va(p)
346 353
347#ifndef virt_to_bus 354#ifndef virt_to_bus
348static inline unsigned long virt_to_bus(volatile void *address) 355static inline unsigned long virt_to_bus(volatile void *address)
diff --git a/include/asm-generic/iomap.h b/include/asm-generic/iomap.h
index 76b0cc5637f8..98dcd76ce836 100644
--- a/include/asm-generic/iomap.h
+++ b/include/asm-generic/iomap.h
@@ -56,17 +56,29 @@ extern void iowrite8_rep(void __iomem *port, const void *buf, unsigned long coun
56extern void iowrite16_rep(void __iomem *port, const void *buf, unsigned long count); 56extern void iowrite16_rep(void __iomem *port, const void *buf, unsigned long count);
57extern void iowrite32_rep(void __iomem *port, const void *buf, unsigned long count); 57extern void iowrite32_rep(void __iomem *port, const void *buf, unsigned long count);
58 58
59#ifdef CONFIG_HAS_IOPORT
59/* Create a virtual mapping cookie for an IO port range */ 60/* Create a virtual mapping cookie for an IO port range */
60extern void __iomem *ioport_map(unsigned long port, unsigned int nr); 61extern void __iomem *ioport_map(unsigned long port, unsigned int nr);
61extern void ioport_unmap(void __iomem *); 62extern void ioport_unmap(void __iomem *);
63#endif
62 64
63#ifndef ARCH_HAS_IOREMAP_WC 65#ifndef ARCH_HAS_IOREMAP_WC
64#define ioremap_wc ioremap_nocache 66#define ioremap_wc ioremap_nocache
65#endif 67#endif
66 68
69#ifdef CONFIG_PCI
67/* Create a virtual mapping cookie for a PCI BAR (memory or IO) */ 70/* Create a virtual mapping cookie for a PCI BAR (memory or IO) */
68struct pci_dev; 71struct pci_dev;
69extern void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long max); 72extern void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long max);
70extern void pci_iounmap(struct pci_dev *dev, void __iomem *); 73extern void pci_iounmap(struct pci_dev *dev, void __iomem *);
74#else
75struct pci_dev;
76static inline void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long max)
77{
78 return NULL;
79}
80static inline void pci_iounmap(struct pci_dev *dev, void __iomem *addr)
81{ }
82#endif
71 83
72#endif 84#endif
diff --git a/include/asm-generic/local.h b/include/asm-generic/local.h
index c8a5d68541d7..9ceb03b4f466 100644
--- a/include/asm-generic/local.h
+++ b/include/asm-generic/local.h
@@ -2,7 +2,7 @@
2#define _ASM_GENERIC_LOCAL_H 2#define _ASM_GENERIC_LOCAL_H
3 3
4#include <linux/percpu.h> 4#include <linux/percpu.h>
5#include <asm/atomic.h> 5#include <linux/atomic.h>
6#include <asm/types.h> 6#include <asm/types.h>
7 7
8/* 8/*
diff --git a/include/asm-generic/local64.h b/include/asm-generic/local64.h
index 02ac760c1a8b..5980002b8b7b 100644
--- a/include/asm-generic/local64.h
+++ b/include/asm-generic/local64.h
@@ -55,7 +55,7 @@ typedef struct {
55 55
56#else /* BITS_PER_LONG != 64 */ 56#else /* BITS_PER_LONG != 64 */
57 57
58#include <asm/atomic.h> 58#include <linux/atomic.h>
59 59
60/* Don't use typedef: don't want them to be mixed with atomic_t's. */ 60/* Don't use typedef: don't want them to be mixed with atomic_t's. */
61typedef struct { 61typedef struct {
diff --git a/include/asm-generic/pci-bridge.h b/include/asm-generic/pci-bridge.h
new file mode 100644
index 000000000000..4a5aca2a2c94
--- /dev/null
+++ b/include/asm-generic/pci-bridge.h
@@ -0,0 +1,62 @@
1/*
2 * This program is free software; you can redistribute it and/or
3 * modify it under the terms of the GNU General Public License
4 * as published by the Free Software Foundation; either version
5 * 2 of the License, or (at your option) any later version.
6 */
7#ifndef _ASM_GENERIC_PCI_BRIDGE_H
8#define _ASM_GENERIC_PCI_BRIDGE_H
9
10#ifdef __KERNEL__
11
12enum {
13 /* Force re-assigning all resources (ignore firmware
14 * setup completely)
15 */
16 PCI_REASSIGN_ALL_RSRC = 0x00000001,
17
18 /* Re-assign all bus numbers */
19 PCI_REASSIGN_ALL_BUS = 0x00000002,
20
21 /* Do not try to assign, just use existing setup */
22 PCI_PROBE_ONLY = 0x00000004,
23
24 /* Don't bother with ISA alignment unless the bridge has
25 * ISA forwarding enabled
26 */
27 PCI_CAN_SKIP_ISA_ALIGN = 0x00000008,
28
29 /* Enable domain numbers in /proc */
30 PCI_ENABLE_PROC_DOMAINS = 0x00000010,
31 /* ... except for domain 0 */
32 PCI_COMPAT_DOMAIN_0 = 0x00000020,
33};
34
35#ifdef CONFIG_PCI
36extern unsigned int pci_flags;
37
38static inline void pci_set_flags(int flags)
39{
40 pci_flags = flags;
41}
42
43static inline void pci_add_flags(int flags)
44{
45 pci_flags |= flags;
46}
47
48static inline int pci_has_flag(int flag)
49{
50 return pci_flags & flag;
51}
52#else
53static inline void pci_set_flags(int flags) { }
54static inline void pci_add_flags(int flags) { }
55static inline int pci_has_flag(int flag)
56{
57 return 0;
58}
59#endif /* CONFIG_PCI */
60
61#endif /* __KERNEL__ */
62#endif /* _ASM_GENERIC_PCI_BRIDGE_H */
diff --git a/include/asm-generic/pgtable.h b/include/asm-generic/pgtable.h
index e9b8e5926bef..76bff2bff15e 100644
--- a/include/asm-generic/pgtable.h
+++ b/include/asm-generic/pgtable.h
@@ -88,7 +88,7 @@ static inline pmd_t pmdp_get_and_clear(struct mm_struct *mm,
88 pmd_t pmd = *pmdp; 88 pmd_t pmd = *pmdp;
89 pmd_clear(mm, address, pmdp); 89 pmd_clear(mm, address, pmdp);
90 return pmd; 90 return pmd;
91}) 91}
92#endif /* CONFIG_TRANSPARENT_HUGEPAGE */ 92#endif /* CONFIG_TRANSPARENT_HUGEPAGE */
93#endif 93#endif
94 94
diff --git a/include/asm-generic/system.h b/include/asm-generic/system.h
index 4b0b9cbbfae5..215efa74f5a2 100644
--- a/include/asm-generic/system.h
+++ b/include/asm-generic/system.h
@@ -14,7 +14,6 @@
14#ifndef __ASM_GENERIC_SYSTEM_H 14#ifndef __ASM_GENERIC_SYSTEM_H
15#define __ASM_GENERIC_SYSTEM_H 15#define __ASM_GENERIC_SYSTEM_H
16 16
17#ifdef __KERNEL__
18#ifndef __ASSEMBLY__ 17#ifndef __ASSEMBLY__
19 18
20#include <linux/types.h> 19#include <linux/types.h>
@@ -139,5 +138,4 @@ unsigned long __xchg(unsigned long x, volatile void *ptr, int size)
139 138
140#endif /* !__ASSEMBLY__ */ 139#endif /* !__ASSEMBLY__ */
141 140
142#endif /* __KERNEL__ */
143#endif /* __ASM_GENERIC_SYSTEM_H */ 141#endif /* __ASM_GENERIC_SYSTEM_H */
diff --git a/include/asm-generic/unistd.h b/include/asm-generic/unistd.h
index ae90e0f63995..4f76959397fa 100644
--- a/include/asm-generic/unistd.h
+++ b/include/asm-generic/unistd.h
@@ -683,9 +683,11 @@ __SC_COMP(__NR_clock_adjtime, sys_clock_adjtime, compat_sys_clock_adjtime)
683__SYSCALL(__NR_syncfs, sys_syncfs) 683__SYSCALL(__NR_syncfs, sys_syncfs)
684#define __NR_setns 268 684#define __NR_setns 268
685__SYSCALL(__NR_setns, sys_setns) 685__SYSCALL(__NR_setns, sys_setns)
686#define __NR_sendmmsg 269
687__SC_COMP(__NR_sendmmsg, sys_sendmmsg, compat_sys_sendmmsg)
686 688
687#undef __NR_syscalls 689#undef __NR_syscalls
688#define __NR_syscalls 269 690#define __NR_syscalls 270
689 691
690/* 692/*
691 * All syscalls below here should go away really, 693 * All syscalls below here should go away really,
diff --git a/include/crypto/if_alg.h b/include/crypto/if_alg.h
index c5813c87de06..d61c11170213 100644
--- a/include/crypto/if_alg.h
+++ b/include/crypto/if_alg.h
@@ -16,6 +16,7 @@
16#include <linux/compiler.h> 16#include <linux/compiler.h>
17#include <linux/completion.h> 17#include <linux/completion.h>
18#include <linux/if_alg.h> 18#include <linux/if_alg.h>
19#include <linux/scatterlist.h>
19#include <linux/types.h> 20#include <linux/types.h>
20#include <net/sock.h> 21#include <net/sock.h>
21 22
diff --git a/include/drm/drmP.h b/include/drm/drmP.h
index 738b3a5faa12..9b7c2bb4bb44 100644
--- a/include/drm/drmP.h
+++ b/include/drm/drmP.h
@@ -886,6 +886,8 @@ struct drm_driver {
886 */ 886 */
887 int (*gem_init_object) (struct drm_gem_object *obj); 887 int (*gem_init_object) (struct drm_gem_object *obj);
888 void (*gem_free_object) (struct drm_gem_object *obj); 888 void (*gem_free_object) (struct drm_gem_object *obj);
889 int (*gem_open_object) (struct drm_gem_object *, struct drm_file *);
890 void (*gem_close_object) (struct drm_gem_object *, struct drm_file *);
889 891
890 /* vga arb irq handler */ 892 /* vga arb irq handler */
891 void (*vgaarb_irq)(struct drm_device *dev, bool state); 893 void (*vgaarb_irq)(struct drm_device *dev, bool state);
@@ -1539,6 +1541,8 @@ struct drm_gem_object *drm_gem_object_alloc(struct drm_device *dev,
1539 size_t size); 1541 size_t size);
1540int drm_gem_object_init(struct drm_device *dev, 1542int drm_gem_object_init(struct drm_device *dev,
1541 struct drm_gem_object *obj, size_t size); 1543 struct drm_gem_object *obj, size_t size);
1544int drm_gem_private_object_init(struct drm_device *dev,
1545 struct drm_gem_object *obj, size_t size);
1542void drm_gem_object_handle_free(struct drm_gem_object *obj); 1546void drm_gem_object_handle_free(struct drm_gem_object *obj);
1543void drm_gem_vm_open(struct vm_area_struct *vma); 1547void drm_gem_vm_open(struct vm_area_struct *vma);
1544void drm_gem_vm_close(struct vm_area_struct *vma); 1548void drm_gem_vm_close(struct vm_area_struct *vma);
@@ -1672,13 +1676,6 @@ static __inline__ int drm_pci_device_is_agp(struct drm_device *dev)
1672 return pci_find_capability(dev->pdev, PCI_CAP_ID_AGP); 1676 return pci_find_capability(dev->pdev, PCI_CAP_ID_AGP);
1673} 1677}
1674 1678
1675
1676static __inline__ int drm_pci_device_is_pcie(struct drm_device *dev)
1677{
1678 return pci_find_capability(dev->pdev, PCI_CAP_ID_EXP);
1679}
1680
1681
1682extern int drm_pci_init(struct drm_driver *driver, struct pci_driver *pdriver); 1679extern int drm_pci_init(struct drm_driver *driver, struct pci_driver *pdriver);
1683extern void drm_pci_exit(struct drm_driver *driver, struct pci_driver *pdriver); 1680extern void drm_pci_exit(struct drm_driver *driver, struct pci_driver *pdriver);
1684extern int drm_get_pci_dev(struct pci_dev *pdev, 1681extern int drm_get_pci_dev(struct pci_dev *pdev,
diff --git a/include/drm/drm_crtc.h b/include/drm/drm_crtc.h
index 9573e0ce3120..44335e57eaaa 100644
--- a/include/drm/drm_crtc.h
+++ b/include/drm/drm_crtc.h
@@ -205,6 +205,8 @@ struct drm_display_info {
205 enum subpixel_order subpixel_order; 205 enum subpixel_order subpixel_order;
206 u32 color_formats; 206 u32 color_formats;
207 207
208 u8 cea_rev;
209
208 char *raw_edid; /* if any */ 210 char *raw_edid; /* if any */
209}; 211};
210 212
@@ -520,6 +522,8 @@ struct drm_connector {
520 uint32_t encoder_ids[DRM_CONNECTOR_MAX_ENCODER]; 522 uint32_t encoder_ids[DRM_CONNECTOR_MAX_ENCODER];
521 uint32_t force_encoder_id; 523 uint32_t force_encoder_id;
522 struct drm_encoder *encoder; /* currently active encoder */ 524 struct drm_encoder *encoder; /* currently active encoder */
525
526 int null_edid_counter; /* needed to workaround some HW bugs where we get all 0s */
523}; 527};
524 528
525/** 529/**
@@ -800,6 +804,7 @@ extern struct drm_display_mode *drm_gtf_mode_complex(struct drm_device *dev,
800extern int drm_add_modes_noedid(struct drm_connector *connector, 804extern int drm_add_modes_noedid(struct drm_connector *connector,
801 int hdisplay, int vdisplay); 805 int hdisplay, int vdisplay);
802 806
807extern int drm_edid_header_is_valid(const u8 *raw_edid);
803extern bool drm_edid_is_valid(struct edid *edid); 808extern bool drm_edid_is_valid(struct edid *edid);
804struct drm_display_mode *drm_mode_find_dmt(struct drm_device *dev, 809struct drm_display_mode *drm_mode_find_dmt(struct drm_device *dev,
805 int hsize, int vsize, int fresh); 810 int hsize, int vsize, int fresh);
diff --git a/include/drm/drm_pciids.h b/include/drm/drm_pciids.h
index f04b2a3b0f49..3d53efd25ab9 100644
--- a/include/drm/drm_pciids.h
+++ b/include/drm/drm_pciids.h
@@ -182,6 +182,7 @@
182 {0x1002, 0x6750, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_TURKS|RADEON_NEW_MEMMAP}, \ 182 {0x1002, 0x6750, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_TURKS|RADEON_NEW_MEMMAP}, \
183 {0x1002, 0x6758, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_TURKS|RADEON_NEW_MEMMAP}, \ 183 {0x1002, 0x6758, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_TURKS|RADEON_NEW_MEMMAP}, \
184 {0x1002, 0x6759, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_TURKS|RADEON_NEW_MEMMAP}, \ 184 {0x1002, 0x6759, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_TURKS|RADEON_NEW_MEMMAP}, \
185 {0x1002, 0x675F, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_TURKS|RADEON_NEW_MEMMAP}, \
185 {0x1002, 0x6760, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_CAICOS|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \ 186 {0x1002, 0x6760, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_CAICOS|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \
186 {0x1002, 0x6761, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_CAICOS|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \ 187 {0x1002, 0x6761, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_CAICOS|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \
187 {0x1002, 0x6762, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_CAICOS|RADEON_NEW_MEMMAP}, \ 188 {0x1002, 0x6762, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_CAICOS|RADEON_NEW_MEMMAP}, \
@@ -192,6 +193,7 @@
192 {0x1002, 0x6767, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_CAICOS|RADEON_NEW_MEMMAP}, \ 193 {0x1002, 0x6767, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_CAICOS|RADEON_NEW_MEMMAP}, \
193 {0x1002, 0x6768, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_CAICOS|RADEON_NEW_MEMMAP}, \ 194 {0x1002, 0x6768, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_CAICOS|RADEON_NEW_MEMMAP}, \
194 {0x1002, 0x6770, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_CAICOS|RADEON_NEW_MEMMAP}, \ 195 {0x1002, 0x6770, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_CAICOS|RADEON_NEW_MEMMAP}, \
196 {0x1002, 0x6778, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_CAICOS|RADEON_NEW_MEMMAP}, \
195 {0x1002, 0x6779, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_CAICOS|RADEON_NEW_MEMMAP}, \ 197 {0x1002, 0x6779, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_CAICOS|RADEON_NEW_MEMMAP}, \
196 {0x1002, 0x6880, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_CYPRESS|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \ 198 {0x1002, 0x6880, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_CYPRESS|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \
197 {0x1002, 0x6888, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_CYPRESS|RADEON_NEW_MEMMAP}, \ 199 {0x1002, 0x6888, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_CYPRESS|RADEON_NEW_MEMMAP}, \
@@ -467,6 +469,17 @@
467 {0x1002, 0x9614, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RS780|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \ 469 {0x1002, 0x9614, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RS780|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \
468 {0x1002, 0x9615, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RS780|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \ 470 {0x1002, 0x9615, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RS780|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \
469 {0x1002, 0x9616, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RS780|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \ 471 {0x1002, 0x9616, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RS780|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \
472 {0x1002, 0x9640, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_SUMO|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \
473 {0x1002, 0x9641, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_SUMO|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \
474 {0x1002, 0x9642, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_SUMO2|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \
475 {0x1002, 0x9643, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_SUMO2|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \
476 {0x1002, 0x9644, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_SUMO2|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \
477 {0x1002, 0x9645, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_SUMO2|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \
478 {0x1002, 0x9647, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_SUMO|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP|RADEON_IS_IGP},\
479 {0x1002, 0x9648, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_SUMO|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP|RADEON_IS_IGP},\
480 {0x1002, 0x964a, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_SUMO|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \
481 {0x1002, 0x964e, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_SUMO|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP|RADEON_IS_IGP},\
482 {0x1002, 0x964f, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_SUMO|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP|RADEON_IS_IGP},\
470 {0x1002, 0x9710, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RS880|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \ 483 {0x1002, 0x9710, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RS880|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \
471 {0x1002, 0x9711, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RS880|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \ 484 {0x1002, 0x9711, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RS880|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \
472 {0x1002, 0x9712, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RS880|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \ 485 {0x1002, 0x9712, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RS880|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \
diff --git a/include/drm/i915_drm.h b/include/drm/i915_drm.h
index c4d6dbfa3ff4..28c0d114cb52 100644
--- a/include/drm/i915_drm.h
+++ b/include/drm/i915_drm.h
@@ -237,7 +237,7 @@ typedef struct _drm_i915_sarea {
237#define DRM_IOCTL_I915_GEM_GET_APERTURE DRM_IOR (DRM_COMMAND_BASE + DRM_I915_GEM_GET_APERTURE, struct drm_i915_gem_get_aperture) 237#define DRM_IOCTL_I915_GEM_GET_APERTURE DRM_IOR (DRM_COMMAND_BASE + DRM_I915_GEM_GET_APERTURE, struct drm_i915_gem_get_aperture)
238#define DRM_IOCTL_I915_GET_PIPE_FROM_CRTC_ID DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_GET_PIPE_FROM_CRTC_ID, struct drm_i915_get_pipe_from_crtc_id) 238#define DRM_IOCTL_I915_GET_PIPE_FROM_CRTC_ID DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_GET_PIPE_FROM_CRTC_ID, struct drm_i915_get_pipe_from_crtc_id)
239#define DRM_IOCTL_I915_GEM_MADVISE DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_GEM_MADVISE, struct drm_i915_gem_madvise) 239#define DRM_IOCTL_I915_GEM_MADVISE DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_GEM_MADVISE, struct drm_i915_gem_madvise)
240#define DRM_IOCTL_I915_OVERLAY_PUT_IMAGE DRM_IOW(DRM_COMMAND_BASE + DRM_IOCTL_I915_OVERLAY_ATTRS, struct drm_intel_overlay_put_image) 240#define DRM_IOCTL_I915_OVERLAY_PUT_IMAGE DRM_IOW(DRM_COMMAND_BASE + DRM_I915_OVERLAY_PUT_IMAGE, struct drm_intel_overlay_put_image)
241#define DRM_IOCTL_I915_OVERLAY_ATTRS DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_OVERLAY_ATTRS, struct drm_intel_overlay_attrs) 241#define DRM_IOCTL_I915_OVERLAY_ATTRS DRM_IOWR(DRM_COMMAND_BASE + DRM_I915_OVERLAY_ATTRS, struct drm_intel_overlay_attrs)
242 242
243/* Allow drivers to submit batchbuffers directly to hardware, relying 243/* Allow drivers to submit batchbuffers directly to hardware, relying
diff --git a/include/drm/radeon_drm.h b/include/drm/radeon_drm.h
index 787f7b6fd622..b65be6054a18 100644
--- a/include/drm/radeon_drm.h
+++ b/include/drm/radeon_drm.h
@@ -911,6 +911,7 @@ struct drm_radeon_cs {
911#define RADEON_INFO_NUM_BACKENDS 0x0a /* DB/backends for r600+ - need for OQ */ 911#define RADEON_INFO_NUM_BACKENDS 0x0a /* DB/backends for r600+ - need for OQ */
912#define RADEON_INFO_NUM_TILE_PIPES 0x0b /* tile pipes for r600+ */ 912#define RADEON_INFO_NUM_TILE_PIPES 0x0b /* tile pipes for r600+ */
913#define RADEON_INFO_FUSION_GART_WORKING 0x0c /* fusion writes to GTT were broken before this */ 913#define RADEON_INFO_FUSION_GART_WORKING 0x0c /* fusion writes to GTT were broken before this */
914#define RADEON_INFO_BACKEND_MAP 0x0d /* pipe to backend map, needed by mesa */
914 915
915struct drm_radeon_info { 916struct drm_radeon_info {
916 uint32_t request; 917 uint32_t request;
diff --git a/include/drm/ttm/ttm_bo_api.h b/include/drm/ttm/ttm_bo_api.h
index 62a0e4c4ceee..42e346985186 100644
--- a/include/drm/ttm/ttm_bo_api.h
+++ b/include/drm/ttm/ttm_bo_api.h
@@ -662,9 +662,6 @@ extern int ttm_bo_kmap(struct ttm_buffer_object *bo, unsigned long start_page,
662 662
663extern void ttm_bo_kunmap(struct ttm_bo_kmap_obj *map); 663extern void ttm_bo_kunmap(struct ttm_bo_kmap_obj *map);
664 664
665#if 0
666#endif
667
668/** 665/**
669 * ttm_fbdev_mmap - mmap fbdev memory backed by a ttm buffer object. 666 * ttm_fbdev_mmap - mmap fbdev memory backed by a ttm buffer object.
670 * 667 *
diff --git a/include/drm/ttm/ttm_bo_driver.h b/include/drm/ttm/ttm_bo_driver.h
index 09af2d746d1c..94eb1434316e 100644
--- a/include/drm/ttm/ttm_bo_driver.h
+++ b/include/drm/ttm/ttm_bo_driver.h
@@ -78,7 +78,7 @@ struct ttm_backend_func {
78 * 78 *
79 * Bind the backend pages into the aperture in the location 79 * Bind the backend pages into the aperture in the location
80 * indicated by @bo_mem. This function should be able to handle 80 * indicated by @bo_mem. This function should be able to handle
81 * differences between aperture- and system page sizes. 81 * differences between aperture and system page sizes.
82 */ 82 */
83 int (*bind) (struct ttm_backend *backend, struct ttm_mem_reg *bo_mem); 83 int (*bind) (struct ttm_backend *backend, struct ttm_mem_reg *bo_mem);
84 84
@@ -88,7 +88,7 @@ struct ttm_backend_func {
88 * @backend: Pointer to a struct ttm_backend. 88 * @backend: Pointer to a struct ttm_backend.
89 * 89 *
90 * Unbind previously bound backend pages. This function should be 90 * Unbind previously bound backend pages. This function should be
91 * able to handle differences between aperture- and system page sizes. 91 * able to handle differences between aperture and system page sizes.
92 */ 92 */
93 int (*unbind) (struct ttm_backend *backend); 93 int (*unbind) (struct ttm_backend *backend);
94 94
@@ -786,7 +786,7 @@ extern int ttm_bo_device_release(struct ttm_bo_device *bdev);
786 * ttm_bo_device_init 786 * ttm_bo_device_init
787 * 787 *
788 * @bdev: A pointer to a struct ttm_bo_device to initialize. 788 * @bdev: A pointer to a struct ttm_bo_device to initialize.
789 * @mem_global: A pointer to an initialized struct ttm_mem_global. 789 * @glob: A pointer to an initialized struct ttm_bo_global.
790 * @driver: A pointer to a struct ttm_bo_driver set up by the caller. 790 * @driver: A pointer to a struct ttm_bo_driver set up by the caller.
791 * @file_page_offset: Offset into the device address space that is available 791 * @file_page_offset: Offset into the device address space that is available
792 * for buffer data. This ensures compatibility with other users of the 792 * for buffer data. This ensures compatibility with other users of the
diff --git a/include/drm/ttm/ttm_lock.h b/include/drm/ttm/ttm_lock.h
index 81ba0b0b891a..2e7f0c941b5d 100644
--- a/include/drm/ttm/ttm_lock.h
+++ b/include/drm/ttm/ttm_lock.h
@@ -51,7 +51,7 @@
51 51
52#include "ttm/ttm_object.h" 52#include "ttm/ttm_object.h"
53#include <linux/wait.h> 53#include <linux/wait.h>
54#include <asm/atomic.h> 54#include <linux/atomic.h>
55 55
56/** 56/**
57 * struct ttm_lock 57 * struct ttm_lock
diff --git a/include/drm/ttm/ttm_memory.h b/include/drm/ttm/ttm_memory.h
index b199170b3c2c..26c1f78d136f 100644
--- a/include/drm/ttm/ttm_memory.h
+++ b/include/drm/ttm/ttm_memory.h
@@ -41,7 +41,7 @@
41 * @do_shrink: The callback function. 41 * @do_shrink: The callback function.
42 * 42 *
43 * Arguments to the do_shrink functions are intended to be passed using 43 * Arguments to the do_shrink functions are intended to be passed using
44 * inheritance. That is, the argument class derives from struct ttm_mem_srink, 44 * inheritance. That is, the argument class derives from struct ttm_mem_shrink,
45 * and can be accessed using container_of(). 45 * and can be accessed using container_of().
46 */ 46 */
47 47
diff --git a/include/drm/ttm/ttm_object.h b/include/drm/ttm/ttm_object.h
index 0d9db099978b..e46054e5255b 100644
--- a/include/drm/ttm/ttm_object.h
+++ b/include/drm/ttm/ttm_object.h
@@ -111,7 +111,7 @@ struct ttm_object_device;
111 * 111 *
112 * @ref_obj_release: A function to be called when a reference object 112 * @ref_obj_release: A function to be called when a reference object
113 * with another ttm_ref_type than TTM_REF_USAGE is deleted. 113 * with another ttm_ref_type than TTM_REF_USAGE is deleted.
114 * this function may, for example, release a lock held by a user-space 114 * This function may, for example, release a lock held by a user-space
115 * process. 115 * process.
116 * 116 *
117 * This struct is intended to be used as a base struct for objects that 117 * This struct is intended to be used as a base struct for objects that
@@ -172,7 +172,7 @@ extern struct ttm_base_object *ttm_base_object_lookup(struct ttm_object_file
172/** 172/**
173 * ttm_base_object_unref 173 * ttm_base_object_unref
174 * 174 *
175 * @p_base: Pointer to a pointer referncing a struct ttm_base_object. 175 * @p_base: Pointer to a pointer referencing a struct ttm_base_object.
176 * 176 *
177 * Decrements the base object refcount and clears the pointer pointed to by 177 * Decrements the base object refcount and clears the pointer pointed to by
178 * p_base. 178 * p_base.
diff --git a/include/drm/ttm/ttm_page_alloc.h b/include/drm/ttm/ttm_page_alloc.h
index 8062890f725e..129de12353f1 100644
--- a/include/drm/ttm/ttm_page_alloc.h
+++ b/include/drm/ttm/ttm_page_alloc.h
@@ -32,7 +32,7 @@
32/** 32/**
33 * Get count number of pages from pool to pages list. 33 * Get count number of pages from pool to pages list.
34 * 34 *
35 * @pages: heado of empty linked list where pages are filled. 35 * @pages: head of empty linked list where pages are filled.
36 * @flags: ttm flags for page allocation. 36 * @flags: ttm flags for page allocation.
37 * @cstate: ttm caching state for the page. 37 * @cstate: ttm caching state for the page.
38 * @count: number of pages to allocate. 38 * @count: number of pages to allocate.
diff --git a/include/keys/encrypted-type.h b/include/keys/encrypted-type.h
index 95855017a32b..1d4541370a64 100644
--- a/include/keys/encrypted-type.h
+++ b/include/keys/encrypted-type.h
@@ -1,6 +1,11 @@
1/* 1/*
2 * Copyright (C) 2010 IBM Corporation 2 * Copyright (C) 2010 IBM Corporation
3 * Author: Mimi Zohar <zohar@us.ibm.com> 3 * Copyright (C) 2010 Politecnico di Torino, Italy
4 * TORSEC group -- http://security.polito.it
5 *
6 * Authors:
7 * Mimi Zohar <zohar@us.ibm.com>
8 * Roberto Sassu <roberto.sassu@polito.it>
4 * 9 *
5 * This program is free software; you can redistribute it and/or modify 10 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by 11 * it under the terms of the GNU General Public License as published by
@@ -15,13 +20,17 @@
15 20
16struct encrypted_key_payload { 21struct encrypted_key_payload {
17 struct rcu_head rcu; 22 struct rcu_head rcu;
23 char *format; /* datablob: format */
18 char *master_desc; /* datablob: master key name */ 24 char *master_desc; /* datablob: master key name */
19 char *datalen; /* datablob: decrypted key length */ 25 char *datalen; /* datablob: decrypted key length */
20 u8 *iv; /* datablob: iv */ 26 u8 *iv; /* datablob: iv */
21 u8 *encrypted_data; /* datablob: encrypted data */ 27 u8 *encrypted_data; /* datablob: encrypted data */
22 unsigned short datablob_len; /* length of datablob */ 28 unsigned short datablob_len; /* length of datablob */
23 unsigned short decrypted_datalen; /* decrypted data length */ 29 unsigned short decrypted_datalen; /* decrypted data length */
24 u8 decrypted_data[0]; /* decrypted data + datablob + hmac */ 30 unsigned short payload_datalen; /* payload data length */
31 unsigned short encrypted_key_format; /* encrypted key format */
32 u8 *decrypted_data; /* decrypted data */
33 u8 payload_data[0]; /* payload data + datablob + hmac */
25}; 34};
26 35
27extern struct key_type key_type_encrypted; 36extern struct key_type key_type_encrypted;
diff --git a/include/linux/Kbuild b/include/linux/Kbuild
index 01f636275057..619b5657af77 100644
--- a/include/linux/Kbuild
+++ b/include/linux/Kbuild
@@ -135,6 +135,7 @@ header-y += firewire-cdev.h
135header-y += firewire-constants.h 135header-y += firewire-constants.h
136header-y += flat.h 136header-y += flat.h
137header-y += fs.h 137header-y += fs.h
138header-y += fsl_hypervisor.h
138header-y += fuse.h 139header-y += fuse.h
139header-y += futex.h 140header-y += futex.h
140header-y += gameport.h 141header-y += gameport.h
diff --git a/include/linux/acpi.h b/include/linux/acpi.h
index 1deb2a73c2da..6001b4da39dd 100644
--- a/include/linux/acpi.h
+++ b/include/linux/acpi.h
@@ -238,7 +238,6 @@ extern int acpi_paddr_to_node(u64 start_addr, u64 size);
238extern int pnpacpi_disabled; 238extern int pnpacpi_disabled;
239 239
240#define PXM_INVAL (-1) 240#define PXM_INVAL (-1)
241#define NID_INVAL (-1)
242 241
243int acpi_check_resource_conflict(const struct resource *res); 242int acpi_check_resource_conflict(const struct resource *res);
244 243
@@ -280,6 +279,8 @@ acpi_status acpi_run_osc(acpi_handle handle, struct acpi_osc_context *context);
280#define OSC_SB_CPUHP_OST_SUPPORT 8 279#define OSC_SB_CPUHP_OST_SUPPORT 8
281#define OSC_SB_APEI_SUPPORT 16 280#define OSC_SB_APEI_SUPPORT 16
282 281
282extern bool osc_sb_apei_support_acked;
283
283/* PCI defined _OSC bits */ 284/* PCI defined _OSC bits */
284/* _OSC DW1 Definition (OS Support Fields) */ 285/* _OSC DW1 Definition (OS Support Fields) */
285#define OSC_EXT_PCI_CONFIG_SUPPORT 1 286#define OSC_EXT_PCI_CONFIG_SUPPORT 1
diff --git a/include/linux/aer.h b/include/linux/aer.h
index 8414de22a779..544abdb2238c 100644
--- a/include/linux/aer.h
+++ b/include/linux/aer.h
@@ -51,5 +51,8 @@ static inline int pci_cleanup_aer_uncorrect_error_status(struct pci_dev *dev)
51 51
52extern void cper_print_aer(const char *prefix, int cper_severity, 52extern void cper_print_aer(const char *prefix, int cper_severity,
53 struct aer_capability_regs *aer); 53 struct aer_capability_regs *aer);
54extern int cper_severity_to_aer(int cper_severity);
55extern void aer_recover_queue(int domain, unsigned int bus, unsigned int devfn,
56 int severity);
54#endif //_AER_H_ 57#endif //_AER_H_
55 58
diff --git a/include/linux/aio.h b/include/linux/aio.h
index 7a8db4155281..2dcb72bff4b6 100644
--- a/include/linux/aio.h
+++ b/include/linux/aio.h
@@ -7,7 +7,7 @@
7#include <linux/uio.h> 7#include <linux/uio.h>
8#include <linux/rcupdate.h> 8#include <linux/rcupdate.h>
9 9
10#include <asm/atomic.h> 10#include <linux/atomic.h>
11 11
12#define AIO_MAXSEGS 4 12#define AIO_MAXSEGS 4
13#define AIO_KIOGRP_NR_ATOMIC 8 13#define AIO_KIOGRP_NR_ATOMIC 8
diff --git a/include/linux/amba/pl08x.h b/include/linux/amba/pl08x.h
index 3111385b8ca7..e6e28f37d8ec 100644
--- a/include/linux/amba/pl08x.h
+++ b/include/linux/amba/pl08x.h
@@ -172,8 +172,11 @@ struct pl08x_dma_chan {
172 int phychan_hold; 172 int phychan_hold;
173 struct tasklet_struct tasklet; 173 struct tasklet_struct tasklet;
174 char *name; 174 char *name;
175 struct pl08x_channel_data *cd; 175 const struct pl08x_channel_data *cd;
176 dma_addr_t runtime_addr; 176 dma_addr_t src_addr;
177 dma_addr_t dst_addr;
178 u32 src_cctl;
179 u32 dst_cctl;
177 enum dma_data_direction runtime_direction; 180 enum dma_data_direction runtime_direction;
178 dma_cookie_t lc; 181 dma_cookie_t lc;
179 struct list_head pend_list; 182 struct list_head pend_list;
@@ -202,7 +205,7 @@ struct pl08x_dma_chan {
202 * @mem_buses: buses which memory can be accessed from: PL08X_AHB1 | PL08X_AHB2 205 * @mem_buses: buses which memory can be accessed from: PL08X_AHB1 | PL08X_AHB2
203 */ 206 */
204struct pl08x_platform_data { 207struct pl08x_platform_data {
205 struct pl08x_channel_data *slave_channels; 208 const struct pl08x_channel_data *slave_channels;
206 unsigned int num_slave_channels; 209 unsigned int num_slave_channels;
207 struct pl08x_channel_data memcpy_channel; 210 struct pl08x_channel_data memcpy_channel;
208 int (*get_signal)(struct pl08x_dma_chan *); 211 int (*get_signal)(struct pl08x_dma_chan *);
diff --git a/include/linux/amba/serial.h b/include/linux/amba/serial.h
index 5479fdc849e9..514ed45c462e 100644
--- a/include/linux/amba/serial.h
+++ b/include/linux/amba/serial.h
@@ -201,6 +201,9 @@ struct amba_pl011_data {
201 bool (*dma_filter)(struct dma_chan *chan, void *filter_param); 201 bool (*dma_filter)(struct dma_chan *chan, void *filter_param);
202 void *dma_rx_param; 202 void *dma_rx_param;
203 void *dma_tx_param; 203 void *dma_tx_param;
204 void (*init) (void);
205 void (*exit) (void);
206 void (*reset) (void);
204}; 207};
205#endif 208#endif
206 209
diff --git a/include/linux/amd-iommu.h b/include/linux/amd-iommu.h
new file mode 100644
index 000000000000..a6863a2dec1f
--- /dev/null
+++ b/include/linux/amd-iommu.h
@@ -0,0 +1,35 @@
1/*
2 * Copyright (C) 2007-2010 Advanced Micro Devices, Inc.
3 * Author: Joerg Roedel <joerg.roedel@amd.com>
4 * Leo Duran <leo.duran@amd.com>
5 *
6 * This program is free software; you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License version 2 as published
8 * by the Free Software Foundation.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 */
19
20#ifndef _ASM_X86_AMD_IOMMU_H
21#define _ASM_X86_AMD_IOMMU_H
22
23#include <linux/irqreturn.h>
24
25#ifdef CONFIG_AMD_IOMMU
26
27extern int amd_iommu_detect(void);
28
29#else
30
31static inline int amd_iommu_detect(void) { return -ENODEV; }
32
33#endif
34
35#endif /* _ASM_X86_AMD_IOMMU_H */
diff --git a/include/linux/anon_inodes.h b/include/linux/anon_inodes.h
index 69a21e0ebd33..8013a45242fe 100644
--- a/include/linux/anon_inodes.h
+++ b/include/linux/anon_inodes.h
@@ -8,6 +8,8 @@
8#ifndef _LINUX_ANON_INODES_H 8#ifndef _LINUX_ANON_INODES_H
9#define _LINUX_ANON_INODES_H 9#define _LINUX_ANON_INODES_H
10 10
11struct file_operations;
12
11struct file *anon_inode_getfile(const char *name, 13struct file *anon_inode_getfile(const char *name,
12 const struct file_operations *fops, 14 const struct file_operations *fops,
13 void *priv, int flags); 15 void *priv, int flags);
diff --git a/include/linux/arcdevice.h b/include/linux/arcdevice.h
index 7d650a0e3d8f..7216b0daf544 100644
--- a/include/linux/arcdevice.h
+++ b/include/linux/arcdevice.h
@@ -20,6 +20,7 @@
20#include <linux/if_arcnet.h> 20#include <linux/if_arcnet.h>
21 21
22#ifdef __KERNEL__ 22#ifdef __KERNEL__
23#include <linux/irqreturn.h>
23 24
24#ifndef bool 25#ifndef bool
25#define bool int 26#define bool int
diff --git a/include/linux/ath9k_platform.h b/include/linux/ath9k_platform.h
index 60a7c49dcb49..6e3f54f37844 100644
--- a/include/linux/ath9k_platform.h
+++ b/include/linux/ath9k_platform.h
@@ -30,6 +30,8 @@ struct ath9k_platform_data {
30 u32 gpio_val; 30 u32 gpio_val;
31 31
32 bool is_clk_25mhz; 32 bool is_clk_25mhz;
33 int (*get_mac_revision)(void);
34 int (*external_reset)(void);
33}; 35};
34 36
35#endif /* _LINUX_ATH9K_PLATFORM_H */ 37#endif /* _LINUX_ATH9K_PLATFORM_H */
diff --git a/include/linux/atmdev.h b/include/linux/atmdev.h
index 381f4cec8260..49a83ca900ba 100644
--- a/include/linux/atmdev.h
+++ b/include/linux/atmdev.h
@@ -220,7 +220,7 @@ struct atm_cirange {
220#include <linux/skbuff.h> /* struct sk_buff */ 220#include <linux/skbuff.h> /* struct sk_buff */
221#include <linux/uio.h> 221#include <linux/uio.h>
222#include <net/sock.h> 222#include <net/sock.h>
223#include <asm/atomic.h> 223#include <linux/atomic.h>
224 224
225#ifdef CONFIG_PROC_FS 225#ifdef CONFIG_PROC_FS
226#include <linux/proc_fs.h> 226#include <linux/proc_fs.h>
diff --git a/include/linux/atomic.h b/include/linux/atomic.h
index ee456c79b0e6..42b77b5446d2 100644
--- a/include/linux/atomic.h
+++ b/include/linux/atomic.h
@@ -1,8 +1,32 @@
1/* Atomic operations usable in machine independent code */
1#ifndef _LINUX_ATOMIC_H 2#ifndef _LINUX_ATOMIC_H
2#define _LINUX_ATOMIC_H 3#define _LINUX_ATOMIC_H
3#include <asm/atomic.h> 4#include <asm/atomic.h>
4 5
5/** 6/**
7 * atomic_add_unless - add unless the number is already a given value
8 * @v: pointer of type atomic_t
9 * @a: the amount to add to v...
10 * @u: ...unless v is equal to u.
11 *
12 * Atomically adds @a to @v, so long as @v was not already @u.
13 * Returns non-zero if @v was not @u, and zero otherwise.
14 */
15static inline int atomic_add_unless(atomic_t *v, int a, int u)
16{
17 return __atomic_add_unless(v, a, u) != u;
18}
19
20/**
21 * atomic_inc_not_zero - increment unless the number is zero
22 * @v: pointer of type atomic_t
23 *
24 * Atomically increments @v by 1, so long as @v is non-zero.
25 * Returns non-zero if @v was non-zero, and zero otherwise.
26 */
27#define atomic_inc_not_zero(v) atomic_add_unless((v), 1, 0)
28
29/**
6 * atomic_inc_not_zero_hint - increment if not null 30 * atomic_inc_not_zero_hint - increment if not null
7 * @v: pointer of type atomic_t 31 * @v: pointer of type atomic_t
8 * @hint: probable value of the atomic before the increment 32 * @hint: probable value of the atomic before the increment
@@ -34,6 +58,32 @@ static inline int atomic_inc_not_zero_hint(atomic_t *v, int hint)
34} 58}
35#endif 59#endif
36 60
61#ifndef atomic_inc_unless_negative
62static inline int atomic_inc_unless_negative(atomic_t *p)
63{
64 int v, v1;
65 for (v = 0; v >= 0; v = v1) {
66 v1 = atomic_cmpxchg(p, v, v + 1);
67 if (likely(v1 == v))
68 return 1;
69 }
70 return 0;
71}
72#endif
73
74#ifndef atomic_dec_unless_positive
75static inline int atomic_dec_unless_positive(atomic_t *p)
76{
77 int v, v1;
78 for (v = 0; v <= 0; v = v1) {
79 v1 = atomic_cmpxchg(p, v, v - 1);
80 if (likely(v1 == v))
81 return 1;
82 }
83 return 0;
84}
85#endif
86
37#ifndef CONFIG_ARCH_HAS_ATOMIC_OR 87#ifndef CONFIG_ARCH_HAS_ATOMIC_OR
38static inline void atomic_or(int i, atomic_t *v) 88static inline void atomic_or(int i, atomic_t *v)
39{ 89{
@@ -47,4 +97,8 @@ static inline void atomic_or(int i, atomic_t *v)
47} 97}
48#endif /* #ifndef CONFIG_ARCH_HAS_ATOMIC_OR */ 98#endif /* #ifndef CONFIG_ARCH_HAS_ATOMIC_OR */
49 99
100#include <asm-generic/atomic-long.h>
101#ifdef CONFIG_GENERIC_ATOMIC64
102#include <asm-generic/atomic64.h>
103#endif
50#endif /* _LINUX_ATOMIC_H */ 104#endif /* _LINUX_ATOMIC_H */
diff --git a/include/linux/audit.h b/include/linux/audit.h
index 9d339eb27881..0c8006129fb2 100644
--- a/include/linux/audit.h
+++ b/include/linux/audit.h
@@ -613,6 +613,12 @@ extern void audit_log_d_path(struct audit_buffer *ab,
613extern void audit_log_key(struct audit_buffer *ab, 613extern void audit_log_key(struct audit_buffer *ab,
614 char *key); 614 char *key);
615extern void audit_log_lost(const char *message); 615extern void audit_log_lost(const char *message);
616#ifdef CONFIG_SECURITY
617extern void audit_log_secctx(struct audit_buffer *ab, u32 secid);
618#else
619#define audit_log_secctx(b,s) do { ; } while (0)
620#endif
621
616extern int audit_update_lsm_rules(void); 622extern int audit_update_lsm_rules(void);
617 623
618 /* Private API (for audit.c only) */ 624 /* Private API (for audit.c only) */
@@ -635,6 +641,7 @@ extern int audit_enabled;
635#define audit_log_untrustedstring(a,s) do { ; } while (0) 641#define audit_log_untrustedstring(a,s) do { ; } while (0)
636#define audit_log_d_path(b, p, d) do { ; } while (0) 642#define audit_log_d_path(b, p, d) do { ; } while (0)
637#define audit_log_key(b, k) do { ; } while (0) 643#define audit_log_key(b, k) do { ; } while (0)
644#define audit_log_secctx(b,s) do { ; } while (0)
638#define audit_enabled 0 645#define audit_enabled 0
639#endif 646#endif
640#endif 647#endif
diff --git a/include/linux/backing-dev.h b/include/linux/backing-dev.h
index 96f4094b706d..3b2f9cb82986 100644
--- a/include/linux/backing-dev.h
+++ b/include/linux/backing-dev.h
@@ -16,7 +16,7 @@
16#include <linux/sched.h> 16#include <linux/sched.h>
17#include <linux/timer.h> 17#include <linux/timer.h>
18#include <linux/writeback.h> 18#include <linux/writeback.h>
19#include <asm/atomic.h> 19#include <linux/atomic.h>
20 20
21struct page; 21struct page;
22struct device; 22struct device;
@@ -40,6 +40,7 @@ typedef int (congested_fn)(void *, int);
40enum bdi_stat_item { 40enum bdi_stat_item {
41 BDI_RECLAIMABLE, 41 BDI_RECLAIMABLE,
42 BDI_WRITEBACK, 42 BDI_WRITEBACK,
43 BDI_WRITTEN,
43 NR_BDI_STAT_ITEMS 44 NR_BDI_STAT_ITEMS
44}; 45};
45 46
@@ -57,6 +58,7 @@ struct bdi_writeback {
57 struct list_head b_dirty; /* dirty inodes */ 58 struct list_head b_dirty; /* dirty inodes */
58 struct list_head b_io; /* parked for writeback */ 59 struct list_head b_io; /* parked for writeback */
59 struct list_head b_more_io; /* parked for more writeback */ 60 struct list_head b_more_io; /* parked for more writeback */
61 spinlock_t list_lock; /* protects the b_* lists */
60}; 62};
61 63
62struct backing_dev_info { 64struct backing_dev_info {
@@ -71,6 +73,11 @@ struct backing_dev_info {
71 73
72 struct percpu_counter bdi_stat[NR_BDI_STAT_ITEMS]; 74 struct percpu_counter bdi_stat[NR_BDI_STAT_ITEMS];
73 75
76 unsigned long bw_time_stamp; /* last time write bw is updated */
77 unsigned long written_stamp; /* pages written at bw_time_stamp */
78 unsigned long write_bandwidth; /* the estimated write bandwidth */
79 unsigned long avg_write_bandwidth; /* further smoothed write bw */
80
74 struct prop_local_percpu completions; 81 struct prop_local_percpu completions;
75 int dirty_exceeded; 82 int dirty_exceeded;
76 83
@@ -106,6 +113,7 @@ int bdi_writeback_thread(void *data);
106int bdi_has_dirty_io(struct backing_dev_info *bdi); 113int bdi_has_dirty_io(struct backing_dev_info *bdi);
107void bdi_arm_supers_timer(void); 114void bdi_arm_supers_timer(void);
108void bdi_wakeup_thread_delayed(struct backing_dev_info *bdi); 115void bdi_wakeup_thread_delayed(struct backing_dev_info *bdi);
116void bdi_lock_two(struct bdi_writeback *wb1, struct bdi_writeback *wb2);
109 117
110extern spinlock_t bdi_lock; 118extern spinlock_t bdi_lock;
111extern struct list_head bdi_list; 119extern struct list_head bdi_list;
diff --git a/include/linux/basic_mmio_gpio.h b/include/linux/basic_mmio_gpio.h
index 1ae12710d732..98999cf107ce 100644
--- a/include/linux/basic_mmio_gpio.h
+++ b/include/linux/basic_mmio_gpio.h
@@ -16,6 +16,7 @@
16#include <linux/gpio.h> 16#include <linux/gpio.h>
17#include <linux/types.h> 17#include <linux/types.h>
18#include <linux/compiler.h> 18#include <linux/compiler.h>
19#include <linux/spinlock_types.h>
19 20
20struct bgpio_pdata { 21struct bgpio_pdata {
21 int base; 22 int base;
diff --git a/include/linux/bcma/bcma.h b/include/linux/bcma/bcma.h
index 08763e4e848f..8c96654bef16 100644
--- a/include/linux/bcma/bcma.h
+++ b/include/linux/bcma/bcma.h
@@ -6,6 +6,7 @@
6 6
7#include <linux/bcma/bcma_driver_chipcommon.h> 7#include <linux/bcma/bcma_driver_chipcommon.h>
8#include <linux/bcma/bcma_driver_pci.h> 8#include <linux/bcma/bcma_driver_pci.h>
9#include <linux/ssb/ssb.h> /* SPROM sharing */
9 10
10#include "bcma_regs.h" 11#include "bcma_regs.h"
11 12
@@ -24,6 +25,11 @@ struct bcma_chipinfo {
24 u8 pkg; 25 u8 pkg;
25}; 26};
26 27
28enum bcma_clkmode {
29 BCMA_CLKMODE_FAST,
30 BCMA_CLKMODE_DYNAMIC,
31};
32
27struct bcma_host_ops { 33struct bcma_host_ops {
28 u8 (*read8)(struct bcma_device *core, u16 offset); 34 u8 (*read8)(struct bcma_device *core, u16 offset);
29 u16 (*read16)(struct bcma_device *core, u16 offset); 35 u16 (*read16)(struct bcma_device *core, u16 offset);
@@ -31,6 +37,12 @@ struct bcma_host_ops {
31 void (*write8)(struct bcma_device *core, u16 offset, u8 value); 37 void (*write8)(struct bcma_device *core, u16 offset, u8 value);
32 void (*write16)(struct bcma_device *core, u16 offset, u16 value); 38 void (*write16)(struct bcma_device *core, u16 offset, u16 value);
33 void (*write32)(struct bcma_device *core, u16 offset, u32 value); 39 void (*write32)(struct bcma_device *core, u16 offset, u32 value);
40#ifdef CONFIG_BCMA_BLOCKIO
41 void (*block_read)(struct bcma_device *core, void *buffer,
42 size_t count, u16 offset, u8 reg_width);
43 void (*block_write)(struct bcma_device *core, const void *buffer,
44 size_t count, u16 offset, u8 reg_width);
45#endif
34 /* Agent ops */ 46 /* Agent ops */
35 u32 (*aread32)(struct bcma_device *core, u16 offset); 47 u32 (*aread32)(struct bcma_device *core, u16 offset);
36 void (*awrite32)(struct bcma_device *core, u16 offset, u32 value); 48 void (*awrite32)(struct bcma_device *core, u16 offset, u32 value);
@@ -117,6 +129,8 @@ struct bcma_device {
117 struct bcma_device_id id; 129 struct bcma_device_id id;
118 130
119 struct device dev; 131 struct device dev;
132 struct device *dma_dev;
133 unsigned int irq;
120 bool dev_registered; 134 bool dev_registered;
121 135
122 u8 core_index; 136 u8 core_index;
@@ -179,6 +193,10 @@ struct bcma_bus {
179 193
180 struct bcma_drv_cc drv_cc; 194 struct bcma_drv_cc drv_cc;
181 struct bcma_drv_pci drv_pci; 195 struct bcma_drv_pci drv_pci;
196
197 /* We decided to share SPROM struct with SSB as long as we do not need
198 * any hacks for BCMA. This simplifies drivers code. */
199 struct ssb_sprom sprom;
182}; 200};
183 201
184extern inline u32 bcma_read8(struct bcma_device *core, u16 offset) 202extern inline u32 bcma_read8(struct bcma_device *core, u16 offset)
@@ -208,6 +226,18 @@ void bcma_write32(struct bcma_device *core, u16 offset, u32 value)
208{ 226{
209 core->bus->ops->write32(core, offset, value); 227 core->bus->ops->write32(core, offset, value);
210} 228}
229#ifdef CONFIG_BCMA_BLOCKIO
230extern inline void bcma_block_read(struct bcma_device *core, void *buffer,
231 size_t count, u16 offset, u8 reg_width)
232{
233 core->bus->ops->block_read(core, buffer, count, offset, reg_width);
234}
235extern inline void bcma_block_write(struct bcma_device *core, const void *buffer,
236 size_t count, u16 offset, u8 reg_width)
237{
238 core->bus->ops->block_write(core, buffer, count, offset, reg_width);
239}
240#endif
211extern inline u32 bcma_aread32(struct bcma_device *core, u16 offset) 241extern inline u32 bcma_aread32(struct bcma_device *core, u16 offset)
212{ 242{
213 return core->bus->ops->aread32(core, offset); 243 return core->bus->ops->aread32(core, offset);
@@ -218,7 +248,24 @@ void bcma_awrite32(struct bcma_device *core, u16 offset, u32 value)
218 core->bus->ops->awrite32(core, offset, value); 248 core->bus->ops->awrite32(core, offset, value);
219} 249}
220 250
251#define bcma_mask32(cc, offset, mask) \
252 bcma_write32(cc, offset, bcma_read32(cc, offset) & (mask))
253#define bcma_set32(cc, offset, set) \
254 bcma_write32(cc, offset, bcma_read32(cc, offset) | (set))
255#define bcma_maskset32(cc, offset, mask, set) \
256 bcma_write32(cc, offset, (bcma_read32(cc, offset) & (mask)) | (set))
257
221extern bool bcma_core_is_enabled(struct bcma_device *core); 258extern bool bcma_core_is_enabled(struct bcma_device *core);
259extern void bcma_core_disable(struct bcma_device *core, u32 flags);
222extern int bcma_core_enable(struct bcma_device *core, u32 flags); 260extern int bcma_core_enable(struct bcma_device *core, u32 flags);
261extern void bcma_core_set_clockmode(struct bcma_device *core,
262 enum bcma_clkmode clkmode);
263extern void bcma_core_pll_ctl(struct bcma_device *core, u32 req, u32 status,
264 bool on);
265#define BCMA_DMA_TRANSLATION_MASK 0xC0000000
266#define BCMA_DMA_TRANSLATION_NONE 0x00000000
267#define BCMA_DMA_TRANSLATION_DMA32_CMT 0x40000000 /* Client Mode Translation for 32-bit DMA */
268#define BCMA_DMA_TRANSLATION_DMA64_CMT 0x80000000 /* Client Mode Translation for 64-bit DMA */
269extern u32 bcma_core_dma_translation(struct bcma_device *core);
223 270
224#endif /* LINUX_BCMA_H_ */ 271#endif /* LINUX_BCMA_H_ */
diff --git a/include/linux/bcma/bcma_driver_chipcommon.h b/include/linux/bcma/bcma_driver_chipcommon.h
index 083c3b6cd5ce..a0f684615ae5 100644
--- a/include/linux/bcma/bcma_driver_chipcommon.h
+++ b/include/linux/bcma/bcma_driver_chipcommon.h
@@ -179,15 +179,7 @@
179#define BCMA_CC_PROG_WAITCNT 0x0124 179#define BCMA_CC_PROG_WAITCNT 0x0124
180#define BCMA_CC_FLASH_CFG 0x0128 180#define BCMA_CC_FLASH_CFG 0x0128
181#define BCMA_CC_FLASH_WAITCNT 0x012C 181#define BCMA_CC_FLASH_WAITCNT 0x012C
182#define BCMA_CC_CLKCTLST 0x01E0 /* Clock control and status (rev >= 20) */ 182/* 0x1E0 is defined as shared BCMA_CLKCTLST */
183#define BCMA_CC_CLKCTLST_FORCEALP 0x00000001 /* Force ALP request */
184#define BCMA_CC_CLKCTLST_FORCEHT 0x00000002 /* Force HT request */
185#define BCMA_CC_CLKCTLST_FORCEILP 0x00000004 /* Force ILP request */
186#define BCMA_CC_CLKCTLST_HAVEALPREQ 0x00000008 /* ALP available request */
187#define BCMA_CC_CLKCTLST_HAVEHTREQ 0x00000010 /* HT available request */
188#define BCMA_CC_CLKCTLST_HWCROFF 0x00000020 /* Force HW clock request off */
189#define BCMA_CC_CLKCTLST_HAVEHT 0x00010000 /* HT available */
190#define BCMA_CC_CLKCTLST_HAVEALP 0x00020000 /* APL available */
191#define BCMA_CC_HW_WORKAROUND 0x01E4 /* Hardware workaround (rev >= 20) */ 183#define BCMA_CC_HW_WORKAROUND 0x01E4 /* Hardware workaround (rev >= 20) */
192#define BCMA_CC_UART0_DATA 0x0300 184#define BCMA_CC_UART0_DATA 0x0300
193#define BCMA_CC_UART0_IMR 0x0304 185#define BCMA_CC_UART0_IMR 0x0304
@@ -244,6 +236,8 @@
244#define BCMA_CC_REGCTL_DATA 0x065C 236#define BCMA_CC_REGCTL_DATA 0x065C
245#define BCMA_CC_PLLCTL_ADDR 0x0660 237#define BCMA_CC_PLLCTL_ADDR 0x0660
246#define BCMA_CC_PLLCTL_DATA 0x0664 238#define BCMA_CC_PLLCTL_DATA 0x0664
239#define BCMA_CC_SPROM 0x0800 /* SPROM beginning */
240#define BCMA_CC_SPROM_PCIE6 0x0830 /* SPROM beginning on PCIe rev >= 6 */
247 241
248/* Data for the PMU, if available. 242/* Data for the PMU, if available.
249 * Check availability with ((struct bcma_chipcommon)->capabilities & BCMA_CC_CAP_PMU) 243 * Check availability with ((struct bcma_chipcommon)->capabilities & BCMA_CC_CAP_PMU)
diff --git a/include/linux/bcma/bcma_driver_pci.h b/include/linux/bcma/bcma_driver_pci.h
index b7e191cf00ec..3871b668caf9 100644
--- a/include/linux/bcma/bcma_driver_pci.h
+++ b/include/linux/bcma/bcma_driver_pci.h
@@ -85,5 +85,7 @@ struct bcma_drv_pci {
85#define pcicore_write32(pc, offset, val) bcma_write32((pc)->core, offset, val) 85#define pcicore_write32(pc, offset, val) bcma_write32((pc)->core, offset, val)
86 86
87extern void bcma_core_pci_init(struct bcma_drv_pci *pc); 87extern void bcma_core_pci_init(struct bcma_drv_pci *pc);
88extern int bcma_core_pci_irq_ctl(struct bcma_drv_pci *pc,
89 struct bcma_device *core, bool enable);
88 90
89#endif /* LINUX_BCMA_DRIVER_PCI_H_ */ 91#endif /* LINUX_BCMA_DRIVER_PCI_H_ */
diff --git a/include/linux/bcma/bcma_regs.h b/include/linux/bcma/bcma_regs.h
index f82d88a960ce..9faae2ae02e8 100644
--- a/include/linux/bcma/bcma_regs.h
+++ b/include/linux/bcma/bcma_regs.h
@@ -1,13 +1,38 @@
1#ifndef LINUX_BCMA_REGS_H_ 1#ifndef LINUX_BCMA_REGS_H_
2#define LINUX_BCMA_REGS_H_ 2#define LINUX_BCMA_REGS_H_
3 3
4/* Some single registers are shared between many cores */
5/* BCMA_CLKCTLST: ChipCommon (rev >= 20), PCIe, 80211 */
6#define BCMA_CLKCTLST 0x01E0 /* Clock control and status */
7#define BCMA_CLKCTLST_FORCEALP 0x00000001 /* Force ALP request */
8#define BCMA_CLKCTLST_FORCEHT 0x00000002 /* Force HT request */
9#define BCMA_CLKCTLST_FORCEILP 0x00000004 /* Force ILP request */
10#define BCMA_CLKCTLST_HAVEALPREQ 0x00000008 /* ALP available request */
11#define BCMA_CLKCTLST_HAVEHTREQ 0x00000010 /* HT available request */
12#define BCMA_CLKCTLST_HWCROFF 0x00000020 /* Force HW clock request off */
13#define BCMA_CLKCTLST_EXTRESREQ 0x00000700 /* Mask of external resource requests */
14#define BCMA_CLKCTLST_HAVEALP 0x00010000 /* ALP available */
15#define BCMA_CLKCTLST_HAVEHT 0x00020000 /* HT available */
16#define BCMA_CLKCTLST_BP_ON_ALP 0x00040000 /* RO: running on ALP clock */
17#define BCMA_CLKCTLST_BP_ON_HT 0x00080000 /* RO: running on HT clock */
18#define BCMA_CLKCTLST_EXTRESST 0x07000000 /* Mask of external resource status */
19/* Is there any BCM4328 on BCMA bus? */
20#define BCMA_CLKCTLST_4328A0_HAVEHT 0x00010000 /* 4328a0 has reversed bits */
21#define BCMA_CLKCTLST_4328A0_HAVEALP 0x00020000 /* 4328a0 has reversed bits */
22
4/* Agent registers (common for every core) */ 23/* Agent registers (common for every core) */
5#define BCMA_IOCTL 0x0408 24#define BCMA_IOCTL 0x0408 /* IO control */
6#define BCMA_IOCTL_CLK 0x0001 25#define BCMA_IOCTL_CLK 0x0001
7#define BCMA_IOCTL_FGC 0x0002 26#define BCMA_IOCTL_FGC 0x0002
8#define BCMA_IOCTL_CORE_BITS 0x3FFC 27#define BCMA_IOCTL_CORE_BITS 0x3FFC
9#define BCMA_IOCTL_PME_EN 0x4000 28#define BCMA_IOCTL_PME_EN 0x4000
10#define BCMA_IOCTL_BIST_EN 0x8000 29#define BCMA_IOCTL_BIST_EN 0x8000
30#define BCMA_IOST 0x0500 /* IO status */
31#define BCMA_IOST_CORE_BITS 0x0FFF
32#define BCMA_IOST_DMA64 0x1000
33#define BCMA_IOST_GATED_CLK 0x2000
34#define BCMA_IOST_BIST_ERROR 0x4000
35#define BCMA_IOST_BIST_DONE 0x8000
11#define BCMA_RESET_CTL 0x0800 36#define BCMA_RESET_CTL 0x0800
12#define BCMA_RESET_CTL_RESET 0x0001 37#define BCMA_RESET_CTL_RESET 0x0001
13 38
diff --git a/include/linux/binfmts.h b/include/linux/binfmts.h
index 8845613fd7e3..fd88a3945aa1 100644
--- a/include/linux/binfmts.h
+++ b/include/linux/binfmts.h
@@ -111,6 +111,7 @@ extern int __must_check remove_arg_zero(struct linux_binprm *);
111extern int search_binary_handler(struct linux_binprm *, struct pt_regs *); 111extern int search_binary_handler(struct linux_binprm *, struct pt_regs *);
112extern int flush_old_exec(struct linux_binprm * bprm); 112extern int flush_old_exec(struct linux_binprm * bprm);
113extern void setup_new_exec(struct linux_binprm * bprm); 113extern void setup_new_exec(struct linux_binprm * bprm);
114extern void would_dump(struct linux_binprm *, struct file *);
114 115
115extern int suid_dumpable; 116extern int suid_dumpable;
116#define SUID_DUMP_DISABLE 0 /* No setuid dumping */ 117#define SUID_DUMP_DISABLE 0 /* No setuid dumping */
diff --git a/include/linux/bit_spinlock.h b/include/linux/bit_spinlock.h
index b4326bfa684f..ac4d9f8b52e9 100644
--- a/include/linux/bit_spinlock.h
+++ b/include/linux/bit_spinlock.h
@@ -3,7 +3,7 @@
3 3
4#include <linux/kernel.h> 4#include <linux/kernel.h>
5#include <linux/preempt.h> 5#include <linux/preempt.h>
6#include <asm/atomic.h> 6#include <linux/atomic.h>
7 7
8/* 8/*
9 * bit-based spin_lock() 9 * bit-based spin_lock()
@@ -88,7 +88,7 @@ static inline int bit_spin_is_locked(int bitnum, unsigned long *addr)
88{ 88{
89#if defined(CONFIG_SMP) || defined(CONFIG_DEBUG_SPINLOCK) 89#if defined(CONFIG_SMP) || defined(CONFIG_DEBUG_SPINLOCK)
90 return test_bit(bitnum, addr); 90 return test_bit(bitnum, addr);
91#elif defined CONFIG_PREEMPT 91#elif defined CONFIG_PREEMPT_COUNT
92 return preempt_count(); 92 return preempt_count();
93#else 93#else
94 return 1; 94 return 1;
diff --git a/include/linux/bitmap.h b/include/linux/bitmap.h
index dcafe0bf0005..7ad634501e48 100644
--- a/include/linux/bitmap.h
+++ b/include/linux/bitmap.h
@@ -144,7 +144,9 @@ extern int bitmap_find_free_region(unsigned long *bitmap, int bits, int order);
144extern void bitmap_release_region(unsigned long *bitmap, int pos, int order); 144extern void bitmap_release_region(unsigned long *bitmap, int pos, int order);
145extern int bitmap_allocate_region(unsigned long *bitmap, int pos, int order); 145extern int bitmap_allocate_region(unsigned long *bitmap, int pos, int order);
146extern void bitmap_copy_le(void *dst, const unsigned long *src, int nbits); 146extern void bitmap_copy_le(void *dst, const unsigned long *src, int nbits);
147extern int bitmap_ord_to_pos(const unsigned long *bitmap, int n, int bits);
147 148
149#define BITMAP_FIRST_WORD_MASK(start) (~0UL << ((start) % BITS_PER_LONG))
148#define BITMAP_LAST_WORD_MASK(nbits) \ 150#define BITMAP_LAST_WORD_MASK(nbits) \
149( \ 151( \
150 ((nbits) % BITS_PER_LONG) ? \ 152 ((nbits) % BITS_PER_LONG) ? \
diff --git a/include/linux/blk_types.h b/include/linux/blk_types.h
index 2a7cea53ca0d..6395692b2e7a 100644
--- a/include/linux/blk_types.h
+++ b/include/linux/blk_types.h
@@ -167,7 +167,7 @@ enum rq_flag_bits {
167 (REQ_FAILFAST_DEV | REQ_FAILFAST_TRANSPORT | REQ_FAILFAST_DRIVER) 167 (REQ_FAILFAST_DEV | REQ_FAILFAST_TRANSPORT | REQ_FAILFAST_DRIVER)
168#define REQ_COMMON_MASK \ 168#define REQ_COMMON_MASK \
169 (REQ_WRITE | REQ_FAILFAST_MASK | REQ_SYNC | REQ_META | REQ_DISCARD | \ 169 (REQ_WRITE | REQ_FAILFAST_MASK | REQ_SYNC | REQ_META | REQ_DISCARD | \
170 REQ_NOIDLE | REQ_FLUSH | REQ_FUA) 170 REQ_NOIDLE | REQ_FLUSH | REQ_FUA | REQ_SECURE)
171#define REQ_CLONE_MASK REQ_COMMON_MASK 171#define REQ_CLONE_MASK REQ_COMMON_MASK
172 172
173#define REQ_RAHEAD (1 << __REQ_RAHEAD) 173#define REQ_RAHEAD (1 << __REQ_RAHEAD)
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
index ae9091a68480..0e67c45b3bc9 100644
--- a/include/linux/blkdev.h
+++ b/include/linux/blkdev.h
@@ -73,7 +73,7 @@ enum rq_cmd_type_bits {
73 73
74/* 74/*
75 * try to put the fields that are referenced together in the same cacheline. 75 * try to put the fields that are referenced together in the same cacheline.
76 * if you modify this structure, be sure to check block/blk-core.c:rq_init() 76 * if you modify this structure, be sure to check block/blk-core.c:blk_rq_init()
77 * as well! 77 * as well!
78 */ 78 */
79struct request { 79struct request {
@@ -260,8 +260,7 @@ struct queue_limits {
260 unsigned char discard_zeroes_data; 260 unsigned char discard_zeroes_data;
261}; 261};
262 262
263struct request_queue 263struct request_queue {
264{
265 /* 264 /*
266 * Together with queue_head for cacheline sharing 265 * Together with queue_head for cacheline sharing
267 */ 266 */
@@ -304,14 +303,14 @@ struct request_queue
304 void *queuedata; 303 void *queuedata;
305 304
306 /* 305 /*
307 * queue needs bounce pages for pages above this limit 306 * various queue flags, see QUEUE_* below
308 */ 307 */
309 gfp_t bounce_gfp; 308 unsigned long queue_flags;
310 309
311 /* 310 /*
312 * various queue flags, see QUEUE_* below 311 * queue needs bounce pages for pages above this limit
313 */ 312 */
314 unsigned long queue_flags; 313 gfp_t bounce_gfp;
315 314
316 /* 315 /*
317 * protects queue structures from reentrancy. ->__queue_lock should 316 * protects queue structures from reentrancy. ->__queue_lock should
@@ -334,8 +333,8 @@ struct request_queue
334 unsigned int nr_congestion_off; 333 unsigned int nr_congestion_off;
335 unsigned int nr_batching; 334 unsigned int nr_batching;
336 335
337 void *dma_drain_buffer;
338 unsigned int dma_drain_size; 336 unsigned int dma_drain_size;
337 void *dma_drain_buffer;
339 unsigned int dma_pad_mask; 338 unsigned int dma_pad_mask;
340 unsigned int dma_alignment; 339 unsigned int dma_alignment;
341 340
@@ -393,7 +392,7 @@ struct request_queue
393#define QUEUE_FLAG_ELVSWITCH 6 /* don't use elevator, just do FIFO */ 392#define QUEUE_FLAG_ELVSWITCH 6 /* don't use elevator, just do FIFO */
394#define QUEUE_FLAG_BIDI 7 /* queue supports bidi requests */ 393#define QUEUE_FLAG_BIDI 7 /* queue supports bidi requests */
395#define QUEUE_FLAG_NOMERGES 8 /* disable merge attempts */ 394#define QUEUE_FLAG_NOMERGES 8 /* disable merge attempts */
396#define QUEUE_FLAG_SAME_COMP 9 /* force complete on same CPU */ 395#define QUEUE_FLAG_SAME_COMP 9 /* complete on same CPU-group */
397#define QUEUE_FLAG_FAIL_IO 10 /* fake timeout */ 396#define QUEUE_FLAG_FAIL_IO 10 /* fake timeout */
398#define QUEUE_FLAG_STACKABLE 11 /* supports request stacking */ 397#define QUEUE_FLAG_STACKABLE 11 /* supports request stacking */
399#define QUEUE_FLAG_NONROT 12 /* non-rotational device (SSD) */ 398#define QUEUE_FLAG_NONROT 12 /* non-rotational device (SSD) */
@@ -403,6 +402,7 @@ struct request_queue
403#define QUEUE_FLAG_NOXMERGES 15 /* No extended merges */ 402#define QUEUE_FLAG_NOXMERGES 15 /* No extended merges */
404#define QUEUE_FLAG_ADD_RANDOM 16 /* Contributes to random pool */ 403#define QUEUE_FLAG_ADD_RANDOM 16 /* Contributes to random pool */
405#define QUEUE_FLAG_SECDISCARD 17 /* supports SECDISCARD */ 404#define QUEUE_FLAG_SECDISCARD 17 /* supports SECDISCARD */
405#define QUEUE_FLAG_SAME_FORCE 18 /* force complete on same CPU */
406 406
407#define QUEUE_FLAG_DEFAULT ((1 << QUEUE_FLAG_IO_STAT) | \ 407#define QUEUE_FLAG_DEFAULT ((1 << QUEUE_FLAG_IO_STAT) | \
408 (1 << QUEUE_FLAG_STACKABLE) | \ 408 (1 << QUEUE_FLAG_STACKABLE) | \
@@ -857,12 +857,21 @@ struct request_queue *blk_alloc_queue(gfp_t);
857struct request_queue *blk_alloc_queue_node(gfp_t, int); 857struct request_queue *blk_alloc_queue_node(gfp_t, int);
858extern void blk_put_queue(struct request_queue *); 858extern void blk_put_queue(struct request_queue *);
859 859
860/*
861 * Note: Code in between changing the blk_plug list/cb_list or element of such
862 * lists is preemptable, but such code can't do sleep (or be very careful),
863 * otherwise data is corrupted. For details, please check schedule() where
864 * blk_schedule_flush_plug() is called.
865 */
860struct blk_plug { 866struct blk_plug {
861 unsigned long magic; 867 unsigned long magic;
862 struct list_head list; 868 struct list_head list;
863 struct list_head cb_list; 869 struct list_head cb_list;
864 unsigned int should_sort; 870 unsigned int should_sort;
871 unsigned int count;
865}; 872};
873#define BLK_MAX_REQUEST_COUNT 16
874
866struct blk_plug_cb { 875struct blk_plug_cb {
867 struct list_head list; 876 struct list_head list;
868 void (*callback)(struct blk_plug_cb *); 877 void (*callback)(struct blk_plug_cb *);
@@ -1282,8 +1291,8 @@ queue_max_integrity_segments(struct request_queue *q)
1282#define blk_get_integrity(a) (0) 1291#define blk_get_integrity(a) (0)
1283#define blk_integrity_compare(a, b) (0) 1292#define blk_integrity_compare(a, b) (0)
1284#define blk_integrity_register(a, b) (0) 1293#define blk_integrity_register(a, b) (0)
1285#define blk_integrity_unregister(a) do { } while (0); 1294#define blk_integrity_unregister(a) do { } while (0)
1286#define blk_queue_max_integrity_segments(a, b) do { } while (0); 1295#define blk_queue_max_integrity_segments(a, b) do { } while (0)
1287#define queue_max_integrity_segments(a) (0) 1296#define queue_max_integrity_segments(a) (0)
1288#define blk_integrity_merge_rq(a, b, c) (0) 1297#define blk_integrity_merge_rq(a, b, c) (0)
1289#define blk_integrity_merge_bio(a, b, c) (0) 1298#define blk_integrity_merge_bio(a, b, c) (0)
diff --git a/include/linux/blktrace_api.h b/include/linux/blktrace_api.h
index b22fb0d3db0f..8c7c2de7631a 100644
--- a/include/linux/blktrace_api.h
+++ b/include/linux/blktrace_api.h
@@ -169,7 +169,8 @@ extern void blk_trace_shutdown(struct request_queue *);
169extern int do_blk_trace_setup(struct request_queue *q, char *name, 169extern int do_blk_trace_setup(struct request_queue *q, char *name,
170 dev_t dev, struct block_device *bdev, 170 dev_t dev, struct block_device *bdev,
171 struct blk_user_trace_setup *buts); 171 struct blk_user_trace_setup *buts);
172extern void __trace_note_message(struct blk_trace *, const char *fmt, ...); 172extern __attribute__((format(printf, 2, 3)))
173void __trace_note_message(struct blk_trace *, const char *fmt, ...);
173 174
174/** 175/**
175 * blk_add_trace_msg - Add a (simple) message to the blktrace stream 176 * blk_add_trace_msg - Add a (simple) message to the blktrace stream
diff --git a/include/linux/buffer_head.h b/include/linux/buffer_head.h
index 503c8a6b3079..458f497738a4 100644
--- a/include/linux/buffer_head.h
+++ b/include/linux/buffer_head.h
@@ -12,7 +12,7 @@
12#include <linux/linkage.h> 12#include <linux/linkage.h>
13#include <linux/pagemap.h> 13#include <linux/pagemap.h>
14#include <linux/wait.h> 14#include <linux/wait.h>
15#include <asm/atomic.h> 15#include <linux/atomic.h>
16 16
17#ifdef CONFIG_BLOCK 17#ifdef CONFIG_BLOCK
18 18
diff --git a/include/linux/ceph/libceph.h b/include/linux/ceph/libceph.h
index 6365f041745b..563755181c1e 100644
--- a/include/linux/ceph/libceph.h
+++ b/include/linux/ceph/libceph.h
@@ -35,7 +35,7 @@
35#define CEPH_OPT_MYIP (1<<2) /* specified my ip */ 35#define CEPH_OPT_MYIP (1<<2) /* specified my ip */
36#define CEPH_OPT_NOCRC (1<<3) /* no data crc on writes */ 36#define CEPH_OPT_NOCRC (1<<3) /* no data crc on writes */
37 37
38#define CEPH_OPT_DEFAULT (0); 38#define CEPH_OPT_DEFAULT (0)
39 39
40#define ceph_set_opt(client, opt) \ 40#define ceph_set_opt(client, opt) \
41 (client)->options->flags |= CEPH_OPT_##opt; 41 (client)->options->flags |= CEPH_OPT_##opt;
diff --git a/include/linux/ceph/messenger.h b/include/linux/ceph/messenger.h
index 31d91a64838b..d7adf151d335 100644
--- a/include/linux/ceph/messenger.h
+++ b/include/linux/ceph/messenger.h
@@ -94,6 +94,7 @@ struct ceph_msg {
94 bool more_to_follow; 94 bool more_to_follow;
95 bool needs_out_seq; 95 bool needs_out_seq;
96 int front_max; 96 int front_max;
97 unsigned long ack_stamp; /* tx: when we were acked */
97 98
98 struct ceph_msgpool *pool; 99 struct ceph_msgpool *pool;
99}; 100};
diff --git a/include/linux/cgroup.h b/include/linux/cgroup.h
index ab4ac0ccb857..da7e4bc34e8c 100644
--- a/include/linux/cgroup.h
+++ b/include/linux/cgroup.h
@@ -539,7 +539,6 @@ static inline struct cgroup_subsys_state *cgroup_subsys_state(
539 */ 539 */
540#define task_subsys_state_check(task, subsys_id, __c) \ 540#define task_subsys_state_check(task, subsys_id, __c) \
541 rcu_dereference_check(task->cgroups->subsys[subsys_id], \ 541 rcu_dereference_check(task->cgroups->subsys[subsys_id], \
542 rcu_read_lock_held() || \
543 lockdep_is_held(&task->alloc_lock) || \ 542 lockdep_is_held(&task->alloc_lock) || \
544 cgroup_lock_is_held() || (__c)) 543 cgroup_lock_is_held() || (__c))
545 544
diff --git a/include/linux/clocksource.h b/include/linux/clocksource.h
index d4646b48dc4a..139c4db55f17 100644
--- a/include/linux/clocksource.h
+++ b/include/linux/clocksource.h
@@ -22,6 +22,10 @@
22typedef u64 cycle_t; 22typedef u64 cycle_t;
23struct clocksource; 23struct clocksource;
24 24
25#ifdef CONFIG_ARCH_CLOCKSOURCE_DATA
26#include <asm/clocksource.h>
27#endif
28
25/** 29/**
26 * struct cyclecounter - hardware abstraction for a free running counter 30 * struct cyclecounter - hardware abstraction for a free running counter
27 * Provides completely state-free accessors to the underlying hardware. 31 * Provides completely state-free accessors to the underlying hardware.
@@ -153,7 +157,7 @@ extern u64 timecounter_cyc2time(struct timecounter *tc,
153 * @shift: cycle to nanosecond divisor (power of two) 157 * @shift: cycle to nanosecond divisor (power of two)
154 * @max_idle_ns: max idle time permitted by the clocksource (nsecs) 158 * @max_idle_ns: max idle time permitted by the clocksource (nsecs)
155 * @flags: flags describing special properties 159 * @flags: flags describing special properties
156 * @vread: vsyscall based read 160 * @archdata: arch-specific data
157 * @suspend: suspend function for the clocksource, if necessary 161 * @suspend: suspend function for the clocksource, if necessary
158 * @resume: resume function for the clocksource, if necessary 162 * @resume: resume function for the clocksource, if necessary
159 */ 163 */
@@ -169,16 +173,13 @@ struct clocksource {
169 u32 shift; 173 u32 shift;
170 u64 max_idle_ns; 174 u64 max_idle_ns;
171 175
172#ifdef CONFIG_IA64 176#ifdef CONFIG_ARCH_CLOCKSOURCE_DATA
173 void *fsys_mmio; /* used by fsyscall asm code */ 177 struct arch_clocksource_data archdata;
174#define CLKSRC_FSYS_MMIO_SET(mmio, addr) ((mmio) = (addr))
175#else
176#define CLKSRC_FSYS_MMIO_SET(mmio, addr) do { } while (0)
177#endif 178#endif
179
178 const char *name; 180 const char *name;
179 struct list_head list; 181 struct list_head list;
180 int rating; 182 int rating;
181 cycle_t (*vread)(void);
182 int (*enable)(struct clocksource *cs); 183 int (*enable)(struct clocksource *cs);
183 void (*disable)(struct clocksource *cs); 184 void (*disable)(struct clocksource *cs);
184 unsigned long flags; 185 unsigned long flags;
@@ -188,6 +189,7 @@ struct clocksource {
188#ifdef CONFIG_CLOCKSOURCE_WATCHDOG 189#ifdef CONFIG_CLOCKSOURCE_WATCHDOG
189 /* Watchdog related data, used by the framework */ 190 /* Watchdog related data, used by the framework */
190 struct list_head wd_list; 191 struct list_head wd_list;
192 cycle_t cs_last;
191 cycle_t wd_last; 193 cycle_t wd_last;
192#endif 194#endif
193} ____cacheline_aligned; 195} ____cacheline_aligned;
diff --git a/include/linux/cn_proc.h b/include/linux/cn_proc.h
index 47dac5ea8d3a..12c517b51ca2 100644
--- a/include/linux/cn_proc.h
+++ b/include/linux/cn_proc.h
@@ -53,6 +53,7 @@ struct proc_event {
53 PROC_EVENT_UID = 0x00000004, 53 PROC_EVENT_UID = 0x00000004,
54 PROC_EVENT_GID = 0x00000040, 54 PROC_EVENT_GID = 0x00000040,
55 PROC_EVENT_SID = 0x00000080, 55 PROC_EVENT_SID = 0x00000080,
56 PROC_EVENT_PTRACE = 0x00000100,
56 /* "next" should be 0x00000400 */ 57 /* "next" should be 0x00000400 */
57 /* "last" is the last process event: exit */ 58 /* "last" is the last process event: exit */
58 PROC_EVENT_EXIT = 0x80000000 59 PROC_EVENT_EXIT = 0x80000000
@@ -95,6 +96,13 @@ struct proc_event {
95 __kernel_pid_t process_tgid; 96 __kernel_pid_t process_tgid;
96 } sid; 97 } sid;
97 98
99 struct ptrace_proc_event {
100 __kernel_pid_t process_pid;
101 __kernel_pid_t process_tgid;
102 __kernel_pid_t tracer_pid;
103 __kernel_pid_t tracer_tgid;
104 } ptrace;
105
98 struct exit_proc_event { 106 struct exit_proc_event {
99 __kernel_pid_t process_pid; 107 __kernel_pid_t process_pid;
100 __kernel_pid_t process_tgid; 108 __kernel_pid_t process_tgid;
@@ -109,6 +117,7 @@ void proc_fork_connector(struct task_struct *task);
109void proc_exec_connector(struct task_struct *task); 117void proc_exec_connector(struct task_struct *task);
110void proc_id_connector(struct task_struct *task, int which_id); 118void proc_id_connector(struct task_struct *task, int which_id);
111void proc_sid_connector(struct task_struct *task); 119void proc_sid_connector(struct task_struct *task);
120void proc_ptrace_connector(struct task_struct *task, int which_id);
112void proc_exit_connector(struct task_struct *task); 121void proc_exit_connector(struct task_struct *task);
113#else 122#else
114static inline void proc_fork_connector(struct task_struct *task) 123static inline void proc_fork_connector(struct task_struct *task)
@@ -124,6 +133,10 @@ static inline void proc_id_connector(struct task_struct *task,
124static inline void proc_sid_connector(struct task_struct *task) 133static inline void proc_sid_connector(struct task_struct *task)
125{} 134{}
126 135
136static inline void proc_ptrace_connector(struct task_struct *task,
137 int ptrace_id)
138{}
139
127static inline void proc_exit_connector(struct task_struct *task) 140static inline void proc_exit_connector(struct task_struct *task)
128{} 141{}
129#endif /* CONFIG_PROC_EVENTS */ 142#endif /* CONFIG_PROC_EVENTS */
diff --git a/include/linux/compat.h b/include/linux/compat.h
index ddcb7db38e67..8779405e15a8 100644
--- a/include/linux/compat.h
+++ b/include/linux/compat.h
@@ -438,16 +438,7 @@ asmlinkage long compat_sys_ppoll(struct pollfd __user *ufds,
438 struct compat_timespec __user *tsp, 438 struct compat_timespec __user *tsp,
439 const compat_sigset_t __user *sigmask, 439 const compat_sigset_t __user *sigmask,
440 compat_size_t sigsetsize); 440 compat_size_t sigsetsize);
441#if (defined(CONFIG_NFSD) || defined(CONFIG_NFSD_MODULE)) && \
442 !defined(CONFIG_NFSD_DEPRECATED)
443union compat_nfsctl_res;
444struct compat_nfsctl_arg;
445asmlinkage long compat_sys_nfsservctl(int cmd,
446 struct compat_nfsctl_arg __user *arg,
447 union compat_nfsctl_res __user *res);
448#else
449asmlinkage long compat_sys_nfsservctl(int cmd, void *notused, void *notused2); 441asmlinkage long compat_sys_nfsservctl(int cmd, void *notused, void *notused2);
450#endif
451asmlinkage long compat_sys_signalfd4(int ufd, 442asmlinkage long compat_sys_signalfd4(int ufd,
452 const compat_sigset_t __user *sigmask, 443 const compat_sigset_t __user *sigmask,
453 compat_size_t sigsetsize, int flags); 444 compat_size_t sigsetsize, int flags);
@@ -467,6 +458,8 @@ asmlinkage long compat_sys_setsockopt(int fd, int level, int optname,
467 char __user *optval, unsigned int optlen); 458 char __user *optval, unsigned int optlen);
468asmlinkage long compat_sys_sendmsg(int fd, struct compat_msghdr __user *msg, 459asmlinkage long compat_sys_sendmsg(int fd, struct compat_msghdr __user *msg,
469 unsigned flags); 460 unsigned flags);
461asmlinkage long compat_sys_sendmmsg(int fd, struct compat_mmsghdr __user *mmsg,
462 unsigned vlen, unsigned int flags);
470asmlinkage long compat_sys_recvmsg(int fd, struct compat_msghdr __user *msg, 463asmlinkage long compat_sys_recvmsg(int fd, struct compat_msghdr __user *msg,
471 unsigned int flags); 464 unsigned int flags);
472asmlinkage long compat_sys_recv(int fd, void __user *buf, size_t len, 465asmlinkage long compat_sys_recv(int fd, void __user *buf, size_t len,
diff --git a/include/linux/configfs.h b/include/linux/configfs.h
index 645778ad899b..3081c58d696e 100644
--- a/include/linux/configfs.h
+++ b/include/linux/configfs.h
@@ -42,7 +42,7 @@
42#include <linux/mutex.h> 42#include <linux/mutex.h>
43#include <linux/err.h> 43#include <linux/err.h>
44 44
45#include <asm/atomic.h> 45#include <linux/atomic.h>
46 46
47#define CONFIGFS_ITEM_NAME_LEN 20 47#define CONFIGFS_ITEM_NAME_LEN 20
48 48
diff --git a/include/linux/connector.h b/include/linux/connector.h
index 7c60d0942adb..0c69ad825b39 100644
--- a/include/linux/connector.h
+++ b/include/linux/connector.h
@@ -44,7 +44,7 @@
44#define CN_VAL_DRBD 0x1 44#define CN_VAL_DRBD 0x1
45#define CN_KVP_IDX 0x9 /* HyperV KVP */ 45#define CN_KVP_IDX 0x9 /* HyperV KVP */
46 46
47#define CN_NETLINK_USERS 9 47#define CN_NETLINK_USERS 10 /* Highest index + 1 */
48 48
49/* 49/*
50 * Maximum connector's message size. 50 * Maximum connector's message size.
@@ -75,7 +75,7 @@ struct cn_msg {
75 75
76#ifdef __KERNEL__ 76#ifdef __KERNEL__
77 77
78#include <asm/atomic.h> 78#include <linux/atomic.h>
79 79
80#include <linux/list.h> 80#include <linux/list.h>
81#include <linux/workqueue.h> 81#include <linux/workqueue.h>
diff --git a/include/linux/cordic.h b/include/linux/cordic.h
new file mode 100644
index 000000000000..f932093e20c2
--- /dev/null
+++ b/include/linux/cordic.h
@@ -0,0 +1,48 @@
1/*
2 * Copyright (c) 2011 Broadcom Corporation
3 *
4 * Permission to use, copy, modify, and/or distribute this software for any
5 * purpose with or without fee is hereby granted, provided that the above
6 * copyright notice and this permission notice appear in all copies.
7 *
8 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
9 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
10 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
11 * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
12 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
13 * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
14 * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
15 */
16#ifndef __CORDIC_H_
17#define __CORDIC_H_
18
19#include <linux/types.h>
20
21/**
22 * struct cordic_iq - i/q coordinate.
23 *
24 * @i: real part of coordinate (in phase).
25 * @q: imaginary part of coordinate (quadrature).
26 */
27struct cordic_iq {
28 s32 i;
29 s32 q;
30};
31
32/**
33 * cordic_calc_iq() - calculates the i/q coordinate for given angle.
34 *
35 * @theta: angle in degrees for which i/q coordinate is to be calculated.
36 * @coord: function output parameter holding the i/q coordinate.
37 *
38 * The function calculates the i/q coordinate for a given angle using
39 * cordic algorithm. The coordinate consists of a real (i) and an
40 * imaginary (q) part. The real part is essentially the cosine of the
41 * angle and the imaginary part is the sine of the angle. The returned
42 * values are scaled by 2^16 for precision. The range for theta is
43 * for -180 degrees to +180 degrees. Passed values outside this range are
44 * converted before doing the actual calculation.
45 */
46struct cordic_iq cordic_calc_iq(s32 theta);
47
48#endif /* __CORDIC_H_ */
diff --git a/include/linux/cpu.h b/include/linux/cpu.h
index 5f09323ee880..b1a635acf72a 100644
--- a/include/linux/cpu.h
+++ b/include/linux/cpu.h
@@ -70,6 +70,39 @@ enum {
70 CPU_PRI_WORKQUEUE = 5, 70 CPU_PRI_WORKQUEUE = 5,
71}; 71};
72 72
73#define CPU_ONLINE 0x0002 /* CPU (unsigned)v is up */
74#define CPU_UP_PREPARE 0x0003 /* CPU (unsigned)v coming up */
75#define CPU_UP_CANCELED 0x0004 /* CPU (unsigned)v NOT coming up */
76#define CPU_DOWN_PREPARE 0x0005 /* CPU (unsigned)v going down */
77#define CPU_DOWN_FAILED 0x0006 /* CPU (unsigned)v NOT going down */
78#define CPU_DEAD 0x0007 /* CPU (unsigned)v dead */
79#define CPU_DYING 0x0008 /* CPU (unsigned)v not running any task,
80 * not handling interrupts, soon dead.
81 * Called on the dying cpu, interrupts
82 * are already disabled. Must not
83 * sleep, must not fail */
84#define CPU_POST_DEAD 0x0009 /* CPU (unsigned)v dead, cpu_hotplug
85 * lock is dropped */
86#define CPU_STARTING 0x000A /* CPU (unsigned)v soon running.
87 * Called on the new cpu, just before
88 * enabling interrupts. Must not sleep,
89 * must not fail */
90
91/* Used for CPU hotplug events occurring while tasks are frozen due to a suspend
92 * operation in progress
93 */
94#define CPU_TASKS_FROZEN 0x0010
95
96#define CPU_ONLINE_FROZEN (CPU_ONLINE | CPU_TASKS_FROZEN)
97#define CPU_UP_PREPARE_FROZEN (CPU_UP_PREPARE | CPU_TASKS_FROZEN)
98#define CPU_UP_CANCELED_FROZEN (CPU_UP_CANCELED | CPU_TASKS_FROZEN)
99#define CPU_DOWN_PREPARE_FROZEN (CPU_DOWN_PREPARE | CPU_TASKS_FROZEN)
100#define CPU_DOWN_FAILED_FROZEN (CPU_DOWN_FAILED | CPU_TASKS_FROZEN)
101#define CPU_DEAD_FROZEN (CPU_DEAD | CPU_TASKS_FROZEN)
102#define CPU_DYING_FROZEN (CPU_DYING | CPU_TASKS_FROZEN)
103#define CPU_STARTING_FROZEN (CPU_STARTING | CPU_TASKS_FROZEN)
104
105
73#ifdef CONFIG_SMP 106#ifdef CONFIG_SMP
74/* Need to know about CPUs going up/down? */ 107/* Need to know about CPUs going up/down? */
75#if defined(CONFIG_HOTPLUG_CPU) || !defined(MODULE) 108#if defined(CONFIG_HOTPLUG_CPU) || !defined(MODULE)
diff --git a/include/linux/cpufreq.h b/include/linux/cpufreq.h
index 11be48e0d168..6216115c7789 100644
--- a/include/linux/cpufreq.h
+++ b/include/linux/cpufreq.h
@@ -324,11 +324,16 @@ static inline unsigned int cpufreq_get(unsigned int cpu)
324/* query the last known CPU freq (in kHz). If zero, cpufreq couldn't detect it */ 324/* query the last known CPU freq (in kHz). If zero, cpufreq couldn't detect it */
325#ifdef CONFIG_CPU_FREQ 325#ifdef CONFIG_CPU_FREQ
326unsigned int cpufreq_quick_get(unsigned int cpu); 326unsigned int cpufreq_quick_get(unsigned int cpu);
327unsigned int cpufreq_quick_get_max(unsigned int cpu);
327#else 328#else
328static inline unsigned int cpufreq_quick_get(unsigned int cpu) 329static inline unsigned int cpufreq_quick_get(unsigned int cpu)
329{ 330{
330 return 0; 331 return 0;
331} 332}
333static inline unsigned int cpufreq_quick_get_max(unsigned int cpu)
334{
335 return 0;
336}
332#endif 337#endif
333 338
334 339
diff --git a/include/linux/cpuidle.h b/include/linux/cpuidle.h
index 36719ead50e8..b51629e15cfc 100644
--- a/include/linux/cpuidle.h
+++ b/include/linux/cpuidle.h
@@ -122,6 +122,8 @@ struct cpuidle_driver {
122}; 122};
123 123
124#ifdef CONFIG_CPU_IDLE 124#ifdef CONFIG_CPU_IDLE
125extern void disable_cpuidle(void);
126extern int cpuidle_idle_call(void);
125 127
126extern int cpuidle_register_driver(struct cpuidle_driver *drv); 128extern int cpuidle_register_driver(struct cpuidle_driver *drv);
127struct cpuidle_driver *cpuidle_get_driver(void); 129struct cpuidle_driver *cpuidle_get_driver(void);
@@ -135,6 +137,8 @@ extern int cpuidle_enable_device(struct cpuidle_device *dev);
135extern void cpuidle_disable_device(struct cpuidle_device *dev); 137extern void cpuidle_disable_device(struct cpuidle_device *dev);
136 138
137#else 139#else
140static inline void disable_cpuidle(void) { }
141static inline int cpuidle_idle_call(void) { return -ENODEV; }
138 142
139static inline int cpuidle_register_driver(struct cpuidle_driver *drv) 143static inline int cpuidle_register_driver(struct cpuidle_driver *drv)
140{return -ENODEV; } 144{return -ENODEV; }
diff --git a/include/linux/cpumask.h b/include/linux/cpumask.h
index b24ac56477b4..4f7a63237471 100644
--- a/include/linux/cpumask.h
+++ b/include/linux/cpumask.h
@@ -617,6 +617,20 @@ static inline size_t cpumask_size(void)
617 * ... use 'tmpmask' like a normal struct cpumask * ... 617 * ... use 'tmpmask' like a normal struct cpumask * ...
618 * 618 *
619 * free_cpumask_var(tmpmask); 619 * free_cpumask_var(tmpmask);
620 *
621 *
622 * However, one notable exception is there. alloc_cpumask_var() allocates
623 * only nr_cpumask_bits bits (in the other hand, real cpumask_t always has
624 * NR_CPUS bits). Therefore you don't have to dereference cpumask_var_t.
625 *
626 * cpumask_var_t tmpmask;
627 * if (!alloc_cpumask_var(&tmpmask, GFP_KERNEL))
628 * return -ENOMEM;
629 *
630 * var = *tmpmask;
631 *
632 * This code makes NR_CPUS length memcopy and brings to a memory corruption.
633 * cpumask_copy() provide safe copy functionality.
620 */ 634 */
621#ifdef CONFIG_CPUMASK_OFFSTACK 635#ifdef CONFIG_CPUMASK_OFFSTACK
622typedef struct cpumask *cpumask_var_t; 636typedef struct cpumask *cpumask_var_t;
diff --git a/include/linux/crc8.h b/include/linux/crc8.h
new file mode 100644
index 000000000000..13c8dabb0441
--- /dev/null
+++ b/include/linux/crc8.h
@@ -0,0 +1,101 @@
1/*
2 * Copyright (c) 2011 Broadcom Corporation
3 *
4 * Permission to use, copy, modify, and/or distribute this software for any
5 * purpose with or without fee is hereby granted, provided that the above
6 * copyright notice and this permission notice appear in all copies.
7 *
8 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
9 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
10 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
11 * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
12 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
13 * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
14 * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
15 */
16#ifndef __CRC8_H_
17#define __CRC8_H_
18
19#include <linux/types.h>
20
21/* see usage of this value in crc8() description */
22#define CRC8_INIT_VALUE 0xFF
23
24/*
25 * Return value of crc8() indicating valid message+crc. This is true
26 * if a CRC is inverted before transmission. The CRC computed over the
27 * whole received bitstream is _table[x], where x is the bit pattern
28 * of the modification (almost always 0xff).
29 */
30#define CRC8_GOOD_VALUE(_table) (_table[0xFF])
31
32/* required table size for crc8 algorithm */
33#define CRC8_TABLE_SIZE 256
34
35/* helper macro assuring right table size is used */
36#define DECLARE_CRC8_TABLE(_table) \
37 static u8 _table[CRC8_TABLE_SIZE]
38
39/**
40 * crc8_populate_lsb - fill crc table for given polynomial in regular bit order.
41 *
42 * @table: table to be filled.
43 * @polynomial: polynomial for which table is to be filled.
44 *
45 * This function fills the provided table according the polynomial provided for
46 * regular bit order (lsb first). Polynomials in CRC algorithms are typically
47 * represented as shown below.
48 *
49 * poly = x^8 + x^7 + x^6 + x^4 + x^2 + 1
50 *
51 * For lsb first direction x^7 maps to the lsb. So the polynomial is as below.
52 *
53 * - lsb first: poly = 10101011(1) = 0xAB
54 */
55void crc8_populate_lsb(u8 table[CRC8_TABLE_SIZE], u8 polynomial);
56
57/**
58 * crc8_populate_msb - fill crc table for given polynomial in reverse bit order.
59 *
60 * @table: table to be filled.
61 * @polynomial: polynomial for which table is to be filled.
62 *
63 * This function fills the provided table according the polynomial provided for
64 * reverse bit order (msb first). Polynomials in CRC algorithms are typically
65 * represented as shown below.
66 *
67 * poly = x^8 + x^7 + x^6 + x^4 + x^2 + 1
68 *
69 * For msb first direction x^7 maps to the msb. So the polynomial is as below.
70 *
71 * - msb first: poly = (1)11010101 = 0xD5
72 */
73void crc8_populate_msb(u8 table[CRC8_TABLE_SIZE], u8 polynomial);
74
75/**
76 * crc8() - calculate a crc8 over the given input data.
77 *
78 * @table: crc table used for calculation.
79 * @pdata: pointer to data buffer.
80 * @nbytes: number of bytes in data buffer.
81 * @crc: previous returned crc8 value.
82 *
83 * The CRC8 is calculated using the polynomial given in crc8_populate_msb()
84 * or crc8_populate_lsb().
85 *
86 * The caller provides the initial value (either %CRC8_INIT_VALUE
87 * or the previous returned value) to allow for processing of
88 * discontiguous blocks of data. When generating the CRC the
89 * caller is responsible for complementing the final return value
90 * and inserting it into the byte stream. When validating a byte
91 * stream (including CRC8), a final return value of %CRC8_GOOD_VALUE
92 * indicates the byte stream data can be considered valid.
93 *
94 * Reference:
95 * "A Painless Guide to CRC Error Detection Algorithms", ver 3, Aug 1993
96 * Williams, Ross N., ross<at>ross.net
97 * (see URL http://www.ross.net/crc/download/crc_v3.txt).
98 */
99u8 crc8(const u8 table[CRC8_TABLE_SIZE], u8 *pdata, size_t nbytes, u8 crc);
100
101#endif /* __CRC8_H_ */
diff --git a/include/linux/cred.h b/include/linux/cred.h
index 82607992f308..98f46efbe2d2 100644
--- a/include/linux/cred.h
+++ b/include/linux/cred.h
@@ -16,7 +16,7 @@
16#include <linux/init.h> 16#include <linux/init.h>
17#include <linux/key.h> 17#include <linux/key.h>
18#include <linux/selinux.h> 18#include <linux/selinux.h>
19#include <asm/atomic.h> 19#include <linux/atomic.h>
20 20
21struct user_struct; 21struct user_struct;
22struct cred; 22struct cred;
@@ -265,10 +265,11 @@ static inline void put_cred(const struct cred *_cred)
265/** 265/**
266 * current_cred - Access the current task's subjective credentials 266 * current_cred - Access the current task's subjective credentials
267 * 267 *
268 * Access the subjective credentials of the current task. 268 * Access the subjective credentials of the current task. RCU-safe,
269 * since nobody else can modify it.
269 */ 270 */
270#define current_cred() \ 271#define current_cred() \
271 (current->cred) 272 (*(__force struct cred **)&current->cred)
272 273
273/** 274/**
274 * __task_cred - Access a task's objective credentials 275 * __task_cred - Access a task's objective credentials
@@ -284,7 +285,6 @@ static inline void put_cred(const struct cred *_cred)
284 ({ \ 285 ({ \
285 const struct task_struct *__t = (task); \ 286 const struct task_struct *__t = (task); \
286 rcu_dereference_check(__t->real_cred, \ 287 rcu_dereference_check(__t->real_cred, \
287 rcu_read_lock_held() || \
288 task_is_dead(__t)); \ 288 task_is_dead(__t)); \
289 }) 289 })
290 290
@@ -308,7 +308,7 @@ static inline void put_cred(const struct cred *_cred)
308({ \ 308({ \
309 struct user_struct *__u; \ 309 struct user_struct *__u; \
310 struct cred *__cred; \ 310 struct cred *__cred; \
311 __cred = (struct cred *) current_cred(); \ 311 __cred = current_cred(); \
312 __u = get_uid(__cred->user); \ 312 __u = get_uid(__cred->user); \
313 __u; \ 313 __u; \
314}) 314})
@@ -323,7 +323,7 @@ static inline void put_cred(const struct cred *_cred)
323({ \ 323({ \
324 struct group_info *__groups; \ 324 struct group_info *__groups; \
325 struct cred *__cred; \ 325 struct cred *__cred; \
326 __cred = (struct cred *) current_cred(); \ 326 __cred = current_cred(); \
327 __groups = get_group_info(__cred->group_info); \ 327 __groups = get_group_info(__cred->group_info); \
328 __groups; \ 328 __groups; \
329}) 329})
@@ -342,7 +342,7 @@ static inline void put_cred(const struct cred *_cred)
342 342
343#define current_cred_xxx(xxx) \ 343#define current_cred_xxx(xxx) \
344({ \ 344({ \
345 current->cred->xxx; \ 345 current_cred()->xxx; \
346}) 346})
347 347
348#define current_uid() (current_cred_xxx(uid)) 348#define current_uid() (current_cred_xxx(uid))
diff --git a/include/linux/crypto.h b/include/linux/crypto.h
index a6a7a1c83f54..e5e468e9133d 100644
--- a/include/linux/crypto.h
+++ b/include/linux/crypto.h
@@ -17,7 +17,7 @@
17#ifndef _LINUX_CRYPTO_H 17#ifndef _LINUX_CRYPTO_H
18#define _LINUX_CRYPTO_H 18#define _LINUX_CRYPTO_H
19 19
20#include <asm/atomic.h> 20#include <linux/atomic.h>
21#include <linux/module.h> 21#include <linux/module.h>
22#include <linux/kernel.h> 22#include <linux/kernel.h>
23#include <linux/list.h> 23#include <linux/list.h>
diff --git a/include/linux/cryptohash.h b/include/linux/cryptohash.h
index ec78a4bbe1d5..2cd9f1cf9fa3 100644
--- a/include/linux/cryptohash.h
+++ b/include/linux/cryptohash.h
@@ -3,11 +3,16 @@
3 3
4#define SHA_DIGEST_WORDS 5 4#define SHA_DIGEST_WORDS 5
5#define SHA_MESSAGE_BYTES (512 /*bits*/ / 8) 5#define SHA_MESSAGE_BYTES (512 /*bits*/ / 8)
6#define SHA_WORKSPACE_WORDS 80 6#define SHA_WORKSPACE_WORDS 16
7 7
8void sha_init(__u32 *buf); 8void sha_init(__u32 *buf);
9void sha_transform(__u32 *digest, const char *data, __u32 *W); 9void sha_transform(__u32 *digest, const char *data, __u32 *W);
10 10
11#define MD5_DIGEST_WORDS 4
12#define MD5_MESSAGE_BYTES 64
13
14void md5_transform(__u32 *hash, __u32 const *in);
15
11__u32 half_md4_transform(__u32 buf[4], __u32 const in[8]); 16__u32 half_md4_transform(__u32 buf[4], __u32 const in[8]);
12 17
13#endif 18#endif
diff --git a/include/linux/cs5535.h b/include/linux/cs5535.h
index 6fe2114f8ad2..c077aec3a6ff 100644
--- a/include/linux/cs5535.h
+++ b/include/linux/cs5535.h
@@ -11,6 +11,8 @@
11#ifndef _CS5535_H 11#ifndef _CS5535_H
12#define _CS5535_H 12#define _CS5535_H
13 13
14#include <asm/msr.h>
15
14/* MSRs */ 16/* MSRs */
15#define MSR_GLIU_P2D_RO0 0x10000029 17#define MSR_GLIU_P2D_RO0 0x10000029
16 18
@@ -38,17 +40,75 @@
38#define MSR_MFGPT_NR 0x51400029 40#define MSR_MFGPT_NR 0x51400029
39#define MSR_MFGPT_SETUP 0x5140002B 41#define MSR_MFGPT_SETUP 0x5140002B
40 42
43#define MSR_RTC_DOMA_OFFSET 0x51400055
44#define MSR_RTC_MONA_OFFSET 0x51400056
45#define MSR_RTC_CEN_OFFSET 0x51400057
46
41#define MSR_LX_SPARE_MSR 0x80000011 /* DC-specific */ 47#define MSR_LX_SPARE_MSR 0x80000011 /* DC-specific */
42 48
43#define MSR_GX_GLD_MSR_CONFIG 0xC0002001 49#define MSR_GX_GLD_MSR_CONFIG 0xC0002001
44#define MSR_GX_MSR_PADSEL 0xC0002011 50#define MSR_GX_MSR_PADSEL 0xC0002011
45 51
52static inline int cs5535_pic_unreqz_select_high(unsigned int group,
53 unsigned int irq)
54{
55 uint32_t lo, hi;
56
57 rdmsr(MSR_PIC_ZSEL_HIGH, lo, hi);
58 lo &= ~(0xF << (group * 4));
59 lo |= (irq & 0xF) << (group * 4);
60 wrmsr(MSR_PIC_ZSEL_HIGH, lo, hi);
61 return 0;
62}
63
64/* PIC registers */
65#define CS5536_PIC_INT_SEL1 0x4d0
66#define CS5536_PIC_INT_SEL2 0x4d1
67
46/* resource sizes */ 68/* resource sizes */
47#define LBAR_GPIO_SIZE 0xFF 69#define LBAR_GPIO_SIZE 0xFF
48#define LBAR_MFGPT_SIZE 0x40 70#define LBAR_MFGPT_SIZE 0x40
49#define LBAR_ACPI_SIZE 0x40 71#define LBAR_ACPI_SIZE 0x40
50#define LBAR_PMS_SIZE 0x80 72#define LBAR_PMS_SIZE 0x80
51 73
74/*
75 * PMC registers (PMS block)
76 * It is only safe to access these registers as dword accesses.
77 * See CS5536 Specification Update erratas 17 & 18
78 */
79#define CS5536_PM_SCLK 0x10
80#define CS5536_PM_IN_SLPCTL 0x20
81#define CS5536_PM_WKXD 0x34
82#define CS5536_PM_WKD 0x30
83#define CS5536_PM_SSC 0x54
84
85/*
86 * PM registers (ACPI block)
87 * It is only safe to access these registers as dword accesses.
88 * See CS5536 Specification Update erratas 17 & 18
89 */
90#define CS5536_PM1_STS 0x00
91#define CS5536_PM1_EN 0x02
92#define CS5536_PM1_CNT 0x08
93#define CS5536_PM_GPE0_STS 0x18
94#define CS5536_PM_GPE0_EN 0x1c
95
96/* CS5536_PM1_STS bits */
97#define CS5536_WAK_FLAG (1 << 15)
98#define CS5536_PWRBTN_FLAG (1 << 8)
99
100/* CS5536_PM1_EN bits */
101#define CS5536_PM_PWRBTN (1 << 8)
102#define CS5536_PM_RTC (1 << 10)
103
104/* CS5536_PM_GPE0_STS bits */
105#define CS5536_GPIOM7_PME_FLAG (1 << 31)
106#define CS5536_GPIOM6_PME_FLAG (1 << 30)
107
108/* CS5536_PM_GPE0_EN bits */
109#define CS5536_GPIOM7_PME_EN (1 << 31)
110#define CS5536_GPIOM6_PME_EN (1 << 30)
111
52/* VSA2 magic values */ 112/* VSA2 magic values */
53#define VSA_VRC_INDEX 0xAC1C 113#define VSA_VRC_INDEX 0xAC1C
54#define VSA_VRC_DATA 0xAC1E 114#define VSA_VRC_DATA 0xAC1E
diff --git a/include/linux/ctype.h b/include/linux/ctype.h
index a3d6ee0044f9..8acfe312f947 100644
--- a/include/linux/ctype.h
+++ b/include/linux/ctype.h
@@ -52,4 +52,13 @@ static inline unsigned char __toupper(unsigned char c)
52#define tolower(c) __tolower(c) 52#define tolower(c) __tolower(c)
53#define toupper(c) __toupper(c) 53#define toupper(c) __toupper(c)
54 54
55/*
56 * Fast implementation of tolower() for internal usage. Do not use in your
57 * code.
58 */
59static inline char _tolower(const char c)
60{
61 return c | 0x20;
62}
63
55#endif 64#endif
diff --git a/include/linux/dcache.h b/include/linux/dcache.h
index 19d90a55541d..62157c03caf7 100644
--- a/include/linux/dcache.h
+++ b/include/linux/dcache.h
@@ -1,7 +1,7 @@
1#ifndef __LINUX_DCACHE_H 1#ifndef __LINUX_DCACHE_H
2#define __LINUX_DCACHE_H 2#define __LINUX_DCACHE_H
3 3
4#include <asm/atomic.h> 4#include <linux/atomic.h>
5#include <linux/list.h> 5#include <linux/list.h>
6#include <linux/rculist.h> 6#include <linux/rculist.h>
7#include <linux/rculist_bl.h> 7#include <linux/rculist_bl.h>
@@ -180,12 +180,12 @@ struct dentry_operations {
180 */ 180 */
181 181
182/* d_flags entries */ 182/* d_flags entries */
183#define DCACHE_AUTOFS_PENDING 0x0001 /* autofs: "under construction" */ 183#define DCACHE_OP_HASH 0x0001
184#define DCACHE_NFSFS_RENAMED 0x0002 184#define DCACHE_OP_COMPARE 0x0002
185 /* this dentry has been "silly renamed" and has to be deleted on the last 185#define DCACHE_OP_REVALIDATE 0x0004
186 * dput() */ 186#define DCACHE_OP_DELETE 0x0008
187 187
188#define DCACHE_DISCONNECTED 0x0004 188#define DCACHE_DISCONNECTED 0x0010
189 /* This dentry is possibly not currently connected to the dcache tree, in 189 /* This dentry is possibly not currently connected to the dcache tree, in
190 * which case its parent will either be itself, or will have this flag as 190 * which case its parent will either be itself, or will have this flag as
191 * well. nfsd will not use a dentry with this bit set, but will first 191 * well. nfsd will not use a dentry with this bit set, but will first
@@ -196,26 +196,23 @@ struct dentry_operations {
196 * dentry into place and return that dentry rather than the passed one, 196 * dentry into place and return that dentry rather than the passed one,
197 * typically using d_splice_alias. */ 197 * typically using d_splice_alias. */
198 198
199#define DCACHE_REFERENCED 0x0008 /* Recently used, don't discard. */ 199#define DCACHE_REFERENCED 0x0020 /* Recently used, don't discard. */
200#define DCACHE_RCUACCESS 0x0010 /* Entry has ever been RCU-visible */ 200#define DCACHE_RCUACCESS 0x0040 /* Entry has ever been RCU-visible */
201#define DCACHE_INOTIFY_PARENT_WATCHED 0x0020
202 /* Parent inode is watched by inotify */
203
204#define DCACHE_COOKIE 0x0040 /* For use by dcookie subsystem */
205#define DCACHE_FSNOTIFY_PARENT_WATCHED 0x0080
206 /* Parent inode is watched by some fsnotify listener */
207 201
208#define DCACHE_CANT_MOUNT 0x0100 202#define DCACHE_CANT_MOUNT 0x0100
209#define DCACHE_GENOCIDE 0x0200 203#define DCACHE_GENOCIDE 0x0200
210 204
211#define DCACHE_OP_HASH 0x1000 205#define DCACHE_NFSFS_RENAMED 0x1000
212#define DCACHE_OP_COMPARE 0x2000 206 /* this dentry has been "silly renamed" and has to be deleted on the last
213#define DCACHE_OP_REVALIDATE 0x4000 207 * dput() */
214#define DCACHE_OP_DELETE 0x8000 208#define DCACHE_COOKIE 0x2000 /* For use by dcookie subsystem */
209#define DCACHE_FSNOTIFY_PARENT_WATCHED 0x4000
210 /* Parent inode is watched by some fsnotify listener */
215 211
216#define DCACHE_MOUNTED 0x10000 /* is a mountpoint */ 212#define DCACHE_MOUNTED 0x10000 /* is a mountpoint */
217#define DCACHE_NEED_AUTOMOUNT 0x20000 /* handle automount on this dir */ 213#define DCACHE_NEED_AUTOMOUNT 0x20000 /* handle automount on this dir */
218#define DCACHE_MANAGE_TRANSIT 0x40000 /* manage transit from this dirent */ 214#define DCACHE_MANAGE_TRANSIT 0x40000 /* manage transit from this dirent */
215#define DCACHE_NEED_LOOKUP 0x80000 /* dentry requires i_op->lookup */
219#define DCACHE_MANAGED_DENTRY \ 216#define DCACHE_MANAGED_DENTRY \
220 (DCACHE_MOUNTED|DCACHE_NEED_AUTOMOUNT|DCACHE_MANAGE_TRANSIT) 217 (DCACHE_MOUNTED|DCACHE_NEED_AUTOMOUNT|DCACHE_MANAGE_TRANSIT)
221 218
@@ -416,7 +413,12 @@ static inline bool d_mountpoint(struct dentry *dentry)
416 return dentry->d_flags & DCACHE_MOUNTED; 413 return dentry->d_flags & DCACHE_MOUNTED;
417} 414}
418 415
419extern struct dentry *lookup_create(struct nameidata *nd, int is_dir); 416static inline bool d_need_lookup(struct dentry *dentry)
417{
418 return dentry->d_flags & DCACHE_NEED_LOOKUP;
419}
420
421extern void d_clear_need_lookup(struct dentry *dentry);
420 422
421extern int sysctl_vfs_cache_pressure; 423extern int sysctl_vfs_cache_pressure;
422 424
diff --git a/include/linux/dcbnl.h b/include/linux/dcbnl.h
index c52280047e2c..65a2562f66b4 100644
--- a/include/linux/dcbnl.h
+++ b/include/linux/dcbnl.h
@@ -203,6 +203,7 @@ struct dcbmsg {
203 * @DCB_CMD_GFEATCFG: get DCBX features flags 203 * @DCB_CMD_GFEATCFG: get DCBX features flags
204 * @DCB_CMD_SFEATCFG: set DCBX features negotiation flags 204 * @DCB_CMD_SFEATCFG: set DCBX features negotiation flags
205 * @DCB_CMD_CEE_GET: get CEE aggregated configuration 205 * @DCB_CMD_CEE_GET: get CEE aggregated configuration
206 * @DCB_CMD_IEEE_DEL: delete IEEE 802.1Qaz configuration
206 */ 207 */
207enum dcbnl_commands { 208enum dcbnl_commands {
208 DCB_CMD_UNDEFINED, 209 DCB_CMD_UNDEFINED,
@@ -246,6 +247,7 @@ enum dcbnl_commands {
246 DCB_CMD_SFEATCFG, 247 DCB_CMD_SFEATCFG,
247 248
248 DCB_CMD_CEE_GET, 249 DCB_CMD_CEE_GET,
250 DCB_CMD_IEEE_DEL,
249 251
250 __DCB_CMD_ENUM_MAX, 252 __DCB_CMD_ENUM_MAX,
251 DCB_CMD_MAX = __DCB_CMD_ENUM_MAX - 1, 253 DCB_CMD_MAX = __DCB_CMD_ENUM_MAX - 1,
@@ -331,18 +333,30 @@ enum ieee_attrs_app {
331#define DCB_ATTR_IEEE_APP_MAX (__DCB_ATTR_IEEE_APP_MAX - 1) 333#define DCB_ATTR_IEEE_APP_MAX (__DCB_ATTR_IEEE_APP_MAX - 1)
332 334
333/** 335/**
334 * enum cee_attrs - CEE DCBX get attributes 336 * enum cee_attrs - CEE DCBX get attributes.
335 * 337 *
336 * @DCB_ATTR_CEE_UNSPEC: unspecified 338 * @DCB_ATTR_CEE_UNSPEC: unspecified
337 * @DCB_ATTR_CEE_PEER_PG: peer PG configuration - get only 339 * @DCB_ATTR_CEE_PEER_PG: peer PG configuration - get only
338 * @DCB_ATTR_CEE_PEER_PFC: peer PFC configuration - get only 340 * @DCB_ATTR_CEE_PEER_PFC: peer PFC configuration - get only
339 * @DCB_ATTR_CEE_PEER_APP: peer APP tlv - get only 341 * @DCB_ATTR_CEE_PEER_APP_TABLE: peer APP tlv - get only
342 * @DCB_ATTR_CEE_TX_PG: TX PG configuration (DCB_CMD_PGTX_GCFG)
343 * @DCB_ATTR_CEE_RX_PG: RX PG configuration (DCB_CMD_PGRX_GCFG)
344 * @DCB_ATTR_CEE_PFC: PFC configuration (DCB_CMD_PFC_GCFG)
345 * @DCB_ATTR_CEE_APP_TABLE: APP configuration (multi DCB_CMD_GAPP)
346 * @DCB_ATTR_CEE_FEAT: DCBX features flags (DCB_CMD_GFEATCFG)
347 *
348 * An aggregated collection of the cee std negotiated parameters.
340 */ 349 */
341enum cee_attrs { 350enum cee_attrs {
342 DCB_ATTR_CEE_UNSPEC, 351 DCB_ATTR_CEE_UNSPEC,
343 DCB_ATTR_CEE_PEER_PG, 352 DCB_ATTR_CEE_PEER_PG,
344 DCB_ATTR_CEE_PEER_PFC, 353 DCB_ATTR_CEE_PEER_PFC,
345 DCB_ATTR_CEE_PEER_APP_TABLE, 354 DCB_ATTR_CEE_PEER_APP_TABLE,
355 DCB_ATTR_CEE_TX_PG,
356 DCB_ATTR_CEE_RX_PG,
357 DCB_ATTR_CEE_PFC,
358 DCB_ATTR_CEE_APP_TABLE,
359 DCB_ATTR_CEE_FEAT,
346 __DCB_ATTR_CEE_MAX 360 __DCB_ATTR_CEE_MAX
347}; 361};
348#define DCB_ATTR_CEE_MAX (__DCB_ATTR_CEE_MAX - 1) 362#define DCB_ATTR_CEE_MAX (__DCB_ATTR_CEE_MAX - 1)
@@ -355,6 +369,13 @@ enum peer_app_attr {
355}; 369};
356#define DCB_ATTR_CEE_PEER_APP_MAX (__DCB_ATTR_CEE_PEER_APP_MAX - 1) 370#define DCB_ATTR_CEE_PEER_APP_MAX (__DCB_ATTR_CEE_PEER_APP_MAX - 1)
357 371
372enum cee_attrs_app {
373 DCB_ATTR_CEE_APP_UNSPEC,
374 DCB_ATTR_CEE_APP,
375 __DCB_ATTR_CEE_APP_MAX
376};
377#define DCB_ATTR_CEE_APP_MAX (__DCB_ATTR_CEE_APP_MAX - 1)
378
358/** 379/**
359 * enum dcbnl_pfc_attrs - DCB Priority Flow Control user priority nested attrs 380 * enum dcbnl_pfc_attrs - DCB Priority Flow Control user priority nested attrs
360 * 381 *
diff --git a/include/linux/dccp.h b/include/linux/dccp.h
index d638e85dc501..710c04302a15 100644
--- a/include/linux/dccp.h
+++ b/include/linux/dccp.h
@@ -236,6 +236,7 @@ enum dccp_packet_dequeueing_policy {
236#ifdef __KERNEL__ 236#ifdef __KERNEL__
237 237
238#include <linux/in.h> 238#include <linux/in.h>
239#include <linux/interrupt.h>
239#include <linux/ktime.h> 240#include <linux/ktime.h>
240#include <linux/list.h> 241#include <linux/list.h>
241#include <linux/uio.h> 242#include <linux/uio.h>
diff --git a/include/linux/debug_locks.h b/include/linux/debug_locks.h
index 2833452ea01c..5033fb88c107 100644
--- a/include/linux/debug_locks.h
+++ b/include/linux/debug_locks.h
@@ -2,7 +2,7 @@
2#define __LINUX_DEBUG_LOCKING_H 2#define __LINUX_DEBUG_LOCKING_H
3 3
4#include <linux/kernel.h> 4#include <linux/kernel.h>
5#include <asm/atomic.h> 5#include <linux/atomic.h>
6#include <asm/system.h> 6#include <asm/system.h>
7 7
8struct task_struct; 8struct task_struct;
diff --git a/include/linux/device-mapper.h b/include/linux/device-mapper.h
index 4427e0454051..3fa1f3d90ce0 100644
--- a/include/linux/device-mapper.h
+++ b/include/linux/device-mapper.h
@@ -208,6 +208,49 @@ struct dm_target_callbacks {
208int dm_register_target(struct target_type *t); 208int dm_register_target(struct target_type *t);
209void dm_unregister_target(struct target_type *t); 209void dm_unregister_target(struct target_type *t);
210 210
211/*
212 * Target argument parsing.
213 */
214struct dm_arg_set {
215 unsigned argc;
216 char **argv;
217};
218
219/*
220 * The minimum and maximum value of a numeric argument, together with
221 * the error message to use if the number is found to be outside that range.
222 */
223struct dm_arg {
224 unsigned min;
225 unsigned max;
226 char *error;
227};
228
229/*
230 * Validate the next argument, either returning it as *value or, if invalid,
231 * returning -EINVAL and setting *error.
232 */
233int dm_read_arg(struct dm_arg *arg, struct dm_arg_set *arg_set,
234 unsigned *value, char **error);
235
236/*
237 * Process the next argument as the start of a group containing between
238 * arg->min and arg->max further arguments. Either return the size as
239 * *num_args or, if invalid, return -EINVAL and set *error.
240 */
241int dm_read_arg_group(struct dm_arg *arg, struct dm_arg_set *arg_set,
242 unsigned *num_args, char **error);
243
244/*
245 * Return the current argument and shift to the next.
246 */
247const char *dm_shift_arg(struct dm_arg_set *as);
248
249/*
250 * Move through num_args arguments.
251 */
252void dm_consume_args(struct dm_arg_set *as, unsigned num_args);
253
211/*----------------------------------------------------------------- 254/*-----------------------------------------------------------------
212 * Functions for creating and manipulating mapped devices. 255 * Functions for creating and manipulating mapped devices.
213 * Drop the reference with dm_put when you finish with the object. 256 * Drop the reference with dm_put when you finish with the object.
diff --git a/include/linux/device.h b/include/linux/device.h
index c66111affca9..c20dfbfc49b4 100644
--- a/include/linux/device.h
+++ b/include/linux/device.h
@@ -22,7 +22,7 @@
22#include <linux/types.h> 22#include <linux/types.h>
23#include <linux/module.h> 23#include <linux/module.h>
24#include <linux/pm.h> 24#include <linux/pm.h>
25#include <asm/atomic.h> 25#include <linux/atomic.h>
26#include <asm/device.h> 26#include <asm/device.h>
27 27
28struct device; 28struct device;
@@ -516,7 +516,7 @@ struct device_dma_parameters {
516 * minimizes board-specific #ifdefs in drivers. 516 * minimizes board-specific #ifdefs in drivers.
517 * @power: For device power management. 517 * @power: For device power management.
518 * See Documentation/power/devices.txt for details. 518 * See Documentation/power/devices.txt for details.
519 * @pwr_domain: Provide callbacks that are executed during system suspend, 519 * @pm_domain: Provide callbacks that are executed during system suspend,
520 * hibernation, system resume and during runtime PM transitions 520 * hibernation, system resume and during runtime PM transitions
521 * along with subsystem-level and driver-level callbacks. 521 * along with subsystem-level and driver-level callbacks.
522 * @numa_node: NUMA node this device is close to. 522 * @numa_node: NUMA node this device is close to.
@@ -530,7 +530,6 @@ struct device_dma_parameters {
530 * @dma_mem: Internal for coherent mem override. 530 * @dma_mem: Internal for coherent mem override.
531 * @archdata: For arch-specific additions. 531 * @archdata: For arch-specific additions.
532 * @of_node: Associated device tree node. 532 * @of_node: Associated device tree node.
533 * @of_match: Matching of_device_id from driver.
534 * @devt: For creating the sysfs "dev". 533 * @devt: For creating the sysfs "dev".
535 * @devres_lock: Spinlock to protect the resource of the device. 534 * @devres_lock: Spinlock to protect the resource of the device.
536 * @devres_head: The resources list of the device. 535 * @devres_head: The resources list of the device.
@@ -568,7 +567,7 @@ struct device {
568 void *platform_data; /* Platform specific data, device 567 void *platform_data; /* Platform specific data, device
569 core doesn't touch it */ 568 core doesn't touch it */
570 struct dev_pm_info power; 569 struct dev_pm_info power;
571 struct dev_power_domain *pwr_domain; 570 struct dev_pm_domain *pm_domain;
572 571
573#ifdef CONFIG_NUMA 572#ifdef CONFIG_NUMA
574 int numa_node; /* NUMA node this device is close to */ 573 int numa_node; /* NUMA node this device is close to */
@@ -654,13 +653,13 @@ static inline int device_is_registered(struct device *dev)
654 653
655static inline void device_enable_async_suspend(struct device *dev) 654static inline void device_enable_async_suspend(struct device *dev)
656{ 655{
657 if (!dev->power.in_suspend) 656 if (!dev->power.is_prepared)
658 dev->power.async_suspend = true; 657 dev->power.async_suspend = true;
659} 658}
660 659
661static inline void device_disable_async_suspend(struct device *dev) 660static inline void device_disable_async_suspend(struct device *dev)
662{ 661{
663 if (!dev->power.in_suspend) 662 if (!dev->power.is_prepared)
664 dev->power.async_suspend = false; 663 dev->power.async_suspend = false;
665} 664}
666 665
diff --git a/include/linux/device_cgroup.h b/include/linux/device_cgroup.h
index 0b0d9c39ed67..7aad1f440867 100644
--- a/include/linux/device_cgroup.h
+++ b/include/linux/device_cgroup.h
@@ -2,8 +2,16 @@
2#include <linux/fs.h> 2#include <linux/fs.h>
3 3
4#ifdef CONFIG_CGROUP_DEVICE 4#ifdef CONFIG_CGROUP_DEVICE
5extern int devcgroup_inode_permission(struct inode *inode, int mask); 5extern int __devcgroup_inode_permission(struct inode *inode, int mask);
6extern int devcgroup_inode_mknod(int mode, dev_t dev); 6extern int devcgroup_inode_mknod(int mode, dev_t dev);
7static inline int devcgroup_inode_permission(struct inode *inode, int mask)
8{
9 if (likely(!inode->i_rdev))
10 return 0;
11 if (!S_ISBLK(inode->i_mode) && !S_ISCHR(inode->i_mode))
12 return 0;
13 return __devcgroup_inode_permission(inode, mask);
14}
7#else 15#else
8static inline int devcgroup_inode_permission(struct inode *inode, int mask) 16static inline int devcgroup_inode_permission(struct inode *inode, int mask)
9{ return 0; } 17{ return 0; }
diff --git a/include/linux/dio.h b/include/linux/dio.h
index b2dd31ca1710..2cc0fd00463f 100644
--- a/include/linux/dio.h
+++ b/include/linux/dio.h
@@ -254,7 +254,7 @@ static inline struct dio_driver *dio_dev_driver(const struct dio_dev *d)
254 254
255#define dio_resource_start(d) ((d)->resource.start) 255#define dio_resource_start(d) ((d)->resource.start)
256#define dio_resource_end(d) ((d)->resource.end) 256#define dio_resource_end(d) ((d)->resource.end)
257#define dio_resource_len(d) ((d)->resource.end-(d)->resource.start+1) 257#define dio_resource_len(d) (resource_size(&(d)->resource))
258#define dio_resource_flags(d) ((d)->resource.flags) 258#define dio_resource_flags(d) ((d)->resource.flags)
259 259
260#define dio_request_device(d, name) \ 260#define dio_request_device(d, name) \
diff --git a/include/linux/dm-ioctl.h b/include/linux/dm-ioctl.h
index 3708455ee6c3..0cb8eff76bd6 100644
--- a/include/linux/dm-ioctl.h
+++ b/include/linux/dm-ioctl.h
@@ -267,9 +267,9 @@ enum {
267#define DM_DEV_SET_GEOMETRY _IOWR(DM_IOCTL, DM_DEV_SET_GEOMETRY_CMD, struct dm_ioctl) 267#define DM_DEV_SET_GEOMETRY _IOWR(DM_IOCTL, DM_DEV_SET_GEOMETRY_CMD, struct dm_ioctl)
268 268
269#define DM_VERSION_MAJOR 4 269#define DM_VERSION_MAJOR 4
270#define DM_VERSION_MINOR 20 270#define DM_VERSION_MINOR 21
271#define DM_VERSION_PATCHLEVEL 0 271#define DM_VERSION_PATCHLEVEL 0
272#define DM_VERSION_EXTRA "-ioctl (2011-02-02)" 272#define DM_VERSION_EXTRA "-ioctl (2011-07-06)"
273 273
274/* Status bits */ 274/* Status bits */
275#define DM_READONLY_FLAG (1 << 0) /* In/Out */ 275#define DM_READONLY_FLAG (1 << 0) /* In/Out */
diff --git a/include/linux/dm-kcopyd.h b/include/linux/dm-kcopyd.h
index 298d587e349b..5e54458e920f 100644
--- a/include/linux/dm-kcopyd.h
+++ b/include/linux/dm-kcopyd.h
@@ -42,5 +42,20 @@ int dm_kcopyd_copy(struct dm_kcopyd_client *kc, struct dm_io_region *from,
42 unsigned num_dests, struct dm_io_region *dests, 42 unsigned num_dests, struct dm_io_region *dests,
43 unsigned flags, dm_kcopyd_notify_fn fn, void *context); 43 unsigned flags, dm_kcopyd_notify_fn fn, void *context);
44 44
45/*
46 * Prepare a callback and submit it via the kcopyd thread.
47 *
48 * dm_kcopyd_prepare_callback allocates a callback structure and returns it.
49 * It must not be called from interrupt context.
50 * The returned value should be passed into dm_kcopyd_do_callback.
51 *
52 * dm_kcopyd_do_callback submits the callback.
53 * It may be called from interrupt context.
54 * The callback is issued from the kcopyd thread.
55 */
56void *dm_kcopyd_prepare_callback(struct dm_kcopyd_client *kc,
57 dm_kcopyd_notify_fn fn, void *context);
58void dm_kcopyd_do_callback(void *job, int read_err, unsigned long write_err);
59
45#endif /* __KERNEL__ */ 60#endif /* __KERNEL__ */
46#endif /* _LINUX_DM_KCOPYD_H */ 61#endif /* _LINUX_DM_KCOPYD_H */
diff --git a/include/linux/dma-direction.h b/include/linux/dma-direction.h
new file mode 100644
index 000000000000..95b6a82f5951
--- /dev/null
+++ b/include/linux/dma-direction.h
@@ -0,0 +1,13 @@
1#ifndef _LINUX_DMA_DIRECTION_H
2#define _LINUX_DMA_DIRECTION_H
3/*
4 * These definitions mirror those in pci.h, so they can be used
5 * interchangeably with their PCI_ counterparts.
6 */
7enum dma_data_direction {
8 DMA_BIDIRECTIONAL = 0,
9 DMA_TO_DEVICE = 1,
10 DMA_FROM_DEVICE = 2,
11 DMA_NONE = 3,
12};
13#endif
diff --git a/include/linux/dma-mapping.h b/include/linux/dma-mapping.h
index ba8319ae5fcc..347fdc32177a 100644
--- a/include/linux/dma-mapping.h
+++ b/include/linux/dma-mapping.h
@@ -4,17 +4,9 @@
4#include <linux/device.h> 4#include <linux/device.h>
5#include <linux/err.h> 5#include <linux/err.h>
6#include <linux/dma-attrs.h> 6#include <linux/dma-attrs.h>
7#include <linux/dma-direction.h>
7#include <linux/scatterlist.h> 8#include <linux/scatterlist.h>
8 9
9/* These definitions mirror those in pci.h, so they can be used
10 * interchangeably with their PCI_ counterparts */
11enum dma_data_direction {
12 DMA_BIDIRECTIONAL = 0,
13 DMA_TO_DEVICE = 1,
14 DMA_FROM_DEVICE = 2,
15 DMA_NONE = 3,
16};
17
18struct dma_map_ops { 10struct dma_map_ops {
19 void* (*alloc_coherent)(struct device *dev, size_t size, 11 void* (*alloc_coherent)(struct device *dev, size_t size,
20 dma_addr_t *dma_handle, gfp_t gfp); 12 dma_addr_t *dma_handle, gfp_t gfp);
@@ -54,27 +46,6 @@ struct dma_map_ops {
54 46
55#define DMA_BIT_MASK(n) (((n) == 64) ? ~0ULL : ((1ULL<<(n))-1)) 47#define DMA_BIT_MASK(n) (((n) == 64) ? ~0ULL : ((1ULL<<(n))-1))
56 48
57typedef u64 DMA_nnBIT_MASK __deprecated;
58
59/*
60 * NOTE: do not use the below macros in new code and do not add new definitions
61 * here.
62 *
63 * Instead, just open-code DMA_BIT_MASK(n) within your driver
64 */
65#define DMA_64BIT_MASK (DMA_nnBIT_MASK)DMA_BIT_MASK(64)
66#define DMA_48BIT_MASK (DMA_nnBIT_MASK)DMA_BIT_MASK(48)
67#define DMA_47BIT_MASK (DMA_nnBIT_MASK)DMA_BIT_MASK(47)
68#define DMA_40BIT_MASK (DMA_nnBIT_MASK)DMA_BIT_MASK(40)
69#define DMA_39BIT_MASK (DMA_nnBIT_MASK)DMA_BIT_MASK(39)
70#define DMA_35BIT_MASK (DMA_nnBIT_MASK)DMA_BIT_MASK(35)
71#define DMA_32BIT_MASK (DMA_nnBIT_MASK)DMA_BIT_MASK(32)
72#define DMA_31BIT_MASK (DMA_nnBIT_MASK)DMA_BIT_MASK(31)
73#define DMA_30BIT_MASK (DMA_nnBIT_MASK)DMA_BIT_MASK(30)
74#define DMA_29BIT_MASK (DMA_nnBIT_MASK)DMA_BIT_MASK(29)
75#define DMA_28BIT_MASK (DMA_nnBIT_MASK)DMA_BIT_MASK(28)
76#define DMA_24BIT_MASK (DMA_nnBIT_MASK)DMA_BIT_MASK(24)
77
78#define DMA_MASK_NONE 0x0ULL 49#define DMA_MASK_NONE 0x0ULL
79 50
80static inline int valid_dma_direction(int dma_direction) 51static inline int valid_dma_direction(int dma_direction)
diff --git a/include/linux/dma_remapping.h b/include/linux/dma_remapping.h
index 5619f8522738..bbd8661b3473 100644
--- a/include/linux/dma_remapping.h
+++ b/include/linux/dma_remapping.h
@@ -9,8 +9,12 @@
9#define VTD_PAGE_MASK (((u64)-1) << VTD_PAGE_SHIFT) 9#define VTD_PAGE_MASK (((u64)-1) << VTD_PAGE_SHIFT)
10#define VTD_PAGE_ALIGN(addr) (((addr) + VTD_PAGE_SIZE - 1) & VTD_PAGE_MASK) 10#define VTD_PAGE_ALIGN(addr) (((addr) + VTD_PAGE_SIZE - 1) & VTD_PAGE_MASK)
11 11
12#define VTD_STRIDE_SHIFT (9)
13#define VTD_STRIDE_MASK (((u64)-1) << VTD_STRIDE_SHIFT)
14
12#define DMA_PTE_READ (1) 15#define DMA_PTE_READ (1)
13#define DMA_PTE_WRITE (2) 16#define DMA_PTE_WRITE (2)
17#define DMA_PTE_LARGE_PAGE (1 << 7)
14#define DMA_PTE_SNP (1 << 11) 18#define DMA_PTE_SNP (1 << 11)
15 19
16#define CONTEXT_TT_MULTI_LEVEL 0 20#define CONTEXT_TT_MULTI_LEVEL 0
diff --git a/include/linux/dmaengine.h b/include/linux/dmaengine.h
index eee7addec282..8fbf40e0713c 100644
--- a/include/linux/dmaengine.h
+++ b/include/linux/dmaengine.h
@@ -23,7 +23,9 @@
23 23
24#include <linux/device.h> 24#include <linux/device.h>
25#include <linux/uio.h> 25#include <linux/uio.h>
26#include <linux/dma-mapping.h> 26#include <linux/dma-direction.h>
27
28struct scatterlist;
27 29
28/** 30/**
29 * typedef dma_cookie_t - an opaque DMA cookie 31 * typedef dma_cookie_t - an opaque DMA cookie
diff --git a/include/linux/drbd_limits.h b/include/linux/drbd_limits.h
index 246f576c981d..447c36752385 100644
--- a/include/linux/drbd_limits.h
+++ b/include/linux/drbd_limits.h
@@ -117,10 +117,10 @@
117/* drbdsetup XY resize -d Z 117/* drbdsetup XY resize -d Z
118 * you are free to reduce the device size to nothing, if you want to. 118 * you are free to reduce the device size to nothing, if you want to.
119 * the upper limit with 64bit kernel, enough ram and flexible meta data 119 * the upper limit with 64bit kernel, enough ram and flexible meta data
120 * is 16 TB, currently. */ 120 * is 1 PiB, currently. */
121/* DRBD_MAX_SECTORS */ 121/* DRBD_MAX_SECTORS */
122#define DRBD_DISK_SIZE_SECT_MIN 0 122#define DRBD_DISK_SIZE_SECT_MIN 0
123#define DRBD_DISK_SIZE_SECT_MAX (16 * (2LLU << 30)) 123#define DRBD_DISK_SIZE_SECT_MAX (1 * (2LLU << 40))
124#define DRBD_DISK_SIZE_SECT_DEF 0 /* = disabled = no user size... */ 124#define DRBD_DISK_SIZE_SECT_DEF 0 /* = disabled = no user size... */
125 125
126#define DRBD_ON_IO_ERROR_DEF EP_PASS_ON 126#define DRBD_ON_IO_ERROR_DEF EP_PASS_ON
diff --git a/include/linux/dvb/audio.h b/include/linux/dvb/audio.h
index fec66bd24f22..d47bccd604e4 100644
--- a/include/linux/dvb/audio.h
+++ b/include/linux/dvb/audio.h
@@ -67,7 +67,7 @@ typedef struct audio_status {
67 67
68 68
69typedef 69typedef
70struct audio_karaoke{ /* if Vocal1 or Vocal2 are non-zero, they get mixed */ 70struct audio_karaoke { /* if Vocal1 or Vocal2 are non-zero, they get mixed */
71 int vocal1; /* into left and right t at 70% each */ 71 int vocal1; /* into left and right t at 70% each */
72 int vocal2; /* if both, Vocal1 and Vocal2 are non-zero, Vocal1 gets*/ 72 int vocal2; /* if both, Vocal1 and Vocal2 are non-zero, Vocal1 gets*/
73 int melody; /* mixed into the left channel and */ 73 int melody; /* mixed into the left channel and */
diff --git a/include/linux/dw_apb_timer.h b/include/linux/dw_apb_timer.h
new file mode 100644
index 000000000000..49638ea3b776
--- /dev/null
+++ b/include/linux/dw_apb_timer.h
@@ -0,0 +1,56 @@
1/*
2 * (C) Copyright 2009 Intel Corporation
3 * Author: Jacob Pan (jacob.jun.pan@intel.com)
4 *
5 * Shared with ARM platforms, Jamie Iles, Picochip 2011
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 * Support for the Synopsys DesignWare APB Timers.
12 */
13#ifndef __DW_APB_TIMER_H__
14#define __DW_APB_TIMER_H__
15
16#include <linux/clockchips.h>
17#include <linux/clocksource.h>
18#include <linux/interrupt.h>
19
20#define APBTMRS_REG_SIZE 0x14
21
22struct dw_apb_timer {
23 void __iomem *base;
24 unsigned long freq;
25 int irq;
26};
27
28struct dw_apb_clock_event_device {
29 struct clock_event_device ced;
30 struct dw_apb_timer timer;
31 struct irqaction irqaction;
32 void (*eoi)(struct dw_apb_timer *);
33};
34
35struct dw_apb_clocksource {
36 struct dw_apb_timer timer;
37 struct clocksource cs;
38};
39
40void dw_apb_clockevent_register(struct dw_apb_clock_event_device *dw_ced);
41void dw_apb_clockevent_pause(struct dw_apb_clock_event_device *dw_ced);
42void dw_apb_clockevent_resume(struct dw_apb_clock_event_device *dw_ced);
43void dw_apb_clockevent_stop(struct dw_apb_clock_event_device *dw_ced);
44
45struct dw_apb_clock_event_device *
46dw_apb_clockevent_init(int cpu, const char *name, unsigned rating,
47 void __iomem *base, int irq, unsigned long freq);
48struct dw_apb_clocksource *
49dw_apb_clocksource_init(unsigned rating, char *name, void __iomem *base,
50 unsigned long freq);
51void dw_apb_clocksource_register(struct dw_apb_clocksource *dw_cs);
52void dw_apb_clocksource_start(struct dw_apb_clocksource *dw_cs);
53cycle_t dw_apb_clocksource_read(struct dw_apb_clocksource *dw_cs);
54void dw_apb_clocksource_unregister(struct dw_apb_clocksource *dw_cs);
55
56#endif /* __DW_APB_TIMER_H__ */
diff --git a/include/linux/ecryptfs.h b/include/linux/ecryptfs.h
new file mode 100644
index 000000000000..2224a8c0cb64
--- /dev/null
+++ b/include/linux/ecryptfs.h
@@ -0,0 +1,113 @@
1#ifndef _LINUX_ECRYPTFS_H
2#define _LINUX_ECRYPTFS_H
3
4/* Version verification for shared data structures w/ userspace */
5#define ECRYPTFS_VERSION_MAJOR 0x00
6#define ECRYPTFS_VERSION_MINOR 0x04
7#define ECRYPTFS_SUPPORTED_FILE_VERSION 0x03
8/* These flags indicate which features are supported by the kernel
9 * module; userspace tools such as the mount helper read
10 * ECRYPTFS_VERSIONING_MASK from a sysfs handle in order to determine
11 * how to behave. */
12#define ECRYPTFS_VERSIONING_PASSPHRASE 0x00000001
13#define ECRYPTFS_VERSIONING_PUBKEY 0x00000002
14#define ECRYPTFS_VERSIONING_PLAINTEXT_PASSTHROUGH 0x00000004
15#define ECRYPTFS_VERSIONING_POLICY 0x00000008
16#define ECRYPTFS_VERSIONING_XATTR 0x00000010
17#define ECRYPTFS_VERSIONING_MULTKEY 0x00000020
18#define ECRYPTFS_VERSIONING_DEVMISC 0x00000040
19#define ECRYPTFS_VERSIONING_HMAC 0x00000080
20#define ECRYPTFS_VERSIONING_FILENAME_ENCRYPTION 0x00000100
21#define ECRYPTFS_VERSIONING_GCM 0x00000200
22#define ECRYPTFS_VERSIONING_MASK (ECRYPTFS_VERSIONING_PASSPHRASE \
23 | ECRYPTFS_VERSIONING_PLAINTEXT_PASSTHROUGH \
24 | ECRYPTFS_VERSIONING_PUBKEY \
25 | ECRYPTFS_VERSIONING_XATTR \
26 | ECRYPTFS_VERSIONING_MULTKEY \
27 | ECRYPTFS_VERSIONING_DEVMISC \
28 | ECRYPTFS_VERSIONING_FILENAME_ENCRYPTION)
29#define ECRYPTFS_MAX_PASSWORD_LENGTH 64
30#define ECRYPTFS_MAX_PASSPHRASE_BYTES ECRYPTFS_MAX_PASSWORD_LENGTH
31#define ECRYPTFS_SALT_SIZE 8
32#define ECRYPTFS_SALT_SIZE_HEX (ECRYPTFS_SALT_SIZE*2)
33/* The original signature size is only for what is stored on disk; all
34 * in-memory representations are expanded hex, so it better adapted to
35 * be passed around or referenced on the command line */
36#define ECRYPTFS_SIG_SIZE 8
37#define ECRYPTFS_SIG_SIZE_HEX (ECRYPTFS_SIG_SIZE*2)
38#define ECRYPTFS_PASSWORD_SIG_SIZE ECRYPTFS_SIG_SIZE_HEX
39#define ECRYPTFS_MAX_KEY_BYTES 64
40#define ECRYPTFS_MAX_ENCRYPTED_KEY_BYTES 512
41#define ECRYPTFS_FILE_VERSION 0x03
42#define ECRYPTFS_MAX_PKI_NAME_BYTES 16
43
44#define RFC2440_CIPHER_DES3_EDE 0x02
45#define RFC2440_CIPHER_CAST_5 0x03
46#define RFC2440_CIPHER_BLOWFISH 0x04
47#define RFC2440_CIPHER_AES_128 0x07
48#define RFC2440_CIPHER_AES_192 0x08
49#define RFC2440_CIPHER_AES_256 0x09
50#define RFC2440_CIPHER_TWOFISH 0x0a
51#define RFC2440_CIPHER_CAST_6 0x0b
52
53#define RFC2440_CIPHER_RSA 0x01
54
55/**
56 * For convenience, we may need to pass around the encrypted session
57 * key between kernel and userspace because the authentication token
58 * may not be extractable. For example, the TPM may not release the
59 * private key, instead requiring the encrypted data and returning the
60 * decrypted data.
61 */
62struct ecryptfs_session_key {
63#define ECRYPTFS_USERSPACE_SHOULD_TRY_TO_DECRYPT 0x00000001
64#define ECRYPTFS_USERSPACE_SHOULD_TRY_TO_ENCRYPT 0x00000002
65#define ECRYPTFS_CONTAINS_DECRYPTED_KEY 0x00000004
66#define ECRYPTFS_CONTAINS_ENCRYPTED_KEY 0x00000008
67 u32 flags;
68 u32 encrypted_key_size;
69 u32 decrypted_key_size;
70 u8 encrypted_key[ECRYPTFS_MAX_ENCRYPTED_KEY_BYTES];
71 u8 decrypted_key[ECRYPTFS_MAX_KEY_BYTES];
72};
73
74struct ecryptfs_password {
75 u32 password_bytes;
76 s32 hash_algo;
77 u32 hash_iterations;
78 u32 session_key_encryption_key_bytes;
79#define ECRYPTFS_PERSISTENT_PASSWORD 0x01
80#define ECRYPTFS_SESSION_KEY_ENCRYPTION_KEY_SET 0x02
81 u32 flags;
82 /* Iterated-hash concatenation of salt and passphrase */
83 u8 session_key_encryption_key[ECRYPTFS_MAX_KEY_BYTES];
84 u8 signature[ECRYPTFS_PASSWORD_SIG_SIZE + 1];
85 /* Always in expanded hex */
86 u8 salt[ECRYPTFS_SALT_SIZE];
87};
88
89enum ecryptfs_token_types {ECRYPTFS_PASSWORD, ECRYPTFS_PRIVATE_KEY};
90
91struct ecryptfs_private_key {
92 u32 key_size;
93 u32 data_len;
94 u8 signature[ECRYPTFS_PASSWORD_SIG_SIZE + 1];
95 char pki_type[ECRYPTFS_MAX_PKI_NAME_BYTES + 1];
96 u8 data[];
97};
98
99/* May be a password or a private key */
100struct ecryptfs_auth_tok {
101 u16 version; /* 8-bit major and 8-bit minor */
102 u16 token_type;
103#define ECRYPTFS_ENCRYPT_ONLY 0x00000001
104 u32 flags;
105 struct ecryptfs_session_key session_key;
106 u8 reserved[32];
107 union {
108 struct ecryptfs_password password;
109 struct ecryptfs_private_key private_key;
110 } token;
111} __attribute__ ((packed));
112
113#endif /* _LINUX_ECRYPTFS_H */
diff --git a/include/linux/edac.h b/include/linux/edac.h
index 36c66443bdfd..4a73257b47d0 100644
--- a/include/linux/edac.h
+++ b/include/linux/edac.h
@@ -12,7 +12,7 @@
12#ifndef _LINUX_EDAC_H_ 12#ifndef _LINUX_EDAC_H_
13#define _LINUX_EDAC_H_ 13#define _LINUX_EDAC_H_
14 14
15#include <asm/atomic.h> 15#include <linux/atomic.h>
16#include <linux/sysdev.h> 16#include <linux/sysdev.h>
17 17
18#define EDAC_OPSTATE_INVAL -1 18#define EDAC_OPSTATE_INVAL -1
diff --git a/include/linux/eeprom_93xx46.h b/include/linux/eeprom_93xx46.h
new file mode 100644
index 000000000000..06791811e49d
--- /dev/null
+++ b/include/linux/eeprom_93xx46.h
@@ -0,0 +1,18 @@
1/*
2 * Module: eeprom_93xx46
3 * platform description for 93xx46 EEPROMs.
4 */
5
6struct eeprom_93xx46_platform_data {
7 unsigned char flags;
8#define EE_ADDR8 0x01 /* 8 bit addr. cfg */
9#define EE_ADDR16 0x02 /* 16 bit addr. cfg */
10#define EE_READONLY 0x08 /* forbid writing */
11
12 /*
13 * optional hooks to control additional logic
14 * before and after spi transfer.
15 */
16 void (*prepare)(void *);
17 void (*finish)(void *);
18};
diff --git a/include/linux/efi.h b/include/linux/efi.h
index e376270cd26e..2362a0bc7f0d 100644
--- a/include/linux/efi.h
+++ b/include/linux/efi.h
@@ -19,6 +19,7 @@
19#include <linux/rtc.h> 19#include <linux/rtc.h>
20#include <linux/ioport.h> 20#include <linux/ioport.h>
21#include <linux/pfn.h> 21#include <linux/pfn.h>
22#include <linux/pstore.h>
22 23
23#include <asm/page.h> 24#include <asm/page.h>
24#include <asm/system.h> 25#include <asm/system.h>
@@ -101,6 +102,13 @@ typedef struct {
101 u64 attribute; 102 u64 attribute;
102} efi_memory_desc_t; 103} efi_memory_desc_t;
103 104
105typedef struct {
106 efi_guid_t guid;
107 u32 headersize;
108 u32 flags;
109 u32 imagesize;
110} efi_capsule_header_t;
111
104typedef int (*efi_freemem_callback_t) (u64 start, u64 end, void *arg); 112typedef int (*efi_freemem_callback_t) (u64 start, u64 end, void *arg);
105 113
106/* 114/*
@@ -156,6 +164,9 @@ typedef struct {
156 unsigned long set_variable; 164 unsigned long set_variable;
157 unsigned long get_next_high_mono_count; 165 unsigned long get_next_high_mono_count;
158 unsigned long reset_system; 166 unsigned long reset_system;
167 unsigned long update_capsule;
168 unsigned long query_capsule_caps;
169 unsigned long query_variable_info;
159} efi_runtime_services_t; 170} efi_runtime_services_t;
160 171
161typedef efi_status_t efi_get_time_t (efi_time_t *tm, efi_time_cap_t *tc); 172typedef efi_status_t efi_get_time_t (efi_time_t *tm, efi_time_cap_t *tc);
@@ -168,7 +179,7 @@ typedef efi_status_t efi_get_variable_t (efi_char16_t *name, efi_guid_t *vendor,
168typedef efi_status_t efi_get_next_variable_t (unsigned long *name_size, efi_char16_t *name, 179typedef efi_status_t efi_get_next_variable_t (unsigned long *name_size, efi_char16_t *name,
169 efi_guid_t *vendor); 180 efi_guid_t *vendor);
170typedef efi_status_t efi_set_variable_t (efi_char16_t *name, efi_guid_t *vendor, 181typedef efi_status_t efi_set_variable_t (efi_char16_t *name, efi_guid_t *vendor,
171 unsigned long attr, unsigned long data_size, 182 u32 attr, unsigned long data_size,
172 void *data); 183 void *data);
173typedef efi_status_t efi_get_next_high_mono_count_t (u32 *count); 184typedef efi_status_t efi_get_next_high_mono_count_t (u32 *count);
174typedef void efi_reset_system_t (int reset_type, efi_status_t status, 185typedef void efi_reset_system_t (int reset_type, efi_status_t status,
@@ -177,6 +188,17 @@ typedef efi_status_t efi_set_virtual_address_map_t (unsigned long memory_map_siz
177 unsigned long descriptor_size, 188 unsigned long descriptor_size,
178 u32 descriptor_version, 189 u32 descriptor_version,
179 efi_memory_desc_t *virtual_map); 190 efi_memory_desc_t *virtual_map);
191typedef efi_status_t efi_query_variable_info_t(u32 attr,
192 u64 *storage_space,
193 u64 *remaining_space,
194 u64 *max_variable_size);
195typedef efi_status_t efi_update_capsule_t(efi_capsule_header_t **capsules,
196 unsigned long count,
197 unsigned long sg_list);
198typedef efi_status_t efi_query_capsule_caps_t(efi_capsule_header_t **capsules,
199 unsigned long count,
200 u64 *max_size,
201 int *reset_type);
180 202
181/* 203/*
182 * EFI Configuration Table and GUID definitions 204 * EFI Configuration Table and GUID definitions
@@ -211,6 +233,9 @@ typedef efi_status_t efi_set_virtual_address_map_t (unsigned long memory_map_siz
211#define UV_SYSTEM_TABLE_GUID \ 233#define UV_SYSTEM_TABLE_GUID \
212 EFI_GUID( 0x3b13a7d4, 0x633e, 0x11dd, 0x93, 0xec, 0xda, 0x25, 0x56, 0xd8, 0x95, 0x93 ) 234 EFI_GUID( 0x3b13a7d4, 0x633e, 0x11dd, 0x93, 0xec, 0xda, 0x25, 0x56, 0xd8, 0x95, 0x93 )
213 235
236#define LINUX_EFI_CRASH_GUID \
237 EFI_GUID( 0xcfc8fc79, 0xbe2e, 0x4ddc, 0x97, 0xf0, 0x9f, 0x98, 0xbf, 0xe2, 0x98, 0xa0 )
238
214typedef struct { 239typedef struct {
215 efi_guid_t guid; 240 efi_guid_t guid;
216 unsigned long table; 241 unsigned long table;
@@ -218,6 +243,13 @@ typedef struct {
218 243
219#define EFI_SYSTEM_TABLE_SIGNATURE ((u64)0x5453595320494249ULL) 244#define EFI_SYSTEM_TABLE_SIGNATURE ((u64)0x5453595320494249ULL)
220 245
246#define EFI_2_30_SYSTEM_TABLE_REVISION ((2 << 16) | (30))
247#define EFI_2_20_SYSTEM_TABLE_REVISION ((2 << 16) | (20))
248#define EFI_2_10_SYSTEM_TABLE_REVISION ((2 << 16) | (10))
249#define EFI_2_00_SYSTEM_TABLE_REVISION ((2 << 16) | (00))
250#define EFI_1_10_SYSTEM_TABLE_REVISION ((1 << 16) | (10))
251#define EFI_1_02_SYSTEM_TABLE_REVISION ((1 << 16) | (02))
252
221typedef struct { 253typedef struct {
222 efi_table_hdr_t hdr; 254 efi_table_hdr_t hdr;
223 unsigned long fw_vendor; /* physical addr of CHAR16 vendor string */ 255 unsigned long fw_vendor; /* physical addr of CHAR16 vendor string */
@@ -250,6 +282,7 @@ struct efi_memory_map {
250 */ 282 */
251extern struct efi { 283extern struct efi {
252 efi_system_table_t *systab; /* EFI system table */ 284 efi_system_table_t *systab; /* EFI system table */
285 unsigned int runtime_version; /* Runtime services version */
253 unsigned long mps; /* MPS table */ 286 unsigned long mps; /* MPS table */
254 unsigned long acpi; /* ACPI table (IA64 ext 0.71) */ 287 unsigned long acpi; /* ACPI table (IA64 ext 0.71) */
255 unsigned long acpi20; /* ACPI table (ACPI 2.0) */ 288 unsigned long acpi20; /* ACPI table (ACPI 2.0) */
@@ -266,6 +299,9 @@ extern struct efi {
266 efi_get_variable_t *get_variable; 299 efi_get_variable_t *get_variable;
267 efi_get_next_variable_t *get_next_variable; 300 efi_get_next_variable_t *get_next_variable;
268 efi_set_variable_t *set_variable; 301 efi_set_variable_t *set_variable;
302 efi_query_variable_info_t *query_variable_info;
303 efi_update_capsule_t *update_capsule;
304 efi_query_capsule_caps_t *query_capsule_caps;
269 efi_get_next_high_mono_count_t *get_next_high_mono_count; 305 efi_get_next_high_mono_count_t *get_next_high_mono_count;
270 efi_reset_system_t *reset_system; 306 efi_reset_system_t *reset_system;
271 efi_set_virtual_address_map_t *set_virtual_address_map; 307 efi_set_virtual_address_map_t *set_virtual_address_map;
@@ -426,6 +462,8 @@ struct efivars {
426 struct kset *kset; 462 struct kset *kset;
427 struct bin_attribute *new_var, *del_var; 463 struct bin_attribute *new_var, *del_var;
428 const struct efivar_operations *ops; 464 const struct efivar_operations *ops;
465 struct efivar_entry *walk_entry;
466 struct pstore_info efi_pstore_info;
429}; 467};
430 468
431int register_efivars(struct efivars *efivars, 469int register_efivars(struct efivars *efivars,
diff --git a/include/linux/elevator.h b/include/linux/elevator.h
index 21a8ebf2dc3a..d800d5142184 100644
--- a/include/linux/elevator.h
+++ b/include/linux/elevator.h
@@ -146,7 +146,7 @@ extern struct request *elv_rb_latter_request(struct request_queue *, struct requ
146/* 146/*
147 * rb support functions. 147 * rb support functions.
148 */ 148 */
149extern struct request *elv_rb_add(struct rb_root *, struct request *); 149extern void elv_rb_add(struct rb_root *, struct request *);
150extern void elv_rb_del(struct rb_root *, struct request *); 150extern void elv_rb_del(struct rb_root *, struct request *);
151extern struct request *elv_rb_find(struct rb_root *, sector_t); 151extern struct request *elv_rb_find(struct rb_root *, sector_t);
152 152
diff --git a/include/linux/etherdevice.h b/include/linux/etherdevice.h
index ab68f785fd19..05955cf09937 100644
--- a/include/linux/etherdevice.h
+++ b/include/linux/etherdevice.h
@@ -38,7 +38,7 @@ extern int eth_header(struct sk_buff *skb, struct net_device *dev,
38 const void *daddr, const void *saddr, unsigned len); 38 const void *daddr, const void *saddr, unsigned len);
39extern int eth_rebuild_header(struct sk_buff *skb); 39extern int eth_rebuild_header(struct sk_buff *skb);
40extern int eth_header_parse(const struct sk_buff *skb, unsigned char *haddr); 40extern int eth_header_parse(const struct sk_buff *skb, unsigned char *haddr);
41extern int eth_header_cache(const struct neighbour *neigh, struct hh_cache *hh); 41extern int eth_header_cache(const struct neighbour *neigh, struct hh_cache *hh, __be16 type);
42extern void eth_header_cache_update(struct hh_cache *hh, 42extern void eth_header_cache_update(struct hh_cache *hh,
43 const struct net_device *dev, 43 const struct net_device *dev,
44 const unsigned char *haddr); 44 const unsigned char *haddr);
diff --git a/include/linux/ethtool.h b/include/linux/ethtool.h
index c6a850ab2ec5..c6e427ab65fe 100644
--- a/include/linux/ethtool.h
+++ b/include/linux/ethtool.h
@@ -268,7 +268,7 @@ struct ethtool_pauseparam {
268 __u32 cmd; /* ETHTOOL_{G,S}PAUSEPARAM */ 268 __u32 cmd; /* ETHTOOL_{G,S}PAUSEPARAM */
269 269
270 /* If the link is being auto-negotiated (via ethtool_cmd.autoneg 270 /* If the link is being auto-negotiated (via ethtool_cmd.autoneg
271 * being true) the user may set 'autonet' here non-zero to have the 271 * being true) the user may set 'autoneg' here non-zero to have the
272 * pause parameters be auto-negotiated too. In such a case, the 272 * pause parameters be auto-negotiated too. In such a case, the
273 * {rx,tx}_pause values below determine what capabilities are 273 * {rx,tx}_pause values below determine what capabilities are
274 * advertised. 274 * advertised.
@@ -287,7 +287,7 @@ enum ethtool_stringset {
287 ETH_SS_TEST = 0, 287 ETH_SS_TEST = 0,
288 ETH_SS_STATS, 288 ETH_SS_STATS,
289 ETH_SS_PRIV_FLAGS, 289 ETH_SS_PRIV_FLAGS,
290 ETH_SS_NTUPLE_FILTERS, 290 ETH_SS_NTUPLE_FILTERS, /* Do not use, GRXNTUPLE is now deprecated */
291 ETH_SS_FEATURES, 291 ETH_SS_FEATURES,
292}; 292};
293 293
@@ -310,9 +310,21 @@ struct ethtool_sset_info {
310 __u32's, etc. */ 310 __u32's, etc. */
311}; 311};
312 312
313/**
314 * enum ethtool_test_flags - flags definition of ethtool_test
315 * @ETH_TEST_FL_OFFLINE: if set perform online and offline tests, otherwise
316 * only online tests.
317 * @ETH_TEST_FL_FAILED: Driver set this flag if test fails.
318 * @ETH_TEST_FL_EXTERNAL_LB: Application request to perform external loopback
319 * test.
320 * @ETH_TEST_FL_EXTERNAL_LB_DONE: Driver performed the external loopback test
321 */
322
313enum ethtool_test_flags { 323enum ethtool_test_flags {
314 ETH_TEST_FL_OFFLINE = (1 << 0), /* online / offline */ 324 ETH_TEST_FL_OFFLINE = (1 << 0),
315 ETH_TEST_FL_FAILED = (1 << 1), /* test passed / failed */ 325 ETH_TEST_FL_FAILED = (1 << 1),
326 ETH_TEST_FL_EXTERNAL_LB = (1 << 2),
327 ETH_TEST_FL_EXTERNAL_LB_DONE = (1 << 3),
316}; 328};
317 329
318/* for requesting NIC test and getting results*/ 330/* for requesting NIC test and getting results*/
@@ -714,18 +726,6 @@ enum ethtool_sfeatures_retval_bits {
714/* needed by dev_disable_lro() */ 726/* needed by dev_disable_lro() */
715extern int __ethtool_set_flags(struct net_device *dev, u32 flags); 727extern int __ethtool_set_flags(struct net_device *dev, u32 flags);
716 728
717struct ethtool_rx_ntuple_flow_spec_container {
718 struct ethtool_rx_ntuple_flow_spec fs;
719 struct list_head list;
720};
721
722struct ethtool_rx_ntuple_list {
723#define ETHTOOL_MAX_NTUPLE_LIST_ENTRY 1024
724#define ETHTOOL_MAX_NTUPLE_STRING_PER_ENTRY 14
725 struct list_head list;
726 unsigned int count;
727};
728
729/** 729/**
730 * enum ethtool_phys_id_state - indicator state for physical identification 730 * enum ethtool_phys_id_state - indicator state for physical identification
731 * @ETHTOOL_ID_INACTIVE: Physical ID indicator should be deactivated 731 * @ETHTOOL_ID_INACTIVE: Physical ID indicator should be deactivated
@@ -758,7 +758,6 @@ u32 ethtool_op_get_ufo(struct net_device *dev);
758int ethtool_op_set_ufo(struct net_device *dev, u32 data); 758int ethtool_op_set_ufo(struct net_device *dev, u32 data);
759u32 ethtool_op_get_flags(struct net_device *dev); 759u32 ethtool_op_get_flags(struct net_device *dev);
760int ethtool_op_set_flags(struct net_device *dev, u32 data, u32 supported); 760int ethtool_op_set_flags(struct net_device *dev, u32 data, u32 supported);
761void ethtool_ntuple_flush(struct net_device *dev);
762bool ethtool_invalid_flags(struct net_device *dev, u32 data, u32 supported); 761bool ethtool_invalid_flags(struct net_device *dev, u32 data, u32 supported);
763 762
764/** 763/**
@@ -811,7 +810,7 @@ bool ethtool_invalid_flags(struct net_device *dev, u32 data, u32 supported);
811 * @get_tx_csum: Deprecated as redundant. Report whether transmit checksums 810 * @get_tx_csum: Deprecated as redundant. Report whether transmit checksums
812 * are turned on or off. 811 * are turned on or off.
813 * @set_tx_csum: Deprecated in favour of generic netdev features. Turn 812 * @set_tx_csum: Deprecated in favour of generic netdev features. Turn
814 * transmit checksums on or off. Returns a egative error code or zero. 813 * transmit checksums on or off. Returns a negative error code or zero.
815 * @get_sg: Deprecated as redundant. Report whether scatter-gather is 814 * @get_sg: Deprecated as redundant. Report whether scatter-gather is
816 * enabled. 815 * enabled.
817 * @set_sg: Deprecated in favour of generic netdev features. Turn 816 * @set_sg: Deprecated in favour of generic netdev features. Turn
@@ -865,7 +864,6 @@ bool ethtool_invalid_flags(struct net_device *dev, u32 data, u32 supported);
865 * error code or zero. 864 * error code or zero.
866 * @set_rx_ntuple: Set an RX n-tuple rule. Returns a negative error code 865 * @set_rx_ntuple: Set an RX n-tuple rule. Returns a negative error code
867 * or zero. 866 * or zero.
868 * @get_rx_ntuple: Deprecated.
869 * @get_rxfh_indir: Get the contents of the RX flow hash indirection table. 867 * @get_rxfh_indir: Get the contents of the RX flow hash indirection table.
870 * Returns a negative error code or zero. 868 * Returns a negative error code or zero.
871 * @set_rxfh_indir: Set the contents of the RX flow hash indirection table. 869 * @set_rxfh_indir: Set the contents of the RX flow hash indirection table.
@@ -944,7 +942,6 @@ struct ethtool_ops {
944 int (*reset)(struct net_device *, u32 *); 942 int (*reset)(struct net_device *, u32 *);
945 int (*set_rx_ntuple)(struct net_device *, 943 int (*set_rx_ntuple)(struct net_device *,
946 struct ethtool_rx_ntuple *); 944 struct ethtool_rx_ntuple *);
947 int (*get_rx_ntuple)(struct net_device *, u32 stringset, void *);
948 int (*get_rxfh_indir)(struct net_device *, 945 int (*get_rxfh_indir)(struct net_device *,
949 struct ethtool_rxfh_indir *); 946 struct ethtool_rxfh_indir *);
950 int (*set_rxfh_indir)(struct net_device *, 947 int (*set_rxfh_indir)(struct net_device *,
@@ -1017,7 +1014,7 @@ struct ethtool_ops {
1017#define ETHTOOL_FLASHDEV 0x00000033 /* Flash firmware to device */ 1014#define ETHTOOL_FLASHDEV 0x00000033 /* Flash firmware to device */
1018#define ETHTOOL_RESET 0x00000034 /* Reset hardware */ 1015#define ETHTOOL_RESET 0x00000034 /* Reset hardware */
1019#define ETHTOOL_SRXNTUPLE 0x00000035 /* Add an n-tuple filter to device */ 1016#define ETHTOOL_SRXNTUPLE 0x00000035 /* Add an n-tuple filter to device */
1020#define ETHTOOL_GRXNTUPLE 0x00000036 /* Get n-tuple filters from device */ 1017#define ETHTOOL_GRXNTUPLE 0x00000036 /* deprecated */
1021#define ETHTOOL_GSSET_INFO 0x00000037 /* Get string set info */ 1018#define ETHTOOL_GSSET_INFO 0x00000037 /* Get string set info */
1022#define ETHTOOL_GRXFHINDIR 0x00000038 /* Get RX flow hash indir'n table */ 1019#define ETHTOOL_GRXFHINDIR 0x00000038 /* Get RX flow hash indir'n table */
1023#define ETHTOOL_SRXFHINDIR 0x00000039 /* Set RX flow hash indir'n table */ 1020#define ETHTOOL_SRXFHINDIR 0x00000039 /* Set RX flow hash indir'n table */
@@ -1087,7 +1084,7 @@ struct ethtool_ops {
1087/* The following are all involved in forcing a particular link 1084/* The following are all involved in forcing a particular link
1088 * mode for the device for setting things. When getting the 1085 * mode for the device for setting things. When getting the
1089 * devices settings, these indicate the current mode and whether 1086 * devices settings, these indicate the current mode and whether
1090 * it was foced up into this mode or autonegotiated. 1087 * it was forced up into this mode or autonegotiated.
1091 */ 1088 */
1092 1089
1093/* The forced speed, 10Mb, 100Mb, gigabit, 2.5Gb, 10GbE. */ 1090/* The forced speed, 10Mb, 100Mb, gigabit, 2.5Gb, 10GbE. */
diff --git a/include/linux/ext2_fs.h b/include/linux/ext2_fs.h
index 2dfa7076e8b6..53792bf36c71 100644
--- a/include/linux/ext2_fs.h
+++ b/include/linux/ext2_fs.h
@@ -18,6 +18,7 @@
18 18
19#include <linux/types.h> 19#include <linux/types.h>
20#include <linux/magic.h> 20#include <linux/magic.h>
21#include <linux/fs.h>
21 22
22/* 23/*
23 * The second extended filesystem constants/structures 24 * The second extended filesystem constants/structures
diff --git a/include/linux/ext3_fs.h b/include/linux/ext3_fs.h
index 5e06acf95d0f..67a803aee619 100644
--- a/include/linux/ext3_fs.h
+++ b/include/linux/ext3_fs.h
@@ -418,12 +418,11 @@ struct ext3_inode {
418#define EXT2_MOUNT_DATA_FLAGS EXT3_MOUNT_DATA_FLAGS 418#define EXT2_MOUNT_DATA_FLAGS EXT3_MOUNT_DATA_FLAGS
419#endif 419#endif
420 420
421#define ext3_set_bit __test_and_set_bit_le 421#define ext3_set_bit __set_bit_le
422#define ext3_set_bit_atomic ext2_set_bit_atomic 422#define ext3_set_bit_atomic ext2_set_bit_atomic
423#define ext3_clear_bit __test_and_clear_bit_le 423#define ext3_clear_bit __clear_bit_le
424#define ext3_clear_bit_atomic ext2_clear_bit_atomic 424#define ext3_clear_bit_atomic ext2_clear_bit_atomic
425#define ext3_test_bit test_bit_le 425#define ext3_test_bit test_bit_le
426#define ext3_find_first_zero_bit find_first_zero_bit_le
427#define ext3_find_next_zero_bit find_next_zero_bit_le 426#define ext3_find_next_zero_bit find_next_zero_bit_le
428 427
429/* 428/*
@@ -877,7 +876,7 @@ extern int ext3_htree_store_dirent(struct file *dir_file, __u32 hash,
877extern void ext3_htree_free_dir_info(struct dir_private_info *p); 876extern void ext3_htree_free_dir_info(struct dir_private_info *p);
878 877
879/* fsync.c */ 878/* fsync.c */
880extern int ext3_sync_file(struct file *, int); 879extern int ext3_sync_file(struct file *, loff_t, loff_t, int);
881 880
882/* hash.c */ 881/* hash.c */
883extern int ext3fs_dirhash(const char *name, int len, struct 882extern int ext3fs_dirhash(const char *name, int len, struct
@@ -913,7 +912,7 @@ extern void ext3_dirty_inode(struct inode *, int);
913extern int ext3_change_inode_journal_flag(struct inode *, int); 912extern int ext3_change_inode_journal_flag(struct inode *, int);
914extern int ext3_get_inode_loc(struct inode *, struct ext3_iloc *); 913extern int ext3_get_inode_loc(struct inode *, struct ext3_iloc *);
915extern int ext3_can_truncate(struct inode *inode); 914extern int ext3_can_truncate(struct inode *inode);
916extern void ext3_truncate (struct inode *); 915extern void ext3_truncate(struct inode *inode);
917extern void ext3_set_inode_flags(struct inode *); 916extern void ext3_set_inode_flags(struct inode *);
918extern void ext3_get_inode_flags(struct ext3_inode_info *); 917extern void ext3_get_inode_flags(struct ext3_inode_info *);
919extern void ext3_set_aops(struct inode *inode); 918extern void ext3_set_aops(struct inode *inode);
diff --git a/include/linux/fault-inject.h b/include/linux/fault-inject.h
index 7b64ad40e4ce..c6f996f2abb6 100644
--- a/include/linux/fault-inject.h
+++ b/include/linux/fault-inject.h
@@ -5,7 +5,7 @@
5 5
6#include <linux/types.h> 6#include <linux/types.h>
7#include <linux/debugfs.h> 7#include <linux/debugfs.h>
8#include <asm/atomic.h> 8#include <linux/atomic.h>
9 9
10/* 10/*
11 * For explanation of the elements of this struct, see 11 * For explanation of the elements of this struct, see
@@ -25,26 +25,6 @@ struct fault_attr {
25 unsigned long reject_end; 25 unsigned long reject_end;
26 26
27 unsigned long count; 27 unsigned long count;
28
29#ifdef CONFIG_FAULT_INJECTION_DEBUG_FS
30
31 struct {
32 struct dentry *dir;
33
34 struct dentry *probability_file;
35 struct dentry *interval_file;
36 struct dentry *times_file;
37 struct dentry *space_file;
38 struct dentry *verbose_file;
39 struct dentry *task_filter_file;
40 struct dentry *stacktrace_depth_file;
41 struct dentry *require_start_file;
42 struct dentry *require_end_file;
43 struct dentry *reject_start_file;
44 struct dentry *reject_end_file;
45 } dentries;
46
47#endif
48}; 28};
49 29
50#define FAULT_ATTR_INITIALIZER { \ 30#define FAULT_ATTR_INITIALIZER { \
@@ -57,24 +37,19 @@ struct fault_attr {
57 37
58#define DECLARE_FAULT_ATTR(name) struct fault_attr name = FAULT_ATTR_INITIALIZER 38#define DECLARE_FAULT_ATTR(name) struct fault_attr name = FAULT_ATTR_INITIALIZER
59int setup_fault_attr(struct fault_attr *attr, char *str); 39int setup_fault_attr(struct fault_attr *attr, char *str);
60void should_fail_srandom(unsigned long entropy);
61bool should_fail(struct fault_attr *attr, ssize_t size); 40bool should_fail(struct fault_attr *attr, ssize_t size);
62 41
63#ifdef CONFIG_FAULT_INJECTION_DEBUG_FS 42#ifdef CONFIG_FAULT_INJECTION_DEBUG_FS
64 43
65int init_fault_attr_dentries(struct fault_attr *attr, const char *name); 44struct dentry *fault_create_debugfs_attr(const char *name,
66void cleanup_fault_attr_dentries(struct fault_attr *attr); 45 struct dentry *parent, struct fault_attr *attr);
67 46
68#else /* CONFIG_FAULT_INJECTION_DEBUG_FS */ 47#else /* CONFIG_FAULT_INJECTION_DEBUG_FS */
69 48
70static inline int init_fault_attr_dentries(struct fault_attr *attr, 49static inline struct dentry *fault_create_debugfs_attr(const char *name,
71 const char *name) 50 struct dentry *parent, struct fault_attr *attr)
72{
73 return -ENODEV;
74}
75
76static inline void cleanup_fault_attr_dentries(struct fault_attr *attr)
77{ 51{
52 return ERR_PTR(-ENODEV);
78} 53}
79 54
80#endif /* CONFIG_FAULT_INJECTION_DEBUG_FS */ 55#endif /* CONFIG_FAULT_INJECTION_DEBUG_FS */
diff --git a/include/linux/fb.h b/include/linux/fb.h
index 6a8274877171..1d6836c498dd 100644
--- a/include/linux/fb.h
+++ b/include/linux/fb.h
@@ -1043,7 +1043,8 @@ extern void fb_deferred_io_open(struct fb_info *info,
1043 struct inode *inode, 1043 struct inode *inode,
1044 struct file *file); 1044 struct file *file);
1045extern void fb_deferred_io_cleanup(struct fb_info *info); 1045extern void fb_deferred_io_cleanup(struct fb_info *info);
1046extern int fb_deferred_io_fsync(struct file *file, int datasync); 1046extern int fb_deferred_io_fsync(struct file *file, loff_t start,
1047 loff_t end, int datasync);
1047 1048
1048static inline bool fb_be_math(struct fb_info *info) 1049static inline bool fb_be_math(struct fb_info *info)
1049{ 1050{
diff --git a/include/linux/fd.h b/include/linux/fd.h
index f5d194af07a8..72202b1b9a6a 100644
--- a/include/linux/fd.h
+++ b/include/linux/fd.h
@@ -377,4 +377,26 @@ struct floppy_raw_cmd {
377#define FDEJECT _IO(2, 0x5a) 377#define FDEJECT _IO(2, 0x5a)
378/* eject the disk */ 378/* eject the disk */
379 379
380
381#ifdef __KERNEL__
382#ifdef CONFIG_COMPAT
383#include <linux/compat.h>
384
385struct compat_floppy_struct {
386 compat_uint_t size;
387 compat_uint_t sect;
388 compat_uint_t head;
389 compat_uint_t track;
390 compat_uint_t stretch;
391 unsigned char gap;
392 unsigned char rate;
393 unsigned char spec1;
394 unsigned char fmt_gap;
395 const compat_caddr_t name;
396};
397
398#define FDGETPRM32 _IOR(2, 0x04, struct compat_floppy_struct)
399#endif
400#endif
401
380#endif 402#endif
diff --git a/include/linux/fdtable.h b/include/linux/fdtable.h
index 133c0ba25e30..82163c4b32c9 100644
--- a/include/linux/fdtable.h
+++ b/include/linux/fdtable.h
@@ -13,7 +13,7 @@
13#include <linux/init.h> 13#include <linux/init.h>
14#include <linux/fs.h> 14#include <linux/fs.h>
15 15
16#include <asm/atomic.h> 16#include <linux/atomic.h>
17 17
18/* 18/*
19 * The default fd array needs to be at least BITS_PER_LONG, 19 * The default fd array needs to be at least BITS_PER_LONG,
@@ -60,7 +60,6 @@ struct files_struct {
60 60
61#define rcu_dereference_check_fdtable(files, fdtfd) \ 61#define rcu_dereference_check_fdtable(files, fdtfd) \
62 (rcu_dereference_check((fdtfd), \ 62 (rcu_dereference_check((fdtfd), \
63 rcu_read_lock_held() || \
64 lockdep_is_held(&(files)->file_lock) || \ 63 lockdep_is_held(&(files)->file_lock) || \
65 atomic_read(&(files)->count) == 1 || \ 64 atomic_read(&(files)->count) == 1 || \
66 rcu_my_thread_group_empty())) 65 rcu_my_thread_group_empty()))
diff --git a/include/linux/filter.h b/include/linux/filter.h
index 9ee3f9fb0b4a..741956fa5bfd 100644
--- a/include/linux/filter.h
+++ b/include/linux/filter.h
@@ -9,7 +9,7 @@
9#include <linux/types.h> 9#include <linux/types.h>
10 10
11#ifdef __KERNEL__ 11#ifdef __KERNEL__
12#include <asm/atomic.h> 12#include <linux/atomic.h>
13#endif 13#endif
14 14
15/* 15/*
diff --git a/include/linux/firewire-cdev.h b/include/linux/firewire-cdev.h
index 4ff09889c5c0..357dbfc2829e 100644
--- a/include/linux/firewire-cdev.h
+++ b/include/linux/firewire-cdev.h
@@ -30,10 +30,13 @@
30#include <linux/types.h> 30#include <linux/types.h>
31#include <linux/firewire-constants.h> 31#include <linux/firewire-constants.h>
32 32
33/* available since kernel version 2.6.22 */
33#define FW_CDEV_EVENT_BUS_RESET 0x00 34#define FW_CDEV_EVENT_BUS_RESET 0x00
34#define FW_CDEV_EVENT_RESPONSE 0x01 35#define FW_CDEV_EVENT_RESPONSE 0x01
35#define FW_CDEV_EVENT_REQUEST 0x02 36#define FW_CDEV_EVENT_REQUEST 0x02
36#define FW_CDEV_EVENT_ISO_INTERRUPT 0x03 37#define FW_CDEV_EVENT_ISO_INTERRUPT 0x03
38
39/* available since kernel version 2.6.30 */
37#define FW_CDEV_EVENT_ISO_RESOURCE_ALLOCATED 0x04 40#define FW_CDEV_EVENT_ISO_RESOURCE_ALLOCATED 0x04
38#define FW_CDEV_EVENT_ISO_RESOURCE_DEALLOCATED 0x05 41#define FW_CDEV_EVENT_ISO_RESOURCE_DEALLOCATED 0x05
39 42
@@ -120,24 +123,11 @@ struct fw_cdev_event_response {
120 123
121/** 124/**
122 * struct fw_cdev_event_request - Old version of &fw_cdev_event_request2 125 * struct fw_cdev_event_request - Old version of &fw_cdev_event_request2
123 * @closure: See &fw_cdev_event_common; set by %FW_CDEV_IOC_ALLOCATE ioctl
124 * @type: See &fw_cdev_event_common; always %FW_CDEV_EVENT_REQUEST 126 * @type: See &fw_cdev_event_common; always %FW_CDEV_EVENT_REQUEST
125 * @tcode: See &fw_cdev_event_request2
126 * @offset: See &fw_cdev_event_request2
127 * @handle: See &fw_cdev_event_request2
128 * @length: See &fw_cdev_event_request2
129 * @data: See &fw_cdev_event_request2
130 * 127 *
131 * This event is sent instead of &fw_cdev_event_request2 if the kernel or 128 * This event is sent instead of &fw_cdev_event_request2 if the kernel or
132 * the client implements ABI version <= 3. 129 * the client implements ABI version <= 3. &fw_cdev_event_request lacks
133 * 130 * essential information; use &fw_cdev_event_request2 instead.
134 * Unlike &fw_cdev_event_request2, the sender identity cannot be established,
135 * broadcast write requests cannot be distinguished from unicast writes, and
136 * @tcode of lock requests is %TCODE_LOCK_REQUEST.
137 *
138 * Requests to the FCP_REQUEST or FCP_RESPONSE register are responded to as
139 * with &fw_cdev_event_request2, except in kernel 2.6.32 and older which send
140 * the response packet of the client's %FW_CDEV_IOC_SEND_RESPONSE ioctl.
141 */ 131 */
142struct fw_cdev_event_request { 132struct fw_cdev_event_request {
143 __u64 closure; 133 __u64 closure;
@@ -452,29 +442,31 @@ union fw_cdev_event {
452 * %FW_CDEV_ISO_CONTEXT_RECEIVE_MULTICHANNEL, and 442 * %FW_CDEV_ISO_CONTEXT_RECEIVE_MULTICHANNEL, and
453 * %FW_CDEV_IOC_SET_ISO_CHANNELS 443 * %FW_CDEV_IOC_SET_ISO_CHANNELS
454 */ 444 */
455#define FW_CDEV_VERSION 3 /* Meaningless; don't use this macro. */
456 445
457/** 446/**
458 * struct fw_cdev_get_info - General purpose information ioctl 447 * struct fw_cdev_get_info - General purpose information ioctl
459 * @version: The version field is just a running serial number. Both an 448 * @version: The version field is just a running serial number. Both an
460 * input parameter (ABI version implemented by the client) and 449 * input parameter (ABI version implemented by the client) and
461 * output parameter (ABI version implemented by the kernel). 450 * output parameter (ABI version implemented by the kernel).
462 * A client must not fill in an %FW_CDEV_VERSION defined from an 451 * A client shall fill in the ABI @version for which the client
463 * included kernel header file but the actual version for which 452 * was implemented. This is necessary for forward compatibility.
464 * the client was implemented. This is necessary for forward 453 * @rom_length: If @rom is non-zero, up to @rom_length bytes of Configuration
465 * compatibility. We never break backwards compatibility, but
466 * may add more structs, events, and ioctls in later revisions.
467 * @rom_length: If @rom is non-zero, at most rom_length bytes of configuration
468 * ROM will be copied into that user space address. In either 454 * ROM will be copied into that user space address. In either
469 * case, @rom_length is updated with the actual length of the 455 * case, @rom_length is updated with the actual length of the
470 * configuration ROM. 456 * Configuration ROM.
471 * @rom: If non-zero, address of a buffer to be filled by a copy of the 457 * @rom: If non-zero, address of a buffer to be filled by a copy of the
472 * device's configuration ROM 458 * device's Configuration ROM
473 * @bus_reset: If non-zero, address of a buffer to be filled by a 459 * @bus_reset: If non-zero, address of a buffer to be filled by a
474 * &struct fw_cdev_event_bus_reset with the current state 460 * &struct fw_cdev_event_bus_reset with the current state
475 * of the bus. This does not cause a bus reset to happen. 461 * of the bus. This does not cause a bus reset to happen.
476 * @bus_reset_closure: Value of &closure in this and subsequent bus reset events 462 * @bus_reset_closure: Value of &closure in this and subsequent bus reset events
477 * @card: The index of the card this device belongs to 463 * @card: The index of the card this device belongs to
464 *
465 * The %FW_CDEV_IOC_GET_INFO ioctl is usually the very first one which a client
466 * performs right after it opened a /dev/fw* file.
467 *
468 * As a side effect, reception of %FW_CDEV_EVENT_BUS_RESET events to be read(2)
469 * is started by this ioctl.
478 */ 470 */
479struct fw_cdev_get_info { 471struct fw_cdev_get_info {
480 __u32 version; 472 __u32 version;
@@ -612,7 +604,7 @@ struct fw_cdev_initiate_bus_reset {
612 * @handle: Handle to the descriptor, written by the kernel 604 * @handle: Handle to the descriptor, written by the kernel
613 * 605 *
614 * Add a descriptor block and optionally a preceding immediate key to the local 606 * Add a descriptor block and optionally a preceding immediate key to the local
615 * node's configuration ROM. 607 * node's Configuration ROM.
616 * 608 *
617 * The @key field specifies the upper 8 bits of the descriptor root directory 609 * The @key field specifies the upper 8 bits of the descriptor root directory
618 * pointer and the @data and @length fields specify the contents. The @key 610 * pointer and the @data and @length fields specify the contents. The @key
@@ -627,9 +619,9 @@ struct fw_cdev_initiate_bus_reset {
627 * If successful, the kernel adds the descriptor and writes back a @handle to 619 * If successful, the kernel adds the descriptor and writes back a @handle to
628 * the kernel-side object to be used for later removal of the descriptor block 620 * the kernel-side object to be used for later removal of the descriptor block
629 * and immediate key. The kernel will also generate a bus reset to signal the 621 * and immediate key. The kernel will also generate a bus reset to signal the
630 * change of the configuration ROM to other nodes. 622 * change of the Configuration ROM to other nodes.
631 * 623 *
632 * This ioctl affects the configuration ROMs of all local nodes. 624 * This ioctl affects the Configuration ROMs of all local nodes.
633 * The ioctl only succeeds on device files which represent a local node. 625 * The ioctl only succeeds on device files which represent a local node.
634 */ 626 */
635struct fw_cdev_add_descriptor { 627struct fw_cdev_add_descriptor {
@@ -641,13 +633,13 @@ struct fw_cdev_add_descriptor {
641}; 633};
642 634
643/** 635/**
644 * struct fw_cdev_remove_descriptor - Remove contents from the configuration ROM 636 * struct fw_cdev_remove_descriptor - Remove contents from the Configuration ROM
645 * @handle: Handle to the descriptor, as returned by the kernel when the 637 * @handle: Handle to the descriptor, as returned by the kernel when the
646 * descriptor was added 638 * descriptor was added
647 * 639 *
648 * Remove a descriptor block and accompanying immediate key from the local 640 * Remove a descriptor block and accompanying immediate key from the local
649 * nodes' configuration ROMs. The kernel will also generate a bus reset to 641 * nodes' Configuration ROMs. The kernel will also generate a bus reset to
650 * signal the change of the configuration ROM to other nodes. 642 * signal the change of the Configuration ROM to other nodes.
651 */ 643 */
652struct fw_cdev_remove_descriptor { 644struct fw_cdev_remove_descriptor {
653 __u32 handle; 645 __u32 handle;
@@ -863,13 +855,8 @@ struct fw_cdev_stop_iso {
863 * @local_time: system time, in microseconds since the Epoch 855 * @local_time: system time, in microseconds since the Epoch
864 * @cycle_timer: Cycle Time register contents 856 * @cycle_timer: Cycle Time register contents
865 * 857 *
866 * The %FW_CDEV_IOC_GET_CYCLE_TIMER ioctl reads the isochronous cycle timer 858 * Same as %FW_CDEV_IOC_GET_CYCLE_TIMER2, but fixed to use %CLOCK_REALTIME
867 * and also the system clock (%CLOCK_REALTIME). This allows to express the 859 * and only with microseconds resolution.
868 * receive time of an isochronous packet as a system time.
869 *
870 * @cycle_timer consists of 7 bits cycleSeconds, 13 bits cycleCount, and
871 * 12 bits cycleOffset, in host byte order. Cf. the Cycle Time register
872 * per IEEE 1394 or Isochronous Cycle Timer register per OHCI-1394.
873 * 860 *
874 * In version 1 and 2 of the ABI, this ioctl returned unreliable (non- 861 * In version 1 and 2 of the ABI, this ioctl returned unreliable (non-
875 * monotonic) @cycle_timer values on certain controllers. 862 * monotonic) @cycle_timer values on certain controllers.
@@ -886,10 +873,17 @@ struct fw_cdev_get_cycle_timer {
886 * @clk_id: input parameter, clock from which to get the system time 873 * @clk_id: input parameter, clock from which to get the system time
887 * @cycle_timer: Cycle Time register contents 874 * @cycle_timer: Cycle Time register contents
888 * 875 *
889 * The %FW_CDEV_IOC_GET_CYCLE_TIMER2 works like 876 * The %FW_CDEV_IOC_GET_CYCLE_TIMER2 ioctl reads the isochronous cycle timer
890 * %FW_CDEV_IOC_GET_CYCLE_TIMER but lets you choose a clock like with POSIX' 877 * and also the system clock. This allows to correlate reception time of
891 * clock_gettime function. Supported @clk_id values are POSIX' %CLOCK_REALTIME 878 * isochronous packets with system time.
892 * and %CLOCK_MONOTONIC and Linux' %CLOCK_MONOTONIC_RAW. 879 *
880 * @clk_id lets you choose a clock like with POSIX' clock_gettime function.
881 * Supported @clk_id values are POSIX' %CLOCK_REALTIME and %CLOCK_MONOTONIC
882 * and Linux' %CLOCK_MONOTONIC_RAW.
883 *
884 * @cycle_timer consists of 7 bits cycleSeconds, 13 bits cycleCount, and
885 * 12 bits cycleOffset, in host byte order. Cf. the Cycle Time register
886 * per IEEE 1394 or Isochronous Cycle Timer register per OHCI-1394.
893 */ 887 */
894struct fw_cdev_get_cycle_timer2 { 888struct fw_cdev_get_cycle_timer2 {
895 __s64 tv_sec; 889 __s64 tv_sec;
@@ -1011,4 +1005,6 @@ struct fw_cdev_receive_phy_packets {
1011 __u64 closure; 1005 __u64 closure;
1012}; 1006};
1013 1007
1008#define FW_CDEV_VERSION 3 /* Meaningless legacy macro; don't use it. */
1009
1014#endif /* _LINUX_FIREWIRE_CDEV_H */ 1010#endif /* _LINUX_FIREWIRE_CDEV_H */
diff --git a/include/linux/firewire.h b/include/linux/firewire.h
index 5e6f42789afe..84ccf8e04fa6 100644
--- a/include/linux/firewire.h
+++ b/include/linux/firewire.h
@@ -14,7 +14,7 @@
14#include <linux/types.h> 14#include <linux/types.h>
15#include <linux/workqueue.h> 15#include <linux/workqueue.h>
16 16
17#include <asm/atomic.h> 17#include <linux/atomic.h>
18#include <asm/byteorder.h> 18#include <asm/byteorder.h>
19 19
20#define fw_notify(s, args...) printk(KERN_NOTICE KBUILD_MODNAME ": " s, ## args) 20#define fw_notify(s, args...) printk(KERN_NOTICE KBUILD_MODNAME ": " s, ## args)
diff --git a/include/linux/fs.h b/include/linux/fs.h
index c55d6b7cd5d6..178cdb4f1d4a 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -32,7 +32,9 @@
32#define SEEK_SET 0 /* seek relative to beginning of file */ 32#define SEEK_SET 0 /* seek relative to beginning of file */
33#define SEEK_CUR 1 /* seek relative to current file position */ 33#define SEEK_CUR 1 /* seek relative to current file position */
34#define SEEK_END 2 /* seek relative to end of file */ 34#define SEEK_END 2 /* seek relative to end of file */
35#define SEEK_MAX SEEK_END 35#define SEEK_DATA 3 /* seek to the next data */
36#define SEEK_HOLE 4 /* seek to the next hole */
37#define SEEK_MAX SEEK_HOLE
36 38
37struct fstrim_range { 39struct fstrim_range {
38 __u64 start; 40 __u64 start;
@@ -63,6 +65,7 @@ struct inodes_stat_t {
63#define MAY_ACCESS 16 65#define MAY_ACCESS 16
64#define MAY_OPEN 32 66#define MAY_OPEN 32
65#define MAY_CHDIR 64 67#define MAY_CHDIR 64
68#define MAY_NOT_BLOCK 128 /* called from RCU mode, don't block */
66 69
67/* 70/*
68 * flags in file.f_mode. Note that FMODE_READ and FMODE_WRITE must correspond 71 * flags in file.f_mode. Note that FMODE_READ and FMODE_WRITE must correspond
@@ -208,6 +211,7 @@ struct inodes_stat_t {
208#define MS_KERNMOUNT (1<<22) /* this is a kern_mount call */ 211#define MS_KERNMOUNT (1<<22) /* this is a kern_mount call */
209#define MS_I_VERSION (1<<23) /* Update inode I_version field */ 212#define MS_I_VERSION (1<<23) /* Update inode I_version field */
210#define MS_STRICTATIME (1<<24) /* Always perform atime updates */ 213#define MS_STRICTATIME (1<<24) /* Always perform atime updates */
214#define MS_NOSEC (1<<28)
211#define MS_BORN (1<<29) 215#define MS_BORN (1<<29)
212#define MS_ACTIVE (1<<30) 216#define MS_ACTIVE (1<<30)
213#define MS_NOUSER (1<<31) 217#define MS_NOUSER (1<<31)
@@ -375,7 +379,6 @@ struct inodes_stat_t {
375 379
376#include <linux/linkage.h> 380#include <linux/linkage.h>
377#include <linux/wait.h> 381#include <linux/wait.h>
378#include <linux/types.h>
379#include <linux/kdev_t.h> 382#include <linux/kdev_t.h>
380#include <linux/dcache.h> 383#include <linux/dcache.h>
381#include <linux/path.h> 384#include <linux/path.h>
@@ -391,8 +394,9 @@ struct inodes_stat_t {
391#include <linux/semaphore.h> 394#include <linux/semaphore.h>
392#include <linux/fiemap.h> 395#include <linux/fiemap.h>
393#include <linux/rculist_bl.h> 396#include <linux/rculist_bl.h>
397#include <linux/shrinker.h>
398#include <linux/atomic.h>
394 399
395#include <asm/atomic.h>
396#include <asm/byteorder.h> 400#include <asm/byteorder.h>
397 401
398struct export_operations; 402struct export_operations;
@@ -638,6 +642,7 @@ struct address_space {
638 struct prio_tree_root i_mmap; /* tree of private and shared mappings */ 642 struct prio_tree_root i_mmap; /* tree of private and shared mappings */
639 struct list_head i_mmap_nonlinear;/*list VM_NONLINEAR mappings */ 643 struct list_head i_mmap_nonlinear;/*list VM_NONLINEAR mappings */
640 struct mutex i_mmap_mutex; /* protect tree, count, list */ 644 struct mutex i_mmap_mutex; /* protect tree, count, list */
645 /* Protected by tree_lock together with the radix tree */
641 unsigned long nrpages; /* number of total pages */ 646 unsigned long nrpages; /* number of total pages */
642 pgoff_t writeback_index;/* writeback starts here */ 647 pgoff_t writeback_index;/* writeback starts here */
643 const struct address_space_operations *a_ops; /* methods */ 648 const struct address_space_operations *a_ops; /* methods */
@@ -733,19 +738,55 @@ static inline int mapping_writably_mapped(struct address_space *mapping)
733struct posix_acl; 738struct posix_acl;
734#define ACL_NOT_CACHED ((void *)(-1)) 739#define ACL_NOT_CACHED ((void *)(-1))
735 740
741#define IOP_FASTPERM 0x0001
742#define IOP_LOOKUP 0x0002
743#define IOP_NOFOLLOW 0x0004
744
745/*
746 * Keep mostly read-only and often accessed (especially for
747 * the RCU path lookup and 'stat' data) fields at the beginning
748 * of the 'struct inode'
749 */
736struct inode { 750struct inode {
737 /* RCU path lookup touches following: */
738 umode_t i_mode; 751 umode_t i_mode;
752 unsigned short i_opflags;
739 uid_t i_uid; 753 uid_t i_uid;
740 gid_t i_gid; 754 gid_t i_gid;
755 unsigned int i_flags;
756
757#ifdef CONFIG_FS_POSIX_ACL
758 struct posix_acl *i_acl;
759 struct posix_acl *i_default_acl;
760#endif
761
741 const struct inode_operations *i_op; 762 const struct inode_operations *i_op;
742 struct super_block *i_sb; 763 struct super_block *i_sb;
764 struct address_space *i_mapping;
765
766#ifdef CONFIG_SECURITY
767 void *i_security;
768#endif
743 769
770 /* Stat data, not accessed from path walking */
771 unsigned long i_ino;
772 unsigned int i_nlink;
773 dev_t i_rdev;
774 loff_t i_size;
775 struct timespec i_atime;
776 struct timespec i_mtime;
777 struct timespec i_ctime;
778 unsigned int i_blkbits;
779 blkcnt_t i_blocks;
780
781#ifdef __NEED_I_SIZE_ORDERED
782 seqcount_t i_size_seqcount;
783#endif
784
785 /* Misc */
786 unsigned long i_state;
744 spinlock_t i_lock; /* i_blocks, i_bytes, maybe i_size */ 787 spinlock_t i_lock; /* i_blocks, i_bytes, maybe i_size */
745 unsigned int i_flags;
746 struct mutex i_mutex; 788 struct mutex i_mutex;
747 789
748 unsigned long i_state;
749 unsigned long dirtied_when; /* jiffies of first dirtying */ 790 unsigned long dirtied_when; /* jiffies of first dirtying */
750 791
751 struct hlist_node i_hash; 792 struct hlist_node i_hash;
@@ -756,25 +797,12 @@ struct inode {
756 struct list_head i_dentry; 797 struct list_head i_dentry;
757 struct rcu_head i_rcu; 798 struct rcu_head i_rcu;
758 }; 799 };
759 unsigned long i_ino;
760 atomic_t i_count; 800 atomic_t i_count;
761 unsigned int i_nlink;
762 dev_t i_rdev;
763 unsigned int i_blkbits;
764 u64 i_version; 801 u64 i_version;
765 loff_t i_size;
766#ifdef __NEED_I_SIZE_ORDERED
767 seqcount_t i_size_seqcount;
768#endif
769 struct timespec i_atime;
770 struct timespec i_mtime;
771 struct timespec i_ctime;
772 blkcnt_t i_blocks;
773 unsigned short i_bytes; 802 unsigned short i_bytes;
774 struct rw_semaphore i_alloc_sem; 803 atomic_t i_dio_count;
775 const struct file_operations *i_fop; /* former ->i_op->default_file_ops */ 804 const struct file_operations *i_fop; /* former ->i_op->default_file_ops */
776 struct file_lock *i_flock; 805 struct file_lock *i_flock;
777 struct address_space *i_mapping;
778 struct address_space i_data; 806 struct address_space i_data;
779#ifdef CONFIG_QUOTA 807#ifdef CONFIG_QUOTA
780 struct dquot *i_dquot[MAXQUOTAS]; 808 struct dquot *i_dquot[MAXQUOTAS];
@@ -797,13 +825,6 @@ struct inode {
797 atomic_t i_readcount; /* struct files open RO */ 825 atomic_t i_readcount; /* struct files open RO */
798#endif 826#endif
799 atomic_t i_writecount; 827 atomic_t i_writecount;
800#ifdef CONFIG_SECURITY
801 void *i_security;
802#endif
803#ifdef CONFIG_FS_POSIX_ACL
804 struct posix_acl *i_acl;
805 struct posix_acl *i_default_acl;
806#endif
807 void *i_private; /* fs or device private pointer */ 828 void *i_private; /* fs or device private pointer */
808}; 829};
809 830
@@ -1066,12 +1087,12 @@ struct file_lock_operations {
1066}; 1087};
1067 1088
1068struct lock_manager_operations { 1089struct lock_manager_operations {
1069 int (*fl_compare_owner)(struct file_lock *, struct file_lock *); 1090 int (*lm_compare_owner)(struct file_lock *, struct file_lock *);
1070 void (*fl_notify)(struct file_lock *); /* unblock callback */ 1091 void (*lm_notify)(struct file_lock *); /* unblock callback */
1071 int (*fl_grant)(struct file_lock *, struct file_lock *, int); 1092 int (*lm_grant)(struct file_lock *, struct file_lock *, int);
1072 void (*fl_release_private)(struct file_lock *); 1093 void (*lm_release_private)(struct file_lock *);
1073 void (*fl_break)(struct file_lock *); 1094 void (*lm_break)(struct file_lock *);
1074 int (*fl_change)(struct file_lock **, int); 1095 int (*lm_change)(struct file_lock **, int);
1075}; 1096};
1076 1097
1077struct lock_manager { 1098struct lock_manager {
@@ -1393,6 +1414,11 @@ struct super_block {
1393 struct list_head s_dentry_lru; /* unused dentry lru */ 1414 struct list_head s_dentry_lru; /* unused dentry lru */
1394 int s_nr_dentry_unused; /* # of dentry on lru */ 1415 int s_nr_dentry_unused; /* # of dentry on lru */
1395 1416
1417 /* s_inode_lru_lock protects s_inode_lru and s_nr_inodes_unused */
1418 spinlock_t s_inode_lru_lock ____cacheline_aligned_in_smp;
1419 struct list_head s_inode_lru; /* unused inode lru */
1420 int s_nr_inodes_unused; /* # of inodes on lru */
1421
1396 struct block_device *s_bdev; 1422 struct block_device *s_bdev;
1397 struct backing_dev_info *s_bdi; 1423 struct backing_dev_info *s_bdi;
1398 struct mtd_info *s_mtd; 1424 struct mtd_info *s_mtd;
@@ -1435,8 +1461,14 @@ struct super_block {
1435 * Saved pool identifier for cleancache (-1 means none) 1461 * Saved pool identifier for cleancache (-1 means none)
1436 */ 1462 */
1437 int cleancache_poolid; 1463 int cleancache_poolid;
1464
1465 struct shrinker s_shrink; /* per-sb shrinker handle */
1438}; 1466};
1439 1467
1468/* superblock cache pruning functions */
1469extern void prune_icache_sb(struct super_block *sb, int nr_to_scan);
1470extern void prune_dcache_sb(struct super_block *sb, int nr_to_scan);
1471
1440extern struct timespec current_fs_time(struct super_block *sb); 1472extern struct timespec current_fs_time(struct super_block *sb);
1441 1473
1442/* 1474/*
@@ -1451,10 +1483,6 @@ enum {
1451#define vfs_check_frozen(sb, level) \ 1483#define vfs_check_frozen(sb, level) \
1452 wait_event((sb)->s_wait_unfrozen, ((sb)->s_frozen < (level))) 1484 wait_event((sb)->s_wait_unfrozen, ((sb)->s_frozen < (level)))
1453 1485
1454#define get_fs_excl() atomic_inc(&current->fs_excl)
1455#define put_fs_excl() atomic_dec(&current->fs_excl)
1456#define has_fs_excl() atomic_read(&current->fs_excl)
1457
1458/* 1486/*
1459 * until VFS tracks user namespaces for inodes, just make all files 1487 * until VFS tracks user namespaces for inodes, just make all files
1460 * belong to init_user_ns 1488 * belong to init_user_ns
@@ -1487,7 +1515,6 @@ extern void dentry_unhash(struct dentry *dentry);
1487/* 1515/*
1488 * VFS file helper functions. 1516 * VFS file helper functions.
1489 */ 1517 */
1490extern int file_permission(struct file *, int);
1491extern void inode_init_owner(struct inode *inode, const struct inode *dir, 1518extern void inode_init_owner(struct inode *inode, const struct inode *dir,
1492 mode_t mode); 1519 mode_t mode);
1493/* 1520/*
@@ -1535,11 +1562,6 @@ struct block_device_operations;
1535#define HAVE_COMPAT_IOCTL 1 1562#define HAVE_COMPAT_IOCTL 1
1536#define HAVE_UNLOCKED_IOCTL 1 1563#define HAVE_UNLOCKED_IOCTL 1
1537 1564
1538/*
1539 * NOTE:
1540 * all file operations except setlease can be called without
1541 * the big kernel lock held in all filesystems.
1542 */
1543struct file_operations { 1565struct file_operations {
1544 struct module *owner; 1566 struct module *owner;
1545 loff_t (*llseek) (struct file *, loff_t, int); 1567 loff_t (*llseek) (struct file *, loff_t, int);
@@ -1555,7 +1577,7 @@ struct file_operations {
1555 int (*open) (struct inode *, struct file *); 1577 int (*open) (struct inode *, struct file *);
1556 int (*flush) (struct file *, fl_owner_t id); 1578 int (*flush) (struct file *, fl_owner_t id);
1557 int (*release) (struct inode *, struct file *); 1579 int (*release) (struct inode *, struct file *);
1558 int (*fsync) (struct file *, int datasync); 1580 int (*fsync) (struct file *, loff_t, loff_t, int datasync);
1559 int (*aio_fsync) (struct kiocb *, int datasync); 1581 int (*aio_fsync) (struct kiocb *, int datasync);
1560 int (*fasync) (int, struct file *, int); 1582 int (*fasync) (int, struct file *, int);
1561 int (*lock) (struct file *, int, struct file_lock *); 1583 int (*lock) (struct file *, int, struct file_lock *);
@@ -1570,13 +1592,11 @@ struct file_operations {
1570 loff_t len); 1592 loff_t len);
1571}; 1593};
1572 1594
1573#define IPERM_FLAG_RCU 0x0001
1574
1575struct inode_operations { 1595struct inode_operations {
1576 struct dentry * (*lookup) (struct inode *,struct dentry *, struct nameidata *); 1596 struct dentry * (*lookup) (struct inode *,struct dentry *, struct nameidata *);
1577 void * (*follow_link) (struct dentry *, struct nameidata *); 1597 void * (*follow_link) (struct dentry *, struct nameidata *);
1578 int (*permission) (struct inode *, int, unsigned int); 1598 int (*permission) (struct inode *, int);
1579 int (*check_acl)(struct inode *, int, unsigned int); 1599 struct posix_acl * (*get_acl)(struct inode *, int);
1580 1600
1581 int (*readlink) (struct dentry *, char __user *,int); 1601 int (*readlink) (struct dentry *, char __user *,int);
1582 void (*put_link) (struct dentry *, struct nameidata *, void *); 1602 void (*put_link) (struct dentry *, struct nameidata *, void *);
@@ -1642,6 +1662,8 @@ struct super_operations {
1642 ssize_t (*quota_write)(struct super_block *, int, const char *, size_t, loff_t); 1662 ssize_t (*quota_write)(struct super_block *, int, const char *, size_t, loff_t);
1643#endif 1663#endif
1644 int (*bdev_try_to_free_page)(struct super_block*, struct page*, gfp_t); 1664 int (*bdev_try_to_free_page)(struct super_block*, struct page*, gfp_t);
1665 int (*nr_cached_objects)(struct super_block *);
1666 void (*free_cached_objects)(struct super_block *, int);
1645}; 1667};
1646 1668
1647/* 1669/*
@@ -1690,6 +1712,10 @@ struct super_operations {
1690 * set during data writeback, and cleared with a wakeup 1712 * set during data writeback, and cleared with a wakeup
1691 * on the bit address once it is done. 1713 * on the bit address once it is done.
1692 * 1714 *
1715 * I_REFERENCED Marks the inode as recently references on the LRU list.
1716 *
1717 * I_DIO_WAKEUP Never set. Only used as a key for wait_on_bit().
1718 *
1693 * Q: What is the difference between I_WILL_FREE and I_FREEING? 1719 * Q: What is the difference between I_WILL_FREE and I_FREEING?
1694 */ 1720 */
1695#define I_DIRTY_SYNC (1 << 0) 1721#define I_DIRTY_SYNC (1 << 0)
@@ -1703,6 +1729,8 @@ struct super_operations {
1703#define __I_SYNC 7 1729#define __I_SYNC 7
1704#define I_SYNC (1 << __I_SYNC) 1730#define I_SYNC (1 << __I_SYNC)
1705#define I_REFERENCED (1 << 8) 1731#define I_REFERENCED (1 << 8)
1732#define __I_DIO_WAKEUP 9
1733#define I_DIO_WAKEUP (1 << I_DIO_WAKEUP)
1706 1734
1707#define I_DIRTY (I_DIRTY_SYNC | I_DIRTY_DATASYNC | I_DIRTY_PAGES) 1735#define I_DIRTY (I_DIRTY_SYNC | I_DIRTY_DATASYNC | I_DIRTY_PAGES)
1708 1736
@@ -1813,7 +1841,6 @@ struct file_system_type {
1813 struct lock_class_key i_lock_key; 1841 struct lock_class_key i_lock_key;
1814 struct lock_class_key i_mutex_key; 1842 struct lock_class_key i_mutex_key;
1815 struct lock_class_key i_mutex_dir_key; 1843 struct lock_class_key i_mutex_dir_key;
1816 struct lock_class_key i_alloc_sem_key;
1817}; 1844};
1818 1845
1819extern struct dentry *mount_ns(struct file_system_type *fs_type, int flags, 1846extern struct dentry *mount_ns(struct file_system_type *fs_type, int flags,
@@ -1834,6 +1861,8 @@ void kill_litter_super(struct super_block *sb);
1834void deactivate_super(struct super_block *sb); 1861void deactivate_super(struct super_block *sb);
1835void deactivate_locked_super(struct super_block *sb); 1862void deactivate_locked_super(struct super_block *sb);
1836int set_anon_super(struct super_block *s, void *data); 1863int set_anon_super(struct super_block *s, void *data);
1864int get_anon_bdev(dev_t *);
1865void free_anon_bdev(dev_t);
1837struct super_block *sget(struct file_system_type *type, 1866struct super_block *sget(struct file_system_type *type,
1838 int (*test)(struct super_block *,void *), 1867 int (*test)(struct super_block *,void *),
1839 int (*set)(struct super_block *,void *), 1868 int (*set)(struct super_block *,void *),
@@ -1866,6 +1895,7 @@ extern int register_filesystem(struct file_system_type *);
1866extern int unregister_filesystem(struct file_system_type *); 1895extern int unregister_filesystem(struct file_system_type *);
1867extern struct vfsmount *kern_mount_data(struct file_system_type *, void *data); 1896extern struct vfsmount *kern_mount_data(struct file_system_type *, void *data);
1868#define kern_mount(type) kern_mount_data(type, NULL) 1897#define kern_mount(type) kern_mount_data(type, NULL)
1898extern void kern_unmount(struct vfsmount *mnt);
1869extern int may_umount_tree(struct vfsmount *); 1899extern int may_umount_tree(struct vfsmount *);
1870extern int may_umount(struct vfsmount *); 1900extern int may_umount(struct vfsmount *);
1871extern long do_mount(char *, char *, char *, unsigned long, void *); 1901extern long do_mount(char *, char *, char *, unsigned long, void *);
@@ -2185,16 +2215,38 @@ extern sector_t bmap(struct inode *, sector_t);
2185#endif 2215#endif
2186extern int notify_change(struct dentry *, struct iattr *); 2216extern int notify_change(struct dentry *, struct iattr *);
2187extern int inode_permission(struct inode *, int); 2217extern int inode_permission(struct inode *, int);
2188extern int generic_permission(struct inode *, int, unsigned int, 2218extern int generic_permission(struct inode *, int);
2189 int (*check_acl)(struct inode *, int, unsigned int));
2190 2219
2191static inline bool execute_ok(struct inode *inode) 2220static inline bool execute_ok(struct inode *inode)
2192{ 2221{
2193 return (inode->i_mode & S_IXUGO) || S_ISDIR(inode->i_mode); 2222 return (inode->i_mode & S_IXUGO) || S_ISDIR(inode->i_mode);
2194} 2223}
2195 2224
2196extern int get_write_access(struct inode *); 2225/*
2197extern int deny_write_access(struct file *); 2226 * get_write_access() gets write permission for a file.
2227 * put_write_access() releases this write permission.
2228 * This is used for regular files.
2229 * We cannot support write (and maybe mmap read-write shared) accesses and
2230 * MAP_DENYWRITE mmappings simultaneously. The i_writecount field of an inode
2231 * can have the following values:
2232 * 0: no writers, no VM_DENYWRITE mappings
2233 * < 0: (-i_writecount) vm_area_structs with VM_DENYWRITE set exist
2234 * > 0: (i_writecount) users are writing to the file.
2235 *
2236 * Normally we operate on that counter with atomic_{inc,dec} and it's safe
2237 * except for the cases where we don't hold i_writecount yet. Then we need to
2238 * use {get,deny}_write_access() - these functions check the sign and refuse
2239 * to do the change if sign is wrong.
2240 */
2241static inline int get_write_access(struct inode *inode)
2242{
2243 return atomic_inc_unless_negative(&inode->i_writecount) ? 0 : -ETXTBSY;
2244}
2245static inline int deny_write_access(struct file *file)
2246{
2247 struct inode *inode = file->f_path.dentry->d_inode;
2248 return atomic_dec_unless_positive(&inode->i_writecount) ? 0 : -ETXTBSY;
2249}
2198static inline void put_write_access(struct inode * inode) 2250static inline void put_write_access(struct inode * inode)
2199{ 2251{
2200 atomic_dec(&inode->i_writecount); 2252 atomic_dec(&inode->i_writecount);
@@ -2273,17 +2325,25 @@ extern void __iget(struct inode * inode);
2273extern void iget_failed(struct inode *); 2325extern void iget_failed(struct inode *);
2274extern void end_writeback(struct inode *); 2326extern void end_writeback(struct inode *);
2275extern void __destroy_inode(struct inode *); 2327extern void __destroy_inode(struct inode *);
2276extern struct inode *new_inode(struct super_block *); 2328extern struct inode *new_inode_pseudo(struct super_block *sb);
2329extern struct inode *new_inode(struct super_block *sb);
2277extern void free_inode_nonrcu(struct inode *inode); 2330extern void free_inode_nonrcu(struct inode *inode);
2278extern int should_remove_suid(struct dentry *); 2331extern int should_remove_suid(struct dentry *);
2279extern int file_remove_suid(struct file *); 2332extern int file_remove_suid(struct file *);
2280 2333
2281extern void __insert_inode_hash(struct inode *, unsigned long hashval); 2334extern void __insert_inode_hash(struct inode *, unsigned long hashval);
2282extern void remove_inode_hash(struct inode *);
2283static inline void insert_inode_hash(struct inode *inode) 2335static inline void insert_inode_hash(struct inode *inode)
2284{ 2336{
2285 __insert_inode_hash(inode, inode->i_ino); 2337 __insert_inode_hash(inode, inode->i_ino);
2286} 2338}
2339
2340extern void __remove_inode_hash(struct inode *);
2341static inline void remove_inode_hash(struct inode *inode)
2342{
2343 if (!inode_unhashed(inode))
2344 __remove_inode_hash(inode);
2345}
2346
2287extern void inode_sb_list_add(struct inode *inode); 2347extern void inode_sb_list_add(struct inode *inode);
2288 2348
2289#ifdef CONFIG_BLOCK 2349#ifdef CONFIG_BLOCK
@@ -2314,7 +2374,8 @@ extern int generic_segment_checks(const struct iovec *iov,
2314/* fs/block_dev.c */ 2374/* fs/block_dev.c */
2315extern ssize_t blkdev_aio_write(struct kiocb *iocb, const struct iovec *iov, 2375extern ssize_t blkdev_aio_write(struct kiocb *iocb, const struct iovec *iov,
2316 unsigned long nr_segs, loff_t pos); 2376 unsigned long nr_segs, loff_t pos);
2317extern int blkdev_fsync(struct file *filp, int datasync); 2377extern int blkdev_fsync(struct file *filp, loff_t start, loff_t end,
2378 int datasync);
2318 2379
2319/* fs/splice.c */ 2380/* fs/splice.c */
2320extern ssize_t generic_file_splice_read(struct file *, loff_t *, 2381extern ssize_t generic_file_splice_read(struct file *, loff_t *,
@@ -2365,6 +2426,8 @@ enum {
2365}; 2426};
2366 2427
2367void dio_end_io(struct bio *bio, int error); 2428void dio_end_io(struct bio *bio, int error);
2429void inode_dio_wait(struct inode *inode);
2430void inode_dio_done(struct inode *inode);
2368 2431
2369ssize_t __blockdev_direct_IO(int rw, struct kiocb *iocb, struct inode *inode, 2432ssize_t __blockdev_direct_IO(int rw, struct kiocb *iocb, struct inode *inode,
2370 struct block_device *bdev, const struct iovec *iov, loff_t offset, 2433 struct block_device *bdev, const struct iovec *iov, loff_t offset,
@@ -2372,14 +2435,17 @@ ssize_t __blockdev_direct_IO(int rw, struct kiocb *iocb, struct inode *inode,
2372 dio_submit_t submit_io, int flags); 2435 dio_submit_t submit_io, int flags);
2373 2436
2374static inline ssize_t blockdev_direct_IO(int rw, struct kiocb *iocb, 2437static inline ssize_t blockdev_direct_IO(int rw, struct kiocb *iocb,
2375 struct inode *inode, struct block_device *bdev, const struct iovec *iov, 2438 struct inode *inode, const struct iovec *iov, loff_t offset,
2376 loff_t offset, unsigned long nr_segs, get_block_t get_block, 2439 unsigned long nr_segs, get_block_t get_block)
2377 dio_iodone_t end_io)
2378{ 2440{
2379 return __blockdev_direct_IO(rw, iocb, inode, bdev, iov, offset, 2441 return __blockdev_direct_IO(rw, iocb, inode, inode->i_sb->s_bdev, iov,
2380 nr_segs, get_block, end_io, NULL, 2442 offset, nr_segs, get_block, NULL, NULL,
2381 DIO_LOCKING | DIO_SKIP_HOLES); 2443 DIO_LOCKING | DIO_SKIP_HOLES);
2382} 2444}
2445#else
2446static inline void inode_dio_wait(struct inode *inode)
2447{
2448}
2383#endif 2449#endif
2384 2450
2385extern const struct file_operations generic_ro_fops; 2451extern const struct file_operations generic_ro_fops;
@@ -2429,6 +2495,8 @@ extern struct super_block *get_active_super(struct block_device *bdev);
2429extern struct super_block *user_get_super(dev_t); 2495extern struct super_block *user_get_super(dev_t);
2430extern void drop_super(struct super_block *sb); 2496extern void drop_super(struct super_block *sb);
2431extern void iterate_supers(void (*)(struct super_block *, void *), void *); 2497extern void iterate_supers(void (*)(struct super_block *, void *), void *);
2498extern void iterate_supers_type(struct file_system_type *,
2499 void (*)(struct super_block *, void *), void *);
2432 2500
2433extern int dcache_dir_open(struct inode *, struct file *); 2501extern int dcache_dir_open(struct inode *, struct file *);
2434extern int dcache_dir_close(struct inode *, struct file *); 2502extern int dcache_dir_close(struct inode *, struct file *);
@@ -2441,7 +2509,7 @@ extern int simple_link(struct dentry *, struct inode *, struct dentry *);
2441extern int simple_unlink(struct inode *, struct dentry *); 2509extern int simple_unlink(struct inode *, struct dentry *);
2442extern int simple_rmdir(struct inode *, struct dentry *); 2510extern int simple_rmdir(struct inode *, struct dentry *);
2443extern int simple_rename(struct inode *, struct dentry *, struct inode *, struct dentry *); 2511extern int simple_rename(struct inode *, struct dentry *, struct inode *, struct dentry *);
2444extern int noop_fsync(struct file *, int); 2512extern int noop_fsync(struct file *, loff_t, loff_t, int);
2445extern int simple_empty(struct dentry *); 2513extern int simple_empty(struct dentry *);
2446extern int simple_readpage(struct file *file, struct page *page); 2514extern int simple_readpage(struct file *file, struct page *page);
2447extern int simple_write_begin(struct file *file, struct address_space *mapping, 2515extern int simple_write_begin(struct file *file, struct address_space *mapping,
@@ -2466,7 +2534,7 @@ extern ssize_t simple_read_from_buffer(void __user *to, size_t count,
2466extern ssize_t simple_write_to_buffer(void *to, size_t available, loff_t *ppos, 2534extern ssize_t simple_write_to_buffer(void *to, size_t available, loff_t *ppos,
2467 const void __user *from, size_t count); 2535 const void __user *from, size_t count);
2468 2536
2469extern int generic_file_fsync(struct file *, int); 2537extern int generic_file_fsync(struct file *, loff_t, loff_t, int);
2470 2538
2471extern int generic_check_addressable(unsigned, u64); 2539extern int generic_check_addressable(unsigned, u64);
2472 2540
@@ -2591,7 +2659,7 @@ static inline int is_sxid(mode_t mode)
2591 2659
2592static inline void inode_has_no_xattr(struct inode *inode) 2660static inline void inode_has_no_xattr(struct inode *inode)
2593{ 2661{
2594 if (!is_sxid(inode->i_mode)) 2662 if (!is_sxid(inode->i_mode) && (inode->i_sb->s_flags & MS_NOSEC))
2595 inode->i_flags |= S_NOSEC; 2663 inode->i_flags |= S_NOSEC;
2596} 2664}
2597 2665
diff --git a/include/linux/fscache.h b/include/linux/fscache.h
index 7c4d72f5581f..9ec20dec3353 100644
--- a/include/linux/fscache.h
+++ b/include/linux/fscache.h
@@ -204,6 +204,8 @@ extern bool __fscache_check_page_write(struct fscache_cookie *, struct page *);
204extern void __fscache_wait_on_page_write(struct fscache_cookie *, struct page *); 204extern void __fscache_wait_on_page_write(struct fscache_cookie *, struct page *);
205extern bool __fscache_maybe_release_page(struct fscache_cookie *, struct page *, 205extern bool __fscache_maybe_release_page(struct fscache_cookie *, struct page *,
206 gfp_t); 206 gfp_t);
207extern void __fscache_uncache_all_inode_pages(struct fscache_cookie *,
208 struct inode *);
207 209
208/** 210/**
209 * fscache_register_netfs - Register a filesystem as desiring caching services 211 * fscache_register_netfs - Register a filesystem as desiring caching services
@@ -643,4 +645,23 @@ bool fscache_maybe_release_page(struct fscache_cookie *cookie,
643 return false; 645 return false;
644} 646}
645 647
648/**
649 * fscache_uncache_all_inode_pages - Uncache all an inode's pages
650 * @cookie: The cookie representing the inode's cache object.
651 * @inode: The inode to uncache pages from.
652 *
653 * Uncache all the pages in an inode that are marked PG_fscache, assuming them
654 * to be associated with the given cookie.
655 *
656 * This function may sleep. It will wait for pages that are being written out
657 * and will wait whilst the PG_fscache mark is removed by the cache.
658 */
659static inline
660void fscache_uncache_all_inode_pages(struct fscache_cookie *cookie,
661 struct inode *inode)
662{
663 if (fscache_cookie_valid(cookie))
664 __fscache_uncache_all_inode_pages(cookie, inode);
665}
666
646#endif /* _LINUX_FSCACHE_H */ 667#endif /* _LINUX_FSCACHE_H */
diff --git a/include/linux/fsl-diu-fb.h b/include/linux/fsl-diu-fb.h
index 781d4671415f..daa9952d2174 100644
--- a/include/linux/fsl-diu-fb.h
+++ b/include/linux/fsl-diu-fb.h
@@ -24,12 +24,6 @@
24 * See mpc8610fb_set_par(), map_video_memory(), and unmap_video_memory() 24 * See mpc8610fb_set_par(), map_video_memory(), and unmap_video_memory()
25 */ 25 */
26#define MEM_ALLOC_THRESHOLD (1024*768*4+32) 26#define MEM_ALLOC_THRESHOLD (1024*768*4+32)
27/* Minimum value that the pixel clock can be set to in pico seconds
28 * This is determined by platform clock/3 where the minimum platform
29 * clock is 533MHz. This gives 5629 pico seconds.
30 */
31#define MIN_PIX_CLK 5629
32#define MAX_PIX_CLK 96096
33 27
34#include <linux/types.h> 28#include <linux/types.h>
35 29
diff --git a/include/linux/fsl_hypervisor.h b/include/linux/fsl_hypervisor.h
new file mode 100644
index 000000000000..1cebaeeeef57
--- /dev/null
+++ b/include/linux/fsl_hypervisor.h
@@ -0,0 +1,241 @@
1/*
2 * Freescale hypervisor ioctl and kernel interface
3 *
4 * Copyright (C) 2008-2011 Freescale Semiconductor, Inc.
5 * Author: Timur Tabi <timur@freescale.com>
6 *
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions are met:
9 * * Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer.
11 * * Redistributions in binary form must reproduce the above copyright
12 * notice, this list of conditions and the following disclaimer in the
13 * documentation and/or other materials provided with the distribution.
14 * * Neither the name of Freescale Semiconductor nor the
15 * names of its contributors may be used to endorse or promote products
16 * derived from this software without specific prior written permission.
17 *
18 *
19 * ALTERNATIVELY, this software may be distributed under the terms of the
20 * GNU General Public License ("GPL") as published by the Free Software
21 * Foundation, either version 2 of that License or (at your option) any
22 * later version.
23 *
24 * This software is provided by Freescale Semiconductor "as is" and any
25 * express or implied warranties, including, but not limited to, the implied
26 * warranties of merchantability and fitness for a particular purpose are
27 * disclaimed. In no event shall Freescale Semiconductor be liable for any
28 * direct, indirect, incidental, special, exemplary, or consequential damages
29 * (including, but not limited to, procurement of substitute goods or services;
30 * loss of use, data, or profits; or business interruption) however caused and
31 * on any theory of liability, whether in contract, strict liability, or tort
32 * (including negligence or otherwise) arising in any way out of the use of this
33 * software, even if advised of the possibility of such damage.
34 *
35 * This file is used by the Freescale hypervisor management driver. It can
36 * also be included by applications that need to communicate with the driver
37 * via the ioctl interface.
38 */
39
40#ifndef FSL_HYPERVISOR_H
41#define FSL_HYPERVISOR_H
42
43#include <linux/types.h>
44
45/**
46 * struct fsl_hv_ioctl_restart - restart a partition
47 * @ret: return error code from the hypervisor
48 * @partition: the ID of the partition to restart, or -1 for the
49 * calling partition
50 *
51 * Used by FSL_HV_IOCTL_PARTITION_RESTART
52 */
53struct fsl_hv_ioctl_restart {
54 __u32 ret;
55 __u32 partition;
56};
57
58/**
59 * struct fsl_hv_ioctl_status - get a partition's status
60 * @ret: return error code from the hypervisor
61 * @partition: the ID of the partition to query, or -1 for the
62 * calling partition
63 * @status: The returned status of the partition
64 *
65 * Used by FSL_HV_IOCTL_PARTITION_GET_STATUS
66 *
67 * Values of 'status':
68 * 0 = Stopped
69 * 1 = Running
70 * 2 = Starting
71 * 3 = Stopping
72 */
73struct fsl_hv_ioctl_status {
74 __u32 ret;
75 __u32 partition;
76 __u32 status;
77};
78
79/**
80 * struct fsl_hv_ioctl_start - start a partition
81 * @ret: return error code from the hypervisor
82 * @partition: the ID of the partition to control
83 * @entry_point: The offset within the guest IMA to start execution
84 * @load: If non-zero, reload the partition's images before starting
85 *
86 * Used by FSL_HV_IOCTL_PARTITION_START
87 */
88struct fsl_hv_ioctl_start {
89 __u32 ret;
90 __u32 partition;
91 __u32 entry_point;
92 __u32 load;
93};
94
95/**
96 * struct fsl_hv_ioctl_stop - stop a partition
97 * @ret: return error code from the hypervisor
98 * @partition: the ID of the partition to stop, or -1 for the calling
99 * partition
100 *
101 * Used by FSL_HV_IOCTL_PARTITION_STOP
102 */
103struct fsl_hv_ioctl_stop {
104 __u32 ret;
105 __u32 partition;
106};
107
108/**
109 * struct fsl_hv_ioctl_memcpy - copy memory between partitions
110 * @ret: return error code from the hypervisor
111 * @source: the partition ID of the source partition, or -1 for this
112 * partition
113 * @target: the partition ID of the target partition, or -1 for this
114 * partition
115 * @reserved: reserved, must be set to 0
116 * @local_addr: user-space virtual address of a buffer in the local
117 * partition
118 * @remote_addr: guest physical address of a buffer in the
119 * remote partition
120 * @count: the number of bytes to copy. Both the local and remote
121 * buffers must be at least 'count' bytes long
122 *
123 * Used by FSL_HV_IOCTL_MEMCPY
124 *
125 * The 'local' partition is the partition that calls this ioctl. The
126 * 'remote' partition is a different partition. The data is copied from
127 * the 'source' paritition' to the 'target' partition.
128 *
129 * The buffer in the remote partition must be guest physically
130 * contiguous.
131 *
132 * This ioctl does not support copying memory between two remote
133 * partitions or within the same partition, so either 'source' or
134 * 'target' (but not both) must be -1. In other words, either
135 *
136 * source == local and target == remote
137 * or
138 * source == remote and target == local
139 */
140struct fsl_hv_ioctl_memcpy {
141 __u32 ret;
142 __u32 source;
143 __u32 target;
144 __u32 reserved; /* padding to ensure local_vaddr is aligned */
145 __u64 local_vaddr;
146 __u64 remote_paddr;
147 __u64 count;
148};
149
150/**
151 * struct fsl_hv_ioctl_doorbell - ring a doorbell
152 * @ret: return error code from the hypervisor
153 * @doorbell: the handle of the doorbell to ring doorbell
154 *
155 * Used by FSL_HV_IOCTL_DOORBELL
156 */
157struct fsl_hv_ioctl_doorbell {
158 __u32 ret;
159 __u32 doorbell;
160};
161
162/**
163 * struct fsl_hv_ioctl_prop - get/set a device tree property
164 * @ret: return error code from the hypervisor
165 * @handle: handle of partition whose tree to access
166 * @path: virtual address of path name of node to access
167 * @propname: virtual address of name of property to access
168 * @propval: virtual address of property data buffer
169 * @proplen: Size of property data buffer
170 * @reserved: reserved, must be set to 0
171 *
172 * Used by FSL_HV_IOCTL_DOORBELL
173 */
174struct fsl_hv_ioctl_prop {
175 __u32 ret;
176 __u32 handle;
177 __u64 path;
178 __u64 propname;
179 __u64 propval;
180 __u32 proplen;
181 __u32 reserved; /* padding to ensure structure is aligned */
182};
183
184/* The ioctl type, documented in ioctl-number.txt */
185#define FSL_HV_IOCTL_TYPE 0xAF
186
187/* Restart another partition */
188#define FSL_HV_IOCTL_PARTITION_RESTART \
189 _IOWR(FSL_HV_IOCTL_TYPE, 1, struct fsl_hv_ioctl_restart)
190
191/* Get a partition's status */
192#define FSL_HV_IOCTL_PARTITION_GET_STATUS \
193 _IOWR(FSL_HV_IOCTL_TYPE, 2, struct fsl_hv_ioctl_status)
194
195/* Boot another partition */
196#define FSL_HV_IOCTL_PARTITION_START \
197 _IOWR(FSL_HV_IOCTL_TYPE, 3, struct fsl_hv_ioctl_start)
198
199/* Stop this or another partition */
200#define FSL_HV_IOCTL_PARTITION_STOP \
201 _IOWR(FSL_HV_IOCTL_TYPE, 4, struct fsl_hv_ioctl_stop)
202
203/* Copy data from one partition to another */
204#define FSL_HV_IOCTL_MEMCPY \
205 _IOWR(FSL_HV_IOCTL_TYPE, 5, struct fsl_hv_ioctl_memcpy)
206
207/* Ring a doorbell */
208#define FSL_HV_IOCTL_DOORBELL \
209 _IOWR(FSL_HV_IOCTL_TYPE, 6, struct fsl_hv_ioctl_doorbell)
210
211/* Get a property from another guest's device tree */
212#define FSL_HV_IOCTL_GETPROP \
213 _IOWR(FSL_HV_IOCTL_TYPE, 7, struct fsl_hv_ioctl_prop)
214
215/* Set a property in another guest's device tree */
216#define FSL_HV_IOCTL_SETPROP \
217 _IOWR(FSL_HV_IOCTL_TYPE, 8, struct fsl_hv_ioctl_prop)
218
219#ifdef __KERNEL__
220
221/**
222 * fsl_hv_event_register() - register a callback for failover events
223 * @nb: pointer to caller-supplied notifier_block structure
224 *
225 * This function is called by device drivers to register their callback
226 * functions for fail-over events.
227 *
228 * The caller should allocate a notifier_block object and initialize the
229 * 'priority' and 'notifier_call' fields.
230 */
231int fsl_hv_failover_register(struct notifier_block *nb);
232
233/**
234 * fsl_hv_event_unregister() - unregister a callback for failover events
235 * @nb: the same 'nb' used in previous fsl_hv_failover_register call
236 */
237int fsl_hv_failover_unregister(struct notifier_block *nb);
238
239#endif
240
241#endif
diff --git a/include/linux/fsnotify_backend.h b/include/linux/fsnotify_backend.h
index 69ad89b50489..91d0e0a34ef3 100644
--- a/include/linux/fsnotify_backend.h
+++ b/include/linux/fsnotify_backend.h
@@ -16,7 +16,7 @@
16#include <linux/spinlock.h> 16#include <linux/spinlock.h>
17#include <linux/types.h> 17#include <linux/types.h>
18 18
19#include <asm/atomic.h> 19#include <linux/atomic.h>
20 20
21/* 21/*
22 * IN_* from inotfy.h lines up EXACTLY with FS_*, this is so we can easily 22 * IN_* from inotfy.h lines up EXACTLY with FS_*, this is so we can easily
diff --git a/include/linux/ftrace.h b/include/linux/ftrace.h
index 9d88e1cb5dbb..f0c0e8a47ae6 100644
--- a/include/linux/ftrace.h
+++ b/include/linux/ftrace.h
@@ -19,6 +19,8 @@
19 19
20#include <asm/ftrace.h> 20#include <asm/ftrace.h>
21 21
22struct ftrace_hash;
23
22#ifdef CONFIG_FUNCTION_TRACER 24#ifdef CONFIG_FUNCTION_TRACER
23 25
24extern int ftrace_enabled; 26extern int ftrace_enabled;
@@ -29,8 +31,6 @@ ftrace_enable_sysctl(struct ctl_table *table, int write,
29 31
30typedef void (*ftrace_func_t)(unsigned long ip, unsigned long parent_ip); 32typedef void (*ftrace_func_t)(unsigned long ip, unsigned long parent_ip);
31 33
32struct ftrace_hash;
33
34enum { 34enum {
35 FTRACE_OPS_FL_ENABLED = 1 << 0, 35 FTRACE_OPS_FL_ENABLED = 1 << 0,
36 FTRACE_OPS_FL_GLOBAL = 1 << 1, 36 FTRACE_OPS_FL_GLOBAL = 1 << 1,
@@ -123,7 +123,8 @@ stack_trace_sysctl(struct ctl_table *table, int write,
123struct ftrace_func_command { 123struct ftrace_func_command {
124 struct list_head list; 124 struct list_head list;
125 char *name; 125 char *name;
126 int (*func)(char *func, char *cmd, 126 int (*func)(struct ftrace_hash *hash,
127 char *func, char *cmd,
127 char *params, int enable); 128 char *params, int enable);
128}; 129};
129 130
diff --git a/include/linux/ftrace_event.h b/include/linux/ftrace_event.h
index 59d3ef100eb9..96efa6794ea5 100644
--- a/include/linux/ftrace_event.h
+++ b/include/linux/ftrace_event.h
@@ -76,6 +76,7 @@ struct trace_iterator {
76 struct trace_entry *ent; 76 struct trace_entry *ent;
77 unsigned long lost_events; 77 unsigned long lost_events;
78 int leftover; 78 int leftover;
79 int ent_size;
79 int cpu; 80 int cpu;
80 u64 ts; 81 u64 ts;
81 82
@@ -129,6 +130,10 @@ void trace_current_buffer_unlock_commit(struct ring_buffer *buffer,
129void trace_nowake_buffer_unlock_commit(struct ring_buffer *buffer, 130void trace_nowake_buffer_unlock_commit(struct ring_buffer *buffer,
130 struct ring_buffer_event *event, 131 struct ring_buffer_event *event,
131 unsigned long flags, int pc); 132 unsigned long flags, int pc);
133void trace_nowake_buffer_unlock_commit_regs(struct ring_buffer *buffer,
134 struct ring_buffer_event *event,
135 unsigned long flags, int pc,
136 struct pt_regs *regs);
132void trace_current_buffer_discard_commit(struct ring_buffer *buffer, 137void trace_current_buffer_discard_commit(struct ring_buffer *buffer,
133 struct ring_buffer_event *event); 138 struct ring_buffer_event *event);
134 139
diff --git a/include/linux/genalloc.h b/include/linux/genalloc.h
index 5bbebda78b02..5e98eeb2af3b 100644
--- a/include/linux/genalloc.h
+++ b/include/linux/genalloc.h
@@ -1,8 +1,26 @@
1/* 1/*
2 * Basic general purpose allocator for managing special purpose memory 2 * Basic general purpose allocator for managing special purpose
3 * not managed by the regular kmalloc/kfree interface. 3 * memory, for example, memory that is not managed by the regular
4 * Uses for this includes on-device special memory, uncached memory 4 * kmalloc/kfree interface. Uses for this includes on-device special
5 * etc. 5 * memory, uncached memory etc.
6 *
7 * It is safe to use the allocator in NMI handlers and other special
8 * unblockable contexts that could otherwise deadlock on locks. This
9 * is implemented by using atomic operations and retries on any
10 * conflicts. The disadvantage is that there may be livelocks in
11 * extreme cases. For better scalability, one allocator can be used
12 * for each CPU.
13 *
14 * The lockless operation only works if there is enough memory
15 * available. If new memory is added to the pool a lock has to be
16 * still taken. So any user relying on locklessness has to ensure
17 * that sufficient memory is preallocated.
18 *
19 * The basic atomic operation of this allocator is cmpxchg on long.
20 * On architectures that don't have NMI-safe cmpxchg implementation,
21 * the allocator can NOT be used in NMI handler. So code uses the
22 * allocator in NMI handler should depend on
23 * CONFIG_ARCH_HAVE_NMI_SAFE_CMPXCHG.
6 * 24 *
7 * This source code is licensed under the GNU General Public License, 25 * This source code is licensed under the GNU General Public License,
8 * Version 2. See the file COPYING for more details. 26 * Version 2. See the file COPYING for more details.
@@ -15,7 +33,7 @@
15 * General purpose special memory pool descriptor. 33 * General purpose special memory pool descriptor.
16 */ 34 */
17struct gen_pool { 35struct gen_pool {
18 rwlock_t lock; 36 spinlock_t lock;
19 struct list_head chunks; /* list of chunks in this pool */ 37 struct list_head chunks; /* list of chunks in this pool */
20 int min_alloc_order; /* minimum allocation order */ 38 int min_alloc_order; /* minimum allocation order */
21}; 39};
@@ -24,8 +42,8 @@ struct gen_pool {
24 * General purpose special memory pool chunk descriptor. 42 * General purpose special memory pool chunk descriptor.
25 */ 43 */
26struct gen_pool_chunk { 44struct gen_pool_chunk {
27 spinlock_t lock;
28 struct list_head next_chunk; /* next chunk in pool */ 45 struct list_head next_chunk; /* next chunk in pool */
46 atomic_t avail;
29 phys_addr_t phys_addr; /* physical starting address of memory chunk */ 47 phys_addr_t phys_addr; /* physical starting address of memory chunk */
30 unsigned long start_addr; /* starting address of memory chunk */ 48 unsigned long start_addr; /* starting address of memory chunk */
31 unsigned long end_addr; /* ending address of memory chunk */ 49 unsigned long end_addr; /* ending address of memory chunk */
@@ -56,4 +74,8 @@ static inline int gen_pool_add(struct gen_pool *pool, unsigned long addr,
56extern void gen_pool_destroy(struct gen_pool *); 74extern void gen_pool_destroy(struct gen_pool *);
57extern unsigned long gen_pool_alloc(struct gen_pool *, size_t); 75extern unsigned long gen_pool_alloc(struct gen_pool *, size_t);
58extern void gen_pool_free(struct gen_pool *, unsigned long, size_t); 76extern void gen_pool_free(struct gen_pool *, unsigned long, size_t);
77extern void gen_pool_for_each_chunk(struct gen_pool *,
78 void (*)(struct gen_pool *, struct gen_pool_chunk *, void *), void *);
79extern size_t gen_pool_avail(struct gen_pool *);
80extern size_t gen_pool_size(struct gen_pool *);
59#endif /* __GENALLOC_H__ */ 81#endif /* __GENALLOC_H__ */
diff --git a/include/linux/generic_acl.h b/include/linux/generic_acl.h
index 0437e377b555..b6d657544ef1 100644
--- a/include/linux/generic_acl.h
+++ b/include/linux/generic_acl.h
@@ -10,6 +10,5 @@ extern const struct xattr_handler generic_acl_default_handler;
10 10
11int generic_acl_init(struct inode *, struct inode *); 11int generic_acl_init(struct inode *, struct inode *);
12int generic_acl_chmod(struct inode *); 12int generic_acl_chmod(struct inode *);
13int generic_check_acl(struct inode *inode, int mask, unsigned int flags);
14 13
15#endif /* LINUX_GENERIC_ACL_H */ 14#endif /* LINUX_GENERIC_ACL_H */
diff --git a/include/linux/genhd.h b/include/linux/genhd.h
index b78956b3c2e7..02fa4697a0e5 100644
--- a/include/linux/genhd.h
+++ b/include/linux/genhd.h
@@ -100,6 +100,7 @@ struct hd_struct {
100 sector_t start_sect; 100 sector_t start_sect;
101 sector_t nr_sects; 101 sector_t nr_sects;
102 sector_t alignment_offset; 102 sector_t alignment_offset;
103 unsigned int discard_alignment;
103 struct device __dev; 104 struct device __dev;
104 struct kobject *holder_dir; 105 struct kobject *holder_dir;
105 int policy, partno; 106 int policy, partno;
@@ -419,7 +420,7 @@ static inline int get_disk_ro(struct gendisk *disk)
419 420
420extern void disk_block_events(struct gendisk *disk); 421extern void disk_block_events(struct gendisk *disk);
421extern void disk_unblock_events(struct gendisk *disk); 422extern void disk_unblock_events(struct gendisk *disk);
422extern void disk_check_events(struct gendisk *disk); 423extern void disk_flush_events(struct gendisk *disk, unsigned int mask);
423extern unsigned int disk_clear_events(struct gendisk *disk, unsigned int mask); 424extern unsigned int disk_clear_events(struct gendisk *disk, unsigned int mask);
424 425
425/* drivers/char/random.c */ 426/* drivers/char/random.c */
diff --git a/include/linux/gfp.h b/include/linux/gfp.h
index cb4089254f01..3a76faf6a3ee 100644
--- a/include/linux/gfp.h
+++ b/include/linux/gfp.h
@@ -92,7 +92,7 @@ struct vm_area_struct;
92 */ 92 */
93#define __GFP_NOTRACK_FALSE_POSITIVE (__GFP_NOTRACK) 93#define __GFP_NOTRACK_FALSE_POSITIVE (__GFP_NOTRACK)
94 94
95#define __GFP_BITS_SHIFT 23 /* Room for 23 __GFP_FOO bits */ 95#define __GFP_BITS_SHIFT 24 /* Room for N __GFP_FOO bits */
96#define __GFP_BITS_MASK ((__force gfp_t)((1 << __GFP_BITS_SHIFT) - 1)) 96#define __GFP_BITS_MASK ((__force gfp_t)((1 << __GFP_BITS_SHIFT) - 1))
97 97
98/* This equals 0, but use constants in case they ever change */ 98/* This equals 0, but use constants in case they ever change */
diff --git a/include/linux/gpio.h b/include/linux/gpio.h
index 32d47e710661..17b5a0d80e42 100644
--- a/include/linux/gpio.h
+++ b/include/linux/gpio.h
@@ -3,6 +3,17 @@
3 3
4/* see Documentation/gpio.txt */ 4/* see Documentation/gpio.txt */
5 5
6/* make these flag values available regardless of GPIO kconfig options */
7#define GPIOF_DIR_OUT (0 << 0)
8#define GPIOF_DIR_IN (1 << 0)
9
10#define GPIOF_INIT_LOW (0 << 1)
11#define GPIOF_INIT_HIGH (1 << 1)
12
13#define GPIOF_IN (GPIOF_DIR_IN)
14#define GPIOF_OUT_INIT_LOW (GPIOF_DIR_OUT | GPIOF_INIT_LOW)
15#define GPIOF_OUT_INIT_HIGH (GPIOF_DIR_OUT | GPIOF_INIT_HIGH)
16
6#ifdef CONFIG_GENERIC_GPIO 17#ifdef CONFIG_GENERIC_GPIO
7#include <asm/gpio.h> 18#include <asm/gpio.h>
8 19
diff --git a/include/linux/gsmmux.h b/include/linux/gsmmux.h
index 378de4195caf..c25e9477f7c3 100644
--- a/include/linux/gsmmux.h
+++ b/include/linux/gsmmux.h
@@ -21,5 +21,16 @@ struct gsm_config
21#define GSMIOC_GETCONF _IOR('G', 0, struct gsm_config) 21#define GSMIOC_GETCONF _IOR('G', 0, struct gsm_config)
22#define GSMIOC_SETCONF _IOW('G', 1, struct gsm_config) 22#define GSMIOC_SETCONF _IOW('G', 1, struct gsm_config)
23 23
24struct gsm_netconfig {
25 unsigned int adaption; /* Adaption to use in network mode */
26 unsigned short protocol;/* Protocol to use - only ETH_P_IP supported */
27 unsigned short unused2;
28 char if_name[IFNAMSIZ]; /* interface name format string */
29 __u8 unused[28]; /* For future use */
30};
31
32#define GSMIOC_ENABLE_NET _IOW('G', 2, struct gsm_netconfig)
33#define GSMIOC_DISABLE_NET _IO('G', 3)
34
24 35
25#endif 36#endif
diff --git a/include/linux/hardirq.h b/include/linux/hardirq.h
index ba362171e8ae..f743883f769e 100644
--- a/include/linux/hardirq.h
+++ b/include/linux/hardirq.h
@@ -93,7 +93,7 @@
93 */ 93 */
94#define in_nmi() (preempt_count() & NMI_MASK) 94#define in_nmi() (preempt_count() & NMI_MASK)
95 95
96#if defined(CONFIG_PREEMPT) 96#if defined(CONFIG_PREEMPT_COUNT)
97# define PREEMPT_CHECK_OFFSET 1 97# define PREEMPT_CHECK_OFFSET 1
98#else 98#else
99# define PREEMPT_CHECK_OFFSET 0 99# define PREEMPT_CHECK_OFFSET 0
@@ -115,7 +115,7 @@
115#define in_atomic_preempt_off() \ 115#define in_atomic_preempt_off() \
116 ((preempt_count() & ~PREEMPT_ACTIVE) != PREEMPT_CHECK_OFFSET) 116 ((preempt_count() & ~PREEMPT_ACTIVE) != PREEMPT_CHECK_OFFSET)
117 117
118#ifdef CONFIG_PREEMPT 118#ifdef CONFIG_PREEMPT_COUNT
119# define preemptible() (preempt_count() == 0 && !irqs_disabled()) 119# define preemptible() (preempt_count() == 0 && !irqs_disabled())
120# define IRQ_EXIT_OFFSET (HARDIRQ_OFFSET-1) 120# define IRQ_EXIT_OFFSET (HARDIRQ_OFFSET-1)
121#else 121#else
diff --git a/include/linux/hid.h b/include/linux/hid.h
index 42f7e2fb501f..9cf8e7ae7450 100644
--- a/include/linux/hid.h
+++ b/include/linux/hid.h
@@ -453,7 +453,8 @@ struct hid_input {
453 453
454enum hid_type { 454enum hid_type {
455 HID_TYPE_OTHER = 0, 455 HID_TYPE_OTHER = 0,
456 HID_TYPE_USBMOUSE 456 HID_TYPE_USBMOUSE,
457 HID_TYPE_USBNONE
457}; 458};
458 459
459struct hid_driver; 460struct hid_driver;
diff --git a/include/linux/hrtimer.h b/include/linux/hrtimer.h
index 51932e5acf7c..fd0dc30c9f15 100644
--- a/include/linux/hrtimer.h
+++ b/include/linux/hrtimer.h
@@ -135,6 +135,7 @@ struct hrtimer_sleeper {
135 * @cpu_base: per cpu clock base 135 * @cpu_base: per cpu clock base
136 * @index: clock type index for per_cpu support when moving a 136 * @index: clock type index for per_cpu support when moving a
137 * timer to a base on another cpu. 137 * timer to a base on another cpu.
138 * @clockid: clock id for per_cpu support
138 * @active: red black tree root node for the active timers 139 * @active: red black tree root node for the active timers
139 * @resolution: the resolution of the clock, in nanoseconds 140 * @resolution: the resolution of the clock, in nanoseconds
140 * @get_time: function to retrieve the current time of the clock 141 * @get_time: function to retrieve the current time of the clock
diff --git a/include/linux/hugetlb.h b/include/linux/hugetlb.h
index 59225ef27d15..19644e0016bd 100644
--- a/include/linux/hugetlb.h
+++ b/include/linux/hugetlb.h
@@ -231,6 +231,9 @@ struct hstate {
231struct huge_bootmem_page { 231struct huge_bootmem_page {
232 struct list_head list; 232 struct list_head list;
233 struct hstate *hstate; 233 struct hstate *hstate;
234#ifdef CONFIG_HIGHMEM
235 phys_addr_t phys;
236#endif
234}; 237};
235 238
236struct page *alloc_huge_page_node(struct hstate *h, int nid); 239struct page *alloc_huge_page_node(struct hstate *h, int nid);
diff --git a/include/linux/hw_breakpoint.h b/include/linux/hw_breakpoint.h
index d1e55fed2c7d..6ae9c631a1be 100644
--- a/include/linux/hw_breakpoint.h
+++ b/include/linux/hw_breakpoint.h
@@ -73,6 +73,7 @@ static inline unsigned long hw_breakpoint_len(struct perf_event *bp)
73extern struct perf_event * 73extern struct perf_event *
74register_user_hw_breakpoint(struct perf_event_attr *attr, 74register_user_hw_breakpoint(struct perf_event_attr *attr,
75 perf_overflow_handler_t triggered, 75 perf_overflow_handler_t triggered,
76 void *context,
76 struct task_struct *tsk); 77 struct task_struct *tsk);
77 78
78/* FIXME: only change from the attr, and don't unregister */ 79/* FIXME: only change from the attr, and don't unregister */
@@ -85,11 +86,13 @@ modify_user_hw_breakpoint(struct perf_event *bp, struct perf_event_attr *attr);
85extern struct perf_event * 86extern struct perf_event *
86register_wide_hw_breakpoint_cpu(struct perf_event_attr *attr, 87register_wide_hw_breakpoint_cpu(struct perf_event_attr *attr,
87 perf_overflow_handler_t triggered, 88 perf_overflow_handler_t triggered,
89 void *context,
88 int cpu); 90 int cpu);
89 91
90extern struct perf_event * __percpu * 92extern struct perf_event * __percpu *
91register_wide_hw_breakpoint(struct perf_event_attr *attr, 93register_wide_hw_breakpoint(struct perf_event_attr *attr,
92 perf_overflow_handler_t triggered); 94 perf_overflow_handler_t triggered,
95 void *context);
93 96
94extern int register_perf_hw_breakpoint(struct perf_event *bp); 97extern int register_perf_hw_breakpoint(struct perf_event *bp);
95extern int __register_perf_hw_breakpoint(struct perf_event *bp); 98extern int __register_perf_hw_breakpoint(struct perf_event *bp);
@@ -115,6 +118,7 @@ static inline int __init init_hw_breakpoint(void) { return 0; }
115static inline struct perf_event * 118static inline struct perf_event *
116register_user_hw_breakpoint(struct perf_event_attr *attr, 119register_user_hw_breakpoint(struct perf_event_attr *attr,
117 perf_overflow_handler_t triggered, 120 perf_overflow_handler_t triggered,
121 void *context,
118 struct task_struct *tsk) { return NULL; } 122 struct task_struct *tsk) { return NULL; }
119static inline int 123static inline int
120modify_user_hw_breakpoint(struct perf_event *bp, 124modify_user_hw_breakpoint(struct perf_event *bp,
@@ -122,10 +126,12 @@ modify_user_hw_breakpoint(struct perf_event *bp,
122static inline struct perf_event * 126static inline struct perf_event *
123register_wide_hw_breakpoint_cpu(struct perf_event_attr *attr, 127register_wide_hw_breakpoint_cpu(struct perf_event_attr *attr,
124 perf_overflow_handler_t triggered, 128 perf_overflow_handler_t triggered,
129 void *context,
125 int cpu) { return NULL; } 130 int cpu) { return NULL; }
126static inline struct perf_event * __percpu * 131static inline struct perf_event * __percpu *
127register_wide_hw_breakpoint(struct perf_event_attr *attr, 132register_wide_hw_breakpoint(struct perf_event_attr *attr,
128 perf_overflow_handler_t triggered) { return NULL; } 133 perf_overflow_handler_t triggered,
134 void *context) { return NULL; }
129static inline int 135static inline int
130register_perf_hw_breakpoint(struct perf_event *bp) { return -ENOSYS; } 136register_perf_hw_breakpoint(struct perf_event *bp) { return -ENOSYS; }
131static inline int 137static inline int
diff --git a/include/linux/hw_random.h b/include/linux/hw_random.h
index 9bede7633f74..b4b0eef5fddf 100644
--- a/include/linux/hw_random.h
+++ b/include/linux/hw_random.h
@@ -25,7 +25,7 @@
25 * there is always data available. *OBSOLETE* 25 * there is always data available. *OBSOLETE*
26 * @data_read: Read data from the RNG device. 26 * @data_read: Read data from the RNG device.
27 * Returns the number of lower random bytes in "data". 27 * Returns the number of lower random bytes in "data".
28 * Must not be NULL. *OSOLETE* 28 * Must not be NULL. *OBSOLETE*
29 * @read: New API. drivers can fill up to max bytes of data 29 * @read: New API. drivers can fill up to max bytes of data
30 * into the buffer. The buffer is aligned for any type. 30 * into the buffer. The buffer is aligned for any type.
31 * @priv: Private data, for use by the RNG driver. 31 * @priv: Private data, for use by the RNG driver.
diff --git a/include/linux/i2c-omap.h b/include/linux/i2c-omap.h
index 7472449cbb74..0aa0cbd676f7 100644
--- a/include/linux/i2c-omap.h
+++ b/include/linux/i2c-omap.h
@@ -3,6 +3,33 @@
3 3
4#include <linux/platform_device.h> 4#include <linux/platform_device.h>
5 5
6/*
7 * Version 2 of the I2C peripheral unit has a different register
8 * layout and extra registers. The ID register in the V2 peripheral
9 * unit on the OMAP4430 reports the same ID as the V1 peripheral
10 * unit on the OMAP3530, so we must inform the driver which IP
11 * version we know it is running on from platform / cpu-specific
12 * code using these constants in the hwmod class definition.
13 */
14
15#define OMAP_I2C_IP_VERSION_1 1
16#define OMAP_I2C_IP_VERSION_2 2
17
18/* struct omap_i2c_bus_platform_data .flags meanings */
19
20#define OMAP_I2C_FLAG_NO_FIFO BIT(0)
21#define OMAP_I2C_FLAG_SIMPLE_CLOCK BIT(1)
22#define OMAP_I2C_FLAG_16BIT_DATA_REG BIT(2)
23#define OMAP_I2C_FLAG_RESET_REGS_POSTIDLE BIT(3)
24#define OMAP_I2C_FLAG_APPLY_ERRATA_I207 BIT(4)
25#define OMAP_I2C_FLAG_ALWAYS_ARMXOR_CLK BIT(5)
26#define OMAP_I2C_FLAG_FORCE_19200_INT_CLK BIT(6)
27/* how the CPU address bus must be translated for I2C unit access */
28#define OMAP_I2C_FLAG_BUS_SHIFT_NONE 0
29#define OMAP_I2C_FLAG_BUS_SHIFT_1 BIT(7)
30#define OMAP_I2C_FLAG_BUS_SHIFT_2 BIT(8)
31#define OMAP_I2C_FLAG_BUS_SHIFT__SHIFT 7
32
6struct omap_i2c_bus_platform_data { 33struct omap_i2c_bus_platform_data {
7 u32 clkrate; 34 u32 clkrate;
8 void (*set_mpu_wkup_lat)(struct device *dev, long set); 35 void (*set_mpu_wkup_lat)(struct device *dev, long set);
diff --git a/include/linux/i2c/adp8870.h b/include/linux/i2c/adp8870.h
new file mode 100644
index 000000000000..624dceccbd5b
--- /dev/null
+++ b/include/linux/i2c/adp8870.h
@@ -0,0 +1,153 @@
1/*
2 * Definitions and platform data for Analog Devices
3 * Backlight drivers ADP8870
4 *
5 * Copyright 2009-2010 Analog Devices Inc.
6 *
7 * Licensed under the GPL-2 or later.
8 */
9
10#ifndef __LINUX_I2C_ADP8870_H
11#define __LINUX_I2C_ADP8870_H
12
13#define ID_ADP8870 8870
14
15#define ADP8870_MAX_BRIGHTNESS 0x7F
16#define FLAG_OFFT_SHIFT 8
17
18/*
19 * LEDs subdevice platform data
20 */
21
22#define ADP8870_LED_DIS_BLINK (0 << FLAG_OFFT_SHIFT)
23#define ADP8870_LED_OFFT_600ms (1 << FLAG_OFFT_SHIFT)
24#define ADP8870_LED_OFFT_1200ms (2 << FLAG_OFFT_SHIFT)
25#define ADP8870_LED_OFFT_1800ms (3 << FLAG_OFFT_SHIFT)
26
27#define ADP8870_LED_ONT_200ms 0
28#define ADP8870_LED_ONT_600ms 1
29#define ADP8870_LED_ONT_800ms 2
30#define ADP8870_LED_ONT_1200ms 3
31
32#define ADP8870_LED_D7 (7)
33#define ADP8870_LED_D6 (6)
34#define ADP8870_LED_D5 (5)
35#define ADP8870_LED_D4 (4)
36#define ADP8870_LED_D3 (3)
37#define ADP8870_LED_D2 (2)
38#define ADP8870_LED_D1 (1)
39
40/*
41 * Backlight subdevice platform data
42 */
43
44#define ADP8870_BL_D7 (1 << 6)
45#define ADP8870_BL_D6 (1 << 5)
46#define ADP8870_BL_D5 (1 << 4)
47#define ADP8870_BL_D4 (1 << 3)
48#define ADP8870_BL_D3 (1 << 2)
49#define ADP8870_BL_D2 (1 << 1)
50#define ADP8870_BL_D1 (1 << 0)
51
52#define ADP8870_FADE_T_DIS 0 /* Fade Timer Disabled */
53#define ADP8870_FADE_T_300ms 1 /* 0.3 Sec */
54#define ADP8870_FADE_T_600ms 2
55#define ADP8870_FADE_T_900ms 3
56#define ADP8870_FADE_T_1200ms 4
57#define ADP8870_FADE_T_1500ms 5
58#define ADP8870_FADE_T_1800ms 6
59#define ADP8870_FADE_T_2100ms 7
60#define ADP8870_FADE_T_2400ms 8
61#define ADP8870_FADE_T_2700ms 9
62#define ADP8870_FADE_T_3000ms 10
63#define ADP8870_FADE_T_3500ms 11
64#define ADP8870_FADE_T_4000ms 12
65#define ADP8870_FADE_T_4500ms 13
66#define ADP8870_FADE_T_5000ms 14
67#define ADP8870_FADE_T_5500ms 15 /* 5.5 Sec */
68
69#define ADP8870_FADE_LAW_LINEAR 0
70#define ADP8870_FADE_LAW_SQUARE 1
71#define ADP8870_FADE_LAW_CUBIC1 2
72#define ADP8870_FADE_LAW_CUBIC2 3
73
74#define ADP8870_BL_AMBL_FILT_80ms 0 /* Light sensor filter time */
75#define ADP8870_BL_AMBL_FILT_160ms 1
76#define ADP8870_BL_AMBL_FILT_320ms 2
77#define ADP8870_BL_AMBL_FILT_640ms 3
78#define ADP8870_BL_AMBL_FILT_1280ms 4
79#define ADP8870_BL_AMBL_FILT_2560ms 5
80#define ADP8870_BL_AMBL_FILT_5120ms 6
81#define ADP8870_BL_AMBL_FILT_10240ms 7 /* 10.24 sec */
82
83/*
84 * Blacklight current 0..30mA
85 */
86#define ADP8870_BL_CUR_mA(I) ((I * 127) / 30)
87
88/*
89 * L2 comparator current 0..1106uA
90 */
91#define ADP8870_L2_COMP_CURR_uA(I) ((I * 255) / 1106)
92
93/*
94 * L3 comparator current 0..551uA
95 */
96#define ADP8870_L3_COMP_CURR_uA(I) ((I * 255) / 551)
97
98/*
99 * L4 comparator current 0..275uA
100 */
101#define ADP8870_L4_COMP_CURR_uA(I) ((I * 255) / 275)
102
103/*
104 * L5 comparator current 0..138uA
105 */
106#define ADP8870_L5_COMP_CURR_uA(I) ((I * 255) / 138)
107
108struct adp8870_backlight_platform_data {
109 u8 bl_led_assign; /* 1 = Backlight 0 = Individual LED */
110 u8 pwm_assign; /* 1 = Enables PWM mode */
111
112 u8 bl_fade_in; /* Backlight Fade-In Timer */
113 u8 bl_fade_out; /* Backlight Fade-Out Timer */
114 u8 bl_fade_law; /* fade-on/fade-off transfer characteristic */
115
116 u8 en_ambl_sens; /* 1 = enable ambient light sensor */
117 u8 abml_filt; /* Light sensor filter time */
118
119 u8 l1_daylight_max; /* use BL_CUR_mA(I) 0 <= I <= 30 mA */
120 u8 l1_daylight_dim; /* typ = 0, use BL_CUR_mA(I) 0 <= I <= 30 mA */
121 u8 l2_bright_max; /* use BL_CUR_mA(I) 0 <= I <= 30 mA */
122 u8 l2_bright_dim; /* typ = 0, use BL_CUR_mA(I) 0 <= I <= 30 mA */
123 u8 l3_office_max; /* use BL_CUR_mA(I) 0 <= I <= 30 mA */
124 u8 l3_office_dim; /* typ = 0, use BL_CUR_mA(I) 0 <= I <= 30 mA */
125 u8 l4_indoor_max; /* use BL_CUR_mA(I) 0 <= I <= 30 mA */
126 u8 l4_indor_dim; /* typ = 0, use BL_CUR_mA(I) 0 <= I <= 30 mA */
127 u8 l5_dark_max; /* use BL_CUR_mA(I) 0 <= I <= 30 mA */
128 u8 l5_dark_dim; /* typ = 0, use BL_CUR_mA(I) 0 <= I <= 30 mA */
129
130 u8 l2_trip; /* use L2_COMP_CURR_uA(I) 0 <= I <= 1106 uA */
131 u8 l2_hyst; /* use L2_COMP_CURR_uA(I) 0 <= I <= 1106 uA */
132 u8 l3_trip; /* use L3_COMP_CURR_uA(I) 0 <= I <= 551 uA */
133 u8 l3_hyst; /* use L3_COMP_CURR_uA(I) 0 <= I <= 551 uA */
134 u8 l4_trip; /* use L4_COMP_CURR_uA(I) 0 <= I <= 275 uA */
135 u8 l4_hyst; /* use L4_COMP_CURR_uA(I) 0 <= I <= 275 uA */
136 u8 l5_trip; /* use L5_COMP_CURR_uA(I) 0 <= I <= 138 uA */
137 u8 l5_hyst; /* use L6_COMP_CURR_uA(I) 0 <= I <= 138 uA */
138
139 /**
140 * Independent Current Sinks / LEDS
141 * Sinks not assigned to the Backlight can be exposed to
142 * user space using the LEDS CLASS interface
143 */
144
145 int num_leds;
146 struct led_info *leds;
147 u8 led_fade_in; /* LED Fade-In Timer */
148 u8 led_fade_out; /* LED Fade-Out Timer */
149 u8 led_fade_law; /* fade-on/fade-off transfer characteristic */
150 u8 led_on_time;
151};
152
153#endif /* __LINUX_I2C_ADP8870_H */
diff --git a/include/linux/i2c/twl.h b/include/linux/i2c/twl.h
index ba4f88624fcd..114c0f6fc63d 100644
--- a/include/linux/i2c/twl.h
+++ b/include/linux/i2c/twl.h
@@ -657,28 +657,41 @@ struct twl4030_power_data {
657extern void twl4030_power_init(struct twl4030_power_data *triton2_scripts); 657extern void twl4030_power_init(struct twl4030_power_data *triton2_scripts);
658extern int twl4030_remove_script(u8 flags); 658extern int twl4030_remove_script(u8 flags);
659 659
660struct twl4030_codec_audio_data { 660struct twl4030_codec_data {
661 unsigned int digimic_delay; /* in ms */ 661 unsigned int digimic_delay; /* in ms */
662 unsigned int ramp_delay_value; 662 unsigned int ramp_delay_value;
663 unsigned int offset_cncl_path; 663 unsigned int offset_cncl_path;
664 unsigned int check_defaults:1; 664 unsigned int check_defaults:1;
665 unsigned int reset_registers:1; 665 unsigned int reset_registers:1;
666 unsigned int hs_extmute:1; 666 unsigned int hs_extmute:1;
667 u16 hs_left_step;
668 u16 hs_right_step;
669 u16 hf_left_step;
670 u16 hf_right_step;
667 void (*set_hs_extmute)(int mute); 671 void (*set_hs_extmute)(int mute);
668}; 672};
669 673
670struct twl4030_codec_vibra_data { 674struct twl4030_vibra_data {
671 unsigned int coexist; 675 unsigned int coexist;
676
677 /* twl6040 */
678 unsigned int vibldrv_res; /* left driver resistance */
679 unsigned int vibrdrv_res; /* right driver resistance */
680 unsigned int viblmotor_res; /* left motor resistance */
681 unsigned int vibrmotor_res; /* right motor resistance */
682 int vddvibl_uV; /* VDDVIBL volt, set 0 for fixed reg */
683 int vddvibr_uV; /* VDDVIBR volt, set 0 for fixed reg */
672}; 684};
673 685
674struct twl4030_codec_data { 686struct twl4030_audio_data {
675 unsigned int audio_mclk; 687 unsigned int audio_mclk;
676 struct twl4030_codec_audio_data *audio; 688 struct twl4030_codec_data *codec;
677 struct twl4030_codec_vibra_data *vibra; 689 struct twl4030_vibra_data *vibra;
678 690
679 /* twl6040 */ 691 /* twl6040 */
680 int audpwron_gpio; /* audio power-on gpio */ 692 int audpwron_gpio; /* audio power-on gpio */
681 int naudint_irq; /* audio interrupt */ 693 int naudint_irq; /* audio interrupt */
694 unsigned int irq_base;
682}; 695};
683 696
684struct twl4030_platform_data { 697struct twl4030_platform_data {
@@ -690,7 +703,7 @@ struct twl4030_platform_data {
690 struct twl4030_keypad_data *keypad; 703 struct twl4030_keypad_data *keypad;
691 struct twl4030_usb_data *usb; 704 struct twl4030_usb_data *usb;
692 struct twl4030_power_data *power; 705 struct twl4030_power_data *power;
693 struct twl4030_codec_data *codec; 706 struct twl4030_audio_data *audio;
694 707
695 /* Common LDO regulators for TWL4030/TWL6030 */ 708 /* Common LDO regulators for TWL4030/TWL6030 */
696 struct regulator_init_data *vdac; 709 struct regulator_init_data *vdac;
diff --git a/include/linux/i8253.h b/include/linux/i8253.h
new file mode 100644
index 000000000000..e6bb36a97519
--- /dev/null
+++ b/include/linux/i8253.h
@@ -0,0 +1,29 @@
1/*
2 * This file is subject to the terms and conditions of the GNU General Public
3 * License. See the file "COPYING" in the main directory of this archive
4 * for more details.
5 *
6 * Machine specific IO port address definition for generic.
7 * Written by Osamu Tomita <tomita@cinet.co.jp>
8 */
9#ifndef __LINUX_I8253_H
10#define __LINUX_I8253_H
11
12#include <linux/param.h>
13#include <linux/spinlock.h>
14#include <linux/timex.h>
15
16/* i8253A PIT registers */
17#define PIT_MODE 0x43
18#define PIT_CH0 0x40
19#define PIT_CH2 0x42
20
21#define PIT_LATCH ((PIT_TICK_RATE + HZ/2) / HZ)
22
23extern raw_spinlock_t i8253_lock;
24extern struct clock_event_device i8253_clockevent;
25extern void clockevent_i8253_init(bool oneshot);
26
27extern void setup_pit_timer(void);
28
29#endif /* __LINUX_I8253_H */
diff --git a/include/linux/idr.h b/include/linux/idr.h
index 13a801f3d028..255491cf522e 100644
--- a/include/linux/idr.h
+++ b/include/linux/idr.h
@@ -146,6 +146,10 @@ void ida_remove(struct ida *ida, int id);
146void ida_destroy(struct ida *ida); 146void ida_destroy(struct ida *ida);
147void ida_init(struct ida *ida); 147void ida_init(struct ida *ida);
148 148
149int ida_simple_get(struct ida *ida, unsigned int start, unsigned int end,
150 gfp_t gfp_mask);
151void ida_simple_remove(struct ida *ida, unsigned int id);
152
149void __init idr_init_cache(void); 153void __init idr_init_cache(void);
150 154
151#endif /* __IDR_H__ */ 155#endif /* __IDR_H__ */
diff --git a/include/linux/ieee80211.h b/include/linux/ieee80211.h
index b2eee5879883..54c878960872 100644
--- a/include/linux/ieee80211.h
+++ b/include/linux/ieee80211.h
@@ -117,8 +117,19 @@
117#define IEEE80211_MAX_MESH_ID_LEN 32 117#define IEEE80211_MAX_MESH_ID_LEN 32
118 118
119#define IEEE80211_QOS_CTL_LEN 2 119#define IEEE80211_QOS_CTL_LEN 2
120#define IEEE80211_QOS_CTL_TID_MASK 0x000F 120/* 1d tag mask */
121#define IEEE80211_QOS_CTL_TAG1D_MASK 0x0007 121#define IEEE80211_QOS_CTL_TAG1D_MASK 0x0007
122/* TID mask */
123#define IEEE80211_QOS_CTL_TID_MASK 0x000f
124/* EOSP */
125#define IEEE80211_QOS_CTL_EOSP 0x0010
126/* ACK policy */
127#define IEEE80211_QOS_CTL_ACK_POLICY_NORMAL 0x0000
128#define IEEE80211_QOS_CTL_ACK_POLICY_NOACK 0x0020
129#define IEEE80211_QOS_CTL_ACK_POLICY_NO_EXPL 0x0040
130#define IEEE80211_QOS_CTL_ACK_POLICY_BLOCKACK 0x0060
131/* A-MSDU 802.11n */
132#define IEEE80211_QOS_CTL_A_MSDU_PRESENT 0x0080
122 133
123/* U-APSD queue for WMM IEs sent by AP */ 134/* U-APSD queue for WMM IEs sent by AP */
124#define IEEE80211_WMM_IE_AP_QOSINFO_UAPSD (1<<7) 135#define IEEE80211_WMM_IE_AP_QOSINFO_UAPSD (1<<7)
@@ -1003,8 +1014,12 @@ struct ieee80211_ht_info {
1003#define WLAN_CAPABILITY_ESS (1<<0) 1014#define WLAN_CAPABILITY_ESS (1<<0)
1004#define WLAN_CAPABILITY_IBSS (1<<1) 1015#define WLAN_CAPABILITY_IBSS (1<<1)
1005 1016
1006/* A mesh STA sets the ESS and IBSS capability bits to zero */ 1017/*
1007#define WLAN_CAPABILITY_IS_MBSS(cap) \ 1018 * A mesh STA sets the ESS and IBSS capability bits to zero.
1019 * however, this holds true for p2p probe responses (in the p2p_find
1020 * phase) as well.
1021 */
1022#define WLAN_CAPABILITY_IS_STA_BSS(cap) \
1008 (!((cap) & (WLAN_CAPABILITY_ESS | WLAN_CAPABILITY_IBSS))) 1023 (!((cap) & (WLAN_CAPABILITY_ESS | WLAN_CAPABILITY_IBSS)))
1009 1024
1010#define WLAN_CAPABILITY_CF_POLLABLE (1<<2) 1025#define WLAN_CAPABILITY_CF_POLLABLE (1<<2)
@@ -1419,9 +1434,6 @@ enum ieee80211_sa_query_action {
1419}; 1434};
1420 1435
1421 1436
1422/* A-MSDU 802.11n */
1423#define IEEE80211_QOS_CONTROL_A_MSDU_PRESENT 0x0080
1424
1425/* cipher suite selectors */ 1437/* cipher suite selectors */
1426#define WLAN_CIPHER_SUITE_USE_GROUP 0x000FAC00 1438#define WLAN_CIPHER_SUITE_USE_GROUP 0x000FAC00
1427#define WLAN_CIPHER_SUITE_WEP40 0x000FAC01 1439#define WLAN_CIPHER_SUITE_WEP40 0x000FAC01
@@ -1441,6 +1453,43 @@ enum ieee80211_sa_query_action {
1441 1453
1442#define WLAN_PMKID_LEN 16 1454#define WLAN_PMKID_LEN 16
1443 1455
1456/*
1457 * WMM/802.11e Tspec Element
1458 */
1459#define IEEE80211_WMM_IE_TSPEC_TID_MASK 0x0F
1460#define IEEE80211_WMM_IE_TSPEC_TID_SHIFT 1
1461
1462enum ieee80211_tspec_status_code {
1463 IEEE80211_TSPEC_STATUS_ADMISS_ACCEPTED = 0,
1464 IEEE80211_TSPEC_STATUS_ADDTS_INVAL_PARAMS = 0x1,
1465};
1466
1467struct ieee80211_tspec_ie {
1468 u8 element_id;
1469 u8 len;
1470 u8 oui[3];
1471 u8 oui_type;
1472 u8 oui_subtype;
1473 u8 version;
1474 __le16 tsinfo;
1475 u8 tsinfo_resvd;
1476 __le16 nominal_msdu;
1477 __le16 max_msdu;
1478 __le32 min_service_int;
1479 __le32 max_service_int;
1480 __le32 inactivity_int;
1481 __le32 suspension_int;
1482 __le32 service_start_time;
1483 __le32 min_data_rate;
1484 __le32 mean_data_rate;
1485 __le32 peak_data_rate;
1486 __le32 max_burst_size;
1487 __le32 delay_bound;
1488 __le32 min_phy_rate;
1489 __le16 sba;
1490 __le16 medium_time;
1491} __packed;
1492
1444/** 1493/**
1445 * ieee80211_get_qos_ctl - get pointer to qos control bytes 1494 * ieee80211_get_qos_ctl - get pointer to qos control bytes
1446 * @hdr: the frame 1495 * @hdr: the frame
diff --git a/include/linux/if.h b/include/linux/if.h
index 3bc63e6a02f7..03489ca92ded 100644
--- a/include/linux/if.h
+++ b/include/linux/if.h
@@ -76,6 +76,8 @@
76#define IFF_BRIDGE_PORT 0x4000 /* device used as bridge port */ 76#define IFF_BRIDGE_PORT 0x4000 /* device used as bridge port */
77#define IFF_OVS_DATAPATH 0x8000 /* device used as Open vSwitch 77#define IFF_OVS_DATAPATH 0x8000 /* device used as Open vSwitch
78 * datapath port */ 78 * datapath port */
79#define IFF_TX_SKB_SHARING 0x10000 /* The interface supports sharing
80 * skbs on transmit */
79 81
80#define IF_GET_IFACE 0x0001 /* for querying only */ 82#define IF_GET_IFACE 0x0001 /* for querying only */
81#define IF_GET_PROTO 0x0002 83#define IF_GET_PROTO 0x0002
diff --git a/include/linux/if_ether.h b/include/linux/if_ether.h
index 0065ffd3226b..a3d99ff6e3b5 100644
--- a/include/linux/if_ether.h
+++ b/include/linux/if_ether.h
@@ -78,10 +78,15 @@
78 */ 78 */
79#define ETH_P_PAE 0x888E /* Port Access Entity (IEEE 802.1X) */ 79#define ETH_P_PAE 0x888E /* Port Access Entity (IEEE 802.1X) */
80#define ETH_P_AOE 0x88A2 /* ATA over Ethernet */ 80#define ETH_P_AOE 0x88A2 /* ATA over Ethernet */
81#define ETH_P_8021AD 0x88A8 /* 802.1ad Service VLAN */
81#define ETH_P_TIPC 0x88CA /* TIPC */ 82#define ETH_P_TIPC 0x88CA /* TIPC */
83#define ETH_P_8021AH 0x88E7 /* 802.1ah Backbone Service Tag */
82#define ETH_P_1588 0x88F7 /* IEEE 1588 Timesync */ 84#define ETH_P_1588 0x88F7 /* IEEE 1588 Timesync */
83#define ETH_P_FCOE 0x8906 /* Fibre Channel over Ethernet */ 85#define ETH_P_FCOE 0x8906 /* Fibre Channel over Ethernet */
84#define ETH_P_FIP 0x8914 /* FCoE Initialization Protocol */ 86#define ETH_P_FIP 0x8914 /* FCoE Initialization Protocol */
87#define ETH_P_QINQ1 0x9100 /* deprecated QinQ VLAN [ NOT AN OFFICIALLY REGISTERED ID ] */
88#define ETH_P_QINQ2 0x9200 /* deprecated QinQ VLAN [ NOT AN OFFICIALLY REGISTERED ID ] */
89#define ETH_P_QINQ3 0x9300 /* deprecated QinQ VLAN [ NOT AN OFFICIALLY REGISTERED ID ] */
85#define ETH_P_EDSA 0xDADA /* Ethertype DSA [ NOT AN OFFICIALLY REGISTERED ID ] */ 90#define ETH_P_EDSA 0xDADA /* Ethertype DSA [ NOT AN OFFICIALLY REGISTERED ID ] */
86 91
87/* 92/*
diff --git a/include/linux/if_packet.h b/include/linux/if_packet.h
index 72bfa5a034dd..c1486060f5ed 100644
--- a/include/linux/if_packet.h
+++ b/include/linux/if_packet.h
@@ -49,6 +49,12 @@ struct sockaddr_ll {
49#define PACKET_VNET_HDR 15 49#define PACKET_VNET_HDR 15
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
53
54#define PACKET_FANOUT_HASH 0
55#define PACKET_FANOUT_LB 1
56#define PACKET_FANOUT_CPU 2
57#define PACKET_FANOUT_FLAG_DEFRAG 0x8000
52 58
53struct tpacket_stats { 59struct tpacket_stats {
54 unsigned int tp_packets; 60 unsigned int tp_packets;
@@ -62,6 +68,7 @@ struct tpacket_auxdata {
62 __u16 tp_mac; 68 __u16 tp_mac;
63 __u16 tp_net; 69 __u16 tp_net;
64 __u16 tp_vlan_tci; 70 __u16 tp_vlan_tci;
71 __u16 tp_padding;
65}; 72};
66 73
67/* Rx ring - header status */ 74/* Rx ring - header status */
@@ -70,6 +77,7 @@ struct tpacket_auxdata {
70#define TP_STATUS_COPY 0x2 77#define TP_STATUS_COPY 0x2
71#define TP_STATUS_LOSING 0x4 78#define TP_STATUS_LOSING 0x4
72#define TP_STATUS_CSUMNOTREADY 0x8 79#define TP_STATUS_CSUMNOTREADY 0x8
80#define TP_STATUS_VLAN_VALID 0x10 /* auxdata has valid tp_vlan_tci */
73 81
74/* Tx ring - header status */ 82/* Tx ring - header status */
75#define TP_STATUS_AVAILABLE 0x0 83#define TP_STATUS_AVAILABLE 0x0
@@ -100,6 +108,7 @@ struct tpacket2_hdr {
100 __u32 tp_sec; 108 __u32 tp_sec;
101 __u32 tp_nsec; 109 __u32 tp_nsec;
102 __u16 tp_vlan_tci; 110 __u16 tp_vlan_tci;
111 __u16 tp_padding;
103}; 112};
104 113
105#define TPACKET2_HDRLEN (TPACKET_ALIGN(sizeof(struct tpacket2_hdr)) + sizeof(struct sockaddr_ll)) 114#define TPACKET2_HDRLEN (TPACKET_ALIGN(sizeof(struct tpacket2_hdr)) + sizeof(struct sockaddr_ll))
diff --git a/include/linux/if_vlan.h b/include/linux/if_vlan.h
index dc01681fbb42..44da4822bcab 100644
--- a/include/linux/if_vlan.h
+++ b/include/linux/if_vlan.h
@@ -91,25 +91,6 @@ struct vlan_group {
91 struct rcu_head rcu; 91 struct rcu_head rcu;
92}; 92};
93 93
94static inline struct net_device *vlan_group_get_device(struct vlan_group *vg,
95 u16 vlan_id)
96{
97 struct net_device **array;
98 array = vg->vlan_devices_arrays[vlan_id / VLAN_GROUP_ARRAY_PART_LEN];
99 return array ? array[vlan_id % VLAN_GROUP_ARRAY_PART_LEN] : NULL;
100}
101
102static inline void vlan_group_set_device(struct vlan_group *vg,
103 u16 vlan_id,
104 struct net_device *dev)
105{
106 struct net_device **array;
107 if (!vg)
108 return;
109 array = vg->vlan_devices_arrays[vlan_id / VLAN_GROUP_ARRAY_PART_LEN];
110 array[vlan_id % VLAN_GROUP_ARRAY_PART_LEN] = dev;
111}
112
113static inline int is_vlan_dev(struct net_device *dev) 94static inline int is_vlan_dev(struct net_device *dev)
114{ 95{
115 return dev->priv_flags & IFF_802_1Q_VLAN; 96 return dev->priv_flags & IFF_802_1Q_VLAN;
@@ -119,35 +100,18 @@ static inline int is_vlan_dev(struct net_device *dev)
119#define vlan_tx_tag_get(__skb) ((__skb)->vlan_tci & ~VLAN_TAG_PRESENT) 100#define vlan_tx_tag_get(__skb) ((__skb)->vlan_tci & ~VLAN_TAG_PRESENT)
120 101
121#if defined(CONFIG_VLAN_8021Q) || defined(CONFIG_VLAN_8021Q_MODULE) 102#if defined(CONFIG_VLAN_8021Q) || defined(CONFIG_VLAN_8021Q_MODULE)
122/* Must be invoked with rcu_read_lock or with RTNL. */
123static inline struct net_device *vlan_find_dev(struct net_device *real_dev,
124 u16 vlan_id)
125{
126 struct vlan_group *grp = rcu_dereference_rtnl(real_dev->vlgrp);
127
128 if (grp)
129 return vlan_group_get_device(grp, vlan_id);
130
131 return NULL;
132}
133 103
104extern struct net_device *__vlan_find_dev_deep(struct net_device *real_dev,
105 u16 vlan_id);
134extern struct net_device *vlan_dev_real_dev(const struct net_device *dev); 106extern struct net_device *vlan_dev_real_dev(const struct net_device *dev);
135extern u16 vlan_dev_vlan_id(const struct net_device *dev); 107extern u16 vlan_dev_vlan_id(const struct net_device *dev);
136 108
137extern int __vlan_hwaccel_rx(struct sk_buff *skb, struct vlan_group *grp,
138 u16 vlan_tci, int polling);
139extern bool vlan_do_receive(struct sk_buff **skb); 109extern bool vlan_do_receive(struct sk_buff **skb);
140extern struct sk_buff *vlan_untag(struct sk_buff *skb); 110extern struct sk_buff *vlan_untag(struct sk_buff *skb);
141extern gro_result_t
142vlan_gro_receive(struct napi_struct *napi, struct vlan_group *grp,
143 unsigned int vlan_tci, struct sk_buff *skb);
144extern gro_result_t
145vlan_gro_frags(struct napi_struct *napi, struct vlan_group *grp,
146 unsigned int vlan_tci);
147 111
148#else 112#else
149static inline struct net_device *vlan_find_dev(struct net_device *real_dev, 113static inline struct net_device *
150 u16 vlan_id) 114__vlan_find_dev_deep(struct net_device *real_dev, u16 vlan_id)
151{ 115{
152 return NULL; 116 return NULL;
153} 117}
@@ -164,13 +128,6 @@ static inline u16 vlan_dev_vlan_id(const struct net_device *dev)
164 return 0; 128 return 0;
165} 129}
166 130
167static inline int __vlan_hwaccel_rx(struct sk_buff *skb, struct vlan_group *grp,
168 u16 vlan_tci, int polling)
169{
170 BUG();
171 return NET_XMIT_SUCCESS;
172}
173
174static inline bool vlan_do_receive(struct sk_buff **skb) 131static inline bool vlan_do_receive(struct sk_buff **skb)
175{ 132{
176 if ((*skb)->vlan_tci & VLAN_VID_MASK) 133 if ((*skb)->vlan_tci & VLAN_VID_MASK)
@@ -182,50 +139,10 @@ static inline struct sk_buff *vlan_untag(struct sk_buff *skb)
182{ 139{
183 return skb; 140 return skb;
184} 141}
185
186static inline gro_result_t
187vlan_gro_receive(struct napi_struct *napi, struct vlan_group *grp,
188 unsigned int vlan_tci, struct sk_buff *skb)
189{
190 return GRO_DROP;
191}
192
193static inline gro_result_t
194vlan_gro_frags(struct napi_struct *napi, struct vlan_group *grp,
195 unsigned int vlan_tci)
196{
197 return GRO_DROP;
198}
199#endif 142#endif
200 143
201/** 144/**
202 * vlan_hwaccel_rx - netif_rx wrapper for VLAN RX acceleration 145 * vlan_insert_tag - regular VLAN tag inserting
203 * @skb: buffer
204 * @grp: vlan group
205 * @vlan_tci: VLAN TCI as received from the card
206 */
207static inline int vlan_hwaccel_rx(struct sk_buff *skb,
208 struct vlan_group *grp,
209 u16 vlan_tci)
210{
211 return __vlan_hwaccel_rx(skb, grp, vlan_tci, 0);
212}
213
214/**
215 * vlan_hwaccel_receive_skb - netif_receive_skb wrapper for VLAN RX acceleration
216 * @skb: buffer
217 * @grp: vlan group
218 * @vlan_tci: VLAN TCI as received from the card
219 */
220static inline int vlan_hwaccel_receive_skb(struct sk_buff *skb,
221 struct vlan_group *grp,
222 u16 vlan_tci)
223{
224 return __vlan_hwaccel_rx(skb, grp, vlan_tci, 1);
225}
226
227/**
228 * __vlan_put_tag - regular VLAN tag inserting
229 * @skb: skbuff to tag 146 * @skb: skbuff to tag
230 * @vlan_tci: VLAN TCI to insert 147 * @vlan_tci: VLAN TCI to insert
231 * 148 *
@@ -234,8 +151,10 @@ static inline int vlan_hwaccel_receive_skb(struct sk_buff *skb,
234 * 151 *
235 * Following the skb_unshare() example, in case of error, the calling function 152 * Following the skb_unshare() example, in case of error, the calling function
236 * doesn't have to worry about freeing the original skb. 153 * doesn't have to worry about freeing the original skb.
154 *
155 * Does not change skb->protocol so this function can be used during receive.
237 */ 156 */
238static inline struct sk_buff *__vlan_put_tag(struct sk_buff *skb, u16 vlan_tci) 157static inline struct sk_buff *vlan_insert_tag(struct sk_buff *skb, u16 vlan_tci)
239{ 158{
240 struct vlan_ethhdr *veth; 159 struct vlan_ethhdr *veth;
241 160
@@ -255,8 +174,25 @@ static inline struct sk_buff *__vlan_put_tag(struct sk_buff *skb, u16 vlan_tci)
255 /* now, the TCI */ 174 /* now, the TCI */
256 veth->h_vlan_TCI = htons(vlan_tci); 175 veth->h_vlan_TCI = htons(vlan_tci);
257 176
258 skb->protocol = htons(ETH_P_8021Q); 177 return skb;
178}
259 179
180/**
181 * __vlan_put_tag - regular VLAN tag inserting
182 * @skb: skbuff to tag
183 * @vlan_tci: VLAN TCI to insert
184 *
185 * Inserts the VLAN tag into @skb as part of the payload
186 * Returns a VLAN tagged skb. If a new skb is created, @skb is freed.
187 *
188 * Following the skb_unshare() example, in case of error, the calling function
189 * doesn't have to worry about freeing the original skb.
190 */
191static inline struct sk_buff *__vlan_put_tag(struct sk_buff *skb, u16 vlan_tci)
192{
193 skb = vlan_insert_tag(skb, vlan_tci);
194 if (skb)
195 skb->protocol = htons(ETH_P_8021Q);
260 return skb; 196 return skb;
261} 197}
262 198
diff --git a/include/linux/inet_lro.h b/include/linux/inet_lro.h
index c4335faebb63..2cf55afbcd4e 100644
--- a/include/linux/inet_lro.h
+++ b/include/linux/inet_lro.h
@@ -50,7 +50,6 @@ struct net_lro_desc {
50 struct skb_frag_struct *next_frag; 50 struct skb_frag_struct *next_frag;
51 struct iphdr *iph; 51 struct iphdr *iph;
52 struct tcphdr *tcph; 52 struct tcphdr *tcph;
53 struct vlan_group *vgrp;
54 __wsum data_csum; 53 __wsum data_csum;
55 __be32 tcp_rcv_tsecr; 54 __be32 tcp_rcv_tsecr;
56 __be32 tcp_rcv_tsval; 55 __be32 tcp_rcv_tsval;
@@ -60,7 +59,6 @@ struct net_lro_desc {
60 u16 ip_tot_len; 59 u16 ip_tot_len;
61 u16 tcp_saw_tstamp; /* timestamps enabled */ 60 u16 tcp_saw_tstamp; /* timestamps enabled */
62 __be16 tcp_window; 61 __be16 tcp_window;
63 u16 vlan_tag;
64 int pkt_aggr_cnt; /* counts aggregated packets */ 62 int pkt_aggr_cnt; /* counts aggregated packets */
65 int vlan_packet; 63 int vlan_packet;
66 int mss; 64 int mss;
@@ -137,16 +135,6 @@ void lro_receive_skb(struct net_lro_mgr *lro_mgr,
137 void *priv); 135 void *priv);
138 136
139/* 137/*
140 * Processes a SKB with VLAN HW acceleration support
141 */
142
143void lro_vlan_hwaccel_receive_skb(struct net_lro_mgr *lro_mgr,
144 struct sk_buff *skb,
145 struct vlan_group *vgrp,
146 u16 vlan_tag,
147 void *priv);
148
149/*
150 * Processes a fragment list 138 * Processes a fragment list
151 * 139 *
152 * This functions aggregate fragments and generate SKBs do pass 140 * This functions aggregate fragments and generate SKBs do pass
@@ -165,13 +153,6 @@ void lro_receive_frags(struct net_lro_mgr *lro_mgr,
165 struct skb_frag_struct *frags, 153 struct skb_frag_struct *frags,
166 int len, int true_size, void *priv, __wsum sum); 154 int len, int true_size, void *priv, __wsum sum);
167 155
168void lro_vlan_hwaccel_receive_frags(struct net_lro_mgr *lro_mgr,
169 struct skb_frag_struct *frags,
170 int len, int true_size,
171 struct vlan_group *vgrp,
172 u16 vlan_tag,
173 void *priv, __wsum sum);
174
175/* 156/*
176 * Forward all aggregated SKBs held by lro_mgr to network stack 157 * Forward all aggregated SKBs held by lro_mgr to network stack
177 */ 158 */
diff --git a/include/linux/init_task.h b/include/linux/init_task.h
index 580f70c02391..d14e058aaeed 100644
--- a/include/linux/init_task.h
+++ b/include/linux/init_task.h
@@ -176,7 +176,6 @@ extern struct cred init_cred;
176 .alloc_lock = __SPIN_LOCK_UNLOCKED(tsk.alloc_lock), \ 176 .alloc_lock = __SPIN_LOCK_UNLOCKED(tsk.alloc_lock), \
177 .journal_info = NULL, \ 177 .journal_info = NULL, \
178 .cpu_timers = INIT_CPU_TIMERS(tsk.cpu_timers), \ 178 .cpu_timers = INIT_CPU_TIMERS(tsk.cpu_timers), \
179 .fs_excl = ATOMIC_INIT(0), \
180 .pi_lock = __RAW_SPIN_LOCK_UNLOCKED(tsk.pi_lock), \ 179 .pi_lock = __RAW_SPIN_LOCK_UNLOCKED(tsk.pi_lock), \
181 .timer_slack_ns = 50000, /* 50 usec default slack */ \ 180 .timer_slack_ns = 50000, /* 50 usec default slack */ \
182 .pids = { \ 181 .pids = { \
diff --git a/include/linux/input.h b/include/linux/input.h
index 771d6d85667d..a637e7814334 100644
--- a/include/linux/input.h
+++ b/include/linux/input.h
@@ -119,9 +119,9 @@ struct input_keymap_entry {
119#define EVIOCGSND(len) _IOC(_IOC_READ, 'E', 0x1a, len) /* get all sounds status */ 119#define EVIOCGSND(len) _IOC(_IOC_READ, 'E', 0x1a, len) /* get all sounds status */
120#define EVIOCGSW(len) _IOC(_IOC_READ, 'E', 0x1b, len) /* get all switch states */ 120#define EVIOCGSW(len) _IOC(_IOC_READ, 'E', 0x1b, len) /* get all switch states */
121 121
122#define EVIOCGBIT(ev,len) _IOC(_IOC_READ, 'E', 0x20 + ev, len) /* get event bits */ 122#define EVIOCGBIT(ev,len) _IOC(_IOC_READ, 'E', 0x20 + (ev), len) /* get event bits */
123#define EVIOCGABS(abs) _IOR('E', 0x40 + abs, struct input_absinfo) /* get abs value/limits */ 123#define EVIOCGABS(abs) _IOR('E', 0x40 + (abs), struct input_absinfo) /* get abs value/limits */
124#define EVIOCSABS(abs) _IOW('E', 0xc0 + abs, struct input_absinfo) /* set abs value/limits */ 124#define EVIOCSABS(abs) _IOW('E', 0xc0 + (abs), struct input_absinfo) /* set abs value/limits */
125 125
126#define EVIOCSFF _IOC(_IOC_WRITE, 'E', 0x80, sizeof(struct ff_effect)) /* send a force effect to a force feedback device */ 126#define EVIOCSFF _IOC(_IOC_WRITE, 'E', 0x80, sizeof(struct ff_effect)) /* send a force effect to a force feedback device */
127#define EVIOCRMFF _IOW('E', 0x81, int) /* Erase a force effect */ 127#define EVIOCRMFF _IOW('E', 0x81, int) /* Erase a force effect */
@@ -438,6 +438,8 @@ struct input_keymap_entry {
438#define KEY_WIMAX 246 438#define KEY_WIMAX 246
439#define KEY_RFKILL 247 /* Key that controls all radios */ 439#define KEY_RFKILL 247 /* Key that controls all radios */
440 440
441#define KEY_MICMUTE 248 /* Mute / unmute the microphone */
442
441/* Code 255 is reserved for special needs of AT keyboard driver */ 443/* Code 255 is reserved for special needs of AT keyboard driver */
442 444
443#define BTN_MISC 0x100 445#define BTN_MISC 0x100
diff --git a/include/linux/input/kxtj9.h b/include/linux/input/kxtj9.h
new file mode 100644
index 000000000000..f6bac89537b8
--- /dev/null
+++ b/include/linux/input/kxtj9.h
@@ -0,0 +1,70 @@
1/*
2 * Copyright (C) 2011 Kionix, Inc.
3 * Written by Chris Hudson <chudson@kionix.com>
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 2 as
7 * published by the Free Software Foundation.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
17 * 02111-1307, USA
18 */
19
20#ifndef __KXTJ9_H__
21#define __KXTJ9_H__
22
23#define KXTJ9_I2C_ADDR 0x0F
24
25struct kxtj9_platform_data {
26 unsigned int min_interval; /* minimum poll interval (in milli-seconds) */
27
28 /*
29 * By default, x is axis 0, y is axis 1, z is axis 2; these can be
30 * changed to account for sensor orientation within the host device.
31 */
32 u8 axis_map_x;
33 u8 axis_map_y;
34 u8 axis_map_z;
35
36 /*
37 * Each axis can be negated to account for sensor orientation within
38 * the host device.
39 */
40 bool negate_x;
41 bool negate_y;
42 bool negate_z;
43
44 /* CTRL_REG1: set resolution, g-range, data ready enable */
45 /* Output resolution: 8-bit valid or 12-bit valid */
46 #define RES_8BIT 0
47 #define RES_12BIT (1 << 6)
48 u8 res_12bit;
49 /* Output g-range: +/-2g, 4g, or 8g */
50 #define KXTJ9_G_2G 0
51 #define KXTJ9_G_4G (1 << 3)
52 #define KXTJ9_G_8G (1 << 4)
53 u8 g_range;
54
55 /* DATA_CTRL_REG: controls the output data rate of the part */
56 #define ODR12_5F 0
57 #define ODR25F 1
58 #define ODR50F 2
59 #define ODR100F 3
60 #define ODR200F 4
61 #define ODR400F 5
62 #define ODR800F 6
63 u8 data_odr_init;
64
65 int (*init)(void);
66 void (*exit)(void);
67 int (*power_on)(void);
68 int (*power_off)(void);
69};
70#endif /* __KXTJ9_H__ */
diff --git a/include/linux/input/sh_keysc.h b/include/linux/input/sh_keysc.h
index 649dc7f12925..5d253cd93691 100644
--- a/include/linux/input/sh_keysc.h
+++ b/include/linux/input/sh_keysc.h
@@ -1,7 +1,7 @@
1#ifndef __SH_KEYSC_H__ 1#ifndef __SH_KEYSC_H__
2#define __SH_KEYSC_H__ 2#define __SH_KEYSC_H__
3 3
4#define SH_KEYSC_MAXKEYS 49 4#define SH_KEYSC_MAXKEYS 64
5 5
6struct sh_keysc_info { 6struct sh_keysc_info {
7 enum { SH_KEYSC_MODE_1, SH_KEYSC_MODE_2, SH_KEYSC_MODE_3, 7 enum { SH_KEYSC_MODE_1, SH_KEYSC_MODE_2, SH_KEYSC_MODE_3,
diff --git a/include/linux/interrupt.h b/include/linux/interrupt.h
index 6c12989839d9..a103732b7588 100644
--- a/include/linux/interrupt.h
+++ b/include/linux/interrupt.h
@@ -17,7 +17,7 @@
17#include <linux/kref.h> 17#include <linux/kref.h>
18#include <linux/workqueue.h> 18#include <linux/workqueue.h>
19 19
20#include <asm/atomic.h> 20#include <linux/atomic.h>
21#include <asm/ptrace.h> 21#include <asm/ptrace.h>
22#include <asm/system.h> 22#include <asm/system.h>
23#include <trace/events/irq.h> 23#include <trace/events/irq.h>
@@ -414,6 +414,7 @@ enum
414 TASKLET_SOFTIRQ, 414 TASKLET_SOFTIRQ,
415 SCHED_SOFTIRQ, 415 SCHED_SOFTIRQ,
416 HRTIMER_SOFTIRQ, 416 HRTIMER_SOFTIRQ,
417 RCU_SOFTIRQ, /* Preferable RCU should always be the last softirq */
417 418
418 NR_SOFTIRQS 419 NR_SOFTIRQS
419}; 420};
diff --git a/include/linux/iocontext.h b/include/linux/iocontext.h
index b2eee896dcbc..5037a0ad2312 100644
--- a/include/linux/iocontext.h
+++ b/include/linux/iocontext.h
@@ -5,6 +5,14 @@
5#include <linux/rcupdate.h> 5#include <linux/rcupdate.h>
6 6
7struct cfq_queue; 7struct cfq_queue;
8struct cfq_ttime {
9 unsigned long last_end_request;
10
11 unsigned long ttime_total;
12 unsigned long ttime_samples;
13 unsigned long ttime_mean;
14};
15
8struct cfq_io_context { 16struct cfq_io_context {
9 void *key; 17 void *key;
10 18
@@ -12,11 +20,7 @@ struct cfq_io_context {
12 20
13 struct io_context *ioc; 21 struct io_context *ioc;
14 22
15 unsigned long last_end_request; 23 struct cfq_ttime ttime;
16
17 unsigned long ttime_total;
18 unsigned long ttime_samples;
19 unsigned long ttime_mean;
20 24
21 struct list_head queue_list; 25 struct list_head queue_list;
22 struct hlist_node cic_list; 26 struct hlist_node cic_list;
diff --git a/include/linux/iommu.h b/include/linux/iommu.h
index 0a2ba4098996..9940319d6f9d 100644
--- a/include/linux/iommu.h
+++ b/include/linux/iommu.h
@@ -19,6 +19,8 @@
19#ifndef __LINUX_IOMMU_H 19#ifndef __LINUX_IOMMU_H
20#define __LINUX_IOMMU_H 20#define __LINUX_IOMMU_H
21 21
22#include <linux/errno.h>
23
22#define IOMMU_READ (1) 24#define IOMMU_READ (1)
23#define IOMMU_WRITE (2) 25#define IOMMU_WRITE (2)
24#define IOMMU_CACHE (4) /* DMA cache coherency */ 26#define IOMMU_CACHE (4) /* DMA cache coherency */
diff --git a/include/linux/ioport.h b/include/linux/ioport.h
index e9bb22cba764..9d57a71775b5 100644
--- a/include/linux/ioport.h
+++ b/include/linux/ioport.h
@@ -109,6 +109,36 @@ struct resource_list {
109/* PCI control bits. Shares IORESOURCE_BITS with above PCI ROM. */ 109/* PCI control bits. Shares IORESOURCE_BITS with above PCI ROM. */
110#define IORESOURCE_PCI_FIXED (1<<4) /* Do not move resource */ 110#define IORESOURCE_PCI_FIXED (1<<4) /* Do not move resource */
111 111
112
113/* helpers to define resources */
114#define DEFINE_RES_NAMED(_start, _size, _name, _flags) \
115 { \
116 .start = (_start), \
117 .end = (_start) + (_size) - 1, \
118 .name = (_name), \
119 .flags = (_flags), \
120 }
121
122#define DEFINE_RES_IO_NAMED(_start, _size, _name) \
123 DEFINE_RES_NAMED((_start), (_size), (_name), IORESOURCE_IO)
124#define DEFINE_RES_IO(_start, _size) \
125 DEFINE_RES_IO_NAMED((_start), (_size), NULL)
126
127#define DEFINE_RES_MEM_NAMED(_start, _size, _name) \
128 DEFINE_RES_NAMED((_start), (_size), (_name), IORESOURCE_MEM)
129#define DEFINE_RES_MEM(_start, _size) \
130 DEFINE_RES_MEM_NAMED((_start), (_size), NULL)
131
132#define DEFINE_RES_IRQ_NAMED(_irq, _name) \
133 DEFINE_RES_NAMED((_irq), 1, (_name), IORESOURCE_IRQ)
134#define DEFINE_RES_IRQ(_irq) \
135 DEFINE_RES_IRQ_NAMED((_irq), NULL)
136
137#define DEFINE_RES_DMA_NAMED(_dma, _name) \
138 DEFINE_RES_NAMED((_dma), 1, (_name), IORESOURCE_DMA)
139#define DEFINE_RES_DMA(_dma) \
140 DEFINE_RES_DMA_NAMED((_dma), NULL)
141
112/* PC/ISA/whatever - the normal PC address spaces: IO and memory */ 142/* PC/ISA/whatever - the normal PC address spaces: IO and memory */
113extern struct resource ioport_resource; 143extern struct resource ioport_resource;
114extern struct resource iomem_resource; 144extern struct resource iomem_resource;
@@ -132,6 +162,7 @@ extern int allocate_resource(struct resource *root, struct resource *new,
132 resource_size_t, 162 resource_size_t,
133 resource_size_t), 163 resource_size_t),
134 void *alignf_data); 164 void *alignf_data);
165struct resource *lookup_resource(struct resource *root, resource_size_t start);
135int adjust_resource(struct resource *res, resource_size_t start, 166int adjust_resource(struct resource *res, resource_size_t start,
136 resource_size_t size); 167 resource_size_t size);
137resource_size_t resource_alignment(struct resource *res); 168resource_size_t resource_alignment(struct resource *res);
diff --git a/include/linux/ipc_namespace.h b/include/linux/ipc_namespace.h
index a6d1655f9607..8a297a5e794c 100644
--- a/include/linux/ipc_namespace.h
+++ b/include/linux/ipc_namespace.h
@@ -44,6 +44,11 @@ struct ipc_namespace {
44 size_t shm_ctlall; 44 size_t shm_ctlall;
45 int shm_ctlmni; 45 int shm_ctlmni;
46 int shm_tot; 46 int shm_tot;
47 /*
48 * Defines whether IPC_RMID is forced for _all_ shm segments regardless
49 * of shmctl()
50 */
51 int shm_rmid_forced;
47 52
48 struct notifier_block ipcns_nb; 53 struct notifier_block ipcns_nb;
49 54
@@ -72,6 +77,7 @@ extern int register_ipcns_notifier(struct ipc_namespace *);
72extern int cond_register_ipcns_notifier(struct ipc_namespace *); 77extern int cond_register_ipcns_notifier(struct ipc_namespace *);
73extern void unregister_ipcns_notifier(struct ipc_namespace *); 78extern void unregister_ipcns_notifier(struct ipc_namespace *);
74extern int ipcns_notify(unsigned long); 79extern int ipcns_notify(unsigned long);
80extern void shm_destroy_orphaned(struct ipc_namespace *ns);
75#else /* CONFIG_SYSVIPC */ 81#else /* CONFIG_SYSVIPC */
76static inline int register_ipcns_notifier(struct ipc_namespace *ns) 82static inline int register_ipcns_notifier(struct ipc_namespace *ns)
77{ return 0; } 83{ return 0; }
@@ -79,6 +85,7 @@ static inline int cond_register_ipcns_notifier(struct ipc_namespace *ns)
79{ return 0; } 85{ return 0; }
80static inline void unregister_ipcns_notifier(struct ipc_namespace *ns) { } 86static inline void unregister_ipcns_notifier(struct ipc_namespace *ns) { }
81static inline int ipcns_notify(unsigned long l) { return 0; } 87static inline int ipcns_notify(unsigned long l) { return 0; }
88static inline void shm_destroy_orphaned(struct ipc_namespace *ns) {}
82#endif /* CONFIG_SYSVIPC */ 89#endif /* CONFIG_SYSVIPC */
83 90
84#ifdef CONFIG_POSIX_MQUEUE 91#ifdef CONFIG_POSIX_MQUEUE
diff --git a/include/linux/irq.h b/include/linux/irq.h
index 8b4538446636..87a06f345bd2 100644
--- a/include/linux/irq.h
+++ b/include/linux/irq.h
@@ -96,11 +96,6 @@ enum {
96 96
97#define IRQ_NO_BALANCING_MASK (IRQ_PER_CPU | IRQ_NO_BALANCING) 97#define IRQ_NO_BALANCING_MASK (IRQ_PER_CPU | IRQ_NO_BALANCING)
98 98
99static inline __deprecated bool CHECK_IRQ_PER_CPU(unsigned int status)
100{
101 return status & IRQ_PER_CPU;
102}
103
104/* 99/*
105 * Return value for chip->irq_set_affinity() 100 * Return value for chip->irq_set_affinity()
106 * 101 *
@@ -113,14 +108,18 @@ enum {
113}; 108};
114 109
115struct msi_desc; 110struct msi_desc;
111struct irq_domain;
116 112
117/** 113/**
118 * struct irq_data - per irq and irq chip data passed down to chip functions 114 * struct irq_data - per irq and irq chip data passed down to chip functions
119 * @irq: interrupt number 115 * @irq: interrupt number
116 * @hwirq: hardware interrupt number, local to the interrupt domain
120 * @node: node index useful for balancing 117 * @node: node index useful for balancing
121 * @state_use_accessors: status information for irq chip functions. 118 * @state_use_accessors: status information for irq chip functions.
122 * Use accessor functions to deal with it 119 * Use accessor functions to deal with it
123 * @chip: low level interrupt hardware access 120 * @chip: low level interrupt hardware access
121 * @domain: Interrupt translation domain; responsible for mapping
122 * between hwirq number and linux irq number.
124 * @handler_data: per-IRQ data for the irq_chip methods 123 * @handler_data: per-IRQ data for the irq_chip methods
125 * @chip_data: platform-specific per-chip private data for the chip 124 * @chip_data: platform-specific per-chip private data for the chip
126 * methods, to allow shared chip implementations 125 * methods, to allow shared chip implementations
@@ -133,9 +132,11 @@ struct msi_desc;
133 */ 132 */
134struct irq_data { 133struct irq_data {
135 unsigned int irq; 134 unsigned int irq;
135 unsigned long hwirq;
136 unsigned int node; 136 unsigned int node;
137 unsigned int state_use_accessors; 137 unsigned int state_use_accessors;
138 struct irq_chip *chip; 138 struct irq_chip *chip;
139 struct irq_domain *domain;
139 void *handler_data; 140 void *handler_data;
140 void *chip_data; 141 void *chip_data;
141 struct msi_desc *msi_desc; 142 struct msi_desc *msi_desc;
@@ -676,7 +677,8 @@ void irq_gc_mask_disable_reg(struct irq_data *d);
676void irq_gc_mask_set_bit(struct irq_data *d); 677void irq_gc_mask_set_bit(struct irq_data *d);
677void irq_gc_mask_clr_bit(struct irq_data *d); 678void irq_gc_mask_clr_bit(struct irq_data *d);
678void irq_gc_unmask_enable_reg(struct irq_data *d); 679void irq_gc_unmask_enable_reg(struct irq_data *d);
679void irq_gc_ack(struct irq_data *d); 680void irq_gc_ack_set_bit(struct irq_data *d);
681void irq_gc_ack_clr_bit(struct irq_data *d);
680void irq_gc_mask_disable_reg_and_ack(struct irq_data *d); 682void irq_gc_mask_disable_reg_and_ack(struct irq_data *d);
681void irq_gc_eoi(struct irq_data *d); 683void irq_gc_eoi(struct irq_data *d);
682int irq_gc_set_wake(struct irq_data *d, unsigned int on); 684int irq_gc_set_wake(struct irq_data *d, unsigned int on);
diff --git a/include/linux/irqdomain.h b/include/linux/irqdomain.h
new file mode 100644
index 000000000000..e807ad687a07
--- /dev/null
+++ b/include/linux/irqdomain.h
@@ -0,0 +1,91 @@
1/*
2 * irq_domain - IRQ translation domains
3 *
4 * Translation infrastructure between hw and linux irq numbers. This is
5 * helpful for interrupt controllers to implement mapping between hardware
6 * irq numbers and the Linux irq number space.
7 *
8 * irq_domains also have a hook for translating device tree interrupt
9 * representation into a hardware irq number that can be mapped back to a
10 * Linux irq number without any extra platform support code.
11 *
12 * irq_domain is expected to be embedded in an interrupt controller's private
13 * data structure.
14 */
15#ifndef _LINUX_IRQDOMAIN_H
16#define _LINUX_IRQDOMAIN_H
17
18#include <linux/irq.h>
19#include <linux/mod_devicetable.h>
20
21#ifdef CONFIG_IRQ_DOMAIN
22struct device_node;
23struct irq_domain;
24
25/**
26 * struct irq_domain_ops - Methods for irq_domain objects
27 * @to_irq: (optional) given a local hardware irq number, return the linux
28 * irq number. If to_irq is not implemented, then the irq_domain
29 * will use this translation: irq = (domain->irq_base + hwirq)
30 * @dt_translate: Given a device tree node and interrupt specifier, decode
31 * the hardware irq number and linux irq type value.
32 */
33struct irq_domain_ops {
34 unsigned int (*to_irq)(struct irq_domain *d, unsigned long hwirq);
35
36#ifdef CONFIG_OF
37 int (*dt_translate)(struct irq_domain *d, struct device_node *node,
38 const u32 *intspec, unsigned int intsize,
39 unsigned long *out_hwirq, unsigned int *out_type);
40#endif /* CONFIG_OF */
41};
42
43/**
44 * struct irq_domain - Hardware interrupt number translation object
45 * @list: Element in global irq_domain list.
46 * @irq_base: Start of irq_desc range assigned to the irq_domain. The creator
47 * of the irq_domain is responsible for allocating the array of
48 * irq_desc structures.
49 * @nr_irq: Number of irqs managed by the irq domain
50 * @ops: pointer to irq_domain methods
51 * @priv: private data pointer for use by owner. Not touched by irq_domain
52 * core code.
53 * @of_node: (optional) Pointer to device tree nodes associated with the
54 * irq_domain. Used when decoding device tree interrupt specifiers.
55 */
56struct irq_domain {
57 struct list_head list;
58 unsigned int irq_base;
59 unsigned int nr_irq;
60 const struct irq_domain_ops *ops;
61 void *priv;
62 struct device_node *of_node;
63};
64
65/**
66 * irq_domain_to_irq() - Translate from a hardware irq to a linux irq number
67 *
68 * Returns the linux irq number associated with a hardware irq. By default,
69 * the mapping is irq == domain->irq_base + hwirq, but this mapping can
70 * be overridden if the irq_domain implements a .to_irq() hook.
71 */
72static inline unsigned int irq_domain_to_irq(struct irq_domain *d,
73 unsigned long hwirq)
74{
75 return d->ops->to_irq ? d->ops->to_irq(d, hwirq) : d->irq_base + hwirq;
76}
77
78extern void irq_domain_add(struct irq_domain *domain);
79extern void irq_domain_del(struct irq_domain *domain);
80#endif /* CONFIG_IRQ_DOMAIN */
81
82#if defined(CONFIG_IRQ_DOMAIN) && defined(CONFIG_OF_IRQ)
83extern void irq_domain_add_simple(struct device_node *controller, int irq_base);
84extern void irq_domain_generate_simple(const struct of_device_id *match,
85 u64 phys_base, unsigned int irq_start);
86#else /* CONFIG_IRQ_DOMAIN && CONFIG_OF_IRQ */
87static inline void irq_domain_generate_simple(const struct of_device_id *match,
88 u64 phys_base, unsigned int irq_start) { }
89#endif /* CONFIG_IRQ_DOMAIN && CONFIG_OF_IRQ */
90
91#endif /* _LINUX_IRQDOMAIN_H */
diff --git a/include/linux/irqreturn.h b/include/linux/irqreturn.h
index 819acaaac3f5..714ba08dc092 100644
--- a/include/linux/irqreturn.h
+++ b/include/linux/irqreturn.h
@@ -8,9 +8,9 @@
8 * @IRQ_WAKE_THREAD handler requests to wake the handler thread 8 * @IRQ_WAKE_THREAD handler requests to wake the handler thread
9 */ 9 */
10enum irqreturn { 10enum irqreturn {
11 IRQ_NONE, 11 IRQ_NONE = (0 << 0),
12 IRQ_HANDLED, 12 IRQ_HANDLED = (1 << 0),
13 IRQ_WAKE_THREAD, 13 IRQ_WAKE_THREAD = (1 << 1),
14}; 14};
15 15
16typedef enum irqreturn irqreturn_t; 16typedef enum irqreturn irqreturn_t;
diff --git a/include/linux/iscsi_boot_sysfs.h b/include/linux/iscsi_boot_sysfs.h
index f1e6c184f14f..f0a2f8b0aa13 100644
--- a/include/linux/iscsi_boot_sysfs.h
+++ b/include/linux/iscsi_boot_sysfs.h
@@ -92,6 +92,13 @@ struct iscsi_boot_kobj {
92 * properties. 92 * properties.
93 */ 93 */
94 mode_t (*is_visible) (void *data, int type); 94 mode_t (*is_visible) (void *data, int type);
95
96 /*
97 * Driver specific release function.
98 *
99 * The function should free the data passed in.
100 */
101 void (*release) (void *data);
95}; 102};
96 103
97struct iscsi_boot_kset { 104struct iscsi_boot_kset {
@@ -103,18 +110,21 @@ struct iscsi_boot_kobj *
103iscsi_boot_create_initiator(struct iscsi_boot_kset *boot_kset, int index, 110iscsi_boot_create_initiator(struct iscsi_boot_kset *boot_kset, int index,
104 void *data, 111 void *data,
105 ssize_t (*show) (void *data, int type, char *buf), 112 ssize_t (*show) (void *data, int type, char *buf),
106 mode_t (*is_visible) (void *data, int type)); 113 mode_t (*is_visible) (void *data, int type),
114 void (*release) (void *data));
107 115
108struct iscsi_boot_kobj * 116struct iscsi_boot_kobj *
109iscsi_boot_create_ethernet(struct iscsi_boot_kset *boot_kset, int index, 117iscsi_boot_create_ethernet(struct iscsi_boot_kset *boot_kset, int index,
110 void *data, 118 void *data,
111 ssize_t (*show) (void *data, int type, char *buf), 119 ssize_t (*show) (void *data, int type, char *buf),
112 mode_t (*is_visible) (void *data, int type)); 120 mode_t (*is_visible) (void *data, int type),
121 void (*release) (void *data));
113struct iscsi_boot_kobj * 122struct iscsi_boot_kobj *
114iscsi_boot_create_target(struct iscsi_boot_kset *boot_kset, int index, 123iscsi_boot_create_target(struct iscsi_boot_kset *boot_kset, int index,
115 void *data, 124 void *data,
116 ssize_t (*show) (void *data, int type, char *buf), 125 ssize_t (*show) (void *data, int type, char *buf),
117 mode_t (*is_visible) (void *data, int type)); 126 mode_t (*is_visible) (void *data, int type),
127 void (*release) (void *data));
118 128
119struct iscsi_boot_kset *iscsi_boot_create_kset(const char *set_name); 129struct iscsi_boot_kset *iscsi_boot_create_kset(const char *set_name);
120struct iscsi_boot_kset *iscsi_boot_create_host_kset(unsigned int hostno); 130struct iscsi_boot_kset *iscsi_boot_create_host_kset(unsigned int hostno);
diff --git a/include/linux/jbd.h b/include/linux/jbd.h
index e06965081ba5..e6a5e34bed4f 100644
--- a/include/linux/jbd.h
+++ b/include/linux/jbd.h
@@ -940,7 +940,6 @@ extern int journal_force_commit(journal_t *);
940 */ 940 */
941struct journal_head *journal_add_journal_head(struct buffer_head *bh); 941struct journal_head *journal_add_journal_head(struct buffer_head *bh);
942struct journal_head *journal_grab_journal_head(struct buffer_head *bh); 942struct journal_head *journal_grab_journal_head(struct buffer_head *bh);
943void journal_remove_journal_head(struct buffer_head *bh);
944void journal_put_journal_head(struct journal_head *jh); 943void journal_put_journal_head(struct journal_head *jh);
945 944
946/* 945/*
diff --git a/include/linux/jbd2.h b/include/linux/jbd2.h
index 4ecb7b16b278..38f307b8c334 100644
--- a/include/linux/jbd2.h
+++ b/include/linux/jbd2.h
@@ -1024,7 +1024,6 @@ struct journal_s
1024 1024
1025/* Filing buffers */ 1025/* Filing buffers */
1026extern void jbd2_journal_unfile_buffer(journal_t *, struct journal_head *); 1026extern void jbd2_journal_unfile_buffer(journal_t *, struct journal_head *);
1027extern void __jbd2_journal_unfile_buffer(struct journal_head *);
1028extern void __jbd2_journal_refile_buffer(struct journal_head *); 1027extern void __jbd2_journal_refile_buffer(struct journal_head *);
1029extern void jbd2_journal_refile_buffer(journal_t *, struct journal_head *); 1028extern void jbd2_journal_refile_buffer(journal_t *, struct journal_head *);
1030extern void __jbd2_journal_file_buffer(struct journal_head *, transaction_t *, int); 1029extern void __jbd2_journal_file_buffer(struct journal_head *, transaction_t *, int);
@@ -1165,7 +1164,6 @@ extern void jbd2_journal_release_jbd_inode(journal_t *journal, struct jbd2_in
1165 */ 1164 */
1166struct journal_head *jbd2_journal_add_journal_head(struct buffer_head *bh); 1165struct journal_head *jbd2_journal_add_journal_head(struct buffer_head *bh);
1167struct journal_head *jbd2_journal_grab_journal_head(struct buffer_head *bh); 1166struct journal_head *jbd2_journal_grab_journal_head(struct buffer_head *bh);
1168void jbd2_journal_remove_journal_head(struct buffer_head *bh);
1169void jbd2_journal_put_journal_head(struct journal_head *jh); 1167void jbd2_journal_put_journal_head(struct journal_head *jh);
1170 1168
1171/* 1169/*
@@ -1331,12 +1329,6 @@ extern int jbd_blocks_per_page(struct inode *inode);
1331#define BUFFER_TRACE2(bh, bh2, info) do {} while (0) 1329#define BUFFER_TRACE2(bh, bh2, info) do {} while (0)
1332#define JBUFFER_TRACE(jh, info) do {} while (0) 1330#define JBUFFER_TRACE(jh, info) do {} while (0)
1333 1331
1334/*
1335 * jbd2_dev_to_name is a utility function used by the jbd2 and ext4
1336 * tracing infrastructure to map a dev_t to a device name.
1337 */
1338extern const char *jbd2_dev_to_name(dev_t device);
1339
1340#endif /* __KERNEL__ */ 1332#endif /* __KERNEL__ */
1341 1333
1342#endif /* _LINUX_JBD2_H */ 1334#endif /* _LINUX_JBD2_H */
diff --git a/include/linux/journal-head.h b/include/linux/journal-head.h
index 44e95d0a721f..423cb6d78ee0 100644
--- a/include/linux/journal-head.h
+++ b/include/linux/journal-head.h
@@ -45,7 +45,7 @@ struct journal_head {
45 * has been cowed 45 * has been cowed
46 * [jbd_lock_bh_state()] 46 * [jbd_lock_bh_state()]
47 */ 47 */
48 unsigned b_cow_tid; 48 tid_t b_cow_tid;
49 49
50 /* 50 /*
51 * Copy of the buffer data frozen for writing to the log. 51 * Copy of the buffer data frozen for writing to the log.
diff --git a/include/linux/jump_label.h b/include/linux/jump_label.h
index 83e745f3ead7..66f23dc5e76a 100644
--- a/include/linux/jump_label.h
+++ b/include/linux/jump_label.h
@@ -54,7 +54,7 @@ extern void jump_label_apply_nops(struct module *mod);
54 54
55#else 55#else
56 56
57#include <asm/atomic.h> 57#include <linux/atomic.h>
58 58
59#define JUMP_LABEL_INIT {ATOMIC_INIT(0)} 59#define JUMP_LABEL_INIT {ATOMIC_INIT(0)}
60 60
diff --git a/include/linux/kconfig.h b/include/linux/kconfig.h
new file mode 100644
index 000000000000..067eda0e4b32
--- /dev/null
+++ b/include/linux/kconfig.h
@@ -0,0 +1,32 @@
1#ifndef __LINUX_KCONFIG_H
2#define __LINUX_KCONFIG_H
3
4#include <generated/autoconf.h>
5
6/*
7 * Helper macros to use CONFIG_ options in C expressions. Note that
8 * these only work with boolean and tristate options.
9 */
10
11/*
12 * IS_ENABLED(CONFIG_FOO) evaluates to 1 if CONFIG_FOO is set to 'y' or 'm',
13 * 0 otherwise.
14 *
15 */
16#define IS_ENABLED(option) \
17 (__enabled_ ## option || __enabled_ ## option ## _MODULE)
18
19/*
20 * IS_BUILTIN(CONFIG_FOO) evaluates to 1 if CONFIG_FOO is set to 'y', 0
21 * otherwise. For boolean options, this is equivalent to
22 * IS_ENABLED(CONFIG_FOO).
23 */
24#define IS_BUILTIN(option) __enabled_ ## option
25
26/*
27 * IS_MODULE(CONFIG_FOO) evaluates to 1 if CONFIG_FOO is set to 'm', 0
28 * otherwise.
29 */
30#define IS_MODULE(option) __enabled_ ## option ## _MODULE
31
32#endif /* __LINUX_KCONFIG_H */
diff --git a/include/linux/kdb.h b/include/linux/kdb.h
index aadff7cc2b84..529d9a0c75a5 100644
--- a/include/linux/kdb.h
+++ b/include/linux/kdb.h
@@ -16,7 +16,7 @@
16#ifdef CONFIG_KGDB_KDB 16#ifdef CONFIG_KGDB_KDB
17#include <linux/init.h> 17#include <linux/init.h>
18#include <linux/sched.h> 18#include <linux/sched.h>
19#include <asm/atomic.h> 19#include <linux/atomic.h>
20 20
21#define KDB_POLL_FUNC_MAX 5 21#define KDB_POLL_FUNC_MAX 5
22extern int kdb_poll_idx; 22extern int kdb_poll_idx;
diff --git a/include/linux/kernel.h b/include/linux/kernel.h
index fb0e7329fee1..46ac9a50528d 100644
--- a/include/linux/kernel.h
+++ b/include/linux/kernel.h
@@ -56,6 +56,14 @@
56 56
57#define FIELD_SIZEOF(t, f) (sizeof(((t*)0)->f)) 57#define FIELD_SIZEOF(t, f) (sizeof(((t*)0)->f))
58#define DIV_ROUND_UP(n,d) (((n) + (d) - 1) / (d)) 58#define DIV_ROUND_UP(n,d) (((n) + (d) - 1) / (d))
59#define DIV_ROUND_UP_ULL(ll,d) \
60 ({ unsigned long long _tmp = (ll)+(d)-1; do_div(_tmp, d); _tmp; })
61
62#if BITS_PER_LONG == 32
63# define DIV_ROUND_UP_SECTOR_T(ll,d) DIV_ROUND_UP_ULL(ll, d)
64#else
65# define DIV_ROUND_UP_SECTOR_T(ll,d) DIV_ROUND_UP(ll,d)
66#endif
59 67
60/* The `const' in roundup() prevents gcc-3.3 from calling __divdi3 */ 68/* The `const' in roundup() prevents gcc-3.3 from calling __divdi3 */
61#define roundup(x, y) ( \ 69#define roundup(x, y) ( \
@@ -121,7 +129,7 @@ extern int _cond_resched(void);
121# define might_resched() do { } while (0) 129# define might_resched() do { } while (0)
122#endif 130#endif
123 131
124#ifdef CONFIG_DEBUG_SPINLOCK_SLEEP 132#ifdef CONFIG_DEBUG_ATOMIC_SLEEP
125 void __might_sleep(const char *file, int line, int preempt_offset); 133 void __might_sleep(const char *file, int line, int preempt_offset);
126/** 134/**
127 * might_sleep - annotation for functions that can sleep 135 * might_sleep - annotation for functions that can sleep
@@ -646,33 +654,10 @@ static inline void ftrace_dump(enum ftrace_dump_mode oops_dump_mode) { }
646 const typeof( ((type *)0)->member ) *__mptr = (ptr); \ 654 const typeof( ((type *)0)->member ) *__mptr = (ptr); \
647 (type *)( (char *)__mptr - offsetof(type,member) );}) 655 (type *)( (char *)__mptr - offsetof(type,member) );})
648 656
649struct sysinfo;
650extern int do_sysinfo(struct sysinfo *info);
651
652#endif /* __KERNEL__ */
653
654#define SI_LOAD_SHIFT 16
655struct sysinfo {
656 long uptime; /* Seconds since boot */
657 unsigned long loads[3]; /* 1, 5, and 15 minute load averages */
658 unsigned long totalram; /* Total usable main memory size */
659 unsigned long freeram; /* Available memory size */
660 unsigned long sharedram; /* Amount of shared memory */
661 unsigned long bufferram; /* Memory used by buffers */
662 unsigned long totalswap; /* Total swap space size */
663 unsigned long freeswap; /* swap space still available */
664 unsigned short procs; /* Number of current processes */
665 unsigned short pad; /* explicit padding for m68k */
666 unsigned long totalhigh; /* Total high memory size */
667 unsigned long freehigh; /* Available high memory size */
668 unsigned int mem_unit; /* Memory unit size in bytes */
669 char _f[20-2*sizeof(long)-sizeof(int)]; /* Padding: libc5 uses this.. */
670};
671
672#ifdef __CHECKER__ 657#ifdef __CHECKER__
673#define BUILD_BUG_ON_NOT_POWER_OF_2(n) 658#define BUILD_BUG_ON_NOT_POWER_OF_2(n)
674#define BUILD_BUG_ON_ZERO(e) 659#define BUILD_BUG_ON_ZERO(e) (0)
675#define BUILD_BUG_ON_NULL(e) 660#define BUILD_BUG_ON_NULL(e) ((void*)0)
676#define BUILD_BUG_ON(condition) 661#define BUILD_BUG_ON(condition)
677#else /* __CHECKER__ */ 662#else /* __CHECKER__ */
678 663
@@ -736,4 +721,27 @@ extern int __build_bug_on_failed;
736# define REBUILD_DUE_TO_FTRACE_MCOUNT_RECORD 721# define REBUILD_DUE_TO_FTRACE_MCOUNT_RECORD
737#endif 722#endif
738 723
724struct sysinfo;
725extern int do_sysinfo(struct sysinfo *info);
726
727#endif /* __KERNEL__ */
728
729#define SI_LOAD_SHIFT 16
730struct sysinfo {
731 long uptime; /* Seconds since boot */
732 unsigned long loads[3]; /* 1, 5, and 15 minute load averages */
733 unsigned long totalram; /* Total usable main memory size */
734 unsigned long freeram; /* Available memory size */
735 unsigned long sharedram; /* Amount of shared memory */
736 unsigned long bufferram; /* Memory used by buffers */
737 unsigned long totalswap; /* Total swap space size */
738 unsigned long freeswap; /* swap space still available */
739 unsigned short procs; /* Number of current processes */
740 unsigned short pad; /* explicit padding for m68k */
741 unsigned long totalhigh; /* Total high memory size */
742 unsigned long freehigh; /* Available high memory size */
743 unsigned int mem_unit; /* Memory unit size in bytes */
744 char _f[20-2*sizeof(long)-sizeof(int)]; /* Padding: libc5 uses this.. */
745};
746
739#endif 747#endif
diff --git a/include/linux/key.h b/include/linux/key.h
index 6ea4eebd3467..183a6af7715d 100644
--- a/include/linux/key.h
+++ b/include/linux/key.h
@@ -21,7 +21,7 @@
21#include <linux/rcupdate.h> 21#include <linux/rcupdate.h>
22#include <linux/sysctl.h> 22#include <linux/sysctl.h>
23#include <linux/rwsem.h> 23#include <linux/rwsem.h>
24#include <asm/atomic.h> 24#include <linux/atomic.h>
25 25
26#ifdef __KERNEL__ 26#ifdef __KERNEL__
27 27
diff --git a/include/linux/kgdb.h b/include/linux/kgdb.h
index 10ca03d0a250..fa391835508d 100644
--- a/include/linux/kgdb.h
+++ b/include/linux/kgdb.h
@@ -16,7 +16,7 @@
16#include <linux/serial_8250.h> 16#include <linux/serial_8250.h>
17#include <linux/linkage.h> 17#include <linux/linkage.h>
18#include <linux/init.h> 18#include <linux/init.h>
19#include <asm/atomic.h> 19#include <linux/atomic.h>
20#ifdef CONFIG_HAVE_ARCH_KGDB 20#ifdef CONFIG_HAVE_ARCH_KGDB
21#include <asm/kgdb.h> 21#include <asm/kgdb.h>
22#endif 22#endif
diff --git a/include/linux/kmod.h b/include/linux/kmod.h
index d4a5c84c503d..0da38cf7db7b 100644
--- a/include/linux/kmod.h
+++ b/include/linux/kmod.h
@@ -45,7 +45,7 @@ static inline int request_module_nowait(const char *name, ...) { return -ENOSYS;
45#endif 45#endif
46 46
47 47
48struct key; 48struct cred;
49struct file; 49struct file;
50 50
51enum umh_wait { 51enum umh_wait {
@@ -62,7 +62,7 @@ struct subprocess_info {
62 char **envp; 62 char **envp;
63 enum umh_wait wait; 63 enum umh_wait wait;
64 int retval; 64 int retval;
65 int (*init)(struct subprocess_info *info); 65 int (*init)(struct subprocess_info *info, struct cred *new);
66 void (*cleanup)(struct subprocess_info *info); 66 void (*cleanup)(struct subprocess_info *info);
67 void *data; 67 void *data;
68}; 68};
@@ -73,7 +73,7 @@ struct subprocess_info *call_usermodehelper_setup(char *path, char **argv,
73 73
74/* Set various pieces of state into the subprocess_info structure */ 74/* Set various pieces of state into the subprocess_info structure */
75void call_usermodehelper_setfns(struct subprocess_info *info, 75void call_usermodehelper_setfns(struct subprocess_info *info,
76 int (*init)(struct subprocess_info *info), 76 int (*init)(struct subprocess_info *info, struct cred *new),
77 void (*cleanup)(struct subprocess_info *info), 77 void (*cleanup)(struct subprocess_info *info),
78 void *data); 78 void *data);
79 79
@@ -87,7 +87,7 @@ void call_usermodehelper_freeinfo(struct subprocess_info *info);
87static inline int 87static inline int
88call_usermodehelper_fns(char *path, char **argv, char **envp, 88call_usermodehelper_fns(char *path, char **argv, char **envp,
89 enum umh_wait wait, 89 enum umh_wait wait,
90 int (*init)(struct subprocess_info *info), 90 int (*init)(struct subprocess_info *info, struct cred *new),
91 void (*cleanup)(struct subprocess_info *), void *data) 91 void (*cleanup)(struct subprocess_info *), void *data)
92{ 92{
93 struct subprocess_info *info; 93 struct subprocess_info *info;
diff --git a/include/linux/kmsg_dump.h b/include/linux/kmsg_dump.h
index 2a0d7d651dc3..ee0c952188de 100644
--- a/include/linux/kmsg_dump.h
+++ b/include/linux/kmsg_dump.h
@@ -12,6 +12,7 @@
12#ifndef _LINUX_KMSG_DUMP_H 12#ifndef _LINUX_KMSG_DUMP_H
13#define _LINUX_KMSG_DUMP_H 13#define _LINUX_KMSG_DUMP_H
14 14
15#include <linux/errno.h>
15#include <linux/list.h> 16#include <linux/list.h>
16 17
17enum kmsg_dump_reason { 18enum kmsg_dump_reason {
diff --git a/include/linux/kobject.h b/include/linux/kobject.h
index 9229b64ee3aa..668729cc0fe9 100644
--- a/include/linux/kobject.h
+++ b/include/linux/kobject.h
@@ -25,7 +25,7 @@
25#include <linux/kobject_ns.h> 25#include <linux/kobject_ns.h>
26#include <linux/kernel.h> 26#include <linux/kernel.h>
27#include <linux/wait.h> 27#include <linux/wait.h>
28#include <asm/atomic.h> 28#include <linux/atomic.h>
29 29
30#define UEVENT_HELPER_PATH_LEN 256 30#define UEVENT_HELPER_PATH_LEN 256
31#define UEVENT_NUM_ENVP 32 /* number of env pointers */ 31#define UEVENT_NUM_ENVP 32 /* number of env pointers */
diff --git a/include/linux/kobject_ns.h b/include/linux/kobject_ns.h
index 82cb5bf461fb..f66b065a8b5f 100644
--- a/include/linux/kobject_ns.h
+++ b/include/linux/kobject_ns.h
@@ -32,15 +32,17 @@ enum kobj_ns_type {
32 32
33/* 33/*
34 * Callbacks so sysfs can determine namespaces 34 * Callbacks so sysfs can determine namespaces
35 * @current_ns: return calling task's namespace 35 * @grab_current_ns: return a new reference to calling task's namespace
36 * @netlink_ns: return namespace to which a sock belongs (right?) 36 * @netlink_ns: return namespace to which a sock belongs (right?)
37 * @initial_ns: return the initial namespace (i.e. init_net_ns) 37 * @initial_ns: return the initial namespace (i.e. init_net_ns)
38 * @drop_ns: drops a reference to namespace
38 */ 39 */
39struct kobj_ns_type_operations { 40struct kobj_ns_type_operations {
40 enum kobj_ns_type type; 41 enum kobj_ns_type type;
41 const void *(*current_ns)(void); 42 void *(*grab_current_ns)(void);
42 const void *(*netlink_ns)(struct sock *sk); 43 const void *(*netlink_ns)(struct sock *sk);
43 const void *(*initial_ns)(void); 44 const void *(*initial_ns)(void);
45 void (*drop_ns)(void *);
44}; 46};
45 47
46int kobj_ns_type_register(const struct kobj_ns_type_operations *ops); 48int kobj_ns_type_register(const struct kobj_ns_type_operations *ops);
@@ -48,9 +50,9 @@ int kobj_ns_type_registered(enum kobj_ns_type type);
48const struct kobj_ns_type_operations *kobj_child_ns_ops(struct kobject *parent); 50const struct kobj_ns_type_operations *kobj_child_ns_ops(struct kobject *parent);
49const struct kobj_ns_type_operations *kobj_ns_ops(struct kobject *kobj); 51const struct kobj_ns_type_operations *kobj_ns_ops(struct kobject *kobj);
50 52
51const void *kobj_ns_current(enum kobj_ns_type type); 53void *kobj_ns_grab_current(enum kobj_ns_type type);
52const void *kobj_ns_netlink(enum kobj_ns_type type, struct sock *sk); 54const void *kobj_ns_netlink(enum kobj_ns_type type, struct sock *sk);
53const void *kobj_ns_initial(enum kobj_ns_type type); 55const void *kobj_ns_initial(enum kobj_ns_type type);
54void kobj_ns_exit(enum kobj_ns_type type, const void *ns); 56void kobj_ns_drop(enum kobj_ns_type type, void *ns);
55 57
56#endif /* _LINUX_KOBJECT_NS_H */ 58#endif /* _LINUX_KOBJECT_NS_H */
diff --git a/include/linux/kvm.h b/include/linux/kvm.h
index 55ef181521ff..2c366b52f505 100644
--- a/include/linux/kvm.h
+++ b/include/linux/kvm.h
@@ -161,6 +161,7 @@ struct kvm_pit_config {
161#define KVM_EXIT_NMI 16 161#define KVM_EXIT_NMI 16
162#define KVM_EXIT_INTERNAL_ERROR 17 162#define KVM_EXIT_INTERNAL_ERROR 17
163#define KVM_EXIT_OSI 18 163#define KVM_EXIT_OSI 18
164#define KVM_EXIT_PAPR_HCALL 19
164 165
165/* For KVM_EXIT_INTERNAL_ERROR */ 166/* For KVM_EXIT_INTERNAL_ERROR */
166#define KVM_INTERNAL_ERROR_EMULATION 1 167#define KVM_INTERNAL_ERROR_EMULATION 1
@@ -264,6 +265,11 @@ struct kvm_run {
264 struct { 265 struct {
265 __u64 gprs[32]; 266 __u64 gprs[32];
266 } osi; 267 } osi;
268 struct {
269 __u64 nr;
270 __u64 ret;
271 __u64 args[9];
272 } papr_hcall;
267 /* Fix the size of the union. */ 273 /* Fix the size of the union. */
268 char padding[256]; 274 char padding[256];
269 }; 275 };
@@ -544,6 +550,9 @@ struct kvm_ppc_pvinfo {
544#define KVM_CAP_TSC_CONTROL 60 550#define KVM_CAP_TSC_CONTROL 60
545#define KVM_CAP_GET_TSC_KHZ 61 551#define KVM_CAP_GET_TSC_KHZ 61
546#define KVM_CAP_PPC_BOOKE_SREGS 62 552#define KVM_CAP_PPC_BOOKE_SREGS 62
553#define KVM_CAP_SPAPR_TCE 63
554#define KVM_CAP_PPC_SMT 64
555#define KVM_CAP_PPC_RMA 65
547 556
548#ifdef KVM_CAP_IRQ_ROUTING 557#ifdef KVM_CAP_IRQ_ROUTING
549 558
@@ -746,6 +755,9 @@ struct kvm_clock_data {
746/* Available with KVM_CAP_XCRS */ 755/* Available with KVM_CAP_XCRS */
747#define KVM_GET_XCRS _IOR(KVMIO, 0xa6, struct kvm_xcrs) 756#define KVM_GET_XCRS _IOR(KVMIO, 0xa6, struct kvm_xcrs)
748#define KVM_SET_XCRS _IOW(KVMIO, 0xa7, struct kvm_xcrs) 757#define KVM_SET_XCRS _IOW(KVMIO, 0xa7, struct kvm_xcrs)
758#define KVM_CREATE_SPAPR_TCE _IOW(KVMIO, 0xa8, struct kvm_create_spapr_tce)
759/* Available with KVM_CAP_RMA */
760#define KVM_ALLOCATE_RMA _IOR(KVMIO, 0xa9, struct kvm_allocate_rma)
749 761
750#define KVM_DEV_ASSIGN_ENABLE_IOMMU (1 << 0) 762#define KVM_DEV_ASSIGN_ENABLE_IOMMU (1 << 0)
751 763
@@ -773,20 +785,14 @@ struct kvm_assigned_pci_dev {
773 785
774struct kvm_assigned_irq { 786struct kvm_assigned_irq {
775 __u32 assigned_dev_id; 787 __u32 assigned_dev_id;
776 __u32 host_irq; 788 __u32 host_irq; /* ignored (legacy field) */
777 __u32 guest_irq; 789 __u32 guest_irq;
778 __u32 flags; 790 __u32 flags;
779 union { 791 union {
780 struct {
781 __u32 addr_lo;
782 __u32 addr_hi;
783 __u32 data;
784 } guest_msi;
785 __u32 reserved[12]; 792 __u32 reserved[12];
786 }; 793 };
787}; 794};
788 795
789
790struct kvm_assigned_msix_nr { 796struct kvm_assigned_msix_nr {
791 __u32 assigned_dev_id; 797 __u32 assigned_dev_id;
792 __u16 entry_nr; 798 __u16 entry_nr;
diff --git a/include/linux/kvm_host.h b/include/linux/kvm_host.h
index 31ebb59cbd2f..eabb21a30c34 100644
--- a/include/linux/kvm_host.h
+++ b/include/linux/kvm_host.h
@@ -47,6 +47,7 @@
47#define KVM_REQ_DEACTIVATE_FPU 10 47#define KVM_REQ_DEACTIVATE_FPU 10
48#define KVM_REQ_EVENT 11 48#define KVM_REQ_EVENT 11
49#define KVM_REQ_APF_HALT 12 49#define KVM_REQ_APF_HALT 12
50#define KVM_REQ_STEAL_UPDATE 13
50 51
51#define KVM_USERSPACE_IRQ_SOURCE_ID 0 52#define KVM_USERSPACE_IRQ_SOURCE_ID 0
52 53
@@ -326,12 +327,17 @@ static inline struct kvm_memslots *kvm_memslots(struct kvm *kvm)
326static inline int is_error_hpa(hpa_t hpa) { return hpa >> HPA_MSB; } 327static inline int is_error_hpa(hpa_t hpa) { return hpa >> HPA_MSB; }
327 328
328extern struct page *bad_page; 329extern struct page *bad_page;
330extern struct page *fault_page;
331
329extern pfn_t bad_pfn; 332extern pfn_t bad_pfn;
333extern pfn_t fault_pfn;
330 334
331int is_error_page(struct page *page); 335int is_error_page(struct page *page);
332int is_error_pfn(pfn_t pfn); 336int is_error_pfn(pfn_t pfn);
333int is_hwpoison_pfn(pfn_t pfn); 337int is_hwpoison_pfn(pfn_t pfn);
334int is_fault_pfn(pfn_t pfn); 338int is_fault_pfn(pfn_t pfn);
339int is_noslot_pfn(pfn_t pfn);
340int is_invalid_pfn(pfn_t pfn);
335int kvm_is_error_hva(unsigned long addr); 341int kvm_is_error_hva(unsigned long addr);
336int kvm_set_memory_region(struct kvm *kvm, 342int kvm_set_memory_region(struct kvm *kvm,
337 struct kvm_userspace_memory_region *mem, 343 struct kvm_userspace_memory_region *mem,
@@ -381,6 +387,8 @@ int kvm_read_guest_page(struct kvm *kvm, gfn_t gfn, void *data, int offset,
381int kvm_read_guest_atomic(struct kvm *kvm, gpa_t gpa, void *data, 387int kvm_read_guest_atomic(struct kvm *kvm, gpa_t gpa, void *data,
382 unsigned long len); 388 unsigned long len);
383int kvm_read_guest(struct kvm *kvm, gpa_t gpa, void *data, unsigned long len); 389int kvm_read_guest(struct kvm *kvm, gpa_t gpa, void *data, unsigned long len);
390int kvm_read_guest_cached(struct kvm *kvm, struct gfn_to_hva_cache *ghc,
391 void *data, unsigned long len);
384int kvm_write_guest_page(struct kvm *kvm, gfn_t gfn, const void *data, 392int kvm_write_guest_page(struct kvm *kvm, gfn_t gfn, const void *data,
385 int offset, int len); 393 int offset, int len);
386int kvm_write_guest(struct kvm *kvm, gpa_t gpa, const void *data, 394int kvm_write_guest(struct kvm *kvm, gpa_t gpa, const void *data,
diff --git a/include/linux/led-lm3530.h b/include/linux/led-lm3530.h
index 58592fa67d24..8eb12357a110 100644
--- a/include/linux/led-lm3530.h
+++ b/include/linux/led-lm3530.h
@@ -84,6 +84,8 @@ enum lm3530_als_mode {
84 * @brt_ramp_rise: rate of rise of led current 84 * @brt_ramp_rise: rate of rise of led current
85 * @als1_resistor_sel: internal resistance from ALS1 input to ground 85 * @als1_resistor_sel: internal resistance from ALS1 input to ground
86 * @als2_resistor_sel: internal resistance from ALS2 input to ground 86 * @als2_resistor_sel: internal resistance from ALS2 input to ground
87 * @als_vmin: als input voltage calibrated for max brightness in mV
88 * @als_vmax: als input voltage calibrated for min brightness in mV
87 * @brt_val: brightness value (0-255) 89 * @brt_val: brightness value (0-255)
88 */ 90 */
89struct lm3530_platform_data { 91struct lm3530_platform_data {
@@ -101,6 +103,9 @@ struct lm3530_platform_data {
101 u8 als1_resistor_sel; 103 u8 als1_resistor_sel;
102 u8 als2_resistor_sel; 104 u8 als2_resistor_sel;
103 105
106 u32 als_vmin;
107 u32 als_vmax;
108
104 u8 brt_val; 109 u8 brt_val;
105}; 110};
106 111
diff --git a/include/linux/lguest.h b/include/linux/lguest.h
index 2fb1dcbcb5aa..9962c6bb1311 100644
--- a/include/linux/lguest.h
+++ b/include/linux/lguest.h
@@ -59,8 +59,6 @@ struct lguest_data {
59 unsigned long reserve_mem; 59 unsigned long reserve_mem;
60 /* KHz for the TSC clock. */ 60 /* KHz for the TSC clock. */
61 u32 tsc_khz; 61 u32 tsc_khz;
62 /* Page where the top-level pagetable is */
63 unsigned long pgdir;
64 62
65/* Fields initialized by the Guest at boot: */ 63/* Fields initialized by the Guest at boot: */
66 /* Instruction range to suppress interrupts even if enabled */ 64 /* Instruction range to suppress interrupts even if enabled */
diff --git a/include/linux/libata.h b/include/linux/libata.h
index 5a9926b34072..efd6f9800762 100644
--- a/include/linux/libata.h
+++ b/include/linux/libata.h
@@ -74,6 +74,16 @@
74 74
75#define BPRINTK(fmt, args...) if (ap->flags & ATA_FLAG_DEBUGMSG) printk(KERN_ERR "%s: " fmt, __func__, ## args) 75#define BPRINTK(fmt, args...) if (ap->flags & ATA_FLAG_DEBUGMSG) printk(KERN_ERR "%s: " fmt, __func__, ## args)
76 76
77#define ata_print_version_once(dev, version) \
78({ \
79 static bool __print_once; \
80 \
81 if (!__print_once) { \
82 __print_once = true; \
83 ata_print_version(dev, version); \
84 } \
85})
86
77/* NEW: debug levels */ 87/* NEW: debug levels */
78#define HAVE_LIBATA_MSG 1 88#define HAVE_LIBATA_MSG 1
79 89
@@ -1244,20 +1254,50 @@ static inline int sata_srst_pmp(struct ata_link *link)
1244/* 1254/*
1245 * printk helpers 1255 * printk helpers
1246 */ 1256 */
1247#define ata_port_printk(ap, lv, fmt, args...) \ 1257__attribute__((format (printf, 3, 4)))
1248 printk("%sata%u: "fmt, lv, (ap)->print_id , ##args) 1258int ata_port_printk(const struct ata_port *ap, const char *level,
1249 1259 const char *fmt, ...);
1250#define ata_link_printk(link, lv, fmt, args...) do { \ 1260__attribute__((format (printf, 3, 4)))
1251 if (sata_pmp_attached((link)->ap) || (link)->ap->slave_link) \ 1261int ata_link_printk(const struct ata_link *link, const char *level,
1252 printk("%sata%u.%02u: "fmt, lv, (link)->ap->print_id, \ 1262 const char *fmt, ...);
1253 (link)->pmp , ##args); \ 1263__attribute__((format (printf, 3, 4)))
1254 else \ 1264int ata_dev_printk(const struct ata_device *dev, const char *level,
1255 printk("%sata%u: "fmt, lv, (link)->ap->print_id , ##args); \ 1265 const char *fmt, ...);
1256 } while(0) 1266
1257 1267#define ata_port_err(ap, fmt, ...) \
1258#define ata_dev_printk(dev, lv, fmt, args...) \ 1268 ata_port_printk(ap, KERN_ERR, fmt, ##__VA_ARGS__)
1259 printk("%sata%u.%02u: "fmt, lv, (dev)->link->ap->print_id, \ 1269#define ata_port_warn(ap, fmt, ...) \
1260 (dev)->link->pmp + (dev)->devno , ##args) 1270 ata_port_printk(ap, KERN_WARNING, fmt, ##__VA_ARGS__)
1271#define ata_port_notice(ap, fmt, ...) \
1272 ata_port_printk(ap, KERN_NOTICE, fmt, ##__VA_ARGS__)
1273#define ata_port_info(ap, fmt, ...) \
1274 ata_port_printk(ap, KERN_INFO, fmt, ##__VA_ARGS__)
1275#define ata_port_dbg(ap, fmt, ...) \
1276 ata_port_printk(ap, KERN_DEBUG, fmt, ##__VA_ARGS__)
1277
1278#define ata_link_err(link, fmt, ...) \
1279 ata_link_printk(link, KERN_ERR, fmt, ##__VA_ARGS__)
1280#define ata_link_warn(link, fmt, ...) \
1281 ata_link_printk(link, KERN_WARNING, fmt, ##__VA_ARGS__)
1282#define ata_link_notice(link, fmt, ...) \
1283 ata_link_printk(link, KERN_NOTICE, fmt, ##__VA_ARGS__)
1284#define ata_link_info(link, fmt, ...) \
1285 ata_link_printk(link, KERN_INFO, fmt, ##__VA_ARGS__)
1286#define ata_link_dbg(link, fmt, ...) \
1287 ata_link_printk(link, KERN_DEBUG, fmt, ##__VA_ARGS__)
1288
1289#define ata_dev_err(dev, fmt, ...) \
1290 ata_dev_printk(dev, KERN_ERR, fmt, ##__VA_ARGS__)
1291#define ata_dev_warn(dev, fmt, ...) \
1292 ata_dev_printk(dev, KERN_WARNING, fmt, ##__VA_ARGS__)
1293#define ata_dev_notice(dev, fmt, ...) \
1294 ata_dev_printk(dev, KERN_NOTICE, fmt, ##__VA_ARGS__)
1295#define ata_dev_info(dev, fmt, ...) \
1296 ata_dev_printk(dev, KERN_INFO, fmt, ##__VA_ARGS__)
1297#define ata_dev_dbg(dev, fmt, ...) \
1298 ata_dev_printk(dev, KERN_DEBUG, fmt, ##__VA_ARGS__)
1299
1300void ata_print_version(const struct device *dev, const char *version);
1261 1301
1262/* 1302/*
1263 * ata_eh_info helpers 1303 * ata_eh_info helpers
diff --git a/include/linux/llist.h b/include/linux/llist.h
new file mode 100644
index 000000000000..aa0c8b5b3cd0
--- /dev/null
+++ b/include/linux/llist.h
@@ -0,0 +1,126 @@
1#ifndef LLIST_H
2#define LLIST_H
3/*
4 * Lock-less NULL terminated single linked list
5 *
6 * If there are multiple producers and multiple consumers, llist_add
7 * can be used in producers and llist_del_all can be used in
8 * consumers. They can work simultaneously without lock. But
9 * llist_del_first can not be used here. Because llist_del_first
10 * depends on list->first->next does not changed if list->first is not
11 * changed during its operation, but llist_del_first, llist_add,
12 * llist_add (or llist_del_all, llist_add, llist_add) sequence in
13 * another consumer may violate that.
14 *
15 * If there are multiple producers and one consumer, llist_add can be
16 * used in producers and llist_del_all or llist_del_first can be used
17 * in the consumer.
18 *
19 * This can be summarized as follow:
20 *
21 * | add | del_first | del_all
22 * add | - | - | -
23 * del_first | | L | L
24 * del_all | | | -
25 *
26 * Where "-" stands for no lock is needed, while "L" stands for lock
27 * is needed.
28 *
29 * The list entries deleted via llist_del_all can be traversed with
30 * traversing function such as llist_for_each etc. But the list
31 * entries can not be traversed safely before deleted from the list.
32 * The order of deleted entries is from the newest to the oldest added
33 * one. If you want to traverse from the oldest to the newest, you
34 * must reverse the order by yourself before traversing.
35 *
36 * The basic atomic operation of this list is cmpxchg on long. On
37 * architectures that don't have NMI-safe cmpxchg implementation, the
38 * list can NOT be used in NMI handler. So code uses the list in NMI
39 * handler should depend on CONFIG_ARCH_HAVE_NMI_SAFE_CMPXCHG.
40 */
41
42struct llist_head {
43 struct llist_node *first;
44};
45
46struct llist_node {
47 struct llist_node *next;
48};
49
50#define LLIST_HEAD_INIT(name) { NULL }
51#define LLIST_HEAD(name) struct llist_head name = LLIST_HEAD_INIT(name)
52
53/**
54 * init_llist_head - initialize lock-less list head
55 * @head: the head for your lock-less list
56 */
57static inline void init_llist_head(struct llist_head *list)
58{
59 list->first = NULL;
60}
61
62/**
63 * llist_entry - get the struct of this entry
64 * @ptr: the &struct llist_node pointer.
65 * @type: the type of the struct this is embedded in.
66 * @member: the name of the llist_node within the struct.
67 */
68#define llist_entry(ptr, type, member) \
69 container_of(ptr, type, member)
70
71/**
72 * llist_for_each - iterate over some deleted entries of a lock-less list
73 * @pos: the &struct llist_node to use as a loop cursor
74 * @node: the first entry of deleted list entries
75 *
76 * In general, some entries of the lock-less list can be traversed
77 * safely only after being deleted from list, so start with an entry
78 * instead of list head.
79 *
80 * If being used on entries deleted from lock-less list directly, the
81 * traverse order is from the newest to the oldest added entry. If
82 * you want to traverse from the oldest to the newest, you must
83 * reverse the order by yourself before traversing.
84 */
85#define llist_for_each(pos, node) \
86 for ((pos) = (node); pos; (pos) = (pos)->next)
87
88/**
89 * llist_for_each_entry - iterate over some deleted entries of lock-less list of given type
90 * @pos: the type * to use as a loop cursor.
91 * @node: the fist entry of deleted list entries.
92 * @member: the name of the llist_node with the struct.
93 *
94 * In general, some entries of the lock-less list can be traversed
95 * safely only after being removed from list, so start with an entry
96 * instead of list head.
97 *
98 * If being used on entries deleted from lock-less list directly, the
99 * traverse order is from the newest to the oldest added entry. If
100 * you want to traverse from the oldest to the newest, you must
101 * reverse the order by yourself before traversing.
102 */
103#define llist_for_each_entry(pos, node, member) \
104 for ((pos) = llist_entry((node), typeof(*(pos)), member); \
105 &(pos)->member != NULL; \
106 (pos) = llist_entry((pos)->member.next, typeof(*(pos)), member))
107
108/**
109 * llist_empty - tests whether a lock-less list is empty
110 * @head: the list to test
111 *
112 * Not guaranteed to be accurate or up to date. Just a quick way to
113 * test whether the list is empty without deleting something from the
114 * list.
115 */
116static inline int llist_empty(const struct llist_head *head)
117{
118 return ACCESS_ONCE(head->first) == NULL;
119}
120
121void llist_add(struct llist_node *new, struct llist_head *head);
122void llist_add_batch(struct llist_node *new_first, struct llist_node *new_last,
123 struct llist_head *head);
124struct llist_node *llist_del_first(struct llist_head *head);
125struct llist_node *llist_del_all(struct llist_head *head);
126#endif /* LLIST_H */
diff --git a/include/linux/memcontrol.h b/include/linux/memcontrol.h
index 9724a38ee69d..3b535db00a94 100644
--- a/include/linux/memcontrol.h
+++ b/include/linux/memcontrol.h
@@ -39,6 +39,16 @@ extern unsigned long mem_cgroup_isolate_pages(unsigned long nr_to_scan,
39 struct mem_cgroup *mem_cont, 39 struct mem_cgroup *mem_cont,
40 int active, int file); 40 int active, int file);
41 41
42struct memcg_scanrecord {
43 struct mem_cgroup *mem; /* scanend memory cgroup */
44 struct mem_cgroup *root; /* scan target hierarchy root */
45 int context; /* scanning context (see memcontrol.c) */
46 unsigned long nr_scanned[2]; /* the number of scanned pages */
47 unsigned long nr_rotated[2]; /* the number of rotated pages */
48 unsigned long nr_freed[2]; /* the number of freed pages */
49 unsigned long elapsed; /* nsec of time elapsed while scanning */
50};
51
42#ifdef CONFIG_CGROUP_MEM_RES_CTLR 52#ifdef CONFIG_CGROUP_MEM_RES_CTLR
43/* 53/*
44 * All "charge" functions with gfp_mask should use GFP_KERNEL or 54 * All "charge" functions with gfp_mask should use GFP_KERNEL or
@@ -76,14 +86,13 @@ extern void mem_cgroup_uncharge_end(void);
76 86
77extern void mem_cgroup_uncharge_page(struct page *page); 87extern void mem_cgroup_uncharge_page(struct page *page);
78extern void mem_cgroup_uncharge_cache_page(struct page *page); 88extern void mem_cgroup_uncharge_cache_page(struct page *page);
79extern int mem_cgroup_shmem_charge_fallback(struct page *page,
80 struct mm_struct *mm, gfp_t gfp_mask);
81 89
82extern void mem_cgroup_out_of_memory(struct mem_cgroup *mem, gfp_t gfp_mask); 90extern void mem_cgroup_out_of_memory(struct mem_cgroup *mem, gfp_t gfp_mask);
83int task_in_mem_cgroup(struct task_struct *task, const struct mem_cgroup *mem); 91int task_in_mem_cgroup(struct task_struct *task, const struct mem_cgroup *mem);
84 92
85extern struct mem_cgroup *try_get_mem_cgroup_from_page(struct page *page); 93extern struct mem_cgroup *try_get_mem_cgroup_from_page(struct page *page);
86extern struct mem_cgroup *mem_cgroup_from_task(struct task_struct *p); 94extern struct mem_cgroup *mem_cgroup_from_task(struct task_struct *p);
95extern struct mem_cgroup *try_get_mem_cgroup_from_mm(struct mm_struct *mm);
87 96
88static inline 97static inline
89int mm_match_cgroup(const struct mm_struct *mm, const struct mem_cgroup *cgroup) 98int mm_match_cgroup(const struct mm_struct *mm, const struct mem_cgroup *cgroup)
@@ -110,8 +119,7 @@ int mem_cgroup_inactive_anon_is_low(struct mem_cgroup *memcg);
110int mem_cgroup_inactive_file_is_low(struct mem_cgroup *memcg); 119int mem_cgroup_inactive_file_is_low(struct mem_cgroup *memcg);
111int mem_cgroup_select_victim_node(struct mem_cgroup *memcg); 120int mem_cgroup_select_victim_node(struct mem_cgroup *memcg);
112unsigned long mem_cgroup_zone_nr_lru_pages(struct mem_cgroup *memcg, 121unsigned long mem_cgroup_zone_nr_lru_pages(struct mem_cgroup *memcg,
113 struct zone *zone, 122 int nid, int zid, unsigned int lrumask);
114 enum lru_list lru);
115struct zone_reclaim_stat *mem_cgroup_get_reclaim_stat(struct mem_cgroup *memcg, 123struct zone_reclaim_stat *mem_cgroup_get_reclaim_stat(struct mem_cgroup *memcg,
116 struct zone *zone); 124 struct zone *zone);
117struct zone_reclaim_stat* 125struct zone_reclaim_stat*
@@ -119,6 +127,15 @@ mem_cgroup_get_reclaim_stat_from_page(struct page *page);
119extern void mem_cgroup_print_oom_info(struct mem_cgroup *memcg, 127extern void mem_cgroup_print_oom_info(struct mem_cgroup *memcg,
120 struct task_struct *p); 128 struct task_struct *p);
121 129
130extern unsigned long try_to_free_mem_cgroup_pages(struct mem_cgroup *mem,
131 gfp_t gfp_mask, bool noswap,
132 struct memcg_scanrecord *rec);
133extern unsigned long mem_cgroup_shrink_node_zone(struct mem_cgroup *mem,
134 gfp_t gfp_mask, bool noswap,
135 struct zone *zone,
136 struct memcg_scanrecord *rec,
137 unsigned long *nr_scanned);
138
122#ifdef CONFIG_CGROUP_MEM_RES_CTLR_SWAP 139#ifdef CONFIG_CGROUP_MEM_RES_CTLR_SWAP
123extern int do_swap_account; 140extern int do_swap_account;
124#endif 141#endif
@@ -206,12 +223,6 @@ static inline void mem_cgroup_uncharge_cache_page(struct page *page)
206{ 223{
207} 224}
208 225
209static inline int mem_cgroup_shmem_charge_fallback(struct page *page,
210 struct mm_struct *mm, gfp_t gfp_mask)
211{
212 return 0;
213}
214
215static inline void mem_cgroup_add_lru_list(struct page *page, int lru) 226static inline void mem_cgroup_add_lru_list(struct page *page, int lru)
216{ 227{
217} 228}
@@ -246,6 +257,11 @@ static inline struct mem_cgroup *try_get_mem_cgroup_from_page(struct page *page)
246 return NULL; 257 return NULL;
247} 258}
248 259
260static inline struct mem_cgroup *try_get_mem_cgroup_from_mm(struct mm_struct *mm)
261{
262 return NULL;
263}
264
249static inline int mm_match_cgroup(struct mm_struct *mm, struct mem_cgroup *mem) 265static inline int mm_match_cgroup(struct mm_struct *mm, struct mem_cgroup *mem)
250{ 266{
251 return 1; 267 return 1;
@@ -307,8 +323,8 @@ mem_cgroup_inactive_file_is_low(struct mem_cgroup *memcg)
307} 323}
308 324
309static inline unsigned long 325static inline unsigned long
310mem_cgroup_zone_nr_lru_pages(struct mem_cgroup *memcg, struct zone *zone, 326mem_cgroup_zone_nr_lru_pages(struct mem_cgroup *memcg, int nid, int zid,
311 enum lru_list lru) 327 unsigned int lru_mask)
312{ 328{
313 return 0; 329 return 0;
314} 330}
diff --git a/include/linux/memory.h b/include/linux/memory.h
index e1e3b2b84f85..935699b30b7c 100644
--- a/include/linux/memory.h
+++ b/include/linux/memory.h
@@ -20,6 +20,8 @@
20#include <linux/compiler.h> 20#include <linux/compiler.h>
21#include <linux/mutex.h> 21#include <linux/mutex.h>
22 22
23#define MIN_MEMORY_BLOCK_SIZE (1 << SECTION_SIZE_BITS)
24
23struct memory_block { 25struct memory_block {
24 unsigned long start_section_nr; 26 unsigned long start_section_nr;
25 unsigned long end_section_nr; 27 unsigned long end_section_nr;
diff --git a/include/linux/memory_hotplug.h b/include/linux/memory_hotplug.h
index 8122018d3000..0b8e2a742600 100644
--- a/include/linux/memory_hotplug.h
+++ b/include/linux/memory_hotplug.h
@@ -68,12 +68,19 @@ static inline void zone_seqlock_init(struct zone *zone)
68extern int zone_grow_free_lists(struct zone *zone, unsigned long new_nr_pages); 68extern int zone_grow_free_lists(struct zone *zone, unsigned long new_nr_pages);
69extern int zone_grow_waitqueues(struct zone *zone, unsigned long nr_pages); 69extern int zone_grow_waitqueues(struct zone *zone, unsigned long nr_pages);
70extern int add_one_highpage(struct page *page, int pfn, int bad_ppro); 70extern int add_one_highpage(struct page *page, int pfn, int bad_ppro);
71/* need some defines for these for archs that don't support it */
72extern void online_page(struct page *page);
73/* VM interface that may be used by firmware interface */ 71/* VM interface that may be used by firmware interface */
74extern int online_pages(unsigned long, unsigned long); 72extern int online_pages(unsigned long, unsigned long);
75extern void __offline_isolated_pages(unsigned long, unsigned long); 73extern void __offline_isolated_pages(unsigned long, unsigned long);
76 74
75typedef void (*online_page_callback_t)(struct page *page);
76
77extern int set_online_page_callback(online_page_callback_t callback);
78extern int restore_online_page_callback(online_page_callback_t callback);
79
80extern void __online_page_set_limits(struct page *page);
81extern void __online_page_increment_counters(struct page *page);
82extern void __online_page_free(struct page *page);
83
77#ifdef CONFIG_MEMORY_HOTREMOVE 84#ifdef CONFIG_MEMORY_HOTREMOVE
78extern bool is_pageblock_removable_nolock(struct page *page); 85extern bool is_pageblock_removable_nolock(struct page *page);
79#endif /* CONFIG_MEMORY_HOTREMOVE */ 86#endif /* CONFIG_MEMORY_HOTREMOVE */
diff --git a/include/linux/mfd/aat2870.h b/include/linux/mfd/aat2870.h
new file mode 100644
index 000000000000..f7316c29bdec
--- /dev/null
+++ b/include/linux/mfd/aat2870.h
@@ -0,0 +1,181 @@
1/*
2 * linux/include/linux/mfd/aat2870.h
3 *
4 * Copyright (c) 2011, NVIDIA Corporation.
5 * Author: Jin Park <jinyoungp@nvidia.com>
6 *
7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License
9 * version 2 as 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
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
19 * 02110-1301 USA
20 */
21
22#ifndef __LINUX_MFD_AAT2870_H
23#define __LINUX_MFD_AAT2870_H
24
25#include <linux/debugfs.h>
26#include <linux/i2c.h>
27
28/* Register offsets */
29#define AAT2870_BL_CH_EN 0x00
30#define AAT2870_BLM 0x01
31#define AAT2870_BLS 0x02
32#define AAT2870_BL1 0x03
33#define AAT2870_BL2 0x04
34#define AAT2870_BL3 0x05
35#define AAT2870_BL4 0x06
36#define AAT2870_BL5 0x07
37#define AAT2870_BL6 0x08
38#define AAT2870_BL7 0x09
39#define AAT2870_BL8 0x0A
40#define AAT2870_FLR 0x0B
41#define AAT2870_FM 0x0C
42#define AAT2870_FS 0x0D
43#define AAT2870_ALS_CFG0 0x0E
44#define AAT2870_ALS_CFG1 0x0F
45#define AAT2870_ALS_CFG2 0x10
46#define AAT2870_AMB 0x11
47#define AAT2870_ALS0 0x12
48#define AAT2870_ALS1 0x13
49#define AAT2870_ALS2 0x14
50#define AAT2870_ALS3 0x15
51#define AAT2870_ALS4 0x16
52#define AAT2870_ALS5 0x17
53#define AAT2870_ALS6 0x18
54#define AAT2870_ALS7 0x19
55#define AAT2870_ALS8 0x1A
56#define AAT2870_ALS9 0x1B
57#define AAT2870_ALSA 0x1C
58#define AAT2870_ALSB 0x1D
59#define AAT2870_ALSC 0x1E
60#define AAT2870_ALSD 0x1F
61#define AAT2870_ALSE 0x20
62#define AAT2870_ALSF 0x21
63#define AAT2870_SUB_SET 0x22
64#define AAT2870_SUB_CTRL 0x23
65#define AAT2870_LDO_AB 0x24
66#define AAT2870_LDO_CD 0x25
67#define AAT2870_LDO_EN 0x26
68#define AAT2870_REG_NUM 0x27
69
70/* Device IDs */
71enum aat2870_id {
72 AAT2870_ID_BL,
73 AAT2870_ID_LDOA,
74 AAT2870_ID_LDOB,
75 AAT2870_ID_LDOC,
76 AAT2870_ID_LDOD
77};
78
79/* Backlight channels */
80#define AAT2870_BL_CH1 0x01
81#define AAT2870_BL_CH2 0x02
82#define AAT2870_BL_CH3 0x04
83#define AAT2870_BL_CH4 0x08
84#define AAT2870_BL_CH5 0x10
85#define AAT2870_BL_CH6 0x20
86#define AAT2870_BL_CH7 0x40
87#define AAT2870_BL_CH8 0x80
88#define AAT2870_BL_CH_ALL 0xFF
89
90/* Backlight current magnitude (mA) */
91enum aat2870_current {
92 AAT2870_CURRENT_0_45 = 1,
93 AAT2870_CURRENT_0_90,
94 AAT2870_CURRENT_1_80,
95 AAT2870_CURRENT_2_70,
96 AAT2870_CURRENT_3_60,
97 AAT2870_CURRENT_4_50,
98 AAT2870_CURRENT_5_40,
99 AAT2870_CURRENT_6_30,
100 AAT2870_CURRENT_7_20,
101 AAT2870_CURRENT_8_10,
102 AAT2870_CURRENT_9_00,
103 AAT2870_CURRENT_9_90,
104 AAT2870_CURRENT_10_8,
105 AAT2870_CURRENT_11_7,
106 AAT2870_CURRENT_12_6,
107 AAT2870_CURRENT_13_5,
108 AAT2870_CURRENT_14_4,
109 AAT2870_CURRENT_15_3,
110 AAT2870_CURRENT_16_2,
111 AAT2870_CURRENT_17_1,
112 AAT2870_CURRENT_18_0,
113 AAT2870_CURRENT_18_9,
114 AAT2870_CURRENT_19_8,
115 AAT2870_CURRENT_20_7,
116 AAT2870_CURRENT_21_6,
117 AAT2870_CURRENT_22_5,
118 AAT2870_CURRENT_23_4,
119 AAT2870_CURRENT_24_3,
120 AAT2870_CURRENT_25_2,
121 AAT2870_CURRENT_26_1,
122 AAT2870_CURRENT_27_0,
123 AAT2870_CURRENT_27_9
124};
125
126struct aat2870_register {
127 bool readable;
128 bool writeable;
129 u8 value;
130};
131
132struct aat2870_data {
133 struct device *dev;
134 struct i2c_client *client;
135
136 struct mutex io_lock;
137 struct aat2870_register *reg_cache; /* register cache */
138 int en_pin; /* enable GPIO pin (if < 0, ignore this value) */
139 bool is_enable;
140
141 /* init and uninit for platform specified */
142 int (*init)(struct aat2870_data *aat2870);
143 void (*uninit)(struct aat2870_data *aat2870);
144
145 /* i2c io funcntions */
146 int (*read)(struct aat2870_data *aat2870, u8 addr, u8 *val);
147 int (*write)(struct aat2870_data *aat2870, u8 addr, u8 val);
148 int (*update)(struct aat2870_data *aat2870, u8 addr, u8 mask, u8 val);
149
150 /* for debugfs */
151 struct dentry *dentry_root;
152 struct dentry *dentry_reg;
153};
154
155struct aat2870_subdev_info {
156 int id;
157 const char *name;
158 void *platform_data;
159};
160
161struct aat2870_platform_data {
162 int en_pin; /* enable GPIO pin (if < 0, ignore this value) */
163
164 struct aat2870_subdev_info *subdevs;
165 int num_subdevs;
166
167 /* init and uninit for platform specified */
168 int (*init)(struct aat2870_data *aat2870);
169 void (*uninit)(struct aat2870_data *aat2870);
170};
171
172struct aat2870_bl_platform_data {
173 /* backlight channels, default is AAT2870_BL_CH_ALL */
174 int channels;
175 /* backlight current magnitude, default is AAT2870_CURRENT_27_9 */
176 int max_current;
177 /* maximum brightness, default is 255 */
178 int max_brightness;
179};
180
181#endif /* __LINUX_MFD_AAT2870_H */
diff --git a/include/linux/mfd/ab8500.h b/include/linux/mfd/ab8500.h
index b31843075198..838c6b487cc5 100644
--- a/include/linux/mfd/ab8500.h
+++ b/include/linux/mfd/ab8500.h
@@ -28,6 +28,7 @@
28#define AB8500_INTERRUPT 0xE 28#define AB8500_INTERRUPT 0xE
29#define AB8500_RTC 0xF 29#define AB8500_RTC 0xF
30#define AB8500_MISC 0x10 30#define AB8500_MISC 0x10
31#define AB8500_DEVELOPMENT 0x11
31#define AB8500_DEBUG 0x12 32#define AB8500_DEBUG 0x12
32#define AB8500_PROD_TEST 0x13 33#define AB8500_PROD_TEST 0x13
33#define AB8500_OTP_EMUL 0x15 34#define AB8500_OTP_EMUL 0x15
@@ -74,13 +75,6 @@
74#define AB8500_INT_ACC_DETECT_21DB_F 37 75#define AB8500_INT_ACC_DETECT_21DB_F 37
75#define AB8500_INT_ACC_DETECT_21DB_R 38 76#define AB8500_INT_ACC_DETECT_21DB_R 38
76#define AB8500_INT_GP_SW_ADC_CONV_END 39 77#define AB8500_INT_GP_SW_ADC_CONV_END 39
77#define AB8500_INT_ACC_DETECT_1DB_F 33
78#define AB8500_INT_ACC_DETECT_1DB_R 34
79#define AB8500_INT_ACC_DETECT_22DB_F 35
80#define AB8500_INT_ACC_DETECT_22DB_R 36
81#define AB8500_INT_ACC_DETECT_21DB_F 37
82#define AB8500_INT_ACC_DETECT_21DB_R 38
83#define AB8500_INT_GP_SW_ADC_CONV_END 39
84#define AB8500_INT_GPIO6R 40 78#define AB8500_INT_GPIO6R 40
85#define AB8500_INT_GPIO7R 41 79#define AB8500_INT_GPIO7R 41
86#define AB8500_INT_GPIO8R 42 80#define AB8500_INT_GPIO8R 42
diff --git a/include/linux/mfd/ds1wm.h b/include/linux/mfd/ds1wm.h
index be469a357cbb..38a372a0e285 100644
--- a/include/linux/mfd/ds1wm.h
+++ b/include/linux/mfd/ds1wm.h
@@ -3,4 +3,11 @@
3struct ds1wm_driver_data { 3struct ds1wm_driver_data {
4 int active_high; 4 int active_high;
5 int clock_rate; 5 int clock_rate;
6 /* in milliseconds, the amount of time to */
7 /* sleep following a reset pulse. Zero */
8 /* should work if your bus devices recover*/
9 /* time respects the 1-wire spec since the*/
10 /* ds1wm implements the precise timings of*/
11 /* a reset pulse/presence detect sequence.*/
12 unsigned int reset_recover_delay;
6}; 13};
diff --git a/include/linux/mfd/max8997.h b/include/linux/mfd/max8997.h
index 60931d089422..0bbd13dbe336 100644
--- a/include/linux/mfd/max8997.h
+++ b/include/linux/mfd/max8997.h
@@ -107,11 +107,16 @@ struct max8997_platform_data {
107 unsigned int buck5_voltage[8]; 107 unsigned int buck5_voltage[8];
108 bool buck5_gpiodvs; 108 bool buck5_gpiodvs;
109 109
110 /* ---- Charger control ---- */
111 /* eoc stands for 'end of charge' */
112 int eoc_mA; /* 50 ~ 200mA by 10mA step */
113 /* charge Full Timeout */
114 int timeout; /* 0 (no timeout), 5, 6, 7 hours */
115
110 /* MUIC: Not implemented */ 116 /* MUIC: Not implemented */
111 /* HAPTIC: Not implemented */ 117 /* HAPTIC: Not implemented */
112 /* RTC: Not implemented */ 118 /* RTC: Not implemented */
113 /* Flash: Not implemented */ 119 /* Flash: Not implemented */
114 /* Charger control: Not implemented */
115}; 120};
116 121
117#endif /* __LINUX_MFD_MAX8998_H */ 122#endif /* __LINUX_MFD_MAX8998_H */
diff --git a/include/linux/mfd/max8998.h b/include/linux/mfd/max8998.h
index 61daa167b576..f4f0dfa4698a 100644
--- a/include/linux/mfd/max8998.h
+++ b/include/linux/mfd/max8998.h
@@ -87,6 +87,15 @@ struct max8998_regulator_data {
87 * @wakeup: Allow to wake up from suspend 87 * @wakeup: Allow to wake up from suspend
88 * @rtc_delay: LP3974 RTC chip bug that requires delay after a register 88 * @rtc_delay: LP3974 RTC chip bug that requires delay after a register
89 * write before reading it. 89 * write before reading it.
90 * @eoc: End of Charge Level in percent: 10% ~ 45% by 5% step
91 * If it equals 0, leave it unchanged.
92 * Otherwise, it is a invalid value.
93 * @restart: Restart Level in mV: 100, 150, 200, and -1 for disable.
94 * If it equals 0, leave it unchanged.
95 * Otherwise, it is a invalid value.
96 * @timeout: Full Timeout in hours: 5, 6, 7, and -1 for disable.
97 * If it equals 0, leave it unchanged.
98 * Otherwise, leave it unchanged.
90 */ 99 */
91struct max8998_platform_data { 100struct max8998_platform_data {
92 struct max8998_regulator_data *regulators; 101 struct max8998_regulator_data *regulators;
@@ -107,6 +116,9 @@ struct max8998_platform_data {
107 int buck2_default_idx; 116 int buck2_default_idx;
108 bool wakeup; 117 bool wakeup;
109 bool rtc_delay; 118 bool rtc_delay;
119 int eoc;
120 int restart;
121 int timeout;
110}; 122};
111 123
112#endif /* __LINUX_MFD_MAX8998_H */ 124#endif /* __LINUX_MFD_MAX8998_H */
diff --git a/include/linux/mfd/pm8xxx/rtc.h b/include/linux/mfd/pm8xxx/rtc.h
new file mode 100644
index 000000000000..14f1983eaecc
--- /dev/null
+++ b/include/linux/mfd/pm8xxx/rtc.h
@@ -0,0 +1,25 @@
1/* Copyright (c) 2010-2011, Code Aurora Forum. All rights reserved.
2 *
3 * This program is free software; you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License version 2 and
5 * only version 2 as published by the Free Software Foundation.
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
13#ifndef __RTC_PM8XXX_H__
14#define __RTC_PM8XXX_H__
15
16#define PM8XXX_RTC_DEV_NAME "rtc-pm8xxx"
17/**
18 * struct pm8xxx_rtc_pdata - RTC driver platform data
19 * @rtc_write_enable: variable stating RTC write capability
20 */
21struct pm8xxx_rtc_platform_data {
22 bool rtc_write_enable;
23};
24
25#endif /* __RTC_PM8XXX_H__ */
diff --git a/include/linux/mfd/stmpe.h b/include/linux/mfd/stmpe.h
index e762c270d8d4..be1af7c42e57 100644
--- a/include/linux/mfd/stmpe.h
+++ b/include/linux/mfd/stmpe.h
@@ -57,6 +57,7 @@ struct stmpe_variant_info;
57 * @irq_lock: IRQ bus lock 57 * @irq_lock: IRQ bus lock
58 * @dev: device, mostly for dev_dbg() 58 * @dev: device, mostly for dev_dbg()
59 * @i2c: i2c client 59 * @i2c: i2c client
60 * @partnum: part number
60 * @variant: the detected STMPE model number 61 * @variant: the detected STMPE model number
61 * @regs: list of addresses of registers which are at different addresses on 62 * @regs: list of addresses of registers which are at different addresses on
62 * different variants. Indexed by one of STMPE_IDX_*. 63 * different variants. Indexed by one of STMPE_IDX_*.
@@ -121,6 +122,8 @@ struct stmpe_keypad_platform_data {
121 * @norequest_mask: bitmask specifying which GPIOs should _not_ be 122 * @norequest_mask: bitmask specifying which GPIOs should _not_ be
122 * requestable due to different usage (e.g. touch, keypad) 123 * requestable due to different usage (e.g. touch, keypad)
123 * STMPE_GPIO_NOREQ_* macros can be used here. 124 * STMPE_GPIO_NOREQ_* macros can be used here.
125 * @setup: board specific setup callback.
126 * @remove: board specific remove callback
124 */ 127 */
125struct stmpe_gpio_platform_data { 128struct stmpe_gpio_platform_data {
126 int gpio_base; 129 int gpio_base;
diff --git a/include/linux/mfd/tmio.h b/include/linux/mfd/tmio.h
index 5a90266c3a5a..0dc98044d8b7 100644
--- a/include/linux/mfd/tmio.h
+++ b/include/linux/mfd/tmio.h
@@ -68,6 +68,11 @@
68 * controller and report the event to the driver. 68 * controller and report the event to the driver.
69 */ 69 */
70#define TMIO_MMC_HAS_COLD_CD (1 << 3) 70#define TMIO_MMC_HAS_COLD_CD (1 << 3)
71/*
72 * Some controllers require waiting for the SD bus to become
73 * idle before writing to some registers.
74 */
75#define TMIO_MMC_HAS_IDLE_WAIT (1 << 4)
71 76
72int tmio_core_mmc_enable(void __iomem *cnf, int shift, unsigned long base); 77int tmio_core_mmc_enable(void __iomem *cnf, int shift, unsigned long base);
73int tmio_core_mmc_resume(void __iomem *cnf, int shift, unsigned long base); 78int tmio_core_mmc_resume(void __iomem *cnf, int shift, unsigned long base);
@@ -80,6 +85,8 @@ struct tmio_mmc_dma {
80 int alignment_shift; 85 int alignment_shift;
81}; 86};
82 87
88struct tmio_mmc_host;
89
83/* 90/*
84 * data for the MMC controller 91 * data for the MMC controller
85 */ 92 */
@@ -94,6 +101,7 @@ struct tmio_mmc_data {
94 void (*set_pwr)(struct platform_device *host, int state); 101 void (*set_pwr)(struct platform_device *host, int state);
95 void (*set_clk_div)(struct platform_device *host, int state); 102 void (*set_clk_div)(struct platform_device *host, int state);
96 int (*get_cd)(struct platform_device *host); 103 int (*get_cd)(struct platform_device *host);
104 int (*write16_hook)(struct tmio_mmc_host *host, int addr);
97}; 105};
98 106
99static inline void tmio_mmc_cd_wakeup(struct tmio_mmc_data *pdata) 107static inline void tmio_mmc_cd_wakeup(struct tmio_mmc_data *pdata)
diff --git a/include/linux/mfd/tps65910.h b/include/linux/mfd/tps65910.h
index 8bb85b930c07..82b4c8801a4f 100644
--- a/include/linux/mfd/tps65910.h
+++ b/include/linux/mfd/tps65910.h
@@ -269,7 +269,7 @@
269#define LDO1_SEL_MASK 0xFC 269#define LDO1_SEL_MASK 0xFC
270#define LDO3_SEL_MASK 0x7C 270#define LDO3_SEL_MASK 0x7C
271#define LDO_MIN_VOLT 1000 271#define LDO_MIN_VOLT 1000
272#define LDO_MAX_VOLT 3300; 272#define LDO_MAX_VOLT 3300
273 273
274 274
275/*Register VDIG1 (0x80) register.RegisterDescription */ 275/*Register VDIG1 (0x80) register.RegisterDescription */
@@ -791,6 +791,7 @@ int tps65910_clear_bits(struct tps65910 *tps65910, u8 reg, u8 mask);
791void tps65910_gpio_init(struct tps65910 *tps65910, int gpio_base); 791void tps65910_gpio_init(struct tps65910 *tps65910, int gpio_base);
792int tps65910_irq_init(struct tps65910 *tps65910, int irq, 792int tps65910_irq_init(struct tps65910 *tps65910, int irq,
793 struct tps65910_platform_data *pdata); 793 struct tps65910_platform_data *pdata);
794int tps65910_irq_exit(struct tps65910 *tps65910);
794 795
795static inline int tps65910_chip_id(struct tps65910 *tps65910) 796static inline int tps65910_chip_id(struct tps65910 *tps65910)
796{ 797{
diff --git a/include/linux/mfd/tps65912.h b/include/linux/mfd/tps65912.h
new file mode 100644
index 000000000000..aaceab402ec5
--- /dev/null
+++ b/include/linux/mfd/tps65912.h
@@ -0,0 +1,327 @@
1/*
2 * tps65912.h -- TI TPS6591x
3 *
4 * Copyright 2011 Texas Instruments Inc.
5 *
6 * Author: Margarita Olaya <magi@slimlogic.co.uk>
7 *
8 * This program is free software; you can redistribute it and/or modify it
9 * under the terms of the GNU General Public License as published by the
10 * Free Software Foundation; either version 2 of the License, or (at your
11 * option) any later version.
12 *
13 */
14
15#ifndef __LINUX_MFD_TPS65912_H
16#define __LINUX_MFD_TPS65912_H
17
18/* TPS regulator type list */
19#define REGULATOR_LDO 0
20#define REGULATOR_DCDC 1
21
22/*
23 * List of registers for TPS65912
24 */
25
26#define TPS65912_DCDC1_CTRL 0x00
27#define TPS65912_DCDC2_CTRL 0x01
28#define TPS65912_DCDC3_CTRL 0x02
29#define TPS65912_DCDC4_CTRL 0x03
30#define TPS65912_DCDC1_OP 0x04
31#define TPS65912_DCDC1_AVS 0x05
32#define TPS65912_DCDC1_LIMIT 0x06
33#define TPS65912_DCDC2_OP 0x07
34#define TPS65912_DCDC2_AVS 0x08
35#define TPS65912_DCDC2_LIMIT 0x09
36#define TPS65912_DCDC3_OP 0x0A
37#define TPS65912_DCDC3_AVS 0x0B
38#define TPS65912_DCDC3_LIMIT 0x0C
39#define TPS65912_DCDC4_OP 0x0D
40#define TPS65912_DCDC4_AVS 0x0E
41#define TPS65912_DCDC4_LIMIT 0x0F
42#define TPS65912_LDO1_OP 0x10
43#define TPS65912_LDO1_AVS 0x11
44#define TPS65912_LDO1_LIMIT 0x12
45#define TPS65912_LDO2_OP 0x13
46#define TPS65912_LDO2_AVS 0x14
47#define TPS65912_LDO2_LIMIT 0x15
48#define TPS65912_LDO3_OP 0x16
49#define TPS65912_LDO3_AVS 0x17
50#define TPS65912_LDO3_LIMIT 0x18
51#define TPS65912_LDO4_OP 0x19
52#define TPS65912_LDO4_AVS 0x1A
53#define TPS65912_LDO4_LIMIT 0x1B
54#define TPS65912_LDO5 0x1C
55#define TPS65912_LDO6 0x1D
56#define TPS65912_LDO7 0x1E
57#define TPS65912_LDO8 0x1F
58#define TPS65912_LDO9 0x20
59#define TPS65912_LDO10 0x21
60#define TPS65912_THRM 0x22
61#define TPS65912_CLK32OUT 0x23
62#define TPS65912_DEVCTRL 0x24
63#define TPS65912_DEVCTRL2 0x25
64#define TPS65912_I2C_SPI_CFG 0x26
65#define TPS65912_KEEP_ON 0x27
66#define TPS65912_KEEP_ON2 0x28
67#define TPS65912_SET_OFF1 0x29
68#define TPS65912_SET_OFF2 0x2A
69#define TPS65912_DEF_VOLT 0x2B
70#define TPS65912_DEF_VOLT_MAPPING 0x2C
71#define TPS65912_DISCHARGE 0x2D
72#define TPS65912_DISCHARGE2 0x2E
73#define TPS65912_EN1_SET1 0x2F
74#define TPS65912_EN1_SET2 0x30
75#define TPS65912_EN2_SET1 0x31
76#define TPS65912_EN2_SET2 0x32
77#define TPS65912_EN3_SET1 0x33
78#define TPS65912_EN3_SET2 0x34
79#define TPS65912_EN4_SET1 0x35
80#define TPS65912_EN4_SET2 0x36
81#define TPS65912_PGOOD 0x37
82#define TPS65912_PGOOD2 0x38
83#define TPS65912_INT_STS 0x39
84#define TPS65912_INT_MSK 0x3A
85#define TPS65912_INT_STS2 0x3B
86#define TPS65912_INT_MSK2 0x3C
87#define TPS65912_INT_STS3 0x3D
88#define TPS65912_INT_MSK3 0x3E
89#define TPS65912_INT_STS4 0x3F
90#define TPS65912_INT_MSK4 0x40
91#define TPS65912_GPIO1 0x41
92#define TPS65912_GPIO2 0x42
93#define TPS65912_GPIO3 0x43
94#define TPS65912_GPIO4 0x44
95#define TPS65912_GPIO5 0x45
96#define TPS65912_VMON 0x46
97#define TPS65912_LEDA_CTRL1 0x47
98#define TPS65912_LEDA_CTRL2 0x48
99#define TPS65912_LEDA_CTRL3 0x49
100#define TPS65912_LEDA_CTRL4 0x4A
101#define TPS65912_LEDA_CTRL5 0x4B
102#define TPS65912_LEDA_CTRL6 0x4C
103#define TPS65912_LEDA_CTRL7 0x4D
104#define TPS65912_LEDA_CTRL8 0x4E
105#define TPS65912_LEDB_CTRL1 0x4F
106#define TPS65912_LEDB_CTRL2 0x50
107#define TPS65912_LEDB_CTRL3 0x51
108#define TPS65912_LEDB_CTRL4 0x52
109#define TPS65912_LEDB_CTRL5 0x53
110#define TPS65912_LEDB_CTRL6 0x54
111#define TPS65912_LEDB_CTRL7 0x55
112#define TPS65912_LEDB_CTRL8 0x56
113#define TPS65912_LEDC_CTRL1 0x57
114#define TPS65912_LEDC_CTRL2 0x58
115#define TPS65912_LEDC_CTRL3 0x59
116#define TPS65912_LEDC_CTRL4 0x5A
117#define TPS65912_LEDC_CTRL5 0x5B
118#define TPS65912_LEDC_CTRL6 0x5C
119#define TPS65912_LEDC_CTRL7 0x5D
120#define TPS65912_LEDC_CTRL8 0x5E
121#define TPS65912_LED_RAMP_UP_TIME 0x5F
122#define TPS65912_LED_RAMP_DOWN_TIME 0x60
123#define TPS65912_LED_SEQ_EN 0x61
124#define TPS65912_LOADSWITCH 0x62
125#define TPS65912_SPARE 0x63
126#define TPS65912_VERNUM 0x64
127#define TPS6591X_MAX_REGISTER 0x64
128
129/* IRQ Definitions */
130#define TPS65912_IRQ_PWRHOLD_F 0
131#define TPS65912_IRQ_VMON 1
132#define TPS65912_IRQ_PWRON 2
133#define TPS65912_IRQ_PWRON_LP 3
134#define TPS65912_IRQ_PWRHOLD_R 4
135#define TPS65912_IRQ_HOTDIE 5
136#define TPS65912_IRQ_GPIO1_R 6
137#define TPS65912_IRQ_GPIO1_F 7
138#define TPS65912_IRQ_GPIO2_R 8
139#define TPS65912_IRQ_GPIO2_F 9
140#define TPS65912_IRQ_GPIO3_R 10
141#define TPS65912_IRQ_GPIO3_F 11
142#define TPS65912_IRQ_GPIO4_R 12
143#define TPS65912_IRQ_GPIO4_F 13
144#define TPS65912_IRQ_GPIO5_R 14
145#define TPS65912_IRQ_GPIO5_F 15
146#define TPS65912_IRQ_PGOOD_DCDC1 16
147#define TPS65912_IRQ_PGOOD_DCDC2 17
148#define TPS65912_IRQ_PGOOD_DCDC3 18
149#define TPS65912_IRQ_PGOOD_DCDC4 19
150#define TPS65912_IRQ_PGOOD_LDO1 20
151#define TPS65912_IRQ_PGOOD_LDO2 21
152#define TPS65912_IRQ_PGOOD_LDO3 22
153#define TPS65912_IRQ_PGOOD_LDO4 23
154#define TPS65912_IRQ_PGOOD_LDO5 24
155#define TPS65912_IRQ_PGOOD_LDO6 25
156#define TPS65912_IRQ_PGOOD_LDO7 26
157#define TPS65912_IRQ_PGOOD_LD08 27
158#define TPS65912_IRQ_PGOOD_LDO9 28
159#define TPS65912_IRQ_PGOOD_LDO10 29
160
161#define TPS65912_NUM_IRQ 30
162
163/* GPIO 1 and 2 Register Definitions */
164#define GPIO_SLEEP_MASK 0x80
165#define GPIO_SLEEP_SHIFT 7
166#define GPIO_DEB_MASK 0x10
167#define GPIO_DEB_SHIFT 4
168#define GPIO_CFG_MASK 0x04
169#define GPIO_CFG_SHIFT 2
170#define GPIO_STS_MASK 0x02
171#define GPIO_STS_SHIFT 1
172#define GPIO_SET_MASK 0x01
173#define GPIO_SET_SHIFT 0
174
175/* GPIO 3 Register Definitions */
176#define GPIO3_SLEEP_MASK 0x80
177#define GPIO3_SLEEP_SHIFT 7
178#define GPIO3_SEL_MASK 0x40
179#define GPIO3_SEL_SHIFT 6
180#define GPIO3_ODEN_MASK 0x20
181#define GPIO3_ODEN_SHIFT 5
182#define GPIO3_DEB_MASK 0x10
183#define GPIO3_DEB_SHIFT 4
184#define GPIO3_PDEN_MASK 0x08
185#define GPIO3_PDEN_SHIFT 3
186#define GPIO3_CFG_MASK 0x04
187#define GPIO3_CFG_SHIFT 2
188#define GPIO3_STS_MASK 0x02
189#define GPIO3_STS_SHIFT 1
190#define GPIO3_SET_MASK 0x01
191#define GPIO3_SET_SHIFT 0
192
193/* GPIO 4 Register Definitions */
194#define GPIO4_SLEEP_MASK 0x80
195#define GPIO4_SLEEP_SHIFT 7
196#define GPIO4_SEL_MASK 0x40
197#define GPIO4_SEL_SHIFT 6
198#define GPIO4_ODEN_MASK 0x20
199#define GPIO4_ODEN_SHIFT 5
200#define GPIO4_DEB_MASK 0x10
201#define GPIO4_DEB_SHIFT 4
202#define GPIO4_PDEN_MASK 0x08
203#define GPIO4_PDEN_SHIFT 3
204#define GPIO4_CFG_MASK 0x04
205#define GPIO4_CFG_SHIFT 2
206#define GPIO4_STS_MASK 0x02
207#define GPIO4_STS_SHIFT 1
208#define GPIO4_SET_MASK 0x01
209#define GPIO4_SET_SHIFT 0
210
211/* Register THERM (0x80) register.RegisterDescription */
212#define THERM_THERM_HD_MASK 0x20
213#define THERM_THERM_HD_SHIFT 5
214#define THERM_THERM_TS_MASK 0x10
215#define THERM_THERM_TS_SHIFT 4
216#define THERM_THERM_HDSEL_MASK 0x0C
217#define THERM_THERM_HDSEL_SHIFT 2
218#define THERM_RSVD1_MASK 0x02
219#define THERM_RSVD1_SHIFT 1
220#define THERM_THERM_STATE_MASK 0x01
221#define THERM_THERM_STATE_SHIFT 0
222
223/* Register DCDCCTRL1 register.RegisterDescription */
224#define DCDCCTRL_VCON_ENABLE_MASK 0x80
225#define DCDCCTRL_VCON_ENABLE_SHIFT 7
226#define DCDCCTRL_VCON_RANGE1_MASK 0x40
227#define DCDCCTRL_VCON_RANGE1_SHIFT 6
228#define DCDCCTRL_VCON_RANGE0_MASK 0x20
229#define DCDCCTRL_VCON_RANGE0_SHIFT 5
230#define DCDCCTRL_TSTEP2_MASK 0x10
231#define DCDCCTRL_TSTEP2_SHIFT 4
232#define DCDCCTRL_TSTEP1_MASK 0x08
233#define DCDCCTRL_TSTEP1_SHIFT 3
234#define DCDCCTRL_TSTEP0_MASK 0x04
235#define DCDCCTRL_TSTEP0_SHIFT 2
236#define DCDCCTRL_DCDC1_MODE_MASK 0x02
237#define DCDCCTRL_DCDC1_MODE_SHIFT 1
238
239/* Register DCDCCTRL2 and DCDCCTRL3 register.RegisterDescription */
240#define DCDCCTRL_TSTEP2_MASK 0x10
241#define DCDCCTRL_TSTEP2_SHIFT 4
242#define DCDCCTRL_TSTEP1_MASK 0x08
243#define DCDCCTRL_TSTEP1_SHIFT 3
244#define DCDCCTRL_TSTEP0_MASK 0x04
245#define DCDCCTRL_TSTEP0_SHIFT 2
246#define DCDCCTRL_DCDC_MODE_MASK 0x02
247#define DCDCCTRL_DCDC_MODE_SHIFT 1
248#define DCDCCTRL_RSVD0_MASK 0x01
249#define DCDCCTRL_RSVD0_SHIFT 0
250
251/* Register DCDCCTRL4 register.RegisterDescription */
252#define DCDCCTRL_RAMP_TIME_MASK 0x01
253#define DCDCCTRL_RAMP_TIME_SHIFT 0
254
255/* Register DCDCx_AVS */
256#define DCDC_AVS_ENABLE_MASK 0x80
257#define DCDC_AVS_ENABLE_SHIFT 7
258#define DCDC_AVS_ECO_MASK 0x40
259#define DCDC_AVS_ECO_SHIFT 6
260
261/* Register DCDCx_LIMIT */
262#define DCDC_LIMIT_RANGE_MASK 0xC0
263#define DCDC_LIMIT_RANGE_SHIFT 6
264#define DCDC_LIMIT_MAX_SEL_MASK 0x3F
265#define DCDC_LIMIT_MAX_SEL_SHIFT 0
266
267/**
268 * struct tps65912_board
269 * Board platform dat may be used to initialize regulators.
270 */
271struct tps65912_board {
272 int is_dcdc1_avs;
273 int is_dcdc2_avs;
274 int is_dcdc3_avs;
275 int is_dcdc4_avs;
276 int irq;
277 int irq_base;
278 int gpio_base;
279 struct regulator_init_data *tps65912_pmic_init_data;
280};
281
282/**
283 * struct tps65912 - tps65912 sub-driver chip access routines
284 */
285
286struct tps65912 {
287 struct device *dev;
288 /* for read/write acces */
289 struct mutex io_mutex;
290
291 /* For device IO interfaces: I2C or SPI */
292 void *control_data;
293
294 int (*read)(struct tps65912 *tps65912, u8 reg, int size, void *dest);
295 int (*write)(struct tps65912 *tps65912, u8 reg, int size, void *src);
296
297 /* Client devices */
298 struct tps65912_pmic *pmic;
299
300 /* GPIO Handling */
301 struct gpio_chip gpio;
302
303 /* IRQ Handling */
304 struct mutex irq_lock;
305 int chip_irq;
306 int irq_base;
307 int irq_num;
308 u32 irq_mask;
309};
310
311struct tps65912_platform_data {
312 int irq;
313 int irq_base;
314};
315
316unsigned int tps_chip(void);
317
318int tps65912_set_bits(struct tps65912 *tps65912, u8 reg, u8 mask);
319int tps65912_clear_bits(struct tps65912 *tps65912, u8 reg, u8 mask);
320int tps65912_reg_read(struct tps65912 *tps65912, u8 reg);
321int tps65912_reg_write(struct tps65912 *tps65912, u8 reg, u8 val);
322int tps65912_device_init(struct tps65912 *tps65912);
323void tps65912_device_exit(struct tps65912 *tps65912);
324int tps65912_irq_init(struct tps65912 *tps65912, int irq,
325 struct tps65912_platform_data *pdata);
326
327#endif /* __LINUX_MFD_TPS65912_H */
diff --git a/include/linux/mfd/twl4030-codec.h b/include/linux/mfd/twl4030-audio.h
index 5cc16bbd1da1..3d22b72df076 100644
--- a/include/linux/mfd/twl4030-codec.h
+++ b/include/linux/mfd/twl4030-audio.h
@@ -1,5 +1,5 @@
1/* 1/*
2 * MFD driver for twl4030 codec submodule 2 * MFD driver for twl4030 audio submodule
3 * 3 *
4 * Author: Peter Ujfalusi <peter.ujfalusi@ti.com> 4 * Author: Peter Ujfalusi <peter.ujfalusi@ti.com>
5 * 5 *
@@ -259,14 +259,14 @@
259#define TWL4030_VIBRA_DIR_SEL 0x20 259#define TWL4030_VIBRA_DIR_SEL 0x20
260 260
261/* TWL4030 codec resource IDs */ 261/* TWL4030 codec resource IDs */
262enum twl4030_codec_res { 262enum twl4030_audio_res {
263 TWL4030_CODEC_RES_POWER = 0, 263 TWL4030_AUDIO_RES_POWER = 0,
264 TWL4030_CODEC_RES_APLL, 264 TWL4030_AUDIO_RES_APLL,
265 TWL4030_CODEC_RES_MAX, 265 TWL4030_AUDIO_RES_MAX,
266}; 266};
267 267
268int twl4030_codec_disable_resource(enum twl4030_codec_res id); 268int twl4030_audio_disable_resource(enum twl4030_audio_res id);
269int twl4030_codec_enable_resource(enum twl4030_codec_res id); 269int twl4030_audio_enable_resource(enum twl4030_audio_res id);
270unsigned int twl4030_codec_get_mclk(void); 270unsigned int twl4030_audio_get_mclk(void);
271 271
272#endif /* End of __TWL4030_CODEC_H__ */ 272#endif /* End of __TWL4030_CODEC_H__ */
diff --git a/include/linux/mfd/twl6040.h b/include/linux/mfd/twl6040.h
new file mode 100644
index 000000000000..4c806f6d663e
--- /dev/null
+++ b/include/linux/mfd/twl6040.h
@@ -0,0 +1,228 @@
1/*
2 * MFD driver for twl6040
3 *
4 * Authors: Jorge Eduardo Candelaria <jorge.candelaria@ti.com>
5 * Misael Lopez Cruz <misael.lopez@ti.com>
6 *
7 * Copyright: (C) 2011 Texas Instruments, Inc.
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 * This program is distributed in the hope that it will be useful, but
14 * WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
21 * 02110-1301 USA
22 *
23 */
24
25#ifndef __TWL6040_CODEC_H__
26#define __TWL6040_CODEC_H__
27
28#include <linux/interrupt.h>
29#include <linux/mfd/core.h>
30
31#define TWL6040_REG_ASICID 0x01
32#define TWL6040_REG_ASICREV 0x02
33#define TWL6040_REG_INTID 0x03
34#define TWL6040_REG_INTMR 0x04
35#define TWL6040_REG_NCPCTL 0x05
36#define TWL6040_REG_LDOCTL 0x06
37#define TWL6040_REG_HPPLLCTL 0x07
38#define TWL6040_REG_LPPLLCTL 0x08
39#define TWL6040_REG_LPPLLDIV 0x09
40#define TWL6040_REG_AMICBCTL 0x0A
41#define TWL6040_REG_DMICBCTL 0x0B
42#define TWL6040_REG_MICLCTL 0x0C
43#define TWL6040_REG_MICRCTL 0x0D
44#define TWL6040_REG_MICGAIN 0x0E
45#define TWL6040_REG_LINEGAIN 0x0F
46#define TWL6040_REG_HSLCTL 0x10
47#define TWL6040_REG_HSRCTL 0x11
48#define TWL6040_REG_HSGAIN 0x12
49#define TWL6040_REG_EARCTL 0x13
50#define TWL6040_REG_HFLCTL 0x14
51#define TWL6040_REG_HFLGAIN 0x15
52#define TWL6040_REG_HFRCTL 0x16
53#define TWL6040_REG_HFRGAIN 0x17
54#define TWL6040_REG_VIBCTLL 0x18
55#define TWL6040_REG_VIBDATL 0x19
56#define TWL6040_REG_VIBCTLR 0x1A
57#define TWL6040_REG_VIBDATR 0x1B
58#define TWL6040_REG_HKCTL1 0x1C
59#define TWL6040_REG_HKCTL2 0x1D
60#define TWL6040_REG_GPOCTL 0x1E
61#define TWL6040_REG_ALB 0x1F
62#define TWL6040_REG_DLB 0x20
63#define TWL6040_REG_TRIM1 0x28
64#define TWL6040_REG_TRIM2 0x29
65#define TWL6040_REG_TRIM3 0x2A
66#define TWL6040_REG_HSOTRIM 0x2B
67#define TWL6040_REG_HFOTRIM 0x2C
68#define TWL6040_REG_ACCCTL 0x2D
69#define TWL6040_REG_STATUS 0x2E
70
71#define TWL6040_CACHEREGNUM (TWL6040_REG_STATUS + 1)
72
73#define TWL6040_VIOREGNUM 18
74#define TWL6040_VDDREGNUM 21
75
76/* INTID (0x03) fields */
77
78#define TWL6040_THINT 0x01
79#define TWL6040_PLUGINT 0x02
80#define TWL6040_UNPLUGINT 0x04
81#define TWL6040_HOOKINT 0x08
82#define TWL6040_HFINT 0x10
83#define TWL6040_VIBINT 0x20
84#define TWL6040_READYINT 0x40
85
86/* INTMR (0x04) fields */
87
88#define TWL6040_THMSK 0x01
89#define TWL6040_PLUGMSK 0x02
90#define TWL6040_HOOKMSK 0x08
91#define TWL6040_HFMSK 0x10
92#define TWL6040_VIBMSK 0x20
93#define TWL6040_READYMSK 0x40
94#define TWL6040_ALLINT_MSK 0x7B
95
96/* NCPCTL (0x05) fields */
97
98#define TWL6040_NCPENA 0x01
99#define TWL6040_NCPOPEN 0x40
100
101/* LDOCTL (0x06) fields */
102
103#define TWL6040_LSLDOENA 0x01
104#define TWL6040_HSLDOENA 0x04
105#define TWL6040_REFENA 0x40
106#define TWL6040_OSCENA 0x80
107
108/* HPPLLCTL (0x07) fields */
109
110#define TWL6040_HPLLENA 0x01
111#define TWL6040_HPLLRST 0x02
112#define TWL6040_HPLLBP 0x04
113#define TWL6040_HPLLSQRENA 0x08
114#define TWL6040_MCLK_12000KHZ (0 << 5)
115#define TWL6040_MCLK_19200KHZ (1 << 5)
116#define TWL6040_MCLK_26000KHZ (2 << 5)
117#define TWL6040_MCLK_38400KHZ (3 << 5)
118#define TWL6040_MCLK_MSK 0x60
119
120/* LPPLLCTL (0x08) fields */
121
122#define TWL6040_LPLLENA 0x01
123#define TWL6040_LPLLRST 0x02
124#define TWL6040_LPLLSEL 0x04
125#define TWL6040_LPLLFIN 0x08
126#define TWL6040_HPLLSEL 0x10
127
128/* HSLCTL (0x10) fields */
129
130#define TWL6040_HSDACMODEL 0x02
131#define TWL6040_HSDRVMODEL 0x08
132
133/* HSRCTL (0x11) fields */
134
135#define TWL6040_HSDACMODER 0x02
136#define TWL6040_HSDRVMODER 0x08
137
138/* VIBCTLL (0x18) fields */
139
140#define TWL6040_VIBENAL 0x01
141#define TWL6040_VIBCTRLL 0x04
142#define TWL6040_VIBCTRLLP 0x08
143#define TWL6040_VIBCTRLLN 0x10
144
145/* VIBDATL (0x19) fields */
146
147#define TWL6040_VIBDAT_MAX 0x64
148
149/* VIBCTLR (0x1A) fields */
150
151#define TWL6040_VIBENAR 0x01
152#define TWL6040_VIBCTRLR 0x04
153#define TWL6040_VIBCTRLRP 0x08
154#define TWL6040_VIBCTRLRN 0x10
155
156/* GPOCTL (0x1E) fields */
157
158#define TWL6040_GPO1 0x01
159#define TWL6040_GPO2 0x02
160#define TWL6040_GPO3 0x03
161
162/* ACCCTL (0x2D) fields */
163
164#define TWL6040_I2CSEL 0x01
165#define TWL6040_RESETSPLIT 0x04
166#define TWL6040_INTCLRMODE 0x08
167
168/* STATUS (0x2E) fields */
169
170#define TWL6040_PLUGCOMP 0x02
171#define TWL6040_VIBLOCDET 0x10
172#define TWL6040_VIBROCDET 0x20
173#define TWL6040_TSHUTDET 0x40
174
175#define TWL6040_CELLS 2
176
177#define TWL6040_REV_ES1_0 0x00
178#define TWL6040_REV_ES1_1 0x01
179#define TWL6040_REV_ES1_2 0x02
180
181#define TWL6040_IRQ_TH 0
182#define TWL6040_IRQ_PLUG 1
183#define TWL6040_IRQ_HOOK 2
184#define TWL6040_IRQ_HF 3
185#define TWL6040_IRQ_VIB 4
186#define TWL6040_IRQ_READY 5
187
188/* PLL selection */
189#define TWL6040_SYSCLK_SEL_LPPLL 0
190#define TWL6040_SYSCLK_SEL_HPPLL 1
191
192struct twl6040 {
193 struct device *dev;
194 struct mutex mutex;
195 struct mutex io_mutex;
196 struct mutex irq_mutex;
197 struct mfd_cell cells[TWL6040_CELLS];
198 struct completion ready;
199
200 int audpwron;
201 int power_count;
202 int rev;
203
204 int pll;
205 unsigned int sysclk;
206
207 unsigned int irq;
208 unsigned int irq_base;
209 u8 irq_masks_cur;
210 u8 irq_masks_cache;
211};
212
213int twl6040_reg_read(struct twl6040 *twl6040, unsigned int reg);
214int twl6040_reg_write(struct twl6040 *twl6040, unsigned int reg,
215 u8 val);
216int twl6040_set_bits(struct twl6040 *twl6040, unsigned int reg,
217 u8 mask);
218int twl6040_clear_bits(struct twl6040 *twl6040, unsigned int reg,
219 u8 mask);
220int twl6040_power(struct twl6040 *twl6040, int on);
221int twl6040_set_pll(struct twl6040 *twl6040, int pll_id,
222 unsigned int freq_in, unsigned int freq_out);
223int twl6040_get_pll(struct twl6040 *twl6040);
224unsigned int twl6040_get_sysclk(struct twl6040 *twl6040);
225int twl6040_irq_init(struct twl6040 *twl6040);
226void twl6040_irq_exit(struct twl6040 *twl6040);
227
228#endif /* End of __TWL6040_CODEC_H__ */
diff --git a/include/linux/mfd/wm831x/core.h b/include/linux/mfd/wm831x/core.h
index 0d515ee1c247..8dda8ded5cda 100644
--- a/include/linux/mfd/wm831x/core.h
+++ b/include/linux/mfd/wm831x/core.h
@@ -17,6 +17,7 @@
17 17
18#include <linux/completion.h> 18#include <linux/completion.h>
19#include <linux/interrupt.h> 19#include <linux/interrupt.h>
20#include <linux/list.h>
20 21
21/* 22/*
22 * Register values. 23 * Register values.
@@ -234,9 +235,111 @@
234#define WM831X_ON_PIN_TO_SHIFT 0 /* ON_PIN_TO - [1:0] */ 235#define WM831X_ON_PIN_TO_SHIFT 0 /* ON_PIN_TO - [1:0] */
235#define WM831X_ON_PIN_TO_WIDTH 2 /* ON_PIN_TO - [1:0] */ 236#define WM831X_ON_PIN_TO_WIDTH 2 /* ON_PIN_TO - [1:0] */
236 237
238/*
239 * R16528 (0x4090) - Clock Control 1
240 */
241#define WM831X_CLKOUT_ENA 0x8000 /* CLKOUT_ENA */
242#define WM831X_CLKOUT_ENA_MASK 0x8000 /* CLKOUT_ENA */
243#define WM831X_CLKOUT_ENA_SHIFT 15 /* CLKOUT_ENA */
244#define WM831X_CLKOUT_ENA_WIDTH 1 /* CLKOUT_ENA */
245#define WM831X_CLKOUT_OD 0x2000 /* CLKOUT_OD */
246#define WM831X_CLKOUT_OD_MASK 0x2000 /* CLKOUT_OD */
247#define WM831X_CLKOUT_OD_SHIFT 13 /* CLKOUT_OD */
248#define WM831X_CLKOUT_OD_WIDTH 1 /* CLKOUT_OD */
249#define WM831X_CLKOUT_SLOT_MASK 0x0700 /* CLKOUT_SLOT - [10:8] */
250#define WM831X_CLKOUT_SLOT_SHIFT 8 /* CLKOUT_SLOT - [10:8] */
251#define WM831X_CLKOUT_SLOT_WIDTH 3 /* CLKOUT_SLOT - [10:8] */
252#define WM831X_CLKOUT_SLPSLOT_MASK 0x0070 /* CLKOUT_SLPSLOT - [6:4] */
253#define WM831X_CLKOUT_SLPSLOT_SHIFT 4 /* CLKOUT_SLPSLOT - [6:4] */
254#define WM831X_CLKOUT_SLPSLOT_WIDTH 3 /* CLKOUT_SLPSLOT - [6:4] */
255#define WM831X_CLKOUT_SRC 0x0001 /* CLKOUT_SRC */
256#define WM831X_CLKOUT_SRC_MASK 0x0001 /* CLKOUT_SRC */
257#define WM831X_CLKOUT_SRC_SHIFT 0 /* CLKOUT_SRC */
258#define WM831X_CLKOUT_SRC_WIDTH 1 /* CLKOUT_SRC */
259
260/*
261 * R16529 (0x4091) - Clock Control 2
262 */
263#define WM831X_XTAL_INH 0x8000 /* XTAL_INH */
264#define WM831X_XTAL_INH_MASK 0x8000 /* XTAL_INH */
265#define WM831X_XTAL_INH_SHIFT 15 /* XTAL_INH */
266#define WM831X_XTAL_INH_WIDTH 1 /* XTAL_INH */
267#define WM831X_XTAL_ENA 0x2000 /* XTAL_ENA */
268#define WM831X_XTAL_ENA_MASK 0x2000 /* XTAL_ENA */
269#define WM831X_XTAL_ENA_SHIFT 13 /* XTAL_ENA */
270#define WM831X_XTAL_ENA_WIDTH 1 /* XTAL_ENA */
271#define WM831X_XTAL_BKUPENA 0x1000 /* XTAL_BKUPENA */
272#define WM831X_XTAL_BKUPENA_MASK 0x1000 /* XTAL_BKUPENA */
273#define WM831X_XTAL_BKUPENA_SHIFT 12 /* XTAL_BKUPENA */
274#define WM831X_XTAL_BKUPENA_WIDTH 1 /* XTAL_BKUPENA */
275#define WM831X_FLL_AUTO 0x0080 /* FLL_AUTO */
276#define WM831X_FLL_AUTO_MASK 0x0080 /* FLL_AUTO */
277#define WM831X_FLL_AUTO_SHIFT 7 /* FLL_AUTO */
278#define WM831X_FLL_AUTO_WIDTH 1 /* FLL_AUTO */
279#define WM831X_FLL_AUTO_FREQ_MASK 0x0007 /* FLL_AUTO_FREQ - [2:0] */
280#define WM831X_FLL_AUTO_FREQ_SHIFT 0 /* FLL_AUTO_FREQ - [2:0] */
281#define WM831X_FLL_AUTO_FREQ_WIDTH 3 /* FLL_AUTO_FREQ - [2:0] */
282
283/*
284 * R16530 (0x4092) - FLL Control 1
285 */
286#define WM831X_FLL_FRAC 0x0004 /* FLL_FRAC */
287#define WM831X_FLL_FRAC_MASK 0x0004 /* FLL_FRAC */
288#define WM831X_FLL_FRAC_SHIFT 2 /* FLL_FRAC */
289#define WM831X_FLL_FRAC_WIDTH 1 /* FLL_FRAC */
290#define WM831X_FLL_OSC_ENA 0x0002 /* FLL_OSC_ENA */
291#define WM831X_FLL_OSC_ENA_MASK 0x0002 /* FLL_OSC_ENA */
292#define WM831X_FLL_OSC_ENA_SHIFT 1 /* FLL_OSC_ENA */
293#define WM831X_FLL_OSC_ENA_WIDTH 1 /* FLL_OSC_ENA */
294#define WM831X_FLL_ENA 0x0001 /* FLL_ENA */
295#define WM831X_FLL_ENA_MASK 0x0001 /* FLL_ENA */
296#define WM831X_FLL_ENA_SHIFT 0 /* FLL_ENA */
297#define WM831X_FLL_ENA_WIDTH 1 /* FLL_ENA */
298
299/*
300 * R16531 (0x4093) - FLL Control 2
301 */
302#define WM831X_FLL_OUTDIV_MASK 0x3F00 /* FLL_OUTDIV - [13:8] */
303#define WM831X_FLL_OUTDIV_SHIFT 8 /* FLL_OUTDIV - [13:8] */
304#define WM831X_FLL_OUTDIV_WIDTH 6 /* FLL_OUTDIV - [13:8] */
305#define WM831X_FLL_CTRL_RATE_MASK 0x0070 /* FLL_CTRL_RATE - [6:4] */
306#define WM831X_FLL_CTRL_RATE_SHIFT 4 /* FLL_CTRL_RATE - [6:4] */
307#define WM831X_FLL_CTRL_RATE_WIDTH 3 /* FLL_CTRL_RATE - [6:4] */
308#define WM831X_FLL_FRATIO_MASK 0x0007 /* FLL_FRATIO - [2:0] */
309#define WM831X_FLL_FRATIO_SHIFT 0 /* FLL_FRATIO - [2:0] */
310#define WM831X_FLL_FRATIO_WIDTH 3 /* FLL_FRATIO - [2:0] */
311
312/*
313 * R16532 (0x4094) - FLL Control 3
314 */
315#define WM831X_FLL_K_MASK 0xFFFF /* FLL_K - [15:0] */
316#define WM831X_FLL_K_SHIFT 0 /* FLL_K - [15:0] */
317#define WM831X_FLL_K_WIDTH 16 /* FLL_K - [15:0] */
318
319/*
320 * R16533 (0x4095) - FLL Control 4
321 */
322#define WM831X_FLL_N_MASK 0x7FE0 /* FLL_N - [14:5] */
323#define WM831X_FLL_N_SHIFT 5 /* FLL_N - [14:5] */
324#define WM831X_FLL_N_WIDTH 10 /* FLL_N - [14:5] */
325#define WM831X_FLL_GAIN_MASK 0x000F /* FLL_GAIN - [3:0] */
326#define WM831X_FLL_GAIN_SHIFT 0 /* FLL_GAIN - [3:0] */
327#define WM831X_FLL_GAIN_WIDTH 4 /* FLL_GAIN - [3:0] */
328
329/*
330 * R16534 (0x4096) - FLL Control 5
331 */
332#define WM831X_FLL_CLK_REF_DIV_MASK 0x0018 /* FLL_CLK_REF_DIV - [4:3] */
333#define WM831X_FLL_CLK_REF_DIV_SHIFT 3 /* FLL_CLK_REF_DIV - [4:3] */
334#define WM831X_FLL_CLK_REF_DIV_WIDTH 2 /* FLL_CLK_REF_DIV - [4:3] */
335#define WM831X_FLL_CLK_SRC_MASK 0x0003 /* FLL_CLK_SRC - [1:0] */
336#define WM831X_FLL_CLK_SRC_SHIFT 0 /* FLL_CLK_SRC - [1:0] */
337#define WM831X_FLL_CLK_SRC_WIDTH 2 /* FLL_CLK_SRC - [1:0] */
338
237struct regulator_dev; 339struct regulator_dev;
238 340
239#define WM831X_NUM_IRQ_REGS 5 341#define WM831X_NUM_IRQ_REGS 5
342#define WM831X_NUM_GPIO_REGS 16
240 343
241enum wm831x_parent { 344enum wm831x_parent {
242 WM8310 = 0x8310, 345 WM8310 = 0x8310,
@@ -248,6 +351,12 @@ enum wm831x_parent {
248 WM8326 = 0x8326, 351 WM8326 = 0x8326,
249}; 352};
250 353
354struct wm831x;
355enum wm831x_auxadc;
356
357typedef int (*wm831x_auxadc_read_fn)(struct wm831x *wm831x,
358 enum wm831x_auxadc input);
359
251struct wm831x { 360struct wm831x {
252 struct mutex io_lock; 361 struct mutex io_lock;
253 362
@@ -261,7 +370,7 @@ struct wm831x {
261 370
262 int irq; /* Our chip IRQ */ 371 int irq; /* Our chip IRQ */
263 struct mutex irq_lock; 372 struct mutex irq_lock;
264 unsigned int irq_base; 373 int irq_base;
265 int irq_masks_cur[WM831X_NUM_IRQ_REGS]; /* Currently active value */ 374 int irq_masks_cur[WM831X_NUM_IRQ_REGS]; /* Currently active value */
266 int irq_masks_cache[WM831X_NUM_IRQ_REGS]; /* Cached hardware value */ 375 int irq_masks_cache[WM831X_NUM_IRQ_REGS]; /* Cached hardware value */
267 376
@@ -272,8 +381,13 @@ struct wm831x {
272 381
273 int num_gpio; 382 int num_gpio;
274 383
384 /* Used by the interrupt controller code to post writes */
385 int gpio_update[WM831X_NUM_GPIO_REGS];
386
275 struct mutex auxadc_lock; 387 struct mutex auxadc_lock;
276 struct completion auxadc_done; 388 struct list_head auxadc_pending;
389 u16 auxadc_active;
390 wm831x_auxadc_read_fn auxadc_read;
277 391
278 /* The WM831x has a security key blocking access to certain 392 /* The WM831x has a security key blocking access to certain
279 * registers. The mutex is taken by the accessors for locking 393 * registers. The mutex is taken by the accessors for locking
@@ -300,5 +414,6 @@ void wm831x_device_exit(struct wm831x *wm831x);
300int wm831x_device_suspend(struct wm831x *wm831x); 414int wm831x_device_suspend(struct wm831x *wm831x);
301int wm831x_irq_init(struct wm831x *wm831x, int irq); 415int wm831x_irq_init(struct wm831x *wm831x, int irq);
302void wm831x_irq_exit(struct wm831x *wm831x); 416void wm831x_irq_exit(struct wm831x *wm831x);
417void wm831x_auxadc_init(struct wm831x *wm831x);
303 418
304#endif 419#endif
diff --git a/include/linux/mfd/wm831x/pdata.h b/include/linux/mfd/wm831x/pdata.h
index ff42d700293f..0ba24599fe51 100644
--- a/include/linux/mfd/wm831x/pdata.h
+++ b/include/linux/mfd/wm831x/pdata.h
@@ -120,6 +120,9 @@ struct wm831x_pdata {
120 /** Put the /IRQ line into CMOS mode */ 120 /** Put the /IRQ line into CMOS mode */
121 bool irq_cmos; 121 bool irq_cmos;
122 122
123 /** Disable the touchscreen */
124 bool disable_touch;
125
123 int irq_base; 126 int irq_base;
124 int gpio_base; 127 int gpio_base;
125 int gpio_defaults[WM831X_GPIO_NUM]; 128 int gpio_defaults[WM831X_GPIO_NUM];
diff --git a/include/linux/mii.h b/include/linux/mii.h
index 359fba880274..103113a2fd18 100644
--- a/include/linux/mii.h
+++ b/include/linux/mii.h
@@ -128,6 +128,8 @@
128/* 1000BASE-T Control register */ 128/* 1000BASE-T Control register */
129#define ADVERTISE_1000FULL 0x0200 /* Advertise 1000BASE-T full duplex */ 129#define ADVERTISE_1000FULL 0x0200 /* Advertise 1000BASE-T full duplex */
130#define ADVERTISE_1000HALF 0x0100 /* Advertise 1000BASE-T half duplex */ 130#define ADVERTISE_1000HALF 0x0100 /* Advertise 1000BASE-T half duplex */
131#define CTL1000_AS_MASTER 0x0800
132#define CTL1000_ENABLE_MASTER 0x1000
131 133
132/* 1000BASE-T Status register */ 134/* 1000BASE-T Status register */
133#define LPA_1000LOCALRXOK 0x2000 /* Link partner local receiver status */ 135#define LPA_1000LOCALRXOK 0x2000 /* Link partner local receiver status */
diff --git a/include/linux/mlx4/cmd.h b/include/linux/mlx4/cmd.h
index 9a18667c13cc..b56e4587208d 100644
--- a/include/linux/mlx4/cmd.h
+++ b/include/linux/mlx4/cmd.h
@@ -123,6 +123,9 @@ enum {
123 /* debug commands */ 123 /* debug commands */
124 MLX4_CMD_QUERY_DEBUG_MSG = 0x2a, 124 MLX4_CMD_QUERY_DEBUG_MSG = 0x2a,
125 MLX4_CMD_SET_DEBUG_MSG = 0x2b, 125 MLX4_CMD_SET_DEBUG_MSG = 0x2b,
126
127 /* statistics commands */
128 MLX4_CMD_QUERY_IF_STAT = 0X54,
126}; 129};
127 130
128enum { 131enum {
diff --git a/include/linux/mlx4/device.h b/include/linux/mlx4/device.h
index 8985768e2c0d..53ef894bfa05 100644
--- a/include/linux/mlx4/device.h
+++ b/include/linux/mlx4/device.h
@@ -37,7 +37,7 @@
37#include <linux/completion.h> 37#include <linux/completion.h>
38#include <linux/radix-tree.h> 38#include <linux/radix-tree.h>
39 39
40#include <asm/atomic.h> 40#include <linux/atomic.h>
41 41
42#define MAX_MSIX_P_PORT 17 42#define MAX_MSIX_P_PORT 17
43#define MAX_MSIX 64 43#define MAX_MSIX 64
@@ -58,22 +58,28 @@ enum {
58}; 58};
59 59
60enum { 60enum {
61 MLX4_DEV_CAP_FLAG_RC = 1 << 0, 61 MLX4_DEV_CAP_FLAG_RC = 1LL << 0,
62 MLX4_DEV_CAP_FLAG_UC = 1 << 1, 62 MLX4_DEV_CAP_FLAG_UC = 1LL << 1,
63 MLX4_DEV_CAP_FLAG_UD = 1 << 2, 63 MLX4_DEV_CAP_FLAG_UD = 1LL << 2,
64 MLX4_DEV_CAP_FLAG_SRQ = 1 << 6, 64 MLX4_DEV_CAP_FLAG_SRQ = 1LL << 6,
65 MLX4_DEV_CAP_FLAG_IPOIB_CSUM = 1 << 7, 65 MLX4_DEV_CAP_FLAG_IPOIB_CSUM = 1LL << 7,
66 MLX4_DEV_CAP_FLAG_BAD_PKEY_CNTR = 1 << 8, 66 MLX4_DEV_CAP_FLAG_BAD_PKEY_CNTR = 1LL << 8,
67 MLX4_DEV_CAP_FLAG_BAD_QKEY_CNTR = 1 << 9, 67 MLX4_DEV_CAP_FLAG_BAD_QKEY_CNTR = 1LL << 9,
68 MLX4_DEV_CAP_FLAG_DPDP = 1 << 12, 68 MLX4_DEV_CAP_FLAG_DPDP = 1LL << 12,
69 MLX4_DEV_CAP_FLAG_BLH = 1 << 15, 69 MLX4_DEV_CAP_FLAG_BLH = 1LL << 15,
70 MLX4_DEV_CAP_FLAG_MEM_WINDOW = 1 << 16, 70 MLX4_DEV_CAP_FLAG_MEM_WINDOW = 1LL << 16,
71 MLX4_DEV_CAP_FLAG_APM = 1 << 17, 71 MLX4_DEV_CAP_FLAG_APM = 1LL << 17,
72 MLX4_DEV_CAP_FLAG_ATOMIC = 1 << 18, 72 MLX4_DEV_CAP_FLAG_ATOMIC = 1LL << 18,
73 MLX4_DEV_CAP_FLAG_RAW_MCAST = 1 << 19, 73 MLX4_DEV_CAP_FLAG_RAW_MCAST = 1LL << 19,
74 MLX4_DEV_CAP_FLAG_UD_AV_PORT = 1 << 20, 74 MLX4_DEV_CAP_FLAG_UD_AV_PORT = 1LL << 20,
75 MLX4_DEV_CAP_FLAG_UD_MCAST = 1 << 21, 75 MLX4_DEV_CAP_FLAG_UD_MCAST = 1LL << 21,
76 MLX4_DEV_CAP_FLAG_IBOE = 1 << 30 76 MLX4_DEV_CAP_FLAG_IBOE = 1LL << 30,
77 MLX4_DEV_CAP_FLAG_UC_LOOPBACK = 1LL << 32,
78 MLX4_DEV_CAP_FLAG_WOL = 1LL << 38,
79 MLX4_DEV_CAP_FLAG_UDP_RSS = 1LL << 40,
80 MLX4_DEV_CAP_FLAG_VEP_UC_STEER = 1LL << 41,
81 MLX4_DEV_CAP_FLAG_VEP_MC_STEER = 1LL << 42,
82 MLX4_DEV_CAP_FLAG_COUNTERS = 1LL << 48
77}; 83};
78 84
79enum { 85enum {
@@ -253,15 +259,10 @@ struct mlx4_caps {
253 int mtt_entry_sz; 259 int mtt_entry_sz;
254 u32 max_msg_sz; 260 u32 max_msg_sz;
255 u32 page_size_cap; 261 u32 page_size_cap;
256 u32 flags; 262 u64 flags;
257 u32 bmme_flags; 263 u32 bmme_flags;
258 u32 reserved_lkey; 264 u32 reserved_lkey;
259 u16 stat_rate_support; 265 u16 stat_rate_support;
260 int udp_rss;
261 int loopback_support;
262 int vep_uc_steering;
263 int vep_mc_steering;
264 int wol;
265 u8 port_width_cap[MLX4_MAX_PORTS + 1]; 266 u8 port_width_cap[MLX4_MAX_PORTS + 1];
266 int max_gso_sz; 267 int max_gso_sz;
267 int reserved_qps_cnt[MLX4_NUM_QP_REGION]; 268 int reserved_qps_cnt[MLX4_NUM_QP_REGION];
@@ -274,6 +275,7 @@ struct mlx4_caps {
274 u8 supported_type[MLX4_MAX_PORTS + 1]; 275 u8 supported_type[MLX4_MAX_PORTS + 1];
275 u32 port_mask; 276 u32 port_mask;
276 enum mlx4_port_type possible_type[MLX4_MAX_PORTS + 1]; 277 enum mlx4_port_type possible_type[MLX4_MAX_PORTS + 1];
278 u32 max_counters;
277}; 279};
278 280
279struct mlx4_buf_list { 281struct mlx4_buf_list {
@@ -438,6 +440,17 @@ union mlx4_ext_av {
438 struct mlx4_eth_av eth; 440 struct mlx4_eth_av eth;
439}; 441};
440 442
443struct mlx4_counter {
444 u8 reserved1[3];
445 u8 counter_mode;
446 __be32 num_ifc;
447 u32 reserved2[2];
448 __be64 rx_frames;
449 __be64 rx_bytes;
450 __be64 tx_frames;
451 __be64 tx_bytes;
452};
453
441struct mlx4_dev { 454struct mlx4_dev {
442 struct pci_dev *pdev; 455 struct pci_dev *pdev;
443 unsigned long flags; 456 unsigned long flags;
@@ -568,4 +581,7 @@ void mlx4_release_eq(struct mlx4_dev *dev, int vec);
568int mlx4_wol_read(struct mlx4_dev *dev, u64 *config, int port); 581int mlx4_wol_read(struct mlx4_dev *dev, u64 *config, int port);
569int mlx4_wol_write(struct mlx4_dev *dev, u64 config, int port); 582int mlx4_wol_write(struct mlx4_dev *dev, u64 config, int port);
570 583
584int mlx4_counter_alloc(struct mlx4_dev *dev, u32 *idx);
585void mlx4_counter_free(struct mlx4_dev *dev, u32 idx);
586
571#endif /* MLX4_DEVICE_H */ 587#endif /* MLX4_DEVICE_H */
diff --git a/include/linux/mlx4/qp.h b/include/linux/mlx4/qp.h
index 9e9eb21056ca..4001c8249dbb 100644
--- a/include/linux/mlx4/qp.h
+++ b/include/linux/mlx4/qp.h
@@ -54,7 +54,8 @@ enum mlx4_qp_optpar {
54 MLX4_QP_OPTPAR_RETRY_COUNT = 1 << 12, 54 MLX4_QP_OPTPAR_RETRY_COUNT = 1 << 12,
55 MLX4_QP_OPTPAR_RNR_RETRY = 1 << 13, 55 MLX4_QP_OPTPAR_RNR_RETRY = 1 << 13,
56 MLX4_QP_OPTPAR_ACK_TIMEOUT = 1 << 14, 56 MLX4_QP_OPTPAR_ACK_TIMEOUT = 1 << 14,
57 MLX4_QP_OPTPAR_SCHED_QUEUE = 1 << 16 57 MLX4_QP_OPTPAR_SCHED_QUEUE = 1 << 16,
58 MLX4_QP_OPTPAR_COUNTER_INDEX = 1 << 20
58}; 59};
59 60
60enum mlx4_qp_state { 61enum mlx4_qp_state {
@@ -99,7 +100,7 @@ struct mlx4_qp_path {
99 u8 fl; 100 u8 fl;
100 u8 reserved1[2]; 101 u8 reserved1[2];
101 u8 pkey_index; 102 u8 pkey_index;
102 u8 reserved2; 103 u8 counter_index;
103 u8 grh_mylmc; 104 u8 grh_mylmc;
104 __be16 rlid; 105 __be16 rlid;
105 u8 ackto; 106 u8 ackto;
@@ -111,8 +112,7 @@ struct mlx4_qp_path {
111 u8 sched_queue; 112 u8 sched_queue;
112 u8 vlan_index; 113 u8 vlan_index;
113 u8 reserved3[2]; 114 u8 reserved3[2];
114 u8 counter_index; 115 u8 reserved4[2];
115 u8 reserved4;
116 u8 dmac[6]; 116 u8 dmac[6];
117}; 117};
118 118
diff --git a/include/linux/mm.h b/include/linux/mm.h
index 9670f71d7be9..f2690cf49827 100644
--- a/include/linux/mm.h
+++ b/include/linux/mm.h
@@ -15,6 +15,7 @@
15#include <linux/range.h> 15#include <linux/range.h>
16#include <linux/pfn.h> 16#include <linux/pfn.h>
17#include <linux/bit_spinlock.h> 17#include <linux/bit_spinlock.h>
18#include <linux/shrinker.h>
18 19
19struct mempolicy; 20struct mempolicy;
20struct anon_vma; 21struct anon_vma;
@@ -636,7 +637,7 @@ static inline pte_t maybe_mkwrite(pte_t pte, struct vm_area_struct *vma)
636#define SECTIONS_MASK ((1UL << SECTIONS_WIDTH) - 1) 637#define SECTIONS_MASK ((1UL << SECTIONS_WIDTH) - 1)
637#define ZONEID_MASK ((1UL << ZONEID_SHIFT) - 1) 638#define ZONEID_MASK ((1UL << ZONEID_SHIFT) - 1)
638 639
639static inline enum zone_type page_zonenum(struct page *page) 640static inline enum zone_type page_zonenum(const struct page *page)
640{ 641{
641 return (page->flags >> ZONES_PGSHIFT) & ZONES_MASK; 642 return (page->flags >> ZONES_PGSHIFT) & ZONES_MASK;
642} 643}
@@ -664,15 +665,15 @@ static inline int zone_to_nid(struct zone *zone)
664} 665}
665 666
666#ifdef NODE_NOT_IN_PAGE_FLAGS 667#ifdef NODE_NOT_IN_PAGE_FLAGS
667extern int page_to_nid(struct page *page); 668extern int page_to_nid(const struct page *page);
668#else 669#else
669static inline int page_to_nid(struct page *page) 670static inline int page_to_nid(const struct page *page)
670{ 671{
671 return (page->flags >> NODES_PGSHIFT) & NODES_MASK; 672 return (page->flags >> NODES_PGSHIFT) & NODES_MASK;
672} 673}
673#endif 674#endif
674 675
675static inline struct zone *page_zone(struct page *page) 676static inline struct zone *page_zone(const struct page *page)
676{ 677{
677 return &NODE_DATA(page_to_nid(page))->node_zones[page_zonenum(page)]; 678 return &NODE_DATA(page_to_nid(page))->node_zones[page_zonenum(page)];
678} 679}
@@ -717,9 +718,9 @@ static inline void set_page_links(struct page *page, enum zone_type zone,
717 */ 718 */
718#include <linux/vmstat.h> 719#include <linux/vmstat.h>
719 720
720static __always_inline void *lowmem_page_address(struct page *page) 721static __always_inline void *lowmem_page_address(const struct page *page)
721{ 722{
722 return __va(PFN_PHYS(page_to_pfn(page))); 723 return __va(PFN_PHYS(page_to_pfn((struct page *)page)));
723} 724}
724 725
725#if defined(CONFIG_HIGHMEM) && !defined(WANT_PAGE_VIRTUAL) 726#if defined(CONFIG_HIGHMEM) && !defined(WANT_PAGE_VIRTUAL)
@@ -910,6 +911,8 @@ unsigned long unmap_vmas(struct mmu_gather *tlb,
910 * @pte_entry: if set, called for each non-empty PTE (4th-level) entry 911 * @pte_entry: if set, called for each non-empty PTE (4th-level) entry
911 * @pte_hole: if set, called for each hole at all levels 912 * @pte_hole: if set, called for each hole at all levels
912 * @hugetlb_entry: if set, called for each hugetlb entry 913 * @hugetlb_entry: if set, called for each hugetlb entry
914 * *Caution*: The caller must hold mmap_sem() if @hugetlb_entry
915 * is used.
913 * 916 *
914 * (see walk_page_range for more details) 917 * (see walk_page_range for more details)
915 */ 918 */
@@ -985,6 +988,8 @@ int get_user_pages(struct task_struct *tsk, struct mm_struct *mm,
985int get_user_pages_fast(unsigned long start, int nr_pages, int write, 988int get_user_pages_fast(unsigned long start, int nr_pages, int write,
986 struct page **pages); 989 struct page **pages);
987struct page *get_dump_page(unsigned long addr); 990struct page *get_dump_page(unsigned long addr);
991extern int fixup_user_fault(struct task_struct *tsk, struct mm_struct *mm,
992 unsigned long address, unsigned int fault_flags);
988 993
989extern int try_to_release_page(struct page * page, gfp_t gfp_mask); 994extern int try_to_release_page(struct page * page, gfp_t gfp_mask);
990extern void do_invalidatepage(struct page *page, unsigned long offset); 995extern void do_invalidatepage(struct page *page, unsigned long offset);
@@ -1121,44 +1126,6 @@ static inline void sync_mm_rss(struct task_struct *task, struct mm_struct *mm)
1121} 1126}
1122#endif 1127#endif
1123 1128
1124/*
1125 * This struct is used to pass information from page reclaim to the shrinkers.
1126 * We consolidate the values for easier extention later.
1127 */
1128struct shrink_control {
1129 gfp_t gfp_mask;
1130
1131 /* How many slab objects shrinker() should scan and try to reclaim */
1132 unsigned long nr_to_scan;
1133};
1134
1135/*
1136 * A callback you can register to apply pressure to ageable caches.
1137 *
1138 * 'sc' is passed shrink_control which includes a count 'nr_to_scan'
1139 * and a 'gfpmask'. It should look through the least-recently-used
1140 * 'nr_to_scan' entries and attempt to free them up. It should return
1141 * the number of objects which remain in the cache. If it returns -1, it means
1142 * it cannot do any scanning at this time (eg. there is a risk of deadlock).
1143 *
1144 * The 'gfpmask' refers to the allocation we are currently trying to
1145 * fulfil.
1146 *
1147 * Note that 'shrink' will be passed nr_to_scan == 0 when the VM is
1148 * querying the cache size, so a fastpath for that case is appropriate.
1149 */
1150struct shrinker {
1151 int (*shrink)(struct shrinker *, struct shrink_control *sc);
1152 int seeks; /* seeks to recreate an obj */
1153
1154 /* These are for internal use */
1155 struct list_head list;
1156 long nr; /* objs pending delete */
1157};
1158#define DEFAULT_SEEKS 2 /* A good number if you don't know better. */
1159extern void register_shrinker(struct shrinker *);
1160extern void unregister_shrinker(struct shrinker *);
1161
1162int vma_wants_writenotify(struct vm_area_struct *vma); 1129int vma_wants_writenotify(struct vm_area_struct *vma);
1163 1130
1164extern pte_t *__get_locked_pte(struct mm_struct *mm, unsigned long addr, 1131extern pte_t *__get_locked_pte(struct mm_struct *mm, unsigned long addr,
@@ -1313,6 +1280,7 @@ extern void remove_active_range(unsigned int nid, unsigned long start_pfn,
1313 unsigned long end_pfn); 1280 unsigned long end_pfn);
1314extern void remove_all_active_ranges(void); 1281extern void remove_all_active_ranges(void);
1315void sort_node_map(void); 1282void sort_node_map(void);
1283unsigned long node_map_pfn_alignment(void);
1316unsigned long __absent_pages_in_range(int nid, unsigned long start_pfn, 1284unsigned long __absent_pages_in_range(int nid, unsigned long start_pfn,
1317 unsigned long end_pfn); 1285 unsigned long end_pfn);
1318extern unsigned long absent_pages_in_range(unsigned long start_pfn, 1286extern unsigned long absent_pages_in_range(unsigned long start_pfn,
@@ -1445,8 +1413,7 @@ extern int do_munmap(struct mm_struct *, unsigned long, size_t);
1445 1413
1446extern unsigned long do_brk(unsigned long, unsigned long); 1414extern unsigned long do_brk(unsigned long, unsigned long);
1447 1415
1448/* filemap.c */ 1416/* truncate.c */
1449extern unsigned long page_unuse(struct page *);
1450extern void truncate_inode_pages(struct address_space *, loff_t); 1417extern void truncate_inode_pages(struct address_space *, loff_t);
1451extern void truncate_inode_pages_range(struct address_space *, 1418extern void truncate_inode_pages_range(struct address_space *,
1452 loff_t lstart, loff_t lend); 1419 loff_t lstart, loff_t lend);
@@ -1633,6 +1600,7 @@ enum mf_flags {
1633}; 1600};
1634extern void memory_failure(unsigned long pfn, int trapno); 1601extern void memory_failure(unsigned long pfn, int trapno);
1635extern int __memory_failure(unsigned long pfn, int trapno, int flags); 1602extern int __memory_failure(unsigned long pfn, int trapno, int flags);
1603extern void memory_failure_queue(unsigned long pfn, int trapno, int flags);
1636extern int unpoison_memory(unsigned long pfn); 1604extern int unpoison_memory(unsigned long pfn);
1637extern int sysctl_memory_failure_early_kill; 1605extern int sysctl_memory_failure_early_kill;
1638extern int sysctl_memory_failure_recovery; 1606extern int sysctl_memory_failure_recovery;
diff --git a/include/linux/mm_types.h b/include/linux/mm_types.h
index 027935c86c68..774b8952deb4 100644
--- a/include/linux/mm_types.h
+++ b/include/linux/mm_types.h
@@ -30,23 +30,61 @@ struct address_space;
30 * moment. Note that we have no way to track which tasks are using 30 * moment. Note that we have no way to track which tasks are using
31 * a page, though if it is a pagecache page, rmap structures can tell us 31 * a page, though if it is a pagecache page, rmap structures can tell us
32 * who is mapping it. 32 * who is mapping it.
33 *
34 * The objects in struct page are organized in double word blocks in
35 * order to allows us to use atomic double word operations on portions
36 * of struct page. That is currently only used by slub but the arrangement
37 * allows the use of atomic double word operations on the flags/mapping
38 * and lru list pointers also.
33 */ 39 */
34struct page { 40struct page {
41 /* First double word block */
35 unsigned long flags; /* Atomic flags, some possibly 42 unsigned long flags; /* Atomic flags, some possibly
36 * updated asynchronously */ 43 * updated asynchronously */
37 atomic_t _count; /* Usage count, see below. */ 44 struct address_space *mapping; /* If low bit clear, points to
38 union { 45 * inode address_space, or NULL.
39 atomic_t _mapcount; /* Count of ptes mapped in mms, 46 * If page mapped as anonymous
40 * to show when page is mapped 47 * memory, low bit is set, and
41 * & limit reverse map searches. 48 * it points to anon_vma object:
49 * see PAGE_MAPPING_ANON below.
42 */ 50 */
43 struct { /* SLUB */ 51 /* Second double word */
44 u16 inuse; 52 struct {
45 u16 objects; 53 union {
54 pgoff_t index; /* Our offset within mapping. */
55 void *freelist; /* slub first free object */
56 };
57
58 union {
59 /* Used for cmpxchg_double in slub */
60 unsigned long counters;
61
62 struct {
63
64 union {
65 atomic_t _mapcount; /* Count of ptes mapped in mms,
66 * to show when page is mapped
67 * & limit reverse map searches.
68 */
69
70 struct {
71 unsigned inuse:16;
72 unsigned objects:15;
73 unsigned frozen:1;
74 };
75 };
76 atomic_t _count; /* Usage count, see below. */
77 };
46 }; 78 };
47 }; 79 };
80
81 /* Third double word block */
82 struct list_head lru; /* Pageout list, eg. active_list
83 * protected by zone->lru_lock !
84 */
85
86 /* Remainder is not double word aligned */
48 union { 87 union {
49 struct {
50 unsigned long private; /* Mapping-private opaque data: 88 unsigned long private; /* Mapping-private opaque data:
51 * usually used for buffer_heads 89 * usually used for buffer_heads
52 * if PagePrivate set; used for 90 * if PagePrivate set; used for
@@ -54,27 +92,13 @@ struct page {
54 * indicates order in the buddy 92 * indicates order in the buddy
55 * system if PG_buddy is set. 93 * system if PG_buddy is set.
56 */ 94 */
57 struct address_space *mapping; /* If low bit clear, points to
58 * inode address_space, or NULL.
59 * If page mapped as anonymous
60 * memory, low bit is set, and
61 * it points to anon_vma object:
62 * see PAGE_MAPPING_ANON below.
63 */
64 };
65#if USE_SPLIT_PTLOCKS 95#if USE_SPLIT_PTLOCKS
66 spinlock_t ptl; 96 spinlock_t ptl;
67#endif 97#endif
68 struct kmem_cache *slab; /* SLUB: Pointer to slab */ 98 struct kmem_cache *slab; /* SLUB: Pointer to slab */
69 struct page *first_page; /* Compound tail pages */ 99 struct page *first_page; /* Compound tail pages */
70 };
71 union {
72 pgoff_t index; /* Our offset within mapping. */
73 void *freelist; /* SLUB: freelist req. slab lock */
74 }; 100 };
75 struct list_head lru; /* Pageout list, eg. active_list 101
76 * protected by zone->lru_lock !
77 */
78 /* 102 /*
79 * On machines where all RAM is mapped into kernel address space, 103 * On machines where all RAM is mapped into kernel address space,
80 * we can simply calculate the virtual address. On machines with 104 * we can simply calculate the virtual address. On machines with
@@ -100,7 +124,16 @@ struct page {
100 */ 124 */
101 void *shadow; 125 void *shadow;
102#endif 126#endif
103}; 127}
128/*
129 * If another subsystem starts using the double word pairing for atomic
130 * operations on struct page then it must change the #if to ensure
131 * proper alignment of the page struct.
132 */
133#if defined(CONFIG_SLUB) && defined(CONFIG_CMPXCHG_LOCAL)
134 __attribute__((__aligned__(2*sizeof(unsigned long))))
135#endif
136;
104 137
105typedef unsigned long __nocast vm_flags_t; 138typedef unsigned long __nocast vm_flags_t;
106 139
diff --git a/include/linux/mman.h b/include/linux/mman.h
index 9872d6ca58ae..8b74e9b1d0ad 100644
--- a/include/linux/mman.h
+++ b/include/linux/mman.h
@@ -14,7 +14,7 @@
14#include <linux/mm.h> 14#include <linux/mm.h>
15#include <linux/percpu_counter.h> 15#include <linux/percpu_counter.h>
16 16
17#include <asm/atomic.h> 17#include <linux/atomic.h>
18 18
19extern int sysctl_overcommit_memory; 19extern int sysctl_overcommit_memory;
20extern int sysctl_overcommit_ratio; 20extern int sysctl_overcommit_ratio;
diff --git a/include/linux/mmc/boot.h b/include/linux/mmc/boot.h
index 39d787c229cb..23acc3baa07d 100644
--- a/include/linux/mmc/boot.h
+++ b/include/linux/mmc/boot.h
@@ -1,7 +1,7 @@
1#ifndef MMC_BOOT_H 1#ifndef LINUX_MMC_BOOT_H
2#define MMC_BOOT_H 2#define LINUX_MMC_BOOT_H
3 3
4enum { MMC_PROGRESS_ENTER, MMC_PROGRESS_INIT, 4enum { MMC_PROGRESS_ENTER, MMC_PROGRESS_INIT,
5 MMC_PROGRESS_LOAD, MMC_PROGRESS_DONE }; 5 MMC_PROGRESS_LOAD, MMC_PROGRESS_DONE };
6 6
7#endif 7#endif /* LINUX_MMC_BOOT_H */
diff --git a/include/linux/mmc/card.h b/include/linux/mmc/card.h
index c6927a4d157f..b460fc2af8a1 100644
--- a/include/linux/mmc/card.h
+++ b/include/linux/mmc/card.h
@@ -64,6 +64,19 @@ struct mmc_ext_csd {
64 unsigned long long enhanced_area_offset; /* Units: Byte */ 64 unsigned long long enhanced_area_offset; /* Units: Byte */
65 unsigned int enhanced_area_size; /* Units: KB */ 65 unsigned int enhanced_area_size; /* Units: KB */
66 unsigned int boot_size; /* in bytes */ 66 unsigned int boot_size; /* in bytes */
67 u8 raw_partition_support; /* 160 */
68 u8 raw_erased_mem_count; /* 181 */
69 u8 raw_ext_csd_structure; /* 194 */
70 u8 raw_card_type; /* 196 */
71 u8 raw_s_a_timeout; /* 217 */
72 u8 raw_hc_erase_gap_size; /* 221 */
73 u8 raw_erase_timeout_mult; /* 223 */
74 u8 raw_hc_erase_grp_size; /* 224 */
75 u8 raw_sec_trim_mult; /* 229 */
76 u8 raw_sec_erase_mult; /* 230 */
77 u8 raw_sec_feature_support;/* 231 */
78 u8 raw_trim_mult; /* 232 */
79 u8 raw_sectors[4]; /* 212 - 4 bytes */
67}; 80};
68 81
69struct sd_scr { 82struct sd_scr {
@@ -390,4 +403,4 @@ extern void mmc_unregister_driver(struct mmc_driver *);
390extern void mmc_fixup_device(struct mmc_card *card, 403extern void mmc_fixup_device(struct mmc_card *card,
391 const struct mmc_fixup *table); 404 const struct mmc_fixup *table);
392 405
393#endif 406#endif /* LINUX_MMC_CARD_H */
diff --git a/include/linux/mmc/core.h b/include/linux/mmc/core.h
index b6718e549a51..b8b1b7a311f1 100644
--- a/include/linux/mmc/core.h
+++ b/include/linux/mmc/core.h
@@ -117,6 +117,7 @@ struct mmc_data {
117 117
118 unsigned int sg_len; /* size of scatter list */ 118 unsigned int sg_len; /* size of scatter list */
119 struct scatterlist *sg; /* I/O scatter list */ 119 struct scatterlist *sg; /* I/O scatter list */
120 s32 host_cookie; /* host private data */
120}; 121};
121 122
122struct mmc_request { 123struct mmc_request {
@@ -125,13 +126,16 @@ struct mmc_request {
125 struct mmc_data *data; 126 struct mmc_data *data;
126 struct mmc_command *stop; 127 struct mmc_command *stop;
127 128
128 void *done_data; /* completion data */ 129 struct completion completion;
129 void (*done)(struct mmc_request *);/* completion function */ 130 void (*done)(struct mmc_request *);/* completion function */
130}; 131};
131 132
132struct mmc_host; 133struct mmc_host;
133struct mmc_card; 134struct mmc_card;
135struct mmc_async_req;
134 136
137extern struct mmc_async_req *mmc_start_req(struct mmc_host *,
138 struct mmc_async_req *, int *);
135extern void mmc_wait_for_req(struct mmc_host *, struct mmc_request *); 139extern void mmc_wait_for_req(struct mmc_host *, struct mmc_request *);
136extern int mmc_wait_for_cmd(struct mmc_host *, struct mmc_command *, int); 140extern int mmc_wait_for_cmd(struct mmc_host *, struct mmc_command *, int);
137extern int mmc_app_cmd(struct mmc_host *, struct mmc_card *); 141extern int mmc_app_cmd(struct mmc_host *, struct mmc_card *);
@@ -155,6 +159,7 @@ extern int mmc_can_trim(struct mmc_card *card);
155extern int mmc_can_secure_erase_trim(struct mmc_card *card); 159extern int mmc_can_secure_erase_trim(struct mmc_card *card);
156extern int mmc_erase_group_aligned(struct mmc_card *card, unsigned int from, 160extern int mmc_erase_group_aligned(struct mmc_card *card, unsigned int from,
157 unsigned int nr); 161 unsigned int nr);
162extern unsigned int mmc_calc_max_discard(struct mmc_card *card);
158 163
159extern int mmc_set_blocklen(struct mmc_card *card, unsigned int blocklen); 164extern int mmc_set_blocklen(struct mmc_card *card, unsigned int blocklen);
160 165
@@ -179,4 +184,4 @@ static inline void mmc_claim_host(struct mmc_host *host)
179 184
180extern u32 mmc_vddrange_to_ocrmask(int vdd_min, int vdd_max); 185extern u32 mmc_vddrange_to_ocrmask(int vdd_min, int vdd_max);
181 186
182#endif 187#endif /* LINUX_MMC_CORE_H */
diff --git a/include/linux/mmc/dw_mmc.h b/include/linux/mmc/dw_mmc.h
index bdd7ceeb99e4..6b46819705d1 100644
--- a/include/linux/mmc/dw_mmc.h
+++ b/include/linux/mmc/dw_mmc.h
@@ -11,8 +11,8 @@
11 * (at your option) any later version. 11 * (at your option) any later version.
12 */ 12 */
13 13
14#ifndef _LINUX_MMC_DW_MMC_H_ 14#ifndef LINUX_MMC_DW_MMC_H
15#define _LINUX_MMC_DW_MMC_H_ 15#define LINUX_MMC_DW_MMC_H
16 16
17#define MAX_MCI_SLOTS 2 17#define MAX_MCI_SLOTS 2
18 18
@@ -48,6 +48,7 @@ struct mmc_data;
48 * @data: The data currently being transferred, or NULL if no data 48 * @data: The data currently being transferred, or NULL if no data
49 * transfer is in progress. 49 * transfer is in progress.
50 * @use_dma: Whether DMA channel is initialized or not. 50 * @use_dma: Whether DMA channel is initialized or not.
51 * @using_dma: Whether DMA is in use for the current transfer.
51 * @sg_dma: Bus address of DMA buffer. 52 * @sg_dma: Bus address of DMA buffer.
52 * @sg_cpu: Virtual address of DMA buffer. 53 * @sg_cpu: Virtual address of DMA buffer.
53 * @dma_ops: Pointer to platform-specific DMA callbacks. 54 * @dma_ops: Pointer to platform-specific DMA callbacks.
@@ -74,7 +75,11 @@ struct mmc_data;
74 * @pdev: Platform device associated with the MMC controller. 75 * @pdev: Platform device associated with the MMC controller.
75 * @pdata: Platform data associated with the MMC controller. 76 * @pdata: Platform data associated with the MMC controller.
76 * @slot: Slots sharing this MMC controller. 77 * @slot: Slots sharing this MMC controller.
78 * @fifo_depth: depth of FIFO.
77 * @data_shift: log2 of FIFO item size. 79 * @data_shift: log2 of FIFO item size.
80 * @part_buf_start: Start index in part_buf.
81 * @part_buf_count: Bytes of partial data in part_buf.
82 * @part_buf: Simple buffer for partial fifo reads/writes.
78 * @push_data: Pointer to FIFO push function. 83 * @push_data: Pointer to FIFO push function.
79 * @pull_data: Pointer to FIFO pull function. 84 * @pull_data: Pointer to FIFO pull function.
80 * @quirks: Set of quirks that apply to specific versions of the IP. 85 * @quirks: Set of quirks that apply to specific versions of the IP.
@@ -117,6 +122,7 @@ struct dw_mci {
117 122
118 /* DMA interface members*/ 123 /* DMA interface members*/
119 int use_dma; 124 int use_dma;
125 int using_dma;
120 126
121 dma_addr_t sg_dma; 127 dma_addr_t sg_dma;
122 void *sg_cpu; 128 void *sg_cpu;
@@ -131,7 +137,7 @@ struct dw_mci {
131 u32 stop_cmdr; 137 u32 stop_cmdr;
132 u32 dir_status; 138 u32 dir_status;
133 struct tasklet_struct tasklet; 139 struct tasklet_struct tasklet;
134 struct tasklet_struct card_tasklet; 140 struct work_struct card_work;
135 unsigned long pending_events; 141 unsigned long pending_events;
136 unsigned long completed_events; 142 unsigned long completed_events;
137 enum dw_mci_state state; 143 enum dw_mci_state state;
@@ -146,7 +152,15 @@ struct dw_mci {
146 struct dw_mci_slot *slot[MAX_MCI_SLOTS]; 152 struct dw_mci_slot *slot[MAX_MCI_SLOTS];
147 153
148 /* FIFO push and pull */ 154 /* FIFO push and pull */
155 int fifo_depth;
149 int data_shift; 156 int data_shift;
157 u8 part_buf_start;
158 u8 part_buf_count;
159 union {
160 u16 part_buf16;
161 u32 part_buf32;
162 u64 part_buf;
163 };
150 void (*push_data)(struct dw_mci *host, void *buf, int cnt); 164 void (*push_data)(struct dw_mci *host, void *buf, int cnt);
151 void (*pull_data)(struct dw_mci *host, void *buf, int cnt); 165 void (*pull_data)(struct dw_mci *host, void *buf, int cnt);
152 166
@@ -196,6 +210,12 @@ struct dw_mci_board {
196 unsigned int bus_hz; /* Bus speed */ 210 unsigned int bus_hz; /* Bus speed */
197 211
198 unsigned int caps; /* Capabilities */ 212 unsigned int caps; /* Capabilities */
213 /*
214 * Override fifo depth. If 0, autodetect it from the FIFOTH register,
215 * but note that this may not be reliable after a bootloader has used
216 * it.
217 */
218 unsigned int fifo_depth;
199 219
200 /* delay in mS before detecting cards after interrupt */ 220 /* delay in mS before detecting cards after interrupt */
201 u32 detect_delay_ms; 221 u32 detect_delay_ms;
@@ -219,4 +239,4 @@ struct dw_mci_board {
219 struct block_settings *blk_settings; 239 struct block_settings *blk_settings;
220}; 240};
221 241
222#endif /* _LINUX_MMC_DW_MMC_H_ */ 242#endif /* LINUX_MMC_DW_MMC_H */
diff --git a/include/linux/mmc/host.h b/include/linux/mmc/host.h
index 1ee4424462eb..0f83858147a6 100644
--- a/include/linux/mmc/host.h
+++ b/include/linux/mmc/host.h
@@ -106,6 +106,15 @@ struct mmc_host_ops {
106 */ 106 */
107 int (*enable)(struct mmc_host *host); 107 int (*enable)(struct mmc_host *host);
108 int (*disable)(struct mmc_host *host, int lazy); 108 int (*disable)(struct mmc_host *host, int lazy);
109 /*
110 * It is optional for the host to implement pre_req and post_req in
111 * order to support double buffering of requests (prepare one
112 * request while another request is active).
113 */
114 void (*post_req)(struct mmc_host *host, struct mmc_request *req,
115 int err);
116 void (*pre_req)(struct mmc_host *host, struct mmc_request *req,
117 bool is_first_req);
109 void (*request)(struct mmc_host *host, struct mmc_request *req); 118 void (*request)(struct mmc_host *host, struct mmc_request *req);
110 /* 119 /*
111 * Avoid calling these three functions too often or in a "fast path", 120 * Avoid calling these three functions too often or in a "fast path",
@@ -139,11 +148,22 @@ struct mmc_host_ops {
139 int (*start_signal_voltage_switch)(struct mmc_host *host, struct mmc_ios *ios); 148 int (*start_signal_voltage_switch)(struct mmc_host *host, struct mmc_ios *ios);
140 int (*execute_tuning)(struct mmc_host *host); 149 int (*execute_tuning)(struct mmc_host *host);
141 void (*enable_preset_value)(struct mmc_host *host, bool enable); 150 void (*enable_preset_value)(struct mmc_host *host, bool enable);
151 int (*select_drive_strength)(unsigned int max_dtr, int host_drv, int card_drv);
142}; 152};
143 153
144struct mmc_card; 154struct mmc_card;
145struct device; 155struct device;
146 156
157struct mmc_async_req {
158 /* active mmc request */
159 struct mmc_request *mrq;
160 /*
161 * Check error status of completed mmc request.
162 * Returns 0 if success otherwise non zero.
163 */
164 int (*err_check) (struct mmc_card *, struct mmc_async_req *);
165};
166
147struct mmc_host { 167struct mmc_host {
148 struct device *parent; 168 struct device *parent;
149 struct device class_dev; 169 struct device class_dev;
@@ -231,6 +251,7 @@ struct mmc_host {
231 unsigned int max_req_size; /* maximum number of bytes in one req */ 251 unsigned int max_req_size; /* maximum number of bytes in one req */
232 unsigned int max_blk_size; /* maximum size of one mmc block */ 252 unsigned int max_blk_size; /* maximum size of one mmc block */
233 unsigned int max_blk_count; /* maximum number of blocks in one req */ 253 unsigned int max_blk_count; /* maximum number of blocks in one req */
254 unsigned int max_discard_to; /* max. discard timeout in ms */
234 255
235 /* private data */ 256 /* private data */
236 spinlock_t lock; /* lock for claim and bus ops */ 257 spinlock_t lock; /* lock for claim and bus ops */
@@ -281,6 +302,8 @@ struct mmc_host {
281 302
282 struct dentry *debugfs_root; 303 struct dentry *debugfs_root;
283 304
305 struct mmc_async_req *areq; /* active async req */
306
284 unsigned long private[0] ____cacheline_aligned; 307 unsigned long private[0] ____cacheline_aligned;
285}; 308};
286 309
@@ -373,5 +396,4 @@ static inline int mmc_host_cmd23(struct mmc_host *host)
373{ 396{
374 return host->caps & MMC_CAP_CMD23; 397 return host->caps & MMC_CAP_CMD23;
375} 398}
376#endif 399#endif /* LINUX_MMC_HOST_H */
377
diff --git a/include/linux/mmc/ioctl.h b/include/linux/mmc/ioctl.h
index 5baf2983a12f..8fa5bc5f8059 100644
--- a/include/linux/mmc/ioctl.h
+++ b/include/linux/mmc/ioctl.h
@@ -51,4 +51,4 @@ struct mmc_ioc_cmd {
51 * block device operations. 51 * block device operations.
52 */ 52 */
53#define MMC_IOC_MAX_BYTES (512L * 256) 53#define MMC_IOC_MAX_BYTES (512L * 256)
54#endif /* LINUX_MMC_IOCTL_H */ 54#endif /* LINUX_MMC_IOCTL_H */
diff --git a/include/linux/mmc/mmc.h b/include/linux/mmc/mmc.h
index ac26a685cca8..5a794cb503ea 100644
--- a/include/linux/mmc/mmc.h
+++ b/include/linux/mmc/mmc.h
@@ -21,8 +21,8 @@
21 * 15 May 2002 21 * 15 May 2002
22 */ 22 */
23 23
24#ifndef MMC_MMC_H 24#ifndef LINUX_MMC_MMC_H
25#define MMC_MMC_H 25#define LINUX_MMC_MMC_H
26 26
27/* Standard MMC commands (4.1) type argument response */ 27/* Standard MMC commands (4.1) type argument response */
28 /* class 1 */ 28 /* class 1 */
@@ -140,6 +140,16 @@ static inline bool mmc_op_multi(u32 opcode)
140#define R1_SWITCH_ERROR (1 << 7) /* sx, c */ 140#define R1_SWITCH_ERROR (1 << 7) /* sx, c */
141#define R1_APP_CMD (1 << 5) /* sr, c */ 141#define R1_APP_CMD (1 << 5) /* sr, c */
142 142
143#define R1_STATE_IDLE 0
144#define R1_STATE_READY 1
145#define R1_STATE_IDENT 2
146#define R1_STATE_STBY 3
147#define R1_STATE_TRAN 4
148#define R1_STATE_DATA 5
149#define R1_STATE_RCV 6
150#define R1_STATE_PRG 7
151#define R1_STATE_DIS 8
152
143/* 153/*
144 * MMC/SD in SPI mode reports R1 status always, and R2 for SEND_STATUS 154 * MMC/SD in SPI mode reports R1 status always, and R2 for SEND_STATUS
145 * R1 is the low order byte; R2 is the next highest byte, when present. 155 * R1 is the low order byte; R2 is the next highest byte, when present.
@@ -327,5 +337,4 @@ struct _mmc_csd {
327#define MMC_SWITCH_MODE_CLEAR_BITS 0x02 /* Clear bits which are 1 in value */ 337#define MMC_SWITCH_MODE_CLEAR_BITS 0x02 /* Clear bits which are 1 in value */
328#define MMC_SWITCH_MODE_WRITE_BYTE 0x03 /* Set target to value */ 338#define MMC_SWITCH_MODE_WRITE_BYTE 0x03 /* Set target to value */
329 339
330#endif /* MMC_MMC_PROTOCOL_H */ 340#endif /* LINUX_MMC_MMC_H */
331
diff --git a/include/linux/mmc/pm.h b/include/linux/mmc/pm.h
index d37aac49cf9a..4a139204c20c 100644
--- a/include/linux/mmc/pm.h
+++ b/include/linux/mmc/pm.h
@@ -27,4 +27,4 @@ typedef unsigned int mmc_pm_flag_t;
27#define MMC_PM_KEEP_POWER (1 << 0) /* preserve card power during suspend */ 27#define MMC_PM_KEEP_POWER (1 << 0) /* preserve card power during suspend */
28#define MMC_PM_WAKE_SDIO_IRQ (1 << 1) /* wake up host system on SDIO IRQ assertion */ 28#define MMC_PM_WAKE_SDIO_IRQ (1 << 1) /* wake up host system on SDIO IRQ assertion */
29 29
30#endif 30#endif /* LINUX_MMC_PM_H */
diff --git a/include/linux/mmc/sd.h b/include/linux/mmc/sd.h
index 7d35d52c3df3..1ebcf9ba1256 100644
--- a/include/linux/mmc/sd.h
+++ b/include/linux/mmc/sd.h
@@ -9,8 +9,8 @@
9 * your option) any later version. 9 * your option) any later version.
10 */ 10 */
11 11
12#ifndef MMC_SD_H 12#ifndef LINUX_MMC_SD_H
13#define MMC_SD_H 13#define LINUX_MMC_SD_H
14 14
15/* SD commands type argument response */ 15/* SD commands type argument response */
16 /* class 0 */ 16 /* class 0 */
@@ -91,5 +91,4 @@
91#define SD_SWITCH_ACCESS_DEF 0 91#define SD_SWITCH_ACCESS_DEF 0
92#define SD_SWITCH_ACCESS_HS 1 92#define SD_SWITCH_ACCESS_HS 1
93 93
94#endif 94#endif /* LINUX_MMC_SD_H */
95
diff --git a/include/linux/mmc/sdhci-pltfm.h b/include/linux/mmc/sdhci-pltfm.h
deleted file mode 100644
index 548d59d404cb..000000000000
--- a/include/linux/mmc/sdhci-pltfm.h
+++ /dev/null
@@ -1,35 +0,0 @@
1/*
2 * Platform data declarations for the sdhci-pltfm driver.
3 *
4 * Copyright (c) 2010 MontaVista Software, LLC.
5 *
6 * Author: Anton Vorontsov <avorontsov@ru.mvista.com>
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or (at
11 * your option) any later version.
12 */
13
14#ifndef _SDHCI_PLTFM_H
15#define _SDHCI_PLTFM_H
16
17struct sdhci_ops;
18struct sdhci_host;
19
20/**
21 * struct sdhci_pltfm_data - SDHCI platform-specific information & hooks
22 * @ops: optional pointer to the platform-provided SDHCI ops
23 * @quirks: optional SDHCI quirks
24 * @init: optional hook that is called during device probe, before the
25 * driver tries to access any SDHCI registers
26 * @exit: optional hook that is called during device removal
27 */
28struct sdhci_pltfm_data {
29 struct sdhci_ops *ops;
30 unsigned int quirks;
31 int (*init)(struct sdhci_host *host, struct sdhci_pltfm_data *pdata);
32 void (*exit)(struct sdhci_host *host);
33};
34
35#endif /* _SDHCI_PLTFM_H */
diff --git a/include/linux/mmc/sdhci-spear.h b/include/linux/mmc/sdhci-spear.h
index 9188c973f3e1..5cdc96da9dd5 100644
--- a/include/linux/mmc/sdhci-spear.h
+++ b/include/linux/mmc/sdhci-spear.h
@@ -11,8 +11,8 @@
11 * warranty of any kind, whether express or implied. 11 * warranty of any kind, whether express or implied.
12 */ 12 */
13 13
14#ifndef MMC_SDHCI_SPEAR_H 14#ifndef LINUX_MMC_SDHCI_SPEAR_H
15#define MMC_SDHCI_SPEAR_H 15#define LINUX_MMC_SDHCI_SPEAR_H
16 16
17#include <linux/platform_device.h> 17#include <linux/platform_device.h>
18/* 18/*
@@ -39,4 +39,4 @@ sdhci_set_plat_data(struct platform_device *pdev, struct sdhci_plat_data *data)
39 pdev->dev.platform_data = data; 39 pdev->dev.platform_data = data;
40} 40}
41 41
42#endif /* MMC_SDHCI_SPEAR_H */ 42#endif /* LINUX_MMC_SDHCI_SPEAR_H */
diff --git a/include/linux/mmc/sdhci.h b/include/linux/mmc/sdhci.h
index 6a68c4eb4e44..5666f3abfab7 100644
--- a/include/linux/mmc/sdhci.h
+++ b/include/linux/mmc/sdhci.h
@@ -8,8 +8,8 @@
8 * the Free Software Foundation; either version 2 of the License, or (at 8 * the Free Software Foundation; either version 2 of the License, or (at
9 * your option) any later version. 9 * your option) any later version.
10 */ 10 */
11#ifndef __SDHCI_H 11#ifndef LINUX_MMC_SDHCI_H
12#define __SDHCI_H 12#define LINUX_MMC_SDHCI_H
13 13
14#include <linux/scatterlist.h> 14#include <linux/scatterlist.h>
15#include <linux/compiler.h> 15#include <linux/compiler.h>
@@ -162,4 +162,4 @@ struct sdhci_host {
162 162
163 unsigned long private[0] ____cacheline_aligned; 163 unsigned long private[0] ____cacheline_aligned;
164}; 164};
165#endif /* __SDHCI_H */ 165#endif /* LINUX_MMC_SDHCI_H */
diff --git a/include/linux/mmc/sdio.h b/include/linux/mmc/sdio.h
index 245cdacee544..2a2e9905a247 100644
--- a/include/linux/mmc/sdio.h
+++ b/include/linux/mmc/sdio.h
@@ -9,8 +9,8 @@
9 * your option) any later version. 9 * your option) any later version.
10 */ 10 */
11 11
12#ifndef MMC_SDIO_H 12#ifndef LINUX_MMC_SDIO_H
13#define MMC_SDIO_H 13#define LINUX_MMC_SDIO_H
14 14
15/* SDIO commands type argument response */ 15/* SDIO commands type argument response */
16#define SD_IO_SEND_OP_COND 5 /* bcr [23:0] OCR R4 */ 16#define SD_IO_SEND_OP_COND 5 /* bcr [23:0] OCR R4 */
@@ -161,5 +161,4 @@
161 161
162#define SDIO_FBR_BLKSIZE 0x10 /* block size (2 bytes) */ 162#define SDIO_FBR_BLKSIZE 0x10 /* block size (2 bytes) */
163 163
164#endif 164#endif /* LINUX_MMC_SDIO_H */
165
diff --git a/include/linux/mmc/sdio_func.h b/include/linux/mmc/sdio_func.h
index 31baaf82f458..50f0bc952328 100644
--- a/include/linux/mmc/sdio_func.h
+++ b/include/linux/mmc/sdio_func.h
@@ -9,8 +9,8 @@
9 * your option) any later version. 9 * your option) any later version.
10 */ 10 */
11 11
12#ifndef MMC_SDIO_FUNC_H 12#ifndef LINUX_MMC_SDIO_FUNC_H
13#define MMC_SDIO_FUNC_H 13#define LINUX_MMC_SDIO_FUNC_H
14 14
15#include <linux/device.h> 15#include <linux/device.h>
16#include <linux/mod_devicetable.h> 16#include <linux/mod_devicetable.h>
@@ -161,5 +161,4 @@ extern void sdio_f0_writeb(struct sdio_func *func, unsigned char b,
161extern mmc_pm_flag_t sdio_get_host_pm_caps(struct sdio_func *func); 161extern mmc_pm_flag_t sdio_get_host_pm_caps(struct sdio_func *func);
162extern int sdio_set_host_pm_flags(struct sdio_func *func, mmc_pm_flag_t flags); 162extern int sdio_set_host_pm_flags(struct sdio_func *func, mmc_pm_flag_t flags);
163 163
164#endif 164#endif /* LINUX_MMC_SDIO_FUNC_H */
165
diff --git a/include/linux/mmc/sdio_ids.h b/include/linux/mmc/sdio_ids.h
index a36ab3bc7b03..9f03feedc8e7 100644
--- a/include/linux/mmc/sdio_ids.h
+++ b/include/linux/mmc/sdio_ids.h
@@ -2,8 +2,8 @@
2 * SDIO Classes, Interface Types, Manufacturer IDs, etc. 2 * SDIO Classes, Interface Types, Manufacturer IDs, etc.
3 */ 3 */
4 4
5#ifndef MMC_SDIO_IDS_H 5#ifndef LINUX_MMC_SDIO_IDS_H
6#define MMC_SDIO_IDS_H 6#define LINUX_MMC_SDIO_IDS_H
7 7
8/* 8/*
9 * Standard SDIO Function Interfaces 9 * Standard SDIO Function Interfaces
@@ -44,4 +44,4 @@
44#define SDIO_DEVICE_ID_SIANO_NOVA_A0 0x1100 44#define SDIO_DEVICE_ID_SIANO_NOVA_A0 0x1100
45#define SDIO_DEVICE_ID_SIANO_STELLAR 0x5347 45#define SDIO_DEVICE_ID_SIANO_STELLAR 0x5347
46 46
47#endif 47#endif /* LINUX_MMC_SDIO_IDS_H */
diff --git a/include/linux/mmc/sh_mmcif.h b/include/linux/mmc/sh_mmcif.h
index 9eb9b4b96f55..0222cd8ebe76 100644
--- a/include/linux/mmc/sh_mmcif.h
+++ b/include/linux/mmc/sh_mmcif.h
@@ -11,8 +11,8 @@
11 * 11 *
12 */ 12 */
13 13
14#ifndef __SH_MMCIF_H__ 14#ifndef LINUX_MMC_SH_MMCIF_H
15#define __SH_MMCIF_H__ 15#define LINUX_MMC_SH_MMCIF_H
16 16
17#include <linux/io.h> 17#include <linux/io.h>
18#include <linux/platform_device.h> 18#include <linux/platform_device.h>
@@ -220,4 +220,4 @@ static inline void sh_mmcif_boot_init(void __iomem *base)
220 sh_mmcif_boot_cmd(base, 0x03400040, 0x00010000); 220 sh_mmcif_boot_cmd(base, 0x03400040, 0x00010000);
221} 221}
222 222
223#endif /* __SH_MMCIF_H__ */ 223#endif /* LINUX_MMC_SH_MMCIF_H */
diff --git a/include/linux/mmc/sh_mobile_sdhi.h b/include/linux/mmc/sh_mobile_sdhi.h
index faf32b6ec185..bd50b365167f 100644
--- a/include/linux/mmc/sh_mobile_sdhi.h
+++ b/include/linux/mmc/sh_mobile_sdhi.h
@@ -1,5 +1,5 @@
1#ifndef __SH_MOBILE_SDHI_H__ 1#ifndef LINUX_MMC_SH_MOBILE_SDHI_H
2#define __SH_MOBILE_SDHI_H__ 2#define LINUX_MMC_SH_MOBILE_SDHI_H
3 3
4#include <linux/types.h> 4#include <linux/types.h>
5 5
@@ -17,4 +17,4 @@ struct sh_mobile_sdhi_info {
17 int (*get_cd)(struct platform_device *pdev); 17 int (*get_cd)(struct platform_device *pdev);
18}; 18};
19 19
20#endif /* __SH_MOBILE_SDHI_H__ */ 20#endif /* LINUX_MMC_SH_MOBILE_SDHI_H */
diff --git a/include/linux/mmc/tmio.h b/include/linux/mmc/tmio.h
index 19490b942db0..a1c1f321e519 100644
--- a/include/linux/mmc/tmio.h
+++ b/include/linux/mmc/tmio.h
@@ -12,8 +12,8 @@
12 * 12 *
13 * TC6393XB TC6391XB TC6387XB T7L66XB ASIC3 13 * TC6393XB TC6391XB TC6387XB T7L66XB ASIC3
14 */ 14 */
15#ifndef _LINUX_MMC_TMIO_H_ 15#ifndef LINUX_MMC_TMIO_H
16#define _LINUX_MMC_TMIO_H_ 16#define LINUX_MMC_TMIO_H
17 17
18#define CTL_SD_CMD 0x00 18#define CTL_SD_CMD 0x00
19#define CTL_ARG_REG 0x04 19#define CTL_ARG_REG 0x04
@@ -21,6 +21,7 @@
21#define CTL_XFER_BLK_COUNT 0xa 21#define CTL_XFER_BLK_COUNT 0xa
22#define CTL_RESPONSE 0x0c 22#define CTL_RESPONSE 0x0c
23#define CTL_STATUS 0x1c 23#define CTL_STATUS 0x1c
24#define CTL_STATUS2 0x1e
24#define CTL_IRQ_MASK 0x20 25#define CTL_IRQ_MASK 0x20
25#define CTL_SD_CARD_CLK_CTL 0x24 26#define CTL_SD_CARD_CLK_CTL 0x24
26#define CTL_SD_XFER_LEN 0x26 27#define CTL_SD_XFER_LEN 0x26
@@ -30,6 +31,7 @@
30#define CTL_TRANSACTION_CTL 0x34 31#define CTL_TRANSACTION_CTL 0x34
31#define CTL_SDIO_STATUS 0x36 32#define CTL_SDIO_STATUS 0x36
32#define CTL_SDIO_IRQ_MASK 0x38 33#define CTL_SDIO_IRQ_MASK 0x38
34#define CTL_DMA_ENABLE 0xd8
33#define CTL_RESET_SD 0xe0 35#define CTL_RESET_SD 0xe0
34#define CTL_SDIO_REGS 0x100 36#define CTL_SDIO_REGS 0x100
35#define CTL_CLK_AND_WAIT_CTL 0x138 37#define CTL_CLK_AND_WAIT_CTL 0x138
@@ -60,4 +62,4 @@
60 62
61#define TMIO_BBS 512 /* Boot block size */ 63#define TMIO_BBS 512 /* Boot block size */
62 64
63#endif /* _LINUX_MMC_TMIO_H_ */ 65#endif /* LINUX_MMC_TMIO_H */
diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h
index c928dac6cad0..be1ac8d7789b 100644
--- a/include/linux/mmzone.h
+++ b/include/linux/mmzone.h
@@ -16,7 +16,7 @@
16#include <linux/nodemask.h> 16#include <linux/nodemask.h>
17#include <linux/pageblock-flags.h> 17#include <linux/pageblock-flags.h>
18#include <generated/bounds.h> 18#include <generated/bounds.h>
19#include <asm/atomic.h> 19#include <linux/atomic.h>
20#include <asm/page.h> 20#include <asm/page.h>
21 21
22/* Free memory management - zoned buddy allocator. */ 22/* Free memory management - zoned buddy allocator. */
@@ -158,6 +158,12 @@ static inline int is_unevictable_lru(enum lru_list l)
158 return (l == LRU_UNEVICTABLE); 158 return (l == LRU_UNEVICTABLE);
159} 159}
160 160
161/* Mask used at gathering information at once (see memcontrol.c) */
162#define LRU_ALL_FILE (BIT(LRU_INACTIVE_FILE) | BIT(LRU_ACTIVE_FILE))
163#define LRU_ALL_ANON (BIT(LRU_INACTIVE_ANON) | BIT(LRU_ACTIVE_ANON))
164#define LRU_ALL_EVICTABLE (LRU_ALL_FILE | LRU_ALL_ANON)
165#define LRU_ALL ((1 << NR_LRU_LISTS) - 1)
166
161enum zone_watermarks { 167enum zone_watermarks {
162 WMARK_MIN, 168 WMARK_MIN,
163 WMARK_LOW, 169 WMARK_LOW,
@@ -647,6 +653,13 @@ typedef struct pglist_data {
647#endif 653#endif
648#define nid_page_nr(nid, pagenr) pgdat_page_nr(NODE_DATA(nid),(pagenr)) 654#define nid_page_nr(nid, pagenr) pgdat_page_nr(NODE_DATA(nid),(pagenr))
649 655
656#define node_start_pfn(nid) (NODE_DATA(nid)->node_start_pfn)
657
658#define node_end_pfn(nid) ({\
659 pg_data_t *__pgdat = NODE_DATA(nid);\
660 __pgdat->node_start_pfn + __pgdat->node_spanned_pages;\
661})
662
650#include <linux/memory_hotplug.h> 663#include <linux/memory_hotplug.h>
651 664
652extern struct mutex zonelists_mutex; 665extern struct mutex zonelists_mutex;
diff --git a/include/linux/mnt_namespace.h b/include/linux/mnt_namespace.h
index 0b89efc6f215..29304855652d 100644
--- a/include/linux/mnt_namespace.h
+++ b/include/linux/mnt_namespace.h
@@ -18,7 +18,6 @@ struct proc_mounts {
18 struct seq_file m; /* must be the first element */ 18 struct seq_file m; /* must be the first element */
19 struct mnt_namespace *ns; 19 struct mnt_namespace *ns;
20 struct path root; 20 struct path root;
21 int event;
22}; 21};
23 22
24struct fs_struct; 23struct fs_struct;
diff --git a/include/linux/module.h b/include/linux/module.h
index d9ca2d5dc6d0..1c30087a2d81 100644
--- a/include/linux/module.h
+++ b/include/linux/module.h
@@ -48,10 +48,18 @@ struct modversion_info
48 48
49struct module; 49struct module;
50 50
51struct module_kobject {
52 struct kobject kobj;
53 struct module *mod;
54 struct kobject *drivers_dir;
55 struct module_param_attrs *mp;
56};
57
51struct module_attribute { 58struct module_attribute {
52 struct attribute attr; 59 struct attribute attr;
53 ssize_t (*show)(struct module_attribute *, struct module *, char *); 60 ssize_t (*show)(struct module_attribute *, struct module_kobject *,
54 ssize_t (*store)(struct module_attribute *, struct module *, 61 char *);
62 ssize_t (*store)(struct module_attribute *, struct module_kobject *,
55 const char *, size_t count); 63 const char *, size_t count);
56 void (*setup)(struct module *, const char *); 64 void (*setup)(struct module *, const char *);
57 int (*test)(struct module *); 65 int (*test)(struct module *);
@@ -65,15 +73,9 @@ struct module_version_attribute {
65} __attribute__ ((__aligned__(sizeof(void *)))); 73} __attribute__ ((__aligned__(sizeof(void *))));
66 74
67extern ssize_t __modver_version_show(struct module_attribute *, 75extern ssize_t __modver_version_show(struct module_attribute *,
68 struct module *, char *); 76 struct module_kobject *, char *);
69 77
70struct module_kobject 78extern struct module_attribute module_uevent;
71{
72 struct kobject kobj;
73 struct module *mod;
74 struct kobject *drivers_dir;
75 struct module_param_attrs *mp;
76};
77 79
78/* These are either module local, or the kernel's dummy ones. */ 80/* These are either module local, or the kernel's dummy ones. */
79extern int init_module(void); 81extern int init_module(void);
diff --git a/include/linux/moduleloader.h b/include/linux/moduleloader.h
index c1f40c2f7ffb..b2be02ebf453 100644
--- a/include/linux/moduleloader.h
+++ b/include/linux/moduleloader.h
@@ -5,7 +5,12 @@
5#include <linux/module.h> 5#include <linux/module.h>
6#include <linux/elf.h> 6#include <linux/elf.h>
7 7
8/* These must be implemented by the specific architecture */ 8/* These may be implemented by architectures that need to hook into the
9 * module loader code. Architectures that don't need to do anything special
10 * can just rely on the 'weak' default hooks defined in kernel/module.c.
11 * Note, however, that at least one of apply_relocate or apply_relocate_add
12 * must be implemented by each architecture.
13 */
9 14
10/* Adjust arch-specific sections. Return 0 on success. */ 15/* Adjust arch-specific sections. Return 0 on success. */
11int module_frob_arch_sections(Elf_Ehdr *hdr, 16int module_frob_arch_sections(Elf_Ehdr *hdr,
diff --git a/include/linux/mount.h b/include/linux/mount.h
index 604f122a2326..33fe53d78110 100644
--- a/include/linux/mount.h
+++ b/include/linux/mount.h
@@ -14,7 +14,7 @@
14#include <linux/nodemask.h> 14#include <linux/nodemask.h>
15#include <linux/spinlock.h> 15#include <linux/spinlock.h>
16#include <linux/seqlock.h> 16#include <linux/seqlock.h>
17#include <asm/atomic.h> 17#include <linux/atomic.h>
18 18
19struct super_block; 19struct super_block;
20struct vfsmount; 20struct vfsmount;
diff --git a/include/linux/mtd/physmap.h b/include/linux/mtd/physmap.h
index d40bfa1d9c91..e5f21d293c70 100644
--- a/include/linux/mtd/physmap.h
+++ b/include/linux/mtd/physmap.h
@@ -19,6 +19,7 @@
19#include <linux/mtd/partitions.h> 19#include <linux/mtd/partitions.h>
20 20
21struct map_info; 21struct map_info;
22struct platform_device;
22 23
23struct physmap_flash_data { 24struct physmap_flash_data {
24 unsigned int width; 25 unsigned int width;
diff --git a/include/linux/mtd/ubi.h b/include/linux/mtd/ubi.h
index 15da0e99f48a..db4836bed514 100644
--- a/include/linux/mtd/ubi.h
+++ b/include/linux/mtd/ubi.h
@@ -155,12 +155,14 @@ struct ubi_device_info {
155}; 155};
156 156
157/* 157/*
158 * enum - volume notification types. 158 * Volume notification types.
159 * @UBI_VOLUME_ADDED: volume has been added 159 * @UBI_VOLUME_ADDED: a volume has been added (an UBI device was attached or a
160 * @UBI_VOLUME_REMOVED: start volume volume 160 * volume was created)
161 * @UBI_VOLUME_RESIZED: volume size has been re-sized 161 * @UBI_VOLUME_REMOVED: a volume has been removed (an UBI device was detached
162 * @UBI_VOLUME_RENAMED: volume name has been re-named 162 * or a volume was removed)
163 * @UBI_VOLUME_UPDATED: volume name has been updated 163 * @UBI_VOLUME_RESIZED: a volume has been re-sized
164 * @UBI_VOLUME_RENAMED: a volume has been re-named
165 * @UBI_VOLUME_UPDATED: data has been written to a volume
164 * 166 *
165 * These constants define which type of event has happened when a volume 167 * These constants define which type of event has happened when a volume
166 * notification function is invoked. 168 * notification function is invoked.
diff --git a/include/linux/mutex.h b/include/linux/mutex.h
index a940fe435aca..9121595a8ebf 100644
--- a/include/linux/mutex.h
+++ b/include/linux/mutex.h
@@ -15,7 +15,7 @@
15#include <linux/linkage.h> 15#include <linux/linkage.h>
16#include <linux/lockdep.h> 16#include <linux/lockdep.h>
17 17
18#include <asm/atomic.h> 18#include <linux/atomic.h>
19 19
20/* 20/*
21 * Simple, straightforward mutexes with strict semantics: 21 * Simple, straightforward mutexes with strict semantics:
@@ -92,7 +92,7 @@ do { \
92 \ 92 \
93 __mutex_init((mutex), #mutex, &__key); \ 93 __mutex_init((mutex), #mutex, &__key); \
94} while (0) 94} while (0)
95# define mutex_destroy(mutex) do { } while (0) 95static inline void mutex_destroy(struct mutex *lock) {}
96#endif 96#endif
97 97
98#ifdef CONFIG_DEBUG_LOCK_ALLOC 98#ifdef CONFIG_DEBUG_LOCK_ALLOC
diff --git a/include/linux/namei.h b/include/linux/namei.h
index eba45ea10298..76fe2c62ae71 100644
--- a/include/linux/namei.h
+++ b/include/linux/namei.h
@@ -48,7 +48,6 @@ enum {LAST_NORM, LAST_ROOT, LAST_DOT, LAST_DOTDOT, LAST_BIND};
48 */ 48 */
49#define LOOKUP_FOLLOW 0x0001 49#define LOOKUP_FOLLOW 0x0001
50#define LOOKUP_DIRECTORY 0x0002 50#define LOOKUP_DIRECTORY 0x0002
51#define LOOKUP_CONTINUE 0x0004
52 51
53#define LOOKUP_PARENT 0x0010 52#define LOOKUP_PARENT 0x0010
54#define LOOKUP_REVAL 0x0020 53#define LOOKUP_REVAL 0x0020
@@ -75,9 +74,11 @@ extern int user_path_at(int, const char __user *, unsigned, struct path *);
75 74
76extern int kern_path(const char *, unsigned, struct path *); 75extern int kern_path(const char *, unsigned, struct path *);
77 76
77extern struct dentry *kern_path_create(int, const char *, struct path *, int);
78extern struct dentry *user_path_create(int, const char __user *, struct path *, int);
78extern int kern_path_parent(const char *, struct nameidata *); 79extern int kern_path_parent(const char *, struct nameidata *);
79extern int vfs_path_lookup(struct dentry *, struct vfsmount *, 80extern int vfs_path_lookup(struct dentry *, struct vfsmount *,
80 const char *, unsigned int, struct nameidata *); 81 const char *, unsigned int, struct path *);
81 82
82extern struct file *lookup_instantiate_filp(struct nameidata *nd, struct dentry *dentry, 83extern struct file *lookup_instantiate_filp(struct nameidata *nd, struct dentry *dentry,
83 int (*open)(struct inode *, struct file *)); 84 int (*open)(struct inode *, struct file *));
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index ca333e79e10f..ddee79bb8f15 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -34,8 +34,7 @@
34#include <linux/pm_qos_params.h> 34#include <linux/pm_qos_params.h>
35#include <linux/timer.h> 35#include <linux/timer.h>
36#include <linux/delay.h> 36#include <linux/delay.h>
37#include <linux/mm.h> 37#include <linux/atomic.h>
38#include <asm/atomic.h>
39#include <asm/cache.h> 38#include <asm/cache.h>
40#include <asm/byteorder.h> 39#include <asm/byteorder.h>
41 40
@@ -61,11 +60,6 @@ struct wireless_dev;
61#define SET_ETHTOOL_OPS(netdev,ops) \ 60#define SET_ETHTOOL_OPS(netdev,ops) \
62 ( (netdev)->ethtool_ops = (ops) ) 61 ( (netdev)->ethtool_ops = (ops) )
63 62
64#define HAVE_ALLOC_NETDEV /* feature macro: alloc_xxxdev
65 functions are available. */
66#define HAVE_FREE_NETDEV /* free_netdev() */
67#define HAVE_NETDEV_PRIV /* netdev_priv() */
68
69/* hardware address assignment types */ 63/* hardware address assignment types */
70#define NET_ADDR_PERM 0 /* address is permanent (default) */ 64#define NET_ADDR_PERM 0 /* address is permanent (default) */
71#define NET_ADDR_RANDOM 1 /* address is generated randomly */ 65#define NET_ADDR_RANDOM 1 /* address is generated randomly */
@@ -258,21 +252,8 @@ struct netdev_hw_addr_list {
258 netdev_hw_addr_list_for_each(ha, &(dev)->mc) 252 netdev_hw_addr_list_for_each(ha, &(dev)->mc)
259 253
260struct hh_cache { 254struct hh_cache {
261 struct hh_cache *hh_next; /* Next entry */ 255 u16 hh_len;
262 atomic_t hh_refcnt; /* number of users */ 256 u16 __pad;
263/*
264 * We want hh_output, hh_len, hh_lock and hh_data be a in a separate
265 * cache line on SMP.
266 * They are mostly read, but hh_refcnt may be changed quite frequently,
267 * incurring cache line ping pongs.
268 */
269 __be16 hh_type ____cacheline_aligned_in_smp;
270 /* protocol identifier, f.e ETH_P_IP
271 * NOTE: For VLANs, this will be the
272 * encapuslated type. --BLG
273 */
274 u16 hh_len; /* length of header */
275 int (*hh_output)(struct sk_buff *skb);
276 seqlock_t hh_lock; 257 seqlock_t hh_lock;
277 258
278 /* cached hardware header; allow for machine alignment needs. */ 259 /* cached hardware header; allow for machine alignment needs. */
@@ -284,12 +265,6 @@ struct hh_cache {
284 unsigned long hh_data[HH_DATA_ALIGN(LL_MAX_HEADER) / sizeof(long)]; 265 unsigned long hh_data[HH_DATA_ALIGN(LL_MAX_HEADER) / sizeof(long)];
285}; 266};
286 267
287static inline void hh_cache_put(struct hh_cache *hh)
288{
289 if (atomic_dec_and_test(&hh->hh_refcnt))
290 kfree(hh);
291}
292
293/* Reserve HH_DATA_MOD byte aligned hard_header_len, but at least that much. 268/* Reserve HH_DATA_MOD byte aligned hard_header_len, but at least that much.
294 * Alternative is: 269 * Alternative is:
295 * dev->hard_header_len ? (dev->hard_header_len + 270 * dev->hard_header_len ? (dev->hard_header_len +
@@ -314,8 +289,7 @@ struct header_ops {
314 const void *saddr, unsigned len); 289 const void *saddr, unsigned len);
315 int (*parse)(const struct sk_buff *skb, unsigned char *haddr); 290 int (*parse)(const struct sk_buff *skb, unsigned char *haddr);
316 int (*rebuild)(struct sk_buff *skb); 291 int (*rebuild)(struct sk_buff *skb);
317#define HAVE_HEADER_CACHE 292 int (*cache)(const struct neighbour *neigh, struct hh_cache *hh, __be16 type);
318 int (*cache)(const struct neighbour *neigh, struct hh_cache *hh);
319 void (*cache_update)(struct hh_cache *hh, 293 void (*cache_update)(struct hh_cache *hh,
320 const struct net_device *dev, 294 const struct net_device *dev,
321 const unsigned char *haddr); 295 const unsigned char *haddr);
@@ -556,7 +530,7 @@ struct netdev_queue {
556 struct Qdisc *qdisc; 530 struct Qdisc *qdisc;
557 unsigned long state; 531 unsigned long state;
558 struct Qdisc *qdisc_sleeping; 532 struct Qdisc *qdisc_sleeping;
559#ifdef CONFIG_RPS 533#if defined(CONFIG_RPS) || defined(CONFIG_XPS)
560 struct kobject kobj; 534 struct kobject kobj;
561#endif 535#endif
562#if defined(CONFIG_XPS) && defined(CONFIG_NUMA) 536#if defined(CONFIG_XPS) && defined(CONFIG_NUMA)
@@ -794,12 +768,6 @@ struct netdev_tc_txq {
794 * 3. Update dev->stats asynchronously and atomically, and define 768 * 3. Update dev->stats asynchronously and atomically, and define
795 * neither operation. 769 * neither operation.
796 * 770 *
797 * void (*ndo_vlan_rx_register)(struct net_device *dev, struct vlan_group *grp);
798 * If device support VLAN receive acceleration
799 * (ie. dev->features & NETIF_F_HW_VLAN_RX), then this function is called
800 * when vlan groups for the device changes. Note: grp is NULL
801 * if no vlan's groups are being used.
802 *
803 * void (*ndo_vlan_rx_add_vid)(struct net_device *dev, unsigned short vid); 771 * void (*ndo_vlan_rx_add_vid)(struct net_device *dev, unsigned short vid);
804 * If device support VLAN filtering (dev->features & NETIF_F_HW_VLAN_FILTER) 772 * If device support VLAN filtering (dev->features & NETIF_F_HW_VLAN_FILTER)
805 * this function is called when a VLAN id is registered. 773 * this function is called when a VLAN id is registered.
@@ -888,7 +856,6 @@ struct netdev_tc_txq {
888 * Must return >0 or -errno if it changed dev->features itself. 856 * Must return >0 or -errno if it changed dev->features itself.
889 * 857 *
890 */ 858 */
891#define HAVE_NET_DEVICE_OPS
892struct net_device_ops { 859struct net_device_ops {
893 int (*ndo_init)(struct net_device *dev); 860 int (*ndo_init)(struct net_device *dev);
894 void (*ndo_uninit)(struct net_device *dev); 861 void (*ndo_uninit)(struct net_device *dev);
@@ -919,8 +886,6 @@ struct net_device_ops {
919 struct rtnl_link_stats64 *storage); 886 struct rtnl_link_stats64 *storage);
920 struct net_device_stats* (*ndo_get_stats)(struct net_device *dev); 887 struct net_device_stats* (*ndo_get_stats)(struct net_device *dev);
921 888
922 void (*ndo_vlan_rx_register)(struct net_device *dev,
923 struct vlan_group *grp);
924 void (*ndo_vlan_rx_add_vid)(struct net_device *dev, 889 void (*ndo_vlan_rx_add_vid)(struct net_device *dev,
925 unsigned short vid); 890 unsigned short vid);
926 void (*ndo_vlan_rx_kill_vid)(struct net_device *dev, 891 void (*ndo_vlan_rx_kill_vid)(struct net_device *dev,
@@ -1097,12 +1062,6 @@ struct net_device {
1097#define NETIF_F_ALL_FCOE (NETIF_F_FCOE_CRC | NETIF_F_FCOE_MTU | \ 1062#define NETIF_F_ALL_FCOE (NETIF_F_FCOE_CRC | NETIF_F_FCOE_MTU | \
1098 NETIF_F_FSO) 1063 NETIF_F_FSO)
1099 1064
1100#define NETIF_F_ALL_TX_OFFLOADS (NETIF_F_ALL_CSUM | NETIF_F_SG | \
1101 NETIF_F_FRAGLIST | NETIF_F_ALL_TSO | \
1102 NETIF_F_HIGHDMA | \
1103 NETIF_F_SCTP_CSUM | \
1104 NETIF_F_ALL_FCOE)
1105
1106 /* 1065 /*
1107 * If one device supports one of these features, then enable them 1066 * If one device supports one of these features, then enable them
1108 * for all in netdev_increment_features. 1067 * for all in netdev_increment_features.
@@ -1173,7 +1132,7 @@ struct net_device {
1173 spinlock_t addr_list_lock; 1132 spinlock_t addr_list_lock;
1174 struct netdev_hw_addr_list uc; /* Unicast mac addresses */ 1133 struct netdev_hw_addr_list uc; /* Unicast mac addresses */
1175 struct netdev_hw_addr_list mc; /* Multicast mac addresses */ 1134 struct netdev_hw_addr_list mc; /* Multicast mac addresses */
1176 int uc_promisc; 1135 bool uc_promisc;
1177 unsigned int promiscuity; 1136 unsigned int promiscuity;
1178 unsigned int allmulti; 1137 unsigned int allmulti;
1179 1138
@@ -1220,7 +1179,7 @@ struct net_device {
1220 1179
1221 unsigned char broadcast[MAX_ADDR_LEN]; /* hw bcast add */ 1180 unsigned char broadcast[MAX_ADDR_LEN]; /* hw bcast add */
1222 1181
1223#ifdef CONFIG_RPS 1182#if defined(CONFIG_RPS) || defined(CONFIG_XPS)
1224 struct kset *queues_kset; 1183 struct kset *queues_kset;
1225 1184
1226 struct netdev_rx_queue *_rx; 1185 struct netdev_rx_queue *_rx;
@@ -1348,9 +1307,6 @@ struct net_device {
1348 /* max exchange id for FCoE LRO by ddp */ 1307 /* max exchange id for FCoE LRO by ddp */
1349 unsigned int fcoe_ddp_xid; 1308 unsigned int fcoe_ddp_xid;
1350#endif 1309#endif
1351 /* n-tuple filter list attached to this device */
1352 struct ethtool_rx_ntuple_list ethtool_ntuple_list;
1353
1354 /* phy device may attach itself for hardware timestamping */ 1310 /* phy device may attach itself for hardware timestamping */
1355 struct phy_device *phydev; 1311 struct phy_device *phydev;
1356 1312
@@ -1563,9 +1519,41 @@ struct packet_type {
1563 struct list_head list; 1519 struct list_head list;
1564}; 1520};
1565 1521
1566#include <linux/interrupt.h>
1567#include <linux/notifier.h> 1522#include <linux/notifier.h>
1568 1523
1524/* netdevice notifier chain. Please remember to update the rtnetlink
1525 * notification exclusion list in rtnetlink_event() when adding new
1526 * types.
1527 */
1528#define NETDEV_UP 0x0001 /* For now you can't veto a device up/down */
1529#define NETDEV_DOWN 0x0002
1530#define NETDEV_REBOOT 0x0003 /* Tell a protocol stack a network interface
1531 detected a hardware crash and restarted
1532 - we can use this eg to kick tcp sessions
1533 once done */
1534#define NETDEV_CHANGE 0x0004 /* Notify device state change */
1535#define NETDEV_REGISTER 0x0005
1536#define NETDEV_UNREGISTER 0x0006
1537#define NETDEV_CHANGEMTU 0x0007
1538#define NETDEV_CHANGEADDR 0x0008
1539#define NETDEV_GOING_DOWN 0x0009
1540#define NETDEV_CHANGENAME 0x000A
1541#define NETDEV_FEAT_CHANGE 0x000B
1542#define NETDEV_BONDING_FAILOVER 0x000C
1543#define NETDEV_PRE_UP 0x000D
1544#define NETDEV_PRE_TYPE_CHANGE 0x000E
1545#define NETDEV_POST_TYPE_CHANGE 0x000F
1546#define NETDEV_POST_INIT 0x0010
1547#define NETDEV_UNREGISTER_BATCH 0x0011
1548#define NETDEV_RELEASE 0x0012
1549#define NETDEV_NOTIFY_PEERS 0x0013
1550#define NETDEV_JOIN 0x0014
1551
1552extern int register_netdevice_notifier(struct notifier_block *nb);
1553extern int unregister_netdevice_notifier(struct notifier_block *nb);
1554extern int call_netdevice_notifiers(unsigned long val, struct net_device *dev);
1555
1556
1569extern rwlock_t dev_base_lock; /* Device list lock */ 1557extern rwlock_t dev_base_lock; /* Device list lock */
1570 1558
1571 1559
@@ -1648,12 +1636,9 @@ static inline void unregister_netdevice(struct net_device *dev)
1648extern int netdev_refcnt_read(const struct net_device *dev); 1636extern int netdev_refcnt_read(const struct net_device *dev);
1649extern void free_netdev(struct net_device *dev); 1637extern void free_netdev(struct net_device *dev);
1650extern void synchronize_net(void); 1638extern void synchronize_net(void);
1651extern int register_netdevice_notifier(struct notifier_block *nb);
1652extern int unregister_netdevice_notifier(struct notifier_block *nb);
1653extern int init_dummy_netdev(struct net_device *dev); 1639extern int init_dummy_netdev(struct net_device *dev);
1654extern void netdev_resync_ops(struct net_device *dev); 1640extern void netdev_resync_ops(struct net_device *dev);
1655 1641
1656extern int call_netdevice_notifiers(unsigned long val, struct net_device *dev);
1657extern struct net_device *dev_get_by_index(struct net *net, int ifindex); 1642extern struct net_device *dev_get_by_index(struct net *net, int ifindex);
1658extern struct net_device *__dev_get_by_index(struct net *net, int ifindex); 1643extern struct net_device *__dev_get_by_index(struct net *net, int ifindex);
1659extern struct net_device *dev_get_by_index_rcu(struct net *net, int ifindex); 1644extern struct net_device *dev_get_by_index_rcu(struct net *net, int ifindex);
@@ -1694,9 +1679,12 @@ static inline int skb_gro_header_hard(struct sk_buff *skb, unsigned int hlen)
1694static inline void *skb_gro_header_slow(struct sk_buff *skb, unsigned int hlen, 1679static inline void *skb_gro_header_slow(struct sk_buff *skb, unsigned int hlen,
1695 unsigned int offset) 1680 unsigned int offset)
1696{ 1681{
1682 if (!pskb_may_pull(skb, hlen))
1683 return NULL;
1684
1697 NAPI_GRO_CB(skb)->frag0 = NULL; 1685 NAPI_GRO_CB(skb)->frag0 = NULL;
1698 NAPI_GRO_CB(skb)->frag0_len = 0; 1686 NAPI_GRO_CB(skb)->frag0_len = 0;
1699 return pskb_may_pull(skb, hlen) ? skb->data + offset : NULL; 1687 return skb->data + offset;
1700} 1688}
1701 1689
1702static inline void *skb_gro_mac_header(struct sk_buff *skb) 1690static inline void *skb_gro_mac_header(struct sk_buff *skb)
@@ -1786,8 +1774,6 @@ static inline void input_queue_tail_incr_save(struct softnet_data *sd,
1786 1774
1787DECLARE_PER_CPU_ALIGNED(struct softnet_data, softnet_data); 1775DECLARE_PER_CPU_ALIGNED(struct softnet_data, softnet_data);
1788 1776
1789#define HAVE_NETIF_QUEUE
1790
1791extern void __netif_schedule(struct Qdisc *q); 1777extern void __netif_schedule(struct Qdisc *q);
1792 1778
1793static inline void netif_schedule_queue(struct netdev_queue *txq) 1779static inline void netif_schedule_queue(struct netdev_queue *txq)
@@ -2063,10 +2049,8 @@ extern void dev_kfree_skb_irq(struct sk_buff *skb);
2063 */ 2049 */
2064extern void dev_kfree_skb_any(struct sk_buff *skb); 2050extern void dev_kfree_skb_any(struct sk_buff *skb);
2065 2051
2066#define HAVE_NETIF_RX 1
2067extern int netif_rx(struct sk_buff *skb); 2052extern int netif_rx(struct sk_buff *skb);
2068extern int netif_rx_ni(struct sk_buff *skb); 2053extern int netif_rx_ni(struct sk_buff *skb);
2069#define HAVE_NETIF_RECEIVE_SKB 1
2070extern int netif_receive_skb(struct sk_buff *skb); 2054extern int netif_receive_skb(struct sk_buff *skb);
2071extern gro_result_t dev_gro_receive(struct napi_struct *napi, 2055extern gro_result_t dev_gro_receive(struct napi_struct *napi,
2072 struct sk_buff *skb); 2056 struct sk_buff *skb);
@@ -2246,7 +2230,6 @@ extern void netif_device_attach(struct net_device *dev);
2246/* 2230/*
2247 * Network interface message level settings 2231 * Network interface message level settings
2248 */ 2232 */
2249#define HAVE_NETIF_MSG 1
2250 2233
2251enum { 2234enum {
2252 NETIF_MSG_DRV = 0x0001, 2235 NETIF_MSG_DRV = 0x0001,
@@ -2555,7 +2538,7 @@ extern void netdev_class_remove_file(struct class_attribute *class_attr);
2555 2538
2556extern struct kobj_ns_type_operations net_ns_type_operations; 2539extern struct kobj_ns_type_operations net_ns_type_operations;
2557 2540
2558extern char *netdev_drivername(const struct net_device *dev, char *buffer, int len); 2541extern const char *netdev_drivername(const struct net_device *dev);
2559 2542
2560extern void linkwatch_run_queue(void); 2543extern void linkwatch_run_queue(void);
2561 2544
@@ -2564,7 +2547,6 @@ static inline u32 netdev_get_wanted_features(struct net_device *dev)
2564 return (dev->features & ~dev->hw_features) | dev->wanted_features; 2547 return (dev->features & ~dev->hw_features) | dev->wanted_features;
2565} 2548}
2566u32 netdev_increment_features(u32 all, u32 one, u32 mask); 2549u32 netdev_increment_features(u32 all, u32 one, u32 mask);
2567u32 netdev_fix_features(struct net_device *dev, u32 features);
2568int __netdev_update_features(struct net_device *dev); 2550int __netdev_update_features(struct net_device *dev);
2569void netdev_update_features(struct net_device *dev); 2551void netdev_update_features(struct net_device *dev);
2570void netdev_change_features(struct net_device *dev); 2552void netdev_change_features(struct net_device *dev);
diff --git a/include/linux/netfilter/ipset/ip_set.h b/include/linux/netfilter/ipset/ip_set.h
index 5a262e3ae715..3540c6e262f7 100644
--- a/include/linux/netfilter/ipset/ip_set.h
+++ b/include/linux/netfilter/ipset/ip_set.h
@@ -104,6 +104,8 @@ enum {
104 IPSET_ATTR_NAMEREF, 104 IPSET_ATTR_NAMEREF,
105 IPSET_ATTR_IP2, 105 IPSET_ATTR_IP2,
106 IPSET_ATTR_CIDR2, 106 IPSET_ATTR_CIDR2,
107 IPSET_ATTR_IP2_TO,
108 IPSET_ATTR_IFACE,
107 __IPSET_ATTR_ADT_MAX, 109 __IPSET_ATTR_ADT_MAX,
108}; 110};
109#define IPSET_ATTR_ADT_MAX (__IPSET_ATTR_ADT_MAX - 1) 111#define IPSET_ATTR_ADT_MAX (__IPSET_ATTR_ADT_MAX - 1)
@@ -142,12 +144,18 @@ enum ipset_errno {
142enum ipset_cmd_flags { 144enum ipset_cmd_flags {
143 IPSET_FLAG_BIT_EXIST = 0, 145 IPSET_FLAG_BIT_EXIST = 0,
144 IPSET_FLAG_EXIST = (1 << IPSET_FLAG_BIT_EXIST), 146 IPSET_FLAG_EXIST = (1 << IPSET_FLAG_BIT_EXIST),
147 IPSET_FLAG_BIT_LIST_SETNAME = 1,
148 IPSET_FLAG_LIST_SETNAME = (1 << IPSET_FLAG_BIT_LIST_SETNAME),
149 IPSET_FLAG_BIT_LIST_HEADER = 2,
150 IPSET_FLAG_LIST_HEADER = (1 << IPSET_FLAG_BIT_LIST_HEADER),
145}; 151};
146 152
147/* Flags at CADT attribute level */ 153/* Flags at CADT attribute level */
148enum ipset_cadt_flags { 154enum ipset_cadt_flags {
149 IPSET_FLAG_BIT_BEFORE = 0, 155 IPSET_FLAG_BIT_BEFORE = 0,
150 IPSET_FLAG_BEFORE = (1 << IPSET_FLAG_BIT_BEFORE), 156 IPSET_FLAG_BEFORE = (1 << IPSET_FLAG_BIT_BEFORE),
157 IPSET_FLAG_BIT_PHYSDEV = 1,
158 IPSET_FLAG_PHYSDEV = (1 << IPSET_FLAG_BIT_PHYSDEV),
151}; 159};
152 160
153/* Commands with settype-specific attributes */ 161/* Commands with settype-specific attributes */
@@ -165,6 +173,7 @@ enum ipset_adt {
165#include <linux/ipv6.h> 173#include <linux/ipv6.h>
166#include <linux/netlink.h> 174#include <linux/netlink.h>
167#include <linux/netfilter.h> 175#include <linux/netfilter.h>
176#include <linux/netfilter/x_tables.h>
168#include <linux/vmalloc.h> 177#include <linux/vmalloc.h>
169#include <net/netlink.h> 178#include <net/netlink.h>
170 179
@@ -206,6 +215,8 @@ enum ip_set_feature {
206 IPSET_TYPE_IP2 = (1 << IPSET_TYPE_IP2_FLAG), 215 IPSET_TYPE_IP2 = (1 << IPSET_TYPE_IP2_FLAG),
207 IPSET_TYPE_NAME_FLAG = 4, 216 IPSET_TYPE_NAME_FLAG = 4,
208 IPSET_TYPE_NAME = (1 << IPSET_TYPE_NAME_FLAG), 217 IPSET_TYPE_NAME = (1 << IPSET_TYPE_NAME_FLAG),
218 IPSET_TYPE_IFACE_FLAG = 5,
219 IPSET_TYPE_IFACE = (1 << IPSET_TYPE_IFACE_FLAG),
209 /* Strictly speaking not a feature, but a flag for dumping: 220 /* Strictly speaking not a feature, but a flag for dumping:
210 * this settype must be dumped last */ 221 * this settype must be dumped last */
211 IPSET_DUMP_LAST_FLAG = 7, 222 IPSET_DUMP_LAST_FLAG = 7,
@@ -214,7 +225,17 @@ enum ip_set_feature {
214 225
215struct ip_set; 226struct ip_set;
216 227
217typedef int (*ipset_adtfn)(struct ip_set *set, void *value, u32 timeout); 228typedef int (*ipset_adtfn)(struct ip_set *set, void *value,
229 u32 timeout, u32 flags);
230
231/* Kernel API function options */
232struct ip_set_adt_opt {
233 u8 family; /* Actual protocol family */
234 u8 dim; /* Dimension of match/target */
235 u8 flags; /* Direction and negation flags */
236 u32 cmdflags; /* Command-like flags */
237 u32 timeout; /* Timeout value */
238};
218 239
219/* Set type, variant-specific part */ 240/* Set type, variant-specific part */
220struct ip_set_type_variant { 241struct ip_set_type_variant {
@@ -223,14 +244,15 @@ struct ip_set_type_variant {
223 * zero for no match/success to add/delete 244 * zero for no match/success to add/delete
224 * positive for matching element */ 245 * positive for matching element */
225 int (*kadt)(struct ip_set *set, const struct sk_buff * skb, 246 int (*kadt)(struct ip_set *set, const struct sk_buff * skb,
226 enum ipset_adt adt, u8 pf, u8 dim, u8 flags); 247 const struct xt_action_param *par,
248 enum ipset_adt adt, const struct ip_set_adt_opt *opt);
227 249
228 /* Userspace: test/add/del entries 250 /* Userspace: test/add/del entries
229 * returns negative error code, 251 * returns negative error code,
230 * zero for no match/success to add/delete 252 * zero for no match/success to add/delete
231 * positive for matching element */ 253 * positive for matching element */
232 int (*uadt)(struct ip_set *set, struct nlattr *tb[], 254 int (*uadt)(struct ip_set *set, struct nlattr *tb[],
233 enum ipset_adt adt, u32 *lineno, u32 flags); 255 enum ipset_adt adt, u32 *lineno, u32 flags, bool retried);
234 256
235 /* Low level add/del/test functions */ 257 /* Low level add/del/test functions */
236 ipset_adtfn adt[IPSET_ADT_MAX]; 258 ipset_adtfn adt[IPSET_ADT_MAX];
@@ -268,8 +290,8 @@ struct ip_set_type {
268 u8 dimension; 290 u8 dimension;
269 /* Supported family: may be AF_UNSPEC for both AF_INET/AF_INET6 */ 291 /* Supported family: may be AF_UNSPEC for both AF_INET/AF_INET6 */
270 u8 family; 292 u8 family;
271 /* Type revision */ 293 /* Type revisions */
272 u8 revision; 294 u8 revision_min, revision_max;
273 295
274 /* Create set */ 296 /* Create set */
275 int (*create)(struct ip_set *set, struct nlattr *tb[], u32 flags); 297 int (*create)(struct ip_set *set, struct nlattr *tb[], u32 flags);
@@ -300,6 +322,8 @@ struct ip_set {
300 const struct ip_set_type_variant *variant; 322 const struct ip_set_type_variant *variant;
301 /* The actual INET family of the set */ 323 /* The actual INET family of the set */
302 u8 family; 324 u8 family;
325 /* The type revision */
326 u8 revision;
303 /* The type specific data */ 327 /* The type specific data */
304 void *data; 328 void *data;
305}; 329};
@@ -307,21 +331,25 @@ struct ip_set {
307/* register and unregister set references */ 331/* register and unregister set references */
308extern ip_set_id_t ip_set_get_byname(const char *name, struct ip_set **set); 332extern ip_set_id_t ip_set_get_byname(const char *name, struct ip_set **set);
309extern void ip_set_put_byindex(ip_set_id_t index); 333extern void ip_set_put_byindex(ip_set_id_t index);
310extern const char * ip_set_name_byindex(ip_set_id_t index); 334extern const char *ip_set_name_byindex(ip_set_id_t index);
311extern ip_set_id_t ip_set_nfnl_get(const char *name); 335extern ip_set_id_t ip_set_nfnl_get(const char *name);
312extern ip_set_id_t ip_set_nfnl_get_byindex(ip_set_id_t index); 336extern ip_set_id_t ip_set_nfnl_get_byindex(ip_set_id_t index);
313extern void ip_set_nfnl_put(ip_set_id_t index); 337extern void ip_set_nfnl_put(ip_set_id_t index);
314 338
315/* API for iptables set match, and SET target */ 339/* API for iptables set match, and SET target */
340
316extern int ip_set_add(ip_set_id_t id, const struct sk_buff *skb, 341extern int ip_set_add(ip_set_id_t id, const struct sk_buff *skb,
317 u8 family, u8 dim, u8 flags); 342 const struct xt_action_param *par,
343 const struct ip_set_adt_opt *opt);
318extern int ip_set_del(ip_set_id_t id, const struct sk_buff *skb, 344extern int ip_set_del(ip_set_id_t id, const struct sk_buff *skb,
319 u8 family, u8 dim, u8 flags); 345 const struct xt_action_param *par,
346 const struct ip_set_adt_opt *opt);
320extern int ip_set_test(ip_set_id_t id, const struct sk_buff *skb, 347extern int ip_set_test(ip_set_id_t id, const struct sk_buff *skb,
321 u8 family, u8 dim, u8 flags); 348 const struct xt_action_param *par,
349 const struct ip_set_adt_opt *opt);
322 350
323/* Utility functions */ 351/* Utility functions */
324extern void * ip_set_alloc(size_t size); 352extern void *ip_set_alloc(size_t size);
325extern void ip_set_free(void *members); 353extern void ip_set_free(void *members);
326extern int ip_set_get_ipaddr4(struct nlattr *nla, __be32 *ipaddr); 354extern int ip_set_get_ipaddr4(struct nlattr *nla, __be32 *ipaddr);
327extern int ip_set_get_ipaddr6(struct nlattr *nla, union nf_inet_addr *ipaddr); 355extern int ip_set_get_ipaddr6(struct nlattr *nla, union nf_inet_addr *ipaddr);
@@ -331,7 +359,7 @@ ip_set_get_hostipaddr4(struct nlattr *nla, u32 *ipaddr)
331{ 359{
332 __be32 ip; 360 __be32 ip;
333 int ret = ip_set_get_ipaddr4(nla, &ip); 361 int ret = ip_set_get_ipaddr4(nla, &ip);
334 362
335 if (ret) 363 if (ret)
336 return ret; 364 return ret;
337 *ipaddr = ntohl(ip); 365 *ipaddr = ntohl(ip);
diff --git a/include/linux/netfilter/ipset/ip_set_ahash.h b/include/linux/netfilter/ipset/ip_set_ahash.h
index ac3c822eb39a..b89fb79cb44f 100644
--- a/include/linux/netfilter/ipset/ip_set_ahash.h
+++ b/include/linux/netfilter/ipset/ip_set_ahash.h
@@ -5,6 +5,11 @@
5#include <linux/jhash.h> 5#include <linux/jhash.h>
6#include <linux/netfilter/ipset/ip_set_timeout.h> 6#include <linux/netfilter/ipset/ip_set_timeout.h>
7 7
8#define CONCAT(a, b, c) a##b##c
9#define TOKEN(a, b, c) CONCAT(a, b, c)
10
11#define type_pf_next TOKEN(TYPE, PF, _elem)
12
8/* Hashing which uses arrays to resolve clashing. The hash table is resized 13/* Hashing which uses arrays to resolve clashing. The hash table is resized
9 * (doubled) when searching becomes too long. 14 * (doubled) when searching becomes too long.
10 * Internally jhash is used with the assumption that the size of the 15 * Internally jhash is used with the assumption that the size of the
@@ -23,7 +28,32 @@
23/* Number of elements to store in an initial array block */ 28/* Number of elements to store in an initial array block */
24#define AHASH_INIT_SIZE 4 29#define AHASH_INIT_SIZE 4
25/* Max number of elements to store in an array block */ 30/* Max number of elements to store in an array block */
26#define AHASH_MAX_SIZE (3*4) 31#define AHASH_MAX_SIZE (3*AHASH_INIT_SIZE)
32
33/* Max number of elements can be tuned */
34#ifdef IP_SET_HASH_WITH_MULTI
35#define AHASH_MAX(h) ((h)->ahash_max)
36
37static inline u8
38tune_ahash_max(u8 curr, u32 multi)
39{
40 u32 n;
41
42 if (multi < curr)
43 return curr;
44
45 n = curr + AHASH_INIT_SIZE;
46 /* Currently, at listing one hash bucket must fit into a message.
47 * Therefore we have a hard limit here.
48 */
49 return n > curr && n <= 64 ? n : curr;
50}
51#define TUNE_AHASH_MAX(h, multi) \
52 ((h)->ahash_max = tune_ahash_max((h)->ahash_max, multi))
53#else
54#define AHASH_MAX(h) AHASH_MAX_SIZE
55#define TUNE_AHASH_MAX(h, multi)
56#endif
27 57
28/* A hash bucket */ 58/* A hash bucket */
29struct hbucket { 59struct hbucket {
@@ -38,7 +68,7 @@ struct htable {
38 struct hbucket bucket[0]; /* hashtable buckets */ 68 struct hbucket bucket[0]; /* hashtable buckets */
39}; 69};
40 70
41#define hbucket(h, i) &((h)->bucket[i]) 71#define hbucket(h, i) (&((h)->bucket[i]))
42 72
43/* Book-keeping of the prefixes added to the set */ 73/* Book-keeping of the prefixes added to the set */
44struct ip_set_hash_nets { 74struct ip_set_hash_nets {
@@ -54,9 +84,16 @@ struct ip_set_hash {
54 u32 initval; /* random jhash init value */ 84 u32 initval; /* random jhash init value */
55 u32 timeout; /* timeout value, if enabled */ 85 u32 timeout; /* timeout value, if enabled */
56 struct timer_list gc; /* garbage collection when timeout enabled */ 86 struct timer_list gc; /* garbage collection when timeout enabled */
87 struct type_pf_next next; /* temporary storage for uadd */
88#ifdef IP_SET_HASH_WITH_MULTI
89 u8 ahash_max; /* max elements in an array block */
90#endif
57#ifdef IP_SET_HASH_WITH_NETMASK 91#ifdef IP_SET_HASH_WITH_NETMASK
58 u8 netmask; /* netmask value for subnets to store */ 92 u8 netmask; /* netmask value for subnets to store */
59#endif 93#endif
94#ifdef IP_SET_HASH_WITH_RBTREE
95 struct rb_root rbtree;
96#endif
60#ifdef IP_SET_HASH_WITH_NETS 97#ifdef IP_SET_HASH_WITH_NETS
61 struct ip_set_hash_nets nets[0]; /* book-keeping of prefixes */ 98 struct ip_set_hash_nets nets[0]; /* book-keeping of prefixes */
62#endif 99#endif
@@ -194,17 +231,24 @@ ip_set_hash_destroy(struct ip_set *set)
194 del_timer_sync(&h->gc); 231 del_timer_sync(&h->gc);
195 232
196 ahash_destroy(h->table); 233 ahash_destroy(h->table);
234#ifdef IP_SET_HASH_WITH_RBTREE
235 rbtree_destroy(&h->rbtree);
236#endif
197 kfree(h); 237 kfree(h);
198 238
199 set->data = NULL; 239 set->data = NULL;
200} 240}
201 241
202#define HKEY(data, initval, htable_bits) \
203(jhash2((u32 *)(data), sizeof(struct type_pf_elem)/sizeof(u32), initval) \
204 & jhash_mask(htable_bits))
205
206#endif /* _IP_SET_AHASH_H */ 242#endif /* _IP_SET_AHASH_H */
207 243
244#ifndef HKEY_DATALEN
245#define HKEY_DATALEN sizeof(struct type_pf_elem)
246#endif
247
248#define HKEY(data, initval, htable_bits) \
249(jhash2((u32 *)(data), HKEY_DATALEN/sizeof(u32), initval) \
250 & jhash_mask(htable_bits))
251
208#define CONCAT(a, b, c) a##b##c 252#define CONCAT(a, b, c) a##b##c
209#define TOKEN(a, b, c) CONCAT(a, b, c) 253#define TOKEN(a, b, c) CONCAT(a, b, c)
210 254
@@ -217,6 +261,7 @@ ip_set_hash_destroy(struct ip_set *set)
217#define type_pf_data_netmask TOKEN(TYPE, PF, _data_netmask) 261#define type_pf_data_netmask TOKEN(TYPE, PF, _data_netmask)
218#define type_pf_data_list TOKEN(TYPE, PF, _data_list) 262#define type_pf_data_list TOKEN(TYPE, PF, _data_list)
219#define type_pf_data_tlist TOKEN(TYPE, PF, _data_tlist) 263#define type_pf_data_tlist TOKEN(TYPE, PF, _data_tlist)
264#define type_pf_data_next TOKEN(TYPE, PF, _data_next)
220 265
221#define type_pf_elem TOKEN(TYPE, PF, _elem) 266#define type_pf_elem TOKEN(TYPE, PF, _elem)
222#define type_pf_telem TOKEN(TYPE, PF, _telem) 267#define type_pf_telem TOKEN(TYPE, PF, _telem)
@@ -262,12 +307,13 @@ ip_set_hash_destroy(struct ip_set *set)
262/* Add an element to the hash table when resizing the set: 307/* Add an element to the hash table when resizing the set:
263 * we spare the maintenance of the internal counters. */ 308 * we spare the maintenance of the internal counters. */
264static int 309static int
265type_pf_elem_add(struct hbucket *n, const struct type_pf_elem *value) 310type_pf_elem_add(struct hbucket *n, const struct type_pf_elem *value,
311 u8 ahash_max)
266{ 312{
267 if (n->pos >= n->size) { 313 if (n->pos >= n->size) {
268 void *tmp; 314 void *tmp;
269 315
270 if (n->size >= AHASH_MAX_SIZE) 316 if (n->size >= ahash_max)
271 /* Trigger rehashing */ 317 /* Trigger rehashing */
272 return -EAGAIN; 318 return -EAGAIN;
273 319
@@ -322,7 +368,7 @@ retry:
322 for (j = 0; j < n->pos; j++) { 368 for (j = 0; j < n->pos; j++) {
323 data = ahash_data(n, j); 369 data = ahash_data(n, j);
324 m = hbucket(t, HKEY(data, h->initval, htable_bits)); 370 m = hbucket(t, HKEY(data, h->initval, htable_bits));
325 ret = type_pf_elem_add(m, data); 371 ret = type_pf_elem_add(m, data, AHASH_MAX(h));
326 if (ret < 0) { 372 if (ret < 0) {
327 read_unlock_bh(&set->lock); 373 read_unlock_bh(&set->lock);
328 ahash_destroy(t); 374 ahash_destroy(t);
@@ -346,17 +392,20 @@ retry:
346 return 0; 392 return 0;
347} 393}
348 394
395static inline void
396type_pf_data_next(struct ip_set_hash *h, const struct type_pf_elem *d);
397
349/* Add an element to a hash and update the internal counters when succeeded, 398/* Add an element to a hash and update the internal counters when succeeded,
350 * otherwise report the proper error code. */ 399 * otherwise report the proper error code. */
351static int 400static int
352type_pf_add(struct ip_set *set, void *value, u32 timeout) 401type_pf_add(struct ip_set *set, void *value, u32 timeout, u32 flags)
353{ 402{
354 struct ip_set_hash *h = set->data; 403 struct ip_set_hash *h = set->data;
355 struct htable *t; 404 struct htable *t;
356 const struct type_pf_elem *d = value; 405 const struct type_pf_elem *d = value;
357 struct hbucket *n; 406 struct hbucket *n;
358 int i, ret = 0; 407 int i, ret = 0;
359 u32 key; 408 u32 key, multi = 0;
360 409
361 if (h->elements >= h->maxelem) 410 if (h->elements >= h->maxelem)
362 return -IPSET_ERR_HASH_FULL; 411 return -IPSET_ERR_HASH_FULL;
@@ -366,14 +415,17 @@ type_pf_add(struct ip_set *set, void *value, u32 timeout)
366 key = HKEY(value, h->initval, t->htable_bits); 415 key = HKEY(value, h->initval, t->htable_bits);
367 n = hbucket(t, key); 416 n = hbucket(t, key);
368 for (i = 0; i < n->pos; i++) 417 for (i = 0; i < n->pos; i++)
369 if (type_pf_data_equal(ahash_data(n, i), d)) { 418 if (type_pf_data_equal(ahash_data(n, i), d, &multi)) {
370 ret = -IPSET_ERR_EXIST; 419 ret = -IPSET_ERR_EXIST;
371 goto out; 420 goto out;
372 } 421 }
373 422 TUNE_AHASH_MAX(h, multi);
374 ret = type_pf_elem_add(n, value); 423 ret = type_pf_elem_add(n, value, AHASH_MAX(h));
375 if (ret != 0) 424 if (ret != 0) {
425 if (ret == -EAGAIN)
426 type_pf_data_next(h, d);
376 goto out; 427 goto out;
428 }
377 429
378#ifdef IP_SET_HASH_WITH_NETS 430#ifdef IP_SET_HASH_WITH_NETS
379 add_cidr(h, d->cidr, HOST_MASK); 431 add_cidr(h, d->cidr, HOST_MASK);
@@ -388,7 +440,7 @@ out:
388 * and free up space if possible. 440 * and free up space if possible.
389 */ 441 */
390static int 442static int
391type_pf_del(struct ip_set *set, void *value, u32 timeout) 443type_pf_del(struct ip_set *set, void *value, u32 timeout, u32 flags)
392{ 444{
393 struct ip_set_hash *h = set->data; 445 struct ip_set_hash *h = set->data;
394 struct htable *t = h->table; 446 struct htable *t = h->table;
@@ -396,13 +448,13 @@ type_pf_del(struct ip_set *set, void *value, u32 timeout)
396 struct hbucket *n; 448 struct hbucket *n;
397 int i; 449 int i;
398 struct type_pf_elem *data; 450 struct type_pf_elem *data;
399 u32 key; 451 u32 key, multi = 0;
400 452
401 key = HKEY(value, h->initval, t->htable_bits); 453 key = HKEY(value, h->initval, t->htable_bits);
402 n = hbucket(t, key); 454 n = hbucket(t, key);
403 for (i = 0; i < n->pos; i++) { 455 for (i = 0; i < n->pos; i++) {
404 data = ahash_data(n, i); 456 data = ahash_data(n, i);
405 if (!type_pf_data_equal(data, d)) 457 if (!type_pf_data_equal(data, d, &multi))
406 continue; 458 continue;
407 if (i != n->pos - 1) 459 if (i != n->pos - 1)
408 /* Not last one */ 460 /* Not last one */
@@ -443,17 +495,17 @@ type_pf_test_cidrs(struct ip_set *set, struct type_pf_elem *d, u32 timeout)
443 struct hbucket *n; 495 struct hbucket *n;
444 const struct type_pf_elem *data; 496 const struct type_pf_elem *data;
445 int i, j = 0; 497 int i, j = 0;
446 u32 key; 498 u32 key, multi = 0;
447 u8 host_mask = SET_HOST_MASK(set->family); 499 u8 host_mask = SET_HOST_MASK(set->family);
448 500
449 pr_debug("test by nets\n"); 501 pr_debug("test by nets\n");
450 for (; j < host_mask && h->nets[j].cidr; j++) { 502 for (; j < host_mask && h->nets[j].cidr && !multi; j++) {
451 type_pf_data_netmask(d, h->nets[j].cidr); 503 type_pf_data_netmask(d, h->nets[j].cidr);
452 key = HKEY(d, h->initval, t->htable_bits); 504 key = HKEY(d, h->initval, t->htable_bits);
453 n = hbucket(t, key); 505 n = hbucket(t, key);
454 for (i = 0; i < n->pos; i++) { 506 for (i = 0; i < n->pos; i++) {
455 data = ahash_data(n, i); 507 data = ahash_data(n, i);
456 if (type_pf_data_equal(data, d)) 508 if (type_pf_data_equal(data, d, &multi))
457 return 1; 509 return 1;
458 } 510 }
459 } 511 }
@@ -463,7 +515,7 @@ type_pf_test_cidrs(struct ip_set *set, struct type_pf_elem *d, u32 timeout)
463 515
464/* Test whether the element is added to the set */ 516/* Test whether the element is added to the set */
465static int 517static int
466type_pf_test(struct ip_set *set, void *value, u32 timeout) 518type_pf_test(struct ip_set *set, void *value, u32 timeout, u32 flags)
467{ 519{
468 struct ip_set_hash *h = set->data; 520 struct ip_set_hash *h = set->data;
469 struct htable *t = h->table; 521 struct htable *t = h->table;
@@ -471,7 +523,7 @@ type_pf_test(struct ip_set *set, void *value, u32 timeout)
471 struct hbucket *n; 523 struct hbucket *n;
472 const struct type_pf_elem *data; 524 const struct type_pf_elem *data;
473 int i; 525 int i;
474 u32 key; 526 u32 key, multi = 0;
475 527
476#ifdef IP_SET_HASH_WITH_NETS 528#ifdef IP_SET_HASH_WITH_NETS
477 /* If we test an IP address and not a network address, 529 /* If we test an IP address and not a network address,
@@ -484,7 +536,7 @@ type_pf_test(struct ip_set *set, void *value, u32 timeout)
484 n = hbucket(t, key); 536 n = hbucket(t, key);
485 for (i = 0; i < n->pos; i++) { 537 for (i = 0; i < n->pos; i++) {
486 data = ahash_data(n, i); 538 data = ahash_data(n, i);
487 if (type_pf_data_equal(data, d)) 539 if (type_pf_data_equal(data, d, &multi))
488 return 1; 540 return 1;
489 } 541 }
490 return 0; 542 return 0;
@@ -586,10 +638,11 @@ nla_put_failure:
586 638
587static int 639static int
588type_pf_kadt(struct ip_set *set, const struct sk_buff * skb, 640type_pf_kadt(struct ip_set *set, const struct sk_buff * skb,
589 enum ipset_adt adt, u8 pf, u8 dim, u8 flags); 641 const struct xt_action_param *par,
642 enum ipset_adt adt, const struct ip_set_adt_opt *opt);
590static int 643static int
591type_pf_uadt(struct ip_set *set, struct nlattr *tb[], 644type_pf_uadt(struct ip_set *set, struct nlattr *tb[],
592 enum ipset_adt adt, u32 *lineno, u32 flags); 645 enum ipset_adt adt, u32 *lineno, u32 flags, bool retried);
593 646
594static const struct ip_set_type_variant type_pf_variant = { 647static const struct ip_set_type_variant type_pf_variant = {
595 .kadt = type_pf_kadt, 648 .kadt = type_pf_kadt,
@@ -640,14 +693,14 @@ type_pf_data_timeout_set(struct type_pf_elem *data, u32 timeout)
640 693
641static int 694static int
642type_pf_elem_tadd(struct hbucket *n, const struct type_pf_elem *value, 695type_pf_elem_tadd(struct hbucket *n, const struct type_pf_elem *value,
643 u32 timeout) 696 u8 ahash_max, u32 timeout)
644{ 697{
645 struct type_pf_elem *data; 698 struct type_pf_elem *data;
646 699
647 if (n->pos >= n->size) { 700 if (n->pos >= n->size) {
648 void *tmp; 701 void *tmp;
649 702
650 if (n->size >= AHASH_MAX_SIZE) 703 if (n->size >= ahash_max)
651 /* Trigger rehashing */ 704 /* Trigger rehashing */
652 return -EAGAIN; 705 return -EAGAIN;
653 706
@@ -752,7 +805,7 @@ retry:
752 for (j = 0; j < n->pos; j++) { 805 for (j = 0; j < n->pos; j++) {
753 data = ahash_tdata(n, j); 806 data = ahash_tdata(n, j);
754 m = hbucket(t, HKEY(data, h->initval, htable_bits)); 807 m = hbucket(t, HKEY(data, h->initval, htable_bits));
755 ret = type_pf_elem_tadd(m, data, 808 ret = type_pf_elem_tadd(m, data, AHASH_MAX(h),
756 type_pf_data_timeout(data)); 809 type_pf_data_timeout(data));
757 if (ret < 0) { 810 if (ret < 0) {
758 read_unlock_bh(&set->lock); 811 read_unlock_bh(&set->lock);
@@ -776,15 +829,16 @@ retry:
776} 829}
777 830
778static int 831static int
779type_pf_tadd(struct ip_set *set, void *value, u32 timeout) 832type_pf_tadd(struct ip_set *set, void *value, u32 timeout, u32 flags)
780{ 833{
781 struct ip_set_hash *h = set->data; 834 struct ip_set_hash *h = set->data;
782 struct htable *t = h->table; 835 struct htable *t = h->table;
783 const struct type_pf_elem *d = value; 836 const struct type_pf_elem *d = value;
784 struct hbucket *n; 837 struct hbucket *n;
785 struct type_pf_elem *data; 838 struct type_pf_elem *data;
786 int ret = 0, i, j = AHASH_MAX_SIZE + 1; 839 int ret = 0, i, j = AHASH_MAX(h) + 1;
787 u32 key; 840 bool flag_exist = flags & IPSET_FLAG_EXIST;
841 u32 key, multi = 0;
788 842
789 if (h->elements >= h->maxelem) 843 if (h->elements >= h->maxelem)
790 /* FIXME: when set is full, we slow down here */ 844 /* FIXME: when set is full, we slow down here */
@@ -798,18 +852,18 @@ type_pf_tadd(struct ip_set *set, void *value, u32 timeout)
798 n = hbucket(t, key); 852 n = hbucket(t, key);
799 for (i = 0; i < n->pos; i++) { 853 for (i = 0; i < n->pos; i++) {
800 data = ahash_tdata(n, i); 854 data = ahash_tdata(n, i);
801 if (type_pf_data_equal(data, d)) { 855 if (type_pf_data_equal(data, d, &multi)) {
802 if (type_pf_data_expired(data)) 856 if (type_pf_data_expired(data) || flag_exist)
803 j = i; 857 j = i;
804 else { 858 else {
805 ret = -IPSET_ERR_EXIST; 859 ret = -IPSET_ERR_EXIST;
806 goto out; 860 goto out;
807 } 861 }
808 } else if (j == AHASH_MAX_SIZE + 1 && 862 } else if (j == AHASH_MAX(h) + 1 &&
809 type_pf_data_expired(data)) 863 type_pf_data_expired(data))
810 j = i; 864 j = i;
811 } 865 }
812 if (j != AHASH_MAX_SIZE + 1) { 866 if (j != AHASH_MAX(h) + 1) {
813 data = ahash_tdata(n, j); 867 data = ahash_tdata(n, j);
814#ifdef IP_SET_HASH_WITH_NETS 868#ifdef IP_SET_HASH_WITH_NETS
815 del_cidr(h, data->cidr, HOST_MASK); 869 del_cidr(h, data->cidr, HOST_MASK);
@@ -819,9 +873,13 @@ type_pf_tadd(struct ip_set *set, void *value, u32 timeout)
819 type_pf_data_timeout_set(data, timeout); 873 type_pf_data_timeout_set(data, timeout);
820 goto out; 874 goto out;
821 } 875 }
822 ret = type_pf_elem_tadd(n, d, timeout); 876 TUNE_AHASH_MAX(h, multi);
823 if (ret != 0) 877 ret = type_pf_elem_tadd(n, d, AHASH_MAX(h), timeout);
878 if (ret != 0) {
879 if (ret == -EAGAIN)
880 type_pf_data_next(h, d);
824 goto out; 881 goto out;
882 }
825 883
826#ifdef IP_SET_HASH_WITH_NETS 884#ifdef IP_SET_HASH_WITH_NETS
827 add_cidr(h, d->cidr, HOST_MASK); 885 add_cidr(h, d->cidr, HOST_MASK);
@@ -833,7 +891,7 @@ out:
833} 891}
834 892
835static int 893static int
836type_pf_tdel(struct ip_set *set, void *value, u32 timeout) 894type_pf_tdel(struct ip_set *set, void *value, u32 timeout, u32 flags)
837{ 895{
838 struct ip_set_hash *h = set->data; 896 struct ip_set_hash *h = set->data;
839 struct htable *t = h->table; 897 struct htable *t = h->table;
@@ -841,13 +899,13 @@ type_pf_tdel(struct ip_set *set, void *value, u32 timeout)
841 struct hbucket *n; 899 struct hbucket *n;
842 int i; 900 int i;
843 struct type_pf_elem *data; 901 struct type_pf_elem *data;
844 u32 key; 902 u32 key, multi = 0;
845 903
846 key = HKEY(value, h->initval, t->htable_bits); 904 key = HKEY(value, h->initval, t->htable_bits);
847 n = hbucket(t, key); 905 n = hbucket(t, key);
848 for (i = 0; i < n->pos; i++) { 906 for (i = 0; i < n->pos; i++) {
849 data = ahash_tdata(n, i); 907 data = ahash_tdata(n, i);
850 if (!type_pf_data_equal(data, d)) 908 if (!type_pf_data_equal(data, d, &multi))
851 continue; 909 continue;
852 if (type_pf_data_expired(data)) 910 if (type_pf_data_expired(data))
853 return -IPSET_ERR_EXIST; 911 return -IPSET_ERR_EXIST;
@@ -887,16 +945,16 @@ type_pf_ttest_cidrs(struct ip_set *set, struct type_pf_elem *d, u32 timeout)
887 struct type_pf_elem *data; 945 struct type_pf_elem *data;
888 struct hbucket *n; 946 struct hbucket *n;
889 int i, j = 0; 947 int i, j = 0;
890 u32 key; 948 u32 key, multi = 0;
891 u8 host_mask = SET_HOST_MASK(set->family); 949 u8 host_mask = SET_HOST_MASK(set->family);
892 950
893 for (; j < host_mask && h->nets[j].cidr; j++) { 951 for (; j < host_mask && h->nets[j].cidr && !multi; j++) {
894 type_pf_data_netmask(d, h->nets[j].cidr); 952 type_pf_data_netmask(d, h->nets[j].cidr);
895 key = HKEY(d, h->initval, t->htable_bits); 953 key = HKEY(d, h->initval, t->htable_bits);
896 n = hbucket(t, key); 954 n = hbucket(t, key);
897 for (i = 0; i < n->pos; i++) { 955 for (i = 0; i < n->pos; i++) {
898 data = ahash_tdata(n, i); 956 data = ahash_tdata(n, i);
899 if (type_pf_data_equal(data, d)) 957 if (type_pf_data_equal(data, d, &multi))
900 return !type_pf_data_expired(data); 958 return !type_pf_data_expired(data);
901 } 959 }
902 } 960 }
@@ -905,14 +963,14 @@ type_pf_ttest_cidrs(struct ip_set *set, struct type_pf_elem *d, u32 timeout)
905#endif 963#endif
906 964
907static int 965static int
908type_pf_ttest(struct ip_set *set, void *value, u32 timeout) 966type_pf_ttest(struct ip_set *set, void *value, u32 timeout, u32 flags)
909{ 967{
910 struct ip_set_hash *h = set->data; 968 struct ip_set_hash *h = set->data;
911 struct htable *t = h->table; 969 struct htable *t = h->table;
912 struct type_pf_elem *data, *d = value; 970 struct type_pf_elem *data, *d = value;
913 struct hbucket *n; 971 struct hbucket *n;
914 int i; 972 int i;
915 u32 key; 973 u32 key, multi = 0;
916 974
917#ifdef IP_SET_HASH_WITH_NETS 975#ifdef IP_SET_HASH_WITH_NETS
918 if (d->cidr == SET_HOST_MASK(set->family)) 976 if (d->cidr == SET_HOST_MASK(set->family))
@@ -922,7 +980,7 @@ type_pf_ttest(struct ip_set *set, void *value, u32 timeout)
922 n = hbucket(t, key); 980 n = hbucket(t, key);
923 for (i = 0; i < n->pos; i++) { 981 for (i = 0; i < n->pos; i++) {
924 data = ahash_tdata(n, i); 982 data = ahash_tdata(n, i);
925 if (type_pf_data_equal(data, d)) 983 if (type_pf_data_equal(data, d, &multi))
926 return !type_pf_data_expired(data); 984 return !type_pf_data_expired(data);
927 } 985 }
928 return 0; 986 return 0;
@@ -1030,6 +1088,8 @@ type_pf_gc_init(struct ip_set *set)
1030 IPSET_GC_PERIOD(h->timeout)); 1088 IPSET_GC_PERIOD(h->timeout));
1031} 1089}
1032 1090
1091#undef HKEY_DATALEN
1092#undef HKEY
1033#undef type_pf_data_equal 1093#undef type_pf_data_equal
1034#undef type_pf_data_isnull 1094#undef type_pf_data_isnull
1035#undef type_pf_data_copy 1095#undef type_pf_data_copy
diff --git a/include/linux/netfilter/ipset/ip_set_hash.h b/include/linux/netfilter/ipset/ip_set_hash.h
index b86f15c04524..e2a9fae767f6 100644
--- a/include/linux/netfilter/ipset/ip_set_hash.h
+++ b/include/linux/netfilter/ipset/ip_set_hash.h
@@ -11,6 +11,10 @@ enum {
11 IPSET_ERR_INVALID_PROTO, 11 IPSET_ERR_INVALID_PROTO,
12 /* Protocol missing but must be specified */ 12 /* Protocol missing but must be specified */
13 IPSET_ERR_MISSING_PROTO, 13 IPSET_ERR_MISSING_PROTO,
14 /* Range not supported */
15 IPSET_ERR_HASH_RANGE_UNSUPPORTED,
16 /* Invalid range */
17 IPSET_ERR_HASH_RANGE,
14}; 18};
15 19
16#ifdef __KERNEL__ 20#ifdef __KERNEL__
diff --git a/include/linux/netfilter/ipset/ip_set_timeout.h b/include/linux/netfilter/ipset/ip_set_timeout.h
index bcdd40ad39ed..47923205a4ad 100644
--- a/include/linux/netfilter/ipset/ip_set_timeout.h
+++ b/include/linux/netfilter/ipset/ip_set_timeout.h
@@ -22,6 +22,9 @@
22 22
23#define with_timeout(timeout) ((timeout) != IPSET_NO_TIMEOUT) 23#define with_timeout(timeout) ((timeout) != IPSET_NO_TIMEOUT)
24 24
25#define opt_timeout(opt, map) \
26 (with_timeout((opt)->timeout) ? (opt)->timeout : (map)->timeout)
27
25static inline unsigned int 28static inline unsigned int
26ip_set_timeout_uget(struct nlattr *tb) 29ip_set_timeout_uget(struct nlattr *tb)
27{ 30{
@@ -75,7 +78,7 @@ ip_set_timeout_set(u32 timeout)
75static inline u32 78static inline u32
76ip_set_timeout_get(unsigned long timeout) 79ip_set_timeout_get(unsigned long timeout)
77{ 80{
78 return timeout == IPSET_ELEM_PERMANENT ? 0 : 81 return timeout == IPSET_ELEM_PERMANENT ? 0 :
79 jiffies_to_msecs(timeout - jiffies)/1000; 82 jiffies_to_msecs(timeout - jiffies)/1000;
80} 83}
81 84
diff --git a/include/linux/netfilter/ipset/pfxlen.h b/include/linux/netfilter/ipset/pfxlen.h
index 0e1fb50da562..199fd11fedc0 100644
--- a/include/linux/netfilter/ipset/pfxlen.h
+++ b/include/linux/netfilter/ipset/pfxlen.h
@@ -2,7 +2,8 @@
2#define _PFXLEN_H 2#define _PFXLEN_H
3 3
4#include <asm/byteorder.h> 4#include <asm/byteorder.h>
5#include <linux/netfilter.h> 5#include <linux/netfilter.h>
6#include <net/tcp.h>
6 7
7/* Prefixlen maps, by Jan Engelhardt */ 8/* Prefixlen maps, by Jan Engelhardt */
8extern const union nf_inet_addr ip_set_netmask_map[]; 9extern const union nf_inet_addr ip_set_netmask_map[];
@@ -32,4 +33,12 @@ ip_set_hostmask6(u8 pfxlen)
32 return &ip_set_hostmask_map[pfxlen].ip6[0]; 33 return &ip_set_hostmask_map[pfxlen].ip6[0];
33} 34}
34 35
36extern u32 ip_set_range_to_cidr(u32 from, u32 to, u8 *cidr);
37
38#define ip_set_mask_from_to(from, to, cidr) \
39do { \
40 from &= ip_set_hostmask(cidr); \
41 to = from | ~ip_set_hostmask(cidr); \
42} while (0)
43
35#endif /*_PFXLEN_H */ 44#endif /*_PFXLEN_H */
diff --git a/include/linux/netfilter/nf_conntrack_common.h b/include/linux/netfilter/nf_conntrack_common.h
index 50cdc2559a5a..0d3dd66322ec 100644
--- a/include/linux/netfilter/nf_conntrack_common.h
+++ b/include/linux/netfilter/nf_conntrack_common.h
@@ -18,6 +18,9 @@ enum ip_conntrack_info {
18 /* >= this indicates reply direction */ 18 /* >= this indicates reply direction */
19 IP_CT_IS_REPLY, 19 IP_CT_IS_REPLY,
20 20
21 IP_CT_ESTABLISHED_REPLY = IP_CT_ESTABLISHED + IP_CT_IS_REPLY,
22 IP_CT_RELATED_REPLY = IP_CT_RELATED + IP_CT_IS_REPLY,
23 IP_CT_NEW_REPLY = IP_CT_NEW + IP_CT_IS_REPLY,
21 /* Number of distinct IP_CT types (no NEW in reply dirn). */ 24 /* Number of distinct IP_CT types (no NEW in reply dirn). */
22 IP_CT_NUMBER = IP_CT_IS_REPLY * 2 - 1 25 IP_CT_NUMBER = IP_CT_IS_REPLY * 2 - 1
23}; 26};
diff --git a/include/linux/netfilter/nfnetlink.h b/include/linux/netfilter/nfnetlink.h
index 2b11fc1a86be..74d33861473c 100644
--- a/include/linux/netfilter/nfnetlink.h
+++ b/include/linux/netfilter/nfnetlink.h
@@ -60,6 +60,9 @@ struct nfnl_callback {
60 int (*call)(struct sock *nl, struct sk_buff *skb, 60 int (*call)(struct sock *nl, struct sk_buff *skb,
61 const struct nlmsghdr *nlh, 61 const struct nlmsghdr *nlh,
62 const struct nlattr * const cda[]); 62 const struct nlattr * const cda[]);
63 int (*call_rcu)(struct sock *nl, struct sk_buff *skb,
64 const struct nlmsghdr *nlh,
65 const struct nlattr * const cda[]);
63 const struct nla_policy *policy; /* netlink attribute policy */ 66 const struct nla_policy *policy; /* netlink attribute policy */
64 const u_int16_t attr_count; /* number of nlattr's */ 67 const u_int16_t attr_count; /* number of nlattr's */
65}; 68};
diff --git a/include/linux/netfilter/nfnetlink_queue.h b/include/linux/netfilter/nfnetlink_queue.h
index af94e0014ebd..24b32e6c009e 100644
--- a/include/linux/netfilter/nfnetlink_queue.h
+++ b/include/linux/netfilter/nfnetlink_queue.h
@@ -8,6 +8,7 @@ enum nfqnl_msg_types {
8 NFQNL_MSG_PACKET, /* packet from kernel to userspace */ 8 NFQNL_MSG_PACKET, /* packet from kernel to userspace */
9 NFQNL_MSG_VERDICT, /* verdict from userspace to kernel */ 9 NFQNL_MSG_VERDICT, /* verdict from userspace to kernel */
10 NFQNL_MSG_CONFIG, /* connect to a particular queue */ 10 NFQNL_MSG_CONFIG, /* connect to a particular queue */
11 NFQNL_MSG_VERDICT_BATCH, /* batchv from userspace to kernel */
11 12
12 NFQNL_MSG_MAX 13 NFQNL_MSG_MAX
13}; 14};
diff --git a/include/linux/netfilter/xt_set.h b/include/linux/netfilter/xt_set.h
index 081f1ded2842..c0405ac92870 100644
--- a/include/linux/netfilter/xt_set.h
+++ b/include/linux/netfilter/xt_set.h
@@ -35,7 +35,7 @@ struct xt_set_info_target_v0 {
35 struct xt_set_info_v0 del_set; 35 struct xt_set_info_v0 del_set;
36}; 36};
37 37
38/* Revision 1: current interface to netfilter/iptables */ 38/* Revision 1 match and target */
39 39
40struct xt_set_info { 40struct xt_set_info {
41 ip_set_id_t index; 41 ip_set_id_t index;
@@ -44,13 +44,22 @@ struct xt_set_info {
44}; 44};
45 45
46/* match and target infos */ 46/* match and target infos */
47struct xt_set_info_match { 47struct xt_set_info_match_v1 {
48 struct xt_set_info match_set; 48 struct xt_set_info match_set;
49}; 49};
50 50
51struct xt_set_info_target { 51struct xt_set_info_target_v1 {
52 struct xt_set_info add_set; 52 struct xt_set_info add_set;
53 struct xt_set_info del_set; 53 struct xt_set_info del_set;
54}; 54};
55 55
56/* Revision 2 target */
57
58struct xt_set_info_target_v2 {
59 struct xt_set_info add_set;
60 struct xt_set_info del_set;
61 u32 flags;
62 u32 timeout;
63};
64
56#endif /*_XT_SET_H*/ 65#endif /*_XT_SET_H*/
diff --git a/include/linux/netlink.h b/include/linux/netlink.h
index a9dd89552f9c..2e17c5dbdcb8 100644
--- a/include/linux/netlink.h
+++ b/include/linux/netlink.h
@@ -49,6 +49,7 @@ struct nlmsghdr {
49#define NLM_F_MULTI 2 /* Multipart message, terminated by NLMSG_DONE */ 49#define NLM_F_MULTI 2 /* Multipart message, terminated by NLMSG_DONE */
50#define NLM_F_ACK 4 /* Reply with ack, with zero or error code */ 50#define NLM_F_ACK 4 /* Reply with ack, with zero or error code */
51#define NLM_F_ECHO 8 /* Echo this request */ 51#define NLM_F_ECHO 8 /* Echo this request */
52#define NLM_F_DUMP_INTR 16 /* Dump was inconsistent due to sequence change */
52 53
53/* Modifiers to GET request */ 54/* Modifiers to GET request */
54#define NLM_F_ROOT 0x100 /* specify tree root */ 55#define NLM_F_ROOT 0x100 /* specify tree root */
@@ -221,7 +222,9 @@ struct netlink_callback {
221 int (*dump)(struct sk_buff * skb, 222 int (*dump)(struct sk_buff * skb,
222 struct netlink_callback *cb); 223 struct netlink_callback *cb);
223 int (*done)(struct netlink_callback *cb); 224 int (*done)(struct netlink_callback *cb);
224 int family; 225 u16 family;
226 u16 min_dump_alloc;
227 unsigned int prev_seq, seq;
225 long args[6]; 228 long args[6];
226}; 229};
227 230
@@ -259,7 +262,8 @@ __nlmsg_put(struct sk_buff *skb, u32 pid, u32 seq, int type, int len, int flags)
259extern int netlink_dump_start(struct sock *ssk, struct sk_buff *skb, 262extern int netlink_dump_start(struct sock *ssk, struct sk_buff *skb,
260 const struct nlmsghdr *nlh, 263 const struct nlmsghdr *nlh,
261 int (*dump)(struct sk_buff *skb, struct netlink_callback*), 264 int (*dump)(struct sk_buff *skb, struct netlink_callback*),
262 int (*done)(struct netlink_callback*)); 265 int (*done)(struct netlink_callback*),
266 u16 min_dump_alloc);
263 267
264 268
265#define NL_NONROOT_RECV 0x1 269#define NL_NONROOT_RECV 0x1
diff --git a/include/linux/netpoll.h b/include/linux/netpoll.h
index 79358bb712c6..5dfa091c3347 100644
--- a/include/linux/netpoll.h
+++ b/include/linux/netpoll.h
@@ -40,8 +40,6 @@ struct netpoll_info {
40 struct netpoll *netpoll; 40 struct netpoll *netpoll;
41}; 41};
42 42
43void netpoll_poll_dev(struct net_device *dev);
44void netpoll_poll(struct netpoll *np);
45void netpoll_send_udp(struct netpoll *np, const char *msg, int len); 43void netpoll_send_udp(struct netpoll *np, const char *msg, int len);
46void netpoll_print_options(struct netpoll *np); 44void netpoll_print_options(struct netpoll *np);
47int netpoll_parse_options(struct netpoll *np, char *opt); 45int netpoll_parse_options(struct netpoll *np, char *opt);
diff --git a/include/linux/nfc.h b/include/linux/nfc.h
new file mode 100644
index 000000000000..330a4c5db588
--- /dev/null
+++ b/include/linux/nfc.h
@@ -0,0 +1,126 @@
1/*
2 * Copyright (C) 2011 Instituto Nokia de Tecnologia
3 *
4 * Authors:
5 * Lauro Ramos Venancio <lauro.venancio@openbossa.org>
6 * Aloisio Almeida Jr <aloisio.almeida@openbossa.org>
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the
20 * Free Software Foundation, Inc.,
21 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
22 */
23
24#ifndef __LINUX_NFC_H
25#define __LINUX_NFC_H
26
27#include <linux/types.h>
28#include <linux/socket.h>
29
30#define NFC_GENL_NAME "nfc"
31#define NFC_GENL_VERSION 1
32
33#define NFC_GENL_MCAST_EVENT_NAME "events"
34
35/**
36 * enum nfc_commands - supported nfc commands
37 *
38 * @NFC_CMD_UNSPEC: unspecified command
39 *
40 * @NFC_CMD_GET_DEVICE: request information about a device (requires
41 * %NFC_ATTR_DEVICE_INDEX) or dump request to get a list of all nfc devices
42 * @NFC_CMD_START_POLL: start polling for targets using the given protocols
43 * (requires %NFC_ATTR_DEVICE_INDEX and %NFC_ATTR_PROTOCOLS)
44 * @NFC_CMD_STOP_POLL: stop polling for targets (requires
45 * %NFC_ATTR_DEVICE_INDEX)
46 * @NFC_CMD_GET_TARGET: dump all targets found by the previous poll (requires
47 * %NFC_ATTR_DEVICE_INDEX)
48 * @NFC_EVENT_TARGETS_FOUND: event emitted when a new target is found
49 * (it sends %NFC_ATTR_DEVICE_INDEX)
50 * @NFC_EVENT_DEVICE_ADDED: event emitted when a new device is registred
51 * (it sends %NFC_ATTR_DEVICE_NAME, %NFC_ATTR_DEVICE_INDEX and
52 * %NFC_ATTR_PROTOCOLS)
53 * @NFC_EVENT_DEVICE_REMOVED: event emitted when a device is removed
54 * (it sends %NFC_ATTR_DEVICE_INDEX)
55 */
56enum nfc_commands {
57 NFC_CMD_UNSPEC,
58 NFC_CMD_GET_DEVICE,
59 NFC_CMD_START_POLL,
60 NFC_CMD_STOP_POLL,
61 NFC_CMD_GET_TARGET,
62 NFC_EVENT_TARGETS_FOUND,
63 NFC_EVENT_DEVICE_ADDED,
64 NFC_EVENT_DEVICE_REMOVED,
65/* private: internal use only */
66 __NFC_CMD_AFTER_LAST
67};
68#define NFC_CMD_MAX (__NFC_CMD_AFTER_LAST - 1)
69
70/**
71 * enum nfc_attrs - supported nfc attributes
72 *
73 * @NFC_ATTR_UNSPEC: unspecified attribute
74 *
75 * @NFC_ATTR_DEVICE_INDEX: index of nfc device
76 * @NFC_ATTR_DEVICE_NAME: device name, max 8 chars
77 * @NFC_ATTR_PROTOCOLS: nfc protocols - bitwise or-ed combination from
78 * NFC_PROTO_*_MASK constants
79 * @NFC_ATTR_TARGET_INDEX: index of the nfc target
80 * @NFC_ATTR_TARGET_SENS_RES: NFC-A targets extra information such as NFCID
81 * @NFC_ATTR_TARGET_SEL_RES: NFC-A targets extra information (useful if the
82 * target is not NFC-Forum compliant)
83 */
84enum nfc_attrs {
85 NFC_ATTR_UNSPEC,
86 NFC_ATTR_DEVICE_INDEX,
87 NFC_ATTR_DEVICE_NAME,
88 NFC_ATTR_PROTOCOLS,
89 NFC_ATTR_TARGET_INDEX,
90 NFC_ATTR_TARGET_SENS_RES,
91 NFC_ATTR_TARGET_SEL_RES,
92/* private: internal use only */
93 __NFC_ATTR_AFTER_LAST
94};
95#define NFC_ATTR_MAX (__NFC_ATTR_AFTER_LAST - 1)
96
97#define NFC_DEVICE_NAME_MAXSIZE 8
98
99/* NFC protocols */
100#define NFC_PROTO_JEWEL 1
101#define NFC_PROTO_MIFARE 2
102#define NFC_PROTO_FELICA 3
103#define NFC_PROTO_ISO14443 4
104#define NFC_PROTO_NFC_DEP 5
105
106#define NFC_PROTO_MAX 6
107
108/* NFC protocols masks used in bitsets */
109#define NFC_PROTO_JEWEL_MASK (1 << NFC_PROTO_JEWEL)
110#define NFC_PROTO_MIFARE_MASK (1 << NFC_PROTO_MIFARE)
111#define NFC_PROTO_FELICA_MASK (1 << NFC_PROTO_FELICA)
112#define NFC_PROTO_ISO14443_MASK (1 << NFC_PROTO_ISO14443)
113#define NFC_PROTO_NFC_DEP_MASK (1 << NFC_PROTO_NFC_DEP)
114
115struct sockaddr_nfc {
116 sa_family_t sa_family;
117 __u32 dev_idx;
118 __u32 target_idx;
119 __u32 nfc_protocol;
120};
121
122/* NFC socket protocols */
123#define NFC_SOCKPROTO_RAW 0
124#define NFC_SOCKPROTO_MAX 1
125
126#endif /*__LINUX_NFC_H */
diff --git a/include/linux/nfs.h b/include/linux/nfs.h
index f387919bbc59..8c6ee44914cb 100644
--- a/include/linux/nfs.h
+++ b/include/linux/nfs.h
@@ -29,6 +29,8 @@
29#define NFS_MNT_VERSION 1 29#define NFS_MNT_VERSION 1
30#define NFS_MNT3_VERSION 3 30#define NFS_MNT3_VERSION 3
31 31
32#define NFS_PIPE_DIRNAME "/nfs"
33
32/* 34/*
33 * NFS stats. The good thing with these values is that NFSv3 errors are 35 * NFS stats. The good thing with these values is that NFSv3 errors are
34 * a superset of NFSv2 errors (with the exception of NFSERR_WFLUSH which 36 * a superset of NFSv2 errors (with the exception of NFSERR_WFLUSH which
diff --git a/include/linux/nfs4.h b/include/linux/nfs4.h
index 504b289ba680..76f99e8714f3 100644
--- a/include/linux/nfs4.h
+++ b/include/linux/nfs4.h
@@ -563,6 +563,10 @@ enum {
563 NFSPROC4_CLNT_GETDEVICEINFO, 563 NFSPROC4_CLNT_GETDEVICEINFO,
564 NFSPROC4_CLNT_LAYOUTCOMMIT, 564 NFSPROC4_CLNT_LAYOUTCOMMIT,
565 NFSPROC4_CLNT_LAYOUTRETURN, 565 NFSPROC4_CLNT_LAYOUTRETURN,
566 NFSPROC4_CLNT_SECINFO_NO_NAME,
567 NFSPROC4_CLNT_TEST_STATEID,
568 NFSPROC4_CLNT_FREE_STATEID,
569 NFSPROC4_CLNT_GETDEVICELIST,
566}; 570};
567 571
568/* nfs41 types */ 572/* nfs41 types */
diff --git a/include/linux/nfs_fs.h b/include/linux/nfs_fs.h
index 1b93b9c60e55..eaac770f886e 100644
--- a/include/linux/nfs_fs.h
+++ b/include/linux/nfs_fs.h
@@ -85,7 +85,7 @@ struct nfs_lock_context {
85struct nfs4_state; 85struct nfs4_state;
86struct nfs_open_context { 86struct nfs_open_context {
87 struct nfs_lock_context lock_context; 87 struct nfs_lock_context lock_context;
88 struct path path; 88 struct dentry *dentry;
89 struct rpc_cred *cred; 89 struct rpc_cred *cred;
90 struct nfs4_state *state; 90 struct nfs4_state *state;
91 fmode_t mode; 91 fmode_t mode;
@@ -99,9 +99,10 @@ struct nfs_open_context {
99 99
100struct nfs_open_dir_context { 100struct nfs_open_dir_context {
101 struct rpc_cred *cred; 101 struct rpc_cred *cred;
102 unsigned long attr_gencount;
102 __u64 dir_cookie; 103 __u64 dir_cookie;
103 __u64 dup_cookie; 104 __u64 dup_cookie;
104 int duped; 105 signed char duped;
105}; 106};
106 107
107/* 108/*
@@ -360,7 +361,7 @@ extern int nfs_refresh_inode(struct inode *, struct nfs_fattr *);
360extern int nfs_post_op_update_inode(struct inode *inode, struct nfs_fattr *fattr); 361extern int nfs_post_op_update_inode(struct inode *inode, struct nfs_fattr *fattr);
361extern int nfs_post_op_update_inode_force_wcc(struct inode *inode, struct nfs_fattr *fattr); 362extern int nfs_post_op_update_inode_force_wcc(struct inode *inode, struct nfs_fattr *fattr);
362extern int nfs_getattr(struct vfsmount *, struct dentry *, struct kstat *); 363extern int nfs_getattr(struct vfsmount *, struct dentry *, struct kstat *);
363extern int nfs_permission(struct inode *, int, unsigned int); 364extern int nfs_permission(struct inode *, int);
364extern int nfs_open(struct inode *, struct file *); 365extern int nfs_open(struct inode *, struct file *);
365extern int nfs_release(struct inode *, struct file *); 366extern int nfs_release(struct inode *, struct file *);
366extern int nfs_attribute_timeout(struct inode *inode); 367extern int nfs_attribute_timeout(struct inode *inode);
@@ -372,7 +373,7 @@ extern void nfs_setattr_update_inode(struct inode *inode, struct iattr *attr);
372extern struct nfs_open_context *get_nfs_open_context(struct nfs_open_context *ctx); 373extern struct nfs_open_context *get_nfs_open_context(struct nfs_open_context *ctx);
373extern void put_nfs_open_context(struct nfs_open_context *ctx); 374extern void put_nfs_open_context(struct nfs_open_context *ctx);
374extern struct nfs_open_context *nfs_find_open_context(struct inode *inode, struct rpc_cred *cred, fmode_t mode); 375extern struct nfs_open_context *nfs_find_open_context(struct inode *inode, struct rpc_cred *cred, fmode_t mode);
375extern struct nfs_open_context *alloc_nfs_open_context(struct path *path, struct rpc_cred *cred, fmode_t f_mode); 376extern struct nfs_open_context *alloc_nfs_open_context(struct dentry *dentry, struct rpc_cred *cred, fmode_t f_mode);
376extern void nfs_file_set_open_context(struct file *filp, struct nfs_open_context *ctx); 377extern void nfs_file_set_open_context(struct file *filp, struct nfs_open_context *ctx);
377extern struct nfs_lock_context *nfs_get_lock_context(struct nfs_open_context *ctx); 378extern struct nfs_lock_context *nfs_get_lock_context(struct nfs_open_context *ctx);
378extern void nfs_put_lock_context(struct nfs_lock_context *l_ctx); 379extern void nfs_put_lock_context(struct nfs_lock_context *l_ctx);
@@ -568,12 +569,12 @@ extern struct posix_acl *nfs3_proc_getacl(struct inode *inode, int type);
568extern int nfs3_proc_setacl(struct inode *inode, int type, 569extern int nfs3_proc_setacl(struct inode *inode, int type,
569 struct posix_acl *acl); 570 struct posix_acl *acl);
570extern int nfs3_proc_set_default_acl(struct inode *dir, struct inode *inode, 571extern int nfs3_proc_set_default_acl(struct inode *dir, struct inode *inode,
571 mode_t mode); 572 umode_t mode);
572extern void nfs3_forget_cached_acls(struct inode *inode); 573extern void nfs3_forget_cached_acls(struct inode *inode);
573#else 574#else
574static inline int nfs3_proc_set_default_acl(struct inode *dir, 575static inline int nfs3_proc_set_default_acl(struct inode *dir,
575 struct inode *inode, 576 struct inode *inode,
576 mode_t mode) 577 umode_t mode)
577{ 578{
578 return 0; 579 return 0;
579} 580}
diff --git a/include/linux/nfs_fs_sb.h b/include/linux/nfs_fs_sb.h
index 87694ca86914..b5479df8378d 100644
--- a/include/linux/nfs_fs_sb.h
+++ b/include/linux/nfs_fs_sb.h
@@ -7,7 +7,7 @@
7#include <linux/nfs_xdr.h> 7#include <linux/nfs_xdr.h>
8#include <linux/sunrpc/xprt.h> 8#include <linux/sunrpc/xprt.h>
9 9
10#include <asm/atomic.h> 10#include <linux/atomic.h>
11 11
12struct nfs4_session; 12struct nfs4_session;
13struct nfs_iostats; 13struct nfs_iostats;
@@ -16,6 +16,7 @@ struct nfs4_sequence_args;
16struct nfs4_sequence_res; 16struct nfs4_sequence_res;
17struct nfs_server; 17struct nfs_server;
18struct nfs4_minor_version_ops; 18struct nfs4_minor_version_ops;
19struct server_scope;
19 20
20/* 21/*
21 * The nfs_client identifies our client state to the server. 22 * The nfs_client identifies our client state to the server.
@@ -77,12 +78,13 @@ struct nfs_client {
77 /* The flags used for obtaining the clientid during EXCHANGE_ID */ 78 /* The flags used for obtaining the clientid during EXCHANGE_ID */
78 u32 cl_exchange_flags; 79 u32 cl_exchange_flags;
79 struct nfs4_session *cl_session; /* sharred session */ 80 struct nfs4_session *cl_session; /* sharred session */
80 struct list_head cl_layouts;
81#endif /* CONFIG_NFS_V4 */ 81#endif /* CONFIG_NFS_V4 */
82 82
83#ifdef CONFIG_NFS_FSCACHE 83#ifdef CONFIG_NFS_FSCACHE
84 struct fscache_cookie *fscache; /* client index cache cookie */ 84 struct fscache_cookie *fscache; /* client index cache cookie */
85#endif 85#endif
86
87 struct server_scope *server_scope; /* from exchange_id */
86}; 88};
87 89
88/* 90/*
@@ -129,8 +131,9 @@ struct nfs_server {
129 struct fscache_cookie *fscache; /* superblock cookie */ 131 struct fscache_cookie *fscache; /* superblock cookie */
130#endif 132#endif
131 133
134 u32 pnfs_blksize; /* layout_blksize attr */
132#ifdef CONFIG_NFS_V4 135#ifdef CONFIG_NFS_V4
133 u32 attr_bitmask[2];/* V4 bitmask representing the set 136 u32 attr_bitmask[3];/* V4 bitmask representing the set
134 of attributes supported on this 137 of attributes supported on this
135 filesystem */ 138 filesystem */
136 u32 cache_consistency_bitmask[2]; 139 u32 cache_consistency_bitmask[2];
@@ -143,12 +146,14 @@ struct nfs_server {
143 filesystem */ 146 filesystem */
144 struct pnfs_layoutdriver_type *pnfs_curr_ld; /* Active layout driver */ 147 struct pnfs_layoutdriver_type *pnfs_curr_ld; /* Active layout driver */
145 struct rpc_wait_queue roc_rpcwaitq; 148 struct rpc_wait_queue roc_rpcwaitq;
149 void *pnfs_ld_data; /* per mount point data */
146 150
147 /* the following fields are protected by nfs_client->cl_lock */ 151 /* the following fields are protected by nfs_client->cl_lock */
148 struct rb_root state_owners; 152 struct rb_root state_owners;
149 struct rb_root openowner_id; 153 struct rb_root openowner_id;
150 struct rb_root lockowner_id; 154 struct rb_root lockowner_id;
151#endif 155#endif
156 struct list_head layouts;
152 struct list_head delegations; 157 struct list_head delegations;
153 void (*destroy)(struct nfs_server *); 158 void (*destroy)(struct nfs_server *);
154 159
diff --git a/include/linux/nfs_page.h b/include/linux/nfs_page.h
index 3a34e80ae92f..e2791a27a901 100644
--- a/include/linux/nfs_page.h
+++ b/include/linux/nfs_page.h
@@ -55,20 +55,28 @@ struct nfs_page {
55 struct nfs_writeverf wb_verf; /* Commit cookie */ 55 struct nfs_writeverf wb_verf; /* Commit cookie */
56}; 56};
57 57
58struct nfs_pageio_descriptor;
59struct nfs_pageio_ops {
60 void (*pg_init)(struct nfs_pageio_descriptor *, struct nfs_page *);
61 bool (*pg_test)(struct nfs_pageio_descriptor *, struct nfs_page *, struct nfs_page *);
62 int (*pg_doio)(struct nfs_pageio_descriptor *);
63};
64
58struct nfs_pageio_descriptor { 65struct nfs_pageio_descriptor {
59 struct list_head pg_list; 66 struct list_head pg_list;
60 unsigned long pg_bytes_written; 67 unsigned long pg_bytes_written;
61 size_t pg_count; 68 size_t pg_count;
62 size_t pg_bsize; 69 size_t pg_bsize;
63 unsigned int pg_base; 70 unsigned int pg_base;
64 char pg_moreio; 71 unsigned char pg_moreio : 1,
72 pg_recoalesce : 1;
65 73
66 struct inode *pg_inode; 74 struct inode *pg_inode;
67 int (*pg_doio)(struct nfs_pageio_descriptor *); 75 const struct nfs_pageio_ops *pg_ops;
68 int pg_ioflags; 76 int pg_ioflags;
69 int pg_error; 77 int pg_error;
78 const struct rpc_call_ops *pg_rpc_callops;
70 struct pnfs_layout_segment *pg_lseg; 79 struct pnfs_layout_segment *pg_lseg;
71 bool (*pg_test)(struct nfs_pageio_descriptor *, struct nfs_page *, struct nfs_page *);
72}; 80};
73 81
74#define NFS_WBACK_BUSY(req) (test_bit(PG_BUSY,&(req)->wb_flags)) 82#define NFS_WBACK_BUSY(req) (test_bit(PG_BUSY,&(req)->wb_flags))
@@ -85,19 +93,21 @@ extern int nfs_scan_list(struct nfs_inode *nfsi, struct list_head *dst,
85 pgoff_t idx_start, unsigned int npages, int tag); 93 pgoff_t idx_start, unsigned int npages, int tag);
86extern void nfs_pageio_init(struct nfs_pageio_descriptor *desc, 94extern void nfs_pageio_init(struct nfs_pageio_descriptor *desc,
87 struct inode *inode, 95 struct inode *inode,
88 int (*doio)(struct nfs_pageio_descriptor *desc), 96 const struct nfs_pageio_ops *pg_ops,
89 size_t bsize, 97 size_t bsize,
90 int how); 98 int how);
91extern int nfs_pageio_add_request(struct nfs_pageio_descriptor *, 99extern int nfs_pageio_add_request(struct nfs_pageio_descriptor *,
92 struct nfs_page *); 100 struct nfs_page *);
93extern void nfs_pageio_complete(struct nfs_pageio_descriptor *desc); 101extern void nfs_pageio_complete(struct nfs_pageio_descriptor *desc);
94extern void nfs_pageio_cond_complete(struct nfs_pageio_descriptor *, pgoff_t); 102extern void nfs_pageio_cond_complete(struct nfs_pageio_descriptor *, pgoff_t);
103extern bool nfs_generic_pg_test(struct nfs_pageio_descriptor *desc,
104 struct nfs_page *prev,
105 struct nfs_page *req);
95extern int nfs_wait_on_request(struct nfs_page *); 106extern int nfs_wait_on_request(struct nfs_page *);
96extern void nfs_unlock_request(struct nfs_page *req); 107extern void nfs_unlock_request(struct nfs_page *req);
97extern int nfs_set_page_tag_locked(struct nfs_page *req); 108extern int nfs_set_page_tag_locked(struct nfs_page *req);
98extern void nfs_clear_page_tag_locked(struct nfs_page *req); 109extern void nfs_clear_page_tag_locked(struct nfs_page *req);
99 110
100
101/* 111/*
102 * Lock the page of an asynchronous request without getting a new reference 112 * Lock the page of an asynchronous request without getting a new reference
103 */ 113 */
diff --git a/include/linux/nfs_xdr.h b/include/linux/nfs_xdr.h
index 5e8444a11adf..abd615d74a29 100644
--- a/include/linux/nfs_xdr.h
+++ b/include/linux/nfs_xdr.h
@@ -122,6 +122,7 @@ struct nfs_fsinfo {
122 struct timespec time_delta; /* server time granularity */ 122 struct timespec time_delta; /* server time granularity */
123 __u32 lease_time; /* in seconds */ 123 __u32 lease_time; /* in seconds */
124 __u32 layouttype; /* supported pnfs layout driver */ 124 __u32 layouttype; /* supported pnfs layout driver */
125 __u32 blksize; /* preferred pnfs io block size */
125}; 126};
126 127
127struct nfs_fsstat { 128struct nfs_fsstat {
@@ -158,7 +159,6 @@ struct nfs_seqid;
158 159
159/* nfs41 sessions channel attributes */ 160/* nfs41 sessions channel attributes */
160struct nfs4_channel_attrs { 161struct nfs4_channel_attrs {
161 u32 headerpadsz;
162 u32 max_rqst_sz; 162 u32 max_rqst_sz;
163 u32 max_resp_sz; 163 u32 max_resp_sz;
164 u32 max_resp_sz_cached; 164 u32 max_resp_sz_cached;
@@ -236,6 +236,17 @@ struct nfs4_layoutget {
236 gfp_t gfp_flags; 236 gfp_t gfp_flags;
237}; 237};
238 238
239struct nfs4_getdevicelist_args {
240 const struct nfs_fh *fh;
241 u32 layoutclass;
242 struct nfs4_sequence_args seq_args;
243};
244
245struct nfs4_getdevicelist_res {
246 struct pnfs_devicelist *devlist;
247 struct nfs4_sequence_res seq_res;
248};
249
239struct nfs4_getdeviceinfo_args { 250struct nfs4_getdeviceinfo_args {
240 struct pnfs_device *pdev; 251 struct pnfs_device *pdev;
241 struct nfs4_sequence_args seq_args; 252 struct nfs4_sequence_args seq_args;
@@ -258,21 +269,23 @@ struct nfs4_layoutcommit_res {
258 struct nfs_fattr *fattr; 269 struct nfs_fattr *fattr;
259 const struct nfs_server *server; 270 const struct nfs_server *server;
260 struct nfs4_sequence_res seq_res; 271 struct nfs4_sequence_res seq_res;
272 int status;
261}; 273};
262 274
263struct nfs4_layoutcommit_data { 275struct nfs4_layoutcommit_data {
264 struct rpc_task task; 276 struct rpc_task task;
265 struct nfs_fattr fattr; 277 struct nfs_fattr fattr;
266 struct pnfs_layout_segment *lseg; 278 struct list_head lseg_list;
267 struct rpc_cred *cred; 279 struct rpc_cred *cred;
268 struct nfs4_layoutcommit_args args; 280 struct nfs4_layoutcommit_args args;
269 struct nfs4_layoutcommit_res res; 281 struct nfs4_layoutcommit_res res;
270}; 282};
271 283
272struct nfs4_layoutreturn_args { 284struct nfs4_layoutreturn_args {
273 __u32 layout_type; 285 struct pnfs_layout_hdr *layout;
274 struct inode *inode; 286 struct inode *inode;
275 nfs4_stateid stateid; 287 nfs4_stateid stateid;
288 __u32 layout_type;
276 struct nfs4_sequence_args seq_args; 289 struct nfs4_sequence_args seq_args;
277}; 290};
278 291
@@ -760,6 +773,11 @@ struct nfs3_getaclres {
760 struct posix_acl * acl_default; 773 struct posix_acl * acl_default;
761}; 774};
762 775
776struct nfs4_string {
777 unsigned int len;
778 char *data;
779};
780
763#ifdef CONFIG_NFS_V4 781#ifdef CONFIG_NFS_V4
764 782
765typedef u64 clientid4; 783typedef u64 clientid4;
@@ -943,18 +961,13 @@ struct nfs4_server_caps_arg {
943}; 961};
944 962
945struct nfs4_server_caps_res { 963struct nfs4_server_caps_res {
946 u32 attr_bitmask[2]; 964 u32 attr_bitmask[3];
947 u32 acl_bitmask; 965 u32 acl_bitmask;
948 u32 has_links; 966 u32 has_links;
949 u32 has_symlinks; 967 u32 has_symlinks;
950 struct nfs4_sequence_res seq_res; 968 struct nfs4_sequence_res seq_res;
951}; 969};
952 970
953struct nfs4_string {
954 unsigned int len;
955 char *data;
956};
957
958#define NFS4_PATHNAME_MAXCOMPONENTS 512 971#define NFS4_PATHNAME_MAXCOMPONENTS 512
959struct nfs4_pathname { 972struct nfs4_pathname {
960 unsigned int ncomponents; 973 unsigned int ncomponents;
@@ -1061,6 +1074,7 @@ struct server_scope {
1061struct nfs41_exchange_id_res { 1074struct nfs41_exchange_id_res {
1062 struct nfs_client *client; 1075 struct nfs_client *client;
1063 u32 flags; 1076 u32 flags;
1077 struct server_scope *server_scope;
1064}; 1078};
1065 1079
1066struct nfs41_create_session_args { 1080struct nfs41_create_session_args {
@@ -1084,6 +1098,34 @@ struct nfs41_reclaim_complete_args {
1084struct nfs41_reclaim_complete_res { 1098struct nfs41_reclaim_complete_res {
1085 struct nfs4_sequence_res seq_res; 1099 struct nfs4_sequence_res seq_res;
1086}; 1100};
1101
1102#define SECINFO_STYLE_CURRENT_FH 0
1103#define SECINFO_STYLE_PARENT 1
1104struct nfs41_secinfo_no_name_args {
1105 int style;
1106 struct nfs4_sequence_args seq_args;
1107};
1108
1109struct nfs41_test_stateid_args {
1110 nfs4_stateid *stateid;
1111 struct nfs4_sequence_args seq_args;
1112};
1113
1114struct nfs41_test_stateid_res {
1115 unsigned int status;
1116 struct nfs4_sequence_res seq_res;
1117};
1118
1119struct nfs41_free_stateid_args {
1120 nfs4_stateid *stateid;
1121 struct nfs4_sequence_args seq_args;
1122};
1123
1124struct nfs41_free_stateid_res {
1125 unsigned int status;
1126 struct nfs4_sequence_res seq_res;
1127};
1128
1087#endif /* CONFIG_NFS_V4_1 */ 1129#endif /* CONFIG_NFS_V4_1 */
1088 1130
1089struct nfs_page; 1131struct nfs_page;
@@ -1097,6 +1139,7 @@ struct nfs_read_data {
1097 struct rpc_cred *cred; 1139 struct rpc_cred *cred;
1098 struct nfs_fattr fattr; /* fattr storage */ 1140 struct nfs_fattr fattr; /* fattr storage */
1099 struct list_head pages; /* Coalesced read requests */ 1141 struct list_head pages; /* Coalesced read requests */
1142 struct list_head list; /* lists of struct nfs_read_data */
1100 struct nfs_page *req; /* multi ops per nfs_page */ 1143 struct nfs_page *req; /* multi ops per nfs_page */
1101 struct page **pagevec; 1144 struct page **pagevec;
1102 unsigned int npages; /* Max length of pagevec */ 1145 unsigned int npages; /* Max length of pagevec */
@@ -1120,6 +1163,7 @@ struct nfs_write_data {
1120 struct nfs_fattr fattr; 1163 struct nfs_fattr fattr;
1121 struct nfs_writeverf verf; 1164 struct nfs_writeverf verf;
1122 struct list_head pages; /* Coalesced requests we wish to flush */ 1165 struct list_head pages; /* Coalesced requests we wish to flush */
1166 struct list_head list; /* lists of struct nfs_write_data */
1123 struct nfs_page *req; /* multi ops per nfs_page */ 1167 struct nfs_page *req; /* multi ops per nfs_page */
1124 struct page **pagevec; 1168 struct page **pagevec;
1125 unsigned int npages; /* Max length of pagevec */ 1169 unsigned int npages; /* Max length of pagevec */
diff --git a/include/linux/nfsd/export.h b/include/linux/nfsd/export.h
index 84058ec69390..8a31a20efe7e 100644
--- a/include/linux/nfsd/export.h
+++ b/include/linux/nfsd/export.h
@@ -133,8 +133,6 @@ __be32 check_nfsd_access(struct svc_export *exp, struct svc_rqst *rqstp);
133int nfsd_export_init(void); 133int nfsd_export_init(void);
134void nfsd_export_shutdown(void); 134void nfsd_export_shutdown(void);
135void nfsd_export_flush(void); 135void nfsd_export_flush(void);
136void exp_readlock(void);
137void exp_readunlock(void);
138struct svc_export * rqst_exp_get_by_name(struct svc_rqst *, 136struct svc_export * rqst_exp_get_by_name(struct svc_rqst *,
139 struct path *); 137 struct path *);
140struct svc_export * rqst_exp_parent(struct svc_rqst *, 138struct svc_export * rqst_exp_parent(struct svc_rqst *,
diff --git a/include/linux/nl80211.h b/include/linux/nl80211.h
index c7ccaae15af6..8ad70dcac3f9 100644
--- a/include/linux/nl80211.h
+++ b/include/linux/nl80211.h
@@ -6,7 +6,7 @@
6 * Copyright 2006-2010 Johannes Berg <johannes@sipsolutions.net> 6 * Copyright 2006-2010 Johannes Berg <johannes@sipsolutions.net>
7 * Copyright 2008 Michael Wu <flamingice@sourmilk.net> 7 * Copyright 2008 Michael Wu <flamingice@sourmilk.net>
8 * Copyright 2008 Luis Carlos Cobo <luisca@cozybit.com> 8 * Copyright 2008 Luis Carlos Cobo <luisca@cozybit.com>
9 * Copyright 2008 Michael Buesch <mb@bu3sch.de> 9 * Copyright 2008 Michael Buesch <m@bues.ch>
10 * Copyright 2008, 2009 Luis R. Rodriguez <lrodriguez@atheros.com> 10 * Copyright 2008, 2009 Luis R. Rodriguez <lrodriguez@atheros.com>
11 * Copyright 2008 Jouni Malinen <jouni.malinen@atheros.com> 11 * Copyright 2008 Jouni Malinen <jouni.malinen@atheros.com>
12 * Copyright 2008 Colin McCabe <colin@cozybit.com> 12 * Copyright 2008 Colin McCabe <colin@cozybit.com>
@@ -247,7 +247,8 @@
247 * passed, all channels allowed for the current regulatory domain 247 * passed, all channels allowed for the current regulatory domain
248 * are used. Extra IEs can also be passed from the userspace by 248 * are used. Extra IEs can also be passed from the userspace by
249 * using the %NL80211_ATTR_IE attribute. 249 * using the %NL80211_ATTR_IE attribute.
250 * @NL80211_CMD_STOP_SCHED_SCAN: stop a scheduled scan 250 * @NL80211_CMD_STOP_SCHED_SCAN: stop a scheduled scan. Returns -ENOENT
251 * if scheduled scan is not running.
251 * @NL80211_CMD_SCHED_SCAN_RESULTS: indicates that there are scheduled scan 252 * @NL80211_CMD_SCHED_SCAN_RESULTS: indicates that there are scheduled scan
252 * results available. 253 * results available.
253 * @NL80211_CMD_SCHED_SCAN_STOPPED: indicates that the scheduled scan has 254 * @NL80211_CMD_SCHED_SCAN_STOPPED: indicates that the scheduled scan has
@@ -483,6 +484,14 @@
483 * more background information, see 484 * more background information, see
484 * http://wireless.kernel.org/en/users/Documentation/WoWLAN. 485 * http://wireless.kernel.org/en/users/Documentation/WoWLAN.
485 * 486 *
487 * @NL80211_CMD_SET_REKEY_OFFLOAD: This command is used give the driver
488 * the necessary information for supporting GTK rekey offload. This
489 * feature is typically used during WoWLAN. The configuration data
490 * is contained in %NL80211_ATTR_REKEY_DATA (which is nested and
491 * contains the data in sub-attributes). After rekeying happened,
492 * this command may also be sent by the driver as an MLME event to
493 * inform userspace of the new replay counter.
494 *
486 * @NL80211_CMD_MAX: highest used command number 495 * @NL80211_CMD_MAX: highest used command number
487 * @__NL80211_CMD_AFTER_LAST: internal use 496 * @__NL80211_CMD_AFTER_LAST: internal use
488 */ 497 */
@@ -605,6 +614,8 @@ enum nl80211_commands {
605 NL80211_CMD_SCHED_SCAN_RESULTS, 614 NL80211_CMD_SCHED_SCAN_RESULTS,
606 NL80211_CMD_SCHED_SCAN_STOPPED, 615 NL80211_CMD_SCHED_SCAN_STOPPED,
607 616
617 NL80211_CMD_SET_REKEY_OFFLOAD,
618
608 /* add new commands above here */ 619 /* add new commands above here */
609 620
610 /* used to define NL80211_CMD_MAX below */ 621 /* used to define NL80211_CMD_MAX below */
@@ -745,8 +756,12 @@ enum nl80211_commands {
745 * 756 *
746 * @NL80211_ATTR_MAX_NUM_SCAN_SSIDS: number of SSIDs you can scan with 757 * @NL80211_ATTR_MAX_NUM_SCAN_SSIDS: number of SSIDs you can scan with
747 * a single scan request, a wiphy attribute. 758 * a single scan request, a wiphy attribute.
759 * @NL80211_ATTR_MAX_NUM_SCHED_SCAN_SSIDS: number of SSIDs you can
760 * scan with a single scheduled scan request, a wiphy attribute.
748 * @NL80211_ATTR_MAX_SCAN_IE_LEN: maximum length of information elements 761 * @NL80211_ATTR_MAX_SCAN_IE_LEN: maximum length of information elements
749 * that can be added to a scan request 762 * that can be added to a scan request
763 * @NL80211_ATTR_MAX_SCHED_SCAN_IE_LEN: maximum length of information
764 * elements that can be added to a scheduled scan request
750 * 765 *
751 * @NL80211_ATTR_SCAN_FREQUENCIES: nested attribute with frequencies (in MHz) 766 * @NL80211_ATTR_SCAN_FREQUENCIES: nested attribute with frequencies (in MHz)
752 * @NL80211_ATTR_SCAN_SSIDS: nested attribute with SSIDs, leave out for passive 767 * @NL80211_ATTR_SCAN_SSIDS: nested attribute with SSIDs, leave out for passive
@@ -978,8 +993,8 @@ enum nl80211_commands {
978 * driving the peer link management state machine. 993 * driving the peer link management state machine.
979 * @NL80211_MESH_SETUP_USERSPACE_AMPE must be enabled. 994 * @NL80211_MESH_SETUP_USERSPACE_AMPE must be enabled.
980 * 995 *
981 * @NL80211_ATTR_WOWLAN_SUPPORTED: indicates, as part of the wiphy capabilities, 996 * @NL80211_ATTR_WOWLAN_TRIGGERS_SUPPORTED: indicates, as part of the wiphy
982 * the supported WoWLAN triggers 997 * capabilities, the supported WoWLAN triggers
983 * @NL80211_ATTR_WOWLAN_TRIGGERS: used by %NL80211_CMD_SET_WOWLAN to 998 * @NL80211_ATTR_WOWLAN_TRIGGERS: used by %NL80211_CMD_SET_WOWLAN to
984 * indicate which WoW triggers should be enabled. This is also 999 * indicate which WoW triggers should be enabled. This is also
985 * used by %NL80211_CMD_GET_WOWLAN to get the currently enabled WoWLAN 1000 * used by %NL80211_CMD_GET_WOWLAN to get the currently enabled WoWLAN
@@ -996,6 +1011,14 @@ enum nl80211_commands {
996 * are managed in software: interfaces of these types aren't subject to 1011 * are managed in software: interfaces of these types aren't subject to
997 * any restrictions in their number or combinations. 1012 * any restrictions in their number or combinations.
998 * 1013 *
1014 * @%NL80211_ATTR_REKEY_DATA: nested attribute containing the information
1015 * necessary for GTK rekeying in the device, see &enum nl80211_rekey_data.
1016 *
1017 * @NL80211_ATTR_SCAN_SUPP_RATES: rates per to be advertised as supported in scan,
1018 * nested array attribute containing an entry for each band, with the entry
1019 * being a list of supported rates as defined by IEEE 802.11 7.3.2.2 but
1020 * without the length restriction (at most %NL80211_MAX_SUPP_RATES).
1021 *
999 * @NL80211_ATTR_MAX: highest attribute number currently defined 1022 * @NL80211_ATTR_MAX: highest attribute number currently defined
1000 * @__NL80211_ATTR_AFTER_LAST: internal use 1023 * @__NL80211_ATTR_AFTER_LAST: internal use
1001 */ 1024 */
@@ -1194,6 +1217,13 @@ enum nl80211_attrs {
1194 NL80211_ATTR_INTERFACE_COMBINATIONS, 1217 NL80211_ATTR_INTERFACE_COMBINATIONS,
1195 NL80211_ATTR_SOFTWARE_IFTYPES, 1218 NL80211_ATTR_SOFTWARE_IFTYPES,
1196 1219
1220 NL80211_ATTR_REKEY_DATA,
1221
1222 NL80211_ATTR_MAX_NUM_SCHED_SCAN_SSIDS,
1223 NL80211_ATTR_MAX_SCHED_SCAN_IE_LEN,
1224
1225 NL80211_ATTR_SCAN_SUPP_RATES,
1226
1197 /* add attributes here, update the policy in nl80211.c */ 1227 /* add attributes here, update the policy in nl80211.c */
1198 1228
1199 __NL80211_ATTR_AFTER_LAST, 1229 __NL80211_ATTR_AFTER_LAST,
@@ -2239,6 +2269,16 @@ struct nl80211_wowlan_pattern_support {
2239 * 2269 *
2240 * In %NL80211_ATTR_WOWLAN_TRIGGERS_SUPPORTED, it is a binary attribute 2270 * In %NL80211_ATTR_WOWLAN_TRIGGERS_SUPPORTED, it is a binary attribute
2241 * carrying a &struct nl80211_wowlan_pattern_support. 2271 * carrying a &struct nl80211_wowlan_pattern_support.
2272 * @NL80211_WOWLAN_TRIG_GTK_REKEY_SUPPORTED: Not a real trigger, and cannot be
2273 * used when setting, used only to indicate that GTK rekeying is supported
2274 * by the device (flag)
2275 * @NL80211_WOWLAN_TRIG_GTK_REKEY_FAILURE: wake up on GTK rekey failure (if
2276 * done by the device) (flag)
2277 * @NL80211_WOWLAN_TRIG_EAP_IDENT_REQUEST: wake up on EAP Identity Request
2278 * packet (flag)
2279 * @NL80211_WOWLAN_TRIG_4WAY_HANDSHAKE: wake up on 4-way handshake (flag)
2280 * @NL80211_WOWLAN_TRIG_RFKILL_RELEASE: wake up when rfkill is released
2281 * (on devices that have rfkill in the device) (flag)
2242 * @NUM_NL80211_WOWLAN_TRIG: number of wake on wireless triggers 2282 * @NUM_NL80211_WOWLAN_TRIG: number of wake on wireless triggers
2243 * @MAX_NL80211_WOWLAN_TRIG: highest wowlan trigger attribute number 2283 * @MAX_NL80211_WOWLAN_TRIG: highest wowlan trigger attribute number
2244 */ 2284 */
@@ -2248,6 +2288,11 @@ enum nl80211_wowlan_triggers {
2248 NL80211_WOWLAN_TRIG_DISCONNECT, 2288 NL80211_WOWLAN_TRIG_DISCONNECT,
2249 NL80211_WOWLAN_TRIG_MAGIC_PKT, 2289 NL80211_WOWLAN_TRIG_MAGIC_PKT,
2250 NL80211_WOWLAN_TRIG_PKT_PATTERN, 2290 NL80211_WOWLAN_TRIG_PKT_PATTERN,
2291 NL80211_WOWLAN_TRIG_GTK_REKEY_SUPPORTED,
2292 NL80211_WOWLAN_TRIG_GTK_REKEY_FAILURE,
2293 NL80211_WOWLAN_TRIG_EAP_IDENT_REQUEST,
2294 NL80211_WOWLAN_TRIG_4WAY_HANDSHAKE,
2295 NL80211_WOWLAN_TRIG_RFKILL_RELEASE,
2251 2296
2252 /* keep last */ 2297 /* keep last */
2253 NUM_NL80211_WOWLAN_TRIG, 2298 NUM_NL80211_WOWLAN_TRIG,
@@ -2361,4 +2406,28 @@ enum nl80211_plink_state {
2361 MAX_NL80211_PLINK_STATES = NUM_NL80211_PLINK_STATES - 1 2406 MAX_NL80211_PLINK_STATES = NUM_NL80211_PLINK_STATES - 1
2362}; 2407};
2363 2408
2409#define NL80211_KCK_LEN 16
2410#define NL80211_KEK_LEN 16
2411#define NL80211_REPLAY_CTR_LEN 8
2412
2413/**
2414 * enum nl80211_rekey_data - attributes for GTK rekey offload
2415 * @__NL80211_REKEY_DATA_INVALID: invalid number for nested attributes
2416 * @NL80211_REKEY_DATA_KEK: key encryption key (binary)
2417 * @NL80211_REKEY_DATA_KCK: key confirmation key (binary)
2418 * @NL80211_REKEY_DATA_REPLAY_CTR: replay counter (binary)
2419 * @NUM_NL80211_REKEY_DATA: number of rekey attributes (internal)
2420 * @MAX_NL80211_REKEY_DATA: highest rekey attribute (internal)
2421 */
2422enum nl80211_rekey_data {
2423 __NL80211_REKEY_DATA_INVALID,
2424 NL80211_REKEY_DATA_KEK,
2425 NL80211_REKEY_DATA_KCK,
2426 NL80211_REKEY_DATA_REPLAY_CTR,
2427
2428 /* keep last */
2429 NUM_NL80211_REKEY_DATA,
2430 MAX_NL80211_REKEY_DATA = NUM_NL80211_REKEY_DATA - 1
2431};
2432
2364#endif /* __LINUX_NL80211_H */ 2433#endif /* __LINUX_NL80211_H */
diff --git a/include/linux/nodemask.h b/include/linux/nodemask.h
index dba35e413371..7afc36334d52 100644
--- a/include/linux/nodemask.h
+++ b/include/linux/nodemask.h
@@ -66,6 +66,8 @@
66 * int num_online_nodes() Number of online Nodes 66 * int num_online_nodes() Number of online Nodes
67 * int num_possible_nodes() Number of all possible Nodes 67 * int num_possible_nodes() Number of all possible Nodes
68 * 68 *
69 * int node_random(mask) Random node with set bit in mask
70 *
69 * int node_online(node) Is some node online? 71 * int node_online(node) Is some node online?
70 * int node_possible(node) Is some node possible? 72 * int node_possible(node) Is some node possible?
71 * 73 *
@@ -430,6 +432,7 @@ static inline void node_set_offline(int nid)
430 node_clear_state(nid, N_ONLINE); 432 node_clear_state(nid, N_ONLINE);
431 nr_online_nodes = num_node_state(N_ONLINE); 433 nr_online_nodes = num_node_state(N_ONLINE);
432} 434}
435
433#else 436#else
434 437
435static inline int node_state(int node, enum node_states state) 438static inline int node_state(int node, enum node_states state)
@@ -460,6 +463,16 @@ static inline int num_node_state(enum node_states state)
460 463
461#define node_set_online(node) node_set_state((node), N_ONLINE) 464#define node_set_online(node) node_set_state((node), N_ONLINE)
462#define node_set_offline(node) node_clear_state((node), N_ONLINE) 465#define node_set_offline(node) node_clear_state((node), N_ONLINE)
466
467#endif
468
469#if defined(CONFIG_NUMA) && (MAX_NUMNODES > 1)
470extern int node_random(const nodemask_t *maskp);
471#else
472static inline int node_random(const nodemask_t *mask)
473{
474 return 0;
475}
463#endif 476#endif
464 477
465#define node_online_map node_states[N_ONLINE] 478#define node_online_map node_states[N_ONLINE]
diff --git a/include/linux/notifier.h b/include/linux/notifier.h
index c0688b0168b3..d65746efc954 100644
--- a/include/linux/notifier.h
+++ b/include/linux/notifier.h
@@ -185,80 +185,17 @@ static inline int notifier_to_errno(int ret)
185 * VC switch chains (for loadable kernel svgalib VC switch helpers) etc... 185 * VC switch chains (for loadable kernel svgalib VC switch helpers) etc...
186 */ 186 */
187 187
188/* netdevice notifier chain. Please remember to update the rtnetlink 188/* CPU notfiers are defined in include/linux/cpu.h. */
189 * notification exclusion list in rtnetlink_event() when adding new
190 * types.
191 */
192#define NETDEV_UP 0x0001 /* For now you can't veto a device up/down */
193#define NETDEV_DOWN 0x0002
194#define NETDEV_REBOOT 0x0003 /* Tell a protocol stack a network interface
195 detected a hardware crash and restarted
196 - we can use this eg to kick tcp sessions
197 once done */
198#define NETDEV_CHANGE 0x0004 /* Notify device state change */
199#define NETDEV_REGISTER 0x0005
200#define NETDEV_UNREGISTER 0x0006
201#define NETDEV_CHANGEMTU 0x0007
202#define NETDEV_CHANGEADDR 0x0008
203#define NETDEV_GOING_DOWN 0x0009
204#define NETDEV_CHANGENAME 0x000A
205#define NETDEV_FEAT_CHANGE 0x000B
206#define NETDEV_BONDING_FAILOVER 0x000C
207#define NETDEV_PRE_UP 0x000D
208#define NETDEV_PRE_TYPE_CHANGE 0x000E
209#define NETDEV_POST_TYPE_CHANGE 0x000F
210#define NETDEV_POST_INIT 0x0010
211#define NETDEV_UNREGISTER_BATCH 0x0011
212#define NETDEV_RELEASE 0x0012
213#define NETDEV_NOTIFY_PEERS 0x0013
214#define NETDEV_JOIN 0x0014
215
216#define SYS_DOWN 0x0001 /* Notify of system down */
217#define SYS_RESTART SYS_DOWN
218#define SYS_HALT 0x0002 /* Notify of system halt */
219#define SYS_POWER_OFF 0x0003 /* Notify of system power off */
220 189
221#define NETLINK_URELEASE 0x0001 /* Unicast netlink socket released */ 190/* netdevice notifiers are defined in include/linux/netdevice.h */
222 191
223#define CPU_ONLINE 0x0002 /* CPU (unsigned)v is up */ 192/* reboot notifiers are defined in include/linux/reboot.h. */
224#define CPU_UP_PREPARE 0x0003 /* CPU (unsigned)v coming up */
225#define CPU_UP_CANCELED 0x0004 /* CPU (unsigned)v NOT coming up */
226#define CPU_DOWN_PREPARE 0x0005 /* CPU (unsigned)v going down */
227#define CPU_DOWN_FAILED 0x0006 /* CPU (unsigned)v NOT going down */
228#define CPU_DEAD 0x0007 /* CPU (unsigned)v dead */
229#define CPU_DYING 0x0008 /* CPU (unsigned)v not running any task,
230 * not handling interrupts, soon dead.
231 * Called on the dying cpu, interrupts
232 * are already disabled. Must not
233 * sleep, must not fail */
234#define CPU_POST_DEAD 0x0009 /* CPU (unsigned)v dead, cpu_hotplug
235 * lock is dropped */
236#define CPU_STARTING 0x000A /* CPU (unsigned)v soon running.
237 * Called on the new cpu, just before
238 * enabling interrupts. Must not sleep,
239 * must not fail */
240 193
241/* Used for CPU hotplug events occurring while tasks are frozen due to a suspend 194/* Hibernation and suspend events are defined in include/linux/suspend.h. */
242 * operation in progress
243 */
244#define CPU_TASKS_FROZEN 0x0010
245 195
246#define CPU_ONLINE_FROZEN (CPU_ONLINE | CPU_TASKS_FROZEN) 196/* Virtual Terminal events are defined in include/linux/vt.h. */
247#define CPU_UP_PREPARE_FROZEN (CPU_UP_PREPARE | CPU_TASKS_FROZEN)
248#define CPU_UP_CANCELED_FROZEN (CPU_UP_CANCELED | CPU_TASKS_FROZEN)
249#define CPU_DOWN_PREPARE_FROZEN (CPU_DOWN_PREPARE | CPU_TASKS_FROZEN)
250#define CPU_DOWN_FAILED_FROZEN (CPU_DOWN_FAILED | CPU_TASKS_FROZEN)
251#define CPU_DEAD_FROZEN (CPU_DEAD | CPU_TASKS_FROZEN)
252#define CPU_DYING_FROZEN (CPU_DYING | CPU_TASKS_FROZEN)
253#define CPU_STARTING_FROZEN (CPU_STARTING | CPU_TASKS_FROZEN)
254 197
255/* Hibernation and suspend events */ 198#define NETLINK_URELEASE 0x0001 /* Unicast netlink socket released */
256#define PM_HIBERNATION_PREPARE 0x0001 /* Going to hibernate */
257#define PM_POST_HIBERNATION 0x0002 /* Hibernation finished */
258#define PM_SUSPEND_PREPARE 0x0003 /* Going to suspend the system */
259#define PM_POST_SUSPEND 0x0004 /* Suspend finished */
260#define PM_RESTORE_PREPARE 0x0005 /* Going to restore a saved image */
261#define PM_POST_RESTORE 0x0006 /* Restore failed */
262 199
263/* Console keyboard events. 200/* Console keyboard events.
264 * Note: KBD_KEYCODE is always sent before KBD_UNBOUND_KEYCODE, KBD_UNICODE and 201 * Note: KBD_KEYCODE is always sent before KBD_UNBOUND_KEYCODE, KBD_UNICODE and
@@ -271,12 +208,5 @@ static inline int notifier_to_errno(int ret)
271 208
272extern struct blocking_notifier_head reboot_notifier_list; 209extern struct blocking_notifier_head reboot_notifier_list;
273 210
274/* Virtual Terminal events. */
275#define VT_ALLOCATE 0x0001 /* Console got allocated */
276#define VT_DEALLOCATE 0x0002 /* Console will be deallocated */
277#define VT_WRITE 0x0003 /* A char got output */
278#define VT_UPDATE 0x0004 /* A bigger update occurred */
279#define VT_PREWRITE 0x0005 /* A char is about to be written to the console */
280
281#endif /* __KERNEL__ */ 211#endif /* __KERNEL__ */
282#endif /* _LINUX_NOTIFIER_H */ 212#endif /* _LINUX_NOTIFIER_H */
diff --git a/include/linux/nsproxy.h b/include/linux/nsproxy.h
index 50d20aba57d3..cc37a55ad004 100644
--- a/include/linux/nsproxy.h
+++ b/include/linux/nsproxy.h
@@ -68,6 +68,7 @@ void switch_task_namespaces(struct task_struct *tsk, struct nsproxy *new);
68void free_nsproxy(struct nsproxy *ns); 68void free_nsproxy(struct nsproxy *ns);
69int unshare_nsproxy_namespaces(unsigned long, struct nsproxy **, 69int unshare_nsproxy_namespaces(unsigned long, struct nsproxy **,
70 struct fs_struct *); 70 struct fs_struct *);
71int __init nsproxy_cache_init(void);
71 72
72static inline void put_nsproxy(struct nsproxy *ns) 73static inline void put_nsproxy(struct nsproxy *ns)
73{ 74{
diff --git a/include/linux/of.h b/include/linux/of.h
index bfc0ed1b0ced..0085bb01c041 100644
--- a/include/linux/of.h
+++ b/include/linux/of.h
@@ -195,6 +195,14 @@ extern struct device_node *of_find_node_with_property(
195extern struct property *of_find_property(const struct device_node *np, 195extern struct property *of_find_property(const struct device_node *np,
196 const char *name, 196 const char *name,
197 int *lenp); 197 int *lenp);
198extern int of_property_read_u32_array(const struct device_node *np,
199 const char *propname,
200 u32 *out_values,
201 size_t sz);
202
203extern int of_property_read_string(struct device_node *np,
204 const char *propname,
205 const char **out_string);
198extern int of_device_is_compatible(const struct device_node *device, 206extern int of_device_is_compatible(const struct device_node *device,
199 const char *); 207 const char *);
200extern int of_device_is_available(const struct device_node *device); 208extern int of_device_is_available(const struct device_node *device);
@@ -227,12 +235,34 @@ extern void of_attach_node(struct device_node *);
227extern void of_detach_node(struct device_node *); 235extern void of_detach_node(struct device_node *);
228#endif 236#endif
229 237
230#else 238#else /* CONFIG_OF */
231 239
232static inline bool of_have_populated_dt(void) 240static inline bool of_have_populated_dt(void)
233{ 241{
234 return false; 242 return false;
235} 243}
236 244
245static inline int of_property_read_u32_array(const struct device_node *np,
246 const char *propname,
247 u32 *out_values, size_t sz)
248{
249 return -ENOSYS;
250}
251
252static inline int of_property_read_string(struct device_node *np,
253 const char *propname,
254 const char **out_string)
255{
256 return -ENOSYS;
257}
258
237#endif /* CONFIG_OF */ 259#endif /* CONFIG_OF */
260
261static inline int of_property_read_u32(const struct device_node *np,
262 const char *propname,
263 u32 *out_value)
264{
265 return of_property_read_u32_array(np, propname, out_value, 1);
266}
267
238#endif /* _LINUX_OF_H */ 268#endif /* _LINUX_OF_H */
diff --git a/include/linux/of_address.h b/include/linux/of_address.h
index 2feda6ee6140..3118623c2c1f 100644
--- a/include/linux/of_address.h
+++ b/include/linux/of_address.h
@@ -1,11 +1,16 @@
1#ifndef __OF_ADDRESS_H 1#ifndef __OF_ADDRESS_H
2#define __OF_ADDRESS_H 2#define __OF_ADDRESS_H
3#include <linux/ioport.h> 3#include <linux/ioport.h>
4#include <linux/errno.h>
4#include <linux/of.h> 5#include <linux/of.h>
5 6
6extern u64 of_translate_address(struct device_node *np, const __be32 *addr); 7extern u64 of_translate_address(struct device_node *np, const __be32 *addr);
7extern int of_address_to_resource(struct device_node *dev, int index, 8extern int of_address_to_resource(struct device_node *dev, int index,
8 struct resource *r); 9 struct resource *r);
10extern struct device_node *of_find_matching_node_by_address(
11 struct device_node *from,
12 const struct of_device_id *matches,
13 u64 base_address);
9extern void __iomem *of_iomap(struct device_node *device, int index); 14extern void __iomem *of_iomap(struct device_node *device, int index);
10 15
11/* Extract an address from a device, returns the region size and 16/* Extract an address from a device, returns the region size and
diff --git a/include/linux/of_gpio.h b/include/linux/of_gpio.h
index 6598c04dab01..52280a2b5e63 100644
--- a/include/linux/of_gpio.h
+++ b/include/linux/of_gpio.h
@@ -46,8 +46,9 @@ static inline struct of_mm_gpio_chip *to_of_mm_gpio_chip(struct gpio_chip *gc)
46 return container_of(gc, struct of_mm_gpio_chip, gc); 46 return container_of(gc, struct of_mm_gpio_chip, gc);
47} 47}
48 48
49extern int of_get_gpio_flags(struct device_node *np, int index, 49extern int of_get_named_gpio_flags(struct device_node *np,
50 enum of_gpio_flags *flags); 50 const char *list_name, int index, enum of_gpio_flags *flags);
51
51extern unsigned int of_gpio_count(struct device_node *np); 52extern unsigned int of_gpio_count(struct device_node *np);
52 53
53extern int of_mm_gpiochip_add(struct device_node *np, 54extern int of_mm_gpiochip_add(struct device_node *np,
@@ -56,12 +57,14 @@ extern int of_mm_gpiochip_add(struct device_node *np,
56extern void of_gpiochip_add(struct gpio_chip *gc); 57extern void of_gpiochip_add(struct gpio_chip *gc);
57extern void of_gpiochip_remove(struct gpio_chip *gc); 58extern void of_gpiochip_remove(struct gpio_chip *gc);
58extern struct gpio_chip *of_node_to_gpiochip(struct device_node *np); 59extern struct gpio_chip *of_node_to_gpiochip(struct device_node *np);
60extern int of_gpio_simple_xlate(struct gpio_chip *gc, struct device_node *np,
61 const void *gpio_spec, u32 *flags);
59 62
60#else /* CONFIG_OF_GPIO */ 63#else /* CONFIG_OF_GPIO */
61 64
62/* Drivers may not strictly depend on the GPIO support, so let them link. */ 65/* Drivers may not strictly depend on the GPIO support, so let them link. */
63static inline int of_get_gpio_flags(struct device_node *np, int index, 66static inline int of_get_named_gpio_flags(struct device_node *np,
64 enum of_gpio_flags *flags) 67 const char *list_name, int index, enum of_gpio_flags *flags)
65{ 68{
66 return -ENOSYS; 69 return -ENOSYS;
67} 70}
@@ -71,13 +74,51 @@ static inline unsigned int of_gpio_count(struct device_node *np)
71 return 0; 74 return 0;
72} 75}
73 76
77static inline int of_gpio_simple_xlate(struct gpio_chip *gc,
78 struct device_node *np,
79 const void *gpio_spec, u32 *flags)
80{
81 return -ENOSYS;
82}
83
74static inline void of_gpiochip_add(struct gpio_chip *gc) { } 84static inline void of_gpiochip_add(struct gpio_chip *gc) { }
75static inline void of_gpiochip_remove(struct gpio_chip *gc) { } 85static inline void of_gpiochip_remove(struct gpio_chip *gc) { }
76 86
77#endif /* CONFIG_OF_GPIO */ 87#endif /* CONFIG_OF_GPIO */
78 88
79/** 89/**
80 * of_get_gpio - Get a GPIO number to use with GPIO API 90 * of_get_gpio_flags() - Get a GPIO number and flags to use with GPIO API
91 * @np: device node to get GPIO from
92 * @index: index of the GPIO
93 * @flags: a flags pointer to fill in
94 *
95 * Returns GPIO number to use with Linux generic GPIO API, or one of the errno
96 * value on the error condition. If @flags is not NULL the function also fills
97 * in flags for the GPIO.
98 */
99static inline int of_get_gpio_flags(struct device_node *np, int index,
100 enum of_gpio_flags *flags)
101{
102 return of_get_named_gpio_flags(np, "gpios", index, flags);
103}
104
105/**
106 * of_get_named_gpio() - Get a GPIO number to use with GPIO API
107 * @np: device node to get GPIO from
108 * @propname: Name of property containing gpio specifier(s)
109 * @index: index of the GPIO
110 *
111 * Returns GPIO number to use with Linux generic GPIO API, or one of the errno
112 * value on the error condition.
113 */
114static inline int of_get_named_gpio(struct device_node *np,
115 const char *propname, int index)
116{
117 return of_get_named_gpio_flags(np, propname, index, NULL);
118}
119
120/**
121 * of_get_gpio() - Get a GPIO number to use with GPIO API
81 * @np: device node to get GPIO from 122 * @np: device node to get GPIO from
82 * @index: index of the GPIO 123 * @index: index of the GPIO
83 * 124 *
diff --git a/include/linux/of_irq.h b/include/linux/of_irq.h
index e6955f5d1f08..cd2e61ce4e83 100644
--- a/include/linux/of_irq.h
+++ b/include/linux/of_irq.h
@@ -63,6 +63,9 @@ extern int of_irq_map_one(struct device_node *device, int index,
63extern unsigned int irq_create_of_mapping(struct device_node *controller, 63extern unsigned int irq_create_of_mapping(struct device_node *controller,
64 const u32 *intspec, 64 const u32 *intspec,
65 unsigned int intsize); 65 unsigned int intsize);
66#ifdef CONFIG_IRQ_DOMAIN
67extern void irq_dispose_mapping(unsigned int irq);
68#endif
66extern int of_irq_to_resource(struct device_node *dev, int index, 69extern int of_irq_to_resource(struct device_node *dev, int index,
67 struct resource *r); 70 struct resource *r);
68extern int of_irq_count(struct device_node *dev); 71extern int of_irq_count(struct device_node *dev);
@@ -70,6 +73,7 @@ extern int of_irq_to_resource_table(struct device_node *dev,
70 struct resource *res, int nr_irqs); 73 struct resource *res, int nr_irqs);
71extern struct device_node *of_irq_find_parent(struct device_node *child); 74extern struct device_node *of_irq_find_parent(struct device_node *child);
72 75
76
73#endif /* CONFIG_OF_IRQ */ 77#endif /* CONFIG_OF_IRQ */
74#endif /* CONFIG_OF */ 78#endif /* CONFIG_OF */
75#endif /* __OF_IRQ_H */ 79#endif /* __OF_IRQ_H */
diff --git a/include/linux/of_net.h b/include/linux/of_net.h
index e913081fb52a..f47464188710 100644
--- a/include/linux/of_net.h
+++ b/include/linux/of_net.h
@@ -9,6 +9,7 @@
9 9
10#ifdef CONFIG_OF_NET 10#ifdef CONFIG_OF_NET
11#include <linux/of.h> 11#include <linux/of.h>
12extern const int of_get_phy_mode(struct device_node *np);
12extern const void *of_get_mac_address(struct device_node *np); 13extern const void *of_get_mac_address(struct device_node *np);
13#endif 14#endif
14 15
diff --git a/include/linux/of_pci.h b/include/linux/of_pci.h
index 85a27b650d76..f93e21700d3e 100644
--- a/include/linux/of_pci.h
+++ b/include/linux/of_pci.h
@@ -6,4 +6,9 @@
6struct pci_dev; 6struct pci_dev;
7struct of_irq; 7struct of_irq;
8int of_irq_map_pci(struct pci_dev *pdev, struct of_irq *out_irq); 8int of_irq_map_pci(struct pci_dev *pdev, struct of_irq *out_irq);
9
10struct device_node;
11struct device_node *of_pci_find_child_device(struct device_node *parent,
12 unsigned int devfn);
13
9#endif 14#endif
diff --git a/include/linux/of_platform.h b/include/linux/of_platform.h
index fb51ae38cea7..5a6f458a4bb7 100644
--- a/include/linux/of_platform.h
+++ b/include/linux/of_platform.h
@@ -20,6 +20,40 @@
20#include <linux/platform_device.h> 20#include <linux/platform_device.h>
21 21
22/** 22/**
23 * struct of_dev_auxdata - lookup table entry for device names & platform_data
24 * @compatible: compatible value of node to match against node
25 * @phys_addr: Start address of registers to match against node
26 * @name: Name to assign for matching nodes
27 * @platform_data: platform_data to assign for matching nodes
28 *
29 * This lookup table allows the caller of of_platform_populate() to override
30 * the names of devices when creating devices from the device tree. The table
31 * should be terminated with an empty entry. It also allows the platform_data
32 * pointer to be set.
33 *
34 * The reason for this functionality is that some Linux infrastructure uses
35 * the device name to look up a specific device, but the Linux-specific names
36 * are not encoded into the device tree, so the kernel needs to provide specific
37 * values.
38 *
39 * Note: Using an auxdata lookup table should be considered a last resort when
40 * converting a platform to use the DT. Normally the automatically generated
41 * device name will not matter, and drivers should obtain data from the device
42 * node instead of from an anonymouns platform_data pointer.
43 */
44struct of_dev_auxdata {
45 char *compatible;
46 resource_size_t phys_addr;
47 char *name;
48 void *platform_data;
49};
50
51/* Macro to simplify populating a lookup table */
52#define OF_DEV_AUXDATA(_compat,_phys,_name,_pdata) \
53 { .compatible = _compat, .phys_addr = _phys, .name = _name, \
54 .platform_data = _pdata }
55
56/**
23 * of_platform_driver - Legacy of-aware driver for platform devices. 57 * of_platform_driver - Legacy of-aware driver for platform devices.
24 * 58 *
25 * An of_platform_driver driver is attached to a basic platform_device on 59 * An of_platform_driver driver is attached to a basic platform_device on
@@ -40,6 +74,8 @@ struct of_platform_driver
40#define to_of_platform_driver(drv) \ 74#define to_of_platform_driver(drv) \
41 container_of(drv,struct of_platform_driver, driver) 75 container_of(drv,struct of_platform_driver, driver)
42 76
77extern const struct of_device_id of_default_bus_match_table[];
78
43/* Platform drivers register/unregister */ 79/* Platform drivers register/unregister */
44extern struct platform_device *of_device_alloc(struct device_node *np, 80extern struct platform_device *of_device_alloc(struct device_node *np,
45 const char *bus_id, 81 const char *bus_id,
@@ -55,6 +91,10 @@ extern struct platform_device *of_platform_device_create(struct device_node *np,
55extern int of_platform_bus_probe(struct device_node *root, 91extern int of_platform_bus_probe(struct device_node *root,
56 const struct of_device_id *matches, 92 const struct of_device_id *matches,
57 struct device *parent); 93 struct device *parent);
94extern int of_platform_populate(struct device_node *root,
95 const struct of_device_id *matches,
96 const struct of_dev_auxdata *lookup,
97 struct device *parent);
58#endif /* !CONFIG_SPARC */ 98#endif /* !CONFIG_SPARC */
59 99
60#endif /* CONFIG_OF_DEVICE */ 100#endif /* CONFIG_OF_DEVICE */
diff --git a/include/linux/oom.h b/include/linux/oom.h
index 4952fb874ad3..13b7b02e599a 100644
--- a/include/linux/oom.h
+++ b/include/linux/oom.h
@@ -64,10 +64,6 @@ static inline void oom_killer_enable(void)
64 oom_killer_disabled = false; 64 oom_killer_disabled = false;
65} 65}
66 66
67/* The badness from the OOM killer */
68extern unsigned long badness(struct task_struct *p, struct mem_cgroup *mem,
69 const nodemask_t *nodemask, unsigned long uptime);
70
71extern struct task_struct *find_lock_task_mm(struct task_struct *p); 67extern struct task_struct *find_lock_task_mm(struct task_struct *p);
72 68
73/* sysctls */ 69/* sysctls */
diff --git a/include/linux/opp.h b/include/linux/opp.h
index 5449945d589f..7020e9736fc5 100644
--- a/include/linux/opp.h
+++ b/include/linux/opp.h
@@ -94,12 +94,20 @@ static inline int opp_disable(struct device *dev, unsigned long freq)
94#if defined(CONFIG_CPU_FREQ) && defined(CONFIG_PM_OPP) 94#if defined(CONFIG_CPU_FREQ) && defined(CONFIG_PM_OPP)
95int opp_init_cpufreq_table(struct device *dev, 95int opp_init_cpufreq_table(struct device *dev,
96 struct cpufreq_frequency_table **table); 96 struct cpufreq_frequency_table **table);
97void opp_free_cpufreq_table(struct device *dev,
98 struct cpufreq_frequency_table **table);
97#else 99#else
98static inline int opp_init_cpufreq_table(struct device *dev, 100static inline int opp_init_cpufreq_table(struct device *dev,
99 struct cpufreq_frequency_table **table) 101 struct cpufreq_frequency_table **table)
100{ 102{
101 return -EINVAL; 103 return -EINVAL;
102} 104}
105
106static inline
107void opp_free_cpufreq_table(struct device *dev,
108 struct cpufreq_frequency_table **table)
109{
110}
103#endif /* CONFIG_CPU_FREQ */ 111#endif /* CONFIG_CPU_FREQ */
104 112
105#endif /* __LINUX_OPP_H__ */ 113#endif /* __LINUX_OPP_H__ */
diff --git a/include/linux/oprofile.h b/include/linux/oprofile.h
index 7f5cfd3b37dd..49c8727eeb57 100644
--- a/include/linux/oprofile.h
+++ b/include/linux/oprofile.h
@@ -18,7 +18,7 @@
18#include <linux/init.h> 18#include <linux/init.h>
19#include <linux/errno.h> 19#include <linux/errno.h>
20#include <linux/printk.h> 20#include <linux/printk.h>
21#include <asm/atomic.h> 21#include <linux/atomic.h>
22 22
23/* Each escaped entry is prefixed by ESCAPE_CODE 23/* Each escaped entry is prefixed by ESCAPE_CODE
24 * then one of the following codes, then the 24 * then one of the following codes, then the
diff --git a/include/linux/page-flags.h b/include/linux/page-flags.h
index 6081493db68f..e90a673be67e 100644
--- a/include/linux/page-flags.h
+++ b/include/linux/page-flags.h
@@ -124,9 +124,6 @@ enum pageflags {
124 124
125 /* SLOB */ 125 /* SLOB */
126 PG_slob_free = PG_private, 126 PG_slob_free = PG_private,
127
128 /* SLUB */
129 PG_slub_frozen = PG_active,
130}; 127};
131 128
132#ifndef __GENERATING_BOUNDS_H 129#ifndef __GENERATING_BOUNDS_H
@@ -135,7 +132,7 @@ enum pageflags {
135 * Macros to create function definitions for page flags 132 * Macros to create function definitions for page flags
136 */ 133 */
137#define TESTPAGEFLAG(uname, lname) \ 134#define TESTPAGEFLAG(uname, lname) \
138static inline int Page##uname(struct page *page) \ 135static inline int Page##uname(const struct page *page) \
139 { return test_bit(PG_##lname, &page->flags); } 136 { return test_bit(PG_##lname, &page->flags); }
140 137
141#define SETPAGEFLAG(uname, lname) \ 138#define SETPAGEFLAG(uname, lname) \
@@ -173,7 +170,7 @@ static inline int __TestClearPage##uname(struct page *page) \
173 __SETPAGEFLAG(uname, lname) __CLEARPAGEFLAG(uname, lname) 170 __SETPAGEFLAG(uname, lname) __CLEARPAGEFLAG(uname, lname)
174 171
175#define PAGEFLAG_FALSE(uname) \ 172#define PAGEFLAG_FALSE(uname) \
176static inline int Page##uname(struct page *page) \ 173static inline int Page##uname(const struct page *page) \
177 { return 0; } 174 { return 0; }
178 175
179#define TESTSCFLAG(uname, lname) \ 176#define TESTSCFLAG(uname, lname) \
@@ -212,8 +209,6 @@ PAGEFLAG(SwapBacked, swapbacked) __CLEARPAGEFLAG(SwapBacked, swapbacked)
212 209
213__PAGEFLAG(SlobFree, slob_free) 210__PAGEFLAG(SlobFree, slob_free)
214 211
215__PAGEFLAG(SlubFrozen, slub_frozen)
216
217/* 212/*
218 * Private page markings that may be used by the filesystem that owns the page 213 * Private page markings that may be used by the filesystem that owns the page
219 * for its own purposes. 214 * for its own purposes.
diff --git a/include/linux/pagemap.h b/include/linux/pagemap.h
index 716875e53520..cfaaa6949b8b 100644
--- a/include/linux/pagemap.h
+++ b/include/linux/pagemap.h
@@ -134,7 +134,7 @@ static inline int page_cache_get_speculative(struct page *page)
134 VM_BUG_ON(in_interrupt()); 134 VM_BUG_ON(in_interrupt());
135 135
136#if !defined(CONFIG_SMP) && defined(CONFIG_TREE_RCU) 136#if !defined(CONFIG_SMP) && defined(CONFIG_TREE_RCU)
137# ifdef CONFIG_PREEMPT 137# ifdef CONFIG_PREEMPT_COUNT
138 VM_BUG_ON(!in_atomic()); 138 VM_BUG_ON(!in_atomic());
139# endif 139# endif
140 /* 140 /*
@@ -172,7 +172,7 @@ static inline int page_cache_add_speculative(struct page *page, int count)
172 VM_BUG_ON(in_interrupt()); 172 VM_BUG_ON(in_interrupt());
173 173
174#if !defined(CONFIG_SMP) && defined(CONFIG_TREE_RCU) 174#if !defined(CONFIG_SMP) && defined(CONFIG_TREE_RCU)
175# ifdef CONFIG_PREEMPT 175# ifdef CONFIG_PREEMPT_COUNT
176 VM_BUG_ON(!in_atomic()); 176 VM_BUG_ON(!in_atomic());
177# endif 177# endif
178 VM_BUG_ON(page_count(page) == 0); 178 VM_BUG_ON(page_count(page) == 0);
@@ -255,26 +255,24 @@ static inline struct page *grab_cache_page(struct address_space *mapping,
255extern struct page * grab_cache_page_nowait(struct address_space *mapping, 255extern struct page * grab_cache_page_nowait(struct address_space *mapping,
256 pgoff_t index); 256 pgoff_t index);
257extern struct page * read_cache_page_async(struct address_space *mapping, 257extern struct page * read_cache_page_async(struct address_space *mapping,
258 pgoff_t index, filler_t *filler, 258 pgoff_t index, filler_t *filler, void *data);
259 void *data);
260extern struct page * read_cache_page(struct address_space *mapping, 259extern struct page * read_cache_page(struct address_space *mapping,
261 pgoff_t index, filler_t *filler, 260 pgoff_t index, filler_t *filler, void *data);
262 void *data);
263extern struct page * read_cache_page_gfp(struct address_space *mapping, 261extern struct page * read_cache_page_gfp(struct address_space *mapping,
264 pgoff_t index, gfp_t gfp_mask); 262 pgoff_t index, gfp_t gfp_mask);
265extern int read_cache_pages(struct address_space *mapping, 263extern int read_cache_pages(struct address_space *mapping,
266 struct list_head *pages, filler_t *filler, void *data); 264 struct list_head *pages, filler_t *filler, void *data);
267 265
268static inline struct page *read_mapping_page_async( 266static inline struct page *read_mapping_page_async(
269 struct address_space *mapping, 267 struct address_space *mapping,
270 pgoff_t index, void *data) 268 pgoff_t index, void *data)
271{ 269{
272 filler_t *filler = (filler_t *)mapping->a_ops->readpage; 270 filler_t *filler = (filler_t *)mapping->a_ops->readpage;
273 return read_cache_page_async(mapping, index, filler, data); 271 return read_cache_page_async(mapping, index, filler, data);
274} 272}
275 273
276static inline struct page *read_mapping_page(struct address_space *mapping, 274static inline struct page *read_mapping_page(struct address_space *mapping,
277 pgoff_t index, void *data) 275 pgoff_t index, void *data)
278{ 276{
279 filler_t *filler = (filler_t *)mapping->a_ops->readpage; 277 filler_t *filler = (filler_t *)mapping->a_ops->readpage;
280 return read_cache_page(mapping, index, filler, data); 278 return read_cache_page(mapping, index, filler, data);
diff --git a/include/linux/pci.h b/include/linux/pci.h
index c446b5ca2d38..f27893b3b724 100644
--- a/include/linux/pci.h
+++ b/include/linux/pci.h
@@ -49,7 +49,7 @@
49#include <linux/compiler.h> 49#include <linux/compiler.h>
50#include <linux/errno.h> 50#include <linux/errno.h>
51#include <linux/kobject.h> 51#include <linux/kobject.h>
52#include <asm/atomic.h> 52#include <linux/atomic.h>
53#include <linux/device.h> 53#include <linux/device.h>
54#include <linux/io.h> 54#include <linux/io.h>
55#include <linux/irqreturn.h> 55#include <linux/irqreturn.h>
@@ -843,8 +843,8 @@ void pci_enable_ido(struct pci_dev *dev, unsigned long type);
843void pci_disable_ido(struct pci_dev *dev, unsigned long type); 843void pci_disable_ido(struct pci_dev *dev, unsigned long type);
844 844
845enum pci_obff_signal_type { 845enum pci_obff_signal_type {
846 PCI_EXP_OBFF_SIGNAL_L0, 846 PCI_EXP_OBFF_SIGNAL_L0 = 0,
847 PCI_EXP_OBFF_SIGNAL_ALWAYS, 847 PCI_EXP_OBFF_SIGNAL_ALWAYS = 1,
848}; 848};
849int pci_enable_obff(struct pci_dev *dev, enum pci_obff_signal_type); 849int pci_enable_obff(struct pci_dev *dev, enum pci_obff_signal_type);
850void pci_disable_obff(struct pci_dev *dev); 850void pci_disable_obff(struct pci_dev *dev);
@@ -879,7 +879,7 @@ void pdev_enable_device(struct pci_dev *);
879void pdev_sort_resources(struct pci_dev *, struct resource_list *); 879void pdev_sort_resources(struct pci_dev *, struct resource_list *);
880int pci_enable_resources(struct pci_dev *, int mask); 880int pci_enable_resources(struct pci_dev *, int mask);
881void pci_fixup_irqs(u8 (*)(struct pci_dev *, u8 *), 881void pci_fixup_irqs(u8 (*)(struct pci_dev *, u8 *),
882 int (*)(struct pci_dev *, u8, u8)); 882 int (*)(const struct pci_dev *, u8, u8));
883#define HAVE_PCI_REQ_REGIONS 2 883#define HAVE_PCI_REQ_REGIONS 2
884int __must_check pci_request_regions(struct pci_dev *, const char *); 884int __must_check pci_request_regions(struct pci_dev *, const char *);
885int __must_check pci_request_regions_exclusive(struct pci_dev *, const char *); 885int __must_check pci_request_regions_exclusive(struct pci_dev *, const char *);
@@ -1589,5 +1589,44 @@ int pci_vpd_find_tag(const u8 *buf, unsigned int off, unsigned int len, u8 rdt);
1589int pci_vpd_find_info_keyword(const u8 *buf, unsigned int off, 1589int pci_vpd_find_info_keyword(const u8 *buf, unsigned int off,
1590 unsigned int len, const char *kw); 1590 unsigned int len, const char *kw);
1591 1591
1592/* PCI <-> OF binding helpers */
1593#ifdef CONFIG_OF
1594struct device_node;
1595extern void pci_set_of_node(struct pci_dev *dev);
1596extern void pci_release_of_node(struct pci_dev *dev);
1597extern void pci_set_bus_of_node(struct pci_bus *bus);
1598extern void pci_release_bus_of_node(struct pci_bus *bus);
1599
1600/* Arch may override this (weak) */
1601extern struct device_node * __weak pcibios_get_phb_of_node(struct pci_bus *bus);
1602
1603static inline struct device_node *pci_device_to_OF_node(struct pci_dev *pdev)
1604{
1605 return pdev ? pdev->dev.of_node : NULL;
1606}
1607
1608static inline struct device_node *pci_bus_to_OF_node(struct pci_bus *bus)
1609{
1610 return bus ? bus->dev.of_node : NULL;
1611}
1612
1613#else /* CONFIG_OF */
1614static inline void pci_set_of_node(struct pci_dev *dev) { }
1615static inline void pci_release_of_node(struct pci_dev *dev) { }
1616static inline void pci_set_bus_of_node(struct pci_bus *bus) { }
1617static inline void pci_release_bus_of_node(struct pci_bus *bus) { }
1618#endif /* CONFIG_OF */
1619
1620/**
1621 * pci_find_upstream_pcie_bridge - find upstream PCIe-to-PCI bridge of a device
1622 * @pdev: the PCI device
1623 *
1624 * if the device is PCIE, return NULL
1625 * if the device isn't connected to a PCIe bridge (that is its parent is a
1626 * legacy PCI bridge and the bridge is directly connected to bus 0), return its
1627 * parent
1628 */
1629struct pci_dev *pci_find_upstream_pcie_bridge(struct pci_dev *pdev);
1630
1592#endif /* __KERNEL__ */ 1631#endif /* __KERNEL__ */
1593#endif /* LINUX_PCI_H */ 1632#endif /* LINUX_PCI_H */
diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h
index a311008af5e1..ae96bbe54518 100644
--- a/include/linux/pci_ids.h
+++ b/include/linux/pci_ids.h
@@ -1308,6 +1308,7 @@
1308#define PCI_SUBDEVICE_ID_CREATIVE_SB08801 0x0041 1308#define PCI_SUBDEVICE_ID_CREATIVE_SB08801 0x0041
1309#define PCI_SUBDEVICE_ID_CREATIVE_SB08802 0x0042 1309#define PCI_SUBDEVICE_ID_CREATIVE_SB08802 0x0042
1310#define PCI_SUBDEVICE_ID_CREATIVE_SB08803 0x0043 1310#define PCI_SUBDEVICE_ID_CREATIVE_SB08803 0x0043
1311#define PCI_SUBDEVICE_ID_CREATIVE_SB1270 0x0062
1311#define PCI_SUBDEVICE_ID_CREATIVE_HENDRIX 0x6000 1312#define PCI_SUBDEVICE_ID_CREATIVE_HENDRIX 0x6000
1312 1313
1313#define PCI_VENDOR_ID_ECTIVA 0x1102 /* duplicate: CREATIVE */ 1314#define PCI_VENDOR_ID_ECTIVA 0x1102 /* duplicate: CREATIVE */
@@ -1537,6 +1538,7 @@
1537#define PCI_DEVICE_ID_RICOH_RL5C476 0x0476 1538#define PCI_DEVICE_ID_RICOH_RL5C476 0x0476
1538#define PCI_DEVICE_ID_RICOH_RL5C478 0x0478 1539#define PCI_DEVICE_ID_RICOH_RL5C478 0x0478
1539#define PCI_DEVICE_ID_RICOH_R5C822 0x0822 1540#define PCI_DEVICE_ID_RICOH_R5C822 0x0822
1541#define PCI_DEVICE_ID_RICOH_R5CE823 0xe823
1540#define PCI_DEVICE_ID_RICOH_R5C832 0x0832 1542#define PCI_DEVICE_ID_RICOH_R5C832 0x0832
1541#define PCI_DEVICE_ID_RICOH_R5C843 0x0843 1543#define PCI_DEVICE_ID_RICOH_R5C843 0x0843
1542 1544
@@ -2102,6 +2104,9 @@
2102#define PCI_DEVICE_ID_TIGON3_5761E 0x1680 2104#define PCI_DEVICE_ID_TIGON3_5761E 0x1680
2103#define PCI_DEVICE_ID_TIGON3_5761 0x1681 2105#define PCI_DEVICE_ID_TIGON3_5761 0x1681
2104#define PCI_DEVICE_ID_TIGON3_5764 0x1684 2106#define PCI_DEVICE_ID_TIGON3_5764 0x1684
2107#define PCI_DEVICE_ID_NX2_57800 0x168a
2108#define PCI_DEVICE_ID_NX2_57840 0x168d
2109#define PCI_DEVICE_ID_NX2_57810 0x168e
2105#define PCI_DEVICE_ID_TIGON3_5787M 0x1693 2110#define PCI_DEVICE_ID_TIGON3_5787M 0x1693
2106#define PCI_DEVICE_ID_TIGON3_5782 0x1696 2111#define PCI_DEVICE_ID_TIGON3_5782 0x1696
2107#define PCI_DEVICE_ID_TIGON3_5784 0x1698 2112#define PCI_DEVICE_ID_TIGON3_5784 0x1698
@@ -2109,11 +2114,17 @@
2109#define PCI_DEVICE_ID_TIGON3_5787 0x169b 2114#define PCI_DEVICE_ID_TIGON3_5787 0x169b
2110#define PCI_DEVICE_ID_TIGON3_5788 0x169c 2115#define PCI_DEVICE_ID_TIGON3_5788 0x169c
2111#define PCI_DEVICE_ID_TIGON3_5789 0x169d 2116#define PCI_DEVICE_ID_TIGON3_5789 0x169d
2117#define PCI_DEVICE_ID_NX2_57800_MF 0x16a5
2112#define PCI_DEVICE_ID_TIGON3_5702X 0x16a6 2118#define PCI_DEVICE_ID_TIGON3_5702X 0x16a6
2113#define PCI_DEVICE_ID_TIGON3_5703X 0x16a7 2119#define PCI_DEVICE_ID_TIGON3_5703X 0x16a7
2114#define PCI_DEVICE_ID_TIGON3_5704S 0x16a8 2120#define PCI_DEVICE_ID_TIGON3_5704S 0x16a8
2121#define PCI_DEVICE_ID_NX2_57800_VF 0x16a9
2115#define PCI_DEVICE_ID_NX2_5706S 0x16aa 2122#define PCI_DEVICE_ID_NX2_5706S 0x16aa
2123#define PCI_DEVICE_ID_NX2_57840_MF 0x16ab
2116#define PCI_DEVICE_ID_NX2_5708S 0x16ac 2124#define PCI_DEVICE_ID_NX2_5708S 0x16ac
2125#define PCI_DEVICE_ID_NX2_57840_VF 0x16ad
2126#define PCI_DEVICE_ID_NX2_57810_MF 0x16ae
2127#define PCI_DEVICE_ID_NX2_57810_VF 0x16af
2117#define PCI_DEVICE_ID_TIGON3_5702A3 0x16c6 2128#define PCI_DEVICE_ID_TIGON3_5702A3 0x16c6
2118#define PCI_DEVICE_ID_TIGON3_5703A3 0x16c7 2129#define PCI_DEVICE_ID_TIGON3_5703A3 0x16c7
2119#define PCI_DEVICE_ID_TIGON3_5781 0x16dd 2130#define PCI_DEVICE_ID_TIGON3_5781 0x16dd
@@ -2698,6 +2709,16 @@
2698#define PCI_DEVICE_ID_INTEL_ICH10_5 0x3a60 2709#define PCI_DEVICE_ID_INTEL_ICH10_5 0x3a60
2699#define PCI_DEVICE_ID_INTEL_5_3400_SERIES_LPC_MIN 0x3b00 2710#define PCI_DEVICE_ID_INTEL_5_3400_SERIES_LPC_MIN 0x3b00
2700#define PCI_DEVICE_ID_INTEL_5_3400_SERIES_LPC_MAX 0x3b1f 2711#define PCI_DEVICE_ID_INTEL_5_3400_SERIES_LPC_MAX 0x3b1f
2712#define PCI_DEVICE_ID_INTEL_IOAT_SNB0 0x3c20
2713#define PCI_DEVICE_ID_INTEL_IOAT_SNB1 0x3c21
2714#define PCI_DEVICE_ID_INTEL_IOAT_SNB2 0x3c22
2715#define PCI_DEVICE_ID_INTEL_IOAT_SNB3 0x3c23
2716#define PCI_DEVICE_ID_INTEL_IOAT_SNB4 0x3c24
2717#define PCI_DEVICE_ID_INTEL_IOAT_SNB5 0x3c25
2718#define PCI_DEVICE_ID_INTEL_IOAT_SNB6 0x3c26
2719#define PCI_DEVICE_ID_INTEL_IOAT_SNB7 0x3c27
2720#define PCI_DEVICE_ID_INTEL_IOAT_SNB8 0x3c2e
2721#define PCI_DEVICE_ID_INTEL_IOAT_SNB9 0x3c2f
2701#define PCI_DEVICE_ID_INTEL_IOAT_SNB 0x402f 2722#define PCI_DEVICE_ID_INTEL_IOAT_SNB 0x402f
2702#define PCI_DEVICE_ID_INTEL_5100_16 0x65f0 2723#define PCI_DEVICE_ID_INTEL_5100_16 0x65f0
2703#define PCI_DEVICE_ID_INTEL_5100_21 0x65f5 2724#define PCI_DEVICE_ID_INTEL_5100_21 0x65f5
@@ -2821,7 +2842,11 @@
2821#define PCI_DEVICE_ID_NETMOS_9845 0x9845 2842#define PCI_DEVICE_ID_NETMOS_9845 0x9845
2822#define PCI_DEVICE_ID_NETMOS_9855 0x9855 2843#define PCI_DEVICE_ID_NETMOS_9855 0x9855
2823#define PCI_DEVICE_ID_NETMOS_9865 0x9865 2844#define PCI_DEVICE_ID_NETMOS_9865 0x9865
2845#define PCI_DEVICE_ID_NETMOS_9900 0x9900
2824#define PCI_DEVICE_ID_NETMOS_9901 0x9901 2846#define PCI_DEVICE_ID_NETMOS_9901 0x9901
2847#define PCI_DEVICE_ID_NETMOS_9904 0x9904
2848#define PCI_DEVICE_ID_NETMOS_9912 0x9912
2849#define PCI_DEVICE_ID_NETMOS_9922 0x9922
2825 2850
2826#define PCI_VENDOR_ID_3COM_2 0xa727 2851#define PCI_VENDOR_ID_3COM_2 0xa727
2827 2852
diff --git a/include/linux/percpu.h b/include/linux/percpu.h
index 8b97308e65df..9ca008f0c542 100644
--- a/include/linux/percpu.h
+++ b/include/linux/percpu.h
@@ -259,6 +259,9 @@ extern void __bad_size_call_parameter(void);
259 * Special handling for cmpxchg_double. cmpxchg_double is passed two 259 * Special handling for cmpxchg_double. cmpxchg_double is passed two
260 * percpu variables. The first has to be aligned to a double word 260 * percpu variables. The first has to be aligned to a double word
261 * boundary and the second has to follow directly thereafter. 261 * boundary and the second has to follow directly thereafter.
262 * We enforce this on all architectures even if they don't support
263 * a double cmpxchg instruction, since it's a cheap requirement, and it
264 * avoids breaking the requirement for architectures with the instruction.
262 */ 265 */
263#define __pcpu_double_call_return_bool(stem, pcp1, pcp2, ...) \ 266#define __pcpu_double_call_return_bool(stem, pcp1, pcp2, ...) \
264({ \ 267({ \
diff --git a/include/linux/perf_event.h b/include/linux/perf_event.h
index 3412684ce5d5..245bafdafd5e 100644
--- a/include/linux/perf_event.h
+++ b/include/linux/perf_event.h
@@ -61,7 +61,7 @@ enum perf_hw_id {
61/* 61/*
62 * Generalized hardware cache events: 62 * Generalized hardware cache events:
63 * 63 *
64 * { L1-D, L1-I, LLC, ITLB, DTLB, BPU } x 64 * { L1-D, L1-I, LLC, ITLB, DTLB, BPU, NODE } x
65 * { read, write, prefetch } x 65 * { read, write, prefetch } x
66 * { accesses, misses } 66 * { accesses, misses }
67 */ 67 */
@@ -72,6 +72,7 @@ enum perf_hw_cache_id {
72 PERF_COUNT_HW_CACHE_DTLB = 3, 72 PERF_COUNT_HW_CACHE_DTLB = 3,
73 PERF_COUNT_HW_CACHE_ITLB = 4, 73 PERF_COUNT_HW_CACHE_ITLB = 4,
74 PERF_COUNT_HW_CACHE_BPU = 5, 74 PERF_COUNT_HW_CACHE_BPU = 5,
75 PERF_COUNT_HW_CACHE_NODE = 6,
75 76
76 PERF_COUNT_HW_CACHE_MAX, /* non-ABI */ 77 PERF_COUNT_HW_CACHE_MAX, /* non-ABI */
77}; 78};
@@ -137,14 +138,14 @@ enum perf_event_sample_format {
137 * 138 *
138 * struct read_format { 139 * struct read_format {
139 * { u64 value; 140 * { u64 value;
140 * { u64 time_enabled; } && PERF_FORMAT_ENABLED 141 * { u64 time_enabled; } && PERF_FORMAT_TOTAL_TIME_ENABLED
141 * { u64 time_running; } && PERF_FORMAT_RUNNING 142 * { u64 time_running; } && PERF_FORMAT_TOTAL_TIME_RUNNING
142 * { u64 id; } && PERF_FORMAT_ID 143 * { u64 id; } && PERF_FORMAT_ID
143 * } && !PERF_FORMAT_GROUP 144 * } && !PERF_FORMAT_GROUP
144 * 145 *
145 * { u64 nr; 146 * { u64 nr;
146 * { u64 time_enabled; } && PERF_FORMAT_ENABLED 147 * { u64 time_enabled; } && PERF_FORMAT_TOTAL_TIME_ENABLED
147 * { u64 time_running; } && PERF_FORMAT_RUNNING 148 * { u64 time_running; } && PERF_FORMAT_TOTAL_TIME_RUNNING
148 * { u64 value; 149 * { u64 value;
149 * { u64 id; } && PERF_FORMAT_ID 150 * { u64 id; } && PERF_FORMAT_ID
150 * } cntr[nr]; 151 * } cntr[nr];
@@ -508,7 +509,7 @@ struct perf_guest_info_callbacks {
508#include <linux/cpu.h> 509#include <linux/cpu.h>
509#include <linux/irq_work.h> 510#include <linux/irq_work.h>
510#include <linux/jump_label.h> 511#include <linux/jump_label.h>
511#include <asm/atomic.h> 512#include <linux/atomic.h>
512#include <asm/local.h> 513#include <asm/local.h>
513 514
514#define PERF_MAX_STACK_DEPTH 255 515#define PERF_MAX_STACK_DEPTH 255
@@ -536,6 +537,16 @@ struct perf_branch_stack {
536 537
537struct task_struct; 538struct task_struct;
538 539
540/*
541 * extra PMU register associated with an event
542 */
543struct hw_perf_event_extra {
544 u64 config; /* register value */
545 unsigned int reg; /* register address or index */
546 int alloc; /* extra register already allocated */
547 int idx; /* index in shared_regs->regs[] */
548};
549
539/** 550/**
540 * struct hw_perf_event - performance event hardware details: 551 * struct hw_perf_event - performance event hardware details:
541 */ 552 */
@@ -549,9 +560,7 @@ struct hw_perf_event {
549 unsigned long event_base; 560 unsigned long event_base;
550 int idx; 561 int idx;
551 int last_cpu; 562 int last_cpu;
552 unsigned int extra_reg; 563 struct hw_perf_event_extra extra_reg;
553 u64 extra_config;
554 int extra_alloc;
555 }; 564 };
556 struct { /* software */ 565 struct { /* software */
557 struct hrtimer hrtimer; 566 struct hrtimer hrtimer;
@@ -680,36 +689,9 @@ enum perf_event_active_state {
680}; 689};
681 690
682struct file; 691struct file;
683
684#define PERF_BUFFER_WRITABLE 0x01
685
686struct perf_buffer {
687 atomic_t refcount;
688 struct rcu_head rcu_head;
689#ifdef CONFIG_PERF_USE_VMALLOC
690 struct work_struct work;
691 int page_order; /* allocation order */
692#endif
693 int nr_pages; /* nr of data pages */
694 int writable; /* are we writable */
695
696 atomic_t poll; /* POLL_ for wakeups */
697
698 local_t head; /* write position */
699 local_t nest; /* nested writers */
700 local_t events; /* event limit */
701 local_t wakeup; /* wakeup stamp */
702 local_t lost; /* nr records lost */
703
704 long watermark; /* wakeup watermark */
705
706 struct perf_event_mmap_page *user_page;
707 void *data_pages[0];
708};
709
710struct perf_sample_data; 692struct perf_sample_data;
711 693
712typedef void (*perf_overflow_handler_t)(struct perf_event *, int, 694typedef void (*perf_overflow_handler_t)(struct perf_event *,
713 struct perf_sample_data *, 695 struct perf_sample_data *,
714 struct pt_regs *regs); 696 struct pt_regs *regs);
715 697
@@ -745,6 +727,8 @@ struct perf_cgroup {
745}; 727};
746#endif 728#endif
747 729
730struct ring_buffer;
731
748/** 732/**
749 * struct perf_event - performance event kernel representation: 733 * struct perf_event - performance event kernel representation:
750 */ 734 */
@@ -834,7 +818,7 @@ struct perf_event {
834 atomic_t mmap_count; 818 atomic_t mmap_count;
835 int mmap_locked; 819 int mmap_locked;
836 struct user_struct *mmap_user; 820 struct user_struct *mmap_user;
837 struct perf_buffer *buffer; 821 struct ring_buffer *rb;
838 822
839 /* poll related */ 823 /* poll related */
840 wait_queue_head_t waitq; 824 wait_queue_head_t waitq;
@@ -855,6 +839,7 @@ struct perf_event {
855 u64 id; 839 u64 id;
856 840
857 perf_overflow_handler_t overflow_handler; 841 perf_overflow_handler_t overflow_handler;
842 void *overflow_handler_context;
858 843
859#ifdef CONFIG_EVENT_TRACING 844#ifdef CONFIG_EVENT_TRACING
860 struct ftrace_event_call *tp_event; 845 struct ftrace_event_call *tp_event;
@@ -919,8 +904,8 @@ struct perf_event_context {
919 u64 parent_gen; 904 u64 parent_gen;
920 u64 generation; 905 u64 generation;
921 int pin_count; 906 int pin_count;
922 struct rcu_head rcu_head;
923 int nr_cgroups; /* cgroup events present */ 907 int nr_cgroups; /* cgroup events present */
908 struct rcu_head rcu_head;
924}; 909};
925 910
926/* 911/*
@@ -945,13 +930,11 @@ struct perf_cpu_context {
945 930
946struct perf_output_handle { 931struct perf_output_handle {
947 struct perf_event *event; 932 struct perf_event *event;
948 struct perf_buffer *buffer; 933 struct ring_buffer *rb;
949 unsigned long wakeup; 934 unsigned long wakeup;
950 unsigned long size; 935 unsigned long size;
951 void *addr; 936 void *addr;
952 int page; 937 int page;
953 int nmi;
954 int sample;
955}; 938};
956 939
957#ifdef CONFIG_PERF_EVENTS 940#ifdef CONFIG_PERF_EVENTS
@@ -972,13 +955,15 @@ extern void perf_pmu_disable(struct pmu *pmu);
972extern void perf_pmu_enable(struct pmu *pmu); 955extern void perf_pmu_enable(struct pmu *pmu);
973extern int perf_event_task_disable(void); 956extern int perf_event_task_disable(void);
974extern int perf_event_task_enable(void); 957extern int perf_event_task_enable(void);
958extern int perf_event_refresh(struct perf_event *event, int refresh);
975extern void perf_event_update_userpage(struct perf_event *event); 959extern void perf_event_update_userpage(struct perf_event *event);
976extern int perf_event_release_kernel(struct perf_event *event); 960extern int perf_event_release_kernel(struct perf_event *event);
977extern struct perf_event * 961extern struct perf_event *
978perf_event_create_kernel_counter(struct perf_event_attr *attr, 962perf_event_create_kernel_counter(struct perf_event_attr *attr,
979 int cpu, 963 int cpu,
980 struct task_struct *task, 964 struct task_struct *task,
981 perf_overflow_handler_t callback); 965 perf_overflow_handler_t callback,
966 void *context);
982extern u64 perf_event_read_value(struct perf_event *event, 967extern u64 perf_event_read_value(struct perf_event *event,
983 u64 *enabled, u64 *running); 968 u64 *enabled, u64 *running);
984 969
@@ -1018,7 +1003,7 @@ extern void perf_prepare_sample(struct perf_event_header *header,
1018 struct perf_event *event, 1003 struct perf_event *event,
1019 struct pt_regs *regs); 1004 struct pt_regs *regs);
1020 1005
1021extern int perf_event_overflow(struct perf_event *event, int nmi, 1006extern int perf_event_overflow(struct perf_event *event,
1022 struct perf_sample_data *data, 1007 struct perf_sample_data *data,
1023 struct pt_regs *regs); 1008 struct pt_regs *regs);
1024 1009
@@ -1037,7 +1022,7 @@ static inline int is_software_event(struct perf_event *event)
1037 1022
1038extern struct jump_label_key perf_swevent_enabled[PERF_COUNT_SW_MAX]; 1023extern struct jump_label_key perf_swevent_enabled[PERF_COUNT_SW_MAX];
1039 1024
1040extern void __perf_sw_event(u32, u64, int, struct pt_regs *, u64); 1025extern void __perf_sw_event(u32, u64, struct pt_regs *, u64);
1041 1026
1042#ifndef perf_arch_fetch_caller_regs 1027#ifndef perf_arch_fetch_caller_regs
1043static inline void perf_arch_fetch_caller_regs(struct pt_regs *regs, unsigned long ip) { } 1028static inline void perf_arch_fetch_caller_regs(struct pt_regs *regs, unsigned long ip) { }
@@ -1059,7 +1044,7 @@ static inline void perf_fetch_caller_regs(struct pt_regs *regs)
1059} 1044}
1060 1045
1061static __always_inline void 1046static __always_inline void
1062perf_sw_event(u32 event_id, u64 nr, int nmi, struct pt_regs *regs, u64 addr) 1047perf_sw_event(u32 event_id, u64 nr, struct pt_regs *regs, u64 addr)
1063{ 1048{
1064 struct pt_regs hot_regs; 1049 struct pt_regs hot_regs;
1065 1050
@@ -1068,7 +1053,7 @@ perf_sw_event(u32 event_id, u64 nr, int nmi, struct pt_regs *regs, u64 addr)
1068 perf_fetch_caller_regs(&hot_regs); 1053 perf_fetch_caller_regs(&hot_regs);
1069 regs = &hot_regs; 1054 regs = &hot_regs;
1070 } 1055 }
1071 __perf_sw_event(event_id, nr, nmi, regs, addr); 1056 __perf_sw_event(event_id, nr, regs, addr);
1072 } 1057 }
1073} 1058}
1074 1059
@@ -1082,7 +1067,7 @@ static inline void perf_event_task_sched_in(struct task_struct *task)
1082 1067
1083static inline void perf_event_task_sched_out(struct task_struct *task, struct task_struct *next) 1068static inline void perf_event_task_sched_out(struct task_struct *task, struct task_struct *next)
1084{ 1069{
1085 perf_sw_event(PERF_COUNT_SW_CONTEXT_SWITCHES, 1, 1, NULL, 0); 1070 perf_sw_event(PERF_COUNT_SW_CONTEXT_SWITCHES, 1, NULL, 0);
1086 1071
1087 __perf_event_task_sched_out(task, next); 1072 __perf_event_task_sched_out(task, next);
1088} 1073}
@@ -1143,8 +1128,7 @@ extern void perf_bp_event(struct perf_event *event, void *data);
1143#endif 1128#endif
1144 1129
1145extern int perf_output_begin(struct perf_output_handle *handle, 1130extern int perf_output_begin(struct perf_output_handle *handle,
1146 struct perf_event *event, unsigned int size, 1131 struct perf_event *event, unsigned int size);
1147 int nmi, int sample);
1148extern void perf_output_end(struct perf_output_handle *handle); 1132extern void perf_output_end(struct perf_output_handle *handle);
1149extern void perf_output_copy(struct perf_output_handle *handle, 1133extern void perf_output_copy(struct perf_output_handle *handle,
1150 const void *buf, unsigned int len); 1134 const void *buf, unsigned int len);
@@ -1166,10 +1150,13 @@ static inline void perf_event_delayed_put(struct task_struct *task) { }
1166static inline void perf_event_print_debug(void) { } 1150static inline void perf_event_print_debug(void) { }
1167static inline int perf_event_task_disable(void) { return -EINVAL; } 1151static inline int perf_event_task_disable(void) { return -EINVAL; }
1168static inline int perf_event_task_enable(void) { return -EINVAL; } 1152static inline int perf_event_task_enable(void) { return -EINVAL; }
1153static inline int perf_event_refresh(struct perf_event *event, int refresh)
1154{
1155 return -EINVAL;
1156}
1169 1157
1170static inline void 1158static inline void
1171perf_sw_event(u32 event_id, u64 nr, int nmi, 1159perf_sw_event(u32 event_id, u64 nr, struct pt_regs *regs, u64 addr) { }
1172 struct pt_regs *regs, u64 addr) { }
1173static inline void 1160static inline void
1174perf_bp_event(struct perf_event *event, void *data) { } 1161perf_bp_event(struct perf_event *event, void *data) { }
1175 1162
diff --git a/include/linux/phy.h b/include/linux/phy.h
index 7da5fa845959..54fc4138955f 100644
--- a/include/linux/phy.h
+++ b/include/linux/phy.h
@@ -26,7 +26,7 @@
26#include <linux/workqueue.h> 26#include <linux/workqueue.h>
27#include <linux/mod_devicetable.h> 27#include <linux/mod_devicetable.h>
28 28
29#include <asm/atomic.h> 29#include <linux/atomic.h>
30 30
31#define PHY_BASIC_FEATURES (SUPPORTED_10baseT_Half | \ 31#define PHY_BASIC_FEATURES (SUPPORTED_10baseT_Half | \
32 SUPPORTED_10baseT_Full | \ 32 SUPPORTED_10baseT_Full | \
@@ -53,6 +53,7 @@
53 53
54/* Interface Mode definitions */ 54/* Interface Mode definitions */
55typedef enum { 55typedef enum {
56 PHY_INTERFACE_MODE_NA,
56 PHY_INTERFACE_MODE_MII, 57 PHY_INTERFACE_MODE_MII,
57 PHY_INTERFACE_MODE_GMII, 58 PHY_INTERFACE_MODE_GMII,
58 PHY_INTERFACE_MODE_SGMII, 59 PHY_INTERFACE_MODE_SGMII,
@@ -62,7 +63,8 @@ typedef enum {
62 PHY_INTERFACE_MODE_RGMII_ID, 63 PHY_INTERFACE_MODE_RGMII_ID,
63 PHY_INTERFACE_MODE_RGMII_RXID, 64 PHY_INTERFACE_MODE_RGMII_RXID,
64 PHY_INTERFACE_MODE_RGMII_TXID, 65 PHY_INTERFACE_MODE_RGMII_TXID,
65 PHY_INTERFACE_MODE_RTBI 66 PHY_INTERFACE_MODE_RTBI,
67 PHY_INTERFACE_MODE_SMII,
66} phy_interface_t; 68} phy_interface_t;
67 69
68 70
diff --git a/include/linux/platform_data/fsa9480.h b/include/linux/platform_data/fsa9480.h
new file mode 100644
index 000000000000..72dddcb4bed1
--- /dev/null
+++ b/include/linux/platform_data/fsa9480.h
@@ -0,0 +1,27 @@
1/*
2 * Copyright (C) 2010 Samsung Electronics
3 * Minkyu Kang <mk7.kang@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
10#ifndef _FSA9480_H_
11#define _FSA9480_H_
12
13#define FSA9480_ATTACHED 1
14#define FSA9480_DETACHED 0
15
16struct fsa9480_platform_data {
17 void (*cfg_gpio) (void);
18 void (*usb_cb) (u8 attached);
19 void (*uart_cb) (u8 attached);
20 void (*charger_cb) (u8 attached);
21 void (*jig_cb) (u8 attached);
22 void (*reset_cb) (void);
23 void (*usb_power) (u8 on);
24 int wakeup;
25};
26
27#endif /* _FSA9480_H_ */
diff --git a/include/linux/platform_data/ntc_thermistor.h b/include/linux/platform_data/ntc_thermistor.h
new file mode 100644
index 000000000000..abd286215279
--- /dev/null
+++ b/include/linux/platform_data/ntc_thermistor.h
@@ -0,0 +1,53 @@
1/*
2 * ntc_thermistor.h - NTC Thermistors
3 *
4 * Copyright (C) 2010 Samsung Electronics
5 * MyungJoo Ham <myungjoo.ham@samsung.com>
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 */
21#ifndef _LINUX_NTC_H
22#define _LINUX_NTC_H
23
24enum ntc_thermistor_type {
25 TYPE_NCPXXWB473,
26 TYPE_NCPXXWL333,
27};
28
29struct ntc_thermistor_platform_data {
30 /*
31 * One (not both) of read_uV and read_ohm should be provided and only
32 * one of the two should be provided.
33 * Both functions should return negative value for an error case.
34 *
35 * pullup_uV, pullup_ohm, pulldown_ohm, and connect are required to use
36 * read_uV()
37 *
38 * How to setup pullup_ohm, pulldown_ohm, and connect is
39 * described at Documentation/hwmon/ntc
40 *
41 * pullup/down_ohm: 0 for infinite / not-connected
42 */
43 int (*read_uV)(void);
44 unsigned int pullup_uV;
45
46 unsigned int pullup_ohm;
47 unsigned int pulldown_ohm;
48 enum { NTC_CONNECTED_POSITIVE, NTC_CONNECTED_GROUND } connect;
49
50 int (*read_ohm)(void);
51};
52
53#endif /* _LINUX_NTC_H */
diff --git a/include/linux/platform_data/pxa_sdhci.h b/include/linux/platform_data/pxa_sdhci.h
new file mode 100644
index 000000000000..51ad0995abac
--- /dev/null
+++ b/include/linux/platform_data/pxa_sdhci.h
@@ -0,0 +1,60 @@
1/*
2 * include/linux/platform_data/pxa_sdhci.h
3 *
4 * Copyright 2010 Marvell
5 * Zhangfei Gao <zhangfei.gao@marvell.com>
6 *
7 * PXA Platform - SDHCI platform data definitions
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 _PXA_SDHCI_H_
15#define _PXA_SDHCI_H_
16
17/* pxa specific flag */
18/* Require clock free running */
19#define PXA_FLAG_ENABLE_CLOCK_GATING (1<<0)
20/* card always wired to host, like on-chip emmc */
21#define PXA_FLAG_CARD_PERMANENT (1<<1)
22/* Board design supports 8-bit data on SD/SDIO BUS */
23#define PXA_FLAG_SD_8_BIT_CAPABLE_SLOT (1<<2)
24
25/*
26 * struct pxa_sdhci_platdata() - Platform device data for PXA SDHCI
27 * @flags: flags for platform requirement
28 * @clk_delay_cycles:
29 * mmp2: each step is roughly 100ps, 5bits width
30 * pxa910: each step is 1ns, 4bits width
31 * @clk_delay_sel: select clk_delay, used on pxa910
32 * 0: choose feedback clk
33 * 1: choose feedback clk + delay value
34 * 2: choose internal clk
35 * @clk_delay_enable: enable clk_delay or not, used on pxa910
36 * @ext_cd_gpio: gpio pin used for external CD line
37 * @ext_cd_gpio_invert: invert values for external CD gpio line
38 * @max_speed: the maximum speed supported
39 * @host_caps: Standard MMC host capabilities bit field.
40 * @quirks: quirks of platfrom
41 * @pm_caps: pm_caps of platfrom
42 */
43struct sdhci_pxa_platdata {
44 unsigned int flags;
45 unsigned int clk_delay_cycles;
46 unsigned int clk_delay_sel;
47 bool clk_delay_enable;
48 unsigned int ext_cd_gpio;
49 bool ext_cd_gpio_invert;
50 unsigned int max_speed;
51 unsigned int host_caps;
52 unsigned int quirks;
53 unsigned int pm_caps;
54};
55
56struct sdhci_pxa {
57 u8 clk_enable;
58 u8 power_mode;
59};
60#endif /* _PXA_SDHCI_H_ */
diff --git a/include/linux/platform_device.h b/include/linux/platform_device.h
index ede1a80e3358..27bb05aae70d 100644
--- a/include/linux/platform_device.h
+++ b/include/linux/platform_device.h
@@ -42,6 +42,7 @@ extern void platform_device_unregister(struct platform_device *);
42extern struct bus_type platform_bus_type; 42extern struct bus_type platform_bus_type;
43extern struct device platform_bus; 43extern struct device platform_bus;
44 44
45extern void arch_setup_pdev_archdata(struct platform_device *);
45extern struct resource *platform_get_resource(struct platform_device *, unsigned int, unsigned int); 46extern struct resource *platform_get_resource(struct platform_device *, unsigned int, unsigned int);
46extern int platform_get_irq(struct platform_device *, unsigned int); 47extern int platform_get_irq(struct platform_device *, unsigned int);
47extern struct resource *platform_get_resource_byname(struct platform_device *, unsigned int, const char *); 48extern struct resource *platform_get_resource_byname(struct platform_device *, unsigned int, const char *);
diff --git a/include/linux/plist.h b/include/linux/plist.h
index c9b9f322c8d8..aa0fb390bd29 100644
--- a/include/linux/plist.h
+++ b/include/linux/plist.h
@@ -77,14 +77,9 @@
77 77
78#include <linux/kernel.h> 78#include <linux/kernel.h>
79#include <linux/list.h> 79#include <linux/list.h>
80#include <linux/spinlock_types.h>
81 80
82struct plist_head { 81struct plist_head {
83 struct list_head node_list; 82 struct list_head node_list;
84#ifdef CONFIG_DEBUG_PI_LIST
85 raw_spinlock_t *rawlock;
86 spinlock_t *spinlock;
87#endif
88}; 83};
89 84
90struct plist_node { 85struct plist_node {
@@ -93,37 +88,13 @@ struct plist_node {
93 struct list_head node_list; 88 struct list_head node_list;
94}; 89};
95 90
96#ifdef CONFIG_DEBUG_PI_LIST
97# define PLIST_HEAD_LOCK_INIT(_lock) .spinlock = _lock
98# define PLIST_HEAD_LOCK_INIT_RAW(_lock) .rawlock = _lock
99#else
100# define PLIST_HEAD_LOCK_INIT(_lock)
101# define PLIST_HEAD_LOCK_INIT_RAW(_lock)
102#endif
103
104#define _PLIST_HEAD_INIT(head) \
105 .node_list = LIST_HEAD_INIT((head).node_list)
106
107/** 91/**
108 * PLIST_HEAD_INIT - static struct plist_head initializer 92 * PLIST_HEAD_INIT - static struct plist_head initializer
109 * @head: struct plist_head variable name 93 * @head: struct plist_head variable name
110 * @_lock: lock to initialize for this list
111 */
112#define PLIST_HEAD_INIT(head, _lock) \
113{ \
114 _PLIST_HEAD_INIT(head), \
115 PLIST_HEAD_LOCK_INIT(&(_lock)) \
116}
117
118/**
119 * PLIST_HEAD_INIT_RAW - static struct plist_head initializer
120 * @head: struct plist_head variable name
121 * @_lock: lock to initialize for this list
122 */ 94 */
123#define PLIST_HEAD_INIT_RAW(head, _lock) \ 95#define PLIST_HEAD_INIT(head) \
124{ \ 96{ \
125 _PLIST_HEAD_INIT(head), \ 97 .node_list = LIST_HEAD_INIT((head).node_list) \
126 PLIST_HEAD_LOCK_INIT_RAW(&(_lock)) \
127} 98}
128 99
129/** 100/**
@@ -141,31 +112,11 @@ struct plist_node {
141/** 112/**
142 * plist_head_init - dynamic struct plist_head initializer 113 * plist_head_init - dynamic struct plist_head initializer
143 * @head: &struct plist_head pointer 114 * @head: &struct plist_head pointer
144 * @lock: spinlock protecting the list (debugging)
145 */ 115 */
146static inline void 116static inline void
147plist_head_init(struct plist_head *head, spinlock_t *lock) 117plist_head_init(struct plist_head *head)
148{ 118{
149 INIT_LIST_HEAD(&head->node_list); 119 INIT_LIST_HEAD(&head->node_list);
150#ifdef CONFIG_DEBUG_PI_LIST
151 head->spinlock = lock;
152 head->rawlock = NULL;
153#endif
154}
155
156/**
157 * plist_head_init_raw - dynamic struct plist_head initializer
158 * @head: &struct plist_head pointer
159 * @lock: raw_spinlock protecting the list (debugging)
160 */
161static inline void
162plist_head_init_raw(struct plist_head *head, raw_spinlock_t *lock)
163{
164 INIT_LIST_HEAD(&head->node_list);
165#ifdef CONFIG_DEBUG_PI_LIST
166 head->rawlock = lock;
167 head->spinlock = NULL;
168#endif
169} 120}
170 121
171/** 122/**
diff --git a/include/linux/pm.h b/include/linux/pm.h
index 3160648ccdda..f7c84c9abd30 100644
--- a/include/linux/pm.h
+++ b/include/linux/pm.h
@@ -425,7 +425,8 @@ struct dev_pm_info {
425 pm_message_t power_state; 425 pm_message_t power_state;
426 unsigned int can_wakeup:1; 426 unsigned int can_wakeup:1;
427 unsigned int async_suspend:1; 427 unsigned int async_suspend:1;
428 unsigned int in_suspend:1; /* Owned by the PM core */ 428 bool is_prepared:1; /* Owned by the PM core */
429 bool is_suspended:1; /* Ditto */
429 spinlock_t lock; 430 spinlock_t lock;
430#ifdef CONFIG_PM_SLEEP 431#ifdef CONFIG_PM_SLEEP
431 struct list_head entry; 432 struct list_head entry;
@@ -460,8 +461,8 @@ struct dev_pm_info {
460 unsigned long active_jiffies; 461 unsigned long active_jiffies;
461 unsigned long suspended_jiffies; 462 unsigned long suspended_jiffies;
462 unsigned long accounting_timestamp; 463 unsigned long accounting_timestamp;
463 void *subsys_data; /* Owned by the subsystem. */
464#endif 464#endif
465 void *subsys_data; /* Owned by the subsystem. */
465}; 466};
466 467
467extern void update_pm_runtime_accounting(struct device *dev); 468extern void update_pm_runtime_accounting(struct device *dev);
@@ -471,7 +472,7 @@ extern void update_pm_runtime_accounting(struct device *dev);
471 * hibernation, system resume and during runtime PM transitions along with 472 * hibernation, system resume and during runtime PM transitions along with
472 * subsystem-level and driver-level callbacks. 473 * subsystem-level and driver-level callbacks.
473 */ 474 */
474struct dev_power_domain { 475struct dev_pm_domain {
475 struct dev_pm_ops ops; 476 struct dev_pm_ops ops;
476}; 477};
477 478
@@ -552,11 +553,17 @@ extern void __suspend_report_result(const char *function, void *fn, int ret);
552extern int device_pm_wait_for_dev(struct device *sub, struct device *dev); 553extern int device_pm_wait_for_dev(struct device *sub, struct device *dev);
553 554
554extern int pm_generic_prepare(struct device *dev); 555extern int pm_generic_prepare(struct device *dev);
556extern int pm_generic_suspend_noirq(struct device *dev);
555extern int pm_generic_suspend(struct device *dev); 557extern int pm_generic_suspend(struct device *dev);
558extern int pm_generic_resume_noirq(struct device *dev);
556extern int pm_generic_resume(struct device *dev); 559extern int pm_generic_resume(struct device *dev);
560extern int pm_generic_freeze_noirq(struct device *dev);
557extern int pm_generic_freeze(struct device *dev); 561extern int pm_generic_freeze(struct device *dev);
562extern int pm_generic_thaw_noirq(struct device *dev);
558extern int pm_generic_thaw(struct device *dev); 563extern int pm_generic_thaw(struct device *dev);
564extern int pm_generic_restore_noirq(struct device *dev);
559extern int pm_generic_restore(struct device *dev); 565extern int pm_generic_restore(struct device *dev);
566extern int pm_generic_poweroff_noirq(struct device *dev);
560extern int pm_generic_poweroff(struct device *dev); 567extern int pm_generic_poweroff(struct device *dev);
561extern void pm_generic_complete(struct device *dev); 568extern void pm_generic_complete(struct device *dev);
562 569
diff --git a/include/linux/pm_domain.h b/include/linux/pm_domain.h
new file mode 100644
index 000000000000..21097cb086fe
--- /dev/null
+++ b/include/linux/pm_domain.h
@@ -0,0 +1,108 @@
1/*
2 * pm_domain.h - Definitions and headers related to device power domains.
3 *
4 * Copyright (C) 2011 Rafael J. Wysocki <rjw@sisk.pl>, Renesas Electronics Corp.
5 *
6 * This file is released under the GPLv2.
7 */
8
9#ifndef _LINUX_PM_DOMAIN_H
10#define _LINUX_PM_DOMAIN_H
11
12#include <linux/device.h>
13
14enum gpd_status {
15 GPD_STATE_ACTIVE = 0, /* PM domain is active */
16 GPD_STATE_BUSY, /* Something is happening to the PM domain */
17 GPD_STATE_REPEAT, /* Power off in progress, to be repeated */
18 GPD_STATE_POWER_OFF, /* PM domain is off */
19};
20
21struct dev_power_governor {
22 bool (*power_down_ok)(struct dev_pm_domain *domain);
23};
24
25struct generic_pm_domain {
26 struct dev_pm_domain domain; /* PM domain operations */
27 struct list_head gpd_list_node; /* Node in the global PM domains list */
28 struct list_head sd_node; /* Node in the parent's subdomain list */
29 struct generic_pm_domain *parent; /* Parent PM domain */
30 struct list_head sd_list; /* List of dubdomains */
31 struct list_head dev_list; /* List of devices */
32 struct mutex lock;
33 struct dev_power_governor *gov;
34 struct work_struct power_off_work;
35 unsigned int in_progress; /* Number of devices being suspended now */
36 unsigned int sd_count; /* Number of subdomains with power "on" */
37 enum gpd_status status; /* Current state of the domain */
38 wait_queue_head_t status_wait_queue;
39 struct task_struct *poweroff_task; /* Powering off task */
40 unsigned int resume_count; /* Number of devices being resumed */
41 unsigned int device_count; /* Number of devices */
42 unsigned int suspended_count; /* System suspend device counter */
43 unsigned int prepared_count; /* Suspend counter of prepared devices */
44 bool suspend_power_off; /* Power status before system suspend */
45 int (*power_off)(struct generic_pm_domain *domain);
46 int (*power_on)(struct generic_pm_domain *domain);
47 int (*start_device)(struct device *dev);
48 int (*stop_device)(struct device *dev);
49 bool (*active_wakeup)(struct device *dev);
50};
51
52static inline struct generic_pm_domain *pd_to_genpd(struct dev_pm_domain *pd)
53{
54 return container_of(pd, struct generic_pm_domain, domain);
55}
56
57struct dev_list_entry {
58 struct list_head node;
59 struct device *dev;
60 bool need_restore;
61};
62
63#ifdef CONFIG_PM_GENERIC_DOMAINS
64extern int pm_genpd_add_device(struct generic_pm_domain *genpd,
65 struct device *dev);
66extern int pm_genpd_remove_device(struct generic_pm_domain *genpd,
67 struct device *dev);
68extern int pm_genpd_add_subdomain(struct generic_pm_domain *genpd,
69 struct generic_pm_domain *new_subdomain);
70extern int pm_genpd_remove_subdomain(struct generic_pm_domain *genpd,
71 struct generic_pm_domain *target);
72extern void pm_genpd_init(struct generic_pm_domain *genpd,
73 struct dev_power_governor *gov, bool is_off);
74extern int pm_genpd_poweron(struct generic_pm_domain *genpd);
75extern void pm_genpd_poweroff_unused(void);
76extern void genpd_queue_power_off_work(struct generic_pm_domain *genpd);
77#else
78static inline int pm_genpd_add_device(struct generic_pm_domain *genpd,
79 struct device *dev)
80{
81 return -ENOSYS;
82}
83static inline int pm_genpd_remove_device(struct generic_pm_domain *genpd,
84 struct device *dev)
85{
86 return -ENOSYS;
87}
88static inline int pm_genpd_add_subdomain(struct generic_pm_domain *genpd,
89 struct generic_pm_domain *new_sd)
90{
91 return -ENOSYS;
92}
93static inline int pm_genpd_remove_subdomain(struct generic_pm_domain *genpd,
94 struct generic_pm_domain *target)
95{
96 return -ENOSYS;
97}
98static inline void pm_genpd_init(struct generic_pm_domain *genpd,
99 struct dev_power_governor *gov, bool is_off) {}
100static inline int pm_genpd_poweron(struct generic_pm_domain *genpd)
101{
102 return -ENOSYS;
103}
104static inline void pm_genpd_poweroff_unused(void) {}
105static inline void genpd_queue_power_off_work(struct generic_pm_domain *gpd) {}
106#endif
107
108#endif /* _LINUX_PM_DOMAIN_H */
diff --git a/include/linux/pm_runtime.h b/include/linux/pm_runtime.h
index 878cf84baeb1..daac05d751b2 100644
--- a/include/linux/pm_runtime.h
+++ b/include/linux/pm_runtime.h
@@ -82,6 +82,11 @@ static inline bool pm_runtime_suspended(struct device *dev)
82 && !dev->power.disable_depth; 82 && !dev->power.disable_depth;
83} 83}
84 84
85static inline bool pm_runtime_status_suspended(struct device *dev)
86{
87 return dev->power.runtime_status == RPM_SUSPENDED;
88}
89
85static inline bool pm_runtime_enabled(struct device *dev) 90static inline bool pm_runtime_enabled(struct device *dev)
86{ 91{
87 return !dev->power.disable_depth; 92 return !dev->power.disable_depth;
@@ -130,6 +135,7 @@ static inline void pm_runtime_put_noidle(struct device *dev) {}
130static inline bool device_run_wake(struct device *dev) { return false; } 135static inline bool device_run_wake(struct device *dev) { return false; }
131static inline void device_set_run_wake(struct device *dev, bool enable) {} 136static inline void device_set_run_wake(struct device *dev, bool enable) {}
132static inline bool pm_runtime_suspended(struct device *dev) { return false; } 137static inline bool pm_runtime_suspended(struct device *dev) { return false; }
138static inline bool pm_runtime_status_suspended(struct device *dev) { return false; }
133static inline bool pm_runtime_enabled(struct device *dev) { return false; } 139static inline bool pm_runtime_enabled(struct device *dev) { return false; }
134 140
135static inline int pm_generic_runtime_idle(struct device *dev) { return 0; } 141static inline int pm_generic_runtime_idle(struct device *dev) { return 0; }
@@ -247,41 +253,41 @@ static inline void pm_runtime_dont_use_autosuspend(struct device *dev)
247 253
248struct pm_clk_notifier_block { 254struct pm_clk_notifier_block {
249 struct notifier_block nb; 255 struct notifier_block nb;
250 struct dev_power_domain *pwr_domain; 256 struct dev_pm_domain *pm_domain;
251 char *con_ids[]; 257 char *con_ids[];
252}; 258};
253 259
254#ifdef CONFIG_PM_RUNTIME_CLK 260#ifdef CONFIG_PM_CLK
255extern int pm_runtime_clk_init(struct device *dev); 261extern int pm_clk_init(struct device *dev);
256extern void pm_runtime_clk_destroy(struct device *dev); 262extern void pm_clk_destroy(struct device *dev);
257extern int pm_runtime_clk_add(struct device *dev, const char *con_id); 263extern int pm_clk_add(struct device *dev, const char *con_id);
258extern void pm_runtime_clk_remove(struct device *dev, const char *con_id); 264extern void pm_clk_remove(struct device *dev, const char *con_id);
259extern int pm_runtime_clk_suspend(struct device *dev); 265extern int pm_clk_suspend(struct device *dev);
260extern int pm_runtime_clk_resume(struct device *dev); 266extern int pm_clk_resume(struct device *dev);
261#else 267#else
262static inline int pm_runtime_clk_init(struct device *dev) 268static inline int pm_clk_init(struct device *dev)
263{ 269{
264 return -EINVAL; 270 return -EINVAL;
265} 271}
266static inline void pm_runtime_clk_destroy(struct device *dev) 272static inline void pm_clk_destroy(struct device *dev)
267{ 273{
268} 274}
269static inline int pm_runtime_clk_add(struct device *dev, const char *con_id) 275static inline int pm_clk_add(struct device *dev, const char *con_id)
270{ 276{
271 return -EINVAL; 277 return -EINVAL;
272} 278}
273static inline void pm_runtime_clk_remove(struct device *dev, const char *con_id) 279static inline void pm_clk_remove(struct device *dev, const char *con_id)
274{ 280{
275} 281}
276#define pm_runtime_clock_suspend NULL 282#define pm_clk_suspend NULL
277#define pm_runtime_clock_resume NULL 283#define pm_clk_resume NULL
278#endif 284#endif
279 285
280#ifdef CONFIG_HAVE_CLK 286#ifdef CONFIG_HAVE_CLK
281extern void pm_runtime_clk_add_notifier(struct bus_type *bus, 287extern void pm_clk_add_notifier(struct bus_type *bus,
282 struct pm_clk_notifier_block *clknb); 288 struct pm_clk_notifier_block *clknb);
283#else 289#else
284static inline void pm_runtime_clk_add_notifier(struct bus_type *bus, 290static inline void pm_clk_add_notifier(struct bus_type *bus,
285 struct pm_clk_notifier_block *clknb) 291 struct pm_clk_notifier_block *clknb)
286{ 292{
287} 293}
diff --git a/include/linux/pnfs_osd_xdr.h b/include/linux/pnfs_osd_xdr.h
index 76efbdd01622..435dd5fa7453 100644
--- a/include/linux/pnfs_osd_xdr.h
+++ b/include/linux/pnfs_osd_xdr.h
@@ -41,9 +41,6 @@
41 41
42#include <linux/nfs_fs.h> 42#include <linux/nfs_fs.h>
43#include <linux/nfs_page.h> 43#include <linux/nfs_page.h>
44#include <scsi/osd_protocol.h>
45
46#define PNFS_OSD_OSDNAME_MAXSIZE 256
47 44
48/* 45/*
49 * draft-ietf-nfsv4-minorversion-22 46 * draft-ietf-nfsv4-minorversion-22
@@ -99,12 +96,6 @@ struct pnfs_osd_objid {
99#define _DEVID_HI(oid_device_id) \ 96#define _DEVID_HI(oid_device_id) \
100 (unsigned long long)be64_to_cpup(((__be64 *)(oid_device_id)->data) + 1) 97 (unsigned long long)be64_to_cpup(((__be64 *)(oid_device_id)->data) + 1)
101 98
102static inline int
103pnfs_osd_objid_xdr_sz(void)
104{
105 return (NFS4_DEVICEID4_SIZE / 4) + 2 + 2;
106}
107
108enum pnfs_osd_version { 99enum pnfs_osd_version {
109 PNFS_OSD_MISSING = 0, 100 PNFS_OSD_MISSING = 0,
110 PNFS_OSD_VERSION_1 = 1, 101 PNFS_OSD_VERSION_1 = 1,
@@ -189,8 +180,6 @@ struct pnfs_osd_targetid {
189 struct nfs4_string oti_scsi_device_id; 180 struct nfs4_string oti_scsi_device_id;
190}; 181};
191 182
192enum { PNFS_OSD_TARGETID_MAX = 1 + PNFS_OSD_OSDNAME_MAXSIZE / 4 };
193
194/* struct netaddr4 { 183/* struct netaddr4 {
195 * // see struct rpcb in RFC1833 184 * // see struct rpcb in RFC1833
196 * string r_netid<>; // network id 185 * string r_netid<>; // network id
@@ -207,12 +196,6 @@ struct pnfs_osd_targetaddr {
207 struct pnfs_osd_net_addr ota_netaddr; 196 struct pnfs_osd_net_addr ota_netaddr;
208}; 197};
209 198
210enum {
211 NETWORK_ID_MAX = 16 / 4,
212 UNIVERSAL_ADDRESS_MAX = 64 / 4,
213 PNFS_OSD_TARGETADDR_MAX = 3 + NETWORK_ID_MAX + UNIVERSAL_ADDRESS_MAX,
214};
215
216struct pnfs_osd_deviceaddr { 199struct pnfs_osd_deviceaddr {
217 struct pnfs_osd_targetid oda_targetid; 200 struct pnfs_osd_targetid oda_targetid;
218 struct pnfs_osd_targetaddr oda_targetaddr; 201 struct pnfs_osd_targetaddr oda_targetaddr;
@@ -222,15 +205,6 @@ struct pnfs_osd_deviceaddr {
222 struct nfs4_string oda_osdname; 205 struct nfs4_string oda_osdname;
223}; 206};
224 207
225enum {
226 ODA_OSDNAME_MAX = PNFS_OSD_OSDNAME_MAXSIZE / 4,
227 PNFS_OSD_DEVICEADDR_MAX =
228 PNFS_OSD_TARGETID_MAX + PNFS_OSD_TARGETADDR_MAX +
229 2 /*oda_lun*/ +
230 1 + OSD_SYSTEMID_LEN +
231 1 + ODA_OSDNAME_MAX,
232};
233
234/* LAYOUTCOMMIT: layoutupdate */ 208/* LAYOUTCOMMIT: layoutupdate */
235 209
236/* union pnfs_osd_deltaspaceused4 switch (bool dsu_valid) { 210/* union pnfs_osd_deltaspaceused4 switch (bool dsu_valid) {
@@ -279,7 +253,7 @@ struct pnfs_osd_ioerr {
279 u32 oer_errno; 253 u32 oer_errno;
280}; 254};
281 255
282/* OSD XDR API */ 256/* OSD XDR Client API */
283/* Layout helpers */ 257/* Layout helpers */
284/* Layout decoding is done in two parts: 258/* Layout decoding is done in two parts:
285 * 1. First Call pnfs_osd_xdr_decode_layout_map to read in only the header part 259 * 1. First Call pnfs_osd_xdr_decode_layout_map to read in only the header part
@@ -337,8 +311,7 @@ extern int
337pnfs_osd_xdr_encode_layoutupdate(struct xdr_stream *xdr, 311pnfs_osd_xdr_encode_layoutupdate(struct xdr_stream *xdr,
338 struct pnfs_osd_layoutupdate *lou); 312 struct pnfs_osd_layoutupdate *lou);
339 313
340/* osd_ioerror encoding/decoding (layout_return) */ 314/* osd_ioerror encoding (layout_return) */
341/* Client */
342extern __be32 *pnfs_osd_xdr_ioerr_reserve_space(struct xdr_stream *xdr); 315extern __be32 *pnfs_osd_xdr_ioerr_reserve_space(struct xdr_stream *xdr);
343extern void pnfs_osd_xdr_encode_ioerr(__be32 *p, struct pnfs_osd_ioerr *ioerr); 316extern void pnfs_osd_xdr_encode_ioerr(__be32 *p, struct pnfs_osd_ioerr *ioerr);
344 317
diff --git a/include/linux/pnp.h b/include/linux/pnp.h
index 1bc1338b817b..195aafc6cd07 100644
--- a/include/linux/pnp.h
+++ b/include/linux/pnp.h
@@ -50,7 +50,7 @@ static inline resource_size_t pnp_resource_len(struct resource *res)
50{ 50{
51 if (res->start == 0 && res->end == 0) 51 if (res->start == 0 && res->end == 0)
52 return 0; 52 return 0;
53 return res->end - res->start + 1; 53 return resource_size(res);
54} 54}
55 55
56 56
diff --git a/include/linux/poison.h b/include/linux/poison.h
index 2110a81c5e2a..79159de0e341 100644
--- a/include/linux/poison.h
+++ b/include/linux/poison.h
@@ -40,6 +40,12 @@
40#define RED_INACTIVE 0x09F911029D74E35BULL /* when obj is inactive */ 40#define RED_INACTIVE 0x09F911029D74E35BULL /* when obj is inactive */
41#define RED_ACTIVE 0xD84156C5635688C0ULL /* when obj is active */ 41#define RED_ACTIVE 0xD84156C5635688C0ULL /* when obj is active */
42 42
43#ifdef CONFIG_PHYS_ADDR_T_64BIT
44#define MEMBLOCK_INACTIVE 0x3a84fb0144c9e71bULL
45#else
46#define MEMBLOCK_INACTIVE 0x44c9e71bUL
47#endif
48
43#define SLUB_RED_INACTIVE 0xbb 49#define SLUB_RED_INACTIVE 0xbb
44#define SLUB_RED_ACTIVE 0xcc 50#define SLUB_RED_ACTIVE 0xcc
45 51
diff --git a/include/linux/posix_acl.h b/include/linux/posix_acl.h
index 54211c1cd926..b7681102a4b9 100644
--- a/include/linux/posix_acl.h
+++ b/include/linux/posix_acl.h
@@ -9,6 +9,7 @@
9#define __LINUX_POSIX_ACL_H 9#define __LINUX_POSIX_ACL_H
10 10
11#include <linux/slab.h> 11#include <linux/slab.h>
12#include <linux/rcupdate.h>
12 13
13#define ACL_UNDEFINED_ID (-1) 14#define ACL_UNDEFINED_ID (-1)
14 15
@@ -38,7 +39,10 @@ struct posix_acl_entry {
38}; 39};
39 40
40struct posix_acl { 41struct posix_acl {
41 atomic_t a_refcount; 42 union {
43 atomic_t a_refcount;
44 struct rcu_head a_rcu;
45 };
42 unsigned int a_count; 46 unsigned int a_count;
43 struct posix_acl_entry a_entries[0]; 47 struct posix_acl_entry a_entries[0];
44}; 48};
@@ -65,7 +69,7 @@ static inline void
65posix_acl_release(struct posix_acl *acl) 69posix_acl_release(struct posix_acl *acl)
66{ 70{
67 if (acl && atomic_dec_and_test(&acl->a_refcount)) 71 if (acl && atomic_dec_and_test(&acl->a_refcount))
68 kfree(acl); 72 kfree_rcu(acl, a_rcu);
69} 73}
70 74
71 75
@@ -73,32 +77,33 @@ posix_acl_release(struct posix_acl *acl)
73 77
74extern void posix_acl_init(struct posix_acl *, int); 78extern void posix_acl_init(struct posix_acl *, int);
75extern struct posix_acl *posix_acl_alloc(int, gfp_t); 79extern struct posix_acl *posix_acl_alloc(int, gfp_t);
76extern struct posix_acl *posix_acl_clone(const struct posix_acl *, gfp_t);
77extern int posix_acl_valid(const struct posix_acl *); 80extern int posix_acl_valid(const struct posix_acl *);
78extern int posix_acl_permission(struct inode *, const struct posix_acl *, int); 81extern int posix_acl_permission(struct inode *, const struct posix_acl *, int);
79extern struct posix_acl *posix_acl_from_mode(mode_t, gfp_t); 82extern struct posix_acl *posix_acl_from_mode(umode_t, gfp_t);
80extern int posix_acl_equiv_mode(const struct posix_acl *, mode_t *); 83extern int posix_acl_equiv_mode(const struct posix_acl *, umode_t *);
81extern int posix_acl_create_masq(struct posix_acl *, mode_t *); 84extern int posix_acl_create(struct posix_acl **, gfp_t, umode_t *);
82extern int posix_acl_chmod_masq(struct posix_acl *, mode_t); 85extern int posix_acl_chmod(struct posix_acl **, gfp_t, umode_t);
83 86
84extern struct posix_acl *get_posix_acl(struct inode *, int); 87extern struct posix_acl *get_posix_acl(struct inode *, int);
85extern int set_posix_acl(struct inode *, int, struct posix_acl *); 88extern int set_posix_acl(struct inode *, int, struct posix_acl *);
86 89
87#ifdef CONFIG_FS_POSIX_ACL 90#ifdef CONFIG_FS_POSIX_ACL
88static inline struct posix_acl *get_cached_acl(struct inode *inode, int type) 91static inline struct posix_acl **acl_by_type(struct inode *inode, int type)
89{ 92{
90 struct posix_acl **p, *acl;
91 switch (type) { 93 switch (type) {
92 case ACL_TYPE_ACCESS: 94 case ACL_TYPE_ACCESS:
93 p = &inode->i_acl; 95 return &inode->i_acl;
94 break;
95 case ACL_TYPE_DEFAULT: 96 case ACL_TYPE_DEFAULT:
96 p = &inode->i_default_acl; 97 return &inode->i_default_acl;
97 break;
98 default: 98 default:
99 return ERR_PTR(-EINVAL); 99 BUG();
100 } 100 }
101 acl = ACCESS_ONCE(*p); 101}
102
103static inline struct posix_acl *get_cached_acl(struct inode *inode, int type)
104{
105 struct posix_acl **p = acl_by_type(inode, type);
106 struct posix_acl *acl = ACCESS_ONCE(*p);
102 if (acl) { 107 if (acl) {
103 spin_lock(&inode->i_lock); 108 spin_lock(&inode->i_lock);
104 acl = *p; 109 acl = *p;
@@ -109,41 +114,20 @@ static inline struct posix_acl *get_cached_acl(struct inode *inode, int type)
109 return acl; 114 return acl;
110} 115}
111 116
112static inline int negative_cached_acl(struct inode *inode, int type) 117static inline struct posix_acl *get_cached_acl_rcu(struct inode *inode, int type)
113{ 118{
114 struct posix_acl **p, *acl; 119 return rcu_dereference(*acl_by_type(inode, type));
115 switch (type) {
116 case ACL_TYPE_ACCESS:
117 p = &inode->i_acl;
118 break;
119 case ACL_TYPE_DEFAULT:
120 p = &inode->i_default_acl;
121 break;
122 default:
123 BUG();
124 }
125 acl = ACCESS_ONCE(*p);
126 if (acl)
127 return 0;
128 return 1;
129} 120}
130 121
131static inline void set_cached_acl(struct inode *inode, 122static inline void set_cached_acl(struct inode *inode,
132 int type, 123 int type,
133 struct posix_acl *acl) 124 struct posix_acl *acl)
134{ 125{
135 struct posix_acl *old = NULL; 126 struct posix_acl **p = acl_by_type(inode, type);
127 struct posix_acl *old;
136 spin_lock(&inode->i_lock); 128 spin_lock(&inode->i_lock);
137 switch (type) { 129 old = *p;
138 case ACL_TYPE_ACCESS: 130 rcu_assign_pointer(*p, posix_acl_dup(acl));
139 old = inode->i_acl;
140 inode->i_acl = posix_acl_dup(acl);
141 break;
142 case ACL_TYPE_DEFAULT:
143 old = inode->i_default_acl;
144 inode->i_default_acl = posix_acl_dup(acl);
145 break;
146 }
147 spin_unlock(&inode->i_lock); 131 spin_unlock(&inode->i_lock);
148 if (old != ACL_NOT_CACHED) 132 if (old != ACL_NOT_CACHED)
149 posix_acl_release(old); 133 posix_acl_release(old);
@@ -151,18 +135,11 @@ static inline void set_cached_acl(struct inode *inode,
151 135
152static inline void forget_cached_acl(struct inode *inode, int type) 136static inline void forget_cached_acl(struct inode *inode, int type)
153{ 137{
154 struct posix_acl *old = NULL; 138 struct posix_acl **p = acl_by_type(inode, type);
139 struct posix_acl *old;
155 spin_lock(&inode->i_lock); 140 spin_lock(&inode->i_lock);
156 switch (type) { 141 old = *p;
157 case ACL_TYPE_ACCESS: 142 *p = ACL_NOT_CACHED;
158 old = inode->i_acl;
159 inode->i_acl = ACL_NOT_CACHED;
160 break;
161 case ACL_TYPE_DEFAULT:
162 old = inode->i_default_acl;
163 inode->i_default_acl = ACL_NOT_CACHED;
164 break;
165 }
166 spin_unlock(&inode->i_lock); 143 spin_unlock(&inode->i_lock);
167 if (old != ACL_NOT_CACHED) 144 if (old != ACL_NOT_CACHED)
168 posix_acl_release(old); 145 posix_acl_release(old);
diff --git a/include/linux/power/bq20z75.h b/include/linux/power/bq20z75.h
index b0843b68af92..1398eb004e83 100644
--- a/include/linux/power/bq20z75.h
+++ b/include/linux/power/bq20z75.h
@@ -29,11 +29,14 @@
29 * @battery_detect: GPIO which is used to detect battery presence 29 * @battery_detect: GPIO which is used to detect battery presence
30 * @battery_detect_present: gpio state when battery is present (0 / 1) 30 * @battery_detect_present: gpio state when battery is present (0 / 1)
31 * @i2c_retry_count: # of times to retry on i2c IO failure 31 * @i2c_retry_count: # of times to retry on i2c IO failure
32 * @poll_retry_count: # of times to retry looking for new status after
33 * external change notification
32 */ 34 */
33struct bq20z75_platform_data { 35struct bq20z75_platform_data {
34 int battery_detect; 36 int battery_detect;
35 int battery_detect_present; 37 int battery_detect_present;
36 int i2c_retry_count; 38 int i2c_retry_count;
39 int poll_retry_count;
37}; 40};
38 41
39#endif 42#endif
diff --git a/include/linux/power/max17042_battery.h b/include/linux/power/max17042_battery.h
index 7995deb8bfc1..fe99211fb2b8 100644
--- a/include/linux/power/max17042_battery.h
+++ b/include/linux/power/max17042_battery.h
@@ -23,8 +23,99 @@
23#ifndef __MAX17042_BATTERY_H_ 23#ifndef __MAX17042_BATTERY_H_
24#define __MAX17042_BATTERY_H_ 24#define __MAX17042_BATTERY_H_
25 25
26#define MAX17042_STATUS_BattAbsent (1 << 3)
27#define MAX17042_BATTERY_FULL (100)
28#define MAX17042_DEFAULT_SNS_RESISTOR (10000)
29
30enum max17042_register {
31 MAX17042_STATUS = 0x00,
32 MAX17042_VALRT_Th = 0x01,
33 MAX17042_TALRT_Th = 0x02,
34 MAX17042_SALRT_Th = 0x03,
35 MAX17042_AtRate = 0x04,
36 MAX17042_RepCap = 0x05,
37 MAX17042_RepSOC = 0x06,
38 MAX17042_Age = 0x07,
39 MAX17042_TEMP = 0x08,
40 MAX17042_VCELL = 0x09,
41 MAX17042_Current = 0x0A,
42 MAX17042_AvgCurrent = 0x0B,
43 MAX17042_Qresidual = 0x0C,
44 MAX17042_SOC = 0x0D,
45 MAX17042_AvSOC = 0x0E,
46 MAX17042_RemCap = 0x0F,
47 MAX17402_FullCAP = 0x10,
48 MAX17042_TTE = 0x11,
49 MAX17042_V_empty = 0x12,
50
51 MAX17042_RSLOW = 0x14,
52
53 MAX17042_AvgTA = 0x16,
54 MAX17042_Cycles = 0x17,
55 MAX17042_DesignCap = 0x18,
56 MAX17042_AvgVCELL = 0x19,
57 MAX17042_MinMaxTemp = 0x1A,
58 MAX17042_MinMaxVolt = 0x1B,
59 MAX17042_MinMaxCurr = 0x1C,
60 MAX17042_CONFIG = 0x1D,
61 MAX17042_ICHGTerm = 0x1E,
62 MAX17042_AvCap = 0x1F,
63 MAX17042_ManName = 0x20,
64 MAX17042_DevName = 0x21,
65 MAX17042_DevChem = 0x22,
66
67 MAX17042_TempNom = 0x24,
68 MAX17042_TempCold = 0x25,
69 MAX17042_TempHot = 0x26,
70 MAX17042_AIN = 0x27,
71 MAX17042_LearnCFG = 0x28,
72 MAX17042_SHFTCFG = 0x29,
73 MAX17042_RelaxCFG = 0x2A,
74 MAX17042_MiscCFG = 0x2B,
75 MAX17042_TGAIN = 0x2C,
76 MAx17042_TOFF = 0x2D,
77 MAX17042_CGAIN = 0x2E,
78 MAX17042_COFF = 0x2F,
79
80 MAX17042_Q_empty = 0x33,
81 MAX17042_T_empty = 0x34,
82
83 MAX17042_RCOMP0 = 0x38,
84 MAX17042_TempCo = 0x39,
85 MAX17042_Rx = 0x3A,
86 MAX17042_T_empty0 = 0x3B,
87 MAX17042_TaskPeriod = 0x3C,
88 MAX17042_FSTAT = 0x3D,
89
90 MAX17042_SHDNTIMER = 0x3F,
91
92 MAX17042_VFRemCap = 0x4A,
93
94 MAX17042_QH = 0x4D,
95 MAX17042_QL = 0x4E,
96};
97
98/*
99 * used for setting a register to a desired value
100 * addr : address for a register
101 * data : setting value for the register
102 */
103struct max17042_reg_data {
104 u8 addr;
105 u16 data;
106};
107
26struct max17042_platform_data { 108struct max17042_platform_data {
109 struct max17042_reg_data *init_data;
110 int num_init_data; /* Number of enties in init_data array */
27 bool enable_current_sense; 111 bool enable_current_sense;
112
113 /*
114 * R_sns in micro-ohms.
115 * default 10000 (if r_sns = 0) as it is the recommended value by
116 * the datasheet although it can be changed by board designers.
117 */
118 unsigned int r_sns;
28}; 119};
29 120
30#endif /* __MAX17042_BATTERY_H_ */ 121#endif /* __MAX17042_BATTERY_H_ */
diff --git a/include/linux/preempt.h b/include/linux/preempt.h
index 2e681d9555bd..58969b2a8a82 100644
--- a/include/linux/preempt.h
+++ b/include/linux/preempt.h
@@ -27,6 +27,21 @@
27 27
28asmlinkage void preempt_schedule(void); 28asmlinkage void preempt_schedule(void);
29 29
30#define preempt_check_resched() \
31do { \
32 if (unlikely(test_thread_flag(TIF_NEED_RESCHED))) \
33 preempt_schedule(); \
34} while (0)
35
36#else /* !CONFIG_PREEMPT */
37
38#define preempt_check_resched() do { } while (0)
39
40#endif /* CONFIG_PREEMPT */
41
42
43#ifdef CONFIG_PREEMPT_COUNT
44
30#define preempt_disable() \ 45#define preempt_disable() \
31do { \ 46do { \
32 inc_preempt_count(); \ 47 inc_preempt_count(); \
@@ -39,12 +54,6 @@ do { \
39 dec_preempt_count(); \ 54 dec_preempt_count(); \
40} while (0) 55} while (0)
41 56
42#define preempt_check_resched() \
43do { \
44 if (unlikely(test_thread_flag(TIF_NEED_RESCHED))) \
45 preempt_schedule(); \
46} while (0)
47
48#define preempt_enable() \ 57#define preempt_enable() \
49do { \ 58do { \
50 preempt_enable_no_resched(); \ 59 preempt_enable_no_resched(); \
@@ -80,18 +89,17 @@ do { \
80 preempt_check_resched(); \ 89 preempt_check_resched(); \
81} while (0) 90} while (0)
82 91
83#else 92#else /* !CONFIG_PREEMPT_COUNT */
84 93
85#define preempt_disable() do { } while (0) 94#define preempt_disable() do { } while (0)
86#define preempt_enable_no_resched() do { } while (0) 95#define preempt_enable_no_resched() do { } while (0)
87#define preempt_enable() do { } while (0) 96#define preempt_enable() do { } while (0)
88#define preempt_check_resched() do { } while (0)
89 97
90#define preempt_disable_notrace() do { } while (0) 98#define preempt_disable_notrace() do { } while (0)
91#define preempt_enable_no_resched_notrace() do { } while (0) 99#define preempt_enable_no_resched_notrace() do { } while (0)
92#define preempt_enable_notrace() do { } while (0) 100#define preempt_enable_notrace() do { } while (0)
93 101
94#endif 102#endif /* CONFIG_PREEMPT_COUNT */
95 103
96#ifdef CONFIG_PREEMPT_NOTIFIERS 104#ifdef CONFIG_PREEMPT_NOTIFIERS
97 105
diff --git a/include/linux/proc_fs.h b/include/linux/proc_fs.h
index e7576cf9e32d..643b96c7a94f 100644
--- a/include/linux/proc_fs.h
+++ b/include/linux/proc_fs.h
@@ -5,7 +5,7 @@
5#include <linux/fs.h> 5#include <linux/fs.h>
6#include <linux/spinlock.h> 6#include <linux/spinlock.h>
7#include <linux/magic.h> 7#include <linux/magic.h>
8#include <asm/atomic.h> 8#include <linux/atomic.h>
9 9
10struct net; 10struct net;
11struct completion; 11struct completion;
@@ -50,8 +50,6 @@ typedef int (write_proc_t)(struct file *file, const char __user *buffer,
50 50
51struct proc_dir_entry { 51struct proc_dir_entry {
52 unsigned int low_ino; 52 unsigned int low_ino;
53 unsigned int namelen;
54 const char *name;
55 mode_t mode; 53 mode_t mode;
56 nlink_t nlink; 54 nlink_t nlink;
57 uid_t uid; 55 uid_t uid;
@@ -73,9 +71,11 @@ struct proc_dir_entry {
73 write_proc_t *write_proc; 71 write_proc_t *write_proc;
74 atomic_t count; /* use count */ 72 atomic_t count; /* use count */
75 int pde_users; /* number of callers into module in progress */ 73 int pde_users; /* number of callers into module in progress */
76 spinlock_t pde_unload_lock; /* proc_fops checks and pde_users bumps */
77 struct completion *pde_unload_completion; 74 struct completion *pde_unload_completion;
78 struct list_head pde_openers; /* who did ->open, but not ->release */ 75 struct list_head pde_openers; /* who did ->open, but not ->release */
76 spinlock_t pde_unload_lock; /* proc_fops checks and pde_users bumps */
77 u8 namelen;
78 char name[];
79}; 79};
80 80
81enum kcore_type { 81enum kcore_type {
diff --git a/include/linux/pstore.h b/include/linux/pstore.h
index 2455ef2683f0..cc03bbf5c4b8 100644
--- a/include/linux/pstore.h
+++ b/include/linux/pstore.h
@@ -38,9 +38,12 @@ struct pstore_info {
38 int (*open)(struct pstore_info *psi); 38 int (*open)(struct pstore_info *psi);
39 int (*close)(struct pstore_info *psi); 39 int (*close)(struct pstore_info *psi);
40 ssize_t (*read)(u64 *id, enum pstore_type_id *type, 40 ssize_t (*read)(u64 *id, enum pstore_type_id *type,
41 struct timespec *time); 41 struct timespec *time, struct pstore_info *psi);
42 u64 (*write)(enum pstore_type_id type, size_t size); 42 u64 (*write)(enum pstore_type_id type, unsigned int part,
43 int (*erase)(u64 id); 43 size_t size, struct pstore_info *psi);
44 int (*erase)(enum pstore_type_id type, u64 id,
45 struct pstore_info *psi);
46 void *data;
44}; 47};
45 48
46#ifdef CONFIG_PSTORE 49#ifdef CONFIG_PSTORE
diff --git a/include/linux/pti.h b/include/linux/pti.h
index 81af667bb2d5..b3ea01a3197e 100644
--- a/include/linux/pti.h
+++ b/include/linux/pti.h
@@ -36,7 +36,8 @@ struct pti_masterchannel {
36 36
37/* the following functions are defined in misc/pti.c */ 37/* the following functions are defined in misc/pti.c */
38void pti_writedata(struct pti_masterchannel *mc, u8 *buf, int count); 38void pti_writedata(struct pti_masterchannel *mc, u8 *buf, int count);
39struct pti_masterchannel *pti_request_masterchannel(u8 type); 39struct pti_masterchannel *pti_request_masterchannel(u8 type,
40 const char *thread_name);
40void pti_release_masterchannel(struct pti_masterchannel *mc); 41void pti_release_masterchannel(struct pti_masterchannel *mc);
41 42
42#endif /*PTI_H_*/ 43#endif /*PTI_H_*/
diff --git a/include/linux/ptrace.h b/include/linux/ptrace.h
index 9178d5cc0b01..800f113bea66 100644
--- a/include/linux/ptrace.h
+++ b/include/linux/ptrace.h
@@ -47,6 +47,13 @@
47#define PTRACE_GETREGSET 0x4204 47#define PTRACE_GETREGSET 0x4204
48#define PTRACE_SETREGSET 0x4205 48#define PTRACE_SETREGSET 0x4205
49 49
50#define PTRACE_SEIZE 0x4206
51#define PTRACE_INTERRUPT 0x4207
52#define PTRACE_LISTEN 0x4208
53
54/* flags in @data for PTRACE_SEIZE */
55#define PTRACE_SEIZE_DEVEL 0x80000000 /* temp flag for development */
56
50/* options set using PTRACE_SETOPTIONS */ 57/* options set using PTRACE_SETOPTIONS */
51#define PTRACE_O_TRACESYSGOOD 0x00000001 58#define PTRACE_O_TRACESYSGOOD 0x00000001
52#define PTRACE_O_TRACEFORK 0x00000002 59#define PTRACE_O_TRACEFORK 0x00000002
@@ -65,6 +72,7 @@
65#define PTRACE_EVENT_EXEC 4 72#define PTRACE_EVENT_EXEC 4
66#define PTRACE_EVENT_VFORK_DONE 5 73#define PTRACE_EVENT_VFORK_DONE 5
67#define PTRACE_EVENT_EXIT 6 74#define PTRACE_EVENT_EXIT 6
75#define PTRACE_EVENT_STOP 7
68 76
69#include <asm/ptrace.h> 77#include <asm/ptrace.h>
70 78
@@ -77,16 +85,22 @@
77 * flags. When the a task is stopped the ptracer owns task->ptrace. 85 * flags. When the a task is stopped the ptracer owns task->ptrace.
78 */ 86 */
79 87
88#define PT_SEIZED 0x00010000 /* SEIZE used, enable new behavior */
80#define PT_PTRACED 0x00000001 89#define PT_PTRACED 0x00000001
81#define PT_DTRACE 0x00000002 /* delayed trace (used on m68k, i386) */ 90#define PT_DTRACE 0x00000002 /* delayed trace (used on m68k, i386) */
82#define PT_TRACESYSGOOD 0x00000004 91#define PT_TRACESYSGOOD 0x00000004
83#define PT_PTRACE_CAP 0x00000008 /* ptracer can follow suid-exec */ 92#define PT_PTRACE_CAP 0x00000008 /* ptracer can follow suid-exec */
84#define PT_TRACE_FORK 0x00000010 93
85#define PT_TRACE_VFORK 0x00000020 94/* PT_TRACE_* event enable flags */
86#define PT_TRACE_CLONE 0x00000040 95#define PT_EVENT_FLAG_SHIFT 4
87#define PT_TRACE_EXEC 0x00000080 96#define PT_EVENT_FLAG(event) (1 << (PT_EVENT_FLAG_SHIFT + (event) - 1))
88#define PT_TRACE_VFORK_DONE 0x00000100 97
89#define PT_TRACE_EXIT 0x00000200 98#define PT_TRACE_FORK PT_EVENT_FLAG(PTRACE_EVENT_FORK)
99#define PT_TRACE_VFORK PT_EVENT_FLAG(PTRACE_EVENT_VFORK)
100#define PT_TRACE_CLONE PT_EVENT_FLAG(PTRACE_EVENT_CLONE)
101#define PT_TRACE_EXEC PT_EVENT_FLAG(PTRACE_EVENT_EXEC)
102#define PT_TRACE_VFORK_DONE PT_EVENT_FLAG(PTRACE_EVENT_VFORK_DONE)
103#define PT_TRACE_EXIT PT_EVENT_FLAG(PTRACE_EVENT_EXIT)
90 104
91#define PT_TRACE_MASK 0x000003f4 105#define PT_TRACE_MASK 0x000003f4
92 106
@@ -105,7 +119,7 @@ extern long arch_ptrace(struct task_struct *child, long request,
105extern int ptrace_readdata(struct task_struct *tsk, unsigned long src, char __user *dst, int len); 119extern int ptrace_readdata(struct task_struct *tsk, unsigned long src, char __user *dst, int len);
106extern int ptrace_writedata(struct task_struct *tsk, char __user *src, unsigned long dst, int len); 120extern int ptrace_writedata(struct task_struct *tsk, char __user *src, unsigned long dst, int len);
107extern void ptrace_disable(struct task_struct *); 121extern void ptrace_disable(struct task_struct *);
108extern int ptrace_check_attach(struct task_struct *task, int kill); 122extern int ptrace_check_attach(struct task_struct *task, bool ignore_state);
109extern int ptrace_request(struct task_struct *child, long request, 123extern int ptrace_request(struct task_struct *child, long request,
110 unsigned long addr, unsigned long data); 124 unsigned long addr, unsigned long data);
111extern void ptrace_notify(int exit_code); 125extern void ptrace_notify(int exit_code);
@@ -122,7 +136,7 @@ extern bool ptrace_may_access(struct task_struct *task, unsigned int mode);
122 136
123static inline int ptrace_reparented(struct task_struct *child) 137static inline int ptrace_reparented(struct task_struct *child)
124{ 138{
125 return child->real_parent != child->parent; 139 return !same_thread_group(child->real_parent, child->parent);
126} 140}
127 141
128static inline void ptrace_unlink(struct task_struct *child) 142static inline void ptrace_unlink(struct task_struct *child)
@@ -137,36 +151,56 @@ int generic_ptrace_pokedata(struct task_struct *tsk, unsigned long addr,
137 unsigned long data); 151 unsigned long data);
138 152
139/** 153/**
140 * task_ptrace - return %PT_* flags that apply to a task 154 * ptrace_parent - return the task that is tracing the given task
141 * @task: pointer to &task_struct in question 155 * @task: task to consider
142 * 156 *
143 * Returns the %PT_* flags that apply to @task. 157 * Returns %NULL if no one is tracing @task, or the &struct task_struct
158 * pointer to its tracer.
159 *
160 * Must called under rcu_read_lock(). The pointer returned might be kept
161 * live only by RCU. During exec, this may be called with task_lock() held
162 * on @task, still held from when check_unsafe_exec() was called.
144 */ 163 */
145static inline int task_ptrace(struct task_struct *task) 164static inline struct task_struct *ptrace_parent(struct task_struct *task)
146{ 165{
147 return task->ptrace; 166 if (unlikely(task->ptrace))
167 return rcu_dereference(task->parent);
168 return NULL;
169}
170
171/**
172 * ptrace_event_enabled - test whether a ptrace event is enabled
173 * @task: ptracee of interest
174 * @event: %PTRACE_EVENT_* to test
175 *
176 * Test whether @event is enabled for ptracee @task.
177 *
178 * Returns %true if @event is enabled, %false otherwise.
179 */
180static inline bool ptrace_event_enabled(struct task_struct *task, int event)
181{
182 return task->ptrace & PT_EVENT_FLAG(event);
148} 183}
149 184
150/** 185/**
151 * ptrace_event - possibly stop for a ptrace event notification 186 * ptrace_event - possibly stop for a ptrace event notification
152 * @mask: %PT_* bit to check in @current->ptrace 187 * @event: %PTRACE_EVENT_* value to report
153 * @event: %PTRACE_EVENT_* value to report if @mask is set
154 * @message: value for %PTRACE_GETEVENTMSG to return 188 * @message: value for %PTRACE_GETEVENTMSG to return
155 * 189 *
156 * This checks the @mask bit to see if ptrace wants stops for this event. 190 * Check whether @event is enabled and, if so, report @event and @message
157 * If so we stop, reporting @event and @message to the ptrace parent. 191 * to the ptrace parent.
158 *
159 * Returns nonzero if we did a ptrace notification, zero if not.
160 * 192 *
161 * Called without locks. 193 * Called without locks.
162 */ 194 */
163static inline int ptrace_event(int mask, int event, unsigned long message) 195static inline void ptrace_event(int event, unsigned long message)
164{ 196{
165 if (mask && likely(!(current->ptrace & mask))) 197 if (unlikely(ptrace_event_enabled(current, event))) {
166 return 0; 198 current->ptrace_message = message;
167 current->ptrace_message = message; 199 ptrace_notify((event << 8) | SIGTRAP);
168 ptrace_notify((event << 8) | SIGTRAP); 200 } else if (event == PTRACE_EVENT_EXEC && unlikely(current->ptrace)) {
169 return 1; 201 /* legacy EXEC report via SIGTRAP */
202 send_sig(SIGTRAP, current, 0);
203 }
170} 204}
171 205
172/** 206/**
@@ -183,16 +217,24 @@ static inline void ptrace_init_task(struct task_struct *child, bool ptrace)
183{ 217{
184 INIT_LIST_HEAD(&child->ptrace_entry); 218 INIT_LIST_HEAD(&child->ptrace_entry);
185 INIT_LIST_HEAD(&child->ptraced); 219 INIT_LIST_HEAD(&child->ptraced);
186 child->parent = child->real_parent; 220#ifdef CONFIG_HAVE_HW_BREAKPOINT
221 atomic_set(&child->ptrace_bp_refcnt, 1);
222#endif
223 child->jobctl = 0;
187 child->ptrace = 0; 224 child->ptrace = 0;
188 if (unlikely(ptrace) && (current->ptrace & PT_PTRACED)) { 225 child->parent = child->real_parent;
226
227 if (unlikely(ptrace) && current->ptrace) {
189 child->ptrace = current->ptrace; 228 child->ptrace = current->ptrace;
190 __ptrace_link(child, current->parent); 229 __ptrace_link(child, current->parent);
191 }
192 230
193#ifdef CONFIG_HAVE_HW_BREAKPOINT 231 if (child->ptrace & PT_SEIZED)
194 atomic_set(&child->ptrace_bp_refcnt, 1); 232 task_set_jobctl_pending(child, JOBCTL_TRAP_STOP);
195#endif 233 else
234 sigaddset(&child->pending.signal, SIGSTOP);
235
236 set_tsk_thread_flag(child, TIF_SIGPENDING);
237 }
196} 238}
197 239
198/** 240/**
diff --git a/include/linux/quota.h b/include/linux/quota.h
index 9a85412e0db6..cb7855699037 100644
--- a/include/linux/quota.h
+++ b/include/linux/quota.h
@@ -180,7 +180,7 @@ enum {
180#include <linux/dqblk_v1.h> 180#include <linux/dqblk_v1.h>
181#include <linux/dqblk_v2.h> 181#include <linux/dqblk_v2.h>
182 182
183#include <asm/atomic.h> 183#include <linux/atomic.h>
184 184
185typedef __kernel_uid32_t qid_t; /* Type in which we store ids in memory */ 185typedef __kernel_uid32_t qid_t; /* Type in which we store ids in memory */
186typedef long long qsize_t; /* Type in which we store sizes */ 186typedef long long qsize_t; /* Type in which we store sizes */
@@ -415,13 +415,5 @@ struct quota_module_name {
415 {QFMT_VFS_V0, "quota_v2"},\ 415 {QFMT_VFS_V0, "quota_v2"},\
416 {0, NULL}} 416 {0, NULL}}
417 417
418#else
419
420# /* nodep */ include <sys/cdefs.h>
421
422__BEGIN_DECLS
423long quotactl __P ((unsigned int, const char *, int, caddr_t));
424__END_DECLS
425
426#endif /* __KERNEL__ */ 418#endif /* __KERNEL__ */
427#endif /* _QUOTA_ */ 419#endif /* _QUOTA_ */
diff --git a/include/linux/radix-tree.h b/include/linux/radix-tree.h
index 23241c2fecce..9d4539c52e53 100644
--- a/include/linux/radix-tree.h
+++ b/include/linux/radix-tree.h
@@ -39,7 +39,15 @@
39 * when it is shrunk, before we rcu free the node. See shrink code for 39 * when it is shrunk, before we rcu free the node. See shrink code for
40 * details. 40 * details.
41 */ 41 */
42#define RADIX_TREE_INDIRECT_PTR 1 42#define RADIX_TREE_INDIRECT_PTR 1
43/*
44 * A common use of the radix tree is to store pointers to struct pages;
45 * but shmem/tmpfs needs also to store swap entries in the same tree:
46 * those are marked as exceptional entries to distinguish them.
47 * EXCEPTIONAL_ENTRY tests the bit, EXCEPTIONAL_SHIFT shifts content past it.
48 */
49#define RADIX_TREE_EXCEPTIONAL_ENTRY 2
50#define RADIX_TREE_EXCEPTIONAL_SHIFT 2
43 51
44#define radix_tree_indirect_to_ptr(ptr) \ 52#define radix_tree_indirect_to_ptr(ptr) \
45 radix_tree_indirect_to_ptr((void __force *)(ptr)) 53 radix_tree_indirect_to_ptr((void __force *)(ptr))
@@ -174,6 +182,28 @@ static inline int radix_tree_deref_retry(void *arg)
174} 182}
175 183
176/** 184/**
185 * radix_tree_exceptional_entry - radix_tree_deref_slot gave exceptional entry?
186 * @arg: value returned by radix_tree_deref_slot
187 * Returns: 0 if well-aligned pointer, non-0 if exceptional entry.
188 */
189static inline int radix_tree_exceptional_entry(void *arg)
190{
191 /* Not unlikely because radix_tree_exception often tested first */
192 return (unsigned long)arg & RADIX_TREE_EXCEPTIONAL_ENTRY;
193}
194
195/**
196 * radix_tree_exception - radix_tree_deref_slot returned either exception?
197 * @arg: value returned by radix_tree_deref_slot
198 * Returns: 0 if well-aligned pointer, non-0 if either kind of exception.
199 */
200static inline int radix_tree_exception(void *arg)
201{
202 return unlikely((unsigned long)arg &
203 (RADIX_TREE_INDIRECT_PTR | RADIX_TREE_EXCEPTIONAL_ENTRY));
204}
205
206/**
177 * radix_tree_replace_slot - replace item in a slot 207 * radix_tree_replace_slot - replace item in a slot
178 * @pslot: pointer to slot, returned by radix_tree_lookup_slot 208 * @pslot: pointer to slot, returned by radix_tree_lookup_slot
179 * @item: new item to store in the slot. 209 * @item: new item to store in the slot.
@@ -194,8 +224,8 @@ void *radix_tree_delete(struct radix_tree_root *, unsigned long);
194unsigned int 224unsigned int
195radix_tree_gang_lookup(struct radix_tree_root *root, void **results, 225radix_tree_gang_lookup(struct radix_tree_root *root, void **results,
196 unsigned long first_index, unsigned int max_items); 226 unsigned long first_index, unsigned int max_items);
197unsigned int 227unsigned int radix_tree_gang_lookup_slot(struct radix_tree_root *root,
198radix_tree_gang_lookup_slot(struct radix_tree_root *root, void ***results, 228 void ***results, unsigned long *indices,
199 unsigned long first_index, unsigned int max_items); 229 unsigned long first_index, unsigned int max_items);
200unsigned long radix_tree_next_hole(struct radix_tree_root *root, 230unsigned long radix_tree_next_hole(struct radix_tree_root *root,
201 unsigned long index, unsigned long max_scan); 231 unsigned long index, unsigned long max_scan);
@@ -222,6 +252,7 @@ unsigned long radix_tree_range_tag_if_tagged(struct radix_tree_root *root,
222 unsigned long nr_to_tag, 252 unsigned long nr_to_tag,
223 unsigned int fromtag, unsigned int totag); 253 unsigned int fromtag, unsigned int totag);
224int radix_tree_tagged(struct radix_tree_root *root, unsigned int tag); 254int radix_tree_tagged(struct radix_tree_root *root, unsigned int tag);
255unsigned long radix_tree_locate_item(struct radix_tree_root *root, void *item);
225 256
226static inline void radix_tree_preload_end(void) 257static inline void radix_tree_preload_end(void)
227{ 258{
diff --git a/include/linux/raid/md_p.h b/include/linux/raid/md_p.h
index 75cbf4f62fe8..9e65d9e20662 100644
--- a/include/linux/raid/md_p.h
+++ b/include/linux/raid/md_p.h
@@ -245,10 +245,16 @@ struct mdp_superblock_1 {
245 __u8 device_uuid[16]; /* user-space setable, ignored by kernel */ 245 __u8 device_uuid[16]; /* user-space setable, ignored by kernel */
246 __u8 devflags; /* per-device flags. Only one defined...*/ 246 __u8 devflags; /* per-device flags. Only one defined...*/
247#define WriteMostly1 1 /* mask for writemostly flag in above */ 247#define WriteMostly1 1 /* mask for writemostly flag in above */
248 __u8 pad2[64-57]; /* set to 0 when writing */ 248 /* Bad block log. If there are any bad blocks the feature flag is set.
249 * If offset and size are non-zero, that space is reserved and available
250 */
251 __u8 bblog_shift; /* shift from sectors to block size */
252 __le16 bblog_size; /* number of sectors reserved for list */
253 __le32 bblog_offset; /* sector offset from superblock to bblog,
254 * signed - not unsigned */
249 255
250 /* array state information - 64 bytes */ 256 /* array state information - 64 bytes */
251 __le64 utime; /* 40 bits second, 24 btes microseconds */ 257 __le64 utime; /* 40 bits second, 24 bits microseconds */
252 __le64 events; /* incremented when superblock updated */ 258 __le64 events; /* incremented when superblock updated */
253 __le64 resync_offset; /* data before this offset (from data_offset) known to be in sync */ 259 __le64 resync_offset; /* data before this offset (from data_offset) known to be in sync */
254 __le32 sb_csum; /* checksum up to devs[max_dev] */ 260 __le32 sb_csum; /* checksum up to devs[max_dev] */
@@ -270,8 +276,8 @@ struct mdp_superblock_1 {
270 * must be honoured 276 * must be honoured
271 */ 277 */
272#define MD_FEATURE_RESHAPE_ACTIVE 4 278#define MD_FEATURE_RESHAPE_ACTIVE 4
279#define MD_FEATURE_BAD_BLOCKS 8 /* badblock list is not empty */
273 280
274#define MD_FEATURE_ALL (1|2|4) 281#define MD_FEATURE_ALL (1|2|4|8)
275 282
276#endif 283#endif
277
diff --git a/include/linux/ramoops.h b/include/linux/ramoops.h
index 0ae68a2c1212..484fef81cd3a 100644
--- a/include/linux/ramoops.h
+++ b/include/linux/ramoops.h
@@ -10,6 +10,8 @@
10struct ramoops_platform_data { 10struct ramoops_platform_data {
11 unsigned long mem_size; 11 unsigned long mem_size;
12 unsigned long mem_address; 12 unsigned long mem_address;
13 unsigned long record_size;
14 int dump_oops;
13}; 15};
14 16
15#endif 17#endif
diff --git a/include/linux/random.h b/include/linux/random.h
index fb7ab9de5f36..d13059f3ea32 100644
--- a/include/linux/random.h
+++ b/include/linux/random.h
@@ -57,17 +57,6 @@ extern void add_interrupt_randomness(int irq);
57extern void get_random_bytes(void *buf, int nbytes); 57extern void get_random_bytes(void *buf, int nbytes);
58void generate_random_uuid(unsigned char uuid_out[16]); 58void generate_random_uuid(unsigned char uuid_out[16]);
59 59
60extern __u32 secure_ip_id(__be32 daddr);
61extern u32 secure_ipv4_port_ephemeral(__be32 saddr, __be32 daddr, __be16 dport);
62extern u32 secure_ipv6_port_ephemeral(const __be32 *saddr, const __be32 *daddr,
63 __be16 dport);
64extern __u32 secure_tcp_sequence_number(__be32 saddr, __be32 daddr,
65 __be16 sport, __be16 dport);
66extern __u32 secure_tcpv6_sequence_number(__be32 *saddr, __be32 *daddr,
67 __be16 sport, __be16 dport);
68extern u64 secure_dccp_sequence_number(__be32 saddr, __be32 daddr,
69 __be16 sport, __be16 dport);
70
71#ifndef MODULE 60#ifndef MODULE
72extern const struct file_operations random_fops, urandom_fops; 61extern const struct file_operations random_fops, urandom_fops;
73#endif 62#endif
diff --git a/include/linux/rculist.h b/include/linux/rculist.h
index e3beb315517a..d079290843a9 100644
--- a/include/linux/rculist.h
+++ b/include/linux/rculist.h
@@ -183,7 +183,7 @@ static inline void list_splice_init_rcu(struct list_head *list,
183 struct list_head *last = list->prev; 183 struct list_head *last = list->prev;
184 struct list_head *at = head->next; 184 struct list_head *at = head->next;
185 185
186 if (list_empty(head)) 186 if (list_empty(list))
187 return; 187 return;
188 188
189 /* "first" and "last" tracking list, so initialize it. */ 189 /* "first" and "last" tracking list, so initialize it. */
diff --git a/include/linux/rcupdate.h b/include/linux/rcupdate.h
index 99f9aa7c2804..8f4f881a0ad8 100644
--- a/include/linux/rcupdate.h
+++ b/include/linux/rcupdate.h
@@ -239,7 +239,7 @@ extern int rcu_read_lock_bh_held(void);
239 * Check debug_lockdep_rcu_enabled() to prevent false positives during boot 239 * Check debug_lockdep_rcu_enabled() to prevent false positives during boot
240 * and while lockdep is disabled. 240 * and while lockdep is disabled.
241 */ 241 */
242#ifdef CONFIG_PREEMPT 242#ifdef CONFIG_PREEMPT_COUNT
243static inline int rcu_read_lock_sched_held(void) 243static inline int rcu_read_lock_sched_held(void)
244{ 244{
245 int lockdep_opinion = 0; 245 int lockdep_opinion = 0;
@@ -250,12 +250,12 @@ static inline int rcu_read_lock_sched_held(void)
250 lockdep_opinion = lock_is_held(&rcu_sched_lock_map); 250 lockdep_opinion = lock_is_held(&rcu_sched_lock_map);
251 return lockdep_opinion || preempt_count() != 0 || irqs_disabled(); 251 return lockdep_opinion || preempt_count() != 0 || irqs_disabled();
252} 252}
253#else /* #ifdef CONFIG_PREEMPT */ 253#else /* #ifdef CONFIG_PREEMPT_COUNT */
254static inline int rcu_read_lock_sched_held(void) 254static inline int rcu_read_lock_sched_held(void)
255{ 255{
256 return 1; 256 return 1;
257} 257}
258#endif /* #else #ifdef CONFIG_PREEMPT */ 258#endif /* #else #ifdef CONFIG_PREEMPT_COUNT */
259 259
260#else /* #ifdef CONFIG_DEBUG_LOCK_ALLOC */ 260#else /* #ifdef CONFIG_DEBUG_LOCK_ALLOC */
261 261
@@ -276,17 +276,17 @@ static inline int rcu_read_lock_bh_held(void)
276 return 1; 276 return 1;
277} 277}
278 278
279#ifdef CONFIG_PREEMPT 279#ifdef CONFIG_PREEMPT_COUNT
280static inline int rcu_read_lock_sched_held(void) 280static inline int rcu_read_lock_sched_held(void)
281{ 281{
282 return preempt_count() != 0 || irqs_disabled(); 282 return preempt_count() != 0 || irqs_disabled();
283} 283}
284#else /* #ifdef CONFIG_PREEMPT */ 284#else /* #ifdef CONFIG_PREEMPT_COUNT */
285static inline int rcu_read_lock_sched_held(void) 285static inline int rcu_read_lock_sched_held(void)
286{ 286{
287 return 1; 287 return 1;
288} 288}
289#endif /* #else #ifdef CONFIG_PREEMPT */ 289#endif /* #else #ifdef CONFIG_PREEMPT_COUNT */
290 290
291#endif /* #else #ifdef CONFIG_DEBUG_LOCK_ALLOC */ 291#endif /* #else #ifdef CONFIG_DEBUG_LOCK_ALLOC */
292 292
diff --git a/include/linux/reboot.h b/include/linux/reboot.h
index 3005d5a7fce5..e0879a70e830 100644
--- a/include/linux/reboot.h
+++ b/include/linux/reboot.h
@@ -39,6 +39,11 @@
39 39
40#include <linux/notifier.h> 40#include <linux/notifier.h>
41 41
42#define SYS_DOWN 0x0001 /* Notify of system down */
43#define SYS_RESTART SYS_DOWN
44#define SYS_HALT 0x0002 /* Notify of system halt */
45#define SYS_POWER_OFF 0x0003 /* Notify of system power off */
46
42extern int register_reboot_notifier(struct notifier_block *); 47extern int register_reboot_notifier(struct notifier_block *);
43extern int unregister_reboot_notifier(struct notifier_block *); 48extern int unregister_reboot_notifier(struct notifier_block *);
44 49
diff --git a/include/linux/regmap.h b/include/linux/regmap.h
new file mode 100644
index 000000000000..60a65cd7e1a0
--- /dev/null
+++ b/include/linux/regmap.h
@@ -0,0 +1,82 @@
1#ifndef __LINUX_REGMAP_H
2#define __LINUX_REGMAP_H
3
4/*
5 * Register map access API
6 *
7 * Copyright 2011 Wolfson Microelectronics plc
8 *
9 * Author: Mark Brown <broonie@opensource.wolfsonmicro.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 version 2 as
13 * published by the Free Software Foundation.
14 */
15
16#include <linux/device.h>
17#include <linux/list.h>
18#include <linux/module.h>
19
20struct i2c_client;
21struct spi_device;
22
23struct regmap_config {
24 int reg_bits;
25 int val_bits;
26};
27
28typedef int (*regmap_hw_write)(struct device *dev, const void *data,
29 size_t count);
30typedef int (*regmap_hw_gather_write)(struct device *dev,
31 const void *reg, size_t reg_len,
32 const void *val, size_t val_len);
33typedef int (*regmap_hw_read)(struct device *dev,
34 const void *reg_buf, size_t reg_size,
35 void *val_buf, size_t val_size);
36
37/**
38 * Description of a hardware bus for the register map infrastructure.
39 *
40 * @list: Internal use.
41 * @type: Bus type, used to identify bus to be used for a device.
42 * @write: Write operation.
43 * @gather_write: Write operation with split register/value, return -ENOTSUPP
44 * if not implemented on a given device.
45 * @read: Read operation. Data is returned in the buffer used to transmit
46 * data.
47 * @owner: Module with the bus implementation, used to pin the implementation
48 * in memory.
49 * @read_flag_mask: Mask to be set in the top byte of the register when doing
50 * a read.
51 */
52struct regmap_bus {
53 struct list_head list;
54 struct bus_type *type;
55 regmap_hw_write write;
56 regmap_hw_gather_write gather_write;
57 regmap_hw_read read;
58 struct module *owner;
59 u8 read_flag_mask;
60};
61
62struct regmap *regmap_init(struct device *dev,
63 const struct regmap_bus *bus,
64 const struct regmap_config *config);
65struct regmap *regmap_init_i2c(struct i2c_client *i2c,
66 const struct regmap_config *config);
67struct regmap *regmap_init_spi(struct spi_device *dev,
68 const struct regmap_config *config);
69
70void regmap_exit(struct regmap *map);
71int regmap_write(struct regmap *map, unsigned int reg, unsigned int val);
72int regmap_raw_write(struct regmap *map, unsigned int reg,
73 const void *val, size_t val_len);
74int regmap_read(struct regmap *map, unsigned int reg, unsigned int *val);
75int regmap_raw_read(struct regmap *map, unsigned int reg,
76 void *val, size_t val_len);
77int regmap_bulk_read(struct regmap *map, unsigned int reg, void *val,
78 size_t val_count);
79int regmap_update_bits(struct regmap *map, unsigned int reg,
80 unsigned int mask, unsigned int val);
81
82#endif
diff --git a/include/linux/regulator/consumer.h b/include/linux/regulator/consumer.h
index 9e87c1cb7270..26f6ea4444e3 100644
--- a/include/linux/regulator/consumer.h
+++ b/include/linux/regulator/consumer.h
@@ -122,6 +122,9 @@ struct regulator;
122struct regulator_bulk_data { 122struct regulator_bulk_data {
123 const char *supply; 123 const char *supply;
124 struct regulator *consumer; 124 struct regulator *consumer;
125
126 /* Internal use */
127 int ret;
125}; 128};
126 129
127#if defined(CONFIG_REGULATOR) 130#if defined(CONFIG_REGULATOR)
diff --git a/include/linux/regulator/driver.h b/include/linux/regulator/driver.h
index 6c433b89c80d..1a80bc77517d 100644
--- a/include/linux/regulator/driver.h
+++ b/include/linux/regulator/driver.h
@@ -188,18 +188,16 @@ struct regulator_dev {
188 188
189 /* lists we belong to */ 189 /* lists we belong to */
190 struct list_head list; /* list of all regulators */ 190 struct list_head list; /* list of all regulators */
191 struct list_head slist; /* list of supplied regulators */
192 191
193 /* lists we own */ 192 /* lists we own */
194 struct list_head consumer_list; /* consumers we supply */ 193 struct list_head consumer_list; /* consumers we supply */
195 struct list_head supply_list; /* regulators we supply */
196 194
197 struct blocking_notifier_head notifier; 195 struct blocking_notifier_head notifier;
198 struct mutex mutex; /* consumer lock */ 196 struct mutex mutex; /* consumer lock */
199 struct module *owner; 197 struct module *owner;
200 struct device dev; 198 struct device dev;
201 struct regulation_constraints *constraints; 199 struct regulation_constraints *constraints;
202 struct regulator_dev *supply; /* for tree */ 200 struct regulator *supply; /* for tree */
203 201
204 void *reg_data; /* regulator_dev data */ 202 void *reg_data; /* regulator_dev data */
205 203
diff --git a/include/linux/reiserfs_acl.h b/include/linux/reiserfs_acl.h
index 3fd8c4506bbb..f096b80e73d8 100644
--- a/include/linux/reiserfs_acl.h
+++ b/include/linux/reiserfs_acl.h
@@ -59,11 +59,7 @@ extern const struct xattr_handler reiserfs_posix_acl_access_handler;
59#else 59#else
60 60
61#define reiserfs_cache_default_acl(inode) 0 61#define reiserfs_cache_default_acl(inode) 0
62 62#define reiserfs_get_acl NULL
63static inline struct posix_acl *reiserfs_get_acl(struct inode *inode, int type)
64{
65 return NULL;
66}
67 63
68static inline int reiserfs_acl_chmod(struct inode *inode) 64static inline int reiserfs_acl_chmod(struct inode *inode)
69{ 65{
diff --git a/include/linux/reiserfs_fs.h b/include/linux/reiserfs_fs.h
index eca75df00fed..96d465f8d3e6 100644
--- a/include/linux/reiserfs_fs.h
+++ b/include/linux/reiserfs_fs.h
@@ -2332,7 +2332,9 @@ __u32 keyed_hash(const signed char *msg, int len);
2332__u32 yura_hash(const signed char *msg, int len); 2332__u32 yura_hash(const signed char *msg, int len);
2333__u32 r5_hash(const signed char *msg, int len); 2333__u32 r5_hash(const signed char *msg, int len);
2334 2334
2335#define reiserfs_set_le_bit __set_bit_le
2335#define reiserfs_test_and_set_le_bit __test_and_set_bit_le 2336#define reiserfs_test_and_set_le_bit __test_and_set_bit_le
2337#define reiserfs_clear_le_bit __clear_bit_le
2336#define reiserfs_test_and_clear_le_bit __test_and_clear_bit_le 2338#define reiserfs_test_and_clear_le_bit __test_and_clear_bit_le
2337#define reiserfs_test_le_bit test_bit_le 2339#define reiserfs_test_le_bit test_bit_le
2338#define reiserfs_find_next_zero_le_bit find_next_zero_bit_le 2340#define reiserfs_find_next_zero_le_bit find_next_zero_bit_le
diff --git a/include/linux/reiserfs_xattr.h b/include/linux/reiserfs_xattr.h
index 6deef5dc95fb..c2b71473266e 100644
--- a/include/linux/reiserfs_xattr.h
+++ b/include/linux/reiserfs_xattr.h
@@ -41,7 +41,7 @@ int reiserfs_xattr_init(struct super_block *sb, int mount_flags);
41int reiserfs_lookup_privroot(struct super_block *sb); 41int reiserfs_lookup_privroot(struct super_block *sb);
42int reiserfs_delete_xattrs(struct inode *inode); 42int reiserfs_delete_xattrs(struct inode *inode);
43int reiserfs_chown_xattrs(struct inode *inode, struct iattr *attrs); 43int reiserfs_chown_xattrs(struct inode *inode, struct iattr *attrs);
44int reiserfs_permission(struct inode *inode, int mask, unsigned int flags); 44int reiserfs_permission(struct inode *inode, int mask);
45 45
46#ifdef CONFIG_REISERFS_FS_XATTR 46#ifdef CONFIG_REISERFS_FS_XATTR
47#define has_xattr_dir(inode) (REISERFS_I(inode)->i_flags & i_has_xattr_dir) 47#define has_xattr_dir(inode) (REISERFS_I(inode)->i_flags & i_has_xattr_dir)
diff --git a/include/linux/ring_buffer.h b/include/linux/ring_buffer.h
index ab38ac80b0f9..b891de96000f 100644
--- a/include/linux/ring_buffer.h
+++ b/include/linux/ring_buffer.h
@@ -169,7 +169,7 @@ void ring_buffer_set_clock(struct ring_buffer *buffer,
169size_t ring_buffer_page_len(void *page); 169size_t ring_buffer_page_len(void *page);
170 170
171 171
172void *ring_buffer_alloc_read_page(struct ring_buffer *buffer); 172void *ring_buffer_alloc_read_page(struct ring_buffer *buffer, int cpu);
173void ring_buffer_free_read_page(struct ring_buffer *buffer, void *data); 173void ring_buffer_free_read_page(struct ring_buffer *buffer, void *data);
174int ring_buffer_read_page(struct ring_buffer *buffer, void **data_page, 174int ring_buffer_read_page(struct ring_buffer *buffer, void **data_page,
175 size_t len, int cpu, int full); 175 size_t len, int cpu, int full);
diff --git a/include/linux/rtmutex.h b/include/linux/rtmutex.h
index 8d522ffeda33..de17134244f3 100644
--- a/include/linux/rtmutex.h
+++ b/include/linux/rtmutex.h
@@ -66,7 +66,7 @@ struct hrtimer_sleeper;
66 66
67#define __RT_MUTEX_INITIALIZER(mutexname) \ 67#define __RT_MUTEX_INITIALIZER(mutexname) \
68 { .wait_lock = __RAW_SPIN_LOCK_UNLOCKED(mutexname.wait_lock) \ 68 { .wait_lock = __RAW_SPIN_LOCK_UNLOCKED(mutexname.wait_lock) \
69 , .wait_list = PLIST_HEAD_INIT_RAW(mutexname.wait_list, mutexname.wait_lock) \ 69 , .wait_list = PLIST_HEAD_INIT(mutexname.wait_list) \
70 , .owner = NULL \ 70 , .owner = NULL \
71 __DEBUG_RT_MUTEX_INITIALIZER(mutexname)} 71 __DEBUG_RT_MUTEX_INITIALIZER(mutexname)}
72 72
@@ -100,7 +100,7 @@ extern void rt_mutex_unlock(struct rt_mutex *lock);
100 100
101#ifdef CONFIG_RT_MUTEXES 101#ifdef CONFIG_RT_MUTEXES
102# define INIT_RT_MUTEXES(tsk) \ 102# define INIT_RT_MUTEXES(tsk) \
103 .pi_waiters = PLIST_HEAD_INIT(tsk.pi_waiters, tsk.pi_lock), \ 103 .pi_waiters = PLIST_HEAD_INIT(tsk.pi_waiters), \
104 INIT_RT_MUTEX_DEBUG(tsk) 104 INIT_RT_MUTEX_DEBUG(tsk)
105#else 105#else
106# define INIT_RT_MUTEXES(tsk) 106# define INIT_RT_MUTEXES(tsk)
diff --git a/include/linux/rtnetlink.h b/include/linux/rtnetlink.h
index bbad657a3725..8e872ead88b5 100644
--- a/include/linux/rtnetlink.h
+++ b/include/linux/rtnetlink.h
@@ -585,6 +585,8 @@ enum rtnetlink_groups {
585#define RTNLGRP_PHONET_IFADDR RTNLGRP_PHONET_IFADDR 585#define RTNLGRP_PHONET_IFADDR RTNLGRP_PHONET_IFADDR
586 RTNLGRP_PHONET_ROUTE, 586 RTNLGRP_PHONET_ROUTE,
587#define RTNLGRP_PHONET_ROUTE RTNLGRP_PHONET_ROUTE 587#define RTNLGRP_PHONET_ROUTE RTNLGRP_PHONET_ROUTE
588 RTNLGRP_DCB,
589#define RTNLGRP_DCB RTNLGRP_DCB
588 __RTNLGRP_MAX 590 __RTNLGRP_MAX
589}; 591};
590#define RTNLGRP_MAX (__RTNLGRP_MAX - 1) 592#define RTNLGRP_MAX (__RTNLGRP_MAX - 1)
@@ -758,8 +760,7 @@ extern int lockdep_rtnl_is_held(void);
758 * or RTNL. Note : Please prefer rtnl_dereference() or rcu_dereference() 760 * or RTNL. Note : Please prefer rtnl_dereference() or rcu_dereference()
759 */ 761 */
760#define rcu_dereference_rtnl(p) \ 762#define rcu_dereference_rtnl(p) \
761 rcu_dereference_check(p, rcu_read_lock_held() || \ 763 rcu_dereference_check(p, lockdep_rtnl_is_held())
762 lockdep_rtnl_is_held())
763 764
764/** 765/**
765 * rtnl_dereference - fetch RCU pointer when updates are prevented by RTNL 766 * rtnl_dereference - fetch RCU pointer when updates are prevented by RTNL
diff --git a/include/linux/rwsem.h b/include/linux/rwsem.h
index a8afe9cd000c..6a6741440cb7 100644
--- a/include/linux/rwsem.h
+++ b/include/linux/rwsem.h
@@ -15,7 +15,7 @@
15#include <linux/spinlock.h> 15#include <linux/spinlock.h>
16 16
17#include <asm/system.h> 17#include <asm/system.h>
18#include <asm/atomic.h> 18#include <linux/atomic.h>
19 19
20struct rw_semaphore; 20struct rw_semaphore;
21 21
@@ -124,19 +124,9 @@ extern void downgrade_write(struct rw_semaphore *sem);
124 */ 124 */
125extern void down_read_nested(struct rw_semaphore *sem, int subclass); 125extern void down_read_nested(struct rw_semaphore *sem, int subclass);
126extern void down_write_nested(struct rw_semaphore *sem, int subclass); 126extern void down_write_nested(struct rw_semaphore *sem, int subclass);
127/*
128 * Take/release a lock when not the owner will release it.
129 *
130 * [ This API should be avoided as much as possible - the
131 * proper abstraction for this case is completions. ]
132 */
133extern void down_read_non_owner(struct rw_semaphore *sem);
134extern void up_read_non_owner(struct rw_semaphore *sem);
135#else 127#else
136# define down_read_nested(sem, subclass) down_read(sem) 128# define down_read_nested(sem, subclass) down_read(sem)
137# define down_write_nested(sem, subclass) down_write(sem) 129# define down_write_nested(sem, subclass) down_write(sem)
138# define down_read_non_owner(sem) down_read(sem)
139# define up_read_non_owner(sem) up_read(sem)
140#endif 130#endif
141 131
142#endif /* _LINUX_RWSEM_H */ 132#endif /* _LINUX_RWSEM_H */
diff --git a/include/linux/sched.h b/include/linux/sched.h
index 2a8621c4be1e..20b03bf94748 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -808,7 +808,7 @@ enum cpu_idle_type {
808 * when BITS_PER_LONG <= 32 are pretty high and the returns do not justify the 808 * when BITS_PER_LONG <= 32 are pretty high and the returns do not justify the
809 * increased costs. 809 * increased costs.
810 */ 810 */
811#if BITS_PER_LONG > 32 811#if 0 /* BITS_PER_LONG > 32 -- currently broken: it increases power usage under light load */
812# define SCHED_LOAD_RESOLUTION 10 812# define SCHED_LOAD_RESOLUTION 10
813# define scale_load(w) ((w) << SCHED_LOAD_RESOLUTION) 813# define scale_load(w) ((w) << SCHED_LOAD_RESOLUTION)
814# define scale_load_down(w) ((w) >> SCHED_LOAD_RESOLUTION) 814# define scale_load_down(w) ((w) >> SCHED_LOAD_RESOLUTION)
@@ -844,6 +844,7 @@ enum cpu_idle_type {
844#define SD_SERIALIZE 0x0400 /* Only a single load balancing instance */ 844#define SD_SERIALIZE 0x0400 /* Only a single load balancing instance */
845#define SD_ASYM_PACKING 0x0800 /* Place busy groups earlier in the domain */ 845#define SD_ASYM_PACKING 0x0800 /* Place busy groups earlier in the domain */
846#define SD_PREFER_SIBLING 0x1000 /* Prefer to place tasks in a sibling domain */ 846#define SD_PREFER_SIBLING 0x1000 /* Prefer to place tasks in a sibling domain */
847#define SD_OVERLAP 0x2000 /* sched_domains of this level overlap */
847 848
848enum powersavings_balance_level { 849enum powersavings_balance_level {
849 POWERSAVINGS_BALANCE_NONE = 0, /* No power saving load balance */ 850 POWERSAVINGS_BALANCE_NONE = 0, /* No power saving load balance */
@@ -893,16 +894,21 @@ static inline int sd_power_saving_flags(void)
893 return 0; 894 return 0;
894} 895}
895 896
896struct sched_group { 897struct sched_group_power {
897 struct sched_group *next; /* Must be a circular list */
898 atomic_t ref; 898 atomic_t ref;
899
900 /* 899 /*
901 * CPU power of this group, SCHED_LOAD_SCALE being max power for a 900 * CPU power of this group, SCHED_LOAD_SCALE being max power for a
902 * single CPU. 901 * single CPU.
903 */ 902 */
904 unsigned int cpu_power, cpu_power_orig; 903 unsigned int power, power_orig;
904};
905
906struct sched_group {
907 struct sched_group *next; /* Must be a circular list */
908 atomic_t ref;
909
905 unsigned int group_weight; 910 unsigned int group_weight;
911 struct sched_group_power *sgp;
906 912
907 /* 913 /*
908 * The CPUs this group covers. 914 * The CPUs this group covers.
@@ -1063,6 +1069,7 @@ struct sched_domain;
1063 */ 1069 */
1064#define WF_SYNC 0x01 /* waker goes to sleep after wakup */ 1070#define WF_SYNC 0x01 /* waker goes to sleep after wakup */
1065#define WF_FORK 0x02 /* child wakeup after fork */ 1071#define WF_FORK 0x02 /* child wakeup after fork */
1072#define WF_MIGRATED 0x04 /* internal use, task got migrated */
1066 1073
1067#define ENQUEUE_WAKEUP 1 1074#define ENQUEUE_WAKEUP 1
1068#define ENQUEUE_HEAD 2 1075#define ENQUEUE_HEAD 2
@@ -1253,6 +1260,9 @@ struct task_struct {
1253#ifdef CONFIG_PREEMPT_RCU 1260#ifdef CONFIG_PREEMPT_RCU
1254 int rcu_read_lock_nesting; 1261 int rcu_read_lock_nesting;
1255 char rcu_read_unlock_special; 1262 char rcu_read_unlock_special;
1263#if defined(CONFIG_RCU_BOOST) && defined(CONFIG_TREE_PREEMPT_RCU)
1264 int rcu_boosted;
1265#endif /* #if defined(CONFIG_RCU_BOOST) && defined(CONFIG_TREE_PREEMPT_RCU) */
1256 struct list_head rcu_node_entry; 1266 struct list_head rcu_node_entry;
1257#endif /* #ifdef CONFIG_PREEMPT_RCU */ 1267#endif /* #ifdef CONFIG_PREEMPT_RCU */
1258#ifdef CONFIG_TREE_PREEMPT_RCU 1268#ifdef CONFIG_TREE_PREEMPT_RCU
@@ -1282,7 +1292,7 @@ struct task_struct {
1282 int exit_state; 1292 int exit_state;
1283 int exit_code, exit_signal; 1293 int exit_code, exit_signal;
1284 int pdeath_signal; /* The signal sent when the parent dies */ 1294 int pdeath_signal; /* The signal sent when the parent dies */
1285 unsigned int group_stop; /* GROUP_STOP_*, siglock protected */ 1295 unsigned int jobctl; /* JOBCTL_*, siglock protected */
1286 /* ??? */ 1296 /* ??? */
1287 unsigned int personality; 1297 unsigned int personality;
1288 unsigned did_exec:1; 1298 unsigned did_exec:1;
@@ -1502,7 +1512,6 @@ struct task_struct {
1502 short il_next; 1512 short il_next;
1503 short pref_node_fork; 1513 short pref_node_fork;
1504#endif 1514#endif
1505 atomic_t fs_excl; /* holding fs exclusive resources */
1506 struct rcu_head rcu; 1515 struct rcu_head rcu;
1507 1516
1508 /* 1517 /*
@@ -1803,15 +1812,34 @@ extern void thread_group_times(struct task_struct *p, cputime_t *ut, cputime_t *
1803#define used_math() tsk_used_math(current) 1812#define used_math() tsk_used_math(current)
1804 1813
1805/* 1814/*
1806 * task->group_stop flags 1815 * task->jobctl flags
1807 */ 1816 */
1808#define GROUP_STOP_SIGMASK 0xffff /* signr of the last group stop */ 1817#define JOBCTL_STOP_SIGMASK 0xffff /* signr of the last group stop */
1809#define GROUP_STOP_PENDING (1 << 16) /* task should stop for group stop */ 1818
1810#define GROUP_STOP_CONSUME (1 << 17) /* consume group stop count */ 1819#define JOBCTL_STOP_DEQUEUED_BIT 16 /* stop signal dequeued */
1811#define GROUP_STOP_TRAPPING (1 << 18) /* switching from STOPPED to TRACED */ 1820#define JOBCTL_STOP_PENDING_BIT 17 /* task should stop for group stop */
1812#define GROUP_STOP_DEQUEUED (1 << 19) /* stop signal dequeued */ 1821#define JOBCTL_STOP_CONSUME_BIT 18 /* consume group stop count */
1813 1822#define JOBCTL_TRAP_STOP_BIT 19 /* trap for STOP */
1814extern void task_clear_group_stop_pending(struct task_struct *task); 1823#define JOBCTL_TRAP_NOTIFY_BIT 20 /* trap for NOTIFY */
1824#define JOBCTL_TRAPPING_BIT 21 /* switching to TRACED */
1825#define JOBCTL_LISTENING_BIT 22 /* ptracer is listening for events */
1826
1827#define JOBCTL_STOP_DEQUEUED (1 << JOBCTL_STOP_DEQUEUED_BIT)
1828#define JOBCTL_STOP_PENDING (1 << JOBCTL_STOP_PENDING_BIT)
1829#define JOBCTL_STOP_CONSUME (1 << JOBCTL_STOP_CONSUME_BIT)
1830#define JOBCTL_TRAP_STOP (1 << JOBCTL_TRAP_STOP_BIT)
1831#define JOBCTL_TRAP_NOTIFY (1 << JOBCTL_TRAP_NOTIFY_BIT)
1832#define JOBCTL_TRAPPING (1 << JOBCTL_TRAPPING_BIT)
1833#define JOBCTL_LISTENING (1 << JOBCTL_LISTENING_BIT)
1834
1835#define JOBCTL_TRAP_MASK (JOBCTL_TRAP_STOP | JOBCTL_TRAP_NOTIFY)
1836#define JOBCTL_PENDING_MASK (JOBCTL_STOP_PENDING | JOBCTL_TRAP_MASK)
1837
1838extern bool task_set_jobctl_pending(struct task_struct *task,
1839 unsigned int mask);
1840extern void task_clear_jobctl_trapping(struct task_struct *task);
1841extern void task_clear_jobctl_pending(struct task_struct *task,
1842 unsigned int mask);
1815 1843
1816#ifdef CONFIG_PREEMPT_RCU 1844#ifdef CONFIG_PREEMPT_RCU
1817 1845
@@ -2126,7 +2154,7 @@ static inline int dequeue_signal_lock(struct task_struct *tsk, sigset_t *mask, s
2126 spin_unlock_irqrestore(&tsk->sighand->siglock, flags); 2154 spin_unlock_irqrestore(&tsk->sighand->siglock, flags);
2127 2155
2128 return ret; 2156 return ret;
2129} 2157}
2130 2158
2131extern void block_all_signals(int (*notifier)(void *priv), void *priv, 2159extern void block_all_signals(int (*notifier)(void *priv), void *priv,
2132 sigset_t *mask); 2160 sigset_t *mask);
@@ -2141,7 +2169,7 @@ extern int kill_pid_info_as_uid(int, struct siginfo *, struct pid *, uid_t, uid_
2141extern int kill_pgrp(struct pid *pid, int sig, int priv); 2169extern int kill_pgrp(struct pid *pid, int sig, int priv);
2142extern int kill_pid(struct pid *pid, int sig, int priv); 2170extern int kill_pid(struct pid *pid, int sig, int priv);
2143extern int kill_proc_info(int, struct siginfo *, pid_t); 2171extern int kill_proc_info(int, struct siginfo *, pid_t);
2144extern int do_notify_parent(struct task_struct *, int); 2172extern __must_check bool do_notify_parent(struct task_struct *, int);
2145extern void __wake_up_parent(struct task_struct *p, struct task_struct *parent); 2173extern void __wake_up_parent(struct task_struct *p, struct task_struct *parent);
2146extern void force_sig(int, struct task_struct *); 2174extern void force_sig(int, struct task_struct *);
2147extern int send_sig(int, struct task_struct *, int); 2175extern int send_sig(int, struct task_struct *, int);
@@ -2265,8 +2293,10 @@ static inline int get_nr_threads(struct task_struct *tsk)
2265 return tsk->signal->nr_threads; 2293 return tsk->signal->nr_threads;
2266} 2294}
2267 2295
2268/* de_thread depends on thread_group_leader not being a pid based check */ 2296static inline bool thread_group_leader(struct task_struct *p)
2269#define thread_group_leader(p) (p == p->group_leader) 2297{
2298 return p->exit_signal >= 0;
2299}
2270 2300
2271/* Do to the insanities of de_thread it is possible for a process 2301/* Do to the insanities of de_thread it is possible for a process
2272 * to have the pid of the thread group leader without actually being 2302 * to have the pid of the thread group leader without actually being
@@ -2299,11 +2329,6 @@ static inline int thread_group_empty(struct task_struct *p)
2299#define delay_group_leader(p) \ 2329#define delay_group_leader(p) \
2300 (thread_group_leader(p) && !thread_group_empty(p)) 2330 (thread_group_leader(p) && !thread_group_empty(p))
2301 2331
2302static inline int task_detached(struct task_struct *p)
2303{
2304 return p->exit_signal == -1;
2305}
2306
2307/* 2332/*
2308 * Protects ->fs, ->files, ->mm, ->group_info, ->comm, keyring 2333 * Protects ->fs, ->files, ->mm, ->group_info, ->comm, keyring
2309 * subscriptions and synchronises with wait4(). Also used in procfs. Also 2334 * subscriptions and synchronises with wait4(). Also used in procfs. Also
@@ -2500,7 +2525,7 @@ extern int _cond_resched(void);
2500 2525
2501extern int __cond_resched_lock(spinlock_t *lock); 2526extern int __cond_resched_lock(spinlock_t *lock);
2502 2527
2503#ifdef CONFIG_PREEMPT 2528#ifdef CONFIG_PREEMPT_COUNT
2504#define PREEMPT_LOCK_OFFSET PREEMPT_OFFSET 2529#define PREEMPT_LOCK_OFFSET PREEMPT_OFFSET
2505#else 2530#else
2506#define PREEMPT_LOCK_OFFSET 0 2531#define PREEMPT_LOCK_OFFSET 0
diff --git a/include/linux/sdla.h b/include/linux/sdla.h
index 564acd3a71c1..9995c7fc3f60 100644
--- a/include/linux/sdla.h
+++ b/include/linux/sdla.h
@@ -112,11 +112,7 @@ struct sdla_dlci_conf {
112 short Tb_max; 112 short Tb_max;
113}; 113};
114 114
115#ifndef __KERNEL__ 115#ifdef __KERNEL__
116
117void sdla(void *cfg_info, char *dev, struct frad_conf *conf, int quiet);
118
119#else
120 116
121/* important Z80 window addresses */ 117/* important Z80 window addresses */
122#define SDLA_CONTROL_WND 0xE000 118#define SDLA_CONTROL_WND 0xE000
diff --git a/include/linux/seccomp.h b/include/linux/seccomp.h
index 167c33361d9c..cc7a4e9cc7ad 100644
--- a/include/linux/seccomp.h
+++ b/include/linux/seccomp.h
@@ -19,6 +19,11 @@ static inline void secure_computing(int this_syscall)
19extern long prctl_get_seccomp(void); 19extern long prctl_get_seccomp(void);
20extern long prctl_set_seccomp(unsigned long); 20extern long prctl_set_seccomp(unsigned long);
21 21
22static inline int seccomp_mode(seccomp_t *s)
23{
24 return s->mode;
25}
26
22#else /* CONFIG_SECCOMP */ 27#else /* CONFIG_SECCOMP */
23 28
24#include <linux/errno.h> 29#include <linux/errno.h>
@@ -37,6 +42,11 @@ static inline long prctl_set_seccomp(unsigned long arg2)
37 return -EINVAL; 42 return -EINVAL;
38} 43}
39 44
45static inline int seccomp_mode(seccomp_t *s)
46{
47 return 0;
48}
49
40#endif /* CONFIG_SECCOMP */ 50#endif /* CONFIG_SECCOMP */
41 51
42#endif /* _LINUX_SECCOMP_H */ 52#endif /* _LINUX_SECCOMP_H */
diff --git a/include/linux/security.h b/include/linux/security.h
index 8ce59ef3e5af..ebd2a53a3d07 100644
--- a/include/linux/security.h
+++ b/include/linux/security.h
@@ -1456,7 +1456,7 @@ struct security_operations {
1456 struct inode *new_dir, struct dentry *new_dentry); 1456 struct inode *new_dir, struct dentry *new_dentry);
1457 int (*inode_readlink) (struct dentry *dentry); 1457 int (*inode_readlink) (struct dentry *dentry);
1458 int (*inode_follow_link) (struct dentry *dentry, struct nameidata *nd); 1458 int (*inode_follow_link) (struct dentry *dentry, struct nameidata *nd);
1459 int (*inode_permission) (struct inode *inode, int mask, unsigned flags); 1459 int (*inode_permission) (struct inode *inode, int mask);
1460 int (*inode_setattr) (struct dentry *dentry, struct iattr *attr); 1460 int (*inode_setattr) (struct dentry *dentry, struct iattr *attr);
1461 int (*inode_getattr) (struct vfsmount *mnt, struct dentry *dentry); 1461 int (*inode_getattr) (struct vfsmount *mnt, struct dentry *dentry);
1462 int (*inode_setxattr) (struct dentry *dentry, const char *name, 1462 int (*inode_setxattr) (struct dentry *dentry, const char *name,
@@ -1720,7 +1720,6 @@ int security_inode_rename(struct inode *old_dir, struct dentry *old_dentry,
1720int security_inode_readlink(struct dentry *dentry); 1720int security_inode_readlink(struct dentry *dentry);
1721int security_inode_follow_link(struct dentry *dentry, struct nameidata *nd); 1721int security_inode_follow_link(struct dentry *dentry, struct nameidata *nd);
1722int security_inode_permission(struct inode *inode, int mask); 1722int security_inode_permission(struct inode *inode, int mask);
1723int security_inode_exec_permission(struct inode *inode, unsigned int flags);
1724int security_inode_setattr(struct dentry *dentry, struct iattr *attr); 1723int security_inode_setattr(struct dentry *dentry, struct iattr *attr);
1725int security_inode_getattr(struct vfsmount *mnt, struct dentry *dentry); 1724int security_inode_getattr(struct vfsmount *mnt, struct dentry *dentry);
1726int security_inode_setxattr(struct dentry *dentry, const char *name, 1725int security_inode_setxattr(struct dentry *dentry, const char *name,
@@ -2113,12 +2112,6 @@ static inline int security_inode_permission(struct inode *inode, int mask)
2113 return 0; 2112 return 0;
2114} 2113}
2115 2114
2116static inline int security_inode_exec_permission(struct inode *inode,
2117 unsigned int flags)
2118{
2119 return 0;
2120}
2121
2122static inline int security_inode_setattr(struct dentry *dentry, 2115static inline int security_inode_setattr(struct dentry *dentry,
2123 struct iattr *attr) 2116 struct iattr *attr)
2124{ 2117{
diff --git a/include/linux/sem.h b/include/linux/sem.h
index f2961afa2f66..1feb2de2ee57 100644
--- a/include/linux/sem.h
+++ b/include/linux/sem.h
@@ -77,7 +77,7 @@ struct seminfo {
77#define SEMUSZ 20 /* sizeof struct sem_undo */ 77#define SEMUSZ 20 /* sizeof struct sem_undo */
78 78
79#ifdef __KERNEL__ 79#ifdef __KERNEL__
80#include <asm/atomic.h> 80#include <linux/atomic.h>
81#include <linux/rcupdate.h> 81#include <linux/rcupdate.h>
82#include <linux/cache.h> 82#include <linux/cache.h>
83 83
diff --git a/include/linux/seq_file.h b/include/linux/seq_file.h
index 03c0232b4169..be720cd2038d 100644
--- a/include/linux/seq_file.h
+++ b/include/linux/seq_file.h
@@ -23,6 +23,7 @@ struct seq_file {
23 u64 version; 23 u64 version;
24 struct mutex lock; 24 struct mutex lock;
25 const struct seq_operations *op; 25 const struct seq_operations *op;
26 int poll_event;
26 void *private; 27 void *private;
27}; 28};
28 29
diff --git a/include/linux/seqlock.h b/include/linux/seqlock.h
index e9811892844f..c6db9fb33c44 100644
--- a/include/linux/seqlock.h
+++ b/include/linux/seqlock.h
@@ -28,6 +28,7 @@
28 28
29#include <linux/spinlock.h> 29#include <linux/spinlock.h>
30#include <linux/preempt.h> 30#include <linux/preempt.h>
31#include <asm/processor.h>
31 32
32typedef struct { 33typedef struct {
33 unsigned sequence; 34 unsigned sequence;
diff --git a/include/linux/serial_sci.h b/include/linux/serial_sci.h
index a2afc9fbe186..8bffe9ae2ca0 100644
--- a/include/linux/serial_sci.h
+++ b/include/linux/serial_sci.h
@@ -8,6 +8,8 @@
8 * Generic header for SuperH SCI(F) (used by sh/sh64/h8300 and related parts) 8 * Generic header for SuperH SCI(F) (used by sh/sh64/h8300 and related parts)
9 */ 9 */
10 10
11#define SCIx_NOT_SUPPORTED (-1)
12
11enum { 13enum {
12 SCBRR_ALGO_1, /* ((clk + 16 * bps) / (16 * bps) - 1) */ 14 SCBRR_ALGO_1, /* ((clk + 16 * bps) / (16 * bps) - 1) */
13 SCBRR_ALGO_2, /* ((clk + 16 * bps) / (32 * bps) - 1) */ 15 SCBRR_ALGO_2, /* ((clk + 16 * bps) / (32 * bps) - 1) */
@@ -25,6 +27,28 @@ enum {
25#define SCSCR_CKE1 (1 << 1) 27#define SCSCR_CKE1 (1 << 1)
26#define SCSCR_CKE0 (1 << 0) 28#define SCSCR_CKE0 (1 << 0)
27 29
30/* SCxSR SCI */
31#define SCI_TDRE 0x80
32#define SCI_RDRF 0x40
33#define SCI_ORER 0x20
34#define SCI_FER 0x10
35#define SCI_PER 0x08
36#define SCI_TEND 0x04
37
38#define SCI_DEFAULT_ERROR_MASK (SCI_PER | SCI_FER)
39
40/* SCxSR SCIF */
41#define SCIF_ER 0x0080
42#define SCIF_TEND 0x0040
43#define SCIF_TDFE 0x0020
44#define SCIF_BRK 0x0010
45#define SCIF_FER 0x0008
46#define SCIF_PER 0x0004
47#define SCIF_RDF 0x0002
48#define SCIF_DR 0x0001
49
50#define SCIF_DEFAULT_ERROR_MASK (SCIF_PER | SCIF_FER | SCIF_ER | SCIF_BRK)
51
28/* Offsets into the sci_port->irqs array */ 52/* Offsets into the sci_port->irqs array */
29enum { 53enum {
30 SCIx_ERI_IRQ, 54 SCIx_ERI_IRQ,
@@ -32,6 +56,24 @@ enum {
32 SCIx_TXI_IRQ, 56 SCIx_TXI_IRQ,
33 SCIx_BRI_IRQ, 57 SCIx_BRI_IRQ,
34 SCIx_NR_IRQS, 58 SCIx_NR_IRQS,
59
60 SCIx_MUX_IRQ = SCIx_NR_IRQS, /* special case */
61};
62
63enum {
64 SCIx_PROBE_REGTYPE,
65
66 SCIx_SCI_REGTYPE,
67 SCIx_IRDA_REGTYPE,
68 SCIx_SCIFA_REGTYPE,
69 SCIx_SCIFB_REGTYPE,
70 SCIx_SH3_SCIF_REGTYPE,
71 SCIx_SH4_SCIF_REGTYPE,
72 SCIx_SH4_SCIF_NO_SCSPTR_REGTYPE,
73 SCIx_SH4_SCIF_FIFODATA_REGTYPE,
74 SCIx_SH7705_SCIF_REGTYPE,
75
76 SCIx_NR_REGTYPES,
35}; 77};
36 78
37#define SCIx_IRQ_MUXED(irq) \ 79#define SCIx_IRQ_MUXED(irq) \
@@ -42,8 +84,29 @@ enum {
42 [SCIx_BRI_IRQ] = (irq), \ 84 [SCIx_BRI_IRQ] = (irq), \
43} 85}
44 86
87#define SCIx_IRQ_IS_MUXED(port) \
88 ((port)->cfg->irqs[SCIx_ERI_IRQ] == \
89 (port)->cfg->irqs[SCIx_RXI_IRQ]) || \
90 ((port)->cfg->irqs[SCIx_ERI_IRQ] && \
91 !(port)->cfg->irqs[SCIx_RXI_IRQ])
92/*
93 * SCI register subset common for all port types.
94 * Not all registers will exist on all parts.
95 */
96enum {
97 SCSMR, SCBRR, SCSCR, SCxSR,
98 SCFCR, SCFDR, SCxTDR, SCxRDR,
99 SCLSR, SCTFDR, SCRFDR, SCSPTR,
100
101 SCIx_NR_REGS,
102};
103
45struct device; 104struct device;
46 105
106struct plat_sci_port_ops {
107 void (*init_pins)(struct uart_port *, unsigned int cflag);
108};
109
47/* 110/*
48 * Platform device specific platform_data struct 111 * Platform device specific platform_data struct
49 */ 112 */
@@ -56,6 +119,18 @@ struct plat_sci_port {
56 unsigned int scbrr_algo_id; /* SCBRR calculation algo */ 119 unsigned int scbrr_algo_id; /* SCBRR calculation algo */
57 unsigned int scscr; /* SCSCR initialization */ 120 unsigned int scscr; /* SCSCR initialization */
58 121
122 /*
123 * Platform overrides if necessary, defaults otherwise.
124 */
125 int overrun_bit;
126 unsigned int error_mask;
127
128 int port_reg;
129 unsigned char regshift;
130 unsigned char regtype;
131
132 struct plat_sci_port_ops *ops;
133
59 struct device *dma_dev; 134 struct device *dma_dev;
60 135
61 unsigned int dma_slave_tx; 136 unsigned int dma_slave_tx;
diff --git a/include/linux/sh_clk.h b/include/linux/sh_clk.h
index 9a52f72527dc..3ccf18648d0a 100644
--- a/include/linux/sh_clk.h
+++ b/include/linux/sh_clk.h
@@ -147,4 +147,8 @@ int sh_clk_div4_reparent_register(struct clk *clks, int nr,
147int sh_clk_div6_register(struct clk *clks, int nr); 147int sh_clk_div6_register(struct clk *clks, int nr);
148int sh_clk_div6_reparent_register(struct clk *clks, int nr); 148int sh_clk_div6_reparent_register(struct clk *clks, int nr);
149 149
150#define CLKDEV_CON_ID(_id, _clk) { .con_id = _id, .clk = _clk }
151#define CLKDEV_DEV_ID(_id, _clk) { .dev_id = _id, .clk = _clk }
152#define CLKDEV_ICK_ID(_cid, _did, _clk) { .con_id = _cid, .dev_id = _did, .clk = _clk }
153
150#endif /* __SH_CLOCK_H */ 154#endif /* __SH_CLOCK_H */
diff --git a/include/linux/sh_dma.h b/include/linux/sh_dma.h
index b08cd4efa15c..cb2dd118cc0f 100644
--- a/include/linux/sh_dma.h
+++ b/include/linux/sh_dma.h
@@ -62,6 +62,12 @@ struct sh_dmae_pdata {
62 const unsigned int *ts_shift; 62 const unsigned int *ts_shift;
63 int ts_shift_num; 63 int ts_shift_num;
64 u16 dmaor_init; 64 u16 dmaor_init;
65 unsigned int chcr_offset;
66 u32 chcr_ie_bit;
67
68 unsigned int dmaor_is_32bit:1;
69 unsigned int needs_tend_set:1;
70 unsigned int no_dmars:1;
65}; 71};
66 72
67/* DMA register */ 73/* DMA register */
@@ -71,6 +77,8 @@ struct sh_dmae_pdata {
71#define CHCR 0x0C 77#define CHCR 0x0C
72#define DMAOR 0x40 78#define DMAOR 0x40
73 79
80#define TEND 0x18 /* USB-DMAC */
81
74/* DMAOR definitions */ 82/* DMAOR definitions */
75#define DMAOR_AE 0x00000004 83#define DMAOR_AE 0x00000004
76#define DMAOR_NMIF 0x00000002 84#define DMAOR_NMIF 0x00000002
diff --git a/include/linux/shm.h b/include/linux/shm.h
index eca6235a46c0..92808b86703b 100644
--- a/include/linux/shm.h
+++ b/include/linux/shm.h
@@ -95,6 +95,9 @@ struct shmid_kernel /* private to the kernel */
95 pid_t shm_cprid; 95 pid_t shm_cprid;
96 pid_t shm_lprid; 96 pid_t shm_lprid;
97 struct user_struct *mlock_user; 97 struct user_struct *mlock_user;
98
99 /* The task created the shm object. NULL if the task is dead. */
100 struct task_struct *shm_creator;
98}; 101};
99 102
100/* shm_mode upper byte flags */ 103/* shm_mode upper byte flags */
@@ -106,6 +109,7 @@ struct shmid_kernel /* private to the kernel */
106#ifdef CONFIG_SYSVIPC 109#ifdef CONFIG_SYSVIPC
107long do_shmat(int shmid, char __user *shmaddr, int shmflg, unsigned long *addr); 110long do_shmat(int shmid, char __user *shmaddr, int shmflg, unsigned long *addr);
108extern int is_file_shm_hugepages(struct file *file); 111extern int is_file_shm_hugepages(struct file *file);
112extern void exit_shm(struct task_struct *task);
109#else 113#else
110static inline long do_shmat(int shmid, char __user *shmaddr, 114static inline long do_shmat(int shmid, char __user *shmaddr,
111 int shmflg, unsigned long *addr) 115 int shmflg, unsigned long *addr)
@@ -116,6 +120,9 @@ static inline int is_file_shm_hugepages(struct file *file)
116{ 120{
117 return 0; 121 return 0;
118} 122}
123static inline void exit_shm(struct task_struct *task)
124{
125}
119#endif 126#endif
120 127
121#endif /* __KERNEL__ */ 128#endif /* __KERNEL__ */
diff --git a/include/linux/shmem_fs.h b/include/linux/shmem_fs.h
index 2b7fec840517..9291ac3cc627 100644
--- a/include/linux/shmem_fs.h
+++ b/include/linux/shmem_fs.h
@@ -3,26 +3,20 @@
3 3
4#include <linux/swap.h> 4#include <linux/swap.h>
5#include <linux/mempolicy.h> 5#include <linux/mempolicy.h>
6#include <linux/pagemap.h>
6#include <linux/percpu_counter.h> 7#include <linux/percpu_counter.h>
7 8
8/* inode in-kernel data */ 9/* inode in-kernel data */
9 10
10#define SHMEM_NR_DIRECT 16
11
12#define SHMEM_SYMLINK_INLINE_LEN (SHMEM_NR_DIRECT * sizeof(swp_entry_t))
13
14struct shmem_inode_info { 11struct shmem_inode_info {
15 spinlock_t lock; 12 spinlock_t lock;
16 unsigned long flags; 13 unsigned long flags;
17 unsigned long alloced; /* data pages alloced to file */ 14 unsigned long alloced; /* data pages alloced to file */
18 unsigned long swapped; /* subtotal assigned to swap */
19 unsigned long next_index; /* highest alloced index + 1 */
20 struct shared_policy policy; /* NUMA memory alloc policy */
21 struct page *i_indirect; /* top indirect blocks page */
22 union { 15 union {
23 swp_entry_t i_direct[SHMEM_NR_DIRECT]; /* first blocks */ 16 unsigned long swapped; /* subtotal assigned to swap */
24 char inline_symlink[SHMEM_SYMLINK_INLINE_LEN]; 17 char *symlink; /* unswappable short symlink */
25 }; 18 };
19 struct shared_policy policy; /* NUMA memory alloc policy */
26 struct list_head swaplist; /* chain of maybes on swap */ 20 struct list_head swaplist; /* chain of maybes on swap */
27 struct list_head xattr_list; /* list of shmem_xattr */ 21 struct list_head xattr_list; /* list of shmem_xattr */
28 struct inode vfs_inode; 22 struct inode vfs_inode;
@@ -45,7 +39,25 @@ static inline struct shmem_inode_info *SHMEM_I(struct inode *inode)
45 return container_of(inode, struct shmem_inode_info, vfs_inode); 39 return container_of(inode, struct shmem_inode_info, vfs_inode);
46} 40}
47 41
48extern int init_tmpfs(void); 42/*
43 * Functions in mm/shmem.c called directly from elsewhere:
44 */
45extern int shmem_init(void);
49extern int shmem_fill_super(struct super_block *sb, void *data, int silent); 46extern int shmem_fill_super(struct super_block *sb, void *data, int silent);
47extern struct file *shmem_file_setup(const char *name,
48 loff_t size, unsigned long flags);
49extern int shmem_zero_setup(struct vm_area_struct *);
50extern int shmem_lock(struct file *file, int lock, struct user_struct *user);
51extern struct page *shmem_read_mapping_page_gfp(struct address_space *mapping,
52 pgoff_t index, gfp_t gfp_mask);
53extern void shmem_truncate_range(struct inode *inode, loff_t start, loff_t end);
54extern int shmem_unuse(swp_entry_t entry, struct page *page);
55
56static inline struct page *shmem_read_mapping_page(
57 struct address_space *mapping, pgoff_t index)
58{
59 return shmem_read_mapping_page_gfp(mapping, index,
60 mapping_gfp_mask(mapping));
61}
50 62
51#endif 63#endif
diff --git a/include/linux/shrinker.h b/include/linux/shrinker.h
new file mode 100644
index 000000000000..790651b4e5ba
--- /dev/null
+++ b/include/linux/shrinker.h
@@ -0,0 +1,42 @@
1#ifndef _LINUX_SHRINKER_H
2#define _LINUX_SHRINKER_H
3
4/*
5 * This struct is used to pass information from page reclaim to the shrinkers.
6 * We consolidate the values for easier extention later.
7 */
8struct shrink_control {
9 gfp_t gfp_mask;
10
11 /* How many slab objects shrinker() should scan and try to reclaim */
12 unsigned long nr_to_scan;
13};
14
15/*
16 * A callback you can register to apply pressure to ageable caches.
17 *
18 * 'sc' is passed shrink_control which includes a count 'nr_to_scan'
19 * and a 'gfpmask'. It should look through the least-recently-used
20 * 'nr_to_scan' entries and attempt to free them up. It should return
21 * the number of objects which remain in the cache. If it returns -1, it means
22 * it cannot do any scanning at this time (eg. there is a risk of deadlock).
23 *
24 * The 'gfpmask' refers to the allocation we are currently trying to
25 * fulfil.
26 *
27 * Note that 'shrink' will be passed nr_to_scan == 0 when the VM is
28 * querying the cache size, so a fastpath for that case is appropriate.
29 */
30struct shrinker {
31 int (*shrink)(struct shrinker *, struct shrink_control *sc);
32 int seeks; /* seeks to recreate an obj */
33 long batch; /* reclaim batch size, 0 = default */
34
35 /* These are for internal use */
36 struct list_head list;
37 long nr; /* objs pending delete */
38};
39#define DEFAULT_SEEKS 2 /* A good number if you don't know better. */
40extern void register_shrinker(struct shrinker *);
41extern void unregister_shrinker(struct shrinker *);
42#endif
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
index e8b78ce14474..7b996ed86d5b 100644
--- a/include/linux/skbuff.h
+++ b/include/linux/skbuff.h
@@ -20,7 +20,7 @@
20#include <linux/time.h> 20#include <linux/time.h>
21#include <linux/cache.h> 21#include <linux/cache.h>
22 22
23#include <asm/atomic.h> 23#include <linux/atomic.h>
24#include <asm/types.h> 24#include <asm/types.h>
25#include <linux/spinlock.h> 25#include <linux/spinlock.h>
26#include <linux/net.h> 26#include <linux/net.h>
@@ -187,6 +187,20 @@ enum {
187 187
188 /* ensure the originating sk reference is available on driver level */ 188 /* ensure the originating sk reference is available on driver level */
189 SKBTX_DRV_NEEDS_SK_REF = 1 << 3, 189 SKBTX_DRV_NEEDS_SK_REF = 1 << 3,
190
191 /* device driver supports TX zero-copy buffers */
192 SKBTX_DEV_ZEROCOPY = 1 << 4,
193};
194
195/*
196 * The callback notifies userspace to release buffers when skb DMA is done in
197 * lower device, the skb last reference should be 0 when calling this.
198 * The desc is used to track userspace buffer index.
199 */
200struct ubuf_info {
201 void (*callback)(void *);
202 void *arg;
203 unsigned long desc;
190}; 204};
191 205
192/* This data is invariant across clones and lives at 206/* This data is invariant across clones and lives at
@@ -211,6 +225,7 @@ struct skb_shared_info {
211 /* Intermediate layers must ensure that destructor_arg 225 /* Intermediate layers must ensure that destructor_arg
212 * remains valid until skb destructor */ 226 * remains valid until skb destructor */
213 void * destructor_arg; 227 void * destructor_arg;
228
214 /* must be last field, see pskb_expand_head() */ 229 /* must be last field, see pskb_expand_head() */
215 skb_frag_t frags[MAX_SKB_FRAGS]; 230 skb_frag_t frags[MAX_SKB_FRAGS];
216}; 231};
@@ -270,15 +285,12 @@ typedef unsigned char *sk_buff_data_t;
270 * struct sk_buff - socket buffer 285 * struct sk_buff - socket buffer
271 * @next: Next buffer in list 286 * @next: Next buffer in list
272 * @prev: Previous buffer in list 287 * @prev: Previous buffer in list
273 * @sk: Socket we are owned by
274 * @tstamp: Time we arrived 288 * @tstamp: Time we arrived
289 * @sk: Socket we are owned by
275 * @dev: Device we arrived on/are leaving by 290 * @dev: Device we arrived on/are leaving by
276 * @transport_header: Transport layer header 291 * @cb: Control buffer. Free for use by every layer. Put private vars here
277 * @network_header: Network layer header
278 * @mac_header: Link layer header
279 * @_skb_refdst: destination entry (with norefcount bit) 292 * @_skb_refdst: destination entry (with norefcount bit)
280 * @sp: the security path, used for xfrm 293 * @sp: the security path, used for xfrm
281 * @cb: Control buffer. Free for use by every layer. Put private vars here
282 * @len: Length of actual data 294 * @len: Length of actual data
283 * @data_len: Data length 295 * @data_len: Data length
284 * @mac_len: Length of link layer header 296 * @mac_len: Length of link layer header
@@ -286,40 +298,45 @@ typedef unsigned char *sk_buff_data_t;
286 * @csum: Checksum (must include start/offset pair) 298 * @csum: Checksum (must include start/offset pair)
287 * @csum_start: Offset from skb->head where checksumming should start 299 * @csum_start: Offset from skb->head where checksumming should start
288 * @csum_offset: Offset from csum_start where checksum should be stored 300 * @csum_offset: Offset from csum_start where checksum should be stored
301 * @priority: Packet queueing priority
289 * @local_df: allow local fragmentation 302 * @local_df: allow local fragmentation
290 * @cloned: Head may be cloned (check refcnt to be sure) 303 * @cloned: Head may be cloned (check refcnt to be sure)
304 * @ip_summed: Driver fed us an IP checksum
291 * @nohdr: Payload reference only, must not modify header 305 * @nohdr: Payload reference only, must not modify header
306 * @nfctinfo: Relationship of this skb to the connection
292 * @pkt_type: Packet class 307 * @pkt_type: Packet class
293 * @fclone: skbuff clone status 308 * @fclone: skbuff clone status
294 * @ip_summed: Driver fed us an IP checksum
295 * @priority: Packet queueing priority
296 * @users: User count - see {datagram,tcp}.c
297 * @protocol: Packet protocol from driver
298 * @truesize: Buffer size
299 * @head: Head of buffer
300 * @data: Data head pointer
301 * @tail: Tail pointer
302 * @end: End pointer
303 * @destructor: Destruct function
304 * @mark: Generic packet mark
305 * @nfct: Associated connection, if any
306 * @ipvs_property: skbuff is owned by ipvs 309 * @ipvs_property: skbuff is owned by ipvs
307 * @peeked: this packet has been seen already, so stats have been 310 * @peeked: this packet has been seen already, so stats have been
308 * done for it, don't do them again 311 * done for it, don't do them again
309 * @nf_trace: netfilter packet trace flag 312 * @nf_trace: netfilter packet trace flag
310 * @nfctinfo: Relationship of this skb to the connection 313 * @protocol: Packet protocol from driver
314 * @destructor: Destruct function
315 * @nfct: Associated connection, if any
311 * @nfct_reasm: netfilter conntrack re-assembly pointer 316 * @nfct_reasm: netfilter conntrack re-assembly pointer
312 * @nf_bridge: Saved data about a bridged frame - see br_netfilter.c 317 * @nf_bridge: Saved data about a bridged frame - see br_netfilter.c
313 * @skb_iif: ifindex of device we arrived on 318 * @skb_iif: ifindex of device we arrived on
314 * @rxhash: the packet hash computed on receive
315 * @queue_mapping: Queue mapping for multiqueue devices
316 * @tc_index: Traffic control index 319 * @tc_index: Traffic control index
317 * @tc_verd: traffic control verdict 320 * @tc_verd: traffic control verdict
321 * @rxhash: the packet hash computed on receive
322 * @queue_mapping: Queue mapping for multiqueue devices
318 * @ndisc_nodetype: router type (from link layer) 323 * @ndisc_nodetype: router type (from link layer)
324 * @ooo_okay: allow the mapping of a socket to a queue to be changed
319 * @dma_cookie: a cookie to one of several possible DMA operations 325 * @dma_cookie: a cookie to one of several possible DMA operations
320 * done by skb DMA functions 326 * done by skb DMA functions
321 * @secmark: security marking 327 * @secmark: security marking
328 * @mark: Generic packet mark
329 * @dropcount: total number of sk_receive_queue overflows
322 * @vlan_tci: vlan tag control information 330 * @vlan_tci: vlan tag control information
331 * @transport_header: Transport layer header
332 * @network_header: Network layer header
333 * @mac_header: Link layer header
334 * @tail: Tail pointer
335 * @end: End pointer
336 * @head: Head of buffer
337 * @data: Data head pointer
338 * @truesize: Buffer size
339 * @users: User count - see {datagram,tcp}.c
323 */ 340 */
324 341
325struct sk_buff { 342struct sk_buff {
@@ -1256,6 +1273,11 @@ static inline void skb_reserve(struct sk_buff *skb, int len)
1256 skb->tail += len; 1273 skb->tail += len;
1257} 1274}
1258 1275
1276static inline void skb_reset_mac_len(struct sk_buff *skb)
1277{
1278 skb->mac_len = skb->network_header - skb->mac_header;
1279}
1280
1259#ifdef NET_SKBUFF_DATA_USES_OFFSET 1281#ifdef NET_SKBUFF_DATA_USES_OFFSET
1260static inline unsigned char *skb_transport_header(const struct sk_buff *skb) 1282static inline unsigned char *skb_transport_header(const struct sk_buff *skb)
1261{ 1283{
@@ -1557,16 +1579,22 @@ static inline struct sk_buff *netdev_alloc_skb(struct net_device *dev,
1557 return __netdev_alloc_skb(dev, length, GFP_ATOMIC); 1579 return __netdev_alloc_skb(dev, length, GFP_ATOMIC);
1558} 1580}
1559 1581
1560static inline struct sk_buff *netdev_alloc_skb_ip_align(struct net_device *dev, 1582static inline struct sk_buff *__netdev_alloc_skb_ip_align(struct net_device *dev,
1561 unsigned int length) 1583 unsigned int length, gfp_t gfp)
1562{ 1584{
1563 struct sk_buff *skb = netdev_alloc_skb(dev, length + NET_IP_ALIGN); 1585 struct sk_buff *skb = __netdev_alloc_skb(dev, length + NET_IP_ALIGN, gfp);
1564 1586
1565 if (NET_IP_ALIGN && skb) 1587 if (NET_IP_ALIGN && skb)
1566 skb_reserve(skb, NET_IP_ALIGN); 1588 skb_reserve(skb, NET_IP_ALIGN);
1567 return skb; 1589 return skb;
1568} 1590}
1569 1591
1592static inline struct sk_buff *netdev_alloc_skb_ip_align(struct net_device *dev,
1593 unsigned int length)
1594{
1595 return __netdev_alloc_skb_ip_align(dev, length, GFP_ATOMIC);
1596}
1597
1570/** 1598/**
1571 * __netdev_alloc_page - allocate a page for ps-rx on a specific device 1599 * __netdev_alloc_page - allocate a page for ps-rx on a specific device
1572 * @dev: network device to receive on 1600 * @dev: network device to receive on
@@ -2023,8 +2051,7 @@ static inline void sw_tx_timestamp(struct sk_buff *skb)
2023 * skb_tx_timestamp() - Driver hook for transmit timestamping 2051 * skb_tx_timestamp() - Driver hook for transmit timestamping
2024 * 2052 *
2025 * Ethernet MAC Drivers should call this function in their hard_xmit() 2053 * Ethernet MAC Drivers should call this function in their hard_xmit()
2026 * function as soon as possible after giving the sk_buff to the MAC 2054 * function immediately before giving the sk_buff to the MAC hardware.
2027 * hardware, but before freeing the sk_buff.
2028 * 2055 *
2029 * @skb: A socket buffer. 2056 * @skb: A socket buffer.
2030 */ 2057 */
@@ -2261,5 +2288,6 @@ static inline void skb_checksum_none_assert(struct sk_buff *skb)
2261} 2288}
2262 2289
2263bool skb_partial_csum_set(struct sk_buff *skb, u16 start, u16 off); 2290bool skb_partial_csum_set(struct sk_buff *skb, u16 start, u16 off);
2291
2264#endif /* __KERNEL__ */ 2292#endif /* __KERNEL__ */
2265#endif /* _LINUX_SKBUFF_H */ 2293#endif /* _LINUX_SKBUFF_H */
diff --git a/include/linux/slab.h b/include/linux/slab.h
index ad4dd1c8d30a..573c809c33d9 100644
--- a/include/linux/slab.h
+++ b/include/linux/slab.h
@@ -134,6 +134,26 @@ unsigned int kmem_cache_size(struct kmem_cache *);
134#define KMALLOC_MAX_ORDER (KMALLOC_SHIFT_HIGH - PAGE_SHIFT) 134#define KMALLOC_MAX_ORDER (KMALLOC_SHIFT_HIGH - PAGE_SHIFT)
135 135
136/* 136/*
137 * Some archs want to perform DMA into kmalloc caches and need a guaranteed
138 * alignment larger than the alignment of a 64-bit integer.
139 * Setting ARCH_KMALLOC_MINALIGN in arch headers allows that.
140 */
141#ifdef ARCH_DMA_MINALIGN
142#define ARCH_KMALLOC_MINALIGN ARCH_DMA_MINALIGN
143#else
144#define ARCH_KMALLOC_MINALIGN __alignof__(unsigned long long)
145#endif
146
147/*
148 * Setting ARCH_SLAB_MINALIGN in arch headers allows a different alignment.
149 * Intended for arches that get misalignment faults even for 64 bit integer
150 * aligned buffers.
151 */
152#ifndef ARCH_SLAB_MINALIGN
153#define ARCH_SLAB_MINALIGN __alignof__(unsigned long long)
154#endif
155
156/*
137 * Common kmalloc functions provided by all allocators 157 * Common kmalloc functions provided by all allocators
138 */ 158 */
139void * __must_check __krealloc(const void *, size_t, gfp_t); 159void * __must_check __krealloc(const void *, size_t, gfp_t);
diff --git a/include/linux/slab_def.h b/include/linux/slab_def.h
index 83203ae9390b..d00e0bacda93 100644
--- a/include/linux/slab_def.h
+++ b/include/linux/slab_def.h
@@ -18,53 +18,25 @@
18#include <trace/events/kmem.h> 18#include <trace/events/kmem.h>
19 19
20/* 20/*
21 * Enforce a minimum alignment for the kmalloc caches.
22 * Usually, the kmalloc caches are cache_line_size() aligned, except when
23 * DEBUG and FORCED_DEBUG are enabled, then they are BYTES_PER_WORD aligned.
24 * Some archs want to perform DMA into kmalloc caches and need a guaranteed
25 * alignment larger than the alignment of a 64-bit integer.
26 * ARCH_KMALLOC_MINALIGN allows that.
27 * Note that increasing this value may disable some debug features.
28 */
29#ifdef ARCH_DMA_MINALIGN
30#define ARCH_KMALLOC_MINALIGN ARCH_DMA_MINALIGN
31#else
32#define ARCH_KMALLOC_MINALIGN __alignof__(unsigned long long)
33#endif
34
35#ifndef ARCH_SLAB_MINALIGN
36/*
37 * Enforce a minimum alignment for all caches.
38 * Intended for archs that get misalignment faults even for BYTES_PER_WORD
39 * aligned buffers. Includes ARCH_KMALLOC_MINALIGN.
40 * If possible: Do not enable this flag for CONFIG_DEBUG_SLAB, it disables
41 * some debug features.
42 */
43#define ARCH_SLAB_MINALIGN 0
44#endif
45
46/*
47 * struct kmem_cache 21 * struct kmem_cache
48 * 22 *
49 * manages a cache. 23 * manages a cache.
50 */ 24 */
51 25
52struct kmem_cache { 26struct kmem_cache {
53/* 1) per-cpu data, touched during every alloc/free */ 27/* 1) Cache tunables. Protected by cache_chain_mutex */
54 struct array_cache *array[NR_CPUS];
55/* 2) Cache tunables. Protected by cache_chain_mutex */
56 unsigned int batchcount; 28 unsigned int batchcount;
57 unsigned int limit; 29 unsigned int limit;
58 unsigned int shared; 30 unsigned int shared;
59 31
60 unsigned int buffer_size; 32 unsigned int buffer_size;
61 u32 reciprocal_buffer_size; 33 u32 reciprocal_buffer_size;
62/* 3) touched by every alloc & free from the backend */ 34/* 2) touched by every alloc & free from the backend */
63 35
64 unsigned int flags; /* constant flags */ 36 unsigned int flags; /* constant flags */
65 unsigned int num; /* # of objs per slab */ 37 unsigned int num; /* # of objs per slab */
66 38
67/* 4) cache_grow/shrink */ 39/* 3) cache_grow/shrink */
68 /* order of pgs per slab (2^n) */ 40 /* order of pgs per slab (2^n) */
69 unsigned int gfporder; 41 unsigned int gfporder;
70 42
@@ -80,11 +52,11 @@ struct kmem_cache {
80 /* constructor func */ 52 /* constructor func */
81 void (*ctor)(void *obj); 53 void (*ctor)(void *obj);
82 54
83/* 5) cache creation/removal */ 55/* 4) cache creation/removal */
84 const char *name; 56 const char *name;
85 struct list_head next; 57 struct list_head next;
86 58
87/* 6) statistics */ 59/* 5) statistics */
88#ifdef CONFIG_DEBUG_SLAB 60#ifdef CONFIG_DEBUG_SLAB
89 unsigned long num_active; 61 unsigned long num_active;
90 unsigned long num_allocations; 62 unsigned long num_allocations;
@@ -111,16 +83,18 @@ struct kmem_cache {
111 int obj_size; 83 int obj_size;
112#endif /* CONFIG_DEBUG_SLAB */ 84#endif /* CONFIG_DEBUG_SLAB */
113 85
86/* 6) per-cpu/per-node data, touched during every alloc/free */
114 /* 87 /*
115 * We put nodelists[] at the end of kmem_cache, because we want to size 88 * We put array[] at the end of kmem_cache, because we want to size
116 * this array to nr_node_ids slots instead of MAX_NUMNODES 89 * this array to nr_cpu_ids slots instead of NR_CPUS
117 * (see kmem_cache_init()) 90 * (see kmem_cache_init())
118 * We still use [MAX_NUMNODES] and not [1] or [0] because cache_cache 91 * We still use [NR_CPUS] and not [1] or [0] because cache_cache
119 * is statically defined, so we reserve the max number of nodes. 92 * is statically defined, so we reserve the max number of cpus.
120 */ 93 */
121 struct kmem_list3 *nodelists[MAX_NUMNODES]; 94 struct kmem_list3 **nodelists;
95 struct array_cache *array[NR_CPUS];
122 /* 96 /*
123 * Do not add fields after nodelists[] 97 * Do not add fields after array[]
124 */ 98 */
125}; 99};
126 100
diff --git a/include/linux/slob_def.h b/include/linux/slob_def.h
index 4382db09df4f..0ec00b39d006 100644
--- a/include/linux/slob_def.h
+++ b/include/linux/slob_def.h
@@ -1,16 +1,6 @@
1#ifndef __LINUX_SLOB_DEF_H 1#ifndef __LINUX_SLOB_DEF_H
2#define __LINUX_SLOB_DEF_H 2#define __LINUX_SLOB_DEF_H
3 3
4#ifdef ARCH_DMA_MINALIGN
5#define ARCH_KMALLOC_MINALIGN ARCH_DMA_MINALIGN
6#else
7#define ARCH_KMALLOC_MINALIGN __alignof__(unsigned long)
8#endif
9
10#ifndef ARCH_SLAB_MINALIGN
11#define ARCH_SLAB_MINALIGN __alignof__(unsigned long)
12#endif
13
14void *kmem_cache_alloc_node(struct kmem_cache *, gfp_t flags, int node); 4void *kmem_cache_alloc_node(struct kmem_cache *, gfp_t flags, int node);
15 5
16static __always_inline void *kmem_cache_alloc(struct kmem_cache *cachep, 6static __always_inline void *kmem_cache_alloc(struct kmem_cache *cachep,
diff --git a/include/linux/slub_def.h b/include/linux/slub_def.h
index c8668d161dd8..f58d6413d230 100644
--- a/include/linux/slub_def.h
+++ b/include/linux/slub_def.h
@@ -24,6 +24,7 @@ enum stat_item {
24 ALLOC_FROM_PARTIAL, /* Cpu slab acquired from partial list */ 24 ALLOC_FROM_PARTIAL, /* Cpu slab acquired from partial list */
25 ALLOC_SLAB, /* Cpu slab acquired from page allocator */ 25 ALLOC_SLAB, /* Cpu slab acquired from page allocator */
26 ALLOC_REFILL, /* Refill cpu slab from slab freelist */ 26 ALLOC_REFILL, /* Refill cpu slab from slab freelist */
27 ALLOC_NODE_MISMATCH, /* Switching cpu slab */
27 FREE_SLAB, /* Slab freed to the page allocator */ 28 FREE_SLAB, /* Slab freed to the page allocator */
28 CPUSLAB_FLUSH, /* Abandoning of the cpu slab */ 29 CPUSLAB_FLUSH, /* Abandoning of the cpu slab */
29 DEACTIVATE_FULL, /* Cpu slab was full when deactivated */ 30 DEACTIVATE_FULL, /* Cpu slab was full when deactivated */
@@ -31,8 +32,10 @@ enum stat_item {
31 DEACTIVATE_TO_HEAD, /* Cpu slab was moved to the head of partials */ 32 DEACTIVATE_TO_HEAD, /* Cpu slab was moved to the head of partials */
32 DEACTIVATE_TO_TAIL, /* Cpu slab was moved to the tail of partials */ 33 DEACTIVATE_TO_TAIL, /* Cpu slab was moved to the tail of partials */
33 DEACTIVATE_REMOTE_FREES,/* Slab contained remotely freed objects */ 34 DEACTIVATE_REMOTE_FREES,/* Slab contained remotely freed objects */
35 DEACTIVATE_BYPASS, /* Implicit deactivation */
34 ORDER_FALLBACK, /* Number of times fallback was necessary */ 36 ORDER_FALLBACK, /* Number of times fallback was necessary */
35 CMPXCHG_DOUBLE_CPU_FAIL,/* Failure of this_cpu_cmpxchg_double */ 37 CMPXCHG_DOUBLE_CPU_FAIL,/* Failure of this_cpu_cmpxchg_double */
38 CMPXCHG_DOUBLE_FAIL, /* Number of times that cmpxchg double did not match */
36 NR_SLUB_STAT_ITEMS }; 39 NR_SLUB_STAT_ITEMS };
37 40
38struct kmem_cache_cpu { 41struct kmem_cache_cpu {
@@ -113,16 +116,6 @@ struct kmem_cache {
113 116
114#define KMALLOC_SHIFT_LOW ilog2(KMALLOC_MIN_SIZE) 117#define KMALLOC_SHIFT_LOW ilog2(KMALLOC_MIN_SIZE)
115 118
116#ifdef ARCH_DMA_MINALIGN
117#define ARCH_KMALLOC_MINALIGN ARCH_DMA_MINALIGN
118#else
119#define ARCH_KMALLOC_MINALIGN __alignof__(unsigned long long)
120#endif
121
122#ifndef ARCH_SLAB_MINALIGN
123#define ARCH_SLAB_MINALIGN __alignof__(unsigned long long)
124#endif
125
126/* 119/*
127 * Maximum kmalloc object size handled by SLUB. Larger object allocations 120 * Maximum kmalloc object size handled by SLUB. Larger object allocations
128 * are passed through to the page allocator. The page allocator "fastpath" 121 * are passed through to the page allocator. The page allocator "fastpath"
@@ -228,6 +221,19 @@ kmalloc_order(size_t size, gfp_t flags, unsigned int order)
228 return ret; 221 return ret;
229} 222}
230 223
224/**
225 * Calling this on allocated memory will check that the memory
226 * is expected to be in use, and print warnings if not.
227 */
228#ifdef CONFIG_SLUB_DEBUG
229extern bool verify_mem_not_deleted(const void *x);
230#else
231static inline bool verify_mem_not_deleted(const void *x)
232{
233 return true;
234}
235#endif
236
231#ifdef CONFIG_TRACING 237#ifdef CONFIG_TRACING
232extern void * 238extern void *
233kmem_cache_alloc_trace(struct kmem_cache *s, gfp_t gfpflags, size_t size); 239kmem_cache_alloc_trace(struct kmem_cache *s, gfp_t gfpflags, size_t size);
diff --git a/include/linux/smp.h b/include/linux/smp.h
index 7ad824d510a2..8cc38d3bab0c 100644
--- a/include/linux/smp.h
+++ b/include/linux/smp.h
@@ -85,12 +85,15 @@ int smp_call_function_any(const struct cpumask *mask,
85 * Generic and arch helpers 85 * Generic and arch helpers
86 */ 86 */
87#ifdef CONFIG_USE_GENERIC_SMP_HELPERS 87#ifdef CONFIG_USE_GENERIC_SMP_HELPERS
88void __init call_function_init(void);
88void generic_smp_call_function_single_interrupt(void); 89void generic_smp_call_function_single_interrupt(void);
89void generic_smp_call_function_interrupt(void); 90void generic_smp_call_function_interrupt(void);
90void ipi_call_lock(void); 91void ipi_call_lock(void);
91void ipi_call_unlock(void); 92void ipi_call_unlock(void);
92void ipi_call_lock_irq(void); 93void ipi_call_lock_irq(void);
93void ipi_call_unlock_irq(void); 94void ipi_call_unlock_irq(void);
95#else
96static inline void call_function_init(void) { }
94#endif 97#endif
95 98
96/* 99/*
@@ -134,7 +137,7 @@ static inline void smp_send_reschedule(int cpu) { }
134#define smp_prepare_boot_cpu() do {} while (0) 137#define smp_prepare_boot_cpu() do {} while (0)
135#define smp_call_function_many(mask, func, info, wait) \ 138#define smp_call_function_many(mask, func, info, wait) \
136 (up_smp_call_function(func, info)) 139 (up_smp_call_function(func, info))
137static inline void init_call_single_data(void) { } 140static inline void call_function_init(void) { }
138 141
139static inline int 142static inline int
140smp_call_function_any(const struct cpumask *mask, smp_call_func_t func, 143smp_call_function_any(const struct cpumask *mask, smp_call_func_t func,
diff --git a/include/linux/socket.h b/include/linux/socket.h
index 4ef98e422fde..e17f82266639 100644
--- a/include/linux/socket.h
+++ b/include/linux/socket.h
@@ -192,7 +192,8 @@ struct ucred {
192#define AF_IEEE802154 36 /* IEEE802154 sockets */ 192#define AF_IEEE802154 36 /* IEEE802154 sockets */
193#define AF_CAIF 37 /* CAIF sockets */ 193#define AF_CAIF 37 /* CAIF sockets */
194#define AF_ALG 38 /* Algorithm sockets */ 194#define AF_ALG 38 /* Algorithm sockets */
195#define AF_MAX 39 /* For now.. */ 195#define AF_NFC 39 /* NFC sockets */
196#define AF_MAX 40 /* For now.. */
196 197
197/* Protocol families, same as address families. */ 198/* Protocol families, same as address families. */
198#define PF_UNSPEC AF_UNSPEC 199#define PF_UNSPEC AF_UNSPEC
@@ -234,6 +235,7 @@ struct ucred {
234#define PF_IEEE802154 AF_IEEE802154 235#define PF_IEEE802154 AF_IEEE802154
235#define PF_CAIF AF_CAIF 236#define PF_CAIF AF_CAIF
236#define PF_ALG AF_ALG 237#define PF_ALG AF_ALG
238#define PF_NFC AF_NFC
237#define PF_MAX AF_MAX 239#define PF_MAX AF_MAX
238 240
239/* Maximum queue length specifiable by listen. */ 241/* Maximum queue length specifiable by listen. */
diff --git a/include/linux/sonet.h b/include/linux/sonet.h
index 67ad11fcf88b..de8832dd272b 100644
--- a/include/linux/sonet.h
+++ b/include/linux/sonet.h
@@ -58,7 +58,7 @@ struct sonet_stats {
58 58
59#ifdef __KERNEL__ 59#ifdef __KERNEL__
60 60
61#include <asm/atomic.h> 61#include <linux/atomic.h>
62 62
63struct k_sonet_stats { 63struct k_sonet_stats {
64#define __HANDLE_ITEM(i) atomic_t i 64#define __HANDLE_ITEM(i) atomic_t i
diff --git a/include/linux/spi/74x164.h b/include/linux/spi/74x164.h
index d85c52f294a0..0aa6acc73317 100644
--- a/include/linux/spi/74x164.h
+++ b/include/linux/spi/74x164.h
@@ -1,8 +1,6 @@
1#ifndef LINUX_SPI_74X164_H 1#ifndef LINUX_SPI_74X164_H
2#define LINUX_SPI_74X164_H 2#define LINUX_SPI_74X164_H
3 3
4#define GEN_74X164_DRIVER_NAME "74x164"
5
6struct gen_74x164_chip_platform_data { 4struct gen_74x164_chip_platform_data {
7 /* number assigned to the first GPIO */ 5 /* number assigned to the first GPIO */
8 unsigned base; 6 unsigned base;
diff --git a/include/linux/spi/mcp23s08.h b/include/linux/spi/mcp23s08.h
index c42cff8ca191..2d676d5aaa89 100644
--- a/include/linux/spi/mcp23s08.h
+++ b/include/linux/spi/mcp23s08.h
@@ -22,13 +22,4 @@ struct mcp23s08_platform_data {
22 * base to base+15 (or base+31 for s17 variant). 22 * base to base+15 (or base+31 for s17 variant).
23 */ 23 */
24 unsigned base; 24 unsigned base;
25
26 void *context; /* param to setup/teardown */
27
28 int (*setup)(struct spi_device *spi,
29 int gpio, unsigned ngpio,
30 void *context);
31 int (*teardown)(struct spi_device *spi,
32 int gpio, unsigned ngpio,
33 void *context);
34}; 25};
diff --git a/include/linux/spinlock.h b/include/linux/spinlock.h
index 0b22d51258e6..7df6c17b0281 100644
--- a/include/linux/spinlock.h
+++ b/include/linux/spinlock.h
@@ -384,7 +384,7 @@ static inline void assert_spin_locked(spinlock_t *lock)
384 * Pull the atomic_t declaration: 384 * Pull the atomic_t declaration:
385 * (asm-mips/atomic.h needs above definitions) 385 * (asm-mips/atomic.h needs above definitions)
386 */ 386 */
387#include <asm/atomic.h> 387#include <linux/atomic.h>
388/** 388/**
389 * atomic_dec_and_lock - lock on reaching reference count zero 389 * atomic_dec_and_lock - lock on reaching reference count zero
390 * @atomic: the atomic counter 390 * @atomic: the atomic counter
diff --git a/include/linux/splice.h b/include/linux/splice.h
index 997c3b4c212b..26e5b613deda 100644
--- a/include/linux/splice.h
+++ b/include/linux/splice.h
@@ -88,5 +88,7 @@ extern ssize_t splice_direct_to_actor(struct file *, struct splice_desc *,
88extern int splice_grow_spd(struct pipe_inode_info *, struct splice_pipe_desc *); 88extern int splice_grow_spd(struct pipe_inode_info *, struct splice_pipe_desc *);
89extern void splice_shrink_spd(struct pipe_inode_info *, 89extern void splice_shrink_spd(struct pipe_inode_info *,
90 struct splice_pipe_desc *); 90 struct splice_pipe_desc *);
91extern void spd_release_page(struct splice_pipe_desc *, unsigned int);
91 92
93extern const struct pipe_buf_operations page_cache_pipe_buf_ops;
92#endif 94#endif
diff --git a/include/linux/ssb/ssb.h b/include/linux/ssb/ssb.h
index 252e44821787..8623217f84d0 100644
--- a/include/linux/ssb/ssb.h
+++ b/include/linux/ssb/ssb.h
@@ -27,6 +27,8 @@ struct ssb_sprom {
27 u8 et1mdcport; /* MDIO for enet1 */ 27 u8 et1mdcport; /* MDIO for enet1 */
28 u8 board_rev; /* Board revision number from SPROM. */ 28 u8 board_rev; /* Board revision number from SPROM. */
29 u8 country_code; /* Country Code */ 29 u8 country_code; /* Country Code */
30 u16 leddc_on_time; /* LED Powersave Duty Cycle On Count */
31 u16 leddc_off_time; /* LED Powersave Duty Cycle Off Count */
30 u8 ant_available_a; /* 2GHz antenna available bits (up to 4) */ 32 u8 ant_available_a; /* 2GHz antenna available bits (up to 4) */
31 u8 ant_available_bg; /* 5GHz antenna available bits (up to 4) */ 33 u8 ant_available_bg; /* 5GHz antenna available bits (up to 4) */
32 u16 pa0b0; 34 u16 pa0b0;
@@ -99,7 +101,7 @@ struct ssb_sprom {
99struct ssb_boardinfo { 101struct ssb_boardinfo {
100 u16 vendor; 102 u16 vendor;
101 u16 type; 103 u16 type;
102 u16 rev; 104 u8 rev;
103}; 105};
104 106
105 107
diff --git a/include/linux/ssb/ssb_driver_chipcommon.h b/include/linux/ssb/ssb_driver_chipcommon.h
index a08d693d8324..1a6b0045b06b 100644
--- a/include/linux/ssb/ssb_driver_chipcommon.h
+++ b/include/linux/ssb/ssb_driver_chipcommon.h
@@ -8,7 +8,7 @@
8 * gpio interface, extbus, and support for serial and parallel flashes. 8 * gpio interface, extbus, and support for serial and parallel flashes.
9 * 9 *
10 * Copyright 2005, Broadcom Corporation 10 * Copyright 2005, Broadcom Corporation
11 * Copyright 2006, Michael Buesch <mb@bu3sch.de> 11 * Copyright 2006, Michael Buesch <m@bues.ch>
12 * 12 *
13 * Licensed under the GPL version 2. See COPYING for details. 13 * Licensed under the GPL version 2. See COPYING for details.
14 */ 14 */
diff --git a/include/linux/stacktrace.h b/include/linux/stacktrace.h
index 25310f1d7f37..115b570e3bff 100644
--- a/include/linux/stacktrace.h
+++ b/include/linux/stacktrace.h
@@ -14,8 +14,8 @@ struct stack_trace {
14}; 14};
15 15
16extern void save_stack_trace(struct stack_trace *trace); 16extern void save_stack_trace(struct stack_trace *trace);
17extern void save_stack_trace_regs(struct stack_trace *trace, 17extern void save_stack_trace_regs(struct pt_regs *regs,
18 struct pt_regs *regs); 18 struct stack_trace *trace);
19extern void save_stack_trace_tsk(struct task_struct *tsk, 19extern void save_stack_trace_tsk(struct task_struct *tsk,
20 struct stack_trace *trace); 20 struct stack_trace *trace);
21 21
diff --git a/include/linux/stmmac.h b/include/linux/stmmac.h
index 9529e49b0385..0dddc9e42b6b 100644
--- a/include/linux/stmmac.h
+++ b/include/linux/stmmac.h
@@ -28,11 +28,21 @@
28 28
29#include <linux/platform_device.h> 29#include <linux/platform_device.h>
30 30
31/* platform data for platform device structure's platform_data field */ 31/* Platfrom data for platform device structure's platform_data field */
32
33struct stmmac_mdio_bus_data {
34 int bus_id;
35 int (*phy_reset)(void *priv);
36 unsigned int phy_mask;
37 int *irqs;
38 int probed_phy_irq;
39};
32 40
33/* Private data for the STM on-board ethernet driver */
34struct plat_stmmacenet_data { 41struct plat_stmmacenet_data {
35 int bus_id; 42 int bus_id;
43 int phy_addr;
44 int interface;
45 struct stmmac_mdio_bus_data *mdio_bus_data;
36 int pbl; 46 int pbl;
37 int clk_csr; 47 int clk_csr;
38 int has_gmac; 48 int has_gmac;
@@ -40,6 +50,7 @@ struct plat_stmmacenet_data {
40 int tx_coe; 50 int tx_coe;
41 int bugged_jumbo; 51 int bugged_jumbo;
42 int pmt; 52 int pmt;
53 int force_sf_dma_mode;
43 void (*fix_mac_speed)(void *priv, unsigned int speed); 54 void (*fix_mac_speed)(void *priv, unsigned int speed);
44 void (*bus_setup)(void __iomem *ioaddr); 55 void (*bus_setup)(void __iomem *ioaddr);
45 int (*init)(struct platform_device *pdev); 56 int (*init)(struct platform_device *pdev);
@@ -47,14 +58,4 @@ struct plat_stmmacenet_data {
47 void *custom_cfg; 58 void *custom_cfg;
48 void *bsp_priv; 59 void *bsp_priv;
49}; 60};
50
51struct plat_stmmacphy_data {
52 int bus_id;
53 int phy_addr;
54 unsigned int phy_mask;
55 int interface;
56 int (*phy_reset)(void *priv);
57 void *priv;
58};
59#endif 61#endif
60
diff --git a/include/linux/stop_machine.h b/include/linux/stop_machine.h
index 092dc9b1ce7d..2d04ea916760 100644
--- a/include/linux/stop_machine.h
+++ b/include/linux/stop_machine.h
@@ -94,7 +94,7 @@ static inline int try_stop_cpus(const struct cpumask *cpumask,
94 * stop_machine "Bogolock": stop the entire machine, disable 94 * stop_machine "Bogolock": stop the entire machine, disable
95 * interrupts. This is a very heavy lock, which is equivalent to 95 * interrupts. This is a very heavy lock, which is equivalent to
96 * grabbing every spinlock (and more). So the "read" side to such a 96 * grabbing every spinlock (and more). So the "read" side to such a
97 * lock is anything which disables preeempt. 97 * lock is anything which disables preemption.
98 */ 98 */
99#if defined(CONFIG_STOP_MACHINE) && defined(CONFIG_SMP) 99#if defined(CONFIG_STOP_MACHINE) && defined(CONFIG_SMP)
100 100
@@ -124,15 +124,19 @@ int stop_machine(int (*fn)(void *), void *data, const struct cpumask *cpus);
124 */ 124 */
125int __stop_machine(int (*fn)(void *), void *data, const struct cpumask *cpus); 125int __stop_machine(int (*fn)(void *), void *data, const struct cpumask *cpus);
126 126
127int stop_machine_from_inactive_cpu(int (*fn)(void *), void *data,
128 const struct cpumask *cpus);
129
127#else /* CONFIG_STOP_MACHINE && CONFIG_SMP */ 130#else /* CONFIG_STOP_MACHINE && CONFIG_SMP */
128 131
129static inline int __stop_machine(int (*fn)(void *), void *data, 132static inline int __stop_machine(int (*fn)(void *), void *data,
130 const struct cpumask *cpus) 133 const struct cpumask *cpus)
131{ 134{
135 unsigned long flags;
132 int ret; 136 int ret;
133 local_irq_disable(); 137 local_irq_save(flags);
134 ret = fn(data); 138 ret = fn(data);
135 local_irq_enable(); 139 local_irq_restore(flags);
136 return ret; 140 return ret;
137} 141}
138 142
@@ -142,5 +146,11 @@ static inline int stop_machine(int (*fn)(void *), void *data,
142 return __stop_machine(fn, data, cpus); 146 return __stop_machine(fn, data, cpus);
143} 147}
144 148
149static inline int stop_machine_from_inactive_cpu(int (*fn)(void *), void *data,
150 const struct cpumask *cpus)
151{
152 return __stop_machine(fn, data, cpus);
153}
154
145#endif /* CONFIG_STOP_MACHINE && CONFIG_SMP */ 155#endif /* CONFIG_STOP_MACHINE && CONFIG_SMP */
146#endif /* _LINUX_STOP_MACHINE */ 156#endif /* _LINUX_STOP_MACHINE */
diff --git a/include/linux/sunrpc/auth.h b/include/linux/sunrpc/auth.h
index 8521067ed4f7..febc4dbec2ca 100644
--- a/include/linux/sunrpc/auth.h
+++ b/include/linux/sunrpc/auth.h
@@ -15,7 +15,7 @@
15#include <linux/sunrpc/msg_prot.h> 15#include <linux/sunrpc/msg_prot.h>
16#include <linux/sunrpc/xdr.h> 16#include <linux/sunrpc/xdr.h>
17 17
18#include <asm/atomic.h> 18#include <linux/atomic.h>
19#include <linux/rcupdate.h> 19#include <linux/rcupdate.h>
20 20
21/* size of the nodename buffer */ 21/* size of the nodename buffer */
diff --git a/include/linux/sunrpc/bc_xprt.h b/include/linux/sunrpc/bc_xprt.h
index 082884295f80..f7f3ce340c08 100644
--- a/include/linux/sunrpc/bc_xprt.h
+++ b/include/linux/sunrpc/bc_xprt.h
@@ -31,7 +31,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31#include <linux/sunrpc/xprt.h> 31#include <linux/sunrpc/xprt.h>
32#include <linux/sunrpc/sched.h> 32#include <linux/sunrpc/sched.h>
33 33
34#ifdef CONFIG_NFS_V4_1 34#ifdef CONFIG_SUNRPC_BACKCHANNEL
35struct rpc_rqst *xprt_alloc_bc_request(struct rpc_xprt *xprt); 35struct rpc_rqst *xprt_alloc_bc_request(struct rpc_xprt *xprt);
36void xprt_free_bc_request(struct rpc_rqst *req); 36void xprt_free_bc_request(struct rpc_rqst *req);
37int xprt_setup_backchannel(struct rpc_xprt *, unsigned int min_reqs); 37int xprt_setup_backchannel(struct rpc_xprt *, unsigned int min_reqs);
@@ -47,7 +47,7 @@ static inline int svc_is_backchannel(const struct svc_rqst *rqstp)
47 return 1; 47 return 1;
48 return 0; 48 return 0;
49} 49}
50#else /* CONFIG_NFS_V4_1 */ 50#else /* CONFIG_SUNRPC_BACKCHANNEL */
51static inline int xprt_setup_backchannel(struct rpc_xprt *xprt, 51static inline int xprt_setup_backchannel(struct rpc_xprt *xprt,
52 unsigned int min_reqs) 52 unsigned int min_reqs)
53{ 53{
@@ -62,6 +62,6 @@ static inline int svc_is_backchannel(const struct svc_rqst *rqstp)
62static inline void xprt_free_bc_request(struct rpc_rqst *req) 62static inline void xprt_free_bc_request(struct rpc_rqst *req)
63{ 63{
64} 64}
65#endif /* CONFIG_NFS_V4_1 */ 65#endif /* CONFIG_SUNRPC_BACKCHANNEL */
66#endif /* _LINUX_SUNRPC_BC_XPRT_H */ 66#endif /* _LINUX_SUNRPC_BC_XPRT_H */
67 67
diff --git a/include/linux/sunrpc/cache.h b/include/linux/sunrpc/cache.h
index 8d2eef1a8582..5efd8cef389e 100644
--- a/include/linux/sunrpc/cache.h
+++ b/include/linux/sunrpc/cache.h
@@ -15,7 +15,7 @@
15 15
16#include <linux/kref.h> 16#include <linux/kref.h>
17#include <linux/slab.h> 17#include <linux/slab.h>
18#include <asm/atomic.h> 18#include <linux/atomic.h>
19#include <linux/proc_fs.h> 19#include <linux/proc_fs.h>
20 20
21/* 21/*
@@ -256,13 +256,4 @@ static inline time_t get_expiry(char **bpp)
256 return rv - boot.tv_sec; 256 return rv - boot.tv_sec;
257} 257}
258 258
259#ifdef CONFIG_NFSD_DEPRECATED
260static inline void sunrpc_invalidate(struct cache_head *h,
261 struct cache_detail *detail)
262{
263 h->expiry_time = seconds_since_boot() - 1;
264 detail->nextcheck = seconds_since_boot();
265}
266#endif /* CONFIG_NFSD_DEPRECATED */
267
268#endif /* _LINUX_SUNRPC_CACHE_H_ */ 259#endif /* _LINUX_SUNRPC_CACHE_H_ */
diff --git a/include/linux/sunrpc/gss_krb5_enctypes.h b/include/linux/sunrpc/gss_krb5_enctypes.h
new file mode 100644
index 000000000000..ec6234eee89c
--- /dev/null
+++ b/include/linux/sunrpc/gss_krb5_enctypes.h
@@ -0,0 +1,4 @@
1/*
2 * Dumb way to share this static piece of information with nfsd
3 */
4#define KRB5_SUPPORTED_ENCTYPES "18,17,16,23,3,1,2"
diff --git a/include/linux/sunrpc/sched.h b/include/linux/sunrpc/sched.h
index f73c482ec9c6..e7756896f3ca 100644
--- a/include/linux/sunrpc/sched.h
+++ b/include/linux/sunrpc/sched.h
@@ -84,7 +84,8 @@ struct rpc_task {
84#endif 84#endif
85 unsigned char tk_priority : 2,/* Task priority */ 85 unsigned char tk_priority : 2,/* Task priority */
86 tk_garb_retry : 2, 86 tk_garb_retry : 2,
87 tk_cred_retry : 2; 87 tk_cred_retry : 2,
88 tk_rebind_retry : 2;
88}; 89};
89#define tk_xprt tk_client->cl_xprt 90#define tk_xprt tk_client->cl_xprt
90 91
@@ -226,6 +227,10 @@ void rpc_init_wait_queue(struct rpc_wait_queue *, const char *);
226void rpc_destroy_wait_queue(struct rpc_wait_queue *); 227void rpc_destroy_wait_queue(struct rpc_wait_queue *);
227void rpc_sleep_on(struct rpc_wait_queue *, struct rpc_task *, 228void rpc_sleep_on(struct rpc_wait_queue *, struct rpc_task *,
228 rpc_action action); 229 rpc_action action);
230void rpc_sleep_on_priority(struct rpc_wait_queue *,
231 struct rpc_task *,
232 rpc_action action,
233 int priority);
229void rpc_wake_up_queued_task(struct rpc_wait_queue *, 234void rpc_wake_up_queued_task(struct rpc_wait_queue *,
230 struct rpc_task *); 235 struct rpc_task *);
231void rpc_wake_up(struct rpc_wait_queue *); 236void rpc_wake_up(struct rpc_wait_queue *);
diff --git a/include/linux/sunrpc/svc.h b/include/linux/sunrpc/svc.h
index ea29330b78bd..223588a976a0 100644
--- a/include/linux/sunrpc/svc.h
+++ b/include/linux/sunrpc/svc.h
@@ -92,7 +92,7 @@ struct svc_serv {
92 struct module * sv_module; /* optional module to count when 92 struct module * sv_module; /* optional module to count when
93 * adding threads */ 93 * adding threads */
94 svc_thread_fn sv_function; /* main function for threads */ 94 svc_thread_fn sv_function; /* main function for threads */
95#if defined(CONFIG_NFS_V4_1) 95#if defined(CONFIG_SUNRPC_BACKCHANNEL)
96 struct list_head sv_cb_list; /* queue for callback requests 96 struct list_head sv_cb_list; /* queue for callback requests
97 * that arrive over the same 97 * that arrive over the same
98 * connection */ 98 * connection */
@@ -100,7 +100,7 @@ struct svc_serv {
100 wait_queue_head_t sv_cb_waitq; /* sleep here if there are no 100 wait_queue_head_t sv_cb_waitq; /* sleep here if there are no
101 * entries in the svc_cb_list */ 101 * entries in the svc_cb_list */
102 struct svc_xprt *sv_bc_xprt; /* callback on fore channel */ 102 struct svc_xprt *sv_bc_xprt; /* callback on fore channel */
103#endif /* CONFIG_NFS_V4_1 */ 103#endif /* CONFIG_SUNRPC_BACKCHANNEL */
104}; 104};
105 105
106/* 106/*
@@ -273,6 +273,7 @@ struct svc_rqst {
273 /* Catering to nfsd */ 273 /* Catering to nfsd */
274 struct auth_domain * rq_client; /* RPC peer info */ 274 struct auth_domain * rq_client; /* RPC peer info */
275 struct auth_domain * rq_gssclient; /* "gss/"-style peer info */ 275 struct auth_domain * rq_gssclient; /* "gss/"-style peer info */
276 int rq_cachetype;
276 struct svc_cacherep * rq_cacherep; /* cache info */ 277 struct svc_cacherep * rq_cacherep; /* cache info */
277 int rq_splice_ok; /* turned off in gss privacy 278 int rq_splice_ok; /* turned off in gss privacy
278 * to prevent encrypting page 279 * to prevent encrypting page
diff --git a/include/linux/sunrpc/timer.h b/include/linux/sunrpc/timer.h
index a67fd734c73b..697d6e69d61f 100644
--- a/include/linux/sunrpc/timer.h
+++ b/include/linux/sunrpc/timer.h
@@ -9,7 +9,7 @@
9#ifndef _LINUX_SUNRPC_TIMER_H 9#ifndef _LINUX_SUNRPC_TIMER_H
10#define _LINUX_SUNRPC_TIMER_H 10#define _LINUX_SUNRPC_TIMER_H
11 11
12#include <asm/atomic.h> 12#include <linux/atomic.h>
13 13
14struct rpc_rtt { 14struct rpc_rtt {
15 unsigned long timeo; /* default timeout value */ 15 unsigned long timeo; /* default timeout value */
diff --git a/include/linux/sunrpc/xprt.h b/include/linux/sunrpc/xprt.h
index 81cce3b3ee66..15518a152ac3 100644
--- a/include/linux/sunrpc/xprt.h
+++ b/include/linux/sunrpc/xprt.h
@@ -22,6 +22,7 @@
22#define RPC_MIN_SLOT_TABLE (2U) 22#define RPC_MIN_SLOT_TABLE (2U)
23#define RPC_DEF_SLOT_TABLE (16U) 23#define RPC_DEF_SLOT_TABLE (16U)
24#define RPC_MAX_SLOT_TABLE (128U) 24#define RPC_MAX_SLOT_TABLE (128U)
25#define RPC_MAX_SLOT_TABLE_LIMIT (65536U)
25 26
26/* 27/*
27 * This describes a timeout strategy 28 * This describes a timeout strategy
@@ -100,18 +101,18 @@ struct rpc_rqst {
100 ktime_t rq_xtime; /* transmit time stamp */ 101 ktime_t rq_xtime; /* transmit time stamp */
101 int rq_ntrans; 102 int rq_ntrans;
102 103
103#if defined(CONFIG_NFS_V4_1) 104#if defined(CONFIG_SUNRPC_BACKCHANNEL)
104 struct list_head rq_bc_list; /* Callback service list */ 105 struct list_head rq_bc_list; /* Callback service list */
105 unsigned long rq_bc_pa_state; /* Backchannel prealloc state */ 106 unsigned long rq_bc_pa_state; /* Backchannel prealloc state */
106 struct list_head rq_bc_pa_list; /* Backchannel prealloc list */ 107 struct list_head rq_bc_pa_list; /* Backchannel prealloc list */
107#endif /* CONFIG_NFS_V4_1 */ 108#endif /* CONFIG_SUNRPC_BACKCHANEL */
108}; 109};
109#define rq_svec rq_snd_buf.head 110#define rq_svec rq_snd_buf.head
110#define rq_slen rq_snd_buf.len 111#define rq_slen rq_snd_buf.len
111 112
112struct rpc_xprt_ops { 113struct rpc_xprt_ops {
113 void (*set_buffer_size)(struct rpc_xprt *xprt, size_t sndsize, size_t rcvsize); 114 void (*set_buffer_size)(struct rpc_xprt *xprt, size_t sndsize, size_t rcvsize);
114 int (*reserve_xprt)(struct rpc_task *task); 115 int (*reserve_xprt)(struct rpc_xprt *xprt, struct rpc_task *task);
115 void (*release_xprt)(struct rpc_xprt *xprt, struct rpc_task *task); 116 void (*release_xprt)(struct rpc_xprt *xprt, struct rpc_task *task);
116 void (*rpcbind)(struct rpc_task *task); 117 void (*rpcbind)(struct rpc_task *task);
117 void (*set_port)(struct rpc_xprt *xprt, unsigned short port); 118 void (*set_port)(struct rpc_xprt *xprt, unsigned short port);
@@ -164,12 +165,12 @@ struct rpc_xprt {
164 165
165 struct rpc_wait_queue binding; /* requests waiting on rpcbind */ 166 struct rpc_wait_queue binding; /* requests waiting on rpcbind */
166 struct rpc_wait_queue sending; /* requests waiting to send */ 167 struct rpc_wait_queue sending; /* requests waiting to send */
167 struct rpc_wait_queue resend; /* requests waiting to resend */
168 struct rpc_wait_queue pending; /* requests in flight */ 168 struct rpc_wait_queue pending; /* requests in flight */
169 struct rpc_wait_queue backlog; /* waiting for slot */ 169 struct rpc_wait_queue backlog; /* waiting for slot */
170 struct list_head free; /* free slots */ 170 struct list_head free; /* free slots */
171 struct rpc_rqst * slot; /* slot table storage */ 171 unsigned int max_reqs; /* max number of slots */
172 unsigned int max_reqs; /* total slots */ 172 unsigned int min_reqs; /* min number of slots */
173 atomic_t num_reqs; /* total slots */
173 unsigned long state; /* transport state */ 174 unsigned long state; /* transport state */
174 unsigned char shutdown : 1, /* being shut down */ 175 unsigned char shutdown : 1, /* being shut down */
175 resvport : 1; /* use a reserved port */ 176 resvport : 1; /* use a reserved port */
@@ -200,7 +201,7 @@ struct rpc_xprt {
200 u32 xid; /* Next XID value to use */ 201 u32 xid; /* Next XID value to use */
201 struct rpc_task * snd_task; /* Task blocked in send */ 202 struct rpc_task * snd_task; /* Task blocked in send */
202 struct svc_xprt *bc_xprt; /* NFSv4.1 backchannel */ 203 struct svc_xprt *bc_xprt; /* NFSv4.1 backchannel */
203#if defined(CONFIG_NFS_V4_1) 204#if defined(CONFIG_SUNRPC_BACKCHANNEL)
204 struct svc_serv *bc_serv; /* The RPC service which will */ 205 struct svc_serv *bc_serv; /* The RPC service which will */
205 /* process the callback */ 206 /* process the callback */
206 unsigned int bc_alloc_count; /* Total number of preallocs */ 207 unsigned int bc_alloc_count; /* Total number of preallocs */
@@ -208,7 +209,7 @@ struct rpc_xprt {
208 * items */ 209 * items */
209 struct list_head bc_pa_list; /* List of preallocated 210 struct list_head bc_pa_list; /* List of preallocated
210 * backchannel rpc_rqst's */ 211 * backchannel rpc_rqst's */
211#endif /* CONFIG_NFS_V4_1 */ 212#endif /* CONFIG_SUNRPC_BACKCHANNEL */
212 struct list_head recv; 213 struct list_head recv;
213 214
214 struct { 215 struct {
@@ -228,15 +229,15 @@ struct rpc_xprt {
228 const char *address_strings[RPC_DISPLAY_MAX]; 229 const char *address_strings[RPC_DISPLAY_MAX];
229}; 230};
230 231
231#if defined(CONFIG_NFS_V4_1) 232#if defined(CONFIG_SUNRPC_BACKCHANNEL)
232/* 233/*
233 * Backchannel flags 234 * Backchannel flags
234 */ 235 */
235#define RPC_BC_PA_IN_USE 0x0001 /* Preallocated backchannel */ 236#define RPC_BC_PA_IN_USE 0x0001 /* Preallocated backchannel */
236 /* buffer in use */ 237 /* buffer in use */
237#endif /* CONFIG_NFS_V4_1 */ 238#endif /* CONFIG_SUNRPC_BACKCHANNEL */
238 239
239#if defined(CONFIG_NFS_V4_1) 240#if defined(CONFIG_SUNRPC_BACKCHANNEL)
240static inline int bc_prealloc(struct rpc_rqst *req) 241static inline int bc_prealloc(struct rpc_rqst *req)
241{ 242{
242 return test_bit(RPC_BC_PA_IN_USE, &req->rq_bc_pa_state); 243 return test_bit(RPC_BC_PA_IN_USE, &req->rq_bc_pa_state);
@@ -246,7 +247,7 @@ static inline int bc_prealloc(struct rpc_rqst *req)
246{ 247{
247 return 0; 248 return 0;
248} 249}
249#endif /* CONFIG_NFS_V4_1 */ 250#endif /* CONFIG_SUNRPC_BACKCHANNEL */
250 251
251struct xprt_create { 252struct xprt_create {
252 int ident; /* XPRT_TRANSPORT identifier */ 253 int ident; /* XPRT_TRANSPORT identifier */
@@ -271,8 +272,8 @@ struct xprt_class {
271struct rpc_xprt *xprt_create_transport(struct xprt_create *args); 272struct rpc_xprt *xprt_create_transport(struct xprt_create *args);
272void xprt_connect(struct rpc_task *task); 273void xprt_connect(struct rpc_task *task);
273void xprt_reserve(struct rpc_task *task); 274void xprt_reserve(struct rpc_task *task);
274int xprt_reserve_xprt(struct rpc_task *task); 275int xprt_reserve_xprt(struct rpc_xprt *xprt, struct rpc_task *task);
275int xprt_reserve_xprt_cong(struct rpc_task *task); 276int xprt_reserve_xprt_cong(struct rpc_xprt *xprt, struct rpc_task *task);
276int xprt_prepare_transmit(struct rpc_task *task); 277int xprt_prepare_transmit(struct rpc_task *task);
277void xprt_transmit(struct rpc_task *task); 278void xprt_transmit(struct rpc_task *task);
278void xprt_end_transmit(struct rpc_task *task); 279void xprt_end_transmit(struct rpc_task *task);
@@ -282,7 +283,9 @@ void xprt_release_xprt_cong(struct rpc_xprt *xprt, struct rpc_task *task);
282void xprt_release(struct rpc_task *task); 283void xprt_release(struct rpc_task *task);
283struct rpc_xprt * xprt_get(struct rpc_xprt *xprt); 284struct rpc_xprt * xprt_get(struct rpc_xprt *xprt);
284void xprt_put(struct rpc_xprt *xprt); 285void xprt_put(struct rpc_xprt *xprt);
285struct rpc_xprt * xprt_alloc(struct net *net, int size, int max_req); 286struct rpc_xprt * xprt_alloc(struct net *net, size_t size,
287 unsigned int num_prealloc,
288 unsigned int max_req);
286void xprt_free(struct rpc_xprt *); 289void xprt_free(struct rpc_xprt *);
287 290
288static inline __be32 *xprt_skip_transport_header(struct rpc_xprt *xprt, __be32 *p) 291static inline __be32 *xprt_skip_transport_header(struct rpc_xprt *xprt, __be32 *p)
@@ -321,7 +324,6 @@ void xprt_conditional_disconnect(struct rpc_xprt *xprt, unsigned int cookie);
321#define XPRT_CLOSING (6) 324#define XPRT_CLOSING (6)
322#define XPRT_CONNECTION_ABORT (7) 325#define XPRT_CONNECTION_ABORT (7)
323#define XPRT_CONNECTION_CLOSE (8) 326#define XPRT_CONNECTION_CLOSE (8)
324#define XPRT_INITIALIZED (9)
325 327
326static inline void xprt_set_connected(struct rpc_xprt *xprt) 328static inline void xprt_set_connected(struct rpc_xprt *xprt)
327{ 329{
diff --git a/include/linux/suspend.h b/include/linux/suspend.h
index 083ffea7ba18..6bbcef22e105 100644
--- a/include/linux/suspend.h
+++ b/include/linux/suspend.h
@@ -92,6 +92,13 @@ typedef int __bitwise suspend_state_t;
92 * @enter() and @wake(), even if any of them fails. It is executed after 92 * @enter() and @wake(), even if any of them fails. It is executed after
93 * a failing @prepare. 93 * a failing @prepare.
94 * 94 *
95 * @suspend_again: Returns whether the system should suspend again (true) or
96 * not (false). If the platform wants to poll sensors or execute some
97 * code during suspended without invoking userspace and most of devices,
98 * suspend_again callback is the place assuming that periodic-wakeup or
99 * alarm-wakeup is already setup. This allows to execute some codes while
100 * being kept suspended in the view of userland and devices.
101 *
95 * @end: Called by the PM core right after resuming devices, to indicate to 102 * @end: Called by the PM core right after resuming devices, to indicate to
96 * the platform that the system has returned to the working state or 103 * the platform that the system has returned to the working state or
97 * the transition to the sleep state has been aborted. 104 * the transition to the sleep state has been aborted.
@@ -113,6 +120,7 @@ struct platform_suspend_ops {
113 int (*enter)(suspend_state_t state); 120 int (*enter)(suspend_state_t state);
114 void (*wake)(void); 121 void (*wake)(void);
115 void (*finish)(void); 122 void (*finish)(void);
123 bool (*suspend_again)(void);
116 void (*end)(void); 124 void (*end)(void);
117 void (*recover)(void); 125 void (*recover)(void);
118}; 126};
@@ -260,6 +268,14 @@ static inline int hibernate(void) { return -ENOSYS; }
260static inline bool system_entering_hibernation(void) { return false; } 268static inline bool system_entering_hibernation(void) { return false; }
261#endif /* CONFIG_HIBERNATION */ 269#endif /* CONFIG_HIBERNATION */
262 270
271/* Hibernation and suspend events */
272#define PM_HIBERNATION_PREPARE 0x0001 /* Going to hibernate */
273#define PM_POST_HIBERNATION 0x0002 /* Hibernation finished */
274#define PM_SUSPEND_PREPARE 0x0003 /* Going to suspend the system */
275#define PM_POST_SUSPEND 0x0004 /* Suspend finished */
276#define PM_RESTORE_PREPARE 0x0005 /* Going to restore a saved image */
277#define PM_POST_RESTORE 0x0006 /* Restore failed */
278
263#ifdef CONFIG_PM_SLEEP 279#ifdef CONFIG_PM_SLEEP
264void save_processor_state(void); 280void save_processor_state(void);
265void restore_processor_state(void); 281void restore_processor_state(void);
diff --git a/include/linux/swap.h b/include/linux/swap.h
index 384eb5fe530b..14d62490922e 100644
--- a/include/linux/swap.h
+++ b/include/linux/swap.h
@@ -9,7 +9,7 @@
9#include <linux/sched.h> 9#include <linux/sched.h>
10#include <linux/node.h> 10#include <linux/node.h>
11 11
12#include <asm/atomic.h> 12#include <linux/atomic.h>
13#include <asm/page.h> 13#include <asm/page.h>
14 14
15struct notifier_block; 15struct notifier_block;
@@ -251,14 +251,6 @@ static inline void lru_cache_add_file(struct page *page)
251/* linux/mm/vmscan.c */ 251/* linux/mm/vmscan.c */
252extern unsigned long try_to_free_pages(struct zonelist *zonelist, int order, 252extern unsigned long try_to_free_pages(struct zonelist *zonelist, int order,
253 gfp_t gfp_mask, nodemask_t *mask); 253 gfp_t gfp_mask, nodemask_t *mask);
254extern unsigned long try_to_free_mem_cgroup_pages(struct mem_cgroup *mem,
255 gfp_t gfp_mask, bool noswap,
256 unsigned int swappiness);
257extern unsigned long mem_cgroup_shrink_node_zone(struct mem_cgroup *mem,
258 gfp_t gfp_mask, bool noswap,
259 unsigned int swappiness,
260 struct zone *zone,
261 unsigned long *nr_scanned);
262extern int __isolate_lru_page(struct page *page, int mode, int file); 254extern int __isolate_lru_page(struct page *page, int mode, int file);
263extern unsigned long shrink_all_memory(unsigned long nr_pages); 255extern unsigned long shrink_all_memory(unsigned long nr_pages);
264extern int vm_swappiness; 256extern int vm_swappiness;
@@ -299,17 +291,14 @@ static inline void scan_unevictable_unregister_node(struct node *node)
299 291
300extern int kswapd_run(int nid); 292extern int kswapd_run(int nid);
301extern void kswapd_stop(int nid); 293extern void kswapd_stop(int nid);
302
303#ifdef CONFIG_MMU
304/* linux/mm/shmem.c */
305extern int shmem_unuse(swp_entry_t entry, struct page *page);
306#endif /* CONFIG_MMU */
307
308#ifdef CONFIG_CGROUP_MEM_RES_CTLR 294#ifdef CONFIG_CGROUP_MEM_RES_CTLR
309extern void mem_cgroup_get_shmem_target(struct inode *inode, pgoff_t pgoff, 295extern int mem_cgroup_swappiness(struct mem_cgroup *mem);
310 struct page **pagep, swp_entry_t *ent); 296#else
297static inline int mem_cgroup_swappiness(struct mem_cgroup *mem)
298{
299 return vm_swappiness;
300}
311#endif 301#endif
312
313#ifdef CONFIG_SWAP 302#ifdef CONFIG_SWAP
314/* linux/mm/page_io.c */ 303/* linux/mm/page_io.c */
315extern int swap_readpage(struct page *); 304extern int swap_readpage(struct page *);
@@ -358,6 +347,7 @@ struct backing_dev_info;
358extern struct mm_struct *swap_token_mm; 347extern struct mm_struct *swap_token_mm;
359extern void grab_swap_token(struct mm_struct *); 348extern void grab_swap_token(struct mm_struct *);
360extern void __put_swap_token(struct mm_struct *); 349extern void __put_swap_token(struct mm_struct *);
350extern void disable_swap_token(struct mem_cgroup *memcg);
361 351
362static inline int has_swap_token(struct mm_struct *mm) 352static inline int has_swap_token(struct mm_struct *mm)
363{ 353{
@@ -370,11 +360,6 @@ static inline void put_swap_token(struct mm_struct *mm)
370 __put_swap_token(mm); 360 __put_swap_token(mm);
371} 361}
372 362
373static inline void disable_swap_token(void)
374{
375 put_swap_token(swap_token_mm);
376}
377
378#ifdef CONFIG_CGROUP_MEM_RES_CTLR 363#ifdef CONFIG_CGROUP_MEM_RES_CTLR
379extern void 364extern void
380mem_cgroup_uncharge_swapcache(struct page *page, swp_entry_t ent, bool swapout); 365mem_cgroup_uncharge_swapcache(struct page *page, swp_entry_t ent, bool swapout);
@@ -500,7 +485,7 @@ static inline int has_swap_token(struct mm_struct *mm)
500 return 0; 485 return 0;
501} 486}
502 487
503static inline void disable_swap_token(void) 488static inline void disable_swap_token(struct mem_cgroup *memcg)
504{ 489{
505} 490}
506 491
diff --git a/include/linux/swapops.h b/include/linux/swapops.h
index cd42e30b7c6e..2189d3ffc85d 100644
--- a/include/linux/swapops.h
+++ b/include/linux/swapops.h
@@ -1,3 +1,8 @@
1#ifndef _LINUX_SWAPOPS_H
2#define _LINUX_SWAPOPS_H
3
4#include <linux/radix-tree.h>
5
1/* 6/*
2 * swapcache pages are stored in the swapper_space radix tree. We want to 7 * swapcache pages are stored in the swapper_space radix tree. We want to
3 * get good packing density in that tree, so the index should be dense in 8 * get good packing density in that tree, so the index should be dense in
@@ -76,6 +81,22 @@ static inline pte_t swp_entry_to_pte(swp_entry_t entry)
76 return __swp_entry_to_pte(arch_entry); 81 return __swp_entry_to_pte(arch_entry);
77} 82}
78 83
84static inline swp_entry_t radix_to_swp_entry(void *arg)
85{
86 swp_entry_t entry;
87
88 entry.val = (unsigned long)arg >> RADIX_TREE_EXCEPTIONAL_SHIFT;
89 return entry;
90}
91
92static inline void *swp_to_radix_entry(swp_entry_t entry)
93{
94 unsigned long value;
95
96 value = entry.val << RADIX_TREE_EXCEPTIONAL_SHIFT;
97 return (void *)(value | RADIX_TREE_EXCEPTIONAL_ENTRY);
98}
99
79#ifdef CONFIG_MIGRATION 100#ifdef CONFIG_MIGRATION
80static inline swp_entry_t make_migration_entry(struct page *page, int write) 101static inline swp_entry_t make_migration_entry(struct page *page, int write)
81{ 102{
@@ -169,3 +190,5 @@ static inline int non_swap_entry(swp_entry_t entry)
169 return 0; 190 return 0;
170} 191}
171#endif 192#endif
193
194#endif /* _LINUX_SWAPOPS_H */
diff --git a/include/linux/swiotlb.h b/include/linux/swiotlb.h
index 8c0e349f4a6c..445702c60d04 100644
--- a/include/linux/swiotlb.h
+++ b/include/linux/swiotlb.h
@@ -24,6 +24,7 @@ extern int swiotlb_force;
24 24
25extern void swiotlb_init(int verbose); 25extern void swiotlb_init(int verbose);
26extern void swiotlb_init_with_tbl(char *tlb, unsigned long nslabs, int verbose); 26extern void swiotlb_init_with_tbl(char *tlb, unsigned long nslabs, int verbose);
27extern unsigned long swioltb_nr_tbl(void);
27 28
28/* 29/*
29 * Enumeration for sync targets 30 * Enumeration for sync targets
diff --git a/include/linux/sysfs.h b/include/linux/sysfs.h
index c3acda60eee0..d7d2f2158142 100644
--- a/include/linux/sysfs.h
+++ b/include/linux/sysfs.h
@@ -17,7 +17,7 @@
17#include <linux/list.h> 17#include <linux/list.h>
18#include <linux/lockdep.h> 18#include <linux/lockdep.h>
19#include <linux/kobject_ns.h> 19#include <linux/kobject_ns.h>
20#include <asm/atomic.h> 20#include <linux/atomic.h>
21 21
22struct kobject; 22struct kobject;
23struct module; 23struct module;
@@ -177,9 +177,6 @@ struct sysfs_dirent *sysfs_get_dirent(struct sysfs_dirent *parent_sd,
177struct sysfs_dirent *sysfs_get(struct sysfs_dirent *sd); 177struct sysfs_dirent *sysfs_get(struct sysfs_dirent *sd);
178void sysfs_put(struct sysfs_dirent *sd); 178void sysfs_put(struct sysfs_dirent *sd);
179 179
180/* Called to clear a ns tag when it is no longer valid */
181void sysfs_exit_ns(enum kobj_ns_type type, const void *tag);
182
183int __must_check sysfs_init(void); 180int __must_check sysfs_init(void);
184 181
185#else /* CONFIG_SYSFS */ 182#else /* CONFIG_SYSFS */
@@ -338,10 +335,6 @@ static inline void sysfs_put(struct sysfs_dirent *sd)
338{ 335{
339} 336}
340 337
341static inline void sysfs_exit_ns(int type, const void *tag)
342{
343}
344
345static inline int __must_check sysfs_init(void) 338static inline int __must_check sysfs_init(void)
346{ 339{
347 return 0; 340 return 0;
diff --git a/include/linux/tc_ematch/tc_em_meta.h b/include/linux/tc_ematch/tc_em_meta.h
index 7138962664f8..b11f8ce2d3c0 100644
--- a/include/linux/tc_ematch/tc_em_meta.h
+++ b/include/linux/tc_ematch/tc_em_meta.h
@@ -67,7 +67,7 @@ enum {
67 TCF_META_ID_SK_FORWARD_ALLOCS, 67 TCF_META_ID_SK_FORWARD_ALLOCS,
68 TCF_META_ID_SK_SNDBUF, 68 TCF_META_ID_SK_SNDBUF,
69 TCF_META_ID_SK_ALLOCS, 69 TCF_META_ID_SK_ALLOCS,
70 TCF_META_ID_SK_ROUTE_CAPS, 70 __TCF_META_ID_SK_ROUTE_CAPS, /* unimplemented but in ABI already */
71 TCF_META_ID_SK_HASH, 71 TCF_META_ID_SK_HASH,
72 TCF_META_ID_SK_LINGERTIME, 72 TCF_META_ID_SK_LINGERTIME,
73 TCF_META_ID_SK_ACK_BACKLOG, 73 TCF_META_ID_SK_ACK_BACKLOG,
diff --git a/include/linux/tcp.h b/include/linux/tcp.h
index e64f4c67d0ef..531ede8006d9 100644
--- a/include/linux/tcp.h
+++ b/include/linux/tcp.h
@@ -282,6 +282,7 @@ struct tcp_request_sock {
282#endif 282#endif
283 u32 rcv_isn; 283 u32 rcv_isn;
284 u32 snt_isn; 284 u32 snt_isn;
285 u32 snt_synack; /* synack sent time */
285}; 286};
286 287
287static inline struct tcp_request_sock *tcp_rsk(const struct request_sock *req) 288static inline struct tcp_request_sock *tcp_rsk(const struct request_sock *req)
diff --git a/include/linux/thermal.h b/include/linux/thermal.h
index d3ec89fb4122..47b4a27e6e97 100644
--- a/include/linux/thermal.h
+++ b/include/linux/thermal.h
@@ -85,22 +85,6 @@ struct thermal_cooling_device {
85 ((long)t-2732+5)/10 : ((long)t-2732-5)/10) 85 ((long)t-2732+5)/10 : ((long)t-2732-5)/10)
86#define CELSIUS_TO_KELVIN(t) ((t)*10+2732) 86#define CELSIUS_TO_KELVIN(t) ((t)*10+2732)
87 87
88#if defined(CONFIG_THERMAL_HWMON)
89/* thermal zone devices with the same type share one hwmon device */
90struct thermal_hwmon_device {
91 char type[THERMAL_NAME_LENGTH];
92 struct device *device;
93 int count;
94 struct list_head tz_list;
95 struct list_head node;
96};
97
98struct thermal_hwmon_attr {
99 struct device_attribute attr;
100 char name[16];
101};
102#endif
103
104struct thermal_zone_device { 88struct thermal_zone_device {
105 int id; 89 int id;
106 char type[THERMAL_NAME_LENGTH]; 90 char type[THERMAL_NAME_LENGTH];
@@ -120,12 +104,6 @@ struct thermal_zone_device {
120 struct mutex lock; /* protect cooling devices list */ 104 struct mutex lock; /* protect cooling devices list */
121 struct list_head node; 105 struct list_head node;
122 struct delayed_work poll_queue; 106 struct delayed_work poll_queue;
123#if defined(CONFIG_THERMAL_HWMON)
124 struct list_head hwmon_node;
125 struct thermal_hwmon_device *hwmon;
126 struct thermal_hwmon_attr temp_input; /* hwmon sys attr */
127 struct thermal_hwmon_attr temp_crit; /* hwmon sys attr */
128#endif
129}; 107};
130/* Adding event notification support elements */ 108/* Adding event notification support elements */
131#define THERMAL_GENL_FAMILY_NAME "thermal_event" 109#define THERMAL_GENL_FAMILY_NAME "thermal_event"
diff --git a/include/linux/topology.h b/include/linux/topology.h
index b91a40e847d2..fc839bfa7935 100644
--- a/include/linux/topology.h
+++ b/include/linux/topology.h
@@ -60,7 +60,7 @@ int arch_update_cpu_topology(void);
60 * (in whatever arch specific measurement units returned by node_distance()) 60 * (in whatever arch specific measurement units returned by node_distance())
61 * then switch on zone reclaim on boot. 61 * then switch on zone reclaim on boot.
62 */ 62 */
63#define RECLAIM_DISTANCE 20 63#define RECLAIM_DISTANCE 30
64#endif 64#endif
65#ifndef PENALTY_FOR_NODE_WITH_CPUS 65#ifndef PENALTY_FOR_NODE_WITH_CPUS
66#define PENALTY_FOR_NODE_WITH_CPUS (1) 66#define PENALTY_FOR_NODE_WITH_CPUS (1)
diff --git a/include/linux/tracehook.h b/include/linux/tracehook.h
index e95f5236611f..a71a2927a6a0 100644
--- a/include/linux/tracehook.h
+++ b/include/linux/tracehook.h
@@ -51,27 +51,12 @@
51#include <linux/security.h> 51#include <linux/security.h>
52struct linux_binprm; 52struct linux_binprm;
53 53
54/**
55 * tracehook_expect_breakpoints - guess if task memory might be touched
56 * @task: current task, making a new mapping
57 *
58 * Return nonzero if @task is expected to want breakpoint insertion in
59 * its memory at some point. A zero return is no guarantee it won't
60 * be done, but this is a hint that it's known to be likely.
61 *
62 * May be called with @task->mm->mmap_sem held for writing.
63 */
64static inline int tracehook_expect_breakpoints(struct task_struct *task)
65{
66 return (task_ptrace(task) & PT_PTRACED) != 0;
67}
68
69/* 54/*
70 * ptrace report for syscall entry and exit looks identical. 55 * ptrace report for syscall entry and exit looks identical.
71 */ 56 */
72static inline void ptrace_report_syscall(struct pt_regs *regs) 57static inline void ptrace_report_syscall(struct pt_regs *regs)
73{ 58{
74 int ptrace = task_ptrace(current); 59 int ptrace = current->ptrace;
75 60
76 if (!(ptrace & PT_PTRACED)) 61 if (!(ptrace & PT_PTRACED))
77 return; 62 return;
@@ -145,229 +130,6 @@ static inline void tracehook_report_syscall_exit(struct pt_regs *regs, int step)
145} 130}
146 131
147/** 132/**
148 * tracehook_unsafe_exec - check for exec declared unsafe due to tracing
149 * @task: current task doing exec
150 *
151 * Return %LSM_UNSAFE_* bits applied to an exec because of tracing.
152 *
153 * @task->signal->cred_guard_mutex is held by the caller through the do_execve().
154 */
155static inline int tracehook_unsafe_exec(struct task_struct *task)
156{
157 int unsafe = 0;
158 int ptrace = task_ptrace(task);
159 if (ptrace & PT_PTRACED) {
160 if (ptrace & PT_PTRACE_CAP)
161 unsafe |= LSM_UNSAFE_PTRACE_CAP;
162 else
163 unsafe |= LSM_UNSAFE_PTRACE;
164 }
165 return unsafe;
166}
167
168/**
169 * tracehook_tracer_task - return the task that is tracing the given task
170 * @tsk: task to consider
171 *
172 * Returns NULL if no one is tracing @task, or the &struct task_struct
173 * pointer to its tracer.
174 *
175 * Must called under rcu_read_lock(). The pointer returned might be kept
176 * live only by RCU. During exec, this may be called with task_lock()
177 * held on @task, still held from when tracehook_unsafe_exec() was called.
178 */
179static inline struct task_struct *tracehook_tracer_task(struct task_struct *tsk)
180{
181 if (task_ptrace(tsk) & PT_PTRACED)
182 return rcu_dereference(tsk->parent);
183 return NULL;
184}
185
186/**
187 * tracehook_report_exec - a successful exec was completed
188 * @fmt: &struct linux_binfmt that performed the exec
189 * @bprm: &struct linux_binprm containing exec details
190 * @regs: user-mode register state
191 *
192 * An exec just completed, we are shortly going to return to user mode.
193 * The freshly initialized register state can be seen and changed in @regs.
194 * The name, file and other pointers in @bprm are still on hand to be
195 * inspected, but will be freed as soon as this returns.
196 *
197 * Called with no locks, but with some kernel resources held live
198 * and a reference on @fmt->module.
199 */
200static inline void tracehook_report_exec(struct linux_binfmt *fmt,
201 struct linux_binprm *bprm,
202 struct pt_regs *regs)
203{
204 if (!ptrace_event(PT_TRACE_EXEC, PTRACE_EVENT_EXEC, 0) &&
205 unlikely(task_ptrace(current) & PT_PTRACED))
206 send_sig(SIGTRAP, current, 0);
207}
208
209/**
210 * tracehook_report_exit - task has begun to exit
211 * @exit_code: pointer to value destined for @current->exit_code
212 *
213 * @exit_code points to the value passed to do_exit(), which tracing
214 * might change here. This is almost the first thing in do_exit(),
215 * before freeing any resources or setting the %PF_EXITING flag.
216 *
217 * Called with no locks held.
218 */
219static inline void tracehook_report_exit(long *exit_code)
220{
221 ptrace_event(PT_TRACE_EXIT, PTRACE_EVENT_EXIT, *exit_code);
222}
223
224/**
225 * tracehook_prepare_clone - prepare for new child to be cloned
226 * @clone_flags: %CLONE_* flags from clone/fork/vfork system call
227 *
228 * This is called before a new user task is to be cloned.
229 * Its return value will be passed to tracehook_finish_clone().
230 *
231 * Called with no locks held.
232 */
233static inline int tracehook_prepare_clone(unsigned clone_flags)
234{
235 if (clone_flags & CLONE_UNTRACED)
236 return 0;
237
238 if (clone_flags & CLONE_VFORK) {
239 if (current->ptrace & PT_TRACE_VFORK)
240 return PTRACE_EVENT_VFORK;
241 } else if ((clone_flags & CSIGNAL) != SIGCHLD) {
242 if (current->ptrace & PT_TRACE_CLONE)
243 return PTRACE_EVENT_CLONE;
244 } else if (current->ptrace & PT_TRACE_FORK)
245 return PTRACE_EVENT_FORK;
246
247 return 0;
248}
249
250/**
251 * tracehook_finish_clone - new child created and being attached
252 * @child: new child task
253 * @clone_flags: %CLONE_* flags from clone/fork/vfork system call
254 * @trace: return value from tracehook_prepare_clone()
255 *
256 * This is called immediately after adding @child to its parent's children list.
257 * The @trace value is that returned by tracehook_prepare_clone().
258 *
259 * Called with current's siglock and write_lock_irq(&tasklist_lock) held.
260 */
261static inline void tracehook_finish_clone(struct task_struct *child,
262 unsigned long clone_flags, int trace)
263{
264 ptrace_init_task(child, (clone_flags & CLONE_PTRACE) || trace);
265}
266
267/**
268 * tracehook_report_clone - in parent, new child is about to start running
269 * @regs: parent's user register state
270 * @clone_flags: flags from parent's system call
271 * @pid: new child's PID in the parent's namespace
272 * @child: new child task
273 *
274 * Called after a child is set up, but before it has been started running.
275 * This is not a good place to block, because the child has not started
276 * yet. Suspend the child here if desired, and then block in
277 * tracehook_report_clone_complete(). This must prevent the child from
278 * self-reaping if tracehook_report_clone_complete() uses the @child
279 * pointer; otherwise it might have died and been released by the time
280 * tracehook_report_clone_complete() is called.
281 *
282 * Called with no locks held, but the child cannot run until this returns.
283 */
284static inline void tracehook_report_clone(struct pt_regs *regs,
285 unsigned long clone_flags,
286 pid_t pid, struct task_struct *child)
287{
288 if (unlikely(task_ptrace(child))) {
289 /*
290 * It doesn't matter who attached/attaching to this
291 * task, the pending SIGSTOP is right in any case.
292 */
293 sigaddset(&child->pending.signal, SIGSTOP);
294 set_tsk_thread_flag(child, TIF_SIGPENDING);
295 }
296}
297
298/**
299 * tracehook_report_clone_complete - new child is running
300 * @trace: return value from tracehook_prepare_clone()
301 * @regs: parent's user register state
302 * @clone_flags: flags from parent's system call
303 * @pid: new child's PID in the parent's namespace
304 * @child: child task, already running
305 *
306 * This is called just after the child has started running. This is
307 * just before the clone/fork syscall returns, or blocks for vfork
308 * child completion if @clone_flags has the %CLONE_VFORK bit set.
309 * The @child pointer may be invalid if a self-reaping child died and
310 * tracehook_report_clone() took no action to prevent it from self-reaping.
311 *
312 * Called with no locks held.
313 */
314static inline void tracehook_report_clone_complete(int trace,
315 struct pt_regs *regs,
316 unsigned long clone_flags,
317 pid_t pid,
318 struct task_struct *child)
319{
320 if (unlikely(trace))
321 ptrace_event(0, trace, pid);
322}
323
324/**
325 * tracehook_report_vfork_done - vfork parent's child has exited or exec'd
326 * @child: child task, already running
327 * @pid: new child's PID in the parent's namespace
328 *
329 * Called after a %CLONE_VFORK parent has waited for the child to complete.
330 * The clone/vfork system call will return immediately after this.
331 * The @child pointer may be invalid if a self-reaping child died and
332 * tracehook_report_clone() took no action to prevent it from self-reaping.
333 *
334 * Called with no locks held.
335 */
336static inline void tracehook_report_vfork_done(struct task_struct *child,
337 pid_t pid)
338{
339 ptrace_event(PT_TRACE_VFORK_DONE, PTRACE_EVENT_VFORK_DONE, pid);
340}
341
342/**
343 * tracehook_prepare_release_task - task is being reaped, clean up tracing
344 * @task: task in %EXIT_DEAD state
345 *
346 * This is called in release_task() just before @task gets finally reaped
347 * and freed. This would be the ideal place to remove and clean up any
348 * tracing-related state for @task.
349 *
350 * Called with no locks held.
351 */
352static inline void tracehook_prepare_release_task(struct task_struct *task)
353{
354}
355
356/**
357 * tracehook_finish_release_task - final tracing clean-up
358 * @task: task in %EXIT_DEAD state
359 *
360 * This is called in release_task() when @task is being in the middle of
361 * being reaped. After this, there must be no tracing entanglements.
362 *
363 * Called with write_lock_irq(&tasklist_lock) held.
364 */
365static inline void tracehook_finish_release_task(struct task_struct *task)
366{
367 ptrace_release_task(task);
368}
369
370/**
371 * tracehook_signal_handler - signal handler setup is complete 133 * tracehook_signal_handler - signal handler setup is complete
372 * @sig: number of signal being delivered 134 * @sig: number of signal being delivered
373 * @info: siginfo_t of signal being delivered 135 * @info: siginfo_t of signal being delivered
@@ -390,151 +152,6 @@ static inline void tracehook_signal_handler(int sig, siginfo_t *info,
390 ptrace_notify(SIGTRAP); 152 ptrace_notify(SIGTRAP);
391} 153}
392 154
393/**
394 * tracehook_consider_ignored_signal - suppress short-circuit of ignored signal
395 * @task: task receiving the signal
396 * @sig: signal number being sent
397 *
398 * Return zero iff tracing doesn't care to examine this ignored signal,
399 * so it can short-circuit normal delivery and never even get queued.
400 *
401 * Called with @task->sighand->siglock held.
402 */
403static inline int tracehook_consider_ignored_signal(struct task_struct *task,
404 int sig)
405{
406 return (task_ptrace(task) & PT_PTRACED) != 0;
407}
408
409/**
410 * tracehook_consider_fatal_signal - suppress special handling of fatal signal
411 * @task: task receiving the signal
412 * @sig: signal number being sent
413 *
414 * Return nonzero to prevent special handling of this termination signal.
415 * Normally handler for signal is %SIG_DFL. It can be %SIG_IGN if @sig is
416 * ignored, in which case force_sig() is about to reset it to %SIG_DFL.
417 * When this returns zero, this signal might cause a quick termination
418 * that does not give the debugger a chance to intercept the signal.
419 *
420 * Called with or without @task->sighand->siglock held.
421 */
422static inline int tracehook_consider_fatal_signal(struct task_struct *task,
423 int sig)
424{
425 return (task_ptrace(task) & PT_PTRACED) != 0;
426}
427
428/**
429 * tracehook_force_sigpending - let tracing force signal_pending(current) on
430 *
431 * Called when recomputing our signal_pending() flag. Return nonzero
432 * to force the signal_pending() flag on, so that tracehook_get_signal()
433 * will be called before the next return to user mode.
434 *
435 * Called with @current->sighand->siglock held.
436 */
437static inline int tracehook_force_sigpending(void)
438{
439 return 0;
440}
441
442/**
443 * tracehook_get_signal - deliver synthetic signal to traced task
444 * @task: @current
445 * @regs: task_pt_regs(@current)
446 * @info: details of synthetic signal
447 * @return_ka: sigaction for synthetic signal
448 *
449 * Return zero to check for a real pending signal normally.
450 * Return -1 after releasing the siglock to repeat the check.
451 * Return a signal number to induce an artificial signal delivery,
452 * setting *@info and *@return_ka to specify its details and behavior.
453 *
454 * The @return_ka->sa_handler value controls the disposition of the
455 * signal, no matter the signal number. For %SIG_DFL, the return value
456 * is a representative signal to indicate the behavior (e.g. %SIGTERM
457 * for death, %SIGQUIT for core dump, %SIGSTOP for job control stop,
458 * %SIGTSTP for stop unless in an orphaned pgrp), but the signal number
459 * reported will be @info->si_signo instead.
460 *
461 * Called with @task->sighand->siglock held, before dequeuing pending signals.
462 */
463static inline int tracehook_get_signal(struct task_struct *task,
464 struct pt_regs *regs,
465 siginfo_t *info,
466 struct k_sigaction *return_ka)
467{
468 return 0;
469}
470
471/**
472 * tracehook_finish_jctl - report about return from job control stop
473 *
474 * This is called by do_signal_stop() after wakeup.
475 */
476static inline void tracehook_finish_jctl(void)
477{
478}
479
480#define DEATH_REAP -1
481#define DEATH_DELAYED_GROUP_LEADER -2
482
483/**
484 * tracehook_notify_death - task is dead, ready to notify parent
485 * @task: @current task now exiting
486 * @death_cookie: value to pass to tracehook_report_death()
487 * @group_dead: nonzero if this was the last thread in the group to die
488 *
489 * A return value >= 0 means call do_notify_parent() with that signal
490 * number. Negative return value can be %DEATH_REAP to self-reap right
491 * now, or %DEATH_DELAYED_GROUP_LEADER to a zombie without notifying our
492 * parent. Note that a return value of 0 means a do_notify_parent() call
493 * that sends no signal, but still wakes up a parent blocked in wait*().
494 *
495 * Called with write_lock_irq(&tasklist_lock) held.
496 */
497static inline int tracehook_notify_death(struct task_struct *task,
498 void **death_cookie, int group_dead)
499{
500 if (task_detached(task))
501 return task->ptrace ? SIGCHLD : DEATH_REAP;
502
503 /*
504 * If something other than our normal parent is ptracing us, then
505 * send it a SIGCHLD instead of honoring exit_signal. exit_signal
506 * only has special meaning to our real parent.
507 */
508 if (thread_group_empty(task) && !ptrace_reparented(task))
509 return task->exit_signal;
510
511 return task->ptrace ? SIGCHLD : DEATH_DELAYED_GROUP_LEADER;
512}
513
514/**
515 * tracehook_report_death - task is dead and ready to be reaped
516 * @task: @current task now exiting
517 * @signal: return value from tracheook_notify_death()
518 * @death_cookie: value passed back from tracehook_notify_death()
519 * @group_dead: nonzero if this was the last thread in the group to die
520 *
521 * Thread has just become a zombie or is about to self-reap. If positive,
522 * @signal is the signal number just sent to the parent (usually %SIGCHLD).
523 * If @signal is %DEATH_REAP, this thread will self-reap. If @signal is
524 * %DEATH_DELAYED_GROUP_LEADER, this is a delayed_group_leader() zombie.
525 * The @death_cookie was passed back by tracehook_notify_death().
526 *
527 * If normal reaping is not inhibited, @task->exit_state might be changing
528 * in parallel.
529 *
530 * Called without locks.
531 */
532static inline void tracehook_report_death(struct task_struct *task,
533 int signal, void *death_cookie,
534 int group_dead)
535{
536}
537
538#ifdef TIF_NOTIFY_RESUME 155#ifdef TIF_NOTIFY_RESUME
539/** 156/**
540 * set_notify_resume - cause tracehook_notify_resume() to be called 157 * set_notify_resume - cause tracehook_notify_resume() to be called
diff --git a/include/linux/tty.h b/include/linux/tty.h
index d6f05292e456..44bc0c5617e1 100644
--- a/include/linux/tty.h
+++ b/include/linux/tty.h
@@ -5,24 +5,6 @@
5 * 'tty.h' defines some structures used by tty_io.c and some defines. 5 * 'tty.h' defines some structures used by tty_io.c and some defines.
6 */ 6 */
7 7
8#ifdef __KERNEL__
9#include <linux/fs.h>
10#include <linux/major.h>
11#include <linux/termios.h>
12#include <linux/workqueue.h>
13#include <linux/tty_driver.h>
14#include <linux/tty_ldisc.h>
15#include <linux/mutex.h>
16
17#include <asm/system.h>
18
19
20/*
21 * (Note: the *_driver.minor_start values 1, 64, 128, 192 are
22 * hardcoded at present.)
23 */
24#define NR_UNIX98_PTY_DEFAULT 4096 /* Default maximum for Unix98 ptys */
25#define NR_UNIX98_PTY_MAX (1 << MINORBITS) /* Absolute limit */
26#define NR_LDISCS 30 8#define NR_LDISCS 30
27 9
28/* line disciplines */ 10/* line disciplines */
@@ -53,6 +35,25 @@
53#define N_TRACESINK 23 /* Trace data routing for MIPI P1149.7 */ 35#define N_TRACESINK 23 /* Trace data routing for MIPI P1149.7 */
54#define N_TRACEROUTER 24 /* Trace data routing for MIPI P1149.7 */ 36#define N_TRACEROUTER 24 /* Trace data routing for MIPI P1149.7 */
55 37
38#ifdef __KERNEL__
39#include <linux/fs.h>
40#include <linux/major.h>
41#include <linux/termios.h>
42#include <linux/workqueue.h>
43#include <linux/tty_driver.h>
44#include <linux/tty_ldisc.h>
45#include <linux/mutex.h>
46
47#include <asm/system.h>
48
49
50/*
51 * (Note: the *_driver.minor_start values 1, 64, 128, 192 are
52 * hardcoded at present.)
53 */
54#define NR_UNIX98_PTY_DEFAULT 4096 /* Default maximum for Unix98 ptys */
55#define NR_UNIX98_PTY_MAX (1 << MINORBITS) /* Absolute limit */
56
56/* 57/*
57 * This character is the same as _POSIX_VDISABLE: it cannot be used as 58 * This character is the same as _POSIX_VDISABLE: it cannot be used as
58 * a c_cc[] character, but indicates that a particular special character 59 * a c_cc[] character, but indicates that a particular special character
diff --git a/include/linux/tty_ldisc.h b/include/linux/tty_ldisc.h
index 5b07792ccb46..ff7dc08696a8 100644
--- a/include/linux/tty_ldisc.h
+++ b/include/linux/tty_ldisc.h
@@ -76,7 +76,7 @@
76 * tty device. It is solely the responsibility of the line 76 * tty device. It is solely the responsibility of the line
77 * discipline to handle poll requests. 77 * discipline to handle poll requests.
78 * 78 *
79 * unsigned int (*receive_buf)(struct tty_struct *, const unsigned char *cp, 79 * void (*receive_buf)(struct tty_struct *, const unsigned char *cp,
80 * char *fp, int count); 80 * char *fp, int count);
81 * 81 *
82 * This function is called by the low-level tty driver to send 82 * This function is called by the low-level tty driver to send
@@ -84,8 +84,7 @@
84 * processing. <cp> is a pointer to the buffer of input 84 * processing. <cp> is a pointer to the buffer of input
85 * character received by the device. <fp> is a pointer to a 85 * character received by the device. <fp> is a pointer to a
86 * pointer of flag bytes which indicate whether a character was 86 * pointer of flag bytes which indicate whether a character was
87 * received with a parity error, etc. Returns the amount of bytes 87 * received with a parity error, etc.
88 * received.
89 * 88 *
90 * void (*write_wakeup)(struct tty_struct *); 89 * void (*write_wakeup)(struct tty_struct *);
91 * 90 *
@@ -141,8 +140,8 @@ struct tty_ldisc_ops {
141 /* 140 /*
142 * The following routines are called from below. 141 * The following routines are called from below.
143 */ 142 */
144 unsigned int (*receive_buf)(struct tty_struct *, 143 void (*receive_buf)(struct tty_struct *, const unsigned char *cp,
145 const unsigned char *cp, char *fp, int count); 144 char *fp, int count);
146 void (*write_wakeup)(struct tty_struct *); 145 void (*write_wakeup)(struct tty_struct *);
147 void (*dcd_change)(struct tty_struct *, unsigned int, 146 void (*dcd_change)(struct tty_struct *, unsigned int,
148 struct pps_event_time *); 147 struct pps_event_time *);
diff --git a/include/linux/usb/composite.h b/include/linux/usb/composite.h
index b78cba466d3d..a316fba73518 100644
--- a/include/linux/usb/composite.h
+++ b/include/linux/usb/composite.h
@@ -59,6 +59,10 @@ struct usb_configuration;
59 * @hs_descriptors: Table of high speed descriptors, using interface and 59 * @hs_descriptors: Table of high speed descriptors, using interface and
60 * string identifiers assigned during @bind(). If this pointer is null, 60 * string identifiers assigned during @bind(). If this pointer is null,
61 * the function will not be available at high speed. 61 * the function will not be available at high speed.
62 * @ss_descriptors: Table of super speed descriptors, using interface and
63 * string identifiers assigned during @bind(). If this
64 * pointer is null after initiation, the function will not
65 * be available at super speed.
62 * @config: assigned when @usb_add_function() is called; this is the 66 * @config: assigned when @usb_add_function() is called; this is the
63 * configuration with which this function is associated. 67 * configuration with which this function is associated.
64 * @bind: Before the gadget can register, all of its functions bind() to the 68 * @bind: Before the gadget can register, all of its functions bind() to the
@@ -77,6 +81,10 @@ struct usb_configuration;
77 * @setup: Used for interface-specific control requests. 81 * @setup: Used for interface-specific control requests.
78 * @suspend: Notifies functions when the host stops sending USB traffic. 82 * @suspend: Notifies functions when the host stops sending USB traffic.
79 * @resume: Notifies functions when the host restarts USB traffic. 83 * @resume: Notifies functions when the host restarts USB traffic.
84 * @get_status: Returns function status as a reply to
85 * GetStatus() request when the recepient is Interface.
86 * @func_suspend: callback to be called when
87 * SetFeature(FUNCTION_SUSPEND) is reseived
80 * 88 *
81 * A single USB function uses one or more interfaces, and should in most 89 * A single USB function uses one or more interfaces, and should in most
82 * cases support operation at both full and high speeds. Each function is 90 * cases support operation at both full and high speeds. Each function is
@@ -106,6 +114,7 @@ struct usb_function {
106 struct usb_gadget_strings **strings; 114 struct usb_gadget_strings **strings;
107 struct usb_descriptor_header **descriptors; 115 struct usb_descriptor_header **descriptors;
108 struct usb_descriptor_header **hs_descriptors; 116 struct usb_descriptor_header **hs_descriptors;
117 struct usb_descriptor_header **ss_descriptors;
109 118
110 struct usb_configuration *config; 119 struct usb_configuration *config;
111 120
@@ -132,6 +141,10 @@ struct usb_function {
132 void (*suspend)(struct usb_function *); 141 void (*suspend)(struct usb_function *);
133 void (*resume)(struct usb_function *); 142 void (*resume)(struct usb_function *);
134 143
144 /* USB 3.0 additions */
145 int (*get_status)(struct usb_function *);
146 int (*func_suspend)(struct usb_function *,
147 u8 suspend_opt);
135 /* private: */ 148 /* private: */
136 /* internals */ 149 /* internals */
137 struct list_head list; 150 struct list_head list;
@@ -145,20 +158,8 @@ int usb_function_activate(struct usb_function *);
145 158
146int usb_interface_id(struct usb_configuration *, struct usb_function *); 159int usb_interface_id(struct usb_configuration *, struct usb_function *);
147 160
148/** 161int config_ep_by_speed(struct usb_gadget *g, struct usb_function *f,
149 * ep_choose - select descriptor endpoint at current device speed 162 struct usb_ep *_ep);
150 * @g: gadget, connected and running at some speed
151 * @hs: descriptor to use for high speed operation
152 * @fs: descriptor to use for full or low speed operation
153 */
154static inline struct usb_endpoint_descriptor *
155ep_choose(struct usb_gadget *g, struct usb_endpoint_descriptor *hs,
156 struct usb_endpoint_descriptor *fs)
157{
158 if (gadget_is_dualspeed(g) && g->speed == USB_SPEED_HIGH)
159 return hs;
160 return fs;
161}
162 163
163#define MAX_CONFIG_INTERFACES 16 /* arbitrary; max 255 */ 164#define MAX_CONFIG_INTERFACES 16 /* arbitrary; max 255 */
164 165
@@ -231,6 +232,7 @@ struct usb_configuration {
231 struct list_head list; 232 struct list_head list;
232 struct list_head functions; 233 struct list_head functions;
233 u8 next_interface_id; 234 u8 next_interface_id;
235 unsigned superspeed:1;
234 unsigned highspeed:1; 236 unsigned highspeed:1;
235 unsigned fullspeed:1; 237 unsigned fullspeed:1;
236 struct usb_function *interface[MAX_CONFIG_INTERFACES]; 238 struct usb_function *interface[MAX_CONFIG_INTERFACES];
@@ -252,6 +254,7 @@ int usb_add_config(struct usb_composite_dev *,
252 * identifiers. 254 * identifiers.
253 * @strings: tables of strings, keyed by identifiers assigned during bind() 255 * @strings: tables of strings, keyed by identifiers assigned during bind()
254 * and language IDs provided in control requests 256 * and language IDs provided in control requests
257 * @max_speed: Highest speed the driver supports.
255 * @needs_serial: set to 1 if the gadget needs userspace to provide 258 * @needs_serial: set to 1 if the gadget needs userspace to provide
256 * a serial number. If one is not provided, warning will be printed. 259 * a serial number. If one is not provided, warning will be printed.
257 * @unbind: Reverses bind; called as a side effect of unregistering 260 * @unbind: Reverses bind; called as a side effect of unregistering
@@ -279,6 +282,7 @@ struct usb_composite_driver {
279 const char *iManufacturer; 282 const char *iManufacturer;
280 const struct usb_device_descriptor *dev; 283 const struct usb_device_descriptor *dev;
281 struct usb_gadget_strings **strings; 284 struct usb_gadget_strings **strings;
285 enum usb_device_speed max_speed;
282 unsigned needs_serial:1; 286 unsigned needs_serial:1;
283 287
284 int (*unbind)(struct usb_composite_dev *); 288 int (*unbind)(struct usb_composite_dev *);
diff --git a/include/linux/usb/gadget.h b/include/linux/usb/gadget.h
index dd1571db55e7..087f4b931833 100644
--- a/include/linux/usb/gadget.h
+++ b/include/linux/usb/gadget.h
@@ -15,7 +15,13 @@
15#ifndef __LINUX_USB_GADGET_H 15#ifndef __LINUX_USB_GADGET_H
16#define __LINUX_USB_GADGET_H 16#define __LINUX_USB_GADGET_H
17 17
18#include <linux/device.h>
19#include <linux/errno.h>
20#include <linux/init.h>
21#include <linux/list.h>
18#include <linux/slab.h> 22#include <linux/slab.h>
23#include <linux/types.h>
24#include <linux/usb/ch9.h>
19 25
20struct usb_ep; 26struct usb_ep;
21 27
@@ -27,6 +33,7 @@ struct usb_ep;
27 * field, and the usb controller needs one, it is responsible 33 * field, and the usb controller needs one, it is responsible
28 * for mapping and unmapping the buffer. 34 * for mapping and unmapping the buffer.
29 * @length: Length of that data 35 * @length: Length of that data
36 * @stream_id: The stream id, when USB3.0 bulk streams are being used
30 * @no_interrupt: If true, hints that no completion irq is needed. 37 * @no_interrupt: If true, hints that no completion irq is needed.
31 * Helpful sometimes with deep request queues that are handled 38 * Helpful sometimes with deep request queues that are handled
32 * directly by DMA controllers. 39 * directly by DMA controllers.
@@ -81,6 +88,7 @@ struct usb_request {
81 unsigned length; 88 unsigned length;
82 dma_addr_t dma; 89 dma_addr_t dma;
83 90
91 unsigned stream_id:16;
84 unsigned no_interrupt:1; 92 unsigned no_interrupt:1;
85 unsigned zero:1; 93 unsigned zero:1;
86 unsigned short_not_ok:1; 94 unsigned short_not_ok:1;
@@ -131,8 +139,17 @@ struct usb_ep_ops {
131 * @maxpacket:The maximum packet size used on this endpoint. The initial 139 * @maxpacket:The maximum packet size used on this endpoint. The initial
132 * value can sometimes be reduced (hardware allowing), according to 140 * value can sometimes be reduced (hardware allowing), according to
133 * the endpoint descriptor used to configure the endpoint. 141 * the endpoint descriptor used to configure the endpoint.
134 * @driver_data:for use by the gadget driver. all other fields are 142 * @max_streams: The maximum number of streams supported
135 * read-only to gadget drivers. 143 * by this EP (0 - 16, actual number is 2^n)
144 * @mult: multiplier, 'mult' value for SS Isoc EPs
145 * @maxburst: the maximum number of bursts supported by this EP (for usb3)
146 * @driver_data:for use by the gadget driver.
147 * @address: used to identify the endpoint when finding descriptor that
148 * matches connection speed
149 * @desc: endpoint descriptor. This pointer is set before the endpoint is
150 * enabled and remains valid until the endpoint is disabled.
151 * @comp_desc: In case of SuperSpeed support, this is the endpoint companion
152 * descriptor that is used to configure the endpoint
136 * 153 *
137 * the bus controller driver lists all the general purpose endpoints in 154 * the bus controller driver lists all the general purpose endpoints in
138 * gadget->ep_list. the control endpoint (gadget->ep0) is not in that list, 155 * gadget->ep_list. the control endpoint (gadget->ep0) is not in that list,
@@ -145,6 +162,12 @@ struct usb_ep {
145 const struct usb_ep_ops *ops; 162 const struct usb_ep_ops *ops;
146 struct list_head ep_list; 163 struct list_head ep_list;
147 unsigned maxpacket:16; 164 unsigned maxpacket:16;
165 unsigned max_streams:16;
166 unsigned mult:2;
167 unsigned maxburst:4;
168 u8 address;
169 const struct usb_endpoint_descriptor *desc;
170 const struct usb_ss_ep_comp_descriptor *comp_desc;
148}; 171};
149 172
150/*-------------------------------------------------------------------------*/ 173/*-------------------------------------------------------------------------*/
@@ -153,11 +176,8 @@ struct usb_ep {
153 * usb_ep_enable - configure endpoint, making it usable 176 * usb_ep_enable - configure endpoint, making it usable
154 * @ep:the endpoint being configured. may not be the endpoint named "ep0". 177 * @ep:the endpoint being configured. may not be the endpoint named "ep0".
155 * drivers discover endpoints through the ep_list of a usb_gadget. 178 * drivers discover endpoints through the ep_list of a usb_gadget.
156 * @desc:descriptor for desired behavior. caller guarantees this pointer
157 * remains valid until the endpoint is disabled; the data byte order
158 * is little-endian (usb-standard).
159 * 179 *
160 * when configurations are set, or when interface settings change, the driver 180 * When configurations are set, or when interface settings change, the driver
161 * will enable or disable the relevant endpoints. while it is enabled, an 181 * will enable or disable the relevant endpoints. while it is enabled, an
162 * endpoint may be used for i/o until the driver receives a disconnect() from 182 * endpoint may be used for i/o until the driver receives a disconnect() from
163 * the host or until the endpoint is disabled. 183 * the host or until the endpoint is disabled.
@@ -172,10 +192,9 @@ struct usb_ep {
172 * 192 *
173 * returns zero, or a negative error code. 193 * returns zero, or a negative error code.
174 */ 194 */
175static inline int usb_ep_enable(struct usb_ep *ep, 195static inline int usb_ep_enable(struct usb_ep *ep)
176 const struct usb_endpoint_descriptor *desc)
177{ 196{
178 return ep->ops->enable(ep, desc); 197 return ep->ops->enable(ep, ep->desc);
179} 198}
180 199
181/** 200/**
@@ -416,7 +435,16 @@ static inline void usb_ep_fifo_flush(struct usb_ep *ep)
416 435
417/*-------------------------------------------------------------------------*/ 436/*-------------------------------------------------------------------------*/
418 437
438struct usb_dcd_config_params {
439 __u8 bU1devExitLat; /* U1 Device exit Latency */
440#define USB_DEFULT_U1_DEV_EXIT_LAT 0x01 /* Less then 1 microsec */
441 __le16 bU2DevExitLat; /* U2 Device exit Latency */
442#define USB_DEFULT_U2_DEV_EXIT_LAT 0x1F4 /* Less then 500 microsec */
443};
444
445
419struct usb_gadget; 446struct usb_gadget;
447struct usb_gadget_driver;
420 448
421/* the rest of the api to the controller hardware: device operations, 449/* the rest of the api to the controller hardware: device operations,
422 * which don't involve endpoints (or i/o). 450 * which don't involve endpoints (or i/o).
@@ -430,6 +458,16 @@ struct usb_gadget_ops {
430 int (*pullup) (struct usb_gadget *, int is_on); 458 int (*pullup) (struct usb_gadget *, int is_on);
431 int (*ioctl)(struct usb_gadget *, 459 int (*ioctl)(struct usb_gadget *,
432 unsigned code, unsigned long param); 460 unsigned code, unsigned long param);
461 void (*get_config_params)(struct usb_dcd_config_params *);
462 int (*udc_start)(struct usb_gadget *,
463 struct usb_gadget_driver *);
464 int (*udc_stop)(struct usb_gadget *,
465 struct usb_gadget_driver *);
466
467 /* Those two are deprecated */
468 int (*start)(struct usb_gadget_driver *,
469 int (*bind)(struct usb_gadget *));
470 int (*stop)(struct usb_gadget_driver *);
433}; 471};
434 472
435/** 473/**
@@ -521,6 +559,24 @@ static inline int gadget_is_dualspeed(struct usb_gadget *g)
521} 559}
522 560
523/** 561/**
562 * gadget_is_superspeed() - return true if the hardware handles
563 * supperspeed
564 * @g: controller that might support supper speed
565 */
566static inline int gadget_is_superspeed(struct usb_gadget *g)
567{
568#ifdef CONFIG_USB_GADGET_SUPERSPEED
569 /*
570 * runtime test would check "g->is_superspeed" ... that might be
571 * useful to work around hardware bugs, but is mostly pointless
572 */
573 return 1;
574#else
575 return 0;
576#endif
577}
578
579/**
524 * gadget_is_otg - return true iff the hardware is OTG-ready 580 * gadget_is_otg - return true iff the hardware is OTG-ready
525 * @g: controller that might have a Mini-AB connector 581 * @g: controller that might have a Mini-AB connector
526 * 582 *
@@ -821,6 +877,9 @@ int usb_gadget_probe_driver(struct usb_gadget_driver *driver,
821 */ 877 */
822int usb_gadget_unregister_driver(struct usb_gadget_driver *driver); 878int usb_gadget_unregister_driver(struct usb_gadget_driver *driver);
823 879
880extern int usb_add_gadget_udc(struct device *parent, struct usb_gadget *gadget);
881extern void usb_del_gadget_udc(struct usb_gadget *gadget);
882
824/*-------------------------------------------------------------------------*/ 883/*-------------------------------------------------------------------------*/
825 884
826/* utility to simplify dealing with string descriptors */ 885/* utility to simplify dealing with string descriptors */
@@ -870,12 +929,6 @@ int usb_gadget_config_buf(const struct usb_config_descriptor *config,
870struct usb_descriptor_header **usb_copy_descriptors( 929struct usb_descriptor_header **usb_copy_descriptors(
871 struct usb_descriptor_header **); 930 struct usb_descriptor_header **);
872 931
873/* return copy of endpoint descriptor given original descriptor set */
874struct usb_endpoint_descriptor *usb_find_endpoint(
875 struct usb_descriptor_header **src,
876 struct usb_descriptor_header **copy,
877 struct usb_endpoint_descriptor *match);
878
879/** 932/**
880 * usb_free_descriptors - free descriptors returned by usb_copy_descriptors() 933 * usb_free_descriptors - free descriptors returned by usb_copy_descriptors()
881 * @v: vector of descriptors 934 * @v: vector of descriptors
@@ -892,6 +945,11 @@ static inline void usb_free_descriptors(struct usb_descriptor_header **v)
892extern struct usb_ep *usb_ep_autoconfig(struct usb_gadget *, 945extern struct usb_ep *usb_ep_autoconfig(struct usb_gadget *,
893 struct usb_endpoint_descriptor *); 946 struct usb_endpoint_descriptor *);
894 947
948
949extern struct usb_ep *usb_ep_autoconfig_ss(struct usb_gadget *,
950 struct usb_endpoint_descriptor *,
951 struct usb_ss_ep_comp_descriptor *);
952
895extern void usb_ep_autoconfig_reset(struct usb_gadget *); 953extern void usb_ep_autoconfig_reset(struct usb_gadget *);
896 954
897#endif /* __LINUX_USB_GADGET_H */ 955#endif /* __LINUX_USB_GADGET_H */
diff --git a/include/linux/usb/m66592.h b/include/linux/usb/m66592.h
index cda9625e7df0..a4ba31ab2fed 100644
--- a/include/linux/usb/m66592.h
+++ b/include/linux/usb/m66592.h
@@ -38,6 +38,8 @@ struct m66592_platdata {
38 /* (external controller only) one = 3.3V, zero = 1.5V */ 38 /* (external controller only) one = 3.3V, zero = 1.5V */
39 unsigned vif:1; 39 unsigned vif:1;
40 40
41 /* (external controller only) set one = WR0_N shorted to WR1_N */
42 unsigned wr0_shorted_to_wr1:1;
41}; 43};
42 44
43#endif /* __LINUX_USB_M66592_H */ 45#endif /* __LINUX_USB_M66592_H */
diff --git a/include/linux/usb/r8a66597.h b/include/linux/usb/r8a66597.h
index 26d216734057..b6b8660d0c68 100644
--- a/include/linux/usb/r8a66597.h
+++ b/include/linux/usb/r8a66597.h
@@ -3,7 +3,7 @@
3 * 3 *
4 * Copyright (C) 2009 Renesas Solutions Corp. 4 * Copyright (C) 2009 Renesas Solutions Corp.
5 * 5 *
6 * Author : Yoshihiro Shimoda <shimoda.yoshihiro@renesas.com> 6 * Author : Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
7 * 7 *
8 * This program is free software; you can redistribute it and/or modify 8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by 9 * it under the terms of the GNU General Public License as published by
@@ -31,6 +31,9 @@ struct r8a66597_platdata {
31 /* This callback can control port power instead of DVSTCTR register. */ 31 /* This callback can control port power instead of DVSTCTR register. */
32 void (*port_power)(int port, int power); 32 void (*port_power)(int port, int power);
33 33
34 /* This parameter is for BUSWAIT */
35 u16 buswait;
36
34 /* set one = on chip controller, set zero = external controller */ 37 /* set one = on chip controller, set zero = external controller */
35 unsigned on_chip:1; 38 unsigned on_chip:1;
36 39
@@ -42,6 +45,9 @@ struct r8a66597_platdata {
42 45
43 /* set one = big endian, set zero = little endian */ 46 /* set one = big endian, set zero = little endian */
44 unsigned endian:1; 47 unsigned endian:1;
48
49 /* (external controller only) set one = WR0_N shorted to WR1_N */
50 unsigned wr0_shorted_to_wr1:1;
45}; 51};
46 52
47/* Register definitions */ 53/* Register definitions */
diff --git a/include/linux/usb/renesas_usbhs.h b/include/linux/usb/renesas_usbhs.h
index 3a7f1d982dd6..8977431259c6 100644
--- a/include/linux/usb/renesas_usbhs.h
+++ b/include/linux/usb/renesas_usbhs.h
@@ -110,6 +110,23 @@ struct renesas_usbhs_driver_param {
110 * delay time from notify_hotplug callback 110 * delay time from notify_hotplug callback
111 */ 111 */
112 int detection_delay; 112 int detection_delay;
113
114 /*
115 * option:
116 *
117 * dma id for dmaengine
118 */
119 int d0_tx_id;
120 int d0_rx_id;
121 int d1_tx_id;
122 int d1_rx_id;
123
124 /*
125 * option:
126 *
127 * pio <--> dma border.
128 */
129 int pio_dma_border; /* default is 64byte */
113}; 130};
114 131
115/* 132/*
diff --git a/include/linux/usb_usual.h b/include/linux/usb_usual.h
index 71693d4a4fe1..17df3600bcef 100644
--- a/include/linux/usb_usual.h
+++ b/include/linux/usb_usual.h
@@ -62,7 +62,9 @@
62 US_FLAG(NO_READ_DISC_INFO, 0x00040000) \ 62 US_FLAG(NO_READ_DISC_INFO, 0x00040000) \
63 /* cannot handle READ_DISC_INFO */ \ 63 /* cannot handle READ_DISC_INFO */ \
64 US_FLAG(NO_READ_CAPACITY_16, 0x00080000) \ 64 US_FLAG(NO_READ_CAPACITY_16, 0x00080000) \
65 /* cannot handle READ_CAPACITY_16 */ 65 /* cannot handle READ_CAPACITY_16 */ \
66 US_FLAG(INITIAL_READ10, 0x00100000) \
67 /* Initial READ(10) (and others) must be retried */
66 68
67#define US_FLAG(name, value) US_FL_##name = value , 69#define US_FLAG(name, value) US_FL_##name = value ,
68enum { US_DO_ALL_FLAGS }; 70enum { US_DO_ALL_FLAGS };
diff --git a/include/linux/uts.h b/include/linux/uts.h
index 73eb1ed36ec4..6ddbd86377de 100644
--- a/include/linux/uts.h
+++ b/include/linux/uts.h
@@ -9,7 +9,7 @@
9#endif 9#endif
10 10
11#ifndef UTS_NODENAME 11#ifndef UTS_NODENAME
12#define UTS_NODENAME "(none)" /* set by sethostname() */ 12#define UTS_NODENAME CONFIG_DEFAULT_HOSTNAME /* set by sethostname() */
13#endif 13#endif
14 14
15#ifndef UTS_DOMAINNAME 15#ifndef UTS_DOMAINNAME
diff --git a/include/linux/videodev2.h b/include/linux/videodev2.h
index 8a4c309d2344..fca24cc50436 100644
--- a/include/linux/videodev2.h
+++ b/include/linux/videodev2.h
@@ -376,7 +376,16 @@ struct v4l2_pix_format {
376#define V4L2_PIX_FMT_MJPEG v4l2_fourcc('M', 'J', 'P', 'G') /* Motion-JPEG */ 376#define V4L2_PIX_FMT_MJPEG v4l2_fourcc('M', 'J', 'P', 'G') /* Motion-JPEG */
377#define V4L2_PIX_FMT_JPEG v4l2_fourcc('J', 'P', 'E', 'G') /* JFIF JPEG */ 377#define V4L2_PIX_FMT_JPEG v4l2_fourcc('J', 'P', 'E', 'G') /* JFIF JPEG */
378#define V4L2_PIX_FMT_DV v4l2_fourcc('d', 'v', 's', 'd') /* 1394 */ 378#define V4L2_PIX_FMT_DV v4l2_fourcc('d', 'v', 's', 'd') /* 1394 */
379#define V4L2_PIX_FMT_MPEG v4l2_fourcc('M', 'P', 'E', 'G') /* MPEG-1/2/4 */ 379#define V4L2_PIX_FMT_MPEG v4l2_fourcc('M', 'P', 'E', 'G') /* MPEG-1/2/4 Multiplexed */
380#define V4L2_PIX_FMT_H264 v4l2_fourcc('H', '2', '6', '4') /* H264 with start codes */
381#define V4L2_PIX_FMT_H264_NO_SC v4l2_fourcc('A', 'V', 'C', '1') /* H264 without start codes */
382#define V4L2_PIX_FMT_H263 v4l2_fourcc('H', '2', '6', '3') /* H263 */
383#define V4L2_PIX_FMT_MPEG1 v4l2_fourcc('M', 'P', 'G', '1') /* MPEG-1 ES */
384#define V4L2_PIX_FMT_MPEG2 v4l2_fourcc('M', 'P', 'G', '2') /* MPEG-2 ES */
385#define V4L2_PIX_FMT_MPEG4 v4l2_fourcc('M', 'P', 'G', '4') /* MPEG-4 ES */
386#define V4L2_PIX_FMT_XVID v4l2_fourcc('X', 'V', 'I', 'D') /* Xvid */
387#define V4L2_PIX_FMT_VC1_ANNEX_G v4l2_fourcc('V', 'C', '1', 'G') /* SMPTE 421M Annex G compliant stream */
388#define V4L2_PIX_FMT_VC1_ANNEX_L v4l2_fourcc('V', 'C', '1', 'L') /* SMPTE 421M Annex L compliant stream */
380 389
381/* Vendor-specific formats */ 390/* Vendor-specific formats */
382#define V4L2_PIX_FMT_CPIA1 v4l2_fourcc('C', 'P', 'I', 'A') /* cpia1 YUV */ 391#define V4L2_PIX_FMT_CPIA1 v4l2_fourcc('C', 'P', 'I', 'A') /* cpia1 YUV */
@@ -402,6 +411,7 @@ struct v4l2_pix_format {
402#define V4L2_PIX_FMT_CIT_YYVYUY v4l2_fourcc('C', 'I', 'T', 'V') /* one line of Y then 1 line of VYUY */ 411#define V4L2_PIX_FMT_CIT_YYVYUY v4l2_fourcc('C', 'I', 'T', 'V') /* one line of Y then 1 line of VYUY */
403#define V4L2_PIX_FMT_KONICA420 v4l2_fourcc('K', 'O', 'N', 'I') /* YUV420 planar in blocks of 256 pixels */ 412#define V4L2_PIX_FMT_KONICA420 v4l2_fourcc('K', 'O', 'N', 'I') /* YUV420 planar in blocks of 256 pixels */
404#define V4L2_PIX_FMT_JPGL v4l2_fourcc('J', 'P', 'G', 'L') /* JPEG-Lite */ 413#define V4L2_PIX_FMT_JPGL v4l2_fourcc('J', 'P', 'G', 'L') /* JPEG-Lite */
414#define V4L2_PIX_FMT_SE401 v4l2_fourcc('S', '4', '0', '1') /* se401 janggu compressed rgb */
405 415
406/* 416/*
407 * F O R M A T E N U M E R A T I O N 417 * F O R M A T E N U M E R A T I O N
@@ -1026,6 +1036,7 @@ struct v4l2_ext_controls {
1026#define V4L2_CTRL_CLASS_MPEG 0x00990000 /* MPEG-compression controls */ 1036#define V4L2_CTRL_CLASS_MPEG 0x00990000 /* MPEG-compression controls */
1027#define V4L2_CTRL_CLASS_CAMERA 0x009a0000 /* Camera class controls */ 1037#define V4L2_CTRL_CLASS_CAMERA 0x009a0000 /* Camera class controls */
1028#define V4L2_CTRL_CLASS_FM_TX 0x009b0000 /* FM Modulator control class */ 1038#define V4L2_CTRL_CLASS_FM_TX 0x009b0000 /* FM Modulator control class */
1039#define V4L2_CTRL_CLASS_FLASH 0x009c0000 /* Camera flash controls */
1029 1040
1030#define V4L2_CTRL_ID_MASK (0x0fffffff) 1041#define V4L2_CTRL_ID_MASK (0x0fffffff)
1031#define V4L2_CTRL_ID2CLASS(id) ((id) & 0x0fff0000UL) 1042#define V4L2_CTRL_ID2CLASS(id) ((id) & 0x0fff0000UL)
@@ -1039,6 +1050,7 @@ enum v4l2_ctrl_type {
1039 V4L2_CTRL_TYPE_INTEGER64 = 5, 1050 V4L2_CTRL_TYPE_INTEGER64 = 5,
1040 V4L2_CTRL_TYPE_CTRL_CLASS = 6, 1051 V4L2_CTRL_TYPE_CTRL_CLASS = 6,
1041 V4L2_CTRL_TYPE_STRING = 7, 1052 V4L2_CTRL_TYPE_STRING = 7,
1053 V4L2_CTRL_TYPE_BITMASK = 8,
1042}; 1054};
1043 1055
1044/* Used in the VIDIOC_QUERYCTRL ioctl for querying controls */ 1056/* Used in the VIDIOC_QUERYCTRL ioctl for querying controls */
@@ -1144,14 +1156,19 @@ enum v4l2_colorfx {
1144#define V4L2_CID_ILLUMINATORS_1 (V4L2_CID_BASE+37) 1156#define V4L2_CID_ILLUMINATORS_1 (V4L2_CID_BASE+37)
1145#define V4L2_CID_ILLUMINATORS_2 (V4L2_CID_BASE+38) 1157#define V4L2_CID_ILLUMINATORS_2 (V4L2_CID_BASE+38)
1146 1158
1159#define V4L2_CID_MIN_BUFFERS_FOR_CAPTURE (V4L2_CID_BASE+39)
1160#define V4L2_CID_MIN_BUFFERS_FOR_OUTPUT (V4L2_CID_BASE+40)
1161
1147/* last CID + 1 */ 1162/* last CID + 1 */
1148#define V4L2_CID_LASTP1 (V4L2_CID_BASE+39) 1163#define V4L2_CID_LASTP1 (V4L2_CID_BASE+41)
1164
1165/* Minimum number of buffer neede by the device */
1149 1166
1150/* MPEG-class control IDs defined by V4L2 */ 1167/* MPEG-class control IDs defined by V4L2 */
1151#define V4L2_CID_MPEG_BASE (V4L2_CTRL_CLASS_MPEG | 0x900) 1168#define V4L2_CID_MPEG_BASE (V4L2_CTRL_CLASS_MPEG | 0x900)
1152#define V4L2_CID_MPEG_CLASS (V4L2_CTRL_CLASS_MPEG | 1) 1169#define V4L2_CID_MPEG_CLASS (V4L2_CTRL_CLASS_MPEG | 1)
1153 1170
1154/* MPEG streams */ 1171/* MPEG streams, specific to multiplexed streams */
1155#define V4L2_CID_MPEG_STREAM_TYPE (V4L2_CID_MPEG_BASE+0) 1172#define V4L2_CID_MPEG_STREAM_TYPE (V4L2_CID_MPEG_BASE+0)
1156enum v4l2_mpeg_stream_type { 1173enum v4l2_mpeg_stream_type {
1157 V4L2_MPEG_STREAM_TYPE_MPEG2_PS = 0, /* MPEG-2 program stream */ 1174 V4L2_MPEG_STREAM_TYPE_MPEG2_PS = 0, /* MPEG-2 program stream */
@@ -1173,7 +1190,7 @@ enum v4l2_mpeg_stream_vbi_fmt {
1173 V4L2_MPEG_STREAM_VBI_FMT_IVTV = 1, /* VBI in private packets, IVTV format */ 1190 V4L2_MPEG_STREAM_VBI_FMT_IVTV = 1, /* VBI in private packets, IVTV format */
1174}; 1191};
1175 1192
1176/* MPEG audio */ 1193/* MPEG audio controls specific to multiplexed streams */
1177#define V4L2_CID_MPEG_AUDIO_SAMPLING_FREQ (V4L2_CID_MPEG_BASE+100) 1194#define V4L2_CID_MPEG_AUDIO_SAMPLING_FREQ (V4L2_CID_MPEG_BASE+100)
1178enum v4l2_mpeg_audio_sampling_freq { 1195enum v4l2_mpeg_audio_sampling_freq {
1179 V4L2_MPEG_AUDIO_SAMPLING_FREQ_44100 = 0, 1196 V4L2_MPEG_AUDIO_SAMPLING_FREQ_44100 = 0,
@@ -1289,7 +1306,7 @@ enum v4l2_mpeg_audio_ac3_bitrate {
1289 V4L2_MPEG_AUDIO_AC3_BITRATE_640K = 18, 1306 V4L2_MPEG_AUDIO_AC3_BITRATE_640K = 18,
1290}; 1307};
1291 1308
1292/* MPEG video */ 1309/* MPEG video controls specific to multiplexed streams */
1293#define V4L2_CID_MPEG_VIDEO_ENCODING (V4L2_CID_MPEG_BASE+200) 1310#define V4L2_CID_MPEG_VIDEO_ENCODING (V4L2_CID_MPEG_BASE+200)
1294enum v4l2_mpeg_video_encoding { 1311enum v4l2_mpeg_video_encoding {
1295 V4L2_MPEG_VIDEO_ENCODING_MPEG_1 = 0, 1312 V4L2_MPEG_VIDEO_ENCODING_MPEG_1 = 0,
@@ -1317,6 +1334,141 @@ enum v4l2_mpeg_video_bitrate_mode {
1317#define V4L2_CID_MPEG_VIDEO_TEMPORAL_DECIMATION (V4L2_CID_MPEG_BASE+209) 1334#define V4L2_CID_MPEG_VIDEO_TEMPORAL_DECIMATION (V4L2_CID_MPEG_BASE+209)
1318#define V4L2_CID_MPEG_VIDEO_MUTE (V4L2_CID_MPEG_BASE+210) 1335#define V4L2_CID_MPEG_VIDEO_MUTE (V4L2_CID_MPEG_BASE+210)
1319#define V4L2_CID_MPEG_VIDEO_MUTE_YUV (V4L2_CID_MPEG_BASE+211) 1336#define V4L2_CID_MPEG_VIDEO_MUTE_YUV (V4L2_CID_MPEG_BASE+211)
1337#define V4L2_CID_MPEG_VIDEO_DECODER_SLICE_INTERFACE (V4L2_CID_MPEG_BASE+212)
1338#define V4L2_CID_MPEG_VIDEO_DECODER_MPEG4_DEBLOCK_FILTER (V4L2_CID_MPEG_BASE+213)
1339#define V4L2_CID_MPEG_VIDEO_CYCLIC_INTRA_REFRESH_MB (V4L2_CID_MPEG_BASE+214)
1340#define V4L2_CID_MPEG_VIDEO_FRAME_RC_ENABLE (V4L2_CID_MPEG_BASE+215)
1341#define V4L2_CID_MPEG_VIDEO_HEADER_MODE (V4L2_CID_MPEG_BASE+216)
1342enum v4l2_mpeg_video_header_mode {
1343 V4L2_MPEG_VIDEO_HEADER_MODE_SEPARATE = 0,
1344 V4L2_MPEG_VIDEO_HEADER_MODE_JOINED_WITH_1ST_FRAME = 1,
1345
1346};
1347#define V4L2_CID_MPEG_VIDEO_MAX_REF_PIC (V4L2_CID_MPEG_BASE+217)
1348#define V4L2_CID_MPEG_VIDEO_MB_RC_ENABLE (V4L2_CID_MPEG_BASE+218)
1349#define V4L2_CID_MPEG_VIDEO_MULTI_SLICE_MAX_BYTES (V4L2_CID_MPEG_BASE+219)
1350#define V4L2_CID_MPEG_VIDEO_MULTI_SLICE_MAX_MB (V4L2_CID_MPEG_BASE+220)
1351#define V4L2_CID_MPEG_VIDEO_MULTI_SLICE_MODE (V4L2_CID_MPEG_BASE+221)
1352enum v4l2_mpeg_video_multi_slice_mode {
1353 V4L2_MPEG_VIDEO_MULTI_SLICE_MODE_SINGLE = 0,
1354 V4L2_MPEG_VIDEO_MULTI_SICE_MODE_MAX_MB = 1,
1355 V4L2_MPEG_VIDEO_MULTI_SICE_MODE_MAX_BYTES = 2,
1356};
1357#define V4L2_CID_MPEG_VIDEO_VBV_SIZE (V4L2_CID_MPEG_BASE+222)
1358#define V4L2_CID_MPEG_VIDEO_H263_I_FRAME_QP (V4L2_CID_MPEG_BASE+300)
1359#define V4L2_CID_MPEG_VIDEO_H263_P_FRAME_QP (V4L2_CID_MPEG_BASE+301)
1360#define V4L2_CID_MPEG_VIDEO_H263_B_FRAME_QP (V4L2_CID_MPEG_BASE+302)
1361#define V4L2_CID_MPEG_VIDEO_H263_MIN_QP (V4L2_CID_MPEG_BASE+303)
1362#define V4L2_CID_MPEG_VIDEO_H263_MAX_QP (V4L2_CID_MPEG_BASE+304)
1363#define V4L2_CID_MPEG_VIDEO_H264_I_FRAME_QP (V4L2_CID_MPEG_BASE+350)
1364#define V4L2_CID_MPEG_VIDEO_H264_P_FRAME_QP (V4L2_CID_MPEG_BASE+351)
1365#define V4L2_CID_MPEG_VIDEO_H264_B_FRAME_QP (V4L2_CID_MPEG_BASE+352)
1366#define V4L2_CID_MPEG_VIDEO_H264_MIN_QP (V4L2_CID_MPEG_BASE+353)
1367#define V4L2_CID_MPEG_VIDEO_H264_MAX_QP (V4L2_CID_MPEG_BASE+354)
1368#define V4L2_CID_MPEG_VIDEO_H264_8X8_TRANSFORM (V4L2_CID_MPEG_BASE+355)
1369#define V4L2_CID_MPEG_VIDEO_H264_CPB_SIZE (V4L2_CID_MPEG_BASE+356)
1370#define V4L2_CID_MPEG_VIDEO_H264_ENTROPY_MODE (V4L2_CID_MPEG_BASE+357)
1371enum v4l2_mpeg_video_h264_entropy_mode {
1372 V4L2_MPEG_VIDEO_H264_ENTROPY_MODE_CAVLC = 0,
1373 V4L2_MPEG_VIDEO_H264_ENTROPY_MODE_CABAC = 1,
1374};
1375#define V4L2_CID_MPEG_VIDEO_H264_I_PERIOD (V4L2_CID_MPEG_BASE+358)
1376#define V4L2_CID_MPEG_VIDEO_H264_LEVEL (V4L2_CID_MPEG_BASE+359)
1377enum v4l2_mpeg_video_h264_level {
1378 V4L2_MPEG_VIDEO_H264_LEVEL_1_0 = 0,
1379 V4L2_MPEG_VIDEO_H264_LEVEL_1B = 1,
1380 V4L2_MPEG_VIDEO_H264_LEVEL_1_1 = 2,
1381 V4L2_MPEG_VIDEO_H264_LEVEL_1_2 = 3,
1382 V4L2_MPEG_VIDEO_H264_LEVEL_1_3 = 4,
1383 V4L2_MPEG_VIDEO_H264_LEVEL_2_0 = 5,
1384 V4L2_MPEG_VIDEO_H264_LEVEL_2_1 = 6,
1385 V4L2_MPEG_VIDEO_H264_LEVEL_2_2 = 7,
1386 V4L2_MPEG_VIDEO_H264_LEVEL_3_0 = 8,
1387 V4L2_MPEG_VIDEO_H264_LEVEL_3_1 = 9,
1388 V4L2_MPEG_VIDEO_H264_LEVEL_3_2 = 10,
1389 V4L2_MPEG_VIDEO_H264_LEVEL_4_0 = 11,
1390 V4L2_MPEG_VIDEO_H264_LEVEL_4_1 = 12,
1391 V4L2_MPEG_VIDEO_H264_LEVEL_4_2 = 13,
1392 V4L2_MPEG_VIDEO_H264_LEVEL_5_0 = 14,
1393 V4L2_MPEG_VIDEO_H264_LEVEL_5_1 = 15,
1394};
1395#define V4L2_CID_MPEG_VIDEO_H264_LOOP_FILTER_ALPHA (V4L2_CID_MPEG_BASE+360)
1396#define V4L2_CID_MPEG_VIDEO_H264_LOOP_FILTER_BETA (V4L2_CID_MPEG_BASE+361)
1397#define V4L2_CID_MPEG_VIDEO_H264_LOOP_FILTER_MODE (V4L2_CID_MPEG_BASE+362)
1398enum v4l2_mpeg_video_h264_loop_filter_mode {
1399 V4L2_MPEG_VIDEO_H264_LOOP_FILTER_MODE_ENABLED = 0,
1400 V4L2_MPEG_VIDEO_H264_LOOP_FILTER_MODE_DISABLED = 1,
1401 V4L2_MPEG_VIDEO_H264_LOOP_FILTER_MODE_DISABLED_AT_SLICE_BOUNDARY = 2,
1402};
1403#define V4L2_CID_MPEG_VIDEO_H264_PROFILE (V4L2_CID_MPEG_BASE+363)
1404enum v4l2_mpeg_video_h264_profile {
1405 V4L2_MPEG_VIDEO_H264_PROFILE_BASELINE = 0,
1406 V4L2_MPEG_VIDEO_H264_PROFILE_CONSTRAINED_BASELINE = 1,
1407 V4L2_MPEG_VIDEO_H264_PROFILE_MAIN = 2,
1408 V4L2_MPEG_VIDEO_H264_PROFILE_EXTENDED = 3,
1409 V4L2_MPEG_VIDEO_H264_PROFILE_HIGH = 4,
1410 V4L2_MPEG_VIDEO_H264_PROFILE_HIGH_10 = 5,
1411 V4L2_MPEG_VIDEO_H264_PROFILE_HIGH_422 = 6,
1412 V4L2_MPEG_VIDEO_H264_PROFILE_HIGH_444_PREDICTIVE = 7,
1413 V4L2_MPEG_VIDEO_H264_PROFILE_HIGH_10_INTRA = 8,
1414 V4L2_MPEG_VIDEO_H264_PROFILE_HIGH_422_INTRA = 9,
1415 V4L2_MPEG_VIDEO_H264_PROFILE_HIGH_444_INTRA = 10,
1416 V4L2_MPEG_VIDEO_H264_PROFILE_CAVLC_444_INTRA = 11,
1417 V4L2_MPEG_VIDEO_H264_PROFILE_SCALABLE_BASELINE = 12,
1418 V4L2_MPEG_VIDEO_H264_PROFILE_SCALABLE_HIGH = 13,
1419 V4L2_MPEG_VIDEO_H264_PROFILE_SCALABLE_HIGH_INTRA = 14,
1420 V4L2_MPEG_VIDEO_H264_PROFILE_STEREO_HIGH = 15,
1421 V4L2_MPEG_VIDEO_H264_PROFILE_MULTIVIEW_HIGH = 16,
1422};
1423#define V4L2_CID_MPEG_VIDEO_H264_VUI_EXT_SAR_HEIGHT (V4L2_CID_MPEG_BASE+364)
1424#define V4L2_CID_MPEG_VIDEO_H264_VUI_EXT_SAR_WIDTH (V4L2_CID_MPEG_BASE+365)
1425#define V4L2_CID_MPEG_VIDEO_H264_VUI_SAR_ENABLE (V4L2_CID_MPEG_BASE+366)
1426#define V4L2_CID_MPEG_VIDEO_H264_VUI_SAR_IDC (V4L2_CID_MPEG_BASE+367)
1427enum v4l2_mpeg_video_h264_vui_sar_idc {
1428 V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_UNSPECIFIED = 0,
1429 V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_1x1 = 1,
1430 V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_12x11 = 2,
1431 V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_10x11 = 3,
1432 V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_16x11 = 4,
1433 V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_40x33 = 5,
1434 V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_24x11 = 6,
1435 V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_20x11 = 7,
1436 V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_32x11 = 8,
1437 V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_80x33 = 9,
1438 V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_18x11 = 10,
1439 V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_15x11 = 11,
1440 V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_64x33 = 12,
1441 V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_160x99 = 13,
1442 V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_4x3 = 14,
1443 V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_3x2 = 15,
1444 V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_2x1 = 16,
1445 V4L2_MPEG_VIDEO_H264_VUI_SAR_IDC_EXTENDED = 17,
1446};
1447#define V4L2_CID_MPEG_VIDEO_MPEG4_I_FRAME_QP (V4L2_CID_MPEG_BASE+400)
1448#define V4L2_CID_MPEG_VIDEO_MPEG4_P_FRAME_QP (V4L2_CID_MPEG_BASE+401)
1449#define V4L2_CID_MPEG_VIDEO_MPEG4_B_FRAME_QP (V4L2_CID_MPEG_BASE+402)
1450#define V4L2_CID_MPEG_VIDEO_MPEG4_MIN_QP (V4L2_CID_MPEG_BASE+403)
1451#define V4L2_CID_MPEG_VIDEO_MPEG4_MAX_QP (V4L2_CID_MPEG_BASE+404)
1452#define V4L2_CID_MPEG_VIDEO_MPEG4_LEVEL (V4L2_CID_MPEG_BASE+405)
1453enum v4l2_mpeg_video_mpeg4_level {
1454 V4L2_MPEG_VIDEO_MPEG4_LEVEL_0 = 0,
1455 V4L2_MPEG_VIDEO_MPEG4_LEVEL_0B = 1,
1456 V4L2_MPEG_VIDEO_MPEG4_LEVEL_1 = 2,
1457 V4L2_MPEG_VIDEO_MPEG4_LEVEL_2 = 3,
1458 V4L2_MPEG_VIDEO_MPEG4_LEVEL_3 = 4,
1459 V4L2_MPEG_VIDEO_MPEG4_LEVEL_3B = 5,
1460 V4L2_MPEG_VIDEO_MPEG4_LEVEL_4 = 6,
1461 V4L2_MPEG_VIDEO_MPEG4_LEVEL_5 = 7,
1462};
1463#define V4L2_CID_MPEG_VIDEO_MPEG4_PROFILE (V4L2_CID_MPEG_BASE+406)
1464enum v4l2_mpeg_video_mpeg4_profile {
1465 V4L2_MPEG_VIDEO_MPEG4_PROFILE_SIMPLE = 0,
1466 V4L2_MPEG_VIDEO_MPEG4_PROFILE_ADVANCED_SIMPLE = 1,
1467 V4L2_MPEG_VIDEO_MPEG4_PROFILE_CORE = 2,
1468 V4L2_MPEG_VIDEO_MPEG4_PROFILE_SIMPLE_SCALABLE = 3,
1469 V4L2_MPEG_VIDEO_MPEG4_PROFILE_ADVANCED_CODING_EFFICIENCY = 4,
1470};
1471#define V4L2_CID_MPEG_VIDEO_MPEG4_QPEL (V4L2_CID_MPEG_BASE+407)
1320 1472
1321/* MPEG-class control IDs specific to the CX2341x driver as defined by V4L2 */ 1473/* MPEG-class control IDs specific to the CX2341x driver as defined by V4L2 */
1322#define V4L2_CID_MPEG_CX2341X_BASE (V4L2_CTRL_CLASS_MPEG | 0x1000) 1474#define V4L2_CID_MPEG_CX2341X_BASE (V4L2_CTRL_CLASS_MPEG | 0x1000)
@@ -1359,6 +1511,33 @@ enum v4l2_mpeg_cx2341x_video_median_filter_type {
1359#define V4L2_CID_MPEG_CX2341X_VIDEO_CHROMA_MEDIAN_FILTER_TOP (V4L2_CID_MPEG_CX2341X_BASE+10) 1511#define V4L2_CID_MPEG_CX2341X_VIDEO_CHROMA_MEDIAN_FILTER_TOP (V4L2_CID_MPEG_CX2341X_BASE+10)
1360#define V4L2_CID_MPEG_CX2341X_STREAM_INSERT_NAV_PACKETS (V4L2_CID_MPEG_CX2341X_BASE+11) 1512#define V4L2_CID_MPEG_CX2341X_STREAM_INSERT_NAV_PACKETS (V4L2_CID_MPEG_CX2341X_BASE+11)
1361 1513
1514/* MPEG-class control IDs specific to the Samsung MFC 5.1 driver as defined by V4L2 */
1515#define V4L2_CID_MPEG_MFC51_BASE (V4L2_CTRL_CLASS_MPEG | 0x1100)
1516
1517#define V4L2_CID_MPEG_MFC51_VIDEO_DECODER_H264_DISPLAY_DELAY (V4L2_CID_MPEG_MFC51_BASE+0)
1518#define V4L2_CID_MPEG_MFC51_VIDEO_DECODER_H264_DISPLAY_DELAY_ENABLE (V4L2_CID_MPEG_MFC51_BASE+1)
1519#define V4L2_CID_MPEG_MFC51_VIDEO_FRAME_SKIP_MODE (V4L2_CID_MPEG_MFC51_BASE+2)
1520enum v4l2_mpeg_mfc51_video_frame_skip_mode {
1521 V4L2_MPEG_MFC51_VIDEO_FRAME_SKIP_MODE_DISABLED = 0,
1522 V4L2_MPEG_MFC51_VIDEO_FRAME_SKIP_MODE_LEVEL_LIMIT = 1,
1523 V4L2_MPEG_MFC51_VIDEO_FRAME_SKIP_MODE_BUF_LIMIT = 2,
1524};
1525#define V4L2_CID_MPEG_MFC51_VIDEO_FORCE_FRAME_TYPE (V4L2_CID_MPEG_MFC51_BASE+3)
1526enum v4l2_mpeg_mfc51_video_force_frame_type {
1527 V4L2_MPEG_MFC51_VIDEO_FORCE_FRAME_TYPE_DISABLED = 0,
1528 V4L2_MPEG_MFC51_VIDEO_FORCE_FRAME_TYPE_I_FRAME = 1,
1529 V4L2_MPEG_MFC51_VIDEO_FORCE_FRAME_TYPE_NOT_CODED = 2,
1530};
1531#define V4L2_CID_MPEG_MFC51_VIDEO_PADDING (V4L2_CID_MPEG_MFC51_BASE+4)
1532#define V4L2_CID_MPEG_MFC51_VIDEO_PADDING_YUV (V4L2_CID_MPEG_MFC51_BASE+5)
1533#define V4L2_CID_MPEG_MFC51_VIDEO_RC_FIXED_TARGET_BIT (V4L2_CID_MPEG_MFC51_BASE+6)
1534#define V4L2_CID_MPEG_MFC51_VIDEO_RC_REACTION_COEFF (V4L2_CID_MPEG_MFC51_BASE+7)
1535#define V4L2_CID_MPEG_MFC51_VIDEO_H264_ADAPTIVE_RC_ACTIVITY (V4L2_CID_MPEG_MFC51_BASE+50)
1536#define V4L2_CID_MPEG_MFC51_VIDEO_H264_ADAPTIVE_RC_DARK (V4L2_CID_MPEG_MFC51_BASE+51)
1537#define V4L2_CID_MPEG_MFC51_VIDEO_H264_ADAPTIVE_RC_SMOOTH (V4L2_CID_MPEG_MFC51_BASE+52)
1538#define V4L2_CID_MPEG_MFC51_VIDEO_H264_ADAPTIVE_RC_STATIC (V4L2_CID_MPEG_MFC51_BASE+53)
1539#define V4L2_CID_MPEG_MFC51_VIDEO_H264_NUM_REF_PIC_FOR_P (V4L2_CID_MPEG_MFC51_BASE+54)
1540
1362/* Camera class control IDs */ 1541/* Camera class control IDs */
1363#define V4L2_CID_CAMERA_CLASS_BASE (V4L2_CTRL_CLASS_CAMERA | 0x900) 1542#define V4L2_CID_CAMERA_CLASS_BASE (V4L2_CTRL_CLASS_CAMERA | 0x900)
1364#define V4L2_CID_CAMERA_CLASS (V4L2_CTRL_CLASS_CAMERA | 1) 1543#define V4L2_CID_CAMERA_CLASS (V4L2_CTRL_CLASS_CAMERA | 1)
@@ -1427,6 +1606,41 @@ enum v4l2_preemphasis {
1427#define V4L2_CID_TUNE_POWER_LEVEL (V4L2_CID_FM_TX_CLASS_BASE + 113) 1606#define V4L2_CID_TUNE_POWER_LEVEL (V4L2_CID_FM_TX_CLASS_BASE + 113)
1428#define V4L2_CID_TUNE_ANTENNA_CAPACITOR (V4L2_CID_FM_TX_CLASS_BASE + 114) 1607#define V4L2_CID_TUNE_ANTENNA_CAPACITOR (V4L2_CID_FM_TX_CLASS_BASE + 114)
1429 1608
1609/* Flash and privacy (indicator) light controls */
1610#define V4L2_CID_FLASH_CLASS_BASE (V4L2_CTRL_CLASS_FLASH | 0x900)
1611#define V4L2_CID_FLASH_CLASS (V4L2_CTRL_CLASS_FLASH | 1)
1612
1613#define V4L2_CID_FLASH_LED_MODE (V4L2_CID_FLASH_CLASS_BASE + 1)
1614enum v4l2_flash_led_mode {
1615 V4L2_FLASH_LED_MODE_NONE,
1616 V4L2_FLASH_LED_MODE_FLASH,
1617 V4L2_FLASH_LED_MODE_TORCH,
1618};
1619
1620#define V4L2_CID_FLASH_STROBE_SOURCE (V4L2_CID_FLASH_CLASS_BASE + 2)
1621enum v4l2_flash_strobe_source {
1622 V4L2_FLASH_STROBE_SOURCE_SOFTWARE,
1623 V4L2_FLASH_STROBE_SOURCE_EXTERNAL,
1624};
1625
1626#define V4L2_CID_FLASH_STROBE (V4L2_CID_FLASH_CLASS_BASE + 3)
1627#define V4L2_CID_FLASH_STROBE_STOP (V4L2_CID_FLASH_CLASS_BASE + 4)
1628#define V4L2_CID_FLASH_STROBE_STATUS (V4L2_CID_FLASH_CLASS_BASE + 5)
1629
1630#define V4L2_CID_FLASH_TIMEOUT (V4L2_CID_FLASH_CLASS_BASE + 6)
1631#define V4L2_CID_FLASH_INTENSITY (V4L2_CID_FLASH_CLASS_BASE + 7)
1632#define V4L2_CID_FLASH_TORCH_INTENSITY (V4L2_CID_FLASH_CLASS_BASE + 8)
1633#define V4L2_CID_FLASH_INDICATOR_INTENSITY (V4L2_CID_FLASH_CLASS_BASE + 9)
1634
1635#define V4L2_CID_FLASH_FAULT (V4L2_CID_FLASH_CLASS_BASE + 10)
1636#define V4L2_FLASH_FAULT_OVER_VOLTAGE (1 << 0)
1637#define V4L2_FLASH_FAULT_TIMEOUT (1 << 1)
1638#define V4L2_FLASH_FAULT_OVER_TEMPERATURE (1 << 2)
1639#define V4L2_FLASH_FAULT_SHORT_CIRCUIT (1 << 3)
1640
1641#define V4L2_CID_FLASH_CHARGE (V4L2_CID_FLASH_CLASS_BASE + 11)
1642#define V4L2_CID_FLASH_READY (V4L2_CID_FLASH_CLASS_BASE + 12)
1643
1430/* 1644/*
1431 * T U N I N G 1645 * T U N I N G
1432 */ 1646 */
@@ -1791,6 +2005,7 @@ struct v4l2_streamparm {
1791#define V4L2_EVENT_ALL 0 2005#define V4L2_EVENT_ALL 0
1792#define V4L2_EVENT_VSYNC 1 2006#define V4L2_EVENT_VSYNC 1
1793#define V4L2_EVENT_EOS 2 2007#define V4L2_EVENT_EOS 2
2008#define V4L2_EVENT_CTRL 3
1794#define V4L2_EVENT_PRIVATE_START 0x08000000 2009#define V4L2_EVENT_PRIVATE_START 0x08000000
1795 2010
1796/* Payload for V4L2_EVENT_VSYNC */ 2011/* Payload for V4L2_EVENT_VSYNC */
@@ -1799,21 +2014,46 @@ struct v4l2_event_vsync {
1799 __u8 field; 2014 __u8 field;
1800} __attribute__ ((packed)); 2015} __attribute__ ((packed));
1801 2016
2017/* Payload for V4L2_EVENT_CTRL */
2018#define V4L2_EVENT_CTRL_CH_VALUE (1 << 0)
2019#define V4L2_EVENT_CTRL_CH_FLAGS (1 << 1)
2020
2021struct v4l2_event_ctrl {
2022 __u32 changes;
2023 __u32 type;
2024 union {
2025 __s32 value;
2026 __s64 value64;
2027 };
2028 __u32 flags;
2029 __s32 minimum;
2030 __s32 maximum;
2031 __s32 step;
2032 __s32 default_value;
2033};
2034
1802struct v4l2_event { 2035struct v4l2_event {
1803 __u32 type; 2036 __u32 type;
1804 union { 2037 union {
1805 struct v4l2_event_vsync vsync; 2038 struct v4l2_event_vsync vsync;
2039 struct v4l2_event_ctrl ctrl;
1806 __u8 data[64]; 2040 __u8 data[64];
1807 } u; 2041 } u;
1808 __u32 pending; 2042 __u32 pending;
1809 __u32 sequence; 2043 __u32 sequence;
1810 struct timespec timestamp; 2044 struct timespec timestamp;
1811 __u32 reserved[9]; 2045 __u32 id;
2046 __u32 reserved[8];
1812}; 2047};
1813 2048
2049#define V4L2_EVENT_SUB_FL_SEND_INITIAL (1 << 0)
2050#define V4L2_EVENT_SUB_FL_ALLOW_FEEDBACK (1 << 1)
2051
1814struct v4l2_event_subscription { 2052struct v4l2_event_subscription {
1815 __u32 type; 2053 __u32 type;
1816 __u32 reserved[7]; 2054 __u32 id;
2055 __u32 flags;
2056 __u32 reserved[5];
1817}; 2057};
1818 2058
1819/* 2059/*
diff --git a/include/linux/virtio.h b/include/linux/virtio.h
index aff5b4f74041..710885749605 100644
--- a/include/linux/virtio.h
+++ b/include/linux/virtio.h
@@ -51,6 +51,13 @@ struct virtqueue {
51 * This re-enables callbacks; it returns "false" if there are pending 51 * This re-enables callbacks; it returns "false" if there are pending
52 * buffers in the queue, to detect a possible race between the driver 52 * buffers in the queue, to detect a possible race between the driver
53 * checking for more work, and enabling callbacks. 53 * checking for more work, and enabling callbacks.
54 * virtqueue_enable_cb_delayed: restart callbacks after disable_cb.
55 * vq: the struct virtqueue we're talking about.
56 * This re-enables callbacks but hints to the other side to delay
57 * interrupts until most of the available buffers have been processed;
58 * it returns "false" if there are many pending buffers in the queue,
59 * to detect a possible race between the driver checking for more work,
60 * and enabling callbacks.
54 * virtqueue_detach_unused_buf: detach first unused buffer 61 * virtqueue_detach_unused_buf: detach first unused buffer
55 * vq: the struct virtqueue we're talking about. 62 * vq: the struct virtqueue we're talking about.
56 * Returns NULL or the "data" token handed to add_buf 63 * Returns NULL or the "data" token handed to add_buf
@@ -86,6 +93,8 @@ void virtqueue_disable_cb(struct virtqueue *vq);
86 93
87bool virtqueue_enable_cb(struct virtqueue *vq); 94bool virtqueue_enable_cb(struct virtqueue *vq);
88 95
96bool virtqueue_enable_cb_delayed(struct virtqueue *vq);
97
89void *virtqueue_detach_unused_buf(struct virtqueue *vq); 98void *virtqueue_detach_unused_buf(struct virtqueue *vq);
90 99
91/** 100/**
diff --git a/include/linux/virtio_9p.h b/include/linux/virtio_9p.h
index e68b439b2860..277c4ad44e84 100644
--- a/include/linux/virtio_9p.h
+++ b/include/linux/virtio_9p.h
@@ -1,7 +1,30 @@
1#ifndef _LINUX_VIRTIO_9P_H 1#ifndef _LINUX_VIRTIO_9P_H
2#define _LINUX_VIRTIO_9P_H 2#define _LINUX_VIRTIO_9P_H
3/* This header is BSD licensed so anyone can use the definitions to implement 3/* This header is BSD licensed so anyone can use the definitions to implement
4 * compatible drivers/servers. */ 4 * compatible drivers/servers.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
8 * are met:
9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer.
11 * 2. Redistributions in binary form must reproduce the above copyright
12 * notice, this list of conditions and the following disclaimer in the
13 * documentation and/or other materials provided with the distribution.
14 * 3. Neither the name of IBM nor the names of its contributors
15 * may be used to endorse or promote products derived from this software
16 * without specific prior written permission.
17 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS'' AND
18 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
20 * ARE DISCLAIMED. IN NO EVENT SHALL IBM OR CONTRIBUTORS BE LIABLE
21 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
22 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
23 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
24 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
25 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
26 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
27 * SUCH DAMAGE. */
5#include <linux/types.h> 28#include <linux/types.h>
6#include <linux/virtio_ids.h> 29#include <linux/virtio_ids.h>
7#include <linux/virtio_config.h> 30#include <linux/virtio_config.h>
diff --git a/include/linux/virtio_balloon.h b/include/linux/virtio_balloon.h
index a50ecd1b81a2..652dc8bea921 100644
--- a/include/linux/virtio_balloon.h
+++ b/include/linux/virtio_balloon.h
@@ -1,7 +1,30 @@
1#ifndef _LINUX_VIRTIO_BALLOON_H 1#ifndef _LINUX_VIRTIO_BALLOON_H
2#define _LINUX_VIRTIO_BALLOON_H 2#define _LINUX_VIRTIO_BALLOON_H
3/* This header is BSD licensed so anyone can use the definitions to implement 3/* This header is BSD licensed so anyone can use the definitions to implement
4 * compatible drivers/servers. */ 4 * compatible drivers/servers.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
8 * are met:
9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer.
11 * 2. Redistributions in binary form must reproduce the above copyright
12 * notice, this list of conditions and the following disclaimer in the
13 * documentation and/or other materials provided with the distribution.
14 * 3. Neither the name of IBM nor the names of its contributors
15 * may be used to endorse or promote products derived from this software
16 * without specific prior written permission.
17 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS'' AND
18 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
20 * ARE DISCLAIMED. IN NO EVENT SHALL IBM OR CONTRIBUTORS BE LIABLE
21 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
22 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
23 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
24 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
25 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
26 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
27 * SUCH DAMAGE. */
5#include <linux/virtio_ids.h> 28#include <linux/virtio_ids.h>
6#include <linux/virtio_config.h> 29#include <linux/virtio_config.h>
7 30
diff --git a/include/linux/virtio_blk.h b/include/linux/virtio_blk.h
index 167720d695ed..e0edb40ca7aa 100644
--- a/include/linux/virtio_blk.h
+++ b/include/linux/virtio_blk.h
@@ -1,7 +1,30 @@
1#ifndef _LINUX_VIRTIO_BLK_H 1#ifndef _LINUX_VIRTIO_BLK_H
2#define _LINUX_VIRTIO_BLK_H 2#define _LINUX_VIRTIO_BLK_H
3/* This header is BSD licensed so anyone can use the definitions to implement 3/* This header is BSD licensed so anyone can use the definitions to implement
4 * compatible drivers/servers. */ 4 * compatible drivers/servers.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
8 * are met:
9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer.
11 * 2. Redistributions in binary form must reproduce the above copyright
12 * notice, this list of conditions and the following disclaimer in the
13 * documentation and/or other materials provided with the distribution.
14 * 3. Neither the name of IBM nor the names of its contributors
15 * may be used to endorse or promote products derived from this software
16 * without specific prior written permission.
17 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS'' AND
18 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
20 * ARE DISCLAIMED. IN NO EVENT SHALL IBM OR CONTRIBUTORS BE LIABLE
21 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
22 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
23 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
24 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
25 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
26 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
27 * SUCH DAMAGE. */
5#include <linux/types.h> 28#include <linux/types.h>
6#include <linux/virtio_ids.h> 29#include <linux/virtio_ids.h>
7#include <linux/virtio_config.h> 30#include <linux/virtio_config.h>
diff --git a/include/linux/virtio_config.h b/include/linux/virtio_config.h
index 800617b4ddd5..39c88c5ad19d 100644
--- a/include/linux/virtio_config.h
+++ b/include/linux/virtio_config.h
@@ -1,7 +1,30 @@
1#ifndef _LINUX_VIRTIO_CONFIG_H 1#ifndef _LINUX_VIRTIO_CONFIG_H
2#define _LINUX_VIRTIO_CONFIG_H 2#define _LINUX_VIRTIO_CONFIG_H
3/* This header, excluding the #ifdef __KERNEL__ part, is BSD licensed so 3/* This header, excluding the #ifdef __KERNEL__ part, is BSD licensed so
4 * anyone can use the definitions to implement compatible drivers/servers. */ 4 * anyone can use the definitions to implement compatible drivers/servers.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
8 * are met:
9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer.
11 * 2. Redistributions in binary form must reproduce the above copyright
12 * notice, this list of conditions and the following disclaimer in the
13 * documentation and/or other materials provided with the distribution.
14 * 3. Neither the name of IBM nor the names of its contributors
15 * may be used to endorse or promote products derived from this software
16 * without specific prior written permission.
17 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS'' AND
18 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
20 * ARE DISCLAIMED. IN NO EVENT SHALL IBM OR CONTRIBUTORS BE LIABLE
21 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
22 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
23 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
24 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
25 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
26 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
27 * SUCH DAMAGE. */
5 28
6/* Virtio devices use a standardized configuration space to define their 29/* Virtio devices use a standardized configuration space to define their
7 * features and pass configuration information, but each implementation can 30 * features and pass configuration information, but each implementation can
diff --git a/include/linux/virtio_console.h b/include/linux/virtio_console.h
index e4d333543a33..bdf4b0034739 100644
--- a/include/linux/virtio_console.h
+++ b/include/linux/virtio_console.h
@@ -5,7 +5,31 @@
5#include <linux/virtio_config.h> 5#include <linux/virtio_config.h>
6/* 6/*
7 * This header, excluding the #ifdef __KERNEL__ part, is BSD licensed so 7 * This header, excluding the #ifdef __KERNEL__ part, is BSD licensed so
8 * anyone can use the definitions to implement compatible drivers/servers. 8 * anyone can use the definitions to implement compatible drivers/servers:
9 *
10 *
11 * Redistribution and use in source and binary forms, with or without
12 * modification, are permitted provided that the following conditions
13 * are met:
14 * 1. Redistributions of source code must retain the above copyright
15 * notice, this list of conditions and the following disclaimer.
16 * 2. Redistributions in binary form must reproduce the above copyright
17 * notice, this list of conditions and the following disclaimer in the
18 * documentation and/or other materials provided with the distribution.
19 * 3. Neither the name of IBM nor the names of its contributors
20 * may be used to endorse or promote products derived from this software
21 * without specific prior written permission.
22 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS'' AND
23 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
24 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
25 * ARE DISCLAIMED. IN NO EVENT SHALL IBM OR CONTRIBUTORS BE LIABLE
26 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
27 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
28 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
29 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
30 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
31 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
32 * SUCH DAMAGE.
9 * 33 *
10 * Copyright (C) Red Hat, Inc., 2009, 2010, 2011 34 * Copyright (C) Red Hat, Inc., 2009, 2010, 2011
11 * Copyright (C) Amit Shah <amit.shah@redhat.com>, 2009, 2010, 2011 35 * Copyright (C) Amit Shah <amit.shah@redhat.com>, 2009, 2010, 2011
diff --git a/include/linux/virtio_ids.h b/include/linux/virtio_ids.h
index 06660c0a78d7..85bb0bb66ffc 100644
--- a/include/linux/virtio_ids.h
+++ b/include/linux/virtio_ids.h
@@ -5,7 +5,29 @@
5 * 5 *
6 * This header is BSD licensed so anyone can use the definitions to implement 6 * This header is BSD licensed so anyone can use the definitions to implement
7 * compatible drivers/servers. 7 * compatible drivers/servers.
8 */ 8 *
9 * Redistribution and use in source and binary forms, with or without
10 * modification, are permitted provided that the following conditions
11 * are met:
12 * 1. Redistributions of source code must retain the above copyright
13 * notice, this list of conditions and the following disclaimer.
14 * 2. Redistributions in binary form must reproduce the above copyright
15 * notice, this list of conditions and the following disclaimer in the
16 * documentation and/or other materials provided with the distribution.
17 * 3. Neither the name of IBM nor the names of its contributors
18 * may be used to endorse or promote products derived from this software
19 * without specific prior written permission.
20 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS'' AND
21 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
22 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
23 * ARE DISCLAIMED. IN NO EVENT SHALL IBM OR CONTRIBUTORS BE LIABLE
24 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
25 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
26 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
27 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
28 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
29 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
30 * SUCH DAMAGE. */
9 31
10#define VIRTIO_ID_NET 1 /* virtio net */ 32#define VIRTIO_ID_NET 1 /* virtio net */
11#define VIRTIO_ID_BLOCK 2 /* virtio block */ 33#define VIRTIO_ID_BLOCK 2 /* virtio block */
diff --git a/include/linux/virtio_net.h b/include/linux/virtio_net.h
index 085e42298ce5..970d5a2a9047 100644
--- a/include/linux/virtio_net.h
+++ b/include/linux/virtio_net.h
@@ -1,7 +1,30 @@
1#ifndef _LINUX_VIRTIO_NET_H 1#ifndef _LINUX_VIRTIO_NET_H
2#define _LINUX_VIRTIO_NET_H 2#define _LINUX_VIRTIO_NET_H
3/* This header is BSD licensed so anyone can use the definitions to implement 3/* This header is BSD licensed so anyone can use the definitions to implement
4 * compatible drivers/servers. */ 4 * compatible drivers/servers.
5 *
6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions
8 * are met:
9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer.
11 * 2. Redistributions in binary form must reproduce the above copyright
12 * notice, this list of conditions and the following disclaimer in the
13 * documentation and/or other materials provided with the distribution.
14 * 3. Neither the name of IBM nor the names of its contributors
15 * may be used to endorse or promote products derived from this software
16 * without specific prior written permission.
17 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS'' AND
18 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
19 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
20 * ARE DISCLAIMED. IN NO EVENT SHALL IBM OR CONTRIBUTORS BE LIABLE
21 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
22 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
23 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
24 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
25 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
26 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
27 * SUCH DAMAGE. */
5#include <linux/types.h> 28#include <linux/types.h>
6#include <linux/virtio_ids.h> 29#include <linux/virtio_ids.h>
7#include <linux/virtio_config.h> 30#include <linux/virtio_config.h>
@@ -40,6 +63,7 @@ struct virtio_net_config {
40 * specify GSO or CSUM features, you can simply ignore the header. */ 63 * specify GSO or CSUM features, you can simply ignore the header. */
41struct virtio_net_hdr { 64struct virtio_net_hdr {
42#define VIRTIO_NET_HDR_F_NEEDS_CSUM 1 // Use csum_start, csum_offset 65#define VIRTIO_NET_HDR_F_NEEDS_CSUM 1 // Use csum_start, csum_offset
66#define VIRTIO_NET_HDR_F_DATA_VALID 2 // Csum is valid
43 __u8 flags; 67 __u8 flags;
44#define VIRTIO_NET_HDR_GSO_NONE 0 // Not a GSO frame 68#define VIRTIO_NET_HDR_GSO_NONE 0 // Not a GSO frame
45#define VIRTIO_NET_HDR_GSO_TCPV4 1 // GSO frame, IPv4 TCP (TSO) 69#define VIRTIO_NET_HDR_GSO_TCPV4 1 // GSO frame, IPv4 TCP (TSO)
diff --git a/include/linux/virtio_pci.h b/include/linux/virtio_pci.h
index 9a3d7c48c622..ea66f3f60d63 100644
--- a/include/linux/virtio_pci.h
+++ b/include/linux/virtio_pci.h
@@ -11,6 +11,29 @@
11 * 11 *
12 * This header is BSD licensed so anyone can use the definitions to implement 12 * This header is BSD licensed so anyone can use the definitions to implement
13 * compatible drivers/servers. 13 * compatible drivers/servers.
14 *
15 * Redistribution and use in source and binary forms, with or without
16 * modification, are permitted provided that the following conditions
17 * are met:
18 * 1. Redistributions of source code must retain the above copyright
19 * notice, this list of conditions and the following disclaimer.
20 * 2. Redistributions in binary form must reproduce the above copyright
21 * notice, this list of conditions and the following disclaimer in the
22 * documentation and/or other materials provided with the distribution.
23 * 3. Neither the name of IBM nor the names of its contributors
24 * may be used to endorse or promote products derived from this software
25 * without specific prior written permission.
26 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS 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 IBM 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.
14 */ 37 */
15 38
16#ifndef _LINUX_VIRTIO_PCI_H 39#ifndef _LINUX_VIRTIO_PCI_H
diff --git a/include/linux/virtio_ring.h b/include/linux/virtio_ring.h
index e4d144b132b5..4a32cb6da425 100644
--- a/include/linux/virtio_ring.h
+++ b/include/linux/virtio_ring.h
@@ -7,6 +7,29 @@
7 * This header is BSD licensed so anyone can use the definitions to implement 7 * This header is BSD licensed so anyone can use the definitions to implement
8 * compatible drivers/servers. 8 * compatible drivers/servers.
9 * 9 *
10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted provided that the following conditions
12 * are met:
13 * 1. Redistributions of source code must retain the above copyright
14 * notice, this list of conditions and the following disclaimer.
15 * 2. Redistributions in binary form must reproduce the above copyright
16 * notice, this list of conditions and the following disclaimer in the
17 * documentation and/or other materials provided with the distribution.
18 * 3. Neither the name of IBM nor the names of its contributors
19 * may be used to endorse or promote products derived from this software
20 * without specific prior written permission.
21 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS'' AND
22 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
23 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
24 * ARE DISCLAIMED. IN NO EVENT SHALL IBM OR CONTRIBUTORS BE LIABLE
25 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
26 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
27 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
28 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
29 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
30 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
31 * SUCH DAMAGE.
32 *
10 * Copyright Rusty Russell IBM Corporation 2007. */ 33 * Copyright Rusty Russell IBM Corporation 2007. */
11#include <linux/types.h> 34#include <linux/types.h>
12 35
@@ -29,6 +52,12 @@
29/* We support indirect buffer descriptors */ 52/* We support indirect buffer descriptors */
30#define VIRTIO_RING_F_INDIRECT_DESC 28 53#define VIRTIO_RING_F_INDIRECT_DESC 28
31 54
55/* The Guest publishes the used index for which it expects an interrupt
56 * at the end of the avail ring. Host should ignore the avail->flags field. */
57/* The Host publishes the avail index for which it expects a kick
58 * at the end of the used ring. Guest should ignore the used->flags field. */
59#define VIRTIO_RING_F_EVENT_IDX 29
60
32/* Virtio ring descriptors: 16 bytes. These can chain together via "next". */ 61/* Virtio ring descriptors: 16 bytes. These can chain together via "next". */
33struct vring_desc { 62struct vring_desc {
34 /* Address (guest-physical). */ 63 /* Address (guest-physical). */
@@ -83,6 +112,7 @@ struct vring {
83 * __u16 avail_flags; 112 * __u16 avail_flags;
84 * __u16 avail_idx; 113 * __u16 avail_idx;
85 * __u16 available[num]; 114 * __u16 available[num];
115 * __u16 used_event_idx;
86 * 116 *
87 * // Padding to the next align boundary. 117 * // Padding to the next align boundary.
88 * char pad[]; 118 * char pad[];
@@ -91,8 +121,14 @@ struct vring {
91 * __u16 used_flags; 121 * __u16 used_flags;
92 * __u16 used_idx; 122 * __u16 used_idx;
93 * struct vring_used_elem used[num]; 123 * struct vring_used_elem used[num];
124 * __u16 avail_event_idx;
94 * }; 125 * };
95 */ 126 */
127/* We publish the used event index at the end of the available ring, and vice
128 * versa. They are at the end for backwards compatibility. */
129#define vring_used_event(vr) ((vr)->avail->ring[(vr)->num])
130#define vring_avail_event(vr) (*(__u16 *)&(vr)->used->ring[(vr)->num])
131
96static inline void vring_init(struct vring *vr, unsigned int num, void *p, 132static inline void vring_init(struct vring *vr, unsigned int num, void *p,
97 unsigned long align) 133 unsigned long align)
98{ 134{
@@ -107,7 +143,21 @@ static inline unsigned vring_size(unsigned int num, unsigned long align)
107{ 143{
108 return ((sizeof(struct vring_desc) * num + sizeof(__u16) * (2 + num) 144 return ((sizeof(struct vring_desc) * num + sizeof(__u16) * (2 + num)
109 + align - 1) & ~(align - 1)) 145 + align - 1) & ~(align - 1))
110 + sizeof(__u16) * 2 + sizeof(struct vring_used_elem) * num; 146 + sizeof(__u16) * 3 + sizeof(struct vring_used_elem) * num;
147}
148
149/* The following is used with USED_EVENT_IDX and AVAIL_EVENT_IDX */
150/* Assuming a given event_idx value from the other size, if
151 * we have just incremented index from old to new_idx,
152 * should we trigger an event? */
153static inline int vring_need_event(__u16 event_idx, __u16 new_idx, __u16 old)
154{
155 /* Note: Xen has similar logic for notification hold-off
156 * in include/xen/interface/io/ring.h with req_event and req_prod
157 * corresponding to event_idx + 1 and new_idx respectively.
158 * Note also that req_event and req_prod in Xen start at 1,
159 * event indexes in virtio start at 0. */
160 return (__u16)(new_idx - event_idx - 1) < (__u16)(new_idx - old);
111} 161}
112 162
113#ifdef __KERNEL__ 163#ifdef __KERNEL__
diff --git a/include/linux/vmstat.h b/include/linux/vmstat.h
index bcd942fa611c..65efb92da996 100644
--- a/include/linux/vmstat.h
+++ b/include/linux/vmstat.h
@@ -6,7 +6,7 @@
6#include <linux/mm.h> 6#include <linux/mm.h>
7#include <linux/mmzone.h> 7#include <linux/mmzone.h>
8#include <linux/vm_event_item.h> 8#include <linux/vm_event_item.h>
9#include <asm/atomic.h> 9#include <linux/atomic.h>
10 10
11extern int sysctl_stat_interval; 11extern int sysctl_stat_interval;
12 12
diff --git a/include/linux/vt.h b/include/linux/vt.h
index d5dd0bc408fd..30a8dd9c83ff 100644
--- a/include/linux/vt.h
+++ b/include/linux/vt.h
@@ -86,6 +86,13 @@ struct vt_setactivate {
86 86
87#ifdef __KERNEL__ 87#ifdef __KERNEL__
88 88
89/* Virtual Terminal events. */
90#define VT_ALLOCATE 0x0001 /* Console got allocated */
91#define VT_DEALLOCATE 0x0002 /* Console will be deallocated */
92#define VT_WRITE 0x0003 /* A char got output */
93#define VT_UPDATE 0x0004 /* A bigger update occurred */
94#define VT_PREWRITE 0x0005 /* A char is about to be written to the console */
95
89#ifdef CONFIG_VT_CONSOLE 96#ifdef CONFIG_VT_CONSOLE
90 97
91extern int vt_kmsg_redirect(int new); 98extern int vt_kmsg_redirect(int new);
diff --git a/include/linux/vt_kern.h b/include/linux/vt_kern.h
index 4d05e14ea60c..c2164fad0083 100644
--- a/include/linux/vt_kern.h
+++ b/include/linux/vt_kern.h
@@ -137,7 +137,7 @@ int vty_init(const struct file_operations *console_fops);
137 137
138static inline bool vt_force_oops_output(struct vc_data *vc) 138static inline bool vt_force_oops_output(struct vc_data *vc)
139{ 139{
140 if (oops_in_progress && vc->vc_panic_force_write) 140 if (oops_in_progress && vc->vc_panic_force_write && panic_timeout >= 0)
141 return true; 141 return true;
142 return false; 142 return false;
143} 143}
diff --git a/include/linux/watchdog.h b/include/linux/watchdog.h
index 011bcfeb9f09..111843f88b2a 100644
--- a/include/linux/watchdog.h
+++ b/include/linux/watchdog.h
@@ -59,6 +59,84 @@ struct watchdog_info {
59#define WATCHDOG_NOWAYOUT 0 59#define WATCHDOG_NOWAYOUT 0
60#endif 60#endif
61 61
62struct watchdog_ops;
63struct watchdog_device;
64
65/** struct watchdog_ops - The watchdog-devices operations
66 *
67 * @owner: The module owner.
68 * @start: The routine for starting the watchdog device.
69 * @stop: The routine for stopping the watchdog device.
70 * @ping: The routine that sends a keepalive ping to the watchdog device.
71 * @status: The routine that shows the status of the watchdog device.
72 * @set_timeout:The routine for setting the watchdog devices timeout value.
73 * @ioctl: The routines that handles extra ioctl calls.
74 *
75 * The watchdog_ops structure contains a list of low-level operations
76 * that control a watchdog device. It also contains the module that owns
77 * these operations. The start and stop function are mandatory, all other
78 * functions are optonal.
79 */
80struct watchdog_ops {
81 struct module *owner;
82 /* mandatory operations */
83 int (*start)(struct watchdog_device *);
84 int (*stop)(struct watchdog_device *);
85 /* optional operations */
86 int (*ping)(struct watchdog_device *);
87 unsigned int (*status)(struct watchdog_device *);
88 int (*set_timeout)(struct watchdog_device *, unsigned int);
89 long (*ioctl)(struct watchdog_device *, unsigned int, unsigned long);
90};
91
92/** struct watchdog_device - The structure that defines a watchdog device
93 *
94 * @info: Pointer to a watchdog_info structure.
95 * @ops: Pointer to the list of watchdog operations.
96 * @bootstatus: Status of the watchdog device at boot.
97 * @timeout: The watchdog devices timeout value.
98 * @min_timeout:The watchdog devices minimum timeout value.
99 * @max_timeout:The watchdog devices maximum timeout value.
100 * @driver-data:Pointer to the drivers private data.
101 * @status: Field that contains the devices internal status bits.
102 *
103 * The watchdog_device structure contains all information about a
104 * watchdog timer device.
105 *
106 * The driver-data field may not be accessed directly. It must be accessed
107 * via the watchdog_set_drvdata and watchdog_get_drvdata helpers.
108 */
109struct watchdog_device {
110 const struct watchdog_info *info;
111 const struct watchdog_ops *ops;
112 unsigned int bootstatus;
113 unsigned int timeout;
114 unsigned int min_timeout;
115 unsigned int max_timeout;
116 void *driver_data;
117 unsigned long status;
118/* Bit numbers for status flags */
119#define WDOG_ACTIVE 0 /* Is the watchdog running/active */
120#define WDOG_DEV_OPEN 1 /* Opened via /dev/watchdog ? */
121#define WDOG_ALLOW_RELEASE 2 /* Did we receive the magic char ? */
122#define WDOG_NO_WAY_OUT 3 /* Is 'nowayout' feature set ? */
123};
124
125/* Use the following functions to manipulate watchdog driver specific data */
126static inline void watchdog_set_drvdata(struct watchdog_device *wdd, void *data)
127{
128 wdd->driver_data = data;
129}
130
131static inline void *watchdog_get_drvdata(struct watchdog_device *wdd)
132{
133 return wdd->driver_data;
134}
135
136/* drivers/watchdog/core/watchdog_core.c */
137extern int watchdog_register_device(struct watchdog_device *);
138extern void watchdog_unregister_device(struct watchdog_device *);
139
62#endif /* __KERNEL__ */ 140#endif /* __KERNEL__ */
63 141
64#endif /* ifndef _LINUX_WATCHDOG_H */ 142#endif /* ifndef _LINUX_WATCHDOG_H */
diff --git a/include/linux/wm97xx.h b/include/linux/wm97xx.h
index 38e8c4d9289e..fd98bb968219 100644
--- a/include/linux/wm97xx.h
+++ b/include/linux/wm97xx.h
@@ -38,7 +38,11 @@
38#define WM97XX_ADCSEL_X 0x1000 /* x coord measurement */ 38#define WM97XX_ADCSEL_X 0x1000 /* x coord measurement */
39#define WM97XX_ADCSEL_Y 0x2000 /* y coord measurement */ 39#define WM97XX_ADCSEL_Y 0x2000 /* y coord measurement */
40#define WM97XX_ADCSEL_PRES 0x3000 /* pressure measurement */ 40#define WM97XX_ADCSEL_PRES 0x3000 /* pressure measurement */
41#define WM97XX_ADCSEL_MASK 0x7000 41#define WM97XX_AUX_ID1 0x4000
42#define WM97XX_AUX_ID2 0x5000
43#define WM97XX_AUX_ID3 0x6000
44#define WM97XX_AUX_ID4 0x7000
45#define WM97XX_ADCSEL_MASK 0x7000 /* ADC selection mask */
42#define WM97XX_COO 0x0800 /* enable coordinate mode */ 46#define WM97XX_COO 0x0800 /* enable coordinate mode */
43#define WM97XX_CTC 0x0400 /* enable continuous mode */ 47#define WM97XX_CTC 0x0400 /* enable continuous mode */
44#define WM97XX_CM_RATE_93 0x0000 /* 93.75Hz continuous rate */ 48#define WM97XX_CM_RATE_93 0x0000 /* 93.75Hz continuous rate */
@@ -61,13 +65,6 @@
61#define WM97XX_PRP_DET_DIG 0xc000 /* setect on, digitise on */ 65#define WM97XX_PRP_DET_DIG 0xc000 /* setect on, digitise on */
62#define WM97XX_RPR 0x2000 /* wake up on pen down */ 66#define WM97XX_RPR 0x2000 /* wake up on pen down */
63#define WM97XX_PEN_DOWN 0x8000 /* pen is down */ 67#define WM97XX_PEN_DOWN 0x8000 /* pen is down */
64#define WM97XX_ADCSRC_MASK 0x7000 /* ADC source mask */
65
66#define WM97XX_AUX_ID1 0x8001
67#define WM97XX_AUX_ID2 0x8002
68#define WM97XX_AUX_ID3 0x8003
69#define WM97XX_AUX_ID4 0x8004
70
71 68
72/* WM9712 Bits */ 69/* WM9712 Bits */
73#define WM9712_45W 0x1000 /* set for 5-wire touchscreen */ 70#define WM9712_45W 0x1000 /* set for 5-wire touchscreen */
diff --git a/include/linux/workqueue.h b/include/linux/workqueue.h
index f584aba78ca9..0d556deb497b 100644
--- a/include/linux/workqueue.h
+++ b/include/linux/workqueue.h
@@ -10,7 +10,7 @@
10#include <linux/bitops.h> 10#include <linux/bitops.h>
11#include <linux/lockdep.h> 11#include <linux/lockdep.h>
12#include <linux/threads.h> 12#include <linux/threads.h>
13#include <asm/atomic.h> 13#include <linux/atomic.h>
14 14
15struct workqueue_struct; 15struct workqueue_struct;
16 16
@@ -255,7 +255,7 @@ enum {
255 WQ_HIGHPRI = 1 << 4, /* high priority */ 255 WQ_HIGHPRI = 1 << 4, /* high priority */
256 WQ_CPU_INTENSIVE = 1 << 5, /* cpu instensive workqueue */ 256 WQ_CPU_INTENSIVE = 1 << 5, /* cpu instensive workqueue */
257 257
258 WQ_DYING = 1 << 6, /* internal: workqueue is dying */ 258 WQ_DRAINING = 1 << 6, /* internal: workqueue is draining */
259 WQ_RESCUER = 1 << 7, /* internal: workqueue has rescuer */ 259 WQ_RESCUER = 1 << 7, /* internal: workqueue has rescuer */
260 260
261 WQ_MAX_ACTIVE = 512, /* I like 512, better ideas? */ 261 WQ_MAX_ACTIVE = 512, /* I like 512, better ideas? */
@@ -355,6 +355,7 @@ extern int queue_delayed_work_on(int cpu, struct workqueue_struct *wq,
355 struct delayed_work *work, unsigned long delay); 355 struct delayed_work *work, unsigned long delay);
356 356
357extern void flush_workqueue(struct workqueue_struct *wq); 357extern void flush_workqueue(struct workqueue_struct *wq);
358extern void drain_workqueue(struct workqueue_struct *wq);
358extern void flush_scheduled_work(void); 359extern void flush_scheduled_work(void);
359 360
360extern int schedule_work(struct work_struct *work); 361extern int schedule_work(struct work_struct *work);
@@ -412,21 +413,6 @@ static inline bool __cancel_delayed_work(struct delayed_work *work)
412 return ret; 413 return ret;
413} 414}
414 415
415/* Obsolete. use cancel_delayed_work_sync() */
416static inline __deprecated
417void cancel_rearming_delayed_workqueue(struct workqueue_struct *wq,
418 struct delayed_work *work)
419{
420 cancel_delayed_work_sync(work);
421}
422
423/* Obsolete. use cancel_delayed_work_sync() */
424static inline __deprecated
425void cancel_rearming_delayed_work(struct delayed_work *work)
426{
427 cancel_delayed_work_sync(work);
428}
429
430#ifndef CONFIG_SMP 416#ifndef CONFIG_SMP
431static inline long work_on_cpu(unsigned int cpu, long (*fn)(void *), void *arg) 417static inline long work_on_cpu(unsigned int cpu, long (*fn)(void *), void *arg)
432{ 418{
diff --git a/include/linux/writeback.h b/include/linux/writeback.h
index 17e7ccc322a5..f1bfa12ea246 100644
--- a/include/linux/writeback.h
+++ b/include/linux/writeback.h
@@ -7,9 +7,39 @@
7#include <linux/sched.h> 7#include <linux/sched.h>
8#include <linux/fs.h> 8#include <linux/fs.h>
9 9
10struct backing_dev_info; 10/*
11 * The 1/4 region under the global dirty thresh is for smooth dirty throttling:
12 *
13 * (thresh - thresh/DIRTY_FULL_SCOPE, thresh)
14 *
15 * The 1/16 region above the global dirty limit will be put to maximum pauses:
16 *
17 * (limit, limit + limit/DIRTY_MAXPAUSE_AREA)
18 *
19 * The 1/16 region above the max-pause region, dirty exceeded bdi's will be put
20 * to loops:
21 *
22 * (limit + limit/DIRTY_MAXPAUSE_AREA, limit + limit/DIRTY_PASSGOOD_AREA)
23 *
24 * Further beyond, all dirtier tasks will enter a loop waiting (possibly long
25 * time) for the dirty pages to drop, unless written enough pages.
26 *
27 * The global dirty threshold is normally equal to the global dirty limit,
28 * except when the system suddenly allocates a lot of anonymous memory and
29 * knocks down the global dirty threshold quickly, in which case the global
30 * dirty limit will follow down slowly to prevent livelocking all dirtier tasks.
31 */
32#define DIRTY_SCOPE 8
33#define DIRTY_FULL_SCOPE (DIRTY_SCOPE / 2)
34#define DIRTY_MAXPAUSE_AREA 16
35#define DIRTY_PASSGOOD_AREA 8
11 36
12extern spinlock_t inode_wb_list_lock; 37/*
38 * 4MB minimal write chunk size
39 */
40#define MIN_WRITEBACK_PAGES (4096UL >> (PAGE_CACHE_SHIFT - 10))
41
42struct backing_dev_info;
13 43
14/* 44/*
15 * fs/fs-writeback.c 45 * fs/fs-writeback.c
@@ -26,11 +56,6 @@ enum writeback_sync_modes {
26 */ 56 */
27struct writeback_control { 57struct writeback_control {
28 enum writeback_sync_modes sync_mode; 58 enum writeback_sync_modes sync_mode;
29 unsigned long *older_than_this; /* If !NULL, only write back inodes
30 older than this */
31 unsigned long wb_start; /* Time writeback_inodes_wb was
32 called. This is needed to avoid
33 extra jobs and livelock */
34 long nr_to_write; /* Write this many pages, and decrement 59 long nr_to_write; /* Write this many pages, and decrement
35 this for each page written */ 60 this for each page written */
36 long pages_skipped; /* Pages which were not written */ 61 long pages_skipped; /* Pages which were not written */
@@ -43,13 +68,11 @@ struct writeback_control {
43 loff_t range_start; 68 loff_t range_start;
44 loff_t range_end; 69 loff_t range_end;
45 70
46 unsigned nonblocking:1; /* Don't get stuck on request queues */
47 unsigned encountered_congestion:1; /* An output: a queue is full */
48 unsigned for_kupdate:1; /* A kupdate writeback */ 71 unsigned for_kupdate:1; /* A kupdate writeback */
49 unsigned for_background:1; /* A background writeback */ 72 unsigned for_background:1; /* A background writeback */
73 unsigned tagged_writepages:1; /* tag-and-write to avoid livelock */
50 unsigned for_reclaim:1; /* Invoked from the page allocator */ 74 unsigned for_reclaim:1; /* Invoked from the page allocator */
51 unsigned range_cyclic:1; /* range_start is cyclic */ 75 unsigned range_cyclic:1; /* range_start is cyclic */
52 unsigned more_io:1; /* more io to be dispatched */
53}; 76};
54 77
55/* 78/*
@@ -62,8 +85,7 @@ void writeback_inodes_sb_nr(struct super_block *, unsigned long nr);
62int writeback_inodes_sb_if_idle(struct super_block *); 85int writeback_inodes_sb_if_idle(struct super_block *);
63int writeback_inodes_sb_nr_if_idle(struct super_block *, unsigned long nr); 86int writeback_inodes_sb_nr_if_idle(struct super_block *, unsigned long nr);
64void sync_inodes_sb(struct super_block *); 87void sync_inodes_sb(struct super_block *);
65void writeback_inodes_wb(struct bdi_writeback *wb, 88long writeback_inodes_wb(struct bdi_writeback *wb, long nr_pages);
66 struct writeback_control *wbc);
67long wb_do_writeback(struct bdi_writeback *wb, int force_wait); 89long wb_do_writeback(struct bdi_writeback *wb, int force_wait);
68void wakeup_flusher_threads(long nr_pages); 90void wakeup_flusher_threads(long nr_pages);
69 91
@@ -94,6 +116,8 @@ static inline void laptop_sync_completion(void) { }
94#endif 116#endif
95void throttle_vm_writeout(gfp_t gfp_mask); 117void throttle_vm_writeout(gfp_t gfp_mask);
96 118
119extern unsigned long global_dirty_limit;
120
97/* These are exported to sysctl. */ 121/* These are exported to sysctl. */
98extern int dirty_background_ratio; 122extern int dirty_background_ratio;
99extern unsigned long dirty_background_bytes; 123extern unsigned long dirty_background_bytes;
@@ -128,6 +152,13 @@ void global_dirty_limits(unsigned long *pbackground, unsigned long *pdirty);
128unsigned long bdi_dirty_limit(struct backing_dev_info *bdi, 152unsigned long bdi_dirty_limit(struct backing_dev_info *bdi,
129 unsigned long dirty); 153 unsigned long dirty);
130 154
155void __bdi_update_bandwidth(struct backing_dev_info *bdi,
156 unsigned long thresh,
157 unsigned long dirty,
158 unsigned long bdi_thresh,
159 unsigned long bdi_dirty,
160 unsigned long start_time);
161
131void page_writeback_init(void); 162void page_writeback_init(void);
132void balance_dirty_pages_ratelimited_nr(struct address_space *mapping, 163void balance_dirty_pages_ratelimited_nr(struct address_space *mapping,
133 unsigned long nr_pages_dirtied); 164 unsigned long nr_pages_dirtied);
diff --git a/include/linux/zorro.h b/include/linux/zorro.h
index 7bf9db525e9e..dff42025649b 100644
--- a/include/linux/zorro.h
+++ b/include/linux/zorro.h
@@ -187,7 +187,7 @@ extern struct zorro_dev *zorro_find_device(zorro_id id,
187 187
188#define zorro_resource_start(z) ((z)->resource.start) 188#define zorro_resource_start(z) ((z)->resource.start)
189#define zorro_resource_end(z) ((z)->resource.end) 189#define zorro_resource_end(z) ((z)->resource.end)
190#define zorro_resource_len(z) ((z)->resource.end-(z)->resource.start+1) 190#define zorro_resource_len(z) (resource_size(&(z)->resource))
191#define zorro_resource_flags(z) ((z)->resource.flags) 191#define zorro_resource_flags(z) ((z)->resource.flags)
192 192
193#define zorro_request_device(z, name) \ 193#define zorro_request_device(z, name) \
diff --git a/include/media/adp1653.h b/include/media/adp1653.h
new file mode 100644
index 000000000000..50a1af88aed0
--- /dev/null
+++ b/include/media/adp1653.h
@@ -0,0 +1,126 @@
1/*
2 * include/media/adp1653.h
3 *
4 * Copyright (C) 2008--2011 Nokia Corporation
5 *
6 * Contact: Sakari Ailus <sakari.ailus@maxwell.research.nokia.com>
7 *
8 * Contributors:
9 * Sakari Ailus <sakari.ailus@maxwell.research.nokia.com>
10 * Tuukka Toivonen <tuukkat76@gmail.com>
11 *
12 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License
14 * version 2 as published by the Free Software Foundation.
15 *
16 * This program is distributed in the hope that it will be useful, but
17 * WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19 * General Public License for more details.
20 *
21 * You should have received a copy of the GNU General Public License
22 * along with this program; if not, write to the Free Software
23 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
24 * 02110-1301 USA
25 *
26 */
27
28#ifndef ADP1653_H
29#define ADP1653_H
30
31#include <linux/i2c.h>
32#include <linux/mutex.h>
33#include <linux/videodev2.h>
34#include <media/v4l2-ctrls.h>
35#include <media/v4l2-subdev.h>
36
37#define ADP1653_NAME "adp1653"
38#define ADP1653_I2C_ADDR (0x60 >> 1)
39
40/* Register definitions */
41#define ADP1653_REG_OUT_SEL 0x00
42#define ADP1653_REG_OUT_SEL_HPLED_TORCH_MIN 0x01
43#define ADP1653_REG_OUT_SEL_HPLED_TORCH_MAX 0x0b
44#define ADP1653_REG_OUT_SEL_HPLED_FLASH_MIN 0x0c
45#define ADP1653_REG_OUT_SEL_HPLED_FLASH_MAX 0x1f
46#define ADP1653_REG_OUT_SEL_HPLED_SHIFT 3
47#define ADP1653_REG_OUT_SEL_ILED_MAX 0x07
48#define ADP1653_REG_OUT_SEL_ILED_SHIFT 0
49
50#define ADP1653_REG_CONFIG 0x01
51#define ADP1653_REG_CONFIG_TMR_CFG (1 << 4)
52#define ADP1653_REG_CONFIG_TMR_SET_MAX 0x0f
53#define ADP1653_REG_CONFIG_TMR_SET_SHIFT 0
54
55#define ADP1653_REG_SW_STROBE 0x02
56#define ADP1653_REG_SW_STROBE_SW_STROBE (1 << 0)
57
58#define ADP1653_REG_FAULT 0x03
59#define ADP1653_REG_FAULT_FLT_SCP (1 << 3)
60#define ADP1653_REG_FAULT_FLT_OT (1 << 2)
61#define ADP1653_REG_FAULT_FLT_TMR (1 << 1)
62#define ADP1653_REG_FAULT_FLT_OV (1 << 0)
63
64#define ADP1653_INDICATOR_INTENSITY_MIN 0
65#define ADP1653_INDICATOR_INTENSITY_STEP 2500
66#define ADP1653_INDICATOR_INTENSITY_MAX \
67 (ADP1653_REG_OUT_SEL_ILED_MAX * ADP1653_INDICATOR_INTENSITY_STEP)
68#define ADP1653_INDICATOR_INTENSITY_uA_TO_REG(a) \
69 ((a) / ADP1653_INDICATOR_INTENSITY_STEP)
70#define ADP1653_INDICATOR_INTENSITY_REG_TO_uA(a) \
71 ((a) * ADP1653_INDICATOR_INTENSITY_STEP)
72
73#define ADP1653_FLASH_INTENSITY_BASE 35
74#define ADP1653_FLASH_INTENSITY_STEP 15
75#define ADP1653_FLASH_INTENSITY_MIN \
76 (ADP1653_FLASH_INTENSITY_BASE \
77 + ADP1653_REG_OUT_SEL_HPLED_FLASH_MIN * ADP1653_FLASH_INTENSITY_STEP)
78#define ADP1653_FLASH_INTENSITY_MAX \
79 (ADP1653_FLASH_INTENSITY_MIN + \
80 (ADP1653_REG_OUT_SEL_HPLED_FLASH_MAX - \
81 ADP1653_REG_OUT_SEL_HPLED_FLASH_MIN + 1) * \
82 ADP1653_FLASH_INTENSITY_STEP)
83
84#define ADP1653_FLASH_INTENSITY_mA_TO_REG(a) \
85 ((a) < ADP1653_FLASH_INTENSITY_BASE ? 0 : \
86 (((a) - ADP1653_FLASH_INTENSITY_BASE) / ADP1653_FLASH_INTENSITY_STEP))
87#define ADP1653_FLASH_INTENSITY_REG_TO_mA(a) \
88 ((a) * ADP1653_FLASH_INTENSITY_STEP + ADP1653_FLASH_INTENSITY_BASE)
89
90#define ADP1653_TORCH_INTENSITY_MIN \
91 (ADP1653_FLASH_INTENSITY_BASE \
92 + ADP1653_REG_OUT_SEL_HPLED_TORCH_MIN * ADP1653_FLASH_INTENSITY_STEP)
93#define ADP1653_TORCH_INTENSITY_MAX \
94 (ADP1653_TORCH_INTENSITY_MIN + \
95 (ADP1653_REG_OUT_SEL_HPLED_TORCH_MAX - \
96 ADP1653_REG_OUT_SEL_HPLED_TORCH_MIN + 1) * \
97 ADP1653_FLASH_INTENSITY_STEP)
98
99struct adp1653_platform_data {
100 int (*power)(struct v4l2_subdev *sd, int on);
101
102 u32 max_flash_timeout; /* flash light timeout in us */
103 u32 max_flash_intensity; /* led intensity, flash mode */
104 u32 max_torch_intensity; /* led intensity, torch mode */
105 u32 max_indicator_intensity; /* indicator led intensity */
106};
107
108#define to_adp1653_flash(sd) container_of(sd, struct adp1653_flash, subdev)
109
110struct adp1653_flash {
111 struct v4l2_subdev subdev;
112 struct adp1653_platform_data *platform_data;
113
114 struct v4l2_ctrl_handler ctrls;
115 struct v4l2_ctrl *led_mode;
116 struct v4l2_ctrl *flash_timeout;
117 struct v4l2_ctrl *flash_intensity;
118 struct v4l2_ctrl *torch_intensity;
119 struct v4l2_ctrl *indicator_intensity;
120
121 struct mutex power_lock;
122 int power_count;
123 int fault;
124};
125
126#endif /* ADP1653_H */
diff --git a/include/media/atmel-isi.h b/include/media/atmel-isi.h
new file mode 100644
index 000000000000..26cece595121
--- /dev/null
+++ b/include/media/atmel-isi.h
@@ -0,0 +1,119 @@
1/*
2 * Register definitions for the Atmel Image Sensor Interface.
3 *
4 * Copyright (C) 2011 Atmel Corporation
5 * Josh Wu, <josh.wu@atmel.com>
6 *
7 * Based on previous work by Lars Haring, <lars.haring@atmel.com>
8 * and Sedji Gaouaou
9 *
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License version 2 as
12 * published by the Free Software Foundation.
13 */
14#ifndef __ATMEL_ISI_H__
15#define __ATMEL_ISI_H__
16
17#include <linux/types.h>
18
19/* ISI_V2 register offsets */
20#define ISI_CFG1 0x0000
21#define ISI_CFG2 0x0004
22#define ISI_PSIZE 0x0008
23#define ISI_PDECF 0x000c
24#define ISI_Y2R_SET0 0x0010
25#define ISI_Y2R_SET1 0x0014
26#define ISI_R2Y_SET0 0x0018
27#define ISI_R2Y_SET1 0x001C
28#define ISI_R2Y_SET2 0x0020
29#define ISI_CTRL 0x0024
30#define ISI_STATUS 0x0028
31#define ISI_INTEN 0x002C
32#define ISI_INTDIS 0x0030
33#define ISI_INTMASK 0x0034
34#define ISI_DMA_CHER 0x0038
35#define ISI_DMA_CHDR 0x003C
36#define ISI_DMA_CHSR 0x0040
37#define ISI_DMA_P_ADDR 0x0044
38#define ISI_DMA_P_CTRL 0x0048
39#define ISI_DMA_P_DSCR 0x004C
40#define ISI_DMA_C_ADDR 0x0050
41#define ISI_DMA_C_CTRL 0x0054
42#define ISI_DMA_C_DSCR 0x0058
43
44/* Bitfields in CFG1 */
45#define ISI_CFG1_HSYNC_POL_ACTIVE_LOW (1 << 2)
46#define ISI_CFG1_VSYNC_POL_ACTIVE_LOW (1 << 3)
47#define ISI_CFG1_PIXCLK_POL_ACTIVE_FALLING (1 << 4)
48#define ISI_CFG1_EMB_SYNC (1 << 6)
49#define ISI_CFG1_CRC_SYNC (1 << 7)
50/* Constants for FRATE(ISI_V2) */
51#define ISI_CFG1_FRATE_CAPTURE_ALL (0 << 8)
52#define ISI_CFG1_FRATE_DIV_2 (1 << 8)
53#define ISI_CFG1_FRATE_DIV_3 (2 << 8)
54#define ISI_CFG1_FRATE_DIV_4 (3 << 8)
55#define ISI_CFG1_FRATE_DIV_5 (4 << 8)
56#define ISI_CFG1_FRATE_DIV_6 (5 << 8)
57#define ISI_CFG1_FRATE_DIV_7 (6 << 8)
58#define ISI_CFG1_FRATE_DIV_8 (7 << 8)
59#define ISI_CFG1_DISCR (1 << 11)
60#define ISI_CFG1_FULL_MODE (1 << 12)
61
62/* Bitfields in CFG2 */
63#define ISI_CFG2_GRAYSCALE (1 << 13)
64/* Constants for YCC_SWAP(ISI_V2) */
65#define ISI_CFG2_YCC_SWAP_DEFAULT (0 << 28)
66#define ISI_CFG2_YCC_SWAP_MODE_1 (1 << 28)
67#define ISI_CFG2_YCC_SWAP_MODE_2 (2 << 28)
68#define ISI_CFG2_YCC_SWAP_MODE_3 (3 << 28)
69#define ISI_CFG2_IM_VSIZE_OFFSET 0
70#define ISI_CFG2_IM_HSIZE_OFFSET 16
71#define ISI_CFG2_IM_VSIZE_MASK (0x7FF << ISI_CFG2_IM_VSIZE_OFFSET)
72#define ISI_CFG2_IM_HSIZE_MASK (0x7FF << ISI_CFG2_IM_HSIZE_OFFSET)
73
74/* Bitfields in CTRL */
75/* Also using in SR(ISI_V2) */
76#define ISI_CTRL_EN (1 << 0)
77#define ISI_CTRL_CDC (1 << 8)
78/* Also using in SR/IER/IDR/IMR(ISI_V2) */
79#define ISI_CTRL_DIS (1 << 1)
80#define ISI_CTRL_SRST (1 << 2)
81
82/* Bitfields in SR */
83#define ISI_SR_SIP (1 << 19)
84/* Also using in SR/IER/IDR/IMR */
85#define ISI_SR_VSYNC (1 << 10)
86#define ISI_SR_PXFR_DONE (1 << 16)
87#define ISI_SR_CXFR_DONE (1 << 17)
88#define ISI_SR_P_OVR (1 << 24)
89#define ISI_SR_C_OVR (1 << 25)
90#define ISI_SR_CRC_ERR (1 << 26)
91#define ISI_SR_FR_OVR (1 << 27)
92
93/* Bitfields in DMA_C_CTRL & in DMA_P_CTRL */
94#define ISI_DMA_CTRL_FETCH (1 << 0)
95#define ISI_DMA_CTRL_WB (1 << 1)
96#define ISI_DMA_CTRL_IEN (1 << 2)
97#define ISI_DMA_CTRL_DONE (1 << 3)
98
99/* Bitfields in DMA_CHSR/CHER/CHDR */
100#define ISI_DMA_CHSR_P_CH (1 << 0)
101#define ISI_DMA_CHSR_C_CH (1 << 1)
102
103/* Definition for isi_platform_data */
104#define ISI_DATAWIDTH_8 0x01
105#define ISI_DATAWIDTH_10 0x02
106
107struct isi_platform_data {
108 u8 has_emb_sync;
109 u8 emb_crc_sync;
110 u8 hsync_act_low;
111 u8 vsync_act_low;
112 u8 pclk_act_falling;
113 u8 isi_full_mode;
114 u32 data_width_flags;
115 /* Using for ISI_CFG1 */
116 u32 frate;
117};
118
119#endif /* __ATMEL_ISI_H__ */
diff --git a/include/media/davinci/vpbe.h b/include/media/davinci/vpbe.h
new file mode 100644
index 000000000000..8b11fb037980
--- /dev/null
+++ b/include/media/davinci/vpbe.h
@@ -0,0 +1,184 @@
1/*
2 * Copyright (C) 2010 Texas Instruments Inc
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 version 2.
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 * You should have received a copy of the GNU General Public License
14 * along with this program; if not, write to the Free Software
15 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16 */
17#ifndef _VPBE_H
18#define _VPBE_H
19
20#include <linux/videodev2.h>
21#include <linux/i2c.h>
22
23#include <media/v4l2-dev.h>
24#include <media/v4l2-ioctl.h>
25#include <media/v4l2-device.h>
26#include <media/davinci/vpbe_osd.h>
27#include <media/davinci/vpbe_venc.h>
28#include <media/davinci/vpbe_types.h>
29
30/* OSD configuration info */
31struct osd_config_info {
32 char module_name[32];
33};
34
35struct vpbe_output {
36 struct v4l2_output output;
37 /*
38 * If output capabilities include dv_preset, list supported presets
39 * below
40 */
41 char *subdev_name;
42 /*
43 * defualt_mode identifies the default timings set at the venc or
44 * external encoder.
45 */
46 char *default_mode;
47 /*
48 * Fields below are used for supporting multiple modes. For example,
49 * LCD panel might support different modes and they are listed here.
50 * Similarly for supporting external encoders, lcd controller port
51 * requires a set of non-standard timing values to be listed here for
52 * each supported mode since venc is used in non-standard timing mode
53 * for interfacing with external encoder similar to configuring lcd
54 * panel timings
55 */
56 unsigned int num_modes;
57 struct vpbe_enc_mode_info *modes;
58 /*
59 * Bus configuration goes here for external encoders. Some encoders
60 * may require multiple interface types for each of the output. For
61 * example, SD modes would use YCC8 where as HD mode would use YCC16.
62 * Not sure if this is needed on a per mode basis instead of per
63 * output basis. If per mode is needed, we may have to move this to
64 * mode_info structure
65 */
66};
67
68/* encoder configuration info */
69struct encoder_config_info {
70 char module_name[32];
71 /* Is this an i2c device ? */
72 unsigned int is_i2c:1;
73 /* i2c subdevice board info */
74 struct i2c_board_info board_info;
75};
76
77/* structure for defining vpbe display subsystem components */
78struct vpbe_config {
79 char module_name[32];
80 /* i2c bus adapter no */
81 int i2c_adapter_id;
82 struct osd_config_info osd;
83 struct encoder_config_info venc;
84 /* external encoder information goes here */
85 int num_ext_encoders;
86 struct encoder_config_info *ext_encoders;
87 int num_outputs;
88 /* Order is venc outputs followed by LCD and then external encoders */
89 struct vpbe_output *outputs;
90};
91
92struct vpbe_device;
93
94struct vpbe_device_ops {
95 /* crop cap for the display */
96 int (*g_cropcap)(struct vpbe_device *vpbe_dev,
97 struct v4l2_cropcap *cropcap);
98
99 /* Enumerate the outputs */
100 int (*enum_outputs)(struct vpbe_device *vpbe_dev,
101 struct v4l2_output *output);
102
103 /* Set output to the given index */
104 int (*set_output)(struct vpbe_device *vpbe_dev,
105 int index);
106
107 /* Get current output */
108 unsigned int (*get_output)(struct vpbe_device *vpbe_dev);
109
110 /* Set DV preset at current output */
111 int (*s_dv_preset)(struct vpbe_device *vpbe_dev,
112 struct v4l2_dv_preset *dv_preset);
113
114 /* Get DV presets supported at the output */
115 int (*g_dv_preset)(struct vpbe_device *vpbe_dev,
116 struct v4l2_dv_preset *dv_preset);
117
118 /* Enumerate the DV Presets supported at the output */
119 int (*enum_dv_presets)(struct vpbe_device *vpbe_dev,
120 struct v4l2_dv_enum_preset *preset_info);
121
122 /* Set std at the output */
123 int (*s_std)(struct vpbe_device *vpbe_dev, v4l2_std_id *std_id);
124
125 /* Get the current std at the output */
126 int (*g_std)(struct vpbe_device *vpbe_dev, v4l2_std_id *std_id);
127
128 /* initialize the device */
129 int (*initialize)(struct device *dev, struct vpbe_device *vpbe_dev);
130
131 /* De-initialize the device */
132 void (*deinitialize)(struct device *dev, struct vpbe_device *vpbe_dev);
133
134 /* Get the current mode info */
135 int (*get_mode_info)(struct vpbe_device *vpbe_dev,
136 struct vpbe_enc_mode_info*);
137
138 /*
139 * Set the current mode in the encoder. Alternate way of setting
140 * standard or DV preset or custom timings in the encoder
141 */
142 int (*set_mode)(struct vpbe_device *vpbe_dev,
143 struct vpbe_enc_mode_info*);
144 /* Power management operations */
145 int (*suspend)(struct vpbe_device *vpbe_dev);
146 int (*resume)(struct vpbe_device *vpbe_dev);
147};
148
149/* struct for vpbe device */
150struct vpbe_device {
151 /* V4l2 device */
152 struct v4l2_device v4l2_dev;
153 /* vpbe dispay controller cfg */
154 struct vpbe_config *cfg;
155 /* parent device */
156 struct device *pdev;
157 /* external encoder v4l2 sub devices */
158 struct v4l2_subdev **encoders;
159 /* current encoder index */
160 int current_sd_index;
161 struct mutex lock;
162 /* device initialized */
163 int initialized;
164 /* vpbe dac clock */
165 struct clk *dac_clk;
166 /* osd_device pointer */
167 struct osd_state *osd_device;
168 /*
169 * fields below are accessed by users of vpbe_device. Not the
170 * ones above
171 */
172
173 /* current output */
174 int current_out_index;
175 /* lock used by caller to do atomic operation on vpbe device */
176 /* current timings set in the controller */
177 struct vpbe_enc_mode_info current_timings;
178 /* venc sub device */
179 struct v4l2_subdev *venc;
180 /* device operations below */
181 struct vpbe_device_ops ops;
182};
183
184#endif
diff --git a/include/media/davinci/vpbe_display.h b/include/media/davinci/vpbe_display.h
new file mode 100644
index 000000000000..dbf6b37682cd
--- /dev/null
+++ b/include/media/davinci/vpbe_display.h
@@ -0,0 +1,147 @@
1/*
2 * Copyright (C) 2010 Texas Instruments Incorporated - http://www.ti.com/
3 *
4 * This program is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU General Public License as
6 * published by the Free Software Foundation version 2.
7 *
8 * This program is distributed WITHOUT ANY WARRANTY of any
9 * kind, whether express or implied; without even the implied warranty
10 * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
12 */
13#ifndef VPBE_DISPLAY_H
14#define VPBE_DISPLAY_H
15
16/* Header files */
17#include <linux/videodev2.h>
18#include <media/v4l2-common.h>
19#include <media/videobuf-dma-contig.h>
20#include <media/davinci/vpbe_types.h>
21#include <media/davinci/vpbe_osd.h>
22#include <media/davinci/vpbe.h>
23
24#define VPBE_DISPLAY_MAX_DEVICES 2
25
26enum vpbe_display_device_id {
27 VPBE_DISPLAY_DEVICE_0,
28 VPBE_DISPLAY_DEVICE_1
29};
30
31#define VPBE_DISPLAY_DRV_NAME "vpbe-display"
32
33#define VPBE_DISPLAY_MAJOR_RELEASE 1
34#define VPBE_DISPLAY_MINOR_RELEASE 0
35#define VPBE_DISPLAY_BUILD 1
36#define VPBE_DISPLAY_VERSION_CODE ((VPBE_DISPLAY_MAJOR_RELEASE << 16) | \
37 (VPBE_DISPLAY_MINOR_RELEASE << 8) | \
38 VPBE_DISPLAY_BUILD)
39
40#define VPBE_DISPLAY_VALID_FIELD(field) ((V4L2_FIELD_NONE == field) || \
41 (V4L2_FIELD_ANY == field) || (V4L2_FIELD_INTERLACED == field))
42
43/* Exp ratio numerator and denominator constants */
44#define VPBE_DISPLAY_H_EXP_RATIO_N 9
45#define VPBE_DISPLAY_H_EXP_RATIO_D 8
46#define VPBE_DISPLAY_V_EXP_RATIO_N 6
47#define VPBE_DISPLAY_V_EXP_RATIO_D 5
48
49/* Zoom multiplication factor */
50#define VPBE_DISPLAY_ZOOM_4X 4
51#define VPBE_DISPLAY_ZOOM_2X 2
52
53/* Structures */
54struct display_layer_info {
55 int enable;
56 /* Layer ID used by Display Manager */
57 enum osd_layer id;
58 struct osd_layer_config config;
59 enum osd_zoom_factor h_zoom;
60 enum osd_zoom_factor v_zoom;
61 enum osd_h_exp_ratio h_exp;
62 enum osd_v_exp_ratio v_exp;
63};
64
65/* vpbe display object structure */
66struct vpbe_layer {
67 /* number of buffers in fbuffers */
68 unsigned int numbuffers;
69 /* Pointer to the vpbe_display */
70 struct vpbe_display *disp_dev;
71 /* Pointer pointing to current v4l2_buffer */
72 struct videobuf_buffer *cur_frm;
73 /* Pointer pointing to next v4l2_buffer */
74 struct videobuf_buffer *next_frm;
75 /* videobuf specific parameters
76 * Buffer queue used in video-buf
77 */
78 struct videobuf_queue buffer_queue;
79 /* Queue of filled frames */
80 struct list_head dma_queue;
81 /* Used in video-buf */
82 spinlock_t irqlock;
83 /* V4l2 specific parameters */
84 /* Identifies video device for this layer */
85 struct video_device video_dev;
86 /* This field keeps track of type of buffer exchange mechanism user
87 * has selected
88 */
89 enum v4l2_memory memory;
90 /* Used to keep track of state of the priority */
91 struct v4l2_prio_state prio;
92 /* Used to store pixel format */
93 struct v4l2_pix_format pix_fmt;
94 enum v4l2_field buf_field;
95 /* Video layer configuration params */
96 struct display_layer_info layer_info;
97 /* vpbe specific parameters
98 * enable window for display
99 */
100 unsigned char window_enable;
101 /* number of open instances of the layer */
102 unsigned int usrs;
103 /* number of users performing IO */
104 unsigned int io_usrs;
105 /* Indicates id of the field which is being displayed */
106 unsigned int field_id;
107 /* Indicates whether streaming started */
108 unsigned char started;
109 /* Identifies device object */
110 enum vpbe_display_device_id device_id;
111 /* facilitation of ioctl ops lock by v4l2*/
112 struct mutex opslock;
113 u8 layer_first_int;
114};
115
116/* vpbe device structure */
117struct vpbe_display {
118 /* layer specific parameters */
119 /* lock for isr updates to buf layers*/
120 spinlock_t dma_queue_lock;
121 /* C-Plane offset from start of y-plane */
122 unsigned int cbcr_ofst;
123 struct vpbe_layer *dev[VPBE_DISPLAY_MAX_DEVICES];
124 struct vpbe_device *vpbe_dev;
125 struct osd_state *osd_device;
126};
127
128/* File handle structure */
129struct vpbe_fh {
130 /* vpbe device structure */
131 struct vpbe_display *disp_dev;
132 /* pointer to layer object for opened device */
133 struct vpbe_layer *layer;
134 /* Indicates whether this file handle is doing IO */
135 unsigned char io_allowed;
136 /* Used to keep track priority of this instance */
137 enum v4l2_priority prio;
138};
139
140struct buf_config_params {
141 unsigned char min_numbuffers;
142 unsigned char numbuffers[VPBE_DISPLAY_MAX_DEVICES];
143 unsigned int min_bufsize[VPBE_DISPLAY_MAX_DEVICES];
144 unsigned int layer_bufsize[VPBE_DISPLAY_MAX_DEVICES];
145};
146
147#endif /* VPBE_DISPLAY_H */
diff --git a/include/media/davinci/vpbe_osd.h b/include/media/davinci/vpbe_osd.h
new file mode 100644
index 000000000000..d7e397a444e6
--- /dev/null
+++ b/include/media/davinci/vpbe_osd.h
@@ -0,0 +1,394 @@
1/*
2 * Copyright (C) 2007-2009 Texas Instruments Inc
3 * Copyright (C) 2007 MontaVista Software, Inc.
4 *
5 * Andy Lowe (alowe@mvista.com), MontaVista Software
6 * - Initial version
7 * Murali Karicheri (mkaricheri@gmail.com), Texas Instruments Ltd.
8 * - ported to sub device interface
9 *
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation version 2..
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 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
22 *
23 */
24#ifndef _OSD_H
25#define _OSD_H
26
27#include <media/davinci/vpbe_types.h>
28
29#define VPBE_OSD_SUBDEV_NAME "vpbe-osd"
30
31/**
32 * enum osd_layer
33 * @WIN_OSD0: On-Screen Display Window 0
34 * @WIN_VID0: Video Window 0
35 * @WIN_OSD1: On-Screen Display Window 1
36 * @WIN_VID1: Video Window 1
37 *
38 * Description:
39 * An enumeration of the osd display layers.
40 */
41enum osd_layer {
42 WIN_OSD0,
43 WIN_VID0,
44 WIN_OSD1,
45 WIN_VID1,
46};
47
48/**
49 * enum osd_win_layer
50 * @OSDWIN_OSD0: On-Screen Display Window 0
51 * @OSDWIN_OSD1: On-Screen Display Window 1
52 *
53 * Description:
54 * An enumeration of the OSD Window layers.
55 */
56enum osd_win_layer {
57 OSDWIN_OSD0,
58 OSDWIN_OSD1,
59};
60
61/**
62 * enum osd_pix_format
63 * @PIXFMT_1BPP: 1-bit-per-pixel bitmap
64 * @PIXFMT_2BPP: 2-bits-per-pixel bitmap
65 * @PIXFMT_4BPP: 4-bits-per-pixel bitmap
66 * @PIXFMT_8BPP: 8-bits-per-pixel bitmap
67 * @PIXFMT_RGB565: 16-bits-per-pixel RGB565
68 * @PIXFMT_YCbCrI: YUV 4:2:2
69 * @PIXFMT_RGB888: 24-bits-per-pixel RGB888
70 * @PIXFMT_YCrCbI: YUV 4:2:2 with chroma swap
71 * @PIXFMT_NV12: YUV 4:2:0 planar
72 * @PIXFMT_OSD_ATTR: OSD Attribute Window pixel format (4bpp)
73 *
74 * Description:
75 * An enumeration of the DaVinci pixel formats.
76 */
77enum osd_pix_format {
78 PIXFMT_1BPP = 0,
79 PIXFMT_2BPP,
80 PIXFMT_4BPP,
81 PIXFMT_8BPP,
82 PIXFMT_RGB565,
83 PIXFMT_YCbCrI,
84 PIXFMT_RGB888,
85 PIXFMT_YCrCbI,
86 PIXFMT_NV12,
87 PIXFMT_OSD_ATTR,
88};
89
90/**
91 * enum osd_h_exp_ratio
92 * @H_EXP_OFF: no expansion (1/1)
93 * @H_EXP_9_OVER_8: 9/8 expansion ratio
94 * @H_EXP_3_OVER_2: 3/2 expansion ratio
95 *
96 * Description:
97 * An enumeration of the available horizontal expansion ratios.
98 */
99enum osd_h_exp_ratio {
100 H_EXP_OFF,
101 H_EXP_9_OVER_8,
102 H_EXP_3_OVER_2,
103};
104
105/**
106 * enum osd_v_exp_ratio
107 * @V_EXP_OFF: no expansion (1/1)
108 * @V_EXP_6_OVER_5: 6/5 expansion ratio
109 *
110 * Description:
111 * An enumeration of the available vertical expansion ratios.
112 */
113enum osd_v_exp_ratio {
114 V_EXP_OFF,
115 V_EXP_6_OVER_5,
116};
117
118/**
119 * enum osd_zoom_factor
120 * @ZOOM_X1: no zoom (x1)
121 * @ZOOM_X2: x2 zoom
122 * @ZOOM_X4: x4 zoom
123 *
124 * Description:
125 * An enumeration of the available zoom factors.
126 */
127enum osd_zoom_factor {
128 ZOOM_X1,
129 ZOOM_X2,
130 ZOOM_X4,
131};
132
133/**
134 * enum osd_clut
135 * @ROM_CLUT: ROM CLUT
136 * @RAM_CLUT: RAM CLUT
137 *
138 * Description:
139 * An enumeration of the available Color Lookup Tables (CLUTs).
140 */
141enum osd_clut {
142 ROM_CLUT,
143 RAM_CLUT,
144};
145
146/**
147 * enum osd_rom_clut
148 * @ROM_CLUT0: Macintosh CLUT
149 * @ROM_CLUT1: CLUT from DM270 and prior devices
150 *
151 * Description:
152 * An enumeration of the ROM Color Lookup Table (CLUT) options.
153 */
154enum osd_rom_clut {
155 ROM_CLUT0,
156 ROM_CLUT1,
157};
158
159/**
160 * enum osd_blending_factor
161 * @OSD_0_VID_8: OSD pixels are fully transparent
162 * @OSD_1_VID_7: OSD pixels contribute 1/8, video pixels contribute 7/8
163 * @OSD_2_VID_6: OSD pixels contribute 2/8, video pixels contribute 6/8
164 * @OSD_3_VID_5: OSD pixels contribute 3/8, video pixels contribute 5/8
165 * @OSD_4_VID_4: OSD pixels contribute 4/8, video pixels contribute 4/8
166 * @OSD_5_VID_3: OSD pixels contribute 5/8, video pixels contribute 3/8
167 * @OSD_6_VID_2: OSD pixels contribute 6/8, video pixels contribute 2/8
168 * @OSD_8_VID_0: OSD pixels are fully opaque
169 *
170 * Description:
171 * An enumeration of the DaVinci pixel blending factor options.
172 */
173enum osd_blending_factor {
174 OSD_0_VID_8,
175 OSD_1_VID_7,
176 OSD_2_VID_6,
177 OSD_3_VID_5,
178 OSD_4_VID_4,
179 OSD_5_VID_3,
180 OSD_6_VID_2,
181 OSD_8_VID_0,
182};
183
184/**
185 * enum osd_blink_interval
186 * @BLINK_X1: blink interval is 1 vertical refresh cycle
187 * @BLINK_X2: blink interval is 2 vertical refresh cycles
188 * @BLINK_X3: blink interval is 3 vertical refresh cycles
189 * @BLINK_X4: blink interval is 4 vertical refresh cycles
190 *
191 * Description:
192 * An enumeration of the DaVinci pixel blinking interval options.
193 */
194enum osd_blink_interval {
195 BLINK_X1,
196 BLINK_X2,
197 BLINK_X3,
198 BLINK_X4,
199};
200
201/**
202 * enum osd_cursor_h_width
203 * @H_WIDTH_1: horizontal line width is 1 pixel
204 * @H_WIDTH_4: horizontal line width is 4 pixels
205 * @H_WIDTH_8: horizontal line width is 8 pixels
206 * @H_WIDTH_12: horizontal line width is 12 pixels
207 * @H_WIDTH_16: horizontal line width is 16 pixels
208 * @H_WIDTH_20: horizontal line width is 20 pixels
209 * @H_WIDTH_24: horizontal line width is 24 pixels
210 * @H_WIDTH_28: horizontal line width is 28 pixels
211 */
212enum osd_cursor_h_width {
213 H_WIDTH_1,
214 H_WIDTH_4,
215 H_WIDTH_8,
216 H_WIDTH_12,
217 H_WIDTH_16,
218 H_WIDTH_20,
219 H_WIDTH_24,
220 H_WIDTH_28,
221};
222
223/**
224 * enum davinci_cursor_v_width
225 * @V_WIDTH_1: vertical line width is 1 line
226 * @V_WIDTH_2: vertical line width is 2 lines
227 * @V_WIDTH_4: vertical line width is 4 lines
228 * @V_WIDTH_6: vertical line width is 6 lines
229 * @V_WIDTH_8: vertical line width is 8 lines
230 * @V_WIDTH_10: vertical line width is 10 lines
231 * @V_WIDTH_12: vertical line width is 12 lines
232 * @V_WIDTH_14: vertical line width is 14 lines
233 */
234enum osd_cursor_v_width {
235 V_WIDTH_1,
236 V_WIDTH_2,
237 V_WIDTH_4,
238 V_WIDTH_6,
239 V_WIDTH_8,
240 V_WIDTH_10,
241 V_WIDTH_12,
242 V_WIDTH_14,
243};
244
245/**
246 * struct osd_cursor_config
247 * @xsize: horizontal size in pixels
248 * @ysize: vertical size in lines
249 * @xpos: horizontal offset in pixels from the left edge of the display
250 * @ypos: vertical offset in lines from the top of the display
251 * @interlaced: Non-zero if the display is interlaced, or zero otherwise
252 * @h_width: horizontal line width
253 * @v_width: vertical line width
254 * @clut: the CLUT selector (ROM or RAM) for the cursor color
255 * @clut_index: an index into the CLUT for the cursor color
256 *
257 * Description:
258 * A structure describing the configuration parameters of the hardware
259 * rectangular cursor.
260 */
261struct osd_cursor_config {
262 unsigned xsize;
263 unsigned ysize;
264 unsigned xpos;
265 unsigned ypos;
266 int interlaced;
267 enum osd_cursor_h_width h_width;
268 enum osd_cursor_v_width v_width;
269 enum osd_clut clut;
270 unsigned char clut_index;
271};
272
273/**
274 * struct osd_layer_config
275 * @pixfmt: pixel format
276 * @line_length: offset in bytes between start of each line in memory
277 * @xsize: number of horizontal pixels displayed per line
278 * @ysize: number of lines displayed
279 * @xpos: horizontal offset in pixels from the left edge of the display
280 * @ypos: vertical offset in lines from the top of the display
281 * @interlaced: Non-zero if the display is interlaced, or zero otherwise
282 *
283 * Description:
284 * A structure describing the configuration parameters of an On-Screen Display
285 * (OSD) or video layer related to how the image is stored in memory.
286 * @line_length must be a multiple of the cache line size (32 bytes).
287 */
288struct osd_layer_config {
289 enum osd_pix_format pixfmt;
290 unsigned line_length;
291 unsigned xsize;
292 unsigned ysize;
293 unsigned xpos;
294 unsigned ypos;
295 int interlaced;
296};
297
298/* parameters that apply on a per-window (OSD or video) basis */
299struct osd_window_state {
300 int is_allocated;
301 int is_enabled;
302 unsigned long fb_base_phys;
303 enum osd_zoom_factor h_zoom;
304 enum osd_zoom_factor v_zoom;
305 struct osd_layer_config lconfig;
306};
307
308/* parameters that apply on a per-OSD-window basis */
309struct osd_osdwin_state {
310 enum osd_clut clut;
311 enum osd_blending_factor blend;
312 int colorkey_blending;
313 unsigned colorkey;
314 int rec601_attenuation;
315 /* index is pixel value */
316 unsigned char palette_map[16];
317};
318
319/* hardware rectangular cursor parameters */
320struct osd_cursor_state {
321 int is_enabled;
322 struct osd_cursor_config config;
323};
324
325struct osd_state;
326
327struct vpbe_osd_ops {
328 int (*initialize)(struct osd_state *sd);
329 int (*request_layer)(struct osd_state *sd, enum osd_layer layer);
330 void (*release_layer)(struct osd_state *sd, enum osd_layer layer);
331 int (*enable_layer)(struct osd_state *sd, enum osd_layer layer,
332 int otherwin);
333 void (*disable_layer)(struct osd_state *sd, enum osd_layer layer);
334 int (*set_layer_config)(struct osd_state *sd, enum osd_layer layer,
335 struct osd_layer_config *lconfig);
336 void (*get_layer_config)(struct osd_state *sd, enum osd_layer layer,
337 struct osd_layer_config *lconfig);
338 void (*start_layer)(struct osd_state *sd, enum osd_layer layer,
339 unsigned long fb_base_phys,
340 unsigned long cbcr_ofst);
341 void (*set_left_margin)(struct osd_state *sd, u32 val);
342 void (*set_top_margin)(struct osd_state *sd, u32 val);
343 void (*set_interpolation_filter)(struct osd_state *sd, int filter);
344 int (*set_vid_expansion)(struct osd_state *sd,
345 enum osd_h_exp_ratio h_exp,
346 enum osd_v_exp_ratio v_exp);
347 void (*get_vid_expansion)(struct osd_state *sd,
348 enum osd_h_exp_ratio *h_exp,
349 enum osd_v_exp_ratio *v_exp);
350 void (*set_zoom)(struct osd_state *sd, enum osd_layer layer,
351 enum osd_zoom_factor h_zoom,
352 enum osd_zoom_factor v_zoom);
353};
354
355struct osd_state {
356 enum vpbe_version vpbe_type;
357 spinlock_t lock;
358 struct device *dev;
359 dma_addr_t osd_base_phys;
360 unsigned long osd_base;
361 unsigned long osd_size;
362 /* 1-->the isr will toggle the VID0 ping-pong buffer */
363 int pingpong;
364 int interpolation_filter;
365 int field_inversion;
366 enum osd_h_exp_ratio osd_h_exp;
367 enum osd_v_exp_ratio osd_v_exp;
368 enum osd_h_exp_ratio vid_h_exp;
369 enum osd_v_exp_ratio vid_v_exp;
370 enum osd_clut backg_clut;
371 unsigned backg_clut_index;
372 enum osd_rom_clut rom_clut;
373 int is_blinking;
374 /* attribute window blinking enabled */
375 enum osd_blink_interval blink;
376 /* YCbCrI or YCrCbI */
377 enum osd_pix_format yc_pixfmt;
378 /* columns are Y, Cb, Cr */
379 unsigned char clut_ram[256][3];
380 struct osd_cursor_state cursor;
381 /* OSD0, VID0, OSD1, VID1 */
382 struct osd_window_state win[4];
383 /* OSD0, OSD1 */
384 struct osd_osdwin_state osdwin[2];
385 /* OSD device Operations */
386 struct vpbe_osd_ops ops;
387};
388
389struct osd_platform_data {
390 enum vpbe_version vpbe_type;
391 int field_inv_wa_enable;
392};
393
394#endif
diff --git a/include/media/davinci/vpbe_types.h b/include/media/davinci/vpbe_types.h
new file mode 100644
index 000000000000..727f55170e41
--- /dev/null
+++ b/include/media/davinci/vpbe_types.h
@@ -0,0 +1,91 @@
1/*
2 * Copyright (C) 2010 Texas Instruments Inc
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 version 2.
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 * You should have received a copy of the GNU General Public License
14 * along with this program; if not, write to the Free Software
15 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16 */
17#ifndef _VPBE_TYPES_H
18#define _VPBE_TYPES_H
19
20enum vpbe_version {
21 VPBE_VERSION_1 = 1,
22 VPBE_VERSION_2,
23 VPBE_VERSION_3,
24};
25
26/* vpbe_timing_type - Timing types used in vpbe device */
27enum vpbe_enc_timings_type {
28 VPBE_ENC_STD = 0x1,
29 VPBE_ENC_DV_PRESET = 0x2,
30 VPBE_ENC_CUSTOM_TIMINGS = 0x4,
31 /* Used when set timings through FB device interface */
32 VPBE_ENC_TIMINGS_INVALID = 0x8,
33};
34
35union vpbe_timings {
36 v4l2_std_id std_id;
37 unsigned int dv_preset;
38};
39
40/*
41 * struct vpbe_enc_mode_info
42 * @name: ptr to name string of the standard, "NTSC", "PAL" etc
43 * @std: standard or non-standard mode. 1 - standard, 0 - nonstandard
44 * @interlaced: 1 - interlaced, 0 - non interlaced/progressive
45 * @xres: x or horizontal resolution of the display
46 * @yres: y or vertical resolution of the display
47 * @fps: frame per second
48 * @left_margin: left margin of the display
49 * @right_margin: right margin of the display
50 * @upper_margin: upper margin of the display
51 * @lower_margin: lower margin of the display
52 * @hsync_len: h-sync length
53 * @vsync_len: v-sync length
54 * @flags: bit field: bit usage is documented below
55 *
56 * Description:
57 * Structure holding timing and resolution information of a standard.
58 * Used by vpbe_device to set required non-standard timing in the
59 * venc when lcd controller output is connected to a external encoder.
60 * A table of timings is maintained in vpbe device to set this in
61 * venc when external encoder is connected to lcd controller output.
62 * Encoder may provide a g_dv_timings() API to override these values
63 * as needed.
64 *
65 * Notes
66 * ------
67 * if_type should be used only by encoder manager and encoder.
68 * flags usage
69 * b0 (LSB) - hsync polarity, 0 - negative, 1 - positive
70 * b1 - vsync polarity, 0 - negative, 1 - positive
71 * b2 - field id polarity, 0 - negative, 1 - positive
72 */
73struct vpbe_enc_mode_info {
74 unsigned char *name;
75 enum vpbe_enc_timings_type timings_type;
76 union vpbe_timings timings;
77 unsigned int interlaced;
78 unsigned int xres;
79 unsigned int yres;
80 struct v4l2_fract aspect;
81 struct v4l2_fract fps;
82 unsigned int left_margin;
83 unsigned int right_margin;
84 unsigned int upper_margin;
85 unsigned int lower_margin;
86 unsigned int hsync_len;
87 unsigned int vsync_len;
88 unsigned int flags;
89};
90
91#endif
diff --git a/include/media/davinci/vpbe_venc.h b/include/media/davinci/vpbe_venc.h
new file mode 100644
index 000000000000..426c205831a2
--- /dev/null
+++ b/include/media/davinci/vpbe_venc.h
@@ -0,0 +1,45 @@
1/*
2 * Copyright (C) 2010 Texas Instruments Inc
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 version 2.
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 * You should have received a copy of the GNU General Public License
14 * along with this program; if not, write to the Free Software
15 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16 */
17#ifndef _VPBE_VENC_H
18#define _VPBE_VENC_H
19
20#include <media/v4l2-subdev.h>
21#include <media/davinci/vpbe_types.h>
22
23#define VPBE_VENC_SUBDEV_NAME "vpbe-venc"
24
25/* venc events */
26#define VENC_END_OF_FRAME BIT(0)
27#define VENC_FIRST_FIELD BIT(1)
28#define VENC_SECOND_FIELD BIT(2)
29
30struct venc_platform_data {
31 enum vpbe_version venc_type;
32 int (*setup_clock)(enum vpbe_enc_timings_type type,
33 unsigned int mode);
34 /* Number of LCD outputs supported */
35 int num_lcd_outputs;
36};
37
38enum venc_ioctls {
39 VENC_GET_FLD = 1,
40};
41
42/* exported functions */
43struct v4l2_subdev *venc_sub_dev_init(struct v4l2_device *v4l2_dev,
44 const char *venc_name);
45#endif
diff --git a/include/media/lirc_dev.h b/include/media/lirc_dev.h
index 630e702c9511..168dd0b1bae2 100644
--- a/include/media/lirc_dev.h
+++ b/include/media/lirc_dev.h
@@ -9,7 +9,7 @@
9#ifndef _LINUX_LIRC_DEV_H 9#ifndef _LINUX_LIRC_DEV_H
10#define _LINUX_LIRC_DEV_H 10#define _LINUX_LIRC_DEV_H
11 11
12#define MAX_IRCTL_DEVICES 4 12#define MAX_IRCTL_DEVICES 8
13#define BUFLEN 16 13#define BUFLEN 16
14 14
15#define mod(n, div) ((n) % (div)) 15#define mod(n, div) ((n) % (div))
diff --git a/include/media/m5mols.h b/include/media/m5mols.h
index 2d7e7ca2313d..aac2c0e06d5e 100644
--- a/include/media/m5mols.h
+++ b/include/media/m5mols.h
@@ -2,10 +2,10 @@
2 * Driver header for M-5MOLS 8M Pixel camera sensor with ISP 2 * Driver header for M-5MOLS 8M Pixel camera sensor with ISP
3 * 3 *
4 * Copyright (C) 2011 Samsung Electronics Co., Ltd. 4 * Copyright (C) 2011 Samsung Electronics Co., Ltd.
5 * Author: HeungJun Kim, riverful.kim@samsung.com 5 * Author: HeungJun Kim <riverful.kim@samsung.com>
6 * 6 *
7 * Copyright (C) 2009 Samsung Electronics Co., Ltd. 7 * Copyright (C) 2009 Samsung Electronics Co., Ltd.
8 * Author: Dongsoo Nathaniel Kim, dongsoo45.kim@samsung.com 8 * Author: Dongsoo Nathaniel Kim <dongsoo45.kim@samsung.com>
9 * 9 *
10 * This program is free software; you can redistribute it and/or modify 10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by 11 * it under the terms of the GNU General Public License as published by
diff --git a/include/media/mmp-camera.h b/include/media/mmp-camera.h
new file mode 100644
index 000000000000..7611963a257f
--- /dev/null
+++ b/include/media/mmp-camera.h
@@ -0,0 +1,9 @@
1/*
2 * Information for the Marvell Armada MMP camera
3 */
4
5struct mmp_camera_platform_data {
6 struct platform_device *i2c_device;
7 int sensor_power_gpio;
8 int sensor_reset_gpio;
9};
diff --git a/include/media/ov7670.h b/include/media/ov7670.h
new file mode 100644
index 000000000000..b133bc123031
--- /dev/null
+++ b/include/media/ov7670.h
@@ -0,0 +1,20 @@
1/*
2 * A V4L2 driver for OmniVision OV7670 cameras.
3 *
4 * Copyright 2010 One Laptop Per Child
5 *
6 * This file may be distributed under the terms of the GNU General
7 * Public License, version 2.
8 */
9
10#ifndef __OV7670_H
11#define __OV7670_H
12
13struct ov7670_config {
14 int min_width; /* Filter out smaller sizes */
15 int min_height; /* Filter out smaller sizes */
16 int clock_speed; /* External clock speed (MHz) */
17 bool use_smbus; /* Use smbus I/O instead of I2C */
18};
19
20#endif
diff --git a/include/media/rc-core.h b/include/media/rc-core.h
index 60536c74c1ea..b1f19b77ecd4 100644
--- a/include/media/rc-core.h
+++ b/include/media/rc-core.h
@@ -117,7 +117,7 @@ struct rc_dev {
117 int (*s_tx_carrier)(struct rc_dev *dev, u32 carrier); 117 int (*s_tx_carrier)(struct rc_dev *dev, u32 carrier);
118 int (*s_tx_duty_cycle)(struct rc_dev *dev, u32 duty_cycle); 118 int (*s_tx_duty_cycle)(struct rc_dev *dev, u32 duty_cycle);
119 int (*s_rx_carrier_range)(struct rc_dev *dev, u32 min, u32 max); 119 int (*s_rx_carrier_range)(struct rc_dev *dev, u32 min, u32 max);
120 int (*tx_ir)(struct rc_dev *dev, int *txbuf, u32 n); 120 int (*tx_ir)(struct rc_dev *dev, unsigned *txbuf, unsigned n);
121 void (*s_idle)(struct rc_dev *dev, bool enable); 121 void (*s_idle)(struct rc_dev *dev, bool enable);
122 int (*s_learning_mode)(struct rc_dev *dev, int enable); 122 int (*s_learning_mode)(struct rc_dev *dev, int enable);
123 int (*s_carrier_report) (struct rc_dev *dev, int enable); 123 int (*s_carrier_report) (struct rc_dev *dev, int enable);
diff --git a/include/media/rc-map.h b/include/media/rc-map.h
index 4e1409ec2613..17c9759ae77b 100644
--- a/include/media/rc-map.h
+++ b/include/media/rc-map.h
@@ -18,12 +18,13 @@
18#define RC_TYPE_JVC (1 << 3) /* JVC protocol */ 18#define RC_TYPE_JVC (1 << 3) /* JVC protocol */
19#define RC_TYPE_SONY (1 << 4) /* Sony12/15/20 protocol */ 19#define RC_TYPE_SONY (1 << 4) /* Sony12/15/20 protocol */
20#define RC_TYPE_RC5_SZ (1 << 5) /* RC5 variant used by Streamzap */ 20#define RC_TYPE_RC5_SZ (1 << 5) /* RC5 variant used by Streamzap */
21#define RC_TYPE_MCE_KBD (1 << 29) /* RC6-ish MCE keyboard/mouse */
21#define RC_TYPE_LIRC (1 << 30) /* Pass raw IR to lirc userspace */ 22#define RC_TYPE_LIRC (1 << 30) /* Pass raw IR to lirc userspace */
22#define RC_TYPE_OTHER (1u << 31) 23#define RC_TYPE_OTHER (1u << 31)
23 24
24#define RC_TYPE_ALL (RC_TYPE_RC5 | RC_TYPE_NEC | RC_TYPE_RC6 | \ 25#define RC_TYPE_ALL (RC_TYPE_RC5 | RC_TYPE_NEC | RC_TYPE_RC6 | \
25 RC_TYPE_JVC | RC_TYPE_SONY | RC_TYPE_LIRC | \ 26 RC_TYPE_JVC | RC_TYPE_SONY | RC_TYPE_LIRC | \
26 RC_TYPE_RC5_SZ | RC_TYPE_OTHER) 27 RC_TYPE_RC5_SZ | RC_TYPE_MCE_KBD | RC_TYPE_OTHER)
27 28
28struct rc_map_table { 29struct rc_map_table {
29 u32 scancode; 30 u32 scancode;
diff --git a/include/media/sh_mobile_ceu.h b/include/media/sh_mobile_ceu.h
index 80346a6d28a9..48413b410f15 100644
--- a/include/media/sh_mobile_ceu.h
+++ b/include/media/sh_mobile_ceu.h
@@ -7,10 +7,18 @@
7#define SH_CEU_FLAG_VSYNC_LOW (1 << 3) /* default High if possible */ 7#define SH_CEU_FLAG_VSYNC_LOW (1 << 3) /* default High if possible */
8 8
9struct device; 9struct device;
10struct resource;
11
12struct sh_mobile_ceu_companion {
13 u32 num_resources;
14 struct resource *resource;
15 int id;
16 void *platform_data;
17};
10 18
11struct sh_mobile_ceu_info { 19struct sh_mobile_ceu_info {
12 unsigned long flags; 20 unsigned long flags;
13 struct device *csi2_dev; 21 struct sh_mobile_ceu_companion *csi2;
14}; 22};
15 23
16#endif /* __ASM_SH_MOBILE_CEU_H__ */ 24#endif /* __ASM_SH_MOBILE_CEU_H__ */
diff --git a/include/media/sh_mobile_csi2.h b/include/media/sh_mobile_csi2.h
index 4d2615174461..c586c4f7f16b 100644
--- a/include/media/sh_mobile_csi2.h
+++ b/include/media/sh_mobile_csi2.h
@@ -11,6 +11,8 @@
11#ifndef SH_MIPI_CSI 11#ifndef SH_MIPI_CSI
12#define SH_MIPI_CSI 12#define SH_MIPI_CSI
13 13
14#include <linux/list.h>
15
14enum sh_csi2_phy { 16enum sh_csi2_phy {
15 SH_CSI2_PHY_MAIN, 17 SH_CSI2_PHY_MAIN,
16 SH_CSI2_PHY_SUB, 18 SH_CSI2_PHY_SUB,
@@ -33,14 +35,14 @@ struct sh_csi2_client_config {
33 struct platform_device *pdev; /* client platform device */ 35 struct platform_device *pdev; /* client platform device */
34}; 36};
35 37
38struct v4l2_device;
39
36struct sh_csi2_pdata { 40struct sh_csi2_pdata {
37 enum sh_csi2_type type; 41 enum sh_csi2_type type;
38 unsigned int flags; 42 unsigned int flags;
39 struct sh_csi2_client_config *clients; 43 struct sh_csi2_client_config *clients;
40 int num_clients; 44 int num_clients;
45 struct v4l2_device *v4l2_dev;
41}; 46};
42 47
43struct device;
44struct v4l2_device;
45
46#endif 48#endif
diff --git a/include/media/soc_camera.h b/include/media/soc_camera.h
index 238bd334fd83..7582952dceae 100644
--- a/include/media/soc_camera.h
+++ b/include/media/soc_camera.h
@@ -20,14 +20,15 @@
20#include <media/videobuf2-core.h> 20#include <media/videobuf2-core.h>
21#include <media/v4l2-device.h> 21#include <media/v4l2-device.h>
22 22
23extern struct bus_type soc_camera_bus_type;
24
25struct file; 23struct file;
24struct soc_camera_link;
26 25
27struct soc_camera_device { 26struct soc_camera_device {
28 struct list_head list; 27 struct list_head list; /* list of all registered devices */
29 struct device dev; 28 struct soc_camera_link *link;
30 struct device *pdev; /* Platform device */ 29 struct device *pdev; /* Platform device */
30 struct device *parent; /* Camera host device */
31 struct device *control; /* E.g., the i2c client */
31 s32 user_width; 32 s32 user_width;
32 s32 user_height; 33 s32 user_height;
33 u32 bytesperline; /* for padding, zero if unused */ 34 u32 bytesperline; /* for padding, zero if unused */
@@ -66,8 +67,6 @@ struct soc_camera_host_ops {
66 struct module *owner; 67 struct module *owner;
67 int (*add)(struct soc_camera_device *); 68 int (*add)(struct soc_camera_device *);
68 void (*remove)(struct soc_camera_device *); 69 void (*remove)(struct soc_camera_device *);
69 int (*suspend)(struct soc_camera_device *, pm_message_t);
70 int (*resume)(struct soc_camera_device *);
71 /* 70 /*
72 * .get_formats() is called for each client device format, but 71 * .get_formats() is called for each client device format, but
73 * .put_formats() is only called once. Further, if any of the calls to 72 * .put_formats() is only called once. Further, if any of the calls to
@@ -109,12 +108,6 @@ struct soc_camera_host_ops {
109#define SOCAM_SENSOR_INVERT_HSYNC (1 << 2) 108#define SOCAM_SENSOR_INVERT_HSYNC (1 << 2)
110#define SOCAM_SENSOR_INVERT_VSYNC (1 << 3) 109#define SOCAM_SENSOR_INVERT_VSYNC (1 << 3)
111#define SOCAM_SENSOR_INVERT_DATA (1 << 4) 110#define SOCAM_SENSOR_INVERT_DATA (1 << 4)
112#define SOCAM_MIPI_1LANE (1 << 5)
113#define SOCAM_MIPI_2LANE (1 << 6)
114#define SOCAM_MIPI_3LANE (1 << 7)
115#define SOCAM_MIPI_4LANE (1 << 8)
116#define SOCAM_MIPI (SOCAM_MIPI_1LANE | SOCAM_MIPI_2LANE | \
117 SOCAM_MIPI_3LANE | SOCAM_MIPI_4LANE)
118 111
119struct i2c_board_info; 112struct i2c_board_info;
120struct regulator_bulk_data; 113struct regulator_bulk_data;
@@ -134,11 +127,11 @@ struct soc_camera_link {
134 int num_regulators; 127 int num_regulators;
135 128
136 /* 129 /*
137 * For non-I2C devices platform platform has to provide methods to 130 * For non-I2C devices platform has to provide methods to add a device
138 * add a device to the system and to remove 131 * to the system and to remove it
139 */ 132 */
140 int (*add_device)(struct soc_camera_link *, struct device *); 133 int (*add_device)(struct soc_camera_device *);
141 void (*del_device)(struct soc_camera_link *); 134 void (*del_device)(struct soc_camera_device *);
142 /* Optional callbacks to power on or off and reset the sensor */ 135 /* Optional callbacks to power on or off and reset the sensor */
143 int (*power)(struct device *, int); 136 int (*power)(struct device *, int);
144 int (*reset)(struct device *); 137 int (*reset)(struct device *);
@@ -152,12 +145,6 @@ struct soc_camera_link {
152 void (*free_bus)(struct soc_camera_link *); 145 void (*free_bus)(struct soc_camera_link *);
153}; 146};
154 147
155static inline struct soc_camera_device *to_soc_camera_dev(
156 const struct device *dev)
157{
158 return container_of(dev, struct soc_camera_device, dev);
159}
160
161static inline struct soc_camera_host *to_soc_camera_host( 148static inline struct soc_camera_host *to_soc_camera_host(
162 const struct device *dev) 149 const struct device *dev)
163{ 150{
@@ -169,13 +156,13 @@ static inline struct soc_camera_host *to_soc_camera_host(
169static inline struct soc_camera_link *to_soc_camera_link( 156static inline struct soc_camera_link *to_soc_camera_link(
170 const struct soc_camera_device *icd) 157 const struct soc_camera_device *icd)
171{ 158{
172 return icd->dev.platform_data; 159 return icd->link;
173} 160}
174 161
175static inline struct device *to_soc_camera_control( 162static inline struct device *to_soc_camera_control(
176 const struct soc_camera_device *icd) 163 const struct soc_camera_device *icd)
177{ 164{
178 return dev_get_drvdata(&icd->dev); 165 return icd->control;
179} 166}
180 167
181static inline struct v4l2_subdev *soc_camera_to_subdev( 168static inline struct v4l2_subdev *soc_camera_to_subdev(
@@ -207,11 +194,8 @@ struct soc_camera_format_xlate {
207}; 194};
208 195
209struct soc_camera_ops { 196struct soc_camera_ops {
210 int (*suspend)(struct soc_camera_device *, pm_message_t state);
211 int (*resume)(struct soc_camera_device *);
212 unsigned long (*query_bus_param)(struct soc_camera_device *); 197 unsigned long (*query_bus_param)(struct soc_camera_device *);
213 int (*set_bus_param)(struct soc_camera_device *, unsigned long); 198 int (*set_bus_param)(struct soc_camera_device *, unsigned long);
214 int (*enum_input)(struct soc_camera_device *, struct v4l2_input *);
215 const struct v4l2_queryctrl *controls; 199 const struct v4l2_queryctrl *controls;
216 int num_controls; 200 int num_controls;
217}; 201};
@@ -270,6 +254,12 @@ static inline struct v4l2_queryctrl const *soc_camera_find_qctrl(
270#define SOCAM_PCLK_SAMPLE_FALLING (1 << 13) 254#define SOCAM_PCLK_SAMPLE_FALLING (1 << 13)
271#define SOCAM_DATA_ACTIVE_HIGH (1 << 14) 255#define SOCAM_DATA_ACTIVE_HIGH (1 << 14)
272#define SOCAM_DATA_ACTIVE_LOW (1 << 15) 256#define SOCAM_DATA_ACTIVE_LOW (1 << 15)
257#define SOCAM_MIPI_1LANE (1 << 16)
258#define SOCAM_MIPI_2LANE (1 << 17)
259#define SOCAM_MIPI_3LANE (1 << 18)
260#define SOCAM_MIPI_4LANE (1 << 19)
261#define SOCAM_MIPI (SOCAM_MIPI_1LANE | SOCAM_MIPI_2LANE | \
262 SOCAM_MIPI_3LANE | SOCAM_MIPI_4LANE)
273 263
274#define SOCAM_DATAWIDTH_MASK (SOCAM_DATAWIDTH_4 | SOCAM_DATAWIDTH_8 | \ 264#define SOCAM_DATAWIDTH_MASK (SOCAM_DATAWIDTH_4 | SOCAM_DATAWIDTH_8 | \
275 SOCAM_DATAWIDTH_9 | SOCAM_DATAWIDTH_10 | \ 265 SOCAM_DATAWIDTH_9 | SOCAM_DATAWIDTH_10 | \
diff --git a/include/media/soc_camera_platform.h b/include/media/soc_camera_platform.h
index 6d7a4fd00fc0..74f0fa15ca47 100644
--- a/include/media/soc_camera_platform.h
+++ b/include/media/soc_camera_platform.h
@@ -21,7 +21,7 @@ struct soc_camera_platform_info {
21 unsigned long format_depth; 21 unsigned long format_depth;
22 struct v4l2_mbus_framefmt format; 22 struct v4l2_mbus_framefmt format;
23 unsigned long bus_param; 23 unsigned long bus_param;
24 struct device *dev; 24 struct soc_camera_device *icd;
25 int (*set_capture)(struct soc_camera_platform_info *info, int enable); 25 int (*set_capture)(struct soc_camera_platform_info *info, int enable);
26}; 26};
27 27
@@ -30,8 +30,7 @@ static inline void soc_camera_platform_release(struct platform_device **pdev)
30 *pdev = NULL; 30 *pdev = NULL;
31} 31}
32 32
33static inline int soc_camera_platform_add(const struct soc_camera_link *icl, 33static inline int soc_camera_platform_add(struct soc_camera_device *icd,
34 struct device *dev,
35 struct platform_device **pdev, 34 struct platform_device **pdev,
36 struct soc_camera_link *plink, 35 struct soc_camera_link *plink,
37 void (*release)(struct device *dev), 36 void (*release)(struct device *dev),
@@ -40,7 +39,7 @@ static inline int soc_camera_platform_add(const struct soc_camera_link *icl,
40 struct soc_camera_platform_info *info = plink->priv; 39 struct soc_camera_platform_info *info = plink->priv;
41 int ret; 40 int ret;
42 41
43 if (icl != plink) 42 if (icd->link != plink)
44 return -ENODEV; 43 return -ENODEV;
45 44
46 if (*pdev) 45 if (*pdev)
@@ -50,7 +49,7 @@ static inline int soc_camera_platform_add(const struct soc_camera_link *icl,
50 if (!*pdev) 49 if (!*pdev)
51 return -ENOMEM; 50 return -ENOMEM;
52 51
53 info->dev = dev; 52 info->icd = icd;
54 53
55 (*pdev)->dev.platform_data = info; 54 (*pdev)->dev.platform_data = info;
56 (*pdev)->dev.release = release; 55 (*pdev)->dev.release = release;
@@ -59,17 +58,17 @@ static inline int soc_camera_platform_add(const struct soc_camera_link *icl,
59 if (ret < 0) { 58 if (ret < 0) {
60 platform_device_put(*pdev); 59 platform_device_put(*pdev);
61 *pdev = NULL; 60 *pdev = NULL;
62 info->dev = NULL; 61 info->icd = NULL;
63 } 62 }
64 63
65 return ret; 64 return ret;
66} 65}
67 66
68static inline void soc_camera_platform_del(const struct soc_camera_link *icl, 67static inline void soc_camera_platform_del(const struct soc_camera_device *icd,
69 struct platform_device *pdev, 68 struct platform_device *pdev,
70 const struct soc_camera_link *plink) 69 const struct soc_camera_link *plink)
71{ 70{
72 if (icl != plink || !pdev) 71 if (icd->link != plink || !pdev)
73 return; 72 return;
74 73
75 platform_device_unregister(pdev); 74 platform_device_unregister(pdev);
diff --git a/include/media/timb_radio.h b/include/media/timb_radio.h
index a59a84854dc1..a40a6a348d21 100644
--- a/include/media/timb_radio.h
+++ b/include/media/timb_radio.h
@@ -23,13 +23,8 @@
23 23
24struct timb_radio_platform_data { 24struct timb_radio_platform_data {
25 int i2c_adapter; /* I2C adapter where the tuner and dsp are attached */ 25 int i2c_adapter; /* I2C adapter where the tuner and dsp are attached */
26 struct { 26 struct i2c_board_info *tuner;
27 struct i2c_board_info *info; 27 struct i2c_board_info *dsp;
28 } tuner;
29 struct {
30 const char *module_name;
31 struct i2c_board_info *info;
32 } dsp;
33}; 28};
34 29
35#endif 30#endif
diff --git a/include/media/tuner.h b/include/media/tuner.h
index 963e33471835..89c290b69a5c 100644
--- a/include/media/tuner.h
+++ b/include/media/tuner.h
@@ -127,6 +127,8 @@
127#define TUNER_PHILIPS_FMD1216MEX_MK3 78 127#define TUNER_PHILIPS_FMD1216MEX_MK3 78
128#define TUNER_PHILIPS_FM1216MK5 79 128#define TUNER_PHILIPS_FM1216MK5 79
129#define TUNER_PHILIPS_FQ1216LME_MK3 80 /* Active loopthrough, no FM */ 129#define TUNER_PHILIPS_FQ1216LME_MK3 80 /* Active loopthrough, no FM */
130#define TUNER_XC4000 81 /* Xceive Silicon Tuner */
131
130#define TUNER_PARTSNIC_PTI_5NF05 81 132#define TUNER_PARTSNIC_PTI_5NF05 81
131#define TUNER_PHILIPS_CU1216L 82 133#define TUNER_PHILIPS_CU1216L 82
132#define TUNER_NXP_TDA18271 83 134#define TUNER_NXP_TDA18271 83
diff --git a/include/media/v4l2-chip-ident.h b/include/media/v4l2-chip-ident.h
index b3edb67a8311..63fd9d3db296 100644
--- a/include/media/v4l2-chip-ident.h
+++ b/include/media/v4l2-chip-ident.h
@@ -76,6 +76,7 @@ enum {
76 V4L2_IDENT_OV6650 = 258, 76 V4L2_IDENT_OV6650 = 258,
77 V4L2_IDENT_OV2640 = 259, 77 V4L2_IDENT_OV2640 = 259,
78 V4L2_IDENT_OV9740 = 260, 78 V4L2_IDENT_OV9740 = 260,
79 V4L2_IDENT_OV5642 = 261,
79 80
80 /* module saa7146: reserved range 300-309 */ 81 /* module saa7146: reserved range 300-309 */
81 V4L2_IDENT_SAA7146 = 300, 82 V4L2_IDENT_SAA7146 = 300,
@@ -185,8 +186,9 @@ enum {
185 /* module wm8775: just ident 8775 */ 186 /* module wm8775: just ident 8775 */
186 V4L2_IDENT_WM8775 = 8775, 187 V4L2_IDENT_WM8775 = 8775,
187 188
188 /* module cafe_ccic, just ident 8801 */ 189 /* Marvell controllers starting at 8801 */
189 V4L2_IDENT_CAFE = 8801, 190 V4L2_IDENT_CAFE = 8801,
191 V4L2_IDENT_ARMADA610 = 8802,
190 192
191 /* AKM AK8813/AK8814 */ 193 /* AKM AK8813/AK8814 */
192 V4L2_IDENT_AK8813 = 8813, 194 V4L2_IDENT_AK8813 = 8813,
diff --git a/include/media/v4l2-ctrls.h b/include/media/v4l2-ctrls.h
index 97d063837b61..13fe4d744aba 100644
--- a/include/media/v4l2-ctrls.h
+++ b/include/media/v4l2-ctrls.h
@@ -27,9 +27,12 @@
27 27
28/* forward references */ 28/* forward references */
29struct v4l2_ctrl_handler; 29struct v4l2_ctrl_handler;
30struct v4l2_ctrl_helper;
30struct v4l2_ctrl; 31struct v4l2_ctrl;
31struct video_device; 32struct video_device;
32struct v4l2_subdev; 33struct v4l2_subdev;
34struct v4l2_subscribed_event;
35struct v4l2_fh;
33 36
34/** struct v4l2_ctrl_ops - The control operations that the driver has to provide. 37/** struct v4l2_ctrl_ops - The control operations that the driver has to provide.
35 * @g_volatile_ctrl: Get a new value for this control. Generally only relevant 38 * @g_volatile_ctrl: Get a new value for this control. Generally only relevant
@@ -51,6 +54,7 @@ struct v4l2_ctrl_ops {
51 54
52/** struct v4l2_ctrl - The control structure. 55/** struct v4l2_ctrl - The control structure.
53 * @node: The list node. 56 * @node: The list node.
57 * @ev_subs: The list of control event subscriptions.
54 * @handler: The handler that owns the control. 58 * @handler: The handler that owns the control.
55 * @cluster: Point to start of cluster array. 59 * @cluster: Point to start of cluster array.
56 * @ncontrols: Number of controls in cluster array. 60 * @ncontrols: Number of controls in cluster array.
@@ -65,6 +69,15 @@ struct v4l2_ctrl_ops {
65 * control's current value cannot be cached and needs to be 69 * control's current value cannot be cached and needs to be
66 * retrieved through the g_volatile_ctrl op. Drivers can set 70 * retrieved through the g_volatile_ctrl op. Drivers can set
67 * this flag. 71 * this flag.
72 * @is_auto: If set, then this control selects whether the other cluster
73 * members are in 'automatic' mode or 'manual' mode. This is
74 * used for autogain/gain type clusters. Drivers should never
75 * set this flag directly.
76 * @manual_mode_value: If the is_auto flag is set, then this is the value
77 * of the auto control that determines if that control is in
78 * manual mode. So if the value of the auto control equals this
79 * value, then the whole cluster is in manual mode. Drivers should
80 * never set this flag directly.
68 * @ops: The control ops. 81 * @ops: The control ops.
69 * @id: The control ID. 82 * @id: The control ID.
70 * @name: The control name. 83 * @name: The control name.
@@ -97,6 +110,7 @@ struct v4l2_ctrl_ops {
97struct v4l2_ctrl { 110struct v4l2_ctrl {
98 /* Administrative fields */ 111 /* Administrative fields */
99 struct list_head node; 112 struct list_head node;
113 struct list_head ev_subs;
100 struct v4l2_ctrl_handler *handler; 114 struct v4l2_ctrl_handler *handler;
101 struct v4l2_ctrl **cluster; 115 struct v4l2_ctrl **cluster;
102 unsigned ncontrols; 116 unsigned ncontrols;
@@ -105,6 +119,8 @@ struct v4l2_ctrl {
105 unsigned int is_new:1; 119 unsigned int is_new:1;
106 unsigned int is_private:1; 120 unsigned int is_private:1;
107 unsigned int is_volatile:1; 121 unsigned int is_volatile:1;
122 unsigned int is_auto:1;
123 unsigned int manual_mode_value:8;
108 124
109 const struct v4l2_ctrl_ops *ops; 125 const struct v4l2_ctrl_ops *ops;
110 u32 id; 126 u32 id;
@@ -134,6 +150,7 @@ struct v4l2_ctrl {
134 * @node: List node for the sorted list. 150 * @node: List node for the sorted list.
135 * @next: Single-link list node for the hash. 151 * @next: Single-link list node for the hash.
136 * @ctrl: The actual control information. 152 * @ctrl: The actual control information.
153 * @helper: Pointer to helper struct. Used internally in prepare_ext_ctrls().
137 * 154 *
138 * Each control handler has a list of these refs. The list_head is used to 155 * Each control handler has a list of these refs. The list_head is used to
139 * keep a sorted-by-control-ID list of all controls, while the next pointer 156 * keep a sorted-by-control-ID list of all controls, while the next pointer
@@ -143,6 +160,7 @@ struct v4l2_ctrl_ref {
143 struct list_head node; 160 struct list_head node;
144 struct v4l2_ctrl_ref *next; 161 struct v4l2_ctrl_ref *next;
145 struct v4l2_ctrl *ctrl; 162 struct v4l2_ctrl *ctrl;
163 struct v4l2_ctrl_helper *helper;
146}; 164};
147 165
148/** struct v4l2_ctrl_handler - The control handler keeps track of all the 166/** struct v4l2_ctrl_handler - The control handler keeps track of all the
@@ -363,6 +381,40 @@ int v4l2_ctrl_add_handler(struct v4l2_ctrl_handler *hdl,
363void v4l2_ctrl_cluster(unsigned ncontrols, struct v4l2_ctrl **controls); 381void v4l2_ctrl_cluster(unsigned ncontrols, struct v4l2_ctrl **controls);
364 382
365 383
384/** v4l2_ctrl_auto_cluster() - Mark all controls in the cluster as belonging to
385 * that cluster and set it up for autofoo/foo-type handling.
386 * @ncontrols: The number of controls in this cluster.
387 * @controls: The cluster control array of size @ncontrols. The first control
388 * must be the 'auto' control (e.g. autogain, autoexposure, etc.)
389 * @manual_val: The value for the first control in the cluster that equals the
390 * manual setting.
391 * @set_volatile: If true, then all controls except the first auto control will
392 * have is_volatile set to true. If false, then is_volatile will not
393 * be touched.
394 *
395 * Use for control groups where one control selects some automatic feature and
396 * the other controls are only active whenever the automatic feature is turned
397 * off (manual mode). Typical examples: autogain vs gain, auto-whitebalance vs
398 * red and blue balance, etc.
399 *
400 * The behavior of such controls is as follows:
401 *
402 * When the autofoo control is set to automatic, then any manual controls
403 * are set to inactive and any reads will call g_volatile_ctrl (if the control
404 * was marked volatile).
405 *
406 * When the autofoo control is set to manual, then any manual controls will
407 * be marked active, and any reads will just return the current value without
408 * going through g_volatile_ctrl.
409 *
410 * In addition, this function will set the V4L2_CTRL_FLAG_UPDATE flag
411 * on the autofoo control and V4L2_CTRL_FLAG_INACTIVE on the foo control(s)
412 * if autofoo is in auto mode.
413 */
414void v4l2_ctrl_auto_cluster(unsigned ncontrols, struct v4l2_ctrl **controls,
415 u8 manual_val, bool set_volatile);
416
417
366/** v4l2_ctrl_find() - Find a control with the given ID. 418/** v4l2_ctrl_find() - Find a control with the given ID.
367 * @hdl: The control handler. 419 * @hdl: The control handler.
368 * @id: The control ID to find. 420 * @id: The control ID to find.
@@ -379,9 +431,9 @@ struct v4l2_ctrl *v4l2_ctrl_find(struct v4l2_ctrl_handler *hdl, u32 id);
379 * This sets or clears the V4L2_CTRL_FLAG_INACTIVE flag atomically. 431 * This sets or clears the V4L2_CTRL_FLAG_INACTIVE flag atomically.
380 * Does nothing if @ctrl == NULL. 432 * Does nothing if @ctrl == NULL.
381 * This will usually be called from within the s_ctrl op. 433 * This will usually be called from within the s_ctrl op.
434 * The V4L2_EVENT_CTRL event will be generated afterwards.
382 * 435 *
383 * This function can be called regardless of whether the control handler 436 * This function assumes that the control handler is locked.
384 * is locked or not.
385 */ 437 */
386void v4l2_ctrl_activate(struct v4l2_ctrl *ctrl, bool active); 438void v4l2_ctrl_activate(struct v4l2_ctrl *ctrl, bool active);
387 439
@@ -391,11 +443,12 @@ void v4l2_ctrl_activate(struct v4l2_ctrl *ctrl, bool active);
391 * 443 *
392 * This sets or clears the V4L2_CTRL_FLAG_GRABBED flag atomically. 444 * This sets or clears the V4L2_CTRL_FLAG_GRABBED flag atomically.
393 * Does nothing if @ctrl == NULL. 445 * Does nothing if @ctrl == NULL.
446 * The V4L2_EVENT_CTRL event will be generated afterwards.
394 * This will usually be called when starting or stopping streaming in the 447 * This will usually be called when starting or stopping streaming in the
395 * driver. 448 * driver.
396 * 449 *
397 * This function can be called regardless of whether the control handler 450 * This function assumes that the control handler is not locked and will
398 * is locked or not. 451 * take the lock itself.
399 */ 452 */
400void v4l2_ctrl_grab(struct v4l2_ctrl *ctrl, bool grabbed); 453void v4l2_ctrl_grab(struct v4l2_ctrl *ctrl, bool grabbed);
401 454
@@ -440,15 +493,22 @@ s32 v4l2_ctrl_g_ctrl(struct v4l2_ctrl *ctrl);
440 */ 493 */
441int v4l2_ctrl_s_ctrl(struct v4l2_ctrl *ctrl, s32 val); 494int v4l2_ctrl_s_ctrl(struct v4l2_ctrl *ctrl, s32 val);
442 495
496/* Internal helper functions that deal with control events. */
497void v4l2_ctrl_add_event(struct v4l2_ctrl *ctrl,
498 struct v4l2_subscribed_event *sev);
499void v4l2_ctrl_del_event(struct v4l2_ctrl *ctrl,
500 struct v4l2_subscribed_event *sev);
443 501
444/* Helpers for ioctl_ops. If hdl == NULL then they will all return -EINVAL. */ 502/* Helpers for ioctl_ops. If hdl == NULL then they will all return -EINVAL. */
445int v4l2_queryctrl(struct v4l2_ctrl_handler *hdl, struct v4l2_queryctrl *qc); 503int v4l2_queryctrl(struct v4l2_ctrl_handler *hdl, struct v4l2_queryctrl *qc);
446int v4l2_querymenu(struct v4l2_ctrl_handler *hdl, struct v4l2_querymenu *qm); 504int v4l2_querymenu(struct v4l2_ctrl_handler *hdl, struct v4l2_querymenu *qm);
447int v4l2_g_ctrl(struct v4l2_ctrl_handler *hdl, struct v4l2_control *ctrl); 505int v4l2_g_ctrl(struct v4l2_ctrl_handler *hdl, struct v4l2_control *ctrl);
448int v4l2_s_ctrl(struct v4l2_ctrl_handler *hdl, struct v4l2_control *ctrl); 506int v4l2_s_ctrl(struct v4l2_fh *fh, struct v4l2_ctrl_handler *hdl,
507 struct v4l2_control *ctrl);
449int v4l2_g_ext_ctrls(struct v4l2_ctrl_handler *hdl, struct v4l2_ext_controls *c); 508int v4l2_g_ext_ctrls(struct v4l2_ctrl_handler *hdl, struct v4l2_ext_controls *c);
450int v4l2_try_ext_ctrls(struct v4l2_ctrl_handler *hdl, struct v4l2_ext_controls *c); 509int v4l2_try_ext_ctrls(struct v4l2_ctrl_handler *hdl, struct v4l2_ext_controls *c);
451int v4l2_s_ext_ctrls(struct v4l2_ctrl_handler *hdl, struct v4l2_ext_controls *c); 510int v4l2_s_ext_ctrls(struct v4l2_fh *fh, struct v4l2_ctrl_handler *hdl,
511 struct v4l2_ext_controls *c);
452 512
453/* Helpers for subdevices. If the associated ctrl_handler == NULL then they 513/* Helpers for subdevices. If the associated ctrl_handler == NULL then they
454 will all return -EINVAL. */ 514 will all return -EINVAL. */
diff --git a/include/media/v4l2-dev.h b/include/media/v4l2-dev.h
index 93e96fb93452..c7c40f1d2624 100644
--- a/include/media/v4l2-dev.h
+++ b/include/media/v4l2-dev.h
@@ -128,8 +128,8 @@ struct video_device
128 struct mutex *lock; 128 struct mutex *lock;
129}; 129};
130 130
131#define media_entity_to_video_device(entity) \ 131#define media_entity_to_video_device(__e) \
132 container_of(entity, struct video_device, entity) 132 container_of(__e, struct video_device, entity)
133/* dev to video-device */ 133/* dev to video-device */
134#define to_video_device(cd) container_of(cd, struct video_device, dev) 134#define to_video_device(cd) container_of(cd, struct video_device, dev)
135 135
diff --git a/include/media/v4l2-event.h b/include/media/v4l2-event.h
index 3b86177c8cd2..5f14e8895ce2 100644
--- a/include/media/v4l2-event.h
+++ b/include/media/v4l2-event.h
@@ -29,39 +29,95 @@
29#include <linux/videodev2.h> 29#include <linux/videodev2.h>
30#include <linux/wait.h> 30#include <linux/wait.h>
31 31
32/*
33 * Overview:
34 *
35 * Events are subscribed per-filehandle. An event specification consists of a
36 * type and is optionally associated with an object identified through the
37 * 'id' field. So an event is uniquely identified by the (type, id) tuple.
38 *
39 * The v4l2-fh struct has a list of subscribed events. The v4l2_subscribed_event
40 * struct is added to that list, one for every subscribed event.
41 *
42 * Each v4l2_subscribed_event struct ends with an array of v4l2_kevent structs.
43 * This array (ringbuffer, really) is used to store any events raised by the
44 * driver. The v4l2_kevent struct links into the 'available' list of the
45 * v4l2_fh struct so VIDIOC_DQEVENT will know which event to dequeue first.
46 *
47 * Finally, if the event subscription is associated with a particular object
48 * such as a V4L2 control, then that object needs to know about that as well
49 * so that an event can be raised by that object. So the 'node' field can
50 * be used to link the v4l2_subscribed_event struct into a list of that
51 * object.
52 *
53 * So to summarize:
54 *
55 * struct v4l2_fh has two lists: one of the subscribed events, and one of the
56 * pending events.
57 *
58 * struct v4l2_subscribed_event has a ringbuffer of raised (pending) events of
59 * that particular type.
60 *
61 * If struct v4l2_subscribed_event is associated with a specific object, then
62 * that object will have an internal list of struct v4l2_subscribed_event so
63 * it knows who subscribed an event to that object.
64 */
65
32struct v4l2_fh; 66struct v4l2_fh;
67struct v4l2_subscribed_event;
33struct video_device; 68struct video_device;
34 69
70/** struct v4l2_kevent - Internal kernel event struct.
71 * @list: List node for the v4l2_fh->available list.
72 * @sev: Pointer to parent v4l2_subscribed_event.
73 * @event: The event itself.
74 */
35struct v4l2_kevent { 75struct v4l2_kevent {
36 struct list_head list; 76 struct list_head list;
77 struct v4l2_subscribed_event *sev;
37 struct v4l2_event event; 78 struct v4l2_event event;
38}; 79};
39 80
81/** struct v4l2_subscribed_event - Internal struct representing a subscribed event.
82 * @list: List node for the v4l2_fh->subscribed list.
83 * @type: Event type.
84 * @id: Associated object ID (e.g. control ID). 0 if there isn't any.
85 * @flags: Copy of v4l2_event_subscription->flags.
86 * @fh: Filehandle that subscribed to this event.
87 * @node: List node that hooks into the object's event list (if there is one).
88 * @replace: Optional callback that can replace event 'old' with event 'new'.
89 * @merge: Optional callback that can merge event 'old' into event 'new'.
90 * @elems: The number of elements in the events array.
91 * @first: The index of the events containing the oldest available event.
92 * @in_use: The number of queued events.
93 * @events: An array of @elems events.
94 */
40struct v4l2_subscribed_event { 95struct v4l2_subscribed_event {
41 struct list_head list; 96 struct list_head list;
42 u32 type; 97 u32 type;
98 u32 id;
99 u32 flags;
100 struct v4l2_fh *fh;
101 struct list_head node;
102 void (*replace)(struct v4l2_event *old,
103 const struct v4l2_event *new);
104 void (*merge)(const struct v4l2_event *old,
105 struct v4l2_event *new);
106 unsigned elems;
107 unsigned first;
108 unsigned in_use;
109 struct v4l2_kevent events[];
43}; 110};
44 111
45struct v4l2_events {
46 wait_queue_head_t wait;
47 struct list_head subscribed; /* Subscribed events */
48 struct list_head free; /* Events ready for use */
49 struct list_head available; /* Dequeueable event */
50 unsigned int navailable;
51 unsigned int nallocated; /* Number of allocated events */
52 u32 sequence;
53};
54
55int v4l2_event_init(struct v4l2_fh *fh);
56int v4l2_event_alloc(struct v4l2_fh *fh, unsigned int n);
57void v4l2_event_free(struct v4l2_fh *fh);
58int v4l2_event_dequeue(struct v4l2_fh *fh, struct v4l2_event *event, 112int v4l2_event_dequeue(struct v4l2_fh *fh, struct v4l2_event *event,
59 int nonblocking); 113 int nonblocking);
60void v4l2_event_queue(struct video_device *vdev, const struct v4l2_event *ev); 114void v4l2_event_queue(struct video_device *vdev, const struct v4l2_event *ev);
115void v4l2_event_queue_fh(struct v4l2_fh *fh, const struct v4l2_event *ev);
61int v4l2_event_pending(struct v4l2_fh *fh); 116int v4l2_event_pending(struct v4l2_fh *fh);
62int v4l2_event_subscribe(struct v4l2_fh *fh, 117int v4l2_event_subscribe(struct v4l2_fh *fh,
63 struct v4l2_event_subscription *sub); 118 struct v4l2_event_subscription *sub, unsigned elems);
64int v4l2_event_unsubscribe(struct v4l2_fh *fh, 119int v4l2_event_unsubscribe(struct v4l2_fh *fh,
65 struct v4l2_event_subscription *sub); 120 struct v4l2_event_subscription *sub);
121void v4l2_event_unsubscribe_all(struct v4l2_fh *fh);
66 122
67#endif /* V4L2_EVENT_H */ 123#endif /* V4L2_EVENT_H */
diff --git a/include/media/v4l2-fh.h b/include/media/v4l2-fh.h
index 0206aa55be24..52513c225c18 100644
--- a/include/media/v4l2-fh.h
+++ b/include/media/v4l2-fh.h
@@ -29,13 +29,20 @@
29#include <linux/list.h> 29#include <linux/list.h>
30 30
31struct video_device; 31struct video_device;
32struct v4l2_events; 32struct v4l2_ctrl_handler;
33 33
34struct v4l2_fh { 34struct v4l2_fh {
35 struct list_head list; 35 struct list_head list;
36 struct video_device *vdev; 36 struct video_device *vdev;
37 struct v4l2_events *events; /* events, pending and subscribed */ 37 struct v4l2_ctrl_handler *ctrl_handler;
38 enum v4l2_priority prio; 38 enum v4l2_priority prio;
39
40 /* Events */
41 wait_queue_head_t wait;
42 struct list_head subscribed; /* Subscribed events */
43 struct list_head available; /* Dequeueable event */
44 unsigned int navailable;
45 u32 sequence;
39}; 46};
40 47
41/* 48/*
@@ -44,7 +51,7 @@ struct v4l2_fh {
44 * from driver's v4l2_file_operations->open() handler if the driver 51 * from driver's v4l2_file_operations->open() handler if the driver
45 * uses v4l2_fh. 52 * uses v4l2_fh.
46 */ 53 */
47int v4l2_fh_init(struct v4l2_fh *fh, struct video_device *vdev); 54void v4l2_fh_init(struct v4l2_fh *fh, struct video_device *vdev);
48/* 55/*
49 * Add the fh to the list of file handles on a video_device. The file 56 * Add the fh to the list of file handles on a video_device. The file
50 * handle must be initialised first. 57 * handle must be initialised first.
diff --git a/include/media/v4l2-mediabus.h b/include/media/v4l2-mediabus.h
index 971c7fa29614..6114007c8c74 100644
--- a/include/media/v4l2-mediabus.h
+++ b/include/media/v4l2-mediabus.h
@@ -13,6 +13,69 @@
13 13
14#include <linux/v4l2-mediabus.h> 14#include <linux/v4l2-mediabus.h>
15 15
16/* Parallel flags */
17/*
18 * Can the client run in master or in slave mode. By "Master mode" an operation
19 * mode is meant, when the client (e.g., a camera sensor) is producing
20 * horizontal and vertical synchronisation. In "Slave mode" the host is
21 * providing these signals to the slave.
22 */
23#define V4L2_MBUS_MASTER (1 << 0)
24#define V4L2_MBUS_SLAVE (1 << 1)
25/* Which signal polarities it supports */
26/* Note: in BT.656 mode HSYNC and VSYNC are unused */
27#define V4L2_MBUS_HSYNC_ACTIVE_HIGH (1 << 2)
28#define V4L2_MBUS_HSYNC_ACTIVE_LOW (1 << 3)
29#define V4L2_MBUS_VSYNC_ACTIVE_HIGH (1 << 4)
30#define V4L2_MBUS_VSYNC_ACTIVE_LOW (1 << 5)
31#define V4L2_MBUS_PCLK_SAMPLE_RISING (1 << 6)
32#define V4L2_MBUS_PCLK_SAMPLE_FALLING (1 << 7)
33#define V4L2_MBUS_DATA_ACTIVE_HIGH (1 << 8)
34#define V4L2_MBUS_DATA_ACTIVE_LOW (1 << 9)
35
36/* Serial flags */
37/* How many lanes the client can use */
38#define V4L2_MBUS_CSI2_1_LANE (1 << 0)
39#define V4L2_MBUS_CSI2_2_LANE (1 << 1)
40#define V4L2_MBUS_CSI2_3_LANE (1 << 2)
41#define V4L2_MBUS_CSI2_4_LANE (1 << 3)
42/* On which channels it can send video data */
43#define V4L2_MBUS_CSI2_CHANNEL_0 (1 << 4)
44#define V4L2_MBUS_CSI2_CHANNEL_1 (1 << 5)
45#define V4L2_MBUS_CSI2_CHANNEL_2 (1 << 6)
46#define V4L2_MBUS_CSI2_CHANNEL_3 (1 << 7)
47/* Does it support only continuous or also non-continuous clock mode */
48#define V4L2_MBUS_CSI2_CONTINUOUS_CLOCK (1 << 8)
49#define V4L2_MBUS_CSI2_NONCONTINUOUS_CLOCK (1 << 9)
50
51#define V4L2_MBUS_CSI2_LANES (V4L2_MBUS_CSI2_1_LANE | V4L2_MBUS_CSI2_2_LANE | \
52 V4L2_MBUS_CSI2_3_LANE | V4L2_MBUS_CSI2_4_LANE)
53#define V4L2_MBUS_CSI2_CHANNELS (V4L2_MBUS_CSI2_CHANNEL_0 | V4L2_MBUS_CSI2_CHANNEL_1 | \
54 V4L2_MBUS_CSI2_CHANNEL_2 | V4L2_MBUS_CSI2_CHANNEL_3)
55
56/**
57 * v4l2_mbus_type - media bus type
58 * @V4L2_MBUS_PARALLEL: parallel interface with hsync and vsync
59 * @V4L2_MBUS_BT656: parallel interface with embedded synchronisation, can
60 * also be used for BT.1120
61 * @V4L2_MBUS_CSI2: MIPI CSI-2 serial interface
62 */
63enum v4l2_mbus_type {
64 V4L2_MBUS_PARALLEL,
65 V4L2_MBUS_BT656,
66 V4L2_MBUS_CSI2,
67};
68
69/**
70 * v4l2_mbus_config - media bus configuration
71 * @type: in: interface type
72 * @flags: in / out: configuration flags, depending on @type
73 */
74struct v4l2_mbus_config {
75 enum v4l2_mbus_type type;
76 unsigned int flags;
77};
78
16static inline void v4l2_fill_pix_format(struct v4l2_pix_format *pix_fmt, 79static inline void v4l2_fill_pix_format(struct v4l2_pix_format *pix_fmt,
17 const struct v4l2_mbus_framefmt *mbus_fmt) 80 const struct v4l2_mbus_framefmt *mbus_fmt)
18{ 81{
diff --git a/include/media/v4l2-subdev.h b/include/media/v4l2-subdev.h
index 1562c4ff3a65..257da1a30f66 100644
--- a/include/media/v4l2-subdev.h
+++ b/include/media/v4l2-subdev.h
@@ -173,16 +173,20 @@ struct v4l2_subdev_core_ops {
173 struct v4l2_event_subscription *sub); 173 struct v4l2_event_subscription *sub);
174}; 174};
175 175
176/* s_mode: switch the tuner to a specific tuner mode. Replacement of s_radio. 176/* s_radio: v4l device was opened in radio mode.
177 177
178 s_radio: v4l device was opened in Radio mode, to be replaced by s_mode. 178 g_frequency: freq->type must be filled in. Normally done by video_ioctl2
179 or the bridge driver.
180
181 g_tuner:
182 s_tuner: vt->type must be filled in. Normally done by video_ioctl2 or the
183 bridge driver.
179 184
180 s_type_addr: sets tuner type and its I2C addr. 185 s_type_addr: sets tuner type and its I2C addr.
181 186
182 s_config: sets tda9887 specific stuff, like port1, port2 and qss 187 s_config: sets tda9887 specific stuff, like port1, port2 and qss
183 */ 188 */
184struct v4l2_subdev_tuner_ops { 189struct v4l2_subdev_tuner_ops {
185 int (*s_mode)(struct v4l2_subdev *sd, enum v4l2_tuner_type);
186 int (*s_radio)(struct v4l2_subdev *sd); 190 int (*s_radio)(struct v4l2_subdev *sd);
187 int (*s_frequency)(struct v4l2_subdev *sd, struct v4l2_frequency *freq); 191 int (*s_frequency)(struct v4l2_subdev *sd, struct v4l2_frequency *freq);
188 int (*g_frequency)(struct v4l2_subdev *sd, struct v4l2_frequency *freq); 192 int (*g_frequency)(struct v4l2_subdev *sd, struct v4l2_frequency *freq);
@@ -225,6 +229,12 @@ struct v4l2_subdev_audio_ops {
225 s_std_output: set v4l2_std_id for video OUTPUT devices. This is ignored by 229 s_std_output: set v4l2_std_id for video OUTPUT devices. This is ignored by
226 video input devices. 230 video input devices.
227 231
232 g_std_output: get current standard for video OUTPUT devices. This is ignored
233 by video input devices.
234
235 g_tvnorms_output: get v4l2_std_id with all standards supported by video
236 OUTPUT device. This is ignored by video input devices.
237
228 s_crystal_freq: sets the frequency of the crystal used to generate the 238 s_crystal_freq: sets the frequency of the crystal used to generate the
229 clocks in Hz. An extra flags field allows device specific configuration 239 clocks in Hz. An extra flags field allows device specific configuration
230 regarding clock frequency dividers, etc. If not used, then set flags 240 regarding clock frequency dividers, etc. If not used, then set flags
@@ -239,6 +249,8 @@ struct v4l2_subdev_audio_ops {
239 s_dv_preset: set dv (Digital Video) preset in the sub device. Similar to 249 s_dv_preset: set dv (Digital Video) preset in the sub device. Similar to
240 s_std() 250 s_std()
241 251
252 g_dv_preset: get current dv (Digital Video) preset in the sub device.
253
242 query_dv_preset: query dv preset in the sub device. This is similar to 254 query_dv_preset: query dv preset in the sub device. This is similar to
243 querystd() 255 querystd()
244 256
@@ -255,12 +267,20 @@ struct v4l2_subdev_audio_ops {
255 try_mbus_fmt: try to set a pixel format on a video data source 267 try_mbus_fmt: try to set a pixel format on a video data source
256 268
257 s_mbus_fmt: set a pixel format on a video data source 269 s_mbus_fmt: set a pixel format on a video data source
270
271 g_mbus_config: get supported mediabus configurations
272
273 s_mbus_config: set a certain mediabus configuration. This operation is added
274 for compatibility with soc-camera drivers and should not be used by new
275 software.
258 */ 276 */
259struct v4l2_subdev_video_ops { 277struct v4l2_subdev_video_ops {
260 int (*s_routing)(struct v4l2_subdev *sd, u32 input, u32 output, u32 config); 278 int (*s_routing)(struct v4l2_subdev *sd, u32 input, u32 output, u32 config);
261 int (*s_crystal_freq)(struct v4l2_subdev *sd, u32 freq, u32 flags); 279 int (*s_crystal_freq)(struct v4l2_subdev *sd, u32 freq, u32 flags);
262 int (*s_std_output)(struct v4l2_subdev *sd, v4l2_std_id std); 280 int (*s_std_output)(struct v4l2_subdev *sd, v4l2_std_id std);
281 int (*g_std_output)(struct v4l2_subdev *sd, v4l2_std_id *std);
263 int (*querystd)(struct v4l2_subdev *sd, v4l2_std_id *std); 282 int (*querystd)(struct v4l2_subdev *sd, v4l2_std_id *std);
283 int (*g_tvnorms_output)(struct v4l2_subdev *sd, v4l2_std_id *std);
264 int (*g_input_status)(struct v4l2_subdev *sd, u32 *status); 284 int (*g_input_status)(struct v4l2_subdev *sd, u32 *status);
265 int (*s_stream)(struct v4l2_subdev *sd, int enable); 285 int (*s_stream)(struct v4l2_subdev *sd, int enable);
266 int (*cropcap)(struct v4l2_subdev *sd, struct v4l2_cropcap *cc); 286 int (*cropcap)(struct v4l2_subdev *sd, struct v4l2_cropcap *cc);
@@ -278,6 +298,8 @@ struct v4l2_subdev_video_ops {
278 struct v4l2_dv_enum_preset *preset); 298 struct v4l2_dv_enum_preset *preset);
279 int (*s_dv_preset)(struct v4l2_subdev *sd, 299 int (*s_dv_preset)(struct v4l2_subdev *sd,
280 struct v4l2_dv_preset *preset); 300 struct v4l2_dv_preset *preset);
301 int (*g_dv_preset)(struct v4l2_subdev *sd,
302 struct v4l2_dv_preset *preset);
281 int (*query_dv_preset)(struct v4l2_subdev *sd, 303 int (*query_dv_preset)(struct v4l2_subdev *sd,
282 struct v4l2_dv_preset *preset); 304 struct v4l2_dv_preset *preset);
283 int (*s_dv_timings)(struct v4l2_subdev *sd, 305 int (*s_dv_timings)(struct v4l2_subdev *sd,
@@ -294,6 +316,10 @@ struct v4l2_subdev_video_ops {
294 struct v4l2_mbus_framefmt *fmt); 316 struct v4l2_mbus_framefmt *fmt);
295 int (*s_mbus_fmt)(struct v4l2_subdev *sd, 317 int (*s_mbus_fmt)(struct v4l2_subdev *sd,
296 struct v4l2_mbus_framefmt *fmt); 318 struct v4l2_mbus_framefmt *fmt);
319 int (*g_mbus_config)(struct v4l2_subdev *sd,
320 struct v4l2_mbus_config *cfg);
321 int (*s_mbus_config)(struct v4l2_subdev *sd,
322 const struct v4l2_mbus_config *cfg);
297}; 323};
298 324
299/* 325/*
@@ -509,8 +535,6 @@ struct v4l2_subdev {
509 void *host_priv; 535 void *host_priv;
510 /* subdev device node */ 536 /* subdev device node */
511 struct video_device devnode; 537 struct video_device devnode;
512 /* number of events to be allocated on open */
513 unsigned int nevents;
514}; 538};
515 539
516#define media_entity_to_v4l2_subdev(ent) \ 540#define media_entity_to_v4l2_subdev(ent) \
diff --git a/include/net/9p/9p.h b/include/net/9p/9p.h
index 008711e8e78f..342dcf13d039 100644
--- a/include/net/9p/9p.h
+++ b/include/net/9p/9p.h
@@ -40,6 +40,7 @@
40 * @P9_DEBUG_FID: fid allocation/deallocation tracking 40 * @P9_DEBUG_FID: fid allocation/deallocation tracking
41 * @P9_DEBUG_PKT: packet marshalling/unmarshalling 41 * @P9_DEBUG_PKT: packet marshalling/unmarshalling
42 * @P9_DEBUG_FSC: FS-cache tracing 42 * @P9_DEBUG_FSC: FS-cache tracing
43 * @P9_DEBUG_VPKT: Verbose packet debugging (full packet dump)
43 * 44 *
44 * These flags are passed at mount time to turn on various levels of 45 * These flags are passed at mount time to turn on various levels of
45 * verbosity and tracing which will be output to the system logs. 46 * verbosity and tracing which will be output to the system logs.
@@ -57,6 +58,7 @@ enum p9_debug_flags {
57 P9_DEBUG_FID = (1<<9), 58 P9_DEBUG_FID = (1<<9),
58 P9_DEBUG_PKT = (1<<10), 59 P9_DEBUG_PKT = (1<<10),
59 P9_DEBUG_FSC = (1<<11), 60 P9_DEBUG_FSC = (1<<11),
61 P9_DEBUG_VPKT = (1<<12),
60}; 62};
61 63
62#ifdef CONFIG_NET_9P_DEBUG 64#ifdef CONFIG_NET_9P_DEBUG
@@ -74,10 +76,14 @@ do { \
74 } \ 76 } \
75} while (0) 77} while (0)
76 78
79#define P9_DUMP_PKT(way, pdu) p9pdu_dump(way, pdu)
80
77#else 81#else
78#define P9_DPRINTK(level, format, arg...) do { } while (0) 82#define P9_DPRINTK(level, format, arg...) do { } while (0)
83#define P9_DUMP_PKT(way, pdu) do { } while (0)
79#endif 84#endif
80 85
86
81#define P9_EPRINTK(level, format, arg...) \ 87#define P9_EPRINTK(level, format, arg...) \
82do { \ 88do { \
83 printk(level "9p: %s (%d): " \ 89 printk(level "9p: %s (%d): " \
@@ -175,6 +181,10 @@ enum p9_msg_t {
175 P9_RLINK, 181 P9_RLINK,
176 P9_TMKDIR = 72, 182 P9_TMKDIR = 72,
177 P9_RMKDIR, 183 P9_RMKDIR,
184 P9_TRENAMEAT = 74,
185 P9_RRENAMEAT,
186 P9_TUNLINKAT = 76,
187 P9_RUNLINKAT,
178 P9_TVERSION = 100, 188 P9_TVERSION = 100,
179 P9_RVERSION, 189 P9_RVERSION,
180 P9_TAUTH = 102, 190 P9_TAUTH = 102,
@@ -321,21 +331,6 @@ enum p9_qid_t {
321#define P9_READDIRHDRSZ 24 331#define P9_READDIRHDRSZ 24
322 332
323/** 333/**
324 * struct p9_str - length prefixed string type
325 * @len: length of the string
326 * @str: the string
327 *
328 * The protocol uses length prefixed strings for all
329 * string data, so we replicate that for our internal
330 * string members.
331 */
332
333struct p9_str {
334 u16 len;
335 char *str;
336};
337
338/**
339 * struct p9_qid - file system entity information 334 * struct p9_qid - file system entity information
340 * @type: 8-bit type &p9_qid_t 335 * @type: 8-bit type &p9_qid_t
341 * @version: 16-bit monotonically incrementing version number 336 * @version: 16-bit monotonically incrementing version number
@@ -371,11 +366,11 @@ struct p9_qid {
371 * @atime: Last access/read time 366 * @atime: Last access/read time
372 * @mtime: Last modify/write time 367 * @mtime: Last modify/write time
373 * @length: file length 368 * @length: file length
374 * @name: last element of path (aka filename) in type &p9_str 369 * @name: last element of path (aka filename)
375 * @uid: owner name in type &p9_str 370 * @uid: owner name
376 * @gid: group owner in type &p9_str 371 * @gid: group owner
377 * @muid: last modifier in type &p9_str 372 * @muid: last modifier
378 * @extension: area used to encode extended UNIX support in type &p9_str 373 * @extension: area used to encode extended UNIX support
379 * @n_uid: numeric user id of owner (part of 9p2000.u extension) 374 * @n_uid: numeric user id of owner (part of 9p2000.u extension)
380 * @n_gid: numeric group id (part of 9p2000.u extension) 375 * @n_gid: numeric group id (part of 9p2000.u extension)
381 * @n_muid: numeric user id of laster modifier (part of 9p2000.u extension) 376 * @n_muid: numeric user id of laster modifier (part of 9p2000.u extension)
@@ -512,11 +507,6 @@ struct p9_getlock {
512 char *client_id; 507 char *client_id;
513}; 508};
514 509
515/* Structures for Protocol Operations */
516struct p9_tstatfs {
517 u32 fid;
518};
519
520struct p9_rstatfs { 510struct p9_rstatfs {
521 u32 type; 511 u32 type;
522 u32 bsize; 512 u32 bsize;
@@ -529,159 +519,6 @@ struct p9_rstatfs {
529 u32 namelen; 519 u32 namelen;
530}; 520};
531 521
532struct p9_trename {
533 u32 fid;
534 u32 newdirfid;
535 struct p9_str name;
536};
537
538struct p9_rrename {
539};
540
541struct p9_tversion {
542 u32 msize;
543 struct p9_str version;
544};
545
546struct p9_rversion {
547 u32 msize;
548 struct p9_str version;
549};
550
551struct p9_tauth {
552 u32 afid;
553 struct p9_str uname;
554 struct p9_str aname;
555 u32 n_uname; /* 9P2000.u extensions */
556};
557
558struct p9_rauth {
559 struct p9_qid qid;
560};
561
562struct p9_rerror {
563 struct p9_str error;
564 u32 errno; /* 9p2000.u extension */
565};
566
567struct p9_tflush {
568 u16 oldtag;
569};
570
571struct p9_rflush {
572};
573
574struct p9_tattach {
575 u32 fid;
576 u32 afid;
577 struct p9_str uname;
578 struct p9_str aname;
579 u32 n_uname; /* 9P2000.u extensions */
580};
581
582struct p9_rattach {
583 struct p9_qid qid;
584};
585
586struct p9_twalk {
587 u32 fid;
588 u32 newfid;
589 u16 nwname;
590 struct p9_str wnames[16];
591};
592
593struct p9_rwalk {
594 u16 nwqid;
595 struct p9_qid wqids[16];
596};
597
598struct p9_topen {
599 u32 fid;
600 u8 mode;
601};
602
603struct p9_ropen {
604 struct p9_qid qid;
605 u32 iounit;
606};
607
608struct p9_tcreate {
609 u32 fid;
610 struct p9_str name;
611 u32 perm;
612 u8 mode;
613 struct p9_str extension;
614};
615
616struct p9_rcreate {
617 struct p9_qid qid;
618 u32 iounit;
619};
620
621struct p9_tread {
622 u32 fid;
623 u64 offset;
624 u32 count;
625};
626
627struct p9_rread {
628 u32 count;
629 u8 *data;
630};
631
632struct p9_twrite {
633 u32 fid;
634 u64 offset;
635 u32 count;
636 u8 *data;
637};
638
639struct p9_rwrite {
640 u32 count;
641};
642
643struct p9_treaddir {
644 u32 fid;
645 u64 offset;
646 u32 count;
647};
648
649struct p9_rreaddir {
650 u32 count;
651 u8 *data;
652};
653
654
655struct p9_tclunk {
656 u32 fid;
657};
658
659struct p9_rclunk {
660};
661
662struct p9_tremove {
663 u32 fid;
664};
665
666struct p9_rremove {
667};
668
669struct p9_tstat {
670 u32 fid;
671};
672
673struct p9_rstat {
674 struct p9_wstat stat;
675};
676
677struct p9_twstat {
678 u32 fid;
679 struct p9_wstat stat;
680};
681
682struct p9_rwstat {
683};
684
685/** 522/**
686 * struct p9_fcall - primary packet structure 523 * struct p9_fcall - primary packet structure
687 * @size: prefixed length of the structure 524 * @size: prefixed length of the structure
diff --git a/include/net/9p/client.h b/include/net/9p/client.h
index d26d5e98a173..55ce72ce9861 100644
--- a/include/net/9p/client.h
+++ b/include/net/9p/client.h
@@ -36,9 +36,9 @@
36 */ 36 */
37 37
38enum p9_proto_versions{ 38enum p9_proto_versions{
39 p9_proto_legacy = 0, 39 p9_proto_legacy,
40 p9_proto_2000u = 1, 40 p9_proto_2000u,
41 p9_proto_2000L = 2, 41 p9_proto_2000L,
42}; 42};
43 43
44 44
@@ -211,7 +211,10 @@ struct p9_dirent {
211}; 211};
212 212
213int p9_client_statfs(struct p9_fid *fid, struct p9_rstatfs *sb); 213int p9_client_statfs(struct p9_fid *fid, struct p9_rstatfs *sb);
214int p9_client_rename(struct p9_fid *fid, struct p9_fid *newdirfid, char *name); 214int p9_client_rename(struct p9_fid *fid, struct p9_fid *newdirfid,
215 const char *name);
216int p9_client_renameat(struct p9_fid *olddirfid, const char *old_name,
217 struct p9_fid *newdirfid, const char *new_name);
215struct p9_client *p9_client_create(const char *dev_name, char *options); 218struct p9_client *p9_client_create(const char *dev_name, char *options);
216void p9_client_destroy(struct p9_client *clnt); 219void p9_client_destroy(struct p9_client *clnt);
217void p9_client_disconnect(struct p9_client *clnt); 220void p9_client_disconnect(struct p9_client *clnt);
@@ -231,6 +234,7 @@ int p9_client_create_dotl(struct p9_fid *ofid, char *name, u32 flags, u32 mode,
231int p9_client_clunk(struct p9_fid *fid); 234int p9_client_clunk(struct p9_fid *fid);
232int p9_client_fsync(struct p9_fid *fid, int datasync); 235int p9_client_fsync(struct p9_fid *fid, int datasync);
233int p9_client_remove(struct p9_fid *fid); 236int p9_client_remove(struct p9_fid *fid);
237int p9_client_unlinkat(struct p9_fid *dfid, const char *name, int flags);
234int p9_client_read(struct p9_fid *fid, char *data, char __user *udata, 238int p9_client_read(struct p9_fid *fid, char *data, char __user *udata,
235 u64 offset, u32 count); 239 u64 offset, u32 count);
236int p9_client_write(struct p9_fid *fid, char *data, const char __user *udata, 240int p9_client_write(struct p9_fid *fid, char *data, const char __user *udata,
diff --git a/include/net/9p/transport.h b/include/net/9p/transport.h
index d8549fb9c742..83531ebeee99 100644
--- a/include/net/9p/transport.h
+++ b/include/net/9p/transport.h
@@ -67,7 +67,7 @@ struct p9_trans_module {
67 67
68void v9fs_register_trans(struct p9_trans_module *m); 68void v9fs_register_trans(struct p9_trans_module *m);
69void v9fs_unregister_trans(struct p9_trans_module *m); 69void v9fs_unregister_trans(struct p9_trans_module *m);
70struct p9_trans_module *v9fs_get_trans_by_name(const substring_t *name); 70struct p9_trans_module *v9fs_get_trans_by_name(char *s);
71struct p9_trans_module *v9fs_get_default_trans(void); 71struct p9_trans_module *v9fs_get_default_trans(void);
72void v9fs_put_trans(struct p9_trans_module *m); 72void v9fs_put_trans(struct p9_trans_module *m);
73#endif /* NET_9P_TRANSPORT_H */ 73#endif /* NET_9P_TRANSPORT_H */
diff --git a/include/net/act_api.h b/include/net/act_api.h
index bab385f13ac3..c739531e1564 100644
--- a/include/net/act_api.h
+++ b/include/net/act_api.h
@@ -72,7 +72,7 @@ struct tcf_act_hdr {
72 72
73struct tc_action { 73struct tc_action {
74 void *priv; 74 void *priv;
75 struct tc_action_ops *ops; 75 const struct tc_action_ops *ops;
76 __u32 type; /* for backward compat(TCA_OLD_COMPAT) */ 76 __u32 type; /* for backward compat(TCA_OLD_COMPAT) */
77 __u32 order; 77 __u32 order;
78 struct tc_action *next; 78 struct tc_action *next;
@@ -86,7 +86,7 @@ struct tc_action_ops {
86 __u32 type; /* TBD to match kind */ 86 __u32 type; /* TBD to match kind */
87 __u32 capab; /* capabilities includes 4 bit version */ 87 __u32 capab; /* capabilities includes 4 bit version */
88 struct module *owner; 88 struct module *owner;
89 int (*act)(struct sk_buff *, struct tc_action *, struct tcf_result *); 89 int (*act)(struct sk_buff *, const struct tc_action *, struct tcf_result *);
90 int (*get_stats)(struct sk_buff *, struct tc_action *); 90 int (*get_stats)(struct sk_buff *, struct tc_action *);
91 int (*dump)(struct sk_buff *, struct tc_action *, int, int); 91 int (*dump)(struct sk_buff *, struct tc_action *, int, int);
92 int (*cleanup)(struct tc_action *, int bind); 92 int (*cleanup)(struct tc_action *, int bind);
@@ -115,7 +115,7 @@ extern void tcf_hash_insert(struct tcf_common *p, struct tcf_hashinfo *hinfo);
115extern int tcf_register_action(struct tc_action_ops *a); 115extern int tcf_register_action(struct tc_action_ops *a);
116extern int tcf_unregister_action(struct tc_action_ops *a); 116extern int tcf_unregister_action(struct tc_action_ops *a);
117extern void tcf_action_destroy(struct tc_action *a, int bind); 117extern void tcf_action_destroy(struct tc_action *a, int bind);
118extern int tcf_action_exec(struct sk_buff *skb, struct tc_action *a, struct tcf_result *res); 118extern int tcf_action_exec(struct sk_buff *skb, const struct tc_action *a, struct tcf_result *res);
119extern struct tc_action *tcf_action_init(struct nlattr *nla, struct nlattr *est, char *n, int ovr, int bind); 119extern struct tc_action *tcf_action_init(struct nlattr *nla, struct nlattr *est, char *n, int ovr, int bind);
120extern struct tc_action *tcf_action_init_1(struct nlattr *nla, struct nlattr *est, char *n, int ovr, int bind); 120extern struct tc_action *tcf_action_init_1(struct nlattr *nla, struct nlattr *est, char *n, int ovr, int bind);
121extern int tcf_action_dump(struct sk_buff *skb, struct tc_action *a, int, int); 121extern int tcf_action_dump(struct sk_buff *skb, struct tc_action *a, int, int);
diff --git a/include/net/arp.h b/include/net/arp.h
index 91f0568a04ef..4979af8b1559 100644
--- a/include/net/arp.h
+++ b/include/net/arp.h
@@ -8,6 +8,36 @@
8 8
9extern struct neigh_table arp_tbl; 9extern struct neigh_table arp_tbl;
10 10
11static inline u32 arp_hashfn(u32 key, const struct net_device *dev, u32 hash_rnd)
12{
13 u32 val = key ^ dev->ifindex;
14
15 return val * hash_rnd;
16}
17
18static inline struct neighbour *__ipv4_neigh_lookup(struct neigh_table *tbl, struct net_device *dev, u32 key)
19{
20 struct neigh_hash_table *nht;
21 struct neighbour *n;
22 u32 hash_val;
23
24 rcu_read_lock_bh();
25 nht = rcu_dereference_bh(tbl->nht);
26 hash_val = arp_hashfn(key, dev, nht->hash_rnd) >> (32 - nht->hash_shift);
27 for (n = rcu_dereference_bh(nht->hash_buckets[hash_val]);
28 n != NULL;
29 n = rcu_dereference_bh(n->next)) {
30 if (n->dev == dev && *(u32 *)n->primary_key == key) {
31 if (!atomic_inc_not_zero(&n->refcnt))
32 n = NULL;
33 break;
34 }
35 }
36 rcu_read_unlock_bh();
37
38 return n;
39}
40
11extern void arp_init(void); 41extern void arp_init(void);
12extern int arp_find(unsigned char *haddr, struct sk_buff *skb); 42extern int arp_find(unsigned char *haddr, struct sk_buff *skb);
13extern int arp_ioctl(struct net *net, unsigned int cmd, void __user *arg); 43extern int arp_ioctl(struct net *net, unsigned int cmd, void __user *arg);
@@ -15,7 +45,6 @@ extern void arp_send(int type, int ptype, __be32 dest_ip,
15 struct net_device *dev, __be32 src_ip, 45 struct net_device *dev, __be32 src_ip,
16 const unsigned char *dest_hw, 46 const unsigned char *dest_hw,
17 const unsigned char *src_hw, const unsigned char *th); 47 const unsigned char *src_hw, const unsigned char *th);
18extern int arp_bind_neighbour(struct dst_entry *dst);
19extern int arp_mc_map(__be32 addr, u8 *haddr, struct net_device *dev, int dir); 48extern int arp_mc_map(__be32 addr, u8 *haddr, struct net_device *dev, int dir);
20extern void arp_ifdown(struct net_device *dev); 49extern void arp_ifdown(struct net_device *dev);
21 50
diff --git a/include/net/ax25.h b/include/net/ax25.h
index 206d22297ac3..94e09d361bb1 100644
--- a/include/net/ax25.h
+++ b/include/net/ax25.h
@@ -11,7 +11,7 @@
11#include <linux/timer.h> 11#include <linux/timer.h>
12#include <linux/list.h> 12#include <linux/list.h>
13#include <linux/slab.h> 13#include <linux/slab.h>
14#include <asm/atomic.h> 14#include <linux/atomic.h>
15 15
16#define AX25_T1CLAMPLO 1 16#define AX25_T1CLAMPLO 1
17#define AX25_T1CLAMPHI (30 * HZ) 17#define AX25_T1CLAMPHI (30 * HZ)
diff --git a/include/net/bluetooth/bluetooth.h b/include/net/bluetooth/bluetooth.h
index 43750439c521..e727555d4ee9 100644
--- a/include/net/bluetooth/bluetooth.h
+++ b/include/net/bluetooth/bluetooth.h
@@ -56,6 +56,7 @@
56#define BT_SECURITY 4 56#define BT_SECURITY 4
57struct bt_security { 57struct bt_security {
58 __u8 level; 58 __u8 level;
59 __u8 key_size;
59}; 60};
60#define BT_SECURITY_SDP 0 61#define BT_SECURITY_SDP 0
61#define BT_SECURITY_LOW 1 62#define BT_SECURITY_LOW 1
@@ -69,9 +70,19 @@ struct bt_security {
69#define BT_FLUSHABLE_OFF 0 70#define BT_FLUSHABLE_OFF 0
70#define BT_FLUSHABLE_ON 1 71#define BT_FLUSHABLE_ON 1
71 72
72#define BT_INFO(fmt, arg...) printk(KERN_INFO "Bluetooth: " fmt "\n" , ## arg) 73#define BT_POWER 9
73#define BT_ERR(fmt, arg...) printk(KERN_ERR "%s: " fmt "\n" , __func__ , ## arg) 74struct bt_power {
74#define BT_DBG(fmt, arg...) pr_debug("%s: " fmt "\n" , __func__ , ## arg) 75 __u8 force_active;
76};
77#define BT_POWER_FORCE_ACTIVE_OFF 0
78#define BT_POWER_FORCE_ACTIVE_ON 1
79
80__attribute__((format (printf, 2, 3)))
81int bt_printk(const char *level, const char *fmt, ...);
82
83#define BT_INFO(fmt, arg...) bt_printk(KERN_INFO, pr_fmt(fmt), ##arg)
84#define BT_ERR(fmt, arg...) bt_printk(KERN_ERR, pr_fmt(fmt), ##arg)
85#define BT_DBG(fmt, arg...) pr_debug(fmt "\n", ##arg)
75 86
76/* Connection and socket states */ 87/* Connection and socket states */
77enum { 88enum {
@@ -130,7 +141,8 @@ int bt_sock_register(int proto, const struct net_proto_family *ops);
130int bt_sock_unregister(int proto); 141int bt_sock_unregister(int proto);
131void bt_sock_link(struct bt_sock_list *l, struct sock *s); 142void bt_sock_link(struct bt_sock_list *l, struct sock *s);
132void bt_sock_unlink(struct bt_sock_list *l, struct sock *s); 143void bt_sock_unlink(struct bt_sock_list *l, struct sock *s);
133int bt_sock_recvmsg(struct kiocb *iocb, struct socket *sock, struct msghdr *msg, size_t len, int flags); 144int bt_sock_recvmsg(struct kiocb *iocb, struct socket *sock,
145 struct msghdr *msg, size_t len, int flags);
134int bt_sock_stream_recvmsg(struct kiocb *iocb, struct socket *sock, 146int bt_sock_stream_recvmsg(struct kiocb *iocb, struct socket *sock,
135 struct msghdr *msg, size_t len, int flags); 147 struct msghdr *msg, size_t len, int flags);
136uint bt_sock_poll(struct file * file, struct socket *sock, poll_table *wait); 148uint bt_sock_poll(struct file * file, struct socket *sock, poll_table *wait);
@@ -150,6 +162,7 @@ struct bt_skb_cb {
150 __u8 retries; 162 __u8 retries;
151 __u8 sar; 163 __u8 sar;
152 unsigned short channel; 164 unsigned short channel;
165 __u8 force_active;
153}; 166};
154#define bt_cb(skb) ((struct bt_skb_cb *)((skb)->cb)) 167#define bt_cb(skb) ((struct bt_skb_cb *)((skb)->cb))
155 168
@@ -164,8 +177,8 @@ static inline struct sk_buff *bt_skb_alloc(unsigned int len, gfp_t how)
164 return skb; 177 return skb;
165} 178}
166 179
167static inline struct sk_buff *bt_skb_send_alloc(struct sock *sk, unsigned long len, 180static inline struct sk_buff *bt_skb_send_alloc(struct sock *sk,
168 int nb, int *err) 181 unsigned long len, int nb, int *err)
169{ 182{
170 struct sk_buff *skb; 183 struct sk_buff *skb;
171 184
@@ -195,7 +208,7 @@ out:
195 return NULL; 208 return NULL;
196} 209}
197 210
198int bt_err(__u16 code); 211int bt_to_errno(__u16 code);
199 212
200extern int hci_sock_init(void); 213extern int hci_sock_init(void);
201extern void hci_sock_cleanup(void); 214extern void hci_sock_cleanup(void);
diff --git a/include/net/bluetooth/hci.h b/include/net/bluetooth/hci.h
index 0c20227e57f6..be30aabe7b88 100644
--- a/include/net/bluetooth/hci.h
+++ b/include/net/bluetooth/hci.h
@@ -211,11 +211,16 @@ enum {
211#define LMP_EDR_3S_ESCO 0x80 211#define LMP_EDR_3S_ESCO 0x80
212 212
213#define LMP_EXT_INQ 0x01 213#define LMP_EXT_INQ 0x01
214#define LMP_SIMUL_LE_BR 0x02
214#define LMP_SIMPLE_PAIR 0x08 215#define LMP_SIMPLE_PAIR 0x08
215#define LMP_NO_FLUSH 0x40 216#define LMP_NO_FLUSH 0x40
216 217
217#define LMP_LSTO 0x01 218#define LMP_LSTO 0x01
218#define LMP_INQ_TX_PWR 0x02 219#define LMP_INQ_TX_PWR 0x02
220#define LMP_EXTFEATURES 0x80
221
222/* Extended LMP features */
223#define LMP_HOST_LE 0x02
219 224
220/* Connection modes */ 225/* Connection modes */
221#define HCI_CM_ACTIVE 0x0000 226#define HCI_CM_ACTIVE 0x0000
@@ -254,6 +259,10 @@ enum {
254#define HCI_LK_UNAUTH_COMBINATION 0x04 259#define HCI_LK_UNAUTH_COMBINATION 0x04
255#define HCI_LK_AUTH_COMBINATION 0x05 260#define HCI_LK_AUTH_COMBINATION 0x05
256#define HCI_LK_CHANGED_COMBINATION 0x06 261#define HCI_LK_CHANGED_COMBINATION 0x06
262/* The spec doesn't define types for SMP keys */
263#define HCI_LK_SMP_LTK 0x81
264#define HCI_LK_SMP_IRK 0x82
265#define HCI_LK_SMP_CSRK 0x83
257 266
258/* ----- HCI Commands ---- */ 267/* ----- HCI Commands ---- */
259#define HCI_OP_NOP 0x0000 268#define HCI_OP_NOP 0x0000
@@ -653,6 +662,12 @@ struct hci_rp_read_local_oob_data {
653 662
654#define HCI_OP_READ_INQ_RSP_TX_POWER 0x0c58 663#define HCI_OP_READ_INQ_RSP_TX_POWER 0x0c58
655 664
665#define HCI_OP_WRITE_LE_HOST_SUPPORTED 0x0c6d
666struct hci_cp_write_le_host_supported {
667 __u8 le;
668 __u8 simul;
669} __packed;
670
656#define HCI_OP_READ_LOCAL_VERSION 0x1001 671#define HCI_OP_READ_LOCAL_VERSION 0x1001
657struct hci_rp_read_local_version { 672struct hci_rp_read_local_version {
658 __u8 status; 673 __u8 status;
@@ -676,6 +691,9 @@ struct hci_rp_read_local_features {
676} __packed; 691} __packed;
677 692
678#define HCI_OP_READ_LOCAL_EXT_FEATURES 0x1004 693#define HCI_OP_READ_LOCAL_EXT_FEATURES 0x1004
694struct hci_cp_read_local_ext_features {
695 __u8 page;
696} __packed;
679struct hci_rp_read_local_ext_features { 697struct hci_rp_read_local_ext_features {
680 __u8 status; 698 __u8 status;
681 __u8 page; 699 __u8 page;
@@ -710,6 +728,12 @@ struct hci_rp_le_read_buffer_size {
710 __u8 le_max_pkt; 728 __u8 le_max_pkt;
711} __packed; 729} __packed;
712 730
731#define HCI_OP_LE_SET_SCAN_ENABLE 0x200c
732struct hci_cp_le_set_scan_enable {
733 __u8 enable;
734 __u8 filter_dup;
735} __packed;
736
713#define HCI_OP_LE_CREATE_CONN 0x200d 737#define HCI_OP_LE_CREATE_CONN 0x200d
714struct hci_cp_le_create_conn { 738struct hci_cp_le_create_conn {
715 __le16 scan_interval; 739 __le16 scan_interval;
@@ -739,6 +763,33 @@ struct hci_cp_le_conn_update {
739 __le16 max_ce_len; 763 __le16 max_ce_len;
740} __packed; 764} __packed;
741 765
766#define HCI_OP_LE_START_ENC 0x2019
767struct hci_cp_le_start_enc {
768 __le16 handle;
769 __u8 rand[8];
770 __le16 ediv;
771 __u8 ltk[16];
772} __packed;
773
774#define HCI_OP_LE_LTK_REPLY 0x201a
775struct hci_cp_le_ltk_reply {
776 __le16 handle;
777 __u8 ltk[16];
778} __packed;
779struct hci_rp_le_ltk_reply {
780 __u8 status;
781 __le16 handle;
782} __packed;
783
784#define HCI_OP_LE_LTK_NEG_REPLY 0x201b
785struct hci_cp_le_ltk_neg_reply {
786 __le16 handle;
787} __packed;
788struct hci_rp_le_ltk_neg_reply {
789 __u8 status;
790 __le16 handle;
791} __packed;
792
742/* ---- HCI Events ---- */ 793/* ---- HCI Events ---- */
743#define HCI_EV_INQUIRY_COMPLETE 0x01 794#define HCI_EV_INQUIRY_COMPLETE 0x01
744 795
@@ -1029,6 +1080,32 @@ struct hci_ev_le_conn_complete {
1029 __u8 clk_accurancy; 1080 __u8 clk_accurancy;
1030} __packed; 1081} __packed;
1031 1082
1083#define HCI_EV_LE_LTK_REQ 0x05
1084struct hci_ev_le_ltk_req {
1085 __le16 handle;
1086 __u8 random[8];
1087 __le16 ediv;
1088} __packed;
1089
1090/* Advertising report event types */
1091#define ADV_IND 0x00
1092#define ADV_DIRECT_IND 0x01
1093#define ADV_SCAN_IND 0x02
1094#define ADV_NONCONN_IND 0x03
1095#define ADV_SCAN_RSP 0x04
1096
1097#define ADDR_LE_DEV_PUBLIC 0x00
1098#define ADDR_LE_DEV_RANDOM 0x01
1099
1100#define HCI_EV_LE_ADVERTISING_REPORT 0x02
1101struct hci_ev_le_advertising_info {
1102 __u8 evt_type;
1103 __u8 bdaddr_type;
1104 bdaddr_t bdaddr;
1105 __u8 length;
1106 __u8 data[0];
1107} __packed;
1108
1032/* Internal events generated by Bluetooth stack */ 1109/* Internal events generated by Bluetooth stack */
1033#define HCI_EV_STACK_INTERNAL 0xfd 1110#define HCI_EV_STACK_INTERNAL 0xfd
1034struct hci_ev_stack_internal { 1111struct hci_ev_stack_internal {
diff --git a/include/net/bluetooth/hci_core.h b/include/net/bluetooth/hci_core.h
index 6c994c004d15..8f441b8b2963 100644
--- a/include/net/bluetooth/hci_core.h
+++ b/include/net/bluetooth/hci_core.h
@@ -25,6 +25,7 @@
25#ifndef __HCI_CORE_H 25#ifndef __HCI_CORE_H
26#define __HCI_CORE_H 26#define __HCI_CORE_H
27 27
28#include <linux/interrupt.h>
28#include <net/bluetooth/hci.h> 29#include <net/bluetooth/hci.h>
29 30
30/* HCI upper protocols */ 31/* HCI upper protocols */
@@ -74,12 +75,28 @@ struct bt_uuid {
74 u8 svc_hint; 75 u8 svc_hint;
75}; 76};
76 77
78struct key_master_id {
79 __le16 ediv;
80 u8 rand[8];
81} __packed;
82
83struct link_key_data {
84 bdaddr_t bdaddr;
85 u8 type;
86 u8 val[16];
87 u8 pin_len;
88 u8 dlen;
89 u8 data[0];
90} __packed;
91
77struct link_key { 92struct link_key {
78 struct list_head list; 93 struct list_head list;
79 bdaddr_t bdaddr; 94 bdaddr_t bdaddr;
80 u8 type; 95 u8 type;
81 u8 val[16]; 96 u8 val[16];
82 u8 pin_len; 97 u8 pin_len;
98 u8 dlen;
99 u8 data[0];
83}; 100};
84 101
85struct oob_data { 102struct oob_data {
@@ -89,6 +106,12 @@ struct oob_data {
89 u8 randomizer[16]; 106 u8 randomizer[16];
90}; 107};
91 108
109struct adv_entry {
110 struct list_head list;
111 bdaddr_t bdaddr;
112 u8 bdaddr_type;
113};
114
92#define NUM_REASSEMBLY 4 115#define NUM_REASSEMBLY 4
93struct hci_dev { 116struct hci_dev {
94 struct list_head list; 117 struct list_head list;
@@ -107,6 +130,7 @@ struct hci_dev {
107 __u8 major_class; 130 __u8 major_class;
108 __u8 minor_class; 131 __u8 minor_class;
109 __u8 features[8]; 132 __u8 features[8];
133 __u8 extfeatures[8];
110 __u8 commands[64]; 134 __u8 commands[64];
111 __u8 ssp_mode; 135 __u8 ssp_mode;
112 __u8 hci_ver; 136 __u8 hci_ver;
@@ -171,6 +195,8 @@ struct hci_dev {
171 195
172 __u16 init_last_cmd; 196 __u16 init_last_cmd;
173 197
198 struct crypto_blkcipher *tfm;
199
174 struct inquiry_cache inq_cache; 200 struct inquiry_cache inq_cache;
175 struct hci_conn_hash conn_hash; 201 struct hci_conn_hash conn_hash;
176 struct list_head blacklist; 202 struct list_head blacklist;
@@ -181,6 +207,9 @@ struct hci_dev {
181 207
182 struct list_head remote_oob_data; 208 struct list_head remote_oob_data;
183 209
210 struct list_head adv_entries;
211 struct timer_list adv_timer;
212
184 struct hci_dev_stats stat; 213 struct hci_dev_stats stat;
185 214
186 struct sk_buff_head driver_init; 215 struct sk_buff_head driver_init;
@@ -212,9 +241,9 @@ struct hci_conn {
212 struct list_head list; 241 struct list_head list;
213 242
214 atomic_t refcnt; 243 atomic_t refcnt;
215 spinlock_t lock;
216 244
217 bdaddr_t dst; 245 bdaddr_t dst;
246 __u8 dst_type;
218 __u16 handle; 247 __u16 handle;
219 __u16 state; 248 __u16 state;
220 __u8 mode; 249 __u8 mode;
@@ -233,6 +262,7 @@ struct hci_conn {
233 __u8 sec_level; 262 __u8 sec_level;
234 __u8 pending_sec_level; 263 __u8 pending_sec_level;
235 __u8 pin_length; 264 __u8 pin_length;
265 __u8 enc_key_size;
236 __u8 io_capability; 266 __u8 io_capability;
237 __u8 power_save; 267 __u8 power_save;
238 __u16 disc_timeout; 268 __u16 disc_timeout;
@@ -259,7 +289,6 @@ struct hci_conn {
259 struct hci_dev *hdev; 289 struct hci_dev *hdev;
260 void *l2cap_data; 290 void *l2cap_data;
261 void *sco_data; 291 void *sco_data;
262 void *priv;
263 292
264 struct hci_conn *link; 293 struct hci_conn *link;
265 294
@@ -307,12 +336,14 @@ static inline long inquiry_entry_age(struct inquiry_entry *e)
307 return jiffies - e->timestamp; 336 return jiffies - e->timestamp;
308} 337}
309 338
310struct inquiry_entry *hci_inquiry_cache_lookup(struct hci_dev *hdev, bdaddr_t *bdaddr); 339struct inquiry_entry *hci_inquiry_cache_lookup(struct hci_dev *hdev,
340 bdaddr_t *bdaddr);
311void hci_inquiry_cache_update(struct hci_dev *hdev, struct inquiry_data *data); 341void hci_inquiry_cache_update(struct hci_dev *hdev, struct inquiry_data *data);
312 342
313/* ----- HCI Connections ----- */ 343/* ----- HCI Connections ----- */
314enum { 344enum {
315 HCI_CONN_AUTH_PEND, 345 HCI_CONN_AUTH_PEND,
346 HCI_CONN_REAUTH_PEND,
316 HCI_CONN_ENCRYPT_PEND, 347 HCI_CONN_ENCRYPT_PEND,
317 HCI_CONN_RSWITCH_PEND, 348 HCI_CONN_RSWITCH_PEND,
318 HCI_CONN_MODE_CHANGE_PEND, 349 HCI_CONN_MODE_CHANGE_PEND,
@@ -420,14 +451,15 @@ int hci_conn_del(struct hci_conn *conn);
420void hci_conn_hash_flush(struct hci_dev *hdev); 451void hci_conn_hash_flush(struct hci_dev *hdev);
421void hci_conn_check_pending(struct hci_dev *hdev); 452void hci_conn_check_pending(struct hci_dev *hdev);
422 453
423struct hci_conn *hci_connect(struct hci_dev *hdev, int type, bdaddr_t *dst, __u8 sec_level, __u8 auth_type); 454struct hci_conn *hci_connect(struct hci_dev *hdev, int type, bdaddr_t *dst,
455 __u8 sec_level, __u8 auth_type);
424int hci_conn_check_link_mode(struct hci_conn *conn); 456int hci_conn_check_link_mode(struct hci_conn *conn);
425int hci_conn_check_secure(struct hci_conn *conn, __u8 sec_level); 457int hci_conn_check_secure(struct hci_conn *conn, __u8 sec_level);
426int hci_conn_security(struct hci_conn *conn, __u8 sec_level, __u8 auth_type); 458int hci_conn_security(struct hci_conn *conn, __u8 sec_level, __u8 auth_type);
427int hci_conn_change_link_key(struct hci_conn *conn); 459int hci_conn_change_link_key(struct hci_conn *conn);
428int hci_conn_switch_role(struct hci_conn *conn, __u8 role); 460int hci_conn_switch_role(struct hci_conn *conn, __u8 role);
429 461
430void hci_conn_enter_active_mode(struct hci_conn *conn); 462void hci_conn_enter_active_mode(struct hci_conn *conn, __u8 force_active);
431void hci_conn_enter_sniff_mode(struct hci_conn *conn); 463void hci_conn_enter_sniff_mode(struct hci_conn *conn);
432 464
433void hci_conn_hold_device(struct hci_conn *conn); 465void hci_conn_hold_device(struct hci_conn *conn);
@@ -449,10 +481,12 @@ static inline void hci_conn_put(struct hci_conn *conn)
449 timeo = msecs_to_jiffies(conn->disc_timeout); 481 timeo = msecs_to_jiffies(conn->disc_timeout);
450 if (!conn->out) 482 if (!conn->out)
451 timeo *= 2; 483 timeo *= 2;
452 } else 484 } else {
453 timeo = msecs_to_jiffies(10); 485 timeo = msecs_to_jiffies(10);
454 } else 486 }
487 } else {
455 timeo = msecs_to_jiffies(10); 488 timeo = msecs_to_jiffies(10);
489 }
456 mod_timer(&conn->disc_timer, jiffies + timeo); 490 mod_timer(&conn->disc_timer, jiffies + timeo);
457 } 491 }
458} 492}
@@ -511,6 +545,8 @@ int hci_inquiry(void __user *arg);
511 545
512struct bdaddr_list *hci_blacklist_lookup(struct hci_dev *hdev, bdaddr_t *bdaddr); 546struct bdaddr_list *hci_blacklist_lookup(struct hci_dev *hdev, bdaddr_t *bdaddr);
513int hci_blacklist_clear(struct hci_dev *hdev); 547int hci_blacklist_clear(struct hci_dev *hdev);
548int hci_blacklist_add(struct hci_dev *hdev, bdaddr_t *bdaddr);
549int hci_blacklist_del(struct hci_dev *hdev, bdaddr_t *bdaddr);
514 550
515int hci_uuids_clear(struct hci_dev *hdev); 551int hci_uuids_clear(struct hci_dev *hdev);
516 552
@@ -518,6 +554,11 @@ int hci_link_keys_clear(struct hci_dev *hdev);
518struct link_key *hci_find_link_key(struct hci_dev *hdev, bdaddr_t *bdaddr); 554struct link_key *hci_find_link_key(struct hci_dev *hdev, bdaddr_t *bdaddr);
519int hci_add_link_key(struct hci_dev *hdev, struct hci_conn *conn, int new_key, 555int hci_add_link_key(struct hci_dev *hdev, struct hci_conn *conn, int new_key,
520 bdaddr_t *bdaddr, u8 *val, u8 type, u8 pin_len); 556 bdaddr_t *bdaddr, u8 *val, u8 type, u8 pin_len);
557struct link_key *hci_find_ltk(struct hci_dev *hdev, __le16 ediv, u8 rand[8]);
558struct link_key *hci_find_link_key_type(struct hci_dev *hdev,
559 bdaddr_t *bdaddr, u8 type);
560int hci_add_ltk(struct hci_dev *hdev, int new_key, bdaddr_t *bdaddr,
561 u8 key_size, __le16 ediv, u8 rand[8], u8 ltk[16]);
521int hci_remove_link_key(struct hci_dev *hdev, bdaddr_t *bdaddr); 562int hci_remove_link_key(struct hci_dev *hdev, bdaddr_t *bdaddr);
522 563
523int hci_remote_oob_data_clear(struct hci_dev *hdev); 564int hci_remote_oob_data_clear(struct hci_dev *hdev);
@@ -527,6 +568,12 @@ int hci_add_remote_oob_data(struct hci_dev *hdev, bdaddr_t *bdaddr, u8 *hash,
527 u8 *randomizer); 568 u8 *randomizer);
528int hci_remove_remote_oob_data(struct hci_dev *hdev, bdaddr_t *bdaddr); 569int hci_remove_remote_oob_data(struct hci_dev *hdev, bdaddr_t *bdaddr);
529 570
571#define ADV_CLEAR_TIMEOUT (3*60*HZ) /* Three minutes */
572int hci_adv_entries_clear(struct hci_dev *hdev);
573struct adv_entry *hci_find_adv_entry(struct hci_dev *hdev, bdaddr_t *bdaddr);
574int hci_add_adv_entry(struct hci_dev *hdev,
575 struct hci_ev_le_advertising_info *ev);
576
530void hci_del_off_timer(struct hci_dev *hdev); 577void hci_del_off_timer(struct hci_dev *hdev);
531 578
532void hci_event_packet(struct hci_dev *hdev, struct sk_buff *skb); 579void hci_event_packet(struct hci_dev *hdev, struct sk_buff *skb);
@@ -553,6 +600,9 @@ void hci_conn_del_sysfs(struct hci_conn *conn);
553#define lmp_no_flush_capable(dev) ((dev)->features[6] & LMP_NO_FLUSH) 600#define lmp_no_flush_capable(dev) ((dev)->features[6] & LMP_NO_FLUSH)
554#define lmp_le_capable(dev) ((dev)->features[4] & LMP_LE) 601#define lmp_le_capable(dev) ((dev)->features[4] & LMP_LE)
555 602
603/* ----- Extended LMP capabilities ----- */
604#define lmp_host_le_capable(dev) ((dev)->extfeatures[0] & LMP_HOST_LE)
605
556/* ----- HCI protocols ----- */ 606/* ----- HCI protocols ----- */
557struct hci_proto { 607struct hci_proto {
558 char *name; 608 char *name;
@@ -561,16 +611,20 @@ struct hci_proto {
561 611
562 void *priv; 612 void *priv;
563 613
564 int (*connect_ind) (struct hci_dev *hdev, bdaddr_t *bdaddr, __u8 type); 614 int (*connect_ind) (struct hci_dev *hdev, bdaddr_t *bdaddr,
615 __u8 type);
565 int (*connect_cfm) (struct hci_conn *conn, __u8 status); 616 int (*connect_cfm) (struct hci_conn *conn, __u8 status);
566 int (*disconn_ind) (struct hci_conn *conn); 617 int (*disconn_ind) (struct hci_conn *conn);
567 int (*disconn_cfm) (struct hci_conn *conn, __u8 reason); 618 int (*disconn_cfm) (struct hci_conn *conn, __u8 reason);
568 int (*recv_acldata) (struct hci_conn *conn, struct sk_buff *skb, __u16 flags); 619 int (*recv_acldata) (struct hci_conn *conn, struct sk_buff *skb,
620 __u16 flags);
569 int (*recv_scodata) (struct hci_conn *conn, struct sk_buff *skb); 621 int (*recv_scodata) (struct hci_conn *conn, struct sk_buff *skb);
570 int (*security_cfm) (struct hci_conn *conn, __u8 status, __u8 encrypt); 622 int (*security_cfm) (struct hci_conn *conn, __u8 status,
623 __u8 encrypt);
571}; 624};
572 625
573static inline int hci_proto_connect_ind(struct hci_dev *hdev, bdaddr_t *bdaddr, __u8 type) 626static inline int hci_proto_connect_ind(struct hci_dev *hdev, bdaddr_t *bdaddr,
627 __u8 type)
574{ 628{
575 register struct hci_proto *hp; 629 register struct hci_proto *hp;
576 int mask = 0; 630 int mask = 0;
@@ -656,7 +710,8 @@ static inline void hci_proto_auth_cfm(struct hci_conn *conn, __u8 status)
656 conn->security_cfm_cb(conn, status); 710 conn->security_cfm_cb(conn, status);
657} 711}
658 712
659static inline void hci_proto_encrypt_cfm(struct hci_conn *conn, __u8 status, __u8 encrypt) 713static inline void hci_proto_encrypt_cfm(struct hci_conn *conn, __u8 status,
714 __u8 encrypt)
660{ 715{
661 register struct hci_proto *hp; 716 register struct hci_proto *hp;
662 717
@@ -681,7 +736,8 @@ struct hci_cb {
681 736
682 char *name; 737 char *name;
683 738
684 void (*security_cfm) (struct hci_conn *conn, __u8 status, __u8 encrypt); 739 void (*security_cfm) (struct hci_conn *conn, __u8 status,
740 __u8 encrypt);
685 void (*key_change_cfm) (struct hci_conn *conn, __u8 status); 741 void (*key_change_cfm) (struct hci_conn *conn, __u8 status);
686 void (*role_switch_cfm) (struct hci_conn *conn, __u8 status, __u8 role); 742 void (*role_switch_cfm) (struct hci_conn *conn, __u8 status, __u8 role);
687}; 743};
@@ -707,13 +763,17 @@ static inline void hci_auth_cfm(struct hci_conn *conn, __u8 status)
707 read_unlock_bh(&hci_cb_list_lock); 763 read_unlock_bh(&hci_cb_list_lock);
708} 764}
709 765
710static inline void hci_encrypt_cfm(struct hci_conn *conn, __u8 status, __u8 encrypt) 766static inline void hci_encrypt_cfm(struct hci_conn *conn, __u8 status,
767 __u8 encrypt)
711{ 768{
712 struct list_head *p; 769 struct list_head *p;
713 770
714 if (conn->sec_level == BT_SECURITY_SDP) 771 if (conn->sec_level == BT_SECURITY_SDP)
715 conn->sec_level = BT_SECURITY_LOW; 772 conn->sec_level = BT_SECURITY_LOW;
716 773
774 if (conn->pending_sec_level > conn->sec_level)
775 conn->sec_level = conn->pending_sec_level;
776
717 hci_proto_encrypt_cfm(conn, status, encrypt); 777 hci_proto_encrypt_cfm(conn, status, encrypt);
718 778
719 read_lock_bh(&hci_cb_list_lock); 779 read_lock_bh(&hci_cb_list_lock);
@@ -738,7 +798,8 @@ static inline void hci_key_change_cfm(struct hci_conn *conn, __u8 status)
738 read_unlock_bh(&hci_cb_list_lock); 798 read_unlock_bh(&hci_cb_list_lock);
739} 799}
740 800
741static inline void hci_role_switch_cfm(struct hci_conn *conn, __u8 status, __u8 role) 801static inline void hci_role_switch_cfm(struct hci_conn *conn, __u8 status,
802 __u8 role)
742{ 803{
743 struct list_head *p; 804 struct list_head *p;
744 805
@@ -830,4 +891,9 @@ void hci_req_complete(struct hci_dev *hdev, __u16 cmd, int result);
830 891
831void hci_le_conn_update(struct hci_conn *conn, u16 min, u16 max, 892void hci_le_conn_update(struct hci_conn *conn, u16 min, u16 max,
832 u16 latency, u16 to_multiplier); 893 u16 latency, u16 to_multiplier);
894void hci_le_start_enc(struct hci_conn *conn, __le16 ediv, __u8 rand[8],
895 __u8 ltk[16]);
896void hci_le_ltk_reply(struct hci_conn *conn, u8 ltk[16]);
897void hci_le_ltk_neg_reply(struct hci_conn *conn);
898
833#endif /* __HCI_CORE_H */ 899#endif /* __HCI_CORE_H */
diff --git a/include/net/bluetooth/l2cap.h b/include/net/bluetooth/l2cap.h
index d09c9b1118e3..4f34ad25e75c 100644
--- a/include/net/bluetooth/l2cap.h
+++ b/include/net/bluetooth/l2cap.h
@@ -37,7 +37,6 @@
37#define L2CAP_DEFAULT_MONITOR_TO 12000 /* 12 seconds */ 37#define L2CAP_DEFAULT_MONITOR_TO 12000 /* 12 seconds */
38#define L2CAP_DEFAULT_MAX_PDU_SIZE 1009 /* Sized for 3-DH5 packet */ 38#define L2CAP_DEFAULT_MAX_PDU_SIZE 1009 /* Sized for 3-DH5 packet */
39#define L2CAP_DEFAULT_ACK_TO 200 39#define L2CAP_DEFAULT_ACK_TO 200
40#define L2CAP_LOCAL_BUSY_TRIES 12
41#define L2CAP_LE_DEFAULT_MTU 23 40#define L2CAP_LE_DEFAULT_MTU 23
42 41
43#define L2CAP_CONN_TIMEOUT (40000) /* 40 seconds */ 42#define L2CAP_CONN_TIMEOUT (40000) /* 40 seconds */
@@ -130,6 +129,12 @@ struct l2cap_conninfo {
130#define L2CAP_SDU_END 0x8000 129#define L2CAP_SDU_END 0x8000
131#define L2CAP_SDU_CONTINUE 0xC000 130#define L2CAP_SDU_CONTINUE 0xC000
132 131
132/* L2CAP Command rej. reasons */
133#define L2CAP_REJ_NOT_UNDERSTOOD 0x0000
134#define L2CAP_REJ_MTU_EXCEEDED 0x0001
135#define L2CAP_REJ_INVALID_CID 0x0002
136
137
133/* L2CAP structures */ 138/* L2CAP structures */
134struct l2cap_hdr { 139struct l2cap_hdr {
135 __le16 len; 140 __le16 len;
@@ -144,8 +149,19 @@ struct l2cap_cmd_hdr {
144} __packed; 149} __packed;
145#define L2CAP_CMD_HDR_SIZE 4 150#define L2CAP_CMD_HDR_SIZE 4
146 151
147struct l2cap_cmd_rej { 152struct l2cap_cmd_rej_unk {
153 __le16 reason;
154} __packed;
155
156struct l2cap_cmd_rej_mtu {
157 __le16 reason;
158 __le16 max_mtu;
159} __packed;
160
161struct l2cap_cmd_rej_cid {
148 __le16 reason; 162 __le16 reason;
163 __le16 scid;
164 __le16 dcid;
149} __packed; 165} __packed;
150 166
151struct l2cap_conn_req { 167struct l2cap_conn_req {
@@ -287,6 +303,10 @@ struct l2cap_chan {
287 303
288 struct l2cap_conn *conn; 304 struct l2cap_conn *conn;
289 305
306 __u8 state;
307
308 atomic_t refcnt;
309
290 __le16 psm; 310 __le16 psm;
291 __u16 dcid; 311 __u16 dcid;
292 __u16 scid; 312 __u16 scid;
@@ -295,6 +315,7 @@ struct l2cap_chan {
295 __u16 omtu; 315 __u16 omtu;
296 __u16 flush_to; 316 __u16 flush_to;
297 __u8 mode; 317 __u8 mode;
318 __u8 chan_type;
298 319
299 __le16 sport; 320 __le16 sport;
300 321
@@ -302,6 +323,7 @@ struct l2cap_chan {
302 __u8 role_switch; 323 __u8 role_switch;
303 __u8 force_reliable; 324 __u8 force_reliable;
304 __u8 flushable; 325 __u8 flushable;
326 __u8 force_active;
305 327
306 __u8 ident; 328 __u8 ident;
307 329
@@ -318,8 +340,8 @@ struct l2cap_chan {
318 __u16 monitor_timeout; 340 __u16 monitor_timeout;
319 __u16 mps; 341 __u16 mps;
320 342
321 __u8 conf_state; 343 unsigned long conf_state;
322 __u16 conn_state; 344 unsigned long conn_state;
323 345
324 __u8 next_tx_seq; 346 __u8 next_tx_seq;
325 __u8 expected_ack_seq; 347 __u8 expected_ack_seq;
@@ -339,18 +361,29 @@ struct l2cap_chan {
339 __u8 remote_max_tx; 361 __u8 remote_max_tx;
340 __u16 remote_mps; 362 __u16 remote_mps;
341 363
364 struct timer_list chan_timer;
342 struct timer_list retrans_timer; 365 struct timer_list retrans_timer;
343 struct timer_list monitor_timer; 366 struct timer_list monitor_timer;
344 struct timer_list ack_timer; 367 struct timer_list ack_timer;
345 struct sk_buff *tx_send_head; 368 struct sk_buff *tx_send_head;
346 struct sk_buff_head tx_q; 369 struct sk_buff_head tx_q;
347 struct sk_buff_head srej_q; 370 struct sk_buff_head srej_q;
348 struct sk_buff_head busy_q;
349 struct work_struct busy_work;
350 struct list_head srej_l; 371 struct list_head srej_l;
351 372
352 struct list_head list; 373 struct list_head list;
353 struct list_head global_l; 374 struct list_head global_l;
375
376 void *data;
377 struct l2cap_ops *ops;
378};
379
380struct l2cap_ops {
381 char *name;
382
383 struct l2cap_chan *(*new_connection) (void *data);
384 int (*recv) (void *data, struct sk_buff *skb);
385 void (*close) (void *data);
386 void (*state_change) (void *data, int state);
354}; 387};
355 388
356struct l2cap_conn { 389struct l2cap_conn {
@@ -376,6 +409,15 @@ struct l2cap_conn {
376 409
377 __u8 disc_reason; 410 __u8 disc_reason;
378 411
412 __u8 preq[7]; /* SMP Pairing Request */
413 __u8 prsp[7]; /* SMP Pairing Response */
414 __u8 prnd[16]; /* SMP Pairing Random */
415 __u8 pcnf[16]; /* SMP Pairing Confirm */
416 __u8 tk[16]; /* SMP Temporary Key */
417 __u8 smp_key_size;
418
419 struct timer_list security_timer;
420
379 struct list_head chan_l; 421 struct list_head chan_l;
380 rwlock_t chan_lock; 422 rwlock_t chan_lock;
381}; 423};
@@ -384,44 +426,57 @@ struct l2cap_conn {
384#define L2CAP_INFO_FEAT_MASK_REQ_SENT 0x04 426#define L2CAP_INFO_FEAT_MASK_REQ_SENT 0x04
385#define L2CAP_INFO_FEAT_MASK_REQ_DONE 0x08 427#define L2CAP_INFO_FEAT_MASK_REQ_DONE 0x08
386 428
429#define L2CAP_CHAN_RAW 1
430#define L2CAP_CHAN_CONN_LESS 2
431#define L2CAP_CHAN_CONN_ORIENTED 3
432
387/* ----- L2CAP socket info ----- */ 433/* ----- L2CAP socket info ----- */
388#define l2cap_pi(sk) ((struct l2cap_pinfo *) sk) 434#define l2cap_pi(sk) ((struct l2cap_pinfo *) sk)
389 435
390struct l2cap_pinfo { 436struct l2cap_pinfo {
391 struct bt_sock bt; 437 struct bt_sock bt;
392 struct l2cap_chan *chan; 438 struct l2cap_chan *chan;
439 struct sk_buff *rx_busy_skb;
393}; 440};
394 441
395#define L2CAP_CONF_REQ_SENT 0x01 442enum {
396#define L2CAP_CONF_INPUT_DONE 0x02 443 CONF_REQ_SENT,
397#define L2CAP_CONF_OUTPUT_DONE 0x04 444 CONF_INPUT_DONE,
398#define L2CAP_CONF_MTU_DONE 0x08 445 CONF_OUTPUT_DONE,
399#define L2CAP_CONF_MODE_DONE 0x10 446 CONF_MTU_DONE,
400#define L2CAP_CONF_CONNECT_PEND 0x20 447 CONF_MODE_DONE,
401#define L2CAP_CONF_NO_FCS_RECV 0x40 448 CONF_CONNECT_PEND,
402#define L2CAP_CONF_STATE2_DEVICE 0x80 449 CONF_NO_FCS_RECV,
450 CONF_STATE2_DEVICE,
451};
403 452
404#define L2CAP_CONF_MAX_CONF_REQ 2 453#define L2CAP_CONF_MAX_CONF_REQ 2
405#define L2CAP_CONF_MAX_CONF_RSP 2 454#define L2CAP_CONF_MAX_CONF_RSP 2
406 455
407#define L2CAP_CONN_SAR_SDU 0x0001 456enum {
408#define L2CAP_CONN_SREJ_SENT 0x0002 457 CONN_SAR_SDU,
409#define L2CAP_CONN_WAIT_F 0x0004 458 CONN_SREJ_SENT,
410#define L2CAP_CONN_SREJ_ACT 0x0008 459 CONN_WAIT_F,
411#define L2CAP_CONN_SEND_PBIT 0x0010 460 CONN_SREJ_ACT,
412#define L2CAP_CONN_REMOTE_BUSY 0x0020 461 CONN_SEND_PBIT,
413#define L2CAP_CONN_LOCAL_BUSY 0x0040 462 CONN_REMOTE_BUSY,
414#define L2CAP_CONN_REJ_ACT 0x0080 463 CONN_LOCAL_BUSY,
415#define L2CAP_CONN_SEND_FBIT 0x0100 464 CONN_REJ_ACT,
416#define L2CAP_CONN_RNR_SENT 0x0200 465 CONN_SEND_FBIT,
417#define L2CAP_CONN_SAR_RETRY 0x0400 466 CONN_RNR_SENT,
418 467};
419#define __mod_retrans_timer() mod_timer(&chan->retrans_timer, \ 468
420 jiffies + msecs_to_jiffies(L2CAP_DEFAULT_RETRANS_TO)); 469#define __set_chan_timer(c, t) l2cap_set_timer(c, &c->chan_timer, (t))
421#define __mod_monitor_timer() mod_timer(&chan->monitor_timer, \ 470#define __clear_chan_timer(c) l2cap_clear_timer(c, &c->chan_timer)
422 jiffies + msecs_to_jiffies(L2CAP_DEFAULT_MONITOR_TO)); 471#define __set_retrans_timer(c) l2cap_set_timer(c, &c->retrans_timer, \
423#define __mod_ack_timer() mod_timer(&chan->ack_timer, \ 472 L2CAP_DEFAULT_RETRANS_TO);
424 jiffies + msecs_to_jiffies(L2CAP_DEFAULT_ACK_TO)); 473#define __clear_retrans_timer(c) l2cap_clear_timer(c, &c->retrans_timer)
474#define __set_monitor_timer(c) l2cap_set_timer(c, &c->monitor_timer, \
475 L2CAP_DEFAULT_MONITOR_TO);
476#define __clear_monitor_timer(c) l2cap_clear_timer(c, &c->monitor_timer)
477#define __set_ack_timer(c) l2cap_set_timer(c, &chan->ack_timer, \
478 L2CAP_DEFAULT_ACK_TO);
479#define __clear_ack_timer(c) l2cap_clear_timer(c, &c->ack_timer)
425 480
426static inline int l2cap_tx_window_full(struct l2cap_chan *ch) 481static inline int l2cap_tx_window_full(struct l2cap_chan *ch)
427{ 482{
@@ -446,32 +501,17 @@ extern int disable_ertm;
446int l2cap_init_sockets(void); 501int l2cap_init_sockets(void);
447void l2cap_cleanup_sockets(void); 502void l2cap_cleanup_sockets(void);
448 503
449void l2cap_send_cmd(struct l2cap_conn *conn, u8 ident, u8 code, u16 len, void *data);
450void __l2cap_connect_rsp_defer(struct l2cap_chan *chan); 504void __l2cap_connect_rsp_defer(struct l2cap_chan *chan);
451int __l2cap_wait_ack(struct sock *sk); 505int __l2cap_wait_ack(struct sock *sk);
452 506
453struct sk_buff *l2cap_create_connless_pdu(struct l2cap_chan *chan, struct msghdr *msg, size_t len);
454struct sk_buff *l2cap_create_basic_pdu(struct l2cap_chan *chan, struct msghdr *msg, size_t len);
455struct sk_buff *l2cap_create_iframe_pdu(struct l2cap_chan *chan, struct msghdr *msg, size_t len, u16 control, u16 sdulen);
456int l2cap_sar_segment_sdu(struct l2cap_chan *chan, struct msghdr *msg, size_t len);
457void l2cap_do_send(struct l2cap_chan *chan, struct sk_buff *skb);
458void l2cap_streaming_send(struct l2cap_chan *chan);
459int l2cap_ertm_send(struct l2cap_chan *chan);
460
461int l2cap_add_psm(struct l2cap_chan *chan, bdaddr_t *src, __le16 psm); 507int l2cap_add_psm(struct l2cap_chan *chan, bdaddr_t *src, __le16 psm);
462int l2cap_add_scid(struct l2cap_chan *chan, __u16 scid); 508int l2cap_add_scid(struct l2cap_chan *chan, __u16 scid);
463 509
464void l2cap_sock_set_timer(struct sock *sk, long timeout);
465void l2cap_sock_clear_timer(struct sock *sk);
466void __l2cap_sock_close(struct sock *sk, int reason);
467void l2cap_sock_kill(struct sock *sk);
468void l2cap_sock_init(struct sock *sk, struct sock *parent);
469struct sock *l2cap_sock_alloc(struct net *net, struct socket *sock,
470 int proto, gfp_t prio);
471void l2cap_send_disconn_req(struct l2cap_conn *conn, struct l2cap_chan *chan, int err);
472struct l2cap_chan *l2cap_chan_create(struct sock *sk); 510struct l2cap_chan *l2cap_chan_create(struct sock *sk);
473void l2cap_chan_del(struct l2cap_chan *chan, int err); 511void l2cap_chan_close(struct l2cap_chan *chan, int reason);
474void l2cap_chan_destroy(struct l2cap_chan *chan); 512void l2cap_chan_destroy(struct l2cap_chan *chan);
475int l2cap_chan_connect(struct l2cap_chan *chan); 513int l2cap_chan_connect(struct l2cap_chan *chan);
514int l2cap_chan_send(struct l2cap_chan *chan, struct msghdr *msg, size_t len);
515void l2cap_chan_busy(struct l2cap_chan *chan, int busy);
476 516
477#endif /* __L2CAP_H */ 517#endif /* __L2CAP_H */
diff --git a/include/net/bluetooth/mgmt.h b/include/net/bluetooth/mgmt.h
index 4899286ed4e4..5428fd32ccec 100644
--- a/include/net/bluetooth/mgmt.h
+++ b/include/net/bluetooth/mgmt.h
@@ -101,6 +101,8 @@ struct mgmt_key_info {
101 u8 type; 101 u8 type;
102 u8 val[16]; 102 u8 val[16];
103 u8 pin_len; 103 u8 pin_len;
104 u8 dlen;
105 u8 data[0];
104} __packed; 106} __packed;
105 107
106#define MGMT_OP_LOAD_KEYS 0x000D 108#define MGMT_OP_LOAD_KEYS 0x000D
@@ -199,6 +201,16 @@ struct mgmt_cp_remove_remote_oob_data {
199 201
200#define MGMT_OP_STOP_DISCOVERY 0x001C 202#define MGMT_OP_STOP_DISCOVERY 0x001C
201 203
204#define MGMT_OP_BLOCK_DEVICE 0x001D
205struct mgmt_cp_block_device {
206 bdaddr_t bdaddr;
207} __packed;
208
209#define MGMT_OP_UNBLOCK_DEVICE 0x001E
210struct mgmt_cp_unblock_device {
211 bdaddr_t bdaddr;
212} __packed;
213
202#define MGMT_EV_CMD_COMPLETE 0x0001 214#define MGMT_EV_CMD_COMPLETE 0x0001
203struct mgmt_ev_cmd_complete { 215struct mgmt_ev_cmd_complete {
204 __le16 opcode; 216 __le16 opcode;
diff --git a/include/net/bluetooth/rfcomm.h b/include/net/bluetooth/rfcomm.h
index 6eac4a760c3b..d5eee2093b1e 100644
--- a/include/net/bluetooth/rfcomm.h
+++ b/include/net/bluetooth/rfcomm.h
@@ -234,7 +234,8 @@ int rfcomm_send_rpn(struct rfcomm_session *s, int cr, u8 dlci,
234/* ---- RFCOMM DLCs (channels) ---- */ 234/* ---- RFCOMM DLCs (channels) ---- */
235struct rfcomm_dlc *rfcomm_dlc_alloc(gfp_t prio); 235struct rfcomm_dlc *rfcomm_dlc_alloc(gfp_t prio);
236void rfcomm_dlc_free(struct rfcomm_dlc *d); 236void rfcomm_dlc_free(struct rfcomm_dlc *d);
237int rfcomm_dlc_open(struct rfcomm_dlc *d, bdaddr_t *src, bdaddr_t *dst, u8 channel); 237int rfcomm_dlc_open(struct rfcomm_dlc *d, bdaddr_t *src, bdaddr_t *dst,
238 u8 channel);
238int rfcomm_dlc_close(struct rfcomm_dlc *d, int reason); 239int rfcomm_dlc_close(struct rfcomm_dlc *d, int reason);
239int rfcomm_dlc_send(struct rfcomm_dlc *d, struct sk_buff *skb); 240int rfcomm_dlc_send(struct rfcomm_dlc *d, struct sk_buff *skb);
240int rfcomm_dlc_set_modem_status(struct rfcomm_dlc *d, u8 v24_sig); 241int rfcomm_dlc_set_modem_status(struct rfcomm_dlc *d, u8 v24_sig);
@@ -271,7 +272,8 @@ static inline void rfcomm_dlc_unthrottle(struct rfcomm_dlc *d)
271} 272}
272 273
273/* ---- RFCOMM sessions ---- */ 274/* ---- RFCOMM sessions ---- */
274void rfcomm_session_getaddr(struct rfcomm_session *s, bdaddr_t *src, bdaddr_t *dst); 275void rfcomm_session_getaddr(struct rfcomm_session *s, bdaddr_t *src,
276 bdaddr_t *dst);
275 277
276static inline void rfcomm_session_hold(struct rfcomm_session *s) 278static inline void rfcomm_session_hold(struct rfcomm_session *s)
277{ 279{
@@ -312,7 +314,8 @@ struct rfcomm_pinfo {
312int rfcomm_init_sockets(void); 314int rfcomm_init_sockets(void);
313void rfcomm_cleanup_sockets(void); 315void rfcomm_cleanup_sockets(void);
314 316
315int rfcomm_connect_ind(struct rfcomm_session *s, u8 channel, struct rfcomm_dlc **d); 317int rfcomm_connect_ind(struct rfcomm_session *s, u8 channel,
318 struct rfcomm_dlc **d);
316 319
317/* ---- RFCOMM TTY ---- */ 320/* ---- RFCOMM TTY ---- */
318#define RFCOMM_MAX_DEV 256 321#define RFCOMM_MAX_DEV 256
diff --git a/include/net/bluetooth/smp.h b/include/net/bluetooth/smp.h
index 8f2edbf979dc..46c457612300 100644
--- a/include/net/bluetooth/smp.h
+++ b/include/net/bluetooth/smp.h
@@ -1,3 +1,25 @@
1/*
2 BlueZ - Bluetooth protocol stack for Linux
3 Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
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 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
10 OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
11 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS.
12 IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) AND AUTHOR(S) BE LIABLE FOR ANY
13 CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES
14 WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
15 ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
16 OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
17
18 ALL LIABILITY, INCLUDING LIABILITY FOR INFRINGEMENT OF ANY PATENTS,
19 COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS, RELATING TO USE OF THIS
20 SOFTWARE IS DISCLAIMED.
21*/
22
1#ifndef __SMP_H 23#ifndef __SMP_H
2#define __SMP_H 24#define __SMP_H
3 25
@@ -16,6 +38,23 @@ struct smp_cmd_pairing {
16 __u8 resp_key_dist; 38 __u8 resp_key_dist;
17} __packed; 39} __packed;
18 40
41#define SMP_IO_DISPLAY_ONLY 0x00
42#define SMP_IO_DISPLAY_YESNO 0x01
43#define SMP_IO_KEYBOARD_ONLY 0x02
44#define SMP_IO_NO_INPUT_OUTPUT 0x03
45#define SMP_IO_KEYBOARD_DISPLAY 0x04
46
47#define SMP_OOB_NOT_PRESENT 0x00
48#define SMP_OOB_PRESENT 0x01
49
50#define SMP_DIST_ENC_KEY 0x01
51#define SMP_DIST_ID_KEY 0x02
52#define SMP_DIST_SIGN 0x04
53
54#define SMP_AUTH_NONE 0x00
55#define SMP_AUTH_BONDING 0x01
56#define SMP_AUTH_MITM 0x04
57
19#define SMP_CMD_PAIRING_CONFIRM 0x03 58#define SMP_CMD_PAIRING_CONFIRM 0x03
20struct smp_cmd_pairing_confirm { 59struct smp_cmd_pairing_confirm {
21 __u8 confirm_val[16]; 60 __u8 confirm_val[16];
@@ -73,4 +112,12 @@ struct smp_cmd_security_req {
73#define SMP_UNSPECIFIED 0x08 112#define SMP_UNSPECIFIED 0x08
74#define SMP_REPEATED_ATTEMPTS 0x09 113#define SMP_REPEATED_ATTEMPTS 0x09
75 114
115#define SMP_MIN_ENC_KEY_SIZE 7
116#define SMP_MAX_ENC_KEY_SIZE 16
117
118/* SMP Commands */
119int smp_conn_security(struct l2cap_conn *conn, __u8 sec_level);
120int smp_sig_channel(struct l2cap_conn *conn, struct sk_buff *skb);
121int smp_distribute_keys(struct l2cap_conn *conn, __u8 force);
122
76#endif /* __SMP_H */ 123#endif /* __SMP_H */
diff --git a/include/net/caif/caif_hsi.h b/include/net/caif/caif_hsi.h
new file mode 100644
index 000000000000..c5dedd87b4cb
--- /dev/null
+++ b/include/net/caif/caif_hsi.h
@@ -0,0 +1,145 @@
1/*
2 * Copyright (C) ST-Ericsson AB 2010
3 * Contact: Sjur Brendeland / sjur.brandeland@stericsson.com
4 * Author: Daniel Martensson / daniel.martensson@stericsson.com
5 * Dmitry.Tarnyagin / dmitry.tarnyagin@stericsson.com
6 * License terms: GNU General Public License (GPL) version 2
7 */
8
9#ifndef CAIF_HSI_H_
10#define CAIF_HSI_H_
11
12#include <net/caif/caif_layer.h>
13#include <net/caif/caif_device.h>
14#include <linux/atomic.h>
15
16/*
17 * Maximum number of CAIF frames that can reside in the same HSI frame.
18 */
19#define CFHSI_MAX_PKTS 15
20
21/*
22 * Maximum number of bytes used for the frame that can be embedded in the
23 * HSI descriptor.
24 */
25#define CFHSI_MAX_EMB_FRM_SZ 96
26
27/*
28 * Decides if HSI buffers should be prefilled with 0xFF pattern for easier
29 * debugging. Both TX and RX buffers will be filled before the transfer.
30 */
31#define CFHSI_DBG_PREFILL 0
32
33/* Structure describing a HSI packet descriptor. */
34#pragma pack(1) /* Byte alignment. */
35struct cfhsi_desc {
36 u8 header;
37 u8 offset;
38 u16 cffrm_len[CFHSI_MAX_PKTS];
39 u8 emb_frm[CFHSI_MAX_EMB_FRM_SZ];
40};
41#pragma pack() /* Default alignment. */
42
43/* Size of the complete HSI packet descriptor. */
44#define CFHSI_DESC_SZ (sizeof(struct cfhsi_desc))
45
46/*
47 * Size of the complete HSI packet descriptor excluding the optional embedded
48 * CAIF frame.
49 */
50#define CFHSI_DESC_SHORT_SZ (CFHSI_DESC_SZ - CFHSI_MAX_EMB_FRM_SZ)
51
52/*
53 * Maximum bytes transferred in one transfer.
54 */
55/* TODO: 4096 is temporary... */
56#define CFHSI_MAX_PAYLOAD_SZ (CFHSI_MAX_PKTS * 4096)
57
58/* Size of the complete HSI TX buffer. */
59#define CFHSI_BUF_SZ_TX (CFHSI_DESC_SZ + CFHSI_MAX_PAYLOAD_SZ)
60
61/* Size of the complete HSI RX buffer. */
62#define CFHSI_BUF_SZ_RX ((2 * CFHSI_DESC_SZ) + CFHSI_MAX_PAYLOAD_SZ)
63
64/* Bitmasks for the HSI descriptor. */
65#define CFHSI_PIGGY_DESC (0x01 << 7)
66
67#define CFHSI_TX_STATE_IDLE 0
68#define CFHSI_TX_STATE_XFER 1
69
70#define CFHSI_RX_STATE_DESC 0
71#define CFHSI_RX_STATE_PAYLOAD 1
72
73/* Bitmasks for power management. */
74#define CFHSI_WAKE_UP 0
75#define CFHSI_WAKE_UP_ACK 1
76#define CFHSI_WAKE_DOWN_ACK 2
77#define CFHSI_AWAKE 3
78#define CFHSI_PENDING_RX 4
79#define CFHSI_SHUTDOWN 6
80#define CFHSI_FLUSH_FIFO 7
81
82#ifndef CFHSI_INACTIVITY_TOUT
83#define CFHSI_INACTIVITY_TOUT (1 * HZ)
84#endif /* CFHSI_INACTIVITY_TOUT */
85
86#ifndef CFHSI_WAKEUP_TOUT
87#define CFHSI_WAKEUP_TOUT (3 * HZ)
88#endif /* CFHSI_WAKEUP_TOUT */
89
90
91/* Structure implemented by the CAIF HSI driver. */
92struct cfhsi_drv {
93 void (*tx_done_cb) (struct cfhsi_drv *drv);
94 void (*rx_done_cb) (struct cfhsi_drv *drv);
95 void (*wake_up_cb) (struct cfhsi_drv *drv);
96 void (*wake_down_cb) (struct cfhsi_drv *drv);
97};
98
99/* Structure implemented by HSI device. */
100struct cfhsi_dev {
101 int (*cfhsi_up) (struct cfhsi_dev *dev);
102 int (*cfhsi_down) (struct cfhsi_dev *dev);
103 int (*cfhsi_tx) (u8 *ptr, int len, struct cfhsi_dev *dev);
104 int (*cfhsi_rx) (u8 *ptr, int len, struct cfhsi_dev *dev);
105 int (*cfhsi_wake_up) (struct cfhsi_dev *dev);
106 int (*cfhsi_wake_down) (struct cfhsi_dev *dev);
107 int (*cfhsi_fifo_occupancy)(struct cfhsi_dev *dev, size_t *occupancy);
108 int (*cfhsi_rx_cancel)(struct cfhsi_dev *dev);
109 struct cfhsi_drv *drv;
110};
111
112/* Structure implemented by CAIF HSI drivers. */
113struct cfhsi {
114 struct caif_dev_common cfdev;
115 struct net_device *ndev;
116 struct platform_device *pdev;
117 struct sk_buff_head qhead;
118 struct cfhsi_drv drv;
119 struct cfhsi_dev *dev;
120 int tx_state;
121 int rx_state;
122 int rx_len;
123 u8 *rx_ptr;
124 u8 *tx_buf;
125 u8 *rx_buf;
126 spinlock_t lock;
127 int flow_off_sent;
128 u32 q_low_mark;
129 u32 q_high_mark;
130 struct list_head list;
131 struct work_struct wake_up_work;
132 struct work_struct wake_down_work;
133 struct work_struct rx_done_work;
134 struct work_struct tx_done_work;
135 struct workqueue_struct *wq;
136 wait_queue_head_t wake_up_wait;
137 wait_queue_head_t wake_down_wait;
138 wait_queue_head_t flush_fifo_wait;
139 struct timer_list timer;
140 unsigned long bits;
141};
142
143extern struct platform_driver cfhsi_driver;
144
145#endif /* CAIF_HSI_H_ */
diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h
index 0589f554788a..d17f47fc9e31 100644
--- a/include/net/cfg80211.h
+++ b/include/net/cfg80211.h
@@ -777,6 +777,7 @@ struct cfg80211_ssid {
777 * @n_channels: total number of channels to scan 777 * @n_channels: total number of channels to scan
778 * @ie: optional information element(s) to add into Probe Request or %NULL 778 * @ie: optional information element(s) to add into Probe Request or %NULL
779 * @ie_len: length of ie in octets 779 * @ie_len: length of ie in octets
780 * @rates: bitmap of rates to advertise for each band
780 * @wiphy: the wiphy this was for 781 * @wiphy: the wiphy this was for
781 * @dev: the interface 782 * @dev: the interface
782 * @aborted: (internal) scan request was notified as aborted 783 * @aborted: (internal) scan request was notified as aborted
@@ -788,6 +789,8 @@ struct cfg80211_scan_request {
788 const u8 *ie; 789 const u8 *ie;
789 size_t ie_len; 790 size_t ie_len;
790 791
792 u32 rates[IEEE80211_NUM_BANDS];
793
791 /* internal */ 794 /* internal */
792 struct wiphy *wiphy; 795 struct wiphy *wiphy;
793 struct net_device *dev; 796 struct net_device *dev;
@@ -1146,14 +1149,32 @@ struct cfg80211_wowlan_trig_pkt_pattern {
1146 * @magic_pkt: wake up on receiving magic packet 1149 * @magic_pkt: wake up on receiving magic packet
1147 * @patterns: wake up on receiving packet matching a pattern 1150 * @patterns: wake up on receiving packet matching a pattern
1148 * @n_patterns: number of patterns 1151 * @n_patterns: number of patterns
1152 * @gtk_rekey_failure: wake up on GTK rekey failure
1153 * @eap_identity_req: wake up on EAP identity request packet
1154 * @four_way_handshake: wake up on 4-way handshake
1155 * @rfkill_release: wake up when rfkill is released
1149 */ 1156 */
1150struct cfg80211_wowlan { 1157struct cfg80211_wowlan {
1151 bool any, disconnect, magic_pkt; 1158 bool any, disconnect, magic_pkt, gtk_rekey_failure,
1159 eap_identity_req, four_way_handshake,
1160 rfkill_release;
1152 struct cfg80211_wowlan_trig_pkt_pattern *patterns; 1161 struct cfg80211_wowlan_trig_pkt_pattern *patterns;
1153 int n_patterns; 1162 int n_patterns;
1154}; 1163};
1155 1164
1156/** 1165/**
1166 * struct cfg80211_gtk_rekey_data - rekey data
1167 * @kek: key encryption key
1168 * @kck: key confirmation key
1169 * @replay_ctr: replay counter
1170 */
1171struct cfg80211_gtk_rekey_data {
1172 u8 kek[NL80211_KEK_LEN];
1173 u8 kck[NL80211_KCK_LEN];
1174 u8 replay_ctr[NL80211_REPLAY_CTR_LEN];
1175};
1176
1177/**
1157 * struct cfg80211_ops - backend description for wireless configuration 1178 * struct cfg80211_ops - backend description for wireless configuration
1158 * 1179 *
1159 * This struct is registered by fullmac card drivers and/or wireless stacks 1180 * This struct is registered by fullmac card drivers and/or wireless stacks
@@ -1197,6 +1218,8 @@ struct cfg80211_wowlan {
1197 * 1218 *
1198 * @set_default_mgmt_key: set the default management frame key on an interface 1219 * @set_default_mgmt_key: set the default management frame key on an interface
1199 * 1220 *
1221 * @set_rekey_data: give the data necessary for GTK rekeying to the driver
1222 *
1200 * @add_beacon: Add a beacon with given parameters, @head, @interval 1223 * @add_beacon: Add a beacon with given parameters, @head, @interval
1201 * and @dtim_period will be valid, @tail is optional. 1224 * and @dtim_period will be valid, @tail is optional.
1202 * @set_beacon: Change the beacon parameters for an access point mode 1225 * @set_beacon: Change the beacon parameters for an access point mode
@@ -1284,6 +1307,12 @@ struct cfg80211_wowlan {
1284 * frame on another channel 1307 * frame on another channel
1285 * 1308 *
1286 * @testmode_cmd: run a test mode command 1309 * @testmode_cmd: run a test mode command
1310 * @testmode_dump: Implement a test mode dump. The cb->args[2] and up may be
1311 * used by the function, but 0 and 1 must not be touched. Additionally,
1312 * return error codes other than -ENOBUFS and -ENOENT will terminate the
1313 * dump and return to userspace with an error, so be careful. If any data
1314 * was passed in from userspace then the data/len arguments will be present
1315 * and point to the data contained in %NL80211_ATTR_TESTDATA.
1287 * 1316 *
1288 * @set_bitrate_mask: set the bitrate mask configuration 1317 * @set_bitrate_mask: set the bitrate mask configuration
1289 * 1318 *
@@ -1433,6 +1462,9 @@ struct cfg80211_ops {
1433 1462
1434#ifdef CONFIG_NL80211_TESTMODE 1463#ifdef CONFIG_NL80211_TESTMODE
1435 int (*testmode_cmd)(struct wiphy *wiphy, void *data, int len); 1464 int (*testmode_cmd)(struct wiphy *wiphy, void *data, int len);
1465 int (*testmode_dump)(struct wiphy *wiphy, struct sk_buff *skb,
1466 struct netlink_callback *cb,
1467 void *data, int len);
1436#endif 1468#endif
1437 1469
1438 int (*set_bitrate_mask)(struct wiphy *wiphy, 1470 int (*set_bitrate_mask)(struct wiphy *wiphy,
@@ -1490,6 +1522,9 @@ struct cfg80211_ops {
1490 struct net_device *dev, 1522 struct net_device *dev,
1491 struct cfg80211_sched_scan_request *request); 1523 struct cfg80211_sched_scan_request *request);
1492 int (*sched_scan_stop)(struct wiphy *wiphy, struct net_device *dev); 1524 int (*sched_scan_stop)(struct wiphy *wiphy, struct net_device *dev);
1525
1526 int (*set_rekey_data)(struct wiphy *wiphy, struct net_device *dev,
1527 struct cfg80211_gtk_rekey_data *data);
1493}; 1528};
1494 1529
1495/* 1530/*
@@ -1647,11 +1682,21 @@ struct ieee80211_txrx_stypes {
1647 * @WIPHY_WOWLAN_MAGIC_PKT: supports wakeup on magic packet 1682 * @WIPHY_WOWLAN_MAGIC_PKT: supports wakeup on magic packet
1648 * (see nl80211.h) 1683 * (see nl80211.h)
1649 * @WIPHY_WOWLAN_DISCONNECT: supports wakeup on disconnect 1684 * @WIPHY_WOWLAN_DISCONNECT: supports wakeup on disconnect
1685 * @WIPHY_WOWLAN_SUPPORTS_GTK_REKEY: supports GTK rekeying while asleep
1686 * @WIPHY_WOWLAN_GTK_REKEY_FAILURE: supports wakeup on GTK rekey failure
1687 * @WIPHY_WOWLAN_EAP_IDENTITY_REQ: supports wakeup on EAP identity request
1688 * @WIPHY_WOWLAN_4WAY_HANDSHAKE: supports wakeup on 4-way handshake failure
1689 * @WIPHY_WOWLAN_RFKILL_RELEASE: supports wakeup on RF-kill release
1650 */ 1690 */
1651enum wiphy_wowlan_support_flags { 1691enum wiphy_wowlan_support_flags {
1652 WIPHY_WOWLAN_ANY = BIT(0), 1692 WIPHY_WOWLAN_ANY = BIT(0),
1653 WIPHY_WOWLAN_MAGIC_PKT = BIT(1), 1693 WIPHY_WOWLAN_MAGIC_PKT = BIT(1),
1654 WIPHY_WOWLAN_DISCONNECT = BIT(2), 1694 WIPHY_WOWLAN_DISCONNECT = BIT(2),
1695 WIPHY_WOWLAN_SUPPORTS_GTK_REKEY = BIT(3),
1696 WIPHY_WOWLAN_GTK_REKEY_FAILURE = BIT(4),
1697 WIPHY_WOWLAN_EAP_IDENTITY_REQ = BIT(5),
1698 WIPHY_WOWLAN_4WAY_HANDSHAKE = BIT(6),
1699 WIPHY_WOWLAN_RFKILL_RELEASE = BIT(7),
1655}; 1700};
1656 1701
1657/** 1702/**
@@ -1716,9 +1761,13 @@ struct wiphy_wowlan_support {
1716 * this variable determines its size 1761 * this variable determines its size
1717 * @max_scan_ssids: maximum number of SSIDs the device can scan for in 1762 * @max_scan_ssids: maximum number of SSIDs the device can scan for in
1718 * any given scan 1763 * any given scan
1764 * @max_sched_scan_ssids: maximum number of SSIDs the device can scan
1765 * for in any given scheduled scan
1719 * @max_scan_ie_len: maximum length of user-controlled IEs device can 1766 * @max_scan_ie_len: maximum length of user-controlled IEs device can
1720 * add to probe request frames transmitted during a scan, must not 1767 * add to probe request frames transmitted during a scan, must not
1721 * include fixed IEs like supported rates 1768 * include fixed IEs like supported rates
1769 * @max_sched_scan_ie_len: same as max_scan_ie_len, but for scheduled
1770 * scans
1722 * @coverage_class: current coverage class 1771 * @coverage_class: current coverage class
1723 * @fw_version: firmware version for ethtool reporting 1772 * @fw_version: firmware version for ethtool reporting
1724 * @hw_version: hardware version for ethtool reporting 1773 * @hw_version: hardware version for ethtool reporting
@@ -1770,7 +1819,9 @@ struct wiphy {
1770 1819
1771 int bss_priv_size; 1820 int bss_priv_size;
1772 u8 max_scan_ssids; 1821 u8 max_scan_ssids;
1822 u8 max_sched_scan_ssids;
1773 u16 max_scan_ie_len; 1823 u16 max_scan_ie_len;
1824 u16 max_sched_scan_ie_len;
1774 1825
1775 int n_cipher_suites; 1826 int n_cipher_suites;
1776 const u32 *cipher_suites; 1827 const u32 *cipher_suites;
@@ -2688,7 +2739,7 @@ void cfg80211_send_unprot_disassoc(struct net_device *dev, const u8 *buf,
2688 * @dev: network device 2739 * @dev: network device
2689 * @addr: The source MAC address of the frame 2740 * @addr: The source MAC address of the frame
2690 * @key_type: The key type that the received frame used 2741 * @key_type: The key type that the received frame used
2691 * @key_id: Key identifier (0..3) 2742 * @key_id: Key identifier (0..3). Can be -1 if missing.
2692 * @tsc: The TSC value of the frame that generated the MIC failure (6 octets) 2743 * @tsc: The TSC value of the frame that generated the MIC failure (6 octets)
2693 * @gfp: allocation flags 2744 * @gfp: allocation flags
2694 * 2745 *
@@ -2849,8 +2900,10 @@ struct sk_buff *cfg80211_testmode_alloc_event_skb(struct wiphy *wiphy,
2849void cfg80211_testmode_event(struct sk_buff *skb, gfp_t gfp); 2900void cfg80211_testmode_event(struct sk_buff *skb, gfp_t gfp);
2850 2901
2851#define CFG80211_TESTMODE_CMD(cmd) .testmode_cmd = (cmd), 2902#define CFG80211_TESTMODE_CMD(cmd) .testmode_cmd = (cmd),
2903#define CFG80211_TESTMODE_DUMP(cmd) .testmode_dump = (cmd),
2852#else 2904#else
2853#define CFG80211_TESTMODE_CMD(cmd) 2905#define CFG80211_TESTMODE_CMD(cmd)
2906#define CFG80211_TESTMODE_DUMP(cmd)
2854#endif 2907#endif
2855 2908
2856/** 2909/**
@@ -3022,6 +3075,16 @@ void cfg80211_cqm_rssi_notify(struct net_device *dev,
3022void cfg80211_cqm_pktloss_notify(struct net_device *dev, 3075void cfg80211_cqm_pktloss_notify(struct net_device *dev,
3023 const u8 *peer, u32 num_packets, gfp_t gfp); 3076 const u8 *peer, u32 num_packets, gfp_t gfp);
3024 3077
3078/**
3079 * cfg80211_gtk_rekey_notify - notify userspace about driver rekeying
3080 * @dev: network device
3081 * @bssid: BSSID of AP (to avoid races)
3082 * @replay_ctr: new replay counter
3083 * @gfp: allocation flags
3084 */
3085void cfg80211_gtk_rekey_notify(struct net_device *dev, const u8 *bssid,
3086 const u8 *replay_ctr, gfp_t gfp);
3087
3025/* Logging, debugging and troubleshooting/diagnostic helpers. */ 3088/* Logging, debugging and troubleshooting/diagnostic helpers. */
3026 3089
3027/* wiphy_printk helpers, similar to dev_printk */ 3090/* wiphy_printk helpers, similar to dev_printk */
diff --git a/include/net/cipso_ipv4.h b/include/net/cipso_ipv4.h
index abd443604c9f..9808877c2ab9 100644
--- a/include/net/cipso_ipv4.h
+++ b/include/net/cipso_ipv4.h
@@ -8,7 +8,7 @@
8 * have chosen to adopt the protocol and over the years it has become a 8 * have chosen to adopt the protocol and over the years it has become a
9 * de-facto standard for labeled networking. 9 * de-facto standard for labeled networking.
10 * 10 *
11 * Author: Paul Moore <paul.moore@hp.com> 11 * Author: Paul Moore <paul@paul-moore.com>
12 * 12 *
13 */ 13 */
14 14
@@ -41,7 +41,7 @@
41#include <linux/skbuff.h> 41#include <linux/skbuff.h>
42#include <net/netlabel.h> 42#include <net/netlabel.h>
43#include <net/request_sock.h> 43#include <net/request_sock.h>
44#include <asm/atomic.h> 44#include <linux/atomic.h>
45 45
46/* known doi values */ 46/* known doi values */
47#define CIPSO_V4_DOI_UNKNOWN 0x00000000 47#define CIPSO_V4_DOI_UNKNOWN 0x00000000
diff --git a/include/net/dcbnl.h b/include/net/dcbnl.h
index e5983c9053dc..f5aa39997f0b 100644
--- a/include/net/dcbnl.h
+++ b/include/net/dcbnl.h
@@ -28,8 +28,16 @@ struct dcb_app_type {
28 struct list_head list; 28 struct list_head list;
29}; 29};
30 30
31u8 dcb_setapp(struct net_device *, struct dcb_app *); 31int dcb_setapp(struct net_device *, struct dcb_app *);
32u8 dcb_getapp(struct net_device *, struct dcb_app *); 32u8 dcb_getapp(struct net_device *, struct dcb_app *);
33int dcb_ieee_setapp(struct net_device *, struct dcb_app *);
34int dcb_ieee_delapp(struct net_device *, struct dcb_app *);
35u8 dcb_ieee_getapp_mask(struct net_device *, struct dcb_app *);
36
37int dcbnl_ieee_notify(struct net_device *dev, int event, int cmd,
38 u32 seq, u32 pid);
39int dcbnl_cee_notify(struct net_device *dev, int event, int cmd,
40 u32 seq, u32 pid);
33 41
34/* 42/*
35 * Ops struct for the netlink callbacks. Used by DCB-enabled drivers through 43 * Ops struct for the netlink callbacks. Used by DCB-enabled drivers through
@@ -43,6 +51,7 @@ struct dcbnl_rtnl_ops {
43 int (*ieee_setpfc) (struct net_device *, struct ieee_pfc *); 51 int (*ieee_setpfc) (struct net_device *, struct ieee_pfc *);
44 int (*ieee_getapp) (struct net_device *, struct dcb_app *); 52 int (*ieee_getapp) (struct net_device *, struct dcb_app *);
45 int (*ieee_setapp) (struct net_device *, struct dcb_app *); 53 int (*ieee_setapp) (struct net_device *, struct dcb_app *);
54 int (*ieee_delapp) (struct net_device *, struct dcb_app *);
46 int (*ieee_peer_getets) (struct net_device *, struct ieee_ets *); 55 int (*ieee_peer_getets) (struct net_device *, struct ieee_ets *);
47 int (*ieee_peer_getpfc) (struct net_device *, struct ieee_pfc *); 56 int (*ieee_peer_getpfc) (struct net_device *, struct ieee_pfc *);
48 57
diff --git a/include/net/dst.h b/include/net/dst.h
index 7d15d238b6ec..13d507d69ddb 100644
--- a/include/net/dst.h
+++ b/include/net/dst.h
@@ -37,8 +37,7 @@ struct dst_entry {
37 unsigned long _metrics; 37 unsigned long _metrics;
38 unsigned long expires; 38 unsigned long expires;
39 struct dst_entry *path; 39 struct dst_entry *path;
40 struct neighbour *neighbour; 40 struct neighbour __rcu *_neighbour;
41 struct hh_cache *hh;
42#ifdef CONFIG_XFRM 41#ifdef CONFIG_XFRM
43 struct xfrm_state *xfrm; 42 struct xfrm_state *xfrm;
44#else 43#else
@@ -47,6 +46,14 @@ struct dst_entry {
47 int (*input)(struct sk_buff*); 46 int (*input)(struct sk_buff*);
48 int (*output)(struct sk_buff*); 47 int (*output)(struct sk_buff*);
49 48
49 int flags;
50#define DST_HOST 0x0001
51#define DST_NOXFRM 0x0002
52#define DST_NOPOLICY 0x0004
53#define DST_NOHASH 0x0008
54#define DST_NOCACHE 0x0010
55#define DST_NOCOUNT 0x0020
56
50 short error; 57 short error;
51 short obsolete; 58 short obsolete;
52 unsigned short header_len; /* more space at head required */ 59 unsigned short header_len; /* more space at head required */
@@ -62,7 +69,7 @@ struct dst_entry {
62 * (L1_CACHE_SIZE would be too much) 69 * (L1_CACHE_SIZE would be too much)
63 */ 70 */
64#ifdef CONFIG_64BIT 71#ifdef CONFIG_64BIT
65 long __pad_to_align_refcnt[1]; 72 long __pad_to_align_refcnt[2];
66#endif 73#endif
67 /* 74 /*
68 * __refcnt wants to be on a different cache line from 75 * __refcnt wants to be on a different cache line from
@@ -71,12 +78,6 @@ struct dst_entry {
71 atomic_t __refcnt; /* client references */ 78 atomic_t __refcnt; /* client references */
72 int __use; 79 int __use;
73 unsigned long lastuse; 80 unsigned long lastuse;
74 int flags;
75#define DST_HOST 0x0001
76#define DST_NOXFRM 0x0002
77#define DST_NOPOLICY 0x0004
78#define DST_NOHASH 0x0008
79#define DST_NOCACHE 0x0010
80 union { 81 union {
81 struct dst_entry *next; 82 struct dst_entry *next;
82 struct rtable __rcu *rt_next; 83 struct rtable __rcu *rt_next;
@@ -85,6 +86,21 @@ struct dst_entry {
85 }; 86 };
86}; 87};
87 88
89static inline struct neighbour *dst_get_neighbour(struct dst_entry *dst)
90{
91 return rcu_dereference(dst->_neighbour);
92}
93
94static inline struct neighbour *dst_get_neighbour_raw(struct dst_entry *dst)
95{
96 return rcu_dereference_raw(dst->_neighbour);
97}
98
99static inline void dst_set_neighbour(struct dst_entry *dst, struct neighbour *neigh)
100{
101 rcu_assign_pointer(dst->_neighbour, neigh);
102}
103
88extern u32 *dst_cow_metrics_generic(struct dst_entry *dst, unsigned long old); 104extern u32 *dst_cow_metrics_generic(struct dst_entry *dst, unsigned long old);
89extern const u32 dst_default_metrics[RTAX_MAX]; 105extern const u32 dst_default_metrics[RTAX_MAX];
90 106
@@ -370,8 +386,19 @@ static inline void dst_rcu_free(struct rcu_head *head)
370 386
371static inline void dst_confirm(struct dst_entry *dst) 387static inline void dst_confirm(struct dst_entry *dst)
372{ 388{
373 if (dst) 389 if (dst) {
374 neigh_confirm(dst->neighbour); 390 struct neighbour *n;
391
392 rcu_read_lock();
393 n = dst_get_neighbour(dst);
394 neigh_confirm(n);
395 rcu_read_unlock();
396 }
397}
398
399static inline struct neighbour *dst_neigh_lookup(const struct dst_entry *dst, const void *daddr)
400{
401 return dst->ops->neigh_lookup(dst, daddr);
375} 402}
376 403
377static inline void dst_link_failure(struct sk_buff *skb) 404static inline void dst_link_failure(struct sk_buff *skb)
diff --git a/include/net/dst_ops.h b/include/net/dst_ops.h
index dc0746328947..9adb99845a56 100644
--- a/include/net/dst_ops.h
+++ b/include/net/dst_ops.h
@@ -26,6 +26,7 @@ struct dst_ops {
26 void (*link_failure)(struct sk_buff *); 26 void (*link_failure)(struct sk_buff *);
27 void (*update_pmtu)(struct dst_entry *dst, u32 mtu); 27 void (*update_pmtu)(struct dst_entry *dst, u32 mtu);
28 int (*local_out)(struct sk_buff *skb); 28 int (*local_out)(struct sk_buff *skb);
29 struct neighbour * (*neigh_lookup)(const struct dst_entry *dst, const void *daddr);
29 30
30 struct kmem_cache *kmem_cachep; 31 struct kmem_cache *kmem_cachep;
31 32
diff --git a/include/net/flow.h b/include/net/flow.h
index c6d5fe5ec1bf..78113daadd63 100644
--- a/include/net/flow.h
+++ b/include/net/flow.h
@@ -8,7 +8,7 @@
8#define _NET_FLOW_H 8#define _NET_FLOW_H
9 9
10#include <linux/in6.h> 10#include <linux/in6.h>
11#include <asm/atomic.h> 11#include <linux/atomic.h>
12 12
13struct flowi_common { 13struct flowi_common {
14 int flowic_oif; 14 int flowic_oif;
diff --git a/include/net/genetlink.h b/include/net/genetlink.h
index d420f28b6d60..82d8d09faa44 100644
--- a/include/net/genetlink.h
+++ b/include/net/genetlink.h
@@ -160,6 +160,38 @@ static inline void *genlmsg_put(struct sk_buff *skb, u32 pid, u32 seq,
160} 160}
161 161
162/** 162/**
163 * genlmsg_nlhdr - Obtain netlink header from user specified header
164 * @user_hdr: user header as returned from genlmsg_put()
165 * @family: generic netlink family
166 *
167 * Returns pointer to netlink header.
168 */
169static inline struct nlmsghdr *genlmsg_nlhdr(void *user_hdr,
170 struct genl_family *family)
171{
172 return (struct nlmsghdr *)((char *)user_hdr -
173 family->hdrsize -
174 GENL_HDRLEN -
175 NLMSG_HDRLEN);
176}
177
178/**
179 * genl_dump_check_consistent - check if sequence is consistent and advertise if not
180 * @cb: netlink callback structure that stores the sequence number
181 * @user_hdr: user header as returned from genlmsg_put()
182 * @family: generic netlink family
183 *
184 * Cf. nl_dump_check_consistent(), this just provides a wrapper to make it
185 * simpler to use with generic netlink.
186 */
187static inline void genl_dump_check_consistent(struct netlink_callback *cb,
188 void *user_hdr,
189 struct genl_family *family)
190{
191 nl_dump_check_consistent(cb, genlmsg_nlhdr(user_hdr, family));
192}
193
194/**
163 * genlmsg_put_reply - Add generic netlink header to a reply message 195 * genlmsg_put_reply - Add generic netlink header to a reply message
164 * @skb: socket buffer holding the message 196 * @skb: socket buffer holding the message
165 * @info: receiver info 197 * @info: receiver info
diff --git a/include/net/inet_hashtables.h b/include/net/inet_hashtables.h
index e9c2ed8af864..808fc5f76b03 100644
--- a/include/net/inet_hashtables.h
+++ b/include/net/inet_hashtables.h
@@ -33,7 +33,7 @@
33#include <net/tcp_states.h> 33#include <net/tcp_states.h>
34#include <net/netns/hash.h> 34#include <net/netns/hash.h>
35 35
36#include <asm/atomic.h> 36#include <linux/atomic.h>
37#include <asm/byteorder.h> 37#include <asm/byteorder.h>
38 38
39/* This is for all connections with a full identity, no wildcards. 39/* This is for all connections with a full identity, no wildcards.
diff --git a/include/net/inet_timewait_sock.h b/include/net/inet_timewait_sock.h
index 17404b5388a7..f1a770977c4f 100644
--- a/include/net/inet_timewait_sock.h
+++ b/include/net/inet_timewait_sock.h
@@ -28,7 +28,7 @@
28#include <net/tcp_states.h> 28#include <net/tcp_states.h>
29#include <net/timewait_sock.h> 29#include <net/timewait_sock.h>
30 30
31#include <asm/atomic.h> 31#include <linux/atomic.h>
32 32
33struct inet_hashinfo; 33struct inet_hashinfo;
34 34
diff --git a/include/net/inetpeer.h b/include/net/inetpeer.h
index 8a159cc3d68b..78c83e62218f 100644
--- a/include/net/inetpeer.h
+++ b/include/net/inetpeer.h
@@ -13,7 +13,7 @@
13#include <linux/spinlock.h> 13#include <linux/spinlock.h>
14#include <linux/rtnetlink.h> 14#include <linux/rtnetlink.h>
15#include <net/ipv6.h> 15#include <net/ipv6.h>
16#include <asm/atomic.h> 16#include <linux/atomic.h>
17 17
18struct inetpeer_addr_base { 18struct inetpeer_addr_base {
19 union { 19 union {
@@ -32,13 +32,17 @@ struct inet_peer {
32 struct inet_peer __rcu *avl_left, *avl_right; 32 struct inet_peer __rcu *avl_left, *avl_right;
33 struct inetpeer_addr daddr; 33 struct inetpeer_addr daddr;
34 __u32 avl_height; 34 __u32 avl_height;
35 struct list_head unused; 35
36 __u32 dtime; /* the time of last use of not 36 u32 metrics[RTAX_MAX];
37 * referenced entries */ 37 u32 rate_tokens; /* rate limiting for ICMP */
38 atomic_t refcnt; 38 unsigned long rate_last;
39 unsigned long pmtu_expires;
40 u32 pmtu_orig;
41 u32 pmtu_learned;
42 struct inetpeer_addr_base redirect_learned;
39 /* 43 /*
40 * Once inet_peer is queued for deletion (refcnt == -1), following fields 44 * Once inet_peer is queued for deletion (refcnt == -1), following fields
41 * are not available: rid, ip_id_count, tcp_ts, tcp_ts_stamp, metrics 45 * are not available: rid, ip_id_count, tcp_ts, tcp_ts_stamp
42 * We can share memory with rcu_head to help keep inet_peer small. 46 * We can share memory with rcu_head to help keep inet_peer small.
43 */ 47 */
44 union { 48 union {
@@ -47,16 +51,14 @@ struct inet_peer {
47 atomic_t ip_id_count; /* IP ID for the next packet */ 51 atomic_t ip_id_count; /* IP ID for the next packet */
48 __u32 tcp_ts; 52 __u32 tcp_ts;
49 __u32 tcp_ts_stamp; 53 __u32 tcp_ts_stamp;
50 u32 metrics[RTAX_MAX];
51 u32 rate_tokens; /* rate limiting for ICMP */
52 unsigned long rate_last;
53 unsigned long pmtu_expires;
54 u32 pmtu_orig;
55 u32 pmtu_learned;
56 struct inetpeer_addr_base redirect_learned;
57 }; 54 };
58 struct rcu_head rcu; 55 struct rcu_head rcu;
56 struct inet_peer *gc_next;
59 }; 57 };
58
59 /* following fields might be frequently dirtied */
60 __u32 dtime; /* the time of last use of not referenced entries */
61 atomic_t refcnt;
60}; 62};
61 63
62void inet_initpeers(void) __init; 64void inet_initpeers(void) __init;
@@ -69,7 +71,7 @@ static inline bool inet_metrics_new(const struct inet_peer *p)
69} 71}
70 72
71/* can be called with or without local BH being disabled */ 73/* can be called with or without local BH being disabled */
72struct inet_peer *inet_getpeer(struct inetpeer_addr *daddr, int create); 74struct inet_peer *inet_getpeer(const struct inetpeer_addr *daddr, int create);
73 75
74static inline struct inet_peer *inet_getpeer_v4(__be32 v4daddr, int create) 76static inline struct inet_peer *inet_getpeer_v4(__be32 v4daddr, int create)
75{ 77{
@@ -104,11 +106,18 @@ static inline void inet_peer_refcheck(const struct inet_peer *p)
104 106
105 107
106/* can be called with or without local BH being disabled */ 108/* can be called with or without local BH being disabled */
107static inline __u16 inet_getid(struct inet_peer *p, int more) 109static inline int inet_getid(struct inet_peer *p, int more)
108{ 110{
111 int old, new;
109 more++; 112 more++;
110 inet_peer_refcheck(p); 113 inet_peer_refcheck(p);
111 return atomic_add_return(more, &p->ip_id_count) - more; 114 do {
115 old = atomic_read(&p->ip_id_count);
116 new = old + more;
117 if (!new)
118 new = 1;
119 } while (atomic_cmpxchg(&p->ip_id_count, old, new) != old);
120 return new;
112} 121}
113 122
114#endif /* _NET_INETPEER_H */ 123#endif /* _NET_INETPEER_H */
diff --git a/include/net/ip.h b/include/net/ip.h
index 66dd49149208..aa76c7a4d9c3 100644
--- a/include/net/ip.h
+++ b/include/net/ip.h
@@ -228,8 +228,6 @@ extern struct ctl_path net_ipv4_ctl_path[];
228extern int inet_peer_threshold; 228extern int inet_peer_threshold;
229extern int inet_peer_minttl; 229extern int inet_peer_minttl;
230extern int inet_peer_maxttl; 230extern int inet_peer_maxttl;
231extern int inet_peer_gc_mintime;
232extern int inet_peer_gc_maxtime;
233 231
234/* From ip_output.c */ 232/* From ip_output.c */
235extern int sysctl_ip_dynaddr; 233extern int sysctl_ip_dynaddr;
@@ -238,6 +236,11 @@ extern void ipfrag_init(void);
238 236
239extern void ip_static_sysctl_init(void); 237extern void ip_static_sysctl_init(void);
240 238
239static inline bool ip_is_fragment(const struct iphdr *iph)
240{
241 return (iph->frag_off & htons(IP_MF | IP_OFFSET)) != 0;
242}
243
241#ifdef CONFIG_INET 244#ifdef CONFIG_INET
242#include <net/dst.h> 245#include <net/dst.h>
243 246
@@ -401,7 +404,8 @@ enum ip_defrag_users {
401 __IP_DEFRAG_CONNTRACK_BRIDGE_IN = IP_DEFRAG_CONNTRACK_BRIDGE_IN + USHRT_MAX, 404 __IP_DEFRAG_CONNTRACK_BRIDGE_IN = IP_DEFRAG_CONNTRACK_BRIDGE_IN + USHRT_MAX,
402 IP_DEFRAG_VS_IN, 405 IP_DEFRAG_VS_IN,
403 IP_DEFRAG_VS_OUT, 406 IP_DEFRAG_VS_OUT,
404 IP_DEFRAG_VS_FWD 407 IP_DEFRAG_VS_FWD,
408 IP_DEFRAG_AF_PACKET,
405}; 409};
406 410
407int ip_defrag(struct sk_buff *skb, u32 user); 411int ip_defrag(struct sk_buff *skb, u32 user);
diff --git a/include/net/ip6_fib.h b/include/net/ip6_fib.h
index 477ef75f3873..5735a0f979c3 100644
--- a/include/net/ip6_fib.h
+++ b/include/net/ip6_fib.h
@@ -87,7 +87,6 @@ struct rt6_info {
87 struct dst_entry dst; 87 struct dst_entry dst;
88 88
89#define rt6i_dev dst.dev 89#define rt6i_dev dst.dev
90#define rt6i_nexthop dst.neighbour
91#define rt6i_expires dst.expires 90#define rt6i_expires dst.expires
92 91
93 /* 92 /*
diff --git a/include/net/ip_vs.h b/include/net/ip_vs.h
index 481f856c650f..1aaf915656f3 100644
--- a/include/net/ip_vs.h
+++ b/include/net/ip_vs.h
@@ -13,7 +13,7 @@
13#include <linux/sysctl.h> /* for ctl_path */ 13#include <linux/sysctl.h> /* for ctl_path */
14#include <linux/list.h> /* for struct list_head */ 14#include <linux/list.h> /* for struct list_head */
15#include <linux/spinlock.h> /* for struct rwlock_t */ 15#include <linux/spinlock.h> /* for struct rwlock_t */
16#include <asm/atomic.h> /* for struct atomic_t */ 16#include <linux/atomic.h> /* for struct atomic_t */
17#include <linux/compiler.h> 17#include <linux/compiler.h>
18#include <linux/timer.h> 18#include <linux/timer.h>
19 19
@@ -836,8 +836,6 @@ struct netns_ipvs {
836 int num_services; /* no of virtual services */ 836 int num_services; /* no of virtual services */
837 837
838 rwlock_t rs_lock; /* real services table */ 838 rwlock_t rs_lock; /* real services table */
839 /* semaphore for IPVS sockopts. And, [gs]etsockopt may sleep. */
840 struct lock_class_key ctl_key; /* ctl_mutex debuging */
841 /* Trash for destinations */ 839 /* Trash for destinations */
842 struct list_head dest_trash; 840 struct list_head dest_trash;
843 /* Service counters */ 841 /* Service counters */
@@ -1089,19 +1087,19 @@ ip_vs_control_add(struct ip_vs_conn *cp, struct ip_vs_conn *ctl_cp)
1089/* 1087/*
1090 * IPVS netns init & cleanup functions 1088 * IPVS netns init & cleanup functions
1091 */ 1089 */
1092extern int __ip_vs_estimator_init(struct net *net); 1090extern int ip_vs_estimator_net_init(struct net *net);
1093extern int __ip_vs_control_init(struct net *net); 1091extern int ip_vs_control_net_init(struct net *net);
1094extern int __ip_vs_protocol_init(struct net *net); 1092extern int ip_vs_protocol_net_init(struct net *net);
1095extern int __ip_vs_app_init(struct net *net); 1093extern int ip_vs_app_net_init(struct net *net);
1096extern int __ip_vs_conn_init(struct net *net); 1094extern int ip_vs_conn_net_init(struct net *net);
1097extern int __ip_vs_sync_init(struct net *net); 1095extern int ip_vs_sync_net_init(struct net *net);
1098extern void __ip_vs_conn_cleanup(struct net *net); 1096extern void ip_vs_conn_net_cleanup(struct net *net);
1099extern void __ip_vs_app_cleanup(struct net *net); 1097extern void ip_vs_app_net_cleanup(struct net *net);
1100extern void __ip_vs_protocol_cleanup(struct net *net); 1098extern void ip_vs_protocol_net_cleanup(struct net *net);
1101extern void __ip_vs_control_cleanup(struct net *net); 1099extern void ip_vs_control_net_cleanup(struct net *net);
1102extern void __ip_vs_estimator_cleanup(struct net *net); 1100extern void ip_vs_estimator_net_cleanup(struct net *net);
1103extern void __ip_vs_sync_cleanup(struct net *net); 1101extern void ip_vs_sync_net_cleanup(struct net *net);
1104extern void __ip_vs_service_cleanup(struct net *net); 1102extern void ip_vs_service_net_cleanup(struct net *net);
1105 1103
1106/* 1104/*
1107 * IPVS application functions 1105 * IPVS application functions
@@ -1119,8 +1117,6 @@ extern void ip_vs_app_inc_put(struct ip_vs_app *inc);
1119 1117
1120extern int ip_vs_app_pkt_out(struct ip_vs_conn *, struct sk_buff *skb); 1118extern int ip_vs_app_pkt_out(struct ip_vs_conn *, struct sk_buff *skb);
1121extern int ip_vs_app_pkt_in(struct ip_vs_conn *, struct sk_buff *skb); 1119extern int ip_vs_app_pkt_in(struct ip_vs_conn *, struct sk_buff *skb);
1122extern int ip_vs_app_init(void);
1123extern void ip_vs_app_cleanup(void);
1124 1120
1125void ip_vs_bind_pe(struct ip_vs_service *svc, struct ip_vs_pe *pe); 1121void ip_vs_bind_pe(struct ip_vs_service *svc, struct ip_vs_pe *pe);
1126void ip_vs_unbind_pe(struct ip_vs_service *svc); 1122void ip_vs_unbind_pe(struct ip_vs_service *svc);
@@ -1223,15 +1219,11 @@ extern int start_sync_thread(struct net *net, int state, char *mcast_ifn,
1223 __u8 syncid); 1219 __u8 syncid);
1224extern int stop_sync_thread(struct net *net, int state); 1220extern int stop_sync_thread(struct net *net, int state);
1225extern void ip_vs_sync_conn(struct net *net, struct ip_vs_conn *cp); 1221extern void ip_vs_sync_conn(struct net *net, struct ip_vs_conn *cp);
1226extern int ip_vs_sync_init(void);
1227extern void ip_vs_sync_cleanup(void);
1228 1222
1229 1223
1230/* 1224/*
1231 * IPVS rate estimator prototypes (from ip_vs_est.c) 1225 * IPVS rate estimator prototypes (from ip_vs_est.c)
1232 */ 1226 */
1233extern int ip_vs_estimator_init(void);
1234extern void ip_vs_estimator_cleanup(void);
1235extern void ip_vs_start_estimator(struct net *net, struct ip_vs_stats *stats); 1227extern void ip_vs_start_estimator(struct net *net, struct ip_vs_stats *stats);
1236extern void ip_vs_stop_estimator(struct net *net, struct ip_vs_stats *stats); 1228extern void ip_vs_stop_estimator(struct net *net, struct ip_vs_stats *stats);
1237extern void ip_vs_zero_estimator(struct ip_vs_stats *stats); 1229extern void ip_vs_zero_estimator(struct ip_vs_stats *stats);
diff --git a/include/net/ipv6.h b/include/net/ipv6.h
index c033ed00df7d..3b5ac1fbff39 100644
--- a/include/net/ipv6.h
+++ b/include/net/ipv6.h
@@ -463,17 +463,7 @@ static inline int ipv6_addr_diff(const struct in6_addr *a1, const struct in6_add
463 return __ipv6_addr_diff(a1, a2, sizeof(struct in6_addr)); 463 return __ipv6_addr_diff(a1, a2, sizeof(struct in6_addr));
464} 464}
465 465
466static __inline__ void ipv6_select_ident(struct frag_hdr *fhdr) 466extern void ipv6_select_ident(struct frag_hdr *fhdr, struct rt6_info *rt);
467{
468 static u32 ipv6_fragmentation_id = 1;
469 static DEFINE_SPINLOCK(ip6_id_lock);
470
471 spin_lock_bh(&ip6_id_lock);
472 fhdr->identification = htonl(ipv6_fragmentation_id);
473 if (++ipv6_fragmentation_id == 0)
474 ipv6_fragmentation_id = 1;
475 spin_unlock_bh(&ip6_id_lock);
476}
477 467
478/* 468/*
479 * Prototypes exported by ipv6 469 * Prototypes exported by ipv6
diff --git a/include/net/lib80211.h b/include/net/lib80211.h
index 848cce1bb7a5..b95bbb083ee8 100644
--- a/include/net/lib80211.h
+++ b/include/net/lib80211.h
@@ -26,7 +26,7 @@
26#include <linux/types.h> 26#include <linux/types.h>
27#include <linux/list.h> 27#include <linux/list.h>
28#include <linux/module.h> 28#include <linux/module.h>
29#include <asm/atomic.h> 29#include <linux/atomic.h>
30#include <linux/if.h> 30#include <linux/if.h>
31#include <linux/skbuff.h> 31#include <linux/skbuff.h>
32#include <linux/ieee80211.h> 32#include <linux/ieee80211.h>
diff --git a/include/net/llc.h b/include/net/llc.h
index 5503b74ab170..226c846cab08 100644
--- a/include/net/llc.h
+++ b/include/net/llc.h
@@ -20,7 +20,7 @@
20#include <linux/hash.h> 20#include <linux/hash.h>
21#include <linux/jhash.h> 21#include <linux/jhash.h>
22 22
23#include <asm/atomic.h> 23#include <linux/atomic.h>
24 24
25struct net_device; 25struct net_device;
26struct packet_type; 26struct packet_type;
diff --git a/include/net/mac80211.h b/include/net/mac80211.h
index e6d6a66a8f71..9259e97864d7 100644
--- a/include/net/mac80211.h
+++ b/include/net/mac80211.h
@@ -20,6 +20,7 @@
20#include <linux/device.h> 20#include <linux/device.h>
21#include <linux/ieee80211.h> 21#include <linux/ieee80211.h>
22#include <net/cfg80211.h> 22#include <net/cfg80211.h>
23#include <asm/unaligned.h>
23 24
24/** 25/**
25 * DOC: Introduction 26 * DOC: Introduction
@@ -193,6 +194,17 @@ enum ieee80211_bss_change {
193#define IEEE80211_BSS_ARP_ADDR_LIST_LEN 4 194#define IEEE80211_BSS_ARP_ADDR_LIST_LEN 4
194 195
195/** 196/**
197 * enum ieee80211_rssi_event - RSSI threshold event
198 * An indicator for when RSSI goes below/above a certain threshold.
199 * @RSSI_EVENT_HIGH: AP's rssi crossed the high threshold set by the driver.
200 * @RSSI_EVENT_LOW: AP's rssi crossed the low threshold set by the driver.
201 */
202enum ieee80211_rssi_event {
203 RSSI_EVENT_HIGH,
204 RSSI_EVENT_LOW,
205};
206
207/**
196 * struct ieee80211_bss_conf - holds the BSS's changing parameters 208 * struct ieee80211_bss_conf - holds the BSS's changing parameters
197 * 209 *
198 * This structure keeps information about a BSS (and an association 210 * This structure keeps information about a BSS (and an association
@@ -933,6 +945,7 @@ enum set_key_cmd {
933 * @aid: AID we assigned to the station if we're an AP 945 * @aid: AID we assigned to the station if we're an AP
934 * @supp_rates: Bitmap of supported rates (per band) 946 * @supp_rates: Bitmap of supported rates (per band)
935 * @ht_cap: HT capabilities of this STA; restricted to our own TX capabilities 947 * @ht_cap: HT capabilities of this STA; restricted to our own TX capabilities
948 * @wme: indicates whether the STA supports WME. Only valid during AP-mode.
936 * @drv_priv: data area for driver use, will always be aligned to 949 * @drv_priv: data area for driver use, will always be aligned to
937 * sizeof(void *), size is determined in hw information. 950 * sizeof(void *), size is determined in hw information.
938 */ 951 */
@@ -941,6 +954,7 @@ struct ieee80211_sta {
941 u8 addr[ETH_ALEN]; 954 u8 addr[ETH_ALEN];
942 u16 aid; 955 u16 aid;
943 struct ieee80211_sta_ht_cap ht_cap; 956 struct ieee80211_sta_ht_cap ht_cap;
957 bool wme;
944 958
945 /* must be last */ 959 /* must be last */
946 u8 drv_priv[0] __attribute__((__aligned__(sizeof(void *)))); 960 u8 drv_priv[0] __attribute__((__aligned__(sizeof(void *))));
@@ -960,21 +974,6 @@ enum sta_notify_cmd {
960}; 974};
961 975
962/** 976/**
963 * enum ieee80211_tkip_key_type - get tkip key
964 *
965 * Used by drivers which need to get a tkip key for skb. Some drivers need a
966 * phase 1 key, others need a phase 2 key. A single function allows the driver
967 * to get the key, this enum indicates what type of key is required.
968 *
969 * @IEEE80211_TKIP_P1_KEY: the driver needs a phase 1 key
970 * @IEEE80211_TKIP_P2_KEY: the driver needs a phase 2 key
971 */
972enum ieee80211_tkip_key_type {
973 IEEE80211_TKIP_P1_KEY,
974 IEEE80211_TKIP_P2_KEY,
975};
976
977/**
978 * enum ieee80211_hw_flags - hardware flags 977 * enum ieee80211_hw_flags - hardware flags
979 * 978 *
980 * These flags are used to indicate hardware capabilities to 979 * These flags are used to indicate hardware capabilities to
@@ -1587,6 +1586,20 @@ enum ieee80211_ampdu_mlme_action {
1587}; 1586};
1588 1587
1589/** 1588/**
1589 * enum ieee80211_tx_sync_type - TX sync type
1590 * @IEEE80211_TX_SYNC_AUTH: sync TX for authentication
1591 * (and possibly also before direct probe)
1592 * @IEEE80211_TX_SYNC_ASSOC: sync TX for association
1593 * @IEEE80211_TX_SYNC_ACTION: sync TX for action frame
1594 * (not implemented yet)
1595 */
1596enum ieee80211_tx_sync_type {
1597 IEEE80211_TX_SYNC_AUTH,
1598 IEEE80211_TX_SYNC_ASSOC,
1599 IEEE80211_TX_SYNC_ACTION,
1600};
1601
1602/**
1590 * struct ieee80211_ops - callbacks from mac80211 to the driver 1603 * struct ieee80211_ops - callbacks from mac80211 to the driver
1591 * 1604 *
1592 * This structure contains various callbacks that the driver may 1605 * This structure contains various callbacks that the driver may
@@ -1626,6 +1639,10 @@ enum ieee80211_ampdu_mlme_action {
1626 * ask the device to suspend. This is only invoked when WoWLAN is 1639 * ask the device to suspend. This is only invoked when WoWLAN is
1627 * configured, otherwise the device is deconfigured completely and 1640 * configured, otherwise the device is deconfigured completely and
1628 * reconfigured at resume time. 1641 * reconfigured at resume time.
1642 * The driver may also impose special conditions under which it
1643 * wants to use the "normal" suspend (deconfigure), say if it only
1644 * supports WoWLAN when the device is associated. In this case, it
1645 * must return 1 from this function.
1629 * 1646 *
1630 * @resume: If WoWLAN was configured, this indicates that mac80211 is 1647 * @resume: If WoWLAN was configured, this indicates that mac80211 is
1631 * now resuming its operation, after this the device must be fully 1648 * now resuming its operation, after this the device must be fully
@@ -1671,6 +1688,26 @@ enum ieee80211_ampdu_mlme_action {
1671 * of the bss parameters has changed when a call is made. The callback 1688 * of the bss parameters has changed when a call is made. The callback
1672 * can sleep. 1689 * can sleep.
1673 * 1690 *
1691 * @tx_sync: Called before a frame is sent to an AP/GO. In the GO case, the
1692 * driver should sync with the GO's powersaving so the device doesn't
1693 * transmit the frame while the GO is asleep. In the regular AP case
1694 * it may be used by drivers for devices implementing other restrictions
1695 * on talking to APs, e.g. due to regulatory enforcement or just HW
1696 * restrictions.
1697 * This function is called for every authentication, association and
1698 * action frame separately since applications might attempt to auth
1699 * with multiple APs before chosing one to associate to. If it returns
1700 * an error, the corresponding authentication, association or frame
1701 * transmission is aborted and reported as having failed. It is always
1702 * called after tuning to the correct channel.
1703 * The callback might be called multiple times before @finish_tx_sync
1704 * (but @finish_tx_sync will be called once for each) but in practice
1705 * this is unlikely to happen. It can also refuse in that case if the
1706 * driver cannot handle that situation.
1707 * This callback can sleep.
1708 * @finish_tx_sync: Called as a counterpart to @tx_sync, unless that returned
1709 * an error. This callback can sleep.
1710 *
1674 * @prepare_multicast: Prepare for multicast filter configuration. 1711 * @prepare_multicast: Prepare for multicast filter configuration.
1675 * This callback is optional, and its return value is passed 1712 * This callback is optional, and its return value is passed
1676 * to configure_filter(). This callback must be atomic. 1713 * to configure_filter(). This callback must be atomic.
@@ -1694,6 +1731,12 @@ enum ieee80211_ampdu_mlme_action {
1694 * which set IEEE80211_KEY_FLAG_TKIP_REQ_RX_P1_KEY. 1731 * which set IEEE80211_KEY_FLAG_TKIP_REQ_RX_P1_KEY.
1695 * The callback must be atomic. 1732 * The callback must be atomic.
1696 * 1733 *
1734 * @set_rekey_data: If the device supports GTK rekeying, for example while the
1735 * host is suspended, it can assign this callback to retrieve the data
1736 * necessary to do GTK rekeying, this is the KEK, KCK and replay counter.
1737 * After rekeying was done it should (for example during resume) notify
1738 * userspace of the new replay counter using ieee80211_gtk_rekey_notify().
1739 *
1697 * @hw_scan: Ask the hardware to service the scan request, no need to start 1740 * @hw_scan: Ask the hardware to service the scan request, no need to start
1698 * the scan state machine in stack. The scan must honour the channel 1741 * the scan state machine in stack. The scan must honour the channel
1699 * configuration done by the regulatory agent in the wiphy's 1742 * configuration done by the regulatory agent in the wiphy's
@@ -1708,6 +1751,14 @@ enum ieee80211_ampdu_mlme_action {
1708 * any error unless this callback returned a negative error code. 1751 * any error unless this callback returned a negative error code.
1709 * The callback can sleep. 1752 * The callback can sleep.
1710 * 1753 *
1754 * @cancel_hw_scan: Ask the low-level tp cancel the active hw scan.
1755 * The driver should ask the hardware to cancel the scan (if possible),
1756 * but the scan will be completed only after the driver will call
1757 * ieee80211_scan_completed().
1758 * This callback is needed for wowlan, to prevent enqueueing a new
1759 * scan_work after the low-level driver was already suspended.
1760 * The callback can sleep.
1761 *
1711 * @sched_scan_start: Ask the hardware to start scanning repeatedly at 1762 * @sched_scan_start: Ask the hardware to start scanning repeatedly at
1712 * specific intervals. The driver must call the 1763 * specific intervals. The driver must call the
1713 * ieee80211_sched_scan_results() function whenever it finds results. 1764 * ieee80211_sched_scan_results() function whenever it finds results.
@@ -1816,6 +1867,7 @@ enum ieee80211_ampdu_mlme_action {
1816 * 1867 *
1817 * @testmode_cmd: Implement a cfg80211 test mode command. 1868 * @testmode_cmd: Implement a cfg80211 test mode command.
1818 * The callback can sleep. 1869 * The callback can sleep.
1870 * @testmode_dump: Implement a cfg80211 test mode dump. The callback can sleep.
1819 * 1871 *
1820 * @flush: Flush all pending frames from the hardware queue, making sure 1872 * @flush: Flush all pending frames from the hardware queue, making sure
1821 * that the hardware queues are empty. If the parameter @drop is set 1873 * that the hardware queues are empty. If the parameter @drop is set
@@ -1860,6 +1912,8 @@ enum ieee80211_ampdu_mlme_action {
1860 * @set_bitrate_mask: Set a mask of rates to be used for rate control selection 1912 * @set_bitrate_mask: Set a mask of rates to be used for rate control selection
1861 * when transmitting a frame. Currently only legacy rates are handled. 1913 * when transmitting a frame. Currently only legacy rates are handled.
1862 * The callback can sleep. 1914 * The callback can sleep.
1915 * @rssi_callback: Notify driver when the average RSSI goes above/below
1916 * thresholds that were registered previously. The callback can sleep.
1863 */ 1917 */
1864struct ieee80211_ops { 1918struct ieee80211_ops {
1865 void (*tx)(struct ieee80211_hw *hw, struct sk_buff *skb); 1919 void (*tx)(struct ieee80211_hw *hw, struct sk_buff *skb);
@@ -1881,6 +1935,14 @@ struct ieee80211_ops {
1881 struct ieee80211_vif *vif, 1935 struct ieee80211_vif *vif,
1882 struct ieee80211_bss_conf *info, 1936 struct ieee80211_bss_conf *info,
1883 u32 changed); 1937 u32 changed);
1938
1939 int (*tx_sync)(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
1940 const u8 *bssid, enum ieee80211_tx_sync_type type);
1941 void (*finish_tx_sync)(struct ieee80211_hw *hw,
1942 struct ieee80211_vif *vif,
1943 const u8 *bssid,
1944 enum ieee80211_tx_sync_type type);
1945
1884 u64 (*prepare_multicast)(struct ieee80211_hw *hw, 1946 u64 (*prepare_multicast)(struct ieee80211_hw *hw,
1885 struct netdev_hw_addr_list *mc_list); 1947 struct netdev_hw_addr_list *mc_list);
1886 void (*configure_filter)(struct ieee80211_hw *hw, 1948 void (*configure_filter)(struct ieee80211_hw *hw,
@@ -1897,8 +1959,13 @@ struct ieee80211_ops {
1897 struct ieee80211_key_conf *conf, 1959 struct ieee80211_key_conf *conf,
1898 struct ieee80211_sta *sta, 1960 struct ieee80211_sta *sta,
1899 u32 iv32, u16 *phase1key); 1961 u32 iv32, u16 *phase1key);
1962 void (*set_rekey_data)(struct ieee80211_hw *hw,
1963 struct ieee80211_vif *vif,
1964 struct cfg80211_gtk_rekey_data *data);
1900 int (*hw_scan)(struct ieee80211_hw *hw, struct ieee80211_vif *vif, 1965 int (*hw_scan)(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
1901 struct cfg80211_scan_request *req); 1966 struct cfg80211_scan_request *req);
1967 void (*cancel_hw_scan)(struct ieee80211_hw *hw,
1968 struct ieee80211_vif *vif);
1902 int (*sched_scan_start)(struct ieee80211_hw *hw, 1969 int (*sched_scan_start)(struct ieee80211_hw *hw,
1903 struct ieee80211_vif *vif, 1970 struct ieee80211_vif *vif,
1904 struct cfg80211_sched_scan_request *req, 1971 struct cfg80211_sched_scan_request *req,
@@ -1936,6 +2003,9 @@ struct ieee80211_ops {
1936 void (*set_coverage_class)(struct ieee80211_hw *hw, u8 coverage_class); 2003 void (*set_coverage_class)(struct ieee80211_hw *hw, u8 coverage_class);
1937#ifdef CONFIG_NL80211_TESTMODE 2004#ifdef CONFIG_NL80211_TESTMODE
1938 int (*testmode_cmd)(struct ieee80211_hw *hw, void *data, int len); 2005 int (*testmode_cmd)(struct ieee80211_hw *hw, void *data, int len);
2006 int (*testmode_dump)(struct ieee80211_hw *hw, struct sk_buff *skb,
2007 struct netlink_callback *cb,
2008 void *data, int len);
1939#endif 2009#endif
1940 void (*flush)(struct ieee80211_hw *hw, bool drop); 2010 void (*flush)(struct ieee80211_hw *hw, bool drop);
1941 void (*channel_switch)(struct ieee80211_hw *hw, 2011 void (*channel_switch)(struct ieee80211_hw *hw,
@@ -1960,6 +2030,8 @@ struct ieee80211_ops {
1960 bool (*tx_frames_pending)(struct ieee80211_hw *hw); 2030 bool (*tx_frames_pending)(struct ieee80211_hw *hw);
1961 int (*set_bitrate_mask)(struct ieee80211_hw *hw, struct ieee80211_vif *vif, 2031 int (*set_bitrate_mask)(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
1962 const struct cfg80211_bitrate_mask *mask); 2032 const struct cfg80211_bitrate_mask *mask);
2033 void (*rssi_callback)(struct ieee80211_hw *hw,
2034 enum ieee80211_rssi_event rssi_event);
1963}; 2035};
1964 2036
1965/** 2037/**
@@ -2550,21 +2622,136 @@ struct sk_buff *
2550ieee80211_get_buffered_bc(struct ieee80211_hw *hw, struct ieee80211_vif *vif); 2622ieee80211_get_buffered_bc(struct ieee80211_hw *hw, struct ieee80211_vif *vif);
2551 2623
2552/** 2624/**
2553 * ieee80211_get_tkip_key - get a TKIP rc4 for skb 2625 * ieee80211_get_tkip_p1k_iv - get a TKIP phase 1 key for IV32
2626 *
2627 * This function returns the TKIP phase 1 key for the given IV32.
2628 *
2629 * @keyconf: the parameter passed with the set key
2630 * @iv32: IV32 to get the P1K for
2631 * @p1k: a buffer to which the key will be written, as 5 u16 values
2632 */
2633void ieee80211_get_tkip_p1k_iv(struct ieee80211_key_conf *keyconf,
2634 u32 iv32, u16 *p1k);
2635
2636/**
2637 * ieee80211_get_tkip_p1k - get a TKIP phase 1 key
2638 *
2639 * This function returns the TKIP phase 1 key for the IV32 taken
2640 * from the given packet.
2641 *
2642 * @keyconf: the parameter passed with the set key
2643 * @skb: the packet to take the IV32 value from that will be encrypted
2644 * with this P1K
2645 * @p1k: a buffer to which the key will be written, as 5 u16 values
2646 */
2647static inline void ieee80211_get_tkip_p1k(struct ieee80211_key_conf *keyconf,
2648 struct sk_buff *skb, u16 *p1k)
2649{
2650 struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data;
2651 const u8 *data = (u8 *)hdr + ieee80211_hdrlen(hdr->frame_control);
2652 u32 iv32 = get_unaligned_le32(&data[4]);
2653
2654 ieee80211_get_tkip_p1k_iv(keyconf, iv32, p1k);
2655}
2656
2657/**
2658 * ieee80211_get_tkip_rx_p1k - get a TKIP phase 1 key for RX
2659 *
2660 * This function returns the TKIP phase 1 key for the given IV32
2661 * and transmitter address.
2662 *
2663 * @keyconf: the parameter passed with the set key
2664 * @ta: TA that will be used with the key
2665 * @iv32: IV32 to get the P1K for
2666 * @p1k: a buffer to which the key will be written, as 5 u16 values
2667 */
2668void ieee80211_get_tkip_rx_p1k(struct ieee80211_key_conf *keyconf,
2669 const u8 *ta, u32 iv32, u16 *p1k);
2670
2671/**
2672 * ieee80211_get_tkip_p2k - get a TKIP phase 2 key
2673 *
2674 * This function computes the TKIP RC4 key for the IV values
2675 * in the packet.
2676 *
2677 * @keyconf: the parameter passed with the set key
2678 * @skb: the packet to take the IV32/IV16 values from that will be
2679 * encrypted with this key
2680 * @p2k: a buffer to which the key will be written, 16 bytes
2681 */
2682void ieee80211_get_tkip_p2k(struct ieee80211_key_conf *keyconf,
2683 struct sk_buff *skb, u8 *p2k);
2684
2685/**
2686 * struct ieee80211_key_seq - key sequence counter
2554 * 2687 *
2555 * This function computes a TKIP rc4 key for an skb. It computes 2688 * @tkip: TKIP data, containing IV32 and IV16 in host byte order
2556 * a phase 1 key if needed (iv16 wraps around). This function is to 2689 * @ccmp: PN data, most significant byte first (big endian,
2557 * be used by drivers which can do HW encryption but need to compute 2690 * reverse order than in packet)
2558 * to phase 1/2 key in SW. 2691 * @aes_cmac: PN data, most significant byte first (big endian,
2692 * reverse order than in packet)
2693 */
2694struct ieee80211_key_seq {
2695 union {
2696 struct {
2697 u32 iv32;
2698 u16 iv16;
2699 } tkip;
2700 struct {
2701 u8 pn[6];
2702 } ccmp;
2703 struct {
2704 u8 pn[6];
2705 } aes_cmac;
2706 };
2707};
2708
2709/**
2710 * ieee80211_get_key_tx_seq - get key TX sequence counter
2711 *
2712 * @keyconf: the parameter passed with the set key
2713 * @seq: buffer to receive the sequence data
2714 *
2715 * This function allows a driver to retrieve the current TX IV/PN
2716 * for the given key. It must not be called if IV generation is
2717 * offloaded to the device.
2718 *
2719 * Note that this function may only be called when no TX processing
2720 * can be done concurrently, for example when queues are stopped
2721 * and the stop has been synchronized.
2722 */
2723void ieee80211_get_key_tx_seq(struct ieee80211_key_conf *keyconf,
2724 struct ieee80211_key_seq *seq);
2725
2726/**
2727 * ieee80211_get_key_rx_seq - get key RX sequence counter
2559 * 2728 *
2560 * @keyconf: the parameter passed with the set key 2729 * @keyconf: the parameter passed with the set key
2561 * @skb: the skb for which the key is needed 2730 * @tid: The TID, or -1 for the management frame value (CCMP only);
2562 * @type: TBD 2731 * the value on TID 0 is also used for non-QoS frames. For
2563 * @key: a buffer to which the key will be written 2732 * CMAC, only TID 0 is valid.
2733 * @seq: buffer to receive the sequence data
2734 *
2735 * This function allows a driver to retrieve the current RX IV/PNs
2736 * for the given key. It must not be called if IV checking is done
2737 * by the device and not by mac80211.
2738 *
2739 * Note that this function may only be called when no RX processing
2740 * can be done concurrently.
2564 */ 2741 */
2565void ieee80211_get_tkip_key(struct ieee80211_key_conf *keyconf, 2742void ieee80211_get_key_rx_seq(struct ieee80211_key_conf *keyconf,
2566 struct sk_buff *skb, 2743 int tid, struct ieee80211_key_seq *seq);
2567 enum ieee80211_tkip_key_type type, u8 *key); 2744
2745/**
2746 * ieee80211_gtk_rekey_notify - notify userspace supplicant of rekeying
2747 * @vif: virtual interface the rekeying was done on
2748 * @bssid: The BSSID of the AP, for checking association
2749 * @replay_ctr: the new replay counter after GTK rekeying
2750 * @gfp: allocation flags
2751 */
2752void ieee80211_gtk_rekey_notify(struct ieee80211_vif *vif, const u8 *bssid,
2753 const u8 *replay_ctr, gfp_t gfp);
2754
2568/** 2755/**
2569 * ieee80211_wake_queue - wake specific queue 2756 * ieee80211_wake_queue - wake specific queue
2570 * @hw: pointer as obtained from ieee80211_alloc_hw(). 2757 * @hw: pointer as obtained from ieee80211_alloc_hw().
@@ -2830,6 +3017,33 @@ void ieee80211_sta_block_awake(struct ieee80211_hw *hw,
2830 struct ieee80211_sta *pubsta, bool block); 3017 struct ieee80211_sta *pubsta, bool block);
2831 3018
2832/** 3019/**
3020 * ieee80211_iter_keys - iterate keys programmed into the device
3021 * @hw: pointer obtained from ieee80211_alloc_hw()
3022 * @vif: virtual interface to iterate, may be %NULL for all
3023 * @iter: iterator function that will be called for each key
3024 * @iter_data: custom data to pass to the iterator function
3025 *
3026 * This function can be used to iterate all the keys known to
3027 * mac80211, even those that weren't previously programmed into
3028 * the device. This is intended for use in WoWLAN if the device
3029 * needs reprogramming of the keys during suspend. Note that due
3030 * to locking reasons, it is also only safe to call this at few
3031 * spots since it must hold the RTNL and be able to sleep.
3032 *
3033 * The order in which the keys are iterated matches the order
3034 * in which they were originally installed and handed to the
3035 * set_key callback.
3036 */
3037void ieee80211_iter_keys(struct ieee80211_hw *hw,
3038 struct ieee80211_vif *vif,
3039 void (*iter)(struct ieee80211_hw *hw,
3040 struct ieee80211_vif *vif,
3041 struct ieee80211_sta *sta,
3042 struct ieee80211_key_conf *key,
3043 void *data),
3044 void *iter_data);
3045
3046/**
2833 * ieee80211_ap_probereq_get - retrieve a Probe Request template 3047 * ieee80211_ap_probereq_get - retrieve a Probe Request template
2834 * @hw: pointer obtained from ieee80211_alloc_hw(). 3048 * @hw: pointer obtained from ieee80211_alloc_hw().
2835 * @vif: &struct ieee80211_vif pointer from the add_interface callback. 3049 * @vif: &struct ieee80211_vif pointer from the add_interface callback.
@@ -2870,6 +3084,29 @@ void ieee80211_beacon_loss(struct ieee80211_vif *vif);
2870void ieee80211_connection_loss(struct ieee80211_vif *vif); 3084void ieee80211_connection_loss(struct ieee80211_vif *vif);
2871 3085
2872/** 3086/**
3087 * ieee80211_resume_disconnect - disconnect from AP after resume
3088 *
3089 * @vif: &struct ieee80211_vif pointer from the add_interface callback.
3090 *
3091 * Instructs mac80211 to disconnect from the AP after resume.
3092 * Drivers can use this after WoWLAN if they know that the
3093 * connection cannot be kept up, for example because keys were
3094 * used while the device was asleep but the replay counters or
3095 * similar cannot be retrieved from the device during resume.
3096 *
3097 * Note that due to implementation issues, if the driver uses
3098 * the reconfiguration functionality during resume the interface
3099 * will still be added as associated first during resume and then
3100 * disconnect normally later.
3101 *
3102 * This function can only be called from the resume callback and
3103 * the driver must not be holding any of its own locks while it
3104 * calls this function, or at least not any locks it needs in the
3105 * key configuration paths (if it supports HW crypto).
3106 */
3107void ieee80211_resume_disconnect(struct ieee80211_vif *vif);
3108
3109/**
2873 * ieee80211_disable_dyn_ps - force mac80211 to temporarily disable dynamic psm 3110 * ieee80211_disable_dyn_ps - force mac80211 to temporarily disable dynamic psm
2874 * 3111 *
2875 * @vif: &struct ieee80211_vif pointer from the add_interface callback. 3112 * @vif: &struct ieee80211_vif pointer from the add_interface callback.
@@ -2916,6 +3153,16 @@ void ieee80211_cqm_rssi_notify(struct ieee80211_vif *vif,
2916 gfp_t gfp); 3153 gfp_t gfp);
2917 3154
2918/** 3155/**
3156 * ieee80211_get_operstate - get the operstate of the vif
3157 *
3158 * @vif: &struct ieee80211_vif pointer from the add_interface callback.
3159 *
3160 * The driver might need to know the operstate of the net_device
3161 * (specifically, whether the link is IF_OPER_UP after resume)
3162 */
3163unsigned char ieee80211_get_operstate(struct ieee80211_vif *vif);
3164
3165/**
2919 * ieee80211_chswitch_done - Complete channel switch process 3166 * ieee80211_chswitch_done - Complete channel switch process
2920 * @vif: &struct ieee80211_vif pointer from the add_interface callback. 3167 * @vif: &struct ieee80211_vif pointer from the add_interface callback.
2921 * @success: make the channel switch successful or not 3168 * @success: make the channel switch successful or not
@@ -2965,6 +3212,23 @@ void ieee80211_ready_on_channel(struct ieee80211_hw *hw);
2965 */ 3212 */
2966void ieee80211_remain_on_channel_expired(struct ieee80211_hw *hw); 3213void ieee80211_remain_on_channel_expired(struct ieee80211_hw *hw);
2967 3214
3215/**
3216 * ieee80211_stop_rx_ba_session - callback to stop existing BA sessions
3217 *
3218 * in order not to harm the system performance and user experience, the device
3219 * may request not to allow any rx ba session and tear down existing rx ba
3220 * sessions based on system constraints such as periodic BT activity that needs
3221 * to limit wlan activity (eg.sco or a2dp)."
3222 * in such cases, the intention is to limit the duration of the rx ppdu and
3223 * therefore prevent the peer device to use a-mpdu aggregation.
3224 *
3225 * @vif: &struct ieee80211_vif pointer from the add_interface callback.
3226 * @ba_rx_bitmap: Bit map of open rx ba per tid
3227 * @addr: & to bssid mac address
3228 */
3229void ieee80211_stop_rx_ba_session(struct ieee80211_vif *vif, u16 ba_rx_bitmap,
3230 const u8 *addr);
3231
2968/* Rate control API */ 3232/* Rate control API */
2969 3233
2970/** 3234/**
@@ -3150,4 +3414,9 @@ ieee80211_vif_type_p2p(struct ieee80211_vif *vif)
3150 return ieee80211_iftype_p2p(vif->type, vif->p2p); 3414 return ieee80211_iftype_p2p(vif->type, vif->p2p);
3151} 3415}
3152 3416
3417void ieee80211_enable_rssi_reports(struct ieee80211_vif *vif,
3418 int rssi_min_thold,
3419 int rssi_max_thold);
3420
3421void ieee80211_disable_rssi_reports(struct ieee80211_vif *vif);
3153#endif /* MAC80211_H */ 3422#endif /* MAC80211_H */
diff --git a/include/net/neighbour.h b/include/net/neighbour.h
index 4014b623880c..2720884287c3 100644
--- a/include/net/neighbour.h
+++ b/include/net/neighbour.h
@@ -16,7 +16,7 @@
16 * - Add neighbour cache statistics like rtstat 16 * - Add neighbour cache statistics like rtstat
17 */ 17 */
18 18
19#include <asm/atomic.h> 19#include <linux/atomic.h>
20#include <linux/netdevice.h> 20#include <linux/netdevice.h>
21#include <linux/skbuff.h> 21#include <linux/skbuff.h>
22#include <linux/rcupdate.h> 22#include <linux/rcupdate.h>
@@ -108,8 +108,8 @@ struct neighbour {
108 __u8 dead; 108 __u8 dead;
109 seqlock_t ha_lock; 109 seqlock_t ha_lock;
110 unsigned char ha[ALIGN(MAX_ADDR_LEN, sizeof(unsigned long))]; 110 unsigned char ha[ALIGN(MAX_ADDR_LEN, sizeof(unsigned long))];
111 struct hh_cache *hh; 111 struct hh_cache hh;
112 int (*output)(struct sk_buff *skb); 112 int (*output)(struct neighbour *, struct sk_buff *);
113 const struct neigh_ops *ops; 113 const struct neigh_ops *ops;
114 struct rcu_head rcu; 114 struct rcu_head rcu;
115 struct net_device *dev; 115 struct net_device *dev;
@@ -118,12 +118,10 @@ struct neighbour {
118 118
119struct neigh_ops { 119struct neigh_ops {
120 int family; 120 int family;
121 void (*solicit)(struct neighbour *, struct sk_buff*); 121 void (*solicit)(struct neighbour *, struct sk_buff *);
122 void (*error_report)(struct neighbour *, struct sk_buff*); 122 void (*error_report)(struct neighbour *, struct sk_buff *);
123 int (*output)(struct sk_buff*); 123 int (*output)(struct neighbour *, struct sk_buff *);
124 int (*connected_output)(struct sk_buff*); 124 int (*connected_output)(struct neighbour *, struct sk_buff *);
125 int (*hh_output)(struct sk_buff*);
126 int (*queue_xmit)(struct sk_buff*);
127}; 125};
128 126
129struct pneigh_entry { 127struct pneigh_entry {
@@ -142,7 +140,7 @@ struct pneigh_entry {
142 140
143struct neigh_hash_table { 141struct neigh_hash_table {
144 struct neighbour __rcu **hash_buckets; 142 struct neighbour __rcu **hash_buckets;
145 unsigned int hash_mask; 143 unsigned int hash_shift;
146 __u32 hash_rnd; 144 __u32 hash_rnd;
147 struct rcu_head rcu; 145 struct rcu_head rcu;
148}; 146};
@@ -205,9 +203,10 @@ extern int neigh_update(struct neighbour *neigh, const u8 *lladdr, u8 new,
205 u32 flags); 203 u32 flags);
206extern void neigh_changeaddr(struct neigh_table *tbl, struct net_device *dev); 204extern void neigh_changeaddr(struct neigh_table *tbl, struct net_device *dev);
207extern int neigh_ifdown(struct neigh_table *tbl, struct net_device *dev); 205extern int neigh_ifdown(struct neigh_table *tbl, struct net_device *dev);
208extern int neigh_resolve_output(struct sk_buff *skb); 206extern int neigh_resolve_output(struct neighbour *neigh, struct sk_buff *skb);
209extern int neigh_connected_output(struct sk_buff *skb); 207extern int neigh_connected_output(struct neighbour *neigh, struct sk_buff *skb);
210extern int neigh_compat_output(struct sk_buff *skb); 208extern int neigh_compat_output(struct neighbour *neigh, struct sk_buff *skb);
209extern int neigh_direct_output(struct neighbour *neigh, struct sk_buff *skb);
211extern struct neighbour *neigh_event_ns(struct neigh_table *tbl, 210extern struct neighbour *neigh_event_ns(struct neigh_table *tbl,
212 u8 *lladdr, void *saddr, 211 u8 *lladdr, void *saddr,
213 struct net_device *dev); 212 struct net_device *dev);
@@ -341,7 +340,16 @@ static inline int neigh_hh_output(struct hh_cache *hh, struct sk_buff *skb)
341 } while (read_seqretry(&hh->hh_lock, seq)); 340 } while (read_seqretry(&hh->hh_lock, seq));
342 341
343 skb_push(skb, hh_len); 342 skb_push(skb, hh_len);
344 return hh->hh_output(skb); 343 return dev_queue_xmit(skb);
344}
345
346static inline int neigh_output(struct neighbour *n, struct sk_buff *skb)
347{
348 struct hh_cache *hh = &n->hh;
349 if ((n->nud_state & NUD_CONNECTED) && hh->hh_len)
350 return neigh_hh_output(hh, skb);
351 else
352 return n->output(n, skb);
345} 353}
346 354
347static inline struct neighbour * 355static inline struct neighbour *
diff --git a/include/net/net_namespace.h b/include/net/net_namespace.h
index 2bf9ed9ef26b..3bb6fa0eace0 100644
--- a/include/net/net_namespace.h
+++ b/include/net/net_namespace.h
@@ -4,7 +4,7 @@
4#ifndef __NET_NET_NAMESPACE_H 4#ifndef __NET_NET_NAMESPACE_H
5#define __NET_NET_NAMESPACE_H 5#define __NET_NET_NAMESPACE_H
6 6
7#include <asm/atomic.h> 7#include <linux/atomic.h>
8#include <linux/workqueue.h> 8#include <linux/workqueue.h>
9#include <linux/list.h> 9#include <linux/list.h>
10#include <linux/sysctl.h> 10#include <linux/sysctl.h>
@@ -35,8 +35,11 @@ struct netns_ipvs;
35#define NETDEV_HASHENTRIES (1 << NETDEV_HASHBITS) 35#define NETDEV_HASHENTRIES (1 << NETDEV_HASHBITS)
36 36
37struct net { 37struct net {
38 atomic_t passive; /* To decided when the network
39 * namespace should be freed.
40 */
38 atomic_t count; /* To decided when the network 41 atomic_t count; /* To decided when the network
39 * namespace should be freed. 42 * namespace should be shut down.
40 */ 43 */
41#ifdef NETNS_REFCNT_DEBUG 44#ifdef NETNS_REFCNT_DEBUG
42 atomic_t use_count; /* To track references we 45 atomic_t use_count; /* To track references we
@@ -62,6 +65,7 @@ struct net {
62 struct list_head dev_base_head; 65 struct list_head dev_base_head;
63 struct hlist_head *dev_name_head; 66 struct hlist_head *dev_name_head;
64 struct hlist_head *dev_index_head; 67 struct hlist_head *dev_index_head;
68 unsigned int dev_base_seq; /* protected by rtnl_mutex */
65 69
66 /* core fib_rules */ 70 /* core fib_rules */
67 struct list_head rules_ops; 71 struct list_head rules_ops;
@@ -154,6 +158,9 @@ int net_eq(const struct net *net1, const struct net *net2)
154{ 158{
155 return net1 == net2; 159 return net1 == net2;
156} 160}
161
162extern void net_drop_ns(void *);
163
157#else 164#else
158 165
159static inline struct net *get_net(struct net *net) 166static inline struct net *get_net(struct net *net)
@@ -175,6 +182,8 @@ int net_eq(const struct net *net1, const struct net *net2)
175{ 182{
176 return 1; 183 return 1;
177} 184}
185
186#define net_drop_ns NULL
178#endif 187#endif
179 188
180 189
diff --git a/include/net/netfilter/nf_conntrack.h b/include/net/netfilter/nf_conntrack.h
index c7c42e7acc31..0b7f05e4a927 100644
--- a/include/net/netfilter/nf_conntrack.h
+++ b/include/net/netfilter/nf_conntrack.h
@@ -16,7 +16,7 @@
16 16
17#include <linux/bitops.h> 17#include <linux/bitops.h>
18#include <linux/compiler.h> 18#include <linux/compiler.h>
19#include <asm/atomic.h> 19#include <linux/atomic.h>
20 20
21#include <linux/netfilter/nf_conntrack_tcp.h> 21#include <linux/netfilter/nf_conntrack_tcp.h>
22#include <linux/netfilter/nf_conntrack_dccp.h> 22#include <linux/netfilter/nf_conntrack_dccp.h>
@@ -307,6 +307,12 @@ static inline int nf_ct_is_untracked(const struct nf_conn *ct)
307 return test_bit(IPS_UNTRACKED_BIT, &ct->status); 307 return test_bit(IPS_UNTRACKED_BIT, &ct->status);
308} 308}
309 309
310/* Packet is received from loopback */
311static inline bool nf_is_loopback_packet(const struct sk_buff *skb)
312{
313 return skb->dev && skb->skb_iif && skb->dev->flags & IFF_LOOPBACK;
314}
315
310extern int nf_conntrack_set_hashsize(const char *val, struct kernel_param *kp); 316extern int nf_conntrack_set_hashsize(const char *val, struct kernel_param *kp);
311extern unsigned int nf_conntrack_htable_size; 317extern unsigned int nf_conntrack_htable_size;
312extern unsigned int nf_conntrack_max; 318extern unsigned int nf_conntrack_max;
diff --git a/include/net/netlabel.h b/include/net/netlabel.h
index 9db401a8b4d9..f67440970d7e 100644
--- a/include/net/netlabel.h
+++ b/include/net/netlabel.h
@@ -4,7 +4,7 @@
4 * The NetLabel system manages static and dynamic label mappings for network 4 * The NetLabel system manages static and dynamic label mappings for network
5 * protocols such as CIPSO and RIPSO. 5 * protocols such as CIPSO and RIPSO.
6 * 6 *
7 * Author: Paul Moore <paul.moore@hp.com> 7 * Author: Paul Moore <paul@paul-moore.com>
8 * 8 *
9 */ 9 */
10 10
@@ -38,7 +38,7 @@
38#include <linux/in6.h> 38#include <linux/in6.h>
39#include <net/netlink.h> 39#include <net/netlink.h>
40#include <net/request_sock.h> 40#include <net/request_sock.h>
41#include <asm/atomic.h> 41#include <linux/atomic.h>
42 42
43struct cipso_v4_doi; 43struct cipso_v4_doi;
44 44
diff --git a/include/net/netlink.h b/include/net/netlink.h
index 02740a94f108..98c185441bee 100644
--- a/include/net/netlink.h
+++ b/include/net/netlink.h
@@ -638,6 +638,30 @@ static inline int nlmsg_unicast(struct sock *sk, struct sk_buff *skb, u32 pid)
638 nlmsg_ok(pos, rem); \ 638 nlmsg_ok(pos, rem); \
639 pos = nlmsg_next(pos, &(rem))) 639 pos = nlmsg_next(pos, &(rem)))
640 640
641/**
642 * nl_dump_check_consistent - check if sequence is consistent and advertise if not
643 * @cb: netlink callback structure that stores the sequence number
644 * @nlh: netlink message header to write the flag to
645 *
646 * This function checks if the sequence (generation) number changed during dump
647 * and if it did, advertises it in the netlink message header.
648 *
649 * The correct way to use it is to set cb->seq to the generation counter when
650 * all locks for dumping have been acquired, and then call this function for
651 * each message that is generated.
652 *
653 * Note that due to initialisation concerns, 0 is an invalid sequence number
654 * and must not be used by code that uses this functionality.
655 */
656static inline void
657nl_dump_check_consistent(struct netlink_callback *cb,
658 struct nlmsghdr *nlh)
659{
660 if (cb->prev_seq && cb->seq != cb->prev_seq)
661 nlh->nlmsg_flags |= NLM_F_DUMP_INTR;
662 cb->prev_seq = cb->seq;
663}
664
641/************************************************************************** 665/**************************************************************************
642 * Netlink Attributes 666 * Netlink Attributes
643 **************************************************************************/ 667 **************************************************************************/
diff --git a/include/net/netns/conntrack.h b/include/net/netns/conntrack.h
index 341eb089349e..0249399e51a7 100644
--- a/include/net/netns/conntrack.h
+++ b/include/net/netns/conntrack.h
@@ -3,7 +3,7 @@
3 3
4#include <linux/list.h> 4#include <linux/list.h>
5#include <linux/list_nulls.h> 5#include <linux/list_nulls.h>
6#include <asm/atomic.h> 6#include <linux/atomic.h>
7 7
8struct ctl_table_header; 8struct ctl_table_header;
9struct nf_conntrack_ecache; 9struct nf_conntrack_ecache;
diff --git a/include/net/nfc.h b/include/net/nfc.h
new file mode 100644
index 000000000000..cc0130312f70
--- /dev/null
+++ b/include/net/nfc.h
@@ -0,0 +1,156 @@
1/*
2 * Copyright (C) 2011 Instituto Nokia de Tecnologia
3 *
4 * Authors:
5 * Lauro Ramos Venancio <lauro.venancio@openbossa.org>
6 * Aloisio Almeida Jr <aloisio.almeida@openbossa.org>
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the
20 * Free Software Foundation, Inc.,
21 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
22 */
23
24#ifndef __NET_NFC_H
25#define __NET_NFC_H
26
27#include <linux/device.h>
28#include <linux/skbuff.h>
29
30#define nfc_dev_info(dev, fmt, arg...) dev_info((dev), "NFC: " fmt "\n", ## arg)
31#define nfc_dev_err(dev, fmt, arg...) dev_err((dev), "NFC: " fmt "\n", ## arg)
32#define nfc_dev_dbg(dev, fmt, arg...) dev_dbg((dev), fmt "\n", ## arg)
33
34struct nfc_dev;
35
36/**
37 * data_exchange_cb_t - Definition of nfc_data_exchange callback
38 *
39 * @context: nfc_data_exchange cb_context parameter
40 * @skb: response data
41 * @err: If an error has occurred during data exchange, it is the
42 * error number. Zero means no error.
43 *
44 * When a rx or tx package is lost or corrupted or the target gets out
45 * of the operating field, err is -EIO.
46 */
47typedef void (*data_exchange_cb_t)(void *context, struct sk_buff *skb,
48 int err);
49
50struct nfc_ops {
51 int (*start_poll)(struct nfc_dev *dev, u32 protocols);
52 void (*stop_poll)(struct nfc_dev *dev);
53 int (*activate_target)(struct nfc_dev *dev, u32 target_idx,
54 u32 protocol);
55 void (*deactivate_target)(struct nfc_dev *dev, u32 target_idx);
56 int (*data_exchange)(struct nfc_dev *dev, u32 target_idx,
57 struct sk_buff *skb, data_exchange_cb_t cb,
58 void *cb_context);
59};
60
61struct nfc_target {
62 u32 idx;
63 u32 supported_protocols;
64 u16 sens_res;
65 u8 sel_res;
66};
67
68struct nfc_genl_data {
69 u32 poll_req_pid;
70 struct mutex genl_data_mutex;
71};
72
73struct nfc_dev {
74 unsigned idx;
75 unsigned target_idx;
76 struct nfc_target *targets;
77 int n_targets;
78 int targets_generation;
79 spinlock_t targets_lock;
80 struct device dev;
81 bool polling;
82 struct nfc_genl_data genl_data;
83 u32 supported_protocols;
84
85 struct nfc_ops *ops;
86};
87#define to_nfc_dev(_dev) container_of(_dev, struct nfc_dev, dev)
88
89extern struct class nfc_class;
90
91struct nfc_dev *nfc_allocate_device(struct nfc_ops *ops,
92 u32 supported_protocols);
93
94/**
95 * nfc_free_device - free nfc device
96 *
97 * @dev: The nfc device to free
98 */
99static inline void nfc_free_device(struct nfc_dev *dev)
100{
101 put_device(&dev->dev);
102}
103
104int nfc_register_device(struct nfc_dev *dev);
105
106void nfc_unregister_device(struct nfc_dev *dev);
107
108/**
109 * nfc_set_parent_dev - set the parent device
110 *
111 * @nfc_dev: The nfc device whose parent is being set
112 * @dev: The parent device
113 */
114static inline void nfc_set_parent_dev(struct nfc_dev *nfc_dev,
115 struct device *dev)
116{
117 nfc_dev->dev.parent = dev;
118}
119
120/**
121 * nfc_set_drvdata - set driver specifc data
122 *
123 * @dev: The nfc device
124 * @data: Pointer to driver specifc data
125 */
126static inline void nfc_set_drvdata(struct nfc_dev *dev, void *data)
127{
128 dev_set_drvdata(&dev->dev, data);
129}
130
131/**
132 * nfc_get_drvdata - get driver specifc data
133 *
134 * @dev: The nfc device
135 */
136static inline void *nfc_get_drvdata(struct nfc_dev *dev)
137{
138 return dev_get_drvdata(&dev->dev);
139}
140
141/**
142 * nfc_device_name - get the nfc device name
143 *
144 * @dev: The nfc device whose name to return
145 */
146static inline const char *nfc_device_name(struct nfc_dev *dev)
147{
148 return dev_name(&dev->dev);
149}
150
151struct sk_buff *nfc_alloc_skb(unsigned int size, gfp_t gfp);
152
153int nfc_targets_found(struct nfc_dev *dev, struct nfc_target *targets,
154 int ntargets);
155
156#endif /* __NET_NFC_H */
diff --git a/include/net/pkt_sched.h b/include/net/pkt_sched.h
index 65afc4966204..fffdc603f4c8 100644
--- a/include/net/pkt_sched.h
+++ b/include/net/pkt_sched.h
@@ -99,9 +99,9 @@ static inline void qdisc_run(struct Qdisc *q)
99 __qdisc_run(q); 99 __qdisc_run(q);
100} 100}
101 101
102extern int tc_classify_compat(struct sk_buff *skb, struct tcf_proto *tp, 102extern int tc_classify_compat(struct sk_buff *skb, const struct tcf_proto *tp,
103 struct tcf_result *res); 103 struct tcf_result *res);
104extern int tc_classify(struct sk_buff *skb, struct tcf_proto *tp, 104extern int tc_classify(struct sk_buff *skb, const struct tcf_proto *tp,
105 struct tcf_result *res); 105 struct tcf_result *res);
106 106
107/* Calculate maximal size of packet seen by hard_start_xmit 107/* Calculate maximal size of packet seen by hard_start_xmit
diff --git a/include/net/rtnetlink.h b/include/net/rtnetlink.h
index 4093ca78cf60..678f1ffaf843 100644
--- a/include/net/rtnetlink.h
+++ b/include/net/rtnetlink.h
@@ -6,11 +6,14 @@
6 6
7typedef int (*rtnl_doit_func)(struct sk_buff *, struct nlmsghdr *, void *); 7typedef int (*rtnl_doit_func)(struct sk_buff *, struct nlmsghdr *, void *);
8typedef int (*rtnl_dumpit_func)(struct sk_buff *, struct netlink_callback *); 8typedef int (*rtnl_dumpit_func)(struct sk_buff *, struct netlink_callback *);
9typedef u16 (*rtnl_calcit_func)(struct sk_buff *);
9 10
10extern int __rtnl_register(int protocol, int msgtype, 11extern int __rtnl_register(int protocol, int msgtype,
11 rtnl_doit_func, rtnl_dumpit_func); 12 rtnl_doit_func, rtnl_dumpit_func,
13 rtnl_calcit_func);
12extern void rtnl_register(int protocol, int msgtype, 14extern void rtnl_register(int protocol, int msgtype,
13 rtnl_doit_func, rtnl_dumpit_func); 15 rtnl_doit_func, rtnl_dumpit_func,
16 rtnl_calcit_func);
14extern int rtnl_unregister(int protocol, int msgtype); 17extern int rtnl_unregister(int protocol, int msgtype);
15extern void rtnl_unregister_all(int protocol); 18extern void rtnl_unregister_all(int protocol);
16 19
diff --git a/include/net/sch_generic.h b/include/net/sch_generic.h
index b931f021d7ab..4fc88f3ccd5f 100644
--- a/include/net/sch_generic.h
+++ b/include/net/sch_generic.h
@@ -181,8 +181,9 @@ struct tcf_proto_ops {
181 struct tcf_proto_ops *next; 181 struct tcf_proto_ops *next;
182 char kind[IFNAMSIZ]; 182 char kind[IFNAMSIZ];
183 183
184 int (*classify)(struct sk_buff*, struct tcf_proto*, 184 int (*classify)(struct sk_buff *,
185 struct tcf_result *); 185 const struct tcf_proto *,
186 struct tcf_result *);
186 int (*init)(struct tcf_proto*); 187 int (*init)(struct tcf_proto*);
187 void (*destroy)(struct tcf_proto*); 188 void (*destroy)(struct tcf_proto*);
188 189
@@ -205,8 +206,9 @@ struct tcf_proto {
205 /* Fast access part */ 206 /* Fast access part */
206 struct tcf_proto *next; 207 struct tcf_proto *next;
207 void *root; 208 void *root;
208 int (*classify)(struct sk_buff*, struct tcf_proto*, 209 int (*classify)(struct sk_buff *,
209 struct tcf_result *); 210 const struct tcf_proto *,
211 struct tcf_result *);
210 __be16 protocol; 212 __be16 protocol;
211 213
212 /* All the rest */ 214 /* All the rest */
@@ -214,7 +216,7 @@ struct tcf_proto {
214 u32 classid; 216 u32 classid;
215 struct Qdisc *q; 217 struct Qdisc *q;
216 void *data; 218 void *data;
217 struct tcf_proto_ops *ops; 219 const struct tcf_proto_ops *ops;
218}; 220};
219 221
220struct qdisc_skb_cb { 222struct qdisc_skb_cb {
diff --git a/include/net/sctp/command.h b/include/net/sctp/command.h
index 2b447646ce4b..6506458ccd33 100644
--- a/include/net/sctp/command.h
+++ b/include/net/sctp/command.h
@@ -63,6 +63,7 @@ typedef enum {
63 SCTP_CMD_ECN_ECNE, /* Do delayed ECNE processing. */ 63 SCTP_CMD_ECN_ECNE, /* Do delayed ECNE processing. */
64 SCTP_CMD_ECN_CWR, /* Do delayed CWR processing. */ 64 SCTP_CMD_ECN_CWR, /* Do delayed CWR processing. */
65 SCTP_CMD_TIMER_START, /* Start a timer. */ 65 SCTP_CMD_TIMER_START, /* Start a timer. */
66 SCTP_CMD_TIMER_START_ONCE, /* Start a timer once */
66 SCTP_CMD_TIMER_RESTART, /* Restart a timer. */ 67 SCTP_CMD_TIMER_RESTART, /* Restart a timer. */
67 SCTP_CMD_TIMER_STOP, /* Stop a timer. */ 68 SCTP_CMD_TIMER_STOP, /* Stop a timer. */
68 SCTP_CMD_INIT_CHOOSE_TRANSPORT, /* Choose transport for an INIT. */ 69 SCTP_CMD_INIT_CHOOSE_TRANSPORT, /* Choose transport for an INIT. */
@@ -107,6 +108,7 @@ typedef enum {
107 SCTP_CMD_UPDATE_INITTAG, /* Update peer inittag */ 108 SCTP_CMD_UPDATE_INITTAG, /* Update peer inittag */
108 SCTP_CMD_SEND_MSG, /* Send the whole use message */ 109 SCTP_CMD_SEND_MSG, /* Send the whole use message */
109 SCTP_CMD_SEND_NEXT_ASCONF, /* Send the next ASCONF after ACK */ 110 SCTP_CMD_SEND_NEXT_ASCONF, /* Send the next ASCONF after ACK */
111 SCTP_CMD_PURGE_ASCONF_QUEUE, /* Purge all asconf queues.*/
110 SCTP_CMD_LAST 112 SCTP_CMD_LAST
111} sctp_verb_t; 113} sctp_verb_t;
112 114
diff --git a/include/net/sctp/sctp.h b/include/net/sctp/sctp.h
index b2c2366676a7..6a72a58cde59 100644
--- a/include/net/sctp/sctp.h
+++ b/include/net/sctp/sctp.h
@@ -120,6 +120,7 @@ extern int sctp_copy_local_addr_list(struct sctp_bind_addr *,
120 int flags); 120 int flags);
121extern struct sctp_pf *sctp_get_pf_specific(sa_family_t family); 121extern struct sctp_pf *sctp_get_pf_specific(sa_family_t family);
122extern int sctp_register_pf(struct sctp_pf *, sa_family_t); 122extern int sctp_register_pf(struct sctp_pf *, sa_family_t);
123extern void sctp_addr_wq_mgmt(struct sctp_sockaddr_entry *, int);
123 124
124/* 125/*
125 * sctp/socket.c 126 * sctp/socket.c
@@ -134,6 +135,7 @@ void sctp_sock_rfree(struct sk_buff *skb);
134void sctp_copy_sock(struct sock *newsk, struct sock *sk, 135void sctp_copy_sock(struct sock *newsk, struct sock *sk,
135 struct sctp_association *asoc); 136 struct sctp_association *asoc);
136extern struct percpu_counter sctp_sockets_allocated; 137extern struct percpu_counter sctp_sockets_allocated;
138extern int sctp_asconf_mgmt(struct sctp_sock *, struct sctp_sockaddr_entry *);
137 139
138/* 140/*
139 * sctp/primitive.c 141 * sctp/primitive.c
@@ -285,20 +287,21 @@ do { \
285 pr_cont(fmt, ##args); \ 287 pr_cont(fmt, ##args); \
286} while (0) 288} while (0)
287#define SCTP_DEBUG_PRINTK_IPADDR(fmt_lead, fmt_trail, \ 289#define SCTP_DEBUG_PRINTK_IPADDR(fmt_lead, fmt_trail, \
288 args_lead, saddr, args_trail...) \ 290 args_lead, addr, args_trail...) \
289do { \ 291do { \
292 const union sctp_addr *_addr = (addr); \
290 if (sctp_debug_flag) { \ 293 if (sctp_debug_flag) { \
291 if (saddr->sa.sa_family == AF_INET6) { \ 294 if (_addr->sa.sa_family == AF_INET6) { \
292 printk(KERN_DEBUG \ 295 printk(KERN_DEBUG \
293 pr_fmt(fmt_lead "%pI6" fmt_trail), \ 296 pr_fmt(fmt_lead "%pI6" fmt_trail), \
294 args_lead, \ 297 args_lead, \
295 &saddr->v6.sin6_addr, \ 298 &_addr->v6.sin6_addr, \
296 args_trail); \ 299 args_trail); \
297 } else { \ 300 } else { \
298 printk(KERN_DEBUG \ 301 printk(KERN_DEBUG \
299 pr_fmt(fmt_lead "%pI4" fmt_trail), \ 302 pr_fmt(fmt_lead "%pI4" fmt_trail), \
300 args_lead, \ 303 args_lead, \
301 &saddr->v4.sin_addr.s_addr, \ 304 &_addr->v4.sin_addr.s_addr, \
302 args_trail); \ 305 args_trail); \
303 } \ 306 } \
304 } \ 307 } \
@@ -598,7 +601,7 @@ static inline int ipver2af(__u8 ipver)
598 return AF_INET6; 601 return AF_INET6;
599 default: 602 default:
600 return 0; 603 return 0;
601 }; 604 }
602} 605}
603 606
604/* Convert from an address parameter type to an address family. */ 607/* Convert from an address parameter type to an address family. */
@@ -611,7 +614,7 @@ static inline int param_type2af(__be16 type)
611 return AF_INET6; 614 return AF_INET6;
612 default: 615 default:
613 return 0; 616 return 0;
614 }; 617 }
615} 618}
616 619
617/* Perform some sanity checks. */ 620/* Perform some sanity checks. */
diff --git a/include/net/sctp/structs.h b/include/net/sctp/structs.h
index 795f4886e111..f7d9c3fc06fd 100644
--- a/include/net/sctp/structs.h
+++ b/include/net/sctp/structs.h
@@ -60,7 +60,7 @@
60#include <linux/in6.h> /* We get struct in6_addr */ 60#include <linux/in6.h> /* We get struct in6_addr */
61#include <linux/ipv6.h> 61#include <linux/ipv6.h>
62#include <asm/param.h> /* We get MAXHOSTNAMELEN. */ 62#include <asm/param.h> /* We get MAXHOSTNAMELEN. */
63#include <asm/atomic.h> /* This gets us atomic counters. */ 63#include <linux/atomic.h> /* This gets us atomic counters. */
64#include <linux/skbuff.h> /* We need sk_buff_head. */ 64#include <linux/skbuff.h> /* We need sk_buff_head. */
65#include <linux/workqueue.h> /* We need tq_struct. */ 65#include <linux/workqueue.h> /* We need tq_struct. */
66#include <linux/sctp.h> /* We need sctp* header structs. */ 66#include <linux/sctp.h> /* We need sctp* header structs. */
@@ -205,6 +205,11 @@ extern struct sctp_globals {
205 * It is a list of sctp_sockaddr_entry. 205 * It is a list of sctp_sockaddr_entry.
206 */ 206 */
207 struct list_head local_addr_list; 207 struct list_head local_addr_list;
208 int default_auto_asconf;
209 struct list_head addr_waitq;
210 struct timer_list addr_wq_timer;
211 struct list_head auto_asconf_splist;
212 spinlock_t addr_wq_lock;
208 213
209 /* Lock that protects the local_addr_list writers */ 214 /* Lock that protects the local_addr_list writers */
210 spinlock_t addr_list_lock; 215 spinlock_t addr_list_lock;
@@ -264,6 +269,11 @@ extern struct sctp_globals {
264#define sctp_port_hashtable (sctp_globals.port_hashtable) 269#define sctp_port_hashtable (sctp_globals.port_hashtable)
265#define sctp_local_addr_list (sctp_globals.local_addr_list) 270#define sctp_local_addr_list (sctp_globals.local_addr_list)
266#define sctp_local_addr_lock (sctp_globals.addr_list_lock) 271#define sctp_local_addr_lock (sctp_globals.addr_list_lock)
272#define sctp_auto_asconf_splist (sctp_globals.auto_asconf_splist)
273#define sctp_addr_waitq (sctp_globals.addr_waitq)
274#define sctp_addr_wq_timer (sctp_globals.addr_wq_timer)
275#define sctp_addr_wq_lock (sctp_globals.addr_wq_lock)
276#define sctp_default_auto_asconf (sctp_globals.default_auto_asconf)
267#define sctp_scope_policy (sctp_globals.ipv4_scope_policy) 277#define sctp_scope_policy (sctp_globals.ipv4_scope_policy)
268#define sctp_addip_enable (sctp_globals.addip_enable) 278#define sctp_addip_enable (sctp_globals.addip_enable)
269#define sctp_addip_noauth (sctp_globals.addip_noauth_enable) 279#define sctp_addip_noauth (sctp_globals.addip_noauth_enable)
@@ -341,6 +351,8 @@ struct sctp_sock {
341 atomic_t pd_mode; 351 atomic_t pd_mode;
342 /* Receive to here while partial delivery is in effect. */ 352 /* Receive to here while partial delivery is in effect. */
343 struct sk_buff_head pd_lobby; 353 struct sk_buff_head pd_lobby;
354 struct list_head auto_asconf_list;
355 int do_auto_asconf;
344}; 356};
345 357
346static inline struct sctp_sock *sctp_sk(const struct sock *sk) 358static inline struct sctp_sock *sctp_sk(const struct sock *sk)
@@ -792,6 +804,8 @@ struct sctp_sockaddr_entry {
792 __u8 valid; 804 __u8 valid;
793}; 805};
794 806
807#define SCTP_ADDRESS_TICK_DELAY 500
808
795typedef struct sctp_chunk *(sctp_packet_phandler_t)(struct sctp_association *); 809typedef struct sctp_chunk *(sctp_packet_phandler_t)(struct sctp_association *);
796 810
797/* This structure holds lists of chunks as we are assembling for 811/* This structure holds lists of chunks as we are assembling for
@@ -1236,6 +1250,7 @@ sctp_scope_t sctp_scope(const union sctp_addr *);
1236int sctp_in_scope(const union sctp_addr *addr, const sctp_scope_t scope); 1250int sctp_in_scope(const union sctp_addr *addr, const sctp_scope_t scope);
1237int sctp_is_any(struct sock *sk, const union sctp_addr *addr); 1251int sctp_is_any(struct sock *sk, const union sctp_addr *addr);
1238int sctp_addr_is_valid(const union sctp_addr *addr); 1252int sctp_addr_is_valid(const union sctp_addr *addr);
1253int sctp_is_ep_boundall(struct sock *sk);
1239 1254
1240 1255
1241/* What type of endpoint? */ 1256/* What type of endpoint? */
@@ -1898,6 +1913,8 @@ struct sctp_association {
1898 * after reaching 4294967295. 1913 * after reaching 4294967295.
1899 */ 1914 */
1900 __u32 addip_serial; 1915 __u32 addip_serial;
1916 union sctp_addr *asconf_addr_del_pending;
1917 int src_out_of_asoc_ok;
1901 1918
1902 /* SCTP AUTH: list of the endpoint shared keys. These 1919 /* SCTP AUTH: list of the endpoint shared keys. These
1903 * keys are provided out of band by the user applicaton 1920 * keys are provided out of band by the user applicaton
@@ -1993,7 +2010,7 @@ void sctp_assoc_clean_asconf_ack_cache(const struct sctp_association *asoc);
1993struct sctp_chunk *sctp_assoc_lookup_asconf_ack( 2010struct sctp_chunk *sctp_assoc_lookup_asconf_ack(
1994 const struct sctp_association *asoc, 2011 const struct sctp_association *asoc,
1995 __be32 serial); 2012 __be32 serial);
1996 2013void sctp_asconf_queue_teardown(struct sctp_association *asoc);
1997 2014
1998int sctp_cmp_addr_exact(const union sctp_addr *ss1, 2015int sctp_cmp_addr_exact(const union sctp_addr *ss1,
1999 const union sctp_addr *ss2); 2016 const union sctp_addr *ss2);
diff --git a/include/net/sctp/ulpevent.h b/include/net/sctp/ulpevent.h
index 99b027b2adce..ca4693b4e09e 100644
--- a/include/net/sctp/ulpevent.h
+++ b/include/net/sctp/ulpevent.h
@@ -80,7 +80,7 @@ static inline struct sctp_ulpevent *sctp_skb2event(struct sk_buff *skb)
80 80
81void sctp_ulpevent_free(struct sctp_ulpevent *); 81void sctp_ulpevent_free(struct sctp_ulpevent *);
82int sctp_ulpevent_is_notification(const struct sctp_ulpevent *); 82int sctp_ulpevent_is_notification(const struct sctp_ulpevent *);
83void sctp_queue_purge_ulpevents(struct sk_buff_head *list); 83unsigned int sctp_queue_purge_ulpevents(struct sk_buff_head *list);
84 84
85struct sctp_ulpevent *sctp_ulpevent_make_assoc_change( 85struct sctp_ulpevent *sctp_ulpevent_make_assoc_change(
86 const struct sctp_association *asoc, 86 const struct sctp_association *asoc,
diff --git a/include/net/sctp/user.h b/include/net/sctp/user.h
index 32fd51274037..0842ef00b2fe 100644
--- a/include/net/sctp/user.h
+++ b/include/net/sctp/user.h
@@ -92,6 +92,7 @@ typedef __s32 sctp_assoc_t;
92#define SCTP_LOCAL_AUTH_CHUNKS 27 /* Read only */ 92#define SCTP_LOCAL_AUTH_CHUNKS 27 /* Read only */
93#define SCTP_GET_ASSOC_NUMBER 28 /* Read only */ 93#define SCTP_GET_ASSOC_NUMBER 28 /* Read only */
94#define SCTP_GET_ASSOC_ID_LIST 29 /* Read only */ 94#define SCTP_GET_ASSOC_ID_LIST 29 /* Read only */
95#define SCTP_AUTO_ASCONF 30
95 96
96/* Internal Socket Options. Some of the sctp library functions are 97/* Internal Socket Options. Some of the sctp library functions are
97 * implemented using these socket options. 98 * implemented using these socket options.
diff --git a/include/net/secure_seq.h b/include/net/secure_seq.h
new file mode 100644
index 000000000000..d97f6892c019
--- /dev/null
+++ b/include/net/secure_seq.h
@@ -0,0 +1,20 @@
1#ifndef _NET_SECURE_SEQ
2#define _NET_SECURE_SEQ
3
4#include <linux/types.h>
5
6extern __u32 secure_ip_id(__be32 daddr);
7extern __u32 secure_ipv6_id(const __be32 daddr[4]);
8extern u32 secure_ipv4_port_ephemeral(__be32 saddr, __be32 daddr, __be16 dport);
9extern u32 secure_ipv6_port_ephemeral(const __be32 *saddr, const __be32 *daddr,
10 __be16 dport);
11extern __u32 secure_tcp_sequence_number(__be32 saddr, __be32 daddr,
12 __be16 sport, __be16 dport);
13extern __u32 secure_tcpv6_sequence_number(__be32 *saddr, __be32 *daddr,
14 __be16 sport, __be16 dport);
15extern u64 secure_dccp_sequence_number(__be32 saddr, __be32 daddr,
16 __be16 sport, __be16 dport);
17extern u64 secure_dccpv6_sequence_number(__be32 *saddr, __be32 *daddr,
18 __be16 sport, __be16 dport);
19
20#endif /* _NET_SECURE_SEQ */
diff --git a/include/net/snmp.h b/include/net/snmp.h
index 479083a78b0c..8f0f9ac0307f 100644
--- a/include/net/snmp.h
+++ b/include/net/snmp.h
@@ -116,57 +116,51 @@ struct linux_xfrm_mib {
116 unsigned long mibs[LINUX_MIB_XFRMMAX]; 116 unsigned long mibs[LINUX_MIB_XFRMMAX];
117}; 117};
118 118
119/* 119#define SNMP_ARRAY_SZ 1
120 * FIXME: On x86 and some other CPUs the split into user and softirq parts 120
121 * is not needed because addl $1,memory is atomic against interrupts (but
122 * atomic_inc would be overkill because of the lock cycles). Wants new
123 * nonlocked_atomic_inc() primitives -AK
124 */
125#define DEFINE_SNMP_STAT(type, name) \ 121#define DEFINE_SNMP_STAT(type, name) \
126 __typeof__(type) __percpu *name[2] 122 __typeof__(type) __percpu *name[SNMP_ARRAY_SZ]
127#define DEFINE_SNMP_STAT_ATOMIC(type, name) \ 123#define DEFINE_SNMP_STAT_ATOMIC(type, name) \
128 __typeof__(type) *name 124 __typeof__(type) *name
129#define DECLARE_SNMP_STAT(type, name) \ 125#define DECLARE_SNMP_STAT(type, name) \
130 extern __typeof__(type) __percpu *name[2] 126 extern __typeof__(type) __percpu *name[SNMP_ARRAY_SZ]
131
132#define SNMP_STAT_BHPTR(name) (name[0])
133#define SNMP_STAT_USRPTR(name) (name[1])
134 127
135#define SNMP_INC_STATS_BH(mib, field) \ 128#define SNMP_INC_STATS_BH(mib, field) \
136 __this_cpu_inc(mib[0]->mibs[field]) 129 __this_cpu_inc(mib[0]->mibs[field])
130
137#define SNMP_INC_STATS_USER(mib, field) \ 131#define SNMP_INC_STATS_USER(mib, field) \
138 this_cpu_inc(mib[1]->mibs[field]) 132 irqsafe_cpu_inc(mib[0]->mibs[field])
133
139#define SNMP_INC_STATS_ATOMIC_LONG(mib, field) \ 134#define SNMP_INC_STATS_ATOMIC_LONG(mib, field) \
140 atomic_long_inc(&mib->mibs[field]) 135 atomic_long_inc(&mib->mibs[field])
136
141#define SNMP_INC_STATS(mib, field) \ 137#define SNMP_INC_STATS(mib, field) \
142 this_cpu_inc(mib[!in_softirq()]->mibs[field]) 138 irqsafe_cpu_inc(mib[0]->mibs[field])
139
143#define SNMP_DEC_STATS(mib, field) \ 140#define SNMP_DEC_STATS(mib, field) \
144 this_cpu_dec(mib[!in_softirq()]->mibs[field]) 141 irqsafe_cpu_dec(mib[0]->mibs[field])
142
145#define SNMP_ADD_STATS_BH(mib, field, addend) \ 143#define SNMP_ADD_STATS_BH(mib, field, addend) \
146 __this_cpu_add(mib[0]->mibs[field], addend) 144 __this_cpu_add(mib[0]->mibs[field], addend)
145
147#define SNMP_ADD_STATS_USER(mib, field, addend) \ 146#define SNMP_ADD_STATS_USER(mib, field, addend) \
148 this_cpu_add(mib[1]->mibs[field], addend) 147 irqsafe_cpu_add(mib[0]->mibs[field], addend)
148
149#define SNMP_ADD_STATS(mib, field, addend) \ 149#define SNMP_ADD_STATS(mib, field, addend) \
150 this_cpu_add(mib[!in_softirq()]->mibs[field], addend) 150 irqsafe_cpu_add(mib[0]->mibs[field], addend)
151/* 151/*
152 * Use "__typeof__(*mib[0]) *ptr" instead of "__typeof__(mib[0]) ptr" 152 * Use "__typeof__(*mib[0]) *ptr" instead of "__typeof__(mib[0]) ptr"
153 * to make @ptr a non-percpu pointer. 153 * to make @ptr a non-percpu pointer.
154 */ 154 */
155#define SNMP_UPD_PO_STATS(mib, basefield, addend) \ 155#define SNMP_UPD_PO_STATS(mib, basefield, addend) \
156 do { \ 156 do { \
157 __typeof__(*mib[0]) *ptr; \ 157 irqsafe_cpu_inc(mib[0]->mibs[basefield##PKTS]); \
158 preempt_disable(); \ 158 irqsafe_cpu_add(mib[0]->mibs[basefield##OCTETS], addend); \
159 ptr = this_cpu_ptr((mib)[!in_softirq()]); \
160 ptr->mibs[basefield##PKTS]++; \
161 ptr->mibs[basefield##OCTETS] += addend;\
162 preempt_enable(); \
163 } while (0) 159 } while (0)
164#define SNMP_UPD_PO_STATS_BH(mib, basefield, addend) \ 160#define SNMP_UPD_PO_STATS_BH(mib, basefield, addend) \
165 do { \ 161 do { \
166 __typeof__(*mib[0]) *ptr = \ 162 __this_cpu_inc(mib[0]->mibs[basefield##PKTS]); \
167 __this_cpu_ptr((mib)[0]); \ 163 __this_cpu_add(mib[0]->mibs[basefield##OCTETS], addend); \
168 ptr->mibs[basefield##PKTS]++; \
169 ptr->mibs[basefield##OCTETS] += addend;\
170 } while (0) 164 } while (0)
171 165
172 166
@@ -179,40 +173,20 @@ struct linux_xfrm_mib {
179 ptr->mibs[field] += addend; \ 173 ptr->mibs[field] += addend; \
180 u64_stats_update_end(&ptr->syncp); \ 174 u64_stats_update_end(&ptr->syncp); \
181 } while (0) 175 } while (0)
176
182#define SNMP_ADD_STATS64_USER(mib, field, addend) \ 177#define SNMP_ADD_STATS64_USER(mib, field, addend) \
183 do { \ 178 do { \
184 __typeof__(*mib[0]) *ptr; \ 179 local_bh_disable(); \
185 preempt_disable(); \ 180 SNMP_ADD_STATS64_BH(mib, field, addend); \
186 ptr = __this_cpu_ptr((mib)[1]); \ 181 local_bh_enable(); \
187 u64_stats_update_begin(&ptr->syncp); \
188 ptr->mibs[field] += addend; \
189 u64_stats_update_end(&ptr->syncp); \
190 preempt_enable(); \
191 } while (0) 182 } while (0)
183
192#define SNMP_ADD_STATS64(mib, field, addend) \ 184#define SNMP_ADD_STATS64(mib, field, addend) \
193 do { \ 185 SNMP_ADD_STATS64_USER(mib, field, addend)
194 __typeof__(*mib[0]) *ptr; \ 186
195 preempt_disable(); \
196 ptr = __this_cpu_ptr((mib)[!in_softirq()]); \
197 u64_stats_update_begin(&ptr->syncp); \
198 ptr->mibs[field] += addend; \
199 u64_stats_update_end(&ptr->syncp); \
200 preempt_enable(); \
201 } while (0)
202#define SNMP_INC_STATS64_BH(mib, field) SNMP_ADD_STATS64_BH(mib, field, 1) 187#define SNMP_INC_STATS64_BH(mib, field) SNMP_ADD_STATS64_BH(mib, field, 1)
203#define SNMP_INC_STATS64_USER(mib, field) SNMP_ADD_STATS64_USER(mib, field, 1) 188#define SNMP_INC_STATS64_USER(mib, field) SNMP_ADD_STATS64_USER(mib, field, 1)
204#define SNMP_INC_STATS64(mib, field) SNMP_ADD_STATS64(mib, field, 1) 189#define SNMP_INC_STATS64(mib, field) SNMP_ADD_STATS64(mib, field, 1)
205#define SNMP_UPD_PO_STATS64(mib, basefield, addend) \
206 do { \
207 __typeof__(*mib[0]) *ptr; \
208 preempt_disable(); \
209 ptr = __this_cpu_ptr((mib)[!in_softirq()]); \
210 u64_stats_update_begin(&ptr->syncp); \
211 ptr->mibs[basefield##PKTS]++; \
212 ptr->mibs[basefield##OCTETS] += addend; \
213 u64_stats_update_end(&ptr->syncp); \
214 preempt_enable(); \
215 } while (0)
216#define SNMP_UPD_PO_STATS64_BH(mib, basefield, addend) \ 190#define SNMP_UPD_PO_STATS64_BH(mib, basefield, addend) \
217 do { \ 191 do { \
218 __typeof__(*mib[0]) *ptr; \ 192 __typeof__(*mib[0]) *ptr; \
@@ -222,6 +196,12 @@ struct linux_xfrm_mib {
222 ptr->mibs[basefield##OCTETS] += addend; \ 196 ptr->mibs[basefield##OCTETS] += addend; \
223 u64_stats_update_end(&ptr->syncp); \ 197 u64_stats_update_end(&ptr->syncp); \
224 } while (0) 198 } while (0)
199#define SNMP_UPD_PO_STATS64(mib, basefield, addend) \
200 do { \
201 local_bh_disable(); \
202 SNMP_UPD_PO_STATS64_BH(mib, basefield, addend); \
203 local_bh_enable(); \
204 } while (0)
225#else 205#else
226#define SNMP_INC_STATS64_BH(mib, field) SNMP_INC_STATS_BH(mib, field) 206#define SNMP_INC_STATS64_BH(mib, field) SNMP_INC_STATS_BH(mib, field)
227#define SNMP_INC_STATS64_USER(mib, field) SNMP_INC_STATS_USER(mib, field) 207#define SNMP_INC_STATS64_USER(mib, field) SNMP_INC_STATS_USER(mib, field)
diff --git a/include/net/sock.h b/include/net/sock.h
index f2046e404a61..8e4062f165b8 100644
--- a/include/net/sock.h
+++ b/include/net/sock.h
@@ -40,6 +40,7 @@
40#ifndef _SOCK_H 40#ifndef _SOCK_H
41#define _SOCK_H 41#define _SOCK_H
42 42
43#include <linux/hardirq.h>
43#include <linux/kernel.h> 44#include <linux/kernel.h>
44#include <linux/list.h> 45#include <linux/list.h>
45#include <linux/list_nulls.h> 46#include <linux/list_nulls.h>
@@ -178,7 +179,6 @@ struct sock_common {
178 * @sk_dst_cache: destination cache 179 * @sk_dst_cache: destination cache
179 * @sk_dst_lock: destination cache lock 180 * @sk_dst_lock: destination cache lock
180 * @sk_policy: flow policy 181 * @sk_policy: flow policy
181 * @sk_rmem_alloc: receive queue bytes committed
182 * @sk_receive_queue: incoming packets 182 * @sk_receive_queue: incoming packets
183 * @sk_wmem_alloc: transmit queue bytes committed 183 * @sk_wmem_alloc: transmit queue bytes committed
184 * @sk_write_queue: Packet sending queue 184 * @sk_write_queue: Packet sending queue
@@ -563,6 +563,7 @@ enum sock_flags {
563 SOCK_TIMESTAMPING_SYS_HARDWARE, /* %SOF_TIMESTAMPING_SYS_HARDWARE */ 563 SOCK_TIMESTAMPING_SYS_HARDWARE, /* %SOF_TIMESTAMPING_SYS_HARDWARE */
564 SOCK_FASYNC, /* fasync() active */ 564 SOCK_FASYNC, /* fasync() active */
565 SOCK_RXQ_OVFL, 565 SOCK_RXQ_OVFL,
566 SOCK_ZEROCOPY, /* buffers from userspace */
566}; 567};
567 568
568static inline void sock_copy_flags(struct sock *nsk, struct sock *osk) 569static inline void sock_copy_flags(struct sock *nsk, struct sock *osk)
@@ -1302,8 +1303,7 @@ extern unsigned long sock_i_ino(struct sock *sk);
1302static inline struct dst_entry * 1303static inline struct dst_entry *
1303__sk_dst_get(struct sock *sk) 1304__sk_dst_get(struct sock *sk)
1304{ 1305{
1305 return rcu_dereference_check(sk->sk_dst_cache, rcu_read_lock_held() || 1306 return rcu_dereference_check(sk->sk_dst_cache, sock_owned_by_user(sk) ||
1306 sock_owned_by_user(sk) ||
1307 lockdep_is_held(&sk->sk_lock.slock)); 1307 lockdep_is_held(&sk->sk_lock.slock));
1308} 1308}
1309 1309
diff --git a/include/net/tcp.h b/include/net/tcp.h
index cda30ea354a2..149a415d1e0a 100644
--- a/include/net/tcp.h
+++ b/include/net/tcp.h
@@ -122,7 +122,13 @@ extern void tcp_time_wait(struct sock *sk, int state, int timeo);
122#endif 122#endif
123#define TCP_RTO_MAX ((unsigned)(120*HZ)) 123#define TCP_RTO_MAX ((unsigned)(120*HZ))
124#define TCP_RTO_MIN ((unsigned)(HZ/5)) 124#define TCP_RTO_MIN ((unsigned)(HZ/5))
125#define TCP_TIMEOUT_INIT ((unsigned)(3*HZ)) /* RFC 1122 initial RTO value */ 125#define TCP_TIMEOUT_INIT ((unsigned)(1*HZ)) /* RFC2988bis initial RTO value */
126#define TCP_TIMEOUT_FALLBACK ((unsigned)(3*HZ)) /* RFC 1122 initial RTO value, now
127 * used as a fallback RTO for the
128 * initial data transmission if no
129 * valid RTT sample has been acquired,
130 * most likely due to retrans in 3WHS.
131 */
126 132
127#define TCP_RESOURCE_PROBE_INTERVAL ((unsigned)(HZ/2U)) /* Maximal interval between probes 133#define TCP_RESOURCE_PROBE_INTERVAL ((unsigned)(HZ/2U)) /* Maximal interval between probes
128 * for local resources. 134 * for local resources.
@@ -295,7 +301,7 @@ static inline void tcp_synq_overflow(struct sock *sk)
295static inline int tcp_synq_no_recent_overflow(const struct sock *sk) 301static inline int tcp_synq_no_recent_overflow(const struct sock *sk)
296{ 302{
297 unsigned long last_overflow = tcp_sk(sk)->rx_opt.ts_recent_stamp; 303 unsigned long last_overflow = tcp_sk(sk)->rx_opt.ts_recent_stamp;
298 return time_after(jiffies, last_overflow + TCP_TIMEOUT_INIT); 304 return time_after(jiffies, last_overflow + TCP_TIMEOUT_FALLBACK);
299} 305}
300 306
301extern struct proto tcp_prot; 307extern struct proto tcp_prot;
@@ -508,6 +514,7 @@ extern void tcp_initialize_rcv_mss(struct sock *sk);
508extern int tcp_mtu_to_mss(struct sock *sk, int pmtu); 514extern int tcp_mtu_to_mss(struct sock *sk, int pmtu);
509extern int tcp_mss_to_mtu(struct sock *sk, int mss); 515extern int tcp_mss_to_mtu(struct sock *sk, int mss);
510extern void tcp_mtup_init(struct sock *sk); 516extern void tcp_mtup_init(struct sock *sk);
517extern void tcp_valid_rtt_meas(struct sock *sk, u32 seq_rtt);
511 518
512static inline void tcp_bound_rto(const struct sock *sk) 519static inline void tcp_bound_rto(const struct sock *sk)
513{ 520{
diff --git a/include/net/wimax.h b/include/net/wimax.h
index 7328d5019d88..322ff4fbdb4a 100644
--- a/include/net/wimax.h
+++ b/include/net/wimax.h
@@ -423,7 +423,6 @@ struct wimax_dev {
423 int (*op_reset)(struct wimax_dev *wimax_dev); 423 int (*op_reset)(struct wimax_dev *wimax_dev);
424 424
425 struct rfkill *rfkill; 425 struct rfkill *rfkill;
426 struct input_dev *rfkill_input;
427 unsigned rf_hw; 426 unsigned rf_hw;
428 unsigned rf_sw; 427 unsigned rf_sw;
429 char name[32]; 428 char name[32];
diff --git a/include/pcmcia/device_id.h b/include/pcmcia/device_id.h
index 63e5b8f6b7dd..00dbfac9c6e1 100644
--- a/include/pcmcia/device_id.h
+++ b/include/pcmcia/device_id.h
@@ -95,6 +95,15 @@
95 .prod_id = { (v1), NULL, NULL, NULL }, \ 95 .prod_id = { (v1), NULL, NULL, NULL }, \
96 .prod_id_hash = { (vh1), 0, 0, 0 }, } 96 .prod_id_hash = { (vh1), 0, 0, 0 }, }
97 97
98#define PCMCIA_DEVICE_MANF_CARD_PROD_ID3(manf, card, v3, vh3) { \
99 .match_flags = PCMCIA_DEV_ID_MATCH_MANF_ID| \
100 PCMCIA_DEV_ID_MATCH_CARD_ID| \
101 PCMCIA_DEV_ID_MATCH_PROD_ID3, \
102 .manf_id = (manf), \
103 .card_id = (card), \
104 .prod_id = { NULL, NULL, (v3), NULL }, \
105 .prod_id_hash = { 0, 0, (vh3), 0 }, }
106
98 107
99/* multi-function devices */ 108/* multi-function devices */
100 109
diff --git a/include/pcmcia/ds.h b/include/pcmcia/ds.h
index 7b82080eb02c..3bbbd78e1439 100644
--- a/include/pcmcia/ds.h
+++ b/include/pcmcia/ds.h
@@ -26,7 +26,7 @@
26#include <linux/device.h> 26#include <linux/device.h>
27#include <linux/interrupt.h> 27#include <linux/interrupt.h>
28#include <pcmcia/ss.h> 28#include <pcmcia/ss.h>
29#include <asm/atomic.h> 29#include <linux/atomic.h>
30 30
31 31
32/* 32/*
diff --git a/include/rdma/ib_pma.h b/include/rdma/ib_pma.h
new file mode 100644
index 000000000000..a5889f18807b
--- /dev/null
+++ b/include/rdma/ib_pma.h
@@ -0,0 +1,156 @@
1/*
2 * Copyright (c) 2006, 2007, 2008, 2009, 2010 QLogic Corporation.
3 * All rights reserved.
4 * Copyright (c) 2005, 2006 PathScale, Inc. All rights reserved.
5 *
6 * This software is available to you under a choice of one of two
7 * licenses. You may choose to be licensed under the terms of the GNU
8 * General Public License (GPL) Version 2, available from the file
9 * COPYING in the main directory of this source tree, or the
10 * OpenIB.org BSD license below:
11 *
12 * Redistribution and use in source and binary forms, with or
13 * without modification, are permitted provided that the following
14 * conditions are met:
15 *
16 * - Redistributions of source code must retain the above
17 * copyright notice, this list of conditions and the following
18 * disclaimer.
19 *
20 * - Redistributions in binary form must reproduce the above
21 * copyright notice, this list of conditions and the following
22 * disclaimer in the documentation and/or other materials
23 * provided with the distribution.
24 *
25 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
26 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
27 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
28 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
29 * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
30 * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
31 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
32 * SOFTWARE.
33 */
34
35#if !defined(IB_PMA_H)
36#define IB_PMA_H
37
38#include <rdma/ib_mad.h>
39
40/*
41 * PMA class portinfo capability mask bits
42 */
43#define IB_PMA_CLASS_CAP_ALLPORTSELECT cpu_to_be16(1 << 8)
44#define IB_PMA_CLASS_CAP_EXT_WIDTH cpu_to_be16(1 << 9)
45#define IB_PMA_CLASS_CAP_XMIT_WAIT cpu_to_be16(1 << 12)
46
47#define IB_PMA_CLASS_PORT_INFO cpu_to_be16(0x0001)
48#define IB_PMA_PORT_SAMPLES_CONTROL cpu_to_be16(0x0010)
49#define IB_PMA_PORT_SAMPLES_RESULT cpu_to_be16(0x0011)
50#define IB_PMA_PORT_COUNTERS cpu_to_be16(0x0012)
51#define IB_PMA_PORT_COUNTERS_EXT cpu_to_be16(0x001D)
52#define IB_PMA_PORT_SAMPLES_RESULT_EXT cpu_to_be16(0x001E)
53
54struct ib_pma_mad {
55 struct ib_mad_hdr mad_hdr;
56 u8 reserved[40];
57 u8 data[192];
58} __packed;
59
60struct ib_pma_portsamplescontrol {
61 u8 opcode;
62 u8 port_select;
63 u8 tick;
64 u8 counter_width; /* resv: 7:3, counter width: 2:0 */
65 __be32 counter_mask0_9; /* 2, 10 3-bit fields */
66 __be16 counter_mask10_14; /* 1, 5 3-bit fields */
67 u8 sample_mechanisms;
68 u8 sample_status; /* only lower 2 bits */
69 __be64 option_mask;
70 __be64 vendor_mask;
71 __be32 sample_start;
72 __be32 sample_interval;
73 __be16 tag;
74 __be16 counter_select[15];
75 __be32 reserved1;
76 __be64 samples_only_option_mask;
77 __be32 reserved2[28];
78};
79
80struct ib_pma_portsamplesresult {
81 __be16 tag;
82 __be16 sample_status; /* only lower 2 bits */
83 __be32 counter[15];
84};
85
86struct ib_pma_portsamplesresult_ext {
87 __be16 tag;
88 __be16 sample_status; /* only lower 2 bits */
89 __be32 extended_width; /* only upper 2 bits */
90 __be64 counter[15];
91};
92
93struct ib_pma_portcounters {
94 u8 reserved;
95 u8 port_select;
96 __be16 counter_select;
97 __be16 symbol_error_counter;
98 u8 link_error_recovery_counter;
99 u8 link_downed_counter;
100 __be16 port_rcv_errors;
101 __be16 port_rcv_remphys_errors;
102 __be16 port_rcv_switch_relay_errors;
103 __be16 port_xmit_discards;
104 u8 port_xmit_constraint_errors;
105 u8 port_rcv_constraint_errors;
106 u8 reserved1;
107 u8 link_overrun_errors; /* LocalLink: 7:4, BufferOverrun: 3:0 */
108 __be16 reserved2;
109 __be16 vl15_dropped;
110 __be32 port_xmit_data;
111 __be32 port_rcv_data;
112 __be32 port_xmit_packets;
113 __be32 port_rcv_packets;
114 __be32 port_xmit_wait;
115} __packed;
116
117
118#define IB_PMA_SEL_SYMBOL_ERROR cpu_to_be16(0x0001)
119#define IB_PMA_SEL_LINK_ERROR_RECOVERY cpu_to_be16(0x0002)
120#define IB_PMA_SEL_LINK_DOWNED cpu_to_be16(0x0004)
121#define IB_PMA_SEL_PORT_RCV_ERRORS cpu_to_be16(0x0008)
122#define IB_PMA_SEL_PORT_RCV_REMPHYS_ERRORS cpu_to_be16(0x0010)
123#define IB_PMA_SEL_PORT_XMIT_DISCARDS cpu_to_be16(0x0040)
124#define IB_PMA_SEL_LOCAL_LINK_INTEGRITY_ERRORS cpu_to_be16(0x0200)
125#define IB_PMA_SEL_EXCESSIVE_BUFFER_OVERRUNS cpu_to_be16(0x0400)
126#define IB_PMA_SEL_PORT_VL15_DROPPED cpu_to_be16(0x0800)
127#define IB_PMA_SEL_PORT_XMIT_DATA cpu_to_be16(0x1000)
128#define IB_PMA_SEL_PORT_RCV_DATA cpu_to_be16(0x2000)
129#define IB_PMA_SEL_PORT_XMIT_PACKETS cpu_to_be16(0x4000)
130#define IB_PMA_SEL_PORT_RCV_PACKETS cpu_to_be16(0x8000)
131
132struct ib_pma_portcounters_ext {
133 u8 reserved;
134 u8 port_select;
135 __be16 counter_select;
136 __be32 reserved1;
137 __be64 port_xmit_data;
138 __be64 port_rcv_data;
139 __be64 port_xmit_packets;
140 __be64 port_rcv_packets;
141 __be64 port_unicast_xmit_packets;
142 __be64 port_unicast_rcv_packets;
143 __be64 port_multicast_xmit_packets;
144 __be64 port_multicast_rcv_packets;
145} __packed;
146
147#define IB_PMA_SELX_PORT_XMIT_DATA cpu_to_be16(0x0001)
148#define IB_PMA_SELX_PORT_RCV_DATA cpu_to_be16(0x0002)
149#define IB_PMA_SELX_PORT_XMIT_PACKETS cpu_to_be16(0x0004)
150#define IB_PMA_SELX_PORT_RCV_PACKETS cpu_to_be16(0x0008)
151#define IB_PMA_SELX_PORT_UNI_XMIT_PACKETS cpu_to_be16(0x0010)
152#define IB_PMA_SELX_PORT_UNI_RCV_PACKETS cpu_to_be16(0x0020)
153#define IB_PMA_SELX_PORT_MULTI_XMIT_PACKETS cpu_to_be16(0x0040)
154#define IB_PMA_SELX_PORT_MULTI_RCV_PACKETS cpu_to_be16(0x0080)
155
156#endif /* IB_PMA_H */
diff --git a/include/rdma/ib_sa.h b/include/rdma/ib_sa.h
index 1082afaed158..d44a56388a3e 100644
--- a/include/rdma/ib_sa.h
+++ b/include/rdma/ib_sa.h
@@ -38,7 +38,7 @@
38#include <linux/completion.h> 38#include <linux/completion.h>
39#include <linux/compiler.h> 39#include <linux/compiler.h>
40 40
41#include <asm/atomic.h> 41#include <linux/atomic.h>
42 42
43#include <rdma/ib_verbs.h> 43#include <rdma/ib_verbs.h>
44#include <rdma/ib_mad.h> 44#include <rdma/ib_mad.h>
diff --git a/include/rdma/ib_verbs.h b/include/rdma/ib_verbs.h
index 55cd0a0bc977..228be3e220d9 100644
--- a/include/rdma/ib_verbs.h
+++ b/include/rdma/ib_verbs.h
@@ -49,7 +49,7 @@
49#include <linux/scatterlist.h> 49#include <linux/scatterlist.h>
50#include <linux/workqueue.h> 50#include <linux/workqueue.h>
51 51
52#include <asm/atomic.h> 52#include <linux/atomic.h>
53#include <asm/uaccess.h> 53#include <asm/uaccess.h>
54 54
55extern struct workqueue_struct *ib_wq; 55extern struct workqueue_struct *ib_wq;
@@ -350,7 +350,8 @@ enum ib_event_type {
350 IB_EVENT_SRQ_ERR, 350 IB_EVENT_SRQ_ERR,
351 IB_EVENT_SRQ_LIMIT_REACHED, 351 IB_EVENT_SRQ_LIMIT_REACHED,
352 IB_EVENT_QP_LAST_WQE_REACHED, 352 IB_EVENT_QP_LAST_WQE_REACHED,
353 IB_EVENT_CLIENT_REREGISTER 353 IB_EVENT_CLIENT_REREGISTER,
354 IB_EVENT_GID_CHANGE,
354}; 355};
355 356
356struct ib_event { 357struct ib_event {
diff --git a/include/rxrpc/types.h b/include/rxrpc/types.h
index 327a5fc4719c..30d48f6da228 100644
--- a/include/rxrpc/types.h
+++ b/include/rxrpc/types.h
@@ -17,7 +17,7 @@
17#include <linux/socket.h> 17#include <linux/socket.h>
18#include <linux/in.h> 18#include <linux/in.h>
19#include <linux/spinlock.h> 19#include <linux/spinlock.h>
20#include <asm/atomic.h> 20#include <linux/atomic.h>
21 21
22typedef uint32_t rxrpc_seq_t; /* Rx message sequence number */ 22typedef uint32_t rxrpc_seq_t; /* Rx message sequence number */
23typedef uint32_t rxrpc_serial_t; /* Rx message serial number */ 23typedef uint32_t rxrpc_serial_t; /* Rx message serial number */
diff --git a/include/scsi/fc_frame.h b/include/scsi/fc_frame.h
index 4ad02041b667..8225d8063ec4 100644
--- a/include/scsi/fc_frame.h
+++ b/include/scsi/fc_frame.h
@@ -78,7 +78,6 @@ struct fc_frame {
78}; 78};
79 79
80struct fcoe_rcv_info { 80struct fcoe_rcv_info {
81 struct packet_type *ptype;
82 struct fc_lport *fr_dev; /* transport layer private pointer */ 81 struct fc_lport *fr_dev; /* transport layer private pointer */
83 struct fc_seq *fr_seq; /* for use with exchange manager */ 82 struct fc_seq *fr_seq; /* for use with exchange manager */
84 struct fc_fcp_pkt *fr_fsp; /* for the corresponding fcp I/O */ 83 struct fc_fcp_pkt *fr_fsp; /* for the corresponding fcp I/O */
diff --git a/include/scsi/iscsi_proto.h b/include/scsi/iscsi_proto.h
index dd0a52cea95a..988ba06b3ad6 100644
--- a/include/scsi/iscsi_proto.h
+++ b/include/scsi/iscsi_proto.h
@@ -29,10 +29,40 @@
29/* default iSCSI listen port for incoming connections */ 29/* default iSCSI listen port for incoming connections */
30#define ISCSI_LISTEN_PORT 3260 30#define ISCSI_LISTEN_PORT 3260
31 31
32/* iSCSI header length */
33#define ISCSI_HDR_LEN 48
34
35/* iSCSI CRC32C length */
36#define ISCSI_CRC_LEN 4
37
32/* Padding word length */ 38/* Padding word length */
33#define ISCSI_PAD_LEN 4 39#define ISCSI_PAD_LEN 4
34 40
35/* 41/*
42 * Serial Number Arithmetic, 32 bits, RFC1982
43 */
44
45static inline int iscsi_sna_lt(u32 n1, u32 n2)
46{
47 return (s32)(n1 - n2) < 0;
48}
49
50static inline int iscsi_sna_lte(u32 n1, u32 n2)
51{
52 return (s32)(n1 - n2) <= 0;
53}
54
55static inline int iscsi_sna_gt(u32 n1, u32 n2)
56{
57 return (s32)(n1 - n2) > 0;
58}
59
60static inline int iscsi_sna_gte(u32 n1, u32 n2)
61{
62 return (s32)(n1 - n2) >= 0;
63}
64
65/*
36 * useful common(control and data pathes) macro 66 * useful common(control and data pathes) macro
37 */ 67 */
38#define ntoh24(p) (((p)[0] << 16) | ((p)[1] << 8) | ((p)[2])) 68#define ntoh24(p) (((p)[0] << 16) | ((p)[1] << 8) | ((p)[2]))
@@ -60,7 +90,7 @@ struct iscsi_hdr {
60 uint8_t rsvd2[2]; 90 uint8_t rsvd2[2];
61 uint8_t hlength; /* AHSs total length */ 91 uint8_t hlength; /* AHSs total length */
62 uint8_t dlength[3]; /* Data length */ 92 uint8_t dlength[3]; /* Data length */
63 uint8_t lun[8]; 93 struct scsi_lun lun;
64 itt_t itt; /* Initiator Task Tag, opaque for target */ 94 itt_t itt; /* Initiator Task Tag, opaque for target */
65 __be32 ttt; /* Target Task Tag */ 95 __be32 ttt; /* Target Task Tag */
66 __be32 statsn; 96 __be32 statsn;
@@ -116,13 +146,13 @@ struct iscsi_ahs_hdr {
116#define ISCSI_CDB_SIZE 16 146#define ISCSI_CDB_SIZE 16
117 147
118/* iSCSI PDU Header */ 148/* iSCSI PDU Header */
119struct iscsi_cmd { 149struct iscsi_scsi_req {
120 uint8_t opcode; 150 uint8_t opcode;
121 uint8_t flags; 151 uint8_t flags;
122 __be16 rsvd2; 152 __be16 rsvd2;
123 uint8_t hlength; 153 uint8_t hlength;
124 uint8_t dlength[3]; 154 uint8_t dlength[3];
125 uint8_t lun[8]; 155 struct scsi_lun lun;
126 itt_t itt; /* Initiator Task Tag */ 156 itt_t itt; /* Initiator Task Tag */
127 __be32 data_length; 157 __be32 data_length;
128 __be32 cmdsn; 158 __be32 cmdsn;
@@ -161,7 +191,7 @@ struct iscsi_ecdb_ahdr {
161}; 191};
162 192
163/* SCSI Response Header */ 193/* SCSI Response Header */
164struct iscsi_cmd_rsp { 194struct iscsi_scsi_rsp {
165 uint8_t opcode; 195 uint8_t opcode;
166 uint8_t flags; 196 uint8_t flags;
167 uint8_t response; 197 uint8_t response;
@@ -198,7 +228,7 @@ struct iscsi_async {
198 uint8_t rsvd2[2]; 228 uint8_t rsvd2[2];
199 uint8_t rsvd3; 229 uint8_t rsvd3;
200 uint8_t dlength[3]; 230 uint8_t dlength[3];
201 uint8_t lun[8]; 231 struct scsi_lun lun;
202 uint8_t rsvd4[8]; 232 uint8_t rsvd4[8];
203 __be32 statsn; 233 __be32 statsn;
204 __be32 exp_cmdsn; 234 __be32 exp_cmdsn;
@@ -226,7 +256,7 @@ struct iscsi_nopout {
226 __be16 rsvd2; 256 __be16 rsvd2;
227 uint8_t rsvd3; 257 uint8_t rsvd3;
228 uint8_t dlength[3]; 258 uint8_t dlength[3];
229 uint8_t lun[8]; 259 struct scsi_lun lun;
230 itt_t itt; /* Initiator Task Tag */ 260 itt_t itt; /* Initiator Task Tag */
231 __be32 ttt; /* Target Transfer Tag */ 261 __be32 ttt; /* Target Transfer Tag */
232 __be32 cmdsn; 262 __be32 cmdsn;
@@ -241,7 +271,7 @@ struct iscsi_nopin {
241 __be16 rsvd2; 271 __be16 rsvd2;
242 uint8_t rsvd3; 272 uint8_t rsvd3;
243 uint8_t dlength[3]; 273 uint8_t dlength[3];
244 uint8_t lun[8]; 274 struct scsi_lun lun;
245 itt_t itt; /* Initiator Task Tag */ 275 itt_t itt; /* Initiator Task Tag */
246 __be32 ttt; /* Target Transfer Tag */ 276 __be32 ttt; /* Target Transfer Tag */
247 __be32 statsn; 277 __be32 statsn;
@@ -257,7 +287,7 @@ struct iscsi_tm {
257 uint8_t rsvd1[2]; 287 uint8_t rsvd1[2];
258 uint8_t hlength; 288 uint8_t hlength;
259 uint8_t dlength[3]; 289 uint8_t dlength[3];
260 uint8_t lun[8]; 290 struct scsi_lun lun;
261 itt_t itt; /* Initiator Task Tag */ 291 itt_t itt; /* Initiator Task Tag */
262 itt_t rtt; /* Reference Task Tag */ 292 itt_t rtt; /* Reference Task Tag */
263 __be32 cmdsn; 293 __be32 cmdsn;
@@ -315,7 +345,7 @@ struct iscsi_r2t_rsp {
315 uint8_t rsvd2[2]; 345 uint8_t rsvd2[2];
316 uint8_t hlength; 346 uint8_t hlength;
317 uint8_t dlength[3]; 347 uint8_t dlength[3];
318 uint8_t lun[8]; 348 struct scsi_lun lun;
319 itt_t itt; /* Initiator Task Tag */ 349 itt_t itt; /* Initiator Task Tag */
320 __be32 ttt; /* Target Transfer Tag */ 350 __be32 ttt; /* Target Transfer Tag */
321 __be32 statsn; 351 __be32 statsn;
@@ -333,7 +363,7 @@ struct iscsi_data {
333 uint8_t rsvd2[2]; 363 uint8_t rsvd2[2];
334 uint8_t rsvd3; 364 uint8_t rsvd3;
335 uint8_t dlength[3]; 365 uint8_t dlength[3];
336 uint8_t lun[8]; 366 struct scsi_lun lun;
337 itt_t itt; 367 itt_t itt;
338 __be32 ttt; 368 __be32 ttt;
339 __be32 rsvd4; 369 __be32 rsvd4;
@@ -353,7 +383,7 @@ struct iscsi_data_rsp {
353 uint8_t cmd_status; 383 uint8_t cmd_status;
354 uint8_t hlength; 384 uint8_t hlength;
355 uint8_t dlength[3]; 385 uint8_t dlength[3];
356 uint8_t lun[8]; 386 struct scsi_lun lun;
357 itt_t itt; 387 itt_t itt;
358 __be32 ttt; 388 __be32 ttt;
359 __be32 statsn; 389 __be32 statsn;
@@ -406,7 +436,7 @@ struct iscsi_text_rsp {
406}; 436};
407 437
408/* Login Header */ 438/* Login Header */
409struct iscsi_login { 439struct iscsi_login_req {
410 uint8_t opcode; 440 uint8_t opcode;
411 uint8_t flags; 441 uint8_t flags;
412 uint8_t max_version; /* Max. version supported */ 442 uint8_t max_version; /* Max. version supported */
@@ -427,7 +457,13 @@ struct iscsi_login {
427#define ISCSI_FLAG_LOGIN_TRANSIT 0x80 457#define ISCSI_FLAG_LOGIN_TRANSIT 0x80
428#define ISCSI_FLAG_LOGIN_CONTINUE 0x40 458#define ISCSI_FLAG_LOGIN_CONTINUE 0x40
429#define ISCSI_FLAG_LOGIN_CURRENT_STAGE_MASK 0x0C /* 2 bits */ 459#define ISCSI_FLAG_LOGIN_CURRENT_STAGE_MASK 0x0C /* 2 bits */
460#define ISCSI_FLAG_LOGIN_CURRENT_STAGE1 0x04
461#define ISCSI_FLAG_LOGIN_CURRENT_STAGE2 0x08
462#define ISCSI_FLAG_LOGIN_CURRENT_STAGE3 0x0C
430#define ISCSI_FLAG_LOGIN_NEXT_STAGE_MASK 0x03 /* 2 bits */ 463#define ISCSI_FLAG_LOGIN_NEXT_STAGE_MASK 0x03 /* 2 bits */
464#define ISCSI_FLAG_LOGIN_NEXT_STAGE1 0x01
465#define ISCSI_FLAG_LOGIN_NEXT_STAGE2 0x02
466#define ISCSI_FLAG_LOGIN_NEXT_STAGE3 0x03
431 467
432#define ISCSI_LOGIN_CURRENT_STAGE(flags) \ 468#define ISCSI_LOGIN_CURRENT_STAGE(flags) \
433 ((flags & ISCSI_FLAG_LOGIN_CURRENT_STAGE_MASK) >> 2) 469 ((flags & ISCSI_FLAG_LOGIN_CURRENT_STAGE_MASK) >> 2)
@@ -550,17 +586,25 @@ struct iscsi_logout_rsp {
550struct iscsi_snack { 586struct iscsi_snack {
551 uint8_t opcode; 587 uint8_t opcode;
552 uint8_t flags; 588 uint8_t flags;
553 uint8_t rsvd2[14]; 589 uint8_t rsvd2[2];
590 uint8_t hlength;
591 uint8_t dlength[3];
592 uint8_t lun[8];
554 itt_t itt; 593 itt_t itt;
594 __be32 ttt;
595 uint8_t rsvd3[4];
596 __be32 exp_statsn;
597 uint8_t rsvd4[8];
555 __be32 begrun; 598 __be32 begrun;
556 __be32 runlength; 599 __be32 runlength;
557 __be32 exp_statsn;
558 __be32 rsvd3;
559 __be32 exp_datasn;
560 uint8_t rsvd6[8];
561}; 600};
562 601
563/* SNACK PDU flags */ 602/* SNACK PDU flags */
603#define ISCSI_FLAG_SNACK_TYPE_DATA 0
604#define ISCSI_FLAG_SNACK_TYPE_R2T 0
605#define ISCSI_FLAG_SNACK_TYPE_STATUS 1
606#define ISCSI_FLAG_SNACK_TYPE_DATA_ACK 2
607#define ISCSI_FLAG_SNACK_TYPE_RDATA 3
564#define ISCSI_FLAG_SNACK_TYPE_MASK 0x0F /* 4 bits */ 608#define ISCSI_FLAG_SNACK_TYPE_MASK 0x0F /* 4 bits */
565 609
566/* Reject Message Header */ 610/* Reject Message Header */
diff --git a/include/scsi/libfc.h b/include/scsi/libfc.h
index a3cbda4ddb5c..7d96829b0c00 100644
--- a/include/scsi/libfc.h
+++ b/include/scsi/libfc.h
@@ -511,6 +511,14 @@ struct libfc_function_template {
511 */ 511 */
512 int (*ddp_done)(struct fc_lport *, u16); 512 int (*ddp_done)(struct fc_lport *, u16);
513 /* 513 /*
514 * Sets up the DDP context for a given exchange id on the given
515 * scatterlist if LLD supports DDP for FCoE target.
516 *
517 * STATUS: OPTIONAL
518 */
519 int (*ddp_target)(struct fc_lport *, u16, struct scatterlist *,
520 unsigned int);
521 /*
514 * Allow LLD to fill its own Link Error Status Block 522 * Allow LLD to fill its own Link Error Status Block
515 * 523 *
516 * STATUS: OPTIONAL 524 * STATUS: OPTIONAL
diff --git a/include/scsi/libiscsi.h b/include/scsi/libiscsi.h
index 0f4367751b71..cedcff371c88 100644
--- a/include/scsi/libiscsi.h
+++ b/include/scsi/libiscsi.h
@@ -115,7 +115,7 @@ struct iscsi_task {
115 /* copied values in case we need to send tmfs */ 115 /* copied values in case we need to send tmfs */
116 itt_t hdr_itt; 116 itt_t hdr_itt;
117 __be32 cmdsn; 117 __be32 cmdsn;
118 uint8_t lun[8]; 118 struct scsi_lun lun;
119 119
120 int itt; /* this ITT */ 120 int itt; /* this ITT */
121 121
diff --git a/include/scsi/osd_initiator.h b/include/scsi/osd_initiator.h
index 0a5079974fe9..572fb5493661 100644
--- a/include/scsi/osd_initiator.h
+++ b/include/scsi/osd_initiator.h
@@ -262,7 +262,7 @@ int osd_execute_request_async(struct osd_request *or,
262 * osd_req_decode_sense_full - Decode sense information after execution. 262 * osd_req_decode_sense_full - Decode sense information after execution.
263 * 263 *
264 * @or: - osd_request to examine 264 * @or: - osd_request to examine
265 * @osi - Recievs a more detailed error report information (optional). 265 * @osi - Receives a more detailed error report information (optional).
266 * @silent - Do not print to dmsg (Even if enabled) 266 * @silent - Do not print to dmsg (Even if enabled)
267 * @bad_obj_list - Some commands act on multiple objects. Failed objects will 267 * @bad_obj_list - Some commands act on multiple objects. Failed objects will
268 * be received here (optional) 268 * be received here (optional)
diff --git a/include/scsi/osd_ore.h b/include/scsi/osd_ore.h
new file mode 100644
index 000000000000..c5c5e008e6de
--- /dev/null
+++ b/include/scsi/osd_ore.h
@@ -0,0 +1,125 @@
1/*
2 * Copyright (C) 2011
3 * Boaz Harrosh <bharrosh@panasas.com>
4 *
5 * Public Declarations of the ORE API
6 *
7 * This file is part of the ORE (Object Raid Engine) library.
8 *
9 * ORE is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License version 2 as published
11 * by the Free Software Foundation. (GPL v2)
12 *
13 * ORE 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 the ORE; if not, write to the Free Software
20 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
21 */
22#ifndef __ORE_H__
23#define __ORE_H__
24
25#include <scsi/osd_initiator.h>
26#include <scsi/osd_attributes.h>
27#include <scsi/osd_sec.h>
28#include <linux/pnfs_osd_xdr.h>
29
30struct ore_comp {
31 struct osd_obj_id obj;
32 u8 cred[OSD_CAP_LEN];
33};
34
35struct ore_layout {
36 /* Our way of looking at the data_map */
37 unsigned stripe_unit;
38 unsigned mirrors_p1;
39
40 unsigned group_width;
41 u64 group_depth;
42 unsigned group_count;
43};
44
45struct ore_components {
46 unsigned numdevs; /* Num of devices in array */
47 /* If @single_comp == EC_SINGLE_COMP, @comps points to a single
48 * component. else there are @numdevs components
49 */
50 enum EC_COMP_USAGE {
51 EC_SINGLE_COMP = 0, EC_MULTPLE_COMPS = 0xffffffff
52 } single_comp;
53 struct ore_comp *comps;
54 struct osd_dev **ods; /* osd_dev array */
55};
56
57struct ore_io_state;
58typedef void (*ore_io_done_fn)(struct ore_io_state *ios, void *private);
59
60struct ore_io_state {
61 struct kref kref;
62
63 void *private;
64 ore_io_done_fn done;
65
66 struct ore_layout *layout;
67 struct ore_components *comps;
68
69 /* Global read/write IO*/
70 loff_t offset;
71 unsigned long length;
72 void *kern_buff;
73
74 struct page **pages;
75 unsigned nr_pages;
76 unsigned pgbase;
77 unsigned pages_consumed;
78
79 /* Attributes */
80 unsigned in_attr_len;
81 struct osd_attr *in_attr;
82 unsigned out_attr_len;
83 struct osd_attr *out_attr;
84
85 bool reading;
86
87 /* Variable array of size numdevs */
88 unsigned numdevs;
89 struct ore_per_dev_state {
90 struct osd_request *or;
91 struct bio *bio;
92 loff_t offset;
93 unsigned length;
94 unsigned dev;
95 } per_dev[];
96};
97
98static inline unsigned ore_io_state_size(unsigned numdevs)
99{
100 return sizeof(struct ore_io_state) +
101 sizeof(struct ore_per_dev_state) * numdevs;
102}
103
104/* ore.c */
105int ore_get_rw_state(struct ore_layout *layout, struct ore_components *comps,
106 bool is_reading, u64 offset, u64 length,
107 struct ore_io_state **ios);
108int ore_get_io_state(struct ore_layout *layout, struct ore_components *comps,
109 struct ore_io_state **ios);
110void ore_put_io_state(struct ore_io_state *ios);
111
112int ore_check_io(struct ore_io_state *ios, u64 *resid);
113
114int ore_create(struct ore_io_state *ios);
115int ore_remove(struct ore_io_state *ios);
116int ore_write(struct ore_io_state *ios);
117int ore_read(struct ore_io_state *ios);
118int ore_truncate(struct ore_layout *layout, struct ore_components *comps,
119 u64 size);
120
121int extract_attr_from_ios(struct ore_io_state *ios, struct osd_attr *attr);
122
123extern const struct osd_attr g_attr_logical_length;
124
125#endif
diff --git a/include/scsi/scsi.h b/include/scsi/scsi.h
index 3668903e397b..8001ae4cd7ba 100644
--- a/include/scsi/scsi.h
+++ b/include/scsi/scsi.h
@@ -495,7 +495,7 @@ static inline int scsi_is_wlun(unsigned int lun)
495 495
496#define sense_class(sense) (((sense) >> 4) & 0x7) 496#define sense_class(sense) (((sense) >> 4) & 0x7)
497#define sense_error(sense) ((sense) & 0xf) 497#define sense_error(sense) ((sense) & 0xf)
498#define sense_valid(sense) ((sense) & 0x80); 498#define sense_valid(sense) ((sense) & 0x80)
499 499
500/* 500/*
501 * default timeouts 501 * default timeouts
diff --git a/include/scsi/scsi_device.h b/include/scsi/scsi_device.h
index dd82e02ddde3..d371c3ca90c3 100644
--- a/include/scsi/scsi_device.h
+++ b/include/scsi/scsi_device.h
@@ -7,7 +7,7 @@
7#include <linux/workqueue.h> 7#include <linux/workqueue.h>
8#include <linux/blkdev.h> 8#include <linux/blkdev.h>
9#include <scsi/scsi.h> 9#include <scsi/scsi.h>
10#include <asm/atomic.h> 10#include <linux/atomic.h>
11 11
12struct request_queue; 12struct request_queue;
13struct scsi_cmnd; 13struct scsi_cmnd;
diff --git a/include/sound/pcm.h b/include/sound/pcm.h
index e1bad1130616..57e71fa33f7c 100644
--- a/include/sound/pcm.h
+++ b/include/sound/pcm.h
@@ -507,6 +507,18 @@ void snd_pcm_detach_substream(struct snd_pcm_substream *substream);
507void snd_pcm_vma_notify_data(void *client, void *data); 507void snd_pcm_vma_notify_data(void *client, void *data);
508int snd_pcm_mmap_data(struct snd_pcm_substream *substream, struct file *file, struct vm_area_struct *area); 508int snd_pcm_mmap_data(struct snd_pcm_substream *substream, struct file *file, struct vm_area_struct *area);
509 509
510
511#ifdef CONFIG_SND_DEBUG
512void snd_pcm_debug_name(struct snd_pcm_substream *substream,
513 char *name, size_t len);
514#else
515static inline void
516snd_pcm_debug_name(struct snd_pcm_substream *substream, char *buf, size_t size)
517{
518 *buf = 0;
519}
520#endif
521
510/* 522/*
511 * PCM library 523 * PCM library
512 */ 524 */
@@ -749,17 +761,18 @@ static inline const struct snd_interval *hw_param_interval_c(const struct snd_pc
749 return &params->intervals[var - SNDRV_PCM_HW_PARAM_FIRST_INTERVAL]; 761 return &params->intervals[var - SNDRV_PCM_HW_PARAM_FIRST_INTERVAL];
750} 762}
751 763
752#define params_access(p) ((__force snd_pcm_access_t)snd_mask_min(hw_param_mask((p), SNDRV_PCM_HW_PARAM_ACCESS))) 764#define params_channels(p) \
753#define params_format(p) ((__force snd_pcm_format_t)snd_mask_min(hw_param_mask((p), SNDRV_PCM_HW_PARAM_FORMAT))) 765 (hw_param_interval_c((p), SNDRV_PCM_HW_PARAM_CHANNELS)->min)
754#define params_subformat(p) snd_mask_min(hw_param_mask((p), SNDRV_PCM_HW_PARAM_SUBFORMAT)) 766#define params_rate(p) \
755#define params_channels(p) hw_param_interval((p), SNDRV_PCM_HW_PARAM_CHANNELS)->min 767 (hw_param_interval_c((p), SNDRV_PCM_HW_PARAM_RATE)->min)
756#define params_rate(p) hw_param_interval((p), SNDRV_PCM_HW_PARAM_RATE)->min 768#define params_period_size(p) \
757#define params_period_size(p) hw_param_interval((p), SNDRV_PCM_HW_PARAM_PERIOD_SIZE)->min 769 (hw_param_interval_c((p), SNDRV_PCM_HW_PARAM_PERIOD_SIZE)->min)
758#define params_period_bytes(p) ((params_period_size(p)*snd_pcm_format_physical_width(params_format(p))*params_channels(p))/8) 770#define params_periods(p) \
759#define params_periods(p) hw_param_interval((p), SNDRV_PCM_HW_PARAM_PERIODS)->min 771 (hw_param_interval_c((p), SNDRV_PCM_HW_PARAM_PERIODS)->min)
760#define params_buffer_size(p) hw_param_interval((p), SNDRV_PCM_HW_PARAM_BUFFER_SIZE)->min 772#define params_buffer_size(p) \
761#define params_buffer_bytes(p) hw_param_interval((p), SNDRV_PCM_HW_PARAM_BUFFER_BYTES)->min 773 (hw_param_interval_c((p), SNDRV_PCM_HW_PARAM_BUFFER_SIZE)->min)
762 774#define params_buffer_bytes(p) \
775 (hw_param_interval_c((p), SNDRV_PCM_HW_PARAM_BUFFER_BYTES)->min)
763 776
764int snd_interval_refine(struct snd_interval *i, const struct snd_interval *v); 777int snd_interval_refine(struct snd_interval *i, const struct snd_interval *v);
765void snd_interval_mul(const struct snd_interval *a, const struct snd_interval *b, struct snd_interval *c); 778void snd_interval_mul(const struct snd_interval *a, const struct snd_interval *b, struct snd_interval *c);
diff --git a/include/sound/pcm_params.h b/include/sound/pcm_params.h
index 85cf1cf4f31a..f494f1e3c900 100644
--- a/include/sound/pcm_params.h
+++ b/include/sound/pcm_params.h
@@ -337,5 +337,19 @@ static inline unsigned int sub(unsigned int a, unsigned int b)
337 return 0; 337 return 0;
338} 338}
339 339
340#endif /* __SOUND_PCM_PARAMS_H */ 340#define params_access(p) ((__force snd_pcm_access_t)\
341 snd_mask_min(hw_param_mask_c((p), SNDRV_PCM_HW_PARAM_ACCESS)))
342#define params_format(p) ((__force snd_pcm_format_t)\
343 snd_mask_min(hw_param_mask_c((p), SNDRV_PCM_HW_PARAM_FORMAT)))
344#define params_subformat(p) \
345 snd_mask_min(hw_param_mask_c((p), SNDRV_PCM_HW_PARAM_SUBFORMAT))
341 346
347static inline unsigned int
348params_period_bytes(const struct snd_pcm_hw_params *p)
349{
350 return (params_period_size(p) *
351 snd_pcm_format_physical_width(params_format(p)) *
352 params_channels(p)) / 8;
353}
354
355#endif /* __SOUND_PCM_PARAMS_H */
diff --git a/include/sound/rawmidi.h b/include/sound/rawmidi.h
index 2480e7d10dcf..6b14359d9fed 100644
--- a/include/sound/rawmidi.h
+++ b/include/sound/rawmidi.h
@@ -27,6 +27,7 @@
27#include <linux/spinlock.h> 27#include <linux/spinlock.h>
28#include <linux/wait.h> 28#include <linux/wait.h>
29#include <linux/mutex.h> 29#include <linux/mutex.h>
30#include <linux/workqueue.h>
30 31
31#if defined(CONFIG_SND_SEQUENCER) || defined(CONFIG_SND_SEQUENCER_MODULE) 32#if defined(CONFIG_SND_SEQUENCER) || defined(CONFIG_SND_SEQUENCER_MODULE)
32#include "seq_device.h" 33#include "seq_device.h"
@@ -63,6 +64,7 @@ struct snd_rawmidi_global_ops {
63}; 64};
64 65
65struct snd_rawmidi_runtime { 66struct snd_rawmidi_runtime {
67 struct snd_rawmidi_substream *substream;
66 unsigned int drain: 1, /* drain stage */ 68 unsigned int drain: 1, /* drain stage */
67 oss: 1; /* OSS compatible mode */ 69 oss: 1; /* OSS compatible mode */
68 /* midi stream buffer */ 70 /* midi stream buffer */
@@ -79,7 +81,7 @@ struct snd_rawmidi_runtime {
79 /* event handler (new bytes, input only) */ 81 /* event handler (new bytes, input only) */
80 void (*event)(struct snd_rawmidi_substream *substream); 82 void (*event)(struct snd_rawmidi_substream *substream);
81 /* defers calls to event [input] or ops->trigger [output] */ 83 /* defers calls to event [input] or ops->trigger [output] */
82 struct tasklet_struct tasklet; 84 struct work_struct event_work;
83 /* private data */ 85 /* private data */
84 void *private_data; 86 void *private_data;
85 void (*private_free)(struct snd_rawmidi_substream *substream); 87 void (*private_free)(struct snd_rawmidi_substream *substream);
diff --git a/include/sound/sb16_csp.h b/include/sound/sb16_csp.h
index 736eac71d053..af1b49e982df 100644
--- a/include/sound/sb16_csp.h
+++ b/include/sound/sb16_csp.h
@@ -99,7 +99,14 @@ struct snd_sb_csp_info {
99/* get CSP information */ 99/* get CSP information */
100#define SNDRV_SB_CSP_IOCTL_INFO _IOR('H', 0x10, struct snd_sb_csp_info) 100#define SNDRV_SB_CSP_IOCTL_INFO _IOR('H', 0x10, struct snd_sb_csp_info)
101/* load microcode to CSP */ 101/* load microcode to CSP */
102#define SNDRV_SB_CSP_IOCTL_LOAD_CODE _IOW('H', 0x11, struct snd_sb_csp_microcode) 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))
103/* unload microcode from CSP */ 110/* unload microcode from CSP */
104#define SNDRV_SB_CSP_IOCTL_UNLOAD_CODE _IO('H', 0x12) 111#define SNDRV_SB_CSP_IOCTL_UNLOAD_CODE _IO('H', 0x12)
105/* start CSP */ 112/* start CSP */
diff --git a/include/sound/soundfont.h b/include/sound/soundfont.h
index f95d99ba7f74..679df0574066 100644
--- a/include/sound/soundfont.h
+++ b/include/sound/soundfont.h
@@ -121,7 +121,7 @@ int snd_soundfont_search_zone(struct snd_sf_list *sflist, int *notep, int vel,
121int snd_sf_calc_parm_hold(int msec); 121int snd_sf_calc_parm_hold(int msec);
122int snd_sf_calc_parm_attack(int msec); 122int snd_sf_calc_parm_attack(int msec);
123int snd_sf_calc_parm_decay(int msec); 123int snd_sf_calc_parm_decay(int msec);
124#define snd_sf_calc_parm_delay(msec) (0x8000 - (msec) * 1000 / 725); 124#define snd_sf_calc_parm_delay(msec) (0x8000 - (msec) * 1000 / 725)
125extern int snd_sf_vol_table[128]; 125extern int snd_sf_vol_table[128];
126int snd_sf_linear_to_log(unsigned int amount, int offset, int ratio); 126int snd_sf_linear_to_log(unsigned int amount, int offset, int ratio);
127 127
diff --git a/include/sound/tea575x-tuner.h b/include/sound/tea575x-tuner.h
index d2ea112fc20f..726e94742a5c 100644
--- a/include/sound/tea575x-tuner.h
+++ b/include/sound/tea575x-tuner.h
@@ -23,8 +23,8 @@
23 */ 23 */
24 24
25#include <linux/videodev2.h> 25#include <linux/videodev2.h>
26#include <media/v4l2-ctrls.h>
26#include <media/v4l2-dev.h> 27#include <media/v4l2-dev.h>
27#include <media/v4l2-ioctl.h>
28 28
29#define TEA575X_FMIF 10700 29#define TEA575X_FMIF 10700
30 30
@@ -42,18 +42,20 @@ struct snd_tea575x_ops {
42}; 42};
43 43
44struct snd_tea575x { 44struct snd_tea575x {
45 struct video_device *vd; /* video device */ 45 struct video_device vd; /* video device */
46 bool tea5759; /* 5759 chip is present */ 46 bool tea5759; /* 5759 chip is present */
47 bool mute; /* Device is muted? */ 47 bool mute; /* Device is muted? */
48 bool stereo; /* receiving stereo */ 48 bool stereo; /* receiving stereo */
49 bool tuned; /* tuned to a station */ 49 bool tuned; /* tuned to a station */
50 unsigned int val; /* hw value */ 50 unsigned int val; /* hw value */
51 unsigned long freq; /* frequency */ 51 unsigned long freq; /* frequency */
52 unsigned long in_use; /* set if the device is in use */ 52 struct mutex mutex;
53 struct snd_tea575x_ops *ops; 53 struct snd_tea575x_ops *ops;
54 void *private_data; 54 void *private_data;
55 u8 card[32]; 55 u8 card[32];
56 u8 bus_info[32]; 56 u8 bus_info[32];
57 struct v4l2_ctrl_handler ctrl_handler;
58 int (*ext_init)(struct snd_tea575x *tea);
57}; 59};
58 60
59int snd_tea575x_init(struct snd_tea575x *tea); 61int snd_tea575x_init(struct snd_tea575x *tea);
diff --git a/include/staging/altera.h b/include/staging/altera.h
deleted file mode 100644
index 94c0c6181daf..000000000000
--- a/include/staging/altera.h
+++ /dev/null
@@ -1,49 +0,0 @@
1/*
2 * altera.h
3 *
4 * altera FPGA driver
5 *
6 * Copyright (C) Altera Corporation 1998-2001
7 * Copyright (C) 2010 NetUP Inc.
8 * Copyright (C) 2010 Igor M. Liplianin <liplianin@netup.ru>
9 *
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation; either version 2 of the License, or
13 * (at your option) any later version.
14 *
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 *
19 * GNU General Public License for more details.
20 *
21 * You should have received a copy of the GNU General Public License
22 * along with this program; if not, write to the Free Software
23 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
24 */
25
26#ifndef _ALTERA_H_
27#define _ALTERA_H_
28
29struct altera_config {
30 void *dev;
31 u8 *action;
32 int (*jtag_io) (void *dev, int tms, int tdi, int tdo);
33};
34
35#if defined(CONFIG_ALTERA_STAPL) || \
36 (defined(CONFIG_ALTERA_STAPL_MODULE) && defined(MODULE))
37
38extern int altera_init(struct altera_config *config, const struct firmware *fw);
39#else
40
41static inline int altera_init(struct altera_config *config,
42 const struct firmware *fw)
43{
44 printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__);
45 return 0;
46}
47#endif /* CONFIG_ALTERA_STAPL */
48
49#endif /* _ALTERA_H_ */
diff --git a/include/target/target_core_base.h b/include/target/target_core_base.h
index 561ac99def5a..27040653005e 100644
--- a/include/target/target_core_base.h
+++ b/include/target/target_core_base.h
@@ -9,12 +9,13 @@
9#include <net/sock.h> 9#include <net/sock.h>
10#include <net/tcp.h> 10#include <net/tcp.h>
11 11
12#define TARGET_CORE_MOD_VERSION "v4.0.0-rc7-ml" 12#define TARGET_CORE_MOD_VERSION "v4.1.0-rc1-ml"
13#define SHUTDOWN_SIGS (sigmask(SIGKILL)|sigmask(SIGINT)|sigmask(SIGABRT)) 13#define SHUTDOWN_SIGS (sigmask(SIGKILL)|sigmask(SIGINT)|sigmask(SIGABRT))
14 14
15/* Used by transport_generic_allocate_iovecs() */ 15/* Used by transport_generic_allocate_iovecs() */
16#define TRANSPORT_IOV_DATA_BUFFER 5 16#define TRANSPORT_IOV_DATA_BUFFER 5
17/* Maximum Number of LUNs per Target Portal Group */ 17/* Maximum Number of LUNs per Target Portal Group */
18/* Don't raise above 511 or REPORT_LUNS needs to handle >1 page */
18#define TRANSPORT_MAX_LUNS_PER_TPG 256 19#define TRANSPORT_MAX_LUNS_PER_TPG 256
19/* 20/*
20 * By default we use 32-byte CDBs in TCM Core and subsystem plugin code. 21 * By default we use 32-byte CDBs in TCM Core and subsystem plugin code.
@@ -99,6 +100,7 @@ enum transport_state_table {
99 TRANSPORT_FREE = 15, 100 TRANSPORT_FREE = 15,
100 TRANSPORT_NEW_CMD_MAP = 16, 101 TRANSPORT_NEW_CMD_MAP = 16,
101 TRANSPORT_FREE_CMD_INTR = 17, 102 TRANSPORT_FREE_CMD_INTR = 17,
103 TRANSPORT_COMPLETE_QF_WP = 18,
102}; 104};
103 105
104/* Used for struct se_cmd->se_cmd_flags */ 106/* Used for struct se_cmd->se_cmd_flags */
@@ -108,27 +110,22 @@ enum se_cmd_flags_table {
108 SCF_EMULATED_TASK_SENSE = 0x00000004, 110 SCF_EMULATED_TASK_SENSE = 0x00000004,
109 SCF_SCSI_DATA_SG_IO_CDB = 0x00000008, 111 SCF_SCSI_DATA_SG_IO_CDB = 0x00000008,
110 SCF_SCSI_CONTROL_SG_IO_CDB = 0x00000010, 112 SCF_SCSI_CONTROL_SG_IO_CDB = 0x00000010,
111 SCF_SCSI_CONTROL_NONSG_IO_CDB = 0x00000020,
112 SCF_SCSI_NON_DATA_CDB = 0x00000040, 113 SCF_SCSI_NON_DATA_CDB = 0x00000040,
113 SCF_SCSI_CDB_EXCEPTION = 0x00000080, 114 SCF_SCSI_CDB_EXCEPTION = 0x00000080,
114 SCF_SCSI_RESERVATION_CONFLICT = 0x00000100, 115 SCF_SCSI_RESERVATION_CONFLICT = 0x00000100,
115 SCF_CMD_PASSTHROUGH_NOALLOC = 0x00000200,
116 SCF_SE_CMD_FAILED = 0x00000400, 116 SCF_SE_CMD_FAILED = 0x00000400,
117 SCF_SE_LUN_CMD = 0x00000800, 117 SCF_SE_LUN_CMD = 0x00000800,
118 SCF_SE_ALLOW_EOO = 0x00001000, 118 SCF_SE_ALLOW_EOO = 0x00001000,
119 SCF_SE_DISABLE_ONLINE_CHECK = 0x00002000,
120 SCF_SENT_CHECK_CONDITION = 0x00004000, 119 SCF_SENT_CHECK_CONDITION = 0x00004000,
121 SCF_OVERFLOW_BIT = 0x00008000, 120 SCF_OVERFLOW_BIT = 0x00008000,
122 SCF_UNDERFLOW_BIT = 0x00010000, 121 SCF_UNDERFLOW_BIT = 0x00010000,
123 SCF_SENT_DELAYED_TAS = 0x00020000, 122 SCF_SENT_DELAYED_TAS = 0x00020000,
124 SCF_ALUA_NON_OPTIMIZED = 0x00040000, 123 SCF_ALUA_NON_OPTIMIZED = 0x00040000,
125 SCF_DELAYED_CMD_FROM_SAM_ATTR = 0x00080000, 124 SCF_DELAYED_CMD_FROM_SAM_ATTR = 0x00080000,
126 SCF_PASSTHROUGH_SG_TO_MEM = 0x00100000, 125 SCF_UNUSED = 0x00100000,
127 SCF_PASSTHROUGH_CONTIG_TO_SG = 0x00200000,
128 SCF_PASSTHROUGH_SG_TO_MEM_NOALLOC = 0x00400000, 126 SCF_PASSTHROUGH_SG_TO_MEM_NOALLOC = 0x00400000,
129 SCF_EMULATE_SYNC_CACHE = 0x00800000,
130 SCF_EMULATE_CDB_ASYNC = 0x01000000, 127 SCF_EMULATE_CDB_ASYNC = 0x01000000,
131 SCF_EMULATE_SYNC_UNMAP = 0x02000000 128 SCF_EMULATE_QUEUE_FULL = 0x02000000,
132}; 129};
133 130
134/* struct se_dev_entry->lun_flags and struct se_lun->lun_access */ 131/* struct se_dev_entry->lun_flags and struct se_lun->lun_access */
@@ -205,11 +202,6 @@ typedef enum {
205 SCSI_INDEX_TYPE_MAX 202 SCSI_INDEX_TYPE_MAX
206} scsi_index_t; 203} scsi_index_t;
207 204
208struct scsi_index_table {
209 spinlock_t lock;
210 u32 scsi_mib_index[SCSI_INDEX_TYPE_MAX];
211} ____cacheline_aligned;
212
213struct se_cmd; 205struct se_cmd;
214 206
215struct t10_alua { 207struct t10_alua {
@@ -235,7 +227,7 @@ struct t10_alua_lu_gp {
235 atomic_t lu_gp_ref_cnt; 227 atomic_t lu_gp_ref_cnt;
236 spinlock_t lu_gp_lock; 228 spinlock_t lu_gp_lock;
237 struct config_group lu_gp_group; 229 struct config_group lu_gp_group;
238 struct list_head lu_gp_list; 230 struct list_head lu_gp_node;
239 struct list_head lu_gp_mem_list; 231 struct list_head lu_gp_mem_list;
240} ____cacheline_aligned; 232} ____cacheline_aligned;
241 233
@@ -291,10 +283,10 @@ struct t10_vpd {
291} ____cacheline_aligned; 283} ____cacheline_aligned;
292 284
293struct t10_wwn { 285struct t10_wwn {
294 unsigned char vendor[8]; 286 char vendor[8];
295 unsigned char model[16]; 287 char model[16];
296 unsigned char revision[4]; 288 char revision[4];
297 unsigned char unit_serial[INQUIRY_VPD_SERIAL_LEN]; 289 char unit_serial[INQUIRY_VPD_SERIAL_LEN];
298 spinlock_t t10_vpd_lock; 290 spinlock_t t10_vpd_lock;
299 struct se_subsystem_dev *t10_sub_dev; 291 struct se_subsystem_dev *t10_sub_dev;
300 struct config_group t10_wwn_group; 292 struct config_group t10_wwn_group;
@@ -366,13 +358,13 @@ struct t10_reservation_ops {
366 int (*t10_pr_clear)(struct se_cmd *); 358 int (*t10_pr_clear)(struct se_cmd *);
367}; 359};
368 360
369struct t10_reservation_template { 361struct t10_reservation {
370 /* Reservation effects all target ports */ 362 /* Reservation effects all target ports */
371 int pr_all_tg_pt; 363 int pr_all_tg_pt;
372 /* Activate Persistence across Target Power Loss enabled 364 /* Activate Persistence across Target Power Loss enabled
373 * for SCSI device */ 365 * for SCSI device */
374 int pr_aptpl_active; 366 int pr_aptpl_active;
375 /* Used by struct t10_reservation_template->pr_aptpl_buf_len */ 367 /* Used by struct t10_reservation->pr_aptpl_buf_len */
376#define PR_APTPL_BUF_LEN 8192 368#define PR_APTPL_BUF_LEN 8192
377 u32 pr_aptpl_buf_len; 369 u32 pr_aptpl_buf_len;
378 u32 pr_generation; 370 u32 pr_generation;
@@ -397,7 +389,7 @@ struct t10_reservation_template {
397 389
398struct se_queue_req { 390struct se_queue_req {
399 int state; 391 int state;
400 void *cmd; 392 struct se_cmd *cmd;
401 struct list_head qr_list; 393 struct list_head qr_list;
402} ____cacheline_aligned; 394} ____cacheline_aligned;
403 395
@@ -408,64 +400,10 @@ struct se_queue_obj {
408 wait_queue_head_t thread_wq; 400 wait_queue_head_t thread_wq;
409} ____cacheline_aligned; 401} ____cacheline_aligned;
410 402
411/*
412 * Used one per struct se_cmd to hold all extra struct se_task
413 * metadata. This structure is setup and allocated in
414 * drivers/target/target_core_transport.c:__transport_alloc_se_cmd()
415 */
416struct se_transport_task {
417 unsigned char *t_task_cdb;
418 unsigned char __t_task_cdb[TCM_MAX_COMMAND_SIZE];
419 unsigned long long t_task_lba;
420 int t_tasks_failed;
421 int t_tasks_fua;
422 bool t_tasks_bidi;
423 u32 t_task_cdbs;
424 u32 t_tasks_check;
425 u32 t_tasks_no;
426 u32 t_tasks_sectors;
427 u32 t_tasks_se_num;
428 u32 t_tasks_se_bidi_num;
429 u32 t_tasks_sg_chained_no;
430 atomic_t t_fe_count;
431 atomic_t t_se_count;
432 atomic_t t_task_cdbs_left;
433 atomic_t t_task_cdbs_ex_left;
434 atomic_t t_task_cdbs_timeout_left;
435 atomic_t t_task_cdbs_sent;
436 atomic_t t_transport_aborted;
437 atomic_t t_transport_active;
438 atomic_t t_transport_complete;
439 atomic_t t_transport_queue_active;
440 atomic_t t_transport_sent;
441 atomic_t t_transport_stop;
442 atomic_t t_transport_timeout;
443 atomic_t transport_dev_active;
444 atomic_t transport_lun_active;
445 atomic_t transport_lun_fe_stop;
446 atomic_t transport_lun_stop;
447 spinlock_t t_state_lock;
448 struct completion t_transport_stop_comp;
449 struct completion transport_lun_fe_stop_comp;
450 struct completion transport_lun_stop_comp;
451 struct scatterlist *t_tasks_sg_chained;
452 struct scatterlist t_tasks_sg_bounce;
453 void *t_task_buf;
454 /*
455 * Used for pre-registered fabric SGL passthrough WRITE and READ
456 * with the special SCF_PASSTHROUGH_CONTIG_TO_SG case for TCM_Loop
457 * and other HW target mode fabric modules.
458 */
459 struct scatterlist *t_task_pt_sgl;
460 struct list_head *t_mem_list;
461 /* Used for BIDI READ */
462 struct list_head *t_mem_bidi_list;
463 struct list_head t_task_list;
464} ____cacheline_aligned;
465
466struct se_task { 403struct se_task {
467 unsigned char task_sense; 404 unsigned char task_sense;
468 struct scatterlist *task_sg; 405 struct scatterlist *task_sg;
406 u32 task_sg_nents;
469 struct scatterlist *task_sg_bidi; 407 struct scatterlist *task_sg_bidi;
470 u8 task_scsi_status; 408 u8 task_scsi_status;
471 u8 task_flags; 409 u8 task_flags;
@@ -476,8 +414,6 @@ struct se_task {
476 u32 task_no; 414 u32 task_no;
477 u32 task_sectors; 415 u32 task_sectors;
478 u32 task_size; 416 u32 task_size;
479 u32 task_sg_num;
480 u32 task_sg_offset;
481 enum dma_data_direction task_data_direction; 417 enum dma_data_direction task_data_direction;
482 struct se_cmd *task_se_cmd; 418 struct se_cmd *task_se_cmd;
483 struct se_device *se_dev; 419 struct se_device *se_dev;
@@ -495,9 +431,6 @@ struct se_task {
495 struct list_head t_state_list; 431 struct list_head t_state_list;
496} ____cacheline_aligned; 432} ____cacheline_aligned;
497 433
498#define TASK_CMD(task) ((task)->task_se_cmd)
499#define TASK_DEV(task) ((task)->se_dev)
500
501struct se_cmd { 434struct se_cmd {
502 /* SAM response code being sent to initiator */ 435 /* SAM response code being sent to initiator */
503 u8 scsi_status; 436 u8 scsi_status;
@@ -531,9 +464,10 @@ struct se_cmd {
531 atomic_t transport_sent; 464 atomic_t transport_sent;
532 /* Used for sense data */ 465 /* Used for sense data */
533 void *sense_buffer; 466 void *sense_buffer;
534 struct list_head se_delayed_list; 467 struct list_head se_delayed_node;
535 struct list_head se_ordered_list; 468 struct list_head se_ordered_node;
536 struct list_head se_lun_list; 469 struct list_head se_lun_node;
470 struct list_head se_qf_node;
537 struct se_device *se_dev; 471 struct se_device *se_dev;
538 struct se_dev_entry *se_deve; 472 struct se_dev_entry *se_deve;
539 struct se_device *se_obj_ptr; 473 struct se_device *se_obj_ptr;
@@ -542,18 +476,62 @@ struct se_cmd {
542 /* Only used for internal passthrough and legacy TCM fabric modules */ 476 /* Only used for internal passthrough and legacy TCM fabric modules */
543 struct se_session *se_sess; 477 struct se_session *se_sess;
544 struct se_tmr_req *se_tmr_req; 478 struct se_tmr_req *se_tmr_req;
545 /* t_task is setup to t_task_backstore in transport_init_se_cmd() */ 479 struct list_head se_queue_node;
546 struct se_transport_task *t_task;
547 struct se_transport_task t_task_backstore;
548 struct target_core_fabric_ops *se_tfo; 480 struct target_core_fabric_ops *se_tfo;
549 int (*transport_emulate_cdb)(struct se_cmd *); 481 int (*transport_emulate_cdb)(struct se_cmd *);
550 void (*transport_split_cdb)(unsigned long long, u32 *, unsigned char *); 482 void (*transport_split_cdb)(unsigned long long, u32, unsigned char *);
551 void (*transport_wait_for_tasks)(struct se_cmd *, int, int); 483 void (*transport_wait_for_tasks)(struct se_cmd *, int, int);
552 void (*transport_complete_callback)(struct se_cmd *); 484 void (*transport_complete_callback)(struct se_cmd *);
553} ____cacheline_aligned; 485 int (*transport_qf_callback)(struct se_cmd *);
554 486
555#define T_TASK(cmd) ((cmd)->t_task) 487 unsigned char *t_task_cdb;
556#define CMD_TFO(cmd) ((cmd)->se_tfo) 488 unsigned char __t_task_cdb[TCM_MAX_COMMAND_SIZE];
489 unsigned long long t_task_lba;
490 int t_tasks_failed;
491 int t_tasks_fua;
492 bool t_tasks_bidi;
493 u32 t_tasks_sg_chained_no;
494 atomic_t t_fe_count;
495 atomic_t t_se_count;
496 atomic_t t_task_cdbs_left;
497 atomic_t t_task_cdbs_ex_left;
498 atomic_t t_task_cdbs_timeout_left;
499 atomic_t t_task_cdbs_sent;
500 atomic_t t_transport_aborted;
501 atomic_t t_transport_active;
502 atomic_t t_transport_complete;
503 atomic_t t_transport_queue_active;
504 atomic_t t_transport_sent;
505 atomic_t t_transport_stop;
506 atomic_t t_transport_timeout;
507 atomic_t transport_dev_active;
508 atomic_t transport_lun_active;
509 atomic_t transport_lun_fe_stop;
510 atomic_t transport_lun_stop;
511 spinlock_t t_state_lock;
512 struct completion t_transport_stop_comp;
513 struct completion transport_lun_fe_stop_comp;
514 struct completion transport_lun_stop_comp;
515 struct scatterlist *t_tasks_sg_chained;
516
517 /*
518 * Used for pre-registered fabric SGL passthrough WRITE and READ
519 * with the special SCF_PASSTHROUGH_CONTIG_TO_SG case for TCM_Loop
520 * and other HW target mode fabric modules.
521 */
522 struct scatterlist *t_task_pt_sgl;
523 u32 t_task_pt_sgl_num;
524
525 struct scatterlist *t_data_sg;
526 unsigned int t_data_nents;
527 struct scatterlist *t_bidi_data_sg;
528 unsigned int t_bidi_data_nents;
529
530 /* Used for BIDI READ */
531 struct list_head t_task_list;
532 u32 t_task_list_num;
533
534} ____cacheline_aligned;
557 535
558struct se_tmr_req { 536struct se_tmr_req {
559 /* Task Management function to be preformed */ 537 /* Task Management function to be preformed */
@@ -617,9 +595,6 @@ struct se_session {
617 struct list_head sess_acl_list; 595 struct list_head sess_acl_list;
618} ____cacheline_aligned; 596} ____cacheline_aligned;
619 597
620#define SE_SESS(cmd) ((cmd)->se_sess)
621#define SE_NODE_ACL(sess) ((sess)->se_node_acl)
622
623struct se_device; 598struct se_device;
624struct se_transform_info; 599struct se_transform_info;
625struct scatterlist; 600struct scatterlist;
@@ -640,8 +615,6 @@ struct se_lun_acl {
640 struct se_ml_stat_grps ml_stat_grps; 615 struct se_ml_stat_grps ml_stat_grps;
641} ____cacheline_aligned; 616} ____cacheline_aligned;
642 617
643#define ML_STAT_GRPS(lacl) (&(lacl)->ml_stat_grps)
644
645struct se_dev_entry { 618struct se_dev_entry {
646 bool def_pr_registered; 619 bool def_pr_registered;
647 /* See transport_lunflags_table */ 620 /* See transport_lunflags_table */
@@ -688,6 +661,8 @@ struct se_dev_attrib {
688 int emulate_reservations; 661 int emulate_reservations;
689 int emulate_alua; 662 int emulate_alua;
690 int enforce_pr_isids; 663 int enforce_pr_isids;
664 int is_nonrot;
665 int emulate_rest_reord;
691 u32 hw_block_size; 666 u32 hw_block_size;
692 u32 block_size; 667 u32 block_size;
693 u32 hw_max_sectors; 668 u32 hw_max_sectors;
@@ -727,10 +702,10 @@ struct se_subsystem_dev {
727 /* T10 Inquiry and VPD WWN Information */ 702 /* T10 Inquiry and VPD WWN Information */
728 struct t10_wwn t10_wwn; 703 struct t10_wwn t10_wwn;
729 /* T10 SPC-2 + SPC-3 Reservations */ 704 /* T10 SPC-2 + SPC-3 Reservations */
730 struct t10_reservation_template t10_reservation; 705 struct t10_reservation t10_pr;
731 spinlock_t se_dev_lock; 706 spinlock_t se_dev_lock;
732 void *se_dev_su_ptr; 707 void *se_dev_su_ptr;
733 struct list_head g_se_dev_list; 708 struct list_head se_dev_node;
734 struct config_group se_dev_group; 709 struct config_group se_dev_group;
735 /* For T10 Reservations */ 710 /* For T10 Reservations */
736 struct config_group se_dev_pr_group; 711 struct config_group se_dev_pr_group;
@@ -738,11 +713,6 @@ struct se_subsystem_dev {
738 struct se_dev_stat_grps dev_stat_grps; 713 struct se_dev_stat_grps dev_stat_grps;
739} ____cacheline_aligned; 714} ____cacheline_aligned;
740 715
741#define T10_ALUA(su_dev) (&(su_dev)->t10_alua)
742#define T10_RES(su_dev) (&(su_dev)->t10_reservation)
743#define T10_PR_OPS(su_dev) (&(su_dev)->t10_reservation.pr_ops)
744#define DEV_STAT_GRP(dev) (&(dev)->dev_stat_grps)
745
746struct se_device { 716struct se_device {
747 /* Set to 1 if thread is NOT sleeping on thread_sem */ 717 /* Set to 1 if thread is NOT sleeping on thread_sem */
748 u8 thread_active; 718 u8 thread_active;
@@ -780,11 +750,11 @@ struct se_device {
780 atomic_t dev_status_thr_count; 750 atomic_t dev_status_thr_count;
781 atomic_t dev_hoq_count; 751 atomic_t dev_hoq_count;
782 atomic_t dev_ordered_sync; 752 atomic_t dev_ordered_sync;
753 atomic_t dev_qf_count;
783 struct se_obj dev_obj; 754 struct se_obj dev_obj;
784 struct se_obj dev_access_obj; 755 struct se_obj dev_access_obj;
785 struct se_obj dev_export_obj; 756 struct se_obj dev_export_obj;
786 struct se_queue_obj *dev_queue_obj; 757 struct se_queue_obj dev_queue_obj;
787 struct se_queue_obj *dev_status_queue_obj;
788 spinlock_t delayed_cmd_lock; 758 spinlock_t delayed_cmd_lock;
789 spinlock_t ordered_cmd_lock; 759 spinlock_t ordered_cmd_lock;
790 spinlock_t execute_task_lock; 760 spinlock_t execute_task_lock;
@@ -796,6 +766,7 @@ struct se_device {
796 spinlock_t dev_status_thr_lock; 766 spinlock_t dev_status_thr_lock;
797 spinlock_t se_port_lock; 767 spinlock_t se_port_lock;
798 spinlock_t se_tmr_lock; 768 spinlock_t se_tmr_lock;
769 spinlock_t qf_cmd_lock;
799 /* Used for legacy SPC-2 reservationsa */ 770 /* Used for legacy SPC-2 reservationsa */
800 struct se_node_acl *dev_reserved_node_acl; 771 struct se_node_acl *dev_reserved_node_acl;
801 /* Used for ALUA Logical Unit Group membership */ 772 /* Used for ALUA Logical Unit Group membership */
@@ -809,10 +780,12 @@ struct se_device {
809 struct task_struct *process_thread; 780 struct task_struct *process_thread;
810 pid_t process_thread_pid; 781 pid_t process_thread_pid;
811 struct task_struct *dev_mgmt_thread; 782 struct task_struct *dev_mgmt_thread;
783 struct work_struct qf_work_queue;
812 struct list_head delayed_cmd_list; 784 struct list_head delayed_cmd_list;
813 struct list_head ordered_cmd_list; 785 struct list_head ordered_cmd_list;
814 struct list_head execute_task_list; 786 struct list_head execute_task_list;
815 struct list_head state_task_list; 787 struct list_head state_task_list;
788 struct list_head qf_cmd_list;
816 /* Pointer to associated SE HBA */ 789 /* Pointer to associated SE HBA */
817 struct se_hba *se_hba; 790 struct se_hba *se_hba;
818 struct se_subsystem_dev *se_sub_dev; 791 struct se_subsystem_dev *se_sub_dev;
@@ -824,11 +797,6 @@ struct se_device {
824 struct list_head g_se_dev_list; 797 struct list_head g_se_dev_list;
825} ____cacheline_aligned; 798} ____cacheline_aligned;
826 799
827#define SE_DEV(cmd) ((cmd)->se_lun->lun_se_dev)
828#define SU_DEV(dev) ((dev)->se_sub_dev)
829#define DEV_ATTRIB(dev) (&(dev)->se_sub_dev->se_dev_attrib)
830#define DEV_T10_WWN(dev) (&(dev)->se_sub_dev->t10_wwn)
831
832struct se_hba { 800struct se_hba {
833 u16 hba_tpgt; 801 u16 hba_tpgt;
834 u32 hba_id; 802 u32 hba_id;
@@ -837,24 +805,17 @@ struct se_hba {
837 /* Virtual iSCSI devices attached. */ 805 /* Virtual iSCSI devices attached. */
838 u32 dev_count; 806 u32 dev_count;
839 u32 hba_index; 807 u32 hba_index;
840 atomic_t load_balance_queue;
841 atomic_t left_queue_depth;
842 /* Maximum queue depth the HBA can handle. */
843 atomic_t max_queue_depth;
844 /* Pointer to transport specific host structure. */ 808 /* Pointer to transport specific host structure. */
845 void *hba_ptr; 809 void *hba_ptr;
846 /* Linked list for struct se_device */ 810 /* Linked list for struct se_device */
847 struct list_head hba_dev_list; 811 struct list_head hba_dev_list;
848 struct list_head hba_list; 812 struct list_head hba_node;
849 spinlock_t device_lock; 813 spinlock_t device_lock;
850 spinlock_t hba_queue_lock;
851 struct config_group hba_group; 814 struct config_group hba_group;
852 struct mutex hba_access_mutex; 815 struct mutex hba_access_mutex;
853 struct se_subsystem_api *transport; 816 struct se_subsystem_api *transport;
854} ____cacheline_aligned; 817} ____cacheline_aligned;
855 818
856#define SE_HBA(dev) ((dev)->se_hba)
857
858struct se_port_stat_grps { 819struct se_port_stat_grps {
859 struct config_group stat_group; 820 struct config_group stat_group;
860 struct config_group scsi_port_group; 821 struct config_group scsi_port_group;
@@ -881,9 +842,6 @@ struct se_lun {
881 struct se_port_stat_grps port_stat_grps; 842 struct se_port_stat_grps port_stat_grps;
882} ____cacheline_aligned; 843} ____cacheline_aligned;
883 844
884#define SE_LUN(cmd) ((cmd)->se_lun)
885#define PORT_STAT_GRP(lun) (&(lun)->port_stat_grps)
886
887struct scsi_port_stats { 845struct scsi_port_stats {
888 u64 cmd_pdus; 846 u64 cmd_pdus;
889 u64 tx_data_octets; 847 u64 tx_data_octets;
@@ -930,7 +888,7 @@ struct se_portal_group {
930 spinlock_t tpg_lun_lock; 888 spinlock_t tpg_lun_lock;
931 /* Pointer to $FABRIC_MOD portal group */ 889 /* Pointer to $FABRIC_MOD portal group */
932 void *se_tpg_fabric_ptr; 890 void *se_tpg_fabric_ptr;
933 struct list_head se_tpg_list; 891 struct list_head se_tpg_node;
934 /* linked list for initiator ACL list */ 892 /* linked list for initiator ACL list */
935 struct list_head acl_node_list; 893 struct list_head acl_node_list;
936 struct se_lun *tpg_lun_list; 894 struct se_lun *tpg_lun_list;
@@ -949,8 +907,6 @@ struct se_portal_group {
949 struct config_group tpg_param_group; 907 struct config_group tpg_param_group;
950} ____cacheline_aligned; 908} ____cacheline_aligned;
951 909
952#define TPG_TFO(se_tpg) ((se_tpg)->se_tpg_tfo)
953
954struct se_wwn { 910struct se_wwn {
955 struct target_fabric_configfs *wwn_tf; 911 struct target_fabric_configfs *wwn_tf;
956 struct config_group wwn_group; 912 struct config_group wwn_group;
@@ -958,28 +914,4 @@ struct se_wwn {
958 struct config_group fabric_stat_group; 914 struct config_group fabric_stat_group;
959} ____cacheline_aligned; 915} ____cacheline_aligned;
960 916
961struct se_global {
962 u16 alua_lu_gps_counter;
963 int g_sub_api_initialized;
964 u32 in_shutdown;
965 u32 alua_lu_gps_count;
966 u32 g_hba_id_counter;
967 struct config_group target_core_hbagroup;
968 struct config_group alua_group;
969 struct config_group alua_lu_gps_group;
970 struct list_head g_lu_gps_list;
971 struct list_head g_se_tpg_list;
972 struct list_head g_hba_list;
973 struct list_head g_se_dev_list;
974 struct se_hba *g_lun0_hba;
975 struct se_subsystem_dev *g_lun0_su_dev;
976 struct se_device *g_lun0_dev;
977 struct t10_alua_lu_gp *default_lu_gp;
978 spinlock_t g_device_lock;
979 spinlock_t hba_lock;
980 spinlock_t se_tpg_lock;
981 spinlock_t lu_gps_lock;
982 spinlock_t plugin_class_lock;
983} ____cacheline_aligned;
984
985#endif /* TARGET_CORE_BASE_H */ 917#endif /* TARGET_CORE_BASE_H */
diff --git a/include/target/target_core_device.h b/include/target/target_core_device.h
index 52b18a5752c9..46571912086c 100644
--- a/include/target/target_core_device.h
+++ b/include/target/target_core_device.h
@@ -1,8 +1,8 @@
1#ifndef TARGET_CORE_DEVICE_H 1#ifndef TARGET_CORE_DEVICE_H
2#define TARGET_CORE_DEVICE_H 2#define TARGET_CORE_DEVICE_H
3 3
4extern int transport_get_lun_for_cmd(struct se_cmd *, unsigned char *, u32); 4extern int transport_lookup_cmd_lun(struct se_cmd *, u32);
5extern int transport_get_lun_for_tmr(struct se_cmd *, u32); 5extern int transport_lookup_tmr_lun(struct se_cmd *, u32);
6extern struct se_dev_entry *core_get_se_deve_from_rtpi( 6extern struct se_dev_entry *core_get_se_deve_from_rtpi(
7 struct se_node_acl *, u16); 7 struct se_node_acl *, u16);
8extern int core_free_device_list_for_node(struct se_node_acl *, 8extern int core_free_device_list_for_node(struct se_node_acl *,
@@ -39,6 +39,8 @@ extern int se_dev_set_emulate_tas(struct se_device *, int);
39extern int se_dev_set_emulate_tpu(struct se_device *, int); 39extern int se_dev_set_emulate_tpu(struct se_device *, int);
40extern int se_dev_set_emulate_tpws(struct se_device *, int); 40extern int se_dev_set_emulate_tpws(struct se_device *, int);
41extern int se_dev_set_enforce_pr_isids(struct se_device *, int); 41extern int se_dev_set_enforce_pr_isids(struct se_device *, int);
42extern int se_dev_set_is_nonrot(struct se_device *, int);
43extern int se_dev_set_emulate_rest_reord(struct se_device *dev, int);
42extern int se_dev_set_queue_depth(struct se_device *, u32); 44extern int se_dev_set_queue_depth(struct se_device *, u32);
43extern int se_dev_set_max_sectors(struct se_device *, u32); 45extern int se_dev_set_max_sectors(struct se_device *, u32);
44extern int se_dev_set_optimal_sectors(struct se_device *, u32); 46extern int se_dev_set_optimal_sectors(struct se_device *, u32);
diff --git a/include/target/target_core_fabric_ops.h b/include/target/target_core_fabric_ops.h
index 747e1404dca0..2de8fe907596 100644
--- a/include/target/target_core_fabric_ops.h
+++ b/include/target/target_core_fabric_ops.h
@@ -39,17 +39,11 @@ struct target_core_fabric_ops {
39 */ 39 */
40 int (*new_cmd_map)(struct se_cmd *); 40 int (*new_cmd_map)(struct se_cmd *);
41 /* 41 /*
42 * Optional function pointer for TCM fabric modules that use
43 * Linux/NET sockets to allocate struct iovec array to struct se_cmd
44 */
45 int (*alloc_cmd_iovecs)(struct se_cmd *);
46 /*
47 * Optional to release struct se_cmd and fabric dependent allocated 42 * Optional to release struct se_cmd and fabric dependent allocated
48 * I/O descriptor in transport_cmd_check_stop() 43 * I/O descriptor in transport_cmd_check_stop()
49 */ 44 */
50 void (*check_stop_free)(struct se_cmd *); 45 void (*check_stop_free)(struct se_cmd *);
51 void (*release_cmd_to_pool)(struct se_cmd *); 46 void (*release_cmd)(struct se_cmd *);
52 void (*release_cmd_direct)(struct se_cmd *);
53 /* 47 /*
54 * Called with spin_lock_bh(struct se_portal_group->session_lock held. 48 * Called with spin_lock_bh(struct se_portal_group->session_lock held.
55 */ 49 */
@@ -70,7 +64,6 @@ struct target_core_fabric_ops {
70 void (*set_default_node_attributes)(struct se_node_acl *); 64 void (*set_default_node_attributes)(struct se_node_acl *);
71 u32 (*get_task_tag)(struct se_cmd *); 65 u32 (*get_task_tag)(struct se_cmd *);
72 int (*get_cmd_state)(struct se_cmd *); 66 int (*get_cmd_state)(struct se_cmd *);
73 void (*new_cmd_failure)(struct se_cmd *);
74 int (*queue_data_in)(struct se_cmd *); 67 int (*queue_data_in)(struct se_cmd *);
75 int (*queue_status)(struct se_cmd *); 68 int (*queue_status)(struct se_cmd *);
76 int (*queue_tm_rsp)(struct se_cmd *); 69 int (*queue_tm_rsp)(struct se_cmd *);
diff --git a/include/target/target_core_transport.h b/include/target/target_core_transport.h
index 24a1c6cb83c3..46aae4f94ede 100644
--- a/include/target/target_core_transport.h
+++ b/include/target/target_core_transport.h
@@ -101,6 +101,10 @@
101#define DA_ENFORCE_PR_ISIDS 1 101#define DA_ENFORCE_PR_ISIDS 1
102#define DA_STATUS_MAX_SECTORS_MIN 16 102#define DA_STATUS_MAX_SECTORS_MIN 16
103#define DA_STATUS_MAX_SECTORS_MAX 8192 103#define DA_STATUS_MAX_SECTORS_MAX 8192
104/* By default don't report non-rotating (solid state) medium */
105#define DA_IS_NONROT 0
106/* Queue Algorithm Modifier default for restricted reordering in control mode page */
107#define DA_EMULATE_REST_REORD 0
104 108
105#define SE_MODE_PAGE_BUF 512 109#define SE_MODE_PAGE_BUF 512
106 110
@@ -111,9 +115,8 @@ struct se_subsystem_api;
111 115
112extern struct kmem_cache *se_mem_cache; 116extern struct kmem_cache *se_mem_cache;
113 117
114extern int init_se_global(void); 118extern int init_se_kmem_caches(void);
115extern void release_se_global(void); 119extern void release_se_kmem_caches(void);
116extern void init_scsi_index_table(void);
117extern u32 scsi_get_new_index(scsi_index_t); 120extern u32 scsi_get_new_index(scsi_index_t);
118extern void transport_init_queue_obj(struct se_queue_obj *); 121extern void transport_init_queue_obj(struct se_queue_obj *);
119extern int transport_subsystem_check_init(void); 122extern int transport_subsystem_check_init(void);
@@ -160,36 +163,38 @@ extern struct se_device *transport_add_device_to_core_hba(struct se_hba *,
160 struct se_subsystem_dev *, u32, 163 struct se_subsystem_dev *, u32,
161 void *, struct se_dev_limits *, 164 void *, struct se_dev_limits *,
162 const char *, const char *); 165 const char *, const char *);
163extern void transport_device_setup_cmd(struct se_cmd *);
164extern void transport_init_se_cmd(struct se_cmd *, 166extern void transport_init_se_cmd(struct se_cmd *,
165 struct target_core_fabric_ops *, 167 struct target_core_fabric_ops *,
166 struct se_session *, u32, int, int, 168 struct se_session *, u32, int, int,
167 unsigned char *); 169 unsigned char *);
170void *transport_kmap_first_data_page(struct se_cmd *cmd);
171void transport_kunmap_first_data_page(struct se_cmd *cmd);
168extern void transport_free_se_cmd(struct se_cmd *); 172extern void transport_free_se_cmd(struct se_cmd *);
169extern int transport_generic_allocate_tasks(struct se_cmd *, unsigned char *); 173extern int transport_generic_allocate_tasks(struct se_cmd *, unsigned char *);
170extern int transport_generic_handle_cdb(struct se_cmd *); 174extern int transport_generic_handle_cdb(struct se_cmd *);
175extern int transport_handle_cdb_direct(struct se_cmd *);
171extern int transport_generic_handle_cdb_map(struct se_cmd *); 176extern int transport_generic_handle_cdb_map(struct se_cmd *);
172extern int transport_generic_handle_data(struct se_cmd *); 177extern int transport_generic_handle_data(struct se_cmd *);
173extern void transport_new_cmd_failure(struct se_cmd *); 178extern void transport_new_cmd_failure(struct se_cmd *);
174extern int transport_generic_handle_tmr(struct se_cmd *); 179extern int transport_generic_handle_tmr(struct se_cmd *);
175extern void transport_generic_free_cmd_intr(struct se_cmd *); 180extern void transport_generic_free_cmd_intr(struct se_cmd *);
176extern void __transport_stop_task_timer(struct se_task *, unsigned long *); 181extern void __transport_stop_task_timer(struct se_task *, unsigned long *);
177extern unsigned char transport_asciihex_to_binaryhex(unsigned char val[2]);
178extern int transport_generic_map_mem_to_cmd(struct se_cmd *cmd, struct scatterlist *, u32, 182extern int transport_generic_map_mem_to_cmd(struct se_cmd *cmd, struct scatterlist *, u32,
179 struct scatterlist *, u32); 183 struct scatterlist *, u32);
180extern int transport_clear_lun_from_sessions(struct se_lun *); 184extern int transport_clear_lun_from_sessions(struct se_lun *);
181extern int transport_check_aborted_status(struct se_cmd *, int); 185extern int transport_check_aborted_status(struct se_cmd *, int);
182extern int transport_send_check_condition_and_sense(struct se_cmd *, u8, int); 186extern int transport_send_check_condition_and_sense(struct se_cmd *, u8, int);
183extern void transport_send_task_abort(struct se_cmd *); 187extern void transport_send_task_abort(struct se_cmd *);
184extern void transport_release_cmd_to_pool(struct se_cmd *); 188extern void transport_release_cmd(struct se_cmd *);
185extern void transport_generic_free_cmd(struct se_cmd *, int, int, int); 189extern void transport_generic_free_cmd(struct se_cmd *, int, int);
186extern void transport_generic_wait_for_cmds(struct se_cmd *, int); 190extern void transport_generic_wait_for_cmds(struct se_cmd *, int);
187extern u32 transport_calc_sg_num(struct se_task *, struct se_mem *, u32); 191extern int transport_init_task_sg(struct se_task *, struct se_mem *, u32);
188extern int transport_map_mem_to_sg(struct se_task *, struct list_head *, 192extern int transport_map_mem_to_sg(struct se_task *, struct list_head *,
189 void *, struct se_mem *, 193 struct scatterlist *, struct se_mem *,
190 struct se_mem **, u32 *, u32 *); 194 struct se_mem **, u32 *, u32 *);
191extern void transport_do_task_sg_chain(struct se_cmd *); 195extern void transport_do_task_sg_chain(struct se_cmd *);
192extern void transport_generic_process_write(struct se_cmd *); 196extern void transport_generic_process_write(struct se_cmd *);
197extern int transport_generic_new_cmd(struct se_cmd *);
193extern int transport_generic_do_tmr(struct se_cmd *); 198extern int transport_generic_do_tmr(struct se_cmd *);
194/* From target_core_alua.c */ 199/* From target_core_alua.c */
195extern int core_alua_check_nonop_delay(struct se_cmd *); 200extern int core_alua_check_nonop_delay(struct se_cmd *);
@@ -235,13 +240,13 @@ struct se_subsystem_api {
235 */ 240 */
236 int (*cdb_none)(struct se_task *); 241 int (*cdb_none)(struct se_task *);
237 /* 242 /*
238 * For SCF_SCSI_CONTROL_NONSG_IO_CDB 243 * For SCF_SCSI_DATA_SG_IO_CDB
239 */ 244 */
240 int (*map_task_non_SG)(struct se_task *); 245 int (*map_data_SG)(struct se_task *);
241 /* 246 /*
242 * For SCF_SCSI_DATA_SG_IO_CDB and SCF_SCSI_CONTROL_SG_IO_CDB 247 * For SCF_SCSI_CONTROL_SG_IO_CDB
243 */ 248 */
244 int (*map_task_SG)(struct se_task *); 249 int (*map_control_SG)(struct se_task *);
245 /* 250 /*
246 * attach_hba(): 251 * attach_hba():
247 */ 252 */
@@ -292,7 +297,7 @@ struct se_subsystem_api {
292 * drivers. Provided out of convenience. 297 * drivers. Provided out of convenience.
293 */ 298 */
294 int (*transport_complete)(struct se_task *task); 299 int (*transport_complete)(struct se_task *task);
295 struct se_task *(*alloc_task)(struct se_cmd *); 300 struct se_task *(*alloc_task)(unsigned char *cdb);
296 /* 301 /*
297 * do_task(): 302 * do_task():
298 */ 303 */
@@ -342,19 +347,9 @@ struct se_subsystem_api {
342 */ 347 */
343 sector_t (*get_blocks)(struct se_device *); 348 sector_t (*get_blocks)(struct se_device *);
344 /* 349 /*
345 * do_se_mem_map():
346 */
347 int (*do_se_mem_map)(struct se_task *, struct list_head *, void *,
348 struct se_mem *, struct se_mem **, u32 *, u32 *);
349 /*
350 * get_sense_buffer(): 350 * get_sense_buffer():
351 */ 351 */
352 unsigned char *(*get_sense_buffer)(struct se_task *); 352 unsigned char *(*get_sense_buffer)(struct se_task *);
353} ____cacheline_aligned; 353} ____cacheline_aligned;
354 354
355#define TRANSPORT(dev) ((dev)->transport)
356#define HBA_TRANSPORT(hba) ((hba)->transport)
357
358extern struct se_global *se_global;
359
360#endif /* TARGET_CORE_TRANSPORT_H */ 355#endif /* TARGET_CORE_TRANSPORT_H */
diff --git a/include/trace/events/btrfs.h b/include/trace/events/btrfs.h
index 4114129f0794..b31702ac15be 100644
--- a/include/trace/events/btrfs.h
+++ b/include/trace/events/btrfs.h
@@ -284,7 +284,6 @@ DECLARE_EVENT_CLASS(btrfs__writepage,
284 __field( long, pages_skipped ) 284 __field( long, pages_skipped )
285 __field( loff_t, range_start ) 285 __field( loff_t, range_start )
286 __field( loff_t, range_end ) 286 __field( loff_t, range_end )
287 __field( char, nonblocking )
288 __field( char, for_kupdate ) 287 __field( char, for_kupdate )
289 __field( char, for_reclaim ) 288 __field( char, for_reclaim )
290 __field( char, range_cyclic ) 289 __field( char, range_cyclic )
@@ -299,7 +298,6 @@ DECLARE_EVENT_CLASS(btrfs__writepage,
299 __entry->pages_skipped = wbc->pages_skipped; 298 __entry->pages_skipped = wbc->pages_skipped;
300 __entry->range_start = wbc->range_start; 299 __entry->range_start = wbc->range_start;
301 __entry->range_end = wbc->range_end; 300 __entry->range_end = wbc->range_end;
302 __entry->nonblocking = wbc->nonblocking;
303 __entry->for_kupdate = wbc->for_kupdate; 301 __entry->for_kupdate = wbc->for_kupdate;
304 __entry->for_reclaim = wbc->for_reclaim; 302 __entry->for_reclaim = wbc->for_reclaim;
305 __entry->range_cyclic = wbc->range_cyclic; 303 __entry->range_cyclic = wbc->range_cyclic;
@@ -310,13 +308,13 @@ DECLARE_EVENT_CLASS(btrfs__writepage,
310 308
311 TP_printk("root = %llu(%s), ino = %lu, page_index = %lu, " 309 TP_printk("root = %llu(%s), ino = %lu, page_index = %lu, "
312 "nr_to_write = %ld, pages_skipped = %ld, range_start = %llu, " 310 "nr_to_write = %ld, pages_skipped = %ld, range_start = %llu, "
313 "range_end = %llu, nonblocking = %d, for_kupdate = %d, " 311 "range_end = %llu, for_kupdate = %d, "
314 "for_reclaim = %d, range_cyclic = %d, writeback_index = %lu", 312 "for_reclaim = %d, range_cyclic = %d, writeback_index = %lu",
315 show_root_type(__entry->root_objectid), 313 show_root_type(__entry->root_objectid),
316 (unsigned long)__entry->ino, __entry->index, 314 (unsigned long)__entry->ino, __entry->index,
317 __entry->nr_to_write, __entry->pages_skipped, 315 __entry->nr_to_write, __entry->pages_skipped,
318 __entry->range_start, __entry->range_end, 316 __entry->range_start, __entry->range_end,
319 __entry->nonblocking, __entry->for_kupdate, 317 __entry->for_kupdate,
320 __entry->for_reclaim, __entry->range_cyclic, 318 __entry->for_reclaim, __entry->range_cyclic,
321 (unsigned long)__entry->writeback_index) 319 (unsigned long)__entry->writeback_index)
322); 320);
diff --git a/include/trace/events/ext3.h b/include/trace/events/ext3.h
new file mode 100644
index 000000000000..7b53c0573dc9
--- /dev/null
+++ b/include/trace/events/ext3.h
@@ -0,0 +1,864 @@
1#undef TRACE_SYSTEM
2#define TRACE_SYSTEM ext3
3
4#if !defined(_TRACE_EXT3_H) || defined(TRACE_HEADER_MULTI_READ)
5#define _TRACE_EXT3_H
6
7#include <linux/tracepoint.h>
8
9TRACE_EVENT(ext3_free_inode,
10 TP_PROTO(struct inode *inode),
11
12 TP_ARGS(inode),
13
14 TP_STRUCT__entry(
15 __field( dev_t, dev )
16 __field( ino_t, ino )
17 __field( umode_t, mode )
18 __field( uid_t, uid )
19 __field( gid_t, gid )
20 __field( blkcnt_t, blocks )
21 ),
22
23 TP_fast_assign(
24 __entry->dev = inode->i_sb->s_dev;
25 __entry->ino = inode->i_ino;
26 __entry->mode = inode->i_mode;
27 __entry->uid = inode->i_uid;
28 __entry->gid = inode->i_gid;
29 __entry->blocks = inode->i_blocks;
30 ),
31
32 TP_printk("dev %d,%d ino %lu mode 0%o uid %u gid %u blocks %lu",
33 MAJOR(__entry->dev), MINOR(__entry->dev),
34 (unsigned long) __entry->ino,
35 __entry->mode, __entry->uid, __entry->gid,
36 (unsigned long) __entry->blocks)
37);
38
39TRACE_EVENT(ext3_request_inode,
40 TP_PROTO(struct inode *dir, int mode),
41
42 TP_ARGS(dir, mode),
43
44 TP_STRUCT__entry(
45 __field( dev_t, dev )
46 __field( ino_t, dir )
47 __field( umode_t, mode )
48 ),
49
50 TP_fast_assign(
51 __entry->dev = dir->i_sb->s_dev;
52 __entry->dir = dir->i_ino;
53 __entry->mode = mode;
54 ),
55
56 TP_printk("dev %d,%d dir %lu mode 0%o",
57 MAJOR(__entry->dev), MINOR(__entry->dev),
58 (unsigned long) __entry->dir, __entry->mode)
59);
60
61TRACE_EVENT(ext3_allocate_inode,
62 TP_PROTO(struct inode *inode, struct inode *dir, int mode),
63
64 TP_ARGS(inode, dir, mode),
65
66 TP_STRUCT__entry(
67 __field( dev_t, dev )
68 __field( ino_t, ino )
69 __field( ino_t, dir )
70 __field( umode_t, mode )
71 ),
72
73 TP_fast_assign(
74 __entry->dev = inode->i_sb->s_dev;
75 __entry->ino = inode->i_ino;
76 __entry->dir = dir->i_ino;
77 __entry->mode = mode;
78 ),
79
80 TP_printk("dev %d,%d ino %lu dir %lu mode 0%o",
81 MAJOR(__entry->dev), MINOR(__entry->dev),
82 (unsigned long) __entry->ino,
83 (unsigned long) __entry->dir, __entry->mode)
84);
85
86TRACE_EVENT(ext3_evict_inode,
87 TP_PROTO(struct inode *inode),
88
89 TP_ARGS(inode),
90
91 TP_STRUCT__entry(
92 __field( dev_t, dev )
93 __field( ino_t, ino )
94 __field( int, nlink )
95 ),
96
97 TP_fast_assign(
98 __entry->dev = inode->i_sb->s_dev;
99 __entry->ino = inode->i_ino;
100 __entry->nlink = inode->i_nlink;
101 ),
102
103 TP_printk("dev %d,%d ino %lu nlink %d",
104 MAJOR(__entry->dev), MINOR(__entry->dev),
105 (unsigned long) __entry->ino, __entry->nlink)
106);
107
108TRACE_EVENT(ext3_drop_inode,
109 TP_PROTO(struct inode *inode, int drop),
110
111 TP_ARGS(inode, drop),
112
113 TP_STRUCT__entry(
114 __field( dev_t, dev )
115 __field( ino_t, ino )
116 __field( int, drop )
117 ),
118
119 TP_fast_assign(
120 __entry->dev = inode->i_sb->s_dev;
121 __entry->ino = inode->i_ino;
122 __entry->drop = drop;
123 ),
124
125 TP_printk("dev %d,%d ino %lu drop %d",
126 MAJOR(__entry->dev), MINOR(__entry->dev),
127 (unsigned long) __entry->ino, __entry->drop)
128);
129
130TRACE_EVENT(ext3_mark_inode_dirty,
131 TP_PROTO(struct inode *inode, unsigned long IP),
132
133 TP_ARGS(inode, IP),
134
135 TP_STRUCT__entry(
136 __field( dev_t, dev )
137 __field( ino_t, ino )
138 __field(unsigned long, ip )
139 ),
140
141 TP_fast_assign(
142 __entry->dev = inode->i_sb->s_dev;
143 __entry->ino = inode->i_ino;
144 __entry->ip = IP;
145 ),
146
147 TP_printk("dev %d,%d ino %lu caller %pF",
148 MAJOR(__entry->dev), MINOR(__entry->dev),
149 (unsigned long) __entry->ino, (void *)__entry->ip)
150);
151
152TRACE_EVENT(ext3_write_begin,
153 TP_PROTO(struct inode *inode, loff_t pos, unsigned int len,
154 unsigned int flags),
155
156 TP_ARGS(inode, pos, len, flags),
157
158 TP_STRUCT__entry(
159 __field( dev_t, dev )
160 __field( ino_t, ino )
161 __field( loff_t, pos )
162 __field( unsigned int, len )
163 __field( unsigned int, flags )
164 ),
165
166 TP_fast_assign(
167 __entry->dev = inode->i_sb->s_dev;
168 __entry->ino = inode->i_ino;
169 __entry->pos = pos;
170 __entry->len = len;
171 __entry->flags = flags;
172 ),
173
174 TP_printk("dev %d,%d ino %lu pos %llu len %u flags %u",
175 MAJOR(__entry->dev), MINOR(__entry->dev),
176 (unsigned long) __entry->ino,
177 (unsigned long long) __entry->pos, __entry->len,
178 __entry->flags)
179);
180
181DECLARE_EVENT_CLASS(ext3__write_end,
182 TP_PROTO(struct inode *inode, loff_t pos, unsigned int len,
183 unsigned int copied),
184
185 TP_ARGS(inode, pos, len, copied),
186
187 TP_STRUCT__entry(
188 __field( dev_t, dev )
189 __field( ino_t, ino )
190 __field( loff_t, pos )
191 __field( unsigned int, len )
192 __field( unsigned int, copied )
193 ),
194
195 TP_fast_assign(
196 __entry->dev = inode->i_sb->s_dev;
197 __entry->ino = inode->i_ino;
198 __entry->pos = pos;
199 __entry->len = len;
200 __entry->copied = copied;
201 ),
202
203 TP_printk("dev %d,%d ino %lu pos %llu len %u copied %u",
204 MAJOR(__entry->dev), MINOR(__entry->dev),
205 (unsigned long) __entry->ino,
206 (unsigned long long) __entry->pos, __entry->len,
207 __entry->copied)
208);
209
210DEFINE_EVENT(ext3__write_end, ext3_ordered_write_end,
211
212 TP_PROTO(struct inode *inode, loff_t pos, unsigned int len,
213 unsigned int copied),
214
215 TP_ARGS(inode, pos, len, copied)
216);
217
218DEFINE_EVENT(ext3__write_end, ext3_writeback_write_end,
219
220 TP_PROTO(struct inode *inode, loff_t pos, unsigned int len,
221 unsigned int copied),
222
223 TP_ARGS(inode, pos, len, copied)
224);
225
226DEFINE_EVENT(ext3__write_end, ext3_journalled_write_end,
227
228 TP_PROTO(struct inode *inode, loff_t pos, unsigned int len,
229 unsigned int copied),
230
231 TP_ARGS(inode, pos, len, copied)
232);
233
234DECLARE_EVENT_CLASS(ext3__page_op,
235 TP_PROTO(struct page *page),
236
237 TP_ARGS(page),
238
239 TP_STRUCT__entry(
240 __field( dev_t, dev )
241 __field( ino_t, ino )
242 __field( pgoff_t, index )
243
244 ),
245
246 TP_fast_assign(
247 __entry->index = page->index;
248 __entry->ino = page->mapping->host->i_ino;
249 __entry->dev = page->mapping->host->i_sb->s_dev;
250 ),
251
252 TP_printk("dev %d,%d ino %lu page_index %lu",
253 MAJOR(__entry->dev), MINOR(__entry->dev),
254 (unsigned long) __entry->ino, __entry->index)
255);
256
257DEFINE_EVENT(ext3__page_op, ext3_ordered_writepage,
258
259 TP_PROTO(struct page *page),
260
261 TP_ARGS(page)
262);
263
264DEFINE_EVENT(ext3__page_op, ext3_writeback_writepage,
265
266 TP_PROTO(struct page *page),
267
268 TP_ARGS(page)
269);
270
271DEFINE_EVENT(ext3__page_op, ext3_journalled_writepage,
272
273 TP_PROTO(struct page *page),
274
275 TP_ARGS(page)
276);
277
278DEFINE_EVENT(ext3__page_op, ext3_readpage,
279
280 TP_PROTO(struct page *page),
281
282 TP_ARGS(page)
283);
284
285DEFINE_EVENT(ext3__page_op, ext3_releasepage,
286
287 TP_PROTO(struct page *page),
288
289 TP_ARGS(page)
290);
291
292TRACE_EVENT(ext3_invalidatepage,
293 TP_PROTO(struct page *page, unsigned long offset),
294
295 TP_ARGS(page, offset),
296
297 TP_STRUCT__entry(
298 __field( pgoff_t, index )
299 __field( unsigned long, offset )
300 __field( ino_t, ino )
301 __field( dev_t, dev )
302
303 ),
304
305 TP_fast_assign(
306 __entry->index = page->index;
307 __entry->offset = offset;
308 __entry->ino = page->mapping->host->i_ino;
309 __entry->dev = page->mapping->host->i_sb->s_dev;
310 ),
311
312 TP_printk("dev %d,%d ino %lu page_index %lu offset %lu",
313 MAJOR(__entry->dev), MINOR(__entry->dev),
314 (unsigned long) __entry->ino,
315 __entry->index, __entry->offset)
316);
317
318TRACE_EVENT(ext3_discard_blocks,
319 TP_PROTO(struct super_block *sb, unsigned long blk,
320 unsigned long count),
321
322 TP_ARGS(sb, blk, count),
323
324 TP_STRUCT__entry(
325 __field( dev_t, dev )
326 __field( unsigned long, blk )
327 __field( unsigned long, count )
328
329 ),
330
331 TP_fast_assign(
332 __entry->dev = sb->s_dev;
333 __entry->blk = blk;
334 __entry->count = count;
335 ),
336
337 TP_printk("dev %d,%d blk %lu count %lu",
338 MAJOR(__entry->dev), MINOR(__entry->dev),
339 __entry->blk, __entry->count)
340);
341
342TRACE_EVENT(ext3_request_blocks,
343 TP_PROTO(struct inode *inode, unsigned long goal,
344 unsigned long count),
345
346 TP_ARGS(inode, goal, count),
347
348 TP_STRUCT__entry(
349 __field( dev_t, dev )
350 __field( ino_t, ino )
351 __field( unsigned long, count )
352 __field( unsigned long, goal )
353 ),
354
355 TP_fast_assign(
356 __entry->dev = inode->i_sb->s_dev;
357 __entry->ino = inode->i_ino;
358 __entry->count = count;
359 __entry->goal = goal;
360 ),
361
362 TP_printk("dev %d,%d ino %lu count %lu goal %lu ",
363 MAJOR(__entry->dev), MINOR(__entry->dev),
364 (unsigned long) __entry->ino,
365 __entry->count, __entry->goal)
366);
367
368TRACE_EVENT(ext3_allocate_blocks,
369 TP_PROTO(struct inode *inode, unsigned long goal,
370 unsigned long count, unsigned long block),
371
372 TP_ARGS(inode, goal, count, block),
373
374 TP_STRUCT__entry(
375 __field( dev_t, dev )
376 __field( ino_t, ino )
377 __field( unsigned long, block )
378 __field( unsigned long, count )
379 __field( unsigned long, goal )
380 ),
381
382 TP_fast_assign(
383 __entry->dev = inode->i_sb->s_dev;
384 __entry->ino = inode->i_ino;
385 __entry->block = block;
386 __entry->count = count;
387 __entry->goal = goal;
388 ),
389
390 TP_printk("dev %d,%d ino %lu count %lu block %lu goal %lu",
391 MAJOR(__entry->dev), MINOR(__entry->dev),
392 (unsigned long) __entry->ino,
393 __entry->count, __entry->block,
394 __entry->goal)
395);
396
397TRACE_EVENT(ext3_free_blocks,
398 TP_PROTO(struct inode *inode, unsigned long block,
399 unsigned long count),
400
401 TP_ARGS(inode, block, count),
402
403 TP_STRUCT__entry(
404 __field( dev_t, dev )
405 __field( ino_t, ino )
406 __field( umode_t, mode )
407 __field( unsigned long, block )
408 __field( unsigned long, count )
409 ),
410
411 TP_fast_assign(
412 __entry->dev = inode->i_sb->s_dev;
413 __entry->ino = inode->i_ino;
414 __entry->mode = inode->i_mode;
415 __entry->block = block;
416 __entry->count = count;
417 ),
418
419 TP_printk("dev %d,%d ino %lu mode 0%o block %lu count %lu",
420 MAJOR(__entry->dev), MINOR(__entry->dev),
421 (unsigned long) __entry->ino,
422 __entry->mode, __entry->block, __entry->count)
423);
424
425TRACE_EVENT(ext3_sync_file_enter,
426 TP_PROTO(struct file *file, int datasync),
427
428 TP_ARGS(file, datasync),
429
430 TP_STRUCT__entry(
431 __field( dev_t, dev )
432 __field( ino_t, ino )
433 __field( ino_t, parent )
434 __field( int, datasync )
435 ),
436
437 TP_fast_assign(
438 struct dentry *dentry = file->f_path.dentry;
439
440 __entry->dev = dentry->d_inode->i_sb->s_dev;
441 __entry->ino = dentry->d_inode->i_ino;
442 __entry->datasync = datasync;
443 __entry->parent = dentry->d_parent->d_inode->i_ino;
444 ),
445
446 TP_printk("dev %d,%d ino %lu parent %ld datasync %d ",
447 MAJOR(__entry->dev), MINOR(__entry->dev),
448 (unsigned long) __entry->ino,
449 (unsigned long) __entry->parent, __entry->datasync)
450);
451
452TRACE_EVENT(ext3_sync_file_exit,
453 TP_PROTO(struct inode *inode, int ret),
454
455 TP_ARGS(inode, ret),
456
457 TP_STRUCT__entry(
458 __field( int, ret )
459 __field( ino_t, ino )
460 __field( dev_t, dev )
461 ),
462
463 TP_fast_assign(
464 __entry->ret = ret;
465 __entry->ino = inode->i_ino;
466 __entry->dev = inode->i_sb->s_dev;
467 ),
468
469 TP_printk("dev %d,%d ino %lu ret %d",
470 MAJOR(__entry->dev), MINOR(__entry->dev),
471 (unsigned long) __entry->ino,
472 __entry->ret)
473);
474
475TRACE_EVENT(ext3_sync_fs,
476 TP_PROTO(struct super_block *sb, int wait),
477
478 TP_ARGS(sb, wait),
479
480 TP_STRUCT__entry(
481 __field( dev_t, dev )
482 __field( int, wait )
483
484 ),
485
486 TP_fast_assign(
487 __entry->dev = sb->s_dev;
488 __entry->wait = wait;
489 ),
490
491 TP_printk("dev %d,%d wait %d",
492 MAJOR(__entry->dev), MINOR(__entry->dev),
493 __entry->wait)
494);
495
496TRACE_EVENT(ext3_rsv_window_add,
497 TP_PROTO(struct super_block *sb,
498 struct ext3_reserve_window_node *rsv_node),
499
500 TP_ARGS(sb, rsv_node),
501
502 TP_STRUCT__entry(
503 __field( unsigned long, start )
504 __field( unsigned long, end )
505 __field( dev_t, dev )
506 ),
507
508 TP_fast_assign(
509 __entry->dev = sb->s_dev;
510 __entry->start = rsv_node->rsv_window._rsv_start;
511 __entry->end = rsv_node->rsv_window._rsv_end;
512 ),
513
514 TP_printk("dev %d,%d start %lu end %lu",
515 MAJOR(__entry->dev), MINOR(__entry->dev),
516 __entry->start, __entry->end)
517);
518
519TRACE_EVENT(ext3_discard_reservation,
520 TP_PROTO(struct inode *inode,
521 struct ext3_reserve_window_node *rsv_node),
522
523 TP_ARGS(inode, rsv_node),
524
525 TP_STRUCT__entry(
526 __field( unsigned long, start )
527 __field( unsigned long, end )
528 __field( ino_t, ino )
529 __field( dev_t, dev )
530 ),
531
532 TP_fast_assign(
533 __entry->start = rsv_node->rsv_window._rsv_start;
534 __entry->end = rsv_node->rsv_window._rsv_end;
535 __entry->ino = inode->i_ino;
536 __entry->dev = inode->i_sb->s_dev;
537 ),
538
539 TP_printk("dev %d,%d ino %lu start %lu end %lu",
540 MAJOR(__entry->dev), MINOR(__entry->dev),
541 (unsigned long)__entry->ino, __entry->start,
542 __entry->end)
543);
544
545TRACE_EVENT(ext3_alloc_new_reservation,
546 TP_PROTO(struct super_block *sb, unsigned long goal),
547
548 TP_ARGS(sb, goal),
549
550 TP_STRUCT__entry(
551 __field( dev_t, dev )
552 __field( unsigned long, goal )
553 ),
554
555 TP_fast_assign(
556 __entry->dev = sb->s_dev;
557 __entry->goal = goal;
558 ),
559
560 TP_printk("dev %d,%d goal %lu",
561 MAJOR(__entry->dev), MINOR(__entry->dev),
562 __entry->goal)
563);
564
565TRACE_EVENT(ext3_reserved,
566 TP_PROTO(struct super_block *sb, unsigned long block,
567 struct ext3_reserve_window_node *rsv_node),
568
569 TP_ARGS(sb, block, rsv_node),
570
571 TP_STRUCT__entry(
572 __field( unsigned long, block )
573 __field( unsigned long, start )
574 __field( unsigned long, end )
575 __field( dev_t, dev )
576 ),
577
578 TP_fast_assign(
579 __entry->block = block;
580 __entry->start = rsv_node->rsv_window._rsv_start;
581 __entry->end = rsv_node->rsv_window._rsv_end;
582 __entry->dev = sb->s_dev;
583 ),
584
585 TP_printk("dev %d,%d block %lu, start %lu end %lu",
586 MAJOR(__entry->dev), MINOR(__entry->dev),
587 __entry->block, __entry->start, __entry->end)
588);
589
590TRACE_EVENT(ext3_forget,
591 TP_PROTO(struct inode *inode, int is_metadata, unsigned long block),
592
593 TP_ARGS(inode, is_metadata, block),
594
595 TP_STRUCT__entry(
596 __field( dev_t, dev )
597 __field( ino_t, ino )
598 __field( umode_t, mode )
599 __field( int, is_metadata )
600 __field( unsigned long, block )
601 ),
602
603 TP_fast_assign(
604 __entry->dev = inode->i_sb->s_dev;
605 __entry->ino = inode->i_ino;
606 __entry->mode = inode->i_mode;
607 __entry->is_metadata = is_metadata;
608 __entry->block = block;
609 ),
610
611 TP_printk("dev %d,%d ino %lu mode 0%o is_metadata %d block %lu",
612 MAJOR(__entry->dev), MINOR(__entry->dev),
613 (unsigned long) __entry->ino,
614 __entry->mode, __entry->is_metadata, __entry->block)
615);
616
617TRACE_EVENT(ext3_read_block_bitmap,
618 TP_PROTO(struct super_block *sb, unsigned int group),
619
620 TP_ARGS(sb, group),
621
622 TP_STRUCT__entry(
623 __field( dev_t, dev )
624 __field( __u32, group )
625
626 ),
627
628 TP_fast_assign(
629 __entry->dev = sb->s_dev;
630 __entry->group = group;
631 ),
632
633 TP_printk("dev %d,%d group %u",
634 MAJOR(__entry->dev), MINOR(__entry->dev),
635 __entry->group)
636);
637
638TRACE_EVENT(ext3_direct_IO_enter,
639 TP_PROTO(struct inode *inode, loff_t offset, unsigned long len, int rw),
640
641 TP_ARGS(inode, offset, len, rw),
642
643 TP_STRUCT__entry(
644 __field( ino_t, ino )
645 __field( dev_t, dev )
646 __field( loff_t, pos )
647 __field( unsigned long, len )
648 __field( int, rw )
649 ),
650
651 TP_fast_assign(
652 __entry->ino = inode->i_ino;
653 __entry->dev = inode->i_sb->s_dev;
654 __entry->pos = offset;
655 __entry->len = len;
656 __entry->rw = rw;
657 ),
658
659 TP_printk("dev %d,%d ino %lu pos %llu len %lu rw %d",
660 MAJOR(__entry->dev), MINOR(__entry->dev),
661 (unsigned long) __entry->ino,
662 (unsigned long long) __entry->pos, __entry->len,
663 __entry->rw)
664);
665
666TRACE_EVENT(ext3_direct_IO_exit,
667 TP_PROTO(struct inode *inode, loff_t offset, unsigned long len,
668 int rw, int ret),
669
670 TP_ARGS(inode, offset, len, rw, ret),
671
672 TP_STRUCT__entry(
673 __field( ino_t, ino )
674 __field( dev_t, dev )
675 __field( loff_t, pos )
676 __field( unsigned long, len )
677 __field( int, rw )
678 __field( int, ret )
679 ),
680
681 TP_fast_assign(
682 __entry->ino = inode->i_ino;
683 __entry->dev = inode->i_sb->s_dev;
684 __entry->pos = offset;
685 __entry->len = len;
686 __entry->rw = rw;
687 __entry->ret = ret;
688 ),
689
690 TP_printk("dev %d,%d ino %lu pos %llu len %lu rw %d ret %d",
691 MAJOR(__entry->dev), MINOR(__entry->dev),
692 (unsigned long) __entry->ino,
693 (unsigned long long) __entry->pos, __entry->len,
694 __entry->rw, __entry->ret)
695);
696
697TRACE_EVENT(ext3_unlink_enter,
698 TP_PROTO(struct inode *parent, struct dentry *dentry),
699
700 TP_ARGS(parent, dentry),
701
702 TP_STRUCT__entry(
703 __field( ino_t, parent )
704 __field( ino_t, ino )
705 __field( loff_t, size )
706 __field( dev_t, dev )
707 ),
708
709 TP_fast_assign(
710 __entry->parent = parent->i_ino;
711 __entry->ino = dentry->d_inode->i_ino;
712 __entry->size = dentry->d_inode->i_size;
713 __entry->dev = dentry->d_inode->i_sb->s_dev;
714 ),
715
716 TP_printk("dev %d,%d ino %lu size %lld parent %ld",
717 MAJOR(__entry->dev), MINOR(__entry->dev),
718 (unsigned long) __entry->ino,
719 (unsigned long long)__entry->size,
720 (unsigned long) __entry->parent)
721);
722
723TRACE_EVENT(ext3_unlink_exit,
724 TP_PROTO(struct dentry *dentry, int ret),
725
726 TP_ARGS(dentry, ret),
727
728 TP_STRUCT__entry(
729 __field( ino_t, ino )
730 __field( dev_t, dev )
731 __field( int, ret )
732 ),
733
734 TP_fast_assign(
735 __entry->ino = dentry->d_inode->i_ino;
736 __entry->dev = dentry->d_inode->i_sb->s_dev;
737 __entry->ret = ret;
738 ),
739
740 TP_printk("dev %d,%d ino %lu ret %d",
741 MAJOR(__entry->dev), MINOR(__entry->dev),
742 (unsigned long) __entry->ino,
743 __entry->ret)
744);
745
746DECLARE_EVENT_CLASS(ext3__truncate,
747 TP_PROTO(struct inode *inode),
748
749 TP_ARGS(inode),
750
751 TP_STRUCT__entry(
752 __field( ino_t, ino )
753 __field( dev_t, dev )
754 __field( blkcnt_t, blocks )
755 ),
756
757 TP_fast_assign(
758 __entry->ino = inode->i_ino;
759 __entry->dev = inode->i_sb->s_dev;
760 __entry->blocks = inode->i_blocks;
761 ),
762
763 TP_printk("dev %d,%d ino %lu blocks %lu",
764 MAJOR(__entry->dev), MINOR(__entry->dev),
765 (unsigned long) __entry->ino, (unsigned long) __entry->blocks)
766);
767
768DEFINE_EVENT(ext3__truncate, ext3_truncate_enter,
769
770 TP_PROTO(struct inode *inode),
771
772 TP_ARGS(inode)
773);
774
775DEFINE_EVENT(ext3__truncate, ext3_truncate_exit,
776
777 TP_PROTO(struct inode *inode),
778
779 TP_ARGS(inode)
780);
781
782TRACE_EVENT(ext3_get_blocks_enter,
783 TP_PROTO(struct inode *inode, unsigned long lblk,
784 unsigned long len, int create),
785
786 TP_ARGS(inode, lblk, len, create),
787
788 TP_STRUCT__entry(
789 __field( ino_t, ino )
790 __field( dev_t, dev )
791 __field( unsigned long, lblk )
792 __field( unsigned long, len )
793 __field( int, create )
794 ),
795
796 TP_fast_assign(
797 __entry->ino = inode->i_ino;
798 __entry->dev = inode->i_sb->s_dev;
799 __entry->lblk = lblk;
800 __entry->len = len;
801 __entry->create = create;
802 ),
803
804 TP_printk("dev %d,%d ino %lu lblk %lu len %lu create %u",
805 MAJOR(__entry->dev), MINOR(__entry->dev),
806 (unsigned long) __entry->ino,
807 __entry->lblk, __entry->len, __entry->create)
808);
809
810TRACE_EVENT(ext3_get_blocks_exit,
811 TP_PROTO(struct inode *inode, unsigned long lblk,
812 unsigned long pblk, unsigned long len, int ret),
813
814 TP_ARGS(inode, lblk, pblk, len, ret),
815
816 TP_STRUCT__entry(
817 __field( ino_t, ino )
818 __field( dev_t, dev )
819 __field( unsigned long, lblk )
820 __field( unsigned long, pblk )
821 __field( unsigned long, len )
822 __field( int, ret )
823 ),
824
825 TP_fast_assign(
826 __entry->ino = inode->i_ino;
827 __entry->dev = inode->i_sb->s_dev;
828 __entry->lblk = lblk;
829 __entry->pblk = pblk;
830 __entry->len = len;
831 __entry->ret = ret;
832 ),
833
834 TP_printk("dev %d,%d ino %lu lblk %lu pblk %lu len %lu ret %d",
835 MAJOR(__entry->dev), MINOR(__entry->dev),
836 (unsigned long) __entry->ino,
837 __entry->lblk, __entry->pblk,
838 __entry->len, __entry->ret)
839);
840
841TRACE_EVENT(ext3_load_inode,
842 TP_PROTO(struct inode *inode),
843
844 TP_ARGS(inode),
845
846 TP_STRUCT__entry(
847 __field( ino_t, ino )
848 __field( dev_t, dev )
849 ),
850
851 TP_fast_assign(
852 __entry->ino = inode->i_ino;
853 __entry->dev = inode->i_sb->s_dev;
854 ),
855
856 TP_printk("dev %d,%d ino %lu",
857 MAJOR(__entry->dev), MINOR(__entry->dev),
858 (unsigned long) __entry->ino)
859);
860
861#endif /* _TRACE_EXT3_H */
862
863/* This part must be outside protection */
864#include <trace/define_trace.h>
diff --git a/include/trace/events/ext4.h b/include/trace/events/ext4.h
index e09592d2f916..b50a54736242 100644
--- a/include/trace/events/ext4.h
+++ b/include/trace/events/ext4.h
@@ -23,10 +23,10 @@ TRACE_EVENT(ext4_free_inode,
23 TP_STRUCT__entry( 23 TP_STRUCT__entry(
24 __field( dev_t, dev ) 24 __field( dev_t, dev )
25 __field( ino_t, ino ) 25 __field( ino_t, ino )
26 __field( umode_t, mode ) 26 __field( __u16, mode )
27 __field( uid_t, uid ) 27 __field( uid_t, uid )
28 __field( gid_t, gid ) 28 __field( gid_t, gid )
29 __field( blkcnt_t, blocks ) 29 __field( __u64, blocks )
30 ), 30 ),
31 31
32 TP_fast_assign( 32 TP_fast_assign(
@@ -40,9 +40,8 @@ TRACE_EVENT(ext4_free_inode,
40 40
41 TP_printk("dev %d,%d ino %lu mode 0%o uid %u gid %u blocks %llu", 41 TP_printk("dev %d,%d ino %lu mode 0%o uid %u gid %u blocks %llu",
42 MAJOR(__entry->dev), MINOR(__entry->dev), 42 MAJOR(__entry->dev), MINOR(__entry->dev),
43 (unsigned long) __entry->ino, 43 (unsigned long) __entry->ino, __entry->mode,
44 __entry->mode, __entry->uid, __entry->gid, 44 __entry->uid, __entry->gid, __entry->blocks)
45 (unsigned long long) __entry->blocks)
46); 45);
47 46
48TRACE_EVENT(ext4_request_inode, 47TRACE_EVENT(ext4_request_inode,
@@ -53,7 +52,7 @@ TRACE_EVENT(ext4_request_inode,
53 TP_STRUCT__entry( 52 TP_STRUCT__entry(
54 __field( dev_t, dev ) 53 __field( dev_t, dev )
55 __field( ino_t, dir ) 54 __field( ino_t, dir )
56 __field( umode_t, mode ) 55 __field( __u16, mode )
57 ), 56 ),
58 57
59 TP_fast_assign( 58 TP_fast_assign(
@@ -76,7 +75,7 @@ TRACE_EVENT(ext4_allocate_inode,
76 __field( dev_t, dev ) 75 __field( dev_t, dev )
77 __field( ino_t, ino ) 76 __field( ino_t, ino )
78 __field( ino_t, dir ) 77 __field( ino_t, dir )
79 __field( umode_t, mode ) 78 __field( __u16, mode )
80 ), 79 ),
81 80
82 TP_fast_assign( 81 TP_fast_assign(
@@ -178,7 +177,7 @@ TRACE_EVENT(ext4_begin_ordered_truncate,
178 TP_printk("dev %d,%d ino %lu new_size %lld", 177 TP_printk("dev %d,%d ino %lu new_size %lld",
179 MAJOR(__entry->dev), MINOR(__entry->dev), 178 MAJOR(__entry->dev), MINOR(__entry->dev),
180 (unsigned long) __entry->ino, 179 (unsigned long) __entry->ino,
181 (long long) __entry->new_size) 180 __entry->new_size)
182); 181);
183 182
184DECLARE_EVENT_CLASS(ext4__write_begin, 183DECLARE_EVENT_CLASS(ext4__write_begin,
@@ -204,7 +203,7 @@ DECLARE_EVENT_CLASS(ext4__write_begin,
204 __entry->flags = flags; 203 __entry->flags = flags;
205 ), 204 ),
206 205
207 TP_printk("dev %d,%d ino %lu pos %llu len %u flags %u", 206 TP_printk("dev %d,%d ino %lu pos %lld len %u flags %u",
208 MAJOR(__entry->dev), MINOR(__entry->dev), 207 MAJOR(__entry->dev), MINOR(__entry->dev),
209 (unsigned long) __entry->ino, 208 (unsigned long) __entry->ino,
210 __entry->pos, __entry->len, __entry->flags) 209 __entry->pos, __entry->len, __entry->flags)
@@ -248,7 +247,7 @@ DECLARE_EVENT_CLASS(ext4__write_end,
248 __entry->copied = copied; 247 __entry->copied = copied;
249 ), 248 ),
250 249
251 TP_printk("dev %d,%d ino %lu pos %llu len %u copied %u", 250 TP_printk("dev %d,%d ino %lu pos %lld len %u copied %u",
252 MAJOR(__entry->dev), MINOR(__entry->dev), 251 MAJOR(__entry->dev), MINOR(__entry->dev),
253 (unsigned long) __entry->ino, 252 (unsigned long) __entry->ino,
254 __entry->pos, __entry->len, __entry->copied) 253 __entry->pos, __entry->len, __entry->copied)
@@ -286,29 +285,6 @@ DEFINE_EVENT(ext4__write_end, ext4_da_write_end,
286 TP_ARGS(inode, pos, len, copied) 285 TP_ARGS(inode, pos, len, copied)
287); 286);
288 287
289TRACE_EVENT(ext4_writepage,
290 TP_PROTO(struct inode *inode, struct page *page),
291
292 TP_ARGS(inode, page),
293
294 TP_STRUCT__entry(
295 __field( dev_t, dev )
296 __field( ino_t, ino )
297 __field( pgoff_t, index )
298
299 ),
300
301 TP_fast_assign(
302 __entry->dev = inode->i_sb->s_dev;
303 __entry->ino = inode->i_ino;
304 __entry->index = page->index;
305 ),
306
307 TP_printk("dev %d,%d ino %lu page_index %lu",
308 MAJOR(__entry->dev), MINOR(__entry->dev),
309 (unsigned long) __entry->ino, __entry->index)
310);
311
312TRACE_EVENT(ext4_da_writepages, 288TRACE_EVENT(ext4_da_writepages,
313 TP_PROTO(struct inode *inode, struct writeback_control *wbc), 289 TP_PROTO(struct inode *inode, struct writeback_control *wbc),
314 290
@@ -341,7 +317,7 @@ TRACE_EVENT(ext4_da_writepages,
341 ), 317 ),
342 318
343 TP_printk("dev %d,%d ino %lu nr_to_write %ld pages_skipped %ld " 319 TP_printk("dev %d,%d ino %lu nr_to_write %ld pages_skipped %ld "
344 "range_start %llu range_end %llu sync_mode %d" 320 "range_start %lld range_end %lld sync_mode %d"
345 "for_kupdate %d range_cyclic %d writeback_index %lu", 321 "for_kupdate %d range_cyclic %d writeback_index %lu",
346 MAJOR(__entry->dev), MINOR(__entry->dev), 322 MAJOR(__entry->dev), MINOR(__entry->dev),
347 (unsigned long) __entry->ino, __entry->nr_to_write, 323 (unsigned long) __entry->ino, __entry->nr_to_write,
@@ -404,7 +380,6 @@ TRACE_EVENT(ext4_da_writepages_result,
404 __field( int, pages_written ) 380 __field( int, pages_written )
405 __field( long, pages_skipped ) 381 __field( long, pages_skipped )
406 __field( int, sync_mode ) 382 __field( int, sync_mode )
407 __field( char, more_io )
408 __field( pgoff_t, writeback_index ) 383 __field( pgoff_t, writeback_index )
409 ), 384 ),
410 385
@@ -415,16 +390,15 @@ TRACE_EVENT(ext4_da_writepages_result,
415 __entry->pages_written = pages_written; 390 __entry->pages_written = pages_written;
416 __entry->pages_skipped = wbc->pages_skipped; 391 __entry->pages_skipped = wbc->pages_skipped;
417 __entry->sync_mode = wbc->sync_mode; 392 __entry->sync_mode = wbc->sync_mode;
418 __entry->more_io = wbc->more_io;
419 __entry->writeback_index = inode->i_mapping->writeback_index; 393 __entry->writeback_index = inode->i_mapping->writeback_index;
420 ), 394 ),
421 395
422 TP_printk("dev %d,%d ino %lu ret %d pages_written %d pages_skipped %ld " 396 TP_printk("dev %d,%d ino %lu ret %d pages_written %d pages_skipped %ld "
423 " more_io %d sync_mode %d writeback_index %lu", 397 "sync_mode %d writeback_index %lu",
424 MAJOR(__entry->dev), MINOR(__entry->dev), 398 MAJOR(__entry->dev), MINOR(__entry->dev),
425 (unsigned long) __entry->ino, __entry->ret, 399 (unsigned long) __entry->ino, __entry->ret,
426 __entry->pages_written, __entry->pages_skipped, 400 __entry->pages_written, __entry->pages_skipped,
427 __entry->more_io, __entry->sync_mode, 401 __entry->sync_mode,
428 (unsigned long) __entry->writeback_index) 402 (unsigned long) __entry->writeback_index)
429); 403);
430 404
@@ -449,7 +423,14 @@ DECLARE_EVENT_CLASS(ext4__page_op,
449 TP_printk("dev %d,%d ino %lu page_index %lu", 423 TP_printk("dev %d,%d ino %lu page_index %lu",
450 MAJOR(__entry->dev), MINOR(__entry->dev), 424 MAJOR(__entry->dev), MINOR(__entry->dev),
451 (unsigned long) __entry->ino, 425 (unsigned long) __entry->ino,
452 __entry->index) 426 (unsigned long) __entry->index)
427);
428
429DEFINE_EVENT(ext4__page_op, ext4_writepage,
430
431 TP_PROTO(struct page *page),
432
433 TP_ARGS(page)
453); 434);
454 435
455DEFINE_EVENT(ext4__page_op, ext4_readpage, 436DEFINE_EVENT(ext4__page_op, ext4_readpage,
@@ -489,7 +470,7 @@ TRACE_EVENT(ext4_invalidatepage,
489 TP_printk("dev %d,%d ino %lu page_index %lu offset %lu", 470 TP_printk("dev %d,%d ino %lu page_index %lu offset %lu",
490 MAJOR(__entry->dev), MINOR(__entry->dev), 471 MAJOR(__entry->dev), MINOR(__entry->dev),
491 (unsigned long) __entry->ino, 472 (unsigned long) __entry->ino,
492 __entry->index, __entry->offset) 473 (unsigned long) __entry->index, __entry->offset)
493); 474);
494 475
495TRACE_EVENT(ext4_discard_blocks, 476TRACE_EVENT(ext4_discard_blocks,
@@ -562,12 +543,10 @@ DEFINE_EVENT(ext4__mb_new_pa, ext4_mb_new_group_pa,
562); 543);
563 544
564TRACE_EVENT(ext4_mb_release_inode_pa, 545TRACE_EVENT(ext4_mb_release_inode_pa,
565 TP_PROTO(struct super_block *sb, 546 TP_PROTO(struct ext4_prealloc_space *pa,
566 struct inode *inode,
567 struct ext4_prealloc_space *pa,
568 unsigned long long block, unsigned int count), 547 unsigned long long block, unsigned int count),
569 548
570 TP_ARGS(sb, inode, pa, block, count), 549 TP_ARGS(pa, block, count),
571 550
572 TP_STRUCT__entry( 551 TP_STRUCT__entry(
573 __field( dev_t, dev ) 552 __field( dev_t, dev )
@@ -578,8 +557,8 @@ TRACE_EVENT(ext4_mb_release_inode_pa,
578 ), 557 ),
579 558
580 TP_fast_assign( 559 TP_fast_assign(
581 __entry->dev = sb->s_dev; 560 __entry->dev = pa->pa_inode->i_sb->s_dev;
582 __entry->ino = inode->i_ino; 561 __entry->ino = pa->pa_inode->i_ino;
583 __entry->block = block; 562 __entry->block = block;
584 __entry->count = count; 563 __entry->count = count;
585 ), 564 ),
@@ -591,10 +570,9 @@ TRACE_EVENT(ext4_mb_release_inode_pa,
591); 570);
592 571
593TRACE_EVENT(ext4_mb_release_group_pa, 572TRACE_EVENT(ext4_mb_release_group_pa,
594 TP_PROTO(struct super_block *sb, 573 TP_PROTO(struct ext4_prealloc_space *pa),
595 struct ext4_prealloc_space *pa),
596 574
597 TP_ARGS(sb, pa), 575 TP_ARGS(pa),
598 576
599 TP_STRUCT__entry( 577 TP_STRUCT__entry(
600 __field( dev_t, dev ) 578 __field( dev_t, dev )
@@ -604,7 +582,7 @@ TRACE_EVENT(ext4_mb_release_group_pa,
604 ), 582 ),
605 583
606 TP_fast_assign( 584 TP_fast_assign(
607 __entry->dev = sb->s_dev; 585 __entry->dev = pa->pa_inode->i_sb->s_dev;
608 __entry->pa_pstart = pa->pa_pstart; 586 __entry->pa_pstart = pa->pa_pstart;
609 __entry->pa_len = pa->pa_len; 587 __entry->pa_len = pa->pa_len;
610 ), 588 ),
@@ -666,10 +644,10 @@ TRACE_EVENT(ext4_request_blocks,
666 __field( ino_t, ino ) 644 __field( ino_t, ino )
667 __field( unsigned int, flags ) 645 __field( unsigned int, flags )
668 __field( unsigned int, len ) 646 __field( unsigned int, len )
669 __field( __u64, logical ) 647 __field( __u32, logical )
648 __field( __u32, lleft )
649 __field( __u32, lright )
670 __field( __u64, goal ) 650 __field( __u64, goal )
671 __field( __u64, lleft )
672 __field( __u64, lright )
673 __field( __u64, pleft ) 651 __field( __u64, pleft )
674 __field( __u64, pright ) 652 __field( __u64, pright )
675 ), 653 ),
@@ -687,17 +665,13 @@ TRACE_EVENT(ext4_request_blocks,
687 __entry->pright = ar->pright; 665 __entry->pright = ar->pright;
688 ), 666 ),
689 667
690 TP_printk("dev %d,%d ino %lu flags %u len %u lblk %llu goal %llu " 668 TP_printk("dev %d,%d ino %lu flags %u len %u lblk %u goal %llu "
691 "lleft %llu lright %llu pleft %llu pright %llu ", 669 "lleft %u lright %u pleft %llu pright %llu ",
692 MAJOR(__entry->dev), MINOR(__entry->dev), 670 MAJOR(__entry->dev), MINOR(__entry->dev),
693 (unsigned long) __entry->ino, 671 (unsigned long) __entry->ino, __entry->flags,
694 __entry->flags, __entry->len, 672 __entry->len, __entry->logical, __entry->goal,
695 (unsigned long long) __entry->logical, 673 __entry->lleft, __entry->lright, __entry->pleft,
696 (unsigned long long) __entry->goal, 674 __entry->pright)
697 (unsigned long long) __entry->lleft,
698 (unsigned long long) __entry->lright,
699 (unsigned long long) __entry->pleft,
700 (unsigned long long) __entry->pright)
701); 675);
702 676
703TRACE_EVENT(ext4_allocate_blocks, 677TRACE_EVENT(ext4_allocate_blocks,
@@ -711,10 +685,10 @@ TRACE_EVENT(ext4_allocate_blocks,
711 __field( __u64, block ) 685 __field( __u64, block )
712 __field( unsigned int, flags ) 686 __field( unsigned int, flags )
713 __field( unsigned int, len ) 687 __field( unsigned int, len )
714 __field( __u64, logical ) 688 __field( __u32, logical )
689 __field( __u32, lleft )
690 __field( __u32, lright )
715 __field( __u64, goal ) 691 __field( __u64, goal )
716 __field( __u64, lleft )
717 __field( __u64, lright )
718 __field( __u64, pleft ) 692 __field( __u64, pleft )
719 __field( __u64, pright ) 693 __field( __u64, pright )
720 ), 694 ),
@@ -733,17 +707,13 @@ TRACE_EVENT(ext4_allocate_blocks,
733 __entry->pright = ar->pright; 707 __entry->pright = ar->pright;
734 ), 708 ),
735 709
736 TP_printk("dev %d,%d ino %lu flags %u len %u block %llu lblk %llu " 710 TP_printk("dev %d,%d ino %lu flags %u len %u block %llu lblk %u "
737 "goal %llu lleft %llu lright %llu pleft %llu pright %llu", 711 "goal %llu lleft %u lright %u pleft %llu pright %llu",
738 MAJOR(__entry->dev), MINOR(__entry->dev), 712 MAJOR(__entry->dev), MINOR(__entry->dev),
739 (unsigned long) __entry->ino, 713 (unsigned long) __entry->ino, __entry->flags,
740 __entry->flags, __entry->len, __entry->block, 714 __entry->len, __entry->block, __entry->logical,
741 (unsigned long long) __entry->logical, 715 __entry->goal, __entry->lleft, __entry->lright,
742 (unsigned long long) __entry->goal, 716 __entry->pleft, __entry->pright)
743 (unsigned long long) __entry->lleft,
744 (unsigned long long) __entry->lright,
745 (unsigned long long) __entry->pleft,
746 (unsigned long long) __entry->pright)
747); 717);
748 718
749TRACE_EVENT(ext4_free_blocks, 719TRACE_EVENT(ext4_free_blocks,
@@ -755,10 +725,10 @@ TRACE_EVENT(ext4_free_blocks,
755 TP_STRUCT__entry( 725 TP_STRUCT__entry(
756 __field( dev_t, dev ) 726 __field( dev_t, dev )
757 __field( ino_t, ino ) 727 __field( ino_t, ino )
758 __field( umode_t, mode ) 728 __field( __u16, mode )
759 __field( __u64, block ) 729 __field( __u64, block )
760 __field( unsigned long, count ) 730 __field( unsigned long, count )
761 __field( int, flags ) 731 __field( int, flags )
762 ), 732 ),
763 733
764 TP_fast_assign( 734 TP_fast_assign(
@@ -798,7 +768,7 @@ TRACE_EVENT(ext4_sync_file_enter,
798 __entry->parent = dentry->d_parent->d_inode->i_ino; 768 __entry->parent = dentry->d_parent->d_inode->i_ino;
799 ), 769 ),
800 770
801 TP_printk("dev %d,%d ino %ld parent %ld datasync %d ", 771 TP_printk("dev %d,%d ino %lu parent %lu datasync %d ",
802 MAJOR(__entry->dev), MINOR(__entry->dev), 772 MAJOR(__entry->dev), MINOR(__entry->dev),
803 (unsigned long) __entry->ino, 773 (unsigned long) __entry->ino,
804 (unsigned long) __entry->parent, __entry->datasync) 774 (unsigned long) __entry->parent, __entry->datasync)
@@ -821,7 +791,7 @@ TRACE_EVENT(ext4_sync_file_exit,
821 __entry->dev = inode->i_sb->s_dev; 791 __entry->dev = inode->i_sb->s_dev;
822 ), 792 ),
823 793
824 TP_printk("dev %d,%d ino %ld ret %d", 794 TP_printk("dev %d,%d ino %lu ret %d",
825 MAJOR(__entry->dev), MINOR(__entry->dev), 795 MAJOR(__entry->dev), MINOR(__entry->dev),
826 (unsigned long) __entry->ino, 796 (unsigned long) __entry->ino,
827 __entry->ret) 797 __entry->ret)
@@ -1005,7 +975,7 @@ DECLARE_EVENT_CLASS(ext4__mballoc,
1005 __entry->result_len = len; 975 __entry->result_len = len;
1006 ), 976 ),
1007 977
1008 TP_printk("dev %d,%d inode %lu extent %u/%d/%u ", 978 TP_printk("dev %d,%d inode %lu extent %u/%d/%d ",
1009 MAJOR(__entry->dev), MINOR(__entry->dev), 979 MAJOR(__entry->dev), MINOR(__entry->dev),
1010 (unsigned long) __entry->ino, 980 (unsigned long) __entry->ino,
1011 __entry->result_group, __entry->result_start, 981 __entry->result_group, __entry->result_start,
@@ -1042,7 +1012,7 @@ TRACE_EVENT(ext4_forget,
1042 TP_STRUCT__entry( 1012 TP_STRUCT__entry(
1043 __field( dev_t, dev ) 1013 __field( dev_t, dev )
1044 __field( ino_t, ino ) 1014 __field( ino_t, ino )
1045 __field( umode_t, mode ) 1015 __field( __u16, mode )
1046 __field( int, is_metadata ) 1016 __field( int, is_metadata )
1047 __field( __u64, block ) 1017 __field( __u64, block )
1048 ), 1018 ),
@@ -1069,7 +1039,7 @@ TRACE_EVENT(ext4_da_update_reserve_space,
1069 TP_STRUCT__entry( 1039 TP_STRUCT__entry(
1070 __field( dev_t, dev ) 1040 __field( dev_t, dev )
1071 __field( ino_t, ino ) 1041 __field( ino_t, ino )
1072 __field( umode_t, mode ) 1042 __field( __u16, mode )
1073 __field( __u64, i_blocks ) 1043 __field( __u64, i_blocks )
1074 __field( int, used_blocks ) 1044 __field( int, used_blocks )
1075 __field( int, reserved_data_blocks ) 1045 __field( int, reserved_data_blocks )
@@ -1093,7 +1063,7 @@ TRACE_EVENT(ext4_da_update_reserve_space,
1093 "allocated_meta_blocks %d", 1063 "allocated_meta_blocks %d",
1094 MAJOR(__entry->dev), MINOR(__entry->dev), 1064 MAJOR(__entry->dev), MINOR(__entry->dev),
1095 (unsigned long) __entry->ino, 1065 (unsigned long) __entry->ino,
1096 __entry->mode, (unsigned long long) __entry->i_blocks, 1066 __entry->mode, __entry->i_blocks,
1097 __entry->used_blocks, __entry->reserved_data_blocks, 1067 __entry->used_blocks, __entry->reserved_data_blocks,
1098 __entry->reserved_meta_blocks, __entry->allocated_meta_blocks) 1068 __entry->reserved_meta_blocks, __entry->allocated_meta_blocks)
1099); 1069);
@@ -1106,7 +1076,7 @@ TRACE_EVENT(ext4_da_reserve_space,
1106 TP_STRUCT__entry( 1076 TP_STRUCT__entry(
1107 __field( dev_t, dev ) 1077 __field( dev_t, dev )
1108 __field( ino_t, ino ) 1078 __field( ino_t, ino )
1109 __field( umode_t, mode ) 1079 __field( __u16, mode )
1110 __field( __u64, i_blocks ) 1080 __field( __u64, i_blocks )
1111 __field( int, md_needed ) 1081 __field( int, md_needed )
1112 __field( int, reserved_data_blocks ) 1082 __field( int, reserved_data_blocks )
@@ -1127,7 +1097,7 @@ TRACE_EVENT(ext4_da_reserve_space,
1127 "reserved_data_blocks %d reserved_meta_blocks %d", 1097 "reserved_data_blocks %d reserved_meta_blocks %d",
1128 MAJOR(__entry->dev), MINOR(__entry->dev), 1098 MAJOR(__entry->dev), MINOR(__entry->dev),
1129 (unsigned long) __entry->ino, 1099 (unsigned long) __entry->ino,
1130 __entry->mode, (unsigned long long) __entry->i_blocks, 1100 __entry->mode, __entry->i_blocks,
1131 __entry->md_needed, __entry->reserved_data_blocks, 1101 __entry->md_needed, __entry->reserved_data_blocks,
1132 __entry->reserved_meta_blocks) 1102 __entry->reserved_meta_blocks)
1133); 1103);
@@ -1140,7 +1110,7 @@ TRACE_EVENT(ext4_da_release_space,
1140 TP_STRUCT__entry( 1110 TP_STRUCT__entry(
1141 __field( dev_t, dev ) 1111 __field( dev_t, dev )
1142 __field( ino_t, ino ) 1112 __field( ino_t, ino )
1143 __field( umode_t, mode ) 1113 __field( __u16, mode )
1144 __field( __u64, i_blocks ) 1114 __field( __u64, i_blocks )
1145 __field( int, freed_blocks ) 1115 __field( int, freed_blocks )
1146 __field( int, reserved_data_blocks ) 1116 __field( int, reserved_data_blocks )
@@ -1164,7 +1134,7 @@ TRACE_EVENT(ext4_da_release_space,
1164 "allocated_meta_blocks %d", 1134 "allocated_meta_blocks %d",
1165 MAJOR(__entry->dev), MINOR(__entry->dev), 1135 MAJOR(__entry->dev), MINOR(__entry->dev),
1166 (unsigned long) __entry->ino, 1136 (unsigned long) __entry->ino,
1167 __entry->mode, (unsigned long long) __entry->i_blocks, 1137 __entry->mode, __entry->i_blocks,
1168 __entry->freed_blocks, __entry->reserved_data_blocks, 1138 __entry->freed_blocks, __entry->reserved_data_blocks,
1169 __entry->reserved_meta_blocks, __entry->allocated_meta_blocks) 1139 __entry->reserved_meta_blocks, __entry->allocated_meta_blocks)
1170); 1140);
@@ -1239,14 +1209,15 @@ TRACE_EVENT(ext4_direct_IO_enter,
1239 __entry->rw = rw; 1209 __entry->rw = rw;
1240 ), 1210 ),
1241 1211
1242 TP_printk("dev %d,%d ino %lu pos %llu len %lu rw %d", 1212 TP_printk("dev %d,%d ino %lu pos %lld len %lu rw %d",
1243 MAJOR(__entry->dev), MINOR(__entry->dev), 1213 MAJOR(__entry->dev), MINOR(__entry->dev),
1244 (unsigned long) __entry->ino, 1214 (unsigned long) __entry->ino,
1245 (unsigned long long) __entry->pos, __entry->len, __entry->rw) 1215 __entry->pos, __entry->len, __entry->rw)
1246); 1216);
1247 1217
1248TRACE_EVENT(ext4_direct_IO_exit, 1218TRACE_EVENT(ext4_direct_IO_exit,
1249 TP_PROTO(struct inode *inode, loff_t offset, unsigned long len, int rw, int ret), 1219 TP_PROTO(struct inode *inode, loff_t offset, unsigned long len,
1220 int rw, int ret),
1250 1221
1251 TP_ARGS(inode, offset, len, rw, ret), 1222 TP_ARGS(inode, offset, len, rw, ret),
1252 1223
@@ -1268,10 +1239,10 @@ TRACE_EVENT(ext4_direct_IO_exit,
1268 __entry->ret = ret; 1239 __entry->ret = ret;
1269 ), 1240 ),
1270 1241
1271 TP_printk("dev %d,%d ino %lu pos %llu len %lu rw %d ret %d", 1242 TP_printk("dev %d,%d ino %lu pos %lld len %lu rw %d ret %d",
1272 MAJOR(__entry->dev), MINOR(__entry->dev), 1243 MAJOR(__entry->dev), MINOR(__entry->dev),
1273 (unsigned long) __entry->ino, 1244 (unsigned long) __entry->ino,
1274 (unsigned long long) __entry->pos, __entry->len, 1245 __entry->pos, __entry->len,
1275 __entry->rw, __entry->ret) 1246 __entry->rw, __entry->ret)
1276); 1247);
1277 1248
@@ -1296,15 +1267,15 @@ TRACE_EVENT(ext4_fallocate_enter,
1296 __entry->mode = mode; 1267 __entry->mode = mode;
1297 ), 1268 ),
1298 1269
1299 TP_printk("dev %d,%d ino %ld pos %llu len %llu mode %d", 1270 TP_printk("dev %d,%d ino %lu pos %lld len %lld mode %d",
1300 MAJOR(__entry->dev), MINOR(__entry->dev), 1271 MAJOR(__entry->dev), MINOR(__entry->dev),
1301 (unsigned long) __entry->ino, 1272 (unsigned long) __entry->ino, __entry->pos,
1302 (unsigned long long) __entry->pos, 1273 __entry->len, __entry->mode)
1303 (unsigned long long) __entry->len, __entry->mode)
1304); 1274);
1305 1275
1306TRACE_EVENT(ext4_fallocate_exit, 1276TRACE_EVENT(ext4_fallocate_exit,
1307 TP_PROTO(struct inode *inode, loff_t offset, unsigned int max_blocks, int ret), 1277 TP_PROTO(struct inode *inode, loff_t offset,
1278 unsigned int max_blocks, int ret),
1308 1279
1309 TP_ARGS(inode, offset, max_blocks, ret), 1280 TP_ARGS(inode, offset, max_blocks, ret),
1310 1281
@@ -1312,7 +1283,7 @@ TRACE_EVENT(ext4_fallocate_exit,
1312 __field( ino_t, ino ) 1283 __field( ino_t, ino )
1313 __field( dev_t, dev ) 1284 __field( dev_t, dev )
1314 __field( loff_t, pos ) 1285 __field( loff_t, pos )
1315 __field( unsigned, blocks ) 1286 __field( unsigned int, blocks )
1316 __field( int, ret ) 1287 __field( int, ret )
1317 ), 1288 ),
1318 1289
@@ -1324,10 +1295,10 @@ TRACE_EVENT(ext4_fallocate_exit,
1324 __entry->ret = ret; 1295 __entry->ret = ret;
1325 ), 1296 ),
1326 1297
1327 TP_printk("dev %d,%d ino %ld pos %llu blocks %d ret %d", 1298 TP_printk("dev %d,%d ino %lu pos %lld blocks %u ret %d",
1328 MAJOR(__entry->dev), MINOR(__entry->dev), 1299 MAJOR(__entry->dev), MINOR(__entry->dev),
1329 (unsigned long) __entry->ino, 1300 (unsigned long) __entry->ino,
1330 (unsigned long long) __entry->pos, __entry->blocks, 1301 __entry->pos, __entry->blocks,
1331 __entry->ret) 1302 __entry->ret)
1332); 1303);
1333 1304
@@ -1350,7 +1321,7 @@ TRACE_EVENT(ext4_unlink_enter,
1350 __entry->dev = dentry->d_inode->i_sb->s_dev; 1321 __entry->dev = dentry->d_inode->i_sb->s_dev;
1351 ), 1322 ),
1352 1323
1353 TP_printk("dev %d,%d ino %ld size %lld parent %ld", 1324 TP_printk("dev %d,%d ino %lu size %lld parent %lu",
1354 MAJOR(__entry->dev), MINOR(__entry->dev), 1325 MAJOR(__entry->dev), MINOR(__entry->dev),
1355 (unsigned long) __entry->ino, __entry->size, 1326 (unsigned long) __entry->ino, __entry->size,
1356 (unsigned long) __entry->parent) 1327 (unsigned long) __entry->parent)
@@ -1373,7 +1344,7 @@ TRACE_EVENT(ext4_unlink_exit,
1373 __entry->ret = ret; 1344 __entry->ret = ret;
1374 ), 1345 ),
1375 1346
1376 TP_printk("dev %d,%d ino %ld ret %d", 1347 TP_printk("dev %d,%d ino %lu ret %d",
1377 MAJOR(__entry->dev), MINOR(__entry->dev), 1348 MAJOR(__entry->dev), MINOR(__entry->dev),
1378 (unsigned long) __entry->ino, 1349 (unsigned long) __entry->ino,
1379 __entry->ret) 1350 __entry->ret)
@@ -1387,7 +1358,7 @@ DECLARE_EVENT_CLASS(ext4__truncate,
1387 TP_STRUCT__entry( 1358 TP_STRUCT__entry(
1388 __field( ino_t, ino ) 1359 __field( ino_t, ino )
1389 __field( dev_t, dev ) 1360 __field( dev_t, dev )
1390 __field( blkcnt_t, blocks ) 1361 __field( __u64, blocks )
1391 ), 1362 ),
1392 1363
1393 TP_fast_assign( 1364 TP_fast_assign(
@@ -1396,9 +1367,9 @@ DECLARE_EVENT_CLASS(ext4__truncate,
1396 __entry->blocks = inode->i_blocks; 1367 __entry->blocks = inode->i_blocks;
1397 ), 1368 ),
1398 1369
1399 TP_printk("dev %d,%d ino %lu blocks %lu", 1370 TP_printk("dev %d,%d ino %lu blocks %llu",
1400 MAJOR(__entry->dev), MINOR(__entry->dev), 1371 MAJOR(__entry->dev), MINOR(__entry->dev),
1401 (unsigned long) __entry->ino, (unsigned long) __entry->blocks) 1372 (unsigned long) __entry->ino, __entry->blocks)
1402); 1373);
1403 1374
1404DEFINE_EVENT(ext4__truncate, ext4_truncate_enter, 1375DEFINE_EVENT(ext4__truncate, ext4_truncate_enter,
@@ -1417,7 +1388,7 @@ DEFINE_EVENT(ext4__truncate, ext4_truncate_exit,
1417 1388
1418DECLARE_EVENT_CLASS(ext4__map_blocks_enter, 1389DECLARE_EVENT_CLASS(ext4__map_blocks_enter,
1419 TP_PROTO(struct inode *inode, ext4_lblk_t lblk, 1390 TP_PROTO(struct inode *inode, ext4_lblk_t lblk,
1420 unsigned len, unsigned flags), 1391 unsigned int len, unsigned int flags),
1421 1392
1422 TP_ARGS(inode, lblk, len, flags), 1393 TP_ARGS(inode, lblk, len, flags),
1423 1394
@@ -1425,8 +1396,8 @@ DECLARE_EVENT_CLASS(ext4__map_blocks_enter,
1425 __field( ino_t, ino ) 1396 __field( ino_t, ino )
1426 __field( dev_t, dev ) 1397 __field( dev_t, dev )
1427 __field( ext4_lblk_t, lblk ) 1398 __field( ext4_lblk_t, lblk )
1428 __field( unsigned, len ) 1399 __field( unsigned int, len )
1429 __field( unsigned, flags ) 1400 __field( unsigned int, flags )
1430 ), 1401 ),
1431 1402
1432 TP_fast_assign( 1403 TP_fast_assign(
@@ -1440,7 +1411,7 @@ DECLARE_EVENT_CLASS(ext4__map_blocks_enter,
1440 TP_printk("dev %d,%d ino %lu lblk %u len %u flags %u", 1411 TP_printk("dev %d,%d ino %lu lblk %u len %u flags %u",
1441 MAJOR(__entry->dev), MINOR(__entry->dev), 1412 MAJOR(__entry->dev), MINOR(__entry->dev),
1442 (unsigned long) __entry->ino, 1413 (unsigned long) __entry->ino,
1443 (unsigned) __entry->lblk, __entry->len, __entry->flags) 1414 __entry->lblk, __entry->len, __entry->flags)
1444); 1415);
1445 1416
1446DEFINE_EVENT(ext4__map_blocks_enter, ext4_ext_map_blocks_enter, 1417DEFINE_EVENT(ext4__map_blocks_enter, ext4_ext_map_blocks_enter,
@@ -1459,7 +1430,7 @@ DEFINE_EVENT(ext4__map_blocks_enter, ext4_ind_map_blocks_enter,
1459 1430
1460DECLARE_EVENT_CLASS(ext4__map_blocks_exit, 1431DECLARE_EVENT_CLASS(ext4__map_blocks_exit,
1461 TP_PROTO(struct inode *inode, ext4_lblk_t lblk, 1432 TP_PROTO(struct inode *inode, ext4_lblk_t lblk,
1462 ext4_fsblk_t pblk, unsigned len, int ret), 1433 ext4_fsblk_t pblk, unsigned int len, int ret),
1463 1434
1464 TP_ARGS(inode, lblk, pblk, len, ret), 1435 TP_ARGS(inode, lblk, pblk, len, ret),
1465 1436
@@ -1468,7 +1439,7 @@ DECLARE_EVENT_CLASS(ext4__map_blocks_exit,
1468 __field( dev_t, dev ) 1439 __field( dev_t, dev )
1469 __field( ext4_lblk_t, lblk ) 1440 __field( ext4_lblk_t, lblk )
1470 __field( ext4_fsblk_t, pblk ) 1441 __field( ext4_fsblk_t, pblk )
1471 __field( unsigned, len ) 1442 __field( unsigned int, len )
1472 __field( int, ret ) 1443 __field( int, ret )
1473 ), 1444 ),
1474 1445
@@ -1484,7 +1455,7 @@ DECLARE_EVENT_CLASS(ext4__map_blocks_exit,
1484 TP_printk("dev %d,%d ino %lu lblk %u pblk %llu len %u ret %d", 1455 TP_printk("dev %d,%d ino %lu lblk %u pblk %llu len %u ret %d",
1485 MAJOR(__entry->dev), MINOR(__entry->dev), 1456 MAJOR(__entry->dev), MINOR(__entry->dev),
1486 (unsigned long) __entry->ino, 1457 (unsigned long) __entry->ino,
1487 (unsigned) __entry->lblk, (unsigned long long) __entry->pblk, 1458 __entry->lblk, __entry->pblk,
1488 __entry->len, __entry->ret) 1459 __entry->len, __entry->ret)
1489); 1460);
1490 1461
@@ -1524,7 +1495,7 @@ TRACE_EVENT(ext4_ext_load_extent,
1524 TP_printk("dev %d,%d ino %lu lblk %u pblk %llu", 1495 TP_printk("dev %d,%d ino %lu lblk %u pblk %llu",
1525 MAJOR(__entry->dev), MINOR(__entry->dev), 1496 MAJOR(__entry->dev), MINOR(__entry->dev),
1526 (unsigned long) __entry->ino, 1497 (unsigned long) __entry->ino,
1527 (unsigned) __entry->lblk, (unsigned long long) __entry->pblk) 1498 __entry->lblk, __entry->pblk)
1528); 1499);
1529 1500
1530TRACE_EVENT(ext4_load_inode, 1501TRACE_EVENT(ext4_load_inode,
@@ -1547,6 +1518,77 @@ TRACE_EVENT(ext4_load_inode,
1547 (unsigned long) __entry->ino) 1518 (unsigned long) __entry->ino)
1548); 1519);
1549 1520
1521TRACE_EVENT(ext4_journal_start,
1522 TP_PROTO(struct super_block *sb, int nblocks, unsigned long IP),
1523
1524 TP_ARGS(sb, nblocks, IP),
1525
1526 TP_STRUCT__entry(
1527 __field( dev_t, dev )
1528 __field( int, nblocks )
1529 __field(unsigned long, ip )
1530 ),
1531
1532 TP_fast_assign(
1533 __entry->dev = sb->s_dev;
1534 __entry->nblocks = nblocks;
1535 __entry->ip = IP;
1536 ),
1537
1538 TP_printk("dev %d,%d nblocks %d caller %pF",
1539 MAJOR(__entry->dev), MINOR(__entry->dev),
1540 __entry->nblocks, (void *)__entry->ip)
1541);
1542
1543DECLARE_EVENT_CLASS(ext4__trim,
1544 TP_PROTO(struct super_block *sb,
1545 ext4_group_t group,
1546 ext4_grpblk_t start,
1547 ext4_grpblk_t len),
1548
1549 TP_ARGS(sb, group, start, len),
1550
1551 TP_STRUCT__entry(
1552 __field( int, dev_major )
1553 __field( int, dev_minor )
1554 __field( __u32, group )
1555 __field( int, start )
1556 __field( int, len )
1557 ),
1558
1559 TP_fast_assign(
1560 __entry->dev_major = MAJOR(sb->s_dev);
1561 __entry->dev_minor = MINOR(sb->s_dev);
1562 __entry->group = group;
1563 __entry->start = start;
1564 __entry->len = len;
1565 ),
1566
1567 TP_printk("dev %d,%d group %u, start %d, len %d",
1568 __entry->dev_major, __entry->dev_minor,
1569 __entry->group, __entry->start, __entry->len)
1570);
1571
1572DEFINE_EVENT(ext4__trim, ext4_trim_extent,
1573
1574 TP_PROTO(struct super_block *sb,
1575 ext4_group_t group,
1576 ext4_grpblk_t start,
1577 ext4_grpblk_t len),
1578
1579 TP_ARGS(sb, group, start, len)
1580);
1581
1582DEFINE_EVENT(ext4__trim, ext4_trim_all_free,
1583
1584 TP_PROTO(struct super_block *sb,
1585 ext4_group_t group,
1586 ext4_grpblk_t start,
1587 ext4_grpblk_t len),
1588
1589 TP_ARGS(sb, group, start, len)
1590);
1591
1550#endif /* _TRACE_EXT4_H */ 1592#endif /* _TRACE_EXT4_H */
1551 1593
1552/* This part must be outside protection */ 1594/* This part must be outside protection */
diff --git a/include/trace/events/irq.h b/include/trace/events/irq.h
index ae045ca7d356..1c09820df585 100644
--- a/include/trace/events/irq.h
+++ b/include/trace/events/irq.h
@@ -20,7 +20,8 @@ struct softirq_action;
20 softirq_name(BLOCK_IOPOLL), \ 20 softirq_name(BLOCK_IOPOLL), \
21 softirq_name(TASKLET), \ 21 softirq_name(TASKLET), \
22 softirq_name(SCHED), \ 22 softirq_name(SCHED), \
23 softirq_name(HRTIMER)) 23 softirq_name(HRTIMER), \
24 softirq_name(RCU))
24 25
25/** 26/**
26 * irq_handler_entry - called immediately before the irq action handler 27 * irq_handler_entry - called immediately before the irq action handler
diff --git a/include/trace/events/jbd.h b/include/trace/events/jbd.h
new file mode 100644
index 000000000000..aff64d82d713
--- /dev/null
+++ b/include/trace/events/jbd.h
@@ -0,0 +1,203 @@
1#undef TRACE_SYSTEM
2#define TRACE_SYSTEM jbd
3
4#if !defined(_TRACE_JBD_H) || defined(TRACE_HEADER_MULTI_READ)
5#define _TRACE_JBD_H
6
7#include <linux/jbd.h>
8#include <linux/tracepoint.h>
9
10TRACE_EVENT(jbd_checkpoint,
11
12 TP_PROTO(journal_t *journal, int result),
13
14 TP_ARGS(journal, result),
15
16 TP_STRUCT__entry(
17 __field( dev_t, dev )
18 __field( int, result )
19 ),
20
21 TP_fast_assign(
22 __entry->dev = journal->j_fs_dev->bd_dev;
23 __entry->result = result;
24 ),
25
26 TP_printk("dev %d,%d result %d",
27 MAJOR(__entry->dev), MINOR(__entry->dev),
28 __entry->result)
29);
30
31DECLARE_EVENT_CLASS(jbd_commit,
32
33 TP_PROTO(journal_t *journal, transaction_t *commit_transaction),
34
35 TP_ARGS(journal, commit_transaction),
36
37 TP_STRUCT__entry(
38 __field( dev_t, dev )
39 __field( char, sync_commit )
40 __field( int, transaction )
41 ),
42
43 TP_fast_assign(
44 __entry->dev = journal->j_fs_dev->bd_dev;
45 __entry->sync_commit = commit_transaction->t_synchronous_commit;
46 __entry->transaction = commit_transaction->t_tid;
47 ),
48
49 TP_printk("dev %d,%d transaction %d sync %d",
50 MAJOR(__entry->dev), MINOR(__entry->dev),
51 __entry->transaction, __entry->sync_commit)
52);
53
54DEFINE_EVENT(jbd_commit, jbd_start_commit,
55
56 TP_PROTO(journal_t *journal, transaction_t *commit_transaction),
57
58 TP_ARGS(journal, commit_transaction)
59);
60
61DEFINE_EVENT(jbd_commit, jbd_commit_locking,
62
63 TP_PROTO(journal_t *journal, transaction_t *commit_transaction),
64
65 TP_ARGS(journal, commit_transaction)
66);
67
68DEFINE_EVENT(jbd_commit, jbd_commit_flushing,
69
70 TP_PROTO(journal_t *journal, transaction_t *commit_transaction),
71
72 TP_ARGS(journal, commit_transaction)
73);
74
75DEFINE_EVENT(jbd_commit, jbd_commit_logging,
76
77 TP_PROTO(journal_t *journal, transaction_t *commit_transaction),
78
79 TP_ARGS(journal, commit_transaction)
80);
81
82TRACE_EVENT(jbd_drop_transaction,
83
84 TP_PROTO(journal_t *journal, transaction_t *commit_transaction),
85
86 TP_ARGS(journal, commit_transaction),
87
88 TP_STRUCT__entry(
89 __field( dev_t, dev )
90 __field( char, sync_commit )
91 __field( int, transaction )
92 ),
93
94 TP_fast_assign(
95 __entry->dev = journal->j_fs_dev->bd_dev;
96 __entry->sync_commit = commit_transaction->t_synchronous_commit;
97 __entry->transaction = commit_transaction->t_tid;
98 ),
99
100 TP_printk("dev %d,%d transaction %d sync %d",
101 MAJOR(__entry->dev), MINOR(__entry->dev),
102 __entry->transaction, __entry->sync_commit)
103);
104
105TRACE_EVENT(jbd_end_commit,
106 TP_PROTO(journal_t *journal, transaction_t *commit_transaction),
107
108 TP_ARGS(journal, commit_transaction),
109
110 TP_STRUCT__entry(
111 __field( dev_t, dev )
112 __field( char, sync_commit )
113 __field( int, transaction )
114 __field( int, head )
115 ),
116
117 TP_fast_assign(
118 __entry->dev = journal->j_fs_dev->bd_dev;
119 __entry->sync_commit = commit_transaction->t_synchronous_commit;
120 __entry->transaction = commit_transaction->t_tid;
121 __entry->head = journal->j_tail_sequence;
122 ),
123
124 TP_printk("dev %d,%d transaction %d sync %d head %d",
125 MAJOR(__entry->dev), MINOR(__entry->dev),
126 __entry->transaction, __entry->sync_commit, __entry->head)
127);
128
129TRACE_EVENT(jbd_do_submit_data,
130 TP_PROTO(journal_t *journal, transaction_t *commit_transaction),
131
132 TP_ARGS(journal, commit_transaction),
133
134 TP_STRUCT__entry(
135 __field( dev_t, dev )
136 __field( char, sync_commit )
137 __field( int, transaction )
138 ),
139
140 TP_fast_assign(
141 __entry->dev = journal->j_fs_dev->bd_dev;
142 __entry->sync_commit = commit_transaction->t_synchronous_commit;
143 __entry->transaction = commit_transaction->t_tid;
144 ),
145
146 TP_printk("dev %d,%d transaction %d sync %d",
147 MAJOR(__entry->dev), MINOR(__entry->dev),
148 __entry->transaction, __entry->sync_commit)
149);
150
151TRACE_EVENT(jbd_cleanup_journal_tail,
152
153 TP_PROTO(journal_t *journal, tid_t first_tid,
154 unsigned long block_nr, unsigned long freed),
155
156 TP_ARGS(journal, first_tid, block_nr, freed),
157
158 TP_STRUCT__entry(
159 __field( dev_t, dev )
160 __field( tid_t, tail_sequence )
161 __field( tid_t, first_tid )
162 __field(unsigned long, block_nr )
163 __field(unsigned long, freed )
164 ),
165
166 TP_fast_assign(
167 __entry->dev = journal->j_fs_dev->bd_dev;
168 __entry->tail_sequence = journal->j_tail_sequence;
169 __entry->first_tid = first_tid;
170 __entry->block_nr = block_nr;
171 __entry->freed = freed;
172 ),
173
174 TP_printk("dev %d,%d from %u to %u offset %lu freed %lu",
175 MAJOR(__entry->dev), MINOR(__entry->dev),
176 __entry->tail_sequence, __entry->first_tid,
177 __entry->block_nr, __entry->freed)
178);
179
180TRACE_EVENT(jbd_update_superblock_end,
181 TP_PROTO(journal_t *journal, int wait),
182
183 TP_ARGS(journal, wait),
184
185 TP_STRUCT__entry(
186 __field( dev_t, dev )
187 __field( int, wait )
188 ),
189
190 TP_fast_assign(
191 __entry->dev = journal->j_fs_dev->bd_dev;
192 __entry->wait = wait;
193 ),
194
195 TP_printk("dev %d,%d wait %d",
196 MAJOR(__entry->dev), MINOR(__entry->dev),
197 __entry->wait)
198);
199
200#endif /* _TRACE_JBD_H */
201
202/* This part must be outside protection */
203#include <trace/define_trace.h>
diff --git a/include/trace/events/jbd2.h b/include/trace/events/jbd2.h
index bf16545cc977..75964412ddbb 100644
--- a/include/trace/events/jbd2.h
+++ b/include/trace/events/jbd2.h
@@ -26,8 +26,8 @@ TRACE_EVENT(jbd2_checkpoint,
26 __entry->result = result; 26 __entry->result = result;
27 ), 27 ),
28 28
29 TP_printk("dev %s result %d", 29 TP_printk("dev %d,%d result %d",
30 jbd2_dev_to_name(__entry->dev), __entry->result) 30 MAJOR(__entry->dev), MINOR(__entry->dev), __entry->result)
31); 31);
32 32
33DECLARE_EVENT_CLASS(jbd2_commit, 33DECLARE_EVENT_CLASS(jbd2_commit,
@@ -48,9 +48,9 @@ DECLARE_EVENT_CLASS(jbd2_commit,
48 __entry->transaction = commit_transaction->t_tid; 48 __entry->transaction = commit_transaction->t_tid;
49 ), 49 ),
50 50
51 TP_printk("dev %s transaction %d sync %d", 51 TP_printk("dev %d,%d transaction %d sync %d",
52 jbd2_dev_to_name(__entry->dev), __entry->transaction, 52 MAJOR(__entry->dev), MINOR(__entry->dev),
53 __entry->sync_commit) 53 __entry->transaction, __entry->sync_commit)
54); 54);
55 55
56DEFINE_EVENT(jbd2_commit, jbd2_start_commit, 56DEFINE_EVENT(jbd2_commit, jbd2_start_commit,
@@ -100,9 +100,9 @@ TRACE_EVENT(jbd2_end_commit,
100 __entry->head = journal->j_tail_sequence; 100 __entry->head = journal->j_tail_sequence;
101 ), 101 ),
102 102
103 TP_printk("dev %s transaction %d sync %d head %d", 103 TP_printk("dev %d,%d transaction %d sync %d head %d",
104 jbd2_dev_to_name(__entry->dev), __entry->transaction, 104 MAJOR(__entry->dev), MINOR(__entry->dev),
105 __entry->sync_commit, __entry->head) 105 __entry->transaction, __entry->sync_commit, __entry->head)
106); 106);
107 107
108TRACE_EVENT(jbd2_submit_inode_data, 108TRACE_EVENT(jbd2_submit_inode_data,
@@ -120,8 +120,9 @@ TRACE_EVENT(jbd2_submit_inode_data,
120 __entry->ino = inode->i_ino; 120 __entry->ino = inode->i_ino;
121 ), 121 ),
122 122
123 TP_printk("dev %s ino %lu", 123 TP_printk("dev %d,%d ino %lu",
124 jbd2_dev_to_name(__entry->dev), (unsigned long) __entry->ino) 124 MAJOR(__entry->dev), MINOR(__entry->dev),
125 (unsigned long) __entry->ino)
125); 126);
126 127
127TRACE_EVENT(jbd2_run_stats, 128TRACE_EVENT(jbd2_run_stats,
@@ -156,9 +157,9 @@ TRACE_EVENT(jbd2_run_stats,
156 __entry->blocks_logged = stats->rs_blocks_logged; 157 __entry->blocks_logged = stats->rs_blocks_logged;
157 ), 158 ),
158 159
159 TP_printk("dev %s tid %lu wait %u running %u locked %u flushing %u " 160 TP_printk("dev %d,%d tid %lu wait %u running %u locked %u flushing %u "
160 "logging %u handle_count %u blocks %u blocks_logged %u", 161 "logging %u handle_count %u blocks %u blocks_logged %u",
161 jbd2_dev_to_name(__entry->dev), __entry->tid, 162 MAJOR(__entry->dev), MINOR(__entry->dev), __entry->tid,
162 jiffies_to_msecs(__entry->wait), 163 jiffies_to_msecs(__entry->wait),
163 jiffies_to_msecs(__entry->running), 164 jiffies_to_msecs(__entry->running),
164 jiffies_to_msecs(__entry->locked), 165 jiffies_to_msecs(__entry->locked),
@@ -192,9 +193,9 @@ TRACE_EVENT(jbd2_checkpoint_stats,
192 __entry->dropped = stats->cs_dropped; 193 __entry->dropped = stats->cs_dropped;
193 ), 194 ),
194 195
195 TP_printk("dev %s tid %lu chp_time %u forced_to_close %u " 196 TP_printk("dev %d,%d tid %lu chp_time %u forced_to_close %u "
196 "written %u dropped %u", 197 "written %u dropped %u",
197 jbd2_dev_to_name(__entry->dev), __entry->tid, 198 MAJOR(__entry->dev), MINOR(__entry->dev), __entry->tid,
198 jiffies_to_msecs(__entry->chp_time), 199 jiffies_to_msecs(__entry->chp_time),
199 __entry->forced_to_close, __entry->written, __entry->dropped) 200 __entry->forced_to_close, __entry->written, __entry->dropped)
200); 201);
@@ -222,9 +223,10 @@ TRACE_EVENT(jbd2_cleanup_journal_tail,
222 __entry->freed = freed; 223 __entry->freed = freed;
223 ), 224 ),
224 225
225 TP_printk("dev %s from %u to %u offset %lu freed %lu", 226 TP_printk("dev %d,%d from %u to %u offset %lu freed %lu",
226 jbd2_dev_to_name(__entry->dev), __entry->tail_sequence, 227 MAJOR(__entry->dev), MINOR(__entry->dev),
227 __entry->first_tid, __entry->block_nr, __entry->freed) 228 __entry->tail_sequence, __entry->first_tid,
229 __entry->block_nr, __entry->freed)
228); 230);
229 231
230#endif /* _TRACE_JBD2_H */ 232#endif /* _TRACE_JBD2_H */
diff --git a/include/trace/events/net.h b/include/trace/events/net.h
index 5f247f5ffc56..f99645d05a8f 100644
--- a/include/trace/events/net.h
+++ b/include/trace/events/net.h
@@ -12,22 +12,24 @@
12TRACE_EVENT(net_dev_xmit, 12TRACE_EVENT(net_dev_xmit,
13 13
14 TP_PROTO(struct sk_buff *skb, 14 TP_PROTO(struct sk_buff *skb,
15 int rc), 15 int rc,
16 struct net_device *dev,
17 unsigned int skb_len),
16 18
17 TP_ARGS(skb, rc), 19 TP_ARGS(skb, rc, dev, skb_len),
18 20
19 TP_STRUCT__entry( 21 TP_STRUCT__entry(
20 __field( void *, skbaddr ) 22 __field( void *, skbaddr )
21 __field( unsigned int, len ) 23 __field( unsigned int, len )
22 __field( int, rc ) 24 __field( int, rc )
23 __string( name, skb->dev->name ) 25 __string( name, dev->name )
24 ), 26 ),
25 27
26 TP_fast_assign( 28 TP_fast_assign(
27 __entry->skbaddr = skb; 29 __entry->skbaddr = skb;
28 __entry->len = skb->len; 30 __entry->len = skb_len;
29 __entry->rc = rc; 31 __entry->rc = rc;
30 __assign_str(name, skb->dev->name); 32 __assign_str(name, dev->name);
31 ), 33 ),
32 34
33 TP_printk("dev=%s skbaddr=%p len=%u rc=%d", 35 TP_printk("dev=%s skbaddr=%p len=%u rc=%d",
diff --git a/include/trace/events/sock.h b/include/trace/events/sock.h
new file mode 100644
index 000000000000..779abb91df81
--- /dev/null
+++ b/include/trace/events/sock.h
@@ -0,0 +1,68 @@
1#undef TRACE_SYSTEM
2#define TRACE_SYSTEM sock
3
4#if !defined(_TRACE_SOCK_H) || defined(TRACE_HEADER_MULTI_READ)
5#define _TRACE_SOCK_H
6
7#include <net/sock.h>
8#include <linux/tracepoint.h>
9
10TRACE_EVENT(sock_rcvqueue_full,
11
12 TP_PROTO(struct sock *sk, struct sk_buff *skb),
13
14 TP_ARGS(sk, skb),
15
16 TP_STRUCT__entry(
17 __field(int, rmem_alloc)
18 __field(unsigned int, truesize)
19 __field(int, sk_rcvbuf)
20 ),
21
22 TP_fast_assign(
23 __entry->rmem_alloc = atomic_read(&sk->sk_rmem_alloc);
24 __entry->truesize = skb->truesize;
25 __entry->sk_rcvbuf = sk->sk_rcvbuf;
26 ),
27
28 TP_printk("rmem_alloc=%d truesize=%u sk_rcvbuf=%d",
29 __entry->rmem_alloc, __entry->truesize, __entry->sk_rcvbuf)
30);
31
32TRACE_EVENT(sock_exceed_buf_limit,
33
34 TP_PROTO(struct sock *sk, struct proto *prot, long allocated),
35
36 TP_ARGS(sk, prot, allocated),
37
38 TP_STRUCT__entry(
39 __array(char, name, 32)
40 __field(long *, sysctl_mem)
41 __field(long, allocated)
42 __field(int, sysctl_rmem)
43 __field(int, rmem_alloc)
44 ),
45
46 TP_fast_assign(
47 strncpy(__entry->name, prot->name, 32);
48 __entry->sysctl_mem = prot->sysctl_mem;
49 __entry->allocated = allocated;
50 __entry->sysctl_rmem = prot->sysctl_rmem[0];
51 __entry->rmem_alloc = atomic_read(&sk->sk_rmem_alloc);
52 ),
53
54 TP_printk("proto:%s sysctl_mem=%ld,%ld,%ld allocated=%ld "
55 "sysctl_rmem=%d rmem_alloc=%d",
56 __entry->name,
57 __entry->sysctl_mem[0],
58 __entry->sysctl_mem[1],
59 __entry->sysctl_mem[2],
60 __entry->allocated,
61 __entry->sysctl_rmem,
62 __entry->rmem_alloc)
63);
64
65#endif /* _TRACE_SOCK_H */
66
67/* This part must be outside protection */
68#include <trace/define_trace.h>
diff --git a/include/trace/events/udp.h b/include/trace/events/udp.h
new file mode 100644
index 000000000000..a664bb940973
--- /dev/null
+++ b/include/trace/events/udp.h
@@ -0,0 +1,32 @@
1#undef TRACE_SYSTEM
2#define TRACE_SYSTEM udp
3
4#if !defined(_TRACE_UDP_H) || defined(TRACE_HEADER_MULTI_READ)
5#define _TRACE_UDP_H
6
7#include <linux/udp.h>
8#include <linux/tracepoint.h>
9
10TRACE_EVENT(udp_fail_queue_rcv_skb,
11
12 TP_PROTO(int rc, struct sock *sk),
13
14 TP_ARGS(rc, sk),
15
16 TP_STRUCT__entry(
17 __field(int, rc)
18 __field(__u16, lport)
19 ),
20
21 TP_fast_assign(
22 __entry->rc = rc;
23 __entry->lport = inet_sk(sk)->inet_num;
24 ),
25
26 TP_printk("rc=%d port=%hu", __entry->rc, __entry->lport)
27);
28
29#endif /* _TRACE_UDP_H */
30
31/* This part must be outside protection */
32#include <trace/define_trace.h>
diff --git a/include/trace/events/vmscan.h b/include/trace/events/vmscan.h
index ea422aaa23e1..36851f7f13da 100644
--- a/include/trace/events/vmscan.h
+++ b/include/trace/events/vmscan.h
@@ -6,6 +6,8 @@
6 6
7#include <linux/types.h> 7#include <linux/types.h>
8#include <linux/tracepoint.h> 8#include <linux/tracepoint.h>
9#include <linux/mm.h>
10#include <linux/memcontrol.h>
9#include "gfpflags.h" 11#include "gfpflags.h"
10 12
11#define RECLAIM_WB_ANON 0x0001u 13#define RECLAIM_WB_ANON 0x0001u
@@ -177,6 +179,83 @@ DEFINE_EVENT(mm_vmscan_direct_reclaim_end_template, mm_vmscan_memcg_softlimit_re
177 TP_ARGS(nr_reclaimed) 179 TP_ARGS(nr_reclaimed)
178); 180);
179 181
182TRACE_EVENT(mm_shrink_slab_start,
183 TP_PROTO(struct shrinker *shr, struct shrink_control *sc,
184 long nr_objects_to_shrink, unsigned long pgs_scanned,
185 unsigned long lru_pgs, unsigned long cache_items,
186 unsigned long long delta, unsigned long total_scan),
187
188 TP_ARGS(shr, sc, nr_objects_to_shrink, pgs_scanned, lru_pgs,
189 cache_items, delta, total_scan),
190
191 TP_STRUCT__entry(
192 __field(struct shrinker *, shr)
193 __field(void *, shrink)
194 __field(long, nr_objects_to_shrink)
195 __field(gfp_t, gfp_flags)
196 __field(unsigned long, pgs_scanned)
197 __field(unsigned long, lru_pgs)
198 __field(unsigned long, cache_items)
199 __field(unsigned long long, delta)
200 __field(unsigned long, total_scan)
201 ),
202
203 TP_fast_assign(
204 __entry->shr = shr;
205 __entry->shrink = shr->shrink;
206 __entry->nr_objects_to_shrink = nr_objects_to_shrink;
207 __entry->gfp_flags = sc->gfp_mask;
208 __entry->pgs_scanned = pgs_scanned;
209 __entry->lru_pgs = lru_pgs;
210 __entry->cache_items = cache_items;
211 __entry->delta = delta;
212 __entry->total_scan = total_scan;
213 ),
214
215 TP_printk("%pF %p: objects to shrink %ld gfp_flags %s pgs_scanned %ld lru_pgs %ld cache items %ld delta %lld total_scan %ld",
216 __entry->shrink,
217 __entry->shr,
218 __entry->nr_objects_to_shrink,
219 show_gfp_flags(__entry->gfp_flags),
220 __entry->pgs_scanned,
221 __entry->lru_pgs,
222 __entry->cache_items,
223 __entry->delta,
224 __entry->total_scan)
225);
226
227TRACE_EVENT(mm_shrink_slab_end,
228 TP_PROTO(struct shrinker *shr, int shrinker_retval,
229 long unused_scan_cnt, long new_scan_cnt),
230
231 TP_ARGS(shr, shrinker_retval, unused_scan_cnt, new_scan_cnt),
232
233 TP_STRUCT__entry(
234 __field(struct shrinker *, shr)
235 __field(void *, shrink)
236 __field(long, unused_scan)
237 __field(long, new_scan)
238 __field(int, retval)
239 __field(long, total_scan)
240 ),
241
242 TP_fast_assign(
243 __entry->shr = shr;
244 __entry->shrink = shr->shrink;
245 __entry->unused_scan = unused_scan_cnt;
246 __entry->new_scan = new_scan_cnt;
247 __entry->retval = shrinker_retval;
248 __entry->total_scan = new_scan_cnt - unused_scan_cnt;
249 ),
250
251 TP_printk("%pF %p: unused scan count %ld new scan count %ld total_scan %ld last shrinker return val %d",
252 __entry->shrink,
253 __entry->shr,
254 __entry->unused_scan,
255 __entry->new_scan,
256 __entry->total_scan,
257 __entry->retval)
258);
180 259
181DECLARE_EVENT_CLASS(mm_vmscan_lru_isolate_template, 260DECLARE_EVENT_CLASS(mm_vmscan_lru_isolate_template,
182 261
@@ -310,6 +389,87 @@ TRACE_EVENT(mm_vmscan_lru_shrink_inactive,
310 show_reclaim_flags(__entry->reclaim_flags)) 389 show_reclaim_flags(__entry->reclaim_flags))
311); 390);
312 391
392TRACE_EVENT(replace_swap_token,
393 TP_PROTO(struct mm_struct *old_mm,
394 struct mm_struct *new_mm),
395
396 TP_ARGS(old_mm, new_mm),
397
398 TP_STRUCT__entry(
399 __field(struct mm_struct*, old_mm)
400 __field(unsigned int, old_prio)
401 __field(struct mm_struct*, new_mm)
402 __field(unsigned int, new_prio)
403 ),
404
405 TP_fast_assign(
406 __entry->old_mm = old_mm;
407 __entry->old_prio = old_mm ? old_mm->token_priority : 0;
408 __entry->new_mm = new_mm;
409 __entry->new_prio = new_mm->token_priority;
410 ),
411
412 TP_printk("old_token_mm=%p old_prio=%u new_token_mm=%p new_prio=%u",
413 __entry->old_mm, __entry->old_prio,
414 __entry->new_mm, __entry->new_prio)
415);
416
417DECLARE_EVENT_CLASS(put_swap_token_template,
418 TP_PROTO(struct mm_struct *swap_token_mm),
419
420 TP_ARGS(swap_token_mm),
421
422 TP_STRUCT__entry(
423 __field(struct mm_struct*, swap_token_mm)
424 ),
425
426 TP_fast_assign(
427 __entry->swap_token_mm = swap_token_mm;
428 ),
429
430 TP_printk("token_mm=%p", __entry->swap_token_mm)
431);
432
433DEFINE_EVENT(put_swap_token_template, put_swap_token,
434 TP_PROTO(struct mm_struct *swap_token_mm),
435 TP_ARGS(swap_token_mm)
436);
437
438DEFINE_EVENT_CONDITION(put_swap_token_template, disable_swap_token,
439 TP_PROTO(struct mm_struct *swap_token_mm),
440 TP_ARGS(swap_token_mm),
441 TP_CONDITION(swap_token_mm != NULL)
442);
443
444TRACE_EVENT_CONDITION(update_swap_token_priority,
445 TP_PROTO(struct mm_struct *mm,
446 unsigned int old_prio,
447 struct mm_struct *swap_token_mm),
448
449 TP_ARGS(mm, old_prio, swap_token_mm),
450
451 TP_CONDITION(mm->token_priority != old_prio),
452
453 TP_STRUCT__entry(
454 __field(struct mm_struct*, mm)
455 __field(unsigned int, old_prio)
456 __field(unsigned int, new_prio)
457 __field(struct mm_struct*, swap_token_mm)
458 __field(unsigned int, swap_token_prio)
459 ),
460
461 TP_fast_assign(
462 __entry->mm = mm;
463 __entry->old_prio = old_prio;
464 __entry->new_prio = mm->token_priority;
465 __entry->swap_token_mm = swap_token_mm;
466 __entry->swap_token_prio = swap_token_mm ? swap_token_mm->token_priority : 0;
467 ),
468
469 TP_printk("mm=%p old_prio=%u new_prio=%u swap_token_mm=%p token_prio=%u",
470 __entry->mm, __entry->old_prio, __entry->new_prio,
471 __entry->swap_token_mm, __entry->swap_token_prio)
472);
313 473
314#endif /* _TRACE_VMSCAN_H */ 474#endif /* _TRACE_VMSCAN_H */
315 475
diff --git a/include/trace/events/writeback.h b/include/trace/events/writeback.h
index 4e249b927eaa..6bca4cc0063c 100644
--- a/include/trace/events/writeback.h
+++ b/include/trace/events/writeback.h
@@ -8,6 +8,19 @@
8#include <linux/device.h> 8#include <linux/device.h>
9#include <linux/writeback.h> 9#include <linux/writeback.h>
10 10
11#define show_inode_state(state) \
12 __print_flags(state, "|", \
13 {I_DIRTY_SYNC, "I_DIRTY_SYNC"}, \
14 {I_DIRTY_DATASYNC, "I_DIRTY_DATASYNC"}, \
15 {I_DIRTY_PAGES, "I_DIRTY_PAGES"}, \
16 {I_NEW, "I_NEW"}, \
17 {I_WILL_FREE, "I_WILL_FREE"}, \
18 {I_FREEING, "I_FREEING"}, \
19 {I_CLEAR, "I_CLEAR"}, \
20 {I_SYNC, "I_SYNC"}, \
21 {I_REFERENCED, "I_REFERENCED"} \
22 )
23
11struct wb_writeback_work; 24struct wb_writeback_work;
12 25
13DECLARE_EVENT_CLASS(writeback_work_class, 26DECLARE_EVENT_CLASS(writeback_work_class,
@@ -49,6 +62,9 @@ DEFINE_EVENT(writeback_work_class, name, \
49DEFINE_WRITEBACK_WORK_EVENT(writeback_nothread); 62DEFINE_WRITEBACK_WORK_EVENT(writeback_nothread);
50DEFINE_WRITEBACK_WORK_EVENT(writeback_queue); 63DEFINE_WRITEBACK_WORK_EVENT(writeback_queue);
51DEFINE_WRITEBACK_WORK_EVENT(writeback_exec); 64DEFINE_WRITEBACK_WORK_EVENT(writeback_exec);
65DEFINE_WRITEBACK_WORK_EVENT(writeback_start);
66DEFINE_WRITEBACK_WORK_EVENT(writeback_written);
67DEFINE_WRITEBACK_WORK_EVENT(writeback_wait);
52 68
53TRACE_EVENT(writeback_pages_written, 69TRACE_EVENT(writeback_pages_written,
54 TP_PROTO(long pages_written), 70 TP_PROTO(long pages_written),
@@ -88,6 +104,30 @@ DEFINE_WRITEBACK_EVENT(writeback_bdi_register);
88DEFINE_WRITEBACK_EVENT(writeback_bdi_unregister); 104DEFINE_WRITEBACK_EVENT(writeback_bdi_unregister);
89DEFINE_WRITEBACK_EVENT(writeback_thread_start); 105DEFINE_WRITEBACK_EVENT(writeback_thread_start);
90DEFINE_WRITEBACK_EVENT(writeback_thread_stop); 106DEFINE_WRITEBACK_EVENT(writeback_thread_stop);
107DEFINE_WRITEBACK_EVENT(balance_dirty_start);
108DEFINE_WRITEBACK_EVENT(balance_dirty_wait);
109
110TRACE_EVENT(balance_dirty_written,
111
112 TP_PROTO(struct backing_dev_info *bdi, int written),
113
114 TP_ARGS(bdi, written),
115
116 TP_STRUCT__entry(
117 __array(char, name, 32)
118 __field(int, written)
119 ),
120
121 TP_fast_assign(
122 strncpy(__entry->name, dev_name(bdi->dev), 32);
123 __entry->written = written;
124 ),
125
126 TP_printk("bdi %s written %d",
127 __entry->name,
128 __entry->written
129 )
130);
91 131
92DECLARE_EVENT_CLASS(wbc_class, 132DECLARE_EVENT_CLASS(wbc_class,
93 TP_PROTO(struct writeback_control *wbc, struct backing_dev_info *bdi), 133 TP_PROTO(struct writeback_control *wbc, struct backing_dev_info *bdi),
@@ -101,8 +141,6 @@ DECLARE_EVENT_CLASS(wbc_class,
101 __field(int, for_background) 141 __field(int, for_background)
102 __field(int, for_reclaim) 142 __field(int, for_reclaim)
103 __field(int, range_cyclic) 143 __field(int, range_cyclic)
104 __field(int, more_io)
105 __field(unsigned long, older_than_this)
106 __field(long, range_start) 144 __field(long, range_start)
107 __field(long, range_end) 145 __field(long, range_end)
108 ), 146 ),
@@ -116,15 +154,12 @@ DECLARE_EVENT_CLASS(wbc_class,
116 __entry->for_background = wbc->for_background; 154 __entry->for_background = wbc->for_background;
117 __entry->for_reclaim = wbc->for_reclaim; 155 __entry->for_reclaim = wbc->for_reclaim;
118 __entry->range_cyclic = wbc->range_cyclic; 156 __entry->range_cyclic = wbc->range_cyclic;
119 __entry->more_io = wbc->more_io;
120 __entry->older_than_this = wbc->older_than_this ?
121 *wbc->older_than_this : 0;
122 __entry->range_start = (long)wbc->range_start; 157 __entry->range_start = (long)wbc->range_start;
123 __entry->range_end = (long)wbc->range_end; 158 __entry->range_end = (long)wbc->range_end;
124 ), 159 ),
125 160
126 TP_printk("bdi %s: towrt=%ld skip=%ld mode=%d kupd=%d " 161 TP_printk("bdi %s: towrt=%ld skip=%ld mode=%d kupd=%d "
127 "bgrd=%d reclm=%d cyclic=%d more=%d older=0x%lx " 162 "bgrd=%d reclm=%d cyclic=%d "
128 "start=0x%lx end=0x%lx", 163 "start=0x%lx end=0x%lx",
129 __entry->name, 164 __entry->name,
130 __entry->nr_to_write, 165 __entry->nr_to_write,
@@ -134,8 +169,6 @@ DECLARE_EVENT_CLASS(wbc_class,
134 __entry->for_background, 169 __entry->for_background,
135 __entry->for_reclaim, 170 __entry->for_reclaim,
136 __entry->range_cyclic, 171 __entry->range_cyclic,
137 __entry->more_io,
138 __entry->older_than_this,
139 __entry->range_start, 172 __entry->range_start,
140 __entry->range_end) 173 __entry->range_end)
141) 174)
@@ -144,14 +177,79 @@ DECLARE_EVENT_CLASS(wbc_class,
144DEFINE_EVENT(wbc_class, name, \ 177DEFINE_EVENT(wbc_class, name, \
145 TP_PROTO(struct writeback_control *wbc, struct backing_dev_info *bdi), \ 178 TP_PROTO(struct writeback_control *wbc, struct backing_dev_info *bdi), \
146 TP_ARGS(wbc, bdi)) 179 TP_ARGS(wbc, bdi))
147DEFINE_WBC_EVENT(wbc_writeback_start);
148DEFINE_WBC_EVENT(wbc_writeback_written);
149DEFINE_WBC_EVENT(wbc_writeback_wait);
150DEFINE_WBC_EVENT(wbc_balance_dirty_start);
151DEFINE_WBC_EVENT(wbc_balance_dirty_written);
152DEFINE_WBC_EVENT(wbc_balance_dirty_wait);
153DEFINE_WBC_EVENT(wbc_writepage); 180DEFINE_WBC_EVENT(wbc_writepage);
154 181
182TRACE_EVENT(writeback_queue_io,
183 TP_PROTO(struct bdi_writeback *wb,
184 unsigned long *older_than_this,
185 int moved),
186 TP_ARGS(wb, older_than_this, moved),
187 TP_STRUCT__entry(
188 __array(char, name, 32)
189 __field(unsigned long, older)
190 __field(long, age)
191 __field(int, moved)
192 ),
193 TP_fast_assign(
194 strncpy(__entry->name, dev_name(wb->bdi->dev), 32);
195 __entry->older = older_than_this ? *older_than_this : 0;
196 __entry->age = older_than_this ?
197 (jiffies - *older_than_this) * 1000 / HZ : -1;
198 __entry->moved = moved;
199 ),
200 TP_printk("bdi %s: older=%lu age=%ld enqueue=%d",
201 __entry->name,
202 __entry->older, /* older_than_this in jiffies */
203 __entry->age, /* older_than_this in relative milliseconds */
204 __entry->moved)
205);
206
207TRACE_EVENT(global_dirty_state,
208
209 TP_PROTO(unsigned long background_thresh,
210 unsigned long dirty_thresh
211 ),
212
213 TP_ARGS(background_thresh,
214 dirty_thresh
215 ),
216
217 TP_STRUCT__entry(
218 __field(unsigned long, nr_dirty)
219 __field(unsigned long, nr_writeback)
220 __field(unsigned long, nr_unstable)
221 __field(unsigned long, background_thresh)
222 __field(unsigned long, dirty_thresh)
223 __field(unsigned long, dirty_limit)
224 __field(unsigned long, nr_dirtied)
225 __field(unsigned long, nr_written)
226 ),
227
228 TP_fast_assign(
229 __entry->nr_dirty = global_page_state(NR_FILE_DIRTY);
230 __entry->nr_writeback = global_page_state(NR_WRITEBACK);
231 __entry->nr_unstable = global_page_state(NR_UNSTABLE_NFS);
232 __entry->nr_dirtied = global_page_state(NR_DIRTIED);
233 __entry->nr_written = global_page_state(NR_WRITTEN);
234 __entry->background_thresh = background_thresh;
235 __entry->dirty_thresh = dirty_thresh;
236 __entry->dirty_limit = global_dirty_limit;
237 ),
238
239 TP_printk("dirty=%lu writeback=%lu unstable=%lu "
240 "bg_thresh=%lu thresh=%lu limit=%lu "
241 "dirtied=%lu written=%lu",
242 __entry->nr_dirty,
243 __entry->nr_writeback,
244 __entry->nr_unstable,
245 __entry->background_thresh,
246 __entry->dirty_thresh,
247 __entry->dirty_limit,
248 __entry->nr_dirtied,
249 __entry->nr_written
250 )
251);
252
155DECLARE_EVENT_CLASS(writeback_congest_waited_template, 253DECLARE_EVENT_CLASS(writeback_congest_waited_template,
156 254
157 TP_PROTO(unsigned int usec_timeout, unsigned int usec_delayed), 255 TP_PROTO(unsigned int usec_timeout, unsigned int usec_delayed),
@@ -187,6 +285,63 @@ DEFINE_EVENT(writeback_congest_waited_template, writeback_wait_iff_congested,
187 TP_ARGS(usec_timeout, usec_delayed) 285 TP_ARGS(usec_timeout, usec_delayed)
188); 286);
189 287
288DECLARE_EVENT_CLASS(writeback_single_inode_template,
289
290 TP_PROTO(struct inode *inode,
291 struct writeback_control *wbc,
292 unsigned long nr_to_write
293 ),
294
295 TP_ARGS(inode, wbc, nr_to_write),
296
297 TP_STRUCT__entry(
298 __array(char, name, 32)
299 __field(unsigned long, ino)
300 __field(unsigned long, state)
301 __field(unsigned long, age)
302 __field(unsigned long, writeback_index)
303 __field(long, nr_to_write)
304 __field(unsigned long, wrote)
305 ),
306
307 TP_fast_assign(
308 strncpy(__entry->name,
309 dev_name(inode->i_mapping->backing_dev_info->dev), 32);
310 __entry->ino = inode->i_ino;
311 __entry->state = inode->i_state;
312 __entry->age = (jiffies - inode->dirtied_when) *
313 1000 / HZ;
314 __entry->writeback_index = inode->i_mapping->writeback_index;
315 __entry->nr_to_write = nr_to_write;
316 __entry->wrote = nr_to_write - wbc->nr_to_write;
317 ),
318
319 TP_printk("bdi %s: ino=%lu state=%s age=%lu "
320 "index=%lu to_write=%ld wrote=%lu",
321 __entry->name,
322 __entry->ino,
323 show_inode_state(__entry->state),
324 __entry->age,
325 __entry->writeback_index,
326 __entry->nr_to_write,
327 __entry->wrote
328 )
329);
330
331DEFINE_EVENT(writeback_single_inode_template, writeback_single_inode_requeue,
332 TP_PROTO(struct inode *inode,
333 struct writeback_control *wbc,
334 unsigned long nr_to_write),
335 TP_ARGS(inode, wbc, nr_to_write)
336);
337
338DEFINE_EVENT(writeback_single_inode_template, writeback_single_inode,
339 TP_PROTO(struct inode *inode,
340 struct writeback_control *wbc,
341 unsigned long nr_to_write),
342 TP_ARGS(inode, wbc, nr_to_write)
343);
344
190#endif /* _TRACE_WRITEBACK_H */ 345#endif /* _TRACE_WRITEBACK_H */
191 346
192/* This part must be outside protection */ 347/* This part must be outside protection */
diff --git a/include/trace/events/xen.h b/include/trace/events/xen.h
new file mode 100644
index 000000000000..92f1a796829e
--- /dev/null
+++ b/include/trace/events/xen.h
@@ -0,0 +1,506 @@
1#undef TRACE_SYSTEM
2#define TRACE_SYSTEM xen
3
4#if !defined(_TRACE_XEN_H) || defined(TRACE_HEADER_MULTI_READ)
5#define _TRACE_XEN_H
6
7#include <linux/tracepoint.h>
8#include <asm/paravirt_types.h>
9#include <asm/xen/trace_types.h>
10
11struct multicall_entry;
12
13/* Multicalls */
14DECLARE_EVENT_CLASS(xen_mc__batch,
15 TP_PROTO(enum paravirt_lazy_mode mode),
16 TP_ARGS(mode),
17 TP_STRUCT__entry(
18 __field(enum paravirt_lazy_mode, mode)
19 ),
20 TP_fast_assign(__entry->mode = mode),
21 TP_printk("start batch LAZY_%s",
22 (__entry->mode == PARAVIRT_LAZY_MMU) ? "MMU" :
23 (__entry->mode == PARAVIRT_LAZY_CPU) ? "CPU" : "NONE")
24 );
25#define DEFINE_XEN_MC_BATCH(name) \
26 DEFINE_EVENT(xen_mc__batch, name, \
27 TP_PROTO(enum paravirt_lazy_mode mode), \
28 TP_ARGS(mode))
29
30DEFINE_XEN_MC_BATCH(xen_mc_batch);
31DEFINE_XEN_MC_BATCH(xen_mc_issue);
32
33TRACE_EVENT(xen_mc_entry,
34 TP_PROTO(struct multicall_entry *mc, unsigned nargs),
35 TP_ARGS(mc, nargs),
36 TP_STRUCT__entry(
37 __field(unsigned int, op)
38 __field(unsigned int, nargs)
39 __array(unsigned long, args, 6)
40 ),
41 TP_fast_assign(__entry->op = mc->op;
42 __entry->nargs = nargs;
43 memcpy(__entry->args, mc->args, sizeof(unsigned long) * nargs);
44 memset(__entry->args + nargs, 0, sizeof(unsigned long) * (6 - nargs));
45 ),
46 TP_printk("op %u%s args [%lx, %lx, %lx, %lx, %lx, %lx]",
47 __entry->op, xen_hypercall_name(__entry->op),
48 __entry->args[0], __entry->args[1], __entry->args[2],
49 __entry->args[3], __entry->args[4], __entry->args[5])
50 );
51
52TRACE_EVENT(xen_mc_entry_alloc,
53 TP_PROTO(size_t args),
54 TP_ARGS(args),
55 TP_STRUCT__entry(
56 __field(size_t, args)
57 ),
58 TP_fast_assign(__entry->args = args),
59 TP_printk("alloc entry %zu arg bytes", __entry->args)
60 );
61
62TRACE_EVENT(xen_mc_callback,
63 TP_PROTO(xen_mc_callback_fn_t fn, void *data),
64 TP_ARGS(fn, data),
65 TP_STRUCT__entry(
66 __field(xen_mc_callback_fn_t, fn)
67 __field(void *, data)
68 ),
69 TP_fast_assign(
70 __entry->fn = fn;
71 __entry->data = data;
72 ),
73 TP_printk("callback %pf, data %p",
74 __entry->fn, __entry->data)
75 );
76
77TRACE_EVENT(xen_mc_flush_reason,
78 TP_PROTO(enum xen_mc_flush_reason reason),
79 TP_ARGS(reason),
80 TP_STRUCT__entry(
81 __field(enum xen_mc_flush_reason, reason)
82 ),
83 TP_fast_assign(__entry->reason = reason),
84 TP_printk("flush reason %s",
85 (__entry->reason == XEN_MC_FL_NONE) ? "NONE" :
86 (__entry->reason == XEN_MC_FL_BATCH) ? "BATCH" :
87 (__entry->reason == XEN_MC_FL_ARGS) ? "ARGS" :
88 (__entry->reason == XEN_MC_FL_CALLBACK) ? "CALLBACK" : "??")
89 );
90
91TRACE_EVENT(xen_mc_flush,
92 TP_PROTO(unsigned mcidx, unsigned argidx, unsigned cbidx),
93 TP_ARGS(mcidx, argidx, cbidx),
94 TP_STRUCT__entry(
95 __field(unsigned, mcidx)
96 __field(unsigned, argidx)
97 __field(unsigned, cbidx)
98 ),
99 TP_fast_assign(__entry->mcidx = mcidx;
100 __entry->argidx = argidx;
101 __entry->cbidx = cbidx),
102 TP_printk("flushing %u hypercalls, %u arg bytes, %u callbacks",
103 __entry->mcidx, __entry->argidx, __entry->cbidx)
104 );
105
106TRACE_EVENT(xen_mc_extend_args,
107 TP_PROTO(unsigned long op, size_t args, enum xen_mc_extend_args res),
108 TP_ARGS(op, args, res),
109 TP_STRUCT__entry(
110 __field(unsigned int, op)
111 __field(size_t, args)
112 __field(enum xen_mc_extend_args, res)
113 ),
114 TP_fast_assign(__entry->op = op;
115 __entry->args = args;
116 __entry->res = res),
117 TP_printk("extending op %u%s by %zu bytes res %s",
118 __entry->op, xen_hypercall_name(__entry->op),
119 __entry->args,
120 __entry->res == XEN_MC_XE_OK ? "OK" :
121 __entry->res == XEN_MC_XE_BAD_OP ? "BAD_OP" :
122 __entry->res == XEN_MC_XE_NO_SPACE ? "NO_SPACE" : "???")
123 );
124
125/* mmu */
126DECLARE_EVENT_CLASS(xen_mmu__set_pte,
127 TP_PROTO(pte_t *ptep, pte_t pteval),
128 TP_ARGS(ptep, pteval),
129 TP_STRUCT__entry(
130 __field(pte_t *, ptep)
131 __field(pteval_t, pteval)
132 ),
133 TP_fast_assign(__entry->ptep = ptep;
134 __entry->pteval = pteval.pte),
135 TP_printk("ptep %p pteval %0*llx (raw %0*llx)",
136 __entry->ptep,
137 (int)sizeof(pteval_t) * 2, (unsigned long long)pte_val(native_make_pte(__entry->pteval)),
138 (int)sizeof(pteval_t) * 2, (unsigned long long)__entry->pteval)
139 );
140
141#define DEFINE_XEN_MMU_SET_PTE(name) \
142 DEFINE_EVENT(xen_mmu__set_pte, name, \
143 TP_PROTO(pte_t *ptep, pte_t pteval), \
144 TP_ARGS(ptep, pteval))
145
146DEFINE_XEN_MMU_SET_PTE(xen_mmu_set_pte);
147DEFINE_XEN_MMU_SET_PTE(xen_mmu_set_pte_atomic);
148
149TRACE_EVENT(xen_mmu_set_domain_pte,
150 TP_PROTO(pte_t *ptep, pte_t pteval, unsigned domid),
151 TP_ARGS(ptep, pteval, domid),
152 TP_STRUCT__entry(
153 __field(pte_t *, ptep)
154 __field(pteval_t, pteval)
155 __field(unsigned, domid)
156 ),
157 TP_fast_assign(__entry->ptep = ptep;
158 __entry->pteval = pteval.pte;
159 __entry->domid = domid),
160 TP_printk("ptep %p pteval %0*llx (raw %0*llx) domid %u",
161 __entry->ptep,
162 (int)sizeof(pteval_t) * 2, (unsigned long long)pte_val(native_make_pte(__entry->pteval)),
163 (int)sizeof(pteval_t) * 2, (unsigned long long)__entry->pteval,
164 __entry->domid)
165 );
166
167TRACE_EVENT(xen_mmu_set_pte_at,
168 TP_PROTO(struct mm_struct *mm, unsigned long addr,
169 pte_t *ptep, pte_t pteval),
170 TP_ARGS(mm, addr, ptep, pteval),
171 TP_STRUCT__entry(
172 __field(struct mm_struct *, mm)
173 __field(unsigned long, addr)
174 __field(pte_t *, ptep)
175 __field(pteval_t, pteval)
176 ),
177 TP_fast_assign(__entry->mm = mm;
178 __entry->addr = addr;
179 __entry->ptep = ptep;
180 __entry->pteval = pteval.pte),
181 TP_printk("mm %p addr %lx ptep %p pteval %0*llx (raw %0*llx)",
182 __entry->mm, __entry->addr, __entry->ptep,
183 (int)sizeof(pteval_t) * 2, (unsigned long long)pte_val(native_make_pte(__entry->pteval)),
184 (int)sizeof(pteval_t) * 2, (unsigned long long)__entry->pteval)
185 );
186
187TRACE_EVENT(xen_mmu_pte_clear,
188 TP_PROTO(struct mm_struct *mm, unsigned long addr, pte_t *ptep),
189 TP_ARGS(mm, addr, ptep),
190 TP_STRUCT__entry(
191 __field(struct mm_struct *, mm)
192 __field(unsigned long, addr)
193 __field(pte_t *, ptep)
194 ),
195 TP_fast_assign(__entry->mm = mm;
196 __entry->addr = addr;
197 __entry->ptep = ptep),
198 TP_printk("mm %p addr %lx ptep %p",
199 __entry->mm, __entry->addr, __entry->ptep)
200 );
201
202TRACE_EVENT(xen_mmu_set_pmd,
203 TP_PROTO(pmd_t *pmdp, pmd_t pmdval),
204 TP_ARGS(pmdp, pmdval),
205 TP_STRUCT__entry(
206 __field(pmd_t *, pmdp)
207 __field(pmdval_t, pmdval)
208 ),
209 TP_fast_assign(__entry->pmdp = pmdp;
210 __entry->pmdval = pmdval.pmd),
211 TP_printk("pmdp %p pmdval %0*llx (raw %0*llx)",
212 __entry->pmdp,
213 (int)sizeof(pmdval_t) * 2, (unsigned long long)pmd_val(native_make_pmd(__entry->pmdval)),
214 (int)sizeof(pmdval_t) * 2, (unsigned long long)__entry->pmdval)
215 );
216
217TRACE_EVENT(xen_mmu_pmd_clear,
218 TP_PROTO(pmd_t *pmdp),
219 TP_ARGS(pmdp),
220 TP_STRUCT__entry(
221 __field(pmd_t *, pmdp)
222 ),
223 TP_fast_assign(__entry->pmdp = pmdp),
224 TP_printk("pmdp %p", __entry->pmdp)
225 );
226
227#if PAGETABLE_LEVELS >= 4
228
229TRACE_EVENT(xen_mmu_set_pud,
230 TP_PROTO(pud_t *pudp, pud_t pudval),
231 TP_ARGS(pudp, pudval),
232 TP_STRUCT__entry(
233 __field(pud_t *, pudp)
234 __field(pudval_t, pudval)
235 ),
236 TP_fast_assign(__entry->pudp = pudp;
237 __entry->pudval = native_pud_val(pudval)),
238 TP_printk("pudp %p pudval %0*llx (raw %0*llx)",
239 __entry->pudp,
240 (int)sizeof(pudval_t) * 2, (unsigned long long)pud_val(native_make_pud(__entry->pudval)),
241 (int)sizeof(pudval_t) * 2, (unsigned long long)__entry->pudval)
242 );
243
244TRACE_EVENT(xen_mmu_set_pgd,
245 TP_PROTO(pgd_t *pgdp, pgd_t *user_pgdp, pgd_t pgdval),
246 TP_ARGS(pgdp, user_pgdp, pgdval),
247 TP_STRUCT__entry(
248 __field(pgd_t *, pgdp)
249 __field(pgd_t *, user_pgdp)
250 __field(pgdval_t, pgdval)
251 ),
252 TP_fast_assign(__entry->pgdp = pgdp;
253 __entry->user_pgdp = user_pgdp;
254 __entry->pgdval = pgdval.pgd),
255 TP_printk("pgdp %p user_pgdp %p pgdval %0*llx (raw %0*llx)",
256 __entry->pgdp, __entry->user_pgdp,
257 (int)sizeof(pgdval_t) * 2, (unsigned long long)pgd_val(native_make_pgd(__entry->pgdval)),
258 (int)sizeof(pgdval_t) * 2, (unsigned long long)__entry->pgdval)
259 );
260
261TRACE_EVENT(xen_mmu_pud_clear,
262 TP_PROTO(pud_t *pudp),
263 TP_ARGS(pudp),
264 TP_STRUCT__entry(
265 __field(pud_t *, pudp)
266 ),
267 TP_fast_assign(__entry->pudp = pudp),
268 TP_printk("pudp %p", __entry->pudp)
269 );
270#else
271
272TRACE_EVENT(xen_mmu_set_pud,
273 TP_PROTO(pud_t *pudp, pud_t pudval),
274 TP_ARGS(pudp, pudval),
275 TP_STRUCT__entry(
276 __field(pud_t *, pudp)
277 __field(pudval_t, pudval)
278 ),
279 TP_fast_assign(__entry->pudp = pudp;
280 __entry->pudval = native_pud_val(pudval)),
281 TP_printk("pudp %p pudval %0*llx (raw %0*llx)",
282 __entry->pudp,
283 (int)sizeof(pudval_t) * 2, (unsigned long long)pgd_val(native_make_pgd(__entry->pudval)),
284 (int)sizeof(pudval_t) * 2, (unsigned long long)__entry->pudval)
285 );
286
287#endif
288
289TRACE_EVENT(xen_mmu_pgd_clear,
290 TP_PROTO(pgd_t *pgdp),
291 TP_ARGS(pgdp),
292 TP_STRUCT__entry(
293 __field(pgd_t *, pgdp)
294 ),
295 TP_fast_assign(__entry->pgdp = pgdp),
296 TP_printk("pgdp %p", __entry->pgdp)
297 );
298
299DECLARE_EVENT_CLASS(xen_mmu_ptep_modify_prot,
300 TP_PROTO(struct mm_struct *mm, unsigned long addr,
301 pte_t *ptep, pte_t pteval),
302 TP_ARGS(mm, addr, ptep, pteval),
303 TP_STRUCT__entry(
304 __field(struct mm_struct *, mm)
305 __field(unsigned long, addr)
306 __field(pte_t *, ptep)
307 __field(pteval_t, pteval)
308 ),
309 TP_fast_assign(__entry->mm = mm;
310 __entry->addr = addr;
311 __entry->ptep = ptep;
312 __entry->pteval = pteval.pte),
313 TP_printk("mm %p addr %lx ptep %p pteval %0*llx (raw %0*llx)",
314 __entry->mm, __entry->addr, __entry->ptep,
315 (int)sizeof(pteval_t) * 2, (unsigned long long)pte_val(native_make_pte(__entry->pteval)),
316 (int)sizeof(pteval_t) * 2, (unsigned long long)__entry->pteval)
317 );
318#define DEFINE_XEN_MMU_PTEP_MODIFY_PROT(name) \
319 DEFINE_EVENT(xen_mmu_ptep_modify_prot, name, \
320 TP_PROTO(struct mm_struct *mm, unsigned long addr, \
321 pte_t *ptep, pte_t pteval), \
322 TP_ARGS(mm, addr, ptep, pteval))
323
324DEFINE_XEN_MMU_PTEP_MODIFY_PROT(xen_mmu_ptep_modify_prot_start);
325DEFINE_XEN_MMU_PTEP_MODIFY_PROT(xen_mmu_ptep_modify_prot_commit);
326
327TRACE_EVENT(xen_mmu_alloc_ptpage,
328 TP_PROTO(struct mm_struct *mm, unsigned long pfn, unsigned level, bool pinned),
329 TP_ARGS(mm, pfn, level, pinned),
330 TP_STRUCT__entry(
331 __field(struct mm_struct *, mm)
332 __field(unsigned long, pfn)
333 __field(unsigned, level)
334 __field(bool, pinned)
335 ),
336 TP_fast_assign(__entry->mm = mm;
337 __entry->pfn = pfn;
338 __entry->level = level;
339 __entry->pinned = pinned),
340 TP_printk("mm %p pfn %lx level %d %spinned",
341 __entry->mm, __entry->pfn, __entry->level,
342 __entry->pinned ? "" : "un")
343 );
344
345TRACE_EVENT(xen_mmu_release_ptpage,
346 TP_PROTO(unsigned long pfn, unsigned level, bool pinned),
347 TP_ARGS(pfn, level, pinned),
348 TP_STRUCT__entry(
349 __field(unsigned long, pfn)
350 __field(unsigned, level)
351 __field(bool, pinned)
352 ),
353 TP_fast_assign(__entry->pfn = pfn;
354 __entry->level = level;
355 __entry->pinned = pinned),
356 TP_printk("pfn %lx level %d %spinned",
357 __entry->pfn, __entry->level,
358 __entry->pinned ? "" : "un")
359 );
360
361DECLARE_EVENT_CLASS(xen_mmu_pgd,
362 TP_PROTO(struct mm_struct *mm, pgd_t *pgd),
363 TP_ARGS(mm, pgd),
364 TP_STRUCT__entry(
365 __field(struct mm_struct *, mm)
366 __field(pgd_t *, pgd)
367 ),
368 TP_fast_assign(__entry->mm = mm;
369 __entry->pgd = pgd),
370 TP_printk("mm %p pgd %p", __entry->mm, __entry->pgd)
371 );
372#define DEFINE_XEN_MMU_PGD_EVENT(name) \
373 DEFINE_EVENT(xen_mmu_pgd, name, \
374 TP_PROTO(struct mm_struct *mm, pgd_t *pgd), \
375 TP_ARGS(mm, pgd))
376
377DEFINE_XEN_MMU_PGD_EVENT(xen_mmu_pgd_pin);
378DEFINE_XEN_MMU_PGD_EVENT(xen_mmu_pgd_unpin);
379
380TRACE_EVENT(xen_mmu_flush_tlb,
381 TP_PROTO(int x),
382 TP_ARGS(x),
383 TP_STRUCT__entry(__array(char, x, 0)),
384 TP_fast_assign((void)x),
385 TP_printk("%s", "")
386 );
387
388TRACE_EVENT(xen_mmu_flush_tlb_single,
389 TP_PROTO(unsigned long addr),
390 TP_ARGS(addr),
391 TP_STRUCT__entry(
392 __field(unsigned long, addr)
393 ),
394 TP_fast_assign(__entry->addr = addr),
395 TP_printk("addr %lx", __entry->addr)
396 );
397
398TRACE_EVENT(xen_mmu_flush_tlb_others,
399 TP_PROTO(const struct cpumask *cpus, struct mm_struct *mm,
400 unsigned long addr),
401 TP_ARGS(cpus, mm, addr),
402 TP_STRUCT__entry(
403 __field(unsigned, ncpus)
404 __field(struct mm_struct *, mm)
405 __field(unsigned long, addr)
406 ),
407 TP_fast_assign(__entry->ncpus = cpumask_weight(cpus);
408 __entry->mm = mm;
409 __entry->addr = addr),
410 TP_printk("ncpus %d mm %p addr %lx",
411 __entry->ncpus, __entry->mm, __entry->addr)
412 );
413
414TRACE_EVENT(xen_mmu_write_cr3,
415 TP_PROTO(bool kernel, unsigned long cr3),
416 TP_ARGS(kernel, cr3),
417 TP_STRUCT__entry(
418 __field(bool, kernel)
419 __field(unsigned long, cr3)
420 ),
421 TP_fast_assign(__entry->kernel = kernel;
422 __entry->cr3 = cr3),
423 TP_printk("%s cr3 %lx",
424 __entry->kernel ? "kernel" : "user", __entry->cr3)
425 );
426
427
428/* CPU */
429TRACE_EVENT(xen_cpu_write_ldt_entry,
430 TP_PROTO(struct desc_struct *dt, int entrynum, u64 desc),
431 TP_ARGS(dt, entrynum, desc),
432 TP_STRUCT__entry(
433 __field(struct desc_struct *, dt)
434 __field(int, entrynum)
435 __field(u64, desc)
436 ),
437 TP_fast_assign(__entry->dt = dt;
438 __entry->entrynum = entrynum;
439 __entry->desc = desc;
440 ),
441 TP_printk("dt %p entrynum %d entry %016llx",
442 __entry->dt, __entry->entrynum,
443 (unsigned long long)__entry->desc)
444 );
445
446TRACE_EVENT(xen_cpu_write_idt_entry,
447 TP_PROTO(gate_desc *dt, int entrynum, const gate_desc *ent),
448 TP_ARGS(dt, entrynum, ent),
449 TP_STRUCT__entry(
450 __field(gate_desc *, dt)
451 __field(int, entrynum)
452 ),
453 TP_fast_assign(__entry->dt = dt;
454 __entry->entrynum = entrynum;
455 ),
456 TP_printk("dt %p entrynum %d",
457 __entry->dt, __entry->entrynum)
458 );
459
460TRACE_EVENT(xen_cpu_load_idt,
461 TP_PROTO(const struct desc_ptr *desc),
462 TP_ARGS(desc),
463 TP_STRUCT__entry(
464 __field(unsigned long, addr)
465 ),
466 TP_fast_assign(__entry->addr = desc->address),
467 TP_printk("addr %lx", __entry->addr)
468 );
469
470TRACE_EVENT(xen_cpu_write_gdt_entry,
471 TP_PROTO(struct desc_struct *dt, int entrynum, const void *desc, int type),
472 TP_ARGS(dt, entrynum, desc, type),
473 TP_STRUCT__entry(
474 __field(u64, desc)
475 __field(struct desc_struct *, dt)
476 __field(int, entrynum)
477 __field(int, type)
478 ),
479 TP_fast_assign(__entry->dt = dt;
480 __entry->entrynum = entrynum;
481 __entry->desc = *(u64 *)desc;
482 __entry->type = type;
483 ),
484 TP_printk("dt %p entrynum %d type %d desc %016llx",
485 __entry->dt, __entry->entrynum, __entry->type,
486 (unsigned long long)__entry->desc)
487 );
488
489TRACE_EVENT(xen_cpu_set_ldt,
490 TP_PROTO(const void *addr, unsigned entries),
491 TP_ARGS(addr, entries),
492 TP_STRUCT__entry(
493 __field(const void *, addr)
494 __field(unsigned, entries)
495 ),
496 TP_fast_assign(__entry->addr = addr;
497 __entry->entries = entries),
498 TP_printk("addr %p entries %u",
499 __entry->addr, __entry->entries)
500 );
501
502
503#endif /* _TRACE_XEN_H */
504
505/* This part must be outside protection */
506#include <trace/define_trace.h>
diff --git a/include/video/omapdss.h b/include/video/omapdss.h
index 892b97f8e157..3b55ef22f8db 100644
--- a/include/video/omapdss.h
+++ b/include/video/omapdss.h
@@ -21,8 +21,6 @@
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/platform_device.h>
25#include <asm/atomic.h>
26 24
27#define DISPC_IRQ_FRAMEDONE (1 << 0) 25#define DISPC_IRQ_FRAMEDONE (1 << 0)
28#define DISPC_IRQ_VSYNC (1 << 1) 26#define DISPC_IRQ_VSYNC (1 << 1)
@@ -136,12 +134,6 @@ enum omap_display_caps {
136 OMAP_DSS_DISPLAY_CAP_TEAR_ELIM = 1 << 1, 134 OMAP_DSS_DISPLAY_CAP_TEAR_ELIM = 1 << 1,
137}; 135};
138 136
139enum omap_dss_update_mode {
140 OMAP_DSS_UPDATE_DISABLED = 0,
141 OMAP_DSS_UPDATE_AUTO,
142 OMAP_DSS_UPDATE_MANUAL,
143};
144
145enum omap_dss_display_state { 137enum omap_dss_display_state {
146 OMAP_DSS_DISPLAY_DISABLED = 0, 138 OMAP_DSS_DISPLAY_DISABLED = 0,
147 OMAP_DSS_DISPLAY_ACTIVE, 139 OMAP_DSS_DISPLAY_ACTIVE,
@@ -246,7 +238,7 @@ int dsi_vc_send_bta_sync(struct omap_dss_device *dssdev, int channel);
246 238
247/* Board specific data */ 239/* Board specific data */
248struct omap_dss_board_info { 240struct omap_dss_board_info {
249 int (*get_last_off_on_transaction_id)(struct device *dev); 241 int (*get_context_loss_count)(struct device *dev);
250 int num_devices; 242 int num_devices;
251 struct omap_dss_device **devices; 243 struct omap_dss_device **devices;
252 struct omap_dss_device *default_device; 244 struct omap_dss_device *default_device;
@@ -266,8 +258,6 @@ static inline int omap_display_init(struct omap_dss_board_info *board_data)
266struct omap_display_platform_data { 258struct omap_display_platform_data {
267 struct omap_dss_board_info *board_data; 259 struct omap_dss_board_info *board_data;
268 /* TODO: Additional members to be added when PM is considered */ 260 /* TODO: Additional members to be added when PM is considered */
269
270 bool (*opt_clock_available)(const char *clk_role);
271}; 261};
272 262
273struct omap_video_timings { 263struct omap_video_timings {
@@ -300,6 +290,12 @@ extern const struct omap_video_timings omap_dss_pal_timings;
300extern const struct omap_video_timings omap_dss_ntsc_timings; 290extern const struct omap_video_timings omap_dss_ntsc_timings;
301#endif 291#endif
302 292
293struct omap_dss_cpr_coefs {
294 s16 rr, rg, rb;
295 s16 gr, gg, gb;
296 s16 br, bg, bb;
297};
298
303struct omap_overlay_info { 299struct omap_overlay_info {
304 bool enabled; 300 bool enabled;
305 301
@@ -359,6 +355,9 @@ struct omap_overlay_manager_info {
359 bool trans_enabled; 355 bool trans_enabled;
360 356
361 bool alpha_enabled; 357 bool alpha_enabled;
358
359 bool cpr_enable;
360 struct omap_dss_cpr_coefs cpr_coefs;
362}; 361};
363 362
364struct omap_overlay_manager { 363struct omap_overlay_manager {
@@ -526,11 +525,6 @@ struct omap_dss_driver {
526 int (*resume)(struct omap_dss_device *display); 525 int (*resume)(struct omap_dss_device *display);
527 int (*run_test)(struct omap_dss_device *display, int test); 526 int (*run_test)(struct omap_dss_device *display, int test);
528 527
529 int (*set_update_mode)(struct omap_dss_device *dssdev,
530 enum omap_dss_update_mode);
531 enum omap_dss_update_mode (*get_update_mode)(
532 struct omap_dss_device *dssdev);
533
534 int (*update)(struct omap_dss_device *dssdev, 528 int (*update)(struct omap_dss_device *dssdev,
535 u16 x, u16 y, u16 w, u16 h); 529 u16 x, u16 y, u16 w, u16 h);
536 int (*sync)(struct omap_dss_device *dssdev); 530 int (*sync)(struct omap_dss_device *dssdev);
diff --git a/include/xen/balloon.h b/include/xen/balloon.h
index a2b22f01a51d..76f7538bb339 100644
--- a/include/xen/balloon.h
+++ b/include/xen/balloon.h
@@ -15,6 +15,10 @@ struct balloon_stats {
15 unsigned long max_schedule_delay; 15 unsigned long max_schedule_delay;
16 unsigned long retry_count; 16 unsigned long retry_count;
17 unsigned long max_retry_count; 17 unsigned long max_retry_count;
18#ifdef CONFIG_XEN_BALLOON_MEMORY_HOTPLUG
19 unsigned long hotplug_pages;
20 unsigned long balloon_hotplug;
21#endif
18}; 22};
19 23
20extern struct balloon_stats balloon_stats; 24extern struct balloon_stats balloon_stats;
@@ -23,3 +27,13 @@ void balloon_set_new_target(unsigned long target);
23 27
24int alloc_xenballooned_pages(int nr_pages, struct page** pages); 28int alloc_xenballooned_pages(int nr_pages, struct page** pages);
25void free_xenballooned_pages(int nr_pages, struct page** pages); 29void free_xenballooned_pages(int nr_pages, struct page** pages);
30
31struct sys_device;
32#ifdef CONFIG_XEN_SELFBALLOONING
33extern int register_xen_selfballooning(struct sys_device *sysdev);
34#else
35static inline int register_xen_selfballooning(struct sys_device *sysdev)
36{
37 return -ENOSYS;
38}
39#endif
diff --git a/include/xen/events.h b/include/xen/events.h
index 9af21e19545a..d287997d3eab 100644
--- a/include/xen/events.h
+++ b/include/xen/events.h
@@ -74,8 +74,6 @@ int xen_set_callback_via(uint64_t via);
74void xen_evtchn_do_upcall(struct pt_regs *regs); 74void xen_evtchn_do_upcall(struct pt_regs *regs);
75void xen_hvm_evtchn_do_upcall(void); 75void xen_hvm_evtchn_do_upcall(void);
76 76
77/* Allocate a pirq for a physical interrupt, given a gsi. */
78int xen_allocate_pirq_gsi(unsigned gsi);
79/* Bind a pirq for a physical interrupt to an irq. */ 77/* Bind a pirq for a physical interrupt to an irq. */
80int xen_bind_pirq_gsi_to_irq(unsigned gsi, 78int xen_bind_pirq_gsi_to_irq(unsigned gsi,
81 unsigned pirq, int shareable, char *name); 79 unsigned pirq, int shareable, char *name);
diff --git a/include/xen/hvc-console.h b/include/xen/hvc-console.h
index c3adde32669b..901724dc528d 100644
--- a/include/xen/hvc-console.h
+++ b/include/xen/hvc-console.h
@@ -6,11 +6,13 @@ extern struct console xenboot_console;
6#ifdef CONFIG_HVC_XEN 6#ifdef CONFIG_HVC_XEN
7void xen_console_resume(void); 7void xen_console_resume(void);
8void xen_raw_console_write(const char *str); 8void xen_raw_console_write(const char *str);
9__attribute__((format(printf, 1, 2)))
9void xen_raw_printk(const char *fmt, ...); 10void xen_raw_printk(const char *fmt, ...);
10#else 11#else
11static inline void xen_console_resume(void) { } 12static inline void xen_console_resume(void) { }
12static inline void xen_raw_console_write(const char *str) { } 13static inline void xen_raw_console_write(const char *str) { }
13static inline void xen_raw_printk(const char *fmt, ...) { } 14static inline __attribute__((format(printf, 1, 2)))
15void xen_raw_printk(const char *fmt, ...) { }
14#endif 16#endif
15 17
16#endif /* XEN_HVC_CONSOLE_H */ 18#endif /* XEN_HVC_CONSOLE_H */
diff --git a/include/xen/interface/xen.h b/include/xen/interface/xen.h
index 70213b4515eb..6acd9cefd517 100644
--- a/include/xen/interface/xen.h
+++ b/include/xen/interface/xen.h
@@ -450,6 +450,45 @@ struct start_info {
450 int8_t cmd_line[MAX_GUEST_CMDLINE]; 450 int8_t cmd_line[MAX_GUEST_CMDLINE];
451}; 451};
452 452
453struct dom0_vga_console_info {
454 uint8_t video_type;
455#define XEN_VGATYPE_TEXT_MODE_3 0x03
456#define XEN_VGATYPE_VESA_LFB 0x23
457
458 union {
459 struct {
460 /* Font height, in pixels. */
461 uint16_t font_height;
462 /* Cursor location (column, row). */
463 uint16_t cursor_x, cursor_y;
464 /* Number of rows and columns (dimensions in characters). */
465 uint16_t rows, columns;
466 } text_mode_3;
467
468 struct {
469 /* Width and height, in pixels. */
470 uint16_t width, height;
471 /* Bytes per scan line. */
472 uint16_t bytes_per_line;
473 /* Bits per pixel. */
474 uint16_t bits_per_pixel;
475 /* LFB physical address, and size (in units of 64kB). */
476 uint32_t lfb_base;
477 uint32_t lfb_size;
478 /* RGB mask offsets and sizes, as defined by VBE 1.2+ */
479 uint8_t red_pos, red_size;
480 uint8_t green_pos, green_size;
481 uint8_t blue_pos, blue_size;
482 uint8_t rsvd_pos, rsvd_size;
483
484 /* VESA capabilities (offset 0xa, VESA command 0x4f00). */
485 uint32_t gbl_caps;
486 /* Mode attributes (offset 0x0, VESA command 0x4f01). */
487 uint16_t mode_attrs;
488 } vesa_lfb;
489 } u;
490};
491
453/* These flags are passed in the 'flags' field of start_info_t. */ 492/* These flags are passed in the 'flags' field of start_info_t. */
454#define SIF_PRIVILEGED (1<<0) /* Is the domain privileged? */ 493#define SIF_PRIVILEGED (1<<0) /* Is the domain privileged? */
455#define SIF_INITDOMAIN (1<<1) /* Is this the initial control domain? */ 494#define SIF_INITDOMAIN (1<<1) /* Is this the initial control domain? */
diff --git a/include/xen/tmem.h b/include/xen/tmem.h
new file mode 100644
index 000000000000..82e2c83a32f5
--- /dev/null
+++ b/include/xen/tmem.h
@@ -0,0 +1,5 @@
1#ifndef _XEN_TMEM_H
2#define _XEN_TMEM_H
3/* defined in drivers/xen/tmem.c */
4extern int tmem_enabled;
5#endif /* _XEN_TMEM_H */
diff --git a/include/xen/xenbus.h b/include/xen/xenbus.h
index 5467369e0889..aceeca799fd7 100644
--- a/include/xen/xenbus.h
+++ b/include/xen/xenbus.h
@@ -223,7 +223,9 @@ int xenbus_free_evtchn(struct xenbus_device *dev, int port);
223 223
224enum xenbus_state xenbus_read_driver_state(const char *path); 224enum xenbus_state xenbus_read_driver_state(const char *path);
225 225
226__attribute__((format(printf, 3, 4)))
226void xenbus_dev_error(struct xenbus_device *dev, int err, const char *fmt, ...); 227void xenbus_dev_error(struct xenbus_device *dev, int err, const char *fmt, ...);
228__attribute__((format(printf, 3, 4)))
227void xenbus_dev_fatal(struct xenbus_device *dev, int err, const char *fmt, ...); 229void xenbus_dev_fatal(struct xenbus_device *dev, int err, const char *fmt, ...);
228 230
229const char *xenbus_strstate(enum xenbus_state state); 231const char *xenbus_strstate(enum xenbus_state state);