aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/acpi/acpi_drivers.h2
-rw-r--r--include/acpi/acpixf.h3
-rw-r--r--include/acpi/apei.h5
-rw-r--r--include/acpi/processor.h2
-rw-r--r--include/asm-generic/cputime.h4
-rw-r--r--include/asm-generic/fcntl.h5
-rw-r--r--include/asm-generic/memory_model.h4
-rw-r--r--include/asm-generic/unistd.h2
-rw-r--r--include/asm-generic/vmlinux.lds.h1
-rw-r--r--include/drm/drm_crtc.h3
-rw-r--r--include/drm/i915_drm.h2
-rw-r--r--include/linux/acpi.h3
-rw-r--r--include/linux/aer.h3
-rw-r--r--include/linux/alarmtimer.h51
-rw-r--r--include/linux/amba/pl08x.h9
-rw-r--r--include/linux/atalk.h3
-rw-r--r--include/linux/ax25.h2
-rw-r--r--include/linux/basic_mmio_gpio.h15
-rw-r--r--include/linux/bitmap.h1
-rw-r--r--include/linux/blk_types.h13
-rw-r--r--include/linux/blkdev.h6
-rw-r--r--include/linux/blktrace_api.h5
-rw-r--r--include/linux/bsg-lib.h73
-rw-r--r--include/linux/caif/caif_socket.h7
-rw-r--r--include/linux/can.h4
-rw-r--r--include/linux/can/Kbuild1
-rw-r--r--include/linux/can/bcm.h3
-rw-r--r--include/linux/can/core.h2
-rw-r--r--include/linux/can/dev.h1
-rw-r--r--include/linux/can/error.h2
-rw-r--r--include/linux/can/gw.h162
-rw-r--r--include/linux/can/netlink.h2
-rw-r--r--include/linux/can/raw.h2
-rw-r--r--include/linux/capability.h3
-rw-r--r--include/linux/ceph/messenger.h1
-rw-r--r--include/linux/clockchips.h12
-rw-r--r--include/linux/cn_proc.h11
-rw-r--r--include/linux/compat.h1
-rw-r--r--include/linux/connector.h2
-rw-r--r--include/linux/cpuidle.h4
-rw-r--r--include/linux/cred.h15
-rw-r--r--include/linux/cryptohash.h7
-rw-r--r--include/linux/dcache.h30
-rw-r--r--include/linux/devfreq.h238
-rw-r--r--include/linux/device-mapper.h48
-rw-r--r--include/linux/device.h12
-rw-r--r--include/linux/dm-ioctl.h4
-rw-r--r--include/linux/dm-kcopyd.h15
-rw-r--r--include/linux/dma_remapping.h10
-rw-r--r--include/linux/dmar.h43
-rw-r--r--include/linux/drbd_tag_magic.h2
-rw-r--r--include/linux/dvb/audio.h2
-rw-r--r--include/linux/dw_apb_timer.h2
-rw-r--r--include/linux/dynamic_debug.h76
-rw-r--r--include/linux/efi.h6
-rw-r--r--include/linux/ethtool.h180
-rw-r--r--include/linux/evm.h100
-rw-r--r--include/linux/fault-inject.h18
-rw-r--r--include/linux/filter.h2
-rw-r--r--include/linux/freezer.h4
-rw-r--r--include/linux/fs.h83
-rw-r--r--include/linux/fuse.h9
-rw-r--r--include/linux/genalloc.h34
-rw-r--r--include/linux/gfp.h2
-rw-r--r--include/linux/hash.h2
-rw-r--r--include/linux/hid.h3
-rw-r--r--include/linux/hyperv.h873
-rw-r--r--include/linux/idr.h4
-rw-r--r--include/linux/ieee80211.h85
-rw-r--r--include/linux/if.h1
-rw-r--r--include/linux/if_ether.h2
-rw-r--r--include/linux/if_link.h10
-rw-r--r--include/linux/if_macvlan.h1
-rw-r--r--include/linux/if_packet.h119
-rw-r--r--include/linux/if_pppol2tp.h2
-rw-r--r--include/linux/if_pppox.h9
-rw-r--r--include/linux/if_vlan.h6
-rw-r--r--include/linux/ima.h13
-rw-r--r--include/linux/in.h2
-rw-r--r--include/linux/inet_diag.h3
-rw-r--r--include/linux/init_task.h2
-rw-r--r--include/linux/input.h2
-rw-r--r--include/linux/integrity.h39
-rw-r--r--include/linux/intel-iommu.h10
-rw-r--r--include/linux/interrupt.h41
-rw-r--r--include/linux/io-mapping.h2
-rw-r--r--include/linux/ioport.h1
-rw-r--r--include/linux/ip6_tunnel.h2
-rw-r--r--include/linux/ipx.h2
-rw-r--r--include/linux/irda.h9
-rw-r--r--include/linux/irq.h35
-rw-r--r--include/linux/irq_work.h15
-rw-r--r--include/linux/irqdesc.h2
-rw-r--r--include/linux/irqdomain.h92
-rw-r--r--include/linux/isdn.h2
-rw-r--r--include/linux/jbd2.h6
-rw-r--r--include/linux/jiffies.h2
-rw-r--r--include/linux/kconfig.h32
-rw-r--r--include/linux/kernel.h2
-rw-r--r--include/linux/kprobes.h2
-rw-r--r--include/linux/kvm.h1
-rw-r--r--include/linux/l2tp.h7
-rw-r--r--include/linux/lapb.h3
-rw-r--r--include/linux/llc.h10
-rw-r--r--include/linux/llist.h187
-rw-r--r--include/linux/lockdep.h2
-rw-r--r--include/linux/loop.h5
-rw-r--r--include/linux/memcontrol.h27
-rw-r--r--include/linux/mfd/aat2870.h181
-rw-r--r--include/linux/mfd/ab8500.h8
-rw-r--r--include/linux/mfd/max8997.h7
-rw-r--r--include/linux/mfd/max8998.h12
-rw-r--r--include/linux/mfd/stmpe.h3
-rw-r--r--include/linux/mfd/tps65910.h1
-rw-r--r--include/linux/mfd/tps65912.h327
-rw-r--r--include/linux/mfd/wm831x/core.h131
-rw-r--r--include/linux/mfd/wm831x/pdata.h6
-rw-r--r--include/linux/mfd/wm8400-private.h7
-rw-r--r--include/linux/mfd/wm8994/core.h9
-rw-r--r--include/linux/mfd/wm8994/pdata.h2
-rw-r--r--include/linux/mii.h210
-rw-r--r--include/linux/miscdevice.h1
-rw-r--r--include/linux/mlx4/device.h1
-rw-r--r--include/linux/mm.h19
-rw-r--r--include/linux/mm_types.h108
-rw-r--r--include/linux/mmc/host.h2
-rw-r--r--include/linux/mod_devicetable.h9
-rw-r--r--include/linux/module.h12
-rw-r--r--include/linux/moduleparam.h20
-rw-r--r--include/linux/namei.h3
-rw-r--r--include/linux/net_tstamp.h13
-rw-r--r--include/linux/netdevice.h30
-rw-r--r--include/linux/netfilter/xt_connlimit.h1
-rw-r--r--include/linux/netfilter/xt_conntrack.h1
-rw-r--r--include/linux/netfilter/xt_iprange.h1
-rw-r--r--include/linux/netfilter_arp/arp_tables.h14
-rw-r--r--include/linux/netfilter_decnet.h3
-rw-r--r--include/linux/netfilter_ipv4.h3
-rw-r--r--include/linux/netfilter_ipv4/ip_tables.h20
-rw-r--r--include/linux/netfilter_ipv6.h3
-rw-r--r--include/linux/netfilter_ipv6/ip6_tables.h22
-rw-r--r--include/linux/netlink.h4
-rw-r--r--include/linux/netrom.h2
-rw-r--r--include/linux/nfs.h2
-rw-r--r--include/linux/nfs4.h22
-rw-r--r--include/linux/nfs_fs.h8
-rw-r--r--include/linux/nfs_fs_sb.h4
-rw-r--r--include/linux/nfs_page.h1
-rw-r--r--include/linux/nfs_xdr.h32
-rw-r--r--include/linux/nfsd/Kbuild2
-rw-r--r--include/linux/nfsd/const.h55
-rw-r--r--include/linux/nfsd/export.h2
-rw-r--r--include/linux/nfsd/nfsfh.h7
-rw-r--r--include/linux/nfsd/syscall.h116
-rw-r--r--include/linux/nl80211.h59
-rw-r--r--include/linux/of.h22
-rw-r--r--include/linux/of_gpio.h9
-rw-r--r--include/linux/of_irq.h4
-rw-r--r--include/linux/of_net.h1
-rw-r--r--include/linux/opp.h12
-rw-r--r--include/linux/oprofile.h2
-rw-r--r--include/linux/page-flags.h5
-rw-r--r--include/linux/pci.h25
-rw-r--r--include/linux/pci_ids.h10
-rw-r--r--include/linux/percpu_counter.h2
-rw-r--r--include/linux/perf_event.h29
-rw-r--r--include/linux/personality.h1
-rw-r--r--include/linux/phonet.h5
-rw-r--r--include/linux/phy.h6
-rw-r--r--include/linux/pinctrl/machine.h107
-rw-r--r--include/linux/pinctrl/pinctrl.h133
-rw-r--r--include/linux/pinctrl/pinmux.h117
-rw-r--r--include/linux/platform_data/dwc3-omap.h47
-rw-r--r--include/linux/platform_data/exynos4_tmu.h83
-rw-r--r--include/linux/platform_data/mv_usb.h50
-rw-r--r--include/linux/platform_data/ntc_thermistor.h53
-rw-r--r--include/linux/platform_device.h48
-rw-r--r--include/linux/pm.h26
-rw-r--r--include/linux/pm_clock.h71
-rw-r--r--include/linux/pm_domain.h36
-rw-r--r--include/linux/pm_qos.h155
-rw-r--r--include/linux/pm_qos_params.h38
-rw-r--r--include/linux/pm_runtime.h42
-rw-r--r--include/linux/posix-timers.h5
-rw-r--r--include/linux/posix_acl.h82
-rw-r--r--include/linux/power/bq20z75.h3
-rw-r--r--include/linux/power/max17042_battery.h91
-rw-r--r--include/linux/proportions.h6
-rw-r--r--include/linux/pstore.h9
-rw-r--r--include/linux/ptp_classify.h13
-rw-r--r--include/linux/pwm_backlight.h1
-rw-r--r--include/linux/radix-tree.h37
-rw-r--r--include/linux/random.h12
-rw-r--r--include/linux/ratelimit.h6
-rw-r--r--include/linux/rcupdate.h300
-rw-r--r--include/linux/rcutiny.h20
-rw-r--r--include/linux/rcutree.h2
-rw-r--r--include/linux/regmap.h79
-rw-r--r--include/linux/regulator/consumer.h3
-rw-r--r--include/linux/regulator/driver.h4
-rw-r--r--include/linux/rfkill-gpio.h4
-rw-r--r--include/linux/ring_buffer.h2
-rw-r--r--include/linux/rio_regs.h18
-rw-r--r--include/linux/rose.h7
-rw-r--r--include/linux/rtc.h3
-rw-r--r--include/linux/rwsem-spinlock.h2
-rw-r--r--include/linux/rwsem.h10
-rw-r--r--include/linux/sched.h20
-rw-r--r--include/linux/security.h32
-rw-r--r--include/linux/semaphore.h4
-rw-r--r--include/linux/serial.h1
-rw-r--r--include/linux/serial_8250.h2
-rw-r--r--include/linux/serial_core.h10
-rw-r--r--include/linux/serial_reg.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/sh_eth.h25
-rw-r--r--include/linux/shm.h3
-rw-r--r--include/linux/shmem_fs.h17
-rw-r--r--include/linux/skbuff.h263
-rw-r--r--include/linux/slub_def.h7
-rw-r--r--include/linux/snmp.h2
-rw-r--r--include/linux/socket.h6
-rw-r--r--include/linux/sungem_phy.h132
-rw-r--r--include/linux/sunrpc/clnt.h11
-rw-r--r--include/linux/sunrpc/rpc_pipe_fs.h2
-rw-r--r--include/linux/sunrpc/svc.h32
-rw-r--r--include/linux/suspend.h95
-rw-r--r--include/linux/swap.h6
-rw-r--r--include/linux/swapops.h23
-rw-r--r--include/linux/syscalls.h3
-rw-r--r--include/linux/sysctl.h2
-rw-r--r--include/linux/sysfs.h1
-rw-r--r--include/linux/tcp.h7
-rw-r--r--include/linux/thermal.h22
-rw-r--r--include/linux/ti_wilink_st.h27
-rw-r--r--include/linux/tipc_config.h4
-rw-r--r--include/linux/trace_clock.h1
-rw-r--r--include/linux/tracepoint.h25
-rw-r--r--include/linux/tty.h28
-rw-r--r--include/linux/tty_driver.h3
-rw-r--r--include/linux/types.h10
-rw-r--r--include/linux/uio_driver.h7
-rw-r--r--include/linux/un.h4
-rw-r--r--include/linux/usb.h20
-rw-r--r--include/linux/usb/ch9.h29
-rw-r--r--include/linux/usb/gadget.h4
-rw-r--r--include/linux/usb/hcd.h3
-rw-r--r--include/linux/usb/r8a66597.h60
-rw-r--r--include/linux/usb/renesas_usbhs.h14
-rw-r--r--include/linux/videodev2.h254
-rw-r--r--include/linux/virtio.h5
-rw-r--r--include/linux/watchdog.h78
-rw-r--r--include/linux/writeback.h11
-rw-r--r--include/linux/x25.h3
-rw-r--r--include/linux/xattr.h19
-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/mmp-camera.h9
-rw-r--r--include/media/ov7670.h20
-rw-r--r--include/media/pwc-ioctl.h1
-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-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.h24
-rw-r--r--include/media/videobuf-dma-sg.h2
-rw-r--r--include/net/9p/9p.h43
-rw-r--r--include/net/9p/client.h8
-rw-r--r--include/net/9p/transport.h10
-rw-r--r--include/net/addrconf.h2
-rw-r--r--include/net/bluetooth/l2cap.h7
-rw-r--r--include/net/caif/caif_hsi.h37
-rw-r--r--include/net/cfg80211.h45
-rw-r--r--include/net/cipso_ipv4.h2
-rw-r--r--include/net/dcbevent.h18
-rw-r--r--include/net/dcbnl.h3
-rw-r--r--include/net/dst.h26
-rw-r--r--include/net/flow.h25
-rw-r--r--include/net/ieee80211_radiotap.h1
-rw-r--r--include/net/if_inet6.h1
-rw-r--r--include/net/inet_ecn.h8
-rw-r--r--include/net/inet_sock.h2
-rw-r--r--include/net/inet_timewait_sock.h4
-rw-r--r--include/net/ip.h12
-rw-r--r--include/net/ip_vs.h1
-rw-r--r--include/net/ipv6.h3
-rw-r--r--include/net/iucv/af_iucv.h52
-rw-r--r--include/net/iucv/iucv.h36
-rw-r--r--include/net/lapb.h2
-rw-r--r--include/net/mac80211.h258
-rw-r--r--include/net/netlabel.h2
-rw-r--r--include/net/nfc/nci_core.h1
-rw-r--r--include/net/request_sock.h3
-rw-r--r--include/net/sch_generic.h24
-rw-r--r--include/net/scm.h5
-rw-r--r--include/net/sctp/command.h1
-rw-r--r--include/net/sctp/structs.h1
-rw-r--r--include/net/secure_seq.h20
-rw-r--r--include/net/sock.h15
-rw-r--r--include/net/tcp.h93
-rw-r--r--include/net/transp_v6.h1
-rw-r--r--include/net/udplite.h63
-rw-r--r--include/rdma/ib_addr.h6
-rw-r--r--include/scsi/fc_frame.h1
-rw-r--r--include/scsi/osd_ore.h199
-rw-r--r--include/sound/pcm.h4
-rw-r--r--include/sound/tea575x-tuner.h8
-rw-r--r--include/sound/tlv320aic3x.h2
-rw-r--r--include/sound/wm8996.h (renamed from include/sound/wm8915.h)28
-rw-r--r--include/target/configfs_macros.h4
-rw-r--r--include/target/target_core_base.h71
-rw-r--r--include/target/target_core_fabric_ops.h6
-rw-r--r--include/target/target_core_tmr.h2
-rw-r--r--include/target/target_core_transport.h75
-rw-r--r--include/trace/events/9p.h176
-rw-r--r--include/trace/events/block.h20
-rw-r--r--include/trace/events/ext4.h87
-rw-r--r--include/trace/events/jbd2.h36
-rw-r--r--include/trace/events/rcu.h459
-rw-r--r--include/trace/events/regmap.h136
-rw-r--r--include/trace/events/rpm.h99
-rw-r--r--include/trace/events/sched.h9
-rw-r--r--include/trace/events/writeback.h10
-rw-r--r--include/trace/events/xen.h2
-rw-r--r--include/trace/ftrace.h3
-rw-r--r--include/video/omapdss.h26
-rw-r--r--include/xen/balloon.h5
-rw-r--r--include/xen/grant_table.h1
-rw-r--r--include/xen/interface/io/xs_wire.h6
-rw-r--r--include/xen/interface/physdev.h34
-rw-r--r--include/xen/page.h12
347 files changed, 9919 insertions, 1779 deletions
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/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/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/asm-generic/cputime.h b/include/asm-generic/cputime.h
index 61e03dd7939e..62ce6823c0f2 100644
--- a/include/asm-generic/cputime.h
+++ b/include/asm-generic/cputime.h
@@ -38,8 +38,8 @@ typedef u64 cputime64_t;
38/* 38/*
39 * Convert cputime to microseconds and back. 39 * Convert cputime to microseconds and back.
40 */ 40 */
41#define cputime_to_usecs(__ct) jiffies_to_usecs(__ct); 41#define cputime_to_usecs(__ct) jiffies_to_usecs(__ct)
42#define usecs_to_cputime(__msecs) usecs_to_jiffies(__msecs); 42#define usecs_to_cputime(__msecs) usecs_to_jiffies(__msecs)
43 43
44/* 44/*
45 * Convert cputime to seconds and back. 45 * Convert cputime to seconds and back.
diff --git a/include/asm-generic/fcntl.h b/include/asm-generic/fcntl.h
index 84793c7025e2..9e5b0356e2bb 100644
--- a/include/asm-generic/fcntl.h
+++ b/include/asm-generic/fcntl.h
@@ -145,11 +145,6 @@ struct f_owner_ex {
145#define F_SHLCK 8 /* or 4 */ 145#define F_SHLCK 8 /* or 4 */
146#endif 146#endif
147 147
148/* for leases */
149#ifndef F_INPROGRESS
150#define F_INPROGRESS 16
151#endif
152
153/* operations for bsd flock(), also used by the kernel implementation */ 148/* operations for bsd flock(), also used by the kernel implementation */
154#define LOCK_SH 1 /* shared lock */ 149#define LOCK_SH 1 /* shared lock */
155#define LOCK_EX 2 /* exclusive lock */ 150#define LOCK_EX 2 /* exclusive lock */
diff --git a/include/asm-generic/memory_model.h b/include/asm-generic/memory_model.h
index fb2d63f13f4c..aea9e45efce6 100644
--- a/include/asm-generic/memory_model.h
+++ b/include/asm-generic/memory_model.h
@@ -39,7 +39,7 @@
39}) 39})
40 40
41#define __page_to_pfn(pg) \ 41#define __page_to_pfn(pg) \
42({ struct page *__pg = (pg); \ 42({ const struct page *__pg = (pg); \
43 struct pglist_data *__pgdat = NODE_DATA(page_to_nid(__pg)); \ 43 struct pglist_data *__pgdat = NODE_DATA(page_to_nid(__pg)); \
44 (unsigned long)(__pg - __pgdat->node_mem_map) + \ 44 (unsigned long)(__pg - __pgdat->node_mem_map) + \
45 __pgdat->node_start_pfn; \ 45 __pgdat->node_start_pfn; \
@@ -57,7 +57,7 @@
57 * section[i].section_mem_map == mem_map's address - start_pfn; 57 * section[i].section_mem_map == mem_map's address - start_pfn;
58 */ 58 */
59#define __page_to_pfn(pg) \ 59#define __page_to_pfn(pg) \
60({ struct page *__pg = (pg); \ 60({ const struct page *__pg = (pg); \
61 int __sec = page_to_section(__pg); \ 61 int __sec = page_to_section(__pg); \
62 (unsigned long)(__pg - __section_mem_map_addr(__nr_to_section(__sec))); \ 62 (unsigned long)(__pg - __section_mem_map_addr(__nr_to_section(__sec))); \
63}) 63})
diff --git a/include/asm-generic/unistd.h b/include/asm-generic/unistd.h
index 4f76959397fa..f4c38d8c6674 100644
--- a/include/asm-generic/unistd.h
+++ b/include/asm-generic/unistd.h
@@ -143,7 +143,7 @@ __SYSCALL(__NR_pivot_root, sys_pivot_root)
143 143
144/* fs/nfsctl.c */ 144/* fs/nfsctl.c */
145#define __NR_nfsservctl 42 145#define __NR_nfsservctl 42
146__SC_COMP(__NR_nfsservctl, sys_nfsservctl, compat_sys_nfsservctl) 146__SYSCALL(__NR_nfsservctl, sys_ni_syscall)
147 147
148/* fs/open.c */ 148/* fs/open.c */
149#define __NR3264_statfs 43 149#define __NR3264_statfs 43
diff --git a/include/asm-generic/vmlinux.lds.h b/include/asm-generic/vmlinux.lds.h
index db22d136ad08..b5e2e4c6b017 100644
--- a/include/asm-generic/vmlinux.lds.h
+++ b/include/asm-generic/vmlinux.lds.h
@@ -222,7 +222,6 @@
222 VMLINUX_SYMBOL(__start___tracepoints_ptrs) = .; \ 222 VMLINUX_SYMBOL(__start___tracepoints_ptrs) = .; \
223 *(__tracepoints_ptrs) /* Tracepoints: pointer array */\ 223 *(__tracepoints_ptrs) /* Tracepoints: pointer array */\
224 VMLINUX_SYMBOL(__stop___tracepoints_ptrs) = .; \ 224 VMLINUX_SYMBOL(__stop___tracepoints_ptrs) = .; \
225 *(__markers_strings) /* Markers: strings */ \
226 *(__tracepoints_strings)/* Tracepoints: strings */ \ 225 *(__tracepoints_strings)/* Tracepoints: strings */ \
227 } \ 226 } \
228 \ 227 \
diff --git a/include/drm/drm_crtc.h b/include/drm/drm_crtc.h
index 33d12f87f0e0..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
@@ -802,6 +804,7 @@ extern struct drm_display_mode *drm_gtf_mode_complex(struct drm_device *dev,
802extern int drm_add_modes_noedid(struct drm_connector *connector, 804extern int drm_add_modes_noedid(struct drm_connector *connector,
803 int hdisplay, int vdisplay); 805 int hdisplay, int vdisplay);
804 806
807extern int drm_edid_header_is_valid(const u8 *raw_edid);
805extern bool drm_edid_is_valid(struct edid *edid); 808extern bool drm_edid_is_valid(struct edid *edid);
806struct drm_display_mode *drm_mode_find_dmt(struct drm_device *dev, 809struct drm_display_mode *drm_mode_find_dmt(struct drm_device *dev,
807 int hsize, int vsize, int fresh); 810 int hsize, int vsize, int fresh);
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/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/alarmtimer.h b/include/linux/alarmtimer.h
index c5d6095b46f8..975009e1cbe6 100644
--- a/include/linux/alarmtimer.h
+++ b/include/linux/alarmtimer.h
@@ -13,6 +13,16 @@ enum alarmtimer_type {
13 ALARM_NUMTYPE, 13 ALARM_NUMTYPE,
14}; 14};
15 15
16enum alarmtimer_restart {
17 ALARMTIMER_NORESTART,
18 ALARMTIMER_RESTART,
19};
20
21
22#define ALARMTIMER_STATE_INACTIVE 0x00
23#define ALARMTIMER_STATE_ENQUEUED 0x01
24#define ALARMTIMER_STATE_CALLBACK 0x02
25
16/** 26/**
17 * struct alarm - Alarm timer structure 27 * struct alarm - Alarm timer structure
18 * @node: timerqueue node for adding to the event list this value 28 * @node: timerqueue node for adding to the event list this value
@@ -25,16 +35,45 @@ enum alarmtimer_type {
25 */ 35 */
26struct alarm { 36struct alarm {
27 struct timerqueue_node node; 37 struct timerqueue_node node;
28 ktime_t period; 38 enum alarmtimer_restart (*function)(struct alarm *, ktime_t now);
29 void (*function)(struct alarm *);
30 enum alarmtimer_type type; 39 enum alarmtimer_type type;
31 bool enabled; 40 int state;
32 void *data; 41 void *data;
33}; 42};
34 43
35void alarm_init(struct alarm *alarm, enum alarmtimer_type type, 44void alarm_init(struct alarm *alarm, enum alarmtimer_type type,
36 void (*function)(struct alarm *)); 45 enum alarmtimer_restart (*function)(struct alarm *, ktime_t));
37void alarm_start(struct alarm *alarm, ktime_t start, ktime_t period); 46void alarm_start(struct alarm *alarm, ktime_t start);
38void alarm_cancel(struct alarm *alarm); 47int alarm_try_to_cancel(struct alarm *alarm);
48int alarm_cancel(struct alarm *alarm);
49
50u64 alarm_forward(struct alarm *alarm, ktime_t now, ktime_t interval);
51
52/*
53 * A alarmtimer is active, when it is enqueued into timerqueue or the
54 * callback function is running.
55 */
56static inline int alarmtimer_active(const struct alarm *timer)
57{
58 return timer->state != ALARMTIMER_STATE_INACTIVE;
59}
60
61/*
62 * Helper function to check, whether the timer is on one of the queues
63 */
64static inline int alarmtimer_is_queued(struct alarm *timer)
65{
66 return timer->state & ALARMTIMER_STATE_ENQUEUED;
67}
68
69/*
70 * Helper function to check, whether the timer is running the callback
71 * function
72 */
73static inline int alarmtimer_callback_running(struct alarm *timer)
74{
75 return timer->state & ALARMTIMER_STATE_CALLBACK;
76}
77
39 78
40#endif 79#endif
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/atalk.h b/include/linux/atalk.h
index d34c187432ed..f57c36881c48 100644
--- a/include/linux/atalk.h
+++ b/include/linux/atalk.h
@@ -3,6 +3,7 @@
3 3
4#include <linux/types.h> 4#include <linux/types.h>
5#include <asm/byteorder.h> 5#include <asm/byteorder.h>
6#include <linux/socket.h>
6 7
7/* 8/*
8 * AppleTalk networking structures 9 * AppleTalk networking structures
@@ -28,7 +29,7 @@ struct atalk_addr {
28}; 29};
29 30
30struct sockaddr_at { 31struct sockaddr_at {
31 sa_family_t sat_family; 32 __kernel_sa_family_t sat_family;
32 __u8 sat_port; 33 __u8 sat_port;
33 struct atalk_addr sat_addr; 34 struct atalk_addr sat_addr;
34 char sat_zero[8]; 35 char sat_zero[8];
diff --git a/include/linux/ax25.h b/include/linux/ax25.h
index 56c11f0dbd80..74c89a41732d 100644
--- a/include/linux/ax25.h
+++ b/include/linux/ax25.h
@@ -47,7 +47,7 @@ typedef struct {
47} ax25_address; 47} ax25_address;
48 48
49struct sockaddr_ax25 { 49struct sockaddr_ax25 {
50 sa_family_t sax25_family; 50 __kernel_sa_family_t sax25_family;
51 ax25_address sax25_call; 51 ax25_address sax25_call;
52 int sax25_ndigis; 52 int sax25_ndigis;
53 /* Digipeater ax25_address sets follow */ 53 /* Digipeater ax25_address sets follow */
diff --git a/include/linux/basic_mmio_gpio.h b/include/linux/basic_mmio_gpio.h
index 98999cf107ce..feb912196745 100644
--- a/include/linux/basic_mmio_gpio.h
+++ b/include/linux/basic_mmio_gpio.h
@@ -63,15 +63,10 @@ static inline struct bgpio_chip *to_bgpio_chip(struct gpio_chip *gc)
63 return container_of(gc, struct bgpio_chip, gc); 63 return container_of(gc, struct bgpio_chip, gc);
64} 64}
65 65
66int __devexit bgpio_remove(struct bgpio_chip *bgc); 66int bgpio_remove(struct bgpio_chip *bgc);
67int __devinit bgpio_init(struct bgpio_chip *bgc, 67int bgpio_init(struct bgpio_chip *bgc, struct device *dev,
68 struct device *dev, 68 unsigned long sz, void __iomem *dat, void __iomem *set,
69 unsigned long sz, 69 void __iomem *clr, void __iomem *dirout, void __iomem *dirin,
70 void __iomem *dat, 70 bool big_endian);
71 void __iomem *set,
72 void __iomem *clr,
73 void __iomem *dirout,
74 void __iomem *dirin,
75 bool big_endian);
76 71
77#endif /* __BASIC_MMIO_GPIO_H */ 72#endif /* __BASIC_MMIO_GPIO_H */
diff --git a/include/linux/bitmap.h b/include/linux/bitmap.h
index 3bac44cce142..7ad634501e48 100644
--- a/include/linux/bitmap.h
+++ b/include/linux/bitmap.h
@@ -146,6 +146,7 @@ extern 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); 147extern int bitmap_ord_to_pos(const unsigned long *bitmap, int n, int bits);
148 148
149#define BITMAP_FIRST_WORD_MASK(start) (~0UL << ((start) % BITS_PER_LONG))
149#define BITMAP_LAST_WORD_MASK(nbits) \ 150#define BITMAP_LAST_WORD_MASK(nbits) \
150( \ 151( \
151 ((nbits) % BITS_PER_LONG) ? \ 152 ((nbits) % BITS_PER_LONG) ? \
diff --git a/include/linux/blk_types.h b/include/linux/blk_types.h
index 6395692b2e7a..71fc53bb8f1c 100644
--- a/include/linux/blk_types.h
+++ b/include/linux/blk_types.h
@@ -124,8 +124,13 @@ enum rq_flag_bits {
124 124
125 __REQ_SYNC, /* request is sync (sync write or read) */ 125 __REQ_SYNC, /* request is sync (sync write or read) */
126 __REQ_META, /* metadata io request */ 126 __REQ_META, /* metadata io request */
127 __REQ_PRIO, /* boost priority in cfq */
127 __REQ_DISCARD, /* request to discard sectors */ 128 __REQ_DISCARD, /* request to discard sectors */
129 __REQ_SECURE, /* secure discard (used with __REQ_DISCARD) */
130
128 __REQ_NOIDLE, /* don't anticipate more IO after this one */ 131 __REQ_NOIDLE, /* don't anticipate more IO after this one */
132 __REQ_FUA, /* forced unit access */
133 __REQ_FLUSH, /* request for cache flush */
129 134
130 /* bio only flags */ 135 /* bio only flags */
131 __REQ_RAHEAD, /* read ahead, can fail anytime */ 136 __REQ_RAHEAD, /* read ahead, can fail anytime */
@@ -135,7 +140,6 @@ enum rq_flag_bits {
135 /* request only flags */ 140 /* request only flags */
136 __REQ_SORTED, /* elevator knows about this request */ 141 __REQ_SORTED, /* elevator knows about this request */
137 __REQ_SOFTBARRIER, /* may not be passed by ioscheduler */ 142 __REQ_SOFTBARRIER, /* may not be passed by ioscheduler */
138 __REQ_FUA, /* forced unit access */
139 __REQ_NOMERGE, /* don't touch this for merging */ 143 __REQ_NOMERGE, /* don't touch this for merging */
140 __REQ_STARTED, /* drive already may have started this one */ 144 __REQ_STARTED, /* drive already may have started this one */
141 __REQ_DONTPREP, /* don't call prep for this one */ 145 __REQ_DONTPREP, /* don't call prep for this one */
@@ -146,11 +150,9 @@ enum rq_flag_bits {
146 __REQ_PREEMPT, /* set for "ide_preempt" requests */ 150 __REQ_PREEMPT, /* set for "ide_preempt" requests */
147 __REQ_ALLOCED, /* request came from our alloc pool */ 151 __REQ_ALLOCED, /* request came from our alloc pool */
148 __REQ_COPY_USER, /* contains copies of user pages */ 152 __REQ_COPY_USER, /* contains copies of user pages */
149 __REQ_FLUSH, /* request for cache flush */
150 __REQ_FLUSH_SEQ, /* request for flush sequence */ 153 __REQ_FLUSH_SEQ, /* request for flush sequence */
151 __REQ_IO_STAT, /* account I/O stat */ 154 __REQ_IO_STAT, /* account I/O stat */
152 __REQ_MIXED_MERGE, /* merge of different types, fail separately */ 155 __REQ_MIXED_MERGE, /* merge of different types, fail separately */
153 __REQ_SECURE, /* secure discard (used with __REQ_DISCARD) */
154 __REQ_NR_BITS, /* stops here */ 156 __REQ_NR_BITS, /* stops here */
155}; 157};
156 158
@@ -160,14 +162,15 @@ enum rq_flag_bits {
160#define REQ_FAILFAST_DRIVER (1 << __REQ_FAILFAST_DRIVER) 162#define REQ_FAILFAST_DRIVER (1 << __REQ_FAILFAST_DRIVER)
161#define REQ_SYNC (1 << __REQ_SYNC) 163#define REQ_SYNC (1 << __REQ_SYNC)
162#define REQ_META (1 << __REQ_META) 164#define REQ_META (1 << __REQ_META)
165#define REQ_PRIO (1 << __REQ_PRIO)
163#define REQ_DISCARD (1 << __REQ_DISCARD) 166#define REQ_DISCARD (1 << __REQ_DISCARD)
164#define REQ_NOIDLE (1 << __REQ_NOIDLE) 167#define REQ_NOIDLE (1 << __REQ_NOIDLE)
165 168
166#define REQ_FAILFAST_MASK \ 169#define REQ_FAILFAST_MASK \
167 (REQ_FAILFAST_DEV | REQ_FAILFAST_TRANSPORT | REQ_FAILFAST_DRIVER) 170 (REQ_FAILFAST_DEV | REQ_FAILFAST_TRANSPORT | REQ_FAILFAST_DRIVER)
168#define REQ_COMMON_MASK \ 171#define REQ_COMMON_MASK \
169 (REQ_WRITE | REQ_FAILFAST_MASK | REQ_SYNC | REQ_META | REQ_DISCARD | \ 172 (REQ_WRITE | REQ_FAILFAST_MASK | REQ_SYNC | REQ_META | REQ_PRIO | \
170 REQ_NOIDLE | REQ_FLUSH | REQ_FUA | REQ_SECURE) 173 REQ_DISCARD | REQ_NOIDLE | REQ_FLUSH | REQ_FUA | REQ_SECURE)
171#define REQ_CLONE_MASK REQ_COMMON_MASK 174#define REQ_CLONE_MASK REQ_COMMON_MASK
172 175
173#define REQ_RAHEAD (1 << __REQ_RAHEAD) 176#define REQ_RAHEAD (1 << __REQ_RAHEAD)
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
index 0e67c45b3bc9..7fbaa9103344 100644
--- a/include/linux/blkdev.h
+++ b/include/linux/blkdev.h
@@ -30,6 +30,7 @@ struct request_pm_state;
30struct blk_trace; 30struct blk_trace;
31struct request; 31struct request;
32struct sg_io_hdr; 32struct sg_io_hdr;
33struct bsg_job;
33 34
34#define BLKDEV_MIN_RQ 4 35#define BLKDEV_MIN_RQ 4
35#define BLKDEV_MAX_RQ 128 /* Default maximum */ 36#define BLKDEV_MAX_RQ 128 /* Default maximum */
@@ -117,6 +118,7 @@ struct request {
117 struct { 118 struct {
118 unsigned int seq; 119 unsigned int seq;
119 struct list_head list; 120 struct list_head list;
121 rq_end_io_fn *saved_end_io;
120 } flush; 122 } flush;
121 }; 123 };
122 124
@@ -209,6 +211,7 @@ typedef int (merge_bvec_fn) (struct request_queue *, struct bvec_merge_data *,
209typedef void (softirq_done_fn)(struct request *); 211typedef void (softirq_done_fn)(struct request *);
210typedef int (dma_drain_needed_fn)(struct request *); 212typedef int (dma_drain_needed_fn)(struct request *);
211typedef int (lld_busy_fn) (struct request_queue *q); 213typedef int (lld_busy_fn) (struct request_queue *q);
214typedef int (bsg_job_fn) (struct bsg_job *);
212 215
213enum blk_eh_timer_return { 216enum blk_eh_timer_return {
214 BLK_EH_NOT_HANDLED, 217 BLK_EH_NOT_HANDLED,
@@ -375,6 +378,8 @@ struct request_queue {
375 struct mutex sysfs_lock; 378 struct mutex sysfs_lock;
376 379
377#if defined(CONFIG_BLK_DEV_BSG) 380#if defined(CONFIG_BLK_DEV_BSG)
381 bsg_job_fn *bsg_job_fn;
382 int bsg_job_size;
378 struct bsg_class_device bsg_dev; 383 struct bsg_class_device bsg_dev;
379#endif 384#endif
380 385
@@ -868,7 +873,6 @@ struct blk_plug {
868 struct list_head list; 873 struct list_head list;
869 struct list_head cb_list; 874 struct list_head cb_list;
870 unsigned int should_sort; 875 unsigned int should_sort;
871 unsigned int count;
872}; 876};
873#define BLK_MAX_REQUEST_COUNT 16 877#define BLK_MAX_REQUEST_COUNT 16
874 878
diff --git a/include/linux/blktrace_api.h b/include/linux/blktrace_api.h
index 8c7c2de7631a..8e9e4bc6d73b 100644
--- a/include/linux/blktrace_api.h
+++ b/include/linux/blktrace_api.h
@@ -14,7 +14,7 @@
14enum blktrace_cat { 14enum blktrace_cat {
15 BLK_TC_READ = 1 << 0, /* reads */ 15 BLK_TC_READ = 1 << 0, /* reads */
16 BLK_TC_WRITE = 1 << 1, /* writes */ 16 BLK_TC_WRITE = 1 << 1, /* writes */
17 BLK_TC_BARRIER = 1 << 2, /* barrier */ 17 BLK_TC_FLUSH = 1 << 2, /* flush */
18 BLK_TC_SYNC = 1 << 3, /* sync IO */ 18 BLK_TC_SYNC = 1 << 3, /* sync IO */
19 BLK_TC_SYNCIO = BLK_TC_SYNC, 19 BLK_TC_SYNCIO = BLK_TC_SYNC,
20 BLK_TC_QUEUE = 1 << 4, /* queueing/merging */ 20 BLK_TC_QUEUE = 1 << 4, /* queueing/merging */
@@ -28,8 +28,9 @@ enum blktrace_cat {
28 BLK_TC_META = 1 << 12, /* metadata */ 28 BLK_TC_META = 1 << 12, /* metadata */
29 BLK_TC_DISCARD = 1 << 13, /* discard requests */ 29 BLK_TC_DISCARD = 1 << 13, /* discard requests */
30 BLK_TC_DRV_DATA = 1 << 14, /* binary per-driver data */ 30 BLK_TC_DRV_DATA = 1 << 14, /* binary per-driver data */
31 BLK_TC_FUA = 1 << 15, /* fua requests */
31 32
32 BLK_TC_END = 1 << 15, /* only 16-bits, reminder */ 33 BLK_TC_END = 1 << 15, /* we've run out of bits! */
33}; 34};
34 35
35#define BLK_TC_SHIFT (16) 36#define BLK_TC_SHIFT (16)
diff --git a/include/linux/bsg-lib.h b/include/linux/bsg-lib.h
new file mode 100644
index 000000000000..f55ab8cdc106
--- /dev/null
+++ b/include/linux/bsg-lib.h
@@ -0,0 +1,73 @@
1/*
2 * BSG helper library
3 *
4 * Copyright (C) 2008 James Smart, Emulex Corporation
5 * Copyright (C) 2011 Red Hat, Inc. All rights reserved.
6 * Copyright (C) 2011 Mike Christie
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 Free Software
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21 *
22 */
23#ifndef _BLK_BSG_
24#define _BLK_BSG_
25
26#include <linux/blkdev.h>
27
28struct request;
29struct device;
30struct scatterlist;
31struct request_queue;
32
33struct bsg_buffer {
34 unsigned int payload_len;
35 int sg_cnt;
36 struct scatterlist *sg_list;
37};
38
39struct bsg_job {
40 struct device *dev;
41 struct request *req;
42
43 /* Transport/driver specific request/reply structs */
44 void *request;
45 void *reply;
46
47 unsigned int request_len;
48 unsigned int reply_len;
49 /*
50 * On entry : reply_len indicates the buffer size allocated for
51 * the reply.
52 *
53 * Upon completion : the message handler must set reply_len
54 * to indicates the size of the reply to be returned to the
55 * caller.
56 */
57
58 /* DMA payloads for the request/response */
59 struct bsg_buffer request_payload;
60 struct bsg_buffer reply_payload;
61
62 void *dd_data; /* Used for driver-specific storage */
63};
64
65void bsg_job_done(struct bsg_job *job, int result,
66 unsigned int reply_payload_rcv_len);
67int bsg_setup_queue(struct device *dev, struct request_queue *q, char *name,
68 bsg_job_fn *job_fn, int dd_job_size);
69void bsg_request_fn(struct request_queue *q);
70void bsg_remove_queue(struct request_queue *q);
71void bsg_goose_queue(struct request_queue *q);
72
73#endif
diff --git a/include/linux/caif/caif_socket.h b/include/linux/caif/caif_socket.h
index d9cb19b7cff7..3f3bac6af7bc 100644
--- a/include/linux/caif/caif_socket.h
+++ b/include/linux/caif/caif_socket.h
@@ -9,12 +9,7 @@
9#define _LINUX_CAIF_SOCKET_H 9#define _LINUX_CAIF_SOCKET_H
10 10
11#include <linux/types.h> 11#include <linux/types.h>
12
13#ifdef __KERNEL__
14#include <linux/socket.h> 12#include <linux/socket.h>
15#else
16#include <sys/socket.h>
17#endif
18 13
19/** 14/**
20 * enum caif_link_selector - Physical Link Selection. 15 * enum caif_link_selector - Physical Link Selection.
@@ -144,7 +139,7 @@ enum caif_debug_service {
144 * CAIF Channel. It defines the service to connect to on the modem. 139 * CAIF Channel. It defines the service to connect to on the modem.
145 */ 140 */
146struct sockaddr_caif { 141struct sockaddr_caif {
147 sa_family_t family; 142 __kernel_sa_family_t family;
148 union { 143 union {
149 struct { 144 struct {
150 __u8 type; /* type: enum caif_at_type */ 145 __u8 type; /* type: enum caif_at_type */
diff --git a/include/linux/can.h b/include/linux/can.h
index d18333302cbd..9a19bcb3eeaf 100644
--- a/include/linux/can.h
+++ b/include/linux/can.h
@@ -8,8 +8,6 @@
8 * Copyright (c) 2002-2007 Volkswagen Group Electronic Research 8 * Copyright (c) 2002-2007 Volkswagen Group Electronic Research
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Send feedback to <socketcan-users@lists.berlios.de>
12 *
13 */ 11 */
14 12
15#ifndef CAN_H 13#ifndef CAN_H
@@ -78,7 +76,7 @@ struct can_frame {
78 * @can_addr: protocol specific address information 76 * @can_addr: protocol specific address information
79 */ 77 */
80struct sockaddr_can { 78struct sockaddr_can {
81 sa_family_t can_family; 79 __kernel_sa_family_t can_family;
82 int can_ifindex; 80 int can_ifindex;
83 union { 81 union {
84 /* transport protocol class address information (e.g. ISOTP) */ 82 /* transport protocol class address information (e.g. ISOTP) */
diff --git a/include/linux/can/Kbuild b/include/linux/can/Kbuild
index 8cb05aae661c..c62b7f1728f9 100644
--- a/include/linux/can/Kbuild
+++ b/include/linux/can/Kbuild
@@ -1,4 +1,5 @@
1header-y += raw.h 1header-y += raw.h
2header-y += bcm.h 2header-y += bcm.h
3header-y += gw.h
3header-y += error.h 4header-y += error.h
4header-y += netlink.h 5header-y += netlink.h
diff --git a/include/linux/can/bcm.h b/include/linux/can/bcm.h
index 1432b278c52d..3ebe387fea4d 100644
--- a/include/linux/can/bcm.h
+++ b/include/linux/can/bcm.h
@@ -7,14 +7,13 @@
7 * Copyright (c) 2002-2007 Volkswagen Group Electronic Research 7 * Copyright (c) 2002-2007 Volkswagen Group Electronic Research
8 * All rights reserved. 8 * All rights reserved.
9 * 9 *
10 * Send feedback to <socketcan-users@lists.berlios.de>
11 *
12 */ 10 */
13 11
14#ifndef CAN_BCM_H 12#ifndef CAN_BCM_H
15#define CAN_BCM_H 13#define CAN_BCM_H
16 14
17#include <linux/types.h> 15#include <linux/types.h>
16#include <linux/can.h>
18 17
19/** 18/**
20 * struct bcm_msg_head - head of messages to/from the broadcast manager 19 * struct bcm_msg_head - head of messages to/from the broadcast manager
diff --git a/include/linux/can/core.h b/include/linux/can/core.h
index 5ce6b5d62ecc..0ccc1cd28b95 100644
--- a/include/linux/can/core.h
+++ b/include/linux/can/core.h
@@ -8,8 +8,6 @@
8 * Copyright (c) 2002-2007 Volkswagen Group Electronic Research 8 * Copyright (c) 2002-2007 Volkswagen Group Electronic Research
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Send feedback to <socketcan-users@lists.berlios.de>
12 *
13 */ 11 */
14 12
15#ifndef CAN_CORE_H 13#ifndef CAN_CORE_H
diff --git a/include/linux/can/dev.h b/include/linux/can/dev.h
index cc0bb4961669..a0969fcb72b9 100644
--- a/include/linux/can/dev.h
+++ b/include/linux/can/dev.h
@@ -8,7 +8,6 @@
8 * 8 *
9 * Copyright (C) 2008 Wolfgang Grandegger <wg@grandegger.com> 9 * Copyright (C) 2008 Wolfgang Grandegger <wg@grandegger.com>
10 * 10 *
11 * Send feedback to <socketcan-users@lists.berlios.de>
12 */ 11 */
13 12
14#ifndef CAN_DEV_H 13#ifndef CAN_DEV_H
diff --git a/include/linux/can/error.h b/include/linux/can/error.h
index 5958074302a4..63e855ea6b84 100644
--- a/include/linux/can/error.h
+++ b/include/linux/can/error.h
@@ -7,8 +7,6 @@
7 * Copyright (c) 2002-2007 Volkswagen Group Electronic Research 7 * Copyright (c) 2002-2007 Volkswagen Group Electronic Research
8 * All rights reserved. 8 * All rights reserved.
9 * 9 *
10 * Send feedback to <socketcan-users@lists.berlios.de>
11 *
12 */ 10 */
13 11
14#ifndef CAN_ERROR_H 12#ifndef CAN_ERROR_H
diff --git a/include/linux/can/gw.h b/include/linux/can/gw.h
new file mode 100644
index 000000000000..8e1db18c3cb6
--- /dev/null
+++ b/include/linux/can/gw.h
@@ -0,0 +1,162 @@
1/*
2 * linux/can/gw.h
3 *
4 * Definitions for CAN frame Gateway/Router/Bridge
5 *
6 * Author: Oliver Hartkopp <oliver.hartkopp@volkswagen.de>
7 * Copyright (c) 2011 Volkswagen Group Electronic Research
8 * All rights reserved.
9 *
10 */
11
12#ifndef CAN_GW_H
13#define CAN_GW_H
14
15#include <linux/types.h>
16#include <linux/can.h>
17
18struct rtcanmsg {
19 __u8 can_family;
20 __u8 gwtype;
21 __u16 flags;
22};
23
24/* CAN gateway types */
25enum {
26 CGW_TYPE_UNSPEC,
27 CGW_TYPE_CAN_CAN, /* CAN->CAN routing */
28 __CGW_TYPE_MAX
29};
30
31#define CGW_TYPE_MAX (__CGW_TYPE_MAX - 1)
32
33/* CAN rtnetlink attribute definitions */
34enum {
35 CGW_UNSPEC,
36 CGW_MOD_AND, /* CAN frame modification binary AND */
37 CGW_MOD_OR, /* CAN frame modification binary OR */
38 CGW_MOD_XOR, /* CAN frame modification binary XOR */
39 CGW_MOD_SET, /* CAN frame modification set alternate values */
40 CGW_CS_XOR, /* set data[] XOR checksum into data[index] */
41 CGW_CS_CRC8, /* set data[] CRC8 checksum into data[index] */
42 CGW_HANDLED, /* number of handled CAN frames */
43 CGW_DROPPED, /* number of dropped CAN frames */
44 CGW_SRC_IF, /* ifindex of source network interface */
45 CGW_DST_IF, /* ifindex of destination network interface */
46 CGW_FILTER, /* specify struct can_filter on source CAN device */
47 __CGW_MAX
48};
49
50#define CGW_MAX (__CGW_MAX - 1)
51
52#define CGW_FLAGS_CAN_ECHO 0x01
53#define CGW_FLAGS_CAN_SRC_TSTAMP 0x02
54
55#define CGW_MOD_FUNCS 4 /* AND OR XOR SET */
56
57/* CAN frame elements that are affected by curr. 3 CAN frame modifications */
58#define CGW_MOD_ID 0x01
59#define CGW_MOD_DLC 0x02
60#define CGW_MOD_DATA 0x04
61
62#define CGW_FRAME_MODS 3 /* ID DLC DATA */
63
64#define MAX_MODFUNCTIONS (CGW_MOD_FUNCS * CGW_FRAME_MODS)
65
66struct cgw_frame_mod {
67 struct can_frame cf;
68 __u8 modtype;
69} __attribute__((packed));
70
71#define CGW_MODATTR_LEN sizeof(struct cgw_frame_mod)
72
73struct cgw_csum_xor {
74 __s8 from_idx;
75 __s8 to_idx;
76 __s8 result_idx;
77 __u8 init_xor_val;
78} __attribute__((packed));
79
80struct cgw_csum_crc8 {
81 __s8 from_idx;
82 __s8 to_idx;
83 __s8 result_idx;
84 __u8 init_crc_val;
85 __u8 final_xor_val;
86 __u8 crctab[256];
87 __u8 profile;
88 __u8 profile_data[20];
89} __attribute__((packed));
90
91/* length of checksum operation parameters. idx = index in CAN frame data[] */
92#define CGW_CS_XOR_LEN sizeof(struct cgw_csum_xor)
93#define CGW_CS_CRC8_LEN sizeof(struct cgw_csum_crc8)
94
95/* CRC8 profiles (compute CRC for additional data elements - see below) */
96enum {
97 CGW_CRC8PRF_UNSPEC,
98 CGW_CRC8PRF_1U8, /* compute one additional u8 value */
99 CGW_CRC8PRF_16U8, /* u8 value table indexed by data[1] & 0xF */
100 CGW_CRC8PRF_SFFID_XOR, /* (can_id & 0xFF) ^ (can_id >> 8 & 0xFF) */
101 __CGW_CRC8PRF_MAX
102};
103
104#define CGW_CRC8PRF_MAX (__CGW_CRC8PRF_MAX - 1)
105
106/*
107 * CAN rtnetlink attribute contents in detail
108 *
109 * CGW_XXX_IF (length 4 bytes):
110 * Sets an interface index for source/destination network interfaces.
111 * For the CAN->CAN gwtype the indices of _two_ CAN interfaces are mandatory.
112 *
113 * CGW_FILTER (length 8 bytes):
114 * Sets a CAN receive filter for the gateway job specified by the
115 * struct can_filter described in include/linux/can.h
116 *
117 * CGW_MOD_XXX (length 17 bytes):
118 * Specifies a modification that's done to a received CAN frame before it is
119 * send out to the destination interface.
120 *
121 * <struct can_frame> data used as operator
122 * <u8> affected CAN frame elements
123 *
124 * CGW_CS_XOR (length 4 bytes):
125 * Set a simple XOR checksum starting with an initial value into
126 * data[result-idx] using data[start-idx] .. data[end-idx]
127 *
128 * The XOR checksum is calculated like this:
129 *
130 * xor = init_xor_val
131 *
132 * for (i = from_idx .. to_idx)
133 * xor ^= can_frame.data[i]
134 *
135 * can_frame.data[ result_idx ] = xor
136 *
137 * CGW_CS_CRC8 (length 282 bytes):
138 * Set a CRC8 value into data[result-idx] using a given 256 byte CRC8 table,
139 * a given initial value and a defined input data[start-idx] .. data[end-idx].
140 * Finally the result value is XOR'ed with the final_xor_val.
141 *
142 * The CRC8 checksum is calculated like this:
143 *
144 * crc = init_crc_val
145 *
146 * for (i = from_idx .. to_idx)
147 * crc = crctab[ crc ^ can_frame.data[i] ]
148 *
149 * can_frame.data[ result_idx ] = crc ^ final_xor_val
150 *
151 * The calculated CRC may contain additional source data elements that can be
152 * defined in the handling of 'checksum profiles' e.g. shown in AUTOSAR specs
153 * like http://www.autosar.org/download/R4.0/AUTOSAR_SWS_E2ELibrary.pdf
154 * E.g. the profile_data[] may contain additional u8 values (called DATA_IDs)
155 * that are used depending on counter values inside the CAN frame data[].
156 * So far only three profiles have been implemented for illustration.
157 *
158 * Remark: In general the attribute data is a linear buffer.
159 * Beware of sending unpacked or aligned structs!
160 */
161
162#endif
diff --git a/include/linux/can/netlink.h b/include/linux/can/netlink.h
index 34542d374dd8..14966ddb7df1 100644
--- a/include/linux/can/netlink.h
+++ b/include/linux/can/netlink.h
@@ -5,8 +5,6 @@
5 * 5 *
6 * Copyright (c) 2009 Wolfgang Grandegger <wg@grandegger.com> 6 * Copyright (c) 2009 Wolfgang Grandegger <wg@grandegger.com>
7 * 7 *
8 * Send feedback to <socketcan-users@lists.berlios.de>
9 *
10 */ 8 */
11 9
12#ifndef CAN_NETLINK_H 10#ifndef CAN_NETLINK_H
diff --git a/include/linux/can/raw.h b/include/linux/can/raw.h
index b2a0f87492c5..781f3a3701be 100644
--- a/include/linux/can/raw.h
+++ b/include/linux/can/raw.h
@@ -8,8 +8,6 @@
8 * Copyright (c) 2002-2007 Volkswagen Group Electronic Research 8 * Copyright (c) 2002-2007 Volkswagen Group Electronic Research
9 * All rights reserved. 9 * All rights reserved.
10 * 10 *
11 * Send feedback to <socketcan-users@lists.berlios.de>
12 *
13 */ 11 */
14 12
15#ifndef CAN_RAW_H 13#ifndef CAN_RAW_H
diff --git a/include/linux/capability.h b/include/linux/capability.h
index c42112350003..a63d13d84ad8 100644
--- a/include/linux/capability.h
+++ b/include/linux/capability.h
@@ -198,7 +198,7 @@ struct cpu_vfs_cap_data {
198/* Allow modification of routing tables */ 198/* Allow modification of routing tables */
199/* Allow setting arbitrary process / process group ownership on 199/* Allow setting arbitrary process / process group ownership on
200 sockets */ 200 sockets */
201/* Allow binding to any address for transparent proxying */ 201/* Allow binding to any address for transparent proxying (also via NET_RAW) */
202/* Allow setting TOS (type of service) */ 202/* Allow setting TOS (type of service) */
203/* Allow setting promiscuous mode */ 203/* Allow setting promiscuous mode */
204/* Allow clearing driver statistics */ 204/* Allow clearing driver statistics */
@@ -210,6 +210,7 @@ struct cpu_vfs_cap_data {
210 210
211/* Allow use of RAW sockets */ 211/* Allow use of RAW sockets */
212/* Allow use of PACKET sockets */ 212/* Allow use of PACKET sockets */
213/* Allow binding to any address for transparent proxying (also via NET_ADMIN) */
213 214
214#define CAP_NET_RAW 13 215#define CAP_NET_RAW 13
215 216
diff --git a/include/linux/ceph/messenger.h b/include/linux/ceph/messenger.h
index d7adf151d335..ca768ae729b4 100644
--- a/include/linux/ceph/messenger.h
+++ b/include/linux/ceph/messenger.h
@@ -6,7 +6,6 @@
6#include <linux/net.h> 6#include <linux/net.h>
7#include <linux/radix-tree.h> 7#include <linux/radix-tree.h>
8#include <linux/uio.h> 8#include <linux/uio.h>
9#include <linux/version.h>
10#include <linux/workqueue.h> 9#include <linux/workqueue.h>
11 10
12#include "types.h" 11#include "types.h"
diff --git a/include/linux/clockchips.h b/include/linux/clockchips.h
index d6733e27af34..81e803e90aa4 100644
--- a/include/linux/clockchips.h
+++ b/include/linux/clockchips.h
@@ -45,20 +45,22 @@ enum clock_event_nofitiers {
45 */ 45 */
46#define CLOCK_EVT_FEAT_PERIODIC 0x000001 46#define CLOCK_EVT_FEAT_PERIODIC 0x000001
47#define CLOCK_EVT_FEAT_ONESHOT 0x000002 47#define CLOCK_EVT_FEAT_ONESHOT 0x000002
48#define CLOCK_EVT_FEAT_KTIME 0x000004
48/* 49/*
49 * x86(64) specific misfeatures: 50 * x86(64) specific misfeatures:
50 * 51 *
51 * - Clockevent source stops in C3 State and needs broadcast support. 52 * - Clockevent source stops in C3 State and needs broadcast support.
52 * - Local APIC timer is used as a dummy device. 53 * - Local APIC timer is used as a dummy device.
53 */ 54 */
54#define CLOCK_EVT_FEAT_C3STOP 0x000004 55#define CLOCK_EVT_FEAT_C3STOP 0x000008
55#define CLOCK_EVT_FEAT_DUMMY 0x000008 56#define CLOCK_EVT_FEAT_DUMMY 0x000010
56 57
57/** 58/**
58 * struct clock_event_device - clock event device descriptor 59 * struct clock_event_device - clock event device descriptor
59 * @event_handler: Assigned by the framework to be called by the low 60 * @event_handler: Assigned by the framework to be called by the low
60 * level handler of the event source 61 * level handler of the event source
61 * @set_next_event: set next event function 62 * @set_next_event: set next event function using a clocksource delta
63 * @set_next_ktime: set next event function using a direct ktime value
62 * @next_event: local storage for the next event in oneshot mode 64 * @next_event: local storage for the next event in oneshot mode
63 * @max_delta_ns: maximum delta value in ns 65 * @max_delta_ns: maximum delta value in ns
64 * @min_delta_ns: minimum delta value in ns 66 * @min_delta_ns: minimum delta value in ns
@@ -81,6 +83,8 @@ struct clock_event_device {
81 void (*event_handler)(struct clock_event_device *); 83 void (*event_handler)(struct clock_event_device *);
82 int (*set_next_event)(unsigned long evt, 84 int (*set_next_event)(unsigned long evt,
83 struct clock_event_device *); 85 struct clock_event_device *);
86 int (*set_next_ktime)(ktime_t expires,
87 struct clock_event_device *);
84 ktime_t next_event; 88 ktime_t next_event;
85 u64 max_delta_ns; 89 u64 max_delta_ns;
86 u64 min_delta_ns; 90 u64 min_delta_ns;
@@ -140,7 +144,7 @@ extern void clockevents_set_mode(struct clock_event_device *dev,
140 enum clock_event_mode mode); 144 enum clock_event_mode mode);
141extern int clockevents_register_notifier(struct notifier_block *nb); 145extern int clockevents_register_notifier(struct notifier_block *nb);
142extern int clockevents_program_event(struct clock_event_device *dev, 146extern int clockevents_program_event(struct clock_event_device *dev,
143 ktime_t expires, ktime_t now); 147 ktime_t expires, bool force);
144 148
145extern void clockevents_handle_noop(struct clock_event_device *dev); 149extern void clockevents_handle_noop(struct clock_event_device *dev);
146 150
diff --git a/include/linux/cn_proc.h b/include/linux/cn_proc.h
index 12c517b51ca2..d03612b196e1 100644
--- a/include/linux/cn_proc.h
+++ b/include/linux/cn_proc.h
@@ -54,6 +54,7 @@ struct proc_event {
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 PROC_EVENT_PTRACE = 0x00000100,
57 PROC_EVENT_COMM = 0x00000200,
57 /* "next" should be 0x00000400 */ 58 /* "next" should be 0x00000400 */
58 /* "last" is the last process event: exit */ 59 /* "last" is the last process event: exit */
59 PROC_EVENT_EXIT = 0x80000000 60 PROC_EVENT_EXIT = 0x80000000
@@ -103,6 +104,12 @@ struct proc_event {
103 __kernel_pid_t tracer_tgid; 104 __kernel_pid_t tracer_tgid;
104 } ptrace; 105 } ptrace;
105 106
107 struct comm_proc_event {
108 __kernel_pid_t process_pid;
109 __kernel_pid_t process_tgid;
110 char comm[16];
111 } comm;
112
106 struct exit_proc_event { 113 struct exit_proc_event {
107 __kernel_pid_t process_pid; 114 __kernel_pid_t process_pid;
108 __kernel_pid_t process_tgid; 115 __kernel_pid_t process_tgid;
@@ -118,6 +125,7 @@ void proc_exec_connector(struct task_struct *task);
118void proc_id_connector(struct task_struct *task, int which_id); 125void proc_id_connector(struct task_struct *task, int which_id);
119void proc_sid_connector(struct task_struct *task); 126void proc_sid_connector(struct task_struct *task);
120void proc_ptrace_connector(struct task_struct *task, int which_id); 127void proc_ptrace_connector(struct task_struct *task, int which_id);
128void proc_comm_connector(struct task_struct *task);
121void proc_exit_connector(struct task_struct *task); 129void proc_exit_connector(struct task_struct *task);
122#else 130#else
123static inline void proc_fork_connector(struct task_struct *task) 131static inline void proc_fork_connector(struct task_struct *task)
@@ -133,6 +141,9 @@ static inline void proc_id_connector(struct task_struct *task,
133static inline void proc_sid_connector(struct task_struct *task) 141static inline void proc_sid_connector(struct task_struct *task)
134{} 142{}
135 143
144static inline void proc_comm_connector(struct task_struct *task)
145{}
146
136static inline void proc_ptrace_connector(struct task_struct *task, 147static inline void proc_ptrace_connector(struct task_struct *task,
137 int ptrace_id) 148 int ptrace_id)
138{} 149{}
diff --git a/include/linux/compat.h b/include/linux/compat.h
index 8779405e15a8..c6e7523bf765 100644
--- a/include/linux/compat.h
+++ b/include/linux/compat.h
@@ -438,7 +438,6 @@ 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);
441asmlinkage long compat_sys_nfsservctl(int cmd, void *notused, void *notused2);
442asmlinkage long compat_sys_signalfd4(int ufd, 441asmlinkage long compat_sys_signalfd4(int ufd,
443 const compat_sigset_t __user *sigmask, 442 const compat_sigset_t __user *sigmask,
444 compat_size_t sigsetsize, int flags); 443 compat_size_t sigsetsize, int flags);
diff --git a/include/linux/connector.h b/include/linux/connector.h
index 0c69ad825b39..3c9c54fd5690 100644
--- a/include/linux/connector.h
+++ b/include/linux/connector.h
@@ -1,7 +1,7 @@
1/* 1/*
2 * connector.h 2 * connector.h
3 * 3 *
4 * 2004-2005 Copyright (c) Evgeniy Polyakov <johnpol@2ka.mipt.ru> 4 * 2004-2005 Copyright (c) Evgeniy Polyakov <zbr@ioremap.net>
5 * All rights reserved. 5 * All rights reserved.
6 * 6 *
7 * This program is free software; you can redistribute it and/or modify 7 * This program is free software; you can redistribute it and/or modify
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/cred.h b/include/linux/cred.h
index 48e82af1159b..40308969ed00 100644
--- a/include/linux/cred.h
+++ b/include/linux/cred.h
@@ -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 rcu_dereference_protected(current->cred, 1)
272 273
273/** 274/**
274 * __task_cred - Access a task's objective credentials 275 * __task_cred - Access a task's objective credentials
@@ -306,8 +307,8 @@ static inline void put_cred(const struct cred *_cred)
306#define get_current_user() \ 307#define get_current_user() \
307({ \ 308({ \
308 struct user_struct *__u; \ 309 struct user_struct *__u; \
309 struct cred *__cred; \ 310 const struct cred *__cred; \
310 __cred = (struct cred *) current_cred(); \ 311 __cred = current_cred(); \
311 __u = get_uid(__cred->user); \ 312 __u = get_uid(__cred->user); \
312 __u; \ 313 __u; \
313}) 314})
@@ -321,8 +322,8 @@ static inline void put_cred(const struct cred *_cred)
321#define get_current_groups() \ 322#define get_current_groups() \
322({ \ 323({ \
323 struct group_info *__groups; \ 324 struct group_info *__groups; \
324 struct cred *__cred; \ 325 const struct cred *__cred; \
325 __cred = (struct cred *) current_cred(); \ 326 __cred = current_cred(); \
326 __groups = get_group_info(__cred->group_info); \ 327 __groups = get_group_info(__cred->group_info); \
327 __groups; \ 328 __groups; \
328}) 329})
@@ -341,7 +342,7 @@ static inline void put_cred(const struct cred *_cred)
341 342
342#define current_cred_xxx(xxx) \ 343#define current_cred_xxx(xxx) \
343({ \ 344({ \
344 current->cred->xxx; \ 345 current_cred()->xxx; \
345}) 346})
346 347
347#define current_uid() (current_cred_xxx(uid)) 348#define current_uid() (current_cred_xxx(uid))
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/dcache.h b/include/linux/dcache.h
index d37d2a793099..62157c03caf7 100644
--- a/include/linux/dcache.h
+++ b/include/linux/dcache.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,22 +196,18 @@ 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 */
diff --git a/include/linux/devfreq.h b/include/linux/devfreq.h
new file mode 100644
index 000000000000..afb94583960c
--- /dev/null
+++ b/include/linux/devfreq.h
@@ -0,0 +1,238 @@
1/*
2 * devfreq: Generic Dynamic Voltage and Frequency Scaling (DVFS) Framework
3 * for Non-CPU Devices.
4 *
5 * Copyright (C) 2011 Samsung Electronics
6 * MyungJoo Ham <myungjoo.ham@samsung.com>
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11 */
12
13#ifndef __LINUX_DEVFREQ_H__
14#define __LINUX_DEVFREQ_H__
15
16#include <linux/device.h>
17#include <linux/notifier.h>
18#include <linux/opp.h>
19
20#define DEVFREQ_NAME_LEN 16
21
22struct devfreq;
23
24/**
25 * struct devfreq_dev_status - Data given from devfreq user device to
26 * governors. Represents the performance
27 * statistics.
28 * @total_time The total time represented by this instance of
29 * devfreq_dev_status
30 * @busy_time The time that the device was working among the
31 * total_time.
32 * @current_frequency The operating frequency.
33 * @private_data An entry not specified by the devfreq framework.
34 * A device and a specific governor may have their
35 * own protocol with private_data. However, because
36 * this is governor-specific, a governor using this
37 * will be only compatible with devices aware of it.
38 */
39struct devfreq_dev_status {
40 /* both since the last measure */
41 unsigned long total_time;
42 unsigned long busy_time;
43 unsigned long current_frequency;
44 void *private_date;
45};
46
47/**
48 * struct devfreq_dev_profile - Devfreq's user device profile
49 * @initial_freq The operating frequency when devfreq_add_device() is
50 * called.
51 * @polling_ms The polling interval in ms. 0 disables polling.
52 * @target The device should set its operating frequency at
53 * freq or lowest-upper-than-freq value. If freq is
54 * higher than any operable frequency, set maximum.
55 * Before returning, target function should set
56 * freq at the current frequency.
57 * @get_dev_status The device should provide the current performance
58 * status to devfreq, which is used by governors.
59 * @exit An optional callback that is called when devfreq
60 * is removing the devfreq object due to error or
61 * from devfreq_remove_device() call. If the user
62 * has registered devfreq->nb at a notifier-head,
63 * this is the time to unregister it.
64 */
65struct devfreq_dev_profile {
66 unsigned long initial_freq;
67 unsigned int polling_ms;
68
69 int (*target)(struct device *dev, unsigned long *freq);
70 int (*get_dev_status)(struct device *dev,
71 struct devfreq_dev_status *stat);
72 void (*exit)(struct device *dev);
73};
74
75/**
76 * struct devfreq_governor - Devfreq policy governor
77 * @name Governor's name
78 * @get_target_freq Returns desired operating frequency for the device.
79 * Basically, get_target_freq will run
80 * devfreq_dev_profile.get_dev_status() to get the
81 * status of the device (load = busy_time / total_time).
82 * If no_central_polling is set, this callback is called
83 * only with update_devfreq() notified by OPP.
84 * @init Called when the devfreq is being attached to a device
85 * @exit Called when the devfreq is being removed from a
86 * device. Governor should stop any internal routines
87 * before return because related data may be
88 * freed after exit().
89 * @no_central_polling Do not use devfreq's central polling mechanism.
90 * When this is set, devfreq will not call
91 * get_target_freq with devfreq_monitor(). However,
92 * devfreq will call get_target_freq with
93 * devfreq_update() notified by OPP framework.
94 *
95 * Note that the callbacks are called with devfreq->lock locked by devfreq.
96 */
97struct devfreq_governor {
98 const char name[DEVFREQ_NAME_LEN];
99 int (*get_target_freq)(struct devfreq *this, unsigned long *freq);
100 int (*init)(struct devfreq *this);
101 void (*exit)(struct devfreq *this);
102 const bool no_central_polling;
103};
104
105/**
106 * struct devfreq - Device devfreq structure
107 * @node list node - contains the devices with devfreq that have been
108 * registered.
109 * @lock a mutex to protect accessing devfreq.
110 * @dev device registered by devfreq class. dev.parent is the device
111 * using devfreq.
112 * @profile device-specific devfreq profile
113 * @governor method how to choose frequency based on the usage.
114 * @nb notifier block used to notify devfreq object that it should
115 * reevaluate operable frequencies. Devfreq users may use
116 * devfreq.nb to the corresponding register notifier call chain.
117 * @polling_jiffies interval in jiffies.
118 * @previous_freq previously configured frequency value.
119 * @next_polling the number of remaining jiffies to poll with
120 * "devfreq_monitor" executions to reevaluate
121 * frequency/voltage of the device. Set by
122 * profile's polling_ms interval.
123 * @data Private data of the governor. The devfreq framework does not
124 * touch this.
125 * @being_removed a flag to mark that this object is being removed in
126 * order to prevent trying to remove the object multiple times.
127 *
128 * This structure stores the devfreq information for a give device.
129 *
130 * Note that when a governor accesses entries in struct devfreq in its
131 * functions except for the context of callbacks defined in struct
132 * devfreq_governor, the governor should protect its access with the
133 * struct mutex lock in struct devfreq. A governor may use this mutex
134 * to protect its own private data in void *data as well.
135 */
136struct devfreq {
137 struct list_head node;
138
139 struct mutex lock;
140 struct device dev;
141 struct devfreq_dev_profile *profile;
142 const struct devfreq_governor *governor;
143 struct notifier_block nb;
144
145 unsigned long polling_jiffies;
146 unsigned long previous_freq;
147 unsigned int next_polling;
148
149 void *data; /* private data for governors */
150
151 bool being_removed;
152};
153
154#if defined(CONFIG_PM_DEVFREQ)
155extern struct devfreq *devfreq_add_device(struct device *dev,
156 struct devfreq_dev_profile *profile,
157 const struct devfreq_governor *governor,
158 void *data);
159extern int devfreq_remove_device(struct devfreq *devfreq);
160
161/* Helper functions for devfreq user device driver with OPP. */
162extern struct opp *devfreq_recommended_opp(struct device *dev,
163 unsigned long *freq);
164extern int devfreq_register_opp_notifier(struct device *dev,
165 struct devfreq *devfreq);
166extern int devfreq_unregister_opp_notifier(struct device *dev,
167 struct devfreq *devfreq);
168
169#ifdef CONFIG_DEVFREQ_GOV_POWERSAVE
170extern const struct devfreq_governor devfreq_powersave;
171#endif
172#ifdef CONFIG_DEVFREQ_GOV_PERFORMANCE
173extern const struct devfreq_governor devfreq_performance;
174#endif
175#ifdef CONFIG_DEVFREQ_GOV_USERSPACE
176extern const struct devfreq_governor devfreq_userspace;
177#endif
178#ifdef CONFIG_DEVFREQ_GOV_SIMPLE_ONDEMAND
179extern const struct devfreq_governor devfreq_simple_ondemand;
180/**
181 * struct devfreq_simple_ondemand_data - void *data fed to struct devfreq
182 * and devfreq_add_device
183 * @ upthreshold If the load is over this value, the frequency jumps.
184 * Specify 0 to use the default. Valid value = 0 to 100.
185 * @ downdifferential If the load is under upthreshold - downdifferential,
186 * the governor may consider slowing the frequency down.
187 * Specify 0 to use the default. Valid value = 0 to 100.
188 * downdifferential < upthreshold must hold.
189 *
190 * If the fed devfreq_simple_ondemand_data pointer is NULL to the governor,
191 * the governor uses the default values.
192 */
193struct devfreq_simple_ondemand_data {
194 unsigned int upthreshold;
195 unsigned int downdifferential;
196};
197#endif
198
199#else /* !CONFIG_PM_DEVFREQ */
200static struct devfreq *devfreq_add_device(struct device *dev,
201 struct devfreq_dev_profile *profile,
202 struct devfreq_governor *governor,
203 void *data);
204{
205 return NULL;
206}
207
208static int devfreq_remove_device(struct devfreq *devfreq);
209{
210 return 0;
211}
212
213static struct opp *devfreq_recommended_opp(struct device *dev,
214 unsigned long *freq)
215{
216 return -EINVAL;
217}
218
219static int devfreq_register_opp_notifier(struct device *dev,
220 struct devfreq *devfreq)
221{
222 return -EINVAL;
223}
224
225static int devfreq_unregister_opp_notifier(struct device *dev,
226 struct devfreq *devfreq)
227{
228 return -EINVAL;
229}
230
231#define devfreq_powersave NULL
232#define devfreq_performance NULL
233#define devfreq_userspace NULL
234#define devfreq_simple_ondemand NULL
235
236#endif /* CONFIG_PM_DEVFREQ */
237
238#endif /* __LINUX_DEVFREQ_H__ */
diff --git a/include/linux/device-mapper.h b/include/linux/device-mapper.h
index 4427e0454051..99e3e50b5c57 100644
--- a/include/linux/device-mapper.h
+++ b/include/linux/device-mapper.h
@@ -197,6 +197,11 @@ struct dm_target {
197 * whether or not its underlying devices have support. 197 * whether or not its underlying devices have support.
198 */ 198 */
199 unsigned discards_supported:1; 199 unsigned discards_supported:1;
200
201 /*
202 * Set if this target does not return zeroes on discarded blocks.
203 */
204 unsigned discard_zeroes_data_unsupported:1;
200}; 205};
201 206
202/* Each target can link one of these into the table */ 207/* Each target can link one of these into the table */
@@ -208,6 +213,49 @@ struct dm_target_callbacks {
208int dm_register_target(struct target_type *t); 213int dm_register_target(struct target_type *t);
209void dm_unregister_target(struct target_type *t); 214void dm_unregister_target(struct target_type *t);
210 215
216/*
217 * Target argument parsing.
218 */
219struct dm_arg_set {
220 unsigned argc;
221 char **argv;
222};
223
224/*
225 * The minimum and maximum value of a numeric argument, together with
226 * the error message to use if the number is found to be outside that range.
227 */
228struct dm_arg {
229 unsigned min;
230 unsigned max;
231 char *error;
232};
233
234/*
235 * Validate the next argument, either returning it as *value or, if invalid,
236 * returning -EINVAL and setting *error.
237 */
238int dm_read_arg(struct dm_arg *arg, struct dm_arg_set *arg_set,
239 unsigned *value, char **error);
240
241/*
242 * Process the next argument as the start of a group containing between
243 * arg->min and arg->max further arguments. Either return the size as
244 * *num_args or, if invalid, return -EINVAL and set *error.
245 */
246int dm_read_arg_group(struct dm_arg *arg, struct dm_arg_set *arg_set,
247 unsigned *num_args, char **error);
248
249/*
250 * Return the current argument and shift to the next.
251 */
252const char *dm_shift_arg(struct dm_arg_set *as);
253
254/*
255 * Move through num_args arguments.
256 */
257void dm_consume_args(struct dm_arg_set *as, unsigned num_args);
258
211/*----------------------------------------------------------------- 259/*-----------------------------------------------------------------
212 * Functions for creating and manipulating mapped devices. 260 * Functions for creating and manipulating mapped devices.
213 * Drop the reference with dm_put when you finish with the object. 261 * 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 c20dfbfc49b4..bdcf361ca938 100644
--- a/include/linux/device.h
+++ b/include/linux/device.h
@@ -350,6 +350,8 @@ struct class_attribute {
350 char *buf); 350 char *buf);
351 ssize_t (*store)(struct class *class, struct class_attribute *attr, 351 ssize_t (*store)(struct class *class, struct class_attribute *attr,
352 const char *buf, size_t count); 352 const char *buf, size_t count);
353 const void *(*namespace)(struct class *class,
354 const struct class_attribute *attr);
353}; 355};
354 356
355#define CLASS_ATTR(_name, _mode, _show, _store) \ 357#define CLASS_ATTR(_name, _mode, _show, _store) \
@@ -636,6 +638,11 @@ static inline void set_dev_node(struct device *dev, int node)
636} 638}
637#endif 639#endif
638 640
641static inline struct pm_subsys_data *dev_to_psd(struct device *dev)
642{
643 return dev ? dev->power.subsys_data : NULL;
644}
645
639static inline unsigned int dev_get_uevent_suppress(const struct device *dev) 646static inline unsigned int dev_get_uevent_suppress(const struct device *dev)
640{ 647{
641 return dev->kobj.uevent_suppress; 648 return dev->kobj.uevent_suppress;
@@ -785,6 +792,8 @@ extern const char *dev_driver_string(const struct device *dev);
785 792
786#ifdef CONFIG_PRINTK 793#ifdef CONFIG_PRINTK
787 794
795extern int __dev_printk(const char *level, const struct device *dev,
796 struct va_format *vaf);
788extern int dev_printk(const char *level, const struct device *dev, 797extern int dev_printk(const char *level, const struct device *dev,
789 const char *fmt, ...) 798 const char *fmt, ...)
790 __attribute__ ((format (printf, 3, 4))); 799 __attribute__ ((format (printf, 3, 4)));
@@ -805,6 +814,9 @@ extern int _dev_info(const struct device *dev, const char *fmt, ...)
805 814
806#else 815#else
807 816
817static inline int __dev_printk(const char *level, const struct device *dev,
818 struct va_format *vaf)
819 { return 0; }
808static inline int dev_printk(const char *level, const struct device *dev, 820static inline int dev_printk(const char *level, const struct device *dev,
809 const char *fmt, ...) 821 const char *fmt, ...)
810 __attribute__ ((format (printf, 3, 4))); 822 __attribute__ ((format (printf, 3, 4)));
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_remapping.h b/include/linux/dma_remapping.h
index bbd8661b3473..ef90cbd8e173 100644
--- a/include/linux/dma_remapping.h
+++ b/include/linux/dma_remapping.h
@@ -25,11 +25,12 @@ struct intel_iommu;
25struct dmar_domain; 25struct dmar_domain;
26struct root_entry; 26struct root_entry;
27 27
28extern void free_dmar_iommu(struct intel_iommu *iommu);
29 28
30#ifdef CONFIG_DMAR 29#ifdef CONFIG_INTEL_IOMMU
30extern void free_dmar_iommu(struct intel_iommu *iommu);
31extern int iommu_calculate_agaw(struct intel_iommu *iommu); 31extern int iommu_calculate_agaw(struct intel_iommu *iommu);
32extern int iommu_calculate_max_sagaw(struct intel_iommu *iommu); 32extern int iommu_calculate_max_sagaw(struct intel_iommu *iommu);
33extern int dmar_disabled;
33#else 34#else
34static inline int iommu_calculate_agaw(struct intel_iommu *iommu) 35static inline int iommu_calculate_agaw(struct intel_iommu *iommu)
35{ 36{
@@ -39,8 +40,11 @@ static inline int iommu_calculate_max_sagaw(struct intel_iommu *iommu)
39{ 40{
40 return 0; 41 return 0;
41} 42}
43static inline void free_dmar_iommu(struct intel_iommu *iommu)
44{
45}
46#define dmar_disabled (1)
42#endif 47#endif
43 48
44extern int dmar_disabled;
45 49
46#endif 50#endif
diff --git a/include/linux/dmar.h b/include/linux/dmar.h
index 7b776d71d36d..a8b1a847c103 100644
--- a/include/linux/dmar.h
+++ b/include/linux/dmar.h
@@ -26,8 +26,13 @@
26#include <linux/msi.h> 26#include <linux/msi.h>
27#include <linux/irqreturn.h> 27#include <linux/irqreturn.h>
28 28
29/* DMAR Flags */
30#define DMAR_INTR_REMAP 0x1
31#define DMAR_X2APIC_OPT_OUT 0x2
32
29struct intel_iommu; 33struct intel_iommu;
30#if defined(CONFIG_DMAR) || defined(CONFIG_INTR_REMAP) 34#ifdef CONFIG_DMAR_TABLE
35extern struct acpi_table_header *dmar_tbl;
31struct dmar_drhd_unit { 36struct dmar_drhd_unit {
32 struct list_head list; /* list of drhd units */ 37 struct list_head list; /* list of drhd units */
33 struct acpi_dmar_header *hdr; /* ACPI header */ 38 struct acpi_dmar_header *hdr; /* ACPI header */
@@ -76,7 +81,7 @@ static inline int enable_drhd_fault_handling(void)
76{ 81{
77 return -1; 82 return -1;
78} 83}
79#endif /* !CONFIG_DMAR && !CONFIG_INTR_REMAP */ 84#endif /* !CONFIG_DMAR_TABLE */
80 85
81struct irte { 86struct irte {
82 union { 87 union {
@@ -107,10 +112,10 @@ struct irte {
107 }; 112 };
108}; 113};
109 114
110#ifdef CONFIG_INTR_REMAP 115#ifdef CONFIG_IRQ_REMAP
111extern int intr_remapping_enabled; 116extern int intr_remapping_enabled;
112extern int intr_remapping_supported(void); 117extern int intr_remapping_supported(void);
113extern int enable_intr_remapping(int); 118extern int enable_intr_remapping(void);
114extern void disable_intr_remapping(void); 119extern void disable_intr_remapping(void);
115extern int reenable_intr_remapping(int); 120extern int reenable_intr_remapping(int);
116 121
@@ -177,7 +182,7 @@ static inline int set_msi_sid(struct irte *irte, struct pci_dev *dev)
177 182
178#define intr_remapping_enabled (0) 183#define intr_remapping_enabled (0)
179 184
180static inline int enable_intr_remapping(int eim) 185static inline int enable_intr_remapping(void)
181{ 186{
182 return -1; 187 return -1;
183} 188}
@@ -192,6 +197,11 @@ static inline int reenable_intr_remapping(int eim)
192} 197}
193#endif 198#endif
194 199
200enum {
201 IRQ_REMAP_XAPIC_MODE,
202 IRQ_REMAP_X2APIC_MODE,
203};
204
195/* Can't use the common MSI interrupt functions 205/* Can't use the common MSI interrupt functions
196 * since DMAR is not a pci device 206 * since DMAR is not a pci device
197 */ 207 */
@@ -204,7 +214,7 @@ extern int dmar_set_interrupt(struct intel_iommu *iommu);
204extern irqreturn_t dmar_fault(int irq, void *dev_id); 214extern irqreturn_t dmar_fault(int irq, void *dev_id);
205extern int arch_setup_dmar_msi(unsigned int irq); 215extern int arch_setup_dmar_msi(unsigned int irq);
206 216
207#ifdef CONFIG_DMAR 217#ifdef CONFIG_INTEL_IOMMU
208extern int iommu_detected, no_iommu; 218extern int iommu_detected, no_iommu;
209extern struct list_head dmar_rmrr_units; 219extern struct list_head dmar_rmrr_units;
210struct dmar_rmrr_unit { 220struct dmar_rmrr_unit {
@@ -227,9 +237,26 @@ struct dmar_atsr_unit {
227 u8 include_all:1; /* include all ports */ 237 u8 include_all:1; /* include all ports */
228}; 238};
229 239
240int dmar_parse_rmrr_atsr_dev(void);
241extern int dmar_parse_one_rmrr(struct acpi_dmar_header *header);
242extern int dmar_parse_one_atsr(struct acpi_dmar_header *header);
243extern int dmar_parse_dev_scope(void *start, void *end, int *cnt,
244 struct pci_dev ***devices, u16 segment);
230extern int intel_iommu_init(void); 245extern int intel_iommu_init(void);
231#else /* !CONFIG_DMAR: */ 246#else /* !CONFIG_INTEL_IOMMU: */
232static inline int intel_iommu_init(void) { return -ENODEV; } 247static inline int intel_iommu_init(void) { return -ENODEV; }
233#endif /* CONFIG_DMAR */ 248static inline int dmar_parse_one_rmrr(struct acpi_dmar_header *header)
249{
250 return 0;
251}
252static inline int dmar_parse_one_atsr(struct acpi_dmar_header *header)
253{
254 return 0;
255}
256static inline int dmar_parse_rmrr_atsr_dev(void)
257{
258 return 0;
259}
260#endif /* CONFIG_INTEL_IOMMU */
234 261
235#endif /* __DMAR_H__ */ 262#endif /* __DMAR_H__ */
diff --git a/include/linux/drbd_tag_magic.h b/include/linux/drbd_tag_magic.h
index 069543190516..81f52f2c5724 100644
--- a/include/linux/drbd_tag_magic.h
+++ b/include/linux/drbd_tag_magic.h
@@ -28,7 +28,7 @@ enum packet_types {
28#define NL_STRING(pn, pr, member, len) \ 28#define NL_STRING(pn, pr, member, len) \
29 unsigned char member[len]; int member ## _len; \ 29 unsigned char member[len]; int member ## _len; \
30 int tag_and_len ## member; 30 int tag_and_len ## member;
31#include "linux/drbd_nl.h" 31#include <linux/drbd_nl.h>
32 32
33/* declare tag-list-sizes */ 33/* declare tag-list-sizes */
34static const int tag_list_sizes[] = { 34static const int tag_list_sizes[] = {
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
index 49638ea3b776..07261d52a6df 100644
--- a/include/linux/dw_apb_timer.h
+++ b/include/linux/dw_apb_timer.h
@@ -46,7 +46,7 @@ struct dw_apb_clock_event_device *
46dw_apb_clockevent_init(int cpu, const char *name, unsigned rating, 46dw_apb_clockevent_init(int cpu, const char *name, unsigned rating,
47 void __iomem *base, int irq, unsigned long freq); 47 void __iomem *base, int irq, unsigned long freq);
48struct dw_apb_clocksource * 48struct dw_apb_clocksource *
49dw_apb_clocksource_init(unsigned rating, char *name, void __iomem *base, 49dw_apb_clocksource_init(unsigned rating, const char *name, void __iomem *base,
50 unsigned long freq); 50 unsigned long freq);
51void dw_apb_clocksource_register(struct dw_apb_clocksource *dw_cs); 51void dw_apb_clocksource_register(struct dw_apb_clocksource *dw_cs);
52void dw_apb_clocksource_start(struct dw_apb_clocksource *dw_cs); 52void dw_apb_clocksource_start(struct dw_apb_clocksource *dw_cs);
diff --git a/include/linux/dynamic_debug.h b/include/linux/dynamic_debug.h
index e747ecd48e1c..13aae8087b56 100644
--- a/include/linux/dynamic_debug.h
+++ b/include/linux/dynamic_debug.h
@@ -1,13 +1,6 @@
1#ifndef _DYNAMIC_DEBUG_H 1#ifndef _DYNAMIC_DEBUG_H
2#define _DYNAMIC_DEBUG_H 2#define _DYNAMIC_DEBUG_H
3 3
4/* dynamic_printk_enabled, and dynamic_printk_enabled2 are bitmasks in which
5 * bit n is set to 1 if any modname hashes into the bucket n, 0 otherwise. They
6 * use independent hash functions, to reduce the chance of false positives.
7 */
8extern long long dynamic_debug_enabled;
9extern long long dynamic_debug_enabled2;
10
11/* 4/*
12 * An instance of this structure is created in a special 5 * An instance of this structure is created in a special
13 * ELF section at every dynamic debug callsite. At runtime, 6 * ELF section at every dynamic debug callsite. At runtime,
@@ -47,26 +40,55 @@ extern int ddebug_remove_module(const char *mod_name);
47extern int __dynamic_pr_debug(struct _ddebug *descriptor, const char *fmt, ...) 40extern int __dynamic_pr_debug(struct _ddebug *descriptor, const char *fmt, ...)
48 __attribute__ ((format (printf, 2, 3))); 41 __attribute__ ((format (printf, 2, 3)));
49 42
50#define dynamic_pr_debug(fmt, ...) do { \ 43struct device;
51 static struct _ddebug descriptor \ 44
52 __used \ 45extern int __dynamic_dev_dbg(struct _ddebug *descriptor,
53 __attribute__((section("__verbose"), aligned(8))) = \ 46 const struct device *dev,
54 { KBUILD_MODNAME, __func__, __FILE__, fmt, __LINE__, \ 47 const char *fmt, ...)
55 _DPRINTK_FLAGS_DEFAULT }; \ 48 __attribute__ ((format (printf, 3, 4)));
56 if (unlikely(descriptor.enabled)) \ 49
57 __dynamic_pr_debug(&descriptor, pr_fmt(fmt), ##__VA_ARGS__); \ 50struct net_device;
58 } while (0) 51
59 52extern int __dynamic_netdev_dbg(struct _ddebug *descriptor,
60 53 const struct net_device *dev,
61#define dynamic_dev_dbg(dev, fmt, ...) do { \ 54 const char *fmt, ...)
62 static struct _ddebug descriptor \ 55 __attribute__ ((format (printf, 3, 4)));
63 __used \ 56
64 __attribute__((section("__verbose"), aligned(8))) = \ 57#define DEFINE_DYNAMIC_DEBUG_METADATA(name, fmt) \
65 { KBUILD_MODNAME, __func__, __FILE__, fmt, __LINE__, \ 58 static struct _ddebug __used __aligned(8) \
66 _DPRINTK_FLAGS_DEFAULT }; \ 59 __attribute__((section("__verbose"))) name = { \
67 if (unlikely(descriptor.enabled)) \ 60 .modname = KBUILD_MODNAME, \
68 dev_printk(KERN_DEBUG, dev, fmt, ##__VA_ARGS__); \ 61 .function = __func__, \
69 } while (0) 62 .filename = __FILE__, \
63 .format = (fmt), \
64 .lineno = __LINE__, \
65 .flags = _DPRINTK_FLAGS_DEFAULT, \
66 .enabled = false, \
67 }
68
69#define dynamic_pr_debug(fmt, ...) \
70do { \
71 DEFINE_DYNAMIC_DEBUG_METADATA(descriptor, fmt); \
72 if (unlikely(descriptor.enabled)) \
73 __dynamic_pr_debug(&descriptor, pr_fmt(fmt), \
74 ##__VA_ARGS__); \
75} while (0)
76
77#define dynamic_dev_dbg(dev, fmt, ...) \
78do { \
79 DEFINE_DYNAMIC_DEBUG_METADATA(descriptor, fmt); \
80 if (unlikely(descriptor.enabled)) \
81 __dynamic_dev_dbg(&descriptor, dev, fmt, \
82 ##__VA_ARGS__); \
83} while (0)
84
85#define dynamic_netdev_dbg(dev, fmt, ...) \
86do { \
87 DEFINE_DYNAMIC_DEBUG_METADATA(descriptor, fmt); \
88 if (unlikely(descriptor.enabled)) \
89 __dynamic_netdev_dbg(&descriptor, dev, fmt, \
90 ##__VA_ARGS__); \
91} while (0)
70 92
71#else 93#else
72 94
diff --git a/include/linux/efi.h b/include/linux/efi.h
index ec2572693925..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>
@@ -232,6 +233,9 @@ typedef efi_status_t efi_query_capsule_caps_t(efi_capsule_header_t **capsules,
232#define UV_SYSTEM_TABLE_GUID \ 233#define UV_SYSTEM_TABLE_GUID \
233 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 )
234 235
236#define LINUX_EFI_CRASH_GUID \
237 EFI_GUID( 0xcfc8fc79, 0xbe2e, 0x4ddc, 0x97, 0xf0, 0x9f, 0x98, 0xbf, 0xe2, 0x98, 0xa0 )
238
235typedef struct { 239typedef struct {
236 efi_guid_t guid; 240 efi_guid_t guid;
237 unsigned long table; 241 unsigned long table;
@@ -458,6 +462,8 @@ struct efivars {
458 struct kset *kset; 462 struct kset *kset;
459 struct bin_attribute *new_var, *del_var; 463 struct bin_attribute *new_var, *del_var;
460 const struct efivar_operations *ops; 464 const struct efivar_operations *ops;
465 struct efivar_entry *walk_entry;
466 struct pstore_info efi_pstore_info;
461}; 467};
462 468
463int register_efivars(struct efivars *efivars, 469int register_efivars(struct efivars *efivars,
diff --git a/include/linux/ethtool.h b/include/linux/ethtool.h
index c6e427ab65fe..45f00b61c096 100644
--- a/include/linux/ethtool.h
+++ b/include/linux/ethtool.h
@@ -117,99 +117,101 @@ struct ethtool_eeprom {
117 __u8 data[0]; 117 __u8 data[0];
118}; 118};
119 119
120/* for configuring coalescing parameters of chip */ 120/**
121 * struct ethtool_coalesce - coalescing parameters for IRQs and stats updates
122 * @cmd: ETHTOOL_{G,S}COALESCE
123 * @rx_coalesce_usecs: How many usecs to delay an RX interrupt after
124 * a packet arrives.
125 * @rx_max_coalesced_frames: Maximum number of packets to receive
126 * before an RX interrupt.
127 * @rx_coalesce_usecs_irq: Same as @rx_coalesce_usecs, except that
128 * this value applies while an IRQ is being serviced by the host.
129 * @rx_max_coalesced_frames_irq: Same as @rx_max_coalesced_frames,
130 * except that this value applies while an IRQ is being serviced
131 * by the host.
132 * @tx_coalesce_usecs: How many usecs to delay a TX interrupt after
133 * a packet is sent.
134 * @tx_max_coalesced_frames: Maximum number of packets to be sent
135 * before a TX interrupt.
136 * @tx_coalesce_usecs_irq: Same as @tx_coalesce_usecs, except that
137 * this value applies while an IRQ is being serviced by the host.
138 * @tx_max_coalesced_frames_irq: Same as @tx_max_coalesced_frames,
139 * except that this value applies while an IRQ is being serviced
140 * by the host.
141 * @stats_block_coalesce_usecs: How many usecs to delay in-memory
142 * statistics block updates. Some drivers do not have an
143 * in-memory statistic block, and in such cases this value is
144 * ignored. This value must not be zero.
145 * @use_adaptive_rx_coalesce: Enable adaptive RX coalescing.
146 * @use_adaptive_tx_coalesce: Enable adaptive TX coalescing.
147 * @pkt_rate_low: Threshold for low packet rate (packets per second).
148 * @rx_coalesce_usecs_low: How many usecs to delay an RX interrupt after
149 * a packet arrives, when the packet rate is below @pkt_rate_low.
150 * @rx_max_coalesced_frames_low: Maximum number of packets to be received
151 * before an RX interrupt, when the packet rate is below @pkt_rate_low.
152 * @tx_coalesce_usecs_low: How many usecs to delay a TX interrupt after
153 * a packet is sent, when the packet rate is below @pkt_rate_low.
154 * @tx_max_coalesced_frames_low: Maximum nuumber of packets to be sent before
155 * a TX interrupt, when the packet rate is below @pkt_rate_low.
156 * @pkt_rate_high: Threshold for high packet rate (packets per second).
157 * @rx_coalesce_usecs_high: How many usecs to delay an RX interrupt after
158 * a packet arrives, when the packet rate is above @pkt_rate_high.
159 * @rx_max_coalesced_frames_high: Maximum number of packets to be received
160 * before an RX interrupt, when the packet rate is above @pkt_rate_high.
161 * @tx_coalesce_usecs_high: How many usecs to delay a TX interrupt after
162 * a packet is sent, when the packet rate is above @pkt_rate_high.
163 * @tx_max_coalesced_frames_high: Maximum number of packets to be sent before
164 * a TX interrupt, when the packet rate is above @pkt_rate_high.
165 * @rate_sample_interval: How often to do adaptive coalescing packet rate
166 * sampling, measured in seconds. Must not be zero.
167 *
168 * Each pair of (usecs, max_frames) fields specifies this exit
169 * condition for interrupt coalescing:
170 * (usecs > 0 && time_since_first_completion >= usecs) ||
171 * (max_frames > 0 && completed_frames >= max_frames)
172 * It is illegal to set both usecs and max_frames to zero as this
173 * would cause interrupts to never be generated. To disable
174 * coalescing, set usecs = 0 and max_frames = 1.
175 *
176 * Some implementations ignore the value of max_frames and use the
177 * condition:
178 * time_since_first_completion >= usecs
179 * This is deprecated. Drivers for hardware that does not support
180 * counting completions should validate that max_frames == !rx_usecs.
181 *
182 * Adaptive RX/TX coalescing is an algorithm implemented by some
183 * drivers to improve latency under low packet rates and improve
184 * throughput under high packet rates. Some drivers only implement
185 * one of RX or TX adaptive coalescing. Anything not implemented by
186 * the driver causes these values to be silently ignored.
187 *
188 * When the packet rate is below @pkt_rate_high but above
189 * @pkt_rate_low (both measured in packets per second) the
190 * normal {rx,tx}_* coalescing parameters are used.
191 */
121struct ethtool_coalesce { 192struct ethtool_coalesce {
122 __u32 cmd; /* ETHTOOL_{G,S}COALESCE */ 193 __u32 cmd;
123
124 /* How many usecs to delay an RX interrupt after
125 * a packet arrives. If 0, only rx_max_coalesced_frames
126 * is used.
127 */
128 __u32 rx_coalesce_usecs; 194 __u32 rx_coalesce_usecs;
129
130 /* How many packets to delay an RX interrupt after
131 * a packet arrives. If 0, only rx_coalesce_usecs is
132 * used. It is illegal to set both usecs and max frames
133 * to zero as this would cause RX interrupts to never be
134 * generated.
135 */
136 __u32 rx_max_coalesced_frames; 195 __u32 rx_max_coalesced_frames;
137
138 /* Same as above two parameters, except that these values
139 * apply while an IRQ is being serviced by the host. Not
140 * all cards support this feature and the values are ignored
141 * in that case.
142 */
143 __u32 rx_coalesce_usecs_irq; 196 __u32 rx_coalesce_usecs_irq;
144 __u32 rx_max_coalesced_frames_irq; 197 __u32 rx_max_coalesced_frames_irq;
145
146 /* How many usecs to delay a TX interrupt after
147 * a packet is sent. If 0, only tx_max_coalesced_frames
148 * is used.
149 */
150 __u32 tx_coalesce_usecs; 198 __u32 tx_coalesce_usecs;
151
152 /* How many packets to delay a TX interrupt after
153 * a packet is sent. If 0, only tx_coalesce_usecs is
154 * used. It is illegal to set both usecs and max frames
155 * to zero as this would cause TX interrupts to never be
156 * generated.
157 */
158 __u32 tx_max_coalesced_frames; 199 __u32 tx_max_coalesced_frames;
159
160 /* Same as above two parameters, except that these values
161 * apply while an IRQ is being serviced by the host. Not
162 * all cards support this feature and the values are ignored
163 * in that case.
164 */
165 __u32 tx_coalesce_usecs_irq; 200 __u32 tx_coalesce_usecs_irq;
166 __u32 tx_max_coalesced_frames_irq; 201 __u32 tx_max_coalesced_frames_irq;
167
168 /* How many usecs to delay in-memory statistics
169 * block updates. Some drivers do not have an in-memory
170 * statistic block, and in such cases this value is ignored.
171 * This value must not be zero.
172 */
173 __u32 stats_block_coalesce_usecs; 202 __u32 stats_block_coalesce_usecs;
174
175 /* Adaptive RX/TX coalescing is an algorithm implemented by
176 * some drivers to improve latency under low packet rates and
177 * improve throughput under high packet rates. Some drivers
178 * only implement one of RX or TX adaptive coalescing. Anything
179 * not implemented by the driver causes these values to be
180 * silently ignored.
181 */
182 __u32 use_adaptive_rx_coalesce; 203 __u32 use_adaptive_rx_coalesce;
183 __u32 use_adaptive_tx_coalesce; 204 __u32 use_adaptive_tx_coalesce;
184
185 /* When the packet rate (measured in packets per second)
186 * is below pkt_rate_low, the {rx,tx}_*_low parameters are
187 * used.
188 */
189 __u32 pkt_rate_low; 205 __u32 pkt_rate_low;
190 __u32 rx_coalesce_usecs_low; 206 __u32 rx_coalesce_usecs_low;
191 __u32 rx_max_coalesced_frames_low; 207 __u32 rx_max_coalesced_frames_low;
192 __u32 tx_coalesce_usecs_low; 208 __u32 tx_coalesce_usecs_low;
193 __u32 tx_max_coalesced_frames_low; 209 __u32 tx_max_coalesced_frames_low;
194
195 /* When the packet rate is below pkt_rate_high but above
196 * pkt_rate_low (both measured in packets per second) the
197 * normal {rx,tx}_* coalescing parameters are used.
198 */
199
200 /* When the packet rate is (measured in packets per second)
201 * is above pkt_rate_high, the {rx,tx}_*_high parameters are
202 * used.
203 */
204 __u32 pkt_rate_high; 210 __u32 pkt_rate_high;
205 __u32 rx_coalesce_usecs_high; 211 __u32 rx_coalesce_usecs_high;
206 __u32 rx_max_coalesced_frames_high; 212 __u32 rx_max_coalesced_frames_high;
207 __u32 tx_coalesce_usecs_high; 213 __u32 tx_coalesce_usecs_high;
208 __u32 tx_max_coalesced_frames_high; 214 __u32 tx_max_coalesced_frames_high;
209
210 /* How often to do adaptive coalescing packet rate sampling,
211 * measured in seconds. Must not be zero.
212 */
213 __u32 rate_sample_interval; 215 __u32 rate_sample_interval;
214}; 216};
215 217
@@ -444,7 +446,7 @@ struct ethtool_flow_ext {
444}; 446};
445 447
446/** 448/**
447 * struct ethtool_rx_flow_spec - specification for RX flow filter 449 * struct ethtool_rx_flow_spec - classification rule for RX flows
448 * @flow_type: Type of match to perform, e.g. %TCP_V4_FLOW 450 * @flow_type: Type of match to perform, e.g. %TCP_V4_FLOW
449 * @h_u: Flow fields to match (dependent on @flow_type) 451 * @h_u: Flow fields to match (dependent on @flow_type)
450 * @h_ext: Additional fields to match 452 * @h_ext: Additional fields to match
@@ -454,7 +456,9 @@ struct ethtool_flow_ext {
454 * includes the %FLOW_EXT flag. 456 * includes the %FLOW_EXT flag.
455 * @ring_cookie: RX ring/queue index to deliver to, or %RX_CLS_FLOW_DISC 457 * @ring_cookie: RX ring/queue index to deliver to, or %RX_CLS_FLOW_DISC
456 * if packets should be discarded 458 * if packets should be discarded
457 * @location: Index of filter in hardware table 459 * @location: Location of rule in the table. Locations must be
460 * numbered such that a flow matching multiple rules will be
461 * classified according to the first (lowest numbered) rule.
458 */ 462 */
459struct ethtool_rx_flow_spec { 463struct ethtool_rx_flow_spec {
460 __u32 flow_type; 464 __u32 flow_type;
@@ -473,9 +477,9 @@ struct ethtool_rx_flow_spec {
473 * %ETHTOOL_GRXCLSRLALL, %ETHTOOL_SRXCLSRLDEL or %ETHTOOL_SRXCLSRLINS 477 * %ETHTOOL_GRXCLSRLALL, %ETHTOOL_SRXCLSRLDEL or %ETHTOOL_SRXCLSRLINS
474 * @flow_type: Type of flow to be affected, e.g. %TCP_V4_FLOW 478 * @flow_type: Type of flow to be affected, e.g. %TCP_V4_FLOW
475 * @data: Command-dependent value 479 * @data: Command-dependent value
476 * @fs: Flow filter specification 480 * @fs: Flow classification rule
477 * @rule_cnt: Number of rules to be affected 481 * @rule_cnt: Number of rules to be affected
478 * @rule_locs: Array of valid rule indices 482 * @rule_locs: Array of used rule locations
479 * 483 *
480 * For %ETHTOOL_GRXFH and %ETHTOOL_SRXFH, @data is a bitmask indicating 484 * For %ETHTOOL_GRXFH and %ETHTOOL_SRXFH, @data is a bitmask indicating
481 * the fields included in the flow hash, e.g. %RXH_IP_SRC. The following 485 * the fields included in the flow hash, e.g. %RXH_IP_SRC. The following
@@ -487,23 +491,20 @@ struct ethtool_rx_flow_spec {
487 * For %ETHTOOL_GRXCLSRLCNT, @rule_cnt is set to the number of defined 491 * For %ETHTOOL_GRXCLSRLCNT, @rule_cnt is set to the number of defined
488 * rules on return. 492 * rules on return.
489 * 493 *
490 * For %ETHTOOL_GRXCLSRULE, @fs.@location specifies the index of an 494 * For %ETHTOOL_GRXCLSRULE, @fs.@location specifies the location of an
491 * existing filter rule on entry and @fs contains the rule on return. 495 * existing rule on entry and @fs contains the rule on return.
492 * 496 *
493 * For %ETHTOOL_GRXCLSRLALL, @rule_cnt specifies the array size of the 497 * For %ETHTOOL_GRXCLSRLALL, @rule_cnt specifies the array size of the
494 * user buffer for @rule_locs on entry. On return, @data is the size 498 * user buffer for @rule_locs on entry. On return, @data is the size
495 * of the filter table and @rule_locs contains the indices of the 499 * of the rule table, @rule_cnt is the number of defined rules, and
496 * defined rules. 500 * @rule_locs contains the locations of the defined rules. Drivers
501 * must use the second parameter to get_rxnfc() instead of @rule_locs.
497 * 502 *
498 * For %ETHTOOL_SRXCLSRLINS, @fs specifies the filter rule to add or 503 * For %ETHTOOL_SRXCLSRLINS, @fs specifies the rule to add or update.
499 * update. @fs.@location specifies the index to use and must not be 504 * @fs.@location specifies the location to use and must not be ignored.
500 * ignored.
501 * 505 *
502 * For %ETHTOOL_SRXCLSRLDEL, @fs.@location specifies the index of an 506 * For %ETHTOOL_SRXCLSRLDEL, @fs.@location specifies the location of an
503 * existing filter rule on entry. 507 * existing rule on entry.
504 *
505 * Implementation of indexed classification rules generally requires a
506 * TCAM.
507 */ 508 */
508struct ethtool_rxnfc { 509struct ethtool_rxnfc {
509 __u32 cmd; 510 __u32 cmd;
@@ -726,6 +727,9 @@ enum ethtool_sfeatures_retval_bits {
726/* needed by dev_disable_lro() */ 727/* needed by dev_disable_lro() */
727extern int __ethtool_set_flags(struct net_device *dev, u32 flags); 728extern int __ethtool_set_flags(struct net_device *dev, u32 flags);
728 729
730extern int __ethtool_get_settings(struct net_device *dev,
731 struct ethtool_cmd *cmd);
732
729/** 733/**
730 * enum ethtool_phys_id_state - indicator state for physical identification 734 * enum ethtool_phys_id_state - indicator state for physical identification
731 * @ETHTOOL_ID_INACTIVE: Physical ID indicator should be deactivated 735 * @ETHTOOL_ID_INACTIVE: Physical ID indicator should be deactivated
@@ -936,7 +940,7 @@ struct ethtool_ops {
936 int (*set_priv_flags)(struct net_device *, u32); 940 int (*set_priv_flags)(struct net_device *, u32);
937 int (*get_sset_count)(struct net_device *, int); 941 int (*get_sset_count)(struct net_device *, int);
938 int (*get_rxnfc)(struct net_device *, 942 int (*get_rxnfc)(struct net_device *,
939 struct ethtool_rxnfc *, void *); 943 struct ethtool_rxnfc *, u32 *rule_locs);
940 int (*set_rxnfc)(struct net_device *, struct ethtool_rxnfc *); 944 int (*set_rxnfc)(struct net_device *, struct ethtool_rxnfc *);
941 int (*flash_device)(struct net_device *, struct ethtool_flash *); 945 int (*flash_device)(struct net_device *, struct ethtool_flash *);
942 int (*reset)(struct net_device *, u32 *); 946 int (*reset)(struct net_device *, u32 *);
diff --git a/include/linux/evm.h b/include/linux/evm.h
new file mode 100644
index 000000000000..9fc13a760928
--- /dev/null
+++ b/include/linux/evm.h
@@ -0,0 +1,100 @@
1/*
2 * evm.h
3 *
4 * Copyright (c) 2009 IBM Corporation
5 * Author: Mimi Zohar <zohar@us.ibm.com>
6 */
7
8#ifndef _LINUX_EVM_H
9#define _LINUX_EVM_H
10
11#include <linux/integrity.h>
12#include <linux/xattr.h>
13
14struct integrity_iint_cache;
15
16#ifdef CONFIG_EVM
17extern enum integrity_status evm_verifyxattr(struct dentry *dentry,
18 const char *xattr_name,
19 void *xattr_value,
20 size_t xattr_value_len,
21 struct integrity_iint_cache *iint);
22extern int evm_inode_setattr(struct dentry *dentry, struct iattr *attr);
23extern void evm_inode_post_setattr(struct dentry *dentry, int ia_valid);
24extern int evm_inode_setxattr(struct dentry *dentry, const char *name,
25 const void *value, size_t size);
26extern void evm_inode_post_setxattr(struct dentry *dentry,
27 const char *xattr_name,
28 const void *xattr_value,
29 size_t xattr_value_len);
30extern int evm_inode_removexattr(struct dentry *dentry, const char *xattr_name);
31extern void evm_inode_post_removexattr(struct dentry *dentry,
32 const char *xattr_name);
33extern int evm_inode_init_security(struct inode *inode,
34 const struct xattr *xattr_array,
35 struct xattr *evm);
36#ifdef CONFIG_FS_POSIX_ACL
37extern int posix_xattr_acl(const char *xattrname);
38#else
39static inline int posix_xattr_acl(const char *xattrname)
40{
41 return 0;
42}
43#endif
44#else
45#ifdef CONFIG_INTEGRITY
46static inline enum integrity_status evm_verifyxattr(struct dentry *dentry,
47 const char *xattr_name,
48 void *xattr_value,
49 size_t xattr_value_len,
50 struct integrity_iint_cache *iint)
51{
52 return INTEGRITY_UNKNOWN;
53}
54#endif
55
56static inline int evm_inode_setattr(struct dentry *dentry, struct iattr *attr)
57{
58 return 0;
59}
60
61static inline void evm_inode_post_setattr(struct dentry *dentry, int ia_valid)
62{
63 return;
64}
65
66static inline int evm_inode_setxattr(struct dentry *dentry, const char *name,
67 const void *value, size_t size)
68{
69 return 0;
70}
71
72static inline void evm_inode_post_setxattr(struct dentry *dentry,
73 const char *xattr_name,
74 const void *xattr_value,
75 size_t xattr_value_len)
76{
77 return;
78}
79
80static inline int evm_inode_removexattr(struct dentry *dentry,
81 const char *xattr_name)
82{
83 return 0;
84}
85
86static inline void evm_inode_post_removexattr(struct dentry *dentry,
87 const char *xattr_name)
88{
89 return;
90}
91
92static inline int evm_inode_init_security(struct inode *inode,
93 const struct xattr *xattr_array,
94 struct xattr *evm)
95{
96 return 0;
97}
98
99#endif /* CONFIG_EVM_H */
100#endif /* LINUX_EVM_H */
diff --git a/include/linux/fault-inject.h b/include/linux/fault-inject.h
index 3ff060ac7810..c6f996f2abb6 100644
--- a/include/linux/fault-inject.h
+++ b/include/linux/fault-inject.h
@@ -25,10 +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 struct dentry *dir;
31#endif
32}; 28};
33 29
34#define FAULT_ATTR_INITIALIZER { \ 30#define FAULT_ATTR_INITIALIZER { \
@@ -45,19 +41,15 @@ bool should_fail(struct fault_attr *attr, ssize_t size);
45 41
46#ifdef CONFIG_FAULT_INJECTION_DEBUG_FS 42#ifdef CONFIG_FAULT_INJECTION_DEBUG_FS
47 43
48int init_fault_attr_dentries(struct fault_attr *attr, const char *name); 44struct dentry *fault_create_debugfs_attr(const char *name,
49void cleanup_fault_attr_dentries(struct fault_attr *attr); 45 struct dentry *parent, struct fault_attr *attr);
50 46
51#else /* CONFIG_FAULT_INJECTION_DEBUG_FS */ 47#else /* CONFIG_FAULT_INJECTION_DEBUG_FS */
52 48
53static inline int init_fault_attr_dentries(struct fault_attr *attr, 49static inline struct dentry *fault_create_debugfs_attr(const char *name,
54 const char *name) 50 struct dentry *parent, struct fault_attr *attr)
55{
56 return -ENODEV;
57}
58
59static inline void cleanup_fault_attr_dentries(struct fault_attr *attr)
60{ 51{
52 return ERR_PTR(-ENODEV);
61} 53}
62 54
63#endif /* CONFIG_FAULT_INJECTION_DEBUG_FS */ 55#endif /* CONFIG_FAULT_INJECTION_DEBUG_FS */
diff --git a/include/linux/filter.h b/include/linux/filter.h
index 741956fa5bfd..8eeb205f298b 100644
--- a/include/linux/filter.h
+++ b/include/linux/filter.h
@@ -155,7 +155,7 @@ extern unsigned int sk_run_filter(const struct sk_buff *skb,
155 const struct sock_filter *filter); 155 const struct sock_filter *filter);
156extern int sk_attach_filter(struct sock_fprog *fprog, struct sock *sk); 156extern int sk_attach_filter(struct sock_fprog *fprog, struct sock *sk);
157extern int sk_detach_filter(struct sock *sk); 157extern int sk_detach_filter(struct sock *sk);
158extern int sk_chk_filter(struct sock_filter *filter, int flen); 158extern int sk_chk_filter(struct sock_filter *filter, unsigned int flen);
159 159
160#ifdef CONFIG_BPF_JIT 160#ifdef CONFIG_BPF_JIT
161extern void bpf_jit_compile(struct sk_filter *fp); 161extern void bpf_jit_compile(struct sk_filter *fp);
diff --git a/include/linux/freezer.h b/include/linux/freezer.h
index 1effc8b56b4e..aa56cf31f7ff 100644
--- a/include/linux/freezer.h
+++ b/include/linux/freezer.h
@@ -49,6 +49,7 @@ extern int thaw_process(struct task_struct *p);
49 49
50extern void refrigerator(void); 50extern void refrigerator(void);
51extern int freeze_processes(void); 51extern int freeze_processes(void);
52extern int freeze_kernel_threads(void);
52extern void thaw_processes(void); 53extern void thaw_processes(void);
53 54
54static inline int try_to_freeze(void) 55static inline int try_to_freeze(void)
@@ -171,7 +172,8 @@ static inline void clear_freeze_flag(struct task_struct *p) {}
171static inline int thaw_process(struct task_struct *p) { return 1; } 172static inline int thaw_process(struct task_struct *p) { return 1; }
172 173
173static inline void refrigerator(void) {} 174static inline void refrigerator(void) {}
174static inline int freeze_processes(void) { BUG(); return 0; } 175static inline int freeze_processes(void) { return -ENOSYS; }
176static inline int freeze_kernel_threads(void) { return -ENOSYS; }
175static inline void thaw_processes(void) {} 177static inline void thaw_processes(void) {}
176 178
177static inline int try_to_freeze(void) { return 0; } 179static inline int try_to_freeze(void) { return 0; }
diff --git a/include/linux/fs.h b/include/linux/fs.h
index f23bcb77260c..ba98668a1826 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -162,10 +162,8 @@ struct inodes_stat_t {
162#define READA RWA_MASK 162#define READA RWA_MASK
163 163
164#define READ_SYNC (READ | REQ_SYNC) 164#define READ_SYNC (READ | REQ_SYNC)
165#define READ_META (READ | REQ_META)
166#define WRITE_SYNC (WRITE | REQ_SYNC | REQ_NOIDLE) 165#define WRITE_SYNC (WRITE | REQ_SYNC | REQ_NOIDLE)
167#define WRITE_ODIRECT (WRITE | REQ_SYNC) 166#define WRITE_ODIRECT (WRITE | REQ_SYNC)
168#define WRITE_META (WRITE | REQ_META)
169#define WRITE_FLUSH (WRITE | REQ_SYNC | REQ_NOIDLE | REQ_FLUSH) 167#define WRITE_FLUSH (WRITE | REQ_SYNC | REQ_NOIDLE | REQ_FLUSH)
170#define WRITE_FUA (WRITE | REQ_SYNC | REQ_NOIDLE | REQ_FUA) 168#define WRITE_FUA (WRITE | REQ_SYNC | REQ_NOIDLE | REQ_FUA)
171#define WRITE_FLUSH_FUA (WRITE | REQ_SYNC | REQ_NOIDLE | REQ_FLUSH | REQ_FUA) 169#define WRITE_FLUSH_FUA (WRITE | REQ_SYNC | REQ_NOIDLE | REQ_FLUSH | REQ_FUA)
@@ -738,22 +736,54 @@ static inline int mapping_writably_mapped(struct address_space *mapping)
738struct posix_acl; 736struct posix_acl;
739#define ACL_NOT_CACHED ((void *)(-1)) 737#define ACL_NOT_CACHED ((void *)(-1))
740 738
739#define IOP_FASTPERM 0x0001
740#define IOP_LOOKUP 0x0002
741#define IOP_NOFOLLOW 0x0004
742
743/*
744 * Keep mostly read-only and often accessed (especially for
745 * the RCU path lookup and 'stat' data) fields at the beginning
746 * of the 'struct inode'
747 */
741struct inode { 748struct inode {
742 /* RCU path lookup touches following: */
743 umode_t i_mode; 749 umode_t i_mode;
750 unsigned short i_opflags;
744 uid_t i_uid; 751 uid_t i_uid;
745 gid_t i_gid; 752 gid_t i_gid;
753 unsigned int i_flags;
754
755#ifdef CONFIG_FS_POSIX_ACL
756 struct posix_acl *i_acl;
757 struct posix_acl *i_default_acl;
758#endif
759
746 const struct inode_operations *i_op; 760 const struct inode_operations *i_op;
747 struct super_block *i_sb; 761 struct super_block *i_sb;
762 struct address_space *i_mapping;
748 763
749 spinlock_t i_lock; /* i_blocks, i_bytes, maybe i_size */
750 unsigned int i_flags;
751 unsigned long i_state;
752#ifdef CONFIG_SECURITY 764#ifdef CONFIG_SECURITY
753 void *i_security; 765 void *i_security;
754#endif 766#endif
755 struct mutex i_mutex;
756 767
768 /* Stat data, not accessed from path walking */
769 unsigned long i_ino;
770 unsigned int i_nlink;
771 dev_t i_rdev;
772 loff_t i_size;
773 struct timespec i_atime;
774 struct timespec i_mtime;
775 struct timespec i_ctime;
776 unsigned int i_blkbits;
777 blkcnt_t i_blocks;
778
779#ifdef __NEED_I_SIZE_ORDERED
780 seqcount_t i_size_seqcount;
781#endif
782
783 /* Misc */
784 unsigned long i_state;
785 spinlock_t i_lock; /* i_blocks, i_bytes, maybe i_size */
786 struct mutex i_mutex;
757 787
758 unsigned long dirtied_when; /* jiffies of first dirtying */ 788 unsigned long dirtied_when; /* jiffies of first dirtying */
759 789
@@ -765,25 +795,12 @@ struct inode {
765 struct list_head i_dentry; 795 struct list_head i_dentry;
766 struct rcu_head i_rcu; 796 struct rcu_head i_rcu;
767 }; 797 };
768 unsigned long i_ino;
769 atomic_t i_count; 798 atomic_t i_count;
770 unsigned int i_nlink;
771 dev_t i_rdev;
772 unsigned int i_blkbits;
773 u64 i_version; 799 u64 i_version;
774 loff_t i_size;
775#ifdef __NEED_I_SIZE_ORDERED
776 seqcount_t i_size_seqcount;
777#endif
778 struct timespec i_atime;
779 struct timespec i_mtime;
780 struct timespec i_ctime;
781 blkcnt_t i_blocks;
782 unsigned short i_bytes; 800 unsigned short i_bytes;
783 atomic_t i_dio_count; 801 atomic_t i_dio_count;
784 const struct file_operations *i_fop; /* former ->i_op->default_file_ops */ 802 const struct file_operations *i_fop; /* former ->i_op->default_file_ops */
785 struct file_lock *i_flock; 803 struct file_lock *i_flock;
786 struct address_space *i_mapping;
787 struct address_space i_data; 804 struct address_space i_data;
788#ifdef CONFIG_QUOTA 805#ifdef CONFIG_QUOTA
789 struct dquot *i_dquot[MAXQUOTAS]; 806 struct dquot *i_dquot[MAXQUOTAS];
@@ -806,10 +823,6 @@ struct inode {
806 atomic_t i_readcount; /* struct files open RO */ 823 atomic_t i_readcount; /* struct files open RO */
807#endif 824#endif
808 atomic_t i_writecount; 825 atomic_t i_writecount;
809#ifdef CONFIG_FS_POSIX_ACL
810 struct posix_acl *i_acl;
811 struct posix_acl *i_default_acl;
812#endif
813 void *i_private; /* fs or device private pointer */ 826 void *i_private; /* fs or device private pointer */
814}; 827};
815 828
@@ -1050,6 +1063,8 @@ static inline int file_check_writeable(struct file *filp)
1050#define FL_LEASE 32 /* lease held on this file */ 1063#define FL_LEASE 32 /* lease held on this file */
1051#define FL_CLOSE 64 /* unlock on close */ 1064#define FL_CLOSE 64 /* unlock on close */
1052#define FL_SLEEP 128 /* A blocking lock */ 1065#define FL_SLEEP 128 /* A blocking lock */
1066#define FL_DOWNGRADE_PENDING 256 /* Lease is being downgraded */
1067#define FL_UNLOCK_PENDING 512 /* Lease is being broken */
1053 1068
1054/* 1069/*
1055 * Special return value from posix_lock_file() and vfs_lock_file() for 1070 * Special return value from posix_lock_file() and vfs_lock_file() for
@@ -1096,7 +1111,7 @@ struct file_lock {
1096 struct list_head fl_link; /* doubly linked list of all locks */ 1111 struct list_head fl_link; /* doubly linked list of all locks */
1097 struct list_head fl_block; /* circular list of blocked processes */ 1112 struct list_head fl_block; /* circular list of blocked processes */
1098 fl_owner_t fl_owner; 1113 fl_owner_t fl_owner;
1099 unsigned char fl_flags; 1114 unsigned int fl_flags;
1100 unsigned char fl_type; 1115 unsigned char fl_type;
1101 unsigned int fl_pid; 1116 unsigned int fl_pid;
1102 struct pid *fl_nspid; 1117 struct pid *fl_nspid;
@@ -1106,7 +1121,9 @@ struct file_lock {
1106 loff_t fl_end; 1121 loff_t fl_end;
1107 1122
1108 struct fasync_struct * fl_fasync; /* for lease break notifications */ 1123 struct fasync_struct * fl_fasync; /* for lease break notifications */
1109 unsigned long fl_break_time; /* for nonblocking lease breaks */ 1124 /* for lease breaks: */
1125 unsigned long fl_break_time;
1126 unsigned long fl_downgrade_time;
1110 1127
1111 const struct file_lock_operations *fl_ops; /* Callbacks for filesystems */ 1128 const struct file_lock_operations *fl_ops; /* Callbacks for filesystems */
1112 const struct lock_manager_operations *fl_lmops; /* Callbacks for lockmanagers */ 1129 const struct lock_manager_operations *fl_lmops; /* Callbacks for lockmanagers */
@@ -2303,6 +2320,11 @@ extern struct inode * iget5_locked(struct super_block *, unsigned long, int (*te
2303extern struct inode * iget_locked(struct super_block *, unsigned long); 2320extern struct inode * iget_locked(struct super_block *, unsigned long);
2304extern int insert_inode_locked4(struct inode *, unsigned long, int (*test)(struct inode *, void *), void *); 2321extern int insert_inode_locked4(struct inode *, unsigned long, int (*test)(struct inode *, void *), void *);
2305extern int insert_inode_locked(struct inode *); 2322extern int insert_inode_locked(struct inode *);
2323#ifdef CONFIG_DEBUG_LOCK_ALLOC
2324extern void lockdep_annotate_inode_mutex_key(struct inode *inode);
2325#else
2326static inline void lockdep_annotate_inode_mutex_key(struct inode *inode) { };
2327#endif
2306extern void unlock_new_inode(struct inode *); 2328extern void unlock_new_inode(struct inode *);
2307extern unsigned int get_next_ino(void); 2329extern unsigned int get_next_ino(void);
2308 2330
@@ -2317,11 +2339,18 @@ extern int should_remove_suid(struct dentry *);
2317extern int file_remove_suid(struct file *); 2339extern int file_remove_suid(struct file *);
2318 2340
2319extern void __insert_inode_hash(struct inode *, unsigned long hashval); 2341extern void __insert_inode_hash(struct inode *, unsigned long hashval);
2320extern void remove_inode_hash(struct inode *);
2321static inline void insert_inode_hash(struct inode *inode) 2342static inline void insert_inode_hash(struct inode *inode)
2322{ 2343{
2323 __insert_inode_hash(inode, inode->i_ino); 2344 __insert_inode_hash(inode, inode->i_ino);
2324} 2345}
2346
2347extern void __remove_inode_hash(struct inode *);
2348static inline void remove_inode_hash(struct inode *inode)
2349{
2350 if (!inode_unhashed(inode))
2351 __remove_inode_hash(inode);
2352}
2353
2325extern void inode_sb_list_add(struct inode *inode); 2354extern void inode_sb_list_add(struct inode *inode);
2326 2355
2327#ifdef CONFIG_BLOCK 2356#ifdef CONFIG_BLOCK
diff --git a/include/linux/fuse.h b/include/linux/fuse.h
index d464de53db43..464cff526860 100644
--- a/include/linux/fuse.h
+++ b/include/linux/fuse.h
@@ -47,6 +47,9 @@
47 * - FUSE_IOCTL_UNRESTRICTED shall now return with array of 'struct 47 * - FUSE_IOCTL_UNRESTRICTED shall now return with array of 'struct
48 * fuse_ioctl_iovec' instead of ambiguous 'struct iovec' 48 * fuse_ioctl_iovec' instead of ambiguous 'struct iovec'
49 * - add FUSE_IOCTL_32BIT flag 49 * - add FUSE_IOCTL_32BIT flag
50 *
51 * 7.17
52 * - add FUSE_FLOCK_LOCKS and FUSE_RELEASE_FLOCK_UNLOCK
50 */ 53 */
51 54
52#ifndef _LINUX_FUSE_H 55#ifndef _LINUX_FUSE_H
@@ -78,7 +81,7 @@
78#define FUSE_KERNEL_VERSION 7 81#define FUSE_KERNEL_VERSION 7
79 82
80/** Minor version number of this interface */ 83/** Minor version number of this interface */
81#define FUSE_KERNEL_MINOR_VERSION 16 84#define FUSE_KERNEL_MINOR_VERSION 17
82 85
83/** The node ID of the root inode */ 86/** The node ID of the root inode */
84#define FUSE_ROOT_ID 1 87#define FUSE_ROOT_ID 1
@@ -153,8 +156,10 @@ struct fuse_file_lock {
153/** 156/**
154 * INIT request/reply flags 157 * INIT request/reply flags
155 * 158 *
159 * FUSE_POSIX_LOCKS: remote locking for POSIX file locks
156 * FUSE_EXPORT_SUPPORT: filesystem handles lookups of "." and ".." 160 * FUSE_EXPORT_SUPPORT: filesystem handles lookups of "." and ".."
157 * FUSE_DONT_MASK: don't apply umask to file mode on create operations 161 * FUSE_DONT_MASK: don't apply umask to file mode on create operations
162 * FUSE_FLOCK_LOCKS: remote locking for BSD style file locks
158 */ 163 */
159#define FUSE_ASYNC_READ (1 << 0) 164#define FUSE_ASYNC_READ (1 << 0)
160#define FUSE_POSIX_LOCKS (1 << 1) 165#define FUSE_POSIX_LOCKS (1 << 1)
@@ -163,6 +168,7 @@ struct fuse_file_lock {
163#define FUSE_EXPORT_SUPPORT (1 << 4) 168#define FUSE_EXPORT_SUPPORT (1 << 4)
164#define FUSE_BIG_WRITES (1 << 5) 169#define FUSE_BIG_WRITES (1 << 5)
165#define FUSE_DONT_MASK (1 << 6) 170#define FUSE_DONT_MASK (1 << 6)
171#define FUSE_FLOCK_LOCKS (1 << 10)
166 172
167/** 173/**
168 * CUSE INIT request/reply flags 174 * CUSE INIT request/reply flags
@@ -175,6 +181,7 @@ struct fuse_file_lock {
175 * Release flags 181 * Release flags
176 */ 182 */
177#define FUSE_RELEASE_FLUSH (1 << 0) 183#define FUSE_RELEASE_FLUSH (1 << 0)
184#define FUSE_RELEASE_FLOCK_UNLOCK (1 << 1)
178 185
179/** 186/**
180 * Getattr flags 187 * Getattr flags
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/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/hash.h b/include/linux/hash.h
index 06d25c189cc5..b80506bdd733 100644
--- a/include/linux/hash.h
+++ b/include/linux/hash.h
@@ -63,7 +63,7 @@ static inline u32 hash_32(u32 val, unsigned int bits)
63 return hash >> (32 - bits); 63 return hash >> (32 - bits);
64} 64}
65 65
66static inline unsigned long hash_ptr(void *ptr, unsigned int bits) 66static inline unsigned long hash_ptr(const void *ptr, unsigned int bits)
67{ 67{
68 return hash_long((unsigned long)ptr, bits); 68 return hash_long((unsigned long)ptr, bits);
69} 69}
diff --git a/include/linux/hid.h b/include/linux/hid.h
index 9cf8e7ae7450..deed5f9a1e1c 100644
--- a/include/linux/hid.h
+++ b/include/linux/hid.h
@@ -71,6 +71,7 @@
71#include <linux/timer.h> 71#include <linux/timer.h>
72#include <linux/workqueue.h> 72#include <linux/workqueue.h>
73#include <linux/input.h> 73#include <linux/input.h>
74#include <linux/semaphore.h>
74 75
75/* 76/*
76 * We parse each description item into this structure. Short items data 77 * We parse each description item into this structure. Short items data
@@ -312,6 +313,7 @@ struct hid_item {
312#define HID_QUIRK_BADPAD 0x00000020 313#define HID_QUIRK_BADPAD 0x00000020
313#define HID_QUIRK_MULTI_INPUT 0x00000040 314#define HID_QUIRK_MULTI_INPUT 0x00000040
314#define HID_QUIRK_HIDINPUT_FORCE 0x00000080 315#define HID_QUIRK_HIDINPUT_FORCE 0x00000080
316#define HID_QUIRK_MULTITOUCH 0x00000100
315#define HID_QUIRK_SKIP_OUTPUT_REPORTS 0x00010000 317#define HID_QUIRK_SKIP_OUTPUT_REPORTS 0x00010000
316#define HID_QUIRK_FULLSPEED_INTERVAL 0x10000000 318#define HID_QUIRK_FULLSPEED_INTERVAL 0x10000000
317#define HID_QUIRK_NO_INIT_REPORTS 0x20000000 319#define HID_QUIRK_NO_INIT_REPORTS 0x20000000
@@ -475,6 +477,7 @@ struct hid_device { /* device report descriptor */
475 unsigned country; /* HID country */ 477 unsigned country; /* HID country */
476 struct hid_report_enum report_enum[HID_REPORT_TYPES]; 478 struct hid_report_enum report_enum[HID_REPORT_TYPES];
477 479
480 struct semaphore driver_lock; /* protects the current driver */
478 struct device dev; /* device */ 481 struct device dev; /* device */
479 struct hid_driver *driver; 482 struct hid_driver *driver;
480 struct hid_ll_driver *ll_driver; 483 struct hid_ll_driver *ll_driver;
diff --git a/include/linux/hyperv.h b/include/linux/hyperv.h
new file mode 100644
index 000000000000..12ec328481de
--- /dev/null
+++ b/include/linux/hyperv.h
@@ -0,0 +1,873 @@
1/*
2 *
3 * Copyright (c) 2011, Microsoft Corporation.
4 *
5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms and conditions of the GNU General Public License,
7 * version 2, as published by the Free Software Foundation.
8 *
9 * This program is distributed in the hope it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
12 * more details.
13 *
14 * You should have received a copy of the GNU General Public License along with
15 * this program; if not, write to the Free Software Foundation, Inc., 59 Temple
16 * Place - Suite 330, Boston, MA 02111-1307 USA.
17 *
18 * Authors:
19 * Haiyang Zhang <haiyangz@microsoft.com>
20 * Hank Janssen <hjanssen@microsoft.com>
21 * K. Y. Srinivasan <kys@microsoft.com>
22 *
23 */
24
25#ifndef _HYPERV_H
26#define _HYPERV_H
27
28#include <linux/scatterlist.h>
29#include <linux/list.h>
30#include <linux/uuid.h>
31#include <linux/timer.h>
32#include <linux/workqueue.h>
33#include <linux/completion.h>
34#include <linux/device.h>
35#include <linux/mod_devicetable.h>
36
37
38#define MAX_PAGE_BUFFER_COUNT 16
39#define MAX_MULTIPAGE_BUFFER_COUNT 32 /* 128K */
40
41#pragma pack(push, 1)
42
43/* Single-page buffer */
44struct hv_page_buffer {
45 u32 len;
46 u32 offset;
47 u64 pfn;
48};
49
50/* Multiple-page buffer */
51struct hv_multipage_buffer {
52 /* Length and Offset determines the # of pfns in the array */
53 u32 len;
54 u32 offset;
55 u64 pfn_array[MAX_MULTIPAGE_BUFFER_COUNT];
56};
57
58/* 0x18 includes the proprietary packet header */
59#define MAX_PAGE_BUFFER_PACKET (0x18 + \
60 (sizeof(struct hv_page_buffer) * \
61 MAX_PAGE_BUFFER_COUNT))
62#define MAX_MULTIPAGE_BUFFER_PACKET (0x18 + \
63 sizeof(struct hv_multipage_buffer))
64
65
66#pragma pack(pop)
67
68struct hv_ring_buffer {
69 /* Offset in bytes from the start of ring data below */
70 u32 write_index;
71
72 /* Offset in bytes from the start of ring data below */
73 u32 read_index;
74
75 u32 interrupt_mask;
76
77 /* Pad it to PAGE_SIZE so that data starts on page boundary */
78 u8 reserved[4084];
79
80 /* NOTE:
81 * The interrupt_mask field is used only for channels but since our
82 * vmbus connection also uses this data structure and its data starts
83 * here, we commented out this field.
84 */
85
86 /*
87 * Ring data starts here + RingDataStartOffset
88 * !!! DO NOT place any fields below this !!!
89 */
90 u8 buffer[0];
91} __packed;
92
93struct hv_ring_buffer_info {
94 struct hv_ring_buffer *ring_buffer;
95 u32 ring_size; /* Include the shared header */
96 spinlock_t ring_lock;
97
98 u32 ring_datasize; /* < ring_size */
99 u32 ring_data_startoffset;
100};
101
102struct hv_ring_buffer_debug_info {
103 u32 current_interrupt_mask;
104 u32 current_read_index;
105 u32 current_write_index;
106 u32 bytes_avail_toread;
107 u32 bytes_avail_towrite;
108};
109
110/*
111 * We use the same version numbering for all Hyper-V modules.
112 *
113 * Definition of versioning is as follows;
114 *
115 * Major Number Changes for these scenarios;
116 * 1. When a new version of Windows Hyper-V
117 * is released.
118 * 2. A Major change has occurred in the
119 * Linux IC's.
120 * (For example the merge for the first time
121 * into the kernel) Every time the Major Number
122 * changes, the Revision number is reset to 0.
123 * Minor Number Changes when new functionality is added
124 * to the Linux IC's that is not a bug fix.
125 *
126 * 3.1 - Added completed hv_utils driver. Shutdown/Heartbeat/Timesync
127 */
128#define HV_DRV_VERSION "3.1"
129
130
131/*
132 * A revision number of vmbus that is used for ensuring both ends on a
133 * partition are using compatible versions.
134 */
135#define VMBUS_REVISION_NUMBER 13
136
137/* Make maximum size of pipe payload of 16K */
138#define MAX_PIPE_DATA_PAYLOAD (sizeof(u8) * 16384)
139
140/* Define PipeMode values. */
141#define VMBUS_PIPE_TYPE_BYTE 0x00000000
142#define VMBUS_PIPE_TYPE_MESSAGE 0x00000004
143
144/* The size of the user defined data buffer for non-pipe offers. */
145#define MAX_USER_DEFINED_BYTES 120
146
147/* The size of the user defined data buffer for pipe offers. */
148#define MAX_PIPE_USER_DEFINED_BYTES 116
149
150/*
151 * At the center of the Channel Management library is the Channel Offer. This
152 * struct contains the fundamental information about an offer.
153 */
154struct vmbus_channel_offer {
155 uuid_le if_type;
156 uuid_le if_instance;
157 u64 int_latency; /* in 100ns units */
158 u32 if_revision;
159 u32 server_ctx_size; /* in bytes */
160 u16 chn_flags;
161 u16 mmio_megabytes; /* in bytes * 1024 * 1024 */
162
163 union {
164 /* Non-pipes: The user has MAX_USER_DEFINED_BYTES bytes. */
165 struct {
166 unsigned char user_def[MAX_USER_DEFINED_BYTES];
167 } std;
168
169 /*
170 * Pipes:
171 * The following sructure is an integrated pipe protocol, which
172 * is implemented on top of standard user-defined data. Pipe
173 * clients have MAX_PIPE_USER_DEFINED_BYTES left for their own
174 * use.
175 */
176 struct {
177 u32 pipe_mode;
178 unsigned char user_def[MAX_PIPE_USER_DEFINED_BYTES];
179 } pipe;
180 } u;
181 u32 padding;
182} __packed;
183
184/* Server Flags */
185#define VMBUS_CHANNEL_ENUMERATE_DEVICE_INTERFACE 1
186#define VMBUS_CHANNEL_SERVER_SUPPORTS_TRANSFER_PAGES 2
187#define VMBUS_CHANNEL_SERVER_SUPPORTS_GPADLS 4
188#define VMBUS_CHANNEL_NAMED_PIPE_MODE 0x10
189#define VMBUS_CHANNEL_LOOPBACK_OFFER 0x100
190#define VMBUS_CHANNEL_PARENT_OFFER 0x200
191#define VMBUS_CHANNEL_REQUEST_MONITORED_NOTIFICATION 0x400
192
193struct vmpacket_descriptor {
194 u16 type;
195 u16 offset8;
196 u16 len8;
197 u16 flags;
198 u64 trans_id;
199} __packed;
200
201struct vmpacket_header {
202 u32 prev_pkt_start_offset;
203 struct vmpacket_descriptor descriptor;
204} __packed;
205
206struct vmtransfer_page_range {
207 u32 byte_count;
208 u32 byte_offset;
209} __packed;
210
211struct vmtransfer_page_packet_header {
212 struct vmpacket_descriptor d;
213 u16 xfer_pageset_id;
214 bool sender_owns_set;
215 u8 reserved;
216 u32 range_cnt;
217 struct vmtransfer_page_range ranges[1];
218} __packed;
219
220struct vmgpadl_packet_header {
221 struct vmpacket_descriptor d;
222 u32 gpadl;
223 u32 reserved;
224} __packed;
225
226struct vmadd_remove_transfer_page_set {
227 struct vmpacket_descriptor d;
228 u32 gpadl;
229 u16 xfer_pageset_id;
230 u16 reserved;
231} __packed;
232
233/*
234 * This structure defines a range in guest physical space that can be made to
235 * look virtually contiguous.
236 */
237struct gpa_range {
238 u32 byte_count;
239 u32 byte_offset;
240 u64 pfn_array[0];
241};
242
243/*
244 * This is the format for an Establish Gpadl packet, which contains a handle by
245 * which this GPADL will be known and a set of GPA ranges associated with it.
246 * This can be converted to a MDL by the guest OS. If there are multiple GPA
247 * ranges, then the resulting MDL will be "chained," representing multiple VA
248 * ranges.
249 */
250struct vmestablish_gpadl {
251 struct vmpacket_descriptor d;
252 u32 gpadl;
253 u32 range_cnt;
254 struct gpa_range range[1];
255} __packed;
256
257/*
258 * This is the format for a Teardown Gpadl packet, which indicates that the
259 * GPADL handle in the Establish Gpadl packet will never be referenced again.
260 */
261struct vmteardown_gpadl {
262 struct vmpacket_descriptor d;
263 u32 gpadl;
264 u32 reserved; /* for alignment to a 8-byte boundary */
265} __packed;
266
267/*
268 * This is the format for a GPA-Direct packet, which contains a set of GPA
269 * ranges, in addition to commands and/or data.
270 */
271struct vmdata_gpa_direct {
272 struct vmpacket_descriptor d;
273 u32 reserved;
274 u32 range_cnt;
275 struct gpa_range range[1];
276} __packed;
277
278/* This is the format for a Additional Data Packet. */
279struct vmadditional_data {
280 struct vmpacket_descriptor d;
281 u64 total_bytes;
282 u32 offset;
283 u32 byte_cnt;
284 unsigned char data[1];
285} __packed;
286
287union vmpacket_largest_possible_header {
288 struct vmpacket_descriptor simple_hdr;
289 struct vmtransfer_page_packet_header xfer_page_hdr;
290 struct vmgpadl_packet_header gpadl_hdr;
291 struct vmadd_remove_transfer_page_set add_rm_xfer_page_hdr;
292 struct vmestablish_gpadl establish_gpadl_hdr;
293 struct vmteardown_gpadl teardown_gpadl_hdr;
294 struct vmdata_gpa_direct data_gpa_direct_hdr;
295};
296
297#define VMPACKET_DATA_START_ADDRESS(__packet) \
298 (void *)(((unsigned char *)__packet) + \
299 ((struct vmpacket_descriptor)__packet)->offset8 * 8)
300
301#define VMPACKET_DATA_LENGTH(__packet) \
302 ((((struct vmpacket_descriptor)__packet)->len8 - \
303 ((struct vmpacket_descriptor)__packet)->offset8) * 8)
304
305#define VMPACKET_TRANSFER_MODE(__packet) \
306 (((struct IMPACT)__packet)->type)
307
308enum vmbus_packet_type {
309 VM_PKT_INVALID = 0x0,
310 VM_PKT_SYNCH = 0x1,
311 VM_PKT_ADD_XFER_PAGESET = 0x2,
312 VM_PKT_RM_XFER_PAGESET = 0x3,
313 VM_PKT_ESTABLISH_GPADL = 0x4,
314 VM_PKT_TEARDOWN_GPADL = 0x5,
315 VM_PKT_DATA_INBAND = 0x6,
316 VM_PKT_DATA_USING_XFER_PAGES = 0x7,
317 VM_PKT_DATA_USING_GPADL = 0x8,
318 VM_PKT_DATA_USING_GPA_DIRECT = 0x9,
319 VM_PKT_CANCEL_REQUEST = 0xa,
320 VM_PKT_COMP = 0xb,
321 VM_PKT_DATA_USING_ADDITIONAL_PKT = 0xc,
322 VM_PKT_ADDITIONAL_DATA = 0xd
323};
324
325#define VMBUS_DATA_PACKET_FLAG_COMPLETION_REQUESTED 1
326
327
328/* Version 1 messages */
329enum vmbus_channel_message_type {
330 CHANNELMSG_INVALID = 0,
331 CHANNELMSG_OFFERCHANNEL = 1,
332 CHANNELMSG_RESCIND_CHANNELOFFER = 2,
333 CHANNELMSG_REQUESTOFFERS = 3,
334 CHANNELMSG_ALLOFFERS_DELIVERED = 4,
335 CHANNELMSG_OPENCHANNEL = 5,
336 CHANNELMSG_OPENCHANNEL_RESULT = 6,
337 CHANNELMSG_CLOSECHANNEL = 7,
338 CHANNELMSG_GPADL_HEADER = 8,
339 CHANNELMSG_GPADL_BODY = 9,
340 CHANNELMSG_GPADL_CREATED = 10,
341 CHANNELMSG_GPADL_TEARDOWN = 11,
342 CHANNELMSG_GPADL_TORNDOWN = 12,
343 CHANNELMSG_RELID_RELEASED = 13,
344 CHANNELMSG_INITIATE_CONTACT = 14,
345 CHANNELMSG_VERSION_RESPONSE = 15,
346 CHANNELMSG_UNLOAD = 16,
347#ifdef VMBUS_FEATURE_PARENT_OR_PEER_MEMORY_MAPPED_INTO_A_CHILD
348 CHANNELMSG_VIEWRANGE_ADD = 17,
349 CHANNELMSG_VIEWRANGE_REMOVE = 18,
350#endif
351 CHANNELMSG_COUNT
352};
353
354struct vmbus_channel_message_header {
355 enum vmbus_channel_message_type msgtype;
356 u32 padding;
357} __packed;
358
359/* Query VMBus Version parameters */
360struct vmbus_channel_query_vmbus_version {
361 struct vmbus_channel_message_header header;
362 u32 version;
363} __packed;
364
365/* VMBus Version Supported parameters */
366struct vmbus_channel_version_supported {
367 struct vmbus_channel_message_header header;
368 bool version_supported;
369} __packed;
370
371/* Offer Channel parameters */
372struct vmbus_channel_offer_channel {
373 struct vmbus_channel_message_header header;
374 struct vmbus_channel_offer offer;
375 u32 child_relid;
376 u8 monitorid;
377 bool monitor_allocated;
378} __packed;
379
380/* Rescind Offer parameters */
381struct vmbus_channel_rescind_offer {
382 struct vmbus_channel_message_header header;
383 u32 child_relid;
384} __packed;
385
386/*
387 * Request Offer -- no parameters, SynIC message contains the partition ID
388 * Set Snoop -- no parameters, SynIC message contains the partition ID
389 * Clear Snoop -- no parameters, SynIC message contains the partition ID
390 * All Offers Delivered -- no parameters, SynIC message contains the partition
391 * ID
392 * Flush Client -- no parameters, SynIC message contains the partition ID
393 */
394
395/* Open Channel parameters */
396struct vmbus_channel_open_channel {
397 struct vmbus_channel_message_header header;
398
399 /* Identifies the specific VMBus channel that is being opened. */
400 u32 child_relid;
401
402 /* ID making a particular open request at a channel offer unique. */
403 u32 openid;
404
405 /* GPADL for the channel's ring buffer. */
406 u32 ringbuffer_gpadlhandle;
407
408 /* GPADL for the channel's server context save area. */
409 u32 server_contextarea_gpadlhandle;
410
411 /*
412 * The upstream ring buffer begins at offset zero in the memory
413 * described by RingBufferGpadlHandle. The downstream ring buffer
414 * follows it at this offset (in pages).
415 */
416 u32 downstream_ringbuffer_pageoffset;
417
418 /* User-specific data to be passed along to the server endpoint. */
419 unsigned char userdata[MAX_USER_DEFINED_BYTES];
420} __packed;
421
422/* Open Channel Result parameters */
423struct vmbus_channel_open_result {
424 struct vmbus_channel_message_header header;
425 u32 child_relid;
426 u32 openid;
427 u32 status;
428} __packed;
429
430/* Close channel parameters; */
431struct vmbus_channel_close_channel {
432 struct vmbus_channel_message_header header;
433 u32 child_relid;
434} __packed;
435
436/* Channel Message GPADL */
437#define GPADL_TYPE_RING_BUFFER 1
438#define GPADL_TYPE_SERVER_SAVE_AREA 2
439#define GPADL_TYPE_TRANSACTION 8
440
441/*
442 * The number of PFNs in a GPADL message is defined by the number of
443 * pages that would be spanned by ByteCount and ByteOffset. If the
444 * implied number of PFNs won't fit in this packet, there will be a
445 * follow-up packet that contains more.
446 */
447struct vmbus_channel_gpadl_header {
448 struct vmbus_channel_message_header header;
449 u32 child_relid;
450 u32 gpadl;
451 u16 range_buflen;
452 u16 rangecount;
453 struct gpa_range range[0];
454} __packed;
455
456/* This is the followup packet that contains more PFNs. */
457struct vmbus_channel_gpadl_body {
458 struct vmbus_channel_message_header header;
459 u32 msgnumber;
460 u32 gpadl;
461 u64 pfn[0];
462} __packed;
463
464struct vmbus_channel_gpadl_created {
465 struct vmbus_channel_message_header header;
466 u32 child_relid;
467 u32 gpadl;
468 u32 creation_status;
469} __packed;
470
471struct vmbus_channel_gpadl_teardown {
472 struct vmbus_channel_message_header header;
473 u32 child_relid;
474 u32 gpadl;
475} __packed;
476
477struct vmbus_channel_gpadl_torndown {
478 struct vmbus_channel_message_header header;
479 u32 gpadl;
480} __packed;
481
482#ifdef VMBUS_FEATURE_PARENT_OR_PEER_MEMORY_MAPPED_INTO_A_CHILD
483struct vmbus_channel_view_range_add {
484 struct vmbus_channel_message_header header;
485 PHYSICAL_ADDRESS viewrange_base;
486 u64 viewrange_length;
487 u32 child_relid;
488} __packed;
489
490struct vmbus_channel_view_range_remove {
491 struct vmbus_channel_message_header header;
492 PHYSICAL_ADDRESS viewrange_base;
493 u32 child_relid;
494} __packed;
495#endif
496
497struct vmbus_channel_relid_released {
498 struct vmbus_channel_message_header header;
499 u32 child_relid;
500} __packed;
501
502struct vmbus_channel_initiate_contact {
503 struct vmbus_channel_message_header header;
504 u32 vmbus_version_requested;
505 u32 padding2;
506 u64 interrupt_page;
507 u64 monitor_page1;
508 u64 monitor_page2;
509} __packed;
510
511struct vmbus_channel_version_response {
512 struct vmbus_channel_message_header header;
513 bool version_supported;
514} __packed;
515
516enum vmbus_channel_state {
517 CHANNEL_OFFER_STATE,
518 CHANNEL_OPENING_STATE,
519 CHANNEL_OPEN_STATE,
520};
521
522struct vmbus_channel_debug_info {
523 u32 relid;
524 enum vmbus_channel_state state;
525 uuid_le interfacetype;
526 uuid_le interface_instance;
527 u32 monitorid;
528 u32 servermonitor_pending;
529 u32 servermonitor_latency;
530 u32 servermonitor_connectionid;
531 u32 clientmonitor_pending;
532 u32 clientmonitor_latency;
533 u32 clientmonitor_connectionid;
534
535 struct hv_ring_buffer_debug_info inbound;
536 struct hv_ring_buffer_debug_info outbound;
537};
538
539/*
540 * Represents each channel msg on the vmbus connection This is a
541 * variable-size data structure depending on the msg type itself
542 */
543struct vmbus_channel_msginfo {
544 /* Bookkeeping stuff */
545 struct list_head msglistentry;
546
547 /* So far, this is only used to handle gpadl body message */
548 struct list_head submsglist;
549
550 /* Synchronize the request/response if needed */
551 struct completion waitevent;
552 union {
553 struct vmbus_channel_version_supported version_supported;
554 struct vmbus_channel_open_result open_result;
555 struct vmbus_channel_gpadl_torndown gpadl_torndown;
556 struct vmbus_channel_gpadl_created gpadl_created;
557 struct vmbus_channel_version_response version_response;
558 } response;
559
560 u32 msgsize;
561 /*
562 * The channel message that goes out on the "wire".
563 * It will contain at minimum the VMBUS_CHANNEL_MESSAGE_HEADER header
564 */
565 unsigned char msg[0];
566};
567
568struct vmbus_close_msg {
569 struct vmbus_channel_msginfo info;
570 struct vmbus_channel_close_channel msg;
571};
572
573struct vmbus_channel {
574 struct list_head listentry;
575
576 struct hv_device *device_obj;
577
578 struct work_struct work;
579
580 enum vmbus_channel_state state;
581
582 struct vmbus_channel_offer_channel offermsg;
583 /*
584 * These are based on the OfferMsg.MonitorId.
585 * Save it here for easy access.
586 */
587 u8 monitor_grp;
588 u8 monitor_bit;
589
590 u32 ringbuffer_gpadlhandle;
591
592 /* Allocated memory for ring buffer */
593 void *ringbuffer_pages;
594 u32 ringbuffer_pagecount;
595 struct hv_ring_buffer_info outbound; /* send to parent */
596 struct hv_ring_buffer_info inbound; /* receive from parent */
597 spinlock_t inbound_lock;
598 struct workqueue_struct *controlwq;
599
600 struct vmbus_close_msg close_msg;
601
602 /* Channel callback are invoked in this workqueue context */
603 /* HANDLE dataWorkQueue; */
604
605 void (*onchannel_callback)(void *context);
606 void *channel_callback_context;
607};
608
609void vmbus_onmessage(void *context);
610
611int vmbus_request_offers(void);
612
613/* The format must be the same as struct vmdata_gpa_direct */
614struct vmbus_channel_packet_page_buffer {
615 u16 type;
616 u16 dataoffset8;
617 u16 length8;
618 u16 flags;
619 u64 transactionid;
620 u32 reserved;
621 u32 rangecount;
622 struct hv_page_buffer range[MAX_PAGE_BUFFER_COUNT];
623} __packed;
624
625/* The format must be the same as struct vmdata_gpa_direct */
626struct vmbus_channel_packet_multipage_buffer {
627 u16 type;
628 u16 dataoffset8;
629 u16 length8;
630 u16 flags;
631 u64 transactionid;
632 u32 reserved;
633 u32 rangecount; /* Always 1 in this case */
634 struct hv_multipage_buffer range;
635} __packed;
636
637
638extern int vmbus_open(struct vmbus_channel *channel,
639 u32 send_ringbuffersize,
640 u32 recv_ringbuffersize,
641 void *userdata,
642 u32 userdatalen,
643 void(*onchannel_callback)(void *context),
644 void *context);
645
646extern void vmbus_close(struct vmbus_channel *channel);
647
648extern int vmbus_sendpacket(struct vmbus_channel *channel,
649 const void *buffer,
650 u32 bufferLen,
651 u64 requestid,
652 enum vmbus_packet_type type,
653 u32 flags);
654
655extern int vmbus_sendpacket_pagebuffer(struct vmbus_channel *channel,
656 struct hv_page_buffer pagebuffers[],
657 u32 pagecount,
658 void *buffer,
659 u32 bufferlen,
660 u64 requestid);
661
662extern int vmbus_sendpacket_multipagebuffer(struct vmbus_channel *channel,
663 struct hv_multipage_buffer *mpb,
664 void *buffer,
665 u32 bufferlen,
666 u64 requestid);
667
668extern int vmbus_establish_gpadl(struct vmbus_channel *channel,
669 void *kbuffer,
670 u32 size,
671 u32 *gpadl_handle);
672
673extern int vmbus_teardown_gpadl(struct vmbus_channel *channel,
674 u32 gpadl_handle);
675
676extern int vmbus_recvpacket(struct vmbus_channel *channel,
677 void *buffer,
678 u32 bufferlen,
679 u32 *buffer_actual_len,
680 u64 *requestid);
681
682extern int vmbus_recvpacket_raw(struct vmbus_channel *channel,
683 void *buffer,
684 u32 bufferlen,
685 u32 *buffer_actual_len,
686 u64 *requestid);
687
688
689extern void vmbus_get_debug_info(struct vmbus_channel *channel,
690 struct vmbus_channel_debug_info *debug);
691
692extern void vmbus_ontimer(unsigned long data);
693
694struct hv_dev_port_info {
695 u32 int_mask;
696 u32 read_idx;
697 u32 write_idx;
698 u32 bytes_avail_toread;
699 u32 bytes_avail_towrite;
700};
701
702/* Base driver object */
703struct hv_driver {
704 const char *name;
705
706 /* the device type supported by this driver */
707 uuid_le dev_type;
708 const struct hv_vmbus_device_id *id_table;
709
710 struct device_driver driver;
711
712 int (*probe)(struct hv_device *, const struct hv_vmbus_device_id *);
713 int (*remove)(struct hv_device *);
714 void (*shutdown)(struct hv_device *);
715
716};
717
718/* Base device object */
719struct hv_device {
720 /* the device type id of this device */
721 uuid_le dev_type;
722
723 /* the device instance id of this device */
724 uuid_le dev_instance;
725
726 struct device device;
727
728 struct vmbus_channel *channel;
729};
730
731
732static inline struct hv_device *device_to_hv_device(struct device *d)
733{
734 return container_of(d, struct hv_device, device);
735}
736
737static inline struct hv_driver *drv_to_hv_drv(struct device_driver *d)
738{
739 return container_of(d, struct hv_driver, driver);
740}
741
742static inline void hv_set_drvdata(struct hv_device *dev, void *data)
743{
744 dev_set_drvdata(&dev->device, data);
745}
746
747static inline void *hv_get_drvdata(struct hv_device *dev)
748{
749 return dev_get_drvdata(&dev->device);
750}
751
752/* Vmbus interface */
753#define vmbus_driver_register(driver) \
754 __vmbus_driver_register(driver, THIS_MODULE, KBUILD_MODNAME)
755int __must_check __vmbus_driver_register(struct hv_driver *hv_driver,
756 struct module *owner,
757 const char *mod_name);
758void vmbus_driver_unregister(struct hv_driver *hv_driver);
759
760/**
761 * VMBUS_DEVICE - macro used to describe a specific hyperv vmbus device
762 *
763 * This macro is used to create a struct hv_vmbus_device_id that matches a
764 * specific device.
765 */
766#define VMBUS_DEVICE(g0, g1, g2, g3, g4, g5, g6, g7, \
767 g8, g9, ga, gb, gc, gd, ge, gf) \
768 .guid = { g0, g1, g2, g3, g4, g5, g6, g7, \
769 g8, g9, ga, gb, gc, gd, ge, gf },
770
771/*
772 * Common header for Hyper-V ICs
773 */
774
775#define ICMSGTYPE_NEGOTIATE 0
776#define ICMSGTYPE_HEARTBEAT 1
777#define ICMSGTYPE_KVPEXCHANGE 2
778#define ICMSGTYPE_SHUTDOWN 3
779#define ICMSGTYPE_TIMESYNC 4
780#define ICMSGTYPE_VSS 5
781
782#define ICMSGHDRFLAG_TRANSACTION 1
783#define ICMSGHDRFLAG_REQUEST 2
784#define ICMSGHDRFLAG_RESPONSE 4
785
786#define HV_S_OK 0x00000000
787#define HV_E_FAIL 0x80004005
788#define HV_ERROR_NOT_SUPPORTED 0x80070032
789#define HV_ERROR_MACHINE_LOCKED 0x800704F7
790
791/*
792 * While we want to handle util services as regular devices,
793 * there is only one instance of each of these services; so
794 * we statically allocate the service specific state.
795 */
796
797struct hv_util_service {
798 u8 *recv_buffer;
799 void (*util_cb)(void *);
800 int (*util_init)(struct hv_util_service *);
801 void (*util_deinit)(void);
802};
803
804struct vmbuspipe_hdr {
805 u32 flags;
806 u32 msgsize;
807} __packed;
808
809struct ic_version {
810 u16 major;
811 u16 minor;
812} __packed;
813
814struct icmsg_hdr {
815 struct ic_version icverframe;
816 u16 icmsgtype;
817 struct ic_version icvermsg;
818 u16 icmsgsize;
819 u32 status;
820 u8 ictransaction_id;
821 u8 icflags;
822 u8 reserved[2];
823} __packed;
824
825struct icmsg_negotiate {
826 u16 icframe_vercnt;
827 u16 icmsg_vercnt;
828 u32 reserved;
829 struct ic_version icversion_data[1]; /* any size array */
830} __packed;
831
832struct shutdown_msg_data {
833 u32 reason_code;
834 u32 timeout_seconds;
835 u32 flags;
836 u8 display_message[2048];
837} __packed;
838
839struct heartbeat_msg_data {
840 u64 seq_num;
841 u32 reserved[8];
842} __packed;
843
844/* Time Sync IC defs */
845#define ICTIMESYNCFLAG_PROBE 0
846#define ICTIMESYNCFLAG_SYNC 1
847#define ICTIMESYNCFLAG_SAMPLE 2
848
849#ifdef __x86_64__
850#define WLTIMEDELTA 116444736000000000L /* in 100ns unit */
851#else
852#define WLTIMEDELTA 116444736000000000LL
853#endif
854
855struct ictimesync_data {
856 u64 parenttime;
857 u64 childtime;
858 u64 roundtriptime;
859 u8 flags;
860} __packed;
861
862struct hyperv_service_callback {
863 u8 msg_type;
864 char *log_msg;
865 uuid_le data;
866 struct vmbus_channel *channel;
867 void (*callback) (void *context);
868};
869
870extern void vmbus_prep_negotiate_resp(struct icmsg_hdr *,
871 struct icmsg_negotiate *, u8 *);
872
873#endif /* _HYPERV_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 b5e0a5c344fd..48363c3c40f8 100644
--- a/include/linux/ieee80211.h
+++ b/include/linux/ieee80211.h
@@ -759,6 +759,12 @@ struct ieee80211_mgmt {
759 u8 action; 759 u8 action;
760 u8 smps_control; 760 u8 smps_control;
761 } __attribute__ ((packed)) ht_smps; 761 } __attribute__ ((packed)) ht_smps;
762 struct {
763 u8 action_code;
764 u8 dialog_token;
765 __le16 capability;
766 u8 variable[0];
767 } __packed tdls_discover_resp;
762 } u; 768 } u;
763 } __attribute__ ((packed)) action; 769 } __attribute__ ((packed)) action;
764 } u; 770 } u;
@@ -805,6 +811,52 @@ struct ieee80211_pspoll {
805 u8 ta[6]; 811 u8 ta[6];
806} __attribute__ ((packed)); 812} __attribute__ ((packed));
807 813
814/* TDLS */
815
816/* Link-id information element */
817struct ieee80211_tdls_lnkie {
818 u8 ie_type; /* Link Identifier IE */
819 u8 ie_len;
820 u8 bssid[6];
821 u8 init_sta[6];
822 u8 resp_sta[6];
823} __packed;
824
825struct ieee80211_tdls_data {
826 u8 da[6];
827 u8 sa[6];
828 __be16 ether_type;
829 u8 payload_type;
830 u8 category;
831 u8 action_code;
832 union {
833 struct {
834 u8 dialog_token;
835 __le16 capability;
836 u8 variable[0];
837 } __packed setup_req;
838 struct {
839 __le16 status_code;
840 u8 dialog_token;
841 __le16 capability;
842 u8 variable[0];
843 } __packed setup_resp;
844 struct {
845 __le16 status_code;
846 u8 dialog_token;
847 u8 variable[0];
848 } __packed setup_cfm;
849 struct {
850 __le16 reason_code;
851 u8 variable[0];
852 } __packed teardown;
853 struct {
854 u8 dialog_token;
855 u8 variable[0];
856 } __packed discover_req;
857 } u;
858} __packed;
859
808/** 860/**
809 * struct ieee80211_bar - HT Block Ack Request 861 * struct ieee80211_bar - HT Block Ack Request
810 * 862 *
@@ -1196,6 +1248,8 @@ enum ieee80211_eid {
1196 WLAN_EID_TS_DELAY = 43, 1248 WLAN_EID_TS_DELAY = 43,
1197 WLAN_EID_TCLAS_PROCESSING = 44, 1249 WLAN_EID_TCLAS_PROCESSING = 44,
1198 WLAN_EID_QOS_CAPA = 46, 1250 WLAN_EID_QOS_CAPA = 46,
1251 /* 802.11z */
1252 WLAN_EID_LINK_ID = 101,
1199 /* 802.11s */ 1253 /* 802.11s */
1200 WLAN_EID_MESH_CONFIG = 113, 1254 WLAN_EID_MESH_CONFIG = 113,
1201 WLAN_EID_MESH_ID = 114, 1255 WLAN_EID_MESH_ID = 114,
@@ -1279,6 +1333,7 @@ enum ieee80211_category {
1279 WLAN_CATEGORY_HT = 7, 1333 WLAN_CATEGORY_HT = 7,
1280 WLAN_CATEGORY_SA_QUERY = 8, 1334 WLAN_CATEGORY_SA_QUERY = 8,
1281 WLAN_CATEGORY_PROTECTED_DUAL_OF_ACTION = 9, 1335 WLAN_CATEGORY_PROTECTED_DUAL_OF_ACTION = 9,
1336 WLAN_CATEGORY_TDLS = 12,
1282 WLAN_CATEGORY_MESH_ACTION = 13, 1337 WLAN_CATEGORY_MESH_ACTION = 13,
1283 WLAN_CATEGORY_MULTIHOP_ACTION = 14, 1338 WLAN_CATEGORY_MULTIHOP_ACTION = 14,
1284 WLAN_CATEGORY_SELF_PROTECTED = 15, 1339 WLAN_CATEGORY_SELF_PROTECTED = 15,
@@ -1342,6 +1397,36 @@ enum ieee80211_key_len {
1342 WLAN_KEY_LEN_AES_CMAC = 16, 1397 WLAN_KEY_LEN_AES_CMAC = 16,
1343}; 1398};
1344 1399
1400/* Public action codes */
1401enum ieee80211_pub_actioncode {
1402 WLAN_PUB_ACTION_TDLS_DISCOVER_RES = 14,
1403};
1404
1405/* TDLS action codes */
1406enum ieee80211_tdls_actioncode {
1407 WLAN_TDLS_SETUP_REQUEST = 0,
1408 WLAN_TDLS_SETUP_RESPONSE = 1,
1409 WLAN_TDLS_SETUP_CONFIRM = 2,
1410 WLAN_TDLS_TEARDOWN = 3,
1411 WLAN_TDLS_PEER_TRAFFIC_INDICATION = 4,
1412 WLAN_TDLS_CHANNEL_SWITCH_REQUEST = 5,
1413 WLAN_TDLS_CHANNEL_SWITCH_RESPONSE = 6,
1414 WLAN_TDLS_PEER_PSM_REQUEST = 7,
1415 WLAN_TDLS_PEER_PSM_RESPONSE = 8,
1416 WLAN_TDLS_PEER_TRAFFIC_RESPONSE = 9,
1417 WLAN_TDLS_DISCOVERY_REQUEST = 10,
1418};
1419
1420/*
1421 * TDLS capabililites to be enabled in the 5th byte of the
1422 * @WLAN_EID_EXT_CAPABILITY information element
1423 */
1424#define WLAN_EXT_CAPA5_TDLS_ENABLED BIT(5)
1425#define WLAN_EXT_CAPA5_TDLS_PROHIBITED BIT(6)
1426
1427/* TDLS specific payload type in the LLC/SNAP header */
1428#define WLAN_TDLS_SNAP_RFTYPE 0x2
1429
1345/** 1430/**
1346 * enum - mesh path selection protocol identifier 1431 * enum - mesh path selection protocol identifier
1347 * 1432 *
diff --git a/include/linux/if.h b/include/linux/if.h
index 03489ca92ded..db20bd4fd16b 100644
--- a/include/linux/if.h
+++ b/include/linux/if.h
@@ -78,6 +78,7 @@
78 * datapath port */ 78 * datapath port */
79#define IFF_TX_SKB_SHARING 0x10000 /* The interface supports sharing 79#define IFF_TX_SKB_SHARING 0x10000 /* The interface supports sharing
80 * skbs on transmit */ 80 * skbs on transmit */
81#define IFF_UNICAST_FLT 0x20000 /* Supports unicast filtering */
81 82
82#define IF_GET_IFACE 0x0001 /* for querying only */ 83#define IF_GET_IFACE 0x0001 /* for querying only */
83#define IF_GET_PROTO 0x0002 84#define IF_GET_PROTO 0x0002
diff --git a/include/linux/if_ether.h b/include/linux/if_ether.h
index a3d99ff6e3b5..e473003e4bda 100644
--- a/include/linux/if_ether.h
+++ b/include/linux/if_ether.h
@@ -83,11 +83,13 @@
83#define ETH_P_8021AH 0x88E7 /* 802.1ah Backbone Service Tag */ 83#define ETH_P_8021AH 0x88E7 /* 802.1ah Backbone Service Tag */
84#define ETH_P_1588 0x88F7 /* IEEE 1588 Timesync */ 84#define ETH_P_1588 0x88F7 /* IEEE 1588 Timesync */
85#define ETH_P_FCOE 0x8906 /* Fibre Channel over Ethernet */ 85#define ETH_P_FCOE 0x8906 /* Fibre Channel over Ethernet */
86#define ETH_P_TDLS 0x890D /* TDLS */
86#define ETH_P_FIP 0x8914 /* FCoE Initialization Protocol */ 87#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_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_QINQ2 0x9200 /* deprecated QinQ VLAN [ NOT AN OFFICIALLY REGISTERED ID ] */
89#define ETH_P_QINQ3 0x9300 /* deprecated QinQ VLAN [ NOT AN OFFICIALLY REGISTERED ID ] */ 90#define ETH_P_QINQ3 0x9300 /* deprecated QinQ VLAN [ NOT AN OFFICIALLY REGISTERED ID ] */
90#define ETH_P_EDSA 0xDADA /* Ethertype DSA [ NOT AN OFFICIALLY REGISTERED ID ] */ 91#define ETH_P_EDSA 0xDADA /* Ethertype DSA [ NOT AN OFFICIALLY REGISTERED ID ] */
92#define ETH_P_AF_IUCV 0xFBFB /* IBM af_iucv [ NOT AN OFFICIALLY REGISTERED ID ] */
91 93
92/* 94/*
93 * Non DIX types. Won't clash for 1500 types. 95 * Non DIX types. Won't clash for 1500 types.
diff --git a/include/linux/if_link.h b/include/linux/if_link.h
index 0ee969a5593d..c52d4b5f872a 100644
--- a/include/linux/if_link.h
+++ b/include/linux/if_link.h
@@ -279,6 +279,7 @@ enum {
279 IFLA_VF_MAC, /* Hardware queue specific attributes */ 279 IFLA_VF_MAC, /* Hardware queue specific attributes */
280 IFLA_VF_VLAN, 280 IFLA_VF_VLAN,
281 IFLA_VF_TX_RATE, /* TX Bandwidth Allocation */ 281 IFLA_VF_TX_RATE, /* TX Bandwidth Allocation */
282 IFLA_VF_SPOOFCHK, /* Spoof Checking on/off switch */
282 __IFLA_VF_MAX, 283 __IFLA_VF_MAX,
283}; 284};
284 285
@@ -300,13 +301,22 @@ struct ifla_vf_tx_rate {
300 __u32 rate; /* Max TX bandwidth in Mbps, 0 disables throttling */ 301 __u32 rate; /* Max TX bandwidth in Mbps, 0 disables throttling */
301}; 302};
302 303
304struct ifla_vf_spoofchk {
305 __u32 vf;
306 __u32 setting;
307};
308#ifdef __KERNEL__
309
310/* We don't want this structure exposed to user space */
303struct ifla_vf_info { 311struct ifla_vf_info {
304 __u32 vf; 312 __u32 vf;
305 __u8 mac[32]; 313 __u8 mac[32];
306 __u32 vlan; 314 __u32 vlan;
307 __u32 qos; 315 __u32 qos;
308 __u32 tx_rate; 316 __u32 tx_rate;
317 __u32 spoofchk;
309}; 318};
319#endif
310 320
311/* VF ports management section 321/* VF ports management section
312 * 322 *
diff --git a/include/linux/if_macvlan.h b/include/linux/if_macvlan.h
index e28b2e4959d4..d103dca5c563 100644
--- a/include/linux/if_macvlan.h
+++ b/include/linux/if_macvlan.h
@@ -64,6 +64,7 @@ struct macvlan_dev {
64 int (*forward)(struct net_device *dev, struct sk_buff *skb); 64 int (*forward)(struct net_device *dev, struct sk_buff *skb);
65 struct macvtap_queue *taps[MAX_MACVTAP_QUEUES]; 65 struct macvtap_queue *taps[MAX_MACVTAP_QUEUES];
66 int numvtaps; 66 int numvtaps;
67 int minor;
67}; 68};
68 69
69static inline void macvlan_count_rx(const struct macvlan_dev *vlan, 70static inline void macvlan_count_rx(const struct macvlan_dev *vlan,
diff --git a/include/linux/if_packet.h b/include/linux/if_packet.h
index c1486060f5ed..f3799295d231 100644
--- a/include/linux/if_packet.h
+++ b/include/linux/if_packet.h
@@ -61,6 +61,17 @@ struct tpacket_stats {
61 unsigned int tp_drops; 61 unsigned int tp_drops;
62}; 62};
63 63
64struct tpacket_stats_v3 {
65 unsigned int tp_packets;
66 unsigned int tp_drops;
67 unsigned int tp_freeze_q_cnt;
68};
69
70union tpacket_stats_u {
71 struct tpacket_stats stats1;
72 struct tpacket_stats_v3 stats3;
73};
74
64struct tpacket_auxdata { 75struct tpacket_auxdata {
65 __u32 tp_status; 76 __u32 tp_status;
66 __u32 tp_len; 77 __u32 tp_len;
@@ -78,6 +89,7 @@ struct tpacket_auxdata {
78#define TP_STATUS_LOSING 0x4 89#define TP_STATUS_LOSING 0x4
79#define TP_STATUS_CSUMNOTREADY 0x8 90#define TP_STATUS_CSUMNOTREADY 0x8
80#define TP_STATUS_VLAN_VALID 0x10 /* auxdata has valid tp_vlan_tci */ 91#define TP_STATUS_VLAN_VALID 0x10 /* auxdata has valid tp_vlan_tci */
92#define TP_STATUS_BLK_TMO 0x20
81 93
82/* Tx ring - header status */ 94/* Tx ring - header status */
83#define TP_STATUS_AVAILABLE 0x0 95#define TP_STATUS_AVAILABLE 0x0
@@ -85,6 +97,9 @@ struct tpacket_auxdata {
85#define TP_STATUS_SENDING 0x2 97#define TP_STATUS_SENDING 0x2
86#define TP_STATUS_WRONG_FORMAT 0x4 98#define TP_STATUS_WRONG_FORMAT 0x4
87 99
100/* Rx ring - feature request bits */
101#define TP_FT_REQ_FILL_RXHASH 0x1
102
88struct tpacket_hdr { 103struct tpacket_hdr {
89 unsigned long tp_status; 104 unsigned long tp_status;
90 unsigned int tp_len; 105 unsigned int tp_len;
@@ -111,11 +126,100 @@ struct tpacket2_hdr {
111 __u16 tp_padding; 126 __u16 tp_padding;
112}; 127};
113 128
129struct tpacket_hdr_variant1 {
130 __u32 tp_rxhash;
131 __u32 tp_vlan_tci;
132};
133
134struct tpacket3_hdr {
135 __u32 tp_next_offset;
136 __u32 tp_sec;
137 __u32 tp_nsec;
138 __u32 tp_snaplen;
139 __u32 tp_len;
140 __u32 tp_status;
141 __u16 tp_mac;
142 __u16 tp_net;
143 /* pkt_hdr variants */
144 union {
145 struct tpacket_hdr_variant1 hv1;
146 };
147};
148
149struct tpacket_bd_ts {
150 unsigned int ts_sec;
151 union {
152 unsigned int ts_usec;
153 unsigned int ts_nsec;
154 };
155};
156
157struct tpacket_hdr_v1 {
158 __u32 block_status;
159 __u32 num_pkts;
160 __u32 offset_to_first_pkt;
161
162 /* Number of valid bytes (including padding)
163 * blk_len <= tp_block_size
164 */
165 __u32 blk_len;
166
167 /*
168 * Quite a few uses of sequence number:
169 * 1. Make sure cache flush etc worked.
170 * Well, one can argue - why not use the increasing ts below?
171 * But look at 2. below first.
172 * 2. When you pass around blocks to other user space decoders,
173 * you can see which blk[s] is[are] outstanding etc.
174 * 3. Validate kernel code.
175 */
176 __aligned_u64 seq_num;
177
178 /*
179 * ts_last_pkt:
180 *
181 * Case 1. Block has 'N'(N >=1) packets and TMO'd(timed out)
182 * ts_last_pkt == 'time-stamp of last packet' and NOT the
183 * time when the timer fired and the block was closed.
184 * By providing the ts of the last packet we can absolutely
185 * guarantee that time-stamp wise, the first packet in the
186 * next block will never precede the last packet of the
187 * previous block.
188 * Case 2. Block has zero packets and TMO'd
189 * ts_last_pkt = time when the timer fired and the block
190 * was closed.
191 * Case 3. Block has 'N' packets and NO TMO.
192 * ts_last_pkt = time-stamp of the last pkt in the block.
193 *
194 * ts_first_pkt:
195 * Is always the time-stamp when the block was opened.
196 * Case a) ZERO packets
197 * No packets to deal with but atleast you know the
198 * time-interval of this block.
199 * Case b) Non-zero packets
200 * Use the ts of the first packet in the block.
201 *
202 */
203 struct tpacket_bd_ts ts_first_pkt, ts_last_pkt;
204};
205
206union tpacket_bd_header_u {
207 struct tpacket_hdr_v1 bh1;
208};
209
210struct tpacket_block_desc {
211 __u32 version;
212 __u32 offset_to_priv;
213 union tpacket_bd_header_u hdr;
214};
215
114#define TPACKET2_HDRLEN (TPACKET_ALIGN(sizeof(struct tpacket2_hdr)) + sizeof(struct sockaddr_ll)) 216#define TPACKET2_HDRLEN (TPACKET_ALIGN(sizeof(struct tpacket2_hdr)) + sizeof(struct sockaddr_ll))
217#define TPACKET3_HDRLEN (TPACKET_ALIGN(sizeof(struct tpacket3_hdr)) + sizeof(struct sockaddr_ll))
115 218
116enum tpacket_versions { 219enum tpacket_versions {
117 TPACKET_V1, 220 TPACKET_V1,
118 TPACKET_V2, 221 TPACKET_V2,
222 TPACKET_V3
119}; 223};
120 224
121/* 225/*
@@ -138,6 +242,21 @@ struct tpacket_req {
138 unsigned int tp_frame_nr; /* Total number of frames */ 242 unsigned int tp_frame_nr; /* Total number of frames */
139}; 243};
140 244
245struct tpacket_req3 {
246 unsigned int tp_block_size; /* Minimal size of contiguous block */
247 unsigned int tp_block_nr; /* Number of blocks */
248 unsigned int tp_frame_size; /* Size of frame */
249 unsigned int tp_frame_nr; /* Total number of frames */
250 unsigned int tp_retire_blk_tov; /* timeout in msecs */
251 unsigned int tp_sizeof_priv; /* offset to private data area */
252 unsigned int tp_feature_req_word;
253};
254
255union tpacket_req_u {
256 struct tpacket_req req;
257 struct tpacket_req3 req3;
258};
259
141struct packet_mreq { 260struct packet_mreq {
142 int mr_ifindex; 261 int mr_ifindex;
143 unsigned short mr_type; 262 unsigned short mr_type;
diff --git a/include/linux/if_pppol2tp.h b/include/linux/if_pppol2tp.h
index 184bc5566207..23cefa1111bf 100644
--- a/include/linux/if_pppol2tp.h
+++ b/include/linux/if_pppol2tp.h
@@ -39,7 +39,7 @@ struct pppol2tp_addr {
39 * bits. So we need a different sockaddr structure. 39 * bits. So we need a different sockaddr structure.
40 */ 40 */
41struct pppol2tpv3_addr { 41struct pppol2tpv3_addr {
42 pid_t pid; /* pid that owns the fd. 42 __kernel_pid_t pid; /* pid that owns the fd.
43 * 0 => current */ 43 * 0 => current */
44 int fd; /* FD of UDP or IP socket to use */ 44 int fd; /* FD of UDP or IP socket to use */
45 45
diff --git a/include/linux/if_pppox.h b/include/linux/if_pppox.h
index 397921b09ef9..b5f927f59f26 100644
--- a/include/linux/if_pppox.h
+++ b/include/linux/if_pppox.h
@@ -20,8 +20,9 @@
20#include <linux/types.h> 20#include <linux/types.h>
21#include <asm/byteorder.h> 21#include <asm/byteorder.h>
22 22
23#ifdef __KERNEL__ 23#include <linux/socket.h>
24#include <linux/if_ether.h> 24#include <linux/if_ether.h>
25#ifdef __KERNEL__
25#include <linux/if.h> 26#include <linux/if.h>
26#include <linux/netdevice.h> 27#include <linux/netdevice.h>
27#include <linux/ppp_channel.h> 28#include <linux/ppp_channel.h>
@@ -63,7 +64,7 @@ struct pptp_addr {
63#define PX_MAX_PROTO 3 64#define PX_MAX_PROTO 3
64 65
65struct sockaddr_pppox { 66struct sockaddr_pppox {
66 sa_family_t sa_family; /* address family, AF_PPPOX */ 67 __kernel_sa_family_t sa_family; /* address family, AF_PPPOX */
67 unsigned int sa_protocol; /* protocol identifier */ 68 unsigned int sa_protocol; /* protocol identifier */
68 union { 69 union {
69 struct pppoe_addr pppoe; 70 struct pppoe_addr pppoe;
@@ -77,7 +78,7 @@ struct sockaddr_pppox {
77 * type instead. 78 * type instead.
78 */ 79 */
79struct sockaddr_pppol2tp { 80struct sockaddr_pppol2tp {
80 sa_family_t sa_family; /* address family, AF_PPPOX */ 81 __kernel_sa_family_t sa_family; /* address family, AF_PPPOX */
81 unsigned int sa_protocol; /* protocol identifier */ 82 unsigned int sa_protocol; /* protocol identifier */
82 struct pppol2tp_addr pppol2tp; 83 struct pppol2tp_addr pppol2tp;
83} __attribute__((packed)); 84} __attribute__((packed));
@@ -86,7 +87,7 @@ struct sockaddr_pppol2tp {
86 * bits. So we need a different sockaddr structure. 87 * bits. So we need a different sockaddr structure.
87 */ 88 */
88struct sockaddr_pppol2tpv3 { 89struct sockaddr_pppol2tpv3 {
89 sa_family_t sa_family; /* address family, AF_PPPOX */ 90 __kernel_sa_family_t sa_family; /* address family, AF_PPPOX */
90 unsigned int sa_protocol; /* protocol identifier */ 91 unsigned int sa_protocol; /* protocol identifier */
91 struct pppol2tpv3_addr pppol2tp; 92 struct pppol2tpv3_addr pppol2tp;
92} __attribute__((packed)); 93} __attribute__((packed));
diff --git a/include/linux/if_vlan.h b/include/linux/if_vlan.h
index 44da4822bcab..12d5543b14f2 100644
--- a/include/linux/if_vlan.h
+++ b/include/linux/if_vlan.h
@@ -106,7 +106,7 @@ extern struct net_device *__vlan_find_dev_deep(struct net_device *real_dev,
106extern 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);
107extern u16 vlan_dev_vlan_id(const struct net_device *dev); 107extern u16 vlan_dev_vlan_id(const struct net_device *dev);
108 108
109extern bool vlan_do_receive(struct sk_buff **skb); 109extern bool vlan_do_receive(struct sk_buff **skb, bool last_handler);
110extern struct sk_buff *vlan_untag(struct sk_buff *skb); 110extern struct sk_buff *vlan_untag(struct sk_buff *skb);
111 111
112#else 112#else
@@ -128,9 +128,9 @@ static inline u16 vlan_dev_vlan_id(const struct net_device *dev)
128 return 0; 128 return 0;
129} 129}
130 130
131static inline bool vlan_do_receive(struct sk_buff **skb) 131static inline bool vlan_do_receive(struct sk_buff **skb, bool last_handler)
132{ 132{
133 if ((*skb)->vlan_tci & VLAN_VID_MASK) 133 if (((*skb)->vlan_tci & VLAN_VID_MASK) && last_handler)
134 (*skb)->pkt_type = PACKET_OTHERHOST; 134 (*skb)->pkt_type = PACKET_OTHERHOST;
135 return false; 135 return false;
136} 136}
diff --git a/include/linux/ima.h b/include/linux/ima.h
index 09e6e62f9953..6ac8e50c6cf5 100644
--- a/include/linux/ima.h
+++ b/include/linux/ima.h
@@ -15,8 +15,6 @@ struct linux_binprm;
15 15
16#ifdef CONFIG_IMA 16#ifdef CONFIG_IMA
17extern int ima_bprm_check(struct linux_binprm *bprm); 17extern int ima_bprm_check(struct linux_binprm *bprm);
18extern int ima_inode_alloc(struct inode *inode);
19extern void ima_inode_free(struct inode *inode);
20extern int ima_file_check(struct file *file, int mask); 18extern int ima_file_check(struct file *file, int mask);
21extern void ima_file_free(struct file *file); 19extern void ima_file_free(struct file *file);
22extern int ima_file_mmap(struct file *file, unsigned long prot); 20extern int ima_file_mmap(struct file *file, unsigned long prot);
@@ -27,16 +25,6 @@ static inline int ima_bprm_check(struct linux_binprm *bprm)
27 return 0; 25 return 0;
28} 26}
29 27
30static inline int ima_inode_alloc(struct inode *inode)
31{
32 return 0;
33}
34
35static inline void ima_inode_free(struct inode *inode)
36{
37 return;
38}
39
40static inline int ima_file_check(struct file *file, int mask) 28static inline int ima_file_check(struct file *file, int mask)
41{ 29{
42 return 0; 30 return 0;
@@ -51,6 +39,5 @@ static inline int ima_file_mmap(struct file *file, unsigned long prot)
51{ 39{
52 return 0; 40 return 0;
53} 41}
54
55#endif /* CONFIG_IMA_H */ 42#endif /* CONFIG_IMA_H */
56#endif /* _LINUX_IMA_H */ 43#endif /* _LINUX_IMA_H */
diff --git a/include/linux/in.h b/include/linux/in.h
index beeb6dee2b49..01129c0ea87c 100644
--- a/include/linux/in.h
+++ b/include/linux/in.h
@@ -182,7 +182,7 @@ struct in_pktinfo {
182/* Structure describing an Internet (IP) socket address. */ 182/* Structure describing an Internet (IP) socket address. */
183#define __SOCK_SIZE__ 16 /* sizeof(struct sockaddr) */ 183#define __SOCK_SIZE__ 16 /* sizeof(struct sockaddr) */
184struct sockaddr_in { 184struct sockaddr_in {
185 sa_family_t sin_family; /* Address family */ 185 __kernel_sa_family_t sin_family; /* Address family */
186 __be16 sin_port; /* Port number */ 186 __be16 sin_port; /* Port number */
187 struct in_addr sin_addr; /* Internet address */ 187 struct in_addr sin_addr; /* Internet address */
188 188
diff --git a/include/linux/inet_diag.h b/include/linux/inet_diag.h
index bc8c49022084..80b480c97532 100644
--- a/include/linux/inet_diag.h
+++ b/include/linux/inet_diag.h
@@ -97,9 +97,10 @@ enum {
97 INET_DIAG_INFO, 97 INET_DIAG_INFO,
98 INET_DIAG_VEGASINFO, 98 INET_DIAG_VEGASINFO,
99 INET_DIAG_CONG, 99 INET_DIAG_CONG,
100 INET_DIAG_TOS,
100}; 101};
101 102
102#define INET_DIAG_MAX INET_DIAG_CONG 103#define INET_DIAG_MAX INET_DIAG_TOS
103 104
104 105
105/* INET_DIAG_MEM */ 106/* INET_DIAG_MEM */
diff --git a/include/linux/init_task.h b/include/linux/init_task.h
index d14e058aaeed..08ffab01e76c 100644
--- a/include/linux/init_task.h
+++ b/include/linux/init_task.h
@@ -42,7 +42,7 @@ extern struct fs_struct init_fs;
42 .cputimer = { \ 42 .cputimer = { \
43 .cputime = INIT_CPUTIME, \ 43 .cputime = INIT_CPUTIME, \
44 .running = 0, \ 44 .running = 0, \
45 .lock = __SPIN_LOCK_UNLOCKED(sig.cputimer.lock), \ 45 .lock = __RAW_SPIN_LOCK_UNLOCKED(sig.cputimer.lock), \
46 }, \ 46 }, \
47 .cred_guard_mutex = \ 47 .cred_guard_mutex = \
48 __MUTEX_INITIALIZER(sig.cred_guard_mutex), \ 48 __MUTEX_INITIALIZER(sig.cred_guard_mutex), \
diff --git a/include/linux/input.h b/include/linux/input.h
index 068784e17972..a637e7814334 100644
--- a/include/linux/input.h
+++ b/include/linux/input.h
@@ -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/integrity.h b/include/linux/integrity.h
new file mode 100644
index 000000000000..a0c41256cb92
--- /dev/null
+++ b/include/linux/integrity.h
@@ -0,0 +1,39 @@
1/*
2 * Copyright (C) 2009 IBM Corporation
3 * Author: Mimi Zohar <zohar@us.ibm.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 as published by
7 * the Free Software Foundation, version 2 of the License.
8 */
9
10#ifndef _LINUX_INTEGRITY_H
11#define _LINUX_INTEGRITY_H
12
13#include <linux/fs.h>
14
15enum integrity_status {
16 INTEGRITY_PASS = 0,
17 INTEGRITY_FAIL,
18 INTEGRITY_NOLABEL,
19 INTEGRITY_NOXATTRS,
20 INTEGRITY_UNKNOWN,
21};
22
23/* List of EVM protected security xattrs */
24#ifdef CONFIG_INTEGRITY
25extern int integrity_inode_alloc(struct inode *inode);
26extern void integrity_inode_free(struct inode *inode);
27
28#else
29static inline int integrity_inode_alloc(struct inode *inode)
30{
31 return 0;
32}
33
34static inline void integrity_inode_free(struct inode *inode)
35{
36 return;
37}
38#endif /* CONFIG_INTEGRITY_H */
39#endif /* _LINUX_INTEGRITY_H */
diff --git a/include/linux/intel-iommu.h b/include/linux/intel-iommu.h
index 9310c699a37d..e6ca56de9936 100644
--- a/include/linux/intel-iommu.h
+++ b/include/linux/intel-iommu.h
@@ -271,7 +271,7 @@ struct qi_desc {
271}; 271};
272 272
273struct q_inval { 273struct q_inval {
274 spinlock_t q_lock; 274 raw_spinlock_t q_lock;
275 struct qi_desc *desc; /* invalidation queue */ 275 struct qi_desc *desc; /* invalidation queue */
276 int *desc_status; /* desc status */ 276 int *desc_status; /* desc status */
277 int free_head; /* first free entry */ 277 int free_head; /* first free entry */
@@ -279,7 +279,7 @@ struct q_inval {
279 int free_cnt; 279 int free_cnt;
280}; 280};
281 281
282#ifdef CONFIG_INTR_REMAP 282#ifdef CONFIG_IRQ_REMAP
283/* 1MB - maximum possible interrupt remapping table size */ 283/* 1MB - maximum possible interrupt remapping table size */
284#define INTR_REMAP_PAGE_ORDER 8 284#define INTR_REMAP_PAGE_ORDER 8
285#define INTR_REMAP_TABLE_REG_SIZE 0xf 285#define INTR_REMAP_TABLE_REG_SIZE 0xf
@@ -311,14 +311,14 @@ struct intel_iommu {
311 u64 cap; 311 u64 cap;
312 u64 ecap; 312 u64 ecap;
313 u32 gcmd; /* Holds TE, EAFL. Don't need SRTP, SFL, WBF */ 313 u32 gcmd; /* Holds TE, EAFL. Don't need SRTP, SFL, WBF */
314 spinlock_t register_lock; /* protect register handling */ 314 raw_spinlock_t register_lock; /* protect register handling */
315 int seq_id; /* sequence id of the iommu */ 315 int seq_id; /* sequence id of the iommu */
316 int agaw; /* agaw of this iommu */ 316 int agaw; /* agaw of this iommu */
317 int msagaw; /* max sagaw of this iommu */ 317 int msagaw; /* max sagaw of this iommu */
318 unsigned int irq; 318 unsigned int irq;
319 unsigned char name[13]; /* Device Name */ 319 unsigned char name[13]; /* Device Name */
320 320
321#ifdef CONFIG_DMAR 321#ifdef CONFIG_INTEL_IOMMU
322 unsigned long *domain_ids; /* bitmap of domains */ 322 unsigned long *domain_ids; /* bitmap of domains */
323 struct dmar_domain **domains; /* ptr to domains */ 323 struct dmar_domain **domains; /* ptr to domains */
324 spinlock_t lock; /* protect context, domain ids */ 324 spinlock_t lock; /* protect context, domain ids */
@@ -329,7 +329,7 @@ struct intel_iommu {
329 struct q_inval *qi; /* Queued invalidation info */ 329 struct q_inval *qi; /* Queued invalidation info */
330 u32 *iommu_state; /* Store iommu states between suspend and resume.*/ 330 u32 *iommu_state; /* Store iommu states between suspend and resume.*/
331 331
332#ifdef CONFIG_INTR_REMAP 332#ifdef CONFIG_IRQ_REMAP
333 struct ir_table *ir_table; /* Interrupt remapping info */ 333 struct ir_table *ir_table; /* Interrupt remapping info */
334#endif 334#endif
335 int node; 335 int node;
diff --git a/include/linux/interrupt.h b/include/linux/interrupt.h
index a103732b7588..a64b00e286f5 100644
--- a/include/linux/interrupt.h
+++ b/include/linux/interrupt.h
@@ -59,6 +59,8 @@
59 * IRQF_NO_SUSPEND - Do not disable this IRQ during suspend 59 * IRQF_NO_SUSPEND - Do not disable this IRQ during suspend
60 * IRQF_FORCE_RESUME - Force enable it on resume even if IRQF_NO_SUSPEND is set 60 * IRQF_FORCE_RESUME - Force enable it on resume even if IRQF_NO_SUSPEND is set
61 * IRQF_NO_THREAD - Interrupt cannot be threaded 61 * IRQF_NO_THREAD - Interrupt cannot be threaded
62 * IRQF_EARLY_RESUME - Resume IRQ early during syscore instead of at device
63 * resume time.
62 */ 64 */
63#define IRQF_DISABLED 0x00000020 65#define IRQF_DISABLED 0x00000020
64#define IRQF_SAMPLE_RANDOM 0x00000040 66#define IRQF_SAMPLE_RANDOM 0x00000040
@@ -72,6 +74,7 @@
72#define IRQF_NO_SUSPEND 0x00004000 74#define IRQF_NO_SUSPEND 0x00004000
73#define IRQF_FORCE_RESUME 0x00008000 75#define IRQF_FORCE_RESUME 0x00008000
74#define IRQF_NO_THREAD 0x00010000 76#define IRQF_NO_THREAD 0x00010000
77#define IRQF_EARLY_RESUME 0x00020000
75 78
76#define IRQF_TIMER (__IRQF_TIMER | IRQF_NO_SUSPEND | IRQF_NO_THREAD) 79#define IRQF_TIMER (__IRQF_TIMER | IRQF_NO_SUSPEND | IRQF_NO_THREAD)
77 80
@@ -95,6 +98,7 @@ typedef irqreturn_t (*irq_handler_t)(int, void *);
95 * @flags: flags (see IRQF_* above) 98 * @flags: flags (see IRQF_* above)
96 * @name: name of the device 99 * @name: name of the device
97 * @dev_id: cookie to identify the device 100 * @dev_id: cookie to identify the device
101 * @percpu_dev_id: cookie to identify the device
98 * @next: pointer to the next irqaction for shared interrupts 102 * @next: pointer to the next irqaction for shared interrupts
99 * @irq: interrupt number 103 * @irq: interrupt number
100 * @dir: pointer to the proc/irq/NN/name entry 104 * @dir: pointer to the proc/irq/NN/name entry
@@ -104,17 +108,18 @@ typedef irqreturn_t (*irq_handler_t)(int, void *);
104 * @thread_mask: bitmask for keeping track of @thread activity 108 * @thread_mask: bitmask for keeping track of @thread activity
105 */ 109 */
106struct irqaction { 110struct irqaction {
107 irq_handler_t handler; 111 irq_handler_t handler;
108 unsigned long flags; 112 unsigned long flags;
109 void *dev_id; 113 void *dev_id;
110 struct irqaction *next; 114 void __percpu *percpu_dev_id;
111 int irq; 115 struct irqaction *next;
112 irq_handler_t thread_fn; 116 int irq;
113 struct task_struct *thread; 117 irq_handler_t thread_fn;
114 unsigned long thread_flags; 118 struct task_struct *thread;
115 unsigned long thread_mask; 119 unsigned long thread_flags;
116 const char *name; 120 unsigned long thread_mask;
117 struct proc_dir_entry *dir; 121 const char *name;
122 struct proc_dir_entry *dir;
118} ____cacheline_internodealigned_in_smp; 123} ____cacheline_internodealigned_in_smp;
119 124
120extern irqreturn_t no_action(int cpl, void *dev_id); 125extern irqreturn_t no_action(int cpl, void *dev_id);
@@ -136,6 +141,10 @@ extern int __must_check
136request_any_context_irq(unsigned int irq, irq_handler_t handler, 141request_any_context_irq(unsigned int irq, irq_handler_t handler,
137 unsigned long flags, const char *name, void *dev_id); 142 unsigned long flags, const char *name, void *dev_id);
138 143
144extern int __must_check
145request_percpu_irq(unsigned int irq, irq_handler_t handler,
146 const char *devname, void __percpu *percpu_dev_id);
147
139extern void exit_irq_thread(void); 148extern void exit_irq_thread(void);
140#else 149#else
141 150
@@ -164,10 +173,18 @@ request_any_context_irq(unsigned int irq, irq_handler_t handler,
164 return request_irq(irq, handler, flags, name, dev_id); 173 return request_irq(irq, handler, flags, name, dev_id);
165} 174}
166 175
176static inline int __must_check
177request_percpu_irq(unsigned int irq, irq_handler_t handler,
178 const char *devname, void __percpu *percpu_dev_id)
179{
180 return request_irq(irq, handler, 0, devname, percpu_dev_id);
181}
182
167static inline void exit_irq_thread(void) { } 183static inline void exit_irq_thread(void) { }
168#endif 184#endif
169 185
170extern void free_irq(unsigned int, void *); 186extern void free_irq(unsigned int, void *);
187extern void free_percpu_irq(unsigned int, void __percpu *);
171 188
172struct device; 189struct device;
173 190
@@ -207,7 +224,9 @@ extern void devm_free_irq(struct device *dev, unsigned int irq, void *dev_id);
207 224
208extern void disable_irq_nosync(unsigned int irq); 225extern void disable_irq_nosync(unsigned int irq);
209extern void disable_irq(unsigned int irq); 226extern void disable_irq(unsigned int irq);
227extern void disable_percpu_irq(unsigned int irq);
210extern void enable_irq(unsigned int irq); 228extern void enable_irq(unsigned int irq);
229extern void enable_percpu_irq(unsigned int irq, unsigned int type);
211 230
212/* The following three functions are for the core kernel use only. */ 231/* The following three functions are for the core kernel use only. */
213#ifdef CONFIG_GENERIC_HARDIRQS 232#ifdef CONFIG_GENERIC_HARDIRQS
diff --git a/include/linux/io-mapping.h b/include/linux/io-mapping.h
index 8cdcc2a199ad..c81ed2ac16bd 100644
--- a/include/linux/io-mapping.h
+++ b/include/linux/io-mapping.h
@@ -27,7 +27,7 @@
27 * The io_mapping mechanism provides an abstraction for mapping 27 * The io_mapping mechanism provides an abstraction for mapping
28 * individual pages from an io device to the CPU in an efficient fashion. 28 * individual pages from an io device to the CPU in an efficient fashion.
29 * 29 *
30 * See Documentation/io_mapping.txt 30 * See Documentation/io-mapping.txt
31 */ 31 */
32 32
33#ifdef CONFIG_HAVE_ATOMIC_IOMAP 33#ifdef CONFIG_HAVE_ATOMIC_IOMAP
diff --git a/include/linux/ioport.h b/include/linux/ioport.h
index c2ebfe66177c..9d57a71775b5 100644
--- a/include/linux/ioport.h
+++ b/include/linux/ioport.h
@@ -162,6 +162,7 @@ extern int allocate_resource(struct resource *root, struct resource *new,
162 resource_size_t, 162 resource_size_t,
163 resource_size_t), 163 resource_size_t),
164 void *alignf_data); 164 void *alignf_data);
165struct resource *lookup_resource(struct resource *root, resource_size_t start);
165int adjust_resource(struct resource *res, resource_size_t start, 166int adjust_resource(struct resource *res, resource_size_t start,
166 resource_size_t size); 167 resource_size_t size);
167resource_size_t resource_alignment(struct resource *res); 168resource_size_t resource_alignment(struct resource *res);
diff --git a/include/linux/ip6_tunnel.h b/include/linux/ip6_tunnel.h
index acb9ad684d63..bf22b0317902 100644
--- a/include/linux/ip6_tunnel.h
+++ b/include/linux/ip6_tunnel.h
@@ -16,6 +16,8 @@
16#define IP6_TNL_F_MIP6_DEV 0x8 16#define IP6_TNL_F_MIP6_DEV 0x8
17/* copy DSCP from the outer packet */ 17/* copy DSCP from the outer packet */
18#define IP6_TNL_F_RCV_DSCP_COPY 0x10 18#define IP6_TNL_F_RCV_DSCP_COPY 0x10
19/* copy fwmark from inner packet */
20#define IP6_TNL_F_USE_ORIG_FWMARK 0x20
19 21
20struct ip6_tnl_parm { 22struct ip6_tnl_parm {
21 char name[IFNAMSIZ]; /* name of tunnel device */ 23 char name[IFNAMSIZ]; /* name of tunnel device */
diff --git a/include/linux/ipx.h b/include/linux/ipx.h
index aabb1d294025..3d48014cdd71 100644
--- a/include/linux/ipx.h
+++ b/include/linux/ipx.h
@@ -7,7 +7,7 @@
7#define IPX_MTU 576 7#define IPX_MTU 576
8 8
9struct sockaddr_ipx { 9struct sockaddr_ipx {
10 sa_family_t sipx_family; 10 __kernel_sa_family_t sipx_family;
11 __be16 sipx_port; 11 __be16 sipx_port;
12 __be32 sipx_network; 12 __be32 sipx_network;
13 unsigned char sipx_node[IPX_NODE_LEN]; 13 unsigned char sipx_node[IPX_NODE_LEN];
diff --git a/include/linux/irda.h b/include/linux/irda.h
index 00bdad0e8515..a014c3252311 100644
--- a/include/linux/irda.h
+++ b/include/linux/irda.h
@@ -26,12 +26,9 @@
26#define KERNEL_IRDA_H 26#define KERNEL_IRDA_H
27 27
28#include <linux/types.h> 28#include <linux/types.h>
29#include <linux/socket.h>
29 30
30/* Please do *not* add any #include in this file, this file is 31/* Note that this file is shared with user space. */
31 * included as-is in user space.
32 * Please fix the calling file to properly included needed files before
33 * this one, or preferably to include <net/irda/irda.h> instead.
34 * Jean II */
35 32
36/* Hint bit positions for first hint byte */ 33/* Hint bit positions for first hint byte */
37#define HINT_PNP 0x01 34#define HINT_PNP 0x01
@@ -125,7 +122,7 @@ enum {
125#define LSAP_ANY 0xff 122#define LSAP_ANY 0xff
126 123
127struct sockaddr_irda { 124struct sockaddr_irda {
128 sa_family_t sir_family; /* AF_IRDA */ 125 __kernel_sa_family_t sir_family; /* AF_IRDA */
129 __u8 sir_lsap_sel; /* LSAP selector */ 126 __u8 sir_lsap_sel; /* LSAP selector */
130 __u32 sir_addr; /* Device address */ 127 __u32 sir_addr; /* Device address */
131 char sir_name[25]; /* Usually <service>:IrDA:TinyTP */ 128 char sir_name[25]; /* Usually <service>:IrDA:TinyTP */
diff --git a/include/linux/irq.h b/include/linux/irq.h
index 5f695041090c..59e49c80cc2c 100644
--- a/include/linux/irq.h
+++ b/include/linux/irq.h
@@ -23,6 +23,7 @@
23#include <linux/errno.h> 23#include <linux/errno.h>
24#include <linux/topology.h> 24#include <linux/topology.h>
25#include <linux/wait.h> 25#include <linux/wait.h>
26#include <linux/module.h>
26 27
27#include <asm/irq.h> 28#include <asm/irq.h>
28#include <asm/ptrace.h> 29#include <asm/ptrace.h>
@@ -65,6 +66,7 @@ typedef void (*irq_preflow_handler_t)(struct irq_data *data);
65 * IRQ_NO_BALANCING - Interrupt cannot be balanced (affinity set) 66 * IRQ_NO_BALANCING - Interrupt cannot be balanced (affinity set)
66 * IRQ_MOVE_PCNTXT - Interrupt can be migrated from process context 67 * IRQ_MOVE_PCNTXT - Interrupt can be migrated from process context
67 * IRQ_NESTED_TRHEAD - Interrupt nests into another thread 68 * IRQ_NESTED_TRHEAD - Interrupt nests into another thread
69 * IRQ_PER_CPU_DEVID - Dev_id is a per-cpu variable
68 */ 70 */
69enum { 71enum {
70 IRQ_TYPE_NONE = 0x00000000, 72 IRQ_TYPE_NONE = 0x00000000,
@@ -87,12 +89,13 @@ enum {
87 IRQ_MOVE_PCNTXT = (1 << 14), 89 IRQ_MOVE_PCNTXT = (1 << 14),
88 IRQ_NESTED_THREAD = (1 << 15), 90 IRQ_NESTED_THREAD = (1 << 15),
89 IRQ_NOTHREAD = (1 << 16), 91 IRQ_NOTHREAD = (1 << 16),
92 IRQ_PER_CPU_DEVID = (1 << 17),
90}; 93};
91 94
92#define IRQF_MODIFY_MASK \ 95#define IRQF_MODIFY_MASK \
93 (IRQ_TYPE_SENSE_MASK | IRQ_NOPROBE | IRQ_NOREQUEST | \ 96 (IRQ_TYPE_SENSE_MASK | IRQ_NOPROBE | IRQ_NOREQUEST | \
94 IRQ_NOAUTOEN | IRQ_MOVE_PCNTXT | IRQ_LEVEL | IRQ_NO_BALANCING | \ 97 IRQ_NOAUTOEN | IRQ_MOVE_PCNTXT | IRQ_LEVEL | IRQ_NO_BALANCING | \
95 IRQ_PER_CPU | IRQ_NESTED_THREAD) 98 IRQ_PER_CPU | IRQ_NESTED_THREAD | IRQ_NOTHREAD | IRQ_PER_CPU_DEVID)
96 99
97#define IRQ_NO_BALANCING_MASK (IRQ_PER_CPU | IRQ_NO_BALANCING) 100#define IRQ_NO_BALANCING_MASK (IRQ_PER_CPU | IRQ_NO_BALANCING)
98 101
@@ -108,14 +111,18 @@ enum {
108}; 111};
109 112
110struct msi_desc; 113struct msi_desc;
114struct irq_domain;
111 115
112/** 116/**
113 * struct irq_data - per irq and irq chip data passed down to chip functions 117 * struct irq_data - per irq and irq chip data passed down to chip functions
114 * @irq: interrupt number 118 * @irq: interrupt number
119 * @hwirq: hardware interrupt number, local to the interrupt domain
115 * @node: node index useful for balancing 120 * @node: node index useful for balancing
116 * @state_use_accessors: status information for irq chip functions. 121 * @state_use_accessors: status information for irq chip functions.
117 * Use accessor functions to deal with it 122 * Use accessor functions to deal with it
118 * @chip: low level interrupt hardware access 123 * @chip: low level interrupt hardware access
124 * @domain: Interrupt translation domain; responsible for mapping
125 * between hwirq number and linux irq number.
119 * @handler_data: per-IRQ data for the irq_chip methods 126 * @handler_data: per-IRQ data for the irq_chip methods
120 * @chip_data: platform-specific per-chip private data for the chip 127 * @chip_data: platform-specific per-chip private data for the chip
121 * methods, to allow shared chip implementations 128 * methods, to allow shared chip implementations
@@ -128,9 +135,11 @@ struct msi_desc;
128 */ 135 */
129struct irq_data { 136struct irq_data {
130 unsigned int irq; 137 unsigned int irq;
138 unsigned long hwirq;
131 unsigned int node; 139 unsigned int node;
132 unsigned int state_use_accessors; 140 unsigned int state_use_accessors;
133 struct irq_chip *chip; 141 struct irq_chip *chip;
142 struct irq_domain *domain;
134 void *handler_data; 143 void *handler_data;
135 void *chip_data; 144 void *chip_data;
136 struct msi_desc *msi_desc; 145 struct msi_desc *msi_desc;
@@ -329,12 +338,14 @@ struct irq_chip {
329 * IRQCHIP_MASK_ON_SUSPEND: Mask non wake irqs in the suspend path 338 * IRQCHIP_MASK_ON_SUSPEND: Mask non wake irqs in the suspend path
330 * IRQCHIP_ONOFFLINE_ENABLED: Only call irq_on/off_line callbacks 339 * IRQCHIP_ONOFFLINE_ENABLED: Only call irq_on/off_line callbacks
331 * when irq enabled 340 * when irq enabled
341 * IRQCHIP_SKIP_SET_WAKE: Skip chip.irq_set_wake(), for this irq chip
332 */ 342 */
333enum { 343enum {
334 IRQCHIP_SET_TYPE_MASKED = (1 << 0), 344 IRQCHIP_SET_TYPE_MASKED = (1 << 0),
335 IRQCHIP_EOI_IF_HANDLED = (1 << 1), 345 IRQCHIP_EOI_IF_HANDLED = (1 << 1),
336 IRQCHIP_MASK_ON_SUSPEND = (1 << 2), 346 IRQCHIP_MASK_ON_SUSPEND = (1 << 2),
337 IRQCHIP_ONOFFLINE_ENABLED = (1 << 3), 347 IRQCHIP_ONOFFLINE_ENABLED = (1 << 3),
348 IRQCHIP_SKIP_SET_WAKE = (1 << 4),
338}; 349};
339 350
340/* This include will go away once we isolated irq_desc usage to core code */ 351/* This include will go away once we isolated irq_desc usage to core code */
@@ -358,6 +369,8 @@ enum {
358struct irqaction; 369struct irqaction;
359extern int setup_irq(unsigned int irq, struct irqaction *new); 370extern int setup_irq(unsigned int irq, struct irqaction *new);
360extern void remove_irq(unsigned int irq, struct irqaction *act); 371extern void remove_irq(unsigned int irq, struct irqaction *act);
372extern int setup_percpu_irq(unsigned int irq, struct irqaction *new);
373extern void remove_percpu_irq(unsigned int irq, struct irqaction *act);
361 374
362extern void irq_cpu_online(void); 375extern void irq_cpu_online(void);
363extern void irq_cpu_offline(void); 376extern void irq_cpu_offline(void);
@@ -385,6 +398,7 @@ extern void handle_edge_irq(unsigned int irq, struct irq_desc *desc);
385extern void handle_edge_eoi_irq(unsigned int irq, struct irq_desc *desc); 398extern void handle_edge_eoi_irq(unsigned int irq, struct irq_desc *desc);
386extern void handle_simple_irq(unsigned int irq, struct irq_desc *desc); 399extern void handle_simple_irq(unsigned int irq, struct irq_desc *desc);
387extern void handle_percpu_irq(unsigned int irq, struct irq_desc *desc); 400extern void handle_percpu_irq(unsigned int irq, struct irq_desc *desc);
401extern void handle_percpu_devid_irq(unsigned int irq, struct irq_desc *desc);
388extern void handle_bad_irq(unsigned int irq, struct irq_desc *desc); 402extern void handle_bad_irq(unsigned int irq, struct irq_desc *desc);
389extern void handle_nested_irq(unsigned int irq); 403extern void handle_nested_irq(unsigned int irq);
390 404
@@ -413,6 +427,8 @@ static inline void irq_set_chip_and_handler(unsigned int irq, struct irq_chip *c
413 irq_set_chip_and_handler_name(irq, chip, handle, NULL); 427 irq_set_chip_and_handler_name(irq, chip, handle, NULL);
414} 428}
415 429
430extern int irq_set_percpu_devid(unsigned int irq);
431
416extern void 432extern void
417__irq_set_handler(unsigned int irq, irq_flow_handler_t handle, int is_chained, 433__irq_set_handler(unsigned int irq, irq_flow_handler_t handle, int is_chained,
418 const char *name); 434 const char *name);
@@ -474,6 +490,13 @@ static inline void irq_set_nested_thread(unsigned int irq, bool nest)
474 irq_clear_status_flags(irq, IRQ_NESTED_THREAD); 490 irq_clear_status_flags(irq, IRQ_NESTED_THREAD);
475} 491}
476 492
493static inline void irq_set_percpu_devid_flags(unsigned int irq)
494{
495 irq_set_status_flags(irq,
496 IRQ_NOAUTOEN | IRQ_PER_CPU | IRQ_NOTHREAD |
497 IRQ_NOPROBE | IRQ_PER_CPU_DEVID);
498}
499
477/* Handle dynamic irq creation and destruction */ 500/* Handle dynamic irq creation and destruction */
478extern unsigned int create_irq_nr(unsigned int irq_want, int node); 501extern unsigned int create_irq_nr(unsigned int irq_want, int node);
479extern int create_irq(void); 502extern int create_irq(void);
@@ -541,7 +564,15 @@ static inline struct msi_desc *irq_data_get_msi(struct irq_data *d)
541 return d->msi_desc; 564 return d->msi_desc;
542} 565}
543 566
544int irq_alloc_descs(int irq, unsigned int from, unsigned int cnt, int node); 567int __irq_alloc_descs(int irq, unsigned int from, unsigned int cnt, int node,
568 struct module *owner);
569
570static inline int irq_alloc_descs(int irq, unsigned int from, unsigned int cnt,
571 int node)
572{
573 return __irq_alloc_descs(irq, from, cnt, node, THIS_MODULE);
574}
575
545void irq_free_descs(unsigned int irq, unsigned int cnt); 576void irq_free_descs(unsigned int irq, unsigned int cnt);
546int irq_reserve_irqs(unsigned int from, unsigned int cnt); 577int irq_reserve_irqs(unsigned int from, unsigned int cnt);
547 578
diff --git a/include/linux/irq_work.h b/include/linux/irq_work.h
index 4fa09d4d0b71..6a9e8f5399e2 100644
--- a/include/linux/irq_work.h
+++ b/include/linux/irq_work.h
@@ -1,20 +1,23 @@
1#ifndef _LINUX_IRQ_WORK_H 1#ifndef _LINUX_IRQ_WORK_H
2#define _LINUX_IRQ_WORK_H 2#define _LINUX_IRQ_WORK_H
3 3
4#include <linux/llist.h>
5
4struct irq_work { 6struct irq_work {
5 struct irq_work *next; 7 unsigned long flags;
8 struct llist_node llnode;
6 void (*func)(struct irq_work *); 9 void (*func)(struct irq_work *);
7}; 10};
8 11
9static inline 12static inline
10void init_irq_work(struct irq_work *entry, void (*func)(struct irq_work *)) 13void init_irq_work(struct irq_work *work, void (*func)(struct irq_work *))
11{ 14{
12 entry->next = NULL; 15 work->flags = 0;
13 entry->func = func; 16 work->func = func;
14} 17}
15 18
16bool irq_work_queue(struct irq_work *entry); 19bool irq_work_queue(struct irq_work *work);
17void irq_work_run(void); 20void irq_work_run(void);
18void irq_work_sync(struct irq_work *entry); 21void irq_work_sync(struct irq_work *work);
19 22
20#endif /* _LINUX_IRQ_WORK_H */ 23#endif /* _LINUX_IRQ_WORK_H */
diff --git a/include/linux/irqdesc.h b/include/linux/irqdesc.h
index 2d921b35212c..6b69c2c9dff1 100644
--- a/include/linux/irqdesc.h
+++ b/include/linux/irqdesc.h
@@ -53,6 +53,7 @@ struct irq_desc {
53 unsigned long last_unhandled; /* Aging timer for unhandled count */ 53 unsigned long last_unhandled; /* Aging timer for unhandled count */
54 unsigned int irqs_unhandled; 54 unsigned int irqs_unhandled;
55 raw_spinlock_t lock; 55 raw_spinlock_t lock;
56 struct cpumask *percpu_enabled;
56#ifdef CONFIG_SMP 57#ifdef CONFIG_SMP
57 const struct cpumask *affinity_hint; 58 const struct cpumask *affinity_hint;
58 struct irq_affinity_notify *affinity_notify; 59 struct irq_affinity_notify *affinity_notify;
@@ -66,6 +67,7 @@ struct irq_desc {
66#ifdef CONFIG_PROC_FS 67#ifdef CONFIG_PROC_FS
67 struct proc_dir_entry *dir; 68 struct proc_dir_entry *dir;
68#endif 69#endif
70 struct module *owner;
69 const char *name; 71 const char *name;
70} ____cacheline_internodealigned_in_smp; 72} ____cacheline_internodealigned_in_smp;
71 73
diff --git a/include/linux/irqdomain.h b/include/linux/irqdomain.h
new file mode 100644
index 000000000000..3ad553e8eae2
--- /dev/null
+++ b/include/linux/irqdomain.h
@@ -0,0 +1,92 @@
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 struct irq_domain_ops irq_domain_simple_ops;
84extern void irq_domain_add_simple(struct device_node *controller, int irq_base);
85extern void irq_domain_generate_simple(const struct of_device_id *match,
86 u64 phys_base, unsigned int irq_start);
87#else /* CONFIG_IRQ_DOMAIN && CONFIG_OF_IRQ */
88static inline void irq_domain_generate_simple(const struct of_device_id *match,
89 u64 phys_base, unsigned int irq_start) { }
90#endif /* CONFIG_IRQ_DOMAIN && CONFIG_OF_IRQ */
91
92#endif /* _LINUX_IRQDOMAIN_H */
diff --git a/include/linux/isdn.h b/include/linux/isdn.h
index 44cd663c53b6..4ccf95d681b4 100644
--- a/include/linux/isdn.h
+++ b/include/linux/isdn.h
@@ -68,7 +68,7 @@
68#define ISDN_NET_ENCAP_SYNCPPP 4 68#define ISDN_NET_ENCAP_SYNCPPP 4
69#define ISDN_NET_ENCAP_UIHDLC 5 69#define ISDN_NET_ENCAP_UIHDLC 5
70#define ISDN_NET_ENCAP_CISCOHDLCK 6 /* With SLARP and keepalive */ 70#define ISDN_NET_ENCAP_CISCOHDLCK 6 /* With SLARP and keepalive */
71#define ISDN_NET_ENCAP_X25IFACE 7 /* Documentation/networking/x25-iface.txt*/ 71#define ISDN_NET_ENCAP_X25IFACE 7 /* Documentation/networking/x25-iface.txt */
72#define ISDN_NET_ENCAP_MAX_ENCAP ISDN_NET_ENCAP_X25IFACE 72#define ISDN_NET_ENCAP_MAX_ENCAP ISDN_NET_ENCAP_X25IFACE
73 73
74/* Facility which currently uses an ISDN-channel */ 74/* Facility which currently uses an ISDN-channel */
diff --git a/include/linux/jbd2.h b/include/linux/jbd2.h
index d087c2e7b2aa..38f307b8c334 100644
--- a/include/linux/jbd2.h
+++ b/include/linux/jbd2.h
@@ -1329,12 +1329,6 @@ extern int jbd_blocks_per_page(struct inode *inode);
1329#define BUFFER_TRACE2(bh, bh2, info) do {} while (0) 1329#define BUFFER_TRACE2(bh, bh2, info) do {} while (0)
1330#define JBUFFER_TRACE(jh, info) do {} while (0) 1330#define JBUFFER_TRACE(jh, info) do {} while (0)
1331 1331
1332/*
1333 * jbd2_dev_to_name is a utility function used by the jbd2 and ext4
1334 * tracing infrastructure to map a dev_t to a device name.
1335 */
1336extern const char *jbd2_dev_to_name(dev_t device);
1337
1338#endif /* __KERNEL__ */ 1332#endif /* __KERNEL__ */
1339 1333
1340#endif /* _LINUX_JBD2_H */ 1334#endif /* _LINUX_JBD2_H */
diff --git a/include/linux/jiffies.h b/include/linux/jiffies.h
index f97672a36fa8..265e2c3cbd1c 100644
--- a/include/linux/jiffies.h
+++ b/include/linux/jiffies.h
@@ -303,7 +303,7 @@ extern void jiffies_to_timespec(const unsigned long jiffies,
303extern unsigned long timeval_to_jiffies(const struct timeval *value); 303extern unsigned long timeval_to_jiffies(const struct timeval *value);
304extern void jiffies_to_timeval(const unsigned long jiffies, 304extern void jiffies_to_timeval(const unsigned long jiffies,
305 struct timeval *value); 305 struct timeval *value);
306extern clock_t jiffies_to_clock_t(long x); 306extern clock_t jiffies_to_clock_t(unsigned long x);
307extern unsigned long clock_t_to_jiffies(unsigned long x); 307extern unsigned long clock_t_to_jiffies(unsigned long x);
308extern u64 jiffies_64_to_clock_t(u64 x); 308extern u64 jiffies_64_to_clock_t(u64 x);
309extern u64 nsec_to_clock_t(u64 x); 309extern u64 nsec_to_clock_t(u64 x);
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/kernel.h b/include/linux/kernel.h
index 46ac9a50528d..8eefcf7e95eb 100644
--- a/include/linux/kernel.h
+++ b/include/linux/kernel.h
@@ -382,7 +382,7 @@ static inline char *pack_hex_byte(char *buf, u8 byte)
382} 382}
383 383
384extern int hex_to_bin(char ch); 384extern int hex_to_bin(char ch);
385extern void hex2bin(u8 *dst, const char *src, size_t count); 385extern int __must_check hex2bin(u8 *dst, const char *src, size_t count);
386 386
387/* 387/*
388 * General tracing related utility functions - trace_printk(), 388 * General tracing related utility functions - trace_printk(),
diff --git a/include/linux/kprobes.h b/include/linux/kprobes.h
index dd7c12e875bc..dce6e4dbeda7 100644
--- a/include/linux/kprobes.h
+++ b/include/linux/kprobes.h
@@ -181,7 +181,7 @@ struct kretprobe {
181 int nmissed; 181 int nmissed;
182 size_t data_size; 182 size_t data_size;
183 struct hlist_head free_instances; 183 struct hlist_head free_instances;
184 spinlock_t lock; 184 raw_spinlock_t lock;
185}; 185};
186 186
187struct kretprobe_instance { 187struct kretprobe_instance {
diff --git a/include/linux/kvm.h b/include/linux/kvm.h
index 2c366b52f505..aace6b8691a2 100644
--- a/include/linux/kvm.h
+++ b/include/linux/kvm.h
@@ -553,6 +553,7 @@ struct kvm_ppc_pvinfo {
553#define KVM_CAP_SPAPR_TCE 63 553#define KVM_CAP_SPAPR_TCE 63
554#define KVM_CAP_PPC_SMT 64 554#define KVM_CAP_PPC_SMT 64
555#define KVM_CAP_PPC_RMA 65 555#define KVM_CAP_PPC_RMA 65
556#define KVM_CAP_S390_GMAP 71
556 557
557#ifdef KVM_CAP_IRQ_ROUTING 558#ifdef KVM_CAP_IRQ_ROUTING
558 559
diff --git a/include/linux/l2tp.h b/include/linux/l2tp.h
index 4bdb31df8e72..e77d7f9bb246 100644
--- a/include/linux/l2tp.h
+++ b/include/linux/l2tp.h
@@ -8,8 +8,8 @@
8#define _LINUX_L2TP_H_ 8#define _LINUX_L2TP_H_
9 9
10#include <linux/types.h> 10#include <linux/types.h>
11#ifdef __KERNEL__
12#include <linux/socket.h> 11#include <linux/socket.h>
12#ifdef __KERNEL__
13#include <linux/in.h> 13#include <linux/in.h>
14#else 14#else
15#include <netinet/in.h> 15#include <netinet/in.h>
@@ -26,14 +26,15 @@
26#define __SOCK_SIZE__ 16 /* sizeof(struct sockaddr) */ 26#define __SOCK_SIZE__ 16 /* sizeof(struct sockaddr) */
27struct sockaddr_l2tpip { 27struct sockaddr_l2tpip {
28 /* The first fields must match struct sockaddr_in */ 28 /* The first fields must match struct sockaddr_in */
29 sa_family_t l2tp_family; /* AF_INET */ 29 __kernel_sa_family_t l2tp_family; /* AF_INET */
30 __be16 l2tp_unused; /* INET port number (unused) */ 30 __be16 l2tp_unused; /* INET port number (unused) */
31 struct in_addr l2tp_addr; /* Internet address */ 31 struct in_addr l2tp_addr; /* Internet address */
32 32
33 __u32 l2tp_conn_id; /* Connection ID of tunnel */ 33 __u32 l2tp_conn_id; /* Connection ID of tunnel */
34 34
35 /* Pad to size of `struct sockaddr'. */ 35 /* Pad to size of `struct sockaddr'. */
36 unsigned char __pad[sizeof(struct sockaddr) - sizeof(sa_family_t) - 36 unsigned char __pad[sizeof(struct sockaddr) -
37 sizeof(__kernel_sa_family_t) -
37 sizeof(__be16) - sizeof(struct in_addr) - 38 sizeof(__be16) - sizeof(struct in_addr) -
38 sizeof(__u32)]; 39 sizeof(__u32)];
39}; 40};
diff --git a/include/linux/lapb.h b/include/linux/lapb.h
index ce709e1885cc..873c1eb635e4 100644
--- a/include/linux/lapb.h
+++ b/include/linux/lapb.h
@@ -44,7 +44,8 @@ struct lapb_parms_struct {
44 unsigned int mode; 44 unsigned int mode;
45}; 45};
46 46
47extern int lapb_register(struct net_device *dev, struct lapb_register_struct *callbacks); 47extern int lapb_register(struct net_device *dev,
48 const struct lapb_register_struct *callbacks);
48extern int lapb_unregister(struct net_device *dev); 49extern int lapb_unregister(struct net_device *dev);
49extern int lapb_getparms(struct net_device *dev, struct lapb_parms_struct *parms); 50extern int lapb_getparms(struct net_device *dev, struct lapb_parms_struct *parms);
50extern int lapb_setparms(struct net_device *dev, struct lapb_parms_struct *parms); 51extern int lapb_setparms(struct net_device *dev, struct lapb_parms_struct *parms);
diff --git a/include/linux/llc.h b/include/linux/llc.h
index ad7074ba81af..a2418ae13ee9 100644
--- a/include/linux/llc.h
+++ b/include/linux/llc.h
@@ -12,16 +12,20 @@
12 * 12 *
13 * See the GNU General Public License for more details. 13 * See the GNU General Public License for more details.
14 */ 14 */
15
16#include <linux/socket.h>
17
15#define __LLC_SOCK_SIZE__ 16 /* sizeof(sockaddr_llc), word align. */ 18#define __LLC_SOCK_SIZE__ 16 /* sizeof(sockaddr_llc), word align. */
16struct sockaddr_llc { 19struct sockaddr_llc {
17 sa_family_t sllc_family; /* AF_LLC */ 20 __kernel_sa_family_t sllc_family; /* AF_LLC */
18 sa_family_t sllc_arphrd; /* ARPHRD_ETHER */ 21 __kernel_sa_family_t sllc_arphrd; /* ARPHRD_ETHER */
19 unsigned char sllc_test; 22 unsigned char sllc_test;
20 unsigned char sllc_xid; 23 unsigned char sllc_xid;
21 unsigned char sllc_ua; /* UA data, only for SOCK_STREAM. */ 24 unsigned char sllc_ua; /* UA data, only for SOCK_STREAM. */
22 unsigned char sllc_sap; 25 unsigned char sllc_sap;
23 unsigned char sllc_mac[IFHWADDRLEN]; 26 unsigned char sllc_mac[IFHWADDRLEN];
24 unsigned char __pad[__LLC_SOCK_SIZE__ - sizeof(sa_family_t) * 2 - 27 unsigned char __pad[__LLC_SOCK_SIZE__ -
28 sizeof(__kernel_sa_family_t) * 2 -
25 sizeof(unsigned char) * 4 - IFHWADDRLEN]; 29 sizeof(unsigned char) * 4 - IFHWADDRLEN];
26}; 30};
27 31
diff --git a/include/linux/llist.h b/include/linux/llist.h
new file mode 100644
index 000000000000..7287734e08d1
--- /dev/null
+++ b/include/linux/llist.h
@@ -0,0 +1,187 @@
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 handlers. So code that uses the list in
39 * an NMI handler should depend on CONFIG_ARCH_HAVE_NMI_SAFE_CMPXCHG.
40 *
41 * Copyright 2010,2011 Intel Corp.
42 * Author: Huang Ying <ying.huang@intel.com>
43 *
44 * This program is free software; you can redistribute it and/or
45 * modify it under the terms of the GNU General Public License version
46 * 2 as published by the Free Software Foundation;
47 *
48 * This program is distributed in the hope that it will be useful,
49 * but WITHOUT ANY WARRANTY; without even the implied warranty of
50 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
51 * GNU General Public License for more details.
52 *
53 * You should have received a copy of the GNU General Public License
54 * along with this program; if not, write to the Free Software
55 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
56 */
57
58#include <linux/kernel.h>
59#include <asm/system.h>
60#include <asm/processor.h>
61
62struct llist_head {
63 struct llist_node *first;
64};
65
66struct llist_node {
67 struct llist_node *next;
68};
69
70#define LLIST_HEAD_INIT(name) { NULL }
71#define LLIST_HEAD(name) struct llist_head name = LLIST_HEAD_INIT(name)
72
73/**
74 * init_llist_head - initialize lock-less list head
75 * @head: the head for your lock-less list
76 */
77static inline void init_llist_head(struct llist_head *list)
78{
79 list->first = NULL;
80}
81
82/**
83 * llist_entry - get the struct of this entry
84 * @ptr: the &struct llist_node pointer.
85 * @type: the type of the struct this is embedded in.
86 * @member: the name of the llist_node within the struct.
87 */
88#define llist_entry(ptr, type, member) \
89 container_of(ptr, type, member)
90
91/**
92 * llist_for_each - iterate over some deleted entries of a lock-less list
93 * @pos: the &struct llist_node to use as a loop cursor
94 * @node: the first entry of deleted list entries
95 *
96 * In general, some entries of the lock-less list can be traversed
97 * safely only after being deleted from list, so start with an entry
98 * instead of list head.
99 *
100 * If being used on entries deleted from lock-less list directly, the
101 * traverse order is from the newest to the oldest added entry. If
102 * you want to traverse from the oldest to the newest, you must
103 * reverse the order by yourself before traversing.
104 */
105#define llist_for_each(pos, node) \
106 for ((pos) = (node); pos; (pos) = (pos)->next)
107
108/**
109 * llist_for_each_entry - iterate over some deleted entries of lock-less list of given type
110 * @pos: the type * to use as a loop cursor.
111 * @node: the fist entry of deleted list entries.
112 * @member: the name of the llist_node with the struct.
113 *
114 * In general, some entries of the lock-less list can be traversed
115 * safely only after being removed from list, so start with an entry
116 * instead of list head.
117 *
118 * If being used on entries deleted from lock-less list directly, the
119 * traverse order is from the newest to the oldest added entry. If
120 * you want to traverse from the oldest to the newest, you must
121 * reverse the order by yourself before traversing.
122 */
123#define llist_for_each_entry(pos, node, member) \
124 for ((pos) = llist_entry((node), typeof(*(pos)), member); \
125 &(pos)->member != NULL; \
126 (pos) = llist_entry((pos)->member.next, typeof(*(pos)), member))
127
128/**
129 * llist_empty - tests whether a lock-less list is empty
130 * @head: the list to test
131 *
132 * Not guaranteed to be accurate or up to date. Just a quick way to
133 * test whether the list is empty without deleting something from the
134 * list.
135 */
136static inline bool llist_empty(const struct llist_head *head)
137{
138 return ACCESS_ONCE(head->first) == NULL;
139}
140
141static inline struct llist_node *llist_next(struct llist_node *node)
142{
143 return node->next;
144}
145
146/**
147 * llist_add - add a new entry
148 * @new: new entry to be added
149 * @head: the head for your lock-less list
150 *
151 * Return whether list is empty before adding.
152 */
153static inline bool llist_add(struct llist_node *new, struct llist_head *head)
154{
155 struct llist_node *entry, *old_entry;
156
157 entry = head->first;
158 for (;;) {
159 old_entry = entry;
160 new->next = entry;
161 entry = cmpxchg(&head->first, old_entry, new);
162 if (entry == old_entry)
163 break;
164 }
165
166 return old_entry == NULL;
167}
168
169/**
170 * llist_del_all - delete all entries from lock-less list
171 * @head: the head of lock-less list to delete all entries
172 *
173 * If list is empty, return NULL, otherwise, delete all entries and
174 * return the pointer to the first entry. The order of entries
175 * deleted is from the newest to the oldest added one.
176 */
177static inline struct llist_node *llist_del_all(struct llist_head *head)
178{
179 return xchg(&head->first, NULL);
180}
181
182extern bool llist_add_batch(struct llist_node *new_first,
183 struct llist_node *new_last,
184 struct llist_head *head);
185extern struct llist_node *llist_del_first(struct llist_head *head);
186
187#endif /* LLIST_H */
diff --git a/include/linux/lockdep.h b/include/linux/lockdep.h
index ef820a3c378b..b6a56e37284c 100644
--- a/include/linux/lockdep.h
+++ b/include/linux/lockdep.h
@@ -548,7 +548,7 @@ do { \
548#endif 548#endif
549 549
550#ifdef CONFIG_PROVE_RCU 550#ifdef CONFIG_PROVE_RCU
551extern void lockdep_rcu_dereference(const char *file, const int line); 551void lockdep_rcu_suspicious(const char *file, const int line, const char *s);
552#endif 552#endif
553 553
554#endif /* __LINUX_LOCKDEP_H */ 554#endif /* __LINUX_LOCKDEP_H */
diff --git a/include/linux/loop.h b/include/linux/loop.h
index 66c194e2d9b9..683d69890119 100644
--- a/include/linux/loop.h
+++ b/include/linux/loop.h
@@ -64,7 +64,6 @@ struct loop_device {
64 64
65 struct request_queue *lo_queue; 65 struct request_queue *lo_queue;
66 struct gendisk *lo_disk; 66 struct gendisk *lo_disk;
67 struct list_head lo_list;
68}; 67};
69 68
70#endif /* __KERNEL__ */ 69#endif /* __KERNEL__ */
@@ -161,4 +160,8 @@ int loop_unregister_transfer(int number);
161#define LOOP_CHANGE_FD 0x4C06 160#define LOOP_CHANGE_FD 0x4C06
162#define LOOP_SET_CAPACITY 0x4C07 161#define LOOP_SET_CAPACITY 0x4C07
163 162
163/* /dev/loop-control interface */
164#define LOOP_CTL_ADD 0x4C80
165#define LOOP_CTL_REMOVE 0x4C81
166#define LOOP_CTL_GET_FREE 0x4C82
164#endif 167#endif
diff --git a/include/linux/memcontrol.h b/include/linux/memcontrol.h
index b96600786913..343bd7661f2a 100644
--- a/include/linux/memcontrol.h
+++ b/include/linux/memcontrol.h
@@ -39,16 +39,6 @@ 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
52#ifdef CONFIG_CGROUP_MEM_RES_CTLR 42#ifdef CONFIG_CGROUP_MEM_RES_CTLR
53/* 43/*
54 * All "charge" functions with gfp_mask should use GFP_KERNEL or 44 * All "charge" functions with gfp_mask should use GFP_KERNEL or
@@ -86,8 +76,6 @@ extern void mem_cgroup_uncharge_end(void);
86 76
87extern void mem_cgroup_uncharge_page(struct page *page); 77extern void mem_cgroup_uncharge_page(struct page *page);
88extern void mem_cgroup_uncharge_cache_page(struct page *page); 78extern void mem_cgroup_uncharge_cache_page(struct page *page);
89extern int mem_cgroup_shmem_charge_fallback(struct page *page,
90 struct mm_struct *mm, gfp_t gfp_mask);
91 79
92extern void mem_cgroup_out_of_memory(struct mem_cgroup *mem, gfp_t gfp_mask); 80extern void mem_cgroup_out_of_memory(struct mem_cgroup *mem, gfp_t gfp_mask);
93int task_in_mem_cgroup(struct task_struct *task, const struct mem_cgroup *mem); 81int task_in_mem_cgroup(struct task_struct *task, const struct mem_cgroup *mem);
@@ -129,15 +117,6 @@ mem_cgroup_get_reclaim_stat_from_page(struct page *page);
129extern void mem_cgroup_print_oom_info(struct mem_cgroup *memcg, 117extern void mem_cgroup_print_oom_info(struct mem_cgroup *memcg,
130 struct task_struct *p); 118 struct task_struct *p);
131 119
132extern unsigned long try_to_free_mem_cgroup_pages(struct mem_cgroup *mem,
133 gfp_t gfp_mask, bool noswap,
134 struct memcg_scanrecord *rec);
135extern unsigned long mem_cgroup_shrink_node_zone(struct mem_cgroup *mem,
136 gfp_t gfp_mask, bool noswap,
137 struct zone *zone,
138 struct memcg_scanrecord *rec,
139 unsigned long *nr_scanned);
140
141#ifdef CONFIG_CGROUP_MEM_RES_CTLR_SWAP 120#ifdef CONFIG_CGROUP_MEM_RES_CTLR_SWAP
142extern int do_swap_account; 121extern int do_swap_account;
143#endif 122#endif
@@ -225,12 +204,6 @@ static inline void mem_cgroup_uncharge_cache_page(struct page *page)
225{ 204{
226} 205}
227 206
228static inline int mem_cgroup_shmem_charge_fallback(struct page *page,
229 struct mm_struct *mm, gfp_t gfp_mask)
230{
231 return 0;
232}
233
234static inline void mem_cgroup_add_lru_list(struct page *page, int lru) 207static inline void mem_cgroup_add_lru_list(struct page *page, int lru)
235{ 208{
236} 209}
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/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/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/tps65910.h b/include/linux/mfd/tps65910.h
index 73572c65d04f..82b4c8801a4f 100644
--- a/include/linux/mfd/tps65910.h
+++ b/include/linux/mfd/tps65910.h
@@ -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/wm831x/core.h b/include/linux/mfd/wm831x/core.h
index 0d515ee1c247..ed8fe0d04097 100644
--- a/include/linux/mfd/wm831x/core.h
+++ b/include/linux/mfd/wm831x/core.h
@@ -17,6 +17,8 @@
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>
21#include <linux/regmap.h>
20 22
21/* 23/*
22 * Register values. 24 * Register values.
@@ -234,9 +236,111 @@
234#define WM831X_ON_PIN_TO_SHIFT 0 /* ON_PIN_TO - [1:0] */ 236#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] */ 237#define WM831X_ON_PIN_TO_WIDTH 2 /* ON_PIN_TO - [1:0] */
236 238
239/*
240 * R16528 (0x4090) - Clock Control 1
241 */
242#define WM831X_CLKOUT_ENA 0x8000 /* CLKOUT_ENA */
243#define WM831X_CLKOUT_ENA_MASK 0x8000 /* CLKOUT_ENA */
244#define WM831X_CLKOUT_ENA_SHIFT 15 /* CLKOUT_ENA */
245#define WM831X_CLKOUT_ENA_WIDTH 1 /* CLKOUT_ENA */
246#define WM831X_CLKOUT_OD 0x2000 /* CLKOUT_OD */
247#define WM831X_CLKOUT_OD_MASK 0x2000 /* CLKOUT_OD */
248#define WM831X_CLKOUT_OD_SHIFT 13 /* CLKOUT_OD */
249#define WM831X_CLKOUT_OD_WIDTH 1 /* CLKOUT_OD */
250#define WM831X_CLKOUT_SLOT_MASK 0x0700 /* CLKOUT_SLOT - [10:8] */
251#define WM831X_CLKOUT_SLOT_SHIFT 8 /* CLKOUT_SLOT - [10:8] */
252#define WM831X_CLKOUT_SLOT_WIDTH 3 /* CLKOUT_SLOT - [10:8] */
253#define WM831X_CLKOUT_SLPSLOT_MASK 0x0070 /* CLKOUT_SLPSLOT - [6:4] */
254#define WM831X_CLKOUT_SLPSLOT_SHIFT 4 /* CLKOUT_SLPSLOT - [6:4] */
255#define WM831X_CLKOUT_SLPSLOT_WIDTH 3 /* CLKOUT_SLPSLOT - [6:4] */
256#define WM831X_CLKOUT_SRC 0x0001 /* CLKOUT_SRC */
257#define WM831X_CLKOUT_SRC_MASK 0x0001 /* CLKOUT_SRC */
258#define WM831X_CLKOUT_SRC_SHIFT 0 /* CLKOUT_SRC */
259#define WM831X_CLKOUT_SRC_WIDTH 1 /* CLKOUT_SRC */
260
261/*
262 * R16529 (0x4091) - Clock Control 2
263 */
264#define WM831X_XTAL_INH 0x8000 /* XTAL_INH */
265#define WM831X_XTAL_INH_MASK 0x8000 /* XTAL_INH */
266#define WM831X_XTAL_INH_SHIFT 15 /* XTAL_INH */
267#define WM831X_XTAL_INH_WIDTH 1 /* XTAL_INH */
268#define WM831X_XTAL_ENA 0x2000 /* XTAL_ENA */
269#define WM831X_XTAL_ENA_MASK 0x2000 /* XTAL_ENA */
270#define WM831X_XTAL_ENA_SHIFT 13 /* XTAL_ENA */
271#define WM831X_XTAL_ENA_WIDTH 1 /* XTAL_ENA */
272#define WM831X_XTAL_BKUPENA 0x1000 /* XTAL_BKUPENA */
273#define WM831X_XTAL_BKUPENA_MASK 0x1000 /* XTAL_BKUPENA */
274#define WM831X_XTAL_BKUPENA_SHIFT 12 /* XTAL_BKUPENA */
275#define WM831X_XTAL_BKUPENA_WIDTH 1 /* XTAL_BKUPENA */
276#define WM831X_FLL_AUTO 0x0080 /* FLL_AUTO */
277#define WM831X_FLL_AUTO_MASK 0x0080 /* FLL_AUTO */
278#define WM831X_FLL_AUTO_SHIFT 7 /* FLL_AUTO */
279#define WM831X_FLL_AUTO_WIDTH 1 /* FLL_AUTO */
280#define WM831X_FLL_AUTO_FREQ_MASK 0x0007 /* FLL_AUTO_FREQ - [2:0] */
281#define WM831X_FLL_AUTO_FREQ_SHIFT 0 /* FLL_AUTO_FREQ - [2:0] */
282#define WM831X_FLL_AUTO_FREQ_WIDTH 3 /* FLL_AUTO_FREQ - [2:0] */
283
284/*
285 * R16530 (0x4092) - FLL Control 1
286 */
287#define WM831X_FLL_FRAC 0x0004 /* FLL_FRAC */
288#define WM831X_FLL_FRAC_MASK 0x0004 /* FLL_FRAC */
289#define WM831X_FLL_FRAC_SHIFT 2 /* FLL_FRAC */
290#define WM831X_FLL_FRAC_WIDTH 1 /* FLL_FRAC */
291#define WM831X_FLL_OSC_ENA 0x0002 /* FLL_OSC_ENA */
292#define WM831X_FLL_OSC_ENA_MASK 0x0002 /* FLL_OSC_ENA */
293#define WM831X_FLL_OSC_ENA_SHIFT 1 /* FLL_OSC_ENA */
294#define WM831X_FLL_OSC_ENA_WIDTH 1 /* FLL_OSC_ENA */
295#define WM831X_FLL_ENA 0x0001 /* FLL_ENA */
296#define WM831X_FLL_ENA_MASK 0x0001 /* FLL_ENA */
297#define WM831X_FLL_ENA_SHIFT 0 /* FLL_ENA */
298#define WM831X_FLL_ENA_WIDTH 1 /* FLL_ENA */
299
300/*
301 * R16531 (0x4093) - FLL Control 2
302 */
303#define WM831X_FLL_OUTDIV_MASK 0x3F00 /* FLL_OUTDIV - [13:8] */
304#define WM831X_FLL_OUTDIV_SHIFT 8 /* FLL_OUTDIV - [13:8] */
305#define WM831X_FLL_OUTDIV_WIDTH 6 /* FLL_OUTDIV - [13:8] */
306#define WM831X_FLL_CTRL_RATE_MASK 0x0070 /* FLL_CTRL_RATE - [6:4] */
307#define WM831X_FLL_CTRL_RATE_SHIFT 4 /* FLL_CTRL_RATE - [6:4] */
308#define WM831X_FLL_CTRL_RATE_WIDTH 3 /* FLL_CTRL_RATE - [6:4] */
309#define WM831X_FLL_FRATIO_MASK 0x0007 /* FLL_FRATIO - [2:0] */
310#define WM831X_FLL_FRATIO_SHIFT 0 /* FLL_FRATIO - [2:0] */
311#define WM831X_FLL_FRATIO_WIDTH 3 /* FLL_FRATIO - [2:0] */
312
313/*
314 * R16532 (0x4094) - FLL Control 3
315 */
316#define WM831X_FLL_K_MASK 0xFFFF /* FLL_K - [15:0] */
317#define WM831X_FLL_K_SHIFT 0 /* FLL_K - [15:0] */
318#define WM831X_FLL_K_WIDTH 16 /* FLL_K - [15:0] */
319
320/*
321 * R16533 (0x4095) - FLL Control 4
322 */
323#define WM831X_FLL_N_MASK 0x7FE0 /* FLL_N - [14:5] */
324#define WM831X_FLL_N_SHIFT 5 /* FLL_N - [14:5] */
325#define WM831X_FLL_N_WIDTH 10 /* FLL_N - [14:5] */
326#define WM831X_FLL_GAIN_MASK 0x000F /* FLL_GAIN - [3:0] */
327#define WM831X_FLL_GAIN_SHIFT 0 /* FLL_GAIN - [3:0] */
328#define WM831X_FLL_GAIN_WIDTH 4 /* FLL_GAIN - [3:0] */
329
330/*
331 * R16534 (0x4096) - FLL Control 5
332 */
333#define WM831X_FLL_CLK_REF_DIV_MASK 0x0018 /* FLL_CLK_REF_DIV - [4:3] */
334#define WM831X_FLL_CLK_REF_DIV_SHIFT 3 /* FLL_CLK_REF_DIV - [4:3] */
335#define WM831X_FLL_CLK_REF_DIV_WIDTH 2 /* FLL_CLK_REF_DIV - [4:3] */
336#define WM831X_FLL_CLK_SRC_MASK 0x0003 /* FLL_CLK_SRC - [1:0] */
337#define WM831X_FLL_CLK_SRC_SHIFT 0 /* FLL_CLK_SRC - [1:0] */
338#define WM831X_FLL_CLK_SRC_WIDTH 2 /* FLL_CLK_SRC - [1:0] */
339
237struct regulator_dev; 340struct regulator_dev;
238 341
239#define WM831X_NUM_IRQ_REGS 5 342#define WM831X_NUM_IRQ_REGS 5
343#define WM831X_NUM_GPIO_REGS 16
240 344
241enum wm831x_parent { 345enum wm831x_parent {
242 WM8310 = 0x8310, 346 WM8310 = 0x8310,
@@ -248,23 +352,27 @@ enum wm831x_parent {
248 WM8326 = 0x8326, 352 WM8326 = 0x8326,
249}; 353};
250 354
355struct wm831x;
356enum wm831x_auxadc;
357
358typedef int (*wm831x_auxadc_read_fn)(struct wm831x *wm831x,
359 enum wm831x_auxadc input);
360
251struct wm831x { 361struct wm831x {
252 struct mutex io_lock; 362 struct mutex io_lock;
253 363
254 struct device *dev; 364 struct device *dev;
255 int (*read_dev)(struct wm831x *wm831x, unsigned short reg,
256 int bytes, void *dest);
257 int (*write_dev)(struct wm831x *wm831x, unsigned short reg,
258 int bytes, void *src);
259 365
260 void *control_data; 366 struct regmap *regmap;
261 367
262 int irq; /* Our chip IRQ */ 368 int irq; /* Our chip IRQ */
263 struct mutex irq_lock; 369 struct mutex irq_lock;
264 unsigned int irq_base; 370 int irq_base;
265 int irq_masks_cur[WM831X_NUM_IRQ_REGS]; /* Currently active value */ 371 int irq_masks_cur[WM831X_NUM_IRQ_REGS]; /* Currently active value */
266 int irq_masks_cache[WM831X_NUM_IRQ_REGS]; /* Cached hardware value */ 372 int irq_masks_cache[WM831X_NUM_IRQ_REGS]; /* Cached hardware value */
267 373
374 bool soft_shutdown;
375
268 /* Chip revision based flags */ 376 /* Chip revision based flags */
269 unsigned has_gpio_ena:1; /* Has GPIO enable bit */ 377 unsigned has_gpio_ena:1; /* Has GPIO enable bit */
270 unsigned has_cs_sts:1; /* Has current sink status bit */ 378 unsigned has_cs_sts:1; /* Has current sink status bit */
@@ -272,8 +380,13 @@ struct wm831x {
272 380
273 int num_gpio; 381 int num_gpio;
274 382
383 /* Used by the interrupt controller code to post writes */
384 int gpio_update[WM831X_NUM_GPIO_REGS];
385
275 struct mutex auxadc_lock; 386 struct mutex auxadc_lock;
276 struct completion auxadc_done; 387 struct list_head auxadc_pending;
388 u16 auxadc_active;
389 wm831x_auxadc_read_fn auxadc_read;
277 390
278 /* The WM831x has a security key blocking access to certain 391 /* The WM831x has a security key blocking access to certain
279 * registers. The mutex is taken by the accessors for locking 392 * registers. The mutex is taken by the accessors for locking
@@ -298,7 +411,11 @@ int wm831x_bulk_read(struct wm831x *wm831x, unsigned short reg,
298int wm831x_device_init(struct wm831x *wm831x, unsigned long id, int irq); 411int wm831x_device_init(struct wm831x *wm831x, unsigned long id, int irq);
299void wm831x_device_exit(struct wm831x *wm831x); 412void wm831x_device_exit(struct wm831x *wm831x);
300int wm831x_device_suspend(struct wm831x *wm831x); 413int wm831x_device_suspend(struct wm831x *wm831x);
414void wm831x_device_shutdown(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);
418
419extern struct regmap_config wm831x_regmap_config;
303 420
304#endif 421#endif
diff --git a/include/linux/mfd/wm831x/pdata.h b/include/linux/mfd/wm831x/pdata.h
index ff42d700293f..1d7a3f7b3b5d 100644
--- a/include/linux/mfd/wm831x/pdata.h
+++ b/include/linux/mfd/wm831x/pdata.h
@@ -120,6 +120,12 @@ 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
126 /** The driver should initiate a power off sequence during shutdown */
127 bool soft_shutdown;
128
123 int irq_base; 129 int irq_base;
124 int gpio_base; 130 int gpio_base;
125 int gpio_defaults[WM831X_GPIO_NUM]; 131 int gpio_defaults[WM831X_GPIO_NUM];
diff --git a/include/linux/mfd/wm8400-private.h b/include/linux/mfd/wm8400-private.h
index 2aab4e93a5c9..0147b6968510 100644
--- a/include/linux/mfd/wm8400-private.h
+++ b/include/linux/mfd/wm8400-private.h
@@ -25,16 +25,15 @@
25#include <linux/mutex.h> 25#include <linux/mutex.h>
26#include <linux/platform_device.h> 26#include <linux/platform_device.h>
27 27
28struct regmap;
29
28#define WM8400_REGISTER_COUNT 0x55 30#define WM8400_REGISTER_COUNT 0x55
29 31
30struct wm8400 { 32struct wm8400 {
31 struct device *dev; 33 struct device *dev;
32 34
33 int (*read_dev)(void *data, char reg, int count, u16 *dst);
34 int (*write_dev)(void *data, char reg, int count, const u16 *src);
35
36 struct mutex io_lock; 35 struct mutex io_lock;
37 void *io_data; 36 struct regmap *regmap;
38 37
39 u16 reg_cache[WM8400_REGISTER_COUNT]; 38 u16 reg_cache[WM8400_REGISTER_COUNT];
40 39
diff --git a/include/linux/mfd/wm8994/core.h b/include/linux/mfd/wm8994/core.h
index f0b69cdae41c..45df450d869f 100644
--- a/include/linux/mfd/wm8994/core.h
+++ b/include/linux/mfd/wm8994/core.h
@@ -24,6 +24,7 @@ enum wm8994_type {
24 24
25struct regulator_dev; 25struct regulator_dev;
26struct regulator_bulk_data; 26struct regulator_bulk_data;
27struct regmap;
27 28
28#define WM8994_NUM_GPIO_REGS 11 29#define WM8994_NUM_GPIO_REGS 11
29#define WM8994_NUM_LDO_REGS 2 30#define WM8994_NUM_LDO_REGS 2
@@ -50,18 +51,12 @@ struct regulator_bulk_data;
50#define WM8994_IRQ_GPIO(x) (x + WM8994_IRQ_TEMP_WARN) 51#define WM8994_IRQ_GPIO(x) (x + WM8994_IRQ_TEMP_WARN)
51 52
52struct wm8994 { 53struct wm8994 {
53 struct mutex io_lock;
54 struct mutex irq_lock; 54 struct mutex irq_lock;
55 55
56 enum wm8994_type type; 56 enum wm8994_type type;
57 57
58 struct device *dev; 58 struct device *dev;
59 int (*read_dev)(struct wm8994 *wm8994, unsigned short reg, 59 struct regmap *regmap;
60 int bytes, void *dest);
61 int (*write_dev)(struct wm8994 *wm8994, unsigned short reg,
62 int bytes, const void *src);
63
64 void *control_data;
65 60
66 int gpio_base; 61 int gpio_base;
67 int irq_base; 62 int irq_base;
diff --git a/include/linux/mfd/wm8994/pdata.h b/include/linux/mfd/wm8994/pdata.h
index d12f8d635a81..97cf4f27d647 100644
--- a/include/linux/mfd/wm8994/pdata.h
+++ b/include/linux/mfd/wm8994/pdata.h
@@ -26,7 +26,7 @@ struct wm8994_ldo_pdata {
26 struct regulator_init_data *init_data; 26 struct regulator_init_data *init_data;
27}; 27};
28 28
29#define WM8994_CONFIGURE_GPIO 0x8000 29#define WM8994_CONFIGURE_GPIO 0x10000
30 30
31#define WM8994_DRC_REGS 5 31#define WM8994_DRC_REGS 5
32#define WM8994_EQ_REGS 20 32#define WM8994_EQ_REGS 20
diff --git a/include/linux/mii.h b/include/linux/mii.h
index 103113a2fd18..27748230aa69 100644
--- a/include/linux/mii.h
+++ b/include/linux/mii.h
@@ -11,131 +11,130 @@
11#include <linux/types.h> 11#include <linux/types.h>
12 12
13/* Generic MII registers. */ 13/* Generic MII registers. */
14 14#define MII_BMCR 0x00 /* Basic mode control register */
15#define MII_BMCR 0x00 /* Basic mode control register */ 15#define MII_BMSR 0x01 /* Basic mode status register */
16#define MII_BMSR 0x01 /* Basic mode status register */ 16#define MII_PHYSID1 0x02 /* PHYS ID 1 */
17#define MII_PHYSID1 0x02 /* PHYS ID 1 */ 17#define MII_PHYSID2 0x03 /* PHYS ID 2 */
18#define MII_PHYSID2 0x03 /* PHYS ID 2 */ 18#define MII_ADVERTISE 0x04 /* Advertisement control reg */
19#define MII_ADVERTISE 0x04 /* Advertisement control reg */ 19#define MII_LPA 0x05 /* Link partner ability reg */
20#define MII_LPA 0x05 /* Link partner ability reg */ 20#define MII_EXPANSION 0x06 /* Expansion register */
21#define MII_EXPANSION 0x06 /* Expansion register */ 21#define MII_CTRL1000 0x09 /* 1000BASE-T control */
22#define MII_CTRL1000 0x09 /* 1000BASE-T control */ 22#define MII_STAT1000 0x0a /* 1000BASE-T status */
23#define MII_STAT1000 0x0a /* 1000BASE-T status */ 23#define MII_ESTATUS 0x0f /* Extended Status */
24#define MII_ESTATUS 0x0f /* Extended Status */ 24#define MII_DCOUNTER 0x12 /* Disconnect counter */
25#define MII_DCOUNTER 0x12 /* Disconnect counter */ 25#define MII_FCSCOUNTER 0x13 /* False carrier counter */
26#define MII_FCSCOUNTER 0x13 /* False carrier counter */ 26#define MII_NWAYTEST 0x14 /* N-way auto-neg test reg */
27#define MII_NWAYTEST 0x14 /* N-way auto-neg test reg */ 27#define MII_RERRCOUNTER 0x15 /* Receive error counter */
28#define MII_RERRCOUNTER 0x15 /* Receive error counter */ 28#define MII_SREVISION 0x16 /* Silicon revision */
29#define MII_SREVISION 0x16 /* Silicon revision */ 29#define MII_RESV1 0x17 /* Reserved... */
30#define MII_RESV1 0x17 /* Reserved... */ 30#define MII_LBRERROR 0x18 /* Lpback, rx, bypass error */
31#define MII_LBRERROR 0x18 /* Lpback, rx, bypass error */ 31#define MII_PHYADDR 0x19 /* PHY address */
32#define MII_PHYADDR 0x19 /* PHY address */ 32#define MII_RESV2 0x1a /* Reserved... */
33#define MII_RESV2 0x1a /* Reserved... */ 33#define MII_TPISTATUS 0x1b /* TPI status for 10mbps */
34#define MII_TPISTATUS 0x1b /* TPI status for 10mbps */ 34#define MII_NCONFIG 0x1c /* Network interface config */
35#define MII_NCONFIG 0x1c /* Network interface config */
36 35
37/* Basic mode control register. */ 36/* Basic mode control register. */
38#define BMCR_RESV 0x003f /* Unused... */ 37#define BMCR_RESV 0x003f /* Unused... */
39#define BMCR_SPEED1000 0x0040 /* MSB of Speed (1000) */ 38#define BMCR_SPEED1000 0x0040 /* MSB of Speed (1000) */
40#define BMCR_CTST 0x0080 /* Collision test */ 39#define BMCR_CTST 0x0080 /* Collision test */
41#define BMCR_FULLDPLX 0x0100 /* Full duplex */ 40#define BMCR_FULLDPLX 0x0100 /* Full duplex */
42#define BMCR_ANRESTART 0x0200 /* Auto negotiation restart */ 41#define BMCR_ANRESTART 0x0200 /* Auto negotiation restart */
43#define BMCR_ISOLATE 0x0400 /* Disconnect DP83840 from MII */ 42#define BMCR_ISOLATE 0x0400 /* Isolate data paths from MII */
44#define BMCR_PDOWN 0x0800 /* Powerdown the DP83840 */ 43#define BMCR_PDOWN 0x0800 /* Enable low power state */
45#define BMCR_ANENABLE 0x1000 /* Enable auto negotiation */ 44#define BMCR_ANENABLE 0x1000 /* Enable auto negotiation */
46#define BMCR_SPEED100 0x2000 /* Select 100Mbps */ 45#define BMCR_SPEED100 0x2000 /* Select 100Mbps */
47#define BMCR_LOOPBACK 0x4000 /* TXD loopback bits */ 46#define BMCR_LOOPBACK 0x4000 /* TXD loopback bits */
48#define BMCR_RESET 0x8000 /* Reset the DP83840 */ 47#define BMCR_RESET 0x8000 /* Reset to default state */
49 48
50/* Basic mode status register. */ 49/* Basic mode status register. */
51#define BMSR_ERCAP 0x0001 /* Ext-reg capability */ 50#define BMSR_ERCAP 0x0001 /* Ext-reg capability */
52#define BMSR_JCD 0x0002 /* Jabber detected */ 51#define BMSR_JCD 0x0002 /* Jabber detected */
53#define BMSR_LSTATUS 0x0004 /* Link status */ 52#define BMSR_LSTATUS 0x0004 /* Link status */
54#define BMSR_ANEGCAPABLE 0x0008 /* Able to do auto-negotiation */ 53#define BMSR_ANEGCAPABLE 0x0008 /* Able to do auto-negotiation */
55#define BMSR_RFAULT 0x0010 /* Remote fault detected */ 54#define BMSR_RFAULT 0x0010 /* Remote fault detected */
56#define BMSR_ANEGCOMPLETE 0x0020 /* Auto-negotiation complete */ 55#define BMSR_ANEGCOMPLETE 0x0020 /* Auto-negotiation complete */
57#define BMSR_RESV 0x00c0 /* Unused... */ 56#define BMSR_RESV 0x00c0 /* Unused... */
58#define BMSR_ESTATEN 0x0100 /* Extended Status in R15 */ 57#define BMSR_ESTATEN 0x0100 /* Extended Status in R15 */
59#define BMSR_100HALF2 0x0200 /* Can do 100BASE-T2 HDX */ 58#define BMSR_100HALF2 0x0200 /* Can do 100BASE-T2 HDX */
60#define BMSR_100FULL2 0x0400 /* Can do 100BASE-T2 FDX */ 59#define BMSR_100FULL2 0x0400 /* Can do 100BASE-T2 FDX */
61#define BMSR_10HALF 0x0800 /* Can do 10mbps, half-duplex */ 60#define BMSR_10HALF 0x0800 /* Can do 10mbps, half-duplex */
62#define BMSR_10FULL 0x1000 /* Can do 10mbps, full-duplex */ 61#define BMSR_10FULL 0x1000 /* Can do 10mbps, full-duplex */
63#define BMSR_100HALF 0x2000 /* Can do 100mbps, half-duplex */ 62#define BMSR_100HALF 0x2000 /* Can do 100mbps, half-duplex */
64#define BMSR_100FULL 0x4000 /* Can do 100mbps, full-duplex */ 63#define BMSR_100FULL 0x4000 /* Can do 100mbps, full-duplex */
65#define BMSR_100BASE4 0x8000 /* Can do 100mbps, 4k packets */ 64#define BMSR_100BASE4 0x8000 /* Can do 100mbps, 4k packets */
66 65
67/* Advertisement control register. */ 66/* Advertisement control register. */
68#define ADVERTISE_SLCT 0x001f /* Selector bits */ 67#define ADVERTISE_SLCT 0x001f /* Selector bits */
69#define ADVERTISE_CSMA 0x0001 /* Only selector supported */ 68#define ADVERTISE_CSMA 0x0001 /* Only selector supported */
70#define ADVERTISE_10HALF 0x0020 /* Try for 10mbps half-duplex */ 69#define ADVERTISE_10HALF 0x0020 /* Try for 10mbps half-duplex */
71#define ADVERTISE_1000XFULL 0x0020 /* Try for 1000BASE-X full-duplex */ 70#define ADVERTISE_1000XFULL 0x0020 /* Try for 1000BASE-X full-duplex */
72#define ADVERTISE_10FULL 0x0040 /* Try for 10mbps full-duplex */ 71#define ADVERTISE_10FULL 0x0040 /* Try for 10mbps full-duplex */
73#define ADVERTISE_1000XHALF 0x0040 /* Try for 1000BASE-X half-duplex */ 72#define ADVERTISE_1000XHALF 0x0040 /* Try for 1000BASE-X half-duplex */
74#define ADVERTISE_100HALF 0x0080 /* Try for 100mbps half-duplex */ 73#define ADVERTISE_100HALF 0x0080 /* Try for 100mbps half-duplex */
75#define ADVERTISE_1000XPAUSE 0x0080 /* Try for 1000BASE-X pause */ 74#define ADVERTISE_1000XPAUSE 0x0080 /* Try for 1000BASE-X pause */
76#define ADVERTISE_100FULL 0x0100 /* Try for 100mbps full-duplex */ 75#define ADVERTISE_100FULL 0x0100 /* Try for 100mbps full-duplex */
77#define ADVERTISE_1000XPSE_ASYM 0x0100 /* Try for 1000BASE-X asym pause */ 76#define ADVERTISE_1000XPSE_ASYM 0x0100 /* Try for 1000BASE-X asym pause */
78#define ADVERTISE_100BASE4 0x0200 /* Try for 100mbps 4k packets */ 77#define ADVERTISE_100BASE4 0x0200 /* Try for 100mbps 4k packets */
79#define ADVERTISE_PAUSE_CAP 0x0400 /* Try for pause */ 78#define ADVERTISE_PAUSE_CAP 0x0400 /* Try for pause */
80#define ADVERTISE_PAUSE_ASYM 0x0800 /* Try for asymetric pause */ 79#define ADVERTISE_PAUSE_ASYM 0x0800 /* Try for asymetric pause */
81#define ADVERTISE_RESV 0x1000 /* Unused... */ 80#define ADVERTISE_RESV 0x1000 /* Unused... */
82#define ADVERTISE_RFAULT 0x2000 /* Say we can detect faults */ 81#define ADVERTISE_RFAULT 0x2000 /* Say we can detect faults */
83#define ADVERTISE_LPACK 0x4000 /* Ack link partners response */ 82#define ADVERTISE_LPACK 0x4000 /* Ack link partners response */
84#define ADVERTISE_NPAGE 0x8000 /* Next page bit */ 83#define ADVERTISE_NPAGE 0x8000 /* Next page bit */
85 84
86#define ADVERTISE_FULL (ADVERTISE_100FULL | ADVERTISE_10FULL | \ 85#define ADVERTISE_FULL (ADVERTISE_100FULL | ADVERTISE_10FULL | \
87 ADVERTISE_CSMA) 86 ADVERTISE_CSMA)
88#define ADVERTISE_ALL (ADVERTISE_10HALF | ADVERTISE_10FULL | \ 87#define ADVERTISE_ALL (ADVERTISE_10HALF | ADVERTISE_10FULL | \
89 ADVERTISE_100HALF | ADVERTISE_100FULL) 88 ADVERTISE_100HALF | ADVERTISE_100FULL)
90 89
91/* Link partner ability register. */ 90/* Link partner ability register. */
92#define LPA_SLCT 0x001f /* Same as advertise selector */ 91#define LPA_SLCT 0x001f /* Same as advertise selector */
93#define LPA_10HALF 0x0020 /* Can do 10mbps half-duplex */ 92#define LPA_10HALF 0x0020 /* Can do 10mbps half-duplex */
94#define LPA_1000XFULL 0x0020 /* Can do 1000BASE-X full-duplex */ 93#define LPA_1000XFULL 0x0020 /* Can do 1000BASE-X full-duplex */
95#define LPA_10FULL 0x0040 /* Can do 10mbps full-duplex */ 94#define LPA_10FULL 0x0040 /* Can do 10mbps full-duplex */
96#define LPA_1000XHALF 0x0040 /* Can do 1000BASE-X half-duplex */ 95#define LPA_1000XHALF 0x0040 /* Can do 1000BASE-X half-duplex */
97#define LPA_100HALF 0x0080 /* Can do 100mbps half-duplex */ 96#define LPA_100HALF 0x0080 /* Can do 100mbps half-duplex */
98#define LPA_1000XPAUSE 0x0080 /* Can do 1000BASE-X pause */ 97#define LPA_1000XPAUSE 0x0080 /* Can do 1000BASE-X pause */
99#define LPA_100FULL 0x0100 /* Can do 100mbps full-duplex */ 98#define LPA_100FULL 0x0100 /* Can do 100mbps full-duplex */
100#define LPA_1000XPAUSE_ASYM 0x0100 /* Can do 1000BASE-X pause asym*/ 99#define LPA_1000XPAUSE_ASYM 0x0100 /* Can do 1000BASE-X pause asym*/
101#define LPA_100BASE4 0x0200 /* Can do 100mbps 4k packets */ 100#define LPA_100BASE4 0x0200 /* Can do 100mbps 4k packets */
102#define LPA_PAUSE_CAP 0x0400 /* Can pause */ 101#define LPA_PAUSE_CAP 0x0400 /* Can pause */
103#define LPA_PAUSE_ASYM 0x0800 /* Can pause asymetrically */ 102#define LPA_PAUSE_ASYM 0x0800 /* Can pause asymetrically */
104#define LPA_RESV 0x1000 /* Unused... */ 103#define LPA_RESV 0x1000 /* Unused... */
105#define LPA_RFAULT 0x2000 /* Link partner faulted */ 104#define LPA_RFAULT 0x2000 /* Link partner faulted */
106#define LPA_LPACK 0x4000 /* Link partner acked us */ 105#define LPA_LPACK 0x4000 /* Link partner acked us */
107#define LPA_NPAGE 0x8000 /* Next page bit */ 106#define LPA_NPAGE 0x8000 /* Next page bit */
108 107
109#define LPA_DUPLEX (LPA_10FULL | LPA_100FULL) 108#define LPA_DUPLEX (LPA_10FULL | LPA_100FULL)
110#define LPA_100 (LPA_100FULL | LPA_100HALF | LPA_100BASE4) 109#define LPA_100 (LPA_100FULL | LPA_100HALF | LPA_100BASE4)
111 110
112/* Expansion register for auto-negotiation. */ 111/* Expansion register for auto-negotiation. */
113#define EXPANSION_NWAY 0x0001 /* Can do N-way auto-nego */ 112#define EXPANSION_NWAY 0x0001 /* Can do N-way auto-nego */
114#define EXPANSION_LCWP 0x0002 /* Got new RX page code word */ 113#define EXPANSION_LCWP 0x0002 /* Got new RX page code word */
115#define EXPANSION_ENABLENPAGE 0x0004 /* This enables npage words */ 114#define EXPANSION_ENABLENPAGE 0x0004 /* This enables npage words */
116#define EXPANSION_NPCAPABLE 0x0008 /* Link partner supports npage */ 115#define EXPANSION_NPCAPABLE 0x0008 /* Link partner supports npage */
117#define EXPANSION_MFAULTS 0x0010 /* Multiple faults detected */ 116#define EXPANSION_MFAULTS 0x0010 /* Multiple faults detected */
118#define EXPANSION_RESV 0xffe0 /* Unused... */ 117#define EXPANSION_RESV 0xffe0 /* Unused... */
119 118
120#define ESTATUS_1000_TFULL 0x2000 /* Can do 1000BT Full */ 119#define ESTATUS_1000_TFULL 0x2000 /* Can do 1000BT Full */
121#define ESTATUS_1000_THALF 0x1000 /* Can do 1000BT Half */ 120#define ESTATUS_1000_THALF 0x1000 /* Can do 1000BT Half */
122 121
123/* N-way test register. */ 122/* N-way test register. */
124#define NWAYTEST_RESV1 0x00ff /* Unused... */ 123#define NWAYTEST_RESV1 0x00ff /* Unused... */
125#define NWAYTEST_LOOPBACK 0x0100 /* Enable loopback for N-way */ 124#define NWAYTEST_LOOPBACK 0x0100 /* Enable loopback for N-way */
126#define NWAYTEST_RESV2 0xfe00 /* Unused... */ 125#define NWAYTEST_RESV2 0xfe00 /* Unused... */
127 126
128/* 1000BASE-T Control register */ 127/* 1000BASE-T Control register */
129#define ADVERTISE_1000FULL 0x0200 /* Advertise 1000BASE-T full duplex */ 128#define ADVERTISE_1000FULL 0x0200 /* Advertise 1000BASE-T full duplex */
130#define ADVERTISE_1000HALF 0x0100 /* Advertise 1000BASE-T half duplex */ 129#define ADVERTISE_1000HALF 0x0100 /* Advertise 1000BASE-T half duplex */
131#define CTL1000_AS_MASTER 0x0800 130#define CTL1000_AS_MASTER 0x0800
132#define CTL1000_ENABLE_MASTER 0x1000 131#define CTL1000_ENABLE_MASTER 0x1000
133 132
134/* 1000BASE-T Status register */ 133/* 1000BASE-T Status register */
135#define LPA_1000LOCALRXOK 0x2000 /* Link partner local receiver status */ 134#define LPA_1000LOCALRXOK 0x2000 /* Link partner local receiver status */
136#define LPA_1000REMRXOK 0x1000 /* Link partner remote receiver status */ 135#define LPA_1000REMRXOK 0x1000 /* Link partner remote receiver status */
137#define LPA_1000FULL 0x0800 /* Link partner 1000BASE-T full duplex */ 136#define LPA_1000FULL 0x0800 /* Link partner 1000BASE-T full duplex */
138#define LPA_1000HALF 0x0400 /* Link partner 1000BASE-T half duplex */ 137#define LPA_1000HALF 0x0400 /* Link partner 1000BASE-T half duplex */
139 138
140/* Flow control flags */ 139/* Flow control flags */
141#define FLOW_CTRL_TX 0x01 140#define FLOW_CTRL_TX 0x01
@@ -149,7 +148,7 @@ struct mii_ioctl_data {
149 __u16 val_out; 148 __u16 val_out;
150}; 149};
151 150
152#ifdef __KERNEL__ 151#ifdef __KERNEL__
153 152
154#include <linux/if.h> 153#include <linux/if.h>
155 154
@@ -180,7 +179,7 @@ extern unsigned int mii_check_media (struct mii_if_info *mii,
180 unsigned int ok_to_print, 179 unsigned int ok_to_print,
181 unsigned int init_media); 180 unsigned int init_media);
182extern int generic_mii_ioctl(struct mii_if_info *mii_if, 181extern int generic_mii_ioctl(struct mii_if_info *mii_if,
183 struct mii_ioctl_data *mii_data, int cmd, 182 struct mii_ioctl_data *mii_data, int cmd,
184 unsigned int *duplex_changed); 183 unsigned int *duplex_changed);
185 184
186 185
@@ -189,7 +188,6 @@ static inline struct mii_ioctl_data *if_mii(struct ifreq *rq)
189 return (struct mii_ioctl_data *) &rq->ifr_ifru; 188 return (struct mii_ioctl_data *) &rq->ifr_ifru;
190} 189}
191 190
192
193/** 191/**
194 * mii_nway_result 192 * mii_nway_result
195 * @negotiated: value of MII ANAR and'd with ANLPAR 193 * @negotiated: value of MII ANAR and'd with ANLPAR
diff --git a/include/linux/miscdevice.h b/include/linux/miscdevice.h
index 18fd13028ba1..c309b1ecdc1c 100644
--- a/include/linux/miscdevice.h
+++ b/include/linux/miscdevice.h
@@ -40,6 +40,7 @@
40#define BTRFS_MINOR 234 40#define BTRFS_MINOR 234
41#define AUTOFS_MINOR 235 41#define AUTOFS_MINOR 235
42#define MAPPER_CTRL_MINOR 236 42#define MAPPER_CTRL_MINOR 236
43#define LOOP_CTRL_MINOR 237
43#define MISC_DYNAMIC_MINOR 255 44#define MISC_DYNAMIC_MINOR 255
44 45
45struct device; 46struct device;
diff --git a/include/linux/mlx4/device.h b/include/linux/mlx4/device.h
index 53ef894bfa05..2366f94a095a 100644
--- a/include/linux/mlx4/device.h
+++ b/include/linux/mlx4/device.h
@@ -75,6 +75,7 @@ enum {
75 MLX4_DEV_CAP_FLAG_UD_MCAST = 1LL << 21, 75 MLX4_DEV_CAP_FLAG_UD_MCAST = 1LL << 21,
76 MLX4_DEV_CAP_FLAG_IBOE = 1LL << 30, 76 MLX4_DEV_CAP_FLAG_IBOE = 1LL << 30,
77 MLX4_DEV_CAP_FLAG_UC_LOOPBACK = 1LL << 32, 77 MLX4_DEV_CAP_FLAG_UC_LOOPBACK = 1LL << 32,
78 MLX4_DEV_CAP_FLAG_FCS_KEEP = 1LL << 34,
78 MLX4_DEV_CAP_FLAG_WOL = 1LL << 38, 79 MLX4_DEV_CAP_FLAG_WOL = 1LL << 38,
79 MLX4_DEV_CAP_FLAG_UDP_RSS = 1LL << 40, 80 MLX4_DEV_CAP_FLAG_UDP_RSS = 1LL << 40,
80 MLX4_DEV_CAP_FLAG_VEP_UC_STEER = 1LL << 41, 81 MLX4_DEV_CAP_FLAG_VEP_UC_STEER = 1LL << 41,
diff --git a/include/linux/mm.h b/include/linux/mm.h
index 3172a1c0f08e..7438071b44aa 100644
--- a/include/linux/mm.h
+++ b/include/linux/mm.h
@@ -685,7 +685,7 @@ static inline void set_page_section(struct page *page, unsigned long section)
685 page->flags |= (section & SECTIONS_MASK) << SECTIONS_PGSHIFT; 685 page->flags |= (section & SECTIONS_MASK) << SECTIONS_PGSHIFT;
686} 686}
687 687
688static inline unsigned long page_to_section(struct page *page) 688static inline unsigned long page_to_section(const struct page *page)
689{ 689{
690 return (page->flags >> SECTIONS_PGSHIFT) & SECTIONS_MASK; 690 return (page->flags >> SECTIONS_PGSHIFT) & SECTIONS_MASK;
691} 691}
@@ -720,7 +720,7 @@ static inline void set_page_links(struct page *page, enum zone_type zone,
720 720
721static __always_inline void *lowmem_page_address(const struct page *page) 721static __always_inline void *lowmem_page_address(const struct page *page)
722{ 722{
723 return __va(PFN_PHYS(page_to_pfn((struct page *)page))); 723 return __va(PFN_PHYS(page_to_pfn(page)));
724} 724}
725 725
726#if defined(CONFIG_HIGHMEM) && !defined(WANT_PAGE_VIRTUAL) 726#if defined(CONFIG_HIGHMEM) && !defined(WANT_PAGE_VIRTUAL)
@@ -737,7 +737,7 @@ static __always_inline void *lowmem_page_address(const struct page *page)
737#endif 737#endif
738 738
739#if defined(HASHED_PAGE_VIRTUAL) 739#if defined(HASHED_PAGE_VIRTUAL)
740void *page_address(struct page *page); 740void *page_address(const struct page *page);
741void set_page_address(struct page *page, void *virtual); 741void set_page_address(struct page *page, void *virtual);
742void page_address_init(void); 742void page_address_init(void);
743#endif 743#endif
@@ -962,6 +962,8 @@ int invalidate_inode_page(struct page *page);
962#ifdef CONFIG_MMU 962#ifdef CONFIG_MMU
963extern int handle_mm_fault(struct mm_struct *mm, struct vm_area_struct *vma, 963extern int handle_mm_fault(struct mm_struct *mm, struct vm_area_struct *vma,
964 unsigned long address, unsigned int flags); 964 unsigned long address, unsigned int flags);
965extern int fixup_user_fault(struct task_struct *tsk, struct mm_struct *mm,
966 unsigned long address, unsigned int fault_flags);
965#else 967#else
966static inline int handle_mm_fault(struct mm_struct *mm, 968static inline int handle_mm_fault(struct mm_struct *mm,
967 struct vm_area_struct *vma, unsigned long address, 969 struct vm_area_struct *vma, unsigned long address,
@@ -971,6 +973,14 @@ static inline int handle_mm_fault(struct mm_struct *mm,
971 BUG(); 973 BUG();
972 return VM_FAULT_SIGBUS; 974 return VM_FAULT_SIGBUS;
973} 975}
976static inline int fixup_user_fault(struct task_struct *tsk,
977 struct mm_struct *mm, unsigned long address,
978 unsigned int fault_flags)
979{
980 /* should never happen if there's no MMU */
981 BUG();
982 return -EFAULT;
983}
974#endif 984#endif
975 985
976extern int make_pages_present(unsigned long addr, unsigned long end); 986extern int make_pages_present(unsigned long addr, unsigned long end);
@@ -988,8 +998,6 @@ int get_user_pages(struct task_struct *tsk, struct mm_struct *mm,
988int get_user_pages_fast(unsigned long start, int nr_pages, int write, 998int get_user_pages_fast(unsigned long start, int nr_pages, int write,
989 struct page **pages); 999 struct page **pages);
990struct page *get_dump_page(unsigned long addr); 1000struct 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);
993 1001
994extern int try_to_release_page(struct page * page, gfp_t gfp_mask); 1002extern int try_to_release_page(struct page * page, gfp_t gfp_mask);
995extern void do_invalidatepage(struct page *page, unsigned long offset); 1003extern void do_invalidatepage(struct page *page, unsigned long offset);
@@ -1600,6 +1608,7 @@ enum mf_flags {
1600}; 1608};
1601extern void memory_failure(unsigned long pfn, int trapno); 1609extern void memory_failure(unsigned long pfn, int trapno);
1602extern int __memory_failure(unsigned long pfn, int trapno, int flags); 1610extern int __memory_failure(unsigned long pfn, int trapno, int flags);
1611extern void memory_failure_queue(unsigned long pfn, int trapno, int flags);
1603extern int unpoison_memory(unsigned long pfn); 1612extern int unpoison_memory(unsigned long pfn);
1604extern int sysctl_memory_failure_early_kill; 1613extern int sysctl_memory_failure_early_kill;
1605extern int sysctl_memory_failure_recovery; 1614extern int sysctl_memory_failure_recovery;
diff --git a/include/linux/mm_types.h b/include/linux/mm_types.h
index 027935c86c68..c93d00a6e95d 100644
--- a/include/linux/mm_types.h
+++ b/include/linux/mm_types.h
@@ -30,23 +30,73 @@ 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
45 * inode address_space, or NULL.
46 * If page mapped as anonymous
47 * memory, low bit is set, and
48 * it points to anon_vma object:
49 * see PAGE_MAPPING_ANON below.
50 */
51 /* Second double word */
52 struct {
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 };
78 };
79 };
80
81 /* Third double word block */
38 union { 82 union {
39 atomic_t _mapcount; /* Count of ptes mapped in mms, 83 struct list_head lru; /* Pageout list, eg. active_list
40 * to show when page is mapped 84 * protected by zone->lru_lock !
41 * & limit reverse map searches.
42 */ 85 */
43 struct { /* SLUB */ 86 struct { /* slub per cpu partial pages */
44 u16 inuse; 87 struct page *next; /* Next partial slab */
45 u16 objects; 88#ifdef CONFIG_64BIT
89 int pages; /* Nr of partial slabs left */
90 int pobjects; /* Approximate # of objects */
91#else
92 short int pages;
93 short int pobjects;
94#endif
46 }; 95 };
47 }; 96 };
97
98 /* Remainder is not double word aligned */
48 union { 99 union {
49 struct {
50 unsigned long private; /* Mapping-private opaque data: 100 unsigned long private; /* Mapping-private opaque data:
51 * usually used for buffer_heads 101 * usually used for buffer_heads
52 * if PagePrivate set; used for 102 * if PagePrivate set; used for
@@ -54,27 +104,13 @@ struct page {
54 * indicates order in the buddy 104 * indicates order in the buddy
55 * system if PG_buddy is set. 105 * system if PG_buddy is set.
56 */ 106 */
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 107#if USE_SPLIT_PTLOCKS
66 spinlock_t ptl; 108 spinlock_t ptl;
67#endif 109#endif
68 struct kmem_cache *slab; /* SLUB: Pointer to slab */ 110 struct kmem_cache *slab; /* SLUB: Pointer to slab */
69 struct page *first_page; /* Compound tail pages */ 111 struct page *first_page; /* Compound tail pages */
70 }; 112 };
71 union { 113
72 pgoff_t index; /* Our offset within mapping. */
73 void *freelist; /* SLUB: freelist req. slab lock */
74 };
75 struct list_head lru; /* Pageout list, eg. active_list
76 * protected by zone->lru_lock !
77 */
78 /* 114 /*
79 * On machines where all RAM is mapped into kernel address space, 115 * On machines where all RAM is mapped into kernel address space,
80 * we can simply calculate the virtual address. On machines with 116 * we can simply calculate the virtual address. On machines with
@@ -100,6 +136,26 @@ struct page {
100 */ 136 */
101 void *shadow; 137 void *shadow;
102#endif 138#endif
139}
140/*
141 * If another subsystem starts using the double word pairing for atomic
142 * operations on struct page then it must change the #if to ensure
143 * proper alignment of the page struct.
144 */
145#if defined(CONFIG_SLUB) && defined(CONFIG_CMPXCHG_LOCAL)
146 __attribute__((__aligned__(2*sizeof(unsigned long))))
147#endif
148;
149
150struct page_frag {
151 struct page *page;
152#if (BITS_PER_LONG > 32) || (PAGE_SIZE >= 65536)
153 __u32 offset;
154 __u32 size;
155#else
156 __u16 offset;
157 __u16 size;
158#endif
103}; 159};
104 160
105typedef unsigned long __nocast vm_flags_t; 161typedef unsigned long __nocast vm_flags_t;
diff --git a/include/linux/mmc/host.h b/include/linux/mmc/host.h
index 0f83858147a6..1d09562ccf73 100644
--- a/include/linux/mmc/host.h
+++ b/include/linux/mmc/host.h
@@ -56,8 +56,6 @@ struct mmc_ios {
56#define MMC_TIMING_UHS_SDR104 4 56#define MMC_TIMING_UHS_SDR104 4
57#define MMC_TIMING_UHS_DDR50 5 57#define MMC_TIMING_UHS_DDR50 5
58 58
59 unsigned char ddr; /* dual data rate used */
60
61#define MMC_SDR_MODE 0 59#define MMC_SDR_MODE 0
62#define MMC_1_2V_DDR_MODE 1 60#define MMC_1_2V_DDR_MODE 1
63#define MMC_1_8V_DDR_MODE 2 61#define MMC_1_8V_DDR_MODE 2
diff --git a/include/linux/mod_devicetable.h b/include/linux/mod_devicetable.h
index ae28e93fd072..468819cdde87 100644
--- a/include/linux/mod_devicetable.h
+++ b/include/linux/mod_devicetable.h
@@ -405,6 +405,15 @@ struct virtio_device_id {
405}; 405};
406#define VIRTIO_DEV_ANY_ID 0xffffffff 406#define VIRTIO_DEV_ANY_ID 0xffffffff
407 407
408/*
409 * For Hyper-V devices we use the device guid as the id.
410 */
411struct hv_vmbus_device_id {
412 __u8 guid[16];
413 kernel_ulong_t driver_data /* Data private to the driver */
414 __attribute__((aligned(sizeof(kernel_ulong_t))));
415};
416
408/* i2c */ 417/* i2c */
409 418
410#define I2C_NAME_SIZE 20 419#define I2C_NAME_SIZE 20
diff --git a/include/linux/module.h b/include/linux/module.h
index 1c30087a2d81..863921637d9f 100644
--- a/include/linux/module.h
+++ b/include/linux/module.h
@@ -580,9 +580,6 @@ int unregister_module_notifier(struct notifier_block * nb);
580 580
581extern void print_modules(void); 581extern void print_modules(void);
582 582
583extern void module_update_tracepoints(void);
584extern int module_get_iter_tracepoints(struct tracepoint_iter *iter);
585
586#else /* !CONFIG_MODULES... */ 583#else /* !CONFIG_MODULES... */
587#define EXPORT_SYMBOL(sym) 584#define EXPORT_SYMBOL(sym)
588#define EXPORT_SYMBOL_GPL(sym) 585#define EXPORT_SYMBOL_GPL(sym)
@@ -698,15 +695,6 @@ static inline int unregister_module_notifier(struct notifier_block * nb)
698static inline void print_modules(void) 695static inline void print_modules(void)
699{ 696{
700} 697}
701
702static inline void module_update_tracepoints(void)
703{
704}
705
706static inline int module_get_iter_tracepoints(struct tracepoint_iter *iter)
707{
708 return 0;
709}
710#endif /* CONFIG_MODULES */ 698#endif /* CONFIG_MODULES */
711 699
712#ifdef CONFIG_SYSFS 700#ifdef CONFIG_SYSFS
diff --git a/include/linux/moduleparam.h b/include/linux/moduleparam.h
index ddaae98c53f9..fffb10bd5514 100644
--- a/include/linux/moduleparam.h
+++ b/include/linux/moduleparam.h
@@ -262,6 +262,26 @@ static inline void __kernel_param_unlock(void)
262 .str = &__param_string_##name, 0, perm); \ 262 .str = &__param_string_##name, 0, perm); \
263 __MODULE_PARM_TYPE(name, "string") 263 __MODULE_PARM_TYPE(name, "string")
264 264
265/**
266 * parameq - checks if two parameter names match
267 * @name1: parameter name 1
268 * @name2: parameter name 2
269 *
270 * Returns true if the two parameter names are equal.
271 * Dashes (-) are considered equal to underscores (_).
272 */
273extern bool parameq(const char *name1, const char *name2);
274
275/**
276 * parameqn - checks if two parameter names match
277 * @name1: parameter name 1
278 * @name2: parameter name 2
279 * @n: the length to compare
280 *
281 * Similar to parameq(), except it compares @n characters.
282 */
283extern bool parameqn(const char *name1, const char *name2, size_t n);
284
265/* Called on module insert or kernel boot */ 285/* Called on module insert or kernel boot */
266extern int parse_args(const char *name, 286extern int parse_args(const char *name,
267 char *args, 287 char *args,
diff --git a/include/linux/namei.h b/include/linux/namei.h
index 76fe2c62ae71..409328d1cbbb 100644
--- a/include/linux/namei.h
+++ b/include/linux/namei.h
@@ -48,11 +48,12 @@ 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_AUTOMOUNT 0x0004
51 52
52#define LOOKUP_PARENT 0x0010 53#define LOOKUP_PARENT 0x0010
53#define LOOKUP_REVAL 0x0020 54#define LOOKUP_REVAL 0x0020
54#define LOOKUP_RCU 0x0040 55#define LOOKUP_RCU 0x0040
55#define LOOKUP_NO_AUTOMOUNT 0x0080 56
56/* 57/*
57 * Intent data 58 * Intent data
58 */ 59 */
diff --git a/include/linux/net_tstamp.h b/include/linux/net_tstamp.h
index a3b8546354ac..ae5df122e42f 100644
--- a/include/linux/net_tstamp.h
+++ b/include/linux/net_tstamp.h
@@ -45,7 +45,7 @@ struct hwtstamp_config {
45}; 45};
46 46
47/* possible values for hwtstamp_config->tx_type */ 47/* possible values for hwtstamp_config->tx_type */
48enum { 48enum hwtstamp_tx_types {
49 /* 49 /*
50 * No outgoing packet will need hardware time stamping; 50 * No outgoing packet will need hardware time stamping;
51 * should a packet arrive which asks for it, no hardware 51 * should a packet arrive which asks for it, no hardware
@@ -60,10 +60,19 @@ enum {
60 * before sending the packet. 60 * before sending the packet.
61 */ 61 */
62 HWTSTAMP_TX_ON, 62 HWTSTAMP_TX_ON,
63
64 /*
65 * Enables time stamping for outgoing packets just as
66 * HWTSTAMP_TX_ON does, but also enables time stamp insertion
67 * directly into Sync packets. In this case, transmitted Sync
68 * packets will not received a time stamp via the socket error
69 * queue.
70 */
71 HWTSTAMP_TX_ONESTEP_SYNC,
63}; 72};
64 73
65/* possible values for hwtstamp_config->rx_filter */ 74/* possible values for hwtstamp_config->rx_filter */
66enum { 75enum hwtstamp_rx_filters {
67 /* time stamp no incoming packet at all */ 76 /* time stamp no incoming packet at all */
68 HWTSTAMP_FILTER_NONE, 77 HWTSTAMP_FILTER_NONE,
69 78
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index ddee79bb8f15..df1c836e6948 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -31,7 +31,7 @@
31#include <linux/if_link.h> 31#include <linux/if_link.h>
32 32
33#ifdef __KERNEL__ 33#ifdef __KERNEL__
34#include <linux/pm_qos_params.h> 34#include <linux/pm_qos.h>
35#include <linux/timer.h> 35#include <linux/timer.h>
36#include <linux/delay.h> 36#include <linux/delay.h>
37#include <linux/atomic.h> 37#include <linux/atomic.h>
@@ -723,9 +723,8 @@ struct netdev_tc_txq {
723 * 723 *
724 * void (*ndo_set_rx_mode)(struct net_device *dev); 724 * void (*ndo_set_rx_mode)(struct net_device *dev);
725 * This function is called device changes address list filtering. 725 * This function is called device changes address list filtering.
726 * 726 * If driver handles unicast address filtering, it should set
727 * void (*ndo_set_multicast_list)(struct net_device *dev); 727 * IFF_UNICAST_FLT to its priv_flags.
728 * This function is called when the multicast address list changes.
729 * 728 *
730 * int (*ndo_set_mac_address)(struct net_device *dev, void *addr); 729 * int (*ndo_set_mac_address)(struct net_device *dev, void *addr);
731 * This function is called when the Media Access Control address 730 * This function is called when the Media Access Control address
@@ -782,6 +781,7 @@ struct netdev_tc_txq {
782 * int (*ndo_set_vf_mac)(struct net_device *dev, int vf, u8* mac); 781 * int (*ndo_set_vf_mac)(struct net_device *dev, int vf, u8* mac);
783 * int (*ndo_set_vf_vlan)(struct net_device *dev, int vf, u16 vlan, u8 qos); 782 * int (*ndo_set_vf_vlan)(struct net_device *dev, int vf, u16 vlan, u8 qos);
784 * int (*ndo_set_vf_tx_rate)(struct net_device *dev, int vf, int rate); 783 * int (*ndo_set_vf_tx_rate)(struct net_device *dev, int vf, int rate);
784 * int (*ndo_set_vf_spoofchk)(struct net_device *dev, int vf, bool setting);
785 * int (*ndo_get_vf_config)(struct net_device *dev, 785 * int (*ndo_get_vf_config)(struct net_device *dev,
786 * int vf, struct ifla_vf_info *ivf); 786 * int vf, struct ifla_vf_info *ivf);
787 * int (*ndo_set_vf_port)(struct net_device *dev, int vf, 787 * int (*ndo_set_vf_port)(struct net_device *dev, int vf,
@@ -868,7 +868,6 @@ struct net_device_ops {
868 void (*ndo_change_rx_flags)(struct net_device *dev, 868 void (*ndo_change_rx_flags)(struct net_device *dev,
869 int flags); 869 int flags);
870 void (*ndo_set_rx_mode)(struct net_device *dev); 870 void (*ndo_set_rx_mode)(struct net_device *dev);
871 void (*ndo_set_multicast_list)(struct net_device *dev);
872 int (*ndo_set_mac_address)(struct net_device *dev, 871 int (*ndo_set_mac_address)(struct net_device *dev,
873 void *addr); 872 void *addr);
874 int (*ndo_validate_addr)(struct net_device *dev); 873 int (*ndo_validate_addr)(struct net_device *dev);
@@ -902,6 +901,8 @@ struct net_device_ops {
902 int queue, u16 vlan, u8 qos); 901 int queue, u16 vlan, u8 qos);
903 int (*ndo_set_vf_tx_rate)(struct net_device *dev, 902 int (*ndo_set_vf_tx_rate)(struct net_device *dev,
904 int vf, int rate); 903 int vf, int rate);
904 int (*ndo_set_vf_spoofchk)(struct net_device *dev,
905 int vf, bool setting);
905 int (*ndo_get_vf_config)(struct net_device *dev, 906 int (*ndo_get_vf_config)(struct net_device *dev,
906 int vf, 907 int vf,
907 struct ifla_vf_info *ivf); 908 struct ifla_vf_info *ivf);
@@ -924,11 +925,15 @@ struct net_device_ops {
924 u16 xid, 925 u16 xid,
925 struct scatterlist *sgl, 926 struct scatterlist *sgl,
926 unsigned int sgc); 927 unsigned int sgc);
928#endif
929
930#if defined(CONFIG_LIBFCOE) || defined(CONFIG_LIBFCOE_MODULE)
927#define NETDEV_FCOE_WWNN 0 931#define NETDEV_FCOE_WWNN 0
928#define NETDEV_FCOE_WWPN 1 932#define NETDEV_FCOE_WWPN 1
929 int (*ndo_fcoe_get_wwn)(struct net_device *dev, 933 int (*ndo_fcoe_get_wwn)(struct net_device *dev,
930 u64 *wwn, int type); 934 u64 *wwn, int type);
931#endif 935#endif
936
932#ifdef CONFIG_RFS_ACCEL 937#ifdef CONFIG_RFS_ACCEL
933 int (*ndo_rx_flow_steer)(struct net_device *dev, 938 int (*ndo_rx_flow_steer)(struct net_device *dev,
934 const struct sk_buff *skb, 939 const struct sk_buff *skb,
@@ -964,7 +969,7 @@ struct net_device {
964 */ 969 */
965 char name[IFNAMSIZ]; 970 char name[IFNAMSIZ];
966 971
967 struct pm_qos_request_list pm_qos_req; 972 struct pm_qos_request pm_qos_req;
968 973
969 /* device name hash chain */ 974 /* device name hash chain */
970 struct hlist_node name_hlist; 975 struct hlist_node name_hlist;
@@ -2587,9 +2592,6 @@ static inline int netif_is_bond_slave(struct net_device *dev)
2587 2592
2588extern struct pernet_operations __net_initdata loopback_net_ops; 2593extern struct pernet_operations __net_initdata loopback_net_ops;
2589 2594
2590int dev_ethtool_get_settings(struct net_device *dev,
2591 struct ethtool_cmd *cmd);
2592
2593static inline u32 dev_ethtool_get_rx_csum(struct net_device *dev) 2595static inline u32 dev_ethtool_get_rx_csum(struct net_device *dev)
2594{ 2596{
2595 if (dev->features & NETIF_F_RXCSUM) 2597 if (dev->features & NETIF_F_RXCSUM)
@@ -2617,6 +2619,9 @@ static inline const char *netdev_name(const struct net_device *dev)
2617 return dev->name; 2619 return dev->name;
2618} 2620}
2619 2621
2622extern int __netdev_printk(const char *level, const struct net_device *dev,
2623 struct va_format *vaf);
2624
2620extern int netdev_printk(const char *level, const struct net_device *dev, 2625extern int netdev_printk(const char *level, const struct net_device *dev,
2621 const char *format, ...) 2626 const char *format, ...)
2622 __attribute__ ((format (printf, 3, 4))); 2627 __attribute__ ((format (printf, 3, 4)));
@@ -2644,8 +2649,7 @@ extern int netdev_info(const struct net_device *dev, const char *format, ...)
2644#elif defined(CONFIG_DYNAMIC_DEBUG) 2649#elif defined(CONFIG_DYNAMIC_DEBUG)
2645#define netdev_dbg(__dev, format, args...) \ 2650#define netdev_dbg(__dev, format, args...) \
2646do { \ 2651do { \
2647 dynamic_dev_dbg((__dev)->dev.parent, "%s: " format, \ 2652 dynamic_netdev_dbg(__dev, format, ##args); \
2648 netdev_name(__dev), ##args); \
2649} while (0) 2653} while (0)
2650#else 2654#else
2651#define netdev_dbg(__dev, format, args...) \ 2655#define netdev_dbg(__dev, format, args...) \
@@ -2712,9 +2716,7 @@ do { \
2712#define netif_dbg(priv, type, netdev, format, args...) \ 2716#define netif_dbg(priv, type, netdev, format, args...) \
2713do { \ 2717do { \
2714 if (netif_msg_##type(priv)) \ 2718 if (netif_msg_##type(priv)) \
2715 dynamic_dev_dbg((netdev)->dev.parent, \ 2719 dynamic_netdev_dbg(netdev, format, ##args); \
2716 "%s: " format, \
2717 netdev_name(netdev), ##args); \
2718} while (0) 2720} while (0)
2719#else 2721#else
2720#define netif_dbg(priv, type, dev, format, args...) \ 2722#define netif_dbg(priv, type, dev, format, args...) \
diff --git a/include/linux/netfilter/xt_connlimit.h b/include/linux/netfilter/xt_connlimit.h
index 0ca66e97acbc..d1366f05d1b2 100644
--- a/include/linux/netfilter/xt_connlimit.h
+++ b/include/linux/netfilter/xt_connlimit.h
@@ -2,6 +2,7 @@
2#define _XT_CONNLIMIT_H 2#define _XT_CONNLIMIT_H
3 3
4#include <linux/types.h> 4#include <linux/types.h>
5#include <linux/netfilter.h>
5 6
6struct xt_connlimit_data; 7struct xt_connlimit_data;
7 8
diff --git a/include/linux/netfilter/xt_conntrack.h b/include/linux/netfilter/xt_conntrack.h
index 74b904d8f99c..e3c041d54020 100644
--- a/include/linux/netfilter/xt_conntrack.h
+++ b/include/linux/netfilter/xt_conntrack.h
@@ -6,6 +6,7 @@
6#define _XT_CONNTRACK_H 6#define _XT_CONNTRACK_H
7 7
8#include <linux/types.h> 8#include <linux/types.h>
9#include <linux/netfilter.h>
9#include <linux/netfilter/nf_conntrack_tuple_common.h> 10#include <linux/netfilter/nf_conntrack_tuple_common.h>
10 11
11#define XT_CONNTRACK_STATE_BIT(ctinfo) (1 << ((ctinfo)%IP_CT_IS_REPLY+1)) 12#define XT_CONNTRACK_STATE_BIT(ctinfo) (1 << ((ctinfo)%IP_CT_IS_REPLY+1))
diff --git a/include/linux/netfilter/xt_iprange.h b/include/linux/netfilter/xt_iprange.h
index c1f21a779a45..25fd7cf851f0 100644
--- a/include/linux/netfilter/xt_iprange.h
+++ b/include/linux/netfilter/xt_iprange.h
@@ -2,6 +2,7 @@
2#define _LINUX_NETFILTER_XT_IPRANGE_H 1 2#define _LINUX_NETFILTER_XT_IPRANGE_H 1
3 3
4#include <linux/types.h> 4#include <linux/types.h>
5#include <linux/netfilter.h>
5 6
6enum { 7enum {
7 IPRANGE_SRC = 1 << 0, /* match source IP address */ 8 IPRANGE_SRC = 1 << 0, /* match source IP address */
diff --git a/include/linux/netfilter_arp/arp_tables.h b/include/linux/netfilter_arp/arp_tables.h
index adbf4bff87ed..e08565d45178 100644
--- a/include/linux/netfilter_arp/arp_tables.h
+++ b/include/linux/netfilter_arp/arp_tables.h
@@ -52,7 +52,7 @@ struct arpt_arp {
52 struct in_addr smsk, tmsk; 52 struct in_addr smsk, tmsk;
53 53
54 /* Device hw address length, src+target device addresses */ 54 /* Device hw address length, src+target device addresses */
55 u_int8_t arhln, arhln_mask; 55 __u8 arhln, arhln_mask;
56 struct arpt_devaddr_info src_devaddr; 56 struct arpt_devaddr_info src_devaddr;
57 struct arpt_devaddr_info tgt_devaddr; 57 struct arpt_devaddr_info tgt_devaddr;
58 58
@@ -71,9 +71,9 @@ struct arpt_arp {
71 unsigned char iniface_mask[IFNAMSIZ], outiface_mask[IFNAMSIZ]; 71 unsigned char iniface_mask[IFNAMSIZ], outiface_mask[IFNAMSIZ];
72 72
73 /* Flags word */ 73 /* Flags word */
74 u_int8_t flags; 74 __u8 flags;
75 /* Inverse flags */ 75 /* Inverse flags */
76 u_int16_t invflags; 76 __u16 invflags;
77}; 77};
78 78
79/* Values for "flag" field in struct arpt_ip (general arp structure). 79/* Values for "flag" field in struct arpt_ip (general arp structure).
@@ -102,9 +102,9 @@ struct arpt_entry
102 struct arpt_arp arp; 102 struct arpt_arp arp;
103 103
104 /* Size of arpt_entry + matches */ 104 /* Size of arpt_entry + matches */
105 u_int16_t target_offset; 105 __u16 target_offset;
106 /* Size of arpt_entry + matches + target */ 106 /* Size of arpt_entry + matches + target */
107 u_int16_t next_offset; 107 __u16 next_offset;
108 108
109 /* Back pointer */ 109 /* Back pointer */
110 unsigned int comefrom; 110 unsigned int comefrom;
@@ -260,8 +260,8 @@ extern unsigned int arpt_do_table(struct sk_buff *skb,
260 260
261struct compat_arpt_entry { 261struct compat_arpt_entry {
262 struct arpt_arp arp; 262 struct arpt_arp arp;
263 u_int16_t target_offset; 263 __u16 target_offset;
264 u_int16_t next_offset; 264 __u16 next_offset;
265 compat_uint_t comefrom; 265 compat_uint_t comefrom;
266 struct compat_xt_counters counters; 266 struct compat_xt_counters counters;
267 unsigned char elems[0]; 267 unsigned char elems[0];
diff --git a/include/linux/netfilter_decnet.h b/include/linux/netfilter_decnet.h
index 6f425369ee29..0b09732aacd5 100644
--- a/include/linux/netfilter_decnet.h
+++ b/include/linux/netfilter_decnet.h
@@ -11,6 +11,9 @@
11 11
12/* only for userspace compatibility */ 12/* only for userspace compatibility */
13#ifndef __KERNEL__ 13#ifndef __KERNEL__
14
15#include <limits.h> /* for INT_MIN, INT_MAX */
16
14/* IP Cache bits. */ 17/* IP Cache bits. */
15/* Src IP address. */ 18/* Src IP address. */
16#define NFC_DN_SRC 0x0001 19#define NFC_DN_SRC 0x0001
diff --git a/include/linux/netfilter_ipv4.h b/include/linux/netfilter_ipv4.h
index 29c7727ff0e8..fa0946c549d3 100644
--- a/include/linux/netfilter_ipv4.h
+++ b/include/linux/netfilter_ipv4.h
@@ -9,6 +9,9 @@
9 9
10/* only for userspace compatibility */ 10/* only for userspace compatibility */
11#ifndef __KERNEL__ 11#ifndef __KERNEL__
12
13#include <limits.h> /* for INT_MIN, INT_MAX */
14
12/* IP Cache bits. */ 15/* IP Cache bits. */
13/* Src IP address. */ 16/* Src IP address. */
14#define NFC_IP_SRC 0x0001 17#define NFC_IP_SRC 0x0001
diff --git a/include/linux/netfilter_ipv4/ip_tables.h b/include/linux/netfilter_ipv4/ip_tables.h
index 64a5d95c58e8..db79231914ce 100644
--- a/include/linux/netfilter_ipv4/ip_tables.h
+++ b/include/linux/netfilter_ipv4/ip_tables.h
@@ -81,12 +81,12 @@ struct ipt_ip {
81 unsigned char iniface_mask[IFNAMSIZ], outiface_mask[IFNAMSIZ]; 81 unsigned char iniface_mask[IFNAMSIZ], outiface_mask[IFNAMSIZ];
82 82
83 /* Protocol, 0 = ANY */ 83 /* Protocol, 0 = ANY */
84 u_int16_t proto; 84 __u16 proto;
85 85
86 /* Flags word */ 86 /* Flags word */
87 u_int8_t flags; 87 __u8 flags;
88 /* Inverse flags */ 88 /* Inverse flags */
89 u_int8_t invflags; 89 __u8 invflags;
90}; 90};
91 91
92/* Values for "flag" field in struct ipt_ip (general ip structure). */ 92/* Values for "flag" field in struct ipt_ip (general ip structure). */
@@ -114,9 +114,9 @@ struct ipt_entry {
114 unsigned int nfcache; 114 unsigned int nfcache;
115 115
116 /* Size of ipt_entry + matches */ 116 /* Size of ipt_entry + matches */
117 u_int16_t target_offset; 117 __u16 target_offset;
118 /* Size of ipt_entry + matches + target */ 118 /* Size of ipt_entry + matches + target */
119 u_int16_t next_offset; 119 __u16 next_offset;
120 120
121 /* Back pointer */ 121 /* Back pointer */
122 unsigned int comefrom; 122 unsigned int comefrom;
@@ -149,9 +149,9 @@ struct ipt_entry {
149 149
150/* ICMP matching stuff */ 150/* ICMP matching stuff */
151struct ipt_icmp { 151struct ipt_icmp {
152 u_int8_t type; /* type to match */ 152 __u8 type; /* type to match */
153 u_int8_t code[2]; /* range of code */ 153 __u8 code[2]; /* range of code */
154 u_int8_t invflags; /* Inverse flags */ 154 __u8 invflags; /* Inverse flags */
155}; 155};
156 156
157/* Values for "inv" field for struct ipt_icmp. */ 157/* Values for "inv" field for struct ipt_icmp. */
@@ -288,8 +288,8 @@ extern unsigned int ipt_do_table(struct sk_buff *skb,
288struct compat_ipt_entry { 288struct compat_ipt_entry {
289 struct ipt_ip ip; 289 struct ipt_ip ip;
290 compat_uint_t nfcache; 290 compat_uint_t nfcache;
291 u_int16_t target_offset; 291 __u16 target_offset;
292 u_int16_t next_offset; 292 __u16 next_offset;
293 compat_uint_t comefrom; 293 compat_uint_t comefrom;
294 struct compat_xt_counters counters; 294 struct compat_xt_counters counters;
295 unsigned char elems[0]; 295 unsigned char elems[0];
diff --git a/include/linux/netfilter_ipv6.h b/include/linux/netfilter_ipv6.h
index 1f7e300094cd..57c025127f1d 100644
--- a/include/linux/netfilter_ipv6.h
+++ b/include/linux/netfilter_ipv6.h
@@ -12,6 +12,9 @@
12 12
13/* only for userspace compatibility */ 13/* only for userspace compatibility */
14#ifndef __KERNEL__ 14#ifndef __KERNEL__
15
16#include <limits.h> /* for INT_MIN, INT_MAX */
17
15/* IP Cache bits. */ 18/* IP Cache bits. */
16/* Src IP address. */ 19/* Src IP address. */
17#define NFC_IP6_SRC 0x0001 20#define NFC_IP6_SRC 0x0001
diff --git a/include/linux/netfilter_ipv6/ip6_tables.h b/include/linux/netfilter_ipv6/ip6_tables.h
index c9784f7a9c1f..f549adccc94c 100644
--- a/include/linux/netfilter_ipv6/ip6_tables.h
+++ b/include/linux/netfilter_ipv6/ip6_tables.h
@@ -81,14 +81,14 @@ struct ip6t_ip6 {
81 * MH do not match any packets. 81 * MH do not match any packets.
82 * - You also need to set IP6T_FLAGS_PROTO to "flags" to check protocol. 82 * - You also need to set IP6T_FLAGS_PROTO to "flags" to check protocol.
83 */ 83 */
84 u_int16_t proto; 84 __u16 proto;
85 /* TOS to match iff flags & IP6T_F_TOS */ 85 /* TOS to match iff flags & IP6T_F_TOS */
86 u_int8_t tos; 86 __u8 tos;
87 87
88 /* Flags word */ 88 /* Flags word */
89 u_int8_t flags; 89 __u8 flags;
90 /* Inverse flags */ 90 /* Inverse flags */
91 u_int8_t invflags; 91 __u8 invflags;
92}; 92};
93 93
94/* Values for "flag" field in struct ip6t_ip6 (general ip6 structure). */ 94/* Values for "flag" field in struct ip6t_ip6 (general ip6 structure). */
@@ -118,9 +118,9 @@ struct ip6t_entry {
118 unsigned int nfcache; 118 unsigned int nfcache;
119 119
120 /* Size of ipt_entry + matches */ 120 /* Size of ipt_entry + matches */
121 u_int16_t target_offset; 121 __u16 target_offset;
122 /* Size of ipt_entry + matches + target */ 122 /* Size of ipt_entry + matches + target */
123 u_int16_t next_offset; 123 __u16 next_offset;
124 124
125 /* Back pointer */ 125 /* Back pointer */
126 unsigned int comefrom; 126 unsigned int comefrom;
@@ -186,9 +186,9 @@ struct ip6t_error {
186 186
187/* ICMP matching stuff */ 187/* ICMP matching stuff */
188struct ip6t_icmp { 188struct ip6t_icmp {
189 u_int8_t type; /* type to match */ 189 __u8 type; /* type to match */
190 u_int8_t code[2]; /* range of code */ 190 __u8 code[2]; /* range of code */
191 u_int8_t invflags; /* Inverse flags */ 191 __u8 invflags; /* Inverse flags */
192}; 192};
193 193
194/* Values for "inv" field for struct ipt_icmp. */ 194/* Values for "inv" field for struct ipt_icmp. */
@@ -298,8 +298,8 @@ extern int ipv6_find_hdr(const struct sk_buff *skb, unsigned int *offset,
298struct compat_ip6t_entry { 298struct compat_ip6t_entry {
299 struct ip6t_ip6 ipv6; 299 struct ip6t_ip6 ipv6;
300 compat_uint_t nfcache; 300 compat_uint_t nfcache;
301 u_int16_t target_offset; 301 __u16 target_offset;
302 u_int16_t next_offset; 302 __u16 next_offset;
303 compat_uint_t comefrom; 303 compat_uint_t comefrom;
304 struct compat_xt_counters counters; 304 struct compat_xt_counters counters;
305 unsigned char elems[0]; 305 unsigned char elems[0];
diff --git a/include/linux/netlink.h b/include/linux/netlink.h
index 2e17c5dbdcb8..8180cd9d73d5 100644
--- a/include/linux/netlink.h
+++ b/include/linux/netlink.h
@@ -1,7 +1,7 @@
1#ifndef __LINUX_NETLINK_H 1#ifndef __LINUX_NETLINK_H
2#define __LINUX_NETLINK_H 2#define __LINUX_NETLINK_H
3 3
4#include <linux/socket.h> /* for sa_family_t */ 4#include <linux/socket.h> /* for __kernel_sa_family_t */
5#include <linux/types.h> 5#include <linux/types.h>
6 6
7#define NETLINK_ROUTE 0 /* Routing/device hook */ 7#define NETLINK_ROUTE 0 /* Routing/device hook */
@@ -29,7 +29,7 @@
29#define MAX_LINKS 32 29#define MAX_LINKS 32
30 30
31struct sockaddr_nl { 31struct sockaddr_nl {
32 sa_family_t nl_family; /* AF_NETLINK */ 32 __kernel_sa_family_t nl_family; /* AF_NETLINK */
33 unsigned short nl_pad; /* zero */ 33 unsigned short nl_pad; /* zero */
34 __u32 nl_pid; /* port ID */ 34 __u32 nl_pid; /* port ID */
35 __u32 nl_groups; /* multicast groups mask */ 35 __u32 nl_groups; /* multicast groups mask */
diff --git a/include/linux/netrom.h b/include/linux/netrom.h
index 6939b32f66a0..af7313cc9cb6 100644
--- a/include/linux/netrom.h
+++ b/include/linux/netrom.h
@@ -7,6 +7,8 @@
7#ifndef NETROM_KERNEL_H 7#ifndef NETROM_KERNEL_H
8#define NETROM_KERNEL_H 8#define NETROM_KERNEL_H
9 9
10#include <linux/ax25.h>
11
10#define NETROM_MTU 236 12#define NETROM_MTU 236
11 13
12#define NETROM_T1 1 14#define NETROM_T1 1
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 a3c4bc800dce..32345c2805c0 100644
--- a/include/linux/nfs4.h
+++ b/include/linux/nfs4.h
@@ -373,6 +373,22 @@ enum nfsstat4 {
373 NFS4ERR_DELEG_REVOKED = 10087, /* deleg./layout revoked */ 373 NFS4ERR_DELEG_REVOKED = 10087, /* deleg./layout revoked */
374}; 374};
375 375
376static inline bool seqid_mutating_err(u32 err)
377{
378 /* rfc 3530 section 8.1.5: */
379 switch (err) {
380 case NFS4ERR_STALE_CLIENTID:
381 case NFS4ERR_STALE_STATEID:
382 case NFS4ERR_BAD_STATEID:
383 case NFS4ERR_BAD_SEQID:
384 case NFS4ERR_BADXDR:
385 case NFS4ERR_RESOURCE:
386 case NFS4ERR_NOFILEHANDLE:
387 return false;
388 };
389 return true;
390}
391
376/* 392/*
377 * Note: NF4BAD is not actually part of the protocol; it is just used 393 * Note: NF4BAD is not actually part of the protocol; it is just used
378 * internally by nfsd. 394 * internally by nfsd.
@@ -394,7 +410,10 @@ enum open_claim_type4 {
394 NFS4_OPEN_CLAIM_NULL = 0, 410 NFS4_OPEN_CLAIM_NULL = 0,
395 NFS4_OPEN_CLAIM_PREVIOUS = 1, 411 NFS4_OPEN_CLAIM_PREVIOUS = 1,
396 NFS4_OPEN_CLAIM_DELEGATE_CUR = 2, 412 NFS4_OPEN_CLAIM_DELEGATE_CUR = 2,
397 NFS4_OPEN_CLAIM_DELEGATE_PREV = 3 413 NFS4_OPEN_CLAIM_DELEGATE_PREV = 3,
414 NFS4_OPEN_CLAIM_FH = 4, /* 4.1 */
415 NFS4_OPEN_CLAIM_DELEG_CUR_FH = 5, /* 4.1 */
416 NFS4_OPEN_CLAIM_DELEG_PREV_FH = 6, /* 4.1 */
398}; 417};
399 418
400enum opentype4 { 419enum opentype4 {
@@ -566,6 +585,7 @@ enum {
566 NFSPROC4_CLNT_SECINFO_NO_NAME, 585 NFSPROC4_CLNT_SECINFO_NO_NAME,
567 NFSPROC4_CLNT_TEST_STATEID, 586 NFSPROC4_CLNT_TEST_STATEID,
568 NFSPROC4_CLNT_FREE_STATEID, 587 NFSPROC4_CLNT_FREE_STATEID,
588 NFSPROC4_CLNT_GETDEVICELIST,
569}; 589};
570 590
571/* nfs41 types */ 591/* nfs41 types */
diff --git a/include/linux/nfs_fs.h b/include/linux/nfs_fs.h
index 8b579beb6358..60a137b7f171 100644
--- a/include/linux/nfs_fs.h
+++ b/include/linux/nfs_fs.h
@@ -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/*
@@ -148,7 +149,6 @@ struct nfs_inode {
148 unsigned long read_cache_jiffies; 149 unsigned long read_cache_jiffies;
149 unsigned long attrtimeo; 150 unsigned long attrtimeo;
150 unsigned long attrtimeo_timestamp; 151 unsigned long attrtimeo_timestamp;
151 __u64 change_attr; /* v4 only */
152 152
153 unsigned long attr_gencount; 153 unsigned long attr_gencount;
154 /* "Generation counter" for the attribute cache. This is 154 /* "Generation counter" for the attribute cache. This is
@@ -568,12 +568,12 @@ extern struct posix_acl *nfs3_proc_getacl(struct inode *inode, int type);
568extern int nfs3_proc_setacl(struct inode *inode, int type, 568extern int nfs3_proc_setacl(struct inode *inode, int type,
569 struct posix_acl *acl); 569 struct posix_acl *acl);
570extern int nfs3_proc_set_default_acl(struct inode *dir, struct inode *inode, 570extern int nfs3_proc_set_default_acl(struct inode *dir, struct inode *inode,
571 mode_t mode); 571 umode_t mode);
572extern void nfs3_forget_cached_acls(struct inode *inode); 572extern void nfs3_forget_cached_acls(struct inode *inode);
573#else 573#else
574static inline int nfs3_proc_set_default_acl(struct inode *dir, 574static inline int nfs3_proc_set_default_acl(struct inode *dir,
575 struct inode *inode, 575 struct inode *inode,
576 mode_t mode) 576 umode_t mode)
577{ 577{
578 return 0; 578 return 0;
579} 579}
diff --git a/include/linux/nfs_fs_sb.h b/include/linux/nfs_fs_sb.h
index 50a661f8b45a..b5479df8378d 100644
--- a/include/linux/nfs_fs_sb.h
+++ b/include/linux/nfs_fs_sb.h
@@ -131,8 +131,9 @@ struct nfs_server {
131 struct fscache_cookie *fscache; /* superblock cookie */ 131 struct fscache_cookie *fscache; /* superblock cookie */
132#endif 132#endif
133 133
134 u32 pnfs_blksize; /* layout_blksize attr */
134#ifdef CONFIG_NFS_V4 135#ifdef CONFIG_NFS_V4
135 u32 attr_bitmask[2];/* V4 bitmask representing the set 136 u32 attr_bitmask[3];/* V4 bitmask representing the set
136 of attributes supported on this 137 of attributes supported on this
137 filesystem */ 138 filesystem */
138 u32 cache_consistency_bitmask[2]; 139 u32 cache_consistency_bitmask[2];
@@ -145,6 +146,7 @@ struct nfs_server {
145 filesystem */ 146 filesystem */
146 struct pnfs_layoutdriver_type *pnfs_curr_ld; /* Active layout driver */ 147 struct pnfs_layoutdriver_type *pnfs_curr_ld; /* Active layout driver */
147 struct rpc_wait_queue roc_rpcwaitq; 148 struct rpc_wait_queue roc_rpcwaitq;
149 void *pnfs_ld_data; /* per mount point data */
148 150
149 /* the following fields are protected by nfs_client->cl_lock */ 151 /* the following fields are protected by nfs_client->cl_lock */
150 struct rb_root state_owners; 152 struct rb_root state_owners;
diff --git a/include/linux/nfs_page.h b/include/linux/nfs_page.h
index e2791a27a901..ab465fe8c3d6 100644
--- a/include/linux/nfs_page.h
+++ b/include/linux/nfs_page.h
@@ -34,6 +34,7 @@ enum {
34 PG_NEED_COMMIT, 34 PG_NEED_COMMIT,
35 PG_NEED_RESCHED, 35 PG_NEED_RESCHED,
36 PG_PNFS_COMMIT, 36 PG_PNFS_COMMIT,
37 PG_PARTIAL_READ_FAILED,
37}; 38};
38 39
39struct nfs_inode; 40struct nfs_inode;
diff --git a/include/linux/nfs_xdr.h b/include/linux/nfs_xdr.h
index 5b115956abac..c74595ba7094 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 {
@@ -235,6 +236,17 @@ struct nfs4_layoutget {
235 gfp_t gfp_flags; 236 gfp_t gfp_flags;
236}; 237};
237 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
238struct nfs4_getdeviceinfo_args { 250struct nfs4_getdeviceinfo_args {
239 struct pnfs_device *pdev; 251 struct pnfs_device *pdev;
240 struct nfs4_sequence_args seq_args; 252 struct nfs4_sequence_args seq_args;
@@ -257,12 +269,13 @@ struct nfs4_layoutcommit_res {
257 struct nfs_fattr *fattr; 269 struct nfs_fattr *fattr;
258 const struct nfs_server *server; 270 const struct nfs_server *server;
259 struct nfs4_sequence_res seq_res; 271 struct nfs4_sequence_res seq_res;
272 int status;
260}; 273};
261 274
262struct nfs4_layoutcommit_data { 275struct nfs4_layoutcommit_data {
263 struct rpc_task task; 276 struct rpc_task task;
264 struct nfs_fattr fattr; 277 struct nfs_fattr fattr;
265 struct pnfs_layout_segment *lseg; 278 struct list_head lseg_list;
266 struct rpc_cred *cred; 279 struct rpc_cred *cred;
267 struct nfs4_layoutcommit_args args; 280 struct nfs4_layoutcommit_args args;
268 struct nfs4_layoutcommit_res res; 281 struct nfs4_layoutcommit_res res;
@@ -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;
@@ -1120,7 +1133,6 @@ struct nfs_page;
1120#define NFS_PAGEVEC_SIZE (8U) 1133#define NFS_PAGEVEC_SIZE (8U)
1121 1134
1122struct nfs_read_data { 1135struct nfs_read_data {
1123 int flags;
1124 struct rpc_task task; 1136 struct rpc_task task;
1125 struct inode *inode; 1137 struct inode *inode;
1126 struct rpc_cred *cred; 1138 struct rpc_cred *cred;
@@ -1143,7 +1155,6 @@ struct nfs_read_data {
1143}; 1155};
1144 1156
1145struct nfs_write_data { 1157struct nfs_write_data {
1146 int flags;
1147 struct rpc_task task; 1158 struct rpc_task task;
1148 struct inode *inode; 1159 struct inode *inode;
1149 struct rpc_cred *cred; 1160 struct rpc_cred *cred;
@@ -1184,9 +1195,6 @@ struct nfs_rpc_ops {
1184 1195
1185 int (*getroot) (struct nfs_server *, struct nfs_fh *, 1196 int (*getroot) (struct nfs_server *, struct nfs_fh *,
1186 struct nfs_fsinfo *); 1197 struct nfs_fsinfo *);
1187 int (*lookupfh)(struct nfs_server *, struct nfs_fh *,
1188 struct qstr *, struct nfs_fh *,
1189 struct nfs_fattr *);
1190 int (*getattr) (struct nfs_server *, struct nfs_fh *, 1198 int (*getattr) (struct nfs_server *, struct nfs_fh *,
1191 struct nfs_fattr *); 1199 struct nfs_fattr *);
1192 int (*setattr) (struct dentry *, struct nfs_fattr *, 1200 int (*setattr) (struct dentry *, struct nfs_fattr *,
diff --git a/include/linux/nfsd/Kbuild b/include/linux/nfsd/Kbuild
index 55d1467de3c1..b8d4001212b3 100644
--- a/include/linux/nfsd/Kbuild
+++ b/include/linux/nfsd/Kbuild
@@ -1,6 +1,4 @@
1header-y += const.h
2header-y += debug.h 1header-y += debug.h
3header-y += export.h 2header-y += export.h
4header-y += nfsfh.h 3header-y += nfsfh.h
5header-y += stats.h 4header-y += stats.h
6header-y += syscall.h
diff --git a/include/linux/nfsd/const.h b/include/linux/nfsd/const.h
deleted file mode 100644
index 323f8cfa060a..000000000000
--- a/include/linux/nfsd/const.h
+++ /dev/null
@@ -1,55 +0,0 @@
1/*
2 * include/linux/nfsd/const.h
3 *
4 * Various constants related to NFS.
5 *
6 * Copyright (C) 1995-1997 Olaf Kirch <okir@monad.swb.de>
7 */
8
9#ifndef _LINUX_NFSD_CONST_H
10#define _LINUX_NFSD_CONST_H
11
12#include <linux/nfs.h>
13#include <linux/nfs2.h>
14#include <linux/nfs3.h>
15#include <linux/nfs4.h>
16
17/*
18 * Maximum protocol version supported by knfsd
19 */
20#define NFSSVC_MAXVERS 3
21
22/*
23 * Maximum blocksizes supported by daemon under various circumstances.
24 */
25#define NFSSVC_MAXBLKSIZE RPCSVC_MAXPAYLOAD
26/* NFSv2 is limited by the protocol specification, see RFC 1094 */
27#define NFSSVC_MAXBLKSIZE_V2 (8*1024)
28
29#ifdef __KERNEL__
30
31#include <linux/sunrpc/msg_prot.h>
32
33/*
34 * Largest number of bytes we need to allocate for an NFS
35 * call or reply. Used to control buffer sizes. We use
36 * the length of v3 WRITE, READDIR and READDIR replies
37 * which are an RPC header, up to 26 XDR units of reply
38 * data, and some page data.
39 *
40 * Note that accuracy here doesn't matter too much as the
41 * size is rounded up to a page size when allocating space.
42 */
43#define NFSD_BUFSIZE ((RPC_MAX_HEADER_WITH_AUTH+26)*XDR_UNIT + NFSSVC_MAXBLKSIZE)
44
45#ifdef CONFIG_NFSD_V4
46# define NFSSVC_XDRSIZE NFS4_SVC_XDRSIZE
47#elif defined(CONFIG_NFSD_V3)
48# define NFSSVC_XDRSIZE NFS3_SVC_XDRSIZE
49#else
50# define NFSSVC_XDRSIZE NFS2_SVC_XDRSIZE
51#endif
52
53#endif /* __KERNEL__ */
54
55#endif /* _LINUX_NFSD_CONST_H */
diff --git a/include/linux/nfsd/export.h b/include/linux/nfsd/export.h
index 8a31a20efe7e..f85308e688fd 100644
--- a/include/linux/nfsd/export.h
+++ b/include/linux/nfsd/export.h
@@ -96,7 +96,6 @@ struct svc_export {
96 struct auth_domain * ex_client; 96 struct auth_domain * ex_client;
97 int ex_flags; 97 int ex_flags;
98 struct path ex_path; 98 struct path ex_path;
99 char *ex_pathname;
100 uid_t ex_anon_uid; 99 uid_t ex_anon_uid;
101 gid_t ex_anon_gid; 100 gid_t ex_anon_gid;
102 int ex_fsid; 101 int ex_fsid;
@@ -137,6 +136,7 @@ struct svc_export * rqst_exp_get_by_name(struct svc_rqst *,
137 struct path *); 136 struct path *);
138struct svc_export * rqst_exp_parent(struct svc_rqst *, 137struct svc_export * rqst_exp_parent(struct svc_rqst *,
139 struct path *); 138 struct path *);
139struct svc_export * rqst_find_fsidzero_export(struct svc_rqst *);
140int exp_rootfh(struct auth_domain *, 140int exp_rootfh(struct auth_domain *,
141 char *path, struct knfsd_fh *, int maxsize); 141 char *path, struct knfsd_fh *, int maxsize);
142__be32 exp_pseudoroot(struct svc_rqst *, struct svc_fh *); 142__be32 exp_pseudoroot(struct svc_rqst *, struct svc_fh *);
diff --git a/include/linux/nfsd/nfsfh.h b/include/linux/nfsd/nfsfh.h
index f76d80ccec10..ce4743a26015 100644
--- a/include/linux/nfsd/nfsfh.h
+++ b/include/linux/nfsd/nfsfh.h
@@ -14,11 +14,14 @@
14#ifndef _LINUX_NFSD_FH_H 14#ifndef _LINUX_NFSD_FH_H
15#define _LINUX_NFSD_FH_H 15#define _LINUX_NFSD_FH_H
16 16
17# include <linux/types.h> 17#include <linux/types.h>
18#include <linux/nfs.h>
19#include <linux/nfs2.h>
20#include <linux/nfs3.h>
21#include <linux/nfs4.h>
18#ifdef __KERNEL__ 22#ifdef __KERNEL__
19# include <linux/sunrpc/svc.h> 23# include <linux/sunrpc/svc.h>
20#endif 24#endif
21#include <linux/nfsd/const.h>
22 25
23/* 26/*
24 * This is the old "dentry style" Linux NFSv2 file handle. 27 * This is the old "dentry style" Linux NFSv2 file handle.
diff --git a/include/linux/nfsd/syscall.h b/include/linux/nfsd/syscall.h
deleted file mode 100644
index 812bc1e160dc..000000000000
--- a/include/linux/nfsd/syscall.h
+++ /dev/null
@@ -1,116 +0,0 @@
1/*
2 * include/linux/nfsd/syscall.h
3 *
4 * This file holds all declarations for the knfsd syscall interface.
5 *
6 * Copyright (C) 1995-1997 Olaf Kirch <okir@monad.swb.de>
7 */
8
9#ifndef NFSD_SYSCALL_H
10#define NFSD_SYSCALL_H
11
12#include <linux/types.h>
13#include <linux/nfsd/export.h>
14
15/*
16 * Version of the syscall interface
17 */
18#define NFSCTL_VERSION 0x0201
19
20/*
21 * These are the commands understood by nfsctl().
22 */
23#define NFSCTL_SVC 0 /* This is a server process. */
24#define NFSCTL_ADDCLIENT 1 /* Add an NFS client. */
25#define NFSCTL_DELCLIENT 2 /* Remove an NFS client. */
26#define NFSCTL_EXPORT 3 /* export a file system. */
27#define NFSCTL_UNEXPORT 4 /* unexport a file system. */
28/*#define NFSCTL_UGIDUPDATE 5 / * update a client's uid/gid map. DISCARDED */
29/*#define NFSCTL_GETFH 6 / * get an fh by ino DISCARDED */
30#define NFSCTL_GETFD 7 /* get an fh by path (used by mountd) */
31#define NFSCTL_GETFS 8 /* get an fh by path with max FH len */
32
33/* SVC */
34struct nfsctl_svc {
35 unsigned short svc_port;
36 int svc_nthreads;
37};
38
39/* ADDCLIENT/DELCLIENT */
40struct nfsctl_client {
41 char cl_ident[NFSCLNT_IDMAX+1];
42 int cl_naddr;
43 struct in_addr cl_addrlist[NFSCLNT_ADDRMAX];
44 int cl_fhkeytype;
45 int cl_fhkeylen;
46 unsigned char cl_fhkey[NFSCLNT_KEYMAX];
47};
48
49/* EXPORT/UNEXPORT */
50struct nfsctl_export {
51 char ex_client[NFSCLNT_IDMAX+1];
52 char ex_path[NFS_MAXPATHLEN+1];
53 __kernel_old_dev_t ex_dev;
54 __kernel_ino_t ex_ino;
55 int ex_flags;
56 __kernel_uid_t ex_anon_uid;
57 __kernel_gid_t ex_anon_gid;
58};
59
60/* GETFD */
61struct nfsctl_fdparm {
62 struct sockaddr gd_addr;
63 char gd_path[NFS_MAXPATHLEN+1];
64 int gd_version;
65};
66
67/* GETFS - GET Filehandle with Size */
68struct nfsctl_fsparm {
69 struct sockaddr gd_addr;
70 char gd_path[NFS_MAXPATHLEN+1];
71 int gd_maxlen;
72};
73
74/*
75 * This is the argument union.
76 */
77struct nfsctl_arg {
78 int ca_version; /* safeguard */
79 union {
80 struct nfsctl_svc u_svc;
81 struct nfsctl_client u_client;
82 struct nfsctl_export u_export;
83 struct nfsctl_fdparm u_getfd;
84 struct nfsctl_fsparm u_getfs;
85 /*
86 * The following dummy member is needed to preserve binary compatibility
87 * on platforms where alignof(void*)>alignof(int). It's needed because
88 * this union used to contain a member (u_umap) which contained a
89 * pointer.
90 */
91 void *u_ptr;
92 } u;
93#define ca_svc u.u_svc
94#define ca_client u.u_client
95#define ca_export u.u_export
96#define ca_getfd u.u_getfd
97#define ca_getfs u.u_getfs
98};
99
100union nfsctl_res {
101 __u8 cr_getfh[NFS_FHSIZE];
102 struct knfsd_fh cr_getfs;
103};
104
105#ifdef __KERNEL__
106/*
107 * Kernel syscall implementation.
108 */
109extern int exp_addclient(struct nfsctl_client *ncp);
110extern int exp_delclient(struct nfsctl_client *ncp);
111extern int exp_export(struct nfsctl_export *nxp);
112extern int exp_unexport(struct nfsctl_export *nxp);
113
114#endif /* __KERNEL__ */
115
116#endif /* NFSD_SYSCALL_H */
diff --git a/include/linux/nl80211.h b/include/linux/nl80211.h
index 460b12a8ef66..8049bf77d799 100644
--- a/include/linux/nl80211.h
+++ b/include/linux/nl80211.h
@@ -238,6 +238,8 @@
238 * 238 *
239 * @NL80211_CMD_GET_SCAN: get scan results 239 * @NL80211_CMD_GET_SCAN: get scan results
240 * @NL80211_CMD_TRIGGER_SCAN: trigger a new scan with the given parameters 240 * @NL80211_CMD_TRIGGER_SCAN: trigger a new scan with the given parameters
241 * %NL80211_ATTR_TX_NO_CCK_RATE is used to decide whether to send the
242 * probe requests at CCK rate or not.
241 * @NL80211_CMD_NEW_SCAN_RESULTS: scan notification (as a reply to 243 * @NL80211_CMD_NEW_SCAN_RESULTS: scan notification (as a reply to
242 * NL80211_CMD_GET_SCAN and on the "scan" multicast group) 244 * NL80211_CMD_GET_SCAN and on the "scan" multicast group)
243 * @NL80211_CMD_SCAN_ABORTED: scan was aborted, for unspecified reasons, 245 * @NL80211_CMD_SCAN_ABORTED: scan was aborted, for unspecified reasons,
@@ -432,6 +434,8 @@
432 * specified using %NL80211_ATTR_DURATION. When called, this operation 434 * specified using %NL80211_ATTR_DURATION. When called, this operation
433 * returns a cookie (%NL80211_ATTR_COOKIE) that will be included with the 435 * returns a cookie (%NL80211_ATTR_COOKIE) that will be included with the
434 * TX status event pertaining to the TX request. 436 * TX status event pertaining to the TX request.
437 * %NL80211_ATTR_TX_NO_CCK_RATE is used to decide whether to send the
438 * management frames at CCK rate or not in 2GHz band.
435 * @NL80211_CMD_FRAME_WAIT_CANCEL: When an off-channel TX was requested, this 439 * @NL80211_CMD_FRAME_WAIT_CANCEL: When an off-channel TX was requested, this
436 * command may be used with the corresponding cookie to cancel the wait 440 * command may be used with the corresponding cookie to cancel the wait
437 * time if it is known that it is no longer necessary. 441 * time if it is known that it is no longer necessary.
@@ -502,6 +506,9 @@
502 * @NL80211_CMD_PMKSA_CANDIDATE: This is used as an event to inform userspace 506 * @NL80211_CMD_PMKSA_CANDIDATE: This is used as an event to inform userspace
503 * of PMKSA caching dandidates. 507 * of PMKSA caching dandidates.
504 * 508 *
509 * @NL80211_CMD_TDLS_OPER: Perform a high-level TDLS command (e.g. link setup).
510 * @NL80211_CMD_TDLS_MGMT: Send a TDLS management frame.
511 *
505 * @NL80211_CMD_MAX: highest used command number 512 * @NL80211_CMD_MAX: highest used command number
506 * @__NL80211_CMD_AFTER_LAST: internal use 513 * @__NL80211_CMD_AFTER_LAST: internal use
507 */ 514 */
@@ -628,6 +635,9 @@ enum nl80211_commands {
628 635
629 NL80211_CMD_PMKSA_CANDIDATE, 636 NL80211_CMD_PMKSA_CANDIDATE,
630 637
638 NL80211_CMD_TDLS_OPER,
639 NL80211_CMD_TDLS_MGMT,
640
631 /* add new commands above here */ 641 /* add new commands above here */
632 642
633 /* used to define NL80211_CMD_MAX below */ 643 /* used to define NL80211_CMD_MAX below */
@@ -1078,6 +1088,27 @@ enum nl80211_commands {
1078 * @NL80211_ATTR_PMKSA_CANDIDATE: Nested attribute containing the PMKSA caching 1088 * @NL80211_ATTR_PMKSA_CANDIDATE: Nested attribute containing the PMKSA caching
1079 * candidate information, see &enum nl80211_pmksa_candidate_attr. 1089 * candidate information, see &enum nl80211_pmksa_candidate_attr.
1080 * 1090 *
1091 * @NL80211_ATTR_TX_NO_CCK_RATE: Indicates whether to use CCK rate or not
1092 * for management frames transmission. In order to avoid p2p probe/action
1093 * frames are being transmitted at CCK rate in 2GHz band, the user space
1094 * applications use this attribute.
1095 * This attribute is used with %NL80211_CMD_TRIGGER_SCAN and
1096 * %NL80211_CMD_FRAME commands.
1097 *
1098 * @NL80211_ATTR_TDLS_ACTION: Low level TDLS action code (e.g. link setup
1099 * request, link setup confirm, link teardown, etc.). Values are
1100 * described in the TDLS (802.11z) specification.
1101 * @NL80211_ATTR_TDLS_DIALOG_TOKEN: Non-zero token for uniquely identifying a
1102 * TDLS conversation between two devices.
1103 * @NL80211_ATTR_TDLS_OPERATION: High level TDLS operation; see
1104 * &enum nl80211_tdls_operation, represented as a u8.
1105 * @NL80211_ATTR_TDLS_SUPPORT: A flag indicating the device can operate
1106 * as a TDLS peer sta.
1107 * @NL80211_ATTR_TDLS_EXTERNAL_SETUP: The TDLS discovery/setup and teardown
1108 * procedures should be performed by sending TDLS packets via
1109 * %NL80211_CMD_TDLS_MGMT. Otherwise %NL80211_CMD_TDLS_OPER should be
1110 * used for asking the driver to perform a TDLS operation.
1111 *
1081 * @NL80211_ATTR_MAX: highest attribute number currently defined 1112 * @NL80211_ATTR_MAX: highest attribute number currently defined
1082 * @__NL80211_ATTR_AFTER_LAST: internal use 1113 * @__NL80211_ATTR_AFTER_LAST: internal use
1083 */ 1114 */
@@ -1298,6 +1329,14 @@ enum nl80211_attrs {
1298 1329
1299 NL80211_ATTR_PMKSA_CANDIDATE, 1330 NL80211_ATTR_PMKSA_CANDIDATE,
1300 1331
1332 NL80211_ATTR_TX_NO_CCK_RATE,
1333
1334 NL80211_ATTR_TDLS_ACTION,
1335 NL80211_ATTR_TDLS_DIALOG_TOKEN,
1336 NL80211_ATTR_TDLS_OPERATION,
1337 NL80211_ATTR_TDLS_SUPPORT,
1338 NL80211_ATTR_TDLS_EXTERNAL_SETUP,
1339
1301 /* add attributes here, update the policy in nl80211.c */ 1340 /* add attributes here, update the policy in nl80211.c */
1302 1341
1303 __NL80211_ATTR_AFTER_LAST, 1342 __NL80211_ATTR_AFTER_LAST,
@@ -1395,6 +1434,7 @@ enum nl80211_iftype {
1395 * @NL80211_STA_FLAG_WME: station is WME/QoS capable 1434 * @NL80211_STA_FLAG_WME: station is WME/QoS capable
1396 * @NL80211_STA_FLAG_MFP: station uses management frame protection 1435 * @NL80211_STA_FLAG_MFP: station uses management frame protection
1397 * @NL80211_STA_FLAG_AUTHENTICATED: station is authenticated 1436 * @NL80211_STA_FLAG_AUTHENTICATED: station is authenticated
1437 * @NL80211_STA_FLAG_TDLS_PEER: station is a TDLS peer
1398 * @NL80211_STA_FLAG_MAX: highest station flag number currently defined 1438 * @NL80211_STA_FLAG_MAX: highest station flag number currently defined
1399 * @__NL80211_STA_FLAG_AFTER_LAST: internal use 1439 * @__NL80211_STA_FLAG_AFTER_LAST: internal use
1400 */ 1440 */
@@ -1405,6 +1445,7 @@ enum nl80211_sta_flags {
1405 NL80211_STA_FLAG_WME, 1445 NL80211_STA_FLAG_WME,
1406 NL80211_STA_FLAG_MFP, 1446 NL80211_STA_FLAG_MFP,
1407 NL80211_STA_FLAG_AUTHENTICATED, 1447 NL80211_STA_FLAG_AUTHENTICATED,
1448 NL80211_STA_FLAG_TDLS_PEER,
1408 1449
1409 /* keep last */ 1450 /* keep last */
1410 __NL80211_STA_FLAG_AFTER_LAST, 1451 __NL80211_STA_FLAG_AFTER_LAST,
@@ -1507,6 +1548,7 @@ enum nl80211_sta_bss_param {
1507 * @NL80211_STA_INFO_BSS_PARAM: current station's view of BSS, nested attribute 1548 * @NL80211_STA_INFO_BSS_PARAM: current station's view of BSS, nested attribute
1508 * containing info as possible, see &enum nl80211_sta_bss_param 1549 * containing info as possible, see &enum nl80211_sta_bss_param
1509 * @NL80211_STA_INFO_CONNECTED_TIME: time since the station is last connected 1550 * @NL80211_STA_INFO_CONNECTED_TIME: time since the station is last connected
1551 * @NL80211_STA_INFO_STA_FLAGS: Contains a struct nl80211_sta_flag_update.
1510 * @__NL80211_STA_INFO_AFTER_LAST: internal 1552 * @__NL80211_STA_INFO_AFTER_LAST: internal
1511 * @NL80211_STA_INFO_MAX: highest possible station info attribute 1553 * @NL80211_STA_INFO_MAX: highest possible station info attribute
1512 */ 1554 */
@@ -1528,6 +1570,7 @@ enum nl80211_sta_info {
1528 NL80211_STA_INFO_RX_BITRATE, 1570 NL80211_STA_INFO_RX_BITRATE,
1529 NL80211_STA_INFO_BSS_PARAM, 1571 NL80211_STA_INFO_BSS_PARAM,
1530 NL80211_STA_INFO_CONNECTED_TIME, 1572 NL80211_STA_INFO_CONNECTED_TIME,
1573 NL80211_STA_INFO_STA_FLAGS,
1531 1574
1532 /* keep last */ 1575 /* keep last */
1533 __NL80211_STA_INFO_AFTER_LAST, 1576 __NL80211_STA_INFO_AFTER_LAST,
@@ -2591,4 +2634,20 @@ enum nl80211_pmksa_candidate_attr {
2591 MAX_NL80211_PMKSA_CANDIDATE = NUM_NL80211_PMKSA_CANDIDATE - 1 2634 MAX_NL80211_PMKSA_CANDIDATE = NUM_NL80211_PMKSA_CANDIDATE - 1
2592}; 2635};
2593 2636
2637/**
2638 * enum nl80211_tdls_operation - values for %NL80211_ATTR_TDLS_OPERATION
2639 * @NL80211_TDLS_DISCOVERY_REQ: Send a TDLS discovery request
2640 * @NL80211_TDLS_SETUP: Setup TDLS link
2641 * @NL80211_TDLS_TEARDOWN: Teardown a TDLS link which is already established
2642 * @NL80211_TDLS_ENABLE_LINK: Enable TDLS link
2643 * @NL80211_TDLS_DISABLE_LINK: Disable TDLS link
2644 */
2645enum nl80211_tdls_operation {
2646 NL80211_TDLS_DISCOVERY_REQ,
2647 NL80211_TDLS_SETUP,
2648 NL80211_TDLS_TEARDOWN,
2649 NL80211_TDLS_ENABLE_LINK,
2650 NL80211_TDLS_DISABLE_LINK,
2651};
2652
2594#endif /* __LINUX_NL80211_H */ 2653#endif /* __LINUX_NL80211_H */
diff --git a/include/linux/of.h b/include/linux/of.h
index bd716f8908de..9180dc5cb00b 100644
--- a/include/linux/of.h
+++ b/include/linux/of.h
@@ -196,12 +196,13 @@ extern 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, 198extern int of_property_read_u32_array(const struct device_node *np,
199 char *propname, 199 const char *propname,
200 u32 *out_values, 200 u32 *out_values,
201 size_t sz); 201 size_t sz);
202 202
203extern int of_property_read_string(struct device_node *np, char *propname, 203extern int of_property_read_string(struct device_node *np,
204 const char **out_string); 204 const char *propname,
205 const char **out_string);
205extern int of_device_is_compatible(const struct device_node *device, 206extern int of_device_is_compatible(const struct device_node *device,
206 const char *); 207 const char *);
207extern int of_device_is_available(const struct device_node *device); 208extern int of_device_is_available(const struct device_node *device);
@@ -242,21 +243,30 @@ static inline bool of_have_populated_dt(void)
242} 243}
243 244
244static inline int of_property_read_u32_array(const struct device_node *np, 245static inline int of_property_read_u32_array(const struct device_node *np,
245 char *propname, u32 *out_values, size_t sz) 246 const char *propname,
247 u32 *out_values, size_t sz)
246{ 248{
247 return -ENOSYS; 249 return -ENOSYS;
248} 250}
249 251
250static inline int of_property_read_string(struct device_node *np, 252static inline int of_property_read_string(struct device_node *np,
251 char *propname, const char **out_string) 253 const char *propname,
254 const char **out_string)
252{ 255{
253 return -ENOSYS; 256 return -ENOSYS;
254} 257}
255 258
259static inline const void *of_get_property(const struct device_node *node,
260 const char *name,
261 int *lenp)
262{
263 return NULL;
264}
265
256#endif /* CONFIG_OF */ 266#endif /* CONFIG_OF */
257 267
258static inline int of_property_read_u32(const struct device_node *np, 268static inline int of_property_read_u32(const struct device_node *np,
259 char *propname, 269 const char *propname,
260 u32 *out_value) 270 u32 *out_value)
261{ 271{
262 return of_property_read_u32_array(np, propname, out_value, 1); 272 return of_property_read_u32_array(np, propname, out_value, 1);
diff --git a/include/linux/of_gpio.h b/include/linux/of_gpio.h
index aec8025c786a..52280a2b5e63 100644
--- a/include/linux/of_gpio.h
+++ b/include/linux/of_gpio.h
@@ -57,6 +57,8 @@ extern int of_mm_gpiochip_add(struct device_node *np,
57extern void of_gpiochip_add(struct gpio_chip *gc); 57extern void of_gpiochip_add(struct gpio_chip *gc);
58extern void of_gpiochip_remove(struct gpio_chip *gc); 58extern void of_gpiochip_remove(struct gpio_chip *gc);
59extern 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);
60 62
61#else /* CONFIG_OF_GPIO */ 63#else /* CONFIG_OF_GPIO */
62 64
@@ -72,6 +74,13 @@ static inline unsigned int of_gpio_count(struct device_node *np)
72 return 0; 74 return 0;
73} 75}
74 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
75static inline void of_gpiochip_add(struct gpio_chip *gc) { } 84static inline void of_gpiochip_add(struct gpio_chip *gc) { }
76static inline void of_gpiochip_remove(struct gpio_chip *gc) { } 85static inline void of_gpiochip_remove(struct gpio_chip *gc) { }
77 86
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/opp.h b/include/linux/opp.h
index 7020e9736fc5..87a9208f8aec 100644
--- a/include/linux/opp.h
+++ b/include/linux/opp.h
@@ -16,9 +16,14 @@
16 16
17#include <linux/err.h> 17#include <linux/err.h>
18#include <linux/cpufreq.h> 18#include <linux/cpufreq.h>
19#include <linux/notifier.h>
19 20
20struct opp; 21struct opp;
21 22
23enum opp_event {
24 OPP_EVENT_ADD, OPP_EVENT_ENABLE, OPP_EVENT_DISABLE,
25};
26
22#if defined(CONFIG_PM_OPP) 27#if defined(CONFIG_PM_OPP)
23 28
24unsigned long opp_get_voltage(struct opp *opp); 29unsigned long opp_get_voltage(struct opp *opp);
@@ -40,6 +45,8 @@ int opp_enable(struct device *dev, unsigned long freq);
40 45
41int opp_disable(struct device *dev, unsigned long freq); 46int opp_disable(struct device *dev, unsigned long freq);
42 47
48struct srcu_notifier_head *opp_get_notifier(struct device *dev);
49
43#else 50#else
44static inline unsigned long opp_get_voltage(struct opp *opp) 51static inline unsigned long opp_get_voltage(struct opp *opp)
45{ 52{
@@ -89,6 +96,11 @@ static inline int opp_disable(struct device *dev, unsigned long freq)
89{ 96{
90 return 0; 97 return 0;
91} 98}
99
100struct srcu_notifier_head *opp_get_notifier(struct device *dev)
101{
102 return ERR_PTR(-EINVAL);
103}
92#endif /* CONFIG_PM */ 104#endif /* CONFIG_PM */
93 105
94#if defined(CONFIG_CPU_FREQ) && defined(CONFIG_PM_OPP) 106#if defined(CONFIG_CPU_FREQ) && defined(CONFIG_PM_OPP)
diff --git a/include/linux/oprofile.h b/include/linux/oprofile.h
index 49c8727eeb57..a4c562453f6b 100644
--- a/include/linux/oprofile.h
+++ b/include/linux/oprofile.h
@@ -166,7 +166,7 @@ ssize_t oprofilefs_ulong_to_user(unsigned long val, char __user * buf, size_t co
166int oprofilefs_ulong_from_user(unsigned long * val, char const __user * buf, size_t count); 166int oprofilefs_ulong_from_user(unsigned long * val, char const __user * buf, size_t count);
167 167
168/** lock for read/write safety */ 168/** lock for read/write safety */
169extern spinlock_t oprofilefs_lock; 169extern raw_spinlock_t oprofilefs_lock;
170 170
171/** 171/**
172 * Add the contents of a circular buffer to the event buffer. 172 * Add the contents of a circular buffer to the event buffer.
diff --git a/include/linux/page-flags.h b/include/linux/page-flags.h
index 3e5a1b189a41..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
@@ -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/pci.h b/include/linux/pci.h
index 3a5626df37ce..f1b1ca1a09e1 100644
--- a/include/linux/pci.h
+++ b/include/linux/pci.h
@@ -174,6 +174,8 @@ enum pci_dev_flags {
174 PCI_DEV_FLAGS_MSI_INTX_DISABLE_BUG = (__force pci_dev_flags_t) 1, 174 PCI_DEV_FLAGS_MSI_INTX_DISABLE_BUG = (__force pci_dev_flags_t) 1,
175 /* Device configuration is irrevocably lost if disabled into D3 */ 175 /* Device configuration is irrevocably lost if disabled into D3 */
176 PCI_DEV_FLAGS_NO_D3 = (__force pci_dev_flags_t) 2, 176 PCI_DEV_FLAGS_NO_D3 = (__force pci_dev_flags_t) 2,
177 /* Provide indication device is assigned by a Virtual Machine Manager */
178 PCI_DEV_FLAGS_ASSIGNED = (__force pci_dev_flags_t) 4,
177}; 179};
178 180
179enum pci_irq_reroute_variant { 181enum pci_irq_reroute_variant {
@@ -251,7 +253,8 @@ struct pci_dev {
251 u8 revision; /* PCI revision, low byte of class word */ 253 u8 revision; /* PCI revision, low byte of class word */
252 u8 hdr_type; /* PCI header type (`multi' flag masked out) */ 254 u8 hdr_type; /* PCI header type (`multi' flag masked out) */
253 u8 pcie_cap; /* PCI-E capability offset */ 255 u8 pcie_cap; /* PCI-E capability offset */
254 u8 pcie_type; /* PCI-E device/port type */ 256 u8 pcie_type:4; /* PCI-E device/port type */
257 u8 pcie_mpss:3; /* PCI-E Max Payload Size Supported */
255 u8 rom_base_reg; /* which config register controls the ROM */ 258 u8 rom_base_reg; /* which config register controls the ROM */
256 u8 pin; /* which interrupt pin this device uses */ 259 u8 pin; /* which interrupt pin this device uses */
257 260
@@ -617,6 +620,17 @@ struct pci_driver {
617/* these external functions are only available when PCI support is enabled */ 620/* these external functions are only available when PCI support is enabled */
618#ifdef CONFIG_PCI 621#ifdef CONFIG_PCI
619 622
623extern void pcie_bus_configure_settings(struct pci_bus *bus, u8 smpss);
624
625enum pcie_bus_config_types {
626 PCIE_BUS_TUNE_OFF,
627 PCIE_BUS_SAFE,
628 PCIE_BUS_PERFORMANCE,
629 PCIE_BUS_PEER2PEER,
630};
631
632extern enum pcie_bus_config_types pcie_bus_config;
633
620extern struct bus_type pci_bus_type; 634extern struct bus_type pci_bus_type;
621 635
622/* Do NOT directly access these two variables, unless you are arch specific pci 636/* Do NOT directly access these two variables, unless you are arch specific pci
@@ -796,10 +810,13 @@ int pcix_get_mmrbc(struct pci_dev *dev);
796int pcix_set_mmrbc(struct pci_dev *dev, int mmrbc); 810int pcix_set_mmrbc(struct pci_dev *dev, int mmrbc);
797int pcie_get_readrq(struct pci_dev *dev); 811int pcie_get_readrq(struct pci_dev *dev);
798int pcie_set_readrq(struct pci_dev *dev, int rq); 812int pcie_set_readrq(struct pci_dev *dev, int rq);
813int pcie_get_mps(struct pci_dev *dev);
814int pcie_set_mps(struct pci_dev *dev, int mps);
799int __pci_reset_function(struct pci_dev *dev); 815int __pci_reset_function(struct pci_dev *dev);
800int pci_reset_function(struct pci_dev *dev); 816int pci_reset_function(struct pci_dev *dev);
801void pci_update_resource(struct pci_dev *dev, int resno); 817void pci_update_resource(struct pci_dev *dev, int resno);
802int __must_check pci_assign_resource(struct pci_dev *dev, int i); 818int __must_check pci_assign_resource(struct pci_dev *dev, int i);
819int __must_check pci_reassign_resource(struct pci_dev *dev, int i, resource_size_t add_size, resource_size_t align);
803int pci_select_bars(struct pci_dev *dev, unsigned long flags); 820int pci_select_bars(struct pci_dev *dev, unsigned long flags);
804 821
805/* ROM control related routines */ 822/* ROM control related routines */
@@ -843,8 +860,8 @@ void pci_enable_ido(struct pci_dev *dev, unsigned long type);
843void pci_disable_ido(struct pci_dev *dev, unsigned long type); 860void pci_disable_ido(struct pci_dev *dev, unsigned long type);
844 861
845enum pci_obff_signal_type { 862enum pci_obff_signal_type {
846 PCI_EXP_OBFF_SIGNAL_L0, 863 PCI_EXP_OBFF_SIGNAL_L0 = 0,
847 PCI_EXP_OBFF_SIGNAL_ALWAYS, 864 PCI_EXP_OBFF_SIGNAL_ALWAYS = 1,
848}; 865};
849int pci_enable_obff(struct pci_dev *dev, enum pci_obff_signal_type); 866int pci_enable_obff(struct pci_dev *dev, enum pci_obff_signal_type);
850void pci_disable_obff(struct pci_dev *dev); 867void pci_disable_obff(struct pci_dev *dev);
@@ -879,7 +896,7 @@ void pdev_enable_device(struct pci_dev *);
879void pdev_sort_resources(struct pci_dev *, struct resource_list *); 896void pdev_sort_resources(struct pci_dev *, struct resource_list *);
880int pci_enable_resources(struct pci_dev *, int mask); 897int pci_enable_resources(struct pci_dev *, int mask);
881void pci_fixup_irqs(u8 (*)(struct pci_dev *, u8 *), 898void pci_fixup_irqs(u8 (*)(struct pci_dev *, u8 *),
882 int (*)(struct pci_dev *, u8, u8)); 899 int (*)(const struct pci_dev *, u8, u8));
883#define HAVE_PCI_REQ_REGIONS 2 900#define HAVE_PCI_REQ_REGIONS 2
884int __must_check pci_request_regions(struct pci_dev *, const char *); 901int __must_check pci_request_regions(struct pci_dev *, const char *);
885int __must_check pci_request_regions_exclusive(struct pci_dev *, const char *); 902int __must_check pci_request_regions_exclusive(struct pci_dev *, const char *);
diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h
index b00c4ec5056e..ae96bbe54518 100644
--- a/include/linux/pci_ids.h
+++ b/include/linux/pci_ids.h
@@ -2709,6 +2709,16 @@
2709#define PCI_DEVICE_ID_INTEL_ICH10_5 0x3a60 2709#define PCI_DEVICE_ID_INTEL_ICH10_5 0x3a60
2710#define PCI_DEVICE_ID_INTEL_5_3400_SERIES_LPC_MIN 0x3b00 2710#define PCI_DEVICE_ID_INTEL_5_3400_SERIES_LPC_MIN 0x3b00
2711#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
2712#define PCI_DEVICE_ID_INTEL_IOAT_SNB 0x402f 2722#define PCI_DEVICE_ID_INTEL_IOAT_SNB 0x402f
2713#define PCI_DEVICE_ID_INTEL_5100_16 0x65f0 2723#define PCI_DEVICE_ID_INTEL_5100_16 0x65f0
2714#define PCI_DEVICE_ID_INTEL_5100_21 0x65f5 2724#define PCI_DEVICE_ID_INTEL_5100_21 0x65f5
diff --git a/include/linux/percpu_counter.h b/include/linux/percpu_counter.h
index 5edc9014263a..b9df9ed1adc0 100644
--- a/include/linux/percpu_counter.h
+++ b/include/linux/percpu_counter.h
@@ -16,7 +16,7 @@
16#ifdef CONFIG_SMP 16#ifdef CONFIG_SMP
17 17
18struct percpu_counter { 18struct percpu_counter {
19 spinlock_t lock; 19 raw_spinlock_t lock;
20 s64 count; 20 s64 count;
21#ifdef CONFIG_HOTPLUG_CPU 21#ifdef CONFIG_HOTPLUG_CPU
22 struct list_head list; /* All percpu_counters are on a list */ 22 struct list_head list; /* All percpu_counters are on a list */
diff --git a/include/linux/perf_event.h b/include/linux/perf_event.h
index 245bafdafd5e..1e9ebe5e0091 100644
--- a/include/linux/perf_event.h
+++ b/include/linux/perf_event.h
@@ -220,7 +220,10 @@ struct perf_event_attr {
220 mmap_data : 1, /* non-exec mmap data */ 220 mmap_data : 1, /* non-exec mmap data */
221 sample_id_all : 1, /* sample_type all events */ 221 sample_id_all : 1, /* sample_type all events */
222 222
223 __reserved_1 : 45; 223 exclude_host : 1, /* don't count in host */
224 exclude_guest : 1, /* don't count in guest */
225
226 __reserved_1 : 43;
224 227
225 union { 228 union {
226 __u32 wakeup_events; /* wakeup every n events */ 229 __u32 wakeup_events; /* wakeup every n events */
@@ -944,8 +947,10 @@ extern void perf_pmu_unregister(struct pmu *pmu);
944 947
945extern int perf_num_counters(void); 948extern int perf_num_counters(void);
946extern const char *perf_pmu_name(void); 949extern const char *perf_pmu_name(void);
947extern void __perf_event_task_sched_in(struct task_struct *task); 950extern void __perf_event_task_sched_in(struct task_struct *prev,
948extern void __perf_event_task_sched_out(struct task_struct *task, struct task_struct *next); 951 struct task_struct *task);
952extern void __perf_event_task_sched_out(struct task_struct *prev,
953 struct task_struct *next);
949extern int perf_event_init_task(struct task_struct *child); 954extern int perf_event_init_task(struct task_struct *child);
950extern void perf_event_exit_task(struct task_struct *child); 955extern void perf_event_exit_task(struct task_struct *child);
951extern void perf_event_free_task(struct task_struct *task); 956extern void perf_event_free_task(struct task_struct *task);
@@ -1059,17 +1064,20 @@ perf_sw_event(u32 event_id, u64 nr, struct pt_regs *regs, u64 addr)
1059 1064
1060extern struct jump_label_key perf_sched_events; 1065extern struct jump_label_key perf_sched_events;
1061 1066
1062static inline void perf_event_task_sched_in(struct task_struct *task) 1067static inline void perf_event_task_sched_in(struct task_struct *prev,
1068 struct task_struct *task)
1063{ 1069{
1064 if (static_branch(&perf_sched_events)) 1070 if (static_branch(&perf_sched_events))
1065 __perf_event_task_sched_in(task); 1071 __perf_event_task_sched_in(prev, task);
1066} 1072}
1067 1073
1068static inline void perf_event_task_sched_out(struct task_struct *task, struct task_struct *next) 1074static inline void perf_event_task_sched_out(struct task_struct *prev,
1075 struct task_struct *next)
1069{ 1076{
1070 perf_sw_event(PERF_COUNT_SW_CONTEXT_SWITCHES, 1, NULL, 0); 1077 perf_sw_event(PERF_COUNT_SW_CONTEXT_SWITCHES, 1, NULL, 0);
1071 1078
1072 __perf_event_task_sched_out(task, next); 1079 if (static_branch(&perf_sched_events))
1080 __perf_event_task_sched_out(prev, next);
1073} 1081}
1074 1082
1075extern void perf_event_mmap(struct vm_area_struct *vma); 1083extern void perf_event_mmap(struct vm_area_struct *vma);
@@ -1139,10 +1147,11 @@ extern void perf_event_disable(struct perf_event *event);
1139extern void perf_event_task_tick(void); 1147extern void perf_event_task_tick(void);
1140#else 1148#else
1141static inline void 1149static inline void
1142perf_event_task_sched_in(struct task_struct *task) { } 1150perf_event_task_sched_in(struct task_struct *prev,
1151 struct task_struct *task) { }
1143static inline void 1152static inline void
1144perf_event_task_sched_out(struct task_struct *task, 1153perf_event_task_sched_out(struct task_struct *prev,
1145 struct task_struct *next) { } 1154 struct task_struct *next) { }
1146static inline int perf_event_init_task(struct task_struct *child) { return 0; } 1155static inline int perf_event_init_task(struct task_struct *child) { return 0; }
1147static inline void perf_event_exit_task(struct task_struct *child) { } 1156static inline void perf_event_exit_task(struct task_struct *child) { }
1148static inline void perf_event_free_task(struct task_struct *task) { } 1157static inline void perf_event_free_task(struct task_struct *task) { }
diff --git a/include/linux/personality.h b/include/linux/personality.h
index eec3bae164d4..8fc7dd1a57ff 100644
--- a/include/linux/personality.h
+++ b/include/linux/personality.h
@@ -22,6 +22,7 @@ extern int __set_personality(unsigned int);
22 * These occupy the top three bytes. 22 * These occupy the top three bytes.
23 */ 23 */
24enum { 24enum {
25 UNAME26 = 0x0020000,
25 ADDR_NO_RANDOMIZE = 0x0040000, /* disable randomization of VA space */ 26 ADDR_NO_RANDOMIZE = 0x0040000, /* disable randomization of VA space */
26 FDPIC_FUNCPTRS = 0x0080000, /* userspace function ptrs point to descriptors 27 FDPIC_FUNCPTRS = 0x0080000, /* userspace function ptrs point to descriptors
27 * (signal handling) 28 * (signal handling)
diff --git a/include/linux/phonet.h b/include/linux/phonet.h
index 6fb13841db45..f53a4167c5f4 100644
--- a/include/linux/phonet.h
+++ b/include/linux/phonet.h
@@ -24,6 +24,7 @@
24#define LINUX_PHONET_H 24#define LINUX_PHONET_H
25 25
26#include <linux/types.h> 26#include <linux/types.h>
27#include <linux/socket.h>
27 28
28/* Automatic protocol selection */ 29/* Automatic protocol selection */
29#define PN_PROTO_TRANSPORT 0 30#define PN_PROTO_TRANSPORT 0
@@ -96,11 +97,11 @@ struct phonetmsg {
96 97
97/* Phonet socket address structure */ 98/* Phonet socket address structure */
98struct sockaddr_pn { 99struct sockaddr_pn {
99 sa_family_t spn_family; 100 __kernel_sa_family_t spn_family;
100 __u8 spn_obj; 101 __u8 spn_obj;
101 __u8 spn_dev; 102 __u8 spn_dev;
102 __u8 spn_resource; 103 __u8 spn_resource;
103 __u8 spn_zero[sizeof(struct sockaddr) - sizeof(sa_family_t) - 3]; 104 __u8 spn_zero[sizeof(struct sockaddr) - sizeof(__kernel_sa_family_t) - 3];
104} __attribute__((packed)); 105} __attribute__((packed));
105 106
106/* Well known address */ 107/* Well known address */
diff --git a/include/linux/phy.h b/include/linux/phy.h
index ad5186354d92..79f337c47388 100644
--- a/include/linux/phy.h
+++ b/include/linux/phy.h
@@ -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
@@ -418,7 +420,7 @@ struct phy_driver {
418 420
419 /* 421 /*
420 * Requests a Tx timestamp for 'skb'. The phy driver promises 422 * Requests a Tx timestamp for 'skb'. The phy driver promises
421 * to deliver it to the socket's error queue as soon as a 423 * to deliver it using skb_complete_tx_timestamp() as soon as a
422 * timestamp becomes available. One of the PTP_CLASS_ values 424 * timestamp becomes available. One of the PTP_CLASS_ values
423 * is passed in 'type'. 425 * is passed in 'type'.
424 */ 426 */
diff --git a/include/linux/pinctrl/machine.h b/include/linux/pinctrl/machine.h
new file mode 100644
index 000000000000..88863531d862
--- /dev/null
+++ b/include/linux/pinctrl/machine.h
@@ -0,0 +1,107 @@
1/*
2 * Machine interface for the pinctrl subsystem.
3 *
4 * Copyright (C) 2011 ST-Ericsson SA
5 * Written on behalf of Linaro for ST-Ericsson
6 * Based on bits of regulator core, gpio core and clk core
7 *
8 * Author: Linus Walleij <linus.walleij@linaro.org>
9 *
10 * License terms: GNU General Public License (GPL) version 2
11 */
12#ifndef __LINUX_PINMUX_MACHINE_H
13#define __LINUX_PINMUX_MACHINE_H
14
15/**
16 * struct pinmux_map - boards/machines shall provide this map for devices
17 * @name: the name of this specific map entry for the particular machine.
18 * This is the second parameter passed to pinmux_get() when you want
19 * to have several mappings to the same device
20 * @ctrl_dev: the pin control device to be used by this mapping, may be NULL
21 * if you provide .ctrl_dev_name instead (this is more common)
22 * @ctrl_dev_name: the name of the device controlling this specific mapping,
23 * the name must be the same as in your struct device*, may be NULL if
24 * you provide .ctrl_dev instead
25 * @function: a function in the driver to use for this mapping, the driver
26 * will lookup the function referenced by this ID on the specified
27 * pin control device
28 * @group: sometimes a function can map to different pin groups, so this
29 * selects a certain specific pin group to activate for the function, if
30 * left as NULL, the first applicable group will be used
31 * @dev: the device using this specific mapping, may be NULL if you provide
32 * .dev_name instead (this is more common)
33 * @dev_name: the name of the device using this specific mapping, the name
34 * must be the same as in your struct device*, may be NULL if you
35 * provide .dev instead
36 * @hog_on_boot: if this is set to true, the pin control subsystem will itself
37 * hog the mappings as the pinmux device drivers are attached, so this is
38 * typically used with system maps (mux mappings without an assigned
39 * device) that you want to get hogged and enabled by default as soon as
40 * a pinmux device supporting it is registered. These maps will not be
41 * disabled and put until the system shuts down.
42 */
43struct pinmux_map {
44 const char *name;
45 struct device *ctrl_dev;
46 const char *ctrl_dev_name;
47 const char *function;
48 const char *group;
49 struct device *dev;
50 const char *dev_name;
51 const bool hog_on_boot;
52};
53
54/*
55 * Convenience macro to set a simple map from a certain pin controller and a
56 * certain function to a named device
57 */
58#define PINMUX_MAP(a, b, c, d) \
59 { .name = a, .ctrl_dev_name = b, .function = c, .dev_name = d }
60
61/*
62 * Convenience macro to map a system function onto a certain pinctrl device.
63 * System functions are not assigned to a particular device.
64 */
65#define PINMUX_MAP_SYS(a, b, c) \
66 { .name = a, .ctrl_dev_name = b, .function = c }
67
68/*
69 * Convenience macro to map a function onto the primary device pinctrl device
70 * this is especially helpful on systems that have only one pin controller
71 * or need to set up a lot of mappings on the primary controller.
72 */
73#define PINMUX_MAP_PRIMARY(a, b, c) \
74 { .name = a, .ctrl_dev_name = "pinctrl.0", .function = b, \
75 .dev_name = c }
76
77/*
78 * Convenience macro to map a system function onto the primary pinctrl device.
79 * System functions are not assigned to a particular device.
80 */
81#define PINMUX_MAP_PRIMARY_SYS(a, b) \
82 { .name = a, .ctrl_dev_name = "pinctrl.0", .function = b }
83
84/*
85 * Convenience macro to map a system function onto the primary pinctrl device,
86 * to be hogged by the pinmux core until the system shuts down.
87 */
88#define PINMUX_MAP_PRIMARY_SYS_HOG(a, b) \
89 { .name = a, .ctrl_dev_name = "pinctrl.0", .function = b, \
90 .hog_on_boot = true }
91
92
93#ifdef CONFIG_PINMUX
94
95extern int pinmux_register_mappings(struct pinmux_map const *map,
96 unsigned num_maps);
97
98#else
99
100static inline int pinmux_register_mappings(struct pinmux_map const *map,
101 unsigned num_maps)
102{
103 return 0;
104}
105
106#endif /* !CONFIG_PINMUX */
107#endif
diff --git a/include/linux/pinctrl/pinctrl.h b/include/linux/pinctrl/pinctrl.h
new file mode 100644
index 000000000000..3605e947fa90
--- /dev/null
+++ b/include/linux/pinctrl/pinctrl.h
@@ -0,0 +1,133 @@
1/*
2 * Interface the pinctrl subsystem
3 *
4 * Copyright (C) 2011 ST-Ericsson SA
5 * Written on behalf of Linaro for ST-Ericsson
6 * This interface is used in the core to keep track of pins.
7 *
8 * Author: Linus Walleij <linus.walleij@linaro.org>
9 *
10 * License terms: GNU General Public License (GPL) version 2
11 */
12#ifndef __LINUX_PINCTRL_PINCTRL_H
13#define __LINUX_PINCTRL_PINCTRL_H
14
15#ifdef CONFIG_PINCTRL
16
17#include <linux/radix-tree.h>
18#include <linux/spinlock.h>
19#include <linux/list.h>
20#include <linux/seq_file.h>
21
22struct pinctrl_dev;
23struct pinmux_ops;
24struct gpio_chip;
25
26/**
27 * struct pinctrl_pin_desc - boards/machines provide information on their
28 * pins, pads or other muxable units in this struct
29 * @number: unique pin number from the global pin number space
30 * @name: a name for this pin
31 */
32struct pinctrl_pin_desc {
33 unsigned number;
34 const char *name;
35};
36
37/* Convenience macro to define a single named or anonymous pin descriptor */
38#define PINCTRL_PIN(a, b) { .number = a, .name = b }
39#define PINCTRL_PIN_ANON(a) { .number = a }
40
41/**
42 * struct pinctrl_gpio_range - each pin controller can provide subranges of
43 * the GPIO number space to be handled by the controller
44 * @node: list node for internal use
45 * @name: a name for the chip in this range
46 * @id: an ID number for the chip in this range
47 * @base: base offset of the GPIO range
48 * @npins: number of pins in the GPIO range, including the base number
49 * @gc: an optional pointer to a gpio_chip
50 */
51struct pinctrl_gpio_range {
52 struct list_head node;
53 const char *name;
54 unsigned int id;
55 unsigned int base;
56 unsigned int npins;
57 struct gpio_chip *gc;
58};
59
60/**
61 * struct pinctrl_ops - global pin control operations, to be implemented by
62 * pin controller drivers.
63 * @list_groups: list the number of selectable named groups available
64 * in this pinmux driver, the core will begin on 0 and call this
65 * repeatedly as long as it returns >= 0 to enumerate the groups
66 * @get_group_name: return the group name of the pin group
67 * @get_group_pins: return an array of pins corresponding to a certain
68 * group selector @pins, and the size of the array in @num_pins
69 * @pin_dbg_show: optional debugfs display hook that will provide per-device
70 * info for a certain pin in debugfs
71 */
72struct pinctrl_ops {
73 int (*list_groups) (struct pinctrl_dev *pctldev, unsigned selector);
74 const char *(*get_group_name) (struct pinctrl_dev *pctldev,
75 unsigned selector);
76 int (*get_group_pins) (struct pinctrl_dev *pctldev,
77 unsigned selector,
78 const unsigned **pins,
79 unsigned *num_pins);
80 void (*pin_dbg_show) (struct pinctrl_dev *pctldev, struct seq_file *s,
81 unsigned offset);
82};
83
84/**
85 * struct pinctrl_desc - pin controller descriptor, register this to pin
86 * control subsystem
87 * @name: name for the pin controller
88 * @pins: an array of pin descriptors describing all the pins handled by
89 * this pin controller
90 * @npins: number of descriptors in the array, usually just ARRAY_SIZE()
91 * of the pins field above
92 * @maxpin: since pin spaces may be sparse, there can he "holes" in the
93 * pin range, this attribute gives the maximum pin number in the
94 * total range. This should not be lower than npins for example,
95 * but may be equal to npins if you have no holes in the pin range.
96 * @pctlops: pin control operation vtable, to support global concepts like
97 * grouping of pins, this is optional.
98 * @pmxops: pinmux operation vtable, if you support pinmuxing in your driver
99 * @owner: module providing the pin controller, used for refcounting
100 */
101struct pinctrl_desc {
102 const char *name;
103 struct pinctrl_pin_desc const *pins;
104 unsigned int npins;
105 unsigned int maxpin;
106 struct pinctrl_ops *pctlops;
107 struct pinmux_ops *pmxops;
108 struct module *owner;
109};
110
111/* External interface to pin controller */
112extern struct pinctrl_dev *pinctrl_register(struct pinctrl_desc *pctldesc,
113 struct device *dev, void *driver_data);
114extern void pinctrl_unregister(struct pinctrl_dev *pctldev);
115extern bool pin_is_valid(struct pinctrl_dev *pctldev, int pin);
116extern void pinctrl_add_gpio_range(struct pinctrl_dev *pctldev,
117 struct pinctrl_gpio_range *range);
118extern void pinctrl_remove_gpio_range(struct pinctrl_dev *pctldev,
119 struct pinctrl_gpio_range *range);
120extern const char *pinctrl_dev_get_name(struct pinctrl_dev *pctldev);
121extern void *pinctrl_dev_get_drvdata(struct pinctrl_dev *pctldev);
122#else
123
124
125/* Sufficiently stupid default function when pinctrl is not in use */
126static inline bool pin_is_valid(struct pinctrl_dev *pctldev, int pin)
127{
128 return pin >= 0;
129}
130
131#endif /* !CONFIG_PINCTRL */
132
133#endif /* __LINUX_PINCTRL_PINCTRL_H */
diff --git a/include/linux/pinctrl/pinmux.h b/include/linux/pinctrl/pinmux.h
new file mode 100644
index 000000000000..3c430e797efc
--- /dev/null
+++ b/include/linux/pinctrl/pinmux.h
@@ -0,0 +1,117 @@
1/*
2 * Interface the pinmux subsystem
3 *
4 * Copyright (C) 2011 ST-Ericsson SA
5 * Written on behalf of Linaro for ST-Ericsson
6 * Based on bits of regulator core, gpio core and clk core
7 *
8 * Author: Linus Walleij <linus.walleij@linaro.org>
9 *
10 * License terms: GNU General Public License (GPL) version 2
11 */
12#ifndef __LINUX_PINCTRL_PINMUX_H
13#define __LINUX_PINCTRL_PINMUX_H
14
15#include <linux/list.h>
16#include <linux/seq_file.h>
17#include "pinctrl.h"
18
19/* This struct is private to the core and should be regarded as a cookie */
20struct pinmux;
21
22#ifdef CONFIG_PINMUX
23
24struct pinctrl_dev;
25
26/**
27 * struct pinmux_ops - pinmux operations, to be implemented by pin controller
28 * drivers that support pinmuxing
29 * @request: called by the core to see if a certain pin can be made available
30 * available for muxing. This is called by the core to acquire the pins
31 * before selecting any actual mux setting across a function. The driver
32 * is allowed to answer "no" by returning a negative error code
33 * @free: the reverse function of the request() callback, frees a pin after
34 * being requested
35 * @list_functions: list the number of selectable named functions available
36 * in this pinmux driver, the core will begin on 0 and call this
37 * repeatedly as long as it returns >= 0 to enumerate mux settings
38 * @get_function_name: return the function name of the muxing selector,
39 * called by the core to figure out which mux setting it shall map a
40 * certain device to
41 * @get_function_groups: return an array of groups names (in turn
42 * referencing pins) connected to a certain function selector. The group
43 * name can be used with the generic @pinctrl_ops to retrieve the
44 * actual pins affected. The applicable groups will be returned in
45 * @groups and the number of groups in @num_groups
46 * @enable: enable a certain muxing function with a certain pin group. The
47 * driver does not need to figure out whether enabling this function
48 * conflicts some other use of the pins in that group, such collisions
49 * are handled by the pinmux subsystem. The @func_selector selects a
50 * certain function whereas @group_selector selects a certain set of pins
51 * to be used. On simple controllers the latter argument may be ignored
52 * @disable: disable a certain muxing selector with a certain pin group
53 * @gpio_request_enable: requests and enables GPIO on a certain pin.
54 * Implement this only if you can mux every pin individually as GPIO. The
55 * affected GPIO range is passed along with an offset into that
56 * specific GPIO range - function selectors and pin groups are orthogonal
57 * to this, the core will however make sure the pins do not collide
58 */
59struct pinmux_ops {
60 int (*request) (struct pinctrl_dev *pctldev, unsigned offset);
61 int (*free) (struct pinctrl_dev *pctldev, unsigned offset);
62 int (*list_functions) (struct pinctrl_dev *pctldev, unsigned selector);
63 const char *(*get_function_name) (struct pinctrl_dev *pctldev,
64 unsigned selector);
65 int (*get_function_groups) (struct pinctrl_dev *pctldev,
66 unsigned selector,
67 const char * const **groups,
68 unsigned * const num_groups);
69 int (*enable) (struct pinctrl_dev *pctldev, unsigned func_selector,
70 unsigned group_selector);
71 void (*disable) (struct pinctrl_dev *pctldev, unsigned func_selector,
72 unsigned group_selector);
73 int (*gpio_request_enable) (struct pinctrl_dev *pctldev,
74 struct pinctrl_gpio_range *range,
75 unsigned offset);
76};
77
78/* External interface to pinmux */
79extern int pinmux_request_gpio(unsigned gpio);
80extern void pinmux_free_gpio(unsigned gpio);
81extern struct pinmux * __must_check pinmux_get(struct device *dev, const char *name);
82extern void pinmux_put(struct pinmux *pmx);
83extern int pinmux_enable(struct pinmux *pmx);
84extern void pinmux_disable(struct pinmux *pmx);
85
86#else /* !CONFIG_PINMUX */
87
88static inline int pinmux_request_gpio(unsigned gpio)
89{
90 return 0;
91}
92
93static inline void pinmux_free_gpio(unsigned gpio)
94{
95}
96
97static inline struct pinmux * __must_check pinmux_get(struct device *dev, const char *name)
98{
99 return NULL;
100}
101
102static inline void pinmux_put(struct pinmux *pmx)
103{
104}
105
106static inline int pinmux_enable(struct pinmux *pmx)
107{
108 return 0;
109}
110
111static inline void pinmux_disable(struct pinmux *pmx)
112{
113}
114
115#endif /* CONFIG_PINMUX */
116
117#endif /* __LINUX_PINCTRL_PINMUX_H */
diff --git a/include/linux/platform_data/dwc3-omap.h b/include/linux/platform_data/dwc3-omap.h
new file mode 100644
index 000000000000..ada401244e0b
--- /dev/null
+++ b/include/linux/platform_data/dwc3-omap.h
@@ -0,0 +1,47 @@
1/**
2 * dwc3-omap.h - OMAP Specific Glue layer, header.
3 *
4 * Copyright (C) 2010-2011 Texas Instruments Incorporated - http://www.ti.com
5 * All rights reserved.
6 *
7 * Author: Felipe Balbi <balbi@ti.com>
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 * without modification.
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. The names of the above-listed copyright holders may not be used
19 * to endorse or promote products derived from this software without
20 * specific prior written permission.
21 *
22 * ALTERNATIVELY, this software may be distributed under the terms of the
23 * GNU General Public License ("GPL") version 2, as published by the Free
24 * Software Foundation.
25 *
26 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
27 * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
28 * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
29 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
30 * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
31 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
32 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
33 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
34 * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
35 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
36 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
37 */
38
39enum dwc3_omap_utmi_mode {
40 DWC3_OMAP_UTMI_MODE_UNKNOWN = 0,
41 DWC3_OMAP_UTMI_MODE_HW,
42 DWC3_OMAP_UTMI_MODE_SW,
43};
44
45struct dwc3_omap_data {
46 enum dwc3_omap_utmi_mode utmi_mode;
47};
diff --git a/include/linux/platform_data/exynos4_tmu.h b/include/linux/platform_data/exynos4_tmu.h
new file mode 100644
index 000000000000..39e038cca590
--- /dev/null
+++ b/include/linux/platform_data/exynos4_tmu.h
@@ -0,0 +1,83 @@
1/*
2 * exynos4_tmu.h - Samsung EXYNOS4 TMU (Thermal Management Unit)
3 *
4 * Copyright (C) 2011 Samsung Electronics
5 * Donggeun Kim <dg77.kim@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
22#ifndef _LINUX_EXYNOS4_TMU_H
23#define _LINUX_EXYNOS4_TMU_H
24
25enum calibration_type {
26 TYPE_ONE_POINT_TRIMMING,
27 TYPE_TWO_POINT_TRIMMING,
28 TYPE_NONE,
29};
30
31/**
32 * struct exynos4_tmu_platform_data
33 * @threshold: basic temperature for generating interrupt
34 * 25 <= threshold <= 125 [unit: degree Celsius]
35 * @trigger_levels: array for each interrupt levels
36 * [unit: degree Celsius]
37 * 0: temperature for trigger_level0 interrupt
38 * condition for trigger_level0 interrupt:
39 * current temperature > threshold + trigger_levels[0]
40 * 1: temperature for trigger_level1 interrupt
41 * condition for trigger_level1 interrupt:
42 * current temperature > threshold + trigger_levels[1]
43 * 2: temperature for trigger_level2 interrupt
44 * condition for trigger_level2 interrupt:
45 * current temperature > threshold + trigger_levels[2]
46 * 3: temperature for trigger_level3 interrupt
47 * condition for trigger_level3 interrupt:
48 * current temperature > threshold + trigger_levels[3]
49 * @trigger_level0_en:
50 * 1 = enable trigger_level0 interrupt,
51 * 0 = disable trigger_level0 interrupt
52 * @trigger_level1_en:
53 * 1 = enable trigger_level1 interrupt,
54 * 0 = disable trigger_level1 interrupt
55 * @trigger_level2_en:
56 * 1 = enable trigger_level2 interrupt,
57 * 0 = disable trigger_level2 interrupt
58 * @trigger_level3_en:
59 * 1 = enable trigger_level3 interrupt,
60 * 0 = disable trigger_level3 interrupt
61 * @gain: gain of amplifier in the positive-TC generator block
62 * 0 <= gain <= 15
63 * @reference_voltage: reference voltage of amplifier
64 * in the positive-TC generator block
65 * 0 <= reference_voltage <= 31
66 * @cal_type: calibration type for temperature
67 *
68 * This structure is required for configuration of exynos4_tmu driver.
69 */
70struct exynos4_tmu_platform_data {
71 u8 threshold;
72 u8 trigger_levels[4];
73 bool trigger_level0_en;
74 bool trigger_level1_en;
75 bool trigger_level2_en;
76 bool trigger_level3_en;
77
78 u8 gain;
79 u8 reference_voltage;
80
81 enum calibration_type cal_type;
82};
83#endif /* _LINUX_EXYNOS4_TMU_H */
diff --git a/include/linux/platform_data/mv_usb.h b/include/linux/platform_data/mv_usb.h
new file mode 100644
index 000000000000..e9d9149ddf38
--- /dev/null
+++ b/include/linux/platform_data/mv_usb.h
@@ -0,0 +1,50 @@
1/*
2 * Copyright (C) 2011 Marvell International Ltd. All rights reserved.
3 *
4 * This program is free software; you can redistribute it and/or modify it
5 * under the terms of the GNU General Public License as published by the
6 * Free Software Foundation; either version 2 of the License, or (at your
7 * option) any later version.
8 */
9
10#ifndef __MV_PLATFORM_USB_H
11#define __MV_PLATFORM_USB_H
12
13enum pxa_ehci_type {
14 EHCI_UNDEFINED = 0,
15 PXA_U2OEHCI, /* pxa 168, 9xx */
16 PXA_SPH, /* pxa 168, 9xx SPH */
17 MMP3_HSIC, /* mmp3 hsic */
18 MMP3_FSIC, /* mmp3 fsic */
19};
20
21enum {
22 MV_USB_MODE_OTG,
23 MV_USB_MODE_HOST,
24};
25
26enum {
27 VBUS_LOW = 0,
28 VBUS_HIGH = 1 << 0,
29};
30
31struct mv_usb_addon_irq {
32 unsigned int irq;
33 int (*poll)(void);
34};
35
36struct mv_usb_platform_data {
37 unsigned int clknum;
38 char **clkname;
39 struct mv_usb_addon_irq *id; /* Only valid for OTG. ID pin change*/
40 struct mv_usb_addon_irq *vbus; /* valid for OTG/UDC. VBUS change*/
41
42 /* only valid for HCD. OTG or Host only*/
43 unsigned int mode;
44
45 int (*phy_init)(unsigned int regbase);
46 void (*phy_deinit)(unsigned int regbase);
47 int (*set_vbus)(unsigned int vbus);
48};
49
50#endif
diff --git a/include/linux/platform_data/ntc_thermistor.h b/include/linux/platform_data/ntc_thermistor.h
new file mode 100644
index 000000000000..88734e871e3a
--- /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_thermistor
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_device.h b/include/linux/platform_device.h
index 27bb05aae70d..651a066686ac 100644
--- a/include/linux/platform_device.h
+++ b/include/linux/platform_device.h
@@ -49,10 +49,54 @@ extern struct resource *platform_get_resource_byname(struct platform_device *, u
49extern int platform_get_irq_byname(struct platform_device *, const char *); 49extern int platform_get_irq_byname(struct platform_device *, const char *);
50extern int platform_add_devices(struct platform_device **, int); 50extern int platform_add_devices(struct platform_device **, int);
51 51
52extern struct platform_device *platform_device_register_resndata( 52struct platform_device_info {
53 struct device *parent;
54
55 const char *name;
56 int id;
57
58 const struct resource *res;
59 unsigned int num_res;
60
61 const void *data;
62 size_t size_data;
63 u64 dma_mask;
64};
65extern struct platform_device *platform_device_register_full(
66 struct platform_device_info *pdevinfo);
67
68/**
69 * platform_device_register_resndata - add a platform-level device with
70 * resources and platform-specific data
71 *
72 * @parent: parent device for the device we're adding
73 * @name: base name of the device we're adding
74 * @id: instance id
75 * @res: set of resources that needs to be allocated for the device
76 * @num: number of resources
77 * @data: platform specific data for this platform device
78 * @size: size of platform specific data
79 *
80 * Returns &struct platform_device pointer on success, or ERR_PTR() on error.
81 */
82static inline struct platform_device *platform_device_register_resndata(
53 struct device *parent, const char *name, int id, 83 struct device *parent, const char *name, int id,
54 const struct resource *res, unsigned int num, 84 const struct resource *res, unsigned int num,
55 const void *data, size_t size); 85 const void *data, size_t size) {
86
87 struct platform_device_info pdevinfo = {
88 .parent = parent,
89 .name = name,
90 .id = id,
91 .res = res,
92 .num_res = num,
93 .data = data,
94 .size_data = size,
95 .dma_mask = 0,
96 };
97
98 return platform_device_register_full(&pdevinfo);
99}
56 100
57/** 101/**
58 * platform_device_register_simple - add a platform-level device and its resources 102 * platform_device_register_simple - add a platform-level device and its resources
diff --git a/include/linux/pm.h b/include/linux/pm.h
index f7c84c9abd30..f15acb646813 100644
--- a/include/linux/pm.h
+++ b/include/linux/pm.h
@@ -326,6 +326,7 @@ extern struct dev_pm_ops generic_subsys_pm_ops;
326 * requested by a driver. 326 * requested by a driver.
327 */ 327 */
328 328
329#define PM_EVENT_INVALID (-1)
329#define PM_EVENT_ON 0x0000 330#define PM_EVENT_ON 0x0000
330#define PM_EVENT_FREEZE 0x0001 331#define PM_EVENT_FREEZE 0x0001
331#define PM_EVENT_SUSPEND 0x0002 332#define PM_EVENT_SUSPEND 0x0002
@@ -346,6 +347,7 @@ extern struct dev_pm_ops generic_subsys_pm_ops;
346#define PM_EVENT_AUTO_SUSPEND (PM_EVENT_AUTO | PM_EVENT_SUSPEND) 347#define PM_EVENT_AUTO_SUSPEND (PM_EVENT_AUTO | PM_EVENT_SUSPEND)
347#define PM_EVENT_AUTO_RESUME (PM_EVENT_AUTO | PM_EVENT_RESUME) 348#define PM_EVENT_AUTO_RESUME (PM_EVENT_AUTO | PM_EVENT_RESUME)
348 349
350#define PMSG_INVALID ((struct pm_message){ .event = PM_EVENT_INVALID, })
349#define PMSG_ON ((struct pm_message){ .event = PM_EVENT_ON, }) 351#define PMSG_ON ((struct pm_message){ .event = PM_EVENT_ON, })
350#define PMSG_FREEZE ((struct pm_message){ .event = PM_EVENT_FREEZE, }) 352#define PMSG_FREEZE ((struct pm_message){ .event = PM_EVENT_FREEZE, })
351#define PMSG_QUIESCE ((struct pm_message){ .event = PM_EVENT_QUIESCE, }) 353#define PMSG_QUIESCE ((struct pm_message){ .event = PM_EVENT_QUIESCE, })
@@ -366,6 +368,8 @@ extern struct dev_pm_ops generic_subsys_pm_ops;
366#define PMSG_AUTO_RESUME ((struct pm_message) \ 368#define PMSG_AUTO_RESUME ((struct pm_message) \
367 { .event = PM_EVENT_AUTO_RESUME, }) 369 { .event = PM_EVENT_AUTO_RESUME, })
368 370
371#define PMSG_IS_AUTO(msg) (((msg).event & PM_EVENT_AUTO) != 0)
372
369/** 373/**
370 * Device run-time power management status. 374 * Device run-time power management status.
371 * 375 *
@@ -421,6 +425,22 @@ enum rpm_request {
421 425
422struct wakeup_source; 426struct wakeup_source;
423 427
428struct pm_domain_data {
429 struct list_head list_node;
430 struct device *dev;
431};
432
433struct pm_subsys_data {
434 spinlock_t lock;
435 unsigned int refcount;
436#ifdef CONFIG_PM_CLK
437 struct list_head clock_list;
438#endif
439#ifdef CONFIG_PM_GENERIC_DOMAINS
440 struct pm_domain_data *domain_data;
441#endif
442};
443
424struct dev_pm_info { 444struct dev_pm_info {
425 pm_message_t power_state; 445 pm_message_t power_state;
426 unsigned int can_wakeup:1; 446 unsigned int can_wakeup:1;
@@ -432,6 +452,7 @@ struct dev_pm_info {
432 struct list_head entry; 452 struct list_head entry;
433 struct completion completion; 453 struct completion completion;
434 struct wakeup_source *wakeup; 454 struct wakeup_source *wakeup;
455 bool wakeup_path:1;
435#else 456#else
436 unsigned int should_wakeup:1; 457 unsigned int should_wakeup:1;
437#endif 458#endif
@@ -462,10 +483,13 @@ struct dev_pm_info {
462 unsigned long suspended_jiffies; 483 unsigned long suspended_jiffies;
463 unsigned long accounting_timestamp; 484 unsigned long accounting_timestamp;
464#endif 485#endif
465 void *subsys_data; /* Owned by the subsystem. */ 486 struct pm_subsys_data *subsys_data; /* Owned by the subsystem. */
487 struct pm_qos_constraints *constraints;
466}; 488};
467 489
468extern void update_pm_runtime_accounting(struct device *dev); 490extern void update_pm_runtime_accounting(struct device *dev);
491extern int dev_pm_get_subsys_data(struct device *dev);
492extern int dev_pm_put_subsys_data(struct device *dev);
469 493
470/* 494/*
471 * Power domains provide callbacks that are executed during system suspend, 495 * Power domains provide callbacks that are executed during system suspend,
diff --git a/include/linux/pm_clock.h b/include/linux/pm_clock.h
new file mode 100644
index 000000000000..8348866e7b05
--- /dev/null
+++ b/include/linux/pm_clock.h
@@ -0,0 +1,71 @@
1/*
2 * pm_clock.h - Definitions and headers related to device clocks.
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_CLOCK_H
10#define _LINUX_PM_CLOCK_H
11
12#include <linux/device.h>
13#include <linux/notifier.h>
14
15struct pm_clk_notifier_block {
16 struct notifier_block nb;
17 struct dev_pm_domain *pm_domain;
18 char *con_ids[];
19};
20
21#ifdef CONFIG_PM_CLK
22static inline bool pm_clk_no_clocks(struct device *dev)
23{
24 return dev && dev->power.subsys_data
25 && list_empty(&dev->power.subsys_data->clock_list);
26}
27
28extern void pm_clk_init(struct device *dev);
29extern int pm_clk_create(struct device *dev);
30extern void pm_clk_destroy(struct device *dev);
31extern int pm_clk_add(struct device *dev, const char *con_id);
32extern void pm_clk_remove(struct device *dev, const char *con_id);
33extern int pm_clk_suspend(struct device *dev);
34extern int pm_clk_resume(struct device *dev);
35#else
36static inline bool pm_clk_no_clocks(struct device *dev)
37{
38 return true;
39}
40static inline void pm_clk_init(struct device *dev)
41{
42}
43static inline int pm_clk_create(struct device *dev)
44{
45 return -EINVAL;
46}
47static inline void pm_clk_destroy(struct device *dev)
48{
49}
50static inline int pm_clk_add(struct device *dev, const char *con_id)
51{
52 return -EINVAL;
53}
54static inline void pm_clk_remove(struct device *dev, const char *con_id)
55{
56}
57#define pm_clk_suspend NULL
58#define pm_clk_resume NULL
59#endif
60
61#ifdef CONFIG_HAVE_CLK
62extern void pm_clk_add_notifier(struct bus_type *bus,
63 struct pm_clk_notifier_block *clknb);
64#else
65static inline void pm_clk_add_notifier(struct bus_type *bus,
66 struct pm_clk_notifier_block *clknb)
67{
68}
69#endif
70
71#endif
diff --git a/include/linux/pm_domain.h b/include/linux/pm_domain.h
index 21097cb086fe..65633e5a2bc0 100644
--- a/include/linux/pm_domain.h
+++ b/include/linux/pm_domain.h
@@ -13,6 +13,7 @@
13 13
14enum gpd_status { 14enum gpd_status {
15 GPD_STATE_ACTIVE = 0, /* PM domain is active */ 15 GPD_STATE_ACTIVE = 0, /* PM domain is active */
16 GPD_STATE_WAIT_MASTER, /* PM domain's master is being waited for */
16 GPD_STATE_BUSY, /* Something is happening to the PM domain */ 17 GPD_STATE_BUSY, /* Something is happening to the PM domain */
17 GPD_STATE_REPEAT, /* Power off in progress, to be repeated */ 18 GPD_STATE_REPEAT, /* Power off in progress, to be repeated */
18 GPD_STATE_POWER_OFF, /* PM domain is off */ 19 GPD_STATE_POWER_OFF, /* PM domain is off */
@@ -25,15 +26,14 @@ struct dev_power_governor {
25struct generic_pm_domain { 26struct generic_pm_domain {
26 struct dev_pm_domain domain; /* PM domain operations */ 27 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 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 list_head master_links; /* Links with PM domain as a master */
29 struct generic_pm_domain *parent; /* Parent PM domain */ 30 struct list_head slave_links; /* Links with PM domain as a slave */
30 struct list_head sd_list; /* List of dubdomains */
31 struct list_head dev_list; /* List of devices */ 31 struct list_head dev_list; /* List of devices */
32 struct mutex lock; 32 struct mutex lock;
33 struct dev_power_governor *gov; 33 struct dev_power_governor *gov;
34 struct work_struct power_off_work; 34 struct work_struct power_off_work;
35 unsigned int in_progress; /* Number of devices being suspended now */ 35 unsigned int in_progress; /* Number of devices being suspended now */
36 unsigned int sd_count; /* Number of subdomains with power "on" */ 36 atomic_t sd_count; /* Number of subdomains with power "on" */
37 enum gpd_status status; /* Current state of the domain */ 37 enum gpd_status status; /* Current state of the domain */
38 wait_queue_head_t status_wait_queue; 38 wait_queue_head_t status_wait_queue;
39 struct task_struct *poweroff_task; /* Powering off task */ 39 struct task_struct *poweroff_task; /* Powering off task */
@@ -42,6 +42,7 @@ struct generic_pm_domain {
42 unsigned int suspended_count; /* System suspend device counter */ 42 unsigned int suspended_count; /* System suspend device counter */
43 unsigned int prepared_count; /* Suspend counter of prepared devices */ 43 unsigned int prepared_count; /* Suspend counter of prepared devices */
44 bool suspend_power_off; /* Power status before system suspend */ 44 bool suspend_power_off; /* Power status before system suspend */
45 bool dev_irq_safe; /* Device callbacks are IRQ-safe */
45 int (*power_off)(struct generic_pm_domain *domain); 46 int (*power_off)(struct generic_pm_domain *domain);
46 int (*power_on)(struct generic_pm_domain *domain); 47 int (*power_on)(struct generic_pm_domain *domain);
47 int (*start_device)(struct device *dev); 48 int (*start_device)(struct device *dev);
@@ -54,12 +55,23 @@ static inline struct generic_pm_domain *pd_to_genpd(struct dev_pm_domain *pd)
54 return container_of(pd, struct generic_pm_domain, domain); 55 return container_of(pd, struct generic_pm_domain, domain);
55} 56}
56 57
57struct dev_list_entry { 58struct gpd_link {
58 struct list_head node; 59 struct generic_pm_domain *master;
59 struct device *dev; 60 struct list_head master_node;
61 struct generic_pm_domain *slave;
62 struct list_head slave_node;
63};
64
65struct generic_pm_domain_data {
66 struct pm_domain_data base;
60 bool need_restore; 67 bool need_restore;
61}; 68};
62 69
70static inline struct generic_pm_domain_data *to_gpd_data(struct pm_domain_data *pdd)
71{
72 return container_of(pdd, struct generic_pm_domain_data, base);
73}
74
63#ifdef CONFIG_PM_GENERIC_DOMAINS 75#ifdef CONFIG_PM_GENERIC_DOMAINS
64extern int pm_genpd_add_device(struct generic_pm_domain *genpd, 76extern int pm_genpd_add_device(struct generic_pm_domain *genpd,
65 struct device *dev); 77 struct device *dev);
@@ -72,8 +84,6 @@ extern int pm_genpd_remove_subdomain(struct generic_pm_domain *genpd,
72extern void pm_genpd_init(struct generic_pm_domain *genpd, 84extern void pm_genpd_init(struct generic_pm_domain *genpd,
73 struct dev_power_governor *gov, bool is_off); 85 struct dev_power_governor *gov, bool is_off);
74extern int pm_genpd_poweron(struct generic_pm_domain *genpd); 86extern 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 87#else
78static inline int pm_genpd_add_device(struct generic_pm_domain *genpd, 88static inline int pm_genpd_add_device(struct generic_pm_domain *genpd,
79 struct device *dev) 89 struct device *dev)
@@ -101,8 +111,14 @@ static inline int pm_genpd_poweron(struct generic_pm_domain *genpd)
101{ 111{
102 return -ENOSYS; 112 return -ENOSYS;
103} 113}
104static inline void pm_genpd_poweroff_unused(void) {} 114#endif
115
116#ifdef CONFIG_PM_GENERIC_DOMAINS_RUNTIME
117extern void genpd_queue_power_off_work(struct generic_pm_domain *genpd);
118extern void pm_genpd_poweroff_unused(void);
119#else
105static inline void genpd_queue_power_off_work(struct generic_pm_domain *gpd) {} 120static inline void genpd_queue_power_off_work(struct generic_pm_domain *gpd) {}
121static inline void pm_genpd_poweroff_unused(void) {}
106#endif 122#endif
107 123
108#endif /* _LINUX_PM_DOMAIN_H */ 124#endif /* _LINUX_PM_DOMAIN_H */
diff --git a/include/linux/pm_qos.h b/include/linux/pm_qos.h
new file mode 100644
index 000000000000..83b0ea302a80
--- /dev/null
+++ b/include/linux/pm_qos.h
@@ -0,0 +1,155 @@
1#ifndef _LINUX_PM_QOS_H
2#define _LINUX_PM_QOS_H
3/* interface for the pm_qos_power infrastructure of the linux kernel.
4 *
5 * Mark Gross <mgross@linux.intel.com>
6 */
7#include <linux/plist.h>
8#include <linux/notifier.h>
9#include <linux/miscdevice.h>
10#include <linux/device.h>
11
12#define PM_QOS_RESERVED 0
13#define PM_QOS_CPU_DMA_LATENCY 1
14#define PM_QOS_NETWORK_LATENCY 2
15#define PM_QOS_NETWORK_THROUGHPUT 3
16
17#define PM_QOS_NUM_CLASSES 4
18#define PM_QOS_DEFAULT_VALUE -1
19
20#define PM_QOS_CPU_DMA_LAT_DEFAULT_VALUE (2000 * USEC_PER_SEC)
21#define PM_QOS_NETWORK_LAT_DEFAULT_VALUE (2000 * USEC_PER_SEC)
22#define PM_QOS_NETWORK_THROUGHPUT_DEFAULT_VALUE 0
23#define PM_QOS_DEV_LAT_DEFAULT_VALUE 0
24
25struct pm_qos_request {
26 struct plist_node node;
27 int pm_qos_class;
28};
29
30struct dev_pm_qos_request {
31 struct plist_node node;
32 struct device *dev;
33};
34
35enum pm_qos_type {
36 PM_QOS_UNITIALIZED,
37 PM_QOS_MAX, /* return the largest value */
38 PM_QOS_MIN /* return the smallest value */
39};
40
41/*
42 * Note: The lockless read path depends on the CPU accessing
43 * target_value atomically. Atomic access is only guaranteed on all CPU
44 * types linux supports for 32 bit quantites
45 */
46struct pm_qos_constraints {
47 struct plist_head list;
48 s32 target_value; /* Do not change to 64 bit */
49 s32 default_value;
50 enum pm_qos_type type;
51 struct blocking_notifier_head *notifiers;
52};
53
54/* Action requested to pm_qos_update_target */
55enum pm_qos_req_action {
56 PM_QOS_ADD_REQ, /* Add a new request */
57 PM_QOS_UPDATE_REQ, /* Update an existing request */
58 PM_QOS_REMOVE_REQ /* Remove an existing request */
59};
60
61static inline int dev_pm_qos_request_active(struct dev_pm_qos_request *req)
62{
63 return req->dev != 0;
64}
65
66#ifdef CONFIG_PM
67int pm_qos_update_target(struct pm_qos_constraints *c, struct plist_node *node,
68 enum pm_qos_req_action action, int value);
69void pm_qos_add_request(struct pm_qos_request *req, int pm_qos_class,
70 s32 value);
71void pm_qos_update_request(struct pm_qos_request *req,
72 s32 new_value);
73void pm_qos_remove_request(struct pm_qos_request *req);
74
75int pm_qos_request(int pm_qos_class);
76int pm_qos_add_notifier(int pm_qos_class, struct notifier_block *notifier);
77int pm_qos_remove_notifier(int pm_qos_class, struct notifier_block *notifier);
78int pm_qos_request_active(struct pm_qos_request *req);
79s32 pm_qos_read_value(struct pm_qos_constraints *c);
80
81s32 dev_pm_qos_read_value(struct device *dev);
82int dev_pm_qos_add_request(struct device *dev, struct dev_pm_qos_request *req,
83 s32 value);
84int dev_pm_qos_update_request(struct dev_pm_qos_request *req, s32 new_value);
85int dev_pm_qos_remove_request(struct dev_pm_qos_request *req);
86int dev_pm_qos_add_notifier(struct device *dev,
87 struct notifier_block *notifier);
88int dev_pm_qos_remove_notifier(struct device *dev,
89 struct notifier_block *notifier);
90int dev_pm_qos_add_global_notifier(struct notifier_block *notifier);
91int dev_pm_qos_remove_global_notifier(struct notifier_block *notifier);
92void dev_pm_qos_constraints_init(struct device *dev);
93void dev_pm_qos_constraints_destroy(struct device *dev);
94#else
95static inline int pm_qos_update_target(struct pm_qos_constraints *c,
96 struct plist_node *node,
97 enum pm_qos_req_action action,
98 int value)
99 { return 0; }
100static inline void pm_qos_add_request(struct pm_qos_request *req,
101 int pm_qos_class, s32 value)
102 { return; }
103static inline void pm_qos_update_request(struct pm_qos_request *req,
104 s32 new_value)
105 { return; }
106static inline void pm_qos_remove_request(struct pm_qos_request *req)
107 { return; }
108
109static inline int pm_qos_request(int pm_qos_class)
110 { return 0; }
111static inline int pm_qos_add_notifier(int pm_qos_class,
112 struct notifier_block *notifier)
113 { return 0; }
114static inline int pm_qos_remove_notifier(int pm_qos_class,
115 struct notifier_block *notifier)
116 { return 0; }
117static inline int pm_qos_request_active(struct pm_qos_request *req)
118 { return 0; }
119static inline s32 pm_qos_read_value(struct pm_qos_constraints *c)
120 { return 0; }
121
122static inline s32 dev_pm_qos_read_value(struct device *dev)
123 { return 0; }
124static inline int dev_pm_qos_add_request(struct device *dev,
125 struct dev_pm_qos_request *req,
126 s32 value)
127 { return 0; }
128static inline int dev_pm_qos_update_request(struct dev_pm_qos_request *req,
129 s32 new_value)
130 { return 0; }
131static inline int dev_pm_qos_remove_request(struct dev_pm_qos_request *req)
132 { return 0; }
133static inline int dev_pm_qos_add_notifier(struct device *dev,
134 struct notifier_block *notifier)
135 { return 0; }
136static inline int dev_pm_qos_remove_notifier(struct device *dev,
137 struct notifier_block *notifier)
138 { return 0; }
139static inline int dev_pm_qos_add_global_notifier(
140 struct notifier_block *notifier)
141 { return 0; }
142static inline int dev_pm_qos_remove_global_notifier(
143 struct notifier_block *notifier)
144 { return 0; }
145static inline void dev_pm_qos_constraints_init(struct device *dev)
146{
147 dev->power.power_state = PMSG_ON;
148}
149static inline void dev_pm_qos_constraints_destroy(struct device *dev)
150{
151 dev->power.power_state = PMSG_INVALID;
152}
153#endif
154
155#endif
diff --git a/include/linux/pm_qos_params.h b/include/linux/pm_qos_params.h
deleted file mode 100644
index a7d87f911cab..000000000000
--- a/include/linux/pm_qos_params.h
+++ /dev/null
@@ -1,38 +0,0 @@
1#ifndef _LINUX_PM_QOS_PARAMS_H
2#define _LINUX_PM_QOS_PARAMS_H
3/* interface for the pm_qos_power infrastructure of the linux kernel.
4 *
5 * Mark Gross <mgross@linux.intel.com>
6 */
7#include <linux/plist.h>
8#include <linux/notifier.h>
9#include <linux/miscdevice.h>
10
11#define PM_QOS_RESERVED 0
12#define PM_QOS_CPU_DMA_LATENCY 1
13#define PM_QOS_NETWORK_LATENCY 2
14#define PM_QOS_NETWORK_THROUGHPUT 3
15
16#define PM_QOS_NUM_CLASSES 4
17#define PM_QOS_DEFAULT_VALUE -1
18
19#define PM_QOS_CPU_DMA_LAT_DEFAULT_VALUE (2000 * USEC_PER_SEC)
20#define PM_QOS_NETWORK_LAT_DEFAULT_VALUE (2000 * USEC_PER_SEC)
21#define PM_QOS_NETWORK_THROUGHPUT_DEFAULT_VALUE 0
22
23struct pm_qos_request_list {
24 struct plist_node list;
25 int pm_qos_class;
26};
27
28void pm_qos_add_request(struct pm_qos_request_list *l, int pm_qos_class, s32 value);
29void pm_qos_update_request(struct pm_qos_request_list *pm_qos_req,
30 s32 new_value);
31void pm_qos_remove_request(struct pm_qos_request_list *pm_qos_req);
32
33int pm_qos_request(int pm_qos_class);
34int pm_qos_add_notifier(int pm_qos_class, struct notifier_block *notifier);
35int pm_qos_remove_notifier(int pm_qos_class, struct notifier_block *notifier);
36int pm_qos_request_active(struct pm_qos_request_list *req);
37
38#endif
diff --git a/include/linux/pm_runtime.h b/include/linux/pm_runtime.h
index daac05d751b2..70b284024d9e 100644
--- a/include/linux/pm_runtime.h
+++ b/include/linux/pm_runtime.h
@@ -251,46 +251,4 @@ static inline void pm_runtime_dont_use_autosuspend(struct device *dev)
251 __pm_runtime_use_autosuspend(dev, false); 251 __pm_runtime_use_autosuspend(dev, false);
252} 252}
253 253
254struct pm_clk_notifier_block {
255 struct notifier_block nb;
256 struct dev_pm_domain *pm_domain;
257 char *con_ids[];
258};
259
260#ifdef CONFIG_PM_CLK
261extern int pm_clk_init(struct device *dev);
262extern void pm_clk_destroy(struct device *dev);
263extern int pm_clk_add(struct device *dev, const char *con_id);
264extern void pm_clk_remove(struct device *dev, const char *con_id);
265extern int pm_clk_suspend(struct device *dev);
266extern int pm_clk_resume(struct device *dev);
267#else
268static inline int pm_clk_init(struct device *dev)
269{
270 return -EINVAL;
271}
272static inline void pm_clk_destroy(struct device *dev)
273{
274}
275static inline int pm_clk_add(struct device *dev, const char *con_id)
276{
277 return -EINVAL;
278}
279static inline void pm_clk_remove(struct device *dev, const char *con_id)
280{
281}
282#define pm_clk_suspend NULL
283#define pm_clk_resume NULL
284#endif
285
286#ifdef CONFIG_HAVE_CLK
287extern void pm_clk_add_notifier(struct bus_type *bus,
288 struct pm_clk_notifier_block *clknb);
289#else
290static inline void pm_clk_add_notifier(struct bus_type *bus,
291 struct pm_clk_notifier_block *clknb)
292{
293}
294#endif
295
296#endif 254#endif
diff --git a/include/linux/posix-timers.h b/include/linux/posix-timers.h
index 959c14132f46..042058fdb0af 100644
--- a/include/linux/posix-timers.h
+++ b/include/linux/posix-timers.h
@@ -81,7 +81,10 @@ struct k_itimer {
81 unsigned long incr; 81 unsigned long incr;
82 unsigned long expires; 82 unsigned long expires;
83 } mmtimer; 83 } mmtimer;
84 struct alarm alarmtimer; 84 struct {
85 struct alarm alarmtimer;
86 ktime_t interval;
87 } alarm;
85 struct rcu_head rcu; 88 struct rcu_head rcu;
86 } it; 89 } it;
87}; 90};
diff --git a/include/linux/posix_acl.h b/include/linux/posix_acl.h
index 9a53b99818e2..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
@@ -75,29 +79,31 @@ extern 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 int posix_acl_valid(const struct posix_acl *); 80extern int posix_acl_valid(const struct posix_acl *);
77extern int posix_acl_permission(struct inode *, const struct posix_acl *, int); 81extern int posix_acl_permission(struct inode *, const struct posix_acl *, int);
78extern struct posix_acl *posix_acl_from_mode(mode_t, gfp_t); 82extern struct posix_acl *posix_acl_from_mode(umode_t, gfp_t);
79extern int posix_acl_equiv_mode(const struct posix_acl *, mode_t *); 83extern int posix_acl_equiv_mode(const struct posix_acl *, umode_t *);
80extern int posix_acl_create(struct posix_acl **, gfp_t, mode_t *); 84extern int posix_acl_create(struct posix_acl **, gfp_t, umode_t *);
81extern int posix_acl_chmod(struct posix_acl **, gfp_t, mode_t); 85extern int posix_acl_chmod(struct posix_acl **, gfp_t, umode_t);
82 86
83extern struct posix_acl *get_posix_acl(struct inode *, int); 87extern struct posix_acl *get_posix_acl(struct inode *, int);
84extern int set_posix_acl(struct inode *, int, struct posix_acl *); 88extern int set_posix_acl(struct inode *, int, struct posix_acl *);
85 89
86#ifdef CONFIG_FS_POSIX_ACL 90#ifdef CONFIG_FS_POSIX_ACL
87static 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)
88{ 92{
89 struct posix_acl **p, *acl;
90 switch (type) { 93 switch (type) {
91 case ACL_TYPE_ACCESS: 94 case ACL_TYPE_ACCESS:
92 p = &inode->i_acl; 95 return &inode->i_acl;
93 break;
94 case ACL_TYPE_DEFAULT: 96 case ACL_TYPE_DEFAULT:
95 p = &inode->i_default_acl; 97 return &inode->i_default_acl;
96 break;
97 default: 98 default:
98 return ERR_PTR(-EINVAL); 99 BUG();
99 } 100 }
100 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);
101 if (acl) { 107 if (acl) {
102 spin_lock(&inode->i_lock); 108 spin_lock(&inode->i_lock);
103 acl = *p; 109 acl = *p;
@@ -108,41 +114,20 @@ static inline struct posix_acl *get_cached_acl(struct inode *inode, int type)
108 return acl; 114 return acl;
109} 115}
110 116
111static inline int negative_cached_acl(struct inode *inode, int type) 117static inline struct posix_acl *get_cached_acl_rcu(struct inode *inode, int type)
112{ 118{
113 struct posix_acl **p, *acl; 119 return rcu_dereference(*acl_by_type(inode, type));
114 switch (type) {
115 case ACL_TYPE_ACCESS:
116 p = &inode->i_acl;
117 break;
118 case ACL_TYPE_DEFAULT:
119 p = &inode->i_default_acl;
120 break;
121 default:
122 BUG();
123 }
124 acl = ACCESS_ONCE(*p);
125 if (acl)
126 return 0;
127 return 1;
128} 120}
129 121
130static inline void set_cached_acl(struct inode *inode, 122static inline void set_cached_acl(struct inode *inode,
131 int type, 123 int type,
132 struct posix_acl *acl) 124 struct posix_acl *acl)
133{ 125{
134 struct posix_acl *old = NULL; 126 struct posix_acl **p = acl_by_type(inode, type);
127 struct posix_acl *old;
135 spin_lock(&inode->i_lock); 128 spin_lock(&inode->i_lock);
136 switch (type) { 129 old = *p;
137 case ACL_TYPE_ACCESS: 130 rcu_assign_pointer(*p, posix_acl_dup(acl));
138 old = inode->i_acl;
139 inode->i_acl = posix_acl_dup(acl);
140 break;
141 case ACL_TYPE_DEFAULT:
142 old = inode->i_default_acl;
143 inode->i_default_acl = posix_acl_dup(acl);
144 break;
145 }
146 spin_unlock(&inode->i_lock); 131 spin_unlock(&inode->i_lock);
147 if (old != ACL_NOT_CACHED) 132 if (old != ACL_NOT_CACHED)
148 posix_acl_release(old); 133 posix_acl_release(old);
@@ -150,18 +135,11 @@ static inline void set_cached_acl(struct inode *inode,
150 135
151static inline void forget_cached_acl(struct inode *inode, int type) 136static inline void forget_cached_acl(struct inode *inode, int type)
152{ 137{
153 struct posix_acl *old = NULL; 138 struct posix_acl **p = acl_by_type(inode, type);
139 struct posix_acl *old;
154 spin_lock(&inode->i_lock); 140 spin_lock(&inode->i_lock);
155 switch (type) { 141 old = *p;
156 case ACL_TYPE_ACCESS: 142 *p = ACL_NOT_CACHED;
157 old = inode->i_acl;
158 inode->i_acl = ACL_NOT_CACHED;
159 break;
160 case ACL_TYPE_DEFAULT:
161 old = inode->i_default_acl;
162 inode->i_default_acl = ACL_NOT_CACHED;
163 break;
164 }
165 spin_unlock(&inode->i_lock); 143 spin_unlock(&inode->i_lock);
166 if (old != ACL_NOT_CACHED) 144 if (old != ACL_NOT_CACHED)
167 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/proportions.h b/include/linux/proportions.h
index cf793bbbd05e..ef35bb73f69b 100644
--- a/include/linux/proportions.h
+++ b/include/linux/proportions.h
@@ -58,7 +58,7 @@ struct prop_local_percpu {
58 */ 58 */
59 int shift; 59 int shift;
60 unsigned long period; 60 unsigned long period;
61 spinlock_t lock; /* protect the snapshot state */ 61 raw_spinlock_t lock; /* protect the snapshot state */
62}; 62};
63 63
64int prop_local_init_percpu(struct prop_local_percpu *pl); 64int prop_local_init_percpu(struct prop_local_percpu *pl);
@@ -106,11 +106,11 @@ struct prop_local_single {
106 */ 106 */
107 unsigned long period; 107 unsigned long period;
108 int shift; 108 int shift;
109 spinlock_t lock; /* protect the snapshot state */ 109 raw_spinlock_t lock; /* protect the snapshot state */
110}; 110};
111 111
112#define INIT_PROP_LOCAL_SINGLE(name) \ 112#define INIT_PROP_LOCAL_SINGLE(name) \
113{ .lock = __SPIN_LOCK_UNLOCKED(name.lock), \ 113{ .lock = __RAW_SPIN_LOCK_UNLOCKED(name.lock), \
114} 114}
115 115
116int prop_local_init_single(struct prop_local_single *pl); 116int prop_local_init_single(struct prop_local_single *pl);
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/ptp_classify.h b/include/linux/ptp_classify.h
index e07e2742a865..1dc420ba213a 100644
--- a/include/linux/ptp_classify.h
+++ b/include/linux/ptp_classify.h
@@ -51,6 +51,7 @@
51#define PTP_CLASS_V2_VLAN (PTP_CLASS_V2 | PTP_CLASS_VLAN) 51#define PTP_CLASS_V2_VLAN (PTP_CLASS_V2 | PTP_CLASS_VLAN)
52 52
53#define PTP_EV_PORT 319 53#define PTP_EV_PORT 319
54#define PTP_GEN_BIT 0x08 /* indicates general message, if set in message type */
54 55
55#define OFF_ETYPE 12 56#define OFF_ETYPE 12
56#define OFF_IHL 14 57#define OFF_IHL 14
@@ -116,14 +117,20 @@ static inline int ptp_filter_init(struct sock_filter *f, int len)
116 {OP_OR, 0, 0, PTP_CLASS_IPV6 }, /* */ \ 117 {OP_OR, 0, 0, PTP_CLASS_IPV6 }, /* */ \
117 {OP_RETA, 0, 0, 0 }, /* */ \ 118 {OP_RETA, 0, 0, 0 }, /* */ \
118/*L3x*/ {OP_RETK, 0, 0, PTP_CLASS_NONE }, /* */ \ 119/*L3x*/ {OP_RETK, 0, 0, PTP_CLASS_NONE }, /* */ \
119/*L40*/ {OP_JEQ, 0, 6, ETH_P_8021Q }, /* f goto L50 */ \ 120/*L40*/ {OP_JEQ, 0, 9, ETH_P_8021Q }, /* f goto L50 */ \
120 {OP_LDH, 0, 0, OFF_ETYPE + 4 }, /* */ \ 121 {OP_LDH, 0, 0, OFF_ETYPE + 4 }, /* */ \
121 {OP_JEQ, 0, 9, ETH_P_1588 }, /* f goto L60 */ \ 122 {OP_JEQ, 0, 15, ETH_P_1588 }, /* f goto L60 */ \
123 {OP_LDB, 0, 0, ETH_HLEN + VLAN_HLEN }, /* */ \
124 {OP_AND, 0, 0, PTP_GEN_BIT }, /* */ \
125 {OP_JEQ, 0, 12, 0 }, /* f goto L6x */ \
122 {OP_LDH, 0, 0, ETH_HLEN + VLAN_HLEN }, /* */ \ 126 {OP_LDH, 0, 0, ETH_HLEN + VLAN_HLEN }, /* */ \
123 {OP_AND, 0, 0, PTP_CLASS_VMASK }, /* */ \ 127 {OP_AND, 0, 0, PTP_CLASS_VMASK }, /* */ \
124 {OP_OR, 0, 0, PTP_CLASS_VLAN }, /* */ \ 128 {OP_OR, 0, 0, PTP_CLASS_VLAN }, /* */ \
125 {OP_RETA, 0, 0, 0 }, /* */ \ 129 {OP_RETA, 0, 0, 0 }, /* */ \
126/*L50*/ {OP_JEQ, 0, 4, ETH_P_1588 }, /* f goto L61 */ \ 130/*L50*/ {OP_JEQ, 0, 7, ETH_P_1588 }, /* f goto L61 */ \
131 {OP_LDB, 0, 0, ETH_HLEN }, /* */ \
132 {OP_AND, 0, 0, PTP_GEN_BIT }, /* */ \
133 {OP_JEQ, 0, 4, 0 }, /* f goto L6x */ \
127 {OP_LDH, 0, 0, ETH_HLEN }, /* */ \ 134 {OP_LDH, 0, 0, ETH_HLEN }, /* */ \
128 {OP_AND, 0, 0, PTP_CLASS_VMASK }, /* */ \ 135 {OP_AND, 0, 0, PTP_CLASS_VMASK }, /* */ \
129 {OP_OR, 0, 0, PTP_CLASS_L2 }, /* */ \ 136 {OP_OR, 0, 0, PTP_CLASS_L2 }, /* */ \
diff --git a/include/linux/pwm_backlight.h b/include/linux/pwm_backlight.h
index 5e3e25a3c9c3..63d2df43e61a 100644
--- a/include/linux/pwm_backlight.h
+++ b/include/linux/pwm_backlight.h
@@ -14,6 +14,7 @@ struct platform_pwm_backlight_data {
14 unsigned int pwm_period_ns; 14 unsigned int pwm_period_ns;
15 int (*init)(struct device *dev); 15 int (*init)(struct device *dev);
16 int (*notify)(struct device *dev, int brightness); 16 int (*notify)(struct device *dev, int brightness);
17 void (*notify_after)(struct device *dev, int brightness);
17 void (*exit)(struct device *dev); 18 void (*exit)(struct device *dev);
18 int (*check_fb)(struct device *dev, struct fb_info *info); 19 int (*check_fb)(struct device *dev, struct fb_info *info);
19}; 20};
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/random.h b/include/linux/random.h
index ce29a040c8dc..d13059f3ea32 100644
--- a/include/linux/random.h
+++ b/include/linux/random.h
@@ -57,18 +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_ipv6_id(const __be32 daddr[4]);
62extern u32 secure_ipv4_port_ephemeral(__be32 saddr, __be32 daddr, __be16 dport);
63extern u32 secure_ipv6_port_ephemeral(const __be32 *saddr, const __be32 *daddr,
64 __be16 dport);
65extern __u32 secure_tcp_sequence_number(__be32 saddr, __be32 daddr,
66 __be16 sport, __be16 dport);
67extern __u32 secure_tcpv6_sequence_number(__be32 *saddr, __be32 *daddr,
68 __be16 sport, __be16 dport);
69extern u64 secure_dccp_sequence_number(__be32 saddr, __be32 daddr,
70 __be16 sport, __be16 dport);
71
72#ifndef MODULE 60#ifndef MODULE
73extern const struct file_operations random_fops, urandom_fops; 61extern const struct file_operations random_fops, urandom_fops;
74#endif 62#endif
diff --git a/include/linux/ratelimit.h b/include/linux/ratelimit.h
index 2f007157fab9..e11ccb4cf48d 100644
--- a/include/linux/ratelimit.h
+++ b/include/linux/ratelimit.h
@@ -8,7 +8,7 @@
8#define DEFAULT_RATELIMIT_BURST 10 8#define DEFAULT_RATELIMIT_BURST 10
9 9
10struct ratelimit_state { 10struct ratelimit_state {
11 spinlock_t lock; /* protect the state */ 11 raw_spinlock_t lock; /* protect the state */
12 12
13 int interval; 13 int interval;
14 int burst; 14 int burst;
@@ -20,7 +20,7 @@ struct ratelimit_state {
20#define DEFINE_RATELIMIT_STATE(name, interval_init, burst_init) \ 20#define DEFINE_RATELIMIT_STATE(name, interval_init, burst_init) \
21 \ 21 \
22 struct ratelimit_state name = { \ 22 struct ratelimit_state name = { \
23 .lock = __SPIN_LOCK_UNLOCKED(name.lock), \ 23 .lock = __RAW_SPIN_LOCK_UNLOCKED(name.lock), \
24 .interval = interval_init, \ 24 .interval = interval_init, \
25 .burst = burst_init, \ 25 .burst = burst_init, \
26 } 26 }
@@ -28,7 +28,7 @@ struct ratelimit_state {
28static inline void ratelimit_state_init(struct ratelimit_state *rs, 28static inline void ratelimit_state_init(struct ratelimit_state *rs,
29 int interval, int burst) 29 int interval, int burst)
30{ 30{
31 spin_lock_init(&rs->lock); 31 raw_spin_lock_init(&rs->lock);
32 rs->interval = interval; 32 rs->interval = interval;
33 rs->burst = burst; 33 rs->burst = burst;
34 rs->printed = 0; 34 rs->printed = 0;
diff --git a/include/linux/rcupdate.h b/include/linux/rcupdate.h
index 8f4f881a0ad8..2cf4226ade7e 100644
--- a/include/linux/rcupdate.h
+++ b/include/linux/rcupdate.h
@@ -33,6 +33,7 @@
33#ifndef __LINUX_RCUPDATE_H 33#ifndef __LINUX_RCUPDATE_H
34#define __LINUX_RCUPDATE_H 34#define __LINUX_RCUPDATE_H
35 35
36#include <linux/types.h>
36#include <linux/cache.h> 37#include <linux/cache.h>
37#include <linux/spinlock.h> 38#include <linux/spinlock.h>
38#include <linux/threads.h> 39#include <linux/threads.h>
@@ -64,32 +65,74 @@ static inline void rcutorture_record_progress(unsigned long vernum)
64#define ULONG_CMP_GE(a, b) (ULONG_MAX / 2 >= (a) - (b)) 65#define ULONG_CMP_GE(a, b) (ULONG_MAX / 2 >= (a) - (b))
65#define ULONG_CMP_LT(a, b) (ULONG_MAX / 2 < (a) - (b)) 66#define ULONG_CMP_LT(a, b) (ULONG_MAX / 2 < (a) - (b))
66 67
68/* Exported common interfaces */
69
70#ifdef CONFIG_PREEMPT_RCU
71
67/** 72/**
68 * struct rcu_head - callback structure for use with RCU 73 * call_rcu() - Queue an RCU callback for invocation after a grace period.
69 * @next: next update requests in a list 74 * @head: structure to be used for queueing the RCU updates.
70 * @func: actual update function to call after the grace period. 75 * @func: actual callback function to be invoked after the grace period
76 *
77 * The callback function will be invoked some time after a full grace
78 * period elapses, in other words after all pre-existing RCU read-side
79 * critical sections have completed. However, the callback function
80 * might well execute concurrently with RCU read-side critical sections
81 * that started after call_rcu() was invoked. RCU read-side critical
82 * sections are delimited by rcu_read_lock() and rcu_read_unlock(),
83 * and may be nested.
71 */ 84 */
72struct rcu_head { 85extern void call_rcu(struct rcu_head *head,
73 struct rcu_head *next; 86 void (*func)(struct rcu_head *head));
74 void (*func)(struct rcu_head *head);
75};
76 87
77/* Exported common interfaces */ 88#else /* #ifdef CONFIG_PREEMPT_RCU */
89
90/* In classic RCU, call_rcu() is just call_rcu_sched(). */
91#define call_rcu call_rcu_sched
92
93#endif /* #else #ifdef CONFIG_PREEMPT_RCU */
94
95/**
96 * call_rcu_bh() - Queue an RCU for invocation after a quicker grace period.
97 * @head: structure to be used for queueing the RCU updates.
98 * @func: actual callback function to be invoked after the grace period
99 *
100 * The callback function will be invoked some time after a full grace
101 * period elapses, in other words after all currently executing RCU
102 * read-side critical sections have completed. call_rcu_bh() assumes
103 * that the read-side critical sections end on completion of a softirq
104 * handler. This means that read-side critical sections in process
105 * context must not be interrupted by softirqs. This interface is to be
106 * used when most of the read-side critical sections are in softirq context.
107 * RCU read-side critical sections are delimited by :
108 * - rcu_read_lock() and rcu_read_unlock(), if in interrupt context.
109 * OR
110 * - rcu_read_lock_bh() and rcu_read_unlock_bh(), if in process context.
111 * These may be nested.
112 */
113extern void call_rcu_bh(struct rcu_head *head,
114 void (*func)(struct rcu_head *head));
115
116/**
117 * call_rcu_sched() - Queue an RCU for invocation after sched grace period.
118 * @head: structure to be used for queueing the RCU updates.
119 * @func: actual callback function to be invoked after the grace period
120 *
121 * The callback function will be invoked some time after a full grace
122 * period elapses, in other words after all currently executing RCU
123 * read-side critical sections have completed. call_rcu_sched() assumes
124 * that the read-side critical sections end on enabling of preemption
125 * or on voluntary preemption.
126 * RCU read-side critical sections are delimited by :
127 * - rcu_read_lock_sched() and rcu_read_unlock_sched(),
128 * OR
129 * anything that disables preemption.
130 * These may be nested.
131 */
78extern void call_rcu_sched(struct rcu_head *head, 132extern void call_rcu_sched(struct rcu_head *head,
79 void (*func)(struct rcu_head *rcu)); 133 void (*func)(struct rcu_head *rcu));
80extern void synchronize_sched(void);
81extern void rcu_barrier_bh(void);
82extern void rcu_barrier_sched(void);
83
84static inline void __rcu_read_lock_bh(void)
85{
86 local_bh_disable();
87}
88 134
89static inline void __rcu_read_unlock_bh(void) 135extern void synchronize_sched(void);
90{
91 local_bh_enable();
92}
93 136
94#ifdef CONFIG_PREEMPT_RCU 137#ifdef CONFIG_PREEMPT_RCU
95 138
@@ -152,6 +195,15 @@ static inline void rcu_exit_nohz(void)
152 195
153#endif /* #else #ifdef CONFIG_NO_HZ */ 196#endif /* #else #ifdef CONFIG_NO_HZ */
154 197
198/*
199 * Infrastructure to implement the synchronize_() primitives in
200 * TREE_RCU and rcu_barrier_() primitives in TINY_RCU.
201 */
202
203typedef void call_rcu_func_t(struct rcu_head *head,
204 void (*func)(struct rcu_head *head));
205void wait_rcu_gp(call_rcu_func_t crf);
206
155#if defined(CONFIG_TREE_RCU) || defined(CONFIG_TREE_PREEMPT_RCU) 207#if defined(CONFIG_TREE_RCU) || defined(CONFIG_TREE_PREEMPT_RCU)
156#include <linux/rcutree.h> 208#include <linux/rcutree.h>
157#elif defined(CONFIG_TINY_RCU) || defined(CONFIG_TINY_PREEMPT_RCU) 209#elif defined(CONFIG_TINY_RCU) || defined(CONFIG_TINY_PREEMPT_RCU)
@@ -297,19 +349,31 @@ extern int rcu_my_thread_group_empty(void);
297/** 349/**
298 * rcu_lockdep_assert - emit lockdep splat if specified condition not met 350 * rcu_lockdep_assert - emit lockdep splat if specified condition not met
299 * @c: condition to check 351 * @c: condition to check
352 * @s: informative message
300 */ 353 */
301#define rcu_lockdep_assert(c) \ 354#define rcu_lockdep_assert(c, s) \
302 do { \ 355 do { \
303 static bool __warned; \ 356 static bool __warned; \
304 if (debug_lockdep_rcu_enabled() && !__warned && !(c)) { \ 357 if (debug_lockdep_rcu_enabled() && !__warned && !(c)) { \
305 __warned = true; \ 358 __warned = true; \
306 lockdep_rcu_dereference(__FILE__, __LINE__); \ 359 lockdep_rcu_suspicious(__FILE__, __LINE__, s); \
307 } \ 360 } \
308 } while (0) 361 } while (0)
309 362
363#define rcu_sleep_check() \
364 do { \
365 rcu_lockdep_assert(!lock_is_held(&rcu_bh_lock_map), \
366 "Illegal context switch in RCU-bh" \
367 " read-side critical section"); \
368 rcu_lockdep_assert(!lock_is_held(&rcu_sched_lock_map), \
369 "Illegal context switch in RCU-sched"\
370 " read-side critical section"); \
371 } while (0)
372
310#else /* #ifdef CONFIG_PROVE_RCU */ 373#else /* #ifdef CONFIG_PROVE_RCU */
311 374
312#define rcu_lockdep_assert(c) do { } while (0) 375#define rcu_lockdep_assert(c, s) do { } while (0)
376#define rcu_sleep_check() do { } while (0)
313 377
314#endif /* #else #ifdef CONFIG_PROVE_RCU */ 378#endif /* #else #ifdef CONFIG_PROVE_RCU */
315 379
@@ -338,14 +402,16 @@ extern int rcu_my_thread_group_empty(void);
338#define __rcu_dereference_check(p, c, space) \ 402#define __rcu_dereference_check(p, c, space) \
339 ({ \ 403 ({ \
340 typeof(*p) *_________p1 = (typeof(*p)*__force )ACCESS_ONCE(p); \ 404 typeof(*p) *_________p1 = (typeof(*p)*__force )ACCESS_ONCE(p); \
341 rcu_lockdep_assert(c); \ 405 rcu_lockdep_assert(c, "suspicious rcu_dereference_check()" \
406 " usage"); \
342 rcu_dereference_sparse(p, space); \ 407 rcu_dereference_sparse(p, space); \
343 smp_read_barrier_depends(); \ 408 smp_read_barrier_depends(); \
344 ((typeof(*p) __force __kernel *)(_________p1)); \ 409 ((typeof(*p) __force __kernel *)(_________p1)); \
345 }) 410 })
346#define __rcu_dereference_protected(p, c, space) \ 411#define __rcu_dereference_protected(p, c, space) \
347 ({ \ 412 ({ \
348 rcu_lockdep_assert(c); \ 413 rcu_lockdep_assert(c, "suspicious rcu_dereference_protected()" \
414 " usage"); \
349 rcu_dereference_sparse(p, space); \ 415 rcu_dereference_sparse(p, space); \
350 ((typeof(*p) __force __kernel *)(p)); \ 416 ((typeof(*p) __force __kernel *)(p)); \
351 }) 417 })
@@ -359,15 +425,15 @@ extern int rcu_my_thread_group_empty(void);
359#define __rcu_dereference_index_check(p, c) \ 425#define __rcu_dereference_index_check(p, c) \
360 ({ \ 426 ({ \
361 typeof(p) _________p1 = ACCESS_ONCE(p); \ 427 typeof(p) _________p1 = ACCESS_ONCE(p); \
362 rcu_lockdep_assert(c); \ 428 rcu_lockdep_assert(c, \
429 "suspicious rcu_dereference_index_check()" \
430 " usage"); \
363 smp_read_barrier_depends(); \ 431 smp_read_barrier_depends(); \
364 (_________p1); \ 432 (_________p1); \
365 }) 433 })
366#define __rcu_assign_pointer(p, v, space) \ 434#define __rcu_assign_pointer(p, v, space) \
367 ({ \ 435 ({ \
368 if (!__builtin_constant_p(v) || \ 436 smp_wmb(); \
369 ((v) != NULL)) \
370 smp_wmb(); \
371 (p) = (typeof(*v) __force space *)(v); \ 437 (p) = (typeof(*v) __force space *)(v); \
372 }) 438 })
373 439
@@ -500,26 +566,6 @@ extern int rcu_my_thread_group_empty(void);
500#define rcu_dereference_protected(p, c) \ 566#define rcu_dereference_protected(p, c) \
501 __rcu_dereference_protected((p), (c), __rcu) 567 __rcu_dereference_protected((p), (c), __rcu)
502 568
503/**
504 * rcu_dereference_bh_protected() - fetch RCU-bh pointer when updates prevented
505 * @p: The pointer to read, prior to dereferencing
506 * @c: The conditions under which the dereference will take place
507 *
508 * This is the RCU-bh counterpart to rcu_dereference_protected().
509 */
510#define rcu_dereference_bh_protected(p, c) \
511 __rcu_dereference_protected((p), (c), __rcu)
512
513/**
514 * rcu_dereference_sched_protected() - fetch RCU-sched pointer when updates prevented
515 * @p: The pointer to read, prior to dereferencing
516 * @c: The conditions under which the dereference will take place
517 *
518 * This is the RCU-sched counterpart to rcu_dereference_protected().
519 */
520#define rcu_dereference_sched_protected(p, c) \
521 __rcu_dereference_protected((p), (c), __rcu)
522
523 569
524/** 570/**
525 * rcu_dereference() - fetch RCU-protected pointer for dereferencing 571 * rcu_dereference() - fetch RCU-protected pointer for dereferencing
@@ -630,7 +676,7 @@ static inline void rcu_read_unlock(void)
630 */ 676 */
631static inline void rcu_read_lock_bh(void) 677static inline void rcu_read_lock_bh(void)
632{ 678{
633 __rcu_read_lock_bh(); 679 local_bh_disable();
634 __acquire(RCU_BH); 680 __acquire(RCU_BH);
635 rcu_read_acquire_bh(); 681 rcu_read_acquire_bh();
636} 682}
@@ -644,7 +690,7 @@ static inline void rcu_read_unlock_bh(void)
644{ 690{
645 rcu_read_release_bh(); 691 rcu_read_release_bh();
646 __release(RCU_BH); 692 __release(RCU_BH);
647 __rcu_read_unlock_bh(); 693 local_bh_enable();
648} 694}
649 695
650/** 696/**
@@ -698,11 +744,18 @@ static inline notrace void rcu_read_unlock_sched_notrace(void)
698 * any prior initialization. Returns the value assigned. 744 * any prior initialization. Returns the value assigned.
699 * 745 *
700 * Inserts memory barriers on architectures that require them 746 * Inserts memory barriers on architectures that require them
701 * (pretty much all of them other than x86), and also prevents 747 * (which is most of them), and also prevents the compiler from
702 * the compiler from reordering the code that initializes the 748 * reordering the code that initializes the structure after the pointer
703 * structure after the pointer assignment. More importantly, this 749 * assignment. More importantly, this call documents which pointers
704 * call documents which pointers will be dereferenced by RCU read-side 750 * will be dereferenced by RCU read-side code.
705 * code. 751 *
752 * In some special cases, you may use RCU_INIT_POINTER() instead
753 * of rcu_assign_pointer(). RCU_INIT_POINTER() is a bit faster due
754 * to the fact that it does not constrain either the CPU or the compiler.
755 * That said, using RCU_INIT_POINTER() when you should have used
756 * rcu_assign_pointer() is a very bad thing that results in
757 * impossible-to-diagnose memory corruption. So please be careful.
758 * See the RCU_INIT_POINTER() comment header for details.
706 */ 759 */
707#define rcu_assign_pointer(p, v) \ 760#define rcu_assign_pointer(p, v) \
708 __rcu_assign_pointer((p), (v), __rcu) 761 __rcu_assign_pointer((p), (v), __rcu)
@@ -710,105 +763,38 @@ static inline notrace void rcu_read_unlock_sched_notrace(void)
710/** 763/**
711 * RCU_INIT_POINTER() - initialize an RCU protected pointer 764 * RCU_INIT_POINTER() - initialize an RCU protected pointer
712 * 765 *
713 * Initialize an RCU-protected pointer in such a way to avoid RCU-lockdep 766 * Initialize an RCU-protected pointer in special cases where readers
714 * splats. 767 * do not need ordering constraints on the CPU or the compiler. These
768 * special cases are:
769 *
770 * 1. This use of RCU_INIT_POINTER() is NULLing out the pointer -or-
771 * 2. The caller has taken whatever steps are required to prevent
772 * RCU readers from concurrently accessing this pointer -or-
773 * 3. The referenced data structure has already been exposed to
774 * readers either at compile time or via rcu_assign_pointer() -and-
775 * a. You have not made -any- reader-visible changes to
776 * this structure since then -or-
777 * b. It is OK for readers accessing this structure from its
778 * new location to see the old state of the structure. (For
779 * example, the changes were to statistical counters or to
780 * other state where exact synchronization is not required.)
781 *
782 * Failure to follow these rules governing use of RCU_INIT_POINTER() will
783 * result in impossible-to-diagnose memory corruption. As in the structures
784 * will look OK in crash dumps, but any concurrent RCU readers might
785 * see pre-initialized values of the referenced data structure. So
786 * please be very careful how you use RCU_INIT_POINTER()!!!
787 *
788 * If you are creating an RCU-protected linked structure that is accessed
789 * by a single external-to-structure RCU-protected pointer, then you may
790 * use RCU_INIT_POINTER() to initialize the internal RCU-protected
791 * pointers, but you must use rcu_assign_pointer() to initialize the
792 * external-to-structure pointer -after- you have completely initialized
793 * the reader-accessible portions of the linked structure.
715 */ 794 */
716#define RCU_INIT_POINTER(p, v) \ 795#define RCU_INIT_POINTER(p, v) \
717 p = (typeof(*v) __force __rcu *)(v) 796 p = (typeof(*v) __force __rcu *)(v)
718 797
719/* Infrastructure to implement the synchronize_() primitives. */
720
721struct rcu_synchronize {
722 struct rcu_head head;
723 struct completion completion;
724};
725
726extern void wakeme_after_rcu(struct rcu_head *head);
727
728#ifdef CONFIG_PREEMPT_RCU
729
730/**
731 * call_rcu() - Queue an RCU callback for invocation after a grace period.
732 * @head: structure to be used for queueing the RCU updates.
733 * @func: actual callback function to be invoked after the grace period
734 *
735 * The callback function will be invoked some time after a full grace
736 * period elapses, in other words after all pre-existing RCU read-side
737 * critical sections have completed. However, the callback function
738 * might well execute concurrently with RCU read-side critical sections
739 * that started after call_rcu() was invoked. RCU read-side critical
740 * sections are delimited by rcu_read_lock() and rcu_read_unlock(),
741 * and may be nested.
742 */
743extern void call_rcu(struct rcu_head *head,
744 void (*func)(struct rcu_head *head));
745
746#else /* #ifdef CONFIG_PREEMPT_RCU */
747
748/* In classic RCU, call_rcu() is just call_rcu_sched(). */
749#define call_rcu call_rcu_sched
750
751#endif /* #else #ifdef CONFIG_PREEMPT_RCU */
752
753/**
754 * call_rcu_bh() - Queue an RCU for invocation after a quicker grace period.
755 * @head: structure to be used for queueing the RCU updates.
756 * @func: actual callback function to be invoked after the grace period
757 *
758 * The callback function will be invoked some time after a full grace
759 * period elapses, in other words after all currently executing RCU
760 * read-side critical sections have completed. call_rcu_bh() assumes
761 * that the read-side critical sections end on completion of a softirq
762 * handler. This means that read-side critical sections in process
763 * context must not be interrupted by softirqs. This interface is to be
764 * used when most of the read-side critical sections are in softirq context.
765 * RCU read-side critical sections are delimited by :
766 * - rcu_read_lock() and rcu_read_unlock(), if in interrupt context.
767 * OR
768 * - rcu_read_lock_bh() and rcu_read_unlock_bh(), if in process context.
769 * These may be nested.
770 */
771extern void call_rcu_bh(struct rcu_head *head,
772 void (*func)(struct rcu_head *head));
773
774/*
775 * debug_rcu_head_queue()/debug_rcu_head_unqueue() are used internally
776 * by call_rcu() and rcu callback execution, and are therefore not part of the
777 * RCU API. Leaving in rcupdate.h because they are used by all RCU flavors.
778 */
779
780#ifdef CONFIG_DEBUG_OBJECTS_RCU_HEAD
781# define STATE_RCU_HEAD_READY 0
782# define STATE_RCU_HEAD_QUEUED 1
783
784extern struct debug_obj_descr rcuhead_debug_descr;
785
786static inline void debug_rcu_head_queue(struct rcu_head *head)
787{
788 WARN_ON_ONCE((unsigned long)head & 0x3);
789 debug_object_activate(head, &rcuhead_debug_descr);
790 debug_object_active_state(head, &rcuhead_debug_descr,
791 STATE_RCU_HEAD_READY,
792 STATE_RCU_HEAD_QUEUED);
793}
794
795static inline void debug_rcu_head_unqueue(struct rcu_head *head)
796{
797 debug_object_active_state(head, &rcuhead_debug_descr,
798 STATE_RCU_HEAD_QUEUED,
799 STATE_RCU_HEAD_READY);
800 debug_object_deactivate(head, &rcuhead_debug_descr);
801}
802#else /* !CONFIG_DEBUG_OBJECTS_RCU_HEAD */
803static inline void debug_rcu_head_queue(struct rcu_head *head)
804{
805}
806
807static inline void debug_rcu_head_unqueue(struct rcu_head *head)
808{
809}
810#endif /* #else !CONFIG_DEBUG_OBJECTS_RCU_HEAD */
811
812static __always_inline bool __is_kfree_rcu_offset(unsigned long offset) 798static __always_inline bool __is_kfree_rcu_offset(unsigned long offset)
813{ 799{
814 return offset < 4096; 800 return offset < 4096;
@@ -827,18 +813,6 @@ void __kfree_rcu(struct rcu_head *head, unsigned long offset)
827 call_rcu(head, (rcu_callback)offset); 813 call_rcu(head, (rcu_callback)offset);
828} 814}
829 815
830extern void kfree(const void *);
831
832static inline void __rcu_reclaim(struct rcu_head *head)
833{
834 unsigned long offset = (unsigned long)head->func;
835
836 if (__is_kfree_rcu_offset(offset))
837 kfree((void *)head - offset);
838 else
839 head->func(head);
840}
841
842/** 816/**
843 * kfree_rcu() - kfree an object after a grace period. 817 * kfree_rcu() - kfree an object after a grace period.
844 * @ptr: pointer to kfree 818 * @ptr: pointer to kfree
diff --git a/include/linux/rcutiny.h b/include/linux/rcutiny.h
index 52b3e0281fd0..00b7a5e493d2 100644
--- a/include/linux/rcutiny.h
+++ b/include/linux/rcutiny.h
@@ -27,9 +27,23 @@
27 27
28#include <linux/cache.h> 28#include <linux/cache.h>
29 29
30#ifdef CONFIG_RCU_BOOST
30static inline void rcu_init(void) 31static inline void rcu_init(void)
31{ 32{
32} 33}
34#else /* #ifdef CONFIG_RCU_BOOST */
35void rcu_init(void);
36#endif /* #else #ifdef CONFIG_RCU_BOOST */
37
38static inline void rcu_barrier_bh(void)
39{
40 wait_rcu_gp(call_rcu_bh);
41}
42
43static inline void rcu_barrier_sched(void)
44{
45 wait_rcu_gp(call_rcu_sched);
46}
33 47
34#ifdef CONFIG_TINY_RCU 48#ifdef CONFIG_TINY_RCU
35 49
@@ -45,9 +59,13 @@ static inline void rcu_barrier(void)
45 59
46#else /* #ifdef CONFIG_TINY_RCU */ 60#else /* #ifdef CONFIG_TINY_RCU */
47 61
48void rcu_barrier(void);
49void synchronize_rcu_expedited(void); 62void synchronize_rcu_expedited(void);
50 63
64static inline void rcu_barrier(void)
65{
66 wait_rcu_gp(call_rcu);
67}
68
51#endif /* #else #ifdef CONFIG_TINY_RCU */ 69#endif /* #else #ifdef CONFIG_TINY_RCU */
52 70
53static inline void synchronize_rcu_bh(void) 71static inline void synchronize_rcu_bh(void)
diff --git a/include/linux/rcutree.h b/include/linux/rcutree.h
index e65d06634dd8..67458468f1a8 100644
--- a/include/linux/rcutree.h
+++ b/include/linux/rcutree.h
@@ -67,6 +67,8 @@ static inline void synchronize_rcu_bh_expedited(void)
67} 67}
68 68
69extern void rcu_barrier(void); 69extern void rcu_barrier(void);
70extern void rcu_barrier_bh(void);
71extern void rcu_barrier_sched(void);
70 72
71extern unsigned long rcutorture_testseq; 73extern unsigned long rcutorture_testseq;
72extern unsigned long rcutorture_vernum; 74extern unsigned long rcutorture_vernum;
diff --git a/include/linux/regmap.h b/include/linux/regmap.h
index 60a65cd7e1a0..3daac2d8dc37 100644
--- a/include/linux/regmap.h
+++ b/include/linux/regmap.h
@@ -20,9 +20,77 @@
20struct i2c_client; 20struct i2c_client;
21struct spi_device; 21struct spi_device;
22 22
23/* An enum of all the supported cache types */
24enum regcache_type {
25 REGCACHE_NONE,
26 REGCACHE_INDEXED,
27 REGCACHE_RBTREE,
28 REGCACHE_LZO
29};
30
31/**
32 * Default value for a register. We use an array of structs rather
33 * than a simple array as many modern devices have very sparse
34 * register maps.
35 *
36 * @reg: Register address.
37 * @def: Register default value.
38 */
39struct reg_default {
40 unsigned int reg;
41 unsigned int def;
42};
43
44/**
45 * Configuration for the register map of a device.
46 *
47 * @reg_bits: Number of bits in a register address, mandatory.
48 * @val_bits: Number of bits in a register value, mandatory.
49 *
50 * @writeable_reg: Optional callback returning true if the register
51 * can be written to.
52 * @readable_reg: Optional callback returning true if the register
53 * can be read from.
54 * @volatile_reg: Optional callback returning true if the register
55 * value can't be cached.
56 * @precious_reg: Optional callback returning true if the rgister
57 * should not be read outside of a call from the driver
58 * (eg, a clear on read interrupt status register).
59 *
60 * @max_register: Optional, specifies the maximum valid register index.
61 * @reg_defaults: Power on reset values for registers (for use with
62 * register cache support).
63 * @num_reg_defaults: Number of elements in reg_defaults.
64 *
65 * @read_flag_mask: Mask to be set in the top byte of the register when doing
66 * a read.
67 * @write_flag_mask: Mask to be set in the top byte of the register when doing
68 * a write. If both read_flag_mask and write_flag_mask are
69 * empty the regmap_bus default masks are used.
70 *
71 * @cache_type: The actual cache type.
72 * @reg_defaults_raw: Power on reset values for registers (for use with
73 * register cache support).
74 * @num_reg_defaults_raw: Number of elements in reg_defaults_raw.
75 */
23struct regmap_config { 76struct regmap_config {
24 int reg_bits; 77 int reg_bits;
25 int val_bits; 78 int val_bits;
79
80 bool (*writeable_reg)(struct device *dev, unsigned int reg);
81 bool (*readable_reg)(struct device *dev, unsigned int reg);
82 bool (*volatile_reg)(struct device *dev, unsigned int reg);
83 bool (*precious_reg)(struct device *dev, unsigned int reg);
84
85 unsigned int max_register;
86 struct reg_default *reg_defaults;
87 unsigned int num_reg_defaults;
88 enum regcache_type cache_type;
89 const void *reg_defaults_raw;
90 unsigned int num_reg_defaults_raw;
91
92 u8 read_flag_mask;
93 u8 write_flag_mask;
26}; 94};
27 95
28typedef int (*regmap_hw_write)(struct device *dev, const void *data, 96typedef int (*regmap_hw_write)(struct device *dev, const void *data,
@@ -37,25 +105,18 @@ typedef int (*regmap_hw_read)(struct device *dev,
37/** 105/**
38 * Description of a hardware bus for the register map infrastructure. 106 * Description of a hardware bus for the register map infrastructure.
39 * 107 *
40 * @list: Internal use.
41 * @type: Bus type, used to identify bus to be used for a device.
42 * @write: Write operation. 108 * @write: Write operation.
43 * @gather_write: Write operation with split register/value, return -ENOTSUPP 109 * @gather_write: Write operation with split register/value, return -ENOTSUPP
44 * if not implemented on a given device. 110 * if not implemented on a given device.
45 * @read: Read operation. Data is returned in the buffer used to transmit 111 * @read: Read operation. Data is returned in the buffer used to transmit
46 * data. 112 * 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 113 * @read_flag_mask: Mask to be set in the top byte of the register when doing
50 * a read. 114 * a read.
51 */ 115 */
52struct regmap_bus { 116struct regmap_bus {
53 struct list_head list;
54 struct bus_type *type;
55 regmap_hw_write write; 117 regmap_hw_write write;
56 regmap_hw_gather_write gather_write; 118 regmap_hw_gather_write gather_write;
57 regmap_hw_read read; 119 regmap_hw_read read;
58 struct module *owner;
59 u8 read_flag_mask; 120 u8 read_flag_mask;
60}; 121};
61 122
@@ -79,4 +140,8 @@ int regmap_bulk_read(struct regmap *map, unsigned int reg, void *val,
79int regmap_update_bits(struct regmap *map, unsigned int reg, 140int regmap_update_bits(struct regmap *map, unsigned int reg,
80 unsigned int mask, unsigned int val); 141 unsigned int mask, unsigned int val);
81 142
143int regcache_sync(struct regmap *map);
144void regcache_cache_only(struct regmap *map, bool enable);
145void regcache_cache_bypass(struct regmap *map, bool enable);
146
82#endif 147#endif
diff --git a/include/linux/regulator/consumer.h b/include/linux/regulator/consumer.h
index 9e87c1cb7270..b47771aa5718 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 /* private: 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/rfkill-gpio.h b/include/linux/rfkill-gpio.h
index a175d0598033..4d09f6eab359 100644
--- a/include/linux/rfkill-gpio.h
+++ b/include/linux/rfkill-gpio.h
@@ -30,6 +30,8 @@
30 * @reset_gpio: GPIO which is used for reseting rfkill switch 30 * @reset_gpio: GPIO which is used for reseting rfkill switch
31 * @shutdown_gpio: GPIO which is used for shutdown of rfkill switch 31 * @shutdown_gpio: GPIO which is used for shutdown of rfkill switch
32 * @power_clk_name: [optional] name of clk to turn off while blocked 32 * @power_clk_name: [optional] name of clk to turn off while blocked
33 * @gpio_runtime_close: clean up platform specific gpio configuration
34 * @gpio_runtime_setup: set up platform specific gpio configuration
33 */ 35 */
34 36
35struct rfkill_gpio_platform_data { 37struct rfkill_gpio_platform_data {
@@ -38,6 +40,8 @@ struct rfkill_gpio_platform_data {
38 int shutdown_gpio; 40 int shutdown_gpio;
39 const char *power_clk_name; 41 const char *power_clk_name;
40 enum rfkill_type type; 42 enum rfkill_type type;
43 void (*gpio_runtime_close)(struct platform_device *);
44 int (*gpio_runtime_setup)(struct platform_device *);
41}; 45};
42 46
43#endif /* __RFKILL_GPIO_H */ 47#endif /* __RFKILL_GPIO_H */
diff --git a/include/linux/ring_buffer.h b/include/linux/ring_buffer.h
index b891de96000f..67be0376d8e3 100644
--- a/include/linux/ring_buffer.h
+++ b/include/linux/ring_buffer.h
@@ -154,6 +154,8 @@ void ring_buffer_record_enable(struct ring_buffer *buffer);
154void ring_buffer_record_disable_cpu(struct ring_buffer *buffer, int cpu); 154void ring_buffer_record_disable_cpu(struct ring_buffer *buffer, int cpu);
155void ring_buffer_record_enable_cpu(struct ring_buffer *buffer, int cpu); 155void ring_buffer_record_enable_cpu(struct ring_buffer *buffer, int cpu);
156 156
157unsigned long ring_buffer_oldest_event_ts(struct ring_buffer *buffer, int cpu);
158unsigned long ring_buffer_bytes_cpu(struct ring_buffer *buffer, int cpu);
157unsigned long ring_buffer_entries(struct ring_buffer *buffer); 159unsigned long ring_buffer_entries(struct ring_buffer *buffer);
158unsigned long ring_buffer_overruns(struct ring_buffer *buffer); 160unsigned long ring_buffer_overruns(struct ring_buffer *buffer);
159unsigned long ring_buffer_entries_cpu(struct ring_buffer *buffer, int cpu); 161unsigned long ring_buffer_entries_cpu(struct ring_buffer *buffer, int cpu);
diff --git a/include/linux/rio_regs.h b/include/linux/rio_regs.h
index 9026b30238f3..218168a2b5e9 100644
--- a/include/linux/rio_regs.h
+++ b/include/linux/rio_regs.h
@@ -36,12 +36,12 @@
36#define RIO_PEF_PROCESSOR 0x20000000 /* [I] Processor */ 36#define RIO_PEF_PROCESSOR 0x20000000 /* [I] Processor */
37#define RIO_PEF_SWITCH 0x10000000 /* [I] Switch */ 37#define RIO_PEF_SWITCH 0x10000000 /* [I] Switch */
38#define RIO_PEF_MULTIPORT 0x08000000 /* [VI, 2.1] Multiport */ 38#define RIO_PEF_MULTIPORT 0x08000000 /* [VI, 2.1] Multiport */
39#define RIO_PEF_INB_MBOX 0x00f00000 /* [II] Mailboxes */ 39#define RIO_PEF_INB_MBOX 0x00f00000 /* [II, <= 1.2] Mailboxes */
40#define RIO_PEF_INB_MBOX0 0x00800000 /* [II] Mailbox 0 */ 40#define RIO_PEF_INB_MBOX0 0x00800000 /* [II, <= 1.2] Mailbox 0 */
41#define RIO_PEF_INB_MBOX1 0x00400000 /* [II] Mailbox 1 */ 41#define RIO_PEF_INB_MBOX1 0x00400000 /* [II, <= 1.2] Mailbox 1 */
42#define RIO_PEF_INB_MBOX2 0x00200000 /* [II] Mailbox 2 */ 42#define RIO_PEF_INB_MBOX2 0x00200000 /* [II, <= 1.2] Mailbox 2 */
43#define RIO_PEF_INB_MBOX3 0x00100000 /* [II] Mailbox 3 */ 43#define RIO_PEF_INB_MBOX3 0x00100000 /* [II, <= 1.2] Mailbox 3 */
44#define RIO_PEF_INB_DOORBELL 0x00080000 /* [II] Doorbells */ 44#define RIO_PEF_INB_DOORBELL 0x00080000 /* [II, <= 1.2] Doorbells */
45#define RIO_PEF_EXT_RT 0x00000200 /* [III, 1.3] Extended route table support */ 45#define RIO_PEF_EXT_RT 0x00000200 /* [III, 1.3] Extended route table support */
46#define RIO_PEF_STD_RT 0x00000100 /* [III, 1.3] Standard route table support */ 46#define RIO_PEF_STD_RT 0x00000100 /* [III, 1.3] Standard route table support */
47#define RIO_PEF_CTLS 0x00000010 /* [III] CTLS */ 47#define RIO_PEF_CTLS 0x00000010 /* [III] CTLS */
@@ -102,7 +102,7 @@
102#define RIO_SWITCH_RT_LIMIT 0x34 /* [III, 1.3] Switch Route Table Destination ID Limit CAR */ 102#define RIO_SWITCH_RT_LIMIT 0x34 /* [III, 1.3] Switch Route Table Destination ID Limit CAR */
103#define RIO_RT_MAX_DESTID 0x0000ffff 103#define RIO_RT_MAX_DESTID 0x0000ffff
104 104
105#define RIO_MBOX_CSR 0x40 /* [II] Mailbox CSR */ 105#define RIO_MBOX_CSR 0x40 /* [II, <= 1.2] Mailbox CSR */
106#define RIO_MBOX0_AVAIL 0x80000000 /* [II] Mbox 0 avail */ 106#define RIO_MBOX0_AVAIL 0x80000000 /* [II] Mbox 0 avail */
107#define RIO_MBOX0_FULL 0x40000000 /* [II] Mbox 0 full */ 107#define RIO_MBOX0_FULL 0x40000000 /* [II] Mbox 0 full */
108#define RIO_MBOX0_EMPTY 0x20000000 /* [II] Mbox 0 empty */ 108#define RIO_MBOX0_EMPTY 0x20000000 /* [II] Mbox 0 empty */
@@ -128,8 +128,8 @@
128#define RIO_MBOX3_FAIL 0x00000008 /* [II] Mbox 3 fail */ 128#define RIO_MBOX3_FAIL 0x00000008 /* [II] Mbox 3 fail */
129#define RIO_MBOX3_ERROR 0x00000004 /* [II] Mbox 3 error */ 129#define RIO_MBOX3_ERROR 0x00000004 /* [II] Mbox 3 error */
130 130
131#define RIO_WRITE_PORT_CSR 0x44 /* [I] Write Port CSR */ 131#define RIO_WRITE_PORT_CSR 0x44 /* [I, <= 1.2] Write Port CSR */
132#define RIO_DOORBELL_CSR 0x44 /* [II] Doorbell CSR */ 132#define RIO_DOORBELL_CSR 0x44 /* [II, <= 1.2] Doorbell CSR */
133#define RIO_DOORBELL_AVAIL 0x80000000 /* [II] Doorbell avail */ 133#define RIO_DOORBELL_AVAIL 0x80000000 /* [II] Doorbell avail */
134#define RIO_DOORBELL_FULL 0x40000000 /* [II] Doorbell full */ 134#define RIO_DOORBELL_FULL 0x40000000 /* [II] Doorbell full */
135#define RIO_DOORBELL_EMPTY 0x20000000 /* [II] Doorbell empty */ 135#define RIO_DOORBELL_EMPTY 0x20000000 /* [II] Doorbell empty */
diff --git a/include/linux/rose.h b/include/linux/rose.h
index c7b4b184c82e..1fcfe95893b8 100644
--- a/include/linux/rose.h
+++ b/include/linux/rose.h
@@ -7,6 +7,9 @@
7#ifndef ROSE_KERNEL_H 7#ifndef ROSE_KERNEL_H
8#define ROSE_KERNEL_H 8#define ROSE_KERNEL_H
9 9
10#include <linux/socket.h>
11#include <linux/ax25.h>
12
10#define ROSE_MTU 251 13#define ROSE_MTU 251
11 14
12#define ROSE_MAX_DIGIS 6 15#define ROSE_MAX_DIGIS 6
@@ -44,7 +47,7 @@ typedef struct {
44} rose_address; 47} rose_address;
45 48
46struct sockaddr_rose { 49struct sockaddr_rose {
47 sa_family_t srose_family; 50 __kernel_sa_family_t srose_family;
48 rose_address srose_addr; 51 rose_address srose_addr;
49 ax25_address srose_call; 52 ax25_address srose_call;
50 int srose_ndigis; 53 int srose_ndigis;
@@ -52,7 +55,7 @@ struct sockaddr_rose {
52}; 55};
53 56
54struct full_sockaddr_rose { 57struct full_sockaddr_rose {
55 sa_family_t srose_family; 58 __kernel_sa_family_t srose_family;
56 rose_address srose_addr; 59 rose_address srose_addr;
57 ax25_address srose_call; 60 ax25_address srose_call;
58 unsigned int srose_ndigis; 61 unsigned int srose_ndigis;
diff --git a/include/linux/rtc.h b/include/linux/rtc.h
index b27ebea25660..93f4d035076b 100644
--- a/include/linux/rtc.h
+++ b/include/linux/rtc.h
@@ -97,6 +97,9 @@ struct rtc_pll_info {
97#define RTC_AF 0x20 /* Alarm interrupt */ 97#define RTC_AF 0x20 /* Alarm interrupt */
98#define RTC_UF 0x10 /* Update interrupt for 1Hz RTC */ 98#define RTC_UF 0x10 /* Update interrupt for 1Hz RTC */
99 99
100
101#define RTC_MAX_FREQ 8192
102
100#ifdef __KERNEL__ 103#ifdef __KERNEL__
101 104
102#include <linux/types.h> 105#include <linux/types.h>
diff --git a/include/linux/rwsem-spinlock.h b/include/linux/rwsem-spinlock.h
index 34701241b673..d5b13bc07a0b 100644
--- a/include/linux/rwsem-spinlock.h
+++ b/include/linux/rwsem-spinlock.h
@@ -22,7 +22,7 @@
22 */ 22 */
23struct rw_semaphore { 23struct rw_semaphore {
24 __s32 activity; 24 __s32 activity;
25 spinlock_t wait_lock; 25 raw_spinlock_t wait_lock;
26 struct list_head wait_list; 26 struct list_head wait_list;
27#ifdef CONFIG_DEBUG_LOCK_ALLOC 27#ifdef CONFIG_DEBUG_LOCK_ALLOC
28 struct lockdep_map dep_map; 28 struct lockdep_map dep_map;
diff --git a/include/linux/rwsem.h b/include/linux/rwsem.h
index 6a6741440cb7..63d406554391 100644
--- a/include/linux/rwsem.h
+++ b/include/linux/rwsem.h
@@ -25,7 +25,7 @@ struct rw_semaphore;
25/* All arch specific implementations share the same struct */ 25/* All arch specific implementations share the same struct */
26struct rw_semaphore { 26struct rw_semaphore {
27 long count; 27 long count;
28 spinlock_t wait_lock; 28 raw_spinlock_t wait_lock;
29 struct list_head wait_list; 29 struct list_head wait_list;
30#ifdef CONFIG_DEBUG_LOCK_ALLOC 30#ifdef CONFIG_DEBUG_LOCK_ALLOC
31 struct lockdep_map dep_map; 31 struct lockdep_map dep_map;
@@ -56,9 +56,11 @@ static inline int rwsem_is_locked(struct rw_semaphore *sem)
56# define __RWSEM_DEP_MAP_INIT(lockname) 56# define __RWSEM_DEP_MAP_INIT(lockname)
57#endif 57#endif
58 58
59#define __RWSEM_INITIALIZER(name) \ 59#define __RWSEM_INITIALIZER(name) \
60 { RWSEM_UNLOCKED_VALUE, __SPIN_LOCK_UNLOCKED(name.wait_lock), \ 60 { RWSEM_UNLOCKED_VALUE, \
61 LIST_HEAD_INIT((name).wait_list) __RWSEM_DEP_MAP_INIT(name) } 61 __RAW_SPIN_LOCK_UNLOCKED(name.wait_lock), \
62 LIST_HEAD_INIT((name).wait_list) \
63 __RWSEM_DEP_MAP_INIT(name) }
62 64
63#define DECLARE_RWSEM(name) \ 65#define DECLARE_RWSEM(name) \
64 struct rw_semaphore name = __RWSEM_INITIALIZER(name) 66 struct rw_semaphore name = __RWSEM_INITIALIZER(name)
diff --git a/include/linux/sched.h b/include/linux/sched.h
index 20b03bf94748..e8acce717d2a 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -90,6 +90,7 @@ struct sched_param {
90#include <linux/task_io_accounting.h> 90#include <linux/task_io_accounting.h>
91#include <linux/latencytop.h> 91#include <linux/latencytop.h>
92#include <linux/cred.h> 92#include <linux/cred.h>
93#include <linux/llist.h>
93 94
94#include <asm/processor.h> 95#include <asm/processor.h>
95 96
@@ -270,7 +271,6 @@ extern void init_idle_bootup_task(struct task_struct *idle);
270 271
271extern int runqueue_is_locked(int cpu); 272extern int runqueue_is_locked(int cpu);
272 273
273extern cpumask_var_t nohz_cpu_mask;
274#if defined(CONFIG_SMP) && defined(CONFIG_NO_HZ) 274#if defined(CONFIG_SMP) && defined(CONFIG_NO_HZ)
275extern void select_nohz_load_balancer(int stop_tick); 275extern void select_nohz_load_balancer(int stop_tick);
276extern int get_nohz_timer_target(void); 276extern int get_nohz_timer_target(void);
@@ -510,7 +510,7 @@ struct task_cputime {
510struct thread_group_cputimer { 510struct thread_group_cputimer {
511 struct task_cputime cputime; 511 struct task_cputime cputime;
512 int running; 512 int running;
513 spinlock_t lock; 513 raw_spinlock_t lock;
514}; 514};
515 515
516#include <linux/rwsem.h> 516#include <linux/rwsem.h>
@@ -1225,7 +1225,7 @@ struct task_struct {
1225 unsigned int ptrace; 1225 unsigned int ptrace;
1226 1226
1227#ifdef CONFIG_SMP 1227#ifdef CONFIG_SMP
1228 struct task_struct *wake_entry; 1228 struct llist_node wake_entry;
1229 int on_cpu; 1229 int on_cpu;
1230#endif 1230#endif
1231 int on_rq; 1231 int on_rq;
@@ -1260,9 +1260,6 @@ struct task_struct {
1260#ifdef CONFIG_PREEMPT_RCU 1260#ifdef CONFIG_PREEMPT_RCU
1261 int rcu_read_lock_nesting; 1261 int rcu_read_lock_nesting;
1262 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) */
1266 struct list_head rcu_node_entry; 1263 struct list_head rcu_node_entry;
1267#endif /* #ifdef CONFIG_PREEMPT_RCU */ 1264#endif /* #ifdef CONFIG_PREEMPT_RCU */
1268#ifdef CONFIG_TREE_PREEMPT_RCU 1265#ifdef CONFIG_TREE_PREEMPT_RCU
@@ -1767,6 +1764,7 @@ extern void thread_group_times(struct task_struct *p, cputime_t *ut, cputime_t *
1767#define PF_DUMPCORE 0x00000200 /* dumped core */ 1764#define PF_DUMPCORE 0x00000200 /* dumped core */
1768#define PF_SIGNALED 0x00000400 /* killed by a signal */ 1765#define PF_SIGNALED 0x00000400 /* killed by a signal */
1769#define PF_MEMALLOC 0x00000800 /* Allocating memory */ 1766#define PF_MEMALLOC 0x00000800 /* Allocating memory */
1767#define PF_NPROC_EXCEEDED 0x00001000 /* set_user noticed that RLIMIT_NPROC was exceeded */
1770#define PF_USED_MATH 0x00002000 /* if unset the fpu must be initialized before use */ 1768#define PF_USED_MATH 0x00002000 /* if unset the fpu must be initialized before use */
1771#define PF_FREEZING 0x00004000 /* freeze in progress. do not account to load */ 1769#define PF_FREEZING 0x00004000 /* freeze in progress. do not account to load */
1772#define PF_NOFREEZE 0x00008000 /* this thread should not be frozen */ 1770#define PF_NOFREEZE 0x00008000 /* this thread should not be frozen */
@@ -1955,7 +1953,6 @@ static inline void disable_sched_clock_irqtime(void) {}
1955 1953
1956extern unsigned long long 1954extern unsigned long long
1957task_sched_runtime(struct task_struct *task); 1955task_sched_runtime(struct task_struct *task);
1958extern unsigned long long thread_group_sched_runtime(struct task_struct *task);
1959 1956
1960/* sched_exec is called by processes performing an exec */ 1957/* sched_exec is called by processes performing an exec */
1961#ifdef CONFIG_SMP 1958#ifdef CONFIG_SMP
@@ -2039,6 +2036,10 @@ static inline void sched_autogroup_fork(struct signal_struct *sig) { }
2039static inline void sched_autogroup_exit(struct signal_struct *sig) { } 2036static inline void sched_autogroup_exit(struct signal_struct *sig) { }
2040#endif 2037#endif
2041 2038
2039#ifdef CONFIG_CFS_BANDWIDTH
2040extern unsigned int sysctl_sched_cfs_bandwidth_slice;
2041#endif
2042
2042#ifdef CONFIG_RT_MUTEXES 2043#ifdef CONFIG_RT_MUTEXES
2043extern int rt_mutex_getprio(struct task_struct *p); 2044extern int rt_mutex_getprio(struct task_struct *p);
2044extern void rt_mutex_setprio(struct task_struct *p, int prio); 2045extern void rt_mutex_setprio(struct task_struct *p, int prio);
@@ -2165,7 +2166,8 @@ extern int force_sigsegv(int, struct task_struct *);
2165extern int force_sig_info(int, struct siginfo *, struct task_struct *); 2166extern int force_sig_info(int, struct siginfo *, struct task_struct *);
2166extern int __kill_pgrp_info(int sig, struct siginfo *info, struct pid *pgrp); 2167extern int __kill_pgrp_info(int sig, struct siginfo *info, struct pid *pgrp);
2167extern int kill_pid_info(int sig, struct siginfo *info, struct pid *pid); 2168extern int kill_pid_info(int sig, struct siginfo *info, struct pid *pid);
2168extern int kill_pid_info_as_uid(int, struct siginfo *, struct pid *, uid_t, uid_t, u32); 2169extern int kill_pid_info_as_cred(int, struct siginfo *, struct pid *,
2170 const struct cred *, u32);
2169extern int kill_pgrp(struct pid *pid, int sig, int priv); 2171extern int kill_pgrp(struct pid *pid, int sig, int priv);
2170extern int kill_pid(struct pid *pid, int sig, int priv); 2172extern int kill_pid(struct pid *pid, int sig, int priv);
2171extern int kill_proc_info(int, struct siginfo *, pid_t); 2173extern int kill_proc_info(int, struct siginfo *, pid_t);
@@ -2565,7 +2567,7 @@ void thread_group_cputimer(struct task_struct *tsk, struct task_cputime *times);
2565 2567
2566static inline void thread_group_cputime_init(struct signal_struct *sig) 2568static inline void thread_group_cputime_init(struct signal_struct *sig)
2567{ 2569{
2568 spin_lock_init(&sig->cputimer.lock); 2570 raw_spin_lock_init(&sig->cputimer.lock);
2569} 2571}
2570 2572
2571/* 2573/*
diff --git a/include/linux/security.h b/include/linux/security.h
index ebd2a53a3d07..19d8e04e1688 100644
--- a/include/linux/security.h
+++ b/include/linux/security.h
@@ -36,6 +36,7 @@
36#include <linux/key.h> 36#include <linux/key.h>
37#include <linux/xfrm.h> 37#include <linux/xfrm.h>
38#include <linux/slab.h> 38#include <linux/slab.h>
39#include <linux/xattr.h>
39#include <net/flow.h> 40#include <net/flow.h>
40 41
41/* Maximum number of letters for an LSM name string */ 42/* Maximum number of letters for an LSM name string */
@@ -147,6 +148,10 @@ extern int mmap_min_addr_handler(struct ctl_table *table, int write,
147 void __user *buffer, size_t *lenp, loff_t *ppos); 148 void __user *buffer, size_t *lenp, loff_t *ppos);
148#endif 149#endif
149 150
151/* security_inode_init_security callback function to write xattrs */
152typedef int (*initxattrs) (struct inode *inode,
153 const struct xattr *xattr_array, void *fs_data);
154
150#ifdef CONFIG_SECURITY 155#ifdef CONFIG_SECURITY
151 156
152struct security_mnt_opts { 157struct security_mnt_opts {
@@ -1367,7 +1372,7 @@ static inline void security_free_mnt_opts(struct security_mnt_opts *opts)
1367 * @inode_getsecctx: 1372 * @inode_getsecctx:
1368 * Returns a string containing all relavent security context information 1373 * Returns a string containing all relavent security context information
1369 * 1374 *
1370 * @inode we wish to set the security context of. 1375 * @inode we wish to get the security context of.
1371 * @ctx is a pointer in which to place the allocated security context. 1376 * @ctx is a pointer in which to place the allocated security context.
1372 * @ctxlen points to the place to put the length of @ctx. 1377 * @ctxlen points to the place to put the length of @ctx.
1373 * This is the main security structure. 1378 * This is the main security structure.
@@ -1655,6 +1660,8 @@ struct security_operations {
1655extern int security_init(void); 1660extern int security_init(void);
1656extern int security_module_enable(struct security_operations *ops); 1661extern int security_module_enable(struct security_operations *ops);
1657extern int register_security(struct security_operations *ops); 1662extern int register_security(struct security_operations *ops);
1663extern void __init security_fixup_ops(struct security_operations *ops);
1664
1658 1665
1659/* Security operations */ 1666/* Security operations */
1660int security_ptrace_access_check(struct task_struct *child, unsigned int mode); 1667int security_ptrace_access_check(struct task_struct *child, unsigned int mode);
@@ -1704,8 +1711,11 @@ int security_sb_parse_opts_str(char *options, struct security_mnt_opts *opts);
1704int security_inode_alloc(struct inode *inode); 1711int security_inode_alloc(struct inode *inode);
1705void security_inode_free(struct inode *inode); 1712void security_inode_free(struct inode *inode);
1706int security_inode_init_security(struct inode *inode, struct inode *dir, 1713int security_inode_init_security(struct inode *inode, struct inode *dir,
1707 const struct qstr *qstr, char **name, 1714 const struct qstr *qstr,
1708 void **value, size_t *len); 1715 initxattrs initxattrs, void *fs_data);
1716int security_old_inode_init_security(struct inode *inode, struct inode *dir,
1717 const struct qstr *qstr, char **name,
1718 void **value, size_t *len);
1709int security_inode_create(struct inode *dir, struct dentry *dentry, int mode); 1719int security_inode_create(struct inode *dir, struct dentry *dentry, int mode);
1710int security_inode_link(struct dentry *old_dentry, struct inode *dir, 1720int security_inode_link(struct dentry *old_dentry, struct inode *dir,
1711 struct dentry *new_dentry); 1721 struct dentry *new_dentry);
@@ -2034,11 +2044,19 @@ static inline void security_inode_free(struct inode *inode)
2034static inline int security_inode_init_security(struct inode *inode, 2044static inline int security_inode_init_security(struct inode *inode,
2035 struct inode *dir, 2045 struct inode *dir,
2036 const struct qstr *qstr, 2046 const struct qstr *qstr,
2037 char **name, 2047 initxattrs initxattrs,
2038 void **value, 2048 void *fs_data)
2039 size_t *len)
2040{ 2049{
2041 return -EOPNOTSUPP; 2050 return 0;
2051}
2052
2053static inline int security_old_inode_init_security(struct inode *inode,
2054 struct inode *dir,
2055 const struct qstr *qstr,
2056 char **name, void **value,
2057 size_t *len)
2058{
2059 return 0;
2042} 2060}
2043 2061
2044static inline int security_inode_create(struct inode *dir, 2062static inline int security_inode_create(struct inode *dir,
diff --git a/include/linux/semaphore.h b/include/linux/semaphore.h
index 39fa04966aa8..dc368b8ce215 100644
--- a/include/linux/semaphore.h
+++ b/include/linux/semaphore.h
@@ -14,14 +14,14 @@
14 14
15/* Please don't access any members of this structure directly */ 15/* Please don't access any members of this structure directly */
16struct semaphore { 16struct semaphore {
17 spinlock_t lock; 17 raw_spinlock_t lock;
18 unsigned int count; 18 unsigned int count;
19 struct list_head wait_list; 19 struct list_head wait_list;
20}; 20};
21 21
22#define __SEMAPHORE_INITIALIZER(name, n) \ 22#define __SEMAPHORE_INITIALIZER(name, n) \
23{ \ 23{ \
24 .lock = __SPIN_LOCK_UNLOCKED((name).lock), \ 24 .lock = __RAW_SPIN_LOCK_UNLOCKED((name).lock), \
25 .count = n, \ 25 .count = n, \
26 .wait_list = LIST_HEAD_INIT((name).wait_list), \ 26 .wait_list = LIST_HEAD_INIT((name).wait_list), \
27} 27}
diff --git a/include/linux/serial.h b/include/linux/serial.h
index ef914061511e..97ff8e27a6cc 100644
--- a/include/linux/serial.h
+++ b/include/linux/serial.h
@@ -211,6 +211,7 @@ struct serial_rs485 {
211#define SER_RS485_RTS_ON_SEND (1 << 1) 211#define SER_RS485_RTS_ON_SEND (1 << 1)
212#define SER_RS485_RTS_AFTER_SEND (1 << 2) 212#define SER_RS485_RTS_AFTER_SEND (1 << 2)
213#define SER_RS485_RTS_BEFORE_SEND (1 << 3) 213#define SER_RS485_RTS_BEFORE_SEND (1 << 3)
214#define SER_RS485_RX_DURING_TX (1 << 4)
214 __u32 delay_rts_before_send; /* Milliseconds */ 215 __u32 delay_rts_before_send; /* Milliseconds */
215 __u32 delay_rts_after_send; /* Milliseconds */ 216 __u32 delay_rts_after_send; /* Milliseconds */
216 __u32 padding[5]; /* Memory is cheap, new structs 217 __u32 padding[5]; /* Memory is cheap, new structs
diff --git a/include/linux/serial_8250.h b/include/linux/serial_8250.h
index 97f5b45bbc07..1f05bbeac01e 100644
--- a/include/linux/serial_8250.h
+++ b/include/linux/serial_8250.h
@@ -35,6 +35,7 @@ struct plat_serial8250_port {
35 void (*set_termios)(struct uart_port *, 35 void (*set_termios)(struct uart_port *,
36 struct ktermios *new, 36 struct ktermios *new,
37 struct ktermios *old); 37 struct ktermios *old);
38 int (*handle_irq)(struct uart_port *);
38 void (*pm)(struct uart_port *, unsigned int state, 39 void (*pm)(struct uart_port *, unsigned int state,
39 unsigned old); 40 unsigned old);
40}; 41};
@@ -80,6 +81,7 @@ extern void serial8250_do_set_termios(struct uart_port *port,
80 struct ktermios *termios, struct ktermios *old); 81 struct ktermios *termios, struct ktermios *old);
81extern void serial8250_do_pm(struct uart_port *port, unsigned int state, 82extern void serial8250_do_pm(struct uart_port *port, unsigned int state,
82 unsigned int oldstate); 83 unsigned int oldstate);
84int serial8250_handle_irq(struct uart_port *port, unsigned int iir);
83 85
84extern void serial8250_set_isa_configurator(void (*v) 86extern void serial8250_set_isa_configurator(void (*v)
85 (int port, struct uart_port *up, 87 (int port, struct uart_port *up,
diff --git a/include/linux/serial_core.h b/include/linux/serial_core.h
index a5c31146a337..eadf33d0abba 100644
--- a/include/linux/serial_core.h
+++ b/include/linux/serial_core.h
@@ -46,7 +46,8 @@
46#define PORT_AR7 18 /* Texas Instruments AR7 internal UART */ 46#define PORT_AR7 18 /* Texas Instruments AR7 internal UART */
47#define PORT_U6_16550A 19 /* ST-Ericsson U6xxx internal UART */ 47#define PORT_U6_16550A 19 /* ST-Ericsson U6xxx internal UART */
48#define PORT_TEGRA 20 /* NVIDIA Tegra internal UART */ 48#define PORT_TEGRA 20 /* NVIDIA Tegra internal UART */
49#define PORT_MAX_8250 20 /* max port ID */ 49#define PORT_XR17D15X 21 /* Exar XR17D15x UART */
50#define PORT_MAX_8250 21 /* max port ID */
50 51
51/* 52/*
52 * ARM specific type numbers. These are not currently guaranteed 53 * ARM specific type numbers. These are not currently guaranteed
@@ -300,6 +301,7 @@ struct uart_port {
300 void (*set_termios)(struct uart_port *, 301 void (*set_termios)(struct uart_port *,
301 struct ktermios *new, 302 struct ktermios *new,
302 struct ktermios *old); 303 struct ktermios *old);
304 int (*handle_irq)(struct uart_port *);
303 void (*pm)(struct uart_port *, unsigned int state, 305 void (*pm)(struct uart_port *, unsigned int state,
304 unsigned int old); 306 unsigned int old);
305 unsigned int irq; /* irq number */ 307 unsigned int irq; /* irq number */
@@ -317,9 +319,7 @@ struct uart_port {
317#define UPIO_MEM32 (3) 319#define UPIO_MEM32 (3)
318#define UPIO_AU (4) /* Au1x00 type IO */ 320#define UPIO_AU (4) /* Au1x00 type IO */
319#define UPIO_TSI (5) /* Tsi108/109 type IO */ 321#define UPIO_TSI (5) /* Tsi108/109 type IO */
320#define UPIO_DWAPB (6) /* DesignWare APB UART */ 322#define UPIO_RM9000 (6) /* RM9000 type IO */
321#define UPIO_RM9000 (7) /* RM9000 type IO */
322#define UPIO_DWAPB32 (8) /* DesignWare APB UART (32 bit accesses) */
323 323
324 unsigned int read_status_mask; /* driver specific */ 324 unsigned int read_status_mask; /* driver specific */
325 unsigned int ignore_status_mask; /* driver specific */ 325 unsigned int ignore_status_mask; /* driver specific */
@@ -350,6 +350,7 @@ struct uart_port {
350#define UPF_MAGIC_MULTIPLIER ((__force upf_t) (1 << 16)) 350#define UPF_MAGIC_MULTIPLIER ((__force upf_t) (1 << 16))
351#define UPF_CONS_FLOW ((__force upf_t) (1 << 23)) 351#define UPF_CONS_FLOW ((__force upf_t) (1 << 23))
352#define UPF_SHARE_IRQ ((__force upf_t) (1 << 24)) 352#define UPF_SHARE_IRQ ((__force upf_t) (1 << 24))
353#define UPF_EXAR_EFR ((__force upf_t) (1 << 25))
353/* The exact UART type is known and should not be probed. */ 354/* The exact UART type is known and should not be probed. */
354#define UPF_FIXED_TYPE ((__force upf_t) (1 << 27)) 355#define UPF_FIXED_TYPE ((__force upf_t) (1 << 27))
355#define UPF_BOOT_AUTOCONF ((__force upf_t) (1 << 28)) 356#define UPF_BOOT_AUTOCONF ((__force upf_t) (1 << 28))
@@ -384,7 +385,6 @@ struct uart_state {
384 int pm_state; 385 int pm_state;
385 struct circ_buf xmit; 386 struct circ_buf xmit;
386 387
387 struct tasklet_struct tlet;
388 struct uart_port *uart_port; 388 struct uart_port *uart_port;
389}; 389};
390 390
diff --git a/include/linux/serial_reg.h b/include/linux/serial_reg.h
index c75bda37c18e..8ce70d76f836 100644
--- a/include/linux/serial_reg.h
+++ b/include/linux/serial_reg.h
@@ -152,6 +152,7 @@
152 * LCR=0xBF (or DLAB=1 for 16C660) 152 * LCR=0xBF (or DLAB=1 for 16C660)
153 */ 153 */
154#define UART_EFR 2 /* I/O: Extended Features Register */ 154#define UART_EFR 2 /* I/O: Extended Features Register */
155#define UART_XR_EFR 9 /* I/O: Extended Features Register (XR17D15x) */
155#define UART_EFR_CTS 0x80 /* CTS flow control */ 156#define UART_EFR_CTS 0x80 /* CTS flow control */
156#define UART_EFR_RTS 0x40 /* RTS flow control */ 157#define UART_EFR_RTS 0x40 /* RTS flow control */
157#define UART_EFR_SCD 0x20 /* Special character detect */ 158#define UART_EFR_SCD 0x20 /* Special character detect */
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/sh_eth.h b/include/linux/sh_eth.h
new file mode 100644
index 000000000000..2076acf8294d
--- /dev/null
+++ b/include/linux/sh_eth.h
@@ -0,0 +1,25 @@
1#ifndef __ASM_SH_ETH_H__
2#define __ASM_SH_ETH_H__
3
4#include <linux/phy.h>
5
6enum {EDMAC_LITTLE_ENDIAN, EDMAC_BIG_ENDIAN};
7enum {
8 SH_ETH_REG_GIGABIT,
9 SH_ETH_REG_FAST_SH4,
10 SH_ETH_REG_FAST_SH3_SH2
11};
12
13struct sh_eth_plat_data {
14 int phy;
15 int edmac_endian;
16 int register_type;
17 phy_interface_t phy_interface;
18 void (*set_mdio_gate)(void *addr);
19
20 unsigned char mac_addr[6];
21 unsigned no_ether_link:1;
22 unsigned ether_link_active_low:1;
23};
24
25#endif
diff --git a/include/linux/shm.h b/include/linux/shm.h
index 7d27ffde0190..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 */
diff --git a/include/linux/shmem_fs.h b/include/linux/shmem_fs.h
index aa08fa8fd79b..9291ac3cc627 100644
--- a/include/linux/shmem_fs.h
+++ b/include/linux/shmem_fs.h
@@ -8,22 +8,15 @@
8 8
9/* inode in-kernel data */ 9/* inode in-kernel data */
10 10
11#define SHMEM_NR_DIRECT 16
12
13#define SHMEM_SYMLINK_INLINE_LEN (SHMEM_NR_DIRECT * sizeof(swp_entry_t))
14
15struct shmem_inode_info { 11struct shmem_inode_info {
16 spinlock_t lock; 12 spinlock_t lock;
17 unsigned long flags; 13 unsigned long flags;
18 unsigned long alloced; /* data pages alloced to file */ 14 unsigned long alloced; /* data pages alloced to file */
19 unsigned long swapped; /* subtotal assigned to swap */
20 unsigned long next_index; /* highest alloced index + 1 */
21 struct shared_policy policy; /* NUMA memory alloc policy */
22 struct page *i_indirect; /* top indirect blocks page */
23 union { 15 union {
24 swp_entry_t i_direct[SHMEM_NR_DIRECT]; /* first blocks */ 16 unsigned long swapped; /* subtotal assigned to swap */
25 char inline_symlink[SHMEM_SYMLINK_INLINE_LEN]; 17 char *symlink; /* unswappable short symlink */
26 }; 18 };
19 struct shared_policy policy; /* NUMA memory alloc policy */
27 struct list_head swaplist; /* chain of maybes on swap */ 20 struct list_head swaplist; /* chain of maybes on swap */
28 struct list_head xattr_list; /* list of shmem_xattr */ 21 struct list_head xattr_list; /* list of shmem_xattr */
29 struct inode vfs_inode; 22 struct inode vfs_inode;
@@ -49,7 +42,7 @@ static inline struct shmem_inode_info *SHMEM_I(struct inode *inode)
49/* 42/*
50 * Functions in mm/shmem.c called directly from elsewhere: 43 * Functions in mm/shmem.c called directly from elsewhere:
51 */ 44 */
52extern int init_tmpfs(void); 45extern int shmem_init(void);
53extern 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);
54extern struct file *shmem_file_setup(const char *name, 47extern struct file *shmem_file_setup(const char *name,
55 loff_t size, unsigned long flags); 48 loff_t size, unsigned long flags);
@@ -59,8 +52,6 @@ extern struct page *shmem_read_mapping_page_gfp(struct address_space *mapping,
59 pgoff_t index, gfp_t gfp_mask); 52 pgoff_t index, gfp_t gfp_mask);
60extern void shmem_truncate_range(struct inode *inode, loff_t start, loff_t end); 53extern void shmem_truncate_range(struct inode *inode, loff_t start, loff_t end);
61extern int shmem_unuse(swp_entry_t entry, struct page *page); 54extern int shmem_unuse(swp_entry_t entry, struct page *page);
62extern void mem_cgroup_get_shmem_target(struct inode *inode, pgoff_t pgoff,
63 struct page **pagep, swp_entry_t *ent);
64 55
65static inline struct page *shmem_read_mapping_page( 56static inline struct page *shmem_read_mapping_page(
66 struct address_space *mapping, pgoff_t index) 57 struct address_space *mapping, pgoff_t index)
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
index 7b996ed86d5b..6a6b352326d7 100644
--- a/include/linux/skbuff.h
+++ b/include/linux/skbuff.h
@@ -29,6 +29,7 @@
29#include <linux/rcupdate.h> 29#include <linux/rcupdate.h>
30#include <linux/dmaengine.h> 30#include <linux/dmaengine.h>
31#include <linux/hrtimer.h> 31#include <linux/hrtimer.h>
32#include <linux/dma-mapping.h>
32 33
33/* Don't change this without changing skb_csum_unnecessary! */ 34/* Don't change this without changing skb_csum_unnecessary! */
34#define CHECKSUM_NONE 0 35#define CHECKSUM_NONE 0
@@ -45,6 +46,11 @@
45#define SKB_MAX_HEAD(X) (SKB_MAX_ORDER((X), 0)) 46#define SKB_MAX_HEAD(X) (SKB_MAX_ORDER((X), 0))
46#define SKB_MAX_ALLOC (SKB_MAX_ORDER(0, 2)) 47#define SKB_MAX_ALLOC (SKB_MAX_ORDER(0, 2))
47 48
49/* return minimum truesize of one skb containing X bytes of data */
50#define SKB_TRUESIZE(X) ((X) + \
51 SKB_DATA_ALIGN(sizeof(struct sk_buff)) + \
52 SKB_DATA_ALIGN(sizeof(struct skb_shared_info)))
53
48/* A. Checksumming of received packets by device. 54/* A. Checksumming of received packets by device.
49 * 55 *
50 * NONE: device failed to checksum this packet. 56 * NONE: device failed to checksum this packet.
@@ -134,7 +140,9 @@ struct sk_buff;
134typedef struct skb_frag_struct skb_frag_t; 140typedef struct skb_frag_struct skb_frag_t;
135 141
136struct skb_frag_struct { 142struct skb_frag_struct {
137 struct page *page; 143 struct {
144 struct page *p;
145 } page;
138#if (BITS_PER_LONG > 32) || (PAGE_SIZE >= 65536) 146#if (BITS_PER_LONG > 32) || (PAGE_SIZE >= 65536)
139 __u32 page_offset; 147 __u32 page_offset;
140 __u32 size; 148 __u32 size;
@@ -144,6 +152,26 @@ struct skb_frag_struct {
144#endif 152#endif
145}; 153};
146 154
155static inline unsigned int skb_frag_size(const skb_frag_t *frag)
156{
157 return frag->size;
158}
159
160static inline void skb_frag_size_set(skb_frag_t *frag, unsigned int size)
161{
162 frag->size = size;
163}
164
165static inline void skb_frag_size_add(skb_frag_t *frag, int delta)
166{
167 frag->size += delta;
168}
169
170static inline void skb_frag_size_sub(skb_frag_t *frag, int delta)
171{
172 frag->size -= delta;
173}
174
147#define HAVE_HW_TIME_STAMP 175#define HAVE_HW_TIME_STAMP
148 176
149/** 177/**
@@ -322,6 +350,8 @@ typedef unsigned char *sk_buff_data_t;
322 * @queue_mapping: Queue mapping for multiqueue devices 350 * @queue_mapping: Queue mapping for multiqueue devices
323 * @ndisc_nodetype: router type (from link layer) 351 * @ndisc_nodetype: router type (from link layer)
324 * @ooo_okay: allow the mapping of a socket to a queue to be changed 352 * @ooo_okay: allow the mapping of a socket to a queue to be changed
353 * @l4_rxhash: indicate rxhash is a canonical 4-tuple hash over transport
354 * ports.
325 * @dma_cookie: a cookie to one of several possible DMA operations 355 * @dma_cookie: a cookie to one of several possible DMA operations
326 * done by skb DMA functions 356 * done by skb DMA functions
327 * @secmark: security marking 357 * @secmark: security marking
@@ -414,6 +444,7 @@ struct sk_buff {
414 __u8 ndisc_nodetype:2; 444 __u8 ndisc_nodetype:2;
415#endif 445#endif
416 __u8 ooo_okay:1; 446 __u8 ooo_okay:1;
447 __u8 l4_rxhash:1;
417 kmemcheck_bitfield_end(flags2); 448 kmemcheck_bitfield_end(flags2);
418 449
419 /* 0/13 bit hole */ 450 /* 0/13 bit hole */
@@ -521,9 +552,11 @@ static inline struct sk_buff *alloc_skb_fclone(unsigned int size,
521 return __alloc_skb(size, priority, 1, NUMA_NO_NODE); 552 return __alloc_skb(size, priority, 1, NUMA_NO_NODE);
522} 553}
523 554
555extern void skb_recycle(struct sk_buff *skb);
524extern bool skb_recycle_check(struct sk_buff *skb, int skb_size); 556extern bool skb_recycle_check(struct sk_buff *skb, int skb_size);
525 557
526extern struct sk_buff *skb_morph(struct sk_buff *dst, struct sk_buff *src); 558extern struct sk_buff *skb_morph(struct sk_buff *dst, struct sk_buff *src);
559extern int skb_copy_ubufs(struct sk_buff *skb, gfp_t gfp_mask);
527extern struct sk_buff *skb_clone(struct sk_buff *skb, 560extern struct sk_buff *skb_clone(struct sk_buff *skb,
528 gfp_t priority); 561 gfp_t priority);
529extern struct sk_buff *skb_copy(const struct sk_buff *skb, 562extern struct sk_buff *skb_copy(const struct sk_buff *skb,
@@ -572,11 +605,11 @@ extern unsigned int skb_find_text(struct sk_buff *skb, unsigned int from,
572 unsigned int to, struct ts_config *config, 605 unsigned int to, struct ts_config *config,
573 struct ts_state *state); 606 struct ts_state *state);
574 607
575extern __u32 __skb_get_rxhash(struct sk_buff *skb); 608extern void __skb_get_rxhash(struct sk_buff *skb);
576static inline __u32 skb_get_rxhash(struct sk_buff *skb) 609static inline __u32 skb_get_rxhash(struct sk_buff *skb)
577{ 610{
578 if (!skb->rxhash) 611 if (!skb->rxhash)
579 skb->rxhash = __skb_get_rxhash(skb); 612 __skb_get_rxhash(skb);
580 613
581 return skb->rxhash; 614 return skb->rxhash;
582} 615}
@@ -822,9 +855,9 @@ static inline struct sk_buff *skb_unshare(struct sk_buff *skb,
822 * The reference count is not incremented and the reference is therefore 855 * The reference count is not incremented and the reference is therefore
823 * volatile. Use with caution. 856 * volatile. Use with caution.
824 */ 857 */
825static inline struct sk_buff *skb_peek(struct sk_buff_head *list_) 858static inline struct sk_buff *skb_peek(const struct sk_buff_head *list_)
826{ 859{
827 struct sk_buff *list = ((struct sk_buff *)list_)->next; 860 struct sk_buff *list = ((const struct sk_buff *)list_)->next;
828 if (list == (struct sk_buff *)list_) 861 if (list == (struct sk_buff *)list_)
829 list = NULL; 862 list = NULL;
830 return list; 863 return list;
@@ -843,9 +876,9 @@ static inline struct sk_buff *skb_peek(struct sk_buff_head *list_)
843 * The reference count is not incremented and the reference is therefore 876 * The reference count is not incremented and the reference is therefore
844 * volatile. Use with caution. 877 * volatile. Use with caution.
845 */ 878 */
846static inline struct sk_buff *skb_peek_tail(struct sk_buff_head *list_) 879static inline struct sk_buff *skb_peek_tail(const struct sk_buff_head *list_)
847{ 880{
848 struct sk_buff *list = ((struct sk_buff *)list_)->prev; 881 struct sk_buff *list = ((const struct sk_buff *)list_)->prev;
849 if (list == (struct sk_buff *)list_) 882 if (list == (struct sk_buff *)list_)
850 list = NULL; 883 list = NULL;
851 return list; 884 return list;
@@ -1122,18 +1155,51 @@ static inline int skb_pagelen(const struct sk_buff *skb)
1122 int i, len = 0; 1155 int i, len = 0;
1123 1156
1124 for (i = (int)skb_shinfo(skb)->nr_frags - 1; i >= 0; i--) 1157 for (i = (int)skb_shinfo(skb)->nr_frags - 1; i >= 0; i--)
1125 len += skb_shinfo(skb)->frags[i].size; 1158 len += skb_frag_size(&skb_shinfo(skb)->frags[i]);
1126 return len + skb_headlen(skb); 1159 return len + skb_headlen(skb);
1127} 1160}
1128 1161
1129static inline void skb_fill_page_desc(struct sk_buff *skb, int i, 1162/**
1130 struct page *page, int off, int size) 1163 * __skb_fill_page_desc - initialise a paged fragment in an skb
1164 * @skb: buffer containing fragment to be initialised
1165 * @i: paged fragment index to initialise
1166 * @page: the page to use for this fragment
1167 * @off: the offset to the data with @page
1168 * @size: the length of the data
1169 *
1170 * Initialises the @i'th fragment of @skb to point to &size bytes at
1171 * offset @off within @page.
1172 *
1173 * Does not take any additional reference on the fragment.
1174 */
1175static inline void __skb_fill_page_desc(struct sk_buff *skb, int i,
1176 struct page *page, int off, int size)
1131{ 1177{
1132 skb_frag_t *frag = &skb_shinfo(skb)->frags[i]; 1178 skb_frag_t *frag = &skb_shinfo(skb)->frags[i];
1133 1179
1134 frag->page = page; 1180 frag->page.p = page;
1135 frag->page_offset = off; 1181 frag->page_offset = off;
1136 frag->size = size; 1182 skb_frag_size_set(frag, size);
1183}
1184
1185/**
1186 * skb_fill_page_desc - initialise a paged fragment in an skb
1187 * @skb: buffer containing fragment to be initialised
1188 * @i: paged fragment index to initialise
1189 * @page: the page to use for this fragment
1190 * @off: the offset to the data with @page
1191 * @size: the length of the data
1192 *
1193 * As per __skb_fill_page_desc() -- initialises the @i'th fragment of
1194 * @skb to point to &size bytes at offset @off within @page. In
1195 * addition updates @skb such that @i is the last fragment.
1196 *
1197 * Does not take any additional reference on the fragment.
1198 */
1199static inline void skb_fill_page_desc(struct sk_buff *skb, int i,
1200 struct page *page, int off, int size)
1201{
1202 __skb_fill_page_desc(skb, i, page, off, size);
1137 skb_shinfo(skb)->nr_frags = i + 1; 1203 skb_shinfo(skb)->nr_frags = i + 1;
1138} 1204}
1139 1205
@@ -1628,6 +1694,137 @@ static inline void netdev_free_page(struct net_device *dev, struct page *page)
1628} 1694}
1629 1695
1630/** 1696/**
1697 * skb_frag_page - retrieve the page refered to by a paged fragment
1698 * @frag: the paged fragment
1699 *
1700 * Returns the &struct page associated with @frag.
1701 */
1702static inline struct page *skb_frag_page(const skb_frag_t *frag)
1703{
1704 return frag->page.p;
1705}
1706
1707/**
1708 * __skb_frag_ref - take an addition reference on a paged fragment.
1709 * @frag: the paged fragment
1710 *
1711 * Takes an additional reference on the paged fragment @frag.
1712 */
1713static inline void __skb_frag_ref(skb_frag_t *frag)
1714{
1715 get_page(skb_frag_page(frag));
1716}
1717
1718/**
1719 * skb_frag_ref - take an addition reference on a paged fragment of an skb.
1720 * @skb: the buffer
1721 * @f: the fragment offset.
1722 *
1723 * Takes an additional reference on the @f'th paged fragment of @skb.
1724 */
1725static inline void skb_frag_ref(struct sk_buff *skb, int f)
1726{
1727 __skb_frag_ref(&skb_shinfo(skb)->frags[f]);
1728}
1729
1730/**
1731 * __skb_frag_unref - release a reference on a paged fragment.
1732 * @frag: the paged fragment
1733 *
1734 * Releases a reference on the paged fragment @frag.
1735 */
1736static inline void __skb_frag_unref(skb_frag_t *frag)
1737{
1738 put_page(skb_frag_page(frag));
1739}
1740
1741/**
1742 * skb_frag_unref - release a reference on a paged fragment of an skb.
1743 * @skb: the buffer
1744 * @f: the fragment offset
1745 *
1746 * Releases a reference on the @f'th paged fragment of @skb.
1747 */
1748static inline void skb_frag_unref(struct sk_buff *skb, int f)
1749{
1750 __skb_frag_unref(&skb_shinfo(skb)->frags[f]);
1751}
1752
1753/**
1754 * skb_frag_address - gets the address of the data contained in a paged fragment
1755 * @frag: the paged fragment buffer
1756 *
1757 * Returns the address of the data within @frag. The page must already
1758 * be mapped.
1759 */
1760static inline void *skb_frag_address(const skb_frag_t *frag)
1761{
1762 return page_address(skb_frag_page(frag)) + frag->page_offset;
1763}
1764
1765/**
1766 * skb_frag_address_safe - gets the address of the data contained in a paged fragment
1767 * @frag: the paged fragment buffer
1768 *
1769 * Returns the address of the data within @frag. Checks that the page
1770 * is mapped and returns %NULL otherwise.
1771 */
1772static inline void *skb_frag_address_safe(const skb_frag_t *frag)
1773{
1774 void *ptr = page_address(skb_frag_page(frag));
1775 if (unlikely(!ptr))
1776 return NULL;
1777
1778 return ptr + frag->page_offset;
1779}
1780
1781/**
1782 * __skb_frag_set_page - sets the page contained in a paged fragment
1783 * @frag: the paged fragment
1784 * @page: the page to set
1785 *
1786 * Sets the fragment @frag to contain @page.
1787 */
1788static inline void __skb_frag_set_page(skb_frag_t *frag, struct page *page)
1789{
1790 frag->page.p = page;
1791}
1792
1793/**
1794 * skb_frag_set_page - sets the page contained in a paged fragment of an skb
1795 * @skb: the buffer
1796 * @f: the fragment offset
1797 * @page: the page to set
1798 *
1799 * Sets the @f'th fragment of @skb to contain @page.
1800 */
1801static inline void skb_frag_set_page(struct sk_buff *skb, int f,
1802 struct page *page)
1803{
1804 __skb_frag_set_page(&skb_shinfo(skb)->frags[f], page);
1805}
1806
1807/**
1808 * skb_frag_dma_map - maps a paged fragment via the DMA API
1809 * @device: the device to map the fragment to
1810 * @frag: the paged fragment to map
1811 * @offset: the offset within the fragment (starting at the
1812 * fragment's own offset)
1813 * @size: the number of bytes to map
1814 * @direction: the direction of the mapping (%PCI_DMA_*)
1815 *
1816 * Maps the page associated with @frag to @device.
1817 */
1818static inline dma_addr_t skb_frag_dma_map(struct device *dev,
1819 const skb_frag_t *frag,
1820 size_t offset, size_t size,
1821 enum dma_data_direction dir)
1822{
1823 return dma_map_page(dev, skb_frag_page(frag),
1824 frag->page_offset + offset, size, dir);
1825}
1826
1827/**
1631 * skb_clone_writable - is the header of a clone writable 1828 * skb_clone_writable - is the header of a clone writable
1632 * @skb: buffer to check 1829 * @skb: buffer to check
1633 * @len: length up to which to write 1830 * @len: length up to which to write
@@ -1635,7 +1832,7 @@ static inline void netdev_free_page(struct net_device *dev, struct page *page)
1635 * Returns true if modifying the header part of the cloned buffer 1832 * Returns true if modifying the header part of the cloned buffer
1636 * does not requires the data to be copied. 1833 * does not requires the data to be copied.
1637 */ 1834 */
1638static inline int skb_clone_writable(struct sk_buff *skb, unsigned int len) 1835static inline int skb_clone_writable(const struct sk_buff *skb, unsigned int len)
1639{ 1836{
1640 return !skb_header_cloned(skb) && 1837 return !skb_header_cloned(skb) &&
1641 skb_headroom(skb) + len <= skb->hdr_len; 1838 skb_headroom(skb) + len <= skb->hdr_len;
@@ -1729,13 +1926,13 @@ static inline int skb_add_data(struct sk_buff *skb,
1729} 1926}
1730 1927
1731static inline int skb_can_coalesce(struct sk_buff *skb, int i, 1928static inline int skb_can_coalesce(struct sk_buff *skb, int i,
1732 struct page *page, int off) 1929 const struct page *page, int off)
1733{ 1930{
1734 if (i) { 1931 if (i) {
1735 struct skb_frag_struct *frag = &skb_shinfo(skb)->frags[i - 1]; 1932 const struct skb_frag_struct *frag = &skb_shinfo(skb)->frags[i - 1];
1736 1933
1737 return page == frag->page && 1934 return page == skb_frag_page(frag) &&
1738 off == frag->page_offset + frag->size; 1935 off == frag->page_offset + skb_frag_size(frag);
1739 } 1936 }
1740 return 0; 1937 return 0;
1741} 1938}
@@ -2019,8 +2216,13 @@ static inline bool skb_defer_rx_timestamp(struct sk_buff *skb)
2019/** 2216/**
2020 * skb_complete_tx_timestamp() - deliver cloned skb with tx timestamps 2217 * skb_complete_tx_timestamp() - deliver cloned skb with tx timestamps
2021 * 2218 *
2219 * PHY drivers may accept clones of transmitted packets for
2220 * timestamping via their phy_driver.txtstamp method. These drivers
2221 * must call this function to return the skb back to the stack, with
2222 * or without a timestamp.
2223 *
2022 * @skb: clone of the the original outgoing packet 2224 * @skb: clone of the the original outgoing packet
2023 * @hwtstamps: hardware time stamps 2225 * @hwtstamps: hardware time stamps, may be NULL if not available
2024 * 2226 *
2025 */ 2227 */
2026void skb_complete_tx_timestamp(struct sk_buff *skb, 2228void skb_complete_tx_timestamp(struct sk_buff *skb,
@@ -2256,7 +2458,8 @@ static inline bool skb_warn_if_lro(const struct sk_buff *skb)
2256{ 2458{
2257 /* LRO sets gso_size but not gso_type, whereas if GSO is really 2459 /* LRO sets gso_size but not gso_type, whereas if GSO is really
2258 * wanted then gso_type will be set. */ 2460 * wanted then gso_type will be set. */
2259 struct skb_shared_info *shinfo = skb_shinfo(skb); 2461 const struct skb_shared_info *shinfo = skb_shinfo(skb);
2462
2260 if (skb_is_nonlinear(skb) && shinfo->gso_size != 0 && 2463 if (skb_is_nonlinear(skb) && shinfo->gso_size != 0 &&
2261 unlikely(shinfo->gso_type == 0)) { 2464 unlikely(shinfo->gso_type == 0)) {
2262 __skb_warn_lro_forwarding(skb); 2465 __skb_warn_lro_forwarding(skb);
@@ -2280,7 +2483,7 @@ static inline void skb_forward_csum(struct sk_buff *skb)
2280 * Instead of forcing ip_summed to CHECKSUM_NONE, we can 2483 * Instead of forcing ip_summed to CHECKSUM_NONE, we can
2281 * use this helper, to document places where we make this assertion. 2484 * use this helper, to document places where we make this assertion.
2282 */ 2485 */
2283static inline void skb_checksum_none_assert(struct sk_buff *skb) 2486static inline void skb_checksum_none_assert(const struct sk_buff *skb)
2284{ 2487{
2285#ifdef DEBUG 2488#ifdef DEBUG
2286 BUG_ON(skb->ip_summed != CHECKSUM_NONE); 2489 BUG_ON(skb->ip_summed != CHECKSUM_NONE);
@@ -2289,5 +2492,25 @@ static inline void skb_checksum_none_assert(struct sk_buff *skb)
2289 2492
2290bool skb_partial_csum_set(struct sk_buff *skb, u16 start, u16 off); 2493bool skb_partial_csum_set(struct sk_buff *skb, u16 start, u16 off);
2291 2494
2495static inline bool skb_is_recycleable(const struct sk_buff *skb, int skb_size)
2496{
2497 if (irqs_disabled())
2498 return false;
2499
2500 if (skb_shinfo(skb)->tx_flags & SKBTX_DEV_ZEROCOPY)
2501 return false;
2502
2503 if (skb_is_nonlinear(skb) || skb->fclone != SKB_FCLONE_UNAVAILABLE)
2504 return false;
2505
2506 skb_size = SKB_DATA_ALIGN(skb_size + NET_SKB_PAD);
2507 if (skb_end_pointer(skb) - skb->head < skb_size)
2508 return false;
2509
2510 if (skb_shared(skb) || skb_cloned(skb))
2511 return false;
2512
2513 return true;
2514}
2292#endif /* __KERNEL__ */ 2515#endif /* __KERNEL__ */
2293#endif /* _LINUX_SKBUFF_H */ 2516#endif /* _LINUX_SKBUFF_H */
diff --git a/include/linux/slub_def.h b/include/linux/slub_def.h
index 4b35c06dfbc5..a32bcfdc7834 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,14 +32,19 @@ 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 */
39 CPU_PARTIAL_ALLOC, /* Used cpu partial on alloc */
40 CPU_PARTIAL_FREE, /* USed cpu partial on free */
36 NR_SLUB_STAT_ITEMS }; 41 NR_SLUB_STAT_ITEMS };
37 42
38struct kmem_cache_cpu { 43struct kmem_cache_cpu {
39 void **freelist; /* Pointer to next available object */ 44 void **freelist; /* Pointer to next available object */
40 unsigned long tid; /* Globally unique transaction id */ 45 unsigned long tid; /* Globally unique transaction id */
41 struct page *page; /* The slab from which we are allocating */ 46 struct page *page; /* The slab from which we are allocating */
47 struct page *partial; /* Partially allocated frozen slabs */
42 int node; /* The node of the page (or -1 for debug) */ 48 int node; /* The node of the page (or -1 for debug) */
43#ifdef CONFIG_SLUB_STATS 49#ifdef CONFIG_SLUB_STATS
44 unsigned stat[NR_SLUB_STAT_ITEMS]; 50 unsigned stat[NR_SLUB_STAT_ITEMS];
@@ -76,6 +82,7 @@ struct kmem_cache {
76 int size; /* The size of an object including meta data */ 82 int size; /* The size of an object including meta data */
77 int objsize; /* The size of an object without meta data */ 83 int objsize; /* The size of an object without meta data */
78 int offset; /* Free pointer offset. */ 84 int offset; /* Free pointer offset. */
85 int cpu_partial; /* Number of per cpu partial objects to keep around */
79 struct kmem_cache_order_objects oo; 86 struct kmem_cache_order_objects oo;
80 87
81 /* Allocation and freeing of slabs */ 88 /* Allocation and freeing of slabs */
diff --git a/include/linux/snmp.h b/include/linux/snmp.h
index 12b2b18e50c1..e16557a357e5 100644
--- a/include/linux/snmp.h
+++ b/include/linux/snmp.h
@@ -231,6 +231,8 @@ enum
231 LINUX_MIB_TCPDEFERACCEPTDROP, 231 LINUX_MIB_TCPDEFERACCEPTDROP,
232 LINUX_MIB_IPRPFILTER, /* IP Reverse Path Filter (rp_filter) */ 232 LINUX_MIB_IPRPFILTER, /* IP Reverse Path Filter (rp_filter) */
233 LINUX_MIB_TCPTIMEWAITOVERFLOW, /* TCPTimeWaitOverflow */ 233 LINUX_MIB_TCPTIMEWAITOVERFLOW, /* TCPTimeWaitOverflow */
234 LINUX_MIB_TCPREQQFULLDOCOOKIES, /* TCPReqQFullDoCookies */
235 LINUX_MIB_TCPREQQFULLDROP, /* TCPReqQFullDrop */
234 __LINUX_MIB_MAX 236 __LINUX_MIB_MAX
235}; 237};
236 238
diff --git a/include/linux/socket.h b/include/linux/socket.h
index e17f82266639..d0e77f607a79 100644
--- a/include/linux/socket.h
+++ b/include/linux/socket.h
@@ -8,8 +8,10 @@
8#define _K_SS_ALIGNSIZE (__alignof__ (struct sockaddr *)) 8#define _K_SS_ALIGNSIZE (__alignof__ (struct sockaddr *))
9 /* Implementation specific desired alignment */ 9 /* Implementation specific desired alignment */
10 10
11typedef unsigned short __kernel_sa_family_t;
12
11struct __kernel_sockaddr_storage { 13struct __kernel_sockaddr_storage {
12 unsigned short ss_family; /* address family */ 14 __kernel_sa_family_t ss_family; /* address family */
13 /* Following field(s) are implementation specific */ 15 /* Following field(s) are implementation specific */
14 char __data[_K_SS_MAXSIZE - sizeof(unsigned short)]; 16 char __data[_K_SS_MAXSIZE - sizeof(unsigned short)];
15 /* space to achieve desired size, */ 17 /* space to achieve desired size, */
@@ -35,7 +37,7 @@ struct seq_file;
35extern void socket_seq_show(struct seq_file *seq); 37extern void socket_seq_show(struct seq_file *seq);
36#endif 38#endif
37 39
38typedef unsigned short sa_family_t; 40typedef __kernel_sa_family_t sa_family_t;
39 41
40/* 42/*
41 * 1003.1g requires sa_family_t and that sa_data is char. 43 * 1003.1g requires sa_family_t and that sa_data is char.
diff --git a/include/linux/sungem_phy.h b/include/linux/sungem_phy.h
new file mode 100644
index 000000000000..bd9be9f59d3a
--- /dev/null
+++ b/include/linux/sungem_phy.h
@@ -0,0 +1,132 @@
1#ifndef __SUNGEM_PHY_H__
2#define __SUNGEM_PHY_H__
3
4struct mii_phy;
5
6/* Operations supported by any kind of PHY */
7struct mii_phy_ops
8{
9 int (*init)(struct mii_phy *phy);
10 int (*suspend)(struct mii_phy *phy);
11 int (*setup_aneg)(struct mii_phy *phy, u32 advertise);
12 int (*setup_forced)(struct mii_phy *phy, int speed, int fd);
13 int (*poll_link)(struct mii_phy *phy);
14 int (*read_link)(struct mii_phy *phy);
15 int (*enable_fiber)(struct mii_phy *phy, int autoneg);
16};
17
18/* Structure used to statically define an mii/gii based PHY */
19struct mii_phy_def
20{
21 u32 phy_id; /* Concatenated ID1 << 16 | ID2 */
22 u32 phy_id_mask; /* Significant bits */
23 u32 features; /* Ethtool SUPPORTED_* defines */
24 int magic_aneg; /* Autoneg does all speed test for us */
25 const char* name;
26 const struct mii_phy_ops* ops;
27};
28
29enum {
30 BCM54XX_COPPER,
31 BCM54XX_FIBER,
32 BCM54XX_GBIC,
33 BCM54XX_SGMII,
34 BCM54XX_UNKNOWN,
35};
36
37/* An instance of a PHY, partially borrowed from mii_if_info */
38struct mii_phy
39{
40 struct mii_phy_def* def;
41 u32 advertising;
42 int mii_id;
43
44 /* 1: autoneg enabled, 0: disabled */
45 int autoneg;
46
47 /* forced speed & duplex (no autoneg)
48 * partner speed & duplex & pause (autoneg)
49 */
50 int speed;
51 int duplex;
52 int pause;
53
54 /* Provided by host chip */
55 struct net_device *dev;
56 int (*mdio_read) (struct net_device *dev, int mii_id, int reg);
57 void (*mdio_write) (struct net_device *dev, int mii_id, int reg, int val);
58 void *platform_data;
59};
60
61/* Pass in a struct mii_phy with dev, mdio_read and mdio_write
62 * filled, the remaining fields will be filled on return
63 */
64extern int sungem_phy_probe(struct mii_phy *phy, int mii_id);
65
66
67/* MII definitions missing from mii.h */
68
69#define BMCR_SPD2 0x0040 /* Gigabit enable (bcm54xx) */
70#define LPA_PAUSE 0x0400
71
72/* More PHY registers (model specific) */
73
74/* MII BCM5201 MULTIPHY interrupt register */
75#define MII_BCM5201_INTERRUPT 0x1A
76#define MII_BCM5201_INTERRUPT_INTENABLE 0x4000
77
78#define MII_BCM5201_AUXMODE2 0x1B
79#define MII_BCM5201_AUXMODE2_LOWPOWER 0x0008
80
81#define MII_BCM5201_MULTIPHY 0x1E
82
83/* MII BCM5201 MULTIPHY register bits */
84#define MII_BCM5201_MULTIPHY_SERIALMODE 0x0002
85#define MII_BCM5201_MULTIPHY_SUPERISOLATE 0x0008
86
87/* MII BCM5221 Additional registers */
88#define MII_BCM5221_TEST 0x1f
89#define MII_BCM5221_TEST_ENABLE_SHADOWS 0x0080
90#define MII_BCM5221_SHDOW_AUX_STAT2 0x1b
91#define MII_BCM5221_SHDOW_AUX_STAT2_APD 0x0020
92#define MII_BCM5221_SHDOW_AUX_MODE4 0x1a
93#define MII_BCM5221_SHDOW_AUX_MODE4_IDDQMODE 0x0001
94#define MII_BCM5221_SHDOW_AUX_MODE4_CLKLOPWR 0x0004
95
96/* MII BCM5241 Additional registers */
97#define MII_BCM5241_SHDOW_AUX_MODE4_STANDBYPWR 0x0008
98
99/* MII BCM5400 1000-BASET Control register */
100#define MII_BCM5400_GB_CONTROL 0x09
101#define MII_BCM5400_GB_CONTROL_FULLDUPLEXCAP 0x0200
102
103/* MII BCM5400 AUXCONTROL register */
104#define MII_BCM5400_AUXCONTROL 0x18
105#define MII_BCM5400_AUXCONTROL_PWR10BASET 0x0004
106
107/* MII BCM5400 AUXSTATUS register */
108#define MII_BCM5400_AUXSTATUS 0x19
109#define MII_BCM5400_AUXSTATUS_LINKMODE_MASK 0x0700
110#define MII_BCM5400_AUXSTATUS_LINKMODE_SHIFT 8
111
112/* 1000BT control (Marvell & BCM54xx at least) */
113#define MII_1000BASETCONTROL 0x09
114#define MII_1000BASETCONTROL_FULLDUPLEXCAP 0x0200
115#define MII_1000BASETCONTROL_HALFDUPLEXCAP 0x0100
116
117/* Marvell 88E1011 PHY control */
118#define MII_M1011_PHY_SPEC_CONTROL 0x10
119#define MII_M1011_PHY_SPEC_CONTROL_MANUAL_MDIX 0x20
120#define MII_M1011_PHY_SPEC_CONTROL_AUTO_MDIX 0x40
121
122/* Marvell 88E1011 PHY status */
123#define MII_M1011_PHY_SPEC_STATUS 0x11
124#define MII_M1011_PHY_SPEC_STATUS_1000 0x8000
125#define MII_M1011_PHY_SPEC_STATUS_100 0x4000
126#define MII_M1011_PHY_SPEC_STATUS_SPD_MASK 0xc000
127#define MII_M1011_PHY_SPEC_STATUS_FULLDUPLEX 0x2000
128#define MII_M1011_PHY_SPEC_STATUS_RESOLVED 0x0800
129#define MII_M1011_PHY_SPEC_STATUS_TX_PAUSE 0x0008
130#define MII_M1011_PHY_SPEC_STATUS_RX_PAUSE 0x0004
131
132#endif /* __SUNGEM_PHY_H__ */
diff --git a/include/linux/sunrpc/clnt.h b/include/linux/sunrpc/clnt.h
index db7bcaf7c5bd..492486a74484 100644
--- a/include/linux/sunrpc/clnt.h
+++ b/include/linux/sunrpc/clnt.h
@@ -9,6 +9,7 @@
9#ifndef _LINUX_SUNRPC_CLNT_H 9#ifndef _LINUX_SUNRPC_CLNT_H
10#define _LINUX_SUNRPC_CLNT_H 10#define _LINUX_SUNRPC_CLNT_H
11 11
12#include <linux/types.h>
12#include <linux/socket.h> 13#include <linux/socket.h>
13#include <linux/in.h> 14#include <linux/in.h>
14#include <linux/in6.h> 15#include <linux/in6.h>
@@ -161,7 +162,7 @@ const char *rpc_peeraddr2str(struct rpc_clnt *, enum rpc_display_format_t);
161size_t rpc_ntop(const struct sockaddr *, char *, const size_t); 162size_t rpc_ntop(const struct sockaddr *, char *, const size_t);
162size_t rpc_pton(const char *, const size_t, 163size_t rpc_pton(const char *, const size_t,
163 struct sockaddr *, const size_t); 164 struct sockaddr *, const size_t);
164char * rpc_sockaddr2uaddr(const struct sockaddr *); 165char * rpc_sockaddr2uaddr(const struct sockaddr *, gfp_t);
165size_t rpc_uaddr2sockaddr(const char *, const size_t, 166size_t rpc_uaddr2sockaddr(const char *, const size_t,
166 struct sockaddr *, const size_t); 167 struct sockaddr *, const size_t);
167 168
@@ -218,7 +219,13 @@ static inline bool __rpc_cmp_addr6(const struct sockaddr *sap1,
218{ 219{
219 const struct sockaddr_in6 *sin1 = (const struct sockaddr_in6 *)sap1; 220 const struct sockaddr_in6 *sin1 = (const struct sockaddr_in6 *)sap1;
220 const struct sockaddr_in6 *sin2 = (const struct sockaddr_in6 *)sap2; 221 const struct sockaddr_in6 *sin2 = (const struct sockaddr_in6 *)sap2;
221 return ipv6_addr_equal(&sin1->sin6_addr, &sin2->sin6_addr); 222
223 if (!ipv6_addr_equal(&sin1->sin6_addr, &sin2->sin6_addr))
224 return false;
225 else if (ipv6_addr_type(&sin1->sin6_addr) & IPV6_ADDR_LINKLOCAL)
226 return sin1->sin6_scope_id == sin2->sin6_scope_id;
227
228 return true;
222} 229}
223 230
224static inline bool __rpc_copy_addr6(struct sockaddr *dst, 231static inline bool __rpc_copy_addr6(struct sockaddr *dst,
diff --git a/include/linux/sunrpc/rpc_pipe_fs.h b/include/linux/sunrpc/rpc_pipe_fs.h
index cf14db975da0..e4ea43058d8f 100644
--- a/include/linux/sunrpc/rpc_pipe_fs.h
+++ b/include/linux/sunrpc/rpc_pipe_fs.h
@@ -44,6 +44,8 @@ RPC_I(struct inode *inode)
44 return container_of(inode, struct rpc_inode, vfs_inode); 44 return container_of(inode, struct rpc_inode, vfs_inode);
45} 45}
46 46
47extern ssize_t rpc_pipe_generic_upcall(struct file *, struct rpc_pipe_msg *,
48 char __user *, size_t);
47extern int rpc_queue_upcall(struct inode *, struct rpc_pipe_msg *); 49extern int rpc_queue_upcall(struct inode *, struct rpc_pipe_msg *);
48 50
49struct rpc_clnt; 51struct rpc_clnt;
diff --git a/include/linux/sunrpc/svc.h b/include/linux/sunrpc/svc.h
index 223588a976a0..d8d5d93071b3 100644
--- a/include/linux/sunrpc/svc.h
+++ b/include/linux/sunrpc/svc.h
@@ -212,11 +212,6 @@ static inline void svc_putu32(struct kvec *iov, __be32 val)
212 iov->iov_len += sizeof(__be32); 212 iov->iov_len += sizeof(__be32);
213} 213}
214 214
215union svc_addr_u {
216 struct in_addr addr;
217 struct in6_addr addr6;
218};
219
220/* 215/*
221 * The context of a single thread, including the request currently being 216 * The context of a single thread, including the request currently being
222 * processed. 217 * processed.
@@ -225,8 +220,12 @@ struct svc_rqst {
225 struct list_head rq_list; /* idle list */ 220 struct list_head rq_list; /* idle list */
226 struct list_head rq_all; /* all threads list */ 221 struct list_head rq_all; /* all threads list */
227 struct svc_xprt * rq_xprt; /* transport ptr */ 222 struct svc_xprt * rq_xprt; /* transport ptr */
223
228 struct sockaddr_storage rq_addr; /* peer address */ 224 struct sockaddr_storage rq_addr; /* peer address */
229 size_t rq_addrlen; 225 size_t rq_addrlen;
226 struct sockaddr_storage rq_daddr; /* dest addr of request
227 * - reply from here */
228 size_t rq_daddrlen;
230 229
231 struct svc_serv * rq_server; /* RPC service definition */ 230 struct svc_serv * rq_server; /* RPC service definition */
232 struct svc_pool * rq_pool; /* thread pool */ 231 struct svc_pool * rq_pool; /* thread pool */
@@ -255,9 +254,6 @@ struct svc_rqst {
255 unsigned short 254 unsigned short
256 rq_secure : 1; /* secure port */ 255 rq_secure : 1; /* secure port */
257 256
258 union svc_addr_u rq_daddr; /* dest addr of request
259 * - reply from here */
260
261 void * rq_argp; /* decoded arguments */ 257 void * rq_argp; /* decoded arguments */
262 void * rq_resp; /* xdr'd results */ 258 void * rq_resp; /* xdr'd results */
263 void * rq_auth_data; /* flavor-specific data */ 259 void * rq_auth_data; /* flavor-specific data */
@@ -300,6 +296,21 @@ static inline struct sockaddr *svc_addr(const struct svc_rqst *rqst)
300 return (struct sockaddr *) &rqst->rq_addr; 296 return (struct sockaddr *) &rqst->rq_addr;
301} 297}
302 298
299static inline struct sockaddr_in *svc_daddr_in(const struct svc_rqst *rqst)
300{
301 return (struct sockaddr_in *) &rqst->rq_daddr;
302}
303
304static inline struct sockaddr_in6 *svc_daddr_in6(const struct svc_rqst *rqst)
305{
306 return (struct sockaddr_in6 *) &rqst->rq_daddr;
307}
308
309static inline struct sockaddr *svc_daddr(const struct svc_rqst *rqst)
310{
311 return (struct sockaddr *) &rqst->rq_daddr;
312}
313
303/* 314/*
304 * Check buffer bounds after decoding arguments 315 * Check buffer bounds after decoding arguments
305 */ 316 */
@@ -340,7 +351,8 @@ struct svc_deferred_req {
340 struct svc_xprt *xprt; 351 struct svc_xprt *xprt;
341 struct sockaddr_storage addr; /* where reply must go */ 352 struct sockaddr_storage addr; /* where reply must go */
342 size_t addrlen; 353 size_t addrlen;
343 union svc_addr_u daddr; /* where reply must come from */ 354 struct sockaddr_storage daddr; /* where reply must come from */
355 size_t daddrlen;
344 struct cache_deferred_req handle; 356 struct cache_deferred_req handle;
345 size_t xprt_hlen; 357 size_t xprt_hlen;
346 int argslen; 358 int argslen;
@@ -404,7 +416,7 @@ struct svc_procedure {
404struct svc_serv *svc_create(struct svc_program *, unsigned int, 416struct svc_serv *svc_create(struct svc_program *, unsigned int,
405 void (*shutdown)(struct svc_serv *)); 417 void (*shutdown)(struct svc_serv *));
406struct svc_rqst *svc_prepare_thread(struct svc_serv *serv, 418struct svc_rqst *svc_prepare_thread(struct svc_serv *serv,
407 struct svc_pool *pool); 419 struct svc_pool *pool, int node);
408void svc_exit_thread(struct svc_rqst *); 420void svc_exit_thread(struct svc_rqst *);
409struct svc_serv * svc_create_pooled(struct svc_program *, unsigned int, 421struct svc_serv * svc_create_pooled(struct svc_program *, unsigned int,
410 void (*shutdown)(struct svc_serv *), 422 void (*shutdown)(struct svc_serv *),
diff --git a/include/linux/suspend.h b/include/linux/suspend.h
index 6bbcef22e105..57a692432f8a 100644
--- a/include/linux/suspend.h
+++ b/include/linux/suspend.h
@@ -8,15 +8,18 @@
8#include <linux/mm.h> 8#include <linux/mm.h>
9#include <asm/errno.h> 9#include <asm/errno.h>
10 10
11#if defined(CONFIG_PM_SLEEP) && defined(CONFIG_VT) && defined(CONFIG_VT_CONSOLE) 11#ifdef CONFIG_VT
12extern void pm_set_vt_switch(int); 12extern void pm_set_vt_switch(int);
13extern int pm_prepare_console(void);
14extern void pm_restore_console(void);
15#else 13#else
16static inline void pm_set_vt_switch(int do_switch) 14static inline void pm_set_vt_switch(int do_switch)
17{ 15{
18} 16}
17#endif
19 18
19#ifdef CONFIG_VT_CONSOLE_SLEEP
20extern int pm_prepare_console(void);
21extern void pm_restore_console(void);
22#else
20static inline int pm_prepare_console(void) 23static inline int pm_prepare_console(void)
21{ 24{
22 return 0; 25 return 0;
@@ -34,6 +37,58 @@ typedef int __bitwise suspend_state_t;
34#define PM_SUSPEND_MEM ((__force suspend_state_t) 3) 37#define PM_SUSPEND_MEM ((__force suspend_state_t) 3)
35#define PM_SUSPEND_MAX ((__force suspend_state_t) 4) 38#define PM_SUSPEND_MAX ((__force suspend_state_t) 4)
36 39
40enum suspend_stat_step {
41 SUSPEND_FREEZE = 1,
42 SUSPEND_PREPARE,
43 SUSPEND_SUSPEND,
44 SUSPEND_SUSPEND_NOIRQ,
45 SUSPEND_RESUME_NOIRQ,
46 SUSPEND_RESUME
47};
48
49struct suspend_stats {
50 int success;
51 int fail;
52 int failed_freeze;
53 int failed_prepare;
54 int failed_suspend;
55 int failed_suspend_noirq;
56 int failed_resume;
57 int failed_resume_noirq;
58#define REC_FAILED_NUM 2
59 int last_failed_dev;
60 char failed_devs[REC_FAILED_NUM][40];
61 int last_failed_errno;
62 int errno[REC_FAILED_NUM];
63 int last_failed_step;
64 enum suspend_stat_step failed_steps[REC_FAILED_NUM];
65};
66
67extern struct suspend_stats suspend_stats;
68
69static inline void dpm_save_failed_dev(const char *name)
70{
71 strlcpy(suspend_stats.failed_devs[suspend_stats.last_failed_dev],
72 name,
73 sizeof(suspend_stats.failed_devs[0]));
74 suspend_stats.last_failed_dev++;
75 suspend_stats.last_failed_dev %= REC_FAILED_NUM;
76}
77
78static inline void dpm_save_failed_errno(int err)
79{
80 suspend_stats.errno[suspend_stats.last_failed_errno] = err;
81 suspend_stats.last_failed_errno++;
82 suspend_stats.last_failed_errno %= REC_FAILED_NUM;
83}
84
85static inline void dpm_save_failed_step(enum suspend_stat_step step)
86{
87 suspend_stats.failed_steps[suspend_stats.last_failed_step] = step;
88 suspend_stats.last_failed_step++;
89 suspend_stats.last_failed_step %= REC_FAILED_NUM;
90}
91
37/** 92/**
38 * struct platform_suspend_ops - Callbacks for managing platform dependent 93 * struct platform_suspend_ops - Callbacks for managing platform dependent
39 * system sleep states. 94 * system sleep states.
@@ -334,4 +389,38 @@ static inline void unlock_system_sleep(void)
334} 389}
335#endif 390#endif
336 391
392#ifdef CONFIG_ARCH_SAVE_PAGE_KEYS
393/*
394 * The ARCH_SAVE_PAGE_KEYS functions can be used by an architecture
395 * to save/restore additional information to/from the array of page
396 * frame numbers in the hibernation image. For s390 this is used to
397 * save and restore the storage key for each page that is included
398 * in the hibernation image.
399 */
400unsigned long page_key_additional_pages(unsigned long pages);
401int page_key_alloc(unsigned long pages);
402void page_key_free(void);
403void page_key_read(unsigned long *pfn);
404void page_key_memorize(unsigned long *pfn);
405void page_key_write(void *address);
406
407#else /* !CONFIG_ARCH_SAVE_PAGE_KEYS */
408
409static inline unsigned long page_key_additional_pages(unsigned long pages)
410{
411 return 0;
412}
413
414static inline int page_key_alloc(unsigned long pages)
415{
416 return 0;
417}
418
419static inline void page_key_free(void) {}
420static inline void page_key_read(unsigned long *pfn) {}
421static inline void page_key_memorize(unsigned long *pfn) {}
422static inline void page_key_write(void *address) {}
423
424#endif /* !CONFIG_ARCH_SAVE_PAGE_KEYS */
425
337#endif /* _LINUX_SUSPEND_H */ 426#endif /* _LINUX_SUSPEND_H */
diff --git a/include/linux/swap.h b/include/linux/swap.h
index 14d62490922e..c71f84bb62ec 100644
--- a/include/linux/swap.h
+++ b/include/linux/swap.h
@@ -252,6 +252,12 @@ static inline void lru_cache_add_file(struct page *page)
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 int __isolate_lru_page(struct page *page, int mode, int file); 254extern int __isolate_lru_page(struct page *page, int mode, int file);
255extern unsigned long try_to_free_mem_cgroup_pages(struct mem_cgroup *mem,
256 gfp_t gfp_mask, bool noswap);
257extern unsigned long mem_cgroup_shrink_node_zone(struct mem_cgroup *mem,
258 gfp_t gfp_mask, bool noswap,
259 struct zone *zone,
260 unsigned long *nr_scanned);
255extern unsigned long shrink_all_memory(unsigned long nr_pages); 261extern unsigned long shrink_all_memory(unsigned long nr_pages);
256extern int vm_swappiness; 262extern int vm_swappiness;
257extern int remove_mapping(struct address_space *mapping, struct page *page); 263extern int remove_mapping(struct address_space *mapping, struct page *page);
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/syscalls.h b/include/linux/syscalls.h
index 8c03b98df5f9..1ff0ec2a5e8d 100644
--- a/include/linux/syscalls.h
+++ b/include/linux/syscalls.h
@@ -702,9 +702,6 @@ asmlinkage long sys_sysctl(struct __sysctl_args __user *args);
702asmlinkage long sys_sysinfo(struct sysinfo __user *info); 702asmlinkage long sys_sysinfo(struct sysinfo __user *info);
703asmlinkage long sys_sysfs(int option, 703asmlinkage long sys_sysfs(int option,
704 unsigned long arg1, unsigned long arg2); 704 unsigned long arg1, unsigned long arg2);
705asmlinkage long sys_nfsservctl(int cmd,
706 struct nfsctl_arg __user *arg,
707 void __user *res);
708asmlinkage long sys_syslog(int type, char __user *buf, int len); 705asmlinkage long sys_syslog(int type, char __user *buf, int len);
709asmlinkage long sys_uselib(const char __user *library); 706asmlinkage long sys_uselib(const char __user *library);
710asmlinkage long sys_ni_syscall(void); 707asmlinkage long sys_ni_syscall(void);
diff --git a/include/linux/sysctl.h b/include/linux/sysctl.h
index 11684d9e6bd2..9a1ec10fd504 100644
--- a/include/linux/sysctl.h
+++ b/include/linux/sysctl.h
@@ -435,7 +435,7 @@ enum {
435 NET_IPV4_ROUTE_MAX_SIZE=5, 435 NET_IPV4_ROUTE_MAX_SIZE=5,
436 NET_IPV4_ROUTE_GC_MIN_INTERVAL=6, 436 NET_IPV4_ROUTE_GC_MIN_INTERVAL=6,
437 NET_IPV4_ROUTE_GC_TIMEOUT=7, 437 NET_IPV4_ROUTE_GC_TIMEOUT=7,
438 NET_IPV4_ROUTE_GC_INTERVAL=8, 438 NET_IPV4_ROUTE_GC_INTERVAL=8, /* obsolete since 2.6.38 */
439 NET_IPV4_ROUTE_REDIRECT_LOAD=9, 439 NET_IPV4_ROUTE_REDIRECT_LOAD=9,
440 NET_IPV4_ROUTE_REDIRECT_NUMBER=10, 440 NET_IPV4_ROUTE_REDIRECT_NUMBER=10,
441 NET_IPV4_ROUTE_REDIRECT_SILENCE=11, 441 NET_IPV4_ROUTE_REDIRECT_SILENCE=11,
diff --git a/include/linux/sysfs.h b/include/linux/sysfs.h
index d7d2f2158142..dac0859e6440 100644
--- a/include/linux/sysfs.h
+++ b/include/linux/sysfs.h
@@ -112,6 +112,7 @@ struct bin_attribute {
112struct sysfs_ops { 112struct sysfs_ops {
113 ssize_t (*show)(struct kobject *, struct attribute *,char *); 113 ssize_t (*show)(struct kobject *, struct attribute *,char *);
114 ssize_t (*store)(struct kobject *,struct attribute *,const char *, size_t); 114 ssize_t (*store)(struct kobject *,struct attribute *,const char *, size_t);
115 const void *(*namespace)(struct kobject *, const struct attribute *);
115}; 116};
116 117
117struct sysfs_dirent; 118struct sysfs_dirent;
diff --git a/include/linux/tcp.h b/include/linux/tcp.h
index 531ede8006d9..7f59ee946983 100644
--- a/include/linux/tcp.h
+++ b/include/linux/tcp.h
@@ -111,7 +111,8 @@ enum {
111#define TCPI_OPT_TIMESTAMPS 1 111#define TCPI_OPT_TIMESTAMPS 1
112#define TCPI_OPT_SACK 2 112#define TCPI_OPT_SACK 2
113#define TCPI_OPT_WSCALE 4 113#define TCPI_OPT_WSCALE 4
114#define TCPI_OPT_ECN 8 114#define TCPI_OPT_ECN 8 /* ECN was negociated at TCP session init */
115#define TCPI_OPT_ECN_SEEN 16 /* we received at least one packet with ECT */
115 116
116enum tcp_ca_state { 117enum tcp_ca_state {
117 TCP_CA_Open = 0, 118 TCP_CA_Open = 0,
@@ -379,6 +380,10 @@ struct tcp_sock {
379 u32 snd_cwnd_clamp; /* Do not allow snd_cwnd to grow above this */ 380 u32 snd_cwnd_clamp; /* Do not allow snd_cwnd to grow above this */
380 u32 snd_cwnd_used; 381 u32 snd_cwnd_used;
381 u32 snd_cwnd_stamp; 382 u32 snd_cwnd_stamp;
383 u32 prior_cwnd; /* Congestion window at start of Recovery. */
384 u32 prr_delivered; /* Number of newly delivered packets to
385 * receiver in Recovery. */
386 u32 prr_out; /* Total number of pkts sent during Recovery. */
382 387
383 u32 rcv_wnd; /* Current receiver window */ 388 u32 rcv_wnd; /* Current receiver window */
384 u32 write_seq; /* Tail(+1) of data held in tcp send buffer */ 389 u32 write_seq; /* Tail(+1) of data held in tcp send buffer */
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/ti_wilink_st.h b/include/linux/ti_wilink_st.h
index b004e557caa9..2ef4385da6bf 100644
--- a/include/linux/ti_wilink_st.h
+++ b/include/linux/ti_wilink_st.h
@@ -410,7 +410,28 @@ struct gps_event_hdr {
410 u16 plen; 410 u16 plen;
411} __attribute__ ((packed)); 411} __attribute__ ((packed));
412 412
413/* platform data */ 413/**
414 * struct ti_st_plat_data - platform data shared between ST driver and
415 * platform specific board file which adds the ST device.
416 * @nshutdown_gpio: Host's GPIO line to which chip's BT_EN is connected.
417 * @dev_name: The UART/TTY name to which chip is interfaced. (eg: /dev/ttyS1)
418 * @flow_cntrl: Should always be 1, since UART's CTS/RTS is used for PM
419 * purposes.
420 * @baud_rate: The baud rate supported by the Host UART controller, this will
421 * be shared across with the chip via a HCI VS command from User-Space Init
422 * Mgr application.
423 * @suspend:
424 * @resume: legacy PM routines hooked to platform specific board file, so as
425 * to take chip-host interface specific action.
426 * @chip_enable:
427 * @chip_disable: Platform/Interface specific mux mode setting, GPIO
428 * configuring, Host side PM disabling etc.. can be done here.
429 * @chip_asleep:
430 * @chip_awake: Chip specific deep sleep states is communicated to Host
431 * specific board-xx.c to take actions such as cut UART clocks when chip
432 * asleep or run host faster when chip awake etc..
433 *
434 */
414struct ti_st_plat_data { 435struct ti_st_plat_data {
415 long nshutdown_gpio; 436 long nshutdown_gpio;
416 unsigned char dev_name[UART_DEV_NAME_LEN]; /* uart name */ 437 unsigned char dev_name[UART_DEV_NAME_LEN]; /* uart name */
@@ -418,6 +439,10 @@ struct ti_st_plat_data {
418 unsigned long baud_rate; 439 unsigned long baud_rate;
419 int (*suspend)(struct platform_device *, pm_message_t); 440 int (*suspend)(struct platform_device *, pm_message_t);
420 int (*resume)(struct platform_device *); 441 int (*resume)(struct platform_device *);
442 int (*chip_enable) (struct kim_data_s *);
443 int (*chip_disable) (struct kim_data_s *);
444 int (*chip_asleep) (struct kim_data_s *);
445 int (*chip_awake) (struct kim_data_s *);
421}; 446};
422 447
423#endif /* TI_WILINK_ST_H */ 448#endif /* TI_WILINK_ST_H */
diff --git a/include/linux/tipc_config.h b/include/linux/tipc_config.h
index 0db239590b4d..9730b0e51e46 100644
--- a/include/linux/tipc_config.h
+++ b/include/linux/tipc_config.h
@@ -41,6 +41,10 @@
41#include <linux/string.h> 41#include <linux/string.h>
42#include <asm/byteorder.h> 42#include <asm/byteorder.h>
43 43
44#ifndef __KERNEL__
45#include <arpa/inet.h> /* for ntohs etc. */
46#endif
47
44/* 48/*
45 * Configuration 49 * Configuration
46 * 50 *
diff --git a/include/linux/trace_clock.h b/include/linux/trace_clock.h
index 7a8130384087..4eb490237d4c 100644
--- a/include/linux/trace_clock.h
+++ b/include/linux/trace_clock.h
@@ -15,5 +15,6 @@
15extern u64 notrace trace_clock_local(void); 15extern u64 notrace trace_clock_local(void);
16extern u64 notrace trace_clock(void); 16extern u64 notrace trace_clock(void);
17extern u64 notrace trace_clock_global(void); 17extern u64 notrace trace_clock_global(void);
18extern u64 notrace trace_clock_counter(void);
18 19
19#endif /* _LINUX_TRACE_CLOCK_H */ 20#endif /* _LINUX_TRACE_CLOCK_H */
diff --git a/include/linux/tracepoint.h b/include/linux/tracepoint.h
index d530a4460a0b..df0a779c1bbd 100644
--- a/include/linux/tracepoint.h
+++ b/include/linux/tracepoint.h
@@ -54,8 +54,18 @@ extern int tracepoint_probe_unregister_noupdate(const char *name, void *probe,
54 void *data); 54 void *data);
55extern void tracepoint_probe_update_all(void); 55extern void tracepoint_probe_update_all(void);
56 56
57#ifdef CONFIG_MODULES
58struct tp_module {
59 struct list_head list;
60 unsigned int num_tracepoints;
61 struct tracepoint * const *tracepoints_ptrs;
62};
63#endif /* CONFIG_MODULES */
64
57struct tracepoint_iter { 65struct tracepoint_iter {
58 struct module *module; 66#ifdef CONFIG_MODULES
67 struct tp_module *module;
68#endif /* CONFIG_MODULES */
59 struct tracepoint * const *tracepoint; 69 struct tracepoint * const *tracepoint;
60}; 70};
61 71
@@ -63,8 +73,6 @@ extern void tracepoint_iter_start(struct tracepoint_iter *iter);
63extern void tracepoint_iter_next(struct tracepoint_iter *iter); 73extern void tracepoint_iter_next(struct tracepoint_iter *iter);
64extern void tracepoint_iter_stop(struct tracepoint_iter *iter); 74extern void tracepoint_iter_stop(struct tracepoint_iter *iter);
65extern void tracepoint_iter_reset(struct tracepoint_iter *iter); 75extern void tracepoint_iter_reset(struct tracepoint_iter *iter);
66extern int tracepoint_get_iter_range(struct tracepoint * const **tracepoint,
67 struct tracepoint * const *begin, struct tracepoint * const *end);
68 76
69/* 77/*
70 * tracepoint_synchronize_unregister must be called between the last tracepoint 78 * tracepoint_synchronize_unregister must be called between the last tracepoint
@@ -78,17 +86,6 @@ static inline void tracepoint_synchronize_unregister(void)
78 86
79#define PARAMS(args...) args 87#define PARAMS(args...) args
80 88
81#ifdef CONFIG_TRACEPOINTS
82extern
83void tracepoint_update_probe_range(struct tracepoint * const *begin,
84 struct tracepoint * const *end);
85#else
86static inline
87void tracepoint_update_probe_range(struct tracepoint * const *begin,
88 struct tracepoint * const *end)
89{ }
90#endif /* CONFIG_TRACEPOINTS */
91
92#endif /* _LINUX_TRACEPOINT_H */ 89#endif /* _LINUX_TRACEPOINT_H */
93 90
94/* 91/*
diff --git a/include/linux/tty.h b/include/linux/tty.h
index 44bc0c5617e1..5dbb3cb05a82 100644
--- a/include/linux/tty.h
+++ b/include/linux/tty.h
@@ -421,6 +421,8 @@ extern void tty_driver_flush_buffer(struct tty_struct *tty);
421extern void tty_throttle(struct tty_struct *tty); 421extern void tty_throttle(struct tty_struct *tty);
422extern void tty_unthrottle(struct tty_struct *tty); 422extern void tty_unthrottle(struct tty_struct *tty);
423extern int tty_do_resize(struct tty_struct *tty, struct winsize *ws); 423extern int tty_do_resize(struct tty_struct *tty, struct winsize *ws);
424extern void tty_driver_remove_tty(struct tty_driver *driver,
425 struct tty_struct *tty);
424extern void tty_shutdown(struct tty_struct *tty); 426extern void tty_shutdown(struct tty_struct *tty);
425extern void tty_free_termios(struct tty_struct *tty); 427extern void tty_free_termios(struct tty_struct *tty);
426extern int is_current_pgrp_orphaned(void); 428extern int is_current_pgrp_orphaned(void);
@@ -471,7 +473,9 @@ extern void proc_clear_tty(struct task_struct *p);
471extern struct tty_struct *get_current_tty(void); 473extern struct tty_struct *get_current_tty(void);
472extern void tty_default_fops(struct file_operations *fops); 474extern void tty_default_fops(struct file_operations *fops);
473extern struct tty_struct *alloc_tty_struct(void); 475extern struct tty_struct *alloc_tty_struct(void);
474extern int tty_add_file(struct tty_struct *tty, struct file *file); 476extern int tty_alloc_file(struct file *file);
477extern void tty_add_file(struct tty_struct *tty, struct file *file);
478extern void tty_free_file(struct file *file);
475extern void free_tty_struct(struct tty_struct *tty); 479extern void free_tty_struct(struct tty_struct *tty);
476extern void initialize_tty_struct(struct tty_struct *tty, 480extern void initialize_tty_struct(struct tty_struct *tty,
477 struct tty_driver *driver, int idx); 481 struct tty_driver *driver, int idx);
@@ -579,6 +583,8 @@ extern int __init tty_init(void);
579/* tty_ioctl.c */ 583/* tty_ioctl.c */
580extern int n_tty_ioctl_helper(struct tty_struct *tty, struct file *file, 584extern int n_tty_ioctl_helper(struct tty_struct *tty, struct file *file,
581 unsigned int cmd, unsigned long arg); 585 unsigned int cmd, unsigned long arg);
586extern long n_tty_compat_ioctl_helper(struct tty_struct *tty, struct file *file,
587 unsigned int cmd, unsigned long arg);
582 588
583/* serial.c */ 589/* serial.c */
584 590
@@ -600,8 +606,24 @@ extern long vt_compat_ioctl(struct tty_struct *tty,
600/* functions for preparation of BKL removal */ 606/* functions for preparation of BKL removal */
601extern void __lockfunc tty_lock(void) __acquires(tty_lock); 607extern void __lockfunc tty_lock(void) __acquires(tty_lock);
602extern void __lockfunc tty_unlock(void) __releases(tty_lock); 608extern void __lockfunc tty_unlock(void) __releases(tty_lock);
603extern struct task_struct *__big_tty_mutex_owner; 609
604#define tty_locked() (current == __big_tty_mutex_owner) 610/*
611 * this shall be called only from where BTM is held (like close)
612 *
613 * We need this to ensure nobody waits for us to finish while we are waiting.
614 * Without this we were encountering system stalls.
615 *
616 * This should be indeed removed with BTM removal later.
617 *
618 * Locking: BTM required. Nobody is allowed to hold port->mutex.
619 */
620static inline void tty_wait_until_sent_from_close(struct tty_struct *tty,
621 long timeout)
622{
623 tty_unlock(); /* tty->ops->close holds the BTM, drop it while waiting */
624 tty_wait_until_sent(tty, timeout);
625 tty_lock();
626}
605 627
606/* 628/*
607 * wait_event_interruptible_tty -- wait for a condition with the tty lock held 629 * wait_event_interruptible_tty -- wait for a condition with the tty lock held
diff --git a/include/linux/tty_driver.h b/include/linux/tty_driver.h
index 9deeac855240..ecdaeb98b293 100644
--- a/include/linux/tty_driver.h
+++ b/include/linux/tty_driver.h
@@ -47,6 +47,9 @@
47 * 47 *
48 * This routine is called synchronously when a particular tty device 48 * This routine is called synchronously when a particular tty device
49 * is closed for the last time freeing up the resources. 49 * is closed for the last time freeing up the resources.
50 * Note that tty_shutdown() is not called if ops->shutdown is defined.
51 * This means one is responsible to take care of calling ops->remove (e.g.
52 * via tty_driver_remove_tty) and releasing tty->termios.
50 * 53 *
51 * 54 *
52 * void (*cleanup)(struct tty_struct * tty); 55 * void (*cleanup)(struct tty_struct * tty);
diff --git a/include/linux/types.h b/include/linux/types.h
index 176da8c1fbb1..57a97234bec1 100644
--- a/include/linux/types.h
+++ b/include/linux/types.h
@@ -238,6 +238,16 @@ struct ustat {
238 char f_fpack[6]; 238 char f_fpack[6];
239}; 239};
240 240
241/**
242 * struct rcu_head - callback structure for use with RCU
243 * @next: next update requests in a list
244 * @func: actual update function to call after the grace period.
245 */
246struct rcu_head {
247 struct rcu_head *next;
248 void (*func)(struct rcu_head *head);
249};
250
241#endif /* __KERNEL__ */ 251#endif /* __KERNEL__ */
242#endif /* __ASSEMBLY__ */ 252#endif /* __ASSEMBLY__ */
243#endif /* _LINUX_TYPES_H */ 253#endif /* _LINUX_TYPES_H */
diff --git a/include/linux/uio_driver.h b/include/linux/uio_driver.h
index 665517c05eaf..fd99ff9298c6 100644
--- a/include/linux/uio_driver.h
+++ b/include/linux/uio_driver.h
@@ -23,7 +23,10 @@ struct uio_map;
23/** 23/**
24 * struct uio_mem - description of a UIO memory region 24 * struct uio_mem - description of a UIO memory region
25 * @name: name of the memory region for identification 25 * @name: name of the memory region for identification
26 * @addr: address of the device's memory 26 * @addr: address of the device's memory (phys_addr is used since
27 * addr can be logical, virtual, or physical & phys_addr_t
28 * should always be large enough to handle any of the
29 * address types)
27 * @size: size of IO 30 * @size: size of IO
28 * @memtype: type of memory addr points to 31 * @memtype: type of memory addr points to
29 * @internal_addr: ioremap-ped version of addr, for driver internal use 32 * @internal_addr: ioremap-ped version of addr, for driver internal use
@@ -31,7 +34,7 @@ struct uio_map;
31 */ 34 */
32struct uio_mem { 35struct uio_mem {
33 const char *name; 36 const char *name;
34 unsigned long addr; 37 phys_addr_t addr;
35 unsigned long size; 38 unsigned long size;
36 int memtype; 39 int memtype;
37 void __iomem *internal_addr; 40 void __iomem *internal_addr;
diff --git a/include/linux/un.h b/include/linux/un.h
index 45561c564b8e..3ed3e46c1b1f 100644
--- a/include/linux/un.h
+++ b/include/linux/un.h
@@ -1,10 +1,12 @@
1#ifndef _LINUX_UN_H 1#ifndef _LINUX_UN_H
2#define _LINUX_UN_H 2#define _LINUX_UN_H
3 3
4#include <linux/socket.h>
5
4#define UNIX_PATH_MAX 108 6#define UNIX_PATH_MAX 108
5 7
6struct sockaddr_un { 8struct sockaddr_un {
7 sa_family_t sun_family; /* AF_UNIX */ 9 __kernel_sa_family_t sun_family; /* AF_UNIX */
8 char sun_path[UNIX_PATH_MAX]; /* pathname */ 10 char sun_path[UNIX_PATH_MAX]; /* pathname */
9}; 11};
10 12
diff --git a/include/linux/usb.h b/include/linux/usb.h
index 73c7df489607..6f49a1b39fa6 100644
--- a/include/linux/usb.h
+++ b/include/linux/usb.h
@@ -292,6 +292,16 @@ struct usb_host_config {
292 int extralen; 292 int extralen;
293}; 293};
294 294
295/* USB2.0 and USB3.0 device BOS descriptor set */
296struct usb_host_bos {
297 struct usb_bos_descriptor *desc;
298
299 /* wireless cap descriptor is handled by wusb */
300 struct usb_ext_cap_descriptor *ext_cap;
301 struct usb_ss_cap_descriptor *ss_cap;
302 struct usb_ss_container_id_descriptor *ss_id;
303};
304
295int __usb_get_extra_descriptor(char *buffer, unsigned size, 305int __usb_get_extra_descriptor(char *buffer, unsigned size,
296 unsigned char type, void **ptr); 306 unsigned char type, void **ptr);
297#define usb_get_extra_descriptor(ifpoint, type, ptr) \ 307#define usb_get_extra_descriptor(ifpoint, type, ptr) \
@@ -381,6 +391,7 @@ struct usb_tt;
381 * @ep0: endpoint 0 data (default control pipe) 391 * @ep0: endpoint 0 data (default control pipe)
382 * @dev: generic device interface 392 * @dev: generic device interface
383 * @descriptor: USB device descriptor 393 * @descriptor: USB device descriptor
394 * @bos: USB device BOS descriptor set
384 * @config: all of the device's configs 395 * @config: all of the device's configs
385 * @actconfig: the active configuration 396 * @actconfig: the active configuration
386 * @ep_in: array of IN endpoints 397 * @ep_in: array of IN endpoints
@@ -399,6 +410,9 @@ struct usb_tt;
399 * FIXME -- complete doc 410 * FIXME -- complete doc
400 * @authenticated: Crypto authentication passed 411 * @authenticated: Crypto authentication passed
401 * @wusb: device is Wireless USB 412 * @wusb: device is Wireless USB
413 * @lpm_capable: device supports LPM
414 * @usb2_hw_lpm_capable: device can perform USB2 hardware LPM
415 * @usb2_hw_lpm_enabled: USB2 hardware LPM enabled
402 * @string_langid: language ID for strings 416 * @string_langid: language ID for strings
403 * @product: iProduct string, if present (static) 417 * @product: iProduct string, if present (static)
404 * @manufacturer: iManufacturer string, if present (static) 418 * @manufacturer: iManufacturer string, if present (static)
@@ -442,6 +456,7 @@ struct usb_device {
442 struct device dev; 456 struct device dev;
443 457
444 struct usb_device_descriptor descriptor; 458 struct usb_device_descriptor descriptor;
459 struct usb_host_bos *bos;
445 struct usb_host_config *config; 460 struct usb_host_config *config;
446 461
447 struct usb_host_config *actconfig; 462 struct usb_host_config *actconfig;
@@ -460,6 +475,9 @@ struct usb_device {
460 unsigned authorized:1; 475 unsigned authorized:1;
461 unsigned authenticated:1; 476 unsigned authenticated:1;
462 unsigned wusb:1; 477 unsigned wusb:1;
478 unsigned lpm_capable:1;
479 unsigned usb2_hw_lpm_capable:1;
480 unsigned usb2_hw_lpm_enabled:1;
463 int string_langid; 481 int string_langid;
464 482
465 /* static strings from the device */ 483 /* static strings from the device */
@@ -1574,7 +1592,7 @@ usb_maxpacket(struct usb_device *udev, int pipe, int is_out)
1574 return 0; 1592 return 0;
1575 1593
1576 /* NOTE: only 0x07ff bits are for packet size... */ 1594 /* NOTE: only 0x07ff bits are for packet size... */
1577 return le16_to_cpu(ep->desc.wMaxPacketSize); 1595 return usb_endpoint_maxp(&ep->desc);
1578} 1596}
1579 1597
1580/* ----------------------------------------------------------------------- */ 1598/* ----------------------------------------------------------------------- */
diff --git a/include/linux/usb/ch9.h b/include/linux/usb/ch9.h
index 0fd3fbdd8283..f32a64e57f97 100644
--- a/include/linux/usb/ch9.h
+++ b/include/linux/usb/ch9.h
@@ -34,6 +34,7 @@
34#define __LINUX_USB_CH9_H 34#define __LINUX_USB_CH9_H
35 35
36#include <linux/types.h> /* __u8 etc */ 36#include <linux/types.h> /* __u8 etc */
37#include <asm/byteorder.h> /* le16_to_cpu */
37 38
38/*-------------------------------------------------------------------------*/ 39/*-------------------------------------------------------------------------*/
39 40
@@ -143,6 +144,11 @@
143#define USB_INTRF_FUNC_SUSPEND 0 /* function suspend */ 144#define USB_INTRF_FUNC_SUSPEND 0 /* function suspend */
144 145
145#define USB_INTR_FUNC_SUSPEND_OPT_MASK 0xFF00 146#define USB_INTR_FUNC_SUSPEND_OPT_MASK 0xFF00
147/*
148 * Suspend Options, Table 9-7 USB 3.0 spec
149 */
150#define USB_INTRF_FUNC_SUSPEND_LP (1 << (8 + 0))
151#define USB_INTRF_FUNC_SUSPEND_RW (1 << (8 + 1))
146 152
147#define USB_ENDPOINT_HALT 0 /* IN/OUT will STALL */ 153#define USB_ENDPOINT_HALT 0 /* IN/OUT will STALL */
148 154
@@ -570,6 +576,17 @@ static inline int usb_endpoint_is_isoc_out(
570 return usb_endpoint_xfer_isoc(epd) && usb_endpoint_dir_out(epd); 576 return usb_endpoint_xfer_isoc(epd) && usb_endpoint_dir_out(epd);
571} 577}
572 578
579/**
580 * usb_endpoint_maxp - get endpoint's max packet size
581 * @epd: endpoint to be checked
582 *
583 * Returns @epd's max packet
584 */
585static inline int usb_endpoint_maxp(const struct usb_endpoint_descriptor *epd)
586{
587 return le16_to_cpu(epd->wMaxPacketSize);
588}
589
573/*-------------------------------------------------------------------------*/ 590/*-------------------------------------------------------------------------*/
574 591
575/* USB_DT_SS_ENDPOINT_COMP: SuperSpeed Endpoint Companion descriptor */ 592/* USB_DT_SS_ENDPOINT_COMP: SuperSpeed Endpoint Companion descriptor */
@@ -851,6 +868,18 @@ enum usb_device_speed {
851 USB_SPEED_SUPER, /* usb 3.0 */ 868 USB_SPEED_SUPER, /* usb 3.0 */
852}; 869};
853 870
871#ifdef __KERNEL__
872
873/**
874 * usb_speed_string() - Returns human readable-name of the speed.
875 * @speed: The speed to return human-readable name for. If it's not
876 * any of the speeds defined in usb_device_speed enum, string for
877 * USB_SPEED_UNKNOWN will be returned.
878 */
879extern const char *usb_speed_string(enum usb_device_speed speed);
880
881#endif
882
854enum usb_device_state { 883enum usb_device_state {
855 /* NOTATTACHED isn't in the USB spec, and this state acts 884 /* NOTATTACHED isn't in the USB spec, and this state acts
856 * the same as ATTACHED ... but it's clearer this way. 885 * the same as ATTACHED ... but it's clearer this way.
diff --git a/include/linux/usb/gadget.h b/include/linux/usb/gadget.h
index 087f4b931833..1d3a67523ffc 100644
--- a/include/linux/usb/gadget.h
+++ b/include/linux/usb/gadget.h
@@ -437,9 +437,9 @@ static inline void usb_ep_fifo_flush(struct usb_ep *ep)
437 437
438struct usb_dcd_config_params { 438struct usb_dcd_config_params {
439 __u8 bU1devExitLat; /* U1 Device exit Latency */ 439 __u8 bU1devExitLat; /* U1 Device exit Latency */
440#define USB_DEFULT_U1_DEV_EXIT_LAT 0x01 /* Less then 1 microsec */ 440#define USB_DEFAULT_U1_DEV_EXIT_LAT 0x01 /* Less then 1 microsec */
441 __le16 bU2DevExitLat; /* U2 Device exit Latency */ 441 __le16 bU2DevExitLat; /* U2 Device exit Latency */
442#define USB_DEFULT_U2_DEV_EXIT_LAT 0x1F4 /* Less then 500 microsec */ 442#define USB_DEFAULT_U2_DEV_EXIT_LAT 0x1F4 /* Less then 500 microsec */
443}; 443};
444 444
445 445
diff --git a/include/linux/usb/hcd.h b/include/linux/usb/hcd.h
index 0097136ba45d..03354d557b79 100644
--- a/include/linux/usb/hcd.h
+++ b/include/linux/usb/hcd.h
@@ -178,7 +178,7 @@ struct usb_hcd {
178 * this structure. 178 * this structure.
179 */ 179 */
180 unsigned long hcd_priv[0] 180 unsigned long hcd_priv[0]
181 __attribute__ ((aligned(sizeof(unsigned long)))); 181 __attribute__ ((aligned(sizeof(s64))));
182}; 182};
183 183
184/* 2.4 does this a bit differently ... */ 184/* 2.4 does this a bit differently ... */
@@ -343,6 +343,7 @@ struct hc_driver {
343 * address is set 343 * address is set
344 */ 344 */
345 int (*update_device)(struct usb_hcd *, struct usb_device *); 345 int (*update_device)(struct usb_hcd *, struct usb_device *);
346 int (*set_usb2_hw_lpm)(struct usb_hcd *, struct usb_device *, int);
346}; 347};
347 348
348extern int usb_hcd_link_urb_to_ep(struct usb_hcd *hcd, struct urb *urb); 349extern int usb_hcd_link_urb_to_ep(struct usb_hcd *hcd, struct urb *urb);
diff --git a/include/linux/usb/r8a66597.h b/include/linux/usb/r8a66597.h
index b6b8660d0c68..55805f9dcf21 100644
--- a/include/linux/usb/r8a66597.h
+++ b/include/linux/usb/r8a66597.h
@@ -48,6 +48,9 @@ struct r8a66597_platdata {
48 48
49 /* (external controller only) set one = WR0_N shorted to WR1_N */ 49 /* (external controller only) set one = WR0_N shorted to WR1_N */
50 unsigned wr0_shorted_to_wr1:1; 50 unsigned wr0_shorted_to_wr1:1;
51
52 /* set one = using SUDMAC */
53 unsigned sudmac:1;
51}; 54};
52 55
53/* Register definitions */ 56/* Register definitions */
@@ -417,5 +420,62 @@ struct r8a66597_platdata {
417#define USBSPD 0x00C0 420#define USBSPD 0x00C0
418#define RTPORT 0x0001 421#define RTPORT 0x0001
419 422
423/* SUDMAC registers */
424#define CH0CFG 0x00
425#define CH1CFG 0x04
426#define CH0BA 0x10
427#define CH1BA 0x14
428#define CH0BBC 0x18
429#define CH1BBC 0x1C
430#define CH0CA 0x20
431#define CH1CA 0x24
432#define CH0CBC 0x28
433#define CH1CBC 0x2C
434#define CH0DEN 0x30
435#define CH1DEN 0x34
436#define DSTSCLR 0x38
437#define DBUFCTRL 0x3C
438#define DINTCTRL 0x40
439#define DINTSTS 0x44
440#define DINTSTSCLR 0x48
441#define CH0SHCTRL 0x50
442#define CH1SHCTRL 0x54
443
444/* SUDMAC Configuration Registers */
445#define SENDBUFM 0x1000 /* b12: Transmit Buffer Mode */
446#define RCVENDM 0x0100 /* b8: Receive Data Transfer End Mode */
447#define LBA_WAIT 0x0030 /* b5-4: Local Bus Access Wait */
448
449/* DMA Enable Registers */
450#define DEN 0x0001 /* b1: DMA Transfer Enable */
451
452/* DMA Status Clear Register */
453#define CH1STCLR 0x0002 /* b2: Ch1 DMA Status Clear */
454#define CH0STCLR 0x0001 /* b1: Ch0 DMA Status Clear */
455
456/* DMA Buffer Control Register */
457#define CH1BUFW 0x0200 /* b9: Ch1 DMA Buffer Data Transfer Enable */
458#define CH0BUFW 0x0100 /* b8: Ch0 DMA Buffer Data Transfer Enable */
459#define CH1BUFS 0x0002 /* b2: Ch1 DMA Buffer Data Status */
460#define CH0BUFS 0x0001 /* b1: Ch0 DMA Buffer Data Status */
461
462/* DMA Interrupt Control Register */
463#define CH1ERRE 0x0200 /* b9: Ch1 SHwy Res Err Detect Int Enable */
464#define CH0ERRE 0x0100 /* b8: Ch0 SHwy Res Err Detect Int Enable */
465#define CH1ENDE 0x0002 /* b2: Ch1 DMA Transfer End Int Enable */
466#define CH0ENDE 0x0001 /* b1: Ch0 DMA Transfer End Int Enable */
467
468/* DMA Interrupt Status Register */
469#define CH1ERRS 0x0200 /* b9: Ch1 SHwy Res Err Detect Int Status */
470#define CH0ERRS 0x0100 /* b8: Ch0 SHwy Res Err Detect Int Status */
471#define CH1ENDS 0x0002 /* b2: Ch1 DMA Transfer End Int Status */
472#define CH0ENDS 0x0001 /* b1: Ch0 DMA Transfer End Int Status */
473
474/* DMA Interrupt Status Clear Register */
475#define CH1ERRC 0x0200 /* b9: Ch1 SHwy Res Err Detect Int Stat Clear */
476#define CH0ERRC 0x0100 /* b8: Ch0 SHwy Res Err Detect Int Stat Clear */
477#define CH1ENDC 0x0002 /* b2: Ch1 DMA Transfer End Int Stat Clear */
478#define CH0ENDC 0x0001 /* b1: Ch0 DMA Transfer End Int Stat Clear */
479
420#endif /* __LINUX_USB_R8A66597_H */ 480#endif /* __LINUX_USB_R8A66597_H */
421 481
diff --git a/include/linux/usb/renesas_usbhs.h b/include/linux/usb/renesas_usbhs.h
index 8977431259c6..e5a40c318548 100644
--- a/include/linux/usb/renesas_usbhs.h
+++ b/include/linux/usb/renesas_usbhs.h
@@ -82,6 +82,13 @@ struct renesas_usbhs_platform_callback {
82 * get VBUS status function. 82 * get VBUS status function.
83 */ 83 */
84 int (*get_vbus)(struct platform_device *pdev); 84 int (*get_vbus)(struct platform_device *pdev);
85
86 /*
87 * option:
88 *
89 * VBUS control is needed for Host
90 */
91 int (*set_vbus)(struct platform_device *pdev, int enable);
85}; 92};
86 93
87/* 94/*
@@ -101,6 +108,8 @@ struct renesas_usbhs_driver_param {
101 * option: 108 * option:
102 * 109 *
103 * for BUSWAIT :: BWAIT 110 * for BUSWAIT :: BWAIT
111 * see
112 * renesas_usbhs/common.c :: usbhsc_set_buswait()
104 * */ 113 * */
105 int buswait_bwait; 114 int buswait_bwait;
106 115
@@ -127,6 +136,11 @@ struct renesas_usbhs_driver_param {
127 * pio <--> dma border. 136 * pio <--> dma border.
128 */ 137 */
129 int pio_dma_border; /* default is 64byte */ 138 int pio_dma_border; /* default is 64byte */
139
140 /*
141 * option:
142 */
143 u32 has_otg:1; /* for controlling PWEN/EXTLP */
130}; 144};
131 145
132/* 146/*
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 710885749605..851ebf1a4476 100644
--- a/include/linux/virtio.h
+++ b/include/linux/virtio.h
@@ -61,6 +61,9 @@ struct virtqueue {
61 * virtqueue_detach_unused_buf: detach first unused buffer 61 * virtqueue_detach_unused_buf: detach first unused buffer
62 * vq: the struct virtqueue we're talking about. 62 * vq: the struct virtqueue we're talking about.
63 * Returns NULL or the "data" token handed to add_buf 63 * Returns NULL or the "data" token handed to add_buf
64 * virtqueue_get_vring_size: return the size of the virtqueue's vring
65 * vq: the struct virtqueue containing the vring of interest.
66 * Returns the size of the vring.
64 * 67 *
65 * Locking rules are straightforward: the driver is responsible for 68 * Locking rules are straightforward: the driver is responsible for
66 * locking. No two operations may be invoked simultaneously, with the exception 69 * locking. No two operations may be invoked simultaneously, with the exception
@@ -97,6 +100,8 @@ bool virtqueue_enable_cb_delayed(struct virtqueue *vq);
97 100
98void *virtqueue_detach_unused_buf(struct virtqueue *vq); 101void *virtqueue_detach_unused_buf(struct virtqueue *vq);
99 102
103unsigned int virtqueue_get_vring_size(struct virtqueue *vq);
104
100/** 105/**
101 * virtio_device - representation of a device using virtio 106 * virtio_device - representation of a device using virtio
102 * @index: unique position on the virtio bus 107 * @index: unique position on the virtio bus
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/writeback.h b/include/linux/writeback.h
index f1bfa12ea246..2b8963ff0f35 100644
--- a/include/linux/writeback.h
+++ b/include/linux/writeback.h
@@ -12,15 +12,6 @@
12 * 12 *
13 * (thresh - thresh/DIRTY_FULL_SCOPE, thresh) 13 * (thresh - thresh/DIRTY_FULL_SCOPE, thresh)
14 * 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 15 * Further beyond, all dirtier tasks will enter a loop waiting (possibly long
25 * time) for the dirty pages to drop, unless written enough pages. 16 * time) for the dirty pages to drop, unless written enough pages.
26 * 17 *
@@ -31,8 +22,6 @@
31 */ 22 */
32#define DIRTY_SCOPE 8 23#define DIRTY_SCOPE 8
33#define DIRTY_FULL_SCOPE (DIRTY_SCOPE / 2) 24#define DIRTY_FULL_SCOPE (DIRTY_SCOPE / 2)
34#define DIRTY_MAXPAUSE_AREA 16
35#define DIRTY_PASSGOOD_AREA 8
36 25
37/* 26/*
38 * 4MB minimal write chunk size 27 * 4MB minimal write chunk size
diff --git a/include/linux/x25.h b/include/linux/x25.h
index 6450a7f12074..810cce6737ea 100644
--- a/include/linux/x25.h
+++ b/include/linux/x25.h
@@ -12,6 +12,7 @@
12#define X25_KERNEL_H 12#define X25_KERNEL_H
13 13
14#include <linux/types.h> 14#include <linux/types.h>
15#include <linux/socket.h>
15 16
16#define SIOCX25GSUBSCRIP (SIOCPROTOPRIVATE + 0) 17#define SIOCX25GSUBSCRIP (SIOCPROTOPRIVATE + 0)
17#define SIOCX25SSUBSCRIP (SIOCPROTOPRIVATE + 1) 18#define SIOCX25SSUBSCRIP (SIOCPROTOPRIVATE + 1)
@@ -57,7 +58,7 @@ struct x25_address {
57 * Linux X.25 Address structure, used for bind, and connect mostly. 58 * Linux X.25 Address structure, used for bind, and connect mostly.
58 */ 59 */
59struct sockaddr_x25 { 60struct sockaddr_x25 {
60 sa_family_t sx25_family; /* Must be AF_X25 */ 61 __kernel_sa_family_t sx25_family; /* Must be AF_X25 */
61 struct x25_address sx25_addr; /* X.121 Address */ 62 struct x25_address sx25_addr; /* X.121 Address */
62}; 63};
63 64
diff --git a/include/linux/xattr.h b/include/linux/xattr.h
index aed54c50aa66..e5d122031542 100644
--- a/include/linux/xattr.h
+++ b/include/linux/xattr.h
@@ -30,6 +30,9 @@
30#define XATTR_USER_PREFIX_LEN (sizeof (XATTR_USER_PREFIX) - 1) 30#define XATTR_USER_PREFIX_LEN (sizeof (XATTR_USER_PREFIX) - 1)
31 31
32/* Security namespace */ 32/* Security namespace */
33#define XATTR_EVM_SUFFIX "evm"
34#define XATTR_NAME_EVM XATTR_SECURITY_PREFIX XATTR_EVM_SUFFIX
35
33#define XATTR_SELINUX_SUFFIX "selinux" 36#define XATTR_SELINUX_SUFFIX "selinux"
34#define XATTR_NAME_SELINUX XATTR_SECURITY_PREFIX XATTR_SELINUX_SUFFIX 37#define XATTR_NAME_SELINUX XATTR_SECURITY_PREFIX XATTR_SELINUX_SUFFIX
35 38
@@ -49,6 +52,11 @@
49#define XATTR_CAPS_SUFFIX "capability" 52#define XATTR_CAPS_SUFFIX "capability"
50#define XATTR_NAME_CAPS XATTR_SECURITY_PREFIX XATTR_CAPS_SUFFIX 53#define XATTR_NAME_CAPS XATTR_SECURITY_PREFIX XATTR_CAPS_SUFFIX
51 54
55#define XATTR_POSIX_ACL_ACCESS "posix_acl_access"
56#define XATTR_NAME_POSIX_ACL_ACCESS XATTR_SYSTEM_PREFIX XATTR_POSIX_ACL_ACCESS
57#define XATTR_POSIX_ACL_DEFAULT "posix_acl_default"
58#define XATTR_NAME_POSIX_ACL_DEFAULT XATTR_SYSTEM_PREFIX XATTR_POSIX_ACL_DEFAULT
59
52#ifdef __KERNEL__ 60#ifdef __KERNEL__
53 61
54#include <linux/types.h> 62#include <linux/types.h>
@@ -67,6 +75,12 @@ struct xattr_handler {
67 size_t size, int flags, int handler_flags); 75 size_t size, int flags, int handler_flags);
68}; 76};
69 77
78struct xattr {
79 char *name;
80 void *value;
81 size_t value_len;
82};
83
70ssize_t xattr_getsecurity(struct inode *, const char *, void *, size_t); 84ssize_t xattr_getsecurity(struct inode *, const char *, void *, size_t);
71ssize_t vfs_getxattr(struct dentry *, const char *, void *, size_t); 85ssize_t vfs_getxattr(struct dentry *, const char *, void *, size_t);
72ssize_t vfs_listxattr(struct dentry *d, char *list, size_t size); 86ssize_t vfs_listxattr(struct dentry *d, char *list, size_t size);
@@ -78,7 +92,10 @@ ssize_t generic_getxattr(struct dentry *dentry, const char *name, void *buffer,
78ssize_t generic_listxattr(struct dentry *dentry, char *buffer, size_t buffer_size); 92ssize_t generic_listxattr(struct dentry *dentry, char *buffer, size_t buffer_size);
79int generic_setxattr(struct dentry *dentry, const char *name, const void *value, size_t size, int flags); 93int generic_setxattr(struct dentry *dentry, const char *name, const void *value, size_t size, int flags);
80int generic_removexattr(struct dentry *dentry, const char *name); 94int generic_removexattr(struct dentry *dentry, const char *name);
81 95ssize_t vfs_getxattr_alloc(struct dentry *dentry, const char *name,
96 char **xattr_value, size_t size, gfp_t flags);
97int vfs_xattr_cmp(struct dentry *dentry, const char *xattr_name,
98 const char *value, size_t size, gfp_t flags);
82#endif /* __KERNEL__ */ 99#endif /* __KERNEL__ */
83 100
84#endif /* _LINUX_XATTR_H */ 101#endif /* _LINUX_XATTR_H */
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/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/pwc-ioctl.h b/include/media/pwc-ioctl.h
index 0f19779c4634..1ed1e616fe33 100644
--- a/include/media/pwc-ioctl.h
+++ b/include/media/pwc-ioctl.h
@@ -53,7 +53,6 @@
53 */ 53 */
54 54
55#include <linux/types.h> 55#include <linux/types.h>
56#include <linux/version.h>
57 56
58/* Enumeration of image sizes */ 57/* Enumeration of image sizes */
59#define PSZ_SQCIF 0x00 58#define PSZ_SQCIF 0x00
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-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 2884e3e69cb1..257da1a30f66 100644
--- a/include/media/v4l2-subdev.h
+++ b/include/media/v4l2-subdev.h
@@ -229,6 +229,12 @@ struct v4l2_subdev_audio_ops {
229 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
230 video input devices. 230 video input devices.
231 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
232 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
233 clocks in Hz. An extra flags field allows device specific configuration 239 clocks in Hz. An extra flags field allows device specific configuration
234 regarding clock frequency dividers, etc. If not used, then set flags 240 regarding clock frequency dividers, etc. If not used, then set flags
@@ -243,6 +249,8 @@ struct v4l2_subdev_audio_ops {
243 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
244 s_std() 250 s_std()
245 251
252 g_dv_preset: get current dv (Digital Video) preset in the sub device.
253
246 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
247 querystd() 255 querystd()
248 256
@@ -259,12 +267,20 @@ struct v4l2_subdev_audio_ops {
259 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
260 268
261 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.
262 */ 276 */
263struct v4l2_subdev_video_ops { 277struct v4l2_subdev_video_ops {
264 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);
265 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);
266 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);
267 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);
268 int (*g_input_status)(struct v4l2_subdev *sd, u32 *status); 284 int (*g_input_status)(struct v4l2_subdev *sd, u32 *status);
269 int (*s_stream)(struct v4l2_subdev *sd, int enable); 285 int (*s_stream)(struct v4l2_subdev *sd, int enable);
270 int (*cropcap)(struct v4l2_subdev *sd, struct v4l2_cropcap *cc); 286 int (*cropcap)(struct v4l2_subdev *sd, struct v4l2_cropcap *cc);
@@ -282,6 +298,8 @@ struct v4l2_subdev_video_ops {
282 struct v4l2_dv_enum_preset *preset); 298 struct v4l2_dv_enum_preset *preset);
283 int (*s_dv_preset)(struct v4l2_subdev *sd, 299 int (*s_dv_preset)(struct v4l2_subdev *sd,
284 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);
285 int (*query_dv_preset)(struct v4l2_subdev *sd, 303 int (*query_dv_preset)(struct v4l2_subdev *sd,
286 struct v4l2_dv_preset *preset); 304 struct v4l2_dv_preset *preset);
287 int (*s_dv_timings)(struct v4l2_subdev *sd, 305 int (*s_dv_timings)(struct v4l2_subdev *sd,
@@ -298,6 +316,10 @@ struct v4l2_subdev_video_ops {
298 struct v4l2_mbus_framefmt *fmt); 316 struct v4l2_mbus_framefmt *fmt);
299 int (*s_mbus_fmt)(struct v4l2_subdev *sd, 317 int (*s_mbus_fmt)(struct v4l2_subdev *sd,
300 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);
301}; 323};
302 324
303/* 325/*
@@ -513,8 +535,6 @@ struct v4l2_subdev {
513 void *host_priv; 535 void *host_priv;
514 /* subdev device node */ 536 /* subdev device node */
515 struct video_device devnode; 537 struct video_device devnode;
516 /* number of events to be allocated on open */
517 unsigned int nevents;
518}; 538};
519 539
520#define media_entity_to_v4l2_subdev(ent) \ 540#define media_entity_to_v4l2_subdev(ent) \
diff --git a/include/media/videobuf-dma-sg.h b/include/media/videobuf-dma-sg.h
index 1c647e8148c4..d8fb6012c10d 100644
--- a/include/media/videobuf-dma-sg.h
+++ b/include/media/videobuf-dma-sg.h
@@ -34,7 +34,7 @@
34 * does memory allocation too using vmalloc_32(). 34 * does memory allocation too using vmalloc_32().
35 * 35 *
36 * videobuf_dma_*() 36 * videobuf_dma_*()
37 * see Documentation/PCI/PCI-DMA-mapping.txt, these functions to 37 * see Documentation/DMA-API-HOWTO.txt, these functions to
38 * basically the same. The map function does also build a 38 * basically the same. The map function does also build a
39 * scatterlist for the buffer (and unmap frees it ...) 39 * scatterlist for the buffer (and unmap frees it ...)
40 * 40 *
diff --git a/include/net/9p/9p.h b/include/net/9p/9p.h
index 342dcf13d039..2d70b95b3b55 100644
--- a/include/net/9p/9p.h
+++ b/include/net/9p/9p.h
@@ -76,11 +76,8 @@ do { \
76 } \ 76 } \
77} while (0) 77} while (0)
78 78
79#define P9_DUMP_PKT(way, pdu) p9pdu_dump(way, pdu)
80
81#else 79#else
82#define P9_DPRINTK(level, format, arg...) do { } while (0) 80#define P9_DPRINTK(level, format, arg...) do { } while (0)
83#define P9_DUMP_PKT(way, pdu) do { } while (0)
84#endif 81#endif
85 82
86 83
@@ -288,6 +285,35 @@ enum p9_perm_t {
288 P9_DMSETVTX = 0x00010000, 285 P9_DMSETVTX = 0x00010000,
289}; 286};
290 287
288/* 9p2000.L open flags */
289#define P9_DOTL_RDONLY 00000000
290#define P9_DOTL_WRONLY 00000001
291#define P9_DOTL_RDWR 00000002
292#define P9_DOTL_NOACCESS 00000003
293#define P9_DOTL_CREATE 00000100
294#define P9_DOTL_EXCL 00000200
295#define P9_DOTL_NOCTTY 00000400
296#define P9_DOTL_TRUNC 00001000
297#define P9_DOTL_APPEND 00002000
298#define P9_DOTL_NONBLOCK 00004000
299#define P9_DOTL_DSYNC 00010000
300#define P9_DOTL_FASYNC 00020000
301#define P9_DOTL_DIRECT 00040000
302#define P9_DOTL_LARGEFILE 00100000
303#define P9_DOTL_DIRECTORY 00200000
304#define P9_DOTL_NOFOLLOW 00400000
305#define P9_DOTL_NOATIME 01000000
306#define P9_DOTL_CLOEXEC 02000000
307#define P9_DOTL_SYNC 04000000
308
309/* 9p2000.L at flags */
310#define P9_DOTL_AT_REMOVEDIR 0x200
311
312/* 9p2000.L lock type */
313#define P9_LOCK_TYPE_RDLCK 0
314#define P9_LOCK_TYPE_WRLCK 1
315#define P9_LOCK_TYPE_UNLCK 2
316
291/** 317/**
292 * enum p9_qid_t - QID types 318 * enum p9_qid_t - QID types
293 * @P9_QTDIR: directory 319 * @P9_QTDIR: directory
@@ -330,6 +356,9 @@ enum p9_qid_t {
330/* Room for readdir header */ 356/* Room for readdir header */
331#define P9_READDIRHDRSZ 24 357#define P9_READDIRHDRSZ 24
332 358
359/* size of header for zero copy read/write */
360#define P9_ZC_HDR_SZ 4096
361
333/** 362/**
334 * struct p9_qid - file system entity information 363 * struct p9_qid - file system entity information
335 * @type: 8-bit type &p9_qid_t 364 * @type: 8-bit type &p9_qid_t
@@ -526,10 +555,6 @@ struct p9_rstatfs {
526 * @tag: transaction id of the request 555 * @tag: transaction id of the request
527 * @offset: used by marshalling routines to track current position in buffer 556 * @offset: used by marshalling routines to track current position in buffer
528 * @capacity: used by marshalling routines to track total malloc'd capacity 557 * @capacity: used by marshalling routines to track total malloc'd capacity
529 * @pubuf: Payload user buffer given by the caller
530 * @pkbuf: Payload kernel buffer given by the caller
531 * @pbuf_size: pubuf/pkbuf(only one will be !NULL) size to be read/write.
532 * @private: For transport layer's use.
533 * @sdata: payload 558 * @sdata: payload
534 * 559 *
535 * &p9_fcall represents the structure for all 9P RPC 560 * &p9_fcall represents the structure for all 9P RPC
@@ -546,10 +571,6 @@ struct p9_fcall {
546 571
547 size_t offset; 572 size_t offset;
548 size_t capacity; 573 size_t capacity;
549 char __user *pubuf;
550 char *pkbuf;
551 size_t pbuf_size;
552 void *private;
553 574
554 u8 *sdata; 575 u8 *sdata;
555}; 576};
diff --git a/include/net/9p/client.h b/include/net/9p/client.h
index 55ce72ce9861..fc9b90b0c052 100644
--- a/include/net/9p/client.h
+++ b/include/net/9p/client.h
@@ -151,7 +151,7 @@ struct p9_req_t {
151 151
152struct p9_client { 152struct p9_client {
153 spinlock_t lock; /* protect client structure */ 153 spinlock_t lock; /* protect client structure */
154 int msize; 154 unsigned int msize;
155 unsigned char proto_version; 155 unsigned char proto_version;
156 struct p9_trans_module *trans_mod; 156 struct p9_trans_module *trans_mod;
157 enum p9_trans_status status; 157 enum p9_trans_status status;
@@ -240,8 +240,8 @@ int p9_client_read(struct p9_fid *fid, char *data, char __user *udata,
240int 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,
241 u64 offset, u32 count); 241 u64 offset, u32 count);
242int p9_client_readdir(struct p9_fid *fid, char *data, u32 count, u64 offset); 242int p9_client_readdir(struct p9_fid *fid, char *data, u32 count, u64 offset);
243int p9dirent_read(char *buf, int len, struct p9_dirent *dirent, 243int p9dirent_read(struct p9_client *clnt, char *buf, int len,
244 int proto_version); 244 struct p9_dirent *dirent);
245struct p9_wstat *p9_client_stat(struct p9_fid *fid); 245struct p9_wstat *p9_client_stat(struct p9_fid *fid);
246int p9_client_wstat(struct p9_fid *fid, struct p9_wstat *wst); 246int p9_client_wstat(struct p9_fid *fid, struct p9_wstat *wst);
247int p9_client_setattr(struct p9_fid *fid, struct p9_iattr_dotl *attr); 247int p9_client_setattr(struct p9_fid *fid, struct p9_iattr_dotl *attr);
@@ -259,7 +259,7 @@ struct p9_req_t *p9_tag_lookup(struct p9_client *, u16);
259void p9_client_cb(struct p9_client *c, struct p9_req_t *req); 259void p9_client_cb(struct p9_client *c, struct p9_req_t *req);
260 260
261int p9_parse_header(struct p9_fcall *, int32_t *, int8_t *, int16_t *, int); 261int p9_parse_header(struct p9_fcall *, int32_t *, int8_t *, int16_t *, int);
262int p9stat_read(char *, int, struct p9_wstat *, int); 262int p9stat_read(struct p9_client *, char *, int, struct p9_wstat *);
263void p9stat_free(struct p9_wstat *); 263void p9stat_free(struct p9_wstat *);
264 264
265int p9_is_proto_dotu(struct p9_client *clnt); 265int p9_is_proto_dotu(struct p9_client *clnt);
diff --git a/include/net/9p/transport.h b/include/net/9p/transport.h
index 83531ebeee99..adcbb20f6511 100644
--- a/include/net/9p/transport.h
+++ b/include/net/9p/transport.h
@@ -26,13 +26,6 @@
26#ifndef NET_9P_TRANSPORT_H 26#ifndef NET_9P_TRANSPORT_H
27#define NET_9P_TRANSPORT_H 27#define NET_9P_TRANSPORT_H
28 28
29#define P9_TRANS_PREF_PAYLOAD_MASK 0x1
30
31/* Default. Add Payload to PDU before sending it down to transport layer */
32#define P9_TRANS_PREF_PAYLOAD_DEF 0x0
33/* Send pay load separately to transport layer along with PDU.*/
34#define P9_TRANS_PREF_PAYLOAD_SEP 0x1
35
36/** 29/**
37 * struct p9_trans_module - transport module interface 30 * struct p9_trans_module - transport module interface
38 * @list: used to maintain a list of currently available transports 31 * @list: used to maintain a list of currently available transports
@@ -56,13 +49,14 @@ struct p9_trans_module {
56 struct list_head list; 49 struct list_head list;
57 char *name; /* name of transport */ 50 char *name; /* name of transport */
58 int maxsize; /* max message size of transport */ 51 int maxsize; /* max message size of transport */
59 int pref; /* Preferences of this transport */
60 int def; /* this transport should be default */ 52 int def; /* this transport should be default */
61 struct module *owner; 53 struct module *owner;
62 int (*create)(struct p9_client *, const char *, char *); 54 int (*create)(struct p9_client *, const char *, char *);
63 void (*close) (struct p9_client *); 55 void (*close) (struct p9_client *);
64 int (*request) (struct p9_client *, struct p9_req_t *req); 56 int (*request) (struct p9_client *, struct p9_req_t *req);
65 int (*cancel) (struct p9_client *, struct p9_req_t *req); 57 int (*cancel) (struct p9_client *, struct p9_req_t *req);
58 int (*zc_request)(struct p9_client *, struct p9_req_t *,
59 char *, char *, int , int, int, int);
66}; 60};
67 61
68void v9fs_register_trans(struct p9_trans_module *m); 62void v9fs_register_trans(struct p9_trans_module *m);
diff --git a/include/net/addrconf.h b/include/net/addrconf.h
index 582e4ae70753..cbc6bb0a6838 100644
--- a/include/net/addrconf.h
+++ b/include/net/addrconf.h
@@ -8,7 +8,7 @@
8 8
9#define TEMP_VALID_LIFETIME (7*86400) 9#define TEMP_VALID_LIFETIME (7*86400)
10#define TEMP_PREFERRED_LIFETIME (86400) 10#define TEMP_PREFERRED_LIFETIME (86400)
11#define REGEN_MAX_RETRY (5) 11#define REGEN_MAX_RETRY (3)
12#define MAX_DESYNC_FACTOR (600) 12#define MAX_DESYNC_FACTOR (600)
13 13
14#define ADDR_CHECK_FREQUENCY (120*HZ) 14#define ADDR_CHECK_FREQUENCY (120*HZ)
diff --git a/include/net/bluetooth/l2cap.h b/include/net/bluetooth/l2cap.h
index 9280bff55430..875021ad0675 100644
--- a/include/net/bluetooth/l2cap.h
+++ b/include/net/bluetooth/l2cap.h
@@ -45,8 +45,11 @@
45#define L2CAP_DEFAULT_SDU_ITIME 0xFFFFFFFF 45#define L2CAP_DEFAULT_SDU_ITIME 0xFFFFFFFF
46#define L2CAP_DEFAULT_ACC_LAT 0xFFFFFFFF 46#define L2CAP_DEFAULT_ACC_LAT 0xFFFFFFFF
47 47
48#define L2CAP_CONN_TIMEOUT (40000) /* 40 seconds */ 48#define L2CAP_DISC_TIMEOUT (100)
49#define L2CAP_INFO_TIMEOUT (4000) /* 4 seconds */ 49#define L2CAP_DISC_REJ_TIMEOUT (5000) /* 5 seconds */
50#define L2CAP_ENC_TIMEOUT (5000) /* 5 seconds */
51#define L2CAP_CONN_TIMEOUT (40000) /* 40 seconds */
52#define L2CAP_INFO_TIMEOUT (4000) /* 4 seconds */
50 53
51/* L2CAP socket address */ 54/* L2CAP socket address */
52struct sockaddr_l2 { 55struct sockaddr_l2 {
diff --git a/include/net/caif/caif_hsi.h b/include/net/caif/caif_hsi.h
index c5dedd87b4cb..8d552519ff67 100644
--- a/include/net/caif/caif_hsi.h
+++ b/include/net/caif/caif_hsi.h
@@ -52,8 +52,9 @@ struct cfhsi_desc {
52/* 52/*
53 * Maximum bytes transferred in one transfer. 53 * Maximum bytes transferred in one transfer.
54 */ 54 */
55/* TODO: 4096 is temporary... */ 55#define CFHSI_MAX_CAIF_FRAME_SZ 4096
56#define CFHSI_MAX_PAYLOAD_SZ (CFHSI_MAX_PKTS * 4096) 56
57#define CFHSI_MAX_PAYLOAD_SZ (CFHSI_MAX_PKTS * CFHSI_MAX_CAIF_FRAME_SZ)
57 58
58/* Size of the complete HSI TX buffer. */ 59/* Size of the complete HSI TX buffer. */
59#define CFHSI_BUF_SZ_TX (CFHSI_DESC_SZ + CFHSI_MAX_PAYLOAD_SZ) 60#define CFHSI_BUF_SZ_TX (CFHSI_DESC_SZ + CFHSI_MAX_PAYLOAD_SZ)
@@ -75,18 +76,21 @@ struct cfhsi_desc {
75#define CFHSI_WAKE_UP_ACK 1 76#define CFHSI_WAKE_UP_ACK 1
76#define CFHSI_WAKE_DOWN_ACK 2 77#define CFHSI_WAKE_DOWN_ACK 2
77#define CFHSI_AWAKE 3 78#define CFHSI_AWAKE 3
78#define CFHSI_PENDING_RX 4 79#define CFHSI_WAKELOCK_HELD 4
79#define CFHSI_SHUTDOWN 6 80#define CFHSI_SHUTDOWN 5
80#define CFHSI_FLUSH_FIFO 7 81#define CFHSI_FLUSH_FIFO 6
81 82
82#ifndef CFHSI_INACTIVITY_TOUT 83#ifndef CFHSI_INACTIVITY_TOUT
83#define CFHSI_INACTIVITY_TOUT (1 * HZ) 84#define CFHSI_INACTIVITY_TOUT (1 * HZ)
84#endif /* CFHSI_INACTIVITY_TOUT */ 85#endif /* CFHSI_INACTIVITY_TOUT */
85 86
86#ifndef CFHSI_WAKEUP_TOUT 87#ifndef CFHSI_WAKE_TOUT
87#define CFHSI_WAKEUP_TOUT (3 * HZ) 88#define CFHSI_WAKE_TOUT (3 * HZ)
88#endif /* CFHSI_WAKEUP_TOUT */ 89#endif /* CFHSI_WAKE_TOUT */
89 90
91#ifndef CFHSI_MAX_RX_RETRIES
92#define CFHSI_MAX_RX_RETRIES (10 * HZ)
93#endif
90 94
91/* Structure implemented by the CAIF HSI driver. */ 95/* Structure implemented by the CAIF HSI driver. */
92struct cfhsi_drv { 96struct cfhsi_drv {
@@ -104,11 +108,21 @@ struct cfhsi_dev {
104 int (*cfhsi_rx) (u8 *ptr, int len, struct cfhsi_dev *dev); 108 int (*cfhsi_rx) (u8 *ptr, int len, struct cfhsi_dev *dev);
105 int (*cfhsi_wake_up) (struct cfhsi_dev *dev); 109 int (*cfhsi_wake_up) (struct cfhsi_dev *dev);
106 int (*cfhsi_wake_down) (struct cfhsi_dev *dev); 110 int (*cfhsi_wake_down) (struct cfhsi_dev *dev);
111 int (*cfhsi_get_peer_wake) (struct cfhsi_dev *dev, bool *status);
107 int (*cfhsi_fifo_occupancy)(struct cfhsi_dev *dev, size_t *occupancy); 112 int (*cfhsi_fifo_occupancy)(struct cfhsi_dev *dev, size_t *occupancy);
108 int (*cfhsi_rx_cancel)(struct cfhsi_dev *dev); 113 int (*cfhsi_rx_cancel)(struct cfhsi_dev *dev);
109 struct cfhsi_drv *drv; 114 struct cfhsi_drv *drv;
110}; 115};
111 116
117/* Structure holds status of received CAIF frames processing */
118struct cfhsi_rx_state {
119 int state;
120 int nfrms;
121 int pld_len;
122 int retries;
123 bool piggy_desc;
124};
125
112/* Structure implemented by CAIF HSI drivers. */ 126/* Structure implemented by CAIF HSI drivers. */
113struct cfhsi { 127struct cfhsi {
114 struct caif_dev_common cfdev; 128 struct caif_dev_common cfdev;
@@ -118,7 +132,8 @@ struct cfhsi {
118 struct cfhsi_drv drv; 132 struct cfhsi_drv drv;
119 struct cfhsi_dev *dev; 133 struct cfhsi_dev *dev;
120 int tx_state; 134 int tx_state;
121 int rx_state; 135 struct cfhsi_rx_state rx_state;
136 unsigned long inactivity_timeout;
122 int rx_len; 137 int rx_len;
123 u8 *rx_ptr; 138 u8 *rx_ptr;
124 u8 *tx_buf; 139 u8 *tx_buf;
@@ -130,13 +145,13 @@ struct cfhsi {
130 struct list_head list; 145 struct list_head list;
131 struct work_struct wake_up_work; 146 struct work_struct wake_up_work;
132 struct work_struct wake_down_work; 147 struct work_struct wake_down_work;
133 struct work_struct rx_done_work; 148 struct work_struct out_of_sync_work;
134 struct work_struct tx_done_work;
135 struct workqueue_struct *wq; 149 struct workqueue_struct *wq;
136 wait_queue_head_t wake_up_wait; 150 wait_queue_head_t wake_up_wait;
137 wait_queue_head_t wake_down_wait; 151 wait_queue_head_t wake_down_wait;
138 wait_queue_head_t flush_fifo_wait; 152 wait_queue_head_t flush_fifo_wait;
139 struct timer_list timer; 153 struct timer_list timer;
154 struct timer_list rx_slowpath_timer;
140 unsigned long bits; 155 unsigned long bits;
141}; 156};
142 157
diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h
index ccfdf3f63ce5..95852e36713b 100644
--- a/include/net/cfg80211.h
+++ b/include/net/cfg80211.h
@@ -424,6 +424,17 @@ enum plink_actions {
424}; 424};
425 425
426/** 426/**
427 * enum station_parameters_apply_mask - station parameter values to apply
428 * @STATION_PARAM_APPLY_UAPSD: apply new uAPSD parameters (uapsd_queues, max_sp)
429 *
430 * Not all station parameters have in-band "no change" signalling,
431 * for those that don't these flags will are used.
432 */
433enum station_parameters_apply_mask {
434 STATION_PARAM_APPLY_UAPSD = BIT(0),
435};
436
437/**
427 * struct station_parameters - station parameters 438 * struct station_parameters - station parameters
428 * 439 *
429 * Used to change and create a new station. 440 * Used to change and create a new station.
@@ -445,11 +456,15 @@ enum plink_actions {
445 * as the AC bitmap in the QoS info field 456 * as the AC bitmap in the QoS info field
446 * @max_sp: max Service Period. same format as the MAX_SP in the 457 * @max_sp: max Service Period. same format as the MAX_SP in the
447 * QoS info field (but already shifted down) 458 * QoS info field (but already shifted down)
459 * @sta_modify_mask: bitmap indicating which parameters changed
460 * (for those that don't have a natural "no change" value),
461 * see &enum station_parameters_apply_mask
448 */ 462 */
449struct station_parameters { 463struct station_parameters {
450 u8 *supported_rates; 464 u8 *supported_rates;
451 struct net_device *vlan; 465 struct net_device *vlan;
452 u32 sta_flags_mask, sta_flags_set; 466 u32 sta_flags_mask, sta_flags_set;
467 u32 sta_modify_mask;
453 int listen_interval; 468 int listen_interval;
454 u16 aid; 469 u16 aid;
455 u8 supported_rates_len; 470 u8 supported_rates_len;
@@ -485,6 +500,7 @@ struct station_parameters {
485 * @STATION_INFO_BSS_PARAM: @bss_param filled 500 * @STATION_INFO_BSS_PARAM: @bss_param filled
486 * @STATION_INFO_CONNECTED_TIME: @connected_time filled 501 * @STATION_INFO_CONNECTED_TIME: @connected_time filled
487 * @STATION_INFO_ASSOC_REQ_IES: @assoc_req_ies filled 502 * @STATION_INFO_ASSOC_REQ_IES: @assoc_req_ies filled
503 * @STATION_INFO_STA_FLAGS: @sta_flags filled
488 */ 504 */
489enum station_info_flags { 505enum station_info_flags {
490 STATION_INFO_INACTIVE_TIME = 1<<0, 506 STATION_INFO_INACTIVE_TIME = 1<<0,
@@ -504,7 +520,8 @@ enum station_info_flags {
504 STATION_INFO_RX_BITRATE = 1<<14, 520 STATION_INFO_RX_BITRATE = 1<<14,
505 STATION_INFO_BSS_PARAM = 1<<15, 521 STATION_INFO_BSS_PARAM = 1<<15,
506 STATION_INFO_CONNECTED_TIME = 1<<16, 522 STATION_INFO_CONNECTED_TIME = 1<<16,
507 STATION_INFO_ASSOC_REQ_IES = 1<<17 523 STATION_INFO_ASSOC_REQ_IES = 1<<17,
524 STATION_INFO_STA_FLAGS = 1<<18
508}; 525};
509 526
510/** 527/**
@@ -601,6 +618,7 @@ struct sta_bss_parameters {
601 * user space MLME/SME implementation. The information is provided for 618 * user space MLME/SME implementation. The information is provided for
602 * the cfg80211_new_sta() calls to notify user space of the IEs. 619 * the cfg80211_new_sta() calls to notify user space of the IEs.
603 * @assoc_req_ies_len: Length of assoc_req_ies buffer in octets. 620 * @assoc_req_ies_len: Length of assoc_req_ies buffer in octets.
621 * @sta_flags: station flags mask & values
604 */ 622 */
605struct station_info { 623struct station_info {
606 u32 filled; 624 u32 filled;
@@ -621,6 +639,7 @@ struct station_info {
621 u32 tx_failed; 639 u32 tx_failed;
622 u32 rx_dropped_misc; 640 u32 rx_dropped_misc;
623 struct sta_bss_parameters bss_param; 641 struct sta_bss_parameters bss_param;
642 struct nl80211_sta_flag_update sta_flags;
624 643
625 int generation; 644 int generation;
626 645
@@ -860,6 +879,7 @@ struct cfg80211_ssid {
860 * @wiphy: the wiphy this was for 879 * @wiphy: the wiphy this was for
861 * @dev: the interface 880 * @dev: the interface
862 * @aborted: (internal) scan request was notified as aborted 881 * @aborted: (internal) scan request was notified as aborted
882 * @no_cck: used to send probe requests at non CCK rate in 2GHz band
863 */ 883 */
864struct cfg80211_scan_request { 884struct cfg80211_scan_request {
865 struct cfg80211_ssid *ssids; 885 struct cfg80211_ssid *ssids;
@@ -874,6 +894,7 @@ struct cfg80211_scan_request {
874 struct wiphy *wiphy; 894 struct wiphy *wiphy;
875 struct net_device *dev; 895 struct net_device *dev;
876 bool aborted; 896 bool aborted;
897 bool no_cck;
877 898
878 /* keep last */ 899 /* keep last */
879 struct ieee80211_channel *channels[0]; 900 struct ieee80211_channel *channels[0];
@@ -1408,6 +1429,9 @@ struct cfg80211_gtk_rekey_data {
1408 * @set_ringparam: Set tx and rx ring sizes. 1429 * @set_ringparam: Set tx and rx ring sizes.
1409 * 1430 *
1410 * @get_ringparam: Get tx and rx ring current and maximum sizes. 1431 * @get_ringparam: Get tx and rx ring current and maximum sizes.
1432 *
1433 * @tdls_mgmt: Transmit a TDLS management frame.
1434 * @tdls_oper: Perform a high-level TDLS operation (e.g. TDLS link setup).
1411 */ 1435 */
1412struct cfg80211_ops { 1436struct cfg80211_ops {
1413 int (*suspend)(struct wiphy *wiphy, struct cfg80211_wowlan *wow); 1437 int (*suspend)(struct wiphy *wiphy, struct cfg80211_wowlan *wow);
@@ -1484,7 +1508,7 @@ struct cfg80211_ops {
1484 int (*change_bss)(struct wiphy *wiphy, struct net_device *dev, 1508 int (*change_bss)(struct wiphy *wiphy, struct net_device *dev,
1485 struct bss_parameters *params); 1509 struct bss_parameters *params);
1486 1510
1487 int (*set_txq_params)(struct wiphy *wiphy, 1511 int (*set_txq_params)(struct wiphy *wiphy, struct net_device *dev,
1488 struct ieee80211_txq_params *params); 1512 struct ieee80211_txq_params *params);
1489 1513
1490 int (*set_channel)(struct wiphy *wiphy, struct net_device *dev, 1514 int (*set_channel)(struct wiphy *wiphy, struct net_device *dev,
@@ -1560,7 +1584,8 @@ struct cfg80211_ops {
1560 struct ieee80211_channel *chan, bool offchan, 1584 struct ieee80211_channel *chan, bool offchan,
1561 enum nl80211_channel_type channel_type, 1585 enum nl80211_channel_type channel_type,
1562 bool channel_type_valid, unsigned int wait, 1586 bool channel_type_valid, unsigned int wait,
1563 const u8 *buf, size_t len, u64 *cookie); 1587 const u8 *buf, size_t len, bool no_cck,
1588 u64 *cookie);
1564 int (*mgmt_tx_cancel_wait)(struct wiphy *wiphy, 1589 int (*mgmt_tx_cancel_wait)(struct wiphy *wiphy,
1565 struct net_device *dev, 1590 struct net_device *dev,
1566 u64 cookie); 1591 u64 cookie);
@@ -1590,6 +1615,12 @@ struct cfg80211_ops {
1590 1615
1591 int (*set_rekey_data)(struct wiphy *wiphy, struct net_device *dev, 1616 int (*set_rekey_data)(struct wiphy *wiphy, struct net_device *dev,
1592 struct cfg80211_gtk_rekey_data *data); 1617 struct cfg80211_gtk_rekey_data *data);
1618
1619 int (*tdls_mgmt)(struct wiphy *wiphy, struct net_device *dev,
1620 u8 *peer, u8 action_code, u8 dialog_token,
1621 u16 status_code, const u8 *buf, size_t len);
1622 int (*tdls_oper)(struct wiphy *wiphy, struct net_device *dev,
1623 u8 *peer, enum nl80211_tdls_operation oper);
1593}; 1624};
1594 1625
1595/* 1626/*
@@ -1642,6 +1673,12 @@ struct cfg80211_ops {
1642 * @WIPHY_FLAG_SUPPORTS_FW_ROAM: The device supports roaming feature in the 1673 * @WIPHY_FLAG_SUPPORTS_FW_ROAM: The device supports roaming feature in the
1643 * firmware. 1674 * firmware.
1644 * @WIPHY_FLAG_AP_UAPSD: The device supports uapsd on AP. 1675 * @WIPHY_FLAG_AP_UAPSD: The device supports uapsd on AP.
1676 * @WIPHY_FLAG_SUPPORTS_TDLS: The device supports TDLS (802.11z) operation.
1677 * @WIPHY_FLAG_TDLS_EXTERNAL_SETUP: The device does not handle TDLS (802.11z)
1678 * link setup/discovery operations internally. Setup, discovery and
1679 * teardown packets should be sent through the @NL80211_CMD_TDLS_MGMT
1680 * command. When this flag is not set, @NL80211_CMD_TDLS_OPER should be
1681 * used for asking the driver/firmware to perform a TDLS operation.
1645 */ 1682 */
1646enum wiphy_flags { 1683enum wiphy_flags {
1647 WIPHY_FLAG_CUSTOM_REGULATORY = BIT(0), 1684 WIPHY_FLAG_CUSTOM_REGULATORY = BIT(0),
@@ -1658,6 +1695,8 @@ enum wiphy_flags {
1658 WIPHY_FLAG_ENFORCE_COMBINATIONS = BIT(12), 1695 WIPHY_FLAG_ENFORCE_COMBINATIONS = BIT(12),
1659 WIPHY_FLAG_SUPPORTS_FW_ROAM = BIT(13), 1696 WIPHY_FLAG_SUPPORTS_FW_ROAM = BIT(13),
1660 WIPHY_FLAG_AP_UAPSD = BIT(14), 1697 WIPHY_FLAG_AP_UAPSD = BIT(14),
1698 WIPHY_FLAG_SUPPORTS_TDLS = BIT(15),
1699 WIPHY_FLAG_TDLS_EXTERNAL_SETUP = BIT(16),
1661}; 1700};
1662 1701
1663/** 1702/**
diff --git a/include/net/cipso_ipv4.h b/include/net/cipso_ipv4.h
index 3b938743514b..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
diff --git a/include/net/dcbevent.h b/include/net/dcbevent.h
index bc1e7ef40171..443626ed4cbc 100644
--- a/include/net/dcbevent.h
+++ b/include/net/dcbevent.h
@@ -24,8 +24,26 @@ enum dcbevent_notif_type {
24 DCB_APP_EVENT = 1, 24 DCB_APP_EVENT = 1,
25}; 25};
26 26
27#ifdef CONFIG_DCB
27extern int register_dcbevent_notifier(struct notifier_block *nb); 28extern int register_dcbevent_notifier(struct notifier_block *nb);
28extern int unregister_dcbevent_notifier(struct notifier_block *nb); 29extern int unregister_dcbevent_notifier(struct notifier_block *nb);
29extern int call_dcbevent_notifiers(unsigned long val, void *v); 30extern int call_dcbevent_notifiers(unsigned long val, void *v);
31#else
32static inline int
33register_dcbevent_notifier(struct notifier_block *nb)
34{
35 return 0;
36}
37
38static inline int unregister_dcbevent_notifier(struct notifier_block *nb)
39{
40 return 0;
41}
42
43static inline int call_dcbevent_notifiers(unsigned long val, void *v)
44{
45 return 0;
46}
47#endif /* CONFIG_DCB */
30 48
31#endif 49#endif
diff --git a/include/net/dcbnl.h b/include/net/dcbnl.h
index f5aa39997f0b..2cd66d0be348 100644
--- a/include/net/dcbnl.h
+++ b/include/net/dcbnl.h
@@ -23,9 +23,10 @@
23#include <linux/dcbnl.h> 23#include <linux/dcbnl.h>
24 24
25struct dcb_app_type { 25struct dcb_app_type {
26 char name[IFNAMSIZ]; 26 int ifindex;
27 struct dcb_app app; 27 struct dcb_app app;
28 struct list_head list; 28 struct list_head list;
29 u8 dcbx;
29}; 30};
30 31
31int dcb_setapp(struct net_device *, struct dcb_app *); 32int dcb_setapp(struct net_device *, struct dcb_app *);
diff --git a/include/net/dst.h b/include/net/dst.h
index 29e255796ce1..4fb6c4381791 100644
--- a/include/net/dst.h
+++ b/include/net/dst.h
@@ -37,7 +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#ifdef CONFIG_XFRM 41#ifdef CONFIG_XFRM
42 struct xfrm_state *xfrm; 42 struct xfrm_state *xfrm;
43#else 43#else
@@ -88,12 +88,17 @@ struct dst_entry {
88 88
89static inline struct neighbour *dst_get_neighbour(struct dst_entry *dst) 89static inline struct neighbour *dst_get_neighbour(struct dst_entry *dst)
90{ 90{
91 return dst->_neighbour; 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);
92} 97}
93 98
94static inline void dst_set_neighbour(struct dst_entry *dst, struct neighbour *neigh) 99static inline void dst_set_neighbour(struct dst_entry *dst, struct neighbour *neigh)
95{ 100{
96 dst->_neighbour = neigh; 101 rcu_assign_pointer(dst->_neighbour, neigh);
97} 102}
98 103
99extern 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);
@@ -320,7 +325,14 @@ static inline void skb_dst_force(struct sk_buff *skb)
320static inline void __skb_tunnel_rx(struct sk_buff *skb, struct net_device *dev) 325static inline void __skb_tunnel_rx(struct sk_buff *skb, struct net_device *dev)
321{ 326{
322 skb->dev = dev; 327 skb->dev = dev;
323 skb->rxhash = 0; 328
329 /*
330 * Clear rxhash so that we can recalulate the hash for the
331 * encapsulated packet, unless we have already determine the hash
332 * over the L4 4-tuple.
333 */
334 if (!skb->l4_rxhash)
335 skb->rxhash = 0;
324 skb_set_queue_mapping(skb, 0); 336 skb_set_queue_mapping(skb, 0);
325 skb_dst_drop(skb); 337 skb_dst_drop(skb);
326 nf_reset(skb); 338 nf_reset(skb);
@@ -382,8 +394,12 @@ static inline void dst_rcu_free(struct rcu_head *head)
382static inline void dst_confirm(struct dst_entry *dst) 394static inline void dst_confirm(struct dst_entry *dst)
383{ 395{
384 if (dst) { 396 if (dst) {
385 struct neighbour *n = dst_get_neighbour(dst); 397 struct neighbour *n;
398
399 rcu_read_lock();
400 n = dst_get_neighbour(dst);
386 neigh_confirm(n); 401 neigh_confirm(n);
402 rcu_read_unlock();
387 } 403 }
388} 404}
389 405
diff --git a/include/net/flow.h b/include/net/flow.h
index 78113daadd63..a09447749e2d 100644
--- a/include/net/flow.h
+++ b/include/net/flow.h
@@ -7,6 +7,7 @@
7#ifndef _NET_FLOW_H 7#ifndef _NET_FLOW_H
8#define _NET_FLOW_H 8#define _NET_FLOW_H
9 9
10#include <linux/socket.h>
10#include <linux/in6.h> 11#include <linux/in6.h>
11#include <linux/atomic.h> 12#include <linux/atomic.h>
12 13
@@ -68,7 +69,7 @@ struct flowi4 {
68#define fl4_ipsec_spi uli.spi 69#define fl4_ipsec_spi uli.spi
69#define fl4_mh_type uli.mht.type 70#define fl4_mh_type uli.mht.type
70#define fl4_gre_key uli.gre_key 71#define fl4_gre_key uli.gre_key
71}; 72} __attribute__((__aligned__(BITS_PER_LONG/8)));
72 73
73static inline void flowi4_init_output(struct flowi4 *fl4, int oif, 74static inline void flowi4_init_output(struct flowi4 *fl4, int oif,
74 __u32 mark, __u8 tos, __u8 scope, 75 __u32 mark, __u8 tos, __u8 scope,
@@ -112,7 +113,7 @@ struct flowi6 {
112#define fl6_ipsec_spi uli.spi 113#define fl6_ipsec_spi uli.spi
113#define fl6_mh_type uli.mht.type 114#define fl6_mh_type uli.mht.type
114#define fl6_gre_key uli.gre_key 115#define fl6_gre_key uli.gre_key
115}; 116} __attribute__((__aligned__(BITS_PER_LONG/8)));
116 117
117struct flowidn { 118struct flowidn {
118 struct flowi_common __fl_common; 119 struct flowi_common __fl_common;
@@ -127,7 +128,7 @@ struct flowidn {
127 union flowi_uli uli; 128 union flowi_uli uli;
128#define fld_sport uli.ports.sport 129#define fld_sport uli.ports.sport
129#define fld_dport uli.ports.dport 130#define fld_dport uli.ports.dport
130}; 131} __attribute__((__aligned__(BITS_PER_LONG/8)));
131 132
132struct flowi { 133struct flowi {
133 union { 134 union {
@@ -161,6 +162,24 @@ static inline struct flowi *flowidn_to_flowi(struct flowidn *fldn)
161 return container_of(fldn, struct flowi, u.dn); 162 return container_of(fldn, struct flowi, u.dn);
162} 163}
163 164
165typedef unsigned long flow_compare_t;
166
167static inline size_t flow_key_size(u16 family)
168{
169 switch (family) {
170 case AF_INET:
171 BUILD_BUG_ON(sizeof(struct flowi4) % sizeof(flow_compare_t));
172 return sizeof(struct flowi4) / sizeof(flow_compare_t);
173 case AF_INET6:
174 BUILD_BUG_ON(sizeof(struct flowi6) % sizeof(flow_compare_t));
175 return sizeof(struct flowi6) / sizeof(flow_compare_t);
176 case AF_DECnet:
177 BUILD_BUG_ON(sizeof(struct flowidn) % sizeof(flow_compare_t));
178 return sizeof(struct flowidn) / sizeof(flow_compare_t);
179 }
180 return 0;
181}
182
164#define FLOW_DIR_IN 0 183#define FLOW_DIR_IN 0
165#define FLOW_DIR_OUT 1 184#define FLOW_DIR_OUT 1
166#define FLOW_DIR_FWD 2 185#define FLOW_DIR_FWD 2
diff --git a/include/net/ieee80211_radiotap.h b/include/net/ieee80211_radiotap.h
index b0be5fb9de19..7e2c4d483ad0 100644
--- a/include/net/ieee80211_radiotap.h
+++ b/include/net/ieee80211_radiotap.h
@@ -251,6 +251,7 @@ enum ieee80211_radiotap_type {
251 * retries */ 251 * retries */
252#define IEEE80211_RADIOTAP_F_TX_CTS 0x0002 /* used cts 'protection' */ 252#define IEEE80211_RADIOTAP_F_TX_CTS 0x0002 /* used cts 'protection' */
253#define IEEE80211_RADIOTAP_F_TX_RTS 0x0004 /* used rts/cts handshake */ 253#define IEEE80211_RADIOTAP_F_TX_RTS 0x0004 /* used rts/cts handshake */
254#define IEEE80211_RADIOTAP_F_TX_NOACK 0x0008 /* don't expect an ack */
254 255
255 256
256/* For IEEE80211_RADIOTAP_MCS */ 257/* For IEEE80211_RADIOTAP_MCS */
diff --git a/include/net/if_inet6.h b/include/net/if_inet6.h
index 11cf373970a9..51a7031b4aa3 100644
--- a/include/net/if_inet6.h
+++ b/include/net/if_inet6.h
@@ -41,6 +41,7 @@ struct inet6_ifaddr {
41 struct in6_addr addr; 41 struct in6_addr addr;
42 __u32 prefix_len; 42 __u32 prefix_len;
43 43
44 /* In seconds, relative to tstamp. Expiry is at tstamp + HZ * lft. */
44 __u32 valid_lft; 45 __u32 valid_lft;
45 __u32 prefered_lft; 46 __u32 prefered_lft;
46 atomic_t refcnt; 47 atomic_t refcnt;
diff --git a/include/net/inet_ecn.h b/include/net/inet_ecn.h
index 2fa8d1341a0a..2fa14691869c 100644
--- a/include/net/inet_ecn.h
+++ b/include/net/inet_ecn.h
@@ -30,6 +30,14 @@ static inline int INET_ECN_is_capable(__u8 dsfield)
30 return dsfield & INET_ECN_ECT_0; 30 return dsfield & INET_ECN_ECT_0;
31} 31}
32 32
33/*
34 * RFC 3168 9.1.1
35 * The full-functionality option for ECN encapsulation is to copy the
36 * ECN codepoint of the inside header to the outside header on
37 * encapsulation if the inside header is not-ECT or ECT, and to set the
38 * ECN codepoint of the outside header to ECT(0) if the ECN codepoint of
39 * the inside header is CE.
40 */
33static inline __u8 INET_ECN_encapsulate(__u8 outer, __u8 inner) 41static inline __u8 INET_ECN_encapsulate(__u8 outer, __u8 inner)
34{ 42{
35 outer &= ~INET_ECN_MASK; 43 outer &= ~INET_ECN_MASK;
diff --git a/include/net/inet_sock.h b/include/net/inet_sock.h
index caaff5f5f39f..b897d6e6d0a5 100644
--- a/include/net/inet_sock.h
+++ b/include/net/inet_sock.h
@@ -238,7 +238,7 @@ static inline __u8 inet_sk_flowi_flags(const struct sock *sk)
238{ 238{
239 __u8 flags = 0; 239 __u8 flags = 0;
240 240
241 if (inet_sk(sk)->transparent) 241 if (inet_sk(sk)->transparent || inet_sk(sk)->hdrincl)
242 flags |= FLOWI_FLAG_ANYSRC; 242 flags |= FLOWI_FLAG_ANYSRC;
243 if (sk->sk_protocol == IPPROTO_TCP) 243 if (sk->sk_protocol == IPPROTO_TCP)
244 flags |= FLOWI_FLAG_PRECOW_METRICS; 244 flags |= FLOWI_FLAG_PRECOW_METRICS;
diff --git a/include/net/inet_timewait_sock.h b/include/net/inet_timewait_sock.h
index f1a770977c4f..f91a1fb5da7c 100644
--- a/include/net/inet_timewait_sock.h
+++ b/include/net/inet_timewait_sock.h
@@ -126,13 +126,15 @@ struct inet_timewait_sock {
126 /* And these are ours. */ 126 /* And these are ours. */
127 unsigned int tw_ipv6only : 1, 127 unsigned int tw_ipv6only : 1,
128 tw_transparent : 1, 128 tw_transparent : 1,
129 tw_pad : 14, /* 14 bits hole */ 129 tw_pad : 6, /* 6 bits hole */
130 tw_tos : 8,
130 tw_ipv6_offset : 16; 131 tw_ipv6_offset : 16;
131 kmemcheck_bitfield_end(flags); 132 kmemcheck_bitfield_end(flags);
132 unsigned long tw_ttd; 133 unsigned long tw_ttd;
133 struct inet_bind_bucket *tw_tb; 134 struct inet_bind_bucket *tw_tb;
134 struct hlist_node tw_death_node; 135 struct hlist_node tw_death_node;
135}; 136};
137#define tw_tclass tw_tos
136 138
137static inline void inet_twsk_add_node_rcu(struct inet_timewait_sock *tw, 139static inline void inet_twsk_add_node_rcu(struct inet_timewait_sock *tw,
138 struct hlist_nulls_head *list) 140 struct hlist_nulls_head *list)
diff --git a/include/net/ip.h b/include/net/ip.h
index aa76c7a4d9c3..eca0ef7a495e 100644
--- a/include/net/ip.h
+++ b/include/net/ip.h
@@ -165,6 +165,7 @@ struct ip_reply_arg {
165 int csumoffset; /* u16 offset of csum in iov[0].iov_base */ 165 int csumoffset; /* u16 offset of csum in iov[0].iov_base */
166 /* -1 if not needed */ 166 /* -1 if not needed */
167 int bound_dev_if; 167 int bound_dev_if;
168 u8 tos;
168}; 169};
169 170
170#define IP_REPLY_ARG_NOSRCCHECK 1 171#define IP_REPLY_ARG_NOSRCCHECK 1
@@ -175,7 +176,7 @@ static inline __u8 ip_reply_arg_flowi_flags(const struct ip_reply_arg *arg)
175} 176}
176 177
177void ip_send_reply(struct sock *sk, struct sk_buff *skb, __be32 daddr, 178void ip_send_reply(struct sock *sk, struct sk_buff *skb, __be32 daddr,
178 struct ip_reply_arg *arg, unsigned int len); 179 const struct ip_reply_arg *arg, unsigned int len);
179 180
180struct ipv4_config { 181struct ipv4_config {
181 int log_martians; 182 int log_martians;
@@ -406,9 +407,18 @@ enum ip_defrag_users {
406 IP_DEFRAG_VS_OUT, 407 IP_DEFRAG_VS_OUT,
407 IP_DEFRAG_VS_FWD, 408 IP_DEFRAG_VS_FWD,
408 IP_DEFRAG_AF_PACKET, 409 IP_DEFRAG_AF_PACKET,
410 IP_DEFRAG_MACVLAN,
409}; 411};
410 412
411int ip_defrag(struct sk_buff *skb, u32 user); 413int ip_defrag(struct sk_buff *skb, u32 user);
414#ifdef CONFIG_INET
415struct sk_buff *ip_check_defrag(struct sk_buff *skb, u32 user);
416#else
417static inline struct sk_buff *ip_check_defrag(struct sk_buff *skb, u32 user)
418{
419 return skb;
420}
421#endif
412int ip_frag_mem(struct net *net); 422int ip_frag_mem(struct net *net);
413int ip_frag_nqueues(struct net *net); 423int ip_frag_nqueues(struct net *net);
414 424
diff --git a/include/net/ip_vs.h b/include/net/ip_vs.h
index 1aaf915656f3..8fa4430f99c1 100644
--- a/include/net/ip_vs.h
+++ b/include/net/ip_vs.h
@@ -900,6 +900,7 @@ struct netns_ipvs {
900 volatile int sync_state; 900 volatile int sync_state;
901 volatile int master_syncid; 901 volatile int master_syncid;
902 volatile int backup_syncid; 902 volatile int backup_syncid;
903 struct mutex sync_mutex;
903 /* multicast interface name */ 904 /* multicast interface name */
904 char master_mcast_ifn[IP_VS_IFNAME_MAXLEN]; 905 char master_mcast_ifn[IP_VS_IFNAME_MAXLEN];
905 char backup_mcast_ifn[IP_VS_IFNAME_MAXLEN]; 906 char backup_mcast_ifn[IP_VS_IFNAME_MAXLEN];
diff --git a/include/net/ipv6.h b/include/net/ipv6.h
index 3b5ac1fbff39..a366a8a1fe23 100644
--- a/include/net/ipv6.h
+++ b/include/net/ipv6.h
@@ -486,7 +486,8 @@ extern int ip6_rcv_finish(struct sk_buff *skb);
486extern int ip6_xmit(struct sock *sk, 486extern int ip6_xmit(struct sock *sk,
487 struct sk_buff *skb, 487 struct sk_buff *skb,
488 struct flowi6 *fl6, 488 struct flowi6 *fl6,
489 struct ipv6_txoptions *opt); 489 struct ipv6_txoptions *opt,
490 int tclass);
490 491
491extern int ip6_nd_hdr(struct sock *sk, 492extern int ip6_nd_hdr(struct sock *sk,
492 struct sk_buff *skb, 493 struct sk_buff *skb,
diff --git a/include/net/iucv/af_iucv.h b/include/net/iucv/af_iucv.h
index f82a1e877372..f2419cf44cef 100644
--- a/include/net/iucv/af_iucv.h
+++ b/include/net/iucv/af_iucv.h
@@ -14,6 +14,7 @@
14#include <linux/list.h> 14#include <linux/list.h>
15#include <linux/poll.h> 15#include <linux/poll.h>
16#include <linux/socket.h> 16#include <linux/socket.h>
17#include <net/iucv/iucv.h>
17 18
18#ifndef AF_IUCV 19#ifndef AF_IUCV
19#define AF_IUCV 32 20#define AF_IUCV 32
@@ -33,6 +34,7 @@ enum {
33}; 34};
34 35
35#define IUCV_QUEUELEN_DEFAULT 65535 36#define IUCV_QUEUELEN_DEFAULT 65535
37#define IUCV_HIPER_MSGLIM_DEFAULT 128
36#define IUCV_CONN_TIMEOUT (HZ * 40) 38#define IUCV_CONN_TIMEOUT (HZ * 40)
37#define IUCV_DISCONN_TIMEOUT (HZ * 2) 39#define IUCV_DISCONN_TIMEOUT (HZ * 2)
38#define IUCV_CONN_IDLE_TIMEOUT (HZ * 60) 40#define IUCV_CONN_IDLE_TIMEOUT (HZ * 60)
@@ -57,8 +59,51 @@ struct sock_msg_q {
57 spinlock_t lock; 59 spinlock_t lock;
58}; 60};
59 61
62#define AF_IUCV_FLAG_ACK 0x1
63#define AF_IUCV_FLAG_SYN 0x2
64#define AF_IUCV_FLAG_FIN 0x4
65#define AF_IUCV_FLAG_WIN 0x8
66
67struct af_iucv_trans_hdr {
68 u16 magic;
69 u8 version;
70 u8 flags;
71 u16 window;
72 char destNodeID[8];
73 char destUserID[8];
74 char destAppName[16];
75 char srcNodeID[8];
76 char srcUserID[8];
77 char srcAppName[16]; /* => 70 bytes */
78 struct iucv_message iucv_hdr; /* => 33 bytes */
79 u8 pad; /* total 104 bytes */
80} __packed;
81
82enum iucv_tx_notify {
83 /* transmission of skb is completed and was successful */
84 TX_NOTIFY_OK = 0,
85 /* target is unreachable */
86 TX_NOTIFY_UNREACHABLE = 1,
87 /* transfer pending queue full */
88 TX_NOTIFY_TPQFULL = 2,
89 /* general error */
90 TX_NOTIFY_GENERALERROR = 3,
91 /* transmission of skb is pending - may interleave
92 * with TX_NOTIFY_DELAYED_* */
93 TX_NOTIFY_PENDING = 4,
94 /* transmission of skb was done successfully (delayed) */
95 TX_NOTIFY_DELAYED_OK = 5,
96 /* target unreachable (detected delayed) */
97 TX_NOTIFY_DELAYED_UNREACHABLE = 6,
98 /* general error (detected delayed) */
99 TX_NOTIFY_DELAYED_GENERALERROR = 7,
100};
101
60#define iucv_sk(__sk) ((struct iucv_sock *) __sk) 102#define iucv_sk(__sk) ((struct iucv_sock *) __sk)
61 103
104#define AF_IUCV_TRANS_IUCV 0
105#define AF_IUCV_TRANS_HIPER 1
106
62struct iucv_sock { 107struct iucv_sock {
63 struct sock sk; 108 struct sock sk;
64 char src_user_id[8]; 109 char src_user_id[8];
@@ -75,6 +120,13 @@ struct iucv_sock {
75 unsigned int send_tag; 120 unsigned int send_tag;
76 u8 flags; 121 u8 flags;
77 u16 msglimit; 122 u16 msglimit;
123 u16 msglimit_peer;
124 atomic_t msg_sent;
125 atomic_t msg_recv;
126 atomic_t pendings;
127 int transport;
128 void (*sk_txnotify)(struct sk_buff *skb,
129 enum iucv_tx_notify n);
78}; 130};
79 131
80/* iucv socket options (SOL_IUCV) */ 132/* iucv socket options (SOL_IUCV) */
diff --git a/include/net/iucv/iucv.h b/include/net/iucv/iucv.h
index 1121baa9f695..0894ced31957 100644
--- a/include/net/iucv/iucv.h
+++ b/include/net/iucv/iucv.h
@@ -120,7 +120,7 @@ struct iucv_message {
120 u32 reply_size; 120 u32 reply_size;
121 u8 rmmsg[8]; 121 u8 rmmsg[8];
122 u8 flags; 122 u8 flags;
123}; 123} __packed;
124 124
125/* 125/*
126 * struct iucv_handler 126 * struct iucv_handler
@@ -459,3 +459,37 @@ int __iucv_message_send(struct iucv_path *path, struct iucv_message *msg,
459int iucv_message_send2way(struct iucv_path *path, struct iucv_message *msg, 459int iucv_message_send2way(struct iucv_path *path, struct iucv_message *msg,
460 u8 flags, u32 srccls, void *buffer, size_t size, 460 u8 flags, u32 srccls, void *buffer, size_t size,
461 void *answer, size_t asize, size_t *residual); 461 void *answer, size_t asize, size_t *residual);
462
463struct iucv_interface {
464 int (*message_receive)(struct iucv_path *path, struct iucv_message *msg,
465 u8 flags, void *buffer, size_t size, size_t *residual);
466 int (*__message_receive)(struct iucv_path *path,
467 struct iucv_message *msg, u8 flags, void *buffer, size_t size,
468 size_t *residual);
469 int (*message_reply)(struct iucv_path *path, struct iucv_message *msg,
470 u8 flags, void *reply, size_t size);
471 int (*message_reject)(struct iucv_path *path, struct iucv_message *msg);
472 int (*message_send)(struct iucv_path *path, struct iucv_message *msg,
473 u8 flags, u32 srccls, void *buffer, size_t size);
474 int (*__message_send)(struct iucv_path *path, struct iucv_message *msg,
475 u8 flags, u32 srccls, void *buffer, size_t size);
476 int (*message_send2way)(struct iucv_path *path,
477 struct iucv_message *msg, u8 flags, u32 srccls, void *buffer,
478 size_t size, void *answer, size_t asize, size_t *residual);
479 int (*message_purge)(struct iucv_path *path, struct iucv_message *msg,
480 u32 srccls);
481 int (*path_accept)(struct iucv_path *path, struct iucv_handler *handler,
482 u8 userdata[16], void *private);
483 int (*path_connect)(struct iucv_path *path,
484 struct iucv_handler *handler,
485 u8 userid[8], u8 system[8], u8 userdata[16], void *private);
486 int (*path_quiesce)(struct iucv_path *path, u8 userdata[16]);
487 int (*path_resume)(struct iucv_path *path, u8 userdata[16]);
488 int (*path_sever)(struct iucv_path *path, u8 userdata[16]);
489 int (*iucv_register)(struct iucv_handler *handler, int smp);
490 void (*iucv_unregister)(struct iucv_handler *handler, int smp);
491 struct bus_type *bus;
492 struct device *root;
493};
494
495extern struct iucv_interface iucv_if;
diff --git a/include/net/lapb.h b/include/net/lapb.h
index 96cb5ddaa9f1..fd2bf572ee1d 100644
--- a/include/net/lapb.h
+++ b/include/net/lapb.h
@@ -95,7 +95,7 @@ struct lapb_cb {
95 struct sk_buff_head write_queue; 95 struct sk_buff_head write_queue;
96 struct sk_buff_head ack_queue; 96 struct sk_buff_head ack_queue;
97 unsigned char window; 97 unsigned char window;
98 struct lapb_register_struct callbacks; 98 const struct lapb_register_struct *callbacks;
99 99
100 /* FRMR control information */ 100 /* FRMR control information */
101 struct lapb_frame frmr_data; 101 struct lapb_frame frmr_data;
diff --git a/include/net/mac80211.h b/include/net/mac80211.h
index c0f63fd0c52b..eddf49202c50 100644
--- a/include/net/mac80211.h
+++ b/include/net/mac80211.h
@@ -109,6 +109,7 @@ enum ieee80211_ac_numbers {
109 IEEE80211_AC_BE = 2, 109 IEEE80211_AC_BE = 2,
110 IEEE80211_AC_BK = 3, 110 IEEE80211_AC_BK = 3,
111}; 111};
112#define IEEE80211_NUM_ACS 4
112 113
113/** 114/**
114 * struct ieee80211_tx_queue_params - transmit queue configuration 115 * struct ieee80211_tx_queue_params - transmit queue configuration
@@ -338,9 +339,9 @@ struct ieee80211_bss_conf {
338 * used to indicate that a frame was already retried due to PS 339 * used to indicate that a frame was already retried due to PS
339 * @IEEE80211_TX_INTFL_DONT_ENCRYPT: completely internal to mac80211, 340 * @IEEE80211_TX_INTFL_DONT_ENCRYPT: completely internal to mac80211,
340 * used to indicate frame should not be encrypted 341 * used to indicate frame should not be encrypted
341 * @IEEE80211_TX_CTL_PSPOLL_RESPONSE: (internal?) 342 * @IEEE80211_TX_CTL_POLL_RESPONSE: This frame is a response to a poll
342 * This frame is a response to a PS-poll frame and should be sent 343 * frame (PS-Poll or uAPSD) and should be sent although the station
343 * although the station is in powersave mode. 344 * is in powersave mode.
344 * @IEEE80211_TX_CTL_MORE_FRAMES: More frames will be passed to the 345 * @IEEE80211_TX_CTL_MORE_FRAMES: More frames will be passed to the
345 * transmit function after the current frame, this can be used 346 * transmit function after the current frame, this can be used
346 * by drivers to kick the DMA queue only if unset or when the 347 * by drivers to kick the DMA queue only if unset or when the
@@ -348,8 +349,6 @@ struct ieee80211_bss_conf {
348 * @IEEE80211_TX_INTFL_RETRANSMISSION: This frame is being retransmitted 349 * @IEEE80211_TX_INTFL_RETRANSMISSION: This frame is being retransmitted
349 * after TX status because the destination was asleep, it must not 350 * after TX status because the destination was asleep, it must not
350 * be modified again (no seqno assignment, crypto, etc.) 351 * be modified again (no seqno assignment, crypto, etc.)
351 * @IEEE80211_TX_INTFL_HAS_RADIOTAP: This frame was injected and still
352 * has a radiotap header at skb->data.
353 * @IEEE80211_TX_INTFL_NL80211_FRAME_TX: Frame was requested through nl80211 352 * @IEEE80211_TX_INTFL_NL80211_FRAME_TX: Frame was requested through nl80211
354 * MLME command (internal to mac80211 to figure out whether to send TX 353 * MLME command (internal to mac80211 to figure out whether to send TX
355 * status to user space) 354 * status to user space)
@@ -363,6 +362,20 @@ struct ieee80211_bss_conf {
363 * @IEEE80211_TX_INTFL_TKIP_MIC_FAILURE: Marks this packet to be used for TKIP 362 * @IEEE80211_TX_INTFL_TKIP_MIC_FAILURE: Marks this packet to be used for TKIP
364 * testing. It will be sent out with incorrect Michael MIC key to allow 363 * testing. It will be sent out with incorrect Michael MIC key to allow
365 * TKIP countermeasures to be tested. 364 * TKIP countermeasures to be tested.
365 * @IEEE80211_TX_CTL_NO_CCK_RATE: This frame will be sent at non CCK rate.
366 * This flag is actually used for management frame especially for P2P
367 * frames not being sent at CCK rate in 2GHz band.
368 * @IEEE80211_TX_STATUS_EOSP: This packet marks the end of service period,
369 * when its status is reported the service period ends. For frames in
370 * an SP that mac80211 transmits, it is already set; for driver frames
371 * the driver may set this flag. It is also used to do the same for
372 * PS-Poll responses.
373 * @IEEE80211_TX_CTL_USE_MINRATE: This frame will be sent at lowest rate.
374 * This flag is used to send nullfunc frame at minimum rate when
375 * the nullfunc is used for connection monitoring purpose.
376 * @IEEE80211_TX_CTL_DONTFRAG: Don't fragment this packet even if it
377 * would be fragmented by size (this is optional, only used for
378 * monitor injection).
366 * 379 *
367 * Note: If you have to add new flags to the enumeration, then don't 380 * Note: If you have to add new flags to the enumeration, then don't
368 * forget to update %IEEE80211_TX_TEMPORARY_FLAGS when necessary. 381 * forget to update %IEEE80211_TX_TEMPORARY_FLAGS when necessary.
@@ -384,15 +397,19 @@ enum mac80211_tx_control_flags {
384 IEEE80211_TX_INTFL_NEED_TXPROCESSING = BIT(14), 397 IEEE80211_TX_INTFL_NEED_TXPROCESSING = BIT(14),
385 IEEE80211_TX_INTFL_RETRIED = BIT(15), 398 IEEE80211_TX_INTFL_RETRIED = BIT(15),
386 IEEE80211_TX_INTFL_DONT_ENCRYPT = BIT(16), 399 IEEE80211_TX_INTFL_DONT_ENCRYPT = BIT(16),
387 IEEE80211_TX_CTL_PSPOLL_RESPONSE = BIT(17), 400 IEEE80211_TX_CTL_POLL_RESPONSE = BIT(17),
388 IEEE80211_TX_CTL_MORE_FRAMES = BIT(18), 401 IEEE80211_TX_CTL_MORE_FRAMES = BIT(18),
389 IEEE80211_TX_INTFL_RETRANSMISSION = BIT(19), 402 IEEE80211_TX_INTFL_RETRANSMISSION = BIT(19),
390 IEEE80211_TX_INTFL_HAS_RADIOTAP = BIT(20), 403 /* hole at 20, use later */
391 IEEE80211_TX_INTFL_NL80211_FRAME_TX = BIT(21), 404 IEEE80211_TX_INTFL_NL80211_FRAME_TX = BIT(21),
392 IEEE80211_TX_CTL_LDPC = BIT(22), 405 IEEE80211_TX_CTL_LDPC = BIT(22),
393 IEEE80211_TX_CTL_STBC = BIT(23) | BIT(24), 406 IEEE80211_TX_CTL_STBC = BIT(23) | BIT(24),
394 IEEE80211_TX_CTL_TX_OFFCHAN = BIT(25), 407 IEEE80211_TX_CTL_TX_OFFCHAN = BIT(25),
395 IEEE80211_TX_INTFL_TKIP_MIC_FAILURE = BIT(26), 408 IEEE80211_TX_INTFL_TKIP_MIC_FAILURE = BIT(26),
409 IEEE80211_TX_CTL_NO_CCK_RATE = BIT(27),
410 IEEE80211_TX_STATUS_EOSP = BIT(28),
411 IEEE80211_TX_CTL_USE_MINRATE = BIT(29),
412 IEEE80211_TX_CTL_DONTFRAG = BIT(30),
396}; 413};
397 414
398#define IEEE80211_TX_CTL_STBC_SHIFT 23 415#define IEEE80211_TX_CTL_STBC_SHIFT 23
@@ -406,9 +423,9 @@ enum mac80211_tx_control_flags {
406 IEEE80211_TX_CTL_SEND_AFTER_DTIM | IEEE80211_TX_CTL_AMPDU | \ 423 IEEE80211_TX_CTL_SEND_AFTER_DTIM | IEEE80211_TX_CTL_AMPDU | \
407 IEEE80211_TX_STAT_TX_FILTERED | IEEE80211_TX_STAT_ACK | \ 424 IEEE80211_TX_STAT_TX_FILTERED | IEEE80211_TX_STAT_ACK | \
408 IEEE80211_TX_STAT_AMPDU | IEEE80211_TX_STAT_AMPDU_NO_BACK | \ 425 IEEE80211_TX_STAT_AMPDU | IEEE80211_TX_STAT_AMPDU_NO_BACK | \
409 IEEE80211_TX_CTL_RATE_CTRL_PROBE | IEEE80211_TX_CTL_PSPOLL_RESPONSE | \ 426 IEEE80211_TX_CTL_RATE_CTRL_PROBE | IEEE80211_TX_CTL_POLL_RESPONSE | \
410 IEEE80211_TX_CTL_MORE_FRAMES | IEEE80211_TX_CTL_LDPC | \ 427 IEEE80211_TX_CTL_MORE_FRAMES | IEEE80211_TX_CTL_LDPC | \
411 IEEE80211_TX_CTL_STBC) 428 IEEE80211_TX_CTL_STBC | IEEE80211_TX_STATUS_EOSP)
412 429
413/** 430/**
414 * enum mac80211_rate_control_flags - per-rate flags set by the 431 * enum mac80211_rate_control_flags - per-rate flags set by the
@@ -884,6 +901,10 @@ static inline bool ieee80211_vif_is_mesh(struct ieee80211_vif *vif)
884 * @IEEE80211_KEY_FLAG_SW_MGMT: This flag should be set by the driver for a 901 * @IEEE80211_KEY_FLAG_SW_MGMT: This flag should be set by the driver for a
885 * CCMP key if it requires CCMP encryption of management frames (MFP) to 902 * CCMP key if it requires CCMP encryption of management frames (MFP) to
886 * be done in software. 903 * be done in software.
904 * @IEEE80211_KEY_FLAG_PUT_IV_SPACE: This flag should be set by the driver
905 * for a CCMP key if space should be prepared for the IV, but the IV
906 * itself should not be generated. Do not set together with
907 * @IEEE80211_KEY_FLAG_GENERATE_IV on the same key.
887 */ 908 */
888enum ieee80211_key_flags { 909enum ieee80211_key_flags {
889 IEEE80211_KEY_FLAG_WMM_STA = 1<<0, 910 IEEE80211_KEY_FLAG_WMM_STA = 1<<0,
@@ -891,6 +912,7 @@ enum ieee80211_key_flags {
891 IEEE80211_KEY_FLAG_GENERATE_MMIC= 1<<2, 912 IEEE80211_KEY_FLAG_GENERATE_MMIC= 1<<2,
892 IEEE80211_KEY_FLAG_PAIRWISE = 1<<3, 913 IEEE80211_KEY_FLAG_PAIRWISE = 1<<3,
893 IEEE80211_KEY_FLAG_SW_MGMT = 1<<4, 914 IEEE80211_KEY_FLAG_SW_MGMT = 1<<4,
915 IEEE80211_KEY_FLAG_PUT_IV_SPACE = 1<<5,
894}; 916};
895 917
896/** 918/**
@@ -1528,6 +1550,95 @@ ieee80211_get_alt_retry_rate(const struct ieee80211_hw *hw,
1528 */ 1550 */
1529 1551
1530/** 1552/**
1553 * DOC: AP support for powersaving clients
1554 *
1555 * In order to implement AP and P2P GO modes, mac80211 has support for
1556 * client powersaving, both "legacy" PS (PS-Poll/null data) and uAPSD.
1557 * There currently is no support for sAPSD.
1558 *
1559 * There is one assumption that mac80211 makes, namely that a client
1560 * will not poll with PS-Poll and trigger with uAPSD at the same time.
1561 * Both are supported, and both can be used by the same client, but
1562 * they can't be used concurrently by the same client. This simplifies
1563 * the driver code.
1564 *
1565 * The first thing to keep in mind is that there is a flag for complete
1566 * driver implementation: %IEEE80211_HW_AP_LINK_PS. If this flag is set,
1567 * mac80211 expects the driver to handle most of the state machine for
1568 * powersaving clients and will ignore the PM bit in incoming frames.
1569 * Drivers then use ieee80211_sta_ps_transition() to inform mac80211 of
1570 * stations' powersave transitions. In this mode, mac80211 also doesn't
1571 * handle PS-Poll/uAPSD.
1572 *
1573 * In the mode without %IEEE80211_HW_AP_LINK_PS, mac80211 will check the
1574 * PM bit in incoming frames for client powersave transitions. When a
1575 * station goes to sleep, we will stop transmitting to it. There is,
1576 * however, a race condition: a station might go to sleep while there is
1577 * data buffered on hardware queues. If the device has support for this
1578 * it will reject frames, and the driver should give the frames back to
1579 * mac80211 with the %IEEE80211_TX_STAT_TX_FILTERED flag set which will
1580 * cause mac80211 to retry the frame when the station wakes up. The
1581 * driver is also notified of powersave transitions by calling its
1582 * @sta_notify callback.
1583 *
1584 * When the station is asleep, it has three choices: it can wake up,
1585 * it can PS-Poll, or it can possibly start a uAPSD service period.
1586 * Waking up is implemented by simply transmitting all buffered (and
1587 * filtered) frames to the station. This is the easiest case. When
1588 * the station sends a PS-Poll or a uAPSD trigger frame, mac80211
1589 * will inform the driver of this with the @allow_buffered_frames
1590 * callback; this callback is optional. mac80211 will then transmit
1591 * the frames as usual and set the %IEEE80211_TX_CTL_POLL_RESPONSE
1592 * on each frame. The last frame in the service period (or the only
1593 * response to a PS-Poll) also has %IEEE80211_TX_STATUS_EOSP set to
1594 * indicate that it ends the service period; as this frame must have
1595 * TX status report it also sets %IEEE80211_TX_CTL_REQ_TX_STATUS.
1596 * When TX status is reported for this frame, the service period is
1597 * marked has having ended and a new one can be started by the peer.
1598 *
1599 * Another race condition can happen on some devices like iwlwifi
1600 * when there are frames queued for the station and it wakes up
1601 * or polls; the frames that are already queued could end up being
1602 * transmitted first instead, causing reordering and/or wrong
1603 * processing of the EOSP. The cause is that allowing frames to be
1604 * transmitted to a certain station is out-of-band communication to
1605 * the device. To allow this problem to be solved, the driver can
1606 * call ieee80211_sta_block_awake() if frames are buffered when it
1607 * is notified that the station went to sleep. When all these frames
1608 * have been filtered (see above), it must call the function again
1609 * to indicate that the station is no longer blocked.
1610 *
1611 * If the driver buffers frames in the driver for aggregation in any
1612 * way, it must use the ieee80211_sta_set_buffered() call when it is
1613 * notified of the station going to sleep to inform mac80211 of any
1614 * TIDs that have frames buffered. Note that when a station wakes up
1615 * this information is reset (hence the requirement to call it when
1616 * informed of the station going to sleep). Then, when a service
1617 * period starts for any reason, @release_buffered_frames is called
1618 * with the number of frames to be released and which TIDs they are
1619 * to come from. In this case, the driver is responsible for setting
1620 * the EOSP (for uAPSD) and MORE_DATA bits in the released frames,
1621 * to help the @more_data paramter is passed to tell the driver if
1622 * there is more data on other TIDs -- the TIDs to release frames
1623 * from are ignored since mac80211 doesn't know how many frames the
1624 * buffers for those TIDs contain.
1625 *
1626 * If the driver also implement GO mode, where absence periods may
1627 * shorten service periods (or abort PS-Poll responses), it must
1628 * filter those response frames except in the case of frames that
1629 * are buffered in the driver -- those must remain buffered to avoid
1630 * reordering. Because it is possible that no frames are released
1631 * in this case, the driver must call ieee80211_sta_eosp_irqsafe()
1632 * to indicate to mac80211 that the service period ended anyway.
1633 *
1634 * Finally, if frames from multiple TIDs are released from mac80211
1635 * but the driver might reorder them, it must clear & set the flags
1636 * appropriately (only the last frame may have %IEEE80211_TX_STATUS_EOSP)
1637 * and also take care of the EOSP and MORE_DATA bits in the frame.
1638 * The driver may also use ieee80211_sta_eosp_irqsafe() in this case.
1639 */
1640
1641/**
1531 * enum ieee80211_filter_flags - hardware filter flags 1642 * enum ieee80211_filter_flags - hardware filter flags
1532 * 1643 *
1533 * These flags determine what the filter in hardware should be 1644 * These flags determine what the filter in hardware should be
@@ -1617,6 +1728,17 @@ enum ieee80211_tx_sync_type {
1617}; 1728};
1618 1729
1619/** 1730/**
1731 * enum ieee80211_frame_release_type - frame release reason
1732 * @IEEE80211_FRAME_RELEASE_PSPOLL: frame released for PS-Poll
1733 * @IEEE80211_FRAME_RELEASE_UAPSD: frame(s) released due to
1734 * frame received on trigger-enabled AC
1735 */
1736enum ieee80211_frame_release_type {
1737 IEEE80211_FRAME_RELEASE_PSPOLL,
1738 IEEE80211_FRAME_RELEASE_UAPSD,
1739};
1740
1741/**
1620 * struct ieee80211_ops - callbacks from mac80211 to the driver 1742 * struct ieee80211_ops - callbacks from mac80211 to the driver
1621 * 1743 *
1622 * This structure contains various callbacks that the driver may 1744 * This structure contains various callbacks that the driver may
@@ -1926,6 +2048,45 @@ enum ieee80211_tx_sync_type {
1926 * The callback can sleep. 2048 * The callback can sleep.
1927 * @rssi_callback: Notify driver when the average RSSI goes above/below 2049 * @rssi_callback: Notify driver when the average RSSI goes above/below
1928 * thresholds that were registered previously. The callback can sleep. 2050 * thresholds that were registered previously. The callback can sleep.
2051 *
2052 * @release_buffered_frames: Release buffered frames according to the given
2053 * parameters. In the case where the driver buffers some frames for
2054 * sleeping stations mac80211 will use this callback to tell the driver
2055 * to release some frames, either for PS-poll or uAPSD.
2056 * Note that if the @more_data paramter is %false the driver must check
2057 * if there are more frames on the given TIDs, and if there are more than
2058 * the frames being released then it must still set the more-data bit in
2059 * the frame. If the @more_data parameter is %true, then of course the
2060 * more-data bit must always be set.
2061 * The @tids parameter tells the driver which TIDs to release frames
2062 * from, for PS-poll it will always have only a single bit set.
2063 * In the case this is used for a PS-poll initiated release, the
2064 * @num_frames parameter will always be 1 so code can be shared. In
2065 * this case the driver must also set %IEEE80211_TX_STATUS_EOSP flag
2066 * on the TX status (and must report TX status) so that the PS-poll
2067 * period is properly ended. This is used to avoid sending multiple
2068 * responses for a retried PS-poll frame.
2069 * In the case this is used for uAPSD, the @num_frames parameter may be
2070 * bigger than one, but the driver may send fewer frames (it must send
2071 * at least one, however). In this case it is also responsible for
2072 * setting the EOSP flag in the QoS header of the frames. Also, when the
2073 * service period ends, the driver must set %IEEE80211_TX_STATUS_EOSP
2074 * on the last frame in the SP. Alternatively, it may call the function
2075 * ieee80211_sta_eosp_irqsafe() to inform mac80211 of the end of the SP.
2076 * This callback must be atomic.
2077 * @allow_buffered_frames: Prepare device to allow the given number of frames
2078 * to go out to the given station. The frames will be sent by mac80211
2079 * via the usual TX path after this call. The TX information for frames
2080 * released will also have the %IEEE80211_TX_CTL_POLL_RESPONSE flag set
2081 * and the last one will also have %IEEE80211_TX_STATUS_EOSP set. In case
2082 * frames from multiple TIDs are released and the driver might reorder
2083 * them between the TIDs, it must set the %IEEE80211_TX_STATUS_EOSP flag
2084 * on the last frame and clear it on all others and also handle the EOSP
2085 * bit in the QoS header correctly. Alternatively, it can also call the
2086 * ieee80211_sta_eosp_irqsafe() function.
2087 * The @tids parameter is a bitmap and tells the driver which TIDs the
2088 * frames will be on; it will at most have two bits set.
2089 * This callback must be atomic.
1929 */ 2090 */
1930struct ieee80211_ops { 2091struct ieee80211_ops {
1931 void (*tx)(struct ieee80211_hw *hw, struct sk_buff *skb); 2092 void (*tx)(struct ieee80211_hw *hw, struct sk_buff *skb);
@@ -1998,11 +2159,13 @@ struct ieee80211_ops {
1998 struct ieee80211_sta *sta); 2159 struct ieee80211_sta *sta);
1999 void (*sta_notify)(struct ieee80211_hw *hw, struct ieee80211_vif *vif, 2160 void (*sta_notify)(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
2000 enum sta_notify_cmd, struct ieee80211_sta *sta); 2161 enum sta_notify_cmd, struct ieee80211_sta *sta);
2001 int (*conf_tx)(struct ieee80211_hw *hw, u16 queue, 2162 int (*conf_tx)(struct ieee80211_hw *hw,
2163 struct ieee80211_vif *vif, u16 queue,
2002 const struct ieee80211_tx_queue_params *params); 2164 const struct ieee80211_tx_queue_params *params);
2003 u64 (*get_tsf)(struct ieee80211_hw *hw); 2165 u64 (*get_tsf)(struct ieee80211_hw *hw, struct ieee80211_vif *vif);
2004 void (*set_tsf)(struct ieee80211_hw *hw, u64 tsf); 2166 void (*set_tsf)(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
2005 void (*reset_tsf)(struct ieee80211_hw *hw); 2167 u64 tsf);
2168 void (*reset_tsf)(struct ieee80211_hw *hw, struct ieee80211_vif *vif);
2006 int (*tx_last_beacon)(struct ieee80211_hw *hw); 2169 int (*tx_last_beacon)(struct ieee80211_hw *hw);
2007 int (*ampdu_action)(struct ieee80211_hw *hw, 2170 int (*ampdu_action)(struct ieee80211_hw *hw,
2008 struct ieee80211_vif *vif, 2171 struct ieee80211_vif *vif,
@@ -2039,6 +2202,17 @@ struct ieee80211_ops {
2039 const struct cfg80211_bitrate_mask *mask); 2202 const struct cfg80211_bitrate_mask *mask);
2040 void (*rssi_callback)(struct ieee80211_hw *hw, 2203 void (*rssi_callback)(struct ieee80211_hw *hw,
2041 enum ieee80211_rssi_event rssi_event); 2204 enum ieee80211_rssi_event rssi_event);
2205
2206 void (*allow_buffered_frames)(struct ieee80211_hw *hw,
2207 struct ieee80211_sta *sta,
2208 u16 tids, int num_frames,
2209 enum ieee80211_frame_release_type reason,
2210 bool more_data);
2211 void (*release_buffered_frames)(struct ieee80211_hw *hw,
2212 struct ieee80211_sta *sta,
2213 u16 tids, int num_frames,
2214 enum ieee80211_frame_release_type reason,
2215 bool more_data);
2042}; 2216};
2043 2217
2044/** 2218/**
@@ -2353,20 +2527,38 @@ static inline int ieee80211_sta_ps_transition_ni(struct ieee80211_sta *sta,
2353 * The TX headroom reserved by mac80211 for its own tx_status functions. 2527 * The TX headroom reserved by mac80211 for its own tx_status functions.
2354 * This is enough for the radiotap header. 2528 * This is enough for the radiotap header.
2355 */ 2529 */
2356#define IEEE80211_TX_STATUS_HEADROOM 13 2530#define IEEE80211_TX_STATUS_HEADROOM 14
2357 2531
2358/** 2532/**
2359 * ieee80211_sta_set_tim - set the TIM bit for a sleeping station 2533 * ieee80211_sta_set_buffered - inform mac80211 about driver-buffered frames
2360 * @sta: &struct ieee80211_sta pointer for the sleeping station 2534 * @sta: &struct ieee80211_sta pointer for the sleeping station
2535 * @tid: the TID that has buffered frames
2536 * @buffered: indicates whether or not frames are buffered for this TID
2361 * 2537 *
2362 * If a driver buffers frames for a powersave station instead of passing 2538 * If a driver buffers frames for a powersave station instead of passing
2363 * them back to mac80211 for retransmission, the station needs to be told 2539 * them back to mac80211 for retransmission, the station may still need
2364 * to wake up using the TIM bitmap in the beacon. 2540 * to be told that there are buffered frames via the TIM bit.
2365 * 2541 *
2366 * This function sets the station's TIM bit - it will be cleared when the 2542 * This function informs mac80211 whether or not there are frames that are
2367 * station wakes up. 2543 * buffered in the driver for a given TID; mac80211 can then use this data
2544 * to set the TIM bit (NOTE: This may call back into the driver's set_tim
2545 * call! Beware of the locking!)
2546 *
2547 * If all frames are released to the station (due to PS-poll or uAPSD)
2548 * then the driver needs to inform mac80211 that there no longer are
2549 * frames buffered. However, when the station wakes up mac80211 assumes
2550 * that all buffered frames will be transmitted and clears this data,
2551 * drivers need to make sure they inform mac80211 about all buffered
2552 * frames on the sleep transition (sta_notify() with %STA_NOTIFY_SLEEP).
2553 *
2554 * Note that technically mac80211 only needs to know this per AC, not per
2555 * TID, but since driver buffering will inevitably happen per TID (since
2556 * it is related to aggregation) it is easier to make mac80211 map the
2557 * TID to the AC as required instead of keeping track in all drivers that
2558 * use this API.
2368 */ 2559 */
2369void ieee80211_sta_set_tim(struct ieee80211_sta *sta); 2560void ieee80211_sta_set_buffered(struct ieee80211_sta *sta,
2561 u8 tid, bool buffered);
2370 2562
2371/** 2563/**
2372 * ieee80211_tx_status - transmit status callback 2564 * ieee80211_tx_status - transmit status callback
@@ -3024,6 +3216,24 @@ void ieee80211_sta_block_awake(struct ieee80211_hw *hw,
3024 struct ieee80211_sta *pubsta, bool block); 3216 struct ieee80211_sta *pubsta, bool block);
3025 3217
3026/** 3218/**
3219 * ieee80211_sta_eosp - notify mac80211 about end of SP
3220 * @pubsta: the station
3221 *
3222 * When a device transmits frames in a way that it can't tell
3223 * mac80211 in the TX status about the EOSP, it must clear the
3224 * %IEEE80211_TX_STATUS_EOSP bit and call this function instead.
3225 * This applies for PS-Poll as well as uAPSD.
3226 *
3227 * Note that there is no non-_irqsafe version right now as
3228 * it wasn't needed, but just like _tx_status() and _rx()
3229 * must not be mixed in irqsafe/non-irqsafe versions, this
3230 * function must not be mixed with those either. Use the
3231 * all irqsafe, or all non-irqsafe, don't mix! If you need
3232 * the non-irqsafe version of this, you need to add it.
3233 */
3234void ieee80211_sta_eosp_irqsafe(struct ieee80211_sta *pubsta);
3235
3236/**
3027 * ieee80211_iter_keys - iterate keys programmed into the device 3237 * ieee80211_iter_keys - iterate keys programmed into the device
3028 * @hw: pointer obtained from ieee80211_alloc_hw() 3238 * @hw: pointer obtained from ieee80211_alloc_hw()
3029 * @vif: virtual interface to iterate, may be %NULL for all 3239 * @vif: virtual interface to iterate, may be %NULL for all
@@ -3362,8 +3572,9 @@ rate_lowest_index(struct ieee80211_supported_band *sband,
3362 return i; 3572 return i;
3363 3573
3364 /* warn when we cannot find a rate. */ 3574 /* warn when we cannot find a rate. */
3365 WARN_ON(1); 3575 WARN_ON_ONCE(1);
3366 3576
3577 /* and return 0 (the lowest index) */
3367 return 0; 3578 return 0;
3368} 3579}
3369 3580
@@ -3439,4 +3650,9 @@ void ieee80211_enable_rssi_reports(struct ieee80211_vif *vif,
3439 int rssi_max_thold); 3650 int rssi_max_thold);
3440 3651
3441void ieee80211_disable_rssi_reports(struct ieee80211_vif *vif); 3652void ieee80211_disable_rssi_reports(struct ieee80211_vif *vif);
3653
3654int ieee80211_add_srates_ie(struct ieee80211_vif *vif, struct sk_buff *skb);
3655
3656int ieee80211_add_ext_srates_ie(struct ieee80211_vif *vif,
3657 struct sk_buff *skb);
3442#endif /* MAC80211_H */ 3658#endif /* MAC80211_H */
diff --git a/include/net/netlabel.h b/include/net/netlabel.h
index f21a16ee3705..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
diff --git a/include/net/nfc/nci_core.h b/include/net/nfc/nci_core.h
index 2563f3a95e67..b8b4bbd7e0fc 100644
--- a/include/net/nfc/nci_core.h
+++ b/include/net/nfc/nci_core.h
@@ -40,6 +40,7 @@ enum {
40 NCI_UP, 40 NCI_UP,
41 NCI_DISCOVERY, 41 NCI_DISCOVERY,
42 NCI_POLL_ACTIVE, 42 NCI_POLL_ACTIVE,
43 NCI_DATA_EXCHANGE,
43}; 44};
44 45
45/* NCI timeouts */ 46/* NCI timeouts */
diff --git a/include/net/request_sock.h b/include/net/request_sock.h
index 99e6e19b57c2..4c0766e201e3 100644
--- a/include/net/request_sock.h
+++ b/include/net/request_sock.h
@@ -96,7 +96,8 @@ extern int sysctl_max_syn_backlog;
96 */ 96 */
97struct listen_sock { 97struct listen_sock {
98 u8 max_qlen_log; 98 u8 max_qlen_log;
99 /* 3 bytes hole, try to use */ 99 u8 synflood_warned;
100 /* 2 bytes hole, try to use */
100 int qlen; 101 int qlen;
101 int qlen_young; 102 int qlen_young;
102 int clock_hand; 103 int clock_hand;
diff --git a/include/net/sch_generic.h b/include/net/sch_generic.h
index 4fc88f3ccd5f..2eb207ea4eaf 100644
--- a/include/net/sch_generic.h
+++ b/include/net/sch_generic.h
@@ -46,14 +46,14 @@ struct qdisc_size_table {
46struct Qdisc { 46struct Qdisc {
47 int (*enqueue)(struct sk_buff *skb, struct Qdisc *dev); 47 int (*enqueue)(struct sk_buff *skb, struct Qdisc *dev);
48 struct sk_buff * (*dequeue)(struct Qdisc *dev); 48 struct sk_buff * (*dequeue)(struct Qdisc *dev);
49 unsigned flags; 49 unsigned int flags;
50#define TCQ_F_BUILTIN 1 50#define TCQ_F_BUILTIN 1
51#define TCQ_F_INGRESS 2 51#define TCQ_F_INGRESS 2
52#define TCQ_F_CAN_BYPASS 4 52#define TCQ_F_CAN_BYPASS 4
53#define TCQ_F_MQROOT 8 53#define TCQ_F_MQROOT 8
54#define TCQ_F_WARN_NONWC (1 << 16) 54#define TCQ_F_WARN_NONWC (1 << 16)
55 int padded; 55 int padded;
56 struct Qdisc_ops *ops; 56 const struct Qdisc_ops *ops;
57 struct qdisc_size_table __rcu *stab; 57 struct qdisc_size_table __rcu *stab;
58 struct list_head list; 58 struct list_head list;
59 u32 handle; 59 u32 handle;
@@ -224,7 +224,7 @@ struct qdisc_skb_cb {
224 long data[]; 224 long data[];
225}; 225};
226 226
227static inline int qdisc_qlen(struct Qdisc *q) 227static inline int qdisc_qlen(const struct Qdisc *q)
228{ 228{
229 return q->q.qlen; 229 return q->q.qlen;
230} 230}
@@ -239,12 +239,12 @@ static inline spinlock_t *qdisc_lock(struct Qdisc *qdisc)
239 return &qdisc->q.lock; 239 return &qdisc->q.lock;
240} 240}
241 241
242static inline struct Qdisc *qdisc_root(struct Qdisc *qdisc) 242static inline struct Qdisc *qdisc_root(const struct Qdisc *qdisc)
243{ 243{
244 return qdisc->dev_queue->qdisc; 244 return qdisc->dev_queue->qdisc;
245} 245}
246 246
247static inline struct Qdisc *qdisc_root_sleeping(struct Qdisc *qdisc) 247static inline struct Qdisc *qdisc_root_sleeping(const struct Qdisc *qdisc)
248{ 248{
249 return qdisc->dev_queue->qdisc_sleeping; 249 return qdisc->dev_queue->qdisc_sleeping;
250} 250}
@@ -260,7 +260,7 @@ static inline struct Qdisc *qdisc_root_sleeping(struct Qdisc *qdisc)
260 * root. This is enforced by holding the RTNL semaphore, which 260 * root. This is enforced by holding the RTNL semaphore, which
261 * all users of this lock accessor must do. 261 * all users of this lock accessor must do.
262 */ 262 */
263static inline spinlock_t *qdisc_root_lock(struct Qdisc *qdisc) 263static inline spinlock_t *qdisc_root_lock(const struct Qdisc *qdisc)
264{ 264{
265 struct Qdisc *root = qdisc_root(qdisc); 265 struct Qdisc *root = qdisc_root(qdisc);
266 266
@@ -268,7 +268,7 @@ static inline spinlock_t *qdisc_root_lock(struct Qdisc *qdisc)
268 return qdisc_lock(root); 268 return qdisc_lock(root);
269} 269}
270 270
271static inline spinlock_t *qdisc_root_sleeping_lock(struct Qdisc *qdisc) 271static inline spinlock_t *qdisc_root_sleeping_lock(const struct Qdisc *qdisc)
272{ 272{
273 struct Qdisc *root = qdisc_root_sleeping(qdisc); 273 struct Qdisc *root = qdisc_root_sleeping(qdisc);
274 274
@@ -276,17 +276,17 @@ static inline spinlock_t *qdisc_root_sleeping_lock(struct Qdisc *qdisc)
276 return qdisc_lock(root); 276 return qdisc_lock(root);
277} 277}
278 278
279static inline struct net_device *qdisc_dev(struct Qdisc *qdisc) 279static inline struct net_device *qdisc_dev(const struct Qdisc *qdisc)
280{ 280{
281 return qdisc->dev_queue->dev; 281 return qdisc->dev_queue->dev;
282} 282}
283 283
284static inline void sch_tree_lock(struct Qdisc *q) 284static inline void sch_tree_lock(const struct Qdisc *q)
285{ 285{
286 spin_lock_bh(qdisc_root_sleeping_lock(q)); 286 spin_lock_bh(qdisc_root_sleeping_lock(q));
287} 287}
288 288
289static inline void sch_tree_unlock(struct Qdisc *q) 289static inline void sch_tree_unlock(const struct Qdisc *q)
290{ 290{
291 spin_unlock_bh(qdisc_root_sleeping_lock(q)); 291 spin_unlock_bh(qdisc_root_sleeping_lock(q));
292} 292}
@@ -319,7 +319,7 @@ static inline unsigned int qdisc_class_hash(u32 id, u32 mask)
319} 319}
320 320
321static inline struct Qdisc_class_common * 321static inline struct Qdisc_class_common *
322qdisc_class_find(struct Qdisc_class_hash *hash, u32 id) 322qdisc_class_find(const struct Qdisc_class_hash *hash, u32 id)
323{ 323{
324 struct Qdisc_class_common *cl; 324 struct Qdisc_class_common *cl;
325 struct hlist_node *n; 325 struct hlist_node *n;
@@ -393,7 +393,7 @@ static inline bool qdisc_all_tx_empty(const struct net_device *dev)
393} 393}
394 394
395/* Are any of the TX qdiscs changing? */ 395/* Are any of the TX qdiscs changing? */
396static inline bool qdisc_tx_changing(struct net_device *dev) 396static inline bool qdisc_tx_changing(const struct net_device *dev)
397{ 397{
398 unsigned int i; 398 unsigned int i;
399 for (i = 0; i < dev->num_tx_queues; i++) { 399 for (i = 0; i < dev->num_tx_queues; i++) {
diff --git a/include/net/scm.h b/include/net/scm.h
index 745460fa2f02..d456f4c71a32 100644
--- a/include/net/scm.h
+++ b/include/net/scm.h
@@ -49,7 +49,7 @@ static __inline__ void scm_set_cred(struct scm_cookie *scm,
49 struct pid *pid, const struct cred *cred) 49 struct pid *pid, const struct cred *cred)
50{ 50{
51 scm->pid = get_pid(pid); 51 scm->pid = get_pid(pid);
52 scm->cred = get_cred(cred); 52 scm->cred = cred ? get_cred(cred) : NULL;
53 cred_to_ucred(pid, cred, &scm->creds); 53 cred_to_ucred(pid, cred, &scm->creds);
54} 54}
55 55
@@ -73,8 +73,7 @@ static __inline__ void scm_destroy(struct scm_cookie *scm)
73static __inline__ int scm_send(struct socket *sock, struct msghdr *msg, 73static __inline__ int scm_send(struct socket *sock, struct msghdr *msg,
74 struct scm_cookie *scm) 74 struct scm_cookie *scm)
75{ 75{
76 scm_set_cred(scm, task_tgid(current), current_cred()); 76 memset(scm, 0, sizeof(*scm));
77 scm->fp = NULL;
78 unix_get_peersec_dgram(sock, scm); 77 unix_get_peersec_dgram(sock, scm);
79 if (msg->msg_controllen <= 0) 78 if (msg->msg_controllen <= 0)
80 return 0; 79 return 0;
diff --git a/include/net/sctp/command.h b/include/net/sctp/command.h
index 6506458ccd33..712b3bebeda7 100644
--- a/include/net/sctp/command.h
+++ b/include/net/sctp/command.h
@@ -109,6 +109,7 @@ typedef enum {
109 SCTP_CMD_SEND_MSG, /* Send the whole use message */ 109 SCTP_CMD_SEND_MSG, /* Send the whole use message */
110 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.*/ 111 SCTP_CMD_PURGE_ASCONF_QUEUE, /* Purge all asconf queues.*/
112 SCTP_CMD_SET_ASOC, /* Restore association context */
112 SCTP_CMD_LAST 113 SCTP_CMD_LAST
113} sctp_verb_t; 114} sctp_verb_t;
114 115
diff --git a/include/net/sctp/structs.h b/include/net/sctp/structs.h
index f7d9c3fc06fd..e90e7a9935dd 100644
--- a/include/net/sctp/structs.h
+++ b/include/net/sctp/structs.h
@@ -1915,6 +1915,7 @@ struct sctp_association {
1915 __u32 addip_serial; 1915 __u32 addip_serial;
1916 union sctp_addr *asconf_addr_del_pending; 1916 union sctp_addr *asconf_addr_del_pending;
1917 int src_out_of_asoc_ok; 1917 int src_out_of_asoc_ok;
1918 struct sctp_transport *new_transport;
1918 1919
1919 /* SCTP AUTH: list of the endpoint shared keys. These 1920 /* SCTP AUTH: list of the endpoint shared keys. These
1920 * keys are provided out of band by the user applicaton 1921 * keys are provided out of band by the user applicaton
diff --git a/include/net/secure_seq.h b/include/net/secure_seq.h
new file mode 100644
index 000000000000..c2e542b27a5a
--- /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(const __be32 *saddr, const __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/sock.h b/include/net/sock.h
index 8e4062f165b8..5ac682f73d63 100644
--- a/include/net/sock.h
+++ b/include/net/sock.h
@@ -686,16 +686,25 @@ static inline void sock_rps_reset_flow(const struct sock *sk)
686#endif 686#endif
687} 687}
688 688
689static inline void sock_rps_save_rxhash(struct sock *sk, u32 rxhash) 689static inline void sock_rps_save_rxhash(struct sock *sk,
690 const struct sk_buff *skb)
690{ 691{
691#ifdef CONFIG_RPS 692#ifdef CONFIG_RPS
692 if (unlikely(sk->sk_rxhash != rxhash)) { 693 if (unlikely(sk->sk_rxhash != skb->rxhash)) {
693 sock_rps_reset_flow(sk); 694 sock_rps_reset_flow(sk);
694 sk->sk_rxhash = rxhash; 695 sk->sk_rxhash = skb->rxhash;
695 } 696 }
696#endif 697#endif
697} 698}
698 699
700static inline void sock_rps_reset_rxhash(struct sock *sk)
701{
702#ifdef CONFIG_RPS
703 sock_rps_reset_flow(sk);
704 sk->sk_rxhash = 0;
705#endif
706}
707
699#define sk_wait_event(__sk, __timeo, __condition) \ 708#define sk_wait_event(__sk, __timeo, __condition) \
700 ({ int __rc; \ 709 ({ int __rc; \
701 release_sock(__sk); \ 710 release_sock(__sk); \
diff --git a/include/net/tcp.h b/include/net/tcp.h
index 149a415d1e0a..e147f42d643d 100644
--- a/include/net/tcp.h
+++ b/include/net/tcp.h
@@ -18,7 +18,6 @@
18#ifndef _TCP_H 18#ifndef _TCP_H
19#define _TCP_H 19#define _TCP_H
20 20
21#define TCP_DEBUG 1
22#define FASTRETRANS_DEBUG 1 21#define FASTRETRANS_DEBUG 1
23 22
24#include <linux/list.h> 23#include <linux/list.h>
@@ -327,9 +326,9 @@ extern int tcp_sendpage(struct sock *sk, struct page *page, int offset,
327 size_t size, int flags); 326 size_t size, int flags);
328extern int tcp_ioctl(struct sock *sk, int cmd, unsigned long arg); 327extern int tcp_ioctl(struct sock *sk, int cmd, unsigned long arg);
329extern int tcp_rcv_state_process(struct sock *sk, struct sk_buff *skb, 328extern int tcp_rcv_state_process(struct sock *sk, struct sk_buff *skb,
330 struct tcphdr *th, unsigned len); 329 const struct tcphdr *th, unsigned int len);
331extern int tcp_rcv_established(struct sock *sk, struct sk_buff *skb, 330extern int tcp_rcv_established(struct sock *sk, struct sk_buff *skb,
332 struct tcphdr *th, unsigned len); 331 const struct tcphdr *th, unsigned int len);
333extern void tcp_rcv_space_adjust(struct sock *sk); 332extern void tcp_rcv_space_adjust(struct sock *sk);
334extern void tcp_cleanup_rbuf(struct sock *sk, int copied); 333extern void tcp_cleanup_rbuf(struct sock *sk, int copied);
335extern int tcp_twsk_unique(struct sock *sk, struct sock *sktw, void *twp); 334extern int tcp_twsk_unique(struct sock *sk, struct sock *sktw, void *twp);
@@ -356,6 +355,7 @@ static inline void tcp_dec_quickack_mode(struct sock *sk,
356#define TCP_ECN_OK 1 355#define TCP_ECN_OK 1
357#define TCP_ECN_QUEUE_CWR 2 356#define TCP_ECN_QUEUE_CWR 2
358#define TCP_ECN_DEMAND_CWR 4 357#define TCP_ECN_DEMAND_CWR 4
358#define TCP_ECN_SEEN 8
359 359
360static __inline__ void 360static __inline__ void
361TCP_ECN_create_request(struct request_sock *req, struct tcphdr *th) 361TCP_ECN_create_request(struct request_sock *req, struct tcphdr *th)
@@ -400,10 +400,10 @@ extern void tcp_set_keepalive(struct sock *sk, int val);
400extern void tcp_syn_ack_timeout(struct sock *sk, struct request_sock *req); 400extern void tcp_syn_ack_timeout(struct sock *sk, struct request_sock *req);
401extern int tcp_recvmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg, 401extern int tcp_recvmsg(struct kiocb *iocb, struct sock *sk, struct msghdr *msg,
402 size_t len, int nonblock, int flags, int *addr_len); 402 size_t len, int nonblock, int flags, int *addr_len);
403extern void tcp_parse_options(struct sk_buff *skb, 403extern void tcp_parse_options(const struct sk_buff *skb,
404 struct tcp_options_received *opt_rx, u8 **hvpp, 404 struct tcp_options_received *opt_rx, const u8 **hvpp,
405 int estab); 405 int estab);
406extern u8 *tcp_parse_md5sig_option(struct tcphdr *th); 406extern const u8 *tcp_parse_md5sig_option(const struct tcphdr *th);
407 407
408/* 408/*
409 * TCP v4 functions exported for the inet6 API 409 * TCP v4 functions exported for the inet6 API
@@ -431,17 +431,34 @@ extern int tcp_disconnect(struct sock *sk, int flags);
431extern __u32 syncookie_secret[2][16-4+SHA_DIGEST_WORDS]; 431extern __u32 syncookie_secret[2][16-4+SHA_DIGEST_WORDS];
432extern struct sock *cookie_v4_check(struct sock *sk, struct sk_buff *skb, 432extern struct sock *cookie_v4_check(struct sock *sk, struct sk_buff *skb,
433 struct ip_options *opt); 433 struct ip_options *opt);
434#ifdef CONFIG_SYN_COOKIES
434extern __u32 cookie_v4_init_sequence(struct sock *sk, struct sk_buff *skb, 435extern __u32 cookie_v4_init_sequence(struct sock *sk, struct sk_buff *skb,
435 __u16 *mss); 436 __u16 *mss);
437#else
438static inline __u32 cookie_v4_init_sequence(struct sock *sk,
439 struct sk_buff *skb,
440 __u16 *mss)
441{
442 return 0;
443}
444#endif
436 445
437extern __u32 cookie_init_timestamp(struct request_sock *req); 446extern __u32 cookie_init_timestamp(struct request_sock *req);
438extern bool cookie_check_timestamp(struct tcp_options_received *opt, bool *); 447extern bool cookie_check_timestamp(struct tcp_options_received *opt, bool *);
439 448
440/* From net/ipv6/syncookies.c */ 449/* From net/ipv6/syncookies.c */
441extern struct sock *cookie_v6_check(struct sock *sk, struct sk_buff *skb); 450extern struct sock *cookie_v6_check(struct sock *sk, struct sk_buff *skb);
442extern __u32 cookie_v6_init_sequence(struct sock *sk, struct sk_buff *skb, 451#ifdef CONFIG_SYN_COOKIES
452extern __u32 cookie_v6_init_sequence(struct sock *sk, const struct sk_buff *skb,
443 __u16 *mss); 453 __u16 *mss);
444 454#else
455static inline __u32 cookie_v6_init_sequence(struct sock *sk,
456 struct sk_buff *skb,
457 __u16 *mss)
458{
459 return 0;
460}
461#endif
445/* tcp_output.c */ 462/* tcp_output.c */
446 463
447extern void __tcp_push_pending_frames(struct sock *sk, unsigned int cur_mss, 464extern void __tcp_push_pending_frames(struct sock *sk, unsigned int cur_mss,
@@ -460,6 +477,9 @@ extern int tcp_write_wakeup(struct sock *);
460extern void tcp_send_fin(struct sock *sk); 477extern void tcp_send_fin(struct sock *sk);
461extern void tcp_send_active_reset(struct sock *sk, gfp_t priority); 478extern void tcp_send_active_reset(struct sock *sk, gfp_t priority);
462extern int tcp_send_synack(struct sock *); 479extern int tcp_send_synack(struct sock *);
480extern int tcp_syn_flood_action(struct sock *sk,
481 const struct sk_buff *skb,
482 const char *proto);
463extern void tcp_push_one(struct sock *, unsigned int mss_now); 483extern void tcp_push_one(struct sock *, unsigned int mss_now);
464extern void tcp_send_ack(struct sock *sk); 484extern void tcp_send_ack(struct sock *sk);
465extern void tcp_send_delayed_ack(struct sock *sk); 485extern void tcp_send_delayed_ack(struct sock *sk);
@@ -501,7 +521,7 @@ static inline int tcp_bound_to_half_wnd(struct tcp_sock *tp, int pktsize)
501} 521}
502 522
503/* tcp.c */ 523/* tcp.c */
504extern void tcp_get_info(struct sock *, struct tcp_info *); 524extern void tcp_get_info(const struct sock *, struct tcp_info *);
505 525
506/* Read 'sendfile()'-style from a TCP socket */ 526/* Read 'sendfile()'-style from a TCP socket */
507typedef int (*sk_read_actor_t)(read_descriptor_t *, struct sk_buff *, 527typedef int (*sk_read_actor_t)(read_descriptor_t *, struct sk_buff *,
@@ -511,8 +531,8 @@ extern int tcp_read_sock(struct sock *sk, read_descriptor_t *desc,
511 531
512extern void tcp_initialize_rcv_mss(struct sock *sk); 532extern void tcp_initialize_rcv_mss(struct sock *sk);
513 533
514extern int tcp_mtu_to_mss(struct sock *sk, int pmtu); 534extern int tcp_mtu_to_mss(const struct sock *sk, int pmtu);
515extern int tcp_mss_to_mtu(struct sock *sk, int mss); 535extern int tcp_mss_to_mtu(const struct sock *sk, int mss);
516extern void tcp_mtup_init(struct sock *sk); 536extern void tcp_mtup_init(struct sock *sk);
517extern void tcp_valid_rtt_meas(struct sock *sk, u32 seq_rtt); 537extern void tcp_valid_rtt_meas(struct sock *sk, u32 seq_rtt);
518 538
@@ -553,7 +573,7 @@ static inline void tcp_fast_path_check(struct sock *sk)
553/* Compute the actual rto_min value */ 573/* Compute the actual rto_min value */
554static inline u32 tcp_rto_min(struct sock *sk) 574static inline u32 tcp_rto_min(struct sock *sk)
555{ 575{
556 struct dst_entry *dst = __sk_dst_get(sk); 576 const struct dst_entry *dst = __sk_dst_get(sk);
557 u32 rto_min = TCP_RTO_MIN; 577 u32 rto_min = TCP_RTO_MIN;
558 578
559 if (dst && dst_metric_locked(dst, RTAX_RTO_MIN)) 579 if (dst && dst_metric_locked(dst, RTAX_RTO_MIN))
@@ -615,13 +635,14 @@ struct tcp_skb_cb {
615 __u32 seq; /* Starting sequence number */ 635 __u32 seq; /* Starting sequence number */
616 __u32 end_seq; /* SEQ + FIN + SYN + datalen */ 636 __u32 end_seq; /* SEQ + FIN + SYN + datalen */
617 __u32 when; /* used to compute rtt's */ 637 __u32 when; /* used to compute rtt's */
618 __u8 flags; /* TCP header flags. */ 638 __u8 tcp_flags; /* TCP header flags. (tcp[13]) */
619 __u8 sacked; /* State flags for SACK/FACK. */ 639 __u8 sacked; /* State flags for SACK/FACK. */
620#define TCPCB_SACKED_ACKED 0x01 /* SKB ACK'd by a SACK block */ 640#define TCPCB_SACKED_ACKED 0x01 /* SKB ACK'd by a SACK block */
621#define TCPCB_SACKED_RETRANS 0x02 /* SKB retransmitted */ 641#define TCPCB_SACKED_RETRANS 0x02 /* SKB retransmitted */
622#define TCPCB_LOST 0x04 /* SKB is lost */ 642#define TCPCB_LOST 0x04 /* SKB is lost */
623#define TCPCB_TAGBITS 0x07 /* All tag bits */ 643#define TCPCB_TAGBITS 0x07 /* All tag bits */
624 644 __u8 ip_dsfield; /* IPv4 tos or IPv6 dsfield */
645 /* 1 byte hole */
625#define TCPCB_EVER_RETRANS 0x80 /* Ever retransmitted frame */ 646#define TCPCB_EVER_RETRANS 0x80 /* Ever retransmitted frame */
626#define TCPCB_RETRANS (TCPCB_SACKED_RETRANS|TCPCB_EVER_RETRANS) 647#define TCPCB_RETRANS (TCPCB_SACKED_RETRANS|TCPCB_EVER_RETRANS)
627 648
@@ -798,6 +819,7 @@ static inline bool tcp_in_initial_slowstart(const struct tcp_sock *tp)
798static inline __u32 tcp_current_ssthresh(const struct sock *sk) 819static inline __u32 tcp_current_ssthresh(const struct sock *sk)
799{ 820{
800 const struct tcp_sock *tp = tcp_sk(sk); 821 const struct tcp_sock *tp = tcp_sk(sk);
822
801 if ((1 << inet_csk(sk)->icsk_ca_state) & (TCPF_CA_CWR | TCPF_CA_Recovery)) 823 if ((1 << inet_csk(sk)->icsk_ca_state) & (TCPF_CA_CWR | TCPF_CA_Recovery))
802 return tp->snd_ssthresh; 824 return tp->snd_ssthresh;
803 else 825 else
@@ -810,7 +832,7 @@ static inline __u32 tcp_current_ssthresh(const struct sock *sk)
810#define tcp_verify_left_out(tp) WARN_ON(tcp_left_out(tp) > tp->packets_out) 832#define tcp_verify_left_out(tp) WARN_ON(tcp_left_out(tp) > tp->packets_out)
811 833
812extern void tcp_enter_cwr(struct sock *sk, const int set_ssthresh); 834extern void tcp_enter_cwr(struct sock *sk, const int set_ssthresh);
813extern __u32 tcp_init_cwnd(struct tcp_sock *tp, struct dst_entry *dst); 835extern __u32 tcp_init_cwnd(const struct tcp_sock *tp, const struct dst_entry *dst);
814 836
815/* Slow start with delack produces 3 packets of burst, so that 837/* Slow start with delack produces 3 packets of burst, so that
816 * it is safe "de facto". This will be the default - same as 838 * it is safe "de facto". This will be the default - same as
@@ -839,7 +861,7 @@ static inline void tcp_minshall_update(struct tcp_sock *tp, unsigned int mss,
839 861
840static inline void tcp_check_probe_timer(struct sock *sk) 862static inline void tcp_check_probe_timer(struct sock *sk)
841{ 863{
842 struct tcp_sock *tp = tcp_sk(sk); 864 const struct tcp_sock *tp = tcp_sk(sk);
843 const struct inet_connection_sock *icsk = inet_csk(sk); 865 const struct inet_connection_sock *icsk = inet_csk(sk);
844 866
845 if (!tp->packets_out && !icsk->icsk_pending) 867 if (!tp->packets_out && !icsk->icsk_pending)
@@ -1162,8 +1184,9 @@ struct tcp_md5sig_pool {
1162 1184
1163/* - functions */ 1185/* - functions */
1164extern int tcp_v4_md5_hash_skb(char *md5_hash, struct tcp_md5sig_key *key, 1186extern int tcp_v4_md5_hash_skb(char *md5_hash, struct tcp_md5sig_key *key,
1165 struct sock *sk, struct request_sock *req, 1187 const struct sock *sk,
1166 struct sk_buff *skb); 1188 const struct request_sock *req,
1189 const struct sk_buff *skb);
1167extern struct tcp_md5sig_key * tcp_v4_md5_lookup(struct sock *sk, 1190extern struct tcp_md5sig_key * tcp_v4_md5_lookup(struct sock *sk,
1168 struct sock *addr_sk); 1191 struct sock *addr_sk);
1169extern int tcp_v4_md5_do_add(struct sock *sk, __be32 addr, u8 *newkey, 1192extern int tcp_v4_md5_do_add(struct sock *sk, __be32 addr, u8 *newkey,
@@ -1180,17 +1203,17 @@ extern int tcp_v4_md5_do_del(struct sock *sk, __be32 addr);
1180#define tcp_twsk_md5_key(twsk) NULL 1203#define tcp_twsk_md5_key(twsk) NULL
1181#endif 1204#endif
1182 1205
1183extern struct tcp_md5sig_pool * __percpu *tcp_alloc_md5sig_pool(struct sock *); 1206extern struct tcp_md5sig_pool __percpu *tcp_alloc_md5sig_pool(struct sock *);
1184extern void tcp_free_md5sig_pool(void); 1207extern void tcp_free_md5sig_pool(void);
1185 1208
1186extern struct tcp_md5sig_pool *tcp_get_md5sig_pool(void); 1209extern struct tcp_md5sig_pool *tcp_get_md5sig_pool(void);
1187extern void tcp_put_md5sig_pool(void); 1210extern void tcp_put_md5sig_pool(void);
1188 1211
1189extern int tcp_md5_hash_header(struct tcp_md5sig_pool *, struct tcphdr *); 1212extern int tcp_md5_hash_header(struct tcp_md5sig_pool *, const struct tcphdr *);
1190extern int tcp_md5_hash_skb_data(struct tcp_md5sig_pool *, struct sk_buff *, 1213extern int tcp_md5_hash_skb_data(struct tcp_md5sig_pool *, const struct sk_buff *,
1191 unsigned header_len); 1214 unsigned header_len);
1192extern int tcp_md5_hash_key(struct tcp_md5sig_pool *hp, 1215extern int tcp_md5_hash_key(struct tcp_md5sig_pool *hp,
1193 struct tcp_md5sig_key *key); 1216 const struct tcp_md5sig_key *key);
1194 1217
1195/* write queue abstraction */ 1218/* write queue abstraction */
1196static inline void tcp_write_queue_purge(struct sock *sk) 1219static inline void tcp_write_queue_purge(struct sock *sk)
@@ -1203,22 +1226,24 @@ static inline void tcp_write_queue_purge(struct sock *sk)
1203 tcp_clear_all_retrans_hints(tcp_sk(sk)); 1226 tcp_clear_all_retrans_hints(tcp_sk(sk));
1204} 1227}
1205 1228
1206static inline struct sk_buff *tcp_write_queue_head(struct sock *sk) 1229static inline struct sk_buff *tcp_write_queue_head(const struct sock *sk)
1207{ 1230{
1208 return skb_peek(&sk->sk_write_queue); 1231 return skb_peek(&sk->sk_write_queue);
1209} 1232}
1210 1233
1211static inline struct sk_buff *tcp_write_queue_tail(struct sock *sk) 1234static inline struct sk_buff *tcp_write_queue_tail(const struct sock *sk)
1212{ 1235{
1213 return skb_peek_tail(&sk->sk_write_queue); 1236 return skb_peek_tail(&sk->sk_write_queue);
1214} 1237}
1215 1238
1216static inline struct sk_buff *tcp_write_queue_next(struct sock *sk, struct sk_buff *skb) 1239static inline struct sk_buff *tcp_write_queue_next(const struct sock *sk,
1240 const struct sk_buff *skb)
1217{ 1241{
1218 return skb_queue_next(&sk->sk_write_queue, skb); 1242 return skb_queue_next(&sk->sk_write_queue, skb);
1219} 1243}
1220 1244
1221static inline struct sk_buff *tcp_write_queue_prev(struct sock *sk, struct sk_buff *skb) 1245static inline struct sk_buff *tcp_write_queue_prev(const struct sock *sk,
1246 const struct sk_buff *skb)
1222{ 1247{
1223 return skb_queue_prev(&sk->sk_write_queue, skb); 1248 return skb_queue_prev(&sk->sk_write_queue, skb);
1224} 1249}
@@ -1232,7 +1257,7 @@ static inline struct sk_buff *tcp_write_queue_prev(struct sock *sk, struct sk_bu
1232#define tcp_for_write_queue_from_safe(skb, tmp, sk) \ 1257#define tcp_for_write_queue_from_safe(skb, tmp, sk) \
1233 skb_queue_walk_from_safe(&(sk)->sk_write_queue, skb, tmp) 1258 skb_queue_walk_from_safe(&(sk)->sk_write_queue, skb, tmp)
1234 1259
1235static inline struct sk_buff *tcp_send_head(struct sock *sk) 1260static inline struct sk_buff *tcp_send_head(const struct sock *sk)
1236{ 1261{
1237 return sk->sk_send_head; 1262 return sk->sk_send_head;
1238} 1263}
@@ -1243,7 +1268,7 @@ static inline bool tcp_skb_is_last(const struct sock *sk,
1243 return skb_queue_is_last(&sk->sk_write_queue, skb); 1268 return skb_queue_is_last(&sk->sk_write_queue, skb);
1244} 1269}
1245 1270
1246static inline void tcp_advance_send_head(struct sock *sk, struct sk_buff *skb) 1271static inline void tcp_advance_send_head(struct sock *sk, const struct sk_buff *skb)
1247{ 1272{
1248 if (tcp_skb_is_last(sk, skb)) 1273 if (tcp_skb_is_last(sk, skb))
1249 sk->sk_send_head = NULL; 1274 sk->sk_send_head = NULL;
@@ -1423,9 +1448,9 @@ struct tcp_sock_af_ops {
1423 struct sock *addr_sk); 1448 struct sock *addr_sk);
1424 int (*calc_md5_hash) (char *location, 1449 int (*calc_md5_hash) (char *location,
1425 struct tcp_md5sig_key *md5, 1450 struct tcp_md5sig_key *md5,
1426 struct sock *sk, 1451 const struct sock *sk,
1427 struct request_sock *req, 1452 const struct request_sock *req,
1428 struct sk_buff *skb); 1453 const struct sk_buff *skb);
1429 int (*md5_add) (struct sock *sk, 1454 int (*md5_add) (struct sock *sk,
1430 struct sock *addr_sk, 1455 struct sock *addr_sk,
1431 u8 *newkey, 1456 u8 *newkey,
@@ -1442,9 +1467,9 @@ struct tcp_request_sock_ops {
1442 struct request_sock *req); 1467 struct request_sock *req);
1443 int (*calc_md5_hash) (char *location, 1468 int (*calc_md5_hash) (char *location,
1444 struct tcp_md5sig_key *md5, 1469 struct tcp_md5sig_key *md5,
1445 struct sock *sk, 1470 const struct sock *sk,
1446 struct request_sock *req, 1471 const struct request_sock *req,
1447 struct sk_buff *skb); 1472 const struct sk_buff *skb);
1448#endif 1473#endif
1449}; 1474};
1450 1475
diff --git a/include/net/transp_v6.h b/include/net/transp_v6.h
index 5271a741c3a3..498433dd067d 100644
--- a/include/net/transp_v6.h
+++ b/include/net/transp_v6.h
@@ -39,6 +39,7 @@ extern int datagram_recv_ctl(struct sock *sk,
39 struct sk_buff *skb); 39 struct sk_buff *skb);
40 40
41extern int datagram_send_ctl(struct net *net, 41extern int datagram_send_ctl(struct net *net,
42 struct sock *sk,
42 struct msghdr *msg, 43 struct msghdr *msg,
43 struct flowi6 *fl6, 44 struct flowi6 *fl6,
44 struct ipv6_txoptions *opt, 45 struct ipv6_txoptions *opt,
diff --git a/include/net/udplite.h b/include/net/udplite.h
index 673a024c6b2a..5f097ca7d5c5 100644
--- a/include/net/udplite.h
+++ b/include/net/udplite.h
@@ -66,40 +66,34 @@ static inline int udplite_checksum_init(struct sk_buff *skb, struct udphdr *uh)
66 return 0; 66 return 0;
67} 67}
68 68
69static inline int udplite_sender_cscov(struct udp_sock *up, struct udphdr *uh) 69/* Slow-path computation of checksum. Socket is locked. */
70static inline __wsum udplite_csum_outgoing(struct sock *sk, struct sk_buff *skb)
70{ 71{
72 const struct udp_sock *up = udp_sk(skb->sk);
71 int cscov = up->len; 73 int cscov = up->len;
74 __wsum csum = 0;
72 75
73 /* 76 if (up->pcflag & UDPLITE_SEND_CC) {
74 * Sender has set `partial coverage' option on UDP-Lite socket 77 /*
75 */ 78 * Sender has set `partial coverage' option on UDP-Lite socket.
76 if (up->pcflag & UDPLITE_SEND_CC) { 79 * The special case "up->pcslen == 0" signifies full coverage.
80 */
77 if (up->pcslen < up->len) { 81 if (up->pcslen < up->len) {
78 /* up->pcslen == 0 means that full coverage is required, 82 if (0 < up->pcslen)
79 * partial coverage only if 0 < up->pcslen < up->len */ 83 cscov = up->pcslen;
80 if (0 < up->pcslen) { 84 udp_hdr(skb)->len = htons(up->pcslen);
81 cscov = up->pcslen;
82 }
83 uh->len = htons(up->pcslen);
84 } 85 }
85 /* 86 /*
86 * NOTE: Causes for the error case `up->pcslen > up->len': 87 * NOTE: Causes for the error case `up->pcslen > up->len':
87 * (i) Application error (will not be penalized). 88 * (i) Application error (will not be penalized).
88 * (ii) Payload too big for send buffer: data is split 89 * (ii) Payload too big for send buffer: data is split
89 * into several packets, each with its own header. 90 * into several packets, each with its own header.
90 * In this case (e.g. last segment), coverage may 91 * In this case (e.g. last segment), coverage may
91 * exceed packet length. 92 * exceed packet length.
92 * Since packets with coverage length > packet length are 93 * Since packets with coverage length > packet length are
93 * illegal, we fall back to the defaults here. 94 * illegal, we fall back to the defaults here.
94 */ 95 */
95 } 96 }
96 return cscov;
97}
98
99static inline __wsum udplite_csum_outgoing(struct sock *sk, struct sk_buff *skb)
100{
101 int cscov = udplite_sender_cscov(udp_sk(sk), udp_hdr(skb));
102 __wsum csum = 0;
103 97
104 skb->ip_summed = CHECKSUM_NONE; /* no HW support for checksumming */ 98 skb->ip_summed = CHECKSUM_NONE; /* no HW support for checksumming */
105 99
@@ -115,16 +109,21 @@ static inline __wsum udplite_csum_outgoing(struct sock *sk, struct sk_buff *skb)
115 return csum; 109 return csum;
116} 110}
117 111
112/* Fast-path computation of checksum. Socket may not be locked. */
118static inline __wsum udplite_csum(struct sk_buff *skb) 113static inline __wsum udplite_csum(struct sk_buff *skb)
119{ 114{
120 struct sock *sk = skb->sk; 115 const struct udp_sock *up = udp_sk(skb->sk);
121 int cscov = udplite_sender_cscov(udp_sk(sk), udp_hdr(skb));
122 const int off = skb_transport_offset(skb); 116 const int off = skb_transport_offset(skb);
123 const int len = skb->len - off; 117 int len = skb->len - off;
124 118
119 if ((up->pcflag & UDPLITE_SEND_CC) && up->pcslen < len) {
120 if (0 < up->pcslen)
121 len = up->pcslen;
122 udp_hdr(skb)->len = htons(up->pcslen);
123 }
125 skb->ip_summed = CHECKSUM_NONE; /* no HW support for checksumming */ 124 skb->ip_summed = CHECKSUM_NONE; /* no HW support for checksumming */
126 125
127 return skb_checksum(skb, off, min(cscov, len), 0); 126 return skb_checksum(skb, off, len, 0);
128} 127}
129 128
130extern void udplite4_register(void); 129extern void udplite4_register(void);
diff --git a/include/rdma/ib_addr.h b/include/rdma/ib_addr.h
index ae8c68f30f1b..639a4491fc0d 100644
--- a/include/rdma/ib_addr.h
+++ b/include/rdma/ib_addr.h
@@ -218,8 +218,12 @@ static inline int iboe_get_rate(struct net_device *dev)
218{ 218{
219 struct ethtool_cmd cmd; 219 struct ethtool_cmd cmd;
220 u32 speed; 220 u32 speed;
221 int err;
221 222
222 if (dev_ethtool_get_settings(dev, &cmd)) 223 rtnl_lock();
224 err = __ethtool_get_settings(dev, &cmd);
225 rtnl_unlock();
226 if (err)
223 return IB_RATE_PORT_CURRENT; 227 return IB_RATE_PORT_CURRENT;
224 228
225 speed = ethtool_cmd_speed(&cmd); 229 speed = ethtool_cmd_speed(&cmd);
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/osd_ore.h b/include/scsi/osd_ore.h
new file mode 100644
index 000000000000..f05fa826f89e
--- /dev/null
+++ b/include/scsi/osd_ore.h
@@ -0,0 +1,199 @@
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 enum pnfs_osd_raid_algorithm4
38 raid_algorithm;
39 unsigned stripe_unit;
40 unsigned mirrors_p1;
41
42 unsigned group_width;
43 unsigned parity;
44 u64 group_depth;
45 unsigned group_count;
46
47 /* Cached often needed calculations filled in by
48 * ore_verify_layout
49 */
50 unsigned long max_io_length; /* Max length that should be passed to
51 * ore_get_rw_state
52 */
53};
54
55struct ore_dev {
56 struct osd_dev *od;
57};
58
59struct ore_components {
60 unsigned first_dev; /* First logical device no */
61 unsigned numdevs; /* Num of devices in array */
62 /* If @single_comp == EC_SINGLE_COMP, @comps points to a single
63 * component. else there are @numdevs components
64 */
65 enum EC_COMP_USAGE {
66 EC_SINGLE_COMP = 0, EC_MULTPLE_COMPS = 0xffffffff
67 } single_comp;
68 struct ore_comp *comps;
69
70 /* Array of pointers to ore_dev-* . User will usually have these pointed
71 * too a bigger struct which contain an "ore_dev ored" member and use
72 * container_of(oc->ods[i], struct foo_dev, ored) to access the bigger
73 * structure.
74 */
75 struct ore_dev **ods;
76};
77
78/* ore_comp_dev Recievies a logical device index */
79static inline struct osd_dev *ore_comp_dev(
80 const struct ore_components *oc, unsigned i)
81{
82 BUG_ON((i < oc->first_dev) || (oc->first_dev + oc->numdevs <= i));
83 return oc->ods[i - oc->first_dev]->od;
84}
85
86static inline void ore_comp_set_dev(
87 struct ore_components *oc, unsigned i, struct osd_dev *od)
88{
89 oc->ods[i - oc->first_dev]->od = od;
90}
91
92struct ore_striping_info {
93 u64 offset;
94 u64 obj_offset;
95 u64 length;
96 u64 first_stripe_start; /* only used in raid writes */
97 u64 M; /* for truncate */
98 unsigned bytes_in_stripe;
99 unsigned dev;
100 unsigned par_dev;
101 unsigned unit_off;
102 unsigned cur_pg;
103 unsigned cur_comp;
104};
105
106struct ore_io_state;
107typedef void (*ore_io_done_fn)(struct ore_io_state *ios, void *private);
108struct _ore_r4w_op {
109 /* @Priv given here is passed ios->private */
110 struct page * (*get_page)(void *priv, u64 page_index, bool *uptodate);
111 void (*put_page)(void *priv, struct page *page);
112};
113
114struct ore_io_state {
115 struct kref kref;
116 struct ore_striping_info si;
117
118 void *private;
119 ore_io_done_fn done;
120
121 struct ore_layout *layout;
122 struct ore_components *oc;
123
124 /* Global read/write IO*/
125 loff_t offset;
126 unsigned long length;
127 void *kern_buff;
128
129 struct page **pages;
130 unsigned nr_pages;
131 unsigned pgbase;
132 unsigned pages_consumed;
133
134 /* Attributes */
135 unsigned in_attr_len;
136 struct osd_attr *in_attr;
137 unsigned out_attr_len;
138 struct osd_attr *out_attr;
139
140 bool reading;
141
142 /* House keeping of Parity pages */
143 bool extra_part_alloc;
144 struct page **parity_pages;
145 unsigned max_par_pages;
146 unsigned cur_par_page;
147 unsigned sgs_per_dev;
148 struct __stripe_pages_2d *sp2d;
149 struct ore_io_state *ios_read_4_write;
150 const struct _ore_r4w_op *r4w;
151
152 /* Variable array of size numdevs */
153 unsigned numdevs;
154 struct ore_per_dev_state {
155 struct osd_request *or;
156 struct bio *bio;
157 loff_t offset;
158 unsigned length;
159 unsigned last_sgs_total;
160 unsigned dev;
161 struct osd_sg_entry *sglist;
162 unsigned cur_sg;
163 } per_dev[];
164};
165
166static inline unsigned ore_io_state_size(unsigned numdevs)
167{
168 return sizeof(struct ore_io_state) +
169 sizeof(struct ore_per_dev_state) * numdevs;
170}
171
172/* ore.c */
173int ore_verify_layout(unsigned total_comps, struct ore_layout *layout);
174void ore_calc_stripe_info(struct ore_layout *layout, u64 file_offset,
175 u64 length, struct ore_striping_info *si);
176int ore_get_rw_state(struct ore_layout *layout, struct ore_components *comps,
177 bool is_reading, u64 offset, u64 length,
178 struct ore_io_state **ios);
179int ore_get_io_state(struct ore_layout *layout, struct ore_components *comps,
180 struct ore_io_state **ios);
181void ore_put_io_state(struct ore_io_state *ios);
182
183typedef void (*ore_on_dev_error)(struct ore_io_state *ios, struct ore_dev *od,
184 unsigned dev_index, enum osd_err_priority oep,
185 u64 dev_offset, u64 dev_len);
186int ore_check_io(struct ore_io_state *ios, ore_on_dev_error rep);
187
188int ore_create(struct ore_io_state *ios);
189int ore_remove(struct ore_io_state *ios);
190int ore_write(struct ore_io_state *ios);
191int ore_read(struct ore_io_state *ios);
192int ore_truncate(struct ore_layout *layout, struct ore_components *comps,
193 u64 size);
194
195int extract_attr_from_ios(struct ore_io_state *ios, struct osd_attr *attr);
196
197extern const struct osd_attr g_attr_logical_length;
198
199#endif
diff --git a/include/sound/pcm.h b/include/sound/pcm.h
index 57e71fa33f7c..54cb079b7bf1 100644
--- a/include/sound/pcm.h
+++ b/include/sound/pcm.h
@@ -29,7 +29,7 @@
29#include <linux/poll.h> 29#include <linux/poll.h>
30#include <linux/mm.h> 30#include <linux/mm.h>
31#include <linux/bitops.h> 31#include <linux/bitops.h>
32#include <linux/pm_qos_params.h> 32#include <linux/pm_qos.h>
33 33
34#define snd_pcm_substream_chip(substream) ((substream)->private_data) 34#define snd_pcm_substream_chip(substream) ((substream)->private_data)
35#define snd_pcm_chip(pcm) ((pcm)->private_data) 35#define snd_pcm_chip(pcm) ((pcm)->private_data)
@@ -373,7 +373,7 @@ struct snd_pcm_substream {
373 int number; 373 int number;
374 char name[32]; /* substream name */ 374 char name[32]; /* substream name */
375 int stream; /* stream (direction) */ 375 int stream; /* stream (direction) */
376 struct pm_qos_request_list latency_pm_qos_req; /* pm_qos request */ 376 struct pm_qos_request latency_pm_qos_req; /* pm_qos request */
377 size_t buffer_bytes_max; /* limit ring buffer size */ 377 size_t buffer_bytes_max; /* limit ring buffer size */
378 struct snd_dma_buffer dma_buffer; 378 struct snd_dma_buffer dma_buffer;
379 unsigned int dma_buf_id; 379 unsigned int dma_buf_id;
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/sound/tlv320aic3x.h b/include/sound/tlv320aic3x.h
index 99e0308bf2c2..ffd9bc793105 100644
--- a/include/sound/tlv320aic3x.h
+++ b/include/sound/tlv320aic3x.h
@@ -1,7 +1,7 @@
1/* 1/*
2 * Platform data for Texas Instruments TLV320AIC3x codec 2 * Platform data for Texas Instruments TLV320AIC3x codec
3 * 3 *
4 * Author: Jarkko Nikula <jhnikula@gmail.com> 4 * Author: Jarkko Nikula <jarkko.nikula@bitmer.com>
5 * 5 *
6 * This program is free software; you can redistribute it and/or modify 6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as 7 * it under the terms of the GNU General Public License version 2 as
diff --git a/include/sound/wm8915.h b/include/sound/wm8996.h
index 5817d762f6f3..ea4d88f43975 100644
--- a/include/sound/wm8915.h
+++ b/include/sound/wm8996.h
@@ -1,5 +1,5 @@
1/* 1/*
2 * linux/sound/wm8915.h -- Platform data for WM8915 2 * linux/sound/wm8996.h -- Platform data for WM8996
3 * 3 *
4 * Copyright 2011 Wolfson Microelectronics. PLC. 4 * Copyright 2011 Wolfson Microelectronics. PLC.
5 * 5 *
@@ -8,14 +8,14 @@
8 * published by the Free Software Foundation. 8 * published by the Free Software Foundation.
9 */ 9 */
10 10
11#ifndef __LINUX_SND_WM8903_H 11#ifndef __LINUX_SND_WM8996_H
12#define __LINUX_SND_WM8903_H 12#define __LINUX_SND_WM8996_H
13 13
14enum wm8915_inmode { 14enum wm8996_inmode {
15 WM8915_DIFFERRENTIAL_1 = 0, /* IN1xP - IN1xN */ 15 WM8996_DIFFERRENTIAL_1 = 0, /* IN1xP - IN1xN */
16 WM8915_INVERTING = 1, /* IN1xN */ 16 WM8996_INVERTING = 1, /* IN1xN */
17 WM8915_NON_INVERTING = 2, /* IN1xP */ 17 WM8996_NON_INVERTING = 2, /* IN1xP */
18 WM8915_DIFFERENTIAL_2 = 3, /* IN2xP - IN2xP */ 18 WM8996_DIFFERENTIAL_2 = 3, /* IN2xP - IN2xP */
19}; 19};
20 20
21/** 21/**
@@ -25,23 +25,23 @@ enum wm8915_inmode {
25 * Configurations are expected to be generated using the ReTune Mobile 25 * Configurations are expected to be generated using the ReTune Mobile
26 * control panel in WISCE - see http://www.wolfsonmicro.com/wisce/ 26 * control panel in WISCE - see http://www.wolfsonmicro.com/wisce/
27 */ 27 */
28struct wm8915_retune_mobile_config { 28struct wm8996_retune_mobile_config {
29 const char *name; 29 const char *name;
30 int rate; 30 int rate;
31 u16 regs[20]; 31 u16 regs[20];
32}; 32};
33 33
34#define WM8915_SET_DEFAULT 0x10000 34#define WM8996_SET_DEFAULT 0x10000
35 35
36struct wm8915_pdata { 36struct wm8996_pdata {
37 int irq_flags; /** Set IRQ trigger flags; default active low */ 37 int irq_flags; /** Set IRQ trigger flags; default active low */
38 38
39 int ldo_ena; /** GPIO for LDO1; -1 for none */ 39 int ldo_ena; /** GPIO for LDO1; -1 for none */
40 40
41 int micdet_def; /** Default MICDET_SRC/HP1FB_SRC/MICD_BIAS */ 41 int micdet_def; /** Default MICDET_SRC/HP1FB_SRC/MICD_BIAS */
42 42
43 enum wm8915_inmode inl_mode; 43 enum wm8996_inmode inl_mode;
44 enum wm8915_inmode inr_mode; 44 enum wm8996_inmode inr_mode;
45 45
46 u32 spkmute_seq; /** Value for register 0x802 */ 46 u32 spkmute_seq; /** Value for register 0x802 */
47 47
@@ -49,7 +49,7 @@ struct wm8915_pdata {
49 u32 gpio_default[5]; 49 u32 gpio_default[5];
50 50
51 int num_retune_mobile_cfgs; 51 int num_retune_mobile_cfgs;
52 struct wm8915_retune_mobile_config *retune_mobile_cfgs; 52 struct wm8996_retune_mobile_config *retune_mobile_cfgs;
53}; 53};
54 54
55#endif 55#endif
diff --git a/include/target/configfs_macros.h b/include/target/configfs_macros.h
index 7fe74608b437..a0fc85bbe2da 100644
--- a/include/target/configfs_macros.h
+++ b/include/target/configfs_macros.h
@@ -30,8 +30,8 @@
30 * Added CONFIGFS_EATTR() macros from original configfs.h macros 30 * Added CONFIGFS_EATTR() macros from original configfs.h macros
31 * Copright (C) 2008-2009 Nicholas A. Bellinger <nab@linux-iscsi.org> 31 * Copright (C) 2008-2009 Nicholas A. Bellinger <nab@linux-iscsi.org>
32 * 32 *
33 * Please read Documentation/filesystems/configfs.txt before using the 33 * Please read Documentation/filesystems/configfs/configfs.txt before using
34 * configfs interface, ESPECIALLY the parts about reference counts and 34 * the configfs interface, ESPECIALLY the parts about reference counts and
35 * item destructors. 35 * item destructors.
36 */ 36 */
37 37
diff --git a/include/target/target_core_base.h b/include/target/target_core_base.h
index 27040653005e..35aa786f93da 100644
--- a/include/target/target_core_base.h
+++ b/include/target/target_core_base.h
@@ -10,10 +10,7 @@
10#include <net/tcp.h> 10#include <net/tcp.h>
11 11
12#define TARGET_CORE_MOD_VERSION "v4.1.0-rc1-ml" 12#define TARGET_CORE_MOD_VERSION "v4.1.0-rc1-ml"
13#define SHUTDOWN_SIGS (sigmask(SIGKILL)|sigmask(SIGINT)|sigmask(SIGABRT))
14 13
15/* Used by transport_generic_allocate_iovecs() */
16#define TRANSPORT_IOV_DATA_BUFFER 5
17/* Maximum Number of LUNs per Target Portal Group */ 14/* Maximum Number of LUNs per Target Portal Group */
18/* Don't raise above 511 or REPORT_LUNS needs to handle >1 page */ 15/* Don't raise above 511 or REPORT_LUNS needs to handle >1 page */
19#define TRANSPORT_MAX_LUNS_PER_TPG 256 16#define TRANSPORT_MAX_LUNS_PER_TPG 256
@@ -75,32 +72,26 @@ enum transport_tpg_type_table {
75}; 72};
76 73
77/* Used for generate timer flags */ 74/* Used for generate timer flags */
78enum timer_flags_table { 75enum se_task_flags {
79 TF_RUNNING = 0x01, 76 TF_ACTIVE = (1 << 0),
80 TF_STOP = 0x02, 77 TF_SENT = (1 << 1),
78 TF_REQUEST_STOP = (1 << 2),
81}; 79};
82 80
83/* Special transport agnostic struct se_cmd->t_states */ 81/* Special transport agnostic struct se_cmd->t_states */
84enum transport_state_table { 82enum transport_state_table {
85 TRANSPORT_NO_STATE = 0, 83 TRANSPORT_NO_STATE = 0,
86 TRANSPORT_NEW_CMD = 1, 84 TRANSPORT_NEW_CMD = 1,
87 TRANSPORT_DEFERRED_CMD = 2,
88 TRANSPORT_WRITE_PENDING = 3, 85 TRANSPORT_WRITE_PENDING = 3,
89 TRANSPORT_PROCESS_WRITE = 4, 86 TRANSPORT_PROCESS_WRITE = 4,
90 TRANSPORT_PROCESSING = 5, 87 TRANSPORT_PROCESSING = 5,
91 TRANSPORT_COMPLETE_OK = 6, 88 TRANSPORT_COMPLETE = 6,
92 TRANSPORT_COMPLETE_FAILURE = 7,
93 TRANSPORT_COMPLETE_TIMEOUT = 8,
94 TRANSPORT_PROCESS_TMR = 9, 89 TRANSPORT_PROCESS_TMR = 9,
95 TRANSPORT_TMR_COMPLETE = 10,
96 TRANSPORT_ISTATE_PROCESSING = 11, 90 TRANSPORT_ISTATE_PROCESSING = 11,
97 TRANSPORT_ISTATE_PROCESSED = 12,
98 TRANSPORT_KILL = 13,
99 TRANSPORT_REMOVE = 14,
100 TRANSPORT_FREE = 15,
101 TRANSPORT_NEW_CMD_MAP = 16, 91 TRANSPORT_NEW_CMD_MAP = 16,
102 TRANSPORT_FREE_CMD_INTR = 17, 92 TRANSPORT_FREE_CMD_INTR = 17,
103 TRANSPORT_COMPLETE_QF_WP = 18, 93 TRANSPORT_COMPLETE_QF_WP = 18,
94 TRANSPORT_COMPLETE_QF_OK = 19,
104}; 95};
105 96
106/* Used for struct se_cmd->se_cmd_flags */ 97/* Used for struct se_cmd->se_cmd_flags */
@@ -125,7 +116,6 @@ enum se_cmd_flags_table {
125 SCF_UNUSED = 0x00100000, 116 SCF_UNUSED = 0x00100000,
126 SCF_PASSTHROUGH_SG_TO_MEM_NOALLOC = 0x00400000, 117 SCF_PASSTHROUGH_SG_TO_MEM_NOALLOC = 0x00400000,
127 SCF_EMULATE_CDB_ASYNC = 0x01000000, 118 SCF_EMULATE_CDB_ASYNC = 0x01000000,
128 SCF_EMULATE_QUEUE_FULL = 0x02000000,
129}; 119};
130 120
131/* struct se_dev_entry->lun_flags and struct se_lun->lun_access */ 121/* struct se_dev_entry->lun_flags and struct se_lun->lun_access */
@@ -401,34 +391,22 @@ struct se_queue_obj {
401} ____cacheline_aligned; 391} ____cacheline_aligned;
402 392
403struct se_task { 393struct se_task {
404 unsigned char task_sense;
405 struct scatterlist *task_sg;
406 u32 task_sg_nents;
407 struct scatterlist *task_sg_bidi;
408 u8 task_scsi_status;
409 u8 task_flags;
410 int task_error_status;
411 int task_state_flags;
412 bool task_padded_sg;
413 unsigned long long task_lba; 394 unsigned long long task_lba;
414 u32 task_no; 395 u32 task_sectors;
415 u32 task_sectors; 396 u32 task_size;
416 u32 task_size; 397 struct se_cmd *task_se_cmd;
398 struct scatterlist *task_sg;
399 u32 task_sg_nents;
400 u16 task_flags;
401 u8 task_sense;
402 u8 task_scsi_status;
403 int task_error_status;
417 enum dma_data_direction task_data_direction; 404 enum dma_data_direction task_data_direction;
418 struct se_cmd *task_se_cmd; 405 atomic_t task_state_active;
419 struct se_device *se_dev; 406 struct list_head t_list;
407 struct list_head t_execute_list;
408 struct list_head t_state_list;
420 struct completion task_stop_comp; 409 struct completion task_stop_comp;
421 atomic_t task_active;
422 atomic_t task_execute_queue;
423 atomic_t task_timeout;
424 atomic_t task_sent;
425 atomic_t task_stop;
426 atomic_t task_state_active;
427 struct timer_list task_timer;
428 struct se_device *se_obj_ptr;
429 struct list_head t_list;
430 struct list_head t_execute_list;
431 struct list_head t_state_list;
432} ____cacheline_aligned; 410} ____cacheline_aligned;
433 411
434struct se_cmd { 412struct se_cmd {
@@ -446,8 +424,6 @@ struct se_cmd {
446 int sam_task_attr; 424 int sam_task_attr;
447 /* Transport protocol dependent state, see transport_state_table */ 425 /* Transport protocol dependent state, see transport_state_table */
448 enum transport_state_table t_state; 426 enum transport_state_table t_state;
449 /* Transport protocol dependent state for out of order CmdSNs */
450 int deferred_t_state;
451 /* Transport specific error status */ 427 /* Transport specific error status */
452 int transport_error_status; 428 int transport_error_status;
453 /* See se_cmd_flags_table */ 429 /* See se_cmd_flags_table */
@@ -461,7 +437,6 @@ struct se_cmd {
461 u32 orig_fe_lun; 437 u32 orig_fe_lun;
462 /* Persistent Reservation key */ 438 /* Persistent Reservation key */
463 u64 pr_res_key; 439 u64 pr_res_key;
464 atomic_t transport_sent;
465 /* Used for sense data */ 440 /* Used for sense data */
466 void *sense_buffer; 441 void *sense_buffer;
467 struct list_head se_delayed_node; 442 struct list_head se_delayed_node;
@@ -479,10 +454,7 @@ struct se_cmd {
479 struct list_head se_queue_node; 454 struct list_head se_queue_node;
480 struct target_core_fabric_ops *se_tfo; 455 struct target_core_fabric_ops *se_tfo;
481 int (*transport_emulate_cdb)(struct se_cmd *); 456 int (*transport_emulate_cdb)(struct se_cmd *);
482 void (*transport_split_cdb)(unsigned long long, u32, unsigned char *);
483 void (*transport_wait_for_tasks)(struct se_cmd *, int, int);
484 void (*transport_complete_callback)(struct se_cmd *); 457 void (*transport_complete_callback)(struct se_cmd *);
485 int (*transport_qf_callback)(struct se_cmd *);
486 458
487 unsigned char *t_task_cdb; 459 unsigned char *t_task_cdb;
488 unsigned char __t_task_cdb[TCM_MAX_COMMAND_SIZE]; 460 unsigned char __t_task_cdb[TCM_MAX_COMMAND_SIZE];
@@ -495,7 +467,6 @@ struct se_cmd {
495 atomic_t t_se_count; 467 atomic_t t_se_count;
496 atomic_t t_task_cdbs_left; 468 atomic_t t_task_cdbs_left;
497 atomic_t t_task_cdbs_ex_left; 469 atomic_t t_task_cdbs_ex_left;
498 atomic_t t_task_cdbs_timeout_left;
499 atomic_t t_task_cdbs_sent; 470 atomic_t t_task_cdbs_sent;
500 atomic_t t_transport_aborted; 471 atomic_t t_transport_aborted;
501 atomic_t t_transport_active; 472 atomic_t t_transport_active;
@@ -503,7 +474,6 @@ struct se_cmd {
503 atomic_t t_transport_queue_active; 474 atomic_t t_transport_queue_active;
504 atomic_t t_transport_sent; 475 atomic_t t_transport_sent;
505 atomic_t t_transport_stop; 476 atomic_t t_transport_stop;
506 atomic_t t_transport_timeout;
507 atomic_t transport_dev_active; 477 atomic_t transport_dev_active;
508 atomic_t transport_lun_active; 478 atomic_t transport_lun_active;
509 atomic_t transport_lun_fe_stop; 479 atomic_t transport_lun_fe_stop;
@@ -514,6 +484,8 @@ struct se_cmd {
514 struct completion transport_lun_stop_comp; 484 struct completion transport_lun_stop_comp;
515 struct scatterlist *t_tasks_sg_chained; 485 struct scatterlist *t_tasks_sg_chained;
516 486
487 struct work_struct work;
488
517 /* 489 /*
518 * Used for pre-registered fabric SGL passthrough WRITE and READ 490 * Used for pre-registered fabric SGL passthrough WRITE and READ
519 * with the special SCF_PASSTHROUGH_CONTIG_TO_SG case for TCM_Loop 491 * with the special SCF_PASSTHROUGH_CONTIG_TO_SG case for TCM_Loop
@@ -670,7 +642,6 @@ struct se_dev_attrib {
670 u32 optimal_sectors; 642 u32 optimal_sectors;
671 u32 hw_queue_depth; 643 u32 hw_queue_depth;
672 u32 queue_depth; 644 u32 queue_depth;
673 u32 task_timeout;
674 u32 max_unmap_lba_count; 645 u32 max_unmap_lba_count;
675 u32 max_unmap_block_desc_count; 646 u32 max_unmap_block_desc_count;
676 u32 unmap_granularity; 647 u32 unmap_granularity;
diff --git a/include/target/target_core_fabric_ops.h b/include/target/target_core_fabric_ops.h
index 2de8fe907596..126c675f4f14 100644
--- a/include/target/target_core_fabric_ops.h
+++ b/include/target/target_core_fabric_ops.h
@@ -27,6 +27,12 @@ struct target_core_fabric_ops {
27 int (*tpg_check_demo_mode_cache)(struct se_portal_group *); 27 int (*tpg_check_demo_mode_cache)(struct se_portal_group *);
28 int (*tpg_check_demo_mode_write_protect)(struct se_portal_group *); 28 int (*tpg_check_demo_mode_write_protect)(struct se_portal_group *);
29 int (*tpg_check_prod_mode_write_protect)(struct se_portal_group *); 29 int (*tpg_check_prod_mode_write_protect)(struct se_portal_group *);
30 /*
31 * Optionally used by fabrics to allow demo-mode login, but not
32 * expose any TPG LUNs, and return 'not connected' in standard
33 * inquiry response
34 */
35 int (*tpg_check_demo_mode_login_only)(struct se_portal_group *);
30 struct se_node_acl *(*tpg_alloc_fabric_acl)( 36 struct se_node_acl *(*tpg_alloc_fabric_acl)(
31 struct se_portal_group *); 37 struct se_portal_group *);
32 void (*tpg_release_fabric_acl)(struct se_portal_group *, 38 void (*tpg_release_fabric_acl)(struct se_portal_group *,
diff --git a/include/target/target_core_tmr.h b/include/target/target_core_tmr.h
index bd5596807478..d5876e17d3fb 100644
--- a/include/target/target_core_tmr.h
+++ b/include/target/target_core_tmr.h
@@ -27,7 +27,7 @@ enum tcm_tmrsp_table {
27 27
28extern struct kmem_cache *se_tmr_req_cache; 28extern struct kmem_cache *se_tmr_req_cache;
29 29
30extern struct se_tmr_req *core_tmr_alloc_req(struct se_cmd *, void *, u8); 30extern struct se_tmr_req *core_tmr_alloc_req(struct se_cmd *, void *, u8, gfp_t);
31extern void core_tmr_release_req(struct se_tmr_req *); 31extern void core_tmr_release_req(struct se_tmr_req *);
32extern int core_tmr_lun_reset(struct se_device *, struct se_tmr_req *, 32extern int core_tmr_lun_reset(struct se_device *, struct se_tmr_req *,
33 struct list_head *, struct se_cmd *); 33 struct list_head *, struct se_cmd *);
diff --git a/include/target/target_core_transport.h b/include/target/target_core_transport.h
index 46aae4f94ede..a037a1a6fbba 100644
--- a/include/target/target_core_transport.h
+++ b/include/target/target_core_transport.h
@@ -22,10 +22,9 @@
22#define PYX_TRANSPORT_LU_COMM_FAILURE -7 22#define PYX_TRANSPORT_LU_COMM_FAILURE -7
23#define PYX_TRANSPORT_UNKNOWN_MODE_PAGE -8 23#define PYX_TRANSPORT_UNKNOWN_MODE_PAGE -8
24#define PYX_TRANSPORT_WRITE_PROTECTED -9 24#define PYX_TRANSPORT_WRITE_PROTECTED -9
25#define PYX_TRANSPORT_TASK_TIMEOUT -10 25#define PYX_TRANSPORT_RESERVATION_CONFLICT -10
26#define PYX_TRANSPORT_RESERVATION_CONFLICT -11 26#define PYX_TRANSPORT_ILLEGAL_REQUEST -11
27#define PYX_TRANSPORT_ILLEGAL_REQUEST -12 27#define PYX_TRANSPORT_USE_SENSE_REASON -12
28#define PYX_TRANSPORT_USE_SENSE_REASON -13
29 28
30#ifndef SAM_STAT_RESERVATION_CONFLICT 29#ifndef SAM_STAT_RESERVATION_CONFLICT
31#define SAM_STAT_RESERVATION_CONFLICT 0x18 30#define SAM_STAT_RESERVATION_CONFLICT 0x18
@@ -38,16 +37,6 @@
38#define TRANSPORT_PLUGIN_VHBA_PDEV 2 37#define TRANSPORT_PLUGIN_VHBA_PDEV 2
39#define TRANSPORT_PLUGIN_VHBA_VDEV 3 38#define TRANSPORT_PLUGIN_VHBA_VDEV 3
40 39
41/* For SE OBJ Plugins, in seconds */
42#define TRANSPORT_TIMEOUT_TUR 10
43#define TRANSPORT_TIMEOUT_TYPE_DISK 60
44#define TRANSPORT_TIMEOUT_TYPE_ROM 120
45#define TRANSPORT_TIMEOUT_TYPE_TAPE 600
46#define TRANSPORT_TIMEOUT_TYPE_OTHER 300
47
48/* For se_task->task_state_flags */
49#define TSF_EXCEPTION_CLEARED 0x01
50
51/* 40/*
52 * struct se_subsystem_dev->su_dev_flags 41 * struct se_subsystem_dev->su_dev_flags
53*/ 42*/
@@ -64,8 +53,6 @@
64#define DF_SPC2_RESERVATIONS_WITH_ISID 0x00000004 53#define DF_SPC2_RESERVATIONS_WITH_ISID 0x00000004
65 54
66/* struct se_dev_attrib sanity values */ 55/* struct se_dev_attrib sanity values */
67/* 10 Minutes */
68#define DA_TASK_TIMEOUT_MAX 600
69/* Default max_unmap_lba_count */ 56/* Default max_unmap_lba_count */
70#define DA_MAX_UNMAP_LBA_COUNT 0 57#define DA_MAX_UNMAP_LBA_COUNT 0
71/* Default max_unmap_block_desc_count */ 58/* Default max_unmap_block_desc_count */
@@ -110,16 +97,13 @@
110 97
111#define MOD_MAX_SECTORS(ms, bs) (ms % (PAGE_SIZE / bs)) 98#define MOD_MAX_SECTORS(ms, bs) (ms % (PAGE_SIZE / bs))
112 99
113struct se_mem;
114struct se_subsystem_api; 100struct se_subsystem_api;
115 101
116extern struct kmem_cache *se_mem_cache;
117
118extern int init_se_kmem_caches(void); 102extern int init_se_kmem_caches(void);
119extern void release_se_kmem_caches(void); 103extern void release_se_kmem_caches(void);
120extern u32 scsi_get_new_index(scsi_index_t); 104extern u32 scsi_get_new_index(scsi_index_t);
121extern void transport_init_queue_obj(struct se_queue_obj *); 105extern void transport_init_queue_obj(struct se_queue_obj *);
122extern int transport_subsystem_check_init(void); 106extern void transport_subsystem_check_init(void);
123extern int transport_subsystem_register(struct se_subsystem_api *); 107extern int transport_subsystem_register(struct se_subsystem_api *);
124extern void transport_subsystem_release(struct se_subsystem_api *); 108extern void transport_subsystem_release(struct se_subsystem_api *);
125extern void transport_load_plugins(void); 109extern void transport_load_plugins(void);
@@ -134,7 +118,6 @@ extern void transport_free_session(struct se_session *);
134extern void transport_deregister_session_configfs(struct se_session *); 118extern void transport_deregister_session_configfs(struct se_session *);
135extern void transport_deregister_session(struct se_session *); 119extern void transport_deregister_session(struct se_session *);
136extern void transport_cmd_finish_abort(struct se_cmd *, int); 120extern void transport_cmd_finish_abort(struct se_cmd *, int);
137extern void transport_cmd_finish_abort_tmr(struct se_cmd *);
138extern void transport_complete_sync_cache(struct se_cmd *, int); 121extern void transport_complete_sync_cache(struct se_cmd *, int);
139extern void transport_complete_task(struct se_task *, int); 122extern void transport_complete_task(struct se_task *, int);
140extern void transport_add_task_to_execute_queue(struct se_task *, 123extern void transport_add_task_to_execute_queue(struct se_task *,
@@ -142,6 +125,8 @@ extern void transport_add_task_to_execute_queue(struct se_task *,
142 struct se_device *); 125 struct se_device *);
143extern void transport_remove_task_from_execute_queue(struct se_task *, 126extern void transport_remove_task_from_execute_queue(struct se_task *,
144 struct se_device *); 127 struct se_device *);
128extern void __transport_remove_task_from_execute_queue(struct se_task *,
129 struct se_device *);
145unsigned char *transport_dump_cmd_direction(struct se_cmd *); 130unsigned char *transport_dump_cmd_direction(struct se_cmd *);
146extern void transport_dump_dev_state(struct se_device *, char *, int *); 131extern void transport_dump_dev_state(struct se_device *, char *, int *);
147extern void transport_dump_dev_info(struct se_device *, struct se_lun *, 132extern void transport_dump_dev_info(struct se_device *, struct se_lun *,
@@ -169,29 +154,24 @@ extern void transport_init_se_cmd(struct se_cmd *,
169 unsigned char *); 154 unsigned char *);
170void *transport_kmap_first_data_page(struct se_cmd *cmd); 155void *transport_kmap_first_data_page(struct se_cmd *cmd);
171void transport_kunmap_first_data_page(struct se_cmd *cmd); 156void transport_kunmap_first_data_page(struct se_cmd *cmd);
172extern void transport_free_se_cmd(struct se_cmd *);
173extern int transport_generic_allocate_tasks(struct se_cmd *, unsigned char *); 157extern int transport_generic_allocate_tasks(struct se_cmd *, unsigned char *);
174extern int transport_generic_handle_cdb(struct se_cmd *);
175extern int transport_handle_cdb_direct(struct se_cmd *); 158extern int transport_handle_cdb_direct(struct se_cmd *);
176extern int transport_generic_handle_cdb_map(struct se_cmd *); 159extern int transport_generic_handle_cdb_map(struct se_cmd *);
177extern int transport_generic_handle_data(struct se_cmd *); 160extern int transport_generic_handle_data(struct se_cmd *);
178extern void transport_new_cmd_failure(struct se_cmd *); 161extern void transport_new_cmd_failure(struct se_cmd *);
179extern int transport_generic_handle_tmr(struct se_cmd *); 162extern int transport_generic_handle_tmr(struct se_cmd *);
180extern void transport_generic_free_cmd_intr(struct se_cmd *); 163extern void transport_generic_free_cmd_intr(struct se_cmd *);
181extern void __transport_stop_task_timer(struct se_task *, unsigned long *); 164extern bool target_stop_task(struct se_task *task, unsigned long *flags);
182extern int transport_generic_map_mem_to_cmd(struct se_cmd *cmd, struct scatterlist *, u32, 165extern int transport_generic_map_mem_to_cmd(struct se_cmd *cmd, struct scatterlist *, u32,
183 struct scatterlist *, u32); 166 struct scatterlist *, u32);
184extern int transport_clear_lun_from_sessions(struct se_lun *); 167extern int transport_clear_lun_from_sessions(struct se_lun *);
168extern void transport_wait_for_tasks(struct se_cmd *);
185extern int transport_check_aborted_status(struct se_cmd *, int); 169extern int transport_check_aborted_status(struct se_cmd *, int);
186extern int transport_send_check_condition_and_sense(struct se_cmd *, u8, int); 170extern int transport_send_check_condition_and_sense(struct se_cmd *, u8, int);
187extern void transport_send_task_abort(struct se_cmd *); 171extern void transport_send_task_abort(struct se_cmd *);
188extern void transport_release_cmd(struct se_cmd *); 172extern void transport_release_cmd(struct se_cmd *);
189extern void transport_generic_free_cmd(struct se_cmd *, int, int); 173extern void transport_generic_free_cmd(struct se_cmd *, int);
190extern void transport_generic_wait_for_cmds(struct se_cmd *, int); 174extern void transport_generic_wait_for_cmds(struct se_cmd *, int);
191extern int transport_init_task_sg(struct se_task *, struct se_mem *, u32);
192extern int transport_map_mem_to_sg(struct se_task *, struct list_head *,
193 struct scatterlist *, struct se_mem *,
194 struct se_mem **, u32 *, u32 *);
195extern void transport_do_task_sg_chain(struct se_cmd *); 175extern void transport_do_task_sg_chain(struct se_cmd *);
196extern void transport_generic_process_write(struct se_cmd *); 176extern void transport_generic_process_write(struct se_cmd *);
197extern int transport_generic_new_cmd(struct se_cmd *); 177extern int transport_generic_new_cmd(struct se_cmd *);
@@ -200,6 +180,7 @@ extern int transport_generic_do_tmr(struct se_cmd *);
200extern int core_alua_check_nonop_delay(struct se_cmd *); 180extern int core_alua_check_nonop_delay(struct se_cmd *);
201/* From target_core_cdb.c */ 181/* From target_core_cdb.c */
202extern int transport_emulate_control_cdb(struct se_task *); 182extern int transport_emulate_control_cdb(struct se_task *);
183extern void target_get_task_cdb(struct se_task *task, unsigned char *cdb);
203 184
204/* 185/*
205 * Each se_transport_task_t can have N number of possible struct se_task's 186 * Each se_transport_task_t can have N number of possible struct se_task's
@@ -227,6 +208,10 @@ struct se_subsystem_api {
227 * Transport Type. 208 * Transport Type.
228 */ 209 */
229 u8 transport_type; 210 u8 transport_type;
211
212 unsigned int fua_write_emulated : 1;
213 unsigned int write_cache_emulated : 1;
214
230 /* 215 /*
231 * struct module for struct se_hba references 216 * struct module for struct se_hba references
232 */ 217 */
@@ -236,18 +221,6 @@ struct se_subsystem_api {
236 */ 221 */
237 struct list_head sub_api_list; 222 struct list_head sub_api_list;
238 /* 223 /*
239 * For SCF_SCSI_NON_DATA_CDB
240 */
241 int (*cdb_none)(struct se_task *);
242 /*
243 * For SCF_SCSI_DATA_SG_IO_CDB
244 */
245 int (*map_data_SG)(struct se_task *);
246 /*
247 * For SCF_SCSI_CONTROL_SG_IO_CDB
248 */
249 int (*map_control_SG)(struct se_task *);
250 /*
251 * attach_hba(): 224 * attach_hba():
252 */ 225 */
253 int (*attach_hba)(struct se_hba *, u32); 226 int (*attach_hba)(struct se_hba *, u32);
@@ -275,22 +248,6 @@ struct se_subsystem_api {
275 void (*free_device)(void *); 248 void (*free_device)(void *);
276 249
277 /* 250 /*
278 * dpo_emulated():
279 */
280 int (*dpo_emulated)(struct se_device *);
281 /*
282 * fua_write_emulated():
283 */
284 int (*fua_write_emulated)(struct se_device *);
285 /*
286 * fua_read_emulated():
287 */
288 int (*fua_read_emulated)(struct se_device *);
289 /*
290 * write_cache_emulated():
291 */
292 int (*write_cache_emulated)(struct se_device *);
293 /*
294 * transport_complete(): 251 * transport_complete():
295 * 252 *
296 * Use transport_generic_complete() for majority of DAS transport 253 * Use transport_generic_complete() for majority of DAS transport
@@ -331,10 +288,6 @@ struct se_subsystem_api {
331 ssize_t (*show_configfs_dev_params)(struct se_hba *, struct se_subsystem_dev *, 288 ssize_t (*show_configfs_dev_params)(struct se_hba *, struct se_subsystem_dev *,
332 char *); 289 char *);
333 /* 290 /*
334 * get_cdb():
335 */
336 unsigned char *(*get_cdb)(struct se_task *);
337 /*
338 * get_device_rev(): 291 * get_device_rev():
339 */ 292 */
340 u32 (*get_device_rev)(struct se_device *); 293 u32 (*get_device_rev)(struct se_device *);
diff --git a/include/trace/events/9p.h b/include/trace/events/9p.h
new file mode 100644
index 000000000000..beeaed8398ec
--- /dev/null
+++ b/include/trace/events/9p.h
@@ -0,0 +1,176 @@
1#undef TRACE_SYSTEM
2#define TRACE_SYSTEM 9p
3
4#if !defined(_TRACE_9P_H) || defined(TRACE_HEADER_MULTI_READ)
5#define _TRACE_9P_H
6
7#include <linux/tracepoint.h>
8
9#define show_9p_op(type) \
10 __print_symbolic(type, \
11 { P9_TLERROR, "P9_TLERROR" }, \
12 { P9_RLERROR, "P9_RLERROR" }, \
13 { P9_TSTATFS, "P9_TSTATFS" }, \
14 { P9_RSTATFS, "P9_RSTATFS" }, \
15 { P9_TLOPEN, "P9_TLOPEN" }, \
16 { P9_RLOPEN, "P9_RLOPEN" }, \
17 { P9_TLCREATE, "P9_TLCREATE" }, \
18 { P9_RLCREATE, "P9_RLCREATE" }, \
19 { P9_TSYMLINK, "P9_TSYMLINK" }, \
20 { P9_RSYMLINK, "P9_RSYMLINK" }, \
21 { P9_TMKNOD, "P9_TMKNOD" }, \
22 { P9_RMKNOD, "P9_RMKNOD" }, \
23 { P9_TRENAME, "P9_TRENAME" }, \
24 { P9_RRENAME, "P9_RRENAME" }, \
25 { P9_TREADLINK, "P9_TREADLINK" }, \
26 { P9_RREADLINK, "P9_RREADLINK" }, \
27 { P9_TGETATTR, "P9_TGETATTR" }, \
28 { P9_RGETATTR, "P9_RGETATTR" }, \
29 { P9_TSETATTR, "P9_TSETATTR" }, \
30 { P9_RSETATTR, "P9_RSETATTR" }, \
31 { P9_TXATTRWALK, "P9_TXATTRWALK" }, \
32 { P9_RXATTRWALK, "P9_RXATTRWALK" }, \
33 { P9_TXATTRCREATE, "P9_TXATTRCREATE" }, \
34 { P9_RXATTRCREATE, "P9_RXATTRCREATE" }, \
35 { P9_TREADDIR, "P9_TREADDIR" }, \
36 { P9_RREADDIR, "P9_RREADDIR" }, \
37 { P9_TFSYNC, "P9_TFSYNC" }, \
38 { P9_RFSYNC, "P9_RFSYNC" }, \
39 { P9_TLOCK, "P9_TLOCK" }, \
40 { P9_RLOCK, "P9_RLOCK" }, \
41 { P9_TGETLOCK, "P9_TGETLOCK" }, \
42 { P9_RGETLOCK, "P9_RGETLOCK" }, \
43 { P9_TLINK, "P9_TLINK" }, \
44 { P9_RLINK, "P9_RLINK" }, \
45 { P9_TMKDIR, "P9_TMKDIR" }, \
46 { P9_RMKDIR, "P9_RMKDIR" }, \
47 { P9_TRENAMEAT, "P9_TRENAMEAT" }, \
48 { P9_RRENAMEAT, "P9_RRENAMEAT" }, \
49 { P9_TUNLINKAT, "P9_TUNLINKAT" }, \
50 { P9_RUNLINKAT, "P9_RUNLINKAT" }, \
51 { P9_TVERSION, "P9_TVERSION" }, \
52 { P9_RVERSION, "P9_RVERSION" }, \
53 { P9_TAUTH, "P9_TAUTH" }, \
54 { P9_RAUTH, "P9_RAUTH" }, \
55 { P9_TATTACH, "P9_TATTACH" }, \
56 { P9_RATTACH, "P9_RATTACH" }, \
57 { P9_TERROR, "P9_TERROR" }, \
58 { P9_RERROR, "P9_RERROR" }, \
59 { P9_TFLUSH, "P9_TFLUSH" }, \
60 { P9_RFLUSH, "P9_RFLUSH" }, \
61 { P9_TWALK, "P9_TWALK" }, \
62 { P9_RWALK, "P9_RWALK" }, \
63 { P9_TOPEN, "P9_TOPEN" }, \
64 { P9_ROPEN, "P9_ROPEN" }, \
65 { P9_TCREATE, "P9_TCREATE" }, \
66 { P9_RCREATE, "P9_RCREATE" }, \
67 { P9_TREAD, "P9_TREAD" }, \
68 { P9_RREAD, "P9_RREAD" }, \
69 { P9_TWRITE, "P9_TWRITE" }, \
70 { P9_RWRITE, "P9_RWRITE" }, \
71 { P9_TCLUNK, "P9_TCLUNK" }, \
72 { P9_RCLUNK, "P9_RCLUNK" }, \
73 { P9_TREMOVE, "P9_TREMOVE" }, \
74 { P9_RREMOVE, "P9_RREMOVE" }, \
75 { P9_TSTAT, "P9_TSTAT" }, \
76 { P9_RSTAT, "P9_RSTAT" }, \
77 { P9_TWSTAT, "P9_TWSTAT" }, \
78 { P9_RWSTAT, "P9_RWSTAT" })
79
80TRACE_EVENT(9p_client_req,
81 TP_PROTO(struct p9_client *clnt, int8_t type, int tag),
82
83 TP_ARGS(clnt, type, tag),
84
85 TP_STRUCT__entry(
86 __field( void *, clnt )
87 __field( __u8, type )
88 __field( __u32, tag )
89 ),
90
91 TP_fast_assign(
92 __entry->clnt = clnt;
93 __entry->type = type;
94 __entry->tag = tag;
95 ),
96
97 TP_printk("client %lu request %s tag %d",
98 (long)__entry->clnt, show_9p_op(__entry->type),
99 __entry->tag)
100 );
101
102TRACE_EVENT(9p_client_res,
103 TP_PROTO(struct p9_client *clnt, int8_t type, int tag, int err),
104
105 TP_ARGS(clnt, type, tag, err),
106
107 TP_STRUCT__entry(
108 __field( void *, clnt )
109 __field( __u8, type )
110 __field( __u32, tag )
111 __field( __u32, err )
112 ),
113
114 TP_fast_assign(
115 __entry->clnt = clnt;
116 __entry->type = type;
117 __entry->tag = tag;
118 __entry->err = err;
119 ),
120
121 TP_printk("client %lu response %s tag %d err %d",
122 (long)__entry->clnt, show_9p_op(__entry->type),
123 __entry->tag, __entry->err)
124);
125
126/* dump 32 bytes of protocol data */
127#define P9_PROTO_DUMP_SZ 32
128TRACE_EVENT(9p_protocol_dump,
129 TP_PROTO(struct p9_client *clnt, struct p9_fcall *pdu),
130
131 TP_ARGS(clnt, pdu),
132
133 TP_STRUCT__entry(
134 __field( void *, clnt )
135 __field( __u8, type )
136 __field( __u16, tag )
137 __array( unsigned char, line, P9_PROTO_DUMP_SZ )
138 ),
139
140 TP_fast_assign(
141 __entry->clnt = clnt;
142 __entry->type = pdu->id;
143 __entry->tag = pdu->tag;
144 memcpy(__entry->line, pdu->sdata, P9_PROTO_DUMP_SZ);
145 ),
146 TP_printk("clnt %lu %s(tag = %d)\n%.3x: "
147 "%02x %02x %02x %02x %02x %02x %02x %02x "
148 "%02x %02x %02x %02x %02x %02x %02x %02x\n"
149 "%.3x: "
150 "%02x %02x %02x %02x %02x %02x %02x %02x "
151 "%02x %02x %02x %02x %02x %02x %02x %02x\n",
152 (long)__entry->clnt, show_9p_op(__entry->type),
153 __entry->tag, 0,
154 __entry->line[0], __entry->line[1],
155 __entry->line[2], __entry->line[3],
156 __entry->line[4], __entry->line[5],
157 __entry->line[6], __entry->line[7],
158 __entry->line[8], __entry->line[9],
159 __entry->line[10], __entry->line[11],
160 __entry->line[12], __entry->line[13],
161 __entry->line[14], __entry->line[15],
162 16,
163 __entry->line[16], __entry->line[17],
164 __entry->line[18], __entry->line[19],
165 __entry->line[20], __entry->line[21],
166 __entry->line[22], __entry->line[23],
167 __entry->line[24], __entry->line[25],
168 __entry->line[26], __entry->line[27],
169 __entry->line[28], __entry->line[29],
170 __entry->line[30], __entry->line[31])
171 );
172
173#endif /* _TRACE_9P_H */
174
175/* This part must be outside protection */
176#include <trace/define_trace.h>
diff --git a/include/trace/events/block.h b/include/trace/events/block.h
index bf366547da25..05c5e61f0a7c 100644
--- a/include/trace/events/block.h
+++ b/include/trace/events/block.h
@@ -8,6 +8,8 @@
8#include <linux/blkdev.h> 8#include <linux/blkdev.h>
9#include <linux/tracepoint.h> 9#include <linux/tracepoint.h>
10 10
11#define RWBS_LEN 8
12
11DECLARE_EVENT_CLASS(block_rq_with_error, 13DECLARE_EVENT_CLASS(block_rq_with_error,
12 14
13 TP_PROTO(struct request_queue *q, struct request *rq), 15 TP_PROTO(struct request_queue *q, struct request *rq),
@@ -19,7 +21,7 @@ DECLARE_EVENT_CLASS(block_rq_with_error,
19 __field( sector_t, sector ) 21 __field( sector_t, sector )
20 __field( unsigned int, nr_sector ) 22 __field( unsigned int, nr_sector )
21 __field( int, errors ) 23 __field( int, errors )
22 __array( char, rwbs, 6 ) 24 __array( char, rwbs, RWBS_LEN )
23 __dynamic_array( char, cmd, blk_cmd_buf_len(rq) ) 25 __dynamic_array( char, cmd, blk_cmd_buf_len(rq) )
24 ), 26 ),
25 27
@@ -104,7 +106,7 @@ DECLARE_EVENT_CLASS(block_rq,
104 __field( sector_t, sector ) 106 __field( sector_t, sector )
105 __field( unsigned int, nr_sector ) 107 __field( unsigned int, nr_sector )
106 __field( unsigned int, bytes ) 108 __field( unsigned int, bytes )
107 __array( char, rwbs, 6 ) 109 __array( char, rwbs, RWBS_LEN )
108 __array( char, comm, TASK_COMM_LEN ) 110 __array( char, comm, TASK_COMM_LEN )
109 __dynamic_array( char, cmd, blk_cmd_buf_len(rq) ) 111 __dynamic_array( char, cmd, blk_cmd_buf_len(rq) )
110 ), 112 ),
@@ -183,7 +185,7 @@ TRACE_EVENT(block_bio_bounce,
183 __field( dev_t, dev ) 185 __field( dev_t, dev )
184 __field( sector_t, sector ) 186 __field( sector_t, sector )
185 __field( unsigned int, nr_sector ) 187 __field( unsigned int, nr_sector )
186 __array( char, rwbs, 6 ) 188 __array( char, rwbs, RWBS_LEN )
187 __array( char, comm, TASK_COMM_LEN ) 189 __array( char, comm, TASK_COMM_LEN )
188 ), 190 ),
189 191
@@ -222,7 +224,7 @@ TRACE_EVENT(block_bio_complete,
222 __field( sector_t, sector ) 224 __field( sector_t, sector )
223 __field( unsigned, nr_sector ) 225 __field( unsigned, nr_sector )
224 __field( int, error ) 226 __field( int, error )
225 __array( char, rwbs, 6 ) 227 __array( char, rwbs, RWBS_LEN)
226 ), 228 ),
227 229
228 TP_fast_assign( 230 TP_fast_assign(
@@ -249,7 +251,7 @@ DECLARE_EVENT_CLASS(block_bio,
249 __field( dev_t, dev ) 251 __field( dev_t, dev )
250 __field( sector_t, sector ) 252 __field( sector_t, sector )
251 __field( unsigned int, nr_sector ) 253 __field( unsigned int, nr_sector )
252 __array( char, rwbs, 6 ) 254 __array( char, rwbs, RWBS_LEN )
253 __array( char, comm, TASK_COMM_LEN ) 255 __array( char, comm, TASK_COMM_LEN )
254 ), 256 ),
255 257
@@ -321,7 +323,7 @@ DECLARE_EVENT_CLASS(block_get_rq,
321 __field( dev_t, dev ) 323 __field( dev_t, dev )
322 __field( sector_t, sector ) 324 __field( sector_t, sector )
323 __field( unsigned int, nr_sector ) 325 __field( unsigned int, nr_sector )
324 __array( char, rwbs, 6 ) 326 __array( char, rwbs, RWBS_LEN )
325 __array( char, comm, TASK_COMM_LEN ) 327 __array( char, comm, TASK_COMM_LEN )
326 ), 328 ),
327 329
@@ -456,7 +458,7 @@ TRACE_EVENT(block_split,
456 __field( dev_t, dev ) 458 __field( dev_t, dev )
457 __field( sector_t, sector ) 459 __field( sector_t, sector )
458 __field( sector_t, new_sector ) 460 __field( sector_t, new_sector )
459 __array( char, rwbs, 6 ) 461 __array( char, rwbs, RWBS_LEN )
460 __array( char, comm, TASK_COMM_LEN ) 462 __array( char, comm, TASK_COMM_LEN )
461 ), 463 ),
462 464
@@ -498,7 +500,7 @@ TRACE_EVENT(block_bio_remap,
498 __field( unsigned int, nr_sector ) 500 __field( unsigned int, nr_sector )
499 __field( dev_t, old_dev ) 501 __field( dev_t, old_dev )
500 __field( sector_t, old_sector ) 502 __field( sector_t, old_sector )
501 __array( char, rwbs, 6 ) 503 __array( char, rwbs, RWBS_LEN)
502 ), 504 ),
503 505
504 TP_fast_assign( 506 TP_fast_assign(
@@ -542,7 +544,7 @@ TRACE_EVENT(block_rq_remap,
542 __field( unsigned int, nr_sector ) 544 __field( unsigned int, nr_sector )
543 __field( dev_t, old_dev ) 545 __field( dev_t, old_dev )
544 __field( sector_t, old_sector ) 546 __field( sector_t, old_sector )
545 __array( char, rwbs, 6 ) 547 __array( char, rwbs, RWBS_LEN)
546 ), 548 ),
547 549
548 TP_fast_assign( 550 TP_fast_assign(
diff --git a/include/trace/events/ext4.h b/include/trace/events/ext4.h
index 6363193a3418..b50a54736242 100644
--- a/include/trace/events/ext4.h
+++ b/include/trace/events/ext4.h
@@ -23,7 +23,7 @@ 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( __u64, blocks ) 29 __field( __u64, blocks )
@@ -52,7 +52,7 @@ TRACE_EVENT(ext4_request_inode,
52 TP_STRUCT__entry( 52 TP_STRUCT__entry(
53 __field( dev_t, dev ) 53 __field( dev_t, dev )
54 __field( ino_t, dir ) 54 __field( ino_t, dir )
55 __field( umode_t, mode ) 55 __field( __u16, mode )
56 ), 56 ),
57 57
58 TP_fast_assign( 58 TP_fast_assign(
@@ -75,7 +75,7 @@ TRACE_EVENT(ext4_allocate_inode,
75 __field( dev_t, dev ) 75 __field( dev_t, dev )
76 __field( ino_t, ino ) 76 __field( ino_t, ino )
77 __field( ino_t, dir ) 77 __field( ino_t, dir )
78 __field( umode_t, mode ) 78 __field( __u16, mode )
79 ), 79 ),
80 80
81 TP_fast_assign( 81 TP_fast_assign(
@@ -725,7 +725,7 @@ TRACE_EVENT(ext4_free_blocks,
725 TP_STRUCT__entry( 725 TP_STRUCT__entry(
726 __field( dev_t, dev ) 726 __field( dev_t, dev )
727 __field( ino_t, ino ) 727 __field( ino_t, ino )
728 __field( umode_t, mode ) 728 __field( __u16, mode )
729 __field( __u64, block ) 729 __field( __u64, block )
730 __field( unsigned long, count ) 730 __field( unsigned long, count )
731 __field( int, flags ) 731 __field( int, flags )
@@ -1012,7 +1012,7 @@ TRACE_EVENT(ext4_forget,
1012 TP_STRUCT__entry( 1012 TP_STRUCT__entry(
1013 __field( dev_t, dev ) 1013 __field( dev_t, dev )
1014 __field( ino_t, ino ) 1014 __field( ino_t, ino )
1015 __field( umode_t, mode ) 1015 __field( __u16, mode )
1016 __field( int, is_metadata ) 1016 __field( int, is_metadata )
1017 __field( __u64, block ) 1017 __field( __u64, block )
1018 ), 1018 ),
@@ -1039,7 +1039,7 @@ TRACE_EVENT(ext4_da_update_reserve_space,
1039 TP_STRUCT__entry( 1039 TP_STRUCT__entry(
1040 __field( dev_t, dev ) 1040 __field( dev_t, dev )
1041 __field( ino_t, ino ) 1041 __field( ino_t, ino )
1042 __field( umode_t, mode ) 1042 __field( __u16, mode )
1043 __field( __u64, i_blocks ) 1043 __field( __u64, i_blocks )
1044 __field( int, used_blocks ) 1044 __field( int, used_blocks )
1045 __field( int, reserved_data_blocks ) 1045 __field( int, reserved_data_blocks )
@@ -1076,7 +1076,7 @@ TRACE_EVENT(ext4_da_reserve_space,
1076 TP_STRUCT__entry( 1076 TP_STRUCT__entry(
1077 __field( dev_t, dev ) 1077 __field( dev_t, dev )
1078 __field( ino_t, ino ) 1078 __field( ino_t, ino )
1079 __field( umode_t, mode ) 1079 __field( __u16, mode )
1080 __field( __u64, i_blocks ) 1080 __field( __u64, i_blocks )
1081 __field( int, md_needed ) 1081 __field( int, md_needed )
1082 __field( int, reserved_data_blocks ) 1082 __field( int, reserved_data_blocks )
@@ -1110,7 +1110,7 @@ TRACE_EVENT(ext4_da_release_space,
1110 TP_STRUCT__entry( 1110 TP_STRUCT__entry(
1111 __field( dev_t, dev ) 1111 __field( dev_t, dev )
1112 __field( ino_t, ino ) 1112 __field( ino_t, ino )
1113 __field( umode_t, mode ) 1113 __field( __u16, mode )
1114 __field( __u64, i_blocks ) 1114 __field( __u64, i_blocks )
1115 __field( int, freed_blocks ) 1115 __field( int, freed_blocks )
1116 __field( int, reserved_data_blocks ) 1116 __field( int, reserved_data_blocks )
@@ -1518,6 +1518,77 @@ TRACE_EVENT(ext4_load_inode,
1518 (unsigned long) __entry->ino) 1518 (unsigned long) __entry->ino)
1519); 1519);
1520 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
1521#endif /* _TRACE_EXT4_H */ 1592#endif /* _TRACE_EXT4_H */
1522 1593
1523/* This part must be outside protection */ 1594/* This part must be outside protection */
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/rcu.h b/include/trace/events/rcu.h
new file mode 100644
index 000000000000..669fbd62ec25
--- /dev/null
+++ b/include/trace/events/rcu.h
@@ -0,0 +1,459 @@
1#undef TRACE_SYSTEM
2#define TRACE_SYSTEM rcu
3
4#if !defined(_TRACE_RCU_H) || defined(TRACE_HEADER_MULTI_READ)
5#define _TRACE_RCU_H
6
7#include <linux/tracepoint.h>
8
9/*
10 * Tracepoint for start/end markers used for utilization calculations.
11 * By convention, the string is of the following forms:
12 *
13 * "Start <activity>" -- Mark the start of the specified activity,
14 * such as "context switch". Nesting is permitted.
15 * "End <activity>" -- Mark the end of the specified activity.
16 *
17 * An "@" character within "<activity>" is a comment character: Data
18 * reduction scripts will ignore the "@" and the remainder of the line.
19 */
20TRACE_EVENT(rcu_utilization,
21
22 TP_PROTO(char *s),
23
24 TP_ARGS(s),
25
26 TP_STRUCT__entry(
27 __field(char *, s)
28 ),
29
30 TP_fast_assign(
31 __entry->s = s;
32 ),
33
34 TP_printk("%s", __entry->s)
35);
36
37#ifdef CONFIG_RCU_TRACE
38
39#if defined(CONFIG_TREE_RCU) || defined(CONFIG_TREE_PREEMPT_RCU)
40
41/*
42 * Tracepoint for grace-period events: starting and ending a grace
43 * period ("start" and "end", respectively), a CPU noting the start
44 * of a new grace period or the end of an old grace period ("cpustart"
45 * and "cpuend", respectively), a CPU passing through a quiescent
46 * state ("cpuqs"), a CPU coming online or going offline ("cpuonl"
47 * and "cpuofl", respectively), and a CPU being kicked for being too
48 * long in dyntick-idle mode ("kick").
49 */
50TRACE_EVENT(rcu_grace_period,
51
52 TP_PROTO(char *rcuname, unsigned long gpnum, char *gpevent),
53
54 TP_ARGS(rcuname, gpnum, gpevent),
55
56 TP_STRUCT__entry(
57 __field(char *, rcuname)
58 __field(unsigned long, gpnum)
59 __field(char *, gpevent)
60 ),
61
62 TP_fast_assign(
63 __entry->rcuname = rcuname;
64 __entry->gpnum = gpnum;
65 __entry->gpevent = gpevent;
66 ),
67
68 TP_printk("%s %lu %s",
69 __entry->rcuname, __entry->gpnum, __entry->gpevent)
70);
71
72/*
73 * Tracepoint for grace-period-initialization events. These are
74 * distinguished by the type of RCU, the new grace-period number, the
75 * rcu_node structure level, the starting and ending CPU covered by the
76 * rcu_node structure, and the mask of CPUs that will be waited for.
77 * All but the type of RCU are extracted from the rcu_node structure.
78 */
79TRACE_EVENT(rcu_grace_period_init,
80
81 TP_PROTO(char *rcuname, unsigned long gpnum, u8 level,
82 int grplo, int grphi, unsigned long qsmask),
83
84 TP_ARGS(rcuname, gpnum, level, grplo, grphi, qsmask),
85
86 TP_STRUCT__entry(
87 __field(char *, rcuname)
88 __field(unsigned long, gpnum)
89 __field(u8, level)
90 __field(int, grplo)
91 __field(int, grphi)
92 __field(unsigned long, qsmask)
93 ),
94
95 TP_fast_assign(
96 __entry->rcuname = rcuname;
97 __entry->gpnum = gpnum;
98 __entry->level = level;
99 __entry->grplo = grplo;
100 __entry->grphi = grphi;
101 __entry->qsmask = qsmask;
102 ),
103
104 TP_printk("%s %lu %u %d %d %lx",
105 __entry->rcuname, __entry->gpnum, __entry->level,
106 __entry->grplo, __entry->grphi, __entry->qsmask)
107);
108
109/*
110 * Tracepoint for tasks blocking within preemptible-RCU read-side
111 * critical sections. Track the type of RCU (which one day might
112 * include SRCU), the grace-period number that the task is blocking
113 * (the current or the next), and the task's PID.
114 */
115TRACE_EVENT(rcu_preempt_task,
116
117 TP_PROTO(char *rcuname, int pid, unsigned long gpnum),
118
119 TP_ARGS(rcuname, pid, gpnum),
120
121 TP_STRUCT__entry(
122 __field(char *, rcuname)
123 __field(unsigned long, gpnum)
124 __field(int, pid)
125 ),
126
127 TP_fast_assign(
128 __entry->rcuname = rcuname;
129 __entry->gpnum = gpnum;
130 __entry->pid = pid;
131 ),
132
133 TP_printk("%s %lu %d",
134 __entry->rcuname, __entry->gpnum, __entry->pid)
135);
136
137/*
138 * Tracepoint for tasks that blocked within a given preemptible-RCU
139 * read-side critical section exiting that critical section. Track the
140 * type of RCU (which one day might include SRCU) and the task's PID.
141 */
142TRACE_EVENT(rcu_unlock_preempted_task,
143
144 TP_PROTO(char *rcuname, unsigned long gpnum, int pid),
145
146 TP_ARGS(rcuname, gpnum, pid),
147
148 TP_STRUCT__entry(
149 __field(char *, rcuname)
150 __field(unsigned long, gpnum)
151 __field(int, pid)
152 ),
153
154 TP_fast_assign(
155 __entry->rcuname = rcuname;
156 __entry->gpnum = gpnum;
157 __entry->pid = pid;
158 ),
159
160 TP_printk("%s %lu %d", __entry->rcuname, __entry->gpnum, __entry->pid)
161);
162
163/*
164 * Tracepoint for quiescent-state-reporting events. These are
165 * distinguished by the type of RCU, the grace-period number, the
166 * mask of quiescent lower-level entities, the rcu_node structure level,
167 * the starting and ending CPU covered by the rcu_node structure, and
168 * whether there are any blocked tasks blocking the current grace period.
169 * All but the type of RCU are extracted from the rcu_node structure.
170 */
171TRACE_EVENT(rcu_quiescent_state_report,
172
173 TP_PROTO(char *rcuname, unsigned long gpnum,
174 unsigned long mask, unsigned long qsmask,
175 u8 level, int grplo, int grphi, int gp_tasks),
176
177 TP_ARGS(rcuname, gpnum, mask, qsmask, level, grplo, grphi, gp_tasks),
178
179 TP_STRUCT__entry(
180 __field(char *, rcuname)
181 __field(unsigned long, gpnum)
182 __field(unsigned long, mask)
183 __field(unsigned long, qsmask)
184 __field(u8, level)
185 __field(int, grplo)
186 __field(int, grphi)
187 __field(u8, gp_tasks)
188 ),
189
190 TP_fast_assign(
191 __entry->rcuname = rcuname;
192 __entry->gpnum = gpnum;
193 __entry->mask = mask;
194 __entry->qsmask = qsmask;
195 __entry->level = level;
196 __entry->grplo = grplo;
197 __entry->grphi = grphi;
198 __entry->gp_tasks = gp_tasks;
199 ),
200
201 TP_printk("%s %lu %lx>%lx %u %d %d %u",
202 __entry->rcuname, __entry->gpnum,
203 __entry->mask, __entry->qsmask, __entry->level,
204 __entry->grplo, __entry->grphi, __entry->gp_tasks)
205);
206
207/*
208 * Tracepoint for quiescent states detected by force_quiescent_state().
209 * These trace events include the type of RCU, the grace-period number
210 * that was blocked by the CPU, the CPU itself, and the type of quiescent
211 * state, which can be "dti" for dyntick-idle mode, "ofl" for CPU offline,
212 * or "kick" when kicking a CPU that has been in dyntick-idle mode for
213 * too long.
214 */
215TRACE_EVENT(rcu_fqs,
216
217 TP_PROTO(char *rcuname, unsigned long gpnum, int cpu, char *qsevent),
218
219 TP_ARGS(rcuname, gpnum, cpu, qsevent),
220
221 TP_STRUCT__entry(
222 __field(char *, rcuname)
223 __field(unsigned long, gpnum)
224 __field(int, cpu)
225 __field(char *, qsevent)
226 ),
227
228 TP_fast_assign(
229 __entry->rcuname = rcuname;
230 __entry->gpnum = gpnum;
231 __entry->cpu = cpu;
232 __entry->qsevent = qsevent;
233 ),
234
235 TP_printk("%s %lu %d %s",
236 __entry->rcuname, __entry->gpnum,
237 __entry->cpu, __entry->qsevent)
238);
239
240#endif /* #if defined(CONFIG_TREE_RCU) || defined(CONFIG_TREE_PREEMPT_RCU) */
241
242/*
243 * Tracepoint for dyntick-idle entry/exit events. These take a string
244 * as argument: "Start" for entering dyntick-idle mode and "End" for
245 * leaving it.
246 */
247TRACE_EVENT(rcu_dyntick,
248
249 TP_PROTO(char *polarity),
250
251 TP_ARGS(polarity),
252
253 TP_STRUCT__entry(
254 __field(char *, polarity)
255 ),
256
257 TP_fast_assign(
258 __entry->polarity = polarity;
259 ),
260
261 TP_printk("%s", __entry->polarity)
262);
263
264/*
265 * Tracepoint for the registration of a single RCU callback function.
266 * The first argument is the type of RCU, the second argument is
267 * a pointer to the RCU callback itself, and the third element is the
268 * new RCU callback queue length for the current CPU.
269 */
270TRACE_EVENT(rcu_callback,
271
272 TP_PROTO(char *rcuname, struct rcu_head *rhp, long qlen),
273
274 TP_ARGS(rcuname, rhp, qlen),
275
276 TP_STRUCT__entry(
277 __field(char *, rcuname)
278 __field(void *, rhp)
279 __field(void *, func)
280 __field(long, qlen)
281 ),
282
283 TP_fast_assign(
284 __entry->rcuname = rcuname;
285 __entry->rhp = rhp;
286 __entry->func = rhp->func;
287 __entry->qlen = qlen;
288 ),
289
290 TP_printk("%s rhp=%p func=%pf %ld",
291 __entry->rcuname, __entry->rhp, __entry->func, __entry->qlen)
292);
293
294/*
295 * Tracepoint for the registration of a single RCU callback of the special
296 * kfree() form. The first argument is the RCU type, the second argument
297 * is a pointer to the RCU callback, the third argument is the offset
298 * of the callback within the enclosing RCU-protected data structure,
299 * and the fourth argument is the new RCU callback queue length for the
300 * current CPU.
301 */
302TRACE_EVENT(rcu_kfree_callback,
303
304 TP_PROTO(char *rcuname, struct rcu_head *rhp, unsigned long offset,
305 long qlen),
306
307 TP_ARGS(rcuname, rhp, offset, qlen),
308
309 TP_STRUCT__entry(
310 __field(char *, rcuname)
311 __field(void *, rhp)
312 __field(unsigned long, offset)
313 __field(long, qlen)
314 ),
315
316 TP_fast_assign(
317 __entry->rcuname = rcuname;
318 __entry->rhp = rhp;
319 __entry->offset = offset;
320 __entry->qlen = qlen;
321 ),
322
323 TP_printk("%s rhp=%p func=%ld %ld",
324 __entry->rcuname, __entry->rhp, __entry->offset,
325 __entry->qlen)
326);
327
328/*
329 * Tracepoint for marking the beginning rcu_do_batch, performed to start
330 * RCU callback invocation. The first argument is the RCU flavor,
331 * the second is the total number of callbacks (including those that
332 * are not yet ready to be invoked), and the third argument is the
333 * current RCU-callback batch limit.
334 */
335TRACE_EVENT(rcu_batch_start,
336
337 TP_PROTO(char *rcuname, long qlen, int blimit),
338
339 TP_ARGS(rcuname, qlen, blimit),
340
341 TP_STRUCT__entry(
342 __field(char *, rcuname)
343 __field(long, qlen)
344 __field(int, blimit)
345 ),
346
347 TP_fast_assign(
348 __entry->rcuname = rcuname;
349 __entry->qlen = qlen;
350 __entry->blimit = blimit;
351 ),
352
353 TP_printk("%s CBs=%ld bl=%d",
354 __entry->rcuname, __entry->qlen, __entry->blimit)
355);
356
357/*
358 * Tracepoint for the invocation of a single RCU callback function.
359 * The first argument is the type of RCU, and the second argument is
360 * a pointer to the RCU callback itself.
361 */
362TRACE_EVENT(rcu_invoke_callback,
363
364 TP_PROTO(char *rcuname, struct rcu_head *rhp),
365
366 TP_ARGS(rcuname, rhp),
367
368 TP_STRUCT__entry(
369 __field(char *, rcuname)
370 __field(void *, rhp)
371 __field(void *, func)
372 ),
373
374 TP_fast_assign(
375 __entry->rcuname = rcuname;
376 __entry->rhp = rhp;
377 __entry->func = rhp->func;
378 ),
379
380 TP_printk("%s rhp=%p func=%pf",
381 __entry->rcuname, __entry->rhp, __entry->func)
382);
383
384/*
385 * Tracepoint for the invocation of a single RCU callback of the special
386 * kfree() form. The first argument is the RCU flavor, the second
387 * argument is a pointer to the RCU callback, and the third argument
388 * is the offset of the callback within the enclosing RCU-protected
389 * data structure.
390 */
391TRACE_EVENT(rcu_invoke_kfree_callback,
392
393 TP_PROTO(char *rcuname, struct rcu_head *rhp, unsigned long offset),
394
395 TP_ARGS(rcuname, rhp, offset),
396
397 TP_STRUCT__entry(
398 __field(char *, rcuname)
399 __field(void *, rhp)
400 __field(unsigned long, offset)
401 ),
402
403 TP_fast_assign(
404 __entry->rcuname = rcuname;
405 __entry->rhp = rhp;
406 __entry->offset = offset;
407 ),
408
409 TP_printk("%s rhp=%p func=%ld",
410 __entry->rcuname, __entry->rhp, __entry->offset)
411);
412
413/*
414 * Tracepoint for exiting rcu_do_batch after RCU callbacks have been
415 * invoked. The first argument is the name of the RCU flavor and
416 * the second argument is number of callbacks actually invoked.
417 */
418TRACE_EVENT(rcu_batch_end,
419
420 TP_PROTO(char *rcuname, int callbacks_invoked),
421
422 TP_ARGS(rcuname, callbacks_invoked),
423
424 TP_STRUCT__entry(
425 __field(char *, rcuname)
426 __field(int, callbacks_invoked)
427 ),
428
429 TP_fast_assign(
430 __entry->rcuname = rcuname;
431 __entry->callbacks_invoked = callbacks_invoked;
432 ),
433
434 TP_printk("%s CBs-invoked=%d",
435 __entry->rcuname, __entry->callbacks_invoked)
436);
437
438#else /* #ifdef CONFIG_RCU_TRACE */
439
440#define trace_rcu_grace_period(rcuname, gpnum, gpevent) do { } while (0)
441#define trace_rcu_grace_period_init(rcuname, gpnum, level, grplo, grphi, qsmask) do { } while (0)
442#define trace_rcu_preempt_task(rcuname, pid, gpnum) do { } while (0)
443#define trace_rcu_unlock_preempted_task(rcuname, gpnum, pid) do { } while (0)
444#define trace_rcu_quiescent_state_report(rcuname, gpnum, mask, qsmask, level, grplo, grphi, gp_tasks) do { } while (0)
445#define trace_rcu_fqs(rcuname, gpnum, cpu, qsevent) do { } while (0)
446#define trace_rcu_dyntick(polarity) do { } while (0)
447#define trace_rcu_callback(rcuname, rhp, qlen) do { } while (0)
448#define trace_rcu_kfree_callback(rcuname, rhp, offset, qlen) do { } while (0)
449#define trace_rcu_batch_start(rcuname, qlen, blimit) do { } while (0)
450#define trace_rcu_invoke_callback(rcuname, rhp) do { } while (0)
451#define trace_rcu_invoke_kfree_callback(rcuname, rhp, offset) do { } while (0)
452#define trace_rcu_batch_end(rcuname, callbacks_invoked) do { } while (0)
453
454#endif /* #else #ifdef CONFIG_RCU_TRACE */
455
456#endif /* _TRACE_RCU_H */
457
458/* This part must be outside protection */
459#include <trace/define_trace.h>
diff --git a/include/trace/events/regmap.h b/include/trace/events/regmap.h
new file mode 100644
index 000000000000..1e3193b8fcc8
--- /dev/null
+++ b/include/trace/events/regmap.h
@@ -0,0 +1,136 @@
1#undef TRACE_SYSTEM
2#define TRACE_SYSTEM regmap
3
4#if !defined(_TRACE_REGMAP_H) || defined(TRACE_HEADER_MULTI_READ)
5#define _TRACE_REGMAP_H
6
7#include <linux/device.h>
8#include <linux/ktime.h>
9#include <linux/tracepoint.h>
10
11struct regmap;
12
13/*
14 * Log register events
15 */
16DECLARE_EVENT_CLASS(regmap_reg,
17
18 TP_PROTO(struct device *dev, unsigned int reg,
19 unsigned int val),
20
21 TP_ARGS(dev, reg, val),
22
23 TP_STRUCT__entry(
24 __string( name, dev_name(dev) )
25 __field( unsigned int, reg )
26 __field( unsigned int, val )
27 ),
28
29 TP_fast_assign(
30 __assign_str(name, dev_name(dev));
31 __entry->reg = reg;
32 __entry->val = val;
33 ),
34
35 TP_printk("%s reg=%x val=%x", __get_str(name),
36 (unsigned int)__entry->reg,
37 (unsigned int)__entry->val)
38);
39
40DEFINE_EVENT(regmap_reg, regmap_reg_write,
41
42 TP_PROTO(struct device *dev, unsigned int reg,
43 unsigned int val),
44
45 TP_ARGS(dev, reg, val)
46
47);
48
49DEFINE_EVENT(regmap_reg, regmap_reg_read,
50
51 TP_PROTO(struct device *dev, unsigned int reg,
52 unsigned int val),
53
54 TP_ARGS(dev, reg, val)
55
56);
57
58DECLARE_EVENT_CLASS(regmap_block,
59
60 TP_PROTO(struct device *dev, unsigned int reg, int count),
61
62 TP_ARGS(dev, reg, count),
63
64 TP_STRUCT__entry(
65 __string( name, dev_name(dev) )
66 __field( unsigned int, reg )
67 __field( int, count )
68 ),
69
70 TP_fast_assign(
71 __assign_str(name, dev_name(dev));
72 __entry->reg = reg;
73 __entry->count = count;
74 ),
75
76 TP_printk("%s reg=%x count=%d", __get_str(name),
77 (unsigned int)__entry->reg,
78 (int)__entry->count)
79);
80
81DEFINE_EVENT(regmap_block, regmap_hw_read_start,
82
83 TP_PROTO(struct device *dev, unsigned int reg, int count),
84
85 TP_ARGS(dev, reg, count)
86);
87
88DEFINE_EVENT(regmap_block, regmap_hw_read_done,
89
90 TP_PROTO(struct device *dev, unsigned int reg, int count),
91
92 TP_ARGS(dev, reg, count)
93);
94
95DEFINE_EVENT(regmap_block, regmap_hw_write_start,
96
97 TP_PROTO(struct device *dev, unsigned int reg, int count),
98
99 TP_ARGS(dev, reg, count)
100);
101
102DEFINE_EVENT(regmap_block, regmap_hw_write_done,
103
104 TP_PROTO(struct device *dev, unsigned int reg, int count),
105
106 TP_ARGS(dev, reg, count)
107);
108
109TRACE_EVENT(regcache_sync,
110
111 TP_PROTO(struct device *dev, const char *type,
112 const char *status),
113
114 TP_ARGS(dev, type, status),
115
116 TP_STRUCT__entry(
117 __string( name, dev_name(dev) )
118 __string( status, status )
119 __string( type, type )
120 __field( int, type )
121 ),
122
123 TP_fast_assign(
124 __assign_str(name, dev_name(dev));
125 __assign_str(status, status);
126 __assign_str(type, type);
127 ),
128
129 TP_printk("%s type=%s status=%s", __get_str(name),
130 __get_str(type), __get_str(status))
131);
132
133#endif /* _TRACE_REGMAP_H */
134
135/* This part must be outside protection */
136#include <trace/define_trace.h>
diff --git a/include/trace/events/rpm.h b/include/trace/events/rpm.h
new file mode 100644
index 000000000000..d62c558bf64b
--- /dev/null
+++ b/include/trace/events/rpm.h
@@ -0,0 +1,99 @@
1
2#undef TRACE_SYSTEM
3#define TRACE_SYSTEM rpm
4
5#if !defined(_TRACE_RUNTIME_POWER_H) || defined(TRACE_HEADER_MULTI_READ)
6#define _TRACE_RUNTIME_POWER_H
7
8#include <linux/ktime.h>
9#include <linux/tracepoint.h>
10#include <linux/device.h>
11
12/*
13 * The rpm_internal events are used for tracing some important
14 * runtime pm internal functions.
15 */
16DECLARE_EVENT_CLASS(rpm_internal,
17
18 TP_PROTO(struct device *dev, int flags),
19
20 TP_ARGS(dev, flags),
21
22 TP_STRUCT__entry(
23 __string( name, dev_name(dev) )
24 __field( int, flags )
25 __field( int , usage_count )
26 __field( int , disable_depth )
27 __field( int , runtime_auto )
28 __field( int , request_pending )
29 __field( int , irq_safe )
30 __field( int , child_count )
31 ),
32
33 TP_fast_assign(
34 __assign_str(name, dev_name(dev));
35 __entry->flags = flags;
36 __entry->usage_count = atomic_read(
37 &dev->power.usage_count);
38 __entry->disable_depth = dev->power.disable_depth;
39 __entry->runtime_auto = dev->power.runtime_auto;
40 __entry->request_pending = dev->power.request_pending;
41 __entry->irq_safe = dev->power.irq_safe;
42 __entry->child_count = atomic_read(
43 &dev->power.child_count);
44 ),
45
46 TP_printk("%s flags-%x cnt-%-2d dep-%-2d auto-%-1d p-%-1d"
47 " irq-%-1d child-%d",
48 __get_str(name), __entry->flags,
49 __entry->usage_count,
50 __entry->disable_depth,
51 __entry->runtime_auto,
52 __entry->request_pending,
53 __entry->irq_safe,
54 __entry->child_count
55 )
56);
57DEFINE_EVENT(rpm_internal, rpm_suspend,
58
59 TP_PROTO(struct device *dev, int flags),
60
61 TP_ARGS(dev, flags)
62);
63DEFINE_EVENT(rpm_internal, rpm_resume,
64
65 TP_PROTO(struct device *dev, int flags),
66
67 TP_ARGS(dev, flags)
68);
69DEFINE_EVENT(rpm_internal, rpm_idle,
70
71 TP_PROTO(struct device *dev, int flags),
72
73 TP_ARGS(dev, flags)
74);
75
76TRACE_EVENT(rpm_return_int,
77 TP_PROTO(struct device *dev, unsigned long ip, int ret),
78 TP_ARGS(dev, ip, ret),
79
80 TP_STRUCT__entry(
81 __string( name, dev_name(dev))
82 __field( unsigned long, ip )
83 __field( int, ret )
84 ),
85
86 TP_fast_assign(
87 __assign_str(name, dev_name(dev));
88 __entry->ip = ip;
89 __entry->ret = ret;
90 ),
91
92 TP_printk("%pS:%s ret=%d", (void *)__entry->ip, __get_str(name),
93 __entry->ret)
94);
95
96#endif /* _TRACE_RUNTIME_POWER_H */
97
98/* This part must be outside protection */
99#include <trace/define_trace.h>
diff --git a/include/trace/events/sched.h b/include/trace/events/sched.h
index f6334782a593..959ff18b63b6 100644
--- a/include/trace/events/sched.h
+++ b/include/trace/events/sched.h
@@ -100,7 +100,7 @@ static inline long __trace_sched_switch_state(struct task_struct *p)
100 * For all intents and purposes a preempted task is a running task. 100 * For all intents and purposes a preempted task is a running task.
101 */ 101 */
102 if (task_thread_info(p)->preempt_count & PREEMPT_ACTIVE) 102 if (task_thread_info(p)->preempt_count & PREEMPT_ACTIVE)
103 state = TASK_RUNNING; 103 state = TASK_RUNNING | TASK_STATE_MAX;
104#endif 104#endif
105 105
106 return state; 106 return state;
@@ -137,13 +137,14 @@ TRACE_EVENT(sched_switch,
137 __entry->next_prio = next->prio; 137 __entry->next_prio = next->prio;
138 ), 138 ),
139 139
140 TP_printk("prev_comm=%s prev_pid=%d prev_prio=%d prev_state=%s ==> next_comm=%s next_pid=%d next_prio=%d", 140 TP_printk("prev_comm=%s prev_pid=%d prev_prio=%d prev_state=%s%s ==> next_comm=%s next_pid=%d next_prio=%d",
141 __entry->prev_comm, __entry->prev_pid, __entry->prev_prio, 141 __entry->prev_comm, __entry->prev_pid, __entry->prev_prio,
142 __entry->prev_state ? 142 __entry->prev_state & (TASK_STATE_MAX-1) ?
143 __print_flags(__entry->prev_state, "|", 143 __print_flags(__entry->prev_state & (TASK_STATE_MAX-1), "|",
144 { 1, "S"} , { 2, "D" }, { 4, "T" }, { 8, "t" }, 144 { 1, "S"} , { 2, "D" }, { 4, "T" }, { 8, "t" },
145 { 16, "Z" }, { 32, "X" }, { 64, "x" }, 145 { 16, "Z" }, { 32, "X" }, { 64, "x" },
146 { 128, "W" }) : "R", 146 { 128, "W" }) : "R",
147 __entry->prev_state & TASK_STATE_MAX ? "+" : "",
147 __entry->next_comm, __entry->next_pid, __entry->next_prio) 148 __entry->next_comm, __entry->next_pid, __entry->next_prio)
148); 149);
149 150
diff --git a/include/trace/events/writeback.h b/include/trace/events/writeback.h
index 6bca4cc0063c..5f172703eb4f 100644
--- a/include/trace/events/writeback.h
+++ b/include/trace/events/writeback.h
@@ -298,7 +298,7 @@ DECLARE_EVENT_CLASS(writeback_single_inode_template,
298 __array(char, name, 32) 298 __array(char, name, 32)
299 __field(unsigned long, ino) 299 __field(unsigned long, ino)
300 __field(unsigned long, state) 300 __field(unsigned long, state)
301 __field(unsigned long, age) 301 __field(unsigned long, dirtied_when)
302 __field(unsigned long, writeback_index) 302 __field(unsigned long, writeback_index)
303 __field(long, nr_to_write) 303 __field(long, nr_to_write)
304 __field(unsigned long, wrote) 304 __field(unsigned long, wrote)
@@ -309,19 +309,19 @@ DECLARE_EVENT_CLASS(writeback_single_inode_template,
309 dev_name(inode->i_mapping->backing_dev_info->dev), 32); 309 dev_name(inode->i_mapping->backing_dev_info->dev), 32);
310 __entry->ino = inode->i_ino; 310 __entry->ino = inode->i_ino;
311 __entry->state = inode->i_state; 311 __entry->state = inode->i_state;
312 __entry->age = (jiffies - inode->dirtied_when) * 312 __entry->dirtied_when = inode->dirtied_when;
313 1000 / HZ;
314 __entry->writeback_index = inode->i_mapping->writeback_index; 313 __entry->writeback_index = inode->i_mapping->writeback_index;
315 __entry->nr_to_write = nr_to_write; 314 __entry->nr_to_write = nr_to_write;
316 __entry->wrote = nr_to_write - wbc->nr_to_write; 315 __entry->wrote = nr_to_write - wbc->nr_to_write;
317 ), 316 ),
318 317
319 TP_printk("bdi %s: ino=%lu state=%s age=%lu " 318 TP_printk("bdi %s: ino=%lu state=%s dirtied_when=%lu age=%lu "
320 "index=%lu to_write=%ld wrote=%lu", 319 "index=%lu to_write=%ld wrote=%lu",
321 __entry->name, 320 __entry->name,
322 __entry->ino, 321 __entry->ino,
323 show_inode_state(__entry->state), 322 show_inode_state(__entry->state),
324 __entry->age, 323 __entry->dirtied_when,
324 (jiffies - __entry->dirtied_when) / HZ,
325 __entry->writeback_index, 325 __entry->writeback_index,
326 __entry->nr_to_write, 326 __entry->nr_to_write,
327 __entry->wrote 327 __entry->wrote
diff --git a/include/trace/events/xen.h b/include/trace/events/xen.h
index 44d8decee09e..92f1a796829e 100644
--- a/include/trace/events/xen.h
+++ b/include/trace/events/xen.h
@@ -8,6 +8,8 @@
8#include <asm/paravirt_types.h> 8#include <asm/paravirt_types.h>
9#include <asm/xen/trace_types.h> 9#include <asm/xen/trace_types.h>
10 10
11struct multicall_entry;
12
11/* Multicalls */ 13/* Multicalls */
12DECLARE_EVENT_CLASS(xen_mc__batch, 14DECLARE_EVENT_CLASS(xen_mc__batch,
13 TP_PROTO(enum paravirt_lazy_mode mode), 15 TP_PROTO(enum paravirt_lazy_mode mode),
diff --git a/include/trace/ftrace.h b/include/trace/ftrace.h
index 533c49f48047..769724944fc6 100644
--- a/include/trace/ftrace.h
+++ b/include/trace/ftrace.h
@@ -711,6 +711,9 @@ __attribute__((section("_ftrace_events"))) *__event_##call = &event_##call
711#undef __perf_count 711#undef __perf_count
712#define __perf_count(c) __count = (c) 712#define __perf_count(c) __count = (c)
713 713
714#undef TP_perf_assign
715#define TP_perf_assign(args...) args
716
714#undef DECLARE_EVENT_CLASS 717#undef DECLARE_EVENT_CLASS
715#define DECLARE_EVENT_CLASS(call, proto, args, tstruct, assign, print) \ 718#define DECLARE_EVENT_CLASS(call, proto, args, tstruct, assign, print) \
716static notrace void \ 719static notrace void \
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 76f7538bb339..d29c153705bc 100644
--- a/include/xen/balloon.h
+++ b/include/xen/balloon.h
@@ -25,8 +25,9 @@ extern struct balloon_stats balloon_stats;
25 25
26void balloon_set_new_target(unsigned long target); 26void balloon_set_new_target(unsigned long target);
27 27
28int alloc_xenballooned_pages(int nr_pages, struct page** pages); 28int alloc_xenballooned_pages(int nr_pages, struct page **pages,
29void free_xenballooned_pages(int nr_pages, struct page** pages); 29 bool highmem);
30void free_xenballooned_pages(int nr_pages, struct page **pages);
30 31
31struct sys_device; 32struct sys_device;
32#ifdef CONFIG_XEN_SELFBALLOONING 33#ifdef CONFIG_XEN_SELFBALLOONING
diff --git a/include/xen/grant_table.h b/include/xen/grant_table.h
index b1fab6b5b3ef..6b99bfbd785d 100644
--- a/include/xen/grant_table.h
+++ b/include/xen/grant_table.h
@@ -156,6 +156,7 @@ unsigned int gnttab_max_grant_frames(void);
156#define gnttab_map_vaddr(map) ((void *)(map.host_virt_addr)) 156#define gnttab_map_vaddr(map) ((void *)(map.host_virt_addr))
157 157
158int gnttab_map_refs(struct gnttab_map_grant_ref *map_ops, 158int gnttab_map_refs(struct gnttab_map_grant_ref *map_ops,
159 struct gnttab_map_grant_ref *kmap_ops,
159 struct page **pages, unsigned int count); 160 struct page **pages, unsigned int count);
160int gnttab_unmap_refs(struct gnttab_unmap_grant_ref *unmap_ops, 161int gnttab_unmap_refs(struct gnttab_unmap_grant_ref *unmap_ops,
161 struct page **pages, unsigned int count); 162 struct page **pages, unsigned int count);
diff --git a/include/xen/interface/io/xs_wire.h b/include/xen/interface/io/xs_wire.h
index 99fcffb372d1..f0b6890370be 100644
--- a/include/xen/interface/io/xs_wire.h
+++ b/include/xen/interface/io/xs_wire.h
@@ -26,7 +26,11 @@ enum xsd_sockmsg_type
26 XS_SET_PERMS, 26 XS_SET_PERMS,
27 XS_WATCH_EVENT, 27 XS_WATCH_EVENT,
28 XS_ERROR, 28 XS_ERROR,
29 XS_IS_DOMAIN_INTRODUCED 29 XS_IS_DOMAIN_INTRODUCED,
30 XS_RESUME,
31 XS_SET_TARGET,
32 XS_RESTRICT,
33 XS_RESET_WATCHES
30}; 34};
31 35
32#define XS_WRITE_NONE "NONE" 36#define XS_WRITE_NONE "NONE"
diff --git a/include/xen/interface/physdev.h b/include/xen/interface/physdev.h
index 534cac89a77d..c1080d9c705d 100644
--- a/include/xen/interface/physdev.h
+++ b/include/xen/interface/physdev.h
@@ -109,6 +109,7 @@ struct physdev_irq {
109#define MAP_PIRQ_TYPE_MSI 0x0 109#define MAP_PIRQ_TYPE_MSI 0x0
110#define MAP_PIRQ_TYPE_GSI 0x1 110#define MAP_PIRQ_TYPE_GSI 0x1
111#define MAP_PIRQ_TYPE_UNKNOWN 0x2 111#define MAP_PIRQ_TYPE_UNKNOWN 0x2
112#define MAP_PIRQ_TYPE_MSI_SEG 0x3
112 113
113#define PHYSDEVOP_map_pirq 13 114#define PHYSDEVOP_map_pirq 13
114struct physdev_map_pirq { 115struct physdev_map_pirq {
@@ -119,7 +120,7 @@ struct physdev_map_pirq {
119 int index; 120 int index;
120 /* IN or OUT */ 121 /* IN or OUT */
121 int pirq; 122 int pirq;
122 /* IN */ 123 /* IN - high 16 bits hold segment for MAP_PIRQ_TYPE_MSI_SEG */
123 int bus; 124 int bus;
124 /* IN */ 125 /* IN */
125 int devfn; 126 int devfn;
@@ -198,6 +199,37 @@ struct physdev_get_free_pirq {
198 uint32_t pirq; 199 uint32_t pirq;
199}; 200};
200 201
202#define XEN_PCI_DEV_EXTFN 0x1
203#define XEN_PCI_DEV_VIRTFN 0x2
204#define XEN_PCI_DEV_PXM 0x4
205
206#define PHYSDEVOP_pci_device_add 25
207struct physdev_pci_device_add {
208 /* IN */
209 uint16_t seg;
210 uint8_t bus;
211 uint8_t devfn;
212 uint32_t flags;
213 struct {
214 uint8_t bus;
215 uint8_t devfn;
216 } physfn;
217#if defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
218 uint32_t optarr[];
219#elif defined(__GNUC__)
220 uint32_t optarr[0];
221#endif
222};
223
224#define PHYSDEVOP_pci_device_remove 26
225#define PHYSDEVOP_restore_msi_ext 27
226struct physdev_pci_device {
227 /* IN */
228 uint16_t seg;
229 uint8_t bus;
230 uint8_t devfn;
231};
232
201/* 233/*
202 * Notify that some PIRQ-bound event channels have been unmasked. 234 * Notify that some PIRQ-bound event channels have been unmasked.
203 * ** This command is obsolete since interface version 0x00030202 and is ** 235 * ** This command is obsolete since interface version 0x00030202 and is **
diff --git a/include/xen/page.h b/include/xen/page.h
index 0be36b976f4b..12765b6f9517 100644
--- a/include/xen/page.h
+++ b/include/xen/page.h
@@ -3,6 +3,16 @@
3 3
4#include <asm/xen/page.h> 4#include <asm/xen/page.h>
5 5
6extern phys_addr_t xen_extra_mem_start, xen_extra_mem_size; 6struct xen_memory_region {
7 phys_addr_t start;
8 phys_addr_t size;
9};
10
11#define XEN_EXTRA_MEM_MAX_REGIONS 128 /* == E820MAX */
12
13extern __initdata
14struct xen_memory_region xen_extra_mem[XEN_EXTRA_MEM_MAX_REGIONS];
15
16extern unsigned long xen_released_pages;
7 17
8#endif /* _XEN_PAGE_H */ 18#endif /* _XEN_PAGE_H */