aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/acpi/acpi_bus.h2
-rw-r--r--include/acpi/acpiosxf.h3
-rw-r--r--include/acpi/platform/aclinux.h18
-rw-r--r--include/asm-generic/delay.h37
-rw-r--r--include/asm-generic/gpio.h10
-rw-r--r--include/asm-generic/io.h9
-rw-r--r--include/asm-generic/iomap.h12
-rw-r--r--include/asm-generic/pgtable.h2
-rw-r--r--include/asm-generic/system.h2
-rw-r--r--include/crypto/if_alg.h1
-rw-r--r--include/drm/drm_crtc.h2
-rw-r--r--include/drm/drm_pciids.h13
-rw-r--r--include/linux/Kbuild1
-rw-r--r--include/linux/amd-iommu.h35
-rw-r--r--include/linux/anon_inodes.h2
-rw-r--r--include/linux/arcdevice.h1
-rw-r--r--include/linux/ath9k_platform.h2
-rw-r--r--include/linux/atomic.h26
-rw-r--r--include/linux/audit.h7
-rw-r--r--include/linux/basic_mmio_gpio.h1
-rw-r--r--include/linux/bcma/bcma.h47
-rw-r--r--include/linux/bcma/bcma_driver_chipcommon.h12
-rw-r--r--include/linux/bcma/bcma_driver_pci.h2
-rw-r--r--include/linux/bcma/bcma_regs.h27
-rw-r--r--include/linux/binfmts.h1
-rw-r--r--include/linux/bit_spinlock.h2
-rw-r--r--include/linux/blk_types.h2
-rw-r--r--include/linux/blkdev.h27
-rw-r--r--include/linux/blktrace_api.h3
-rw-r--r--include/linux/ceph/libceph.h2
-rw-r--r--include/linux/cgroup.h1
-rw-r--r--include/linux/clocksource.h16
-rw-r--r--include/linux/cn_proc.h13
-rw-r--r--include/linux/compat.h11
-rw-r--r--include/linux/connector.h2
-rw-r--r--include/linux/cordic.h48
-rw-r--r--include/linux/cpu.h33
-rw-r--r--include/linux/crc8.h101
-rw-r--r--include/linux/cred.h1
-rw-r--r--include/linux/ctype.h9
-rw-r--r--include/linux/dcache.h8
-rw-r--r--include/linux/dcbnl.h25
-rw-r--r--include/linux/dccp.h1
-rw-r--r--include/linux/device.h9
-rw-r--r--include/linux/device_cgroup.h10
-rw-r--r--include/linux/dio.h2
-rw-r--r--include/linux/dma-direction.h13
-rw-r--r--include/linux/dma-mapping.h10
-rw-r--r--include/linux/dmaengine.h4
-rw-r--r--include/linux/drbd_limits.h4
-rw-r--r--include/linux/dw_apb_timer.h56
-rw-r--r--include/linux/eeprom_93xx46.h18
-rw-r--r--include/linux/efi.h34
-rw-r--r--include/linux/elevator.h2
-rw-r--r--include/linux/etherdevice.h2
-rw-r--r--include/linux/ethtool.h41
-rw-r--r--include/linux/ext3_fs.h2
-rw-r--r--include/linux/fb.h3
-rw-r--r--include/linux/fd.h22
-rw-r--r--include/linux/fdtable.h1
-rw-r--r--include/linux/firewire-cdev.h78
-rw-r--r--include/linux/fs.h131
-rw-r--r--include/linux/fscache.h21
-rw-r--r--include/linux/fsl-diu-fb.h6
-rw-r--r--include/linux/fsl_hypervisor.h241
-rw-r--r--include/linux/ftrace.h7
-rw-r--r--include/linux/ftrace_event.h5
-rw-r--r--include/linux/generic_acl.h1
-rw-r--r--include/linux/genhd.h2
-rw-r--r--include/linux/gpio.h11
-rw-r--r--include/linux/hardirq.h4
-rw-r--r--include/linux/hid.h3
-rw-r--r--include/linux/hrtimer.h1
-rw-r--r--include/linux/hugetlb.h3
-rw-r--r--include/linux/hw_breakpoint.h10
-rw-r--r--include/linux/hw_random.h2
-rw-r--r--include/linux/i2c/adp8870.h153
-rw-r--r--include/linux/i8253.h29
-rw-r--r--include/linux/ieee80211.h55
-rw-r--r--include/linux/if_ether.h5
-rw-r--r--include/linux/if_packet.h8
-rw-r--r--include/linux/if_vlan.h116
-rw-r--r--include/linux/inet_lro.h19
-rw-r--r--include/linux/init_task.h1
-rw-r--r--include/linux/input/sh_keysc.h2
-rw-r--r--include/linux/interrupt.h1
-rw-r--r--include/linux/iocontext.h14
-rw-r--r--include/linux/iommu.h2
-rw-r--r--include/linux/ioport.h30
-rw-r--r--include/linux/irq.h8
-rw-r--r--include/linux/irqreturn.h6
-rw-r--r--include/linux/iscsi_boot_sysfs.h16
-rw-r--r--include/linux/jbd2.h2
-rw-r--r--include/linux/kernel.h52
-rw-r--r--include/linux/kmod.h8
-rw-r--r--include/linux/kmsg_dump.h1
-rw-r--r--include/linux/kobject_ns.h10
-rw-r--r--include/linux/kvm.h20
-rw-r--r--include/linux/kvm_host.h8
-rw-r--r--include/linux/led-lm3530.h5
-rw-r--r--include/linux/lguest.h2
-rw-r--r--include/linux/libata.h68
-rw-r--r--include/linux/memcontrol.h6
-rw-r--r--include/linux/memory.h2
-rw-r--r--include/linux/memory_hotplug.h11
-rw-r--r--include/linux/mfd/ds1wm.h7
-rw-r--r--include/linux/mfd/pm8xxx/rtc.h25
-rw-r--r--include/linux/mfd/tmio.h8
-rw-r--r--include/linux/mfd/tps65910.h2
-rw-r--r--include/linux/mii.h2
-rw-r--r--include/linux/mlx4/cmd.h3
-rw-r--r--include/linux/mlx4/device.h60
-rw-r--r--include/linux/mlx4/qp.h8
-rw-r--r--include/linux/mm.h59
-rw-r--r--include/linux/mmc/boot.h6
-rw-r--r--include/linux/mmc/card.h15
-rw-r--r--include/linux/mmc/core.h9
-rw-r--r--include/linux/mmc/dw_mmc.h28
-rw-r--r--include/linux/mmc/host.h26
-rw-r--r--include/linux/mmc/ioctl.h2
-rw-r--r--include/linux/mmc/mmc.h17
-rw-r--r--include/linux/mmc/pm.h2
-rw-r--r--include/linux/mmc/sd.h7
-rw-r--r--include/linux/mmc/sdhci-pltfm.h35
-rw-r--r--include/linux/mmc/sdhci-spear.h6
-rw-r--r--include/linux/mmc/sdhci.h6
-rw-r--r--include/linux/mmc/sdio.h7
-rw-r--r--include/linux/mmc/sdio_func.h7
-rw-r--r--include/linux/mmc/sdio_ids.h6
-rw-r--r--include/linux/mmc/sh_mmcif.h6
-rw-r--r--include/linux/mmc/sh_mobile_sdhi.h6
-rw-r--r--include/linux/mmc/tmio.h8
-rw-r--r--include/linux/mmzone.h7
-rw-r--r--include/linux/mnt_namespace.h1
-rw-r--r--include/linux/module.h24
-rw-r--r--include/linux/moduleloader.h7
-rw-r--r--include/linux/mtd/ubi.h14
-rw-r--r--include/linux/mutex.h2
-rw-r--r--include/linux/namei.h5
-rw-r--r--include/linux/netdevice.h99
-rw-r--r--include/linux/netfilter/ipset/ip_set.h50
-rw-r--r--include/linux/netfilter/ipset/ip_set_ahash.h154
-rw-r--r--include/linux/netfilter/ipset/ip_set_hash.h4
-rw-r--r--include/linux/netfilter/ipset/ip_set_timeout.h5
-rw-r--r--include/linux/netfilter/ipset/pfxlen.h11
-rw-r--r--include/linux/netfilter/nf_conntrack_common.h3
-rw-r--r--include/linux/netfilter/nfnetlink.h3
-rw-r--r--include/linux/netfilter/nfnetlink_queue.h1
-rw-r--r--include/linux/netfilter/xt_set.h15
-rw-r--r--include/linux/netlink.h8
-rw-r--r--include/linux/netpoll.h2
-rw-r--r--include/linux/nfc.h126
-rw-r--r--include/linux/nfs_fs.h6
-rw-r--r--include/linux/nfs_page.h3
-rw-r--r--include/linux/nfs_xdr.h1
-rw-r--r--include/linux/nfsd/export.h2
-rw-r--r--include/linux/nl80211.h77
-rw-r--r--include/linux/notifier.h82
-rw-r--r--include/linux/nsproxy.h1
-rw-r--r--include/linux/of.h29
-rw-r--r--include/linux/of_address.h5
-rw-r--r--include/linux/of_gpio.h42
-rw-r--r--include/linux/of_pci.h5
-rw-r--r--include/linux/of_platform.h40
-rw-r--r--include/linux/oom.h4
-rw-r--r--include/linux/opp.h8
-rw-r--r--include/linux/page-flags.h4
-rw-r--r--include/linux/pagemap.h16
-rw-r--r--include/linux/pci.h39
-rw-r--r--include/linux/pci_ids.h11
-rw-r--r--include/linux/percpu.h3
-rw-r--r--include/linux/perf_event.h89
-rw-r--r--include/linux/platform_data/fsa9480.h27
-rw-r--r--include/linux/platform_data/pxa_sdhci.h60
-rw-r--r--include/linux/platform_device.h1
-rw-r--r--include/linux/plist.h55
-rw-r--r--include/linux/pm.h13
-rw-r--r--include/linux/pm_domain.h108
-rw-r--r--include/linux/pm_runtime.h38
-rw-r--r--include/linux/pnp.h2
-rw-r--r--include/linux/poison.h6
-rw-r--r--include/linux/posix_acl.h5
-rw-r--r--include/linux/preempt.h26
-rw-r--r--include/linux/ptrace.h104
-rw-r--r--include/linux/random.h1
-rw-r--r--include/linux/rculist.h2
-rw-r--r--include/linux/rcupdate.h12
-rw-r--r--include/linux/reboot.h5
-rw-r--r--include/linux/regmap.h82
-rw-r--r--include/linux/reiserfs_acl.h6
-rw-r--r--include/linux/reiserfs_fs.h2
-rw-r--r--include/linux/reiserfs_xattr.h2
-rw-r--r--include/linux/ring_buffer.h2
-rw-r--r--include/linux/rtmutex.h4
-rw-r--r--include/linux/rtnetlink.h5
-rw-r--r--include/linux/rwsem.h10
-rw-r--r--include/linux/sched.h75
-rw-r--r--include/linux/sdla.h6
-rw-r--r--include/linux/seccomp.h10
-rw-r--r--include/linux/security.h9
-rw-r--r--include/linux/seq_file.h1
-rw-r--r--include/linux/seqlock.h1
-rw-r--r--include/linux/shmem_fs.h21
-rw-r--r--include/linux/shrinker.h42
-rw-r--r--include/linux/skbuff.h78
-rw-r--r--include/linux/slab.h20
-rw-r--r--include/linux/slab_def.h52
-rw-r--r--include/linux/slob_def.h10
-rw-r--r--include/linux/slub_def.h23
-rw-r--r--include/linux/smp.h5
-rw-r--r--include/linux/socket.h4
-rw-r--r--include/linux/spi/74x164.h2
-rw-r--r--include/linux/spi/mcp23s08.h9
-rw-r--r--include/linux/splice.h2
-rw-r--r--include/linux/ssb/ssb.h4
-rw-r--r--include/linux/ssb/ssb_driver_chipcommon.h2
-rw-r--r--include/linux/stacktrace.h4
-rw-r--r--include/linux/stmmac.h25
-rw-r--r--include/linux/stop_machine.h16
-rw-r--r--include/linux/sunrpc/cache.h9
-rw-r--r--include/linux/sunrpc/gss_krb5_enctypes.h4
-rw-r--r--include/linux/sunrpc/sched.h3
-rw-r--r--include/linux/sunrpc/svc.h1
-rw-r--r--include/linux/suspend.h16
-rw-r--r--include/linux/swap.h18
-rw-r--r--include/linux/swiotlb.h1
-rw-r--r--include/linux/sysfs.h7
-rw-r--r--include/linux/tc_ematch/tc_em_meta.h2
-rw-r--r--include/linux/tcp.h1
-rw-r--r--include/linux/topology.h2
-rw-r--r--include/linux/tracehook.h385
-rw-r--r--include/linux/usb/composite.h32
-rw-r--r--include/linux/usb/gadget.h88
-rw-r--r--include/linux/usb/m66592.h2
-rw-r--r--include/linux/usb/r8a66597.h8
-rw-r--r--include/linux/usb/renesas_usbhs.h17
-rw-r--r--include/linux/usb_usual.h4
-rw-r--r--include/linux/uts.h2
-rw-r--r--include/linux/virtio_net.h1
-rw-r--r--include/linux/vt.h7
-rw-r--r--include/linux/workqueue.h18
-rw-r--r--include/linux/zorro.h2
-rw-r--r--include/media/lirc_dev.h2
-rw-r--r--include/media/m5mols.h4
-rw-r--r--include/media/v4l2-dev.h4
-rw-r--r--include/media/v4l2-subdev.h10
-rw-r--r--include/net/9p/9p.h193
-rw-r--r--include/net/9p/client.h12
-rw-r--r--include/net/9p/transport.h2
-rw-r--r--include/net/act_api.h6
-rw-r--r--include/net/arp.h31
-rw-r--r--include/net/bluetooth/bluetooth.h27
-rw-r--r--include/net/bluetooth/hci.h77
-rw-r--r--include/net/bluetooth/hci_core.h96
-rw-r--r--include/net/bluetooth/l2cap.h140
-rw-r--r--include/net/bluetooth/mgmt.h12
-rw-r--r--include/net/bluetooth/rfcomm.h9
-rw-r--r--include/net/bluetooth/smp.h47
-rw-r--r--include/net/caif/caif_hsi.h145
-rw-r--r--include/net/cfg80211.h73
-rw-r--r--include/net/dcbnl.h11
-rw-r--r--include/net/dst.h40
-rw-r--r--include/net/dst_ops.h1
-rw-r--r--include/net/genetlink.h32
-rw-r--r--include/net/inetpeer.h39
-rw-r--r--include/net/ip.h10
-rw-r--r--include/net/ip6_fib.h1
-rw-r--r--include/net/ip_vs.h34
-rw-r--r--include/net/ipv6.h12
-rw-r--r--include/net/mac80211.h321
-rw-r--r--include/net/neighbour.h34
-rw-r--r--include/net/net_namespace.h11
-rw-r--r--include/net/netfilter/nf_conntrack.h6
-rw-r--r--include/net/netlink.h24
-rw-r--r--include/net/nfc.h156
-rw-r--r--include/net/pkt_sched.h4
-rw-r--r--include/net/rtnetlink.h7
-rw-r--r--include/net/sch_generic.h12
-rw-r--r--include/net/sctp/command.h1
-rw-r--r--include/net/sctp/sctp.h15
-rw-r--r--include/net/sctp/structs.h17
-rw-r--r--include/net/sctp/ulpevent.h2
-rw-r--r--include/net/sctp/user.h1
-rw-r--r--include/net/snmp.h86
-rw-r--r--include/net/sock.h6
-rw-r--r--include/net/tcp.h11
-rw-r--r--include/net/wimax.h1
-rw-r--r--include/rdma/ib_pma.h156
-rw-r--r--include/rdma/ib_verbs.h3
-rw-r--r--include/scsi/iscsi_proto.h18
-rw-r--r--include/scsi/libfc.h8
-rw-r--r--include/scsi/libiscsi.h2
-rw-r--r--include/scsi/osd_initiator.h2
-rw-r--r--include/scsi/scsi.h2
-rw-r--r--include/sound/rawmidi.h4
-rw-r--r--include/sound/sb16_csp.h9
-rw-r--r--include/sound/soc-dai.h4
-rw-r--r--include/sound/soc-dapm.h7
-rw-r--r--include/sound/soc.h62
-rw-r--r--include/sound/soundfont.h2
-rw-r--r--include/staging/altera.h49
-rw-r--r--include/target/target_core_base.h228
-rw-r--r--include/target/target_core_device.h6
-rw-r--r--include/target/target_core_fabric_ops.h9
-rw-r--r--include/target/target_core_transport.h43
-rw-r--r--include/trace/events/asoc.h45
-rw-r--r--include/trace/events/ext4.h179
-rw-r--r--include/trace/events/irq.h3
-rw-r--r--include/trace/events/sock.h68
-rw-r--r--include/trace/events/udp.h32
-rw-r--r--include/trace/events/vmscan.h160
-rw-r--r--include/trace/events/xen.h504
-rw-r--r--include/xen/balloon.h14
-rw-r--r--include/xen/events.h2
-rw-r--r--include/xen/hvc-console.h4
-rw-r--r--include/xen/interface/xen.h39
-rw-r--r--include/xen/tmem.h5
-rw-r--r--include/xen/xenbus.h2
318 files changed, 6018 insertions, 2447 deletions
diff --git a/include/acpi/acpi_bus.h b/include/acpi/acpi_bus.h
index 3a10ef5914eb..6cd5b6403a7b 100644
--- a/include/acpi/acpi_bus.h
+++ b/include/acpi/acpi_bus.h
@@ -210,7 +210,7 @@ struct acpi_device_power_state {
210struct acpi_device_power { 210struct acpi_device_power {
211 int state; /* Current state */ 211 int state; /* Current state */
212 struct acpi_device_power_flags flags; 212 struct acpi_device_power_flags flags;
213 struct acpi_device_power_state states[4]; /* Power states (D0-D3) */ 213 struct acpi_device_power_state states[ACPI_D_STATE_COUNT]; /* Power states (D0-D3Cold) */
214}; 214};
215 215
216/* Performance Management */ 216/* Performance Management */
diff --git a/include/acpi/acpiosxf.h b/include/acpi/acpiosxf.h
index a756bc8d866d..4543b6f75867 100644
--- a/include/acpi/acpiosxf.h
+++ b/include/acpi/acpiosxf.h
@@ -98,8 +98,11 @@ acpi_os_table_override(struct acpi_table_header *existing_table,
98/* 98/*
99 * Spinlock primitives 99 * Spinlock primitives
100 */ 100 */
101
102#ifndef acpi_os_create_lock
101acpi_status 103acpi_status
102acpi_os_create_lock(acpi_spinlock *out_handle); 104acpi_os_create_lock(acpi_spinlock *out_handle);
105#endif
103 106
104void acpi_os_delete_lock(acpi_spinlock handle); 107void acpi_os_delete_lock(acpi_spinlock handle);
105 108
diff --git a/include/acpi/platform/aclinux.h b/include/acpi/platform/aclinux.h
index 5d2a5e9544d9..2ce1be9f6291 100644
--- a/include/acpi/platform/aclinux.h
+++ b/include/acpi/platform/aclinux.h
@@ -159,6 +159,24 @@ static inline void *acpi_os_acquire_object(acpi_cache_t * cache)
159 } while (0) 159 } while (0)
160#endif 160#endif
161 161
162/*
163 * When lockdep is enabled, the spin_lock_init() macro stringifies it's
164 * argument and uses that as a name for the lock in debugging.
165 * By executing spin_lock_init() in a macro the key changes from "lock" for
166 * all locks to the name of the argument of acpi_os_create_lock(), which
167 * prevents lockdep from reporting false positives for ACPICA locks.
168 */
169#define acpi_os_create_lock(__handle) \
170({ \
171 spinlock_t *lock = ACPI_ALLOCATE(sizeof(*lock)); \
172 \
173 if (lock) { \
174 *(__handle) = lock; \
175 spin_lock_init(*(__handle)); \
176 } \
177 lock ? AE_OK : AE_NO_MEMORY; \
178})
179
162#endif /* __KERNEL__ */ 180#endif /* __KERNEL__ */
163 181
164#endif /* __ACLINUX_H__ */ 182#endif /* __ACLINUX_H__ */
diff --git a/include/asm-generic/delay.h b/include/asm-generic/delay.h
index 4586fec75ddb..0f79054ce7cd 100644
--- a/include/asm-generic/delay.h
+++ b/include/asm-generic/delay.h
@@ -1,9 +1,44 @@
1#ifndef __ASM_GENERIC_DELAY_H 1#ifndef __ASM_GENERIC_DELAY_H
2#define __ASM_GENERIC_DELAY_H 2#define __ASM_GENERIC_DELAY_H
3 3
4/* Undefined functions to get compile-time errors */
5extern void __bad_udelay(void);
6extern void __bad_ndelay(void);
7
4extern void __udelay(unsigned long usecs); 8extern void __udelay(unsigned long usecs);
9extern void __ndelay(unsigned long nsecs);
10extern void __const_udelay(unsigned long xloops);
5extern void __delay(unsigned long loops); 11extern void __delay(unsigned long loops);
6 12
7#define udelay(n) __udelay(n) 13/*
14 * The weird n/20000 thing suppresses a "comparison is always false due to
15 * limited range of data type" warning with non-const 8-bit arguments.
16 */
17
18/* 0x10c7 is 2**32 / 1000000 (rounded up) */
19#define udelay(n) \
20 ({ \
21 if (__builtin_constant_p(n)) { \
22 if ((n) / 20000 >= 1) \
23 __bad_udelay(); \
24 else \
25 __const_udelay((n) * 0x10c7ul); \
26 } else { \
27 __udelay(n); \
28 } \
29 })
30
31/* 0x5 is 2**32 / 1000000000 (rounded up) */
32#define ndelay(n) \
33 ({ \
34 if (__builtin_constant_p(n)) { \
35 if ((n) / 20000 >= 1) \
36 __bad_ndelay(); \
37 else \
38 __const_udelay((n) * 5ul); \
39 } else { \
40 __ndelay(n); \
41 } \
42 })
8 43
9#endif /* __ASM_GENERIC_DELAY_H */ 44#endif /* __ASM_GENERIC_DELAY_H */
diff --git a/include/asm-generic/gpio.h b/include/asm-generic/gpio.h
index fcdcb5d5c995..d494001b1226 100644
--- a/include/asm-generic/gpio.h
+++ b/include/asm-generic/gpio.h
@@ -170,16 +170,6 @@ extern int __gpio_cansleep(unsigned gpio);
170 170
171extern int __gpio_to_irq(unsigned gpio); 171extern int __gpio_to_irq(unsigned gpio);
172 172
173#define GPIOF_DIR_OUT (0 << 0)
174#define GPIOF_DIR_IN (1 << 0)
175
176#define GPIOF_INIT_LOW (0 << 1)
177#define GPIOF_INIT_HIGH (1 << 1)
178
179#define GPIOF_IN (GPIOF_DIR_IN)
180#define GPIOF_OUT_INIT_LOW (GPIOF_DIR_OUT | GPIOF_INIT_LOW)
181#define GPIOF_OUT_INIT_HIGH (GPIOF_DIR_OUT | GPIOF_INIT_HIGH)
182
183/** 173/**
184 * struct gpio - a structure describing a GPIO with configuration 174 * struct gpio - a structure describing a GPIO with configuration
185 * @gpio: the GPIO number 175 * @gpio: the GPIO number
diff --git a/include/asm-generic/io.h b/include/asm-generic/io.h
index e0ffa3ddb02a..912088773a69 100644
--- a/include/asm-generic/io.h
+++ b/include/asm-generic/io.h
@@ -307,7 +307,11 @@ static inline void *phys_to_virt(unsigned long address)
307 307
308/* 308/*
309 * Change "struct page" to physical address. 309 * Change "struct page" to physical address.
310 *
311 * This implementation is for the no-MMU case only... if you have an MMU
312 * you'll need to provide your own definitions.
310 */ 313 */
314#ifndef CONFIG_MMU
311static inline void __iomem *ioremap(phys_addr_t offset, unsigned long size) 315static inline void __iomem *ioremap(phys_addr_t offset, unsigned long size)
312{ 316{
313 return (void __iomem*) (unsigned long)offset; 317 return (void __iomem*) (unsigned long)offset;
@@ -326,7 +330,9 @@ static inline void __iomem *ioremap(phys_addr_t offset, unsigned long size)
326static inline void iounmap(void *addr) 330static inline void iounmap(void *addr)
327{ 331{
328} 332}
333#endif /* CONFIG_MMU */
329 334
335#ifdef CONFIG_HAS_IOPORT
330#ifndef CONFIG_GENERIC_IOMAP 336#ifndef CONFIG_GENERIC_IOMAP
331static inline void __iomem *ioport_map(unsigned long port, unsigned int nr) 337static inline void __iomem *ioport_map(unsigned long port, unsigned int nr)
332{ 338{
@@ -340,9 +346,10 @@ static inline void ioport_unmap(void __iomem *p)
340extern void __iomem *ioport_map(unsigned long port, unsigned int nr); 346extern void __iomem *ioport_map(unsigned long port, unsigned int nr);
341extern void ioport_unmap(void __iomem *p); 347extern void ioport_unmap(void __iomem *p);
342#endif /* CONFIG_GENERIC_IOMAP */ 348#endif /* CONFIG_GENERIC_IOMAP */
349#endif /* CONFIG_HAS_IOPORT */
343 350
344#define xlate_dev_kmem_ptr(p) p 351#define xlate_dev_kmem_ptr(p) p
345#define xlate_dev_mem_ptr(p) ((void *) (p)) 352#define xlate_dev_mem_ptr(p) __va(p)
346 353
347#ifndef virt_to_bus 354#ifndef virt_to_bus
348static inline unsigned long virt_to_bus(volatile void *address) 355static inline unsigned long virt_to_bus(volatile void *address)
diff --git a/include/asm-generic/iomap.h b/include/asm-generic/iomap.h
index 76b0cc5637f8..98dcd76ce836 100644
--- a/include/asm-generic/iomap.h
+++ b/include/asm-generic/iomap.h
@@ -56,17 +56,29 @@ extern void iowrite8_rep(void __iomem *port, const void *buf, unsigned long coun
56extern void iowrite16_rep(void __iomem *port, const void *buf, unsigned long count); 56extern void iowrite16_rep(void __iomem *port, const void *buf, unsigned long count);
57extern void iowrite32_rep(void __iomem *port, const void *buf, unsigned long count); 57extern void iowrite32_rep(void __iomem *port, const void *buf, unsigned long count);
58 58
59#ifdef CONFIG_HAS_IOPORT
59/* Create a virtual mapping cookie for an IO port range */ 60/* Create a virtual mapping cookie for an IO port range */
60extern void __iomem *ioport_map(unsigned long port, unsigned int nr); 61extern void __iomem *ioport_map(unsigned long port, unsigned int nr);
61extern void ioport_unmap(void __iomem *); 62extern void ioport_unmap(void __iomem *);
63#endif
62 64
63#ifndef ARCH_HAS_IOREMAP_WC 65#ifndef ARCH_HAS_IOREMAP_WC
64#define ioremap_wc ioremap_nocache 66#define ioremap_wc ioremap_nocache
65#endif 67#endif
66 68
69#ifdef CONFIG_PCI
67/* Create a virtual mapping cookie for a PCI BAR (memory or IO) */ 70/* Create a virtual mapping cookie for a PCI BAR (memory or IO) */
68struct pci_dev; 71struct pci_dev;
69extern void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long max); 72extern void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long max);
70extern void pci_iounmap(struct pci_dev *dev, void __iomem *); 73extern void pci_iounmap(struct pci_dev *dev, void __iomem *);
74#else
75struct pci_dev;
76static inline void __iomem *pci_iomap(struct pci_dev *dev, int bar, unsigned long max)
77{
78 return NULL;
79}
80static inline void pci_iounmap(struct pci_dev *dev, void __iomem *addr)
81{ }
82#endif
71 83
72#endif 84#endif
diff --git a/include/asm-generic/pgtable.h b/include/asm-generic/pgtable.h
index e9b8e5926bef..76bff2bff15e 100644
--- a/include/asm-generic/pgtable.h
+++ b/include/asm-generic/pgtable.h
@@ -88,7 +88,7 @@ static inline pmd_t pmdp_get_and_clear(struct mm_struct *mm,
88 pmd_t pmd = *pmdp; 88 pmd_t pmd = *pmdp;
89 pmd_clear(mm, address, pmdp); 89 pmd_clear(mm, address, pmdp);
90 return pmd; 90 return pmd;
91}) 91}
92#endif /* CONFIG_TRANSPARENT_HUGEPAGE */ 92#endif /* CONFIG_TRANSPARENT_HUGEPAGE */
93#endif 93#endif
94 94
diff --git a/include/asm-generic/system.h b/include/asm-generic/system.h
index 4b0b9cbbfae5..215efa74f5a2 100644
--- a/include/asm-generic/system.h
+++ b/include/asm-generic/system.h
@@ -14,7 +14,6 @@
14#ifndef __ASM_GENERIC_SYSTEM_H 14#ifndef __ASM_GENERIC_SYSTEM_H
15#define __ASM_GENERIC_SYSTEM_H 15#define __ASM_GENERIC_SYSTEM_H
16 16
17#ifdef __KERNEL__
18#ifndef __ASSEMBLY__ 17#ifndef __ASSEMBLY__
19 18
20#include <linux/types.h> 19#include <linux/types.h>
@@ -139,5 +138,4 @@ unsigned long __xchg(unsigned long x, volatile void *ptr, int size)
139 138
140#endif /* !__ASSEMBLY__ */ 139#endif /* !__ASSEMBLY__ */
141 140
142#endif /* __KERNEL__ */
143#endif /* __ASM_GENERIC_SYSTEM_H */ 141#endif /* __ASM_GENERIC_SYSTEM_H */
diff --git a/include/crypto/if_alg.h b/include/crypto/if_alg.h
index c5813c87de06..d61c11170213 100644
--- a/include/crypto/if_alg.h
+++ b/include/crypto/if_alg.h
@@ -16,6 +16,7 @@
16#include <linux/compiler.h> 16#include <linux/compiler.h>
17#include <linux/completion.h> 17#include <linux/completion.h>
18#include <linux/if_alg.h> 18#include <linux/if_alg.h>
19#include <linux/scatterlist.h>
19#include <linux/types.h> 20#include <linux/types.h>
20#include <net/sock.h> 21#include <net/sock.h>
21 22
diff --git a/include/drm/drm_crtc.h b/include/drm/drm_crtc.h
index 9573e0ce3120..33d12f87f0e0 100644
--- a/include/drm/drm_crtc.h
+++ b/include/drm/drm_crtc.h
@@ -520,6 +520,8 @@ struct drm_connector {
520 uint32_t encoder_ids[DRM_CONNECTOR_MAX_ENCODER]; 520 uint32_t encoder_ids[DRM_CONNECTOR_MAX_ENCODER];
521 uint32_t force_encoder_id; 521 uint32_t force_encoder_id;
522 struct drm_encoder *encoder; /* currently active encoder */ 522 struct drm_encoder *encoder; /* currently active encoder */
523
524 int null_edid_counter; /* needed to workaround some HW bugs where we get all 0s */
523}; 525};
524 526
525/** 527/**
diff --git a/include/drm/drm_pciids.h b/include/drm/drm_pciids.h
index f04b2a3b0f49..3d53efd25ab9 100644
--- a/include/drm/drm_pciids.h
+++ b/include/drm/drm_pciids.h
@@ -182,6 +182,7 @@
182 {0x1002, 0x6750, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_TURKS|RADEON_NEW_MEMMAP}, \ 182 {0x1002, 0x6750, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_TURKS|RADEON_NEW_MEMMAP}, \
183 {0x1002, 0x6758, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_TURKS|RADEON_NEW_MEMMAP}, \ 183 {0x1002, 0x6758, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_TURKS|RADEON_NEW_MEMMAP}, \
184 {0x1002, 0x6759, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_TURKS|RADEON_NEW_MEMMAP}, \ 184 {0x1002, 0x6759, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_TURKS|RADEON_NEW_MEMMAP}, \
185 {0x1002, 0x675F, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_TURKS|RADEON_NEW_MEMMAP}, \
185 {0x1002, 0x6760, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_CAICOS|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \ 186 {0x1002, 0x6760, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_CAICOS|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \
186 {0x1002, 0x6761, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_CAICOS|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \ 187 {0x1002, 0x6761, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_CAICOS|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \
187 {0x1002, 0x6762, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_CAICOS|RADEON_NEW_MEMMAP}, \ 188 {0x1002, 0x6762, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_CAICOS|RADEON_NEW_MEMMAP}, \
@@ -192,6 +193,7 @@
192 {0x1002, 0x6767, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_CAICOS|RADEON_NEW_MEMMAP}, \ 193 {0x1002, 0x6767, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_CAICOS|RADEON_NEW_MEMMAP}, \
193 {0x1002, 0x6768, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_CAICOS|RADEON_NEW_MEMMAP}, \ 194 {0x1002, 0x6768, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_CAICOS|RADEON_NEW_MEMMAP}, \
194 {0x1002, 0x6770, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_CAICOS|RADEON_NEW_MEMMAP}, \ 195 {0x1002, 0x6770, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_CAICOS|RADEON_NEW_MEMMAP}, \
196 {0x1002, 0x6778, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_CAICOS|RADEON_NEW_MEMMAP}, \
195 {0x1002, 0x6779, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_CAICOS|RADEON_NEW_MEMMAP}, \ 197 {0x1002, 0x6779, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_CAICOS|RADEON_NEW_MEMMAP}, \
196 {0x1002, 0x6880, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_CYPRESS|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \ 198 {0x1002, 0x6880, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_CYPRESS|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP}, \
197 {0x1002, 0x6888, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_CYPRESS|RADEON_NEW_MEMMAP}, \ 199 {0x1002, 0x6888, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_CYPRESS|RADEON_NEW_MEMMAP}, \
@@ -467,6 +469,17 @@
467 {0x1002, 0x9614, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RS780|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \ 469 {0x1002, 0x9614, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RS780|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \
468 {0x1002, 0x9615, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RS780|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \ 470 {0x1002, 0x9615, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RS780|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \
469 {0x1002, 0x9616, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RS780|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \ 471 {0x1002, 0x9616, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RS780|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \
472 {0x1002, 0x9640, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_SUMO|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \
473 {0x1002, 0x9641, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_SUMO|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \
474 {0x1002, 0x9642, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_SUMO2|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \
475 {0x1002, 0x9643, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_SUMO2|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \
476 {0x1002, 0x9644, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_SUMO2|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \
477 {0x1002, 0x9645, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_SUMO2|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \
478 {0x1002, 0x9647, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_SUMO|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP|RADEON_IS_IGP},\
479 {0x1002, 0x9648, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_SUMO|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP|RADEON_IS_IGP},\
480 {0x1002, 0x964a, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_SUMO|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \
481 {0x1002, 0x964e, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_SUMO|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP|RADEON_IS_IGP},\
482 {0x1002, 0x964f, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_SUMO|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP|RADEON_IS_IGP},\
470 {0x1002, 0x9710, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RS880|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \ 483 {0x1002, 0x9710, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RS880|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \
471 {0x1002, 0x9711, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RS880|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \ 484 {0x1002, 0x9711, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RS880|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \
472 {0x1002, 0x9712, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RS880|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \ 485 {0x1002, 0x9712, PCI_ANY_ID, PCI_ANY_ID, 0, 0, CHIP_RS880|RADEON_IS_MOBILITY|RADEON_NEW_MEMMAP|RADEON_IS_IGP}, \
diff --git a/include/linux/Kbuild b/include/linux/Kbuild
index 01f636275057..619b5657af77 100644
--- a/include/linux/Kbuild
+++ b/include/linux/Kbuild
@@ -135,6 +135,7 @@ header-y += firewire-cdev.h
135header-y += firewire-constants.h 135header-y += firewire-constants.h
136header-y += flat.h 136header-y += flat.h
137header-y += fs.h 137header-y += fs.h
138header-y += fsl_hypervisor.h
138header-y += fuse.h 139header-y += fuse.h
139header-y += futex.h 140header-y += futex.h
140header-y += gameport.h 141header-y += gameport.h
diff --git a/include/linux/amd-iommu.h b/include/linux/amd-iommu.h
new file mode 100644
index 000000000000..a6863a2dec1f
--- /dev/null
+++ b/include/linux/amd-iommu.h
@@ -0,0 +1,35 @@
1/*
2 * Copyright (C) 2007-2010 Advanced Micro Devices, Inc.
3 * Author: Joerg Roedel <joerg.roedel@amd.com>
4 * Leo Duran <leo.duran@amd.com>
5 *
6 * This program is free software; you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License version 2 as published
8 * by the Free Software Foundation.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 */
19
20#ifndef _ASM_X86_AMD_IOMMU_H
21#define _ASM_X86_AMD_IOMMU_H
22
23#include <linux/irqreturn.h>
24
25#ifdef CONFIG_AMD_IOMMU
26
27extern int amd_iommu_detect(void);
28
29#else
30
31static inline int amd_iommu_detect(void) { return -ENODEV; }
32
33#endif
34
35#endif /* _ASM_X86_AMD_IOMMU_H */
diff --git a/include/linux/anon_inodes.h b/include/linux/anon_inodes.h
index 69a21e0ebd33..8013a45242fe 100644
--- a/include/linux/anon_inodes.h
+++ b/include/linux/anon_inodes.h
@@ -8,6 +8,8 @@
8#ifndef _LINUX_ANON_INODES_H 8#ifndef _LINUX_ANON_INODES_H
9#define _LINUX_ANON_INODES_H 9#define _LINUX_ANON_INODES_H
10 10
11struct file_operations;
12
11struct file *anon_inode_getfile(const char *name, 13struct file *anon_inode_getfile(const char *name,
12 const struct file_operations *fops, 14 const struct file_operations *fops,
13 void *priv, int flags); 15 void *priv, int flags);
diff --git a/include/linux/arcdevice.h b/include/linux/arcdevice.h
index 7d650a0e3d8f..7216b0daf544 100644
--- a/include/linux/arcdevice.h
+++ b/include/linux/arcdevice.h
@@ -20,6 +20,7 @@
20#include <linux/if_arcnet.h> 20#include <linux/if_arcnet.h>
21 21
22#ifdef __KERNEL__ 22#ifdef __KERNEL__
23#include <linux/irqreturn.h>
23 24
24#ifndef bool 25#ifndef bool
25#define bool int 26#define bool int
diff --git a/include/linux/ath9k_platform.h b/include/linux/ath9k_platform.h
index 60a7c49dcb49..6e3f54f37844 100644
--- a/include/linux/ath9k_platform.h
+++ b/include/linux/ath9k_platform.h
@@ -30,6 +30,8 @@ struct ath9k_platform_data {
30 u32 gpio_val; 30 u32 gpio_val;
31 31
32 bool is_clk_25mhz; 32 bool is_clk_25mhz;
33 int (*get_mac_revision)(void);
34 int (*external_reset)(void);
33}; 35};
34 36
35#endif /* _LINUX_ATH9K_PLATFORM_H */ 37#endif /* _LINUX_ATH9K_PLATFORM_H */
diff --git a/include/linux/atomic.h b/include/linux/atomic.h
index ee456c79b0e6..bc6615d4132b 100644
--- a/include/linux/atomic.h
+++ b/include/linux/atomic.h
@@ -34,6 +34,32 @@ static inline int atomic_inc_not_zero_hint(atomic_t *v, int hint)
34} 34}
35#endif 35#endif
36 36
37#ifndef atomic_inc_unless_negative
38static inline int atomic_inc_unless_negative(atomic_t *p)
39{
40 int v, v1;
41 for (v = 0; v >= 0; v = v1) {
42 v1 = atomic_cmpxchg(p, v, v + 1);
43 if (likely(v1 == v))
44 return 1;
45 }
46 return 0;
47}
48#endif
49
50#ifndef atomic_dec_unless_positive
51static inline int atomic_dec_unless_positive(atomic_t *p)
52{
53 int v, v1;
54 for (v = 0; v <= 0; v = v1) {
55 v1 = atomic_cmpxchg(p, v, v - 1);
56 if (likely(v1 == v))
57 return 1;
58 }
59 return 0;
60}
61#endif
62
37#ifndef CONFIG_ARCH_HAS_ATOMIC_OR 63#ifndef CONFIG_ARCH_HAS_ATOMIC_OR
38static inline void atomic_or(int i, atomic_t *v) 64static inline void atomic_or(int i, atomic_t *v)
39{ 65{
diff --git a/include/linux/audit.h b/include/linux/audit.h
index 9d339eb27881..0c8006129fb2 100644
--- a/include/linux/audit.h
+++ b/include/linux/audit.h
@@ -613,6 +613,12 @@ extern void audit_log_d_path(struct audit_buffer *ab,
613extern void audit_log_key(struct audit_buffer *ab, 613extern void audit_log_key(struct audit_buffer *ab,
614 char *key); 614 char *key);
615extern void audit_log_lost(const char *message); 615extern void audit_log_lost(const char *message);
616#ifdef CONFIG_SECURITY
617extern void audit_log_secctx(struct audit_buffer *ab, u32 secid);
618#else
619#define audit_log_secctx(b,s) do { ; } while (0)
620#endif
621
616extern int audit_update_lsm_rules(void); 622extern int audit_update_lsm_rules(void);
617 623
618 /* Private API (for audit.c only) */ 624 /* Private API (for audit.c only) */
@@ -635,6 +641,7 @@ extern int audit_enabled;
635#define audit_log_untrustedstring(a,s) do { ; } while (0) 641#define audit_log_untrustedstring(a,s) do { ; } while (0)
636#define audit_log_d_path(b, p, d) do { ; } while (0) 642#define audit_log_d_path(b, p, d) do { ; } while (0)
637#define audit_log_key(b, k) do { ; } while (0) 643#define audit_log_key(b, k) do { ; } while (0)
644#define audit_log_secctx(b,s) do { ; } while (0)
638#define audit_enabled 0 645#define audit_enabled 0
639#endif 646#endif
640#endif 647#endif
diff --git a/include/linux/basic_mmio_gpio.h b/include/linux/basic_mmio_gpio.h
index 1ae12710d732..98999cf107ce 100644
--- a/include/linux/basic_mmio_gpio.h
+++ b/include/linux/basic_mmio_gpio.h
@@ -16,6 +16,7 @@
16#include <linux/gpio.h> 16#include <linux/gpio.h>
17#include <linux/types.h> 17#include <linux/types.h>
18#include <linux/compiler.h> 18#include <linux/compiler.h>
19#include <linux/spinlock_types.h>
19 20
20struct bgpio_pdata { 21struct bgpio_pdata {
21 int base; 22 int base;
diff --git a/include/linux/bcma/bcma.h b/include/linux/bcma/bcma.h
index 08763e4e848f..8c96654bef16 100644
--- a/include/linux/bcma/bcma.h
+++ b/include/linux/bcma/bcma.h
@@ -6,6 +6,7 @@
6 6
7#include <linux/bcma/bcma_driver_chipcommon.h> 7#include <linux/bcma/bcma_driver_chipcommon.h>
8#include <linux/bcma/bcma_driver_pci.h> 8#include <linux/bcma/bcma_driver_pci.h>
9#include <linux/ssb/ssb.h> /* SPROM sharing */
9 10
10#include "bcma_regs.h" 11#include "bcma_regs.h"
11 12
@@ -24,6 +25,11 @@ struct bcma_chipinfo {
24 u8 pkg; 25 u8 pkg;
25}; 26};
26 27
28enum bcma_clkmode {
29 BCMA_CLKMODE_FAST,
30 BCMA_CLKMODE_DYNAMIC,
31};
32
27struct bcma_host_ops { 33struct bcma_host_ops {
28 u8 (*read8)(struct bcma_device *core, u16 offset); 34 u8 (*read8)(struct bcma_device *core, u16 offset);
29 u16 (*read16)(struct bcma_device *core, u16 offset); 35 u16 (*read16)(struct bcma_device *core, u16 offset);
@@ -31,6 +37,12 @@ struct bcma_host_ops {
31 void (*write8)(struct bcma_device *core, u16 offset, u8 value); 37 void (*write8)(struct bcma_device *core, u16 offset, u8 value);
32 void (*write16)(struct bcma_device *core, u16 offset, u16 value); 38 void (*write16)(struct bcma_device *core, u16 offset, u16 value);
33 void (*write32)(struct bcma_device *core, u16 offset, u32 value); 39 void (*write32)(struct bcma_device *core, u16 offset, u32 value);
40#ifdef CONFIG_BCMA_BLOCKIO
41 void (*block_read)(struct bcma_device *core, void *buffer,
42 size_t count, u16 offset, u8 reg_width);
43 void (*block_write)(struct bcma_device *core, const void *buffer,
44 size_t count, u16 offset, u8 reg_width);
45#endif
34 /* Agent ops */ 46 /* Agent ops */
35 u32 (*aread32)(struct bcma_device *core, u16 offset); 47 u32 (*aread32)(struct bcma_device *core, u16 offset);
36 void (*awrite32)(struct bcma_device *core, u16 offset, u32 value); 48 void (*awrite32)(struct bcma_device *core, u16 offset, u32 value);
@@ -117,6 +129,8 @@ struct bcma_device {
117 struct bcma_device_id id; 129 struct bcma_device_id id;
118 130
119 struct device dev; 131 struct device dev;
132 struct device *dma_dev;
133 unsigned int irq;
120 bool dev_registered; 134 bool dev_registered;
121 135
122 u8 core_index; 136 u8 core_index;
@@ -179,6 +193,10 @@ struct bcma_bus {
179 193
180 struct bcma_drv_cc drv_cc; 194 struct bcma_drv_cc drv_cc;
181 struct bcma_drv_pci drv_pci; 195 struct bcma_drv_pci drv_pci;
196
197 /* We decided to share SPROM struct with SSB as long as we do not need
198 * any hacks for BCMA. This simplifies drivers code. */
199 struct ssb_sprom sprom;
182}; 200};
183 201
184extern inline u32 bcma_read8(struct bcma_device *core, u16 offset) 202extern inline u32 bcma_read8(struct bcma_device *core, u16 offset)
@@ -208,6 +226,18 @@ void bcma_write32(struct bcma_device *core, u16 offset, u32 value)
208{ 226{
209 core->bus->ops->write32(core, offset, value); 227 core->bus->ops->write32(core, offset, value);
210} 228}
229#ifdef CONFIG_BCMA_BLOCKIO
230extern inline void bcma_block_read(struct bcma_device *core, void *buffer,
231 size_t count, u16 offset, u8 reg_width)
232{
233 core->bus->ops->block_read(core, buffer, count, offset, reg_width);
234}
235extern inline void bcma_block_write(struct bcma_device *core, const void *buffer,
236 size_t count, u16 offset, u8 reg_width)
237{
238 core->bus->ops->block_write(core, buffer, count, offset, reg_width);
239}
240#endif
211extern inline u32 bcma_aread32(struct bcma_device *core, u16 offset) 241extern inline u32 bcma_aread32(struct bcma_device *core, u16 offset)
212{ 242{
213 return core->bus->ops->aread32(core, offset); 243 return core->bus->ops->aread32(core, offset);
@@ -218,7 +248,24 @@ void bcma_awrite32(struct bcma_device *core, u16 offset, u32 value)
218 core->bus->ops->awrite32(core, offset, value); 248 core->bus->ops->awrite32(core, offset, value);
219} 249}
220 250
251#define bcma_mask32(cc, offset, mask) \
252 bcma_write32(cc, offset, bcma_read32(cc, offset) & (mask))
253#define bcma_set32(cc, offset, set) \
254 bcma_write32(cc, offset, bcma_read32(cc, offset) | (set))
255#define bcma_maskset32(cc, offset, mask, set) \
256 bcma_write32(cc, offset, (bcma_read32(cc, offset) & (mask)) | (set))
257
221extern bool bcma_core_is_enabled(struct bcma_device *core); 258extern bool bcma_core_is_enabled(struct bcma_device *core);
259extern void bcma_core_disable(struct bcma_device *core, u32 flags);
222extern int bcma_core_enable(struct bcma_device *core, u32 flags); 260extern int bcma_core_enable(struct bcma_device *core, u32 flags);
261extern void bcma_core_set_clockmode(struct bcma_device *core,
262 enum bcma_clkmode clkmode);
263extern void bcma_core_pll_ctl(struct bcma_device *core, u32 req, u32 status,
264 bool on);
265#define BCMA_DMA_TRANSLATION_MASK 0xC0000000
266#define BCMA_DMA_TRANSLATION_NONE 0x00000000
267#define BCMA_DMA_TRANSLATION_DMA32_CMT 0x40000000 /* Client Mode Translation for 32-bit DMA */
268#define BCMA_DMA_TRANSLATION_DMA64_CMT 0x80000000 /* Client Mode Translation for 64-bit DMA */
269extern u32 bcma_core_dma_translation(struct bcma_device *core);
223 270
224#endif /* LINUX_BCMA_H_ */ 271#endif /* LINUX_BCMA_H_ */
diff --git a/include/linux/bcma/bcma_driver_chipcommon.h b/include/linux/bcma/bcma_driver_chipcommon.h
index 083c3b6cd5ce..a0f684615ae5 100644
--- a/include/linux/bcma/bcma_driver_chipcommon.h
+++ b/include/linux/bcma/bcma_driver_chipcommon.h
@@ -179,15 +179,7 @@
179#define BCMA_CC_PROG_WAITCNT 0x0124 179#define BCMA_CC_PROG_WAITCNT 0x0124
180#define BCMA_CC_FLASH_CFG 0x0128 180#define BCMA_CC_FLASH_CFG 0x0128
181#define BCMA_CC_FLASH_WAITCNT 0x012C 181#define BCMA_CC_FLASH_WAITCNT 0x012C
182#define BCMA_CC_CLKCTLST 0x01E0 /* Clock control and status (rev >= 20) */ 182/* 0x1E0 is defined as shared BCMA_CLKCTLST */
183#define BCMA_CC_CLKCTLST_FORCEALP 0x00000001 /* Force ALP request */
184#define BCMA_CC_CLKCTLST_FORCEHT 0x00000002 /* Force HT request */
185#define BCMA_CC_CLKCTLST_FORCEILP 0x00000004 /* Force ILP request */
186#define BCMA_CC_CLKCTLST_HAVEALPREQ 0x00000008 /* ALP available request */
187#define BCMA_CC_CLKCTLST_HAVEHTREQ 0x00000010 /* HT available request */
188#define BCMA_CC_CLKCTLST_HWCROFF 0x00000020 /* Force HW clock request off */
189#define BCMA_CC_CLKCTLST_HAVEHT 0x00010000 /* HT available */
190#define BCMA_CC_CLKCTLST_HAVEALP 0x00020000 /* APL available */
191#define BCMA_CC_HW_WORKAROUND 0x01E4 /* Hardware workaround (rev >= 20) */ 183#define BCMA_CC_HW_WORKAROUND 0x01E4 /* Hardware workaround (rev >= 20) */
192#define BCMA_CC_UART0_DATA 0x0300 184#define BCMA_CC_UART0_DATA 0x0300
193#define BCMA_CC_UART0_IMR 0x0304 185#define BCMA_CC_UART0_IMR 0x0304
@@ -244,6 +236,8 @@
244#define BCMA_CC_REGCTL_DATA 0x065C 236#define BCMA_CC_REGCTL_DATA 0x065C
245#define BCMA_CC_PLLCTL_ADDR 0x0660 237#define BCMA_CC_PLLCTL_ADDR 0x0660
246#define BCMA_CC_PLLCTL_DATA 0x0664 238#define BCMA_CC_PLLCTL_DATA 0x0664
239#define BCMA_CC_SPROM 0x0800 /* SPROM beginning */
240#define BCMA_CC_SPROM_PCIE6 0x0830 /* SPROM beginning on PCIe rev >= 6 */
247 241
248/* Data for the PMU, if available. 242/* Data for the PMU, if available.
249 * Check availability with ((struct bcma_chipcommon)->capabilities & BCMA_CC_CAP_PMU) 243 * Check availability with ((struct bcma_chipcommon)->capabilities & BCMA_CC_CAP_PMU)
diff --git a/include/linux/bcma/bcma_driver_pci.h b/include/linux/bcma/bcma_driver_pci.h
index b7e191cf00ec..3871b668caf9 100644
--- a/include/linux/bcma/bcma_driver_pci.h
+++ b/include/linux/bcma/bcma_driver_pci.h
@@ -85,5 +85,7 @@ struct bcma_drv_pci {
85#define pcicore_write32(pc, offset, val) bcma_write32((pc)->core, offset, val) 85#define pcicore_write32(pc, offset, val) bcma_write32((pc)->core, offset, val)
86 86
87extern void bcma_core_pci_init(struct bcma_drv_pci *pc); 87extern void bcma_core_pci_init(struct bcma_drv_pci *pc);
88extern int bcma_core_pci_irq_ctl(struct bcma_drv_pci *pc,
89 struct bcma_device *core, bool enable);
88 90
89#endif /* LINUX_BCMA_DRIVER_PCI_H_ */ 91#endif /* LINUX_BCMA_DRIVER_PCI_H_ */
diff --git a/include/linux/bcma/bcma_regs.h b/include/linux/bcma/bcma_regs.h
index f82d88a960ce..9faae2ae02e8 100644
--- a/include/linux/bcma/bcma_regs.h
+++ b/include/linux/bcma/bcma_regs.h
@@ -1,13 +1,38 @@
1#ifndef LINUX_BCMA_REGS_H_ 1#ifndef LINUX_BCMA_REGS_H_
2#define LINUX_BCMA_REGS_H_ 2#define LINUX_BCMA_REGS_H_
3 3
4/* Some single registers are shared between many cores */
5/* BCMA_CLKCTLST: ChipCommon (rev >= 20), PCIe, 80211 */
6#define BCMA_CLKCTLST 0x01E0 /* Clock control and status */
7#define BCMA_CLKCTLST_FORCEALP 0x00000001 /* Force ALP request */
8#define BCMA_CLKCTLST_FORCEHT 0x00000002 /* Force HT request */
9#define BCMA_CLKCTLST_FORCEILP 0x00000004 /* Force ILP request */
10#define BCMA_CLKCTLST_HAVEALPREQ 0x00000008 /* ALP available request */
11#define BCMA_CLKCTLST_HAVEHTREQ 0x00000010 /* HT available request */
12#define BCMA_CLKCTLST_HWCROFF 0x00000020 /* Force HW clock request off */
13#define BCMA_CLKCTLST_EXTRESREQ 0x00000700 /* Mask of external resource requests */
14#define BCMA_CLKCTLST_HAVEALP 0x00010000 /* ALP available */
15#define BCMA_CLKCTLST_HAVEHT 0x00020000 /* HT available */
16#define BCMA_CLKCTLST_BP_ON_ALP 0x00040000 /* RO: running on ALP clock */
17#define BCMA_CLKCTLST_BP_ON_HT 0x00080000 /* RO: running on HT clock */
18#define BCMA_CLKCTLST_EXTRESST 0x07000000 /* Mask of external resource status */
19/* Is there any BCM4328 on BCMA bus? */
20#define BCMA_CLKCTLST_4328A0_HAVEHT 0x00010000 /* 4328a0 has reversed bits */
21#define BCMA_CLKCTLST_4328A0_HAVEALP 0x00020000 /* 4328a0 has reversed bits */
22
4/* Agent registers (common for every core) */ 23/* Agent registers (common for every core) */
5#define BCMA_IOCTL 0x0408 24#define BCMA_IOCTL 0x0408 /* IO control */
6#define BCMA_IOCTL_CLK 0x0001 25#define BCMA_IOCTL_CLK 0x0001
7#define BCMA_IOCTL_FGC 0x0002 26#define BCMA_IOCTL_FGC 0x0002
8#define BCMA_IOCTL_CORE_BITS 0x3FFC 27#define BCMA_IOCTL_CORE_BITS 0x3FFC
9#define BCMA_IOCTL_PME_EN 0x4000 28#define BCMA_IOCTL_PME_EN 0x4000
10#define BCMA_IOCTL_BIST_EN 0x8000 29#define BCMA_IOCTL_BIST_EN 0x8000
30#define BCMA_IOST 0x0500 /* IO status */
31#define BCMA_IOST_CORE_BITS 0x0FFF
32#define BCMA_IOST_DMA64 0x1000
33#define BCMA_IOST_GATED_CLK 0x2000
34#define BCMA_IOST_BIST_ERROR 0x4000
35#define BCMA_IOST_BIST_DONE 0x8000
11#define BCMA_RESET_CTL 0x0800 36#define BCMA_RESET_CTL 0x0800
12#define BCMA_RESET_CTL_RESET 0x0001 37#define BCMA_RESET_CTL_RESET 0x0001
13 38
diff --git a/include/linux/binfmts.h b/include/linux/binfmts.h
index 8845613fd7e3..fd88a3945aa1 100644
--- a/include/linux/binfmts.h
+++ b/include/linux/binfmts.h
@@ -111,6 +111,7 @@ extern int __must_check remove_arg_zero(struct linux_binprm *);
111extern int search_binary_handler(struct linux_binprm *, struct pt_regs *); 111extern int search_binary_handler(struct linux_binprm *, struct pt_regs *);
112extern int flush_old_exec(struct linux_binprm * bprm); 112extern int flush_old_exec(struct linux_binprm * bprm);
113extern void setup_new_exec(struct linux_binprm * bprm); 113extern void setup_new_exec(struct linux_binprm * bprm);
114extern void would_dump(struct linux_binprm *, struct file *);
114 115
115extern int suid_dumpable; 116extern int suid_dumpable;
116#define SUID_DUMP_DISABLE 0 /* No setuid dumping */ 117#define SUID_DUMP_DISABLE 0 /* No setuid dumping */
diff --git a/include/linux/bit_spinlock.h b/include/linux/bit_spinlock.h
index b4326bfa684f..564d997e2168 100644
--- a/include/linux/bit_spinlock.h
+++ b/include/linux/bit_spinlock.h
@@ -88,7 +88,7 @@ static inline int bit_spin_is_locked(int bitnum, unsigned long *addr)
88{ 88{
89#if defined(CONFIG_SMP) || defined(CONFIG_DEBUG_SPINLOCK) 89#if defined(CONFIG_SMP) || defined(CONFIG_DEBUG_SPINLOCK)
90 return test_bit(bitnum, addr); 90 return test_bit(bitnum, addr);
91#elif defined CONFIG_PREEMPT 91#elif defined CONFIG_PREEMPT_COUNT
92 return preempt_count(); 92 return preempt_count();
93#else 93#else
94 return 1; 94 return 1;
diff --git a/include/linux/blk_types.h b/include/linux/blk_types.h
index 2a7cea53ca0d..6395692b2e7a 100644
--- a/include/linux/blk_types.h
+++ b/include/linux/blk_types.h
@@ -167,7 +167,7 @@ enum rq_flag_bits {
167 (REQ_FAILFAST_DEV | REQ_FAILFAST_TRANSPORT | REQ_FAILFAST_DRIVER) 167 (REQ_FAILFAST_DEV | REQ_FAILFAST_TRANSPORT | REQ_FAILFAST_DRIVER)
168#define REQ_COMMON_MASK \ 168#define REQ_COMMON_MASK \
169 (REQ_WRITE | REQ_FAILFAST_MASK | REQ_SYNC | REQ_META | REQ_DISCARD | \ 169 (REQ_WRITE | REQ_FAILFAST_MASK | REQ_SYNC | REQ_META | REQ_DISCARD | \
170 REQ_NOIDLE | REQ_FLUSH | REQ_FUA) 170 REQ_NOIDLE | REQ_FLUSH | REQ_FUA | REQ_SECURE)
171#define REQ_CLONE_MASK REQ_COMMON_MASK 171#define REQ_CLONE_MASK REQ_COMMON_MASK
172 172
173#define REQ_RAHEAD (1 << __REQ_RAHEAD) 173#define REQ_RAHEAD (1 << __REQ_RAHEAD)
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
index 1a23722e8878..0e67c45b3bc9 100644
--- a/include/linux/blkdev.h
+++ b/include/linux/blkdev.h
@@ -73,7 +73,7 @@ enum rq_cmd_type_bits {
73 73
74/* 74/*
75 * try to put the fields that are referenced together in the same cacheline. 75 * try to put the fields that are referenced together in the same cacheline.
76 * if you modify this structure, be sure to check block/blk-core.c:rq_init() 76 * if you modify this structure, be sure to check block/blk-core.c:blk_rq_init()
77 * as well! 77 * as well!
78 */ 78 */
79struct request { 79struct request {
@@ -260,8 +260,7 @@ struct queue_limits {
260 unsigned char discard_zeroes_data; 260 unsigned char discard_zeroes_data;
261}; 261};
262 262
263struct request_queue 263struct request_queue {
264{
265 /* 264 /*
266 * Together with queue_head for cacheline sharing 265 * Together with queue_head for cacheline sharing
267 */ 266 */
@@ -304,14 +303,14 @@ struct request_queue
304 void *queuedata; 303 void *queuedata;
305 304
306 /* 305 /*
307 * queue needs bounce pages for pages above this limit 306 * various queue flags, see QUEUE_* below
308 */ 307 */
309 gfp_t bounce_gfp; 308 unsigned long queue_flags;
310 309
311 /* 310 /*
312 * various queue flags, see QUEUE_* below 311 * queue needs bounce pages for pages above this limit
313 */ 312 */
314 unsigned long queue_flags; 313 gfp_t bounce_gfp;
315 314
316 /* 315 /*
317 * protects queue structures from reentrancy. ->__queue_lock should 316 * protects queue structures from reentrancy. ->__queue_lock should
@@ -334,8 +333,8 @@ struct request_queue
334 unsigned int nr_congestion_off; 333 unsigned int nr_congestion_off;
335 unsigned int nr_batching; 334 unsigned int nr_batching;
336 335
337 void *dma_drain_buffer;
338 unsigned int dma_drain_size; 336 unsigned int dma_drain_size;
337 void *dma_drain_buffer;
339 unsigned int dma_pad_mask; 338 unsigned int dma_pad_mask;
340 unsigned int dma_alignment; 339 unsigned int dma_alignment;
341 340
@@ -393,7 +392,7 @@ struct request_queue
393#define QUEUE_FLAG_ELVSWITCH 6 /* don't use elevator, just do FIFO */ 392#define QUEUE_FLAG_ELVSWITCH 6 /* don't use elevator, just do FIFO */
394#define QUEUE_FLAG_BIDI 7 /* queue supports bidi requests */ 393#define QUEUE_FLAG_BIDI 7 /* queue supports bidi requests */
395#define QUEUE_FLAG_NOMERGES 8 /* disable merge attempts */ 394#define QUEUE_FLAG_NOMERGES 8 /* disable merge attempts */
396#define QUEUE_FLAG_SAME_COMP 9 /* force complete on same CPU */ 395#define QUEUE_FLAG_SAME_COMP 9 /* complete on same CPU-group */
397#define QUEUE_FLAG_FAIL_IO 10 /* fake timeout */ 396#define QUEUE_FLAG_FAIL_IO 10 /* fake timeout */
398#define QUEUE_FLAG_STACKABLE 11 /* supports request stacking */ 397#define QUEUE_FLAG_STACKABLE 11 /* supports request stacking */
399#define QUEUE_FLAG_NONROT 12 /* non-rotational device (SSD) */ 398#define QUEUE_FLAG_NONROT 12 /* non-rotational device (SSD) */
@@ -403,6 +402,7 @@ struct request_queue
403#define QUEUE_FLAG_NOXMERGES 15 /* No extended merges */ 402#define QUEUE_FLAG_NOXMERGES 15 /* No extended merges */
404#define QUEUE_FLAG_ADD_RANDOM 16 /* Contributes to random pool */ 403#define QUEUE_FLAG_ADD_RANDOM 16 /* Contributes to random pool */
405#define QUEUE_FLAG_SECDISCARD 17 /* supports SECDISCARD */ 404#define QUEUE_FLAG_SECDISCARD 17 /* supports SECDISCARD */
405#define QUEUE_FLAG_SAME_FORCE 18 /* force complete on same CPU */
406 406
407#define QUEUE_FLAG_DEFAULT ((1 << QUEUE_FLAG_IO_STAT) | \ 407#define QUEUE_FLAG_DEFAULT ((1 << QUEUE_FLAG_IO_STAT) | \
408 (1 << QUEUE_FLAG_STACKABLE) | \ 408 (1 << QUEUE_FLAG_STACKABLE) | \
@@ -857,12 +857,21 @@ struct request_queue *blk_alloc_queue(gfp_t);
857struct request_queue *blk_alloc_queue_node(gfp_t, int); 857struct request_queue *blk_alloc_queue_node(gfp_t, int);
858extern void blk_put_queue(struct request_queue *); 858extern void blk_put_queue(struct request_queue *);
859 859
860/*
861 * Note: Code in between changing the blk_plug list/cb_list or element of such
862 * lists is preemptable, but such code can't do sleep (or be very careful),
863 * otherwise data is corrupted. For details, please check schedule() where
864 * blk_schedule_flush_plug() is called.
865 */
860struct blk_plug { 866struct blk_plug {
861 unsigned long magic; 867 unsigned long magic;
862 struct list_head list; 868 struct list_head list;
863 struct list_head cb_list; 869 struct list_head cb_list;
864 unsigned int should_sort; 870 unsigned int should_sort;
871 unsigned int count;
865}; 872};
873#define BLK_MAX_REQUEST_COUNT 16
874
866struct blk_plug_cb { 875struct blk_plug_cb {
867 struct list_head list; 876 struct list_head list;
868 void (*callback)(struct blk_plug_cb *); 877 void (*callback)(struct blk_plug_cb *);
diff --git a/include/linux/blktrace_api.h b/include/linux/blktrace_api.h
index b22fb0d3db0f..8c7c2de7631a 100644
--- a/include/linux/blktrace_api.h
+++ b/include/linux/blktrace_api.h
@@ -169,7 +169,8 @@ extern void blk_trace_shutdown(struct request_queue *);
169extern int do_blk_trace_setup(struct request_queue *q, char *name, 169extern int do_blk_trace_setup(struct request_queue *q, char *name,
170 dev_t dev, struct block_device *bdev, 170 dev_t dev, struct block_device *bdev,
171 struct blk_user_trace_setup *buts); 171 struct blk_user_trace_setup *buts);
172extern void __trace_note_message(struct blk_trace *, const char *fmt, ...); 172extern __attribute__((format(printf, 2, 3)))
173void __trace_note_message(struct blk_trace *, const char *fmt, ...);
173 174
174/** 175/**
175 * blk_add_trace_msg - Add a (simple) message to the blktrace stream 176 * blk_add_trace_msg - Add a (simple) message to the blktrace stream
diff --git a/include/linux/ceph/libceph.h b/include/linux/ceph/libceph.h
index 6365f041745b..563755181c1e 100644
--- a/include/linux/ceph/libceph.h
+++ b/include/linux/ceph/libceph.h
@@ -35,7 +35,7 @@
35#define CEPH_OPT_MYIP (1<<2) /* specified my ip */ 35#define CEPH_OPT_MYIP (1<<2) /* specified my ip */
36#define CEPH_OPT_NOCRC (1<<3) /* no data crc on writes */ 36#define CEPH_OPT_NOCRC (1<<3) /* no data crc on writes */
37 37
38#define CEPH_OPT_DEFAULT (0); 38#define CEPH_OPT_DEFAULT (0)
39 39
40#define ceph_set_opt(client, opt) \ 40#define ceph_set_opt(client, opt) \
41 (client)->options->flags |= CEPH_OPT_##opt; 41 (client)->options->flags |= CEPH_OPT_##opt;
diff --git a/include/linux/cgroup.h b/include/linux/cgroup.h
index ab4ac0ccb857..da7e4bc34e8c 100644
--- a/include/linux/cgroup.h
+++ b/include/linux/cgroup.h
@@ -539,7 +539,6 @@ static inline struct cgroup_subsys_state *cgroup_subsys_state(
539 */ 539 */
540#define task_subsys_state_check(task, subsys_id, __c) \ 540#define task_subsys_state_check(task, subsys_id, __c) \
541 rcu_dereference_check(task->cgroups->subsys[subsys_id], \ 541 rcu_dereference_check(task->cgroups->subsys[subsys_id], \
542 rcu_read_lock_held() || \
543 lockdep_is_held(&task->alloc_lock) || \ 542 lockdep_is_held(&task->alloc_lock) || \
544 cgroup_lock_is_held() || (__c)) 543 cgroup_lock_is_held() || (__c))
545 544
diff --git a/include/linux/clocksource.h b/include/linux/clocksource.h
index d4646b48dc4a..139c4db55f17 100644
--- a/include/linux/clocksource.h
+++ b/include/linux/clocksource.h
@@ -22,6 +22,10 @@
22typedef u64 cycle_t; 22typedef u64 cycle_t;
23struct clocksource; 23struct clocksource;
24 24
25#ifdef CONFIG_ARCH_CLOCKSOURCE_DATA
26#include <asm/clocksource.h>
27#endif
28
25/** 29/**
26 * struct cyclecounter - hardware abstraction for a free running counter 30 * struct cyclecounter - hardware abstraction for a free running counter
27 * Provides completely state-free accessors to the underlying hardware. 31 * Provides completely state-free accessors to the underlying hardware.
@@ -153,7 +157,7 @@ extern u64 timecounter_cyc2time(struct timecounter *tc,
153 * @shift: cycle to nanosecond divisor (power of two) 157 * @shift: cycle to nanosecond divisor (power of two)
154 * @max_idle_ns: max idle time permitted by the clocksource (nsecs) 158 * @max_idle_ns: max idle time permitted by the clocksource (nsecs)
155 * @flags: flags describing special properties 159 * @flags: flags describing special properties
156 * @vread: vsyscall based read 160 * @archdata: arch-specific data
157 * @suspend: suspend function for the clocksource, if necessary 161 * @suspend: suspend function for the clocksource, if necessary
158 * @resume: resume function for the clocksource, if necessary 162 * @resume: resume function for the clocksource, if necessary
159 */ 163 */
@@ -169,16 +173,13 @@ struct clocksource {
169 u32 shift; 173 u32 shift;
170 u64 max_idle_ns; 174 u64 max_idle_ns;
171 175
172#ifdef CONFIG_IA64 176#ifdef CONFIG_ARCH_CLOCKSOURCE_DATA
173 void *fsys_mmio; /* used by fsyscall asm code */ 177 struct arch_clocksource_data archdata;
174#define CLKSRC_FSYS_MMIO_SET(mmio, addr) ((mmio) = (addr))
175#else
176#define CLKSRC_FSYS_MMIO_SET(mmio, addr) do { } while (0)
177#endif 178#endif
179
178 const char *name; 180 const char *name;
179 struct list_head list; 181 struct list_head list;
180 int rating; 182 int rating;
181 cycle_t (*vread)(void);
182 int (*enable)(struct clocksource *cs); 183 int (*enable)(struct clocksource *cs);
183 void (*disable)(struct clocksource *cs); 184 void (*disable)(struct clocksource *cs);
184 unsigned long flags; 185 unsigned long flags;
@@ -188,6 +189,7 @@ struct clocksource {
188#ifdef CONFIG_CLOCKSOURCE_WATCHDOG 189#ifdef CONFIG_CLOCKSOURCE_WATCHDOG
189 /* Watchdog related data, used by the framework */ 190 /* Watchdog related data, used by the framework */
190 struct list_head wd_list; 191 struct list_head wd_list;
192 cycle_t cs_last;
191 cycle_t wd_last; 193 cycle_t wd_last;
192#endif 194#endif
193} ____cacheline_aligned; 195} ____cacheline_aligned;
diff --git a/include/linux/cn_proc.h b/include/linux/cn_proc.h
index 47dac5ea8d3a..12c517b51ca2 100644
--- a/include/linux/cn_proc.h
+++ b/include/linux/cn_proc.h
@@ -53,6 +53,7 @@ struct proc_event {
53 PROC_EVENT_UID = 0x00000004, 53 PROC_EVENT_UID = 0x00000004,
54 PROC_EVENT_GID = 0x00000040, 54 PROC_EVENT_GID = 0x00000040,
55 PROC_EVENT_SID = 0x00000080, 55 PROC_EVENT_SID = 0x00000080,
56 PROC_EVENT_PTRACE = 0x00000100,
56 /* "next" should be 0x00000400 */ 57 /* "next" should be 0x00000400 */
57 /* "last" is the last process event: exit */ 58 /* "last" is the last process event: exit */
58 PROC_EVENT_EXIT = 0x80000000 59 PROC_EVENT_EXIT = 0x80000000
@@ -95,6 +96,13 @@ struct proc_event {
95 __kernel_pid_t process_tgid; 96 __kernel_pid_t process_tgid;
96 } sid; 97 } sid;
97 98
99 struct ptrace_proc_event {
100 __kernel_pid_t process_pid;
101 __kernel_pid_t process_tgid;
102 __kernel_pid_t tracer_pid;
103 __kernel_pid_t tracer_tgid;
104 } ptrace;
105
98 struct exit_proc_event { 106 struct exit_proc_event {
99 __kernel_pid_t process_pid; 107 __kernel_pid_t process_pid;
100 __kernel_pid_t process_tgid; 108 __kernel_pid_t process_tgid;
@@ -109,6 +117,7 @@ void proc_fork_connector(struct task_struct *task);
109void proc_exec_connector(struct task_struct *task); 117void proc_exec_connector(struct task_struct *task);
110void proc_id_connector(struct task_struct *task, int which_id); 118void proc_id_connector(struct task_struct *task, int which_id);
111void proc_sid_connector(struct task_struct *task); 119void proc_sid_connector(struct task_struct *task);
120void proc_ptrace_connector(struct task_struct *task, int which_id);
112void proc_exit_connector(struct task_struct *task); 121void proc_exit_connector(struct task_struct *task);
113#else 122#else
114static inline void proc_fork_connector(struct task_struct *task) 123static inline void proc_fork_connector(struct task_struct *task)
@@ -124,6 +133,10 @@ static inline void proc_id_connector(struct task_struct *task,
124static inline void proc_sid_connector(struct task_struct *task) 133static inline void proc_sid_connector(struct task_struct *task)
125{} 134{}
126 135
136static inline void proc_ptrace_connector(struct task_struct *task,
137 int ptrace_id)
138{}
139
127static inline void proc_exit_connector(struct task_struct *task) 140static inline void proc_exit_connector(struct task_struct *task)
128{} 141{}
129#endif /* CONFIG_PROC_EVENTS */ 142#endif /* CONFIG_PROC_EVENTS */
diff --git a/include/linux/compat.h b/include/linux/compat.h
index ddcb7db38e67..8779405e15a8 100644
--- a/include/linux/compat.h
+++ b/include/linux/compat.h
@@ -438,16 +438,7 @@ asmlinkage long compat_sys_ppoll(struct pollfd __user *ufds,
438 struct compat_timespec __user *tsp, 438 struct compat_timespec __user *tsp,
439 const compat_sigset_t __user *sigmask, 439 const compat_sigset_t __user *sigmask,
440 compat_size_t sigsetsize); 440 compat_size_t sigsetsize);
441#if (defined(CONFIG_NFSD) || defined(CONFIG_NFSD_MODULE)) && \
442 !defined(CONFIG_NFSD_DEPRECATED)
443union compat_nfsctl_res;
444struct compat_nfsctl_arg;
445asmlinkage long compat_sys_nfsservctl(int cmd,
446 struct compat_nfsctl_arg __user *arg,
447 union compat_nfsctl_res __user *res);
448#else
449asmlinkage long compat_sys_nfsservctl(int cmd, void *notused, void *notused2); 441asmlinkage long compat_sys_nfsservctl(int cmd, void *notused, void *notused2);
450#endif
451asmlinkage long compat_sys_signalfd4(int ufd, 442asmlinkage long compat_sys_signalfd4(int ufd,
452 const compat_sigset_t __user *sigmask, 443 const compat_sigset_t __user *sigmask,
453 compat_size_t sigsetsize, int flags); 444 compat_size_t sigsetsize, int flags);
@@ -467,6 +458,8 @@ asmlinkage long compat_sys_setsockopt(int fd, int level, int optname,
467 char __user *optval, unsigned int optlen); 458 char __user *optval, unsigned int optlen);
468asmlinkage long compat_sys_sendmsg(int fd, struct compat_msghdr __user *msg, 459asmlinkage long compat_sys_sendmsg(int fd, struct compat_msghdr __user *msg,
469 unsigned flags); 460 unsigned flags);
461asmlinkage long compat_sys_sendmmsg(int fd, struct compat_mmsghdr __user *mmsg,
462 unsigned vlen, unsigned int flags);
470asmlinkage long compat_sys_recvmsg(int fd, struct compat_msghdr __user *msg, 463asmlinkage long compat_sys_recvmsg(int fd, struct compat_msghdr __user *msg,
471 unsigned int flags); 464 unsigned int flags);
472asmlinkage long compat_sys_recv(int fd, void __user *buf, size_t len, 465asmlinkage long compat_sys_recv(int fd, void __user *buf, size_t len,
diff --git a/include/linux/connector.h b/include/linux/connector.h
index 7c60d0942adb..f696bccd48cb 100644
--- a/include/linux/connector.h
+++ b/include/linux/connector.h
@@ -44,7 +44,7 @@
44#define CN_VAL_DRBD 0x1 44#define CN_VAL_DRBD 0x1
45#define CN_KVP_IDX 0x9 /* HyperV KVP */ 45#define CN_KVP_IDX 0x9 /* HyperV KVP */
46 46
47#define CN_NETLINK_USERS 9 47#define CN_NETLINK_USERS 10 /* Highest index + 1 */
48 48
49/* 49/*
50 * Maximum connector's message size. 50 * Maximum connector's message size.
diff --git a/include/linux/cordic.h b/include/linux/cordic.h
new file mode 100644
index 000000000000..f932093e20c2
--- /dev/null
+++ b/include/linux/cordic.h
@@ -0,0 +1,48 @@
1/*
2 * Copyright (c) 2011 Broadcom Corporation
3 *
4 * Permission to use, copy, modify, and/or distribute this software for any
5 * purpose with or without fee is hereby granted, provided that the above
6 * copyright notice and this permission notice appear in all copies.
7 *
8 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
9 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
10 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
11 * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
12 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
13 * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
14 * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
15 */
16#ifndef __CORDIC_H_
17#define __CORDIC_H_
18
19#include <linux/types.h>
20
21/**
22 * struct cordic_iq - i/q coordinate.
23 *
24 * @i: real part of coordinate (in phase).
25 * @q: imaginary part of coordinate (quadrature).
26 */
27struct cordic_iq {
28 s32 i;
29 s32 q;
30};
31
32/**
33 * cordic_calc_iq() - calculates the i/q coordinate for given angle.
34 *
35 * @theta: angle in degrees for which i/q coordinate is to be calculated.
36 * @coord: function output parameter holding the i/q coordinate.
37 *
38 * The function calculates the i/q coordinate for a given angle using
39 * cordic algorithm. The coordinate consists of a real (i) and an
40 * imaginary (q) part. The real part is essentially the cosine of the
41 * angle and the imaginary part is the sine of the angle. The returned
42 * values are scaled by 2^16 for precision. The range for theta is
43 * for -180 degrees to +180 degrees. Passed values outside this range are
44 * converted before doing the actual calculation.
45 */
46struct cordic_iq cordic_calc_iq(s32 theta);
47
48#endif /* __CORDIC_H_ */
diff --git a/include/linux/cpu.h b/include/linux/cpu.h
index 5f09323ee880..b1a635acf72a 100644
--- a/include/linux/cpu.h
+++ b/include/linux/cpu.h
@@ -70,6 +70,39 @@ enum {
70 CPU_PRI_WORKQUEUE = 5, 70 CPU_PRI_WORKQUEUE = 5,
71}; 71};
72 72
73#define CPU_ONLINE 0x0002 /* CPU (unsigned)v is up */
74#define CPU_UP_PREPARE 0x0003 /* CPU (unsigned)v coming up */
75#define CPU_UP_CANCELED 0x0004 /* CPU (unsigned)v NOT coming up */
76#define CPU_DOWN_PREPARE 0x0005 /* CPU (unsigned)v going down */
77#define CPU_DOWN_FAILED 0x0006 /* CPU (unsigned)v NOT going down */
78#define CPU_DEAD 0x0007 /* CPU (unsigned)v dead */
79#define CPU_DYING 0x0008 /* CPU (unsigned)v not running any task,
80 * not handling interrupts, soon dead.
81 * Called on the dying cpu, interrupts
82 * are already disabled. Must not
83 * sleep, must not fail */
84#define CPU_POST_DEAD 0x0009 /* CPU (unsigned)v dead, cpu_hotplug
85 * lock is dropped */
86#define CPU_STARTING 0x000A /* CPU (unsigned)v soon running.
87 * Called on the new cpu, just before
88 * enabling interrupts. Must not sleep,
89 * must not fail */
90
91/* Used for CPU hotplug events occurring while tasks are frozen due to a suspend
92 * operation in progress
93 */
94#define CPU_TASKS_FROZEN 0x0010
95
96#define CPU_ONLINE_FROZEN (CPU_ONLINE | CPU_TASKS_FROZEN)
97#define CPU_UP_PREPARE_FROZEN (CPU_UP_PREPARE | CPU_TASKS_FROZEN)
98#define CPU_UP_CANCELED_FROZEN (CPU_UP_CANCELED | CPU_TASKS_FROZEN)
99#define CPU_DOWN_PREPARE_FROZEN (CPU_DOWN_PREPARE | CPU_TASKS_FROZEN)
100#define CPU_DOWN_FAILED_FROZEN (CPU_DOWN_FAILED | CPU_TASKS_FROZEN)
101#define CPU_DEAD_FROZEN (CPU_DEAD | CPU_TASKS_FROZEN)
102#define CPU_DYING_FROZEN (CPU_DYING | CPU_TASKS_FROZEN)
103#define CPU_STARTING_FROZEN (CPU_STARTING | CPU_TASKS_FROZEN)
104
105
73#ifdef CONFIG_SMP 106#ifdef CONFIG_SMP
74/* Need to know about CPUs going up/down? */ 107/* Need to know about CPUs going up/down? */
75#if defined(CONFIG_HOTPLUG_CPU) || !defined(MODULE) 108#if defined(CONFIG_HOTPLUG_CPU) || !defined(MODULE)
diff --git a/include/linux/crc8.h b/include/linux/crc8.h
new file mode 100644
index 000000000000..13c8dabb0441
--- /dev/null
+++ b/include/linux/crc8.h
@@ -0,0 +1,101 @@
1/*
2 * Copyright (c) 2011 Broadcom Corporation
3 *
4 * Permission to use, copy, modify, and/or distribute this software for any
5 * purpose with or without fee is hereby granted, provided that the above
6 * copyright notice and this permission notice appear in all copies.
7 *
8 * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
9 * WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
10 * MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
11 * SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
12 * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
13 * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
14 * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
15 */
16#ifndef __CRC8_H_
17#define __CRC8_H_
18
19#include <linux/types.h>
20
21/* see usage of this value in crc8() description */
22#define CRC8_INIT_VALUE 0xFF
23
24/*
25 * Return value of crc8() indicating valid message+crc. This is true
26 * if a CRC is inverted before transmission. The CRC computed over the
27 * whole received bitstream is _table[x], where x is the bit pattern
28 * of the modification (almost always 0xff).
29 */
30#define CRC8_GOOD_VALUE(_table) (_table[0xFF])
31
32/* required table size for crc8 algorithm */
33#define CRC8_TABLE_SIZE 256
34
35/* helper macro assuring right table size is used */
36#define DECLARE_CRC8_TABLE(_table) \
37 static u8 _table[CRC8_TABLE_SIZE]
38
39/**
40 * crc8_populate_lsb - fill crc table for given polynomial in regular bit order.
41 *
42 * @table: table to be filled.
43 * @polynomial: polynomial for which table is to be filled.
44 *
45 * This function fills the provided table according the polynomial provided for
46 * regular bit order (lsb first). Polynomials in CRC algorithms are typically
47 * represented as shown below.
48 *
49 * poly = x^8 + x^7 + x^6 + x^4 + x^2 + 1
50 *
51 * For lsb first direction x^7 maps to the lsb. So the polynomial is as below.
52 *
53 * - lsb first: poly = 10101011(1) = 0xAB
54 */
55void crc8_populate_lsb(u8 table[CRC8_TABLE_SIZE], u8 polynomial);
56
57/**
58 * crc8_populate_msb - fill crc table for given polynomial in reverse bit order.
59 *
60 * @table: table to be filled.
61 * @polynomial: polynomial for which table is to be filled.
62 *
63 * This function fills the provided table according the polynomial provided for
64 * reverse bit order (msb first). Polynomials in CRC algorithms are typically
65 * represented as shown below.
66 *
67 * poly = x^8 + x^7 + x^6 + x^4 + x^2 + 1
68 *
69 * For msb first direction x^7 maps to the msb. So the polynomial is as below.
70 *
71 * - msb first: poly = (1)11010101 = 0xD5
72 */
73void crc8_populate_msb(u8 table[CRC8_TABLE_SIZE], u8 polynomial);
74
75/**
76 * crc8() - calculate a crc8 over the given input data.
77 *
78 * @table: crc table used for calculation.
79 * @pdata: pointer to data buffer.
80 * @nbytes: number of bytes in data buffer.
81 * @crc: previous returned crc8 value.
82 *
83 * The CRC8 is calculated using the polynomial given in crc8_populate_msb()
84 * or crc8_populate_lsb().
85 *
86 * The caller provides the initial value (either %CRC8_INIT_VALUE
87 * or the previous returned value) to allow for processing of
88 * discontiguous blocks of data. When generating the CRC the
89 * caller is responsible for complementing the final return value
90 * and inserting it into the byte stream. When validating a byte
91 * stream (including CRC8), a final return value of %CRC8_GOOD_VALUE
92 * indicates the byte stream data can be considered valid.
93 *
94 * Reference:
95 * "A Painless Guide to CRC Error Detection Algorithms", ver 3, Aug 1993
96 * Williams, Ross N., ross<at>ross.net
97 * (see URL http://www.ross.net/crc/download/crc_v3.txt).
98 */
99u8 crc8(const u8 table[CRC8_TABLE_SIZE], u8 *pdata, size_t nbytes, u8 crc);
100
101#endif /* __CRC8_H_ */
diff --git a/include/linux/cred.h b/include/linux/cred.h
index 82607992f308..f240f2fa0197 100644
--- a/include/linux/cred.h
+++ b/include/linux/cred.h
@@ -284,7 +284,6 @@ static inline void put_cred(const struct cred *_cred)
284 ({ \ 284 ({ \
285 const struct task_struct *__t = (task); \ 285 const struct task_struct *__t = (task); \
286 rcu_dereference_check(__t->real_cred, \ 286 rcu_dereference_check(__t->real_cred, \
287 rcu_read_lock_held() || \
288 task_is_dead(__t)); \ 287 task_is_dead(__t)); \
289 }) 288 })
290 289
diff --git a/include/linux/ctype.h b/include/linux/ctype.h
index a3d6ee0044f9..8acfe312f947 100644
--- a/include/linux/ctype.h
+++ b/include/linux/ctype.h
@@ -52,4 +52,13 @@ static inline unsigned char __toupper(unsigned char c)
52#define tolower(c) __tolower(c) 52#define tolower(c) __tolower(c)
53#define toupper(c) __toupper(c) 53#define toupper(c) __toupper(c)
54 54
55/*
56 * Fast implementation of tolower() for internal usage. Do not use in your
57 * code.
58 */
59static inline char _tolower(const char c)
60{
61 return c | 0x20;
62}
63
55#endif 64#endif
diff --git a/include/linux/dcache.h b/include/linux/dcache.h
index 19d90a55541d..3f22d8d6d8a3 100644
--- a/include/linux/dcache.h
+++ b/include/linux/dcache.h
@@ -216,6 +216,7 @@ struct dentry_operations {
216#define DCACHE_MOUNTED 0x10000 /* is a mountpoint */ 216#define DCACHE_MOUNTED 0x10000 /* is a mountpoint */
217#define DCACHE_NEED_AUTOMOUNT 0x20000 /* handle automount on this dir */ 217#define DCACHE_NEED_AUTOMOUNT 0x20000 /* handle automount on this dir */
218#define DCACHE_MANAGE_TRANSIT 0x40000 /* manage transit from this dirent */ 218#define DCACHE_MANAGE_TRANSIT 0x40000 /* manage transit from this dirent */
219#define DCACHE_NEED_LOOKUP 0x80000 /* dentry requires i_op->lookup */
219#define DCACHE_MANAGED_DENTRY \ 220#define DCACHE_MANAGED_DENTRY \
220 (DCACHE_MOUNTED|DCACHE_NEED_AUTOMOUNT|DCACHE_MANAGE_TRANSIT) 221 (DCACHE_MOUNTED|DCACHE_NEED_AUTOMOUNT|DCACHE_MANAGE_TRANSIT)
221 222
@@ -416,7 +417,12 @@ static inline bool d_mountpoint(struct dentry *dentry)
416 return dentry->d_flags & DCACHE_MOUNTED; 417 return dentry->d_flags & DCACHE_MOUNTED;
417} 418}
418 419
419extern struct dentry *lookup_create(struct nameidata *nd, int is_dir); 420static inline bool d_need_lookup(struct dentry *dentry)
421{
422 return dentry->d_flags & DCACHE_NEED_LOOKUP;
423}
424
425extern void d_clear_need_lookup(struct dentry *dentry);
420 426
421extern int sysctl_vfs_cache_pressure; 427extern int sysctl_vfs_cache_pressure;
422 428
diff --git a/include/linux/dcbnl.h b/include/linux/dcbnl.h
index c52280047e2c..65a2562f66b4 100644
--- a/include/linux/dcbnl.h
+++ b/include/linux/dcbnl.h
@@ -203,6 +203,7 @@ struct dcbmsg {
203 * @DCB_CMD_GFEATCFG: get DCBX features flags 203 * @DCB_CMD_GFEATCFG: get DCBX features flags
204 * @DCB_CMD_SFEATCFG: set DCBX features negotiation flags 204 * @DCB_CMD_SFEATCFG: set DCBX features negotiation flags
205 * @DCB_CMD_CEE_GET: get CEE aggregated configuration 205 * @DCB_CMD_CEE_GET: get CEE aggregated configuration
206 * @DCB_CMD_IEEE_DEL: delete IEEE 802.1Qaz configuration
206 */ 207 */
207enum dcbnl_commands { 208enum dcbnl_commands {
208 DCB_CMD_UNDEFINED, 209 DCB_CMD_UNDEFINED,
@@ -246,6 +247,7 @@ enum dcbnl_commands {
246 DCB_CMD_SFEATCFG, 247 DCB_CMD_SFEATCFG,
247 248
248 DCB_CMD_CEE_GET, 249 DCB_CMD_CEE_GET,
250 DCB_CMD_IEEE_DEL,
249 251
250 __DCB_CMD_ENUM_MAX, 252 __DCB_CMD_ENUM_MAX,
251 DCB_CMD_MAX = __DCB_CMD_ENUM_MAX - 1, 253 DCB_CMD_MAX = __DCB_CMD_ENUM_MAX - 1,
@@ -331,18 +333,30 @@ enum ieee_attrs_app {
331#define DCB_ATTR_IEEE_APP_MAX (__DCB_ATTR_IEEE_APP_MAX - 1) 333#define DCB_ATTR_IEEE_APP_MAX (__DCB_ATTR_IEEE_APP_MAX - 1)
332 334
333/** 335/**
334 * enum cee_attrs - CEE DCBX get attributes 336 * enum cee_attrs - CEE DCBX get attributes.
335 * 337 *
336 * @DCB_ATTR_CEE_UNSPEC: unspecified 338 * @DCB_ATTR_CEE_UNSPEC: unspecified
337 * @DCB_ATTR_CEE_PEER_PG: peer PG configuration - get only 339 * @DCB_ATTR_CEE_PEER_PG: peer PG configuration - get only
338 * @DCB_ATTR_CEE_PEER_PFC: peer PFC configuration - get only 340 * @DCB_ATTR_CEE_PEER_PFC: peer PFC configuration - get only
339 * @DCB_ATTR_CEE_PEER_APP: peer APP tlv - get only 341 * @DCB_ATTR_CEE_PEER_APP_TABLE: peer APP tlv - get only
342 * @DCB_ATTR_CEE_TX_PG: TX PG configuration (DCB_CMD_PGTX_GCFG)
343 * @DCB_ATTR_CEE_RX_PG: RX PG configuration (DCB_CMD_PGRX_GCFG)
344 * @DCB_ATTR_CEE_PFC: PFC configuration (DCB_CMD_PFC_GCFG)
345 * @DCB_ATTR_CEE_APP_TABLE: APP configuration (multi DCB_CMD_GAPP)
346 * @DCB_ATTR_CEE_FEAT: DCBX features flags (DCB_CMD_GFEATCFG)
347 *
348 * An aggregated collection of the cee std negotiated parameters.
340 */ 349 */
341enum cee_attrs { 350enum cee_attrs {
342 DCB_ATTR_CEE_UNSPEC, 351 DCB_ATTR_CEE_UNSPEC,
343 DCB_ATTR_CEE_PEER_PG, 352 DCB_ATTR_CEE_PEER_PG,
344 DCB_ATTR_CEE_PEER_PFC, 353 DCB_ATTR_CEE_PEER_PFC,
345 DCB_ATTR_CEE_PEER_APP_TABLE, 354 DCB_ATTR_CEE_PEER_APP_TABLE,
355 DCB_ATTR_CEE_TX_PG,
356 DCB_ATTR_CEE_RX_PG,
357 DCB_ATTR_CEE_PFC,
358 DCB_ATTR_CEE_APP_TABLE,
359 DCB_ATTR_CEE_FEAT,
346 __DCB_ATTR_CEE_MAX 360 __DCB_ATTR_CEE_MAX
347}; 361};
348#define DCB_ATTR_CEE_MAX (__DCB_ATTR_CEE_MAX - 1) 362#define DCB_ATTR_CEE_MAX (__DCB_ATTR_CEE_MAX - 1)
@@ -355,6 +369,13 @@ enum peer_app_attr {
355}; 369};
356#define DCB_ATTR_CEE_PEER_APP_MAX (__DCB_ATTR_CEE_PEER_APP_MAX - 1) 370#define DCB_ATTR_CEE_PEER_APP_MAX (__DCB_ATTR_CEE_PEER_APP_MAX - 1)
357 371
372enum cee_attrs_app {
373 DCB_ATTR_CEE_APP_UNSPEC,
374 DCB_ATTR_CEE_APP,
375 __DCB_ATTR_CEE_APP_MAX
376};
377#define DCB_ATTR_CEE_APP_MAX (__DCB_ATTR_CEE_APP_MAX - 1)
378
358/** 379/**
359 * enum dcbnl_pfc_attrs - DCB Priority Flow Control user priority nested attrs 380 * enum dcbnl_pfc_attrs - DCB Priority Flow Control user priority nested attrs
360 * 381 *
diff --git a/include/linux/dccp.h b/include/linux/dccp.h
index d638e85dc501..710c04302a15 100644
--- a/include/linux/dccp.h
+++ b/include/linux/dccp.h
@@ -236,6 +236,7 @@ enum dccp_packet_dequeueing_policy {
236#ifdef __KERNEL__ 236#ifdef __KERNEL__
237 237
238#include <linux/in.h> 238#include <linux/in.h>
239#include <linux/interrupt.h>
239#include <linux/ktime.h> 240#include <linux/ktime.h>
240#include <linux/list.h> 241#include <linux/list.h>
241#include <linux/uio.h> 242#include <linux/uio.h>
diff --git a/include/linux/device.h b/include/linux/device.h
index c66111affca9..160d4ddb2499 100644
--- a/include/linux/device.h
+++ b/include/linux/device.h
@@ -516,7 +516,7 @@ struct device_dma_parameters {
516 * minimizes board-specific #ifdefs in drivers. 516 * minimizes board-specific #ifdefs in drivers.
517 * @power: For device power management. 517 * @power: For device power management.
518 * See Documentation/power/devices.txt for details. 518 * See Documentation/power/devices.txt for details.
519 * @pwr_domain: Provide callbacks that are executed during system suspend, 519 * @pm_domain: Provide callbacks that are executed during system suspend,
520 * hibernation, system resume and during runtime PM transitions 520 * hibernation, system resume and during runtime PM transitions
521 * along with subsystem-level and driver-level callbacks. 521 * along with subsystem-level and driver-level callbacks.
522 * @numa_node: NUMA node this device is close to. 522 * @numa_node: NUMA node this device is close to.
@@ -530,7 +530,6 @@ struct device_dma_parameters {
530 * @dma_mem: Internal for coherent mem override. 530 * @dma_mem: Internal for coherent mem override.
531 * @archdata: For arch-specific additions. 531 * @archdata: For arch-specific additions.
532 * @of_node: Associated device tree node. 532 * @of_node: Associated device tree node.
533 * @of_match: Matching of_device_id from driver.
534 * @devt: For creating the sysfs "dev". 533 * @devt: For creating the sysfs "dev".
535 * @devres_lock: Spinlock to protect the resource of the device. 534 * @devres_lock: Spinlock to protect the resource of the device.
536 * @devres_head: The resources list of the device. 535 * @devres_head: The resources list of the device.
@@ -568,7 +567,7 @@ struct device {
568 void *platform_data; /* Platform specific data, device 567 void *platform_data; /* Platform specific data, device
569 core doesn't touch it */ 568 core doesn't touch it */
570 struct dev_pm_info power; 569 struct dev_pm_info power;
571 struct dev_power_domain *pwr_domain; 570 struct dev_pm_domain *pm_domain;
572 571
573#ifdef CONFIG_NUMA 572#ifdef CONFIG_NUMA
574 int numa_node; /* NUMA node this device is close to */ 573 int numa_node; /* NUMA node this device is close to */
@@ -654,13 +653,13 @@ static inline int device_is_registered(struct device *dev)
654 653
655static inline void device_enable_async_suspend(struct device *dev) 654static inline void device_enable_async_suspend(struct device *dev)
656{ 655{
657 if (!dev->power.in_suspend) 656 if (!dev->power.is_prepared)
658 dev->power.async_suspend = true; 657 dev->power.async_suspend = true;
659} 658}
660 659
661static inline void device_disable_async_suspend(struct device *dev) 660static inline void device_disable_async_suspend(struct device *dev)
662{ 661{
663 if (!dev->power.in_suspend) 662 if (!dev->power.is_prepared)
664 dev->power.async_suspend = false; 663 dev->power.async_suspend = false;
665} 664}
666 665
diff --git a/include/linux/device_cgroup.h b/include/linux/device_cgroup.h
index 0b0d9c39ed67..7aad1f440867 100644
--- a/include/linux/device_cgroup.h
+++ b/include/linux/device_cgroup.h
@@ -2,8 +2,16 @@
2#include <linux/fs.h> 2#include <linux/fs.h>
3 3
4#ifdef CONFIG_CGROUP_DEVICE 4#ifdef CONFIG_CGROUP_DEVICE
5extern int devcgroup_inode_permission(struct inode *inode, int mask); 5extern int __devcgroup_inode_permission(struct inode *inode, int mask);
6extern int devcgroup_inode_mknod(int mode, dev_t dev); 6extern int devcgroup_inode_mknod(int mode, dev_t dev);
7static inline int devcgroup_inode_permission(struct inode *inode, int mask)
8{
9 if (likely(!inode->i_rdev))
10 return 0;
11 if (!S_ISBLK(inode->i_mode) && !S_ISCHR(inode->i_mode))
12 return 0;
13 return __devcgroup_inode_permission(inode, mask);
14}
7#else 15#else
8static inline int devcgroup_inode_permission(struct inode *inode, int mask) 16static inline int devcgroup_inode_permission(struct inode *inode, int mask)
9{ return 0; } 17{ return 0; }
diff --git a/include/linux/dio.h b/include/linux/dio.h
index b2dd31ca1710..2cc0fd00463f 100644
--- a/include/linux/dio.h
+++ b/include/linux/dio.h
@@ -254,7 +254,7 @@ static inline struct dio_driver *dio_dev_driver(const struct dio_dev *d)
254 254
255#define dio_resource_start(d) ((d)->resource.start) 255#define dio_resource_start(d) ((d)->resource.start)
256#define dio_resource_end(d) ((d)->resource.end) 256#define dio_resource_end(d) ((d)->resource.end)
257#define dio_resource_len(d) ((d)->resource.end-(d)->resource.start+1) 257#define dio_resource_len(d) (resource_size(&(d)->resource))
258#define dio_resource_flags(d) ((d)->resource.flags) 258#define dio_resource_flags(d) ((d)->resource.flags)
259 259
260#define dio_request_device(d, name) \ 260#define dio_request_device(d, name) \
diff --git a/include/linux/dma-direction.h b/include/linux/dma-direction.h
new file mode 100644
index 000000000000..95b6a82f5951
--- /dev/null
+++ b/include/linux/dma-direction.h
@@ -0,0 +1,13 @@
1#ifndef _LINUX_DMA_DIRECTION_H
2#define _LINUX_DMA_DIRECTION_H
3/*
4 * These definitions mirror those in pci.h, so they can be used
5 * interchangeably with their PCI_ counterparts.
6 */
7enum dma_data_direction {
8 DMA_BIDIRECTIONAL = 0,
9 DMA_TO_DEVICE = 1,
10 DMA_FROM_DEVICE = 2,
11 DMA_NONE = 3,
12};
13#endif
diff --git a/include/linux/dma-mapping.h b/include/linux/dma-mapping.h
index ba8319ae5fcc..1a167c48d84d 100644
--- a/include/linux/dma-mapping.h
+++ b/include/linux/dma-mapping.h
@@ -4,17 +4,9 @@
4#include <linux/device.h> 4#include <linux/device.h>
5#include <linux/err.h> 5#include <linux/err.h>
6#include <linux/dma-attrs.h> 6#include <linux/dma-attrs.h>
7#include <linux/dma-direction.h>
7#include <linux/scatterlist.h> 8#include <linux/scatterlist.h>
8 9
9/* These definitions mirror those in pci.h, so they can be used
10 * interchangeably with their PCI_ counterparts */
11enum dma_data_direction {
12 DMA_BIDIRECTIONAL = 0,
13 DMA_TO_DEVICE = 1,
14 DMA_FROM_DEVICE = 2,
15 DMA_NONE = 3,
16};
17
18struct dma_map_ops { 10struct dma_map_ops {
19 void* (*alloc_coherent)(struct device *dev, size_t size, 11 void* (*alloc_coherent)(struct device *dev, size_t size,
20 dma_addr_t *dma_handle, gfp_t gfp); 12 dma_addr_t *dma_handle, gfp_t gfp);
diff --git a/include/linux/dmaengine.h b/include/linux/dmaengine.h
index eee7addec282..8fbf40e0713c 100644
--- a/include/linux/dmaengine.h
+++ b/include/linux/dmaengine.h
@@ -23,7 +23,9 @@
23 23
24#include <linux/device.h> 24#include <linux/device.h>
25#include <linux/uio.h> 25#include <linux/uio.h>
26#include <linux/dma-mapping.h> 26#include <linux/dma-direction.h>
27
28struct scatterlist;
27 29
28/** 30/**
29 * typedef dma_cookie_t - an opaque DMA cookie 31 * typedef dma_cookie_t - an opaque DMA cookie
diff --git a/include/linux/drbd_limits.h b/include/linux/drbd_limits.h
index 246f576c981d..447c36752385 100644
--- a/include/linux/drbd_limits.h
+++ b/include/linux/drbd_limits.h
@@ -117,10 +117,10 @@
117/* drbdsetup XY resize -d Z 117/* drbdsetup XY resize -d Z
118 * you are free to reduce the device size to nothing, if you want to. 118 * you are free to reduce the device size to nothing, if you want to.
119 * the upper limit with 64bit kernel, enough ram and flexible meta data 119 * the upper limit with 64bit kernel, enough ram and flexible meta data
120 * is 16 TB, currently. */ 120 * is 1 PiB, currently. */
121/* DRBD_MAX_SECTORS */ 121/* DRBD_MAX_SECTORS */
122#define DRBD_DISK_SIZE_SECT_MIN 0 122#define DRBD_DISK_SIZE_SECT_MIN 0
123#define DRBD_DISK_SIZE_SECT_MAX (16 * (2LLU << 30)) 123#define DRBD_DISK_SIZE_SECT_MAX (1 * (2LLU << 40))
124#define DRBD_DISK_SIZE_SECT_DEF 0 /* = disabled = no user size... */ 124#define DRBD_DISK_SIZE_SECT_DEF 0 /* = disabled = no user size... */
125 125
126#define DRBD_ON_IO_ERROR_DEF EP_PASS_ON 126#define DRBD_ON_IO_ERROR_DEF EP_PASS_ON
diff --git a/include/linux/dw_apb_timer.h b/include/linux/dw_apb_timer.h
new file mode 100644
index 000000000000..49638ea3b776
--- /dev/null
+++ b/include/linux/dw_apb_timer.h
@@ -0,0 +1,56 @@
1/*
2 * (C) Copyright 2009 Intel Corporation
3 * Author: Jacob Pan (jacob.jun.pan@intel.com)
4 *
5 * Shared with ARM platforms, Jamie Iles, Picochip 2011
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
10 *
11 * Support for the Synopsys DesignWare APB Timers.
12 */
13#ifndef __DW_APB_TIMER_H__
14#define __DW_APB_TIMER_H__
15
16#include <linux/clockchips.h>
17#include <linux/clocksource.h>
18#include <linux/interrupt.h>
19
20#define APBTMRS_REG_SIZE 0x14
21
22struct dw_apb_timer {
23 void __iomem *base;
24 unsigned long freq;
25 int irq;
26};
27
28struct dw_apb_clock_event_device {
29 struct clock_event_device ced;
30 struct dw_apb_timer timer;
31 struct irqaction irqaction;
32 void (*eoi)(struct dw_apb_timer *);
33};
34
35struct dw_apb_clocksource {
36 struct dw_apb_timer timer;
37 struct clocksource cs;
38};
39
40void dw_apb_clockevent_register(struct dw_apb_clock_event_device *dw_ced);
41void dw_apb_clockevent_pause(struct dw_apb_clock_event_device *dw_ced);
42void dw_apb_clockevent_resume(struct dw_apb_clock_event_device *dw_ced);
43void dw_apb_clockevent_stop(struct dw_apb_clock_event_device *dw_ced);
44
45struct dw_apb_clock_event_device *
46dw_apb_clockevent_init(int cpu, const char *name, unsigned rating,
47 void __iomem *base, int irq, unsigned long freq);
48struct dw_apb_clocksource *
49dw_apb_clocksource_init(unsigned rating, char *name, void __iomem *base,
50 unsigned long freq);
51void dw_apb_clocksource_register(struct dw_apb_clocksource *dw_cs);
52void dw_apb_clocksource_start(struct dw_apb_clocksource *dw_cs);
53cycle_t dw_apb_clocksource_read(struct dw_apb_clocksource *dw_cs);
54void dw_apb_clocksource_unregister(struct dw_apb_clocksource *dw_cs);
55
56#endif /* __DW_APB_TIMER_H__ */
diff --git a/include/linux/eeprom_93xx46.h b/include/linux/eeprom_93xx46.h
new file mode 100644
index 000000000000..06791811e49d
--- /dev/null
+++ b/include/linux/eeprom_93xx46.h
@@ -0,0 +1,18 @@
1/*
2 * Module: eeprom_93xx46
3 * platform description for 93xx46 EEPROMs.
4 */
5
6struct eeprom_93xx46_platform_data {
7 unsigned char flags;
8#define EE_ADDR8 0x01 /* 8 bit addr. cfg */
9#define EE_ADDR16 0x02 /* 16 bit addr. cfg */
10#define EE_READONLY 0x08 /* forbid writing */
11
12 /*
13 * optional hooks to control additional logic
14 * before and after spi transfer.
15 */
16 void (*prepare)(void *);
17 void (*finish)(void *);
18};
diff --git a/include/linux/efi.h b/include/linux/efi.h
index e376270cd26e..ec2572693925 100644
--- a/include/linux/efi.h
+++ b/include/linux/efi.h
@@ -101,6 +101,13 @@ typedef struct {
101 u64 attribute; 101 u64 attribute;
102} efi_memory_desc_t; 102} efi_memory_desc_t;
103 103
104typedef struct {
105 efi_guid_t guid;
106 u32 headersize;
107 u32 flags;
108 u32 imagesize;
109} efi_capsule_header_t;
110
104typedef int (*efi_freemem_callback_t) (u64 start, u64 end, void *arg); 111typedef int (*efi_freemem_callback_t) (u64 start, u64 end, void *arg);
105 112
106/* 113/*
@@ -156,6 +163,9 @@ typedef struct {
156 unsigned long set_variable; 163 unsigned long set_variable;
157 unsigned long get_next_high_mono_count; 164 unsigned long get_next_high_mono_count;
158 unsigned long reset_system; 165 unsigned long reset_system;
166 unsigned long update_capsule;
167 unsigned long query_capsule_caps;
168 unsigned long query_variable_info;
159} efi_runtime_services_t; 169} efi_runtime_services_t;
160 170
161typedef efi_status_t efi_get_time_t (efi_time_t *tm, efi_time_cap_t *tc); 171typedef efi_status_t efi_get_time_t (efi_time_t *tm, efi_time_cap_t *tc);
@@ -168,7 +178,7 @@ typedef efi_status_t efi_get_variable_t (efi_char16_t *name, efi_guid_t *vendor,
168typedef efi_status_t efi_get_next_variable_t (unsigned long *name_size, efi_char16_t *name, 178typedef efi_status_t efi_get_next_variable_t (unsigned long *name_size, efi_char16_t *name,
169 efi_guid_t *vendor); 179 efi_guid_t *vendor);
170typedef efi_status_t efi_set_variable_t (efi_char16_t *name, efi_guid_t *vendor, 180typedef efi_status_t efi_set_variable_t (efi_char16_t *name, efi_guid_t *vendor,
171 unsigned long attr, unsigned long data_size, 181 u32 attr, unsigned long data_size,
172 void *data); 182 void *data);
173typedef efi_status_t efi_get_next_high_mono_count_t (u32 *count); 183typedef efi_status_t efi_get_next_high_mono_count_t (u32 *count);
174typedef void efi_reset_system_t (int reset_type, efi_status_t status, 184typedef void efi_reset_system_t (int reset_type, efi_status_t status,
@@ -177,6 +187,17 @@ typedef efi_status_t efi_set_virtual_address_map_t (unsigned long memory_map_siz
177 unsigned long descriptor_size, 187 unsigned long descriptor_size,
178 u32 descriptor_version, 188 u32 descriptor_version,
179 efi_memory_desc_t *virtual_map); 189 efi_memory_desc_t *virtual_map);
190typedef efi_status_t efi_query_variable_info_t(u32 attr,
191 u64 *storage_space,
192 u64 *remaining_space,
193 u64 *max_variable_size);
194typedef efi_status_t efi_update_capsule_t(efi_capsule_header_t **capsules,
195 unsigned long count,
196 unsigned long sg_list);
197typedef efi_status_t efi_query_capsule_caps_t(efi_capsule_header_t **capsules,
198 unsigned long count,
199 u64 *max_size,
200 int *reset_type);
180 201
181/* 202/*
182 * EFI Configuration Table and GUID definitions 203 * EFI Configuration Table and GUID definitions
@@ -218,6 +239,13 @@ typedef struct {
218 239
219#define EFI_SYSTEM_TABLE_SIGNATURE ((u64)0x5453595320494249ULL) 240#define EFI_SYSTEM_TABLE_SIGNATURE ((u64)0x5453595320494249ULL)
220 241
242#define EFI_2_30_SYSTEM_TABLE_REVISION ((2 << 16) | (30))
243#define EFI_2_20_SYSTEM_TABLE_REVISION ((2 << 16) | (20))
244#define EFI_2_10_SYSTEM_TABLE_REVISION ((2 << 16) | (10))
245#define EFI_2_00_SYSTEM_TABLE_REVISION ((2 << 16) | (00))
246#define EFI_1_10_SYSTEM_TABLE_REVISION ((1 << 16) | (10))
247#define EFI_1_02_SYSTEM_TABLE_REVISION ((1 << 16) | (02))
248
221typedef struct { 249typedef struct {
222 efi_table_hdr_t hdr; 250 efi_table_hdr_t hdr;
223 unsigned long fw_vendor; /* physical addr of CHAR16 vendor string */ 251 unsigned long fw_vendor; /* physical addr of CHAR16 vendor string */
@@ -250,6 +278,7 @@ struct efi_memory_map {
250 */ 278 */
251extern struct efi { 279extern struct efi {
252 efi_system_table_t *systab; /* EFI system table */ 280 efi_system_table_t *systab; /* EFI system table */
281 unsigned int runtime_version; /* Runtime services version */
253 unsigned long mps; /* MPS table */ 282 unsigned long mps; /* MPS table */
254 unsigned long acpi; /* ACPI table (IA64 ext 0.71) */ 283 unsigned long acpi; /* ACPI table (IA64 ext 0.71) */
255 unsigned long acpi20; /* ACPI table (ACPI 2.0) */ 284 unsigned long acpi20; /* ACPI table (ACPI 2.0) */
@@ -266,6 +295,9 @@ extern struct efi {
266 efi_get_variable_t *get_variable; 295 efi_get_variable_t *get_variable;
267 efi_get_next_variable_t *get_next_variable; 296 efi_get_next_variable_t *get_next_variable;
268 efi_set_variable_t *set_variable; 297 efi_set_variable_t *set_variable;
298 efi_query_variable_info_t *query_variable_info;
299 efi_update_capsule_t *update_capsule;
300 efi_query_capsule_caps_t *query_capsule_caps;
269 efi_get_next_high_mono_count_t *get_next_high_mono_count; 301 efi_get_next_high_mono_count_t *get_next_high_mono_count;
270 efi_reset_system_t *reset_system; 302 efi_reset_system_t *reset_system;
271 efi_set_virtual_address_map_t *set_virtual_address_map; 303 efi_set_virtual_address_map_t *set_virtual_address_map;
diff --git a/include/linux/elevator.h b/include/linux/elevator.h
index 21a8ebf2dc3a..d800d5142184 100644
--- a/include/linux/elevator.h
+++ b/include/linux/elevator.h
@@ -146,7 +146,7 @@ extern struct request *elv_rb_latter_request(struct request_queue *, struct requ
146/* 146/*
147 * rb support functions. 147 * rb support functions.
148 */ 148 */
149extern struct request *elv_rb_add(struct rb_root *, struct request *); 149extern void elv_rb_add(struct rb_root *, struct request *);
150extern void elv_rb_del(struct rb_root *, struct request *); 150extern void elv_rb_del(struct rb_root *, struct request *);
151extern struct request *elv_rb_find(struct rb_root *, sector_t); 151extern struct request *elv_rb_find(struct rb_root *, sector_t);
152 152
diff --git a/include/linux/etherdevice.h b/include/linux/etherdevice.h
index ab68f785fd19..05955cf09937 100644
--- a/include/linux/etherdevice.h
+++ b/include/linux/etherdevice.h
@@ -38,7 +38,7 @@ extern int eth_header(struct sk_buff *skb, struct net_device *dev,
38 const void *daddr, const void *saddr, unsigned len); 38 const void *daddr, const void *saddr, unsigned len);
39extern int eth_rebuild_header(struct sk_buff *skb); 39extern int eth_rebuild_header(struct sk_buff *skb);
40extern int eth_header_parse(const struct sk_buff *skb, unsigned char *haddr); 40extern int eth_header_parse(const struct sk_buff *skb, unsigned char *haddr);
41extern int eth_header_cache(const struct neighbour *neigh, struct hh_cache *hh); 41extern int eth_header_cache(const struct neighbour *neigh, struct hh_cache *hh, __be16 type);
42extern void eth_header_cache_update(struct hh_cache *hh, 42extern void eth_header_cache_update(struct hh_cache *hh,
43 const struct net_device *dev, 43 const struct net_device *dev,
44 const unsigned char *haddr); 44 const unsigned char *haddr);
diff --git a/include/linux/ethtool.h b/include/linux/ethtool.h
index c6a850ab2ec5..c6e427ab65fe 100644
--- a/include/linux/ethtool.h
+++ b/include/linux/ethtool.h
@@ -268,7 +268,7 @@ struct ethtool_pauseparam {
268 __u32 cmd; /* ETHTOOL_{G,S}PAUSEPARAM */ 268 __u32 cmd; /* ETHTOOL_{G,S}PAUSEPARAM */
269 269
270 /* If the link is being auto-negotiated (via ethtool_cmd.autoneg 270 /* If the link is being auto-negotiated (via ethtool_cmd.autoneg
271 * being true) the user may set 'autonet' here non-zero to have the 271 * being true) the user may set 'autoneg' here non-zero to have the
272 * pause parameters be auto-negotiated too. In such a case, the 272 * pause parameters be auto-negotiated too. In such a case, the
273 * {rx,tx}_pause values below determine what capabilities are 273 * {rx,tx}_pause values below determine what capabilities are
274 * advertised. 274 * advertised.
@@ -287,7 +287,7 @@ enum ethtool_stringset {
287 ETH_SS_TEST = 0, 287 ETH_SS_TEST = 0,
288 ETH_SS_STATS, 288 ETH_SS_STATS,
289 ETH_SS_PRIV_FLAGS, 289 ETH_SS_PRIV_FLAGS,
290 ETH_SS_NTUPLE_FILTERS, 290 ETH_SS_NTUPLE_FILTERS, /* Do not use, GRXNTUPLE is now deprecated */
291 ETH_SS_FEATURES, 291 ETH_SS_FEATURES,
292}; 292};
293 293
@@ -310,9 +310,21 @@ struct ethtool_sset_info {
310 __u32's, etc. */ 310 __u32's, etc. */
311}; 311};
312 312
313/**
314 * enum ethtool_test_flags - flags definition of ethtool_test
315 * @ETH_TEST_FL_OFFLINE: if set perform online and offline tests, otherwise
316 * only online tests.
317 * @ETH_TEST_FL_FAILED: Driver set this flag if test fails.
318 * @ETH_TEST_FL_EXTERNAL_LB: Application request to perform external loopback
319 * test.
320 * @ETH_TEST_FL_EXTERNAL_LB_DONE: Driver performed the external loopback test
321 */
322
313enum ethtool_test_flags { 323enum ethtool_test_flags {
314 ETH_TEST_FL_OFFLINE = (1 << 0), /* online / offline */ 324 ETH_TEST_FL_OFFLINE = (1 << 0),
315 ETH_TEST_FL_FAILED = (1 << 1), /* test passed / failed */ 325 ETH_TEST_FL_FAILED = (1 << 1),
326 ETH_TEST_FL_EXTERNAL_LB = (1 << 2),
327 ETH_TEST_FL_EXTERNAL_LB_DONE = (1 << 3),
316}; 328};
317 329
318/* for requesting NIC test and getting results*/ 330/* for requesting NIC test and getting results*/
@@ -714,18 +726,6 @@ enum ethtool_sfeatures_retval_bits {
714/* needed by dev_disable_lro() */ 726/* needed by dev_disable_lro() */
715extern int __ethtool_set_flags(struct net_device *dev, u32 flags); 727extern int __ethtool_set_flags(struct net_device *dev, u32 flags);
716 728
717struct ethtool_rx_ntuple_flow_spec_container {
718 struct ethtool_rx_ntuple_flow_spec fs;
719 struct list_head list;
720};
721
722struct ethtool_rx_ntuple_list {
723#define ETHTOOL_MAX_NTUPLE_LIST_ENTRY 1024
724#define ETHTOOL_MAX_NTUPLE_STRING_PER_ENTRY 14
725 struct list_head list;
726 unsigned int count;
727};
728
729/** 729/**
730 * enum ethtool_phys_id_state - indicator state for physical identification 730 * enum ethtool_phys_id_state - indicator state for physical identification
731 * @ETHTOOL_ID_INACTIVE: Physical ID indicator should be deactivated 731 * @ETHTOOL_ID_INACTIVE: Physical ID indicator should be deactivated
@@ -758,7 +758,6 @@ u32 ethtool_op_get_ufo(struct net_device *dev);
758int ethtool_op_set_ufo(struct net_device *dev, u32 data); 758int ethtool_op_set_ufo(struct net_device *dev, u32 data);
759u32 ethtool_op_get_flags(struct net_device *dev); 759u32 ethtool_op_get_flags(struct net_device *dev);
760int ethtool_op_set_flags(struct net_device *dev, u32 data, u32 supported); 760int ethtool_op_set_flags(struct net_device *dev, u32 data, u32 supported);
761void ethtool_ntuple_flush(struct net_device *dev);
762bool ethtool_invalid_flags(struct net_device *dev, u32 data, u32 supported); 761bool ethtool_invalid_flags(struct net_device *dev, u32 data, u32 supported);
763 762
764/** 763/**
@@ -811,7 +810,7 @@ bool ethtool_invalid_flags(struct net_device *dev, u32 data, u32 supported);
811 * @get_tx_csum: Deprecated as redundant. Report whether transmit checksums 810 * @get_tx_csum: Deprecated as redundant. Report whether transmit checksums
812 * are turned on or off. 811 * are turned on or off.
813 * @set_tx_csum: Deprecated in favour of generic netdev features. Turn 812 * @set_tx_csum: Deprecated in favour of generic netdev features. Turn
814 * transmit checksums on or off. Returns a egative error code or zero. 813 * transmit checksums on or off. Returns a negative error code or zero.
815 * @get_sg: Deprecated as redundant. Report whether scatter-gather is 814 * @get_sg: Deprecated as redundant. Report whether scatter-gather is
816 * enabled. 815 * enabled.
817 * @set_sg: Deprecated in favour of generic netdev features. Turn 816 * @set_sg: Deprecated in favour of generic netdev features. Turn
@@ -865,7 +864,6 @@ bool ethtool_invalid_flags(struct net_device *dev, u32 data, u32 supported);
865 * error code or zero. 864 * error code or zero.
866 * @set_rx_ntuple: Set an RX n-tuple rule. Returns a negative error code 865 * @set_rx_ntuple: Set an RX n-tuple rule. Returns a negative error code
867 * or zero. 866 * or zero.
868 * @get_rx_ntuple: Deprecated.
869 * @get_rxfh_indir: Get the contents of the RX flow hash indirection table. 867 * @get_rxfh_indir: Get the contents of the RX flow hash indirection table.
870 * Returns a negative error code or zero. 868 * Returns a negative error code or zero.
871 * @set_rxfh_indir: Set the contents of the RX flow hash indirection table. 869 * @set_rxfh_indir: Set the contents of the RX flow hash indirection table.
@@ -944,7 +942,6 @@ struct ethtool_ops {
944 int (*reset)(struct net_device *, u32 *); 942 int (*reset)(struct net_device *, u32 *);
945 int (*set_rx_ntuple)(struct net_device *, 943 int (*set_rx_ntuple)(struct net_device *,
946 struct ethtool_rx_ntuple *); 944 struct ethtool_rx_ntuple *);
947 int (*get_rx_ntuple)(struct net_device *, u32 stringset, void *);
948 int (*get_rxfh_indir)(struct net_device *, 945 int (*get_rxfh_indir)(struct net_device *,
949 struct ethtool_rxfh_indir *); 946 struct ethtool_rxfh_indir *);
950 int (*set_rxfh_indir)(struct net_device *, 947 int (*set_rxfh_indir)(struct net_device *,
@@ -1017,7 +1014,7 @@ struct ethtool_ops {
1017#define ETHTOOL_FLASHDEV 0x00000033 /* Flash firmware to device */ 1014#define ETHTOOL_FLASHDEV 0x00000033 /* Flash firmware to device */
1018#define ETHTOOL_RESET 0x00000034 /* Reset hardware */ 1015#define ETHTOOL_RESET 0x00000034 /* Reset hardware */
1019#define ETHTOOL_SRXNTUPLE 0x00000035 /* Add an n-tuple filter to device */ 1016#define ETHTOOL_SRXNTUPLE 0x00000035 /* Add an n-tuple filter to device */
1020#define ETHTOOL_GRXNTUPLE 0x00000036 /* Get n-tuple filters from device */ 1017#define ETHTOOL_GRXNTUPLE 0x00000036 /* deprecated */
1021#define ETHTOOL_GSSET_INFO 0x00000037 /* Get string set info */ 1018#define ETHTOOL_GSSET_INFO 0x00000037 /* Get string set info */
1022#define ETHTOOL_GRXFHINDIR 0x00000038 /* Get RX flow hash indir'n table */ 1019#define ETHTOOL_GRXFHINDIR 0x00000038 /* Get RX flow hash indir'n table */
1023#define ETHTOOL_SRXFHINDIR 0x00000039 /* Set RX flow hash indir'n table */ 1020#define ETHTOOL_SRXFHINDIR 0x00000039 /* Set RX flow hash indir'n table */
@@ -1087,7 +1084,7 @@ struct ethtool_ops {
1087/* The following are all involved in forcing a particular link 1084/* The following are all involved in forcing a particular link
1088 * mode for the device for setting things. When getting the 1085 * mode for the device for setting things. When getting the
1089 * devices settings, these indicate the current mode and whether 1086 * devices settings, these indicate the current mode and whether
1090 * it was foced up into this mode or autonegotiated. 1087 * it was forced up into this mode or autonegotiated.
1091 */ 1088 */
1092 1089
1093/* The forced speed, 10Mb, 100Mb, gigabit, 2.5Gb, 10GbE. */ 1090/* The forced speed, 10Mb, 100Mb, gigabit, 2.5Gb, 10GbE. */
diff --git a/include/linux/ext3_fs.h b/include/linux/ext3_fs.h
index 5e06acf95d0f..0c473fd79acb 100644
--- a/include/linux/ext3_fs.h
+++ b/include/linux/ext3_fs.h
@@ -877,7 +877,7 @@ extern int ext3_htree_store_dirent(struct file *dir_file, __u32 hash,
877extern void ext3_htree_free_dir_info(struct dir_private_info *p); 877extern void ext3_htree_free_dir_info(struct dir_private_info *p);
878 878
879/* fsync.c */ 879/* fsync.c */
880extern int ext3_sync_file(struct file *, int); 880extern int ext3_sync_file(struct file *, loff_t, loff_t, int);
881 881
882/* hash.c */ 882/* hash.c */
883extern int ext3fs_dirhash(const char *name, int len, struct 883extern int ext3fs_dirhash(const char *name, int len, struct
diff --git a/include/linux/fb.h b/include/linux/fb.h
index 6a8274877171..1d6836c498dd 100644
--- a/include/linux/fb.h
+++ b/include/linux/fb.h
@@ -1043,7 +1043,8 @@ extern void fb_deferred_io_open(struct fb_info *info,
1043 struct inode *inode, 1043 struct inode *inode,
1044 struct file *file); 1044 struct file *file);
1045extern void fb_deferred_io_cleanup(struct fb_info *info); 1045extern void fb_deferred_io_cleanup(struct fb_info *info);
1046extern int fb_deferred_io_fsync(struct file *file, int datasync); 1046extern int fb_deferred_io_fsync(struct file *file, loff_t start,
1047 loff_t end, int datasync);
1047 1048
1048static inline bool fb_be_math(struct fb_info *info) 1049static inline bool fb_be_math(struct fb_info *info)
1049{ 1050{
diff --git a/include/linux/fd.h b/include/linux/fd.h
index f5d194af07a8..72202b1b9a6a 100644
--- a/include/linux/fd.h
+++ b/include/linux/fd.h
@@ -377,4 +377,26 @@ struct floppy_raw_cmd {
377#define FDEJECT _IO(2, 0x5a) 377#define FDEJECT _IO(2, 0x5a)
378/* eject the disk */ 378/* eject the disk */
379 379
380
381#ifdef __KERNEL__
382#ifdef CONFIG_COMPAT
383#include <linux/compat.h>
384
385struct compat_floppy_struct {
386 compat_uint_t size;
387 compat_uint_t sect;
388 compat_uint_t head;
389 compat_uint_t track;
390 compat_uint_t stretch;
391 unsigned char gap;
392 unsigned char rate;
393 unsigned char spec1;
394 unsigned char fmt_gap;
395 const compat_caddr_t name;
396};
397
398#define FDGETPRM32 _IOR(2, 0x04, struct compat_floppy_struct)
399#endif
400#endif
401
380#endif 402#endif
diff --git a/include/linux/fdtable.h b/include/linux/fdtable.h
index 133c0ba25e30..df7e3cf82e97 100644
--- a/include/linux/fdtable.h
+++ b/include/linux/fdtable.h
@@ -60,7 +60,6 @@ struct files_struct {
60 60
61#define rcu_dereference_check_fdtable(files, fdtfd) \ 61#define rcu_dereference_check_fdtable(files, fdtfd) \
62 (rcu_dereference_check((fdtfd), \ 62 (rcu_dereference_check((fdtfd), \
63 rcu_read_lock_held() || \
64 lockdep_is_held(&(files)->file_lock) || \ 63 lockdep_is_held(&(files)->file_lock) || \
65 atomic_read(&(files)->count) == 1 || \ 64 atomic_read(&(files)->count) == 1 || \
66 rcu_my_thread_group_empty())) 65 rcu_my_thread_group_empty()))
diff --git a/include/linux/firewire-cdev.h b/include/linux/firewire-cdev.h
index 4ff09889c5c0..357dbfc2829e 100644
--- a/include/linux/firewire-cdev.h
+++ b/include/linux/firewire-cdev.h
@@ -30,10 +30,13 @@
30#include <linux/types.h> 30#include <linux/types.h>
31#include <linux/firewire-constants.h> 31#include <linux/firewire-constants.h>
32 32
33/* available since kernel version 2.6.22 */
33#define FW_CDEV_EVENT_BUS_RESET 0x00 34#define FW_CDEV_EVENT_BUS_RESET 0x00
34#define FW_CDEV_EVENT_RESPONSE 0x01 35#define FW_CDEV_EVENT_RESPONSE 0x01
35#define FW_CDEV_EVENT_REQUEST 0x02 36#define FW_CDEV_EVENT_REQUEST 0x02
36#define FW_CDEV_EVENT_ISO_INTERRUPT 0x03 37#define FW_CDEV_EVENT_ISO_INTERRUPT 0x03
38
39/* available since kernel version 2.6.30 */
37#define FW_CDEV_EVENT_ISO_RESOURCE_ALLOCATED 0x04 40#define FW_CDEV_EVENT_ISO_RESOURCE_ALLOCATED 0x04
38#define FW_CDEV_EVENT_ISO_RESOURCE_DEALLOCATED 0x05 41#define FW_CDEV_EVENT_ISO_RESOURCE_DEALLOCATED 0x05
39 42
@@ -120,24 +123,11 @@ struct fw_cdev_event_response {
120 123
121/** 124/**
122 * struct fw_cdev_event_request - Old version of &fw_cdev_event_request2 125 * struct fw_cdev_event_request - Old version of &fw_cdev_event_request2
123 * @closure: See &fw_cdev_event_common; set by %FW_CDEV_IOC_ALLOCATE ioctl
124 * @type: See &fw_cdev_event_common; always %FW_CDEV_EVENT_REQUEST 126 * @type: See &fw_cdev_event_common; always %FW_CDEV_EVENT_REQUEST
125 * @tcode: See &fw_cdev_event_request2
126 * @offset: See &fw_cdev_event_request2
127 * @handle: See &fw_cdev_event_request2
128 * @length: See &fw_cdev_event_request2
129 * @data: See &fw_cdev_event_request2
130 * 127 *
131 * This event is sent instead of &fw_cdev_event_request2 if the kernel or 128 * This event is sent instead of &fw_cdev_event_request2 if the kernel or
132 * the client implements ABI version <= 3. 129 * the client implements ABI version <= 3. &fw_cdev_event_request lacks
133 * 130 * essential information; use &fw_cdev_event_request2 instead.
134 * Unlike &fw_cdev_event_request2, the sender identity cannot be established,
135 * broadcast write requests cannot be distinguished from unicast writes, and
136 * @tcode of lock requests is %TCODE_LOCK_REQUEST.
137 *
138 * Requests to the FCP_REQUEST or FCP_RESPONSE register are responded to as
139 * with &fw_cdev_event_request2, except in kernel 2.6.32 and older which send
140 * the response packet of the client's %FW_CDEV_IOC_SEND_RESPONSE ioctl.
141 */ 131 */
142struct fw_cdev_event_request { 132struct fw_cdev_event_request {
143 __u64 closure; 133 __u64 closure;
@@ -452,29 +442,31 @@ union fw_cdev_event {
452 * %FW_CDEV_ISO_CONTEXT_RECEIVE_MULTICHANNEL, and 442 * %FW_CDEV_ISO_CONTEXT_RECEIVE_MULTICHANNEL, and
453 * %FW_CDEV_IOC_SET_ISO_CHANNELS 443 * %FW_CDEV_IOC_SET_ISO_CHANNELS
454 */ 444 */
455#define FW_CDEV_VERSION 3 /* Meaningless; don't use this macro. */
456 445
457/** 446/**
458 * struct fw_cdev_get_info - General purpose information ioctl 447 * struct fw_cdev_get_info - General purpose information ioctl
459 * @version: The version field is just a running serial number. Both an 448 * @version: The version field is just a running serial number. Both an
460 * input parameter (ABI version implemented by the client) and 449 * input parameter (ABI version implemented by the client) and
461 * output parameter (ABI version implemented by the kernel). 450 * output parameter (ABI version implemented by the kernel).
462 * A client must not fill in an %FW_CDEV_VERSION defined from an 451 * A client shall fill in the ABI @version for which the client
463 * included kernel header file but the actual version for which 452 * was implemented. This is necessary for forward compatibility.
464 * the client was implemented. This is necessary for forward 453 * @rom_length: If @rom is non-zero, up to @rom_length bytes of Configuration
465 * compatibility. We never break backwards compatibility, but
466 * may add more structs, events, and ioctls in later revisions.
467 * @rom_length: If @rom is non-zero, at most rom_length bytes of configuration
468 * ROM will be copied into that user space address. In either 454 * ROM will be copied into that user space address. In either
469 * case, @rom_length is updated with the actual length of the 455 * case, @rom_length is updated with the actual length of the
470 * configuration ROM. 456 * Configuration ROM.
471 * @rom: If non-zero, address of a buffer to be filled by a copy of the 457 * @rom: If non-zero, address of a buffer to be filled by a copy of the
472 * device's configuration ROM 458 * device's Configuration ROM
473 * @bus_reset: If non-zero, address of a buffer to be filled by a 459 * @bus_reset: If non-zero, address of a buffer to be filled by a
474 * &struct fw_cdev_event_bus_reset with the current state 460 * &struct fw_cdev_event_bus_reset with the current state
475 * of the bus. This does not cause a bus reset to happen. 461 * of the bus. This does not cause a bus reset to happen.
476 * @bus_reset_closure: Value of &closure in this and subsequent bus reset events 462 * @bus_reset_closure: Value of &closure in this and subsequent bus reset events
477 * @card: The index of the card this device belongs to 463 * @card: The index of the card this device belongs to
464 *
465 * The %FW_CDEV_IOC_GET_INFO ioctl is usually the very first one which a client
466 * performs right after it opened a /dev/fw* file.
467 *
468 * As a side effect, reception of %FW_CDEV_EVENT_BUS_RESET events to be read(2)
469 * is started by this ioctl.
478 */ 470 */
479struct fw_cdev_get_info { 471struct fw_cdev_get_info {
480 __u32 version; 472 __u32 version;
@@ -612,7 +604,7 @@ struct fw_cdev_initiate_bus_reset {
612 * @handle: Handle to the descriptor, written by the kernel 604 * @handle: Handle to the descriptor, written by the kernel
613 * 605 *
614 * Add a descriptor block and optionally a preceding immediate key to the local 606 * Add a descriptor block and optionally a preceding immediate key to the local
615 * node's configuration ROM. 607 * node's Configuration ROM.
616 * 608 *
617 * The @key field specifies the upper 8 bits of the descriptor root directory 609 * The @key field specifies the upper 8 bits of the descriptor root directory
618 * pointer and the @data and @length fields specify the contents. The @key 610 * pointer and the @data and @length fields specify the contents. The @key
@@ -627,9 +619,9 @@ struct fw_cdev_initiate_bus_reset {
627 * If successful, the kernel adds the descriptor and writes back a @handle to 619 * If successful, the kernel adds the descriptor and writes back a @handle to
628 * the kernel-side object to be used for later removal of the descriptor block 620 * the kernel-side object to be used for later removal of the descriptor block
629 * and immediate key. The kernel will also generate a bus reset to signal the 621 * and immediate key. The kernel will also generate a bus reset to signal the
630 * change of the configuration ROM to other nodes. 622 * change of the Configuration ROM to other nodes.
631 * 623 *
632 * This ioctl affects the configuration ROMs of all local nodes. 624 * This ioctl affects the Configuration ROMs of all local nodes.
633 * The ioctl only succeeds on device files which represent a local node. 625 * The ioctl only succeeds on device files which represent a local node.
634 */ 626 */
635struct fw_cdev_add_descriptor { 627struct fw_cdev_add_descriptor {
@@ -641,13 +633,13 @@ struct fw_cdev_add_descriptor {
641}; 633};
642 634
643/** 635/**
644 * struct fw_cdev_remove_descriptor - Remove contents from the configuration ROM 636 * struct fw_cdev_remove_descriptor - Remove contents from the Configuration ROM
645 * @handle: Handle to the descriptor, as returned by the kernel when the 637 * @handle: Handle to the descriptor, as returned by the kernel when the
646 * descriptor was added 638 * descriptor was added
647 * 639 *
648 * Remove a descriptor block and accompanying immediate key from the local 640 * Remove a descriptor block and accompanying immediate key from the local
649 * nodes' configuration ROMs. The kernel will also generate a bus reset to 641 * nodes' Configuration ROMs. The kernel will also generate a bus reset to
650 * signal the change of the configuration ROM to other nodes. 642 * signal the change of the Configuration ROM to other nodes.
651 */ 643 */
652struct fw_cdev_remove_descriptor { 644struct fw_cdev_remove_descriptor {
653 __u32 handle; 645 __u32 handle;
@@ -863,13 +855,8 @@ struct fw_cdev_stop_iso {
863 * @local_time: system time, in microseconds since the Epoch 855 * @local_time: system time, in microseconds since the Epoch
864 * @cycle_timer: Cycle Time register contents 856 * @cycle_timer: Cycle Time register contents
865 * 857 *
866 * The %FW_CDEV_IOC_GET_CYCLE_TIMER ioctl reads the isochronous cycle timer 858 * Same as %FW_CDEV_IOC_GET_CYCLE_TIMER2, but fixed to use %CLOCK_REALTIME
867 * and also the system clock (%CLOCK_REALTIME). This allows to express the 859 * and only with microseconds resolution.
868 * receive time of an isochronous packet as a system time.
869 *
870 * @cycle_timer consists of 7 bits cycleSeconds, 13 bits cycleCount, and
871 * 12 bits cycleOffset, in host byte order. Cf. the Cycle Time register
872 * per IEEE 1394 or Isochronous Cycle Timer register per OHCI-1394.
873 * 860 *
874 * In version 1 and 2 of the ABI, this ioctl returned unreliable (non- 861 * In version 1 and 2 of the ABI, this ioctl returned unreliable (non-
875 * monotonic) @cycle_timer values on certain controllers. 862 * monotonic) @cycle_timer values on certain controllers.
@@ -886,10 +873,17 @@ struct fw_cdev_get_cycle_timer {
886 * @clk_id: input parameter, clock from which to get the system time 873 * @clk_id: input parameter, clock from which to get the system time
887 * @cycle_timer: Cycle Time register contents 874 * @cycle_timer: Cycle Time register contents
888 * 875 *
889 * The %FW_CDEV_IOC_GET_CYCLE_TIMER2 works like 876 * The %FW_CDEV_IOC_GET_CYCLE_TIMER2 ioctl reads the isochronous cycle timer
890 * %FW_CDEV_IOC_GET_CYCLE_TIMER but lets you choose a clock like with POSIX' 877 * and also the system clock. This allows to correlate reception time of
891 * clock_gettime function. Supported @clk_id values are POSIX' %CLOCK_REALTIME 878 * isochronous packets with system time.
892 * and %CLOCK_MONOTONIC and Linux' %CLOCK_MONOTONIC_RAW. 879 *
880 * @clk_id lets you choose a clock like with POSIX' clock_gettime function.
881 * Supported @clk_id values are POSIX' %CLOCK_REALTIME and %CLOCK_MONOTONIC
882 * and Linux' %CLOCK_MONOTONIC_RAW.
883 *
884 * @cycle_timer consists of 7 bits cycleSeconds, 13 bits cycleCount, and
885 * 12 bits cycleOffset, in host byte order. Cf. the Cycle Time register
886 * per IEEE 1394 or Isochronous Cycle Timer register per OHCI-1394.
893 */ 887 */
894struct fw_cdev_get_cycle_timer2 { 888struct fw_cdev_get_cycle_timer2 {
895 __s64 tv_sec; 889 __s64 tv_sec;
@@ -1011,4 +1005,6 @@ struct fw_cdev_receive_phy_packets {
1011 __u64 closure; 1005 __u64 closure;
1012}; 1006};
1013 1007
1008#define FW_CDEV_VERSION 3 /* Meaningless legacy macro; don't use it. */
1009
1014#endif /* _LINUX_FIREWIRE_CDEV_H */ 1010#endif /* _LINUX_FIREWIRE_CDEV_H */
diff --git a/include/linux/fs.h b/include/linux/fs.h
index c55d6b7cd5d6..5f523eb9bb8d 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -32,7 +32,9 @@
32#define SEEK_SET 0 /* seek relative to beginning of file */ 32#define SEEK_SET 0 /* seek relative to beginning of file */
33#define SEEK_CUR 1 /* seek relative to current file position */ 33#define SEEK_CUR 1 /* seek relative to current file position */
34#define SEEK_END 2 /* seek relative to end of file */ 34#define SEEK_END 2 /* seek relative to end of file */
35#define SEEK_MAX SEEK_END 35#define SEEK_DATA 3 /* seek to the next data */
36#define SEEK_HOLE 4 /* seek to the next hole */
37#define SEEK_MAX SEEK_HOLE
36 38
37struct fstrim_range { 39struct fstrim_range {
38 __u64 start; 40 __u64 start;
@@ -63,6 +65,7 @@ struct inodes_stat_t {
63#define MAY_ACCESS 16 65#define MAY_ACCESS 16
64#define MAY_OPEN 32 66#define MAY_OPEN 32
65#define MAY_CHDIR 64 67#define MAY_CHDIR 64
68#define MAY_NOT_BLOCK 128 /* called from RCU mode, don't block */
66 69
67/* 70/*
68 * flags in file.f_mode. Note that FMODE_READ and FMODE_WRITE must correspond 71 * flags in file.f_mode. Note that FMODE_READ and FMODE_WRITE must correspond
@@ -208,6 +211,7 @@ struct inodes_stat_t {
208#define MS_KERNMOUNT (1<<22) /* this is a kern_mount call */ 211#define MS_KERNMOUNT (1<<22) /* this is a kern_mount call */
209#define MS_I_VERSION (1<<23) /* Update inode I_version field */ 212#define MS_I_VERSION (1<<23) /* Update inode I_version field */
210#define MS_STRICTATIME (1<<24) /* Always perform atime updates */ 213#define MS_STRICTATIME (1<<24) /* Always perform atime updates */
214#define MS_NOSEC (1<<28)
211#define MS_BORN (1<<29) 215#define MS_BORN (1<<29)
212#define MS_ACTIVE (1<<30) 216#define MS_ACTIVE (1<<30)
213#define MS_NOUSER (1<<31) 217#define MS_NOUSER (1<<31)
@@ -375,7 +379,6 @@ struct inodes_stat_t {
375 379
376#include <linux/linkage.h> 380#include <linux/linkage.h>
377#include <linux/wait.h> 381#include <linux/wait.h>
378#include <linux/types.h>
379#include <linux/kdev_t.h> 382#include <linux/kdev_t.h>
380#include <linux/dcache.h> 383#include <linux/dcache.h>
381#include <linux/path.h> 384#include <linux/path.h>
@@ -391,8 +394,9 @@ struct inodes_stat_t {
391#include <linux/semaphore.h> 394#include <linux/semaphore.h>
392#include <linux/fiemap.h> 395#include <linux/fiemap.h>
393#include <linux/rculist_bl.h> 396#include <linux/rculist_bl.h>
397#include <linux/shrinker.h>
398#include <linux/atomic.h>
394 399
395#include <asm/atomic.h>
396#include <asm/byteorder.h> 400#include <asm/byteorder.h>
397 401
398struct export_operations; 402struct export_operations;
@@ -638,6 +642,7 @@ struct address_space {
638 struct prio_tree_root i_mmap; /* tree of private and shared mappings */ 642 struct prio_tree_root i_mmap; /* tree of private and shared mappings */
639 struct list_head i_mmap_nonlinear;/*list VM_NONLINEAR mappings */ 643 struct list_head i_mmap_nonlinear;/*list VM_NONLINEAR mappings */
640 struct mutex i_mmap_mutex; /* protect tree, count, list */ 644 struct mutex i_mmap_mutex; /* protect tree, count, list */
645 /* Protected by tree_lock together with the radix tree */
641 unsigned long nrpages; /* number of total pages */ 646 unsigned long nrpages; /* number of total pages */
642 pgoff_t writeback_index;/* writeback starts here */ 647 pgoff_t writeback_index;/* writeback starts here */
643 const struct address_space_operations *a_ops; /* methods */ 648 const struct address_space_operations *a_ops; /* methods */
@@ -743,9 +748,13 @@ struct inode {
743 748
744 spinlock_t i_lock; /* i_blocks, i_bytes, maybe i_size */ 749 spinlock_t i_lock; /* i_blocks, i_bytes, maybe i_size */
745 unsigned int i_flags; 750 unsigned int i_flags;
751 unsigned long i_state;
752#ifdef CONFIG_SECURITY
753 void *i_security;
754#endif
746 struct mutex i_mutex; 755 struct mutex i_mutex;
747 756
748 unsigned long i_state; 757
749 unsigned long dirtied_when; /* jiffies of first dirtying */ 758 unsigned long dirtied_when; /* jiffies of first dirtying */
750 759
751 struct hlist_node i_hash; 760 struct hlist_node i_hash;
@@ -771,7 +780,7 @@ struct inode {
771 struct timespec i_ctime; 780 struct timespec i_ctime;
772 blkcnt_t i_blocks; 781 blkcnt_t i_blocks;
773 unsigned short i_bytes; 782 unsigned short i_bytes;
774 struct rw_semaphore i_alloc_sem; 783 atomic_t i_dio_count;
775 const struct file_operations *i_fop; /* former ->i_op->default_file_ops */ 784 const struct file_operations *i_fop; /* former ->i_op->default_file_ops */
776 struct file_lock *i_flock; 785 struct file_lock *i_flock;
777 struct address_space *i_mapping; 786 struct address_space *i_mapping;
@@ -797,9 +806,6 @@ struct inode {
797 atomic_t i_readcount; /* struct files open RO */ 806 atomic_t i_readcount; /* struct files open RO */
798#endif 807#endif
799 atomic_t i_writecount; 808 atomic_t i_writecount;
800#ifdef CONFIG_SECURITY
801 void *i_security;
802#endif
803#ifdef CONFIG_FS_POSIX_ACL 809#ifdef CONFIG_FS_POSIX_ACL
804 struct posix_acl *i_acl; 810 struct posix_acl *i_acl;
805 struct posix_acl *i_default_acl; 811 struct posix_acl *i_default_acl;
@@ -1066,12 +1072,12 @@ struct file_lock_operations {
1066}; 1072};
1067 1073
1068struct lock_manager_operations { 1074struct lock_manager_operations {
1069 int (*fl_compare_owner)(struct file_lock *, struct file_lock *); 1075 int (*lm_compare_owner)(struct file_lock *, struct file_lock *);
1070 void (*fl_notify)(struct file_lock *); /* unblock callback */ 1076 void (*lm_notify)(struct file_lock *); /* unblock callback */
1071 int (*fl_grant)(struct file_lock *, struct file_lock *, int); 1077 int (*lm_grant)(struct file_lock *, struct file_lock *, int);
1072 void (*fl_release_private)(struct file_lock *); 1078 void (*lm_release_private)(struct file_lock *);
1073 void (*fl_break)(struct file_lock *); 1079 void (*lm_break)(struct file_lock *);
1074 int (*fl_change)(struct file_lock **, int); 1080 int (*lm_change)(struct file_lock **, int);
1075}; 1081};
1076 1082
1077struct lock_manager { 1083struct lock_manager {
@@ -1393,6 +1399,11 @@ struct super_block {
1393 struct list_head s_dentry_lru; /* unused dentry lru */ 1399 struct list_head s_dentry_lru; /* unused dentry lru */
1394 int s_nr_dentry_unused; /* # of dentry on lru */ 1400 int s_nr_dentry_unused; /* # of dentry on lru */
1395 1401
1402 /* s_inode_lru_lock protects s_inode_lru and s_nr_inodes_unused */
1403 spinlock_t s_inode_lru_lock ____cacheline_aligned_in_smp;
1404 struct list_head s_inode_lru; /* unused inode lru */
1405 int s_nr_inodes_unused; /* # of inodes on lru */
1406
1396 struct block_device *s_bdev; 1407 struct block_device *s_bdev;
1397 struct backing_dev_info *s_bdi; 1408 struct backing_dev_info *s_bdi;
1398 struct mtd_info *s_mtd; 1409 struct mtd_info *s_mtd;
@@ -1435,8 +1446,14 @@ struct super_block {
1435 * Saved pool identifier for cleancache (-1 means none) 1446 * Saved pool identifier for cleancache (-1 means none)
1436 */ 1447 */
1437 int cleancache_poolid; 1448 int cleancache_poolid;
1449
1450 struct shrinker s_shrink; /* per-sb shrinker handle */
1438}; 1451};
1439 1452
1453/* superblock cache pruning functions */
1454extern void prune_icache_sb(struct super_block *sb, int nr_to_scan);
1455extern void prune_dcache_sb(struct super_block *sb, int nr_to_scan);
1456
1440extern struct timespec current_fs_time(struct super_block *sb); 1457extern struct timespec current_fs_time(struct super_block *sb);
1441 1458
1442/* 1459/*
@@ -1451,10 +1468,6 @@ enum {
1451#define vfs_check_frozen(sb, level) \ 1468#define vfs_check_frozen(sb, level) \
1452 wait_event((sb)->s_wait_unfrozen, ((sb)->s_frozen < (level))) 1469 wait_event((sb)->s_wait_unfrozen, ((sb)->s_frozen < (level)))
1453 1470
1454#define get_fs_excl() atomic_inc(&current->fs_excl)
1455#define put_fs_excl() atomic_dec(&current->fs_excl)
1456#define has_fs_excl() atomic_read(&current->fs_excl)
1457
1458/* 1471/*
1459 * until VFS tracks user namespaces for inodes, just make all files 1472 * until VFS tracks user namespaces for inodes, just make all files
1460 * belong to init_user_ns 1473 * belong to init_user_ns
@@ -1487,7 +1500,6 @@ extern void dentry_unhash(struct dentry *dentry);
1487/* 1500/*
1488 * VFS file helper functions. 1501 * VFS file helper functions.
1489 */ 1502 */
1490extern int file_permission(struct file *, int);
1491extern void inode_init_owner(struct inode *inode, const struct inode *dir, 1503extern void inode_init_owner(struct inode *inode, const struct inode *dir,
1492 mode_t mode); 1504 mode_t mode);
1493/* 1505/*
@@ -1535,11 +1547,6 @@ struct block_device_operations;
1535#define HAVE_COMPAT_IOCTL 1 1547#define HAVE_COMPAT_IOCTL 1
1536#define HAVE_UNLOCKED_IOCTL 1 1548#define HAVE_UNLOCKED_IOCTL 1
1537 1549
1538/*
1539 * NOTE:
1540 * all file operations except setlease can be called without
1541 * the big kernel lock held in all filesystems.
1542 */
1543struct file_operations { 1550struct file_operations {
1544 struct module *owner; 1551 struct module *owner;
1545 loff_t (*llseek) (struct file *, loff_t, int); 1552 loff_t (*llseek) (struct file *, loff_t, int);
@@ -1555,7 +1562,7 @@ struct file_operations {
1555 int (*open) (struct inode *, struct file *); 1562 int (*open) (struct inode *, struct file *);
1556 int (*flush) (struct file *, fl_owner_t id); 1563 int (*flush) (struct file *, fl_owner_t id);
1557 int (*release) (struct inode *, struct file *); 1564 int (*release) (struct inode *, struct file *);
1558 int (*fsync) (struct file *, int datasync); 1565 int (*fsync) (struct file *, loff_t, loff_t, int datasync);
1559 int (*aio_fsync) (struct kiocb *, int datasync); 1566 int (*aio_fsync) (struct kiocb *, int datasync);
1560 int (*fasync) (int, struct file *, int); 1567 int (*fasync) (int, struct file *, int);
1561 int (*lock) (struct file *, int, struct file_lock *); 1568 int (*lock) (struct file *, int, struct file_lock *);
@@ -1570,13 +1577,11 @@ struct file_operations {
1570 loff_t len); 1577 loff_t len);
1571}; 1578};
1572 1579
1573#define IPERM_FLAG_RCU 0x0001
1574
1575struct inode_operations { 1580struct inode_operations {
1576 struct dentry * (*lookup) (struct inode *,struct dentry *, struct nameidata *); 1581 struct dentry * (*lookup) (struct inode *,struct dentry *, struct nameidata *);
1577 void * (*follow_link) (struct dentry *, struct nameidata *); 1582 void * (*follow_link) (struct dentry *, struct nameidata *);
1578 int (*permission) (struct inode *, int, unsigned int); 1583 int (*permission) (struct inode *, int);
1579 int (*check_acl)(struct inode *, int, unsigned int); 1584 struct posix_acl * (*get_acl)(struct inode *, int);
1580 1585
1581 int (*readlink) (struct dentry *, char __user *,int); 1586 int (*readlink) (struct dentry *, char __user *,int);
1582 void (*put_link) (struct dentry *, struct nameidata *, void *); 1587 void (*put_link) (struct dentry *, struct nameidata *, void *);
@@ -1642,6 +1647,8 @@ struct super_operations {
1642 ssize_t (*quota_write)(struct super_block *, int, const char *, size_t, loff_t); 1647 ssize_t (*quota_write)(struct super_block *, int, const char *, size_t, loff_t);
1643#endif 1648#endif
1644 int (*bdev_try_to_free_page)(struct super_block*, struct page*, gfp_t); 1649 int (*bdev_try_to_free_page)(struct super_block*, struct page*, gfp_t);
1650 int (*nr_cached_objects)(struct super_block *);
1651 void (*free_cached_objects)(struct super_block *, int);
1645}; 1652};
1646 1653
1647/* 1654/*
@@ -1690,6 +1697,10 @@ struct super_operations {
1690 * set during data writeback, and cleared with a wakeup 1697 * set during data writeback, and cleared with a wakeup
1691 * on the bit address once it is done. 1698 * on the bit address once it is done.
1692 * 1699 *
1700 * I_REFERENCED Marks the inode as recently references on the LRU list.
1701 *
1702 * I_DIO_WAKEUP Never set. Only used as a key for wait_on_bit().
1703 *
1693 * Q: What is the difference between I_WILL_FREE and I_FREEING? 1704 * Q: What is the difference between I_WILL_FREE and I_FREEING?
1694 */ 1705 */
1695#define I_DIRTY_SYNC (1 << 0) 1706#define I_DIRTY_SYNC (1 << 0)
@@ -1703,6 +1714,8 @@ struct super_operations {
1703#define __I_SYNC 7 1714#define __I_SYNC 7
1704#define I_SYNC (1 << __I_SYNC) 1715#define I_SYNC (1 << __I_SYNC)
1705#define I_REFERENCED (1 << 8) 1716#define I_REFERENCED (1 << 8)
1717#define __I_DIO_WAKEUP 9
1718#define I_DIO_WAKEUP (1 << I_DIO_WAKEUP)
1706 1719
1707#define I_DIRTY (I_DIRTY_SYNC | I_DIRTY_DATASYNC | I_DIRTY_PAGES) 1720#define I_DIRTY (I_DIRTY_SYNC | I_DIRTY_DATASYNC | I_DIRTY_PAGES)
1708 1721
@@ -1813,7 +1826,6 @@ struct file_system_type {
1813 struct lock_class_key i_lock_key; 1826 struct lock_class_key i_lock_key;
1814 struct lock_class_key i_mutex_key; 1827 struct lock_class_key i_mutex_key;
1815 struct lock_class_key i_mutex_dir_key; 1828 struct lock_class_key i_mutex_dir_key;
1816 struct lock_class_key i_alloc_sem_key;
1817}; 1829};
1818 1830
1819extern struct dentry *mount_ns(struct file_system_type *fs_type, int flags, 1831extern struct dentry *mount_ns(struct file_system_type *fs_type, int flags,
@@ -1834,6 +1846,8 @@ void kill_litter_super(struct super_block *sb);
1834void deactivate_super(struct super_block *sb); 1846void deactivate_super(struct super_block *sb);
1835void deactivate_locked_super(struct super_block *sb); 1847void deactivate_locked_super(struct super_block *sb);
1836int set_anon_super(struct super_block *s, void *data); 1848int set_anon_super(struct super_block *s, void *data);
1849int get_anon_bdev(dev_t *);
1850void free_anon_bdev(dev_t);
1837struct super_block *sget(struct file_system_type *type, 1851struct super_block *sget(struct file_system_type *type,
1838 int (*test)(struct super_block *,void *), 1852 int (*test)(struct super_block *,void *),
1839 int (*set)(struct super_block *,void *), 1853 int (*set)(struct super_block *,void *),
@@ -1866,6 +1880,7 @@ extern int register_filesystem(struct file_system_type *);
1866extern int unregister_filesystem(struct file_system_type *); 1880extern int unregister_filesystem(struct file_system_type *);
1867extern struct vfsmount *kern_mount_data(struct file_system_type *, void *data); 1881extern struct vfsmount *kern_mount_data(struct file_system_type *, void *data);
1868#define kern_mount(type) kern_mount_data(type, NULL) 1882#define kern_mount(type) kern_mount_data(type, NULL)
1883extern void kern_unmount(struct vfsmount *mnt);
1869extern int may_umount_tree(struct vfsmount *); 1884extern int may_umount_tree(struct vfsmount *);
1870extern int may_umount(struct vfsmount *); 1885extern int may_umount(struct vfsmount *);
1871extern long do_mount(char *, char *, char *, unsigned long, void *); 1886extern long do_mount(char *, char *, char *, unsigned long, void *);
@@ -2185,16 +2200,38 @@ extern sector_t bmap(struct inode *, sector_t);
2185#endif 2200#endif
2186extern int notify_change(struct dentry *, struct iattr *); 2201extern int notify_change(struct dentry *, struct iattr *);
2187extern int inode_permission(struct inode *, int); 2202extern int inode_permission(struct inode *, int);
2188extern int generic_permission(struct inode *, int, unsigned int, 2203extern int generic_permission(struct inode *, int);
2189 int (*check_acl)(struct inode *, int, unsigned int));
2190 2204
2191static inline bool execute_ok(struct inode *inode) 2205static inline bool execute_ok(struct inode *inode)
2192{ 2206{
2193 return (inode->i_mode & S_IXUGO) || S_ISDIR(inode->i_mode); 2207 return (inode->i_mode & S_IXUGO) || S_ISDIR(inode->i_mode);
2194} 2208}
2195 2209
2196extern int get_write_access(struct inode *); 2210/*
2197extern int deny_write_access(struct file *); 2211 * get_write_access() gets write permission for a file.
2212 * put_write_access() releases this write permission.
2213 * This is used for regular files.
2214 * We cannot support write (and maybe mmap read-write shared) accesses and
2215 * MAP_DENYWRITE mmappings simultaneously. The i_writecount field of an inode
2216 * can have the following values:
2217 * 0: no writers, no VM_DENYWRITE mappings
2218 * < 0: (-i_writecount) vm_area_structs with VM_DENYWRITE set exist
2219 * > 0: (i_writecount) users are writing to the file.
2220 *
2221 * Normally we operate on that counter with atomic_{inc,dec} and it's safe
2222 * except for the cases where we don't hold i_writecount yet. Then we need to
2223 * use {get,deny}_write_access() - these functions check the sign and refuse
2224 * to do the change if sign is wrong.
2225 */
2226static inline int get_write_access(struct inode *inode)
2227{
2228 return atomic_inc_unless_negative(&inode->i_writecount) ? 0 : -ETXTBSY;
2229}
2230static inline int deny_write_access(struct file *file)
2231{
2232 struct inode *inode = file->f_path.dentry->d_inode;
2233 return atomic_dec_unless_positive(&inode->i_writecount) ? 0 : -ETXTBSY;
2234}
2198static inline void put_write_access(struct inode * inode) 2235static inline void put_write_access(struct inode * inode)
2199{ 2236{
2200 atomic_dec(&inode->i_writecount); 2237 atomic_dec(&inode->i_writecount);
@@ -2314,7 +2351,8 @@ extern int generic_segment_checks(const struct iovec *iov,
2314/* fs/block_dev.c */ 2351/* fs/block_dev.c */
2315extern ssize_t blkdev_aio_write(struct kiocb *iocb, const struct iovec *iov, 2352extern ssize_t blkdev_aio_write(struct kiocb *iocb, const struct iovec *iov,
2316 unsigned long nr_segs, loff_t pos); 2353 unsigned long nr_segs, loff_t pos);
2317extern int blkdev_fsync(struct file *filp, int datasync); 2354extern int blkdev_fsync(struct file *filp, loff_t start, loff_t end,
2355 int datasync);
2318 2356
2319/* fs/splice.c */ 2357/* fs/splice.c */
2320extern ssize_t generic_file_splice_read(struct file *, loff_t *, 2358extern ssize_t generic_file_splice_read(struct file *, loff_t *,
@@ -2365,6 +2403,8 @@ enum {
2365}; 2403};
2366 2404
2367void dio_end_io(struct bio *bio, int error); 2405void dio_end_io(struct bio *bio, int error);
2406void inode_dio_wait(struct inode *inode);
2407void inode_dio_done(struct inode *inode);
2368 2408
2369ssize_t __blockdev_direct_IO(int rw, struct kiocb *iocb, struct inode *inode, 2409ssize_t __blockdev_direct_IO(int rw, struct kiocb *iocb, struct inode *inode,
2370 struct block_device *bdev, const struct iovec *iov, loff_t offset, 2410 struct block_device *bdev, const struct iovec *iov, loff_t offset,
@@ -2372,14 +2412,17 @@ ssize_t __blockdev_direct_IO(int rw, struct kiocb *iocb, struct inode *inode,
2372 dio_submit_t submit_io, int flags); 2412 dio_submit_t submit_io, int flags);
2373 2413
2374static inline ssize_t blockdev_direct_IO(int rw, struct kiocb *iocb, 2414static inline ssize_t blockdev_direct_IO(int rw, struct kiocb *iocb,
2375 struct inode *inode, struct block_device *bdev, const struct iovec *iov, 2415 struct inode *inode, const struct iovec *iov, loff_t offset,
2376 loff_t offset, unsigned long nr_segs, get_block_t get_block, 2416 unsigned long nr_segs, get_block_t get_block)
2377 dio_iodone_t end_io)
2378{ 2417{
2379 return __blockdev_direct_IO(rw, iocb, inode, bdev, iov, offset, 2418 return __blockdev_direct_IO(rw, iocb, inode, inode->i_sb->s_bdev, iov,
2380 nr_segs, get_block, end_io, NULL, 2419 offset, nr_segs, get_block, NULL, NULL,
2381 DIO_LOCKING | DIO_SKIP_HOLES); 2420 DIO_LOCKING | DIO_SKIP_HOLES);
2382} 2421}
2422#else
2423static inline void inode_dio_wait(struct inode *inode)
2424{
2425}
2383#endif 2426#endif
2384 2427
2385extern const struct file_operations generic_ro_fops; 2428extern const struct file_operations generic_ro_fops;
@@ -2429,6 +2472,8 @@ extern struct super_block *get_active_super(struct block_device *bdev);
2429extern struct super_block *user_get_super(dev_t); 2472extern struct super_block *user_get_super(dev_t);
2430extern void drop_super(struct super_block *sb); 2473extern void drop_super(struct super_block *sb);
2431extern void iterate_supers(void (*)(struct super_block *, void *), void *); 2474extern void iterate_supers(void (*)(struct super_block *, void *), void *);
2475extern void iterate_supers_type(struct file_system_type *,
2476 void (*)(struct super_block *, void *), void *);
2432 2477
2433extern int dcache_dir_open(struct inode *, struct file *); 2478extern int dcache_dir_open(struct inode *, struct file *);
2434extern int dcache_dir_close(struct inode *, struct file *); 2479extern int dcache_dir_close(struct inode *, struct file *);
@@ -2441,7 +2486,7 @@ extern int simple_link(struct dentry *, struct inode *, struct dentry *);
2441extern int simple_unlink(struct inode *, struct dentry *); 2486extern int simple_unlink(struct inode *, struct dentry *);
2442extern int simple_rmdir(struct inode *, struct dentry *); 2487extern int simple_rmdir(struct inode *, struct dentry *);
2443extern int simple_rename(struct inode *, struct dentry *, struct inode *, struct dentry *); 2488extern int simple_rename(struct inode *, struct dentry *, struct inode *, struct dentry *);
2444extern int noop_fsync(struct file *, int); 2489extern int noop_fsync(struct file *, loff_t, loff_t, int);
2445extern int simple_empty(struct dentry *); 2490extern int simple_empty(struct dentry *);
2446extern int simple_readpage(struct file *file, struct page *page); 2491extern int simple_readpage(struct file *file, struct page *page);
2447extern int simple_write_begin(struct file *file, struct address_space *mapping, 2492extern int simple_write_begin(struct file *file, struct address_space *mapping,
@@ -2466,7 +2511,7 @@ extern ssize_t simple_read_from_buffer(void __user *to, size_t count,
2466extern ssize_t simple_write_to_buffer(void *to, size_t available, loff_t *ppos, 2511extern ssize_t simple_write_to_buffer(void *to, size_t available, loff_t *ppos,
2467 const void __user *from, size_t count); 2512 const void __user *from, size_t count);
2468 2513
2469extern int generic_file_fsync(struct file *, int); 2514extern int generic_file_fsync(struct file *, loff_t, loff_t, int);
2470 2515
2471extern int generic_check_addressable(unsigned, u64); 2516extern int generic_check_addressable(unsigned, u64);
2472 2517
@@ -2591,7 +2636,7 @@ static inline int is_sxid(mode_t mode)
2591 2636
2592static inline void inode_has_no_xattr(struct inode *inode) 2637static inline void inode_has_no_xattr(struct inode *inode)
2593{ 2638{
2594 if (!is_sxid(inode->i_mode)) 2639 if (!is_sxid(inode->i_mode) && (inode->i_sb->s_flags & MS_NOSEC))
2595 inode->i_flags |= S_NOSEC; 2640 inode->i_flags |= S_NOSEC;
2596} 2641}
2597 2642
diff --git a/include/linux/fscache.h b/include/linux/fscache.h
index 7c4d72f5581f..9ec20dec3353 100644
--- a/include/linux/fscache.h
+++ b/include/linux/fscache.h
@@ -204,6 +204,8 @@ extern bool __fscache_check_page_write(struct fscache_cookie *, struct page *);
204extern void __fscache_wait_on_page_write(struct fscache_cookie *, struct page *); 204extern void __fscache_wait_on_page_write(struct fscache_cookie *, struct page *);
205extern bool __fscache_maybe_release_page(struct fscache_cookie *, struct page *, 205extern bool __fscache_maybe_release_page(struct fscache_cookie *, struct page *,
206 gfp_t); 206 gfp_t);
207extern void __fscache_uncache_all_inode_pages(struct fscache_cookie *,
208 struct inode *);
207 209
208/** 210/**
209 * fscache_register_netfs - Register a filesystem as desiring caching services 211 * fscache_register_netfs - Register a filesystem as desiring caching services
@@ -643,4 +645,23 @@ bool fscache_maybe_release_page(struct fscache_cookie *cookie,
643 return false; 645 return false;
644} 646}
645 647
648/**
649 * fscache_uncache_all_inode_pages - Uncache all an inode's pages
650 * @cookie: The cookie representing the inode's cache object.
651 * @inode: The inode to uncache pages from.
652 *
653 * Uncache all the pages in an inode that are marked PG_fscache, assuming them
654 * to be associated with the given cookie.
655 *
656 * This function may sleep. It will wait for pages that are being written out
657 * and will wait whilst the PG_fscache mark is removed by the cache.
658 */
659static inline
660void fscache_uncache_all_inode_pages(struct fscache_cookie *cookie,
661 struct inode *inode)
662{
663 if (fscache_cookie_valid(cookie))
664 __fscache_uncache_all_inode_pages(cookie, inode);
665}
666
646#endif /* _LINUX_FSCACHE_H */ 667#endif /* _LINUX_FSCACHE_H */
diff --git a/include/linux/fsl-diu-fb.h b/include/linux/fsl-diu-fb.h
index 781d4671415f..daa9952d2174 100644
--- a/include/linux/fsl-diu-fb.h
+++ b/include/linux/fsl-diu-fb.h
@@ -24,12 +24,6 @@
24 * See mpc8610fb_set_par(), map_video_memory(), and unmap_video_memory() 24 * See mpc8610fb_set_par(), map_video_memory(), and unmap_video_memory()
25 */ 25 */
26#define MEM_ALLOC_THRESHOLD (1024*768*4+32) 26#define MEM_ALLOC_THRESHOLD (1024*768*4+32)
27/* Minimum value that the pixel clock can be set to in pico seconds
28 * This is determined by platform clock/3 where the minimum platform
29 * clock is 533MHz. This gives 5629 pico seconds.
30 */
31#define MIN_PIX_CLK 5629
32#define MAX_PIX_CLK 96096
33 27
34#include <linux/types.h> 28#include <linux/types.h>
35 29
diff --git a/include/linux/fsl_hypervisor.h b/include/linux/fsl_hypervisor.h
new file mode 100644
index 000000000000..1cebaeeeef57
--- /dev/null
+++ b/include/linux/fsl_hypervisor.h
@@ -0,0 +1,241 @@
1/*
2 * Freescale hypervisor ioctl and kernel interface
3 *
4 * Copyright (C) 2008-2011 Freescale Semiconductor, Inc.
5 * Author: Timur Tabi <timur@freescale.com>
6 *
7 * Redistribution and use in source and binary forms, with or without
8 * modification, are permitted provided that the following conditions are met:
9 * * Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer.
11 * * Redistributions in binary form must reproduce the above copyright
12 * notice, this list of conditions and the following disclaimer in the
13 * documentation and/or other materials provided with the distribution.
14 * * Neither the name of Freescale Semiconductor nor the
15 * names of its contributors may be used to endorse or promote products
16 * derived from this software without specific prior written permission.
17 *
18 *
19 * ALTERNATIVELY, this software may be distributed under the terms of the
20 * GNU General Public License ("GPL") as published by the Free Software
21 * Foundation, either version 2 of that License or (at your option) any
22 * later version.
23 *
24 * This software is provided by Freescale Semiconductor "as is" and any
25 * express or implied warranties, including, but not limited to, the implied
26 * warranties of merchantability and fitness for a particular purpose are
27 * disclaimed. In no event shall Freescale Semiconductor be liable for any
28 * direct, indirect, incidental, special, exemplary, or consequential damages
29 * (including, but not limited to, procurement of substitute goods or services;
30 * loss of use, data, or profits; or business interruption) however caused and
31 * on any theory of liability, whether in contract, strict liability, or tort
32 * (including negligence or otherwise) arising in any way out of the use of this
33 * software, even if advised of the possibility of such damage.
34 *
35 * This file is used by the Freescale hypervisor management driver. It can
36 * also be included by applications that need to communicate with the driver
37 * via the ioctl interface.
38 */
39
40#ifndef FSL_HYPERVISOR_H
41#define FSL_HYPERVISOR_H
42
43#include <linux/types.h>
44
45/**
46 * struct fsl_hv_ioctl_restart - restart a partition
47 * @ret: return error code from the hypervisor
48 * @partition: the ID of the partition to restart, or -1 for the
49 * calling partition
50 *
51 * Used by FSL_HV_IOCTL_PARTITION_RESTART
52 */
53struct fsl_hv_ioctl_restart {
54 __u32 ret;
55 __u32 partition;
56};
57
58/**
59 * struct fsl_hv_ioctl_status - get a partition's status
60 * @ret: return error code from the hypervisor
61 * @partition: the ID of the partition to query, or -1 for the
62 * calling partition
63 * @status: The returned status of the partition
64 *
65 * Used by FSL_HV_IOCTL_PARTITION_GET_STATUS
66 *
67 * Values of 'status':
68 * 0 = Stopped
69 * 1 = Running
70 * 2 = Starting
71 * 3 = Stopping
72 */
73struct fsl_hv_ioctl_status {
74 __u32 ret;
75 __u32 partition;
76 __u32 status;
77};
78
79/**
80 * struct fsl_hv_ioctl_start - start a partition
81 * @ret: return error code from the hypervisor
82 * @partition: the ID of the partition to control
83 * @entry_point: The offset within the guest IMA to start execution
84 * @load: If non-zero, reload the partition's images before starting
85 *
86 * Used by FSL_HV_IOCTL_PARTITION_START
87 */
88struct fsl_hv_ioctl_start {
89 __u32 ret;
90 __u32 partition;
91 __u32 entry_point;
92 __u32 load;
93};
94
95/**
96 * struct fsl_hv_ioctl_stop - stop a partition
97 * @ret: return error code from the hypervisor
98 * @partition: the ID of the partition to stop, or -1 for the calling
99 * partition
100 *
101 * Used by FSL_HV_IOCTL_PARTITION_STOP
102 */
103struct fsl_hv_ioctl_stop {
104 __u32 ret;
105 __u32 partition;
106};
107
108/**
109 * struct fsl_hv_ioctl_memcpy - copy memory between partitions
110 * @ret: return error code from the hypervisor
111 * @source: the partition ID of the source partition, or -1 for this
112 * partition
113 * @target: the partition ID of the target partition, or -1 for this
114 * partition
115 * @reserved: reserved, must be set to 0
116 * @local_addr: user-space virtual address of a buffer in the local
117 * partition
118 * @remote_addr: guest physical address of a buffer in the
119 * remote partition
120 * @count: the number of bytes to copy. Both the local and remote
121 * buffers must be at least 'count' bytes long
122 *
123 * Used by FSL_HV_IOCTL_MEMCPY
124 *
125 * The 'local' partition is the partition that calls this ioctl. The
126 * 'remote' partition is a different partition. The data is copied from
127 * the 'source' paritition' to the 'target' partition.
128 *
129 * The buffer in the remote partition must be guest physically
130 * contiguous.
131 *
132 * This ioctl does not support copying memory between two remote
133 * partitions or within the same partition, so either 'source' or
134 * 'target' (but not both) must be -1. In other words, either
135 *
136 * source == local and target == remote
137 * or
138 * source == remote and target == local
139 */
140struct fsl_hv_ioctl_memcpy {
141 __u32 ret;
142 __u32 source;
143 __u32 target;
144 __u32 reserved; /* padding to ensure local_vaddr is aligned */
145 __u64 local_vaddr;
146 __u64 remote_paddr;
147 __u64 count;
148};
149
150/**
151 * struct fsl_hv_ioctl_doorbell - ring a doorbell
152 * @ret: return error code from the hypervisor
153 * @doorbell: the handle of the doorbell to ring doorbell
154 *
155 * Used by FSL_HV_IOCTL_DOORBELL
156 */
157struct fsl_hv_ioctl_doorbell {
158 __u32 ret;
159 __u32 doorbell;
160};
161
162/**
163 * struct fsl_hv_ioctl_prop - get/set a device tree property
164 * @ret: return error code from the hypervisor
165 * @handle: handle of partition whose tree to access
166 * @path: virtual address of path name of node to access
167 * @propname: virtual address of name of property to access
168 * @propval: virtual address of property data buffer
169 * @proplen: Size of property data buffer
170 * @reserved: reserved, must be set to 0
171 *
172 * Used by FSL_HV_IOCTL_DOORBELL
173 */
174struct fsl_hv_ioctl_prop {
175 __u32 ret;
176 __u32 handle;
177 __u64 path;
178 __u64 propname;
179 __u64 propval;
180 __u32 proplen;
181 __u32 reserved; /* padding to ensure structure is aligned */
182};
183
184/* The ioctl type, documented in ioctl-number.txt */
185#define FSL_HV_IOCTL_TYPE 0xAF
186
187/* Restart another partition */
188#define FSL_HV_IOCTL_PARTITION_RESTART \
189 _IOWR(FSL_HV_IOCTL_TYPE, 1, struct fsl_hv_ioctl_restart)
190
191/* Get a partition's status */
192#define FSL_HV_IOCTL_PARTITION_GET_STATUS \
193 _IOWR(FSL_HV_IOCTL_TYPE, 2, struct fsl_hv_ioctl_status)
194
195/* Boot another partition */
196#define FSL_HV_IOCTL_PARTITION_START \
197 _IOWR(FSL_HV_IOCTL_TYPE, 3, struct fsl_hv_ioctl_start)
198
199/* Stop this or another partition */
200#define FSL_HV_IOCTL_PARTITION_STOP \
201 _IOWR(FSL_HV_IOCTL_TYPE, 4, struct fsl_hv_ioctl_stop)
202
203/* Copy data from one partition to another */
204#define FSL_HV_IOCTL_MEMCPY \
205 _IOWR(FSL_HV_IOCTL_TYPE, 5, struct fsl_hv_ioctl_memcpy)
206
207/* Ring a doorbell */
208#define FSL_HV_IOCTL_DOORBELL \
209 _IOWR(FSL_HV_IOCTL_TYPE, 6, struct fsl_hv_ioctl_doorbell)
210
211/* Get a property from another guest's device tree */
212#define FSL_HV_IOCTL_GETPROP \
213 _IOWR(FSL_HV_IOCTL_TYPE, 7, struct fsl_hv_ioctl_prop)
214
215/* Set a property in another guest's device tree */
216#define FSL_HV_IOCTL_SETPROP \
217 _IOWR(FSL_HV_IOCTL_TYPE, 8, struct fsl_hv_ioctl_prop)
218
219#ifdef __KERNEL__
220
221/**
222 * fsl_hv_event_register() - register a callback for failover events
223 * @nb: pointer to caller-supplied notifier_block structure
224 *
225 * This function is called by device drivers to register their callback
226 * functions for fail-over events.
227 *
228 * The caller should allocate a notifier_block object and initialize the
229 * 'priority' and 'notifier_call' fields.
230 */
231int fsl_hv_failover_register(struct notifier_block *nb);
232
233/**
234 * fsl_hv_event_unregister() - unregister a callback for failover events
235 * @nb: the same 'nb' used in previous fsl_hv_failover_register call
236 */
237int fsl_hv_failover_unregister(struct notifier_block *nb);
238
239#endif
240
241#endif
diff --git a/include/linux/ftrace.h b/include/linux/ftrace.h
index 9d88e1cb5dbb..f0c0e8a47ae6 100644
--- a/include/linux/ftrace.h
+++ b/include/linux/ftrace.h
@@ -19,6 +19,8 @@
19 19
20#include <asm/ftrace.h> 20#include <asm/ftrace.h>
21 21
22struct ftrace_hash;
23
22#ifdef CONFIG_FUNCTION_TRACER 24#ifdef CONFIG_FUNCTION_TRACER
23 25
24extern int ftrace_enabled; 26extern int ftrace_enabled;
@@ -29,8 +31,6 @@ ftrace_enable_sysctl(struct ctl_table *table, int write,
29 31
30typedef void (*ftrace_func_t)(unsigned long ip, unsigned long parent_ip); 32typedef void (*ftrace_func_t)(unsigned long ip, unsigned long parent_ip);
31 33
32struct ftrace_hash;
33
34enum { 34enum {
35 FTRACE_OPS_FL_ENABLED = 1 << 0, 35 FTRACE_OPS_FL_ENABLED = 1 << 0,
36 FTRACE_OPS_FL_GLOBAL = 1 << 1, 36 FTRACE_OPS_FL_GLOBAL = 1 << 1,
@@ -123,7 +123,8 @@ stack_trace_sysctl(struct ctl_table *table, int write,
123struct ftrace_func_command { 123struct ftrace_func_command {
124 struct list_head list; 124 struct list_head list;
125 char *name; 125 char *name;
126 int (*func)(char *func, char *cmd, 126 int (*func)(struct ftrace_hash *hash,
127 char *func, char *cmd,
127 char *params, int enable); 128 char *params, int enable);
128}; 129};
129 130
diff --git a/include/linux/ftrace_event.h b/include/linux/ftrace_event.h
index 59d3ef100eb9..96efa6794ea5 100644
--- a/include/linux/ftrace_event.h
+++ b/include/linux/ftrace_event.h
@@ -76,6 +76,7 @@ struct trace_iterator {
76 struct trace_entry *ent; 76 struct trace_entry *ent;
77 unsigned long lost_events; 77 unsigned long lost_events;
78 int leftover; 78 int leftover;
79 int ent_size;
79 int cpu; 80 int cpu;
80 u64 ts; 81 u64 ts;
81 82
@@ -129,6 +130,10 @@ void trace_current_buffer_unlock_commit(struct ring_buffer *buffer,
129void trace_nowake_buffer_unlock_commit(struct ring_buffer *buffer, 130void trace_nowake_buffer_unlock_commit(struct ring_buffer *buffer,
130 struct ring_buffer_event *event, 131 struct ring_buffer_event *event,
131 unsigned long flags, int pc); 132 unsigned long flags, int pc);
133void trace_nowake_buffer_unlock_commit_regs(struct ring_buffer *buffer,
134 struct ring_buffer_event *event,
135 unsigned long flags, int pc,
136 struct pt_regs *regs);
132void trace_current_buffer_discard_commit(struct ring_buffer *buffer, 137void trace_current_buffer_discard_commit(struct ring_buffer *buffer,
133 struct ring_buffer_event *event); 138 struct ring_buffer_event *event);
134 139
diff --git a/include/linux/generic_acl.h b/include/linux/generic_acl.h
index 0437e377b555..b6d657544ef1 100644
--- a/include/linux/generic_acl.h
+++ b/include/linux/generic_acl.h
@@ -10,6 +10,5 @@ extern const struct xattr_handler generic_acl_default_handler;
10 10
11int generic_acl_init(struct inode *, struct inode *); 11int generic_acl_init(struct inode *, struct inode *);
12int generic_acl_chmod(struct inode *); 12int generic_acl_chmod(struct inode *);
13int generic_check_acl(struct inode *inode, int mask, unsigned int flags);
14 13
15#endif /* LINUX_GENERIC_ACL_H */ 14#endif /* LINUX_GENERIC_ACL_H */
diff --git a/include/linux/genhd.h b/include/linux/genhd.h
index 300d7582006e..02fa4697a0e5 100644
--- a/include/linux/genhd.h
+++ b/include/linux/genhd.h
@@ -420,7 +420,7 @@ static inline int get_disk_ro(struct gendisk *disk)
420 420
421extern void disk_block_events(struct gendisk *disk); 421extern void disk_block_events(struct gendisk *disk);
422extern void disk_unblock_events(struct gendisk *disk); 422extern void disk_unblock_events(struct gendisk *disk);
423extern void disk_check_events(struct gendisk *disk); 423extern void disk_flush_events(struct gendisk *disk, unsigned int mask);
424extern unsigned int disk_clear_events(struct gendisk *disk, unsigned int mask); 424extern unsigned int disk_clear_events(struct gendisk *disk, unsigned int mask);
425 425
426/* drivers/char/random.c */ 426/* drivers/char/random.c */
diff --git a/include/linux/gpio.h b/include/linux/gpio.h
index 32d47e710661..17b5a0d80e42 100644
--- a/include/linux/gpio.h
+++ b/include/linux/gpio.h
@@ -3,6 +3,17 @@
3 3
4/* see Documentation/gpio.txt */ 4/* see Documentation/gpio.txt */
5 5
6/* make these flag values available regardless of GPIO kconfig options */
7#define GPIOF_DIR_OUT (0 << 0)
8#define GPIOF_DIR_IN (1 << 0)
9
10#define GPIOF_INIT_LOW (0 << 1)
11#define GPIOF_INIT_HIGH (1 << 1)
12
13#define GPIOF_IN (GPIOF_DIR_IN)
14#define GPIOF_OUT_INIT_LOW (GPIOF_DIR_OUT | GPIOF_INIT_LOW)
15#define GPIOF_OUT_INIT_HIGH (GPIOF_DIR_OUT | GPIOF_INIT_HIGH)
16
6#ifdef CONFIG_GENERIC_GPIO 17#ifdef CONFIG_GENERIC_GPIO
7#include <asm/gpio.h> 18#include <asm/gpio.h>
8 19
diff --git a/include/linux/hardirq.h b/include/linux/hardirq.h
index ba362171e8ae..f743883f769e 100644
--- a/include/linux/hardirq.h
+++ b/include/linux/hardirq.h
@@ -93,7 +93,7 @@
93 */ 93 */
94#define in_nmi() (preempt_count() & NMI_MASK) 94#define in_nmi() (preempt_count() & NMI_MASK)
95 95
96#if defined(CONFIG_PREEMPT) 96#if defined(CONFIG_PREEMPT_COUNT)
97# define PREEMPT_CHECK_OFFSET 1 97# define PREEMPT_CHECK_OFFSET 1
98#else 98#else
99# define PREEMPT_CHECK_OFFSET 0 99# define PREEMPT_CHECK_OFFSET 0
@@ -115,7 +115,7 @@
115#define in_atomic_preempt_off() \ 115#define in_atomic_preempt_off() \
116 ((preempt_count() & ~PREEMPT_ACTIVE) != PREEMPT_CHECK_OFFSET) 116 ((preempt_count() & ~PREEMPT_ACTIVE) != PREEMPT_CHECK_OFFSET)
117 117
118#ifdef CONFIG_PREEMPT 118#ifdef CONFIG_PREEMPT_COUNT
119# define preemptible() (preempt_count() == 0 && !irqs_disabled()) 119# define preemptible() (preempt_count() == 0 && !irqs_disabled())
120# define IRQ_EXIT_OFFSET (HARDIRQ_OFFSET-1) 120# define IRQ_EXIT_OFFSET (HARDIRQ_OFFSET-1)
121#else 121#else
diff --git a/include/linux/hid.h b/include/linux/hid.h
index 42f7e2fb501f..9cf8e7ae7450 100644
--- a/include/linux/hid.h
+++ b/include/linux/hid.h
@@ -453,7 +453,8 @@ struct hid_input {
453 453
454enum hid_type { 454enum hid_type {
455 HID_TYPE_OTHER = 0, 455 HID_TYPE_OTHER = 0,
456 HID_TYPE_USBMOUSE 456 HID_TYPE_USBMOUSE,
457 HID_TYPE_USBNONE
457}; 458};
458 459
459struct hid_driver; 460struct hid_driver;
diff --git a/include/linux/hrtimer.h b/include/linux/hrtimer.h
index 51932e5acf7c..fd0dc30c9f15 100644
--- a/include/linux/hrtimer.h
+++ b/include/linux/hrtimer.h
@@ -135,6 +135,7 @@ struct hrtimer_sleeper {
135 * @cpu_base: per cpu clock base 135 * @cpu_base: per cpu clock base
136 * @index: clock type index for per_cpu support when moving a 136 * @index: clock type index for per_cpu support when moving a
137 * timer to a base on another cpu. 137 * timer to a base on another cpu.
138 * @clockid: clock id for per_cpu support
138 * @active: red black tree root node for the active timers 139 * @active: red black tree root node for the active timers
139 * @resolution: the resolution of the clock, in nanoseconds 140 * @resolution: the resolution of the clock, in nanoseconds
140 * @get_time: function to retrieve the current time of the clock 141 * @get_time: function to retrieve the current time of the clock
diff --git a/include/linux/hugetlb.h b/include/linux/hugetlb.h
index 59225ef27d15..19644e0016bd 100644
--- a/include/linux/hugetlb.h
+++ b/include/linux/hugetlb.h
@@ -231,6 +231,9 @@ struct hstate {
231struct huge_bootmem_page { 231struct huge_bootmem_page {
232 struct list_head list; 232 struct list_head list;
233 struct hstate *hstate; 233 struct hstate *hstate;
234#ifdef CONFIG_HIGHMEM
235 phys_addr_t phys;
236#endif
234}; 237};
235 238
236struct page *alloc_huge_page_node(struct hstate *h, int nid); 239struct page *alloc_huge_page_node(struct hstate *h, int nid);
diff --git a/include/linux/hw_breakpoint.h b/include/linux/hw_breakpoint.h
index d1e55fed2c7d..6ae9c631a1be 100644
--- a/include/linux/hw_breakpoint.h
+++ b/include/linux/hw_breakpoint.h
@@ -73,6 +73,7 @@ static inline unsigned long hw_breakpoint_len(struct perf_event *bp)
73extern struct perf_event * 73extern struct perf_event *
74register_user_hw_breakpoint(struct perf_event_attr *attr, 74register_user_hw_breakpoint(struct perf_event_attr *attr,
75 perf_overflow_handler_t triggered, 75 perf_overflow_handler_t triggered,
76 void *context,
76 struct task_struct *tsk); 77 struct task_struct *tsk);
77 78
78/* FIXME: only change from the attr, and don't unregister */ 79/* FIXME: only change from the attr, and don't unregister */
@@ -85,11 +86,13 @@ modify_user_hw_breakpoint(struct perf_event *bp, struct perf_event_attr *attr);
85extern struct perf_event * 86extern struct perf_event *
86register_wide_hw_breakpoint_cpu(struct perf_event_attr *attr, 87register_wide_hw_breakpoint_cpu(struct perf_event_attr *attr,
87 perf_overflow_handler_t triggered, 88 perf_overflow_handler_t triggered,
89 void *context,
88 int cpu); 90 int cpu);
89 91
90extern struct perf_event * __percpu * 92extern struct perf_event * __percpu *
91register_wide_hw_breakpoint(struct perf_event_attr *attr, 93register_wide_hw_breakpoint(struct perf_event_attr *attr,
92 perf_overflow_handler_t triggered); 94 perf_overflow_handler_t triggered,
95 void *context);
93 96
94extern int register_perf_hw_breakpoint(struct perf_event *bp); 97extern int register_perf_hw_breakpoint(struct perf_event *bp);
95extern int __register_perf_hw_breakpoint(struct perf_event *bp); 98extern int __register_perf_hw_breakpoint(struct perf_event *bp);
@@ -115,6 +118,7 @@ static inline int __init init_hw_breakpoint(void) { return 0; }
115static inline struct perf_event * 118static inline struct perf_event *
116register_user_hw_breakpoint(struct perf_event_attr *attr, 119register_user_hw_breakpoint(struct perf_event_attr *attr,
117 perf_overflow_handler_t triggered, 120 perf_overflow_handler_t triggered,
121 void *context,
118 struct task_struct *tsk) { return NULL; } 122 struct task_struct *tsk) { return NULL; }
119static inline int 123static inline int
120modify_user_hw_breakpoint(struct perf_event *bp, 124modify_user_hw_breakpoint(struct perf_event *bp,
@@ -122,10 +126,12 @@ modify_user_hw_breakpoint(struct perf_event *bp,
122static inline struct perf_event * 126static inline struct perf_event *
123register_wide_hw_breakpoint_cpu(struct perf_event_attr *attr, 127register_wide_hw_breakpoint_cpu(struct perf_event_attr *attr,
124 perf_overflow_handler_t triggered, 128 perf_overflow_handler_t triggered,
129 void *context,
125 int cpu) { return NULL; } 130 int cpu) { return NULL; }
126static inline struct perf_event * __percpu * 131static inline struct perf_event * __percpu *
127register_wide_hw_breakpoint(struct perf_event_attr *attr, 132register_wide_hw_breakpoint(struct perf_event_attr *attr,
128 perf_overflow_handler_t triggered) { return NULL; } 133 perf_overflow_handler_t triggered,
134 void *context) { return NULL; }
129static inline int 135static inline int
130register_perf_hw_breakpoint(struct perf_event *bp) { return -ENOSYS; } 136register_perf_hw_breakpoint(struct perf_event *bp) { return -ENOSYS; }
131static inline int 137static inline int
diff --git a/include/linux/hw_random.h b/include/linux/hw_random.h
index 9bede7633f74..b4b0eef5fddf 100644
--- a/include/linux/hw_random.h
+++ b/include/linux/hw_random.h
@@ -25,7 +25,7 @@
25 * there is always data available. *OBSOLETE* 25 * there is always data available. *OBSOLETE*
26 * @data_read: Read data from the RNG device. 26 * @data_read: Read data from the RNG device.
27 * Returns the number of lower random bytes in "data". 27 * Returns the number of lower random bytes in "data".
28 * Must not be NULL. *OSOLETE* 28 * Must not be NULL. *OBSOLETE*
29 * @read: New API. drivers can fill up to max bytes of data 29 * @read: New API. drivers can fill up to max bytes of data
30 * into the buffer. The buffer is aligned for any type. 30 * into the buffer. The buffer is aligned for any type.
31 * @priv: Private data, for use by the RNG driver. 31 * @priv: Private data, for use by the RNG driver.
diff --git a/include/linux/i2c/adp8870.h b/include/linux/i2c/adp8870.h
new file mode 100644
index 000000000000..624dceccbd5b
--- /dev/null
+++ b/include/linux/i2c/adp8870.h
@@ -0,0 +1,153 @@
1/*
2 * Definitions and platform data for Analog Devices
3 * Backlight drivers ADP8870
4 *
5 * Copyright 2009-2010 Analog Devices Inc.
6 *
7 * Licensed under the GPL-2 or later.
8 */
9
10#ifndef __LINUX_I2C_ADP8870_H
11#define __LINUX_I2C_ADP8870_H
12
13#define ID_ADP8870 8870
14
15#define ADP8870_MAX_BRIGHTNESS 0x7F
16#define FLAG_OFFT_SHIFT 8
17
18/*
19 * LEDs subdevice platform data
20 */
21
22#define ADP8870_LED_DIS_BLINK (0 << FLAG_OFFT_SHIFT)
23#define ADP8870_LED_OFFT_600ms (1 << FLAG_OFFT_SHIFT)
24#define ADP8870_LED_OFFT_1200ms (2 << FLAG_OFFT_SHIFT)
25#define ADP8870_LED_OFFT_1800ms (3 << FLAG_OFFT_SHIFT)
26
27#define ADP8870_LED_ONT_200ms 0
28#define ADP8870_LED_ONT_600ms 1
29#define ADP8870_LED_ONT_800ms 2
30#define ADP8870_LED_ONT_1200ms 3
31
32#define ADP8870_LED_D7 (7)
33#define ADP8870_LED_D6 (6)
34#define ADP8870_LED_D5 (5)
35#define ADP8870_LED_D4 (4)
36#define ADP8870_LED_D3 (3)
37#define ADP8870_LED_D2 (2)
38#define ADP8870_LED_D1 (1)
39
40/*
41 * Backlight subdevice platform data
42 */
43
44#define ADP8870_BL_D7 (1 << 6)
45#define ADP8870_BL_D6 (1 << 5)
46#define ADP8870_BL_D5 (1 << 4)
47#define ADP8870_BL_D4 (1 << 3)
48#define ADP8870_BL_D3 (1 << 2)
49#define ADP8870_BL_D2 (1 << 1)
50#define ADP8870_BL_D1 (1 << 0)
51
52#define ADP8870_FADE_T_DIS 0 /* Fade Timer Disabled */
53#define ADP8870_FADE_T_300ms 1 /* 0.3 Sec */
54#define ADP8870_FADE_T_600ms 2
55#define ADP8870_FADE_T_900ms 3
56#define ADP8870_FADE_T_1200ms 4
57#define ADP8870_FADE_T_1500ms 5
58#define ADP8870_FADE_T_1800ms 6
59#define ADP8870_FADE_T_2100ms 7
60#define ADP8870_FADE_T_2400ms 8
61#define ADP8870_FADE_T_2700ms 9
62#define ADP8870_FADE_T_3000ms 10
63#define ADP8870_FADE_T_3500ms 11
64#define ADP8870_FADE_T_4000ms 12
65#define ADP8870_FADE_T_4500ms 13
66#define ADP8870_FADE_T_5000ms 14
67#define ADP8870_FADE_T_5500ms 15 /* 5.5 Sec */
68
69#define ADP8870_FADE_LAW_LINEAR 0
70#define ADP8870_FADE_LAW_SQUARE 1
71#define ADP8870_FADE_LAW_CUBIC1 2
72#define ADP8870_FADE_LAW_CUBIC2 3
73
74#define ADP8870_BL_AMBL_FILT_80ms 0 /* Light sensor filter time */
75#define ADP8870_BL_AMBL_FILT_160ms 1
76#define ADP8870_BL_AMBL_FILT_320ms 2
77#define ADP8870_BL_AMBL_FILT_640ms 3
78#define ADP8870_BL_AMBL_FILT_1280ms 4
79#define ADP8870_BL_AMBL_FILT_2560ms 5
80#define ADP8870_BL_AMBL_FILT_5120ms 6
81#define ADP8870_BL_AMBL_FILT_10240ms 7 /* 10.24 sec */
82
83/*
84 * Blacklight current 0..30mA
85 */
86#define ADP8870_BL_CUR_mA(I) ((I * 127) / 30)
87
88/*
89 * L2 comparator current 0..1106uA
90 */
91#define ADP8870_L2_COMP_CURR_uA(I) ((I * 255) / 1106)
92
93/*
94 * L3 comparator current 0..551uA
95 */
96#define ADP8870_L3_COMP_CURR_uA(I) ((I * 255) / 551)
97
98/*
99 * L4 comparator current 0..275uA
100 */
101#define ADP8870_L4_COMP_CURR_uA(I) ((I * 255) / 275)
102
103/*
104 * L5 comparator current 0..138uA
105 */
106#define ADP8870_L5_COMP_CURR_uA(I) ((I * 255) / 138)
107
108struct adp8870_backlight_platform_data {
109 u8 bl_led_assign; /* 1 = Backlight 0 = Individual LED */
110 u8 pwm_assign; /* 1 = Enables PWM mode */
111
112 u8 bl_fade_in; /* Backlight Fade-In Timer */
113 u8 bl_fade_out; /* Backlight Fade-Out Timer */
114 u8 bl_fade_law; /* fade-on/fade-off transfer characteristic */
115
116 u8 en_ambl_sens; /* 1 = enable ambient light sensor */
117 u8 abml_filt; /* Light sensor filter time */
118
119 u8 l1_daylight_max; /* use BL_CUR_mA(I) 0 <= I <= 30 mA */
120 u8 l1_daylight_dim; /* typ = 0, use BL_CUR_mA(I) 0 <= I <= 30 mA */
121 u8 l2_bright_max; /* use BL_CUR_mA(I) 0 <= I <= 30 mA */
122 u8 l2_bright_dim; /* typ = 0, use BL_CUR_mA(I) 0 <= I <= 30 mA */
123 u8 l3_office_max; /* use BL_CUR_mA(I) 0 <= I <= 30 mA */
124 u8 l3_office_dim; /* typ = 0, use BL_CUR_mA(I) 0 <= I <= 30 mA */
125 u8 l4_indoor_max; /* use BL_CUR_mA(I) 0 <= I <= 30 mA */
126 u8 l4_indor_dim; /* typ = 0, use BL_CUR_mA(I) 0 <= I <= 30 mA */
127 u8 l5_dark_max; /* use BL_CUR_mA(I) 0 <= I <= 30 mA */
128 u8 l5_dark_dim; /* typ = 0, use BL_CUR_mA(I) 0 <= I <= 30 mA */
129
130 u8 l2_trip; /* use L2_COMP_CURR_uA(I) 0 <= I <= 1106 uA */
131 u8 l2_hyst; /* use L2_COMP_CURR_uA(I) 0 <= I <= 1106 uA */
132 u8 l3_trip; /* use L3_COMP_CURR_uA(I) 0 <= I <= 551 uA */
133 u8 l3_hyst; /* use L3_COMP_CURR_uA(I) 0 <= I <= 551 uA */
134 u8 l4_trip; /* use L4_COMP_CURR_uA(I) 0 <= I <= 275 uA */
135 u8 l4_hyst; /* use L4_COMP_CURR_uA(I) 0 <= I <= 275 uA */
136 u8 l5_trip; /* use L5_COMP_CURR_uA(I) 0 <= I <= 138 uA */
137 u8 l5_hyst; /* use L6_COMP_CURR_uA(I) 0 <= I <= 138 uA */
138
139 /**
140 * Independent Current Sinks / LEDS
141 * Sinks not assigned to the Backlight can be exposed to
142 * user space using the LEDS CLASS interface
143 */
144
145 int num_leds;
146 struct led_info *leds;
147 u8 led_fade_in; /* LED Fade-In Timer */
148 u8 led_fade_out; /* LED Fade-Out Timer */
149 u8 led_fade_law; /* fade-on/fade-off transfer characteristic */
150 u8 led_on_time;
151};
152
153#endif /* __LINUX_I2C_ADP8870_H */
diff --git a/include/linux/i8253.h b/include/linux/i8253.h
new file mode 100644
index 000000000000..e6bb36a97519
--- /dev/null
+++ b/include/linux/i8253.h
@@ -0,0 +1,29 @@
1/*
2 * This file is subject to the terms and conditions of the GNU General Public
3 * License. See the file "COPYING" in the main directory of this archive
4 * for more details.
5 *
6 * Machine specific IO port address definition for generic.
7 * Written by Osamu Tomita <tomita@cinet.co.jp>
8 */
9#ifndef __LINUX_I8253_H
10#define __LINUX_I8253_H
11
12#include <linux/param.h>
13#include <linux/spinlock.h>
14#include <linux/timex.h>
15
16/* i8253A PIT registers */
17#define PIT_MODE 0x43
18#define PIT_CH0 0x40
19#define PIT_CH2 0x42
20
21#define PIT_LATCH ((PIT_TICK_RATE + HZ/2) / HZ)
22
23extern raw_spinlock_t i8253_lock;
24extern struct clock_event_device i8253_clockevent;
25extern void clockevent_i8253_init(bool oneshot);
26
27extern void setup_pit_timer(void);
28
29#endif /* __LINUX_I8253_H */
diff --git a/include/linux/ieee80211.h b/include/linux/ieee80211.h
index bf56b6f78270..54c878960872 100644
--- a/include/linux/ieee80211.h
+++ b/include/linux/ieee80211.h
@@ -117,8 +117,19 @@
117#define IEEE80211_MAX_MESH_ID_LEN 32 117#define IEEE80211_MAX_MESH_ID_LEN 32
118 118
119#define IEEE80211_QOS_CTL_LEN 2 119#define IEEE80211_QOS_CTL_LEN 2
120#define IEEE80211_QOS_CTL_TID_MASK 0x000F 120/* 1d tag mask */
121#define IEEE80211_QOS_CTL_TAG1D_MASK 0x0007 121#define IEEE80211_QOS_CTL_TAG1D_MASK 0x0007
122/* TID mask */
123#define IEEE80211_QOS_CTL_TID_MASK 0x000f
124/* EOSP */
125#define IEEE80211_QOS_CTL_EOSP 0x0010
126/* ACK policy */
127#define IEEE80211_QOS_CTL_ACK_POLICY_NORMAL 0x0000
128#define IEEE80211_QOS_CTL_ACK_POLICY_NOACK 0x0020
129#define IEEE80211_QOS_CTL_ACK_POLICY_NO_EXPL 0x0040
130#define IEEE80211_QOS_CTL_ACK_POLICY_BLOCKACK 0x0060
131/* A-MSDU 802.11n */
132#define IEEE80211_QOS_CTL_A_MSDU_PRESENT 0x0080
122 133
123/* U-APSD queue for WMM IEs sent by AP */ 134/* U-APSD queue for WMM IEs sent by AP */
124#define IEEE80211_WMM_IE_AP_QOSINFO_UAPSD (1<<7) 135#define IEEE80211_WMM_IE_AP_QOSINFO_UAPSD (1<<7)
@@ -1423,9 +1434,6 @@ enum ieee80211_sa_query_action {
1423}; 1434};
1424 1435
1425 1436
1426/* A-MSDU 802.11n */
1427#define IEEE80211_QOS_CONTROL_A_MSDU_PRESENT 0x0080
1428
1429/* cipher suite selectors */ 1437/* cipher suite selectors */
1430#define WLAN_CIPHER_SUITE_USE_GROUP 0x000FAC00 1438#define WLAN_CIPHER_SUITE_USE_GROUP 0x000FAC00
1431#define WLAN_CIPHER_SUITE_WEP40 0x000FAC01 1439#define WLAN_CIPHER_SUITE_WEP40 0x000FAC01
@@ -1445,6 +1453,43 @@ enum ieee80211_sa_query_action {
1445 1453
1446#define WLAN_PMKID_LEN 16 1454#define WLAN_PMKID_LEN 16
1447 1455
1456/*
1457 * WMM/802.11e Tspec Element
1458 */
1459#define IEEE80211_WMM_IE_TSPEC_TID_MASK 0x0F
1460#define IEEE80211_WMM_IE_TSPEC_TID_SHIFT 1
1461
1462enum ieee80211_tspec_status_code {
1463 IEEE80211_TSPEC_STATUS_ADMISS_ACCEPTED = 0,
1464 IEEE80211_TSPEC_STATUS_ADDTS_INVAL_PARAMS = 0x1,
1465};
1466
1467struct ieee80211_tspec_ie {
1468 u8 element_id;
1469 u8 len;
1470 u8 oui[3];
1471 u8 oui_type;
1472 u8 oui_subtype;
1473 u8 version;
1474 __le16 tsinfo;
1475 u8 tsinfo_resvd;
1476 __le16 nominal_msdu;
1477 __le16 max_msdu;
1478 __le32 min_service_int;
1479 __le32 max_service_int;
1480 __le32 inactivity_int;
1481 __le32 suspension_int;
1482 __le32 service_start_time;
1483 __le32 min_data_rate;
1484 __le32 mean_data_rate;
1485 __le32 peak_data_rate;
1486 __le32 max_burst_size;
1487 __le32 delay_bound;
1488 __le32 min_phy_rate;
1489 __le16 sba;
1490 __le16 medium_time;
1491} __packed;
1492
1448/** 1493/**
1449 * ieee80211_get_qos_ctl - get pointer to qos control bytes 1494 * ieee80211_get_qos_ctl - get pointer to qos control bytes
1450 * @hdr: the frame 1495 * @hdr: the frame
diff --git a/include/linux/if_ether.h b/include/linux/if_ether.h
index 0065ffd3226b..a3d99ff6e3b5 100644
--- a/include/linux/if_ether.h
+++ b/include/linux/if_ether.h
@@ -78,10 +78,15 @@
78 */ 78 */
79#define ETH_P_PAE 0x888E /* Port Access Entity (IEEE 802.1X) */ 79#define ETH_P_PAE 0x888E /* Port Access Entity (IEEE 802.1X) */
80#define ETH_P_AOE 0x88A2 /* ATA over Ethernet */ 80#define ETH_P_AOE 0x88A2 /* ATA over Ethernet */
81#define ETH_P_8021AD 0x88A8 /* 802.1ad Service VLAN */
81#define ETH_P_TIPC 0x88CA /* TIPC */ 82#define ETH_P_TIPC 0x88CA /* TIPC */
83#define ETH_P_8021AH 0x88E7 /* 802.1ah Backbone Service Tag */
82#define ETH_P_1588 0x88F7 /* IEEE 1588 Timesync */ 84#define ETH_P_1588 0x88F7 /* IEEE 1588 Timesync */
83#define ETH_P_FCOE 0x8906 /* Fibre Channel over Ethernet */ 85#define ETH_P_FCOE 0x8906 /* Fibre Channel over Ethernet */
84#define ETH_P_FIP 0x8914 /* FCoE Initialization Protocol */ 86#define ETH_P_FIP 0x8914 /* FCoE Initialization Protocol */
87#define ETH_P_QINQ1 0x9100 /* deprecated QinQ VLAN [ NOT AN OFFICIALLY REGISTERED ID ] */
88#define ETH_P_QINQ2 0x9200 /* deprecated QinQ VLAN [ NOT AN OFFICIALLY REGISTERED ID ] */
89#define ETH_P_QINQ3 0x9300 /* deprecated QinQ VLAN [ NOT AN OFFICIALLY REGISTERED ID ] */
85#define ETH_P_EDSA 0xDADA /* Ethertype DSA [ NOT AN OFFICIALLY REGISTERED ID ] */ 90#define ETH_P_EDSA 0xDADA /* Ethertype DSA [ NOT AN OFFICIALLY REGISTERED ID ] */
86 91
87/* 92/*
diff --git a/include/linux/if_packet.h b/include/linux/if_packet.h
index 6d66ce1791a9..c1486060f5ed 100644
--- a/include/linux/if_packet.h
+++ b/include/linux/if_packet.h
@@ -49,6 +49,12 @@ struct sockaddr_ll {
49#define PACKET_VNET_HDR 15 49#define PACKET_VNET_HDR 15
50#define PACKET_TX_TIMESTAMP 16 50#define PACKET_TX_TIMESTAMP 16
51#define PACKET_TIMESTAMP 17 51#define PACKET_TIMESTAMP 17
52#define PACKET_FANOUT 18
53
54#define PACKET_FANOUT_HASH 0
55#define PACKET_FANOUT_LB 1
56#define PACKET_FANOUT_CPU 2
57#define PACKET_FANOUT_FLAG_DEFRAG 0x8000
52 58
53struct tpacket_stats { 59struct tpacket_stats {
54 unsigned int tp_packets; 60 unsigned int tp_packets;
@@ -62,6 +68,7 @@ struct tpacket_auxdata {
62 __u16 tp_mac; 68 __u16 tp_mac;
63 __u16 tp_net; 69 __u16 tp_net;
64 __u16 tp_vlan_tci; 70 __u16 tp_vlan_tci;
71 __u16 tp_padding;
65}; 72};
66 73
67/* Rx ring - header status */ 74/* Rx ring - header status */
@@ -101,6 +108,7 @@ struct tpacket2_hdr {
101 __u32 tp_sec; 108 __u32 tp_sec;
102 __u32 tp_nsec; 109 __u32 tp_nsec;
103 __u16 tp_vlan_tci; 110 __u16 tp_vlan_tci;
111 __u16 tp_padding;
104}; 112};
105 113
106#define TPACKET2_HDRLEN (TPACKET_ALIGN(sizeof(struct tpacket2_hdr)) + sizeof(struct sockaddr_ll)) 114#define TPACKET2_HDRLEN (TPACKET_ALIGN(sizeof(struct tpacket2_hdr)) + sizeof(struct sockaddr_ll))
diff --git a/include/linux/if_vlan.h b/include/linux/if_vlan.h
index dc01681fbb42..44da4822bcab 100644
--- a/include/linux/if_vlan.h
+++ b/include/linux/if_vlan.h
@@ -91,25 +91,6 @@ struct vlan_group {
91 struct rcu_head rcu; 91 struct rcu_head rcu;
92}; 92};
93 93
94static inline struct net_device *vlan_group_get_device(struct vlan_group *vg,
95 u16 vlan_id)
96{
97 struct net_device **array;
98 array = vg->vlan_devices_arrays[vlan_id / VLAN_GROUP_ARRAY_PART_LEN];
99 return array ? array[vlan_id % VLAN_GROUP_ARRAY_PART_LEN] : NULL;
100}
101
102static inline void vlan_group_set_device(struct vlan_group *vg,
103 u16 vlan_id,
104 struct net_device *dev)
105{
106 struct net_device **array;
107 if (!vg)
108 return;
109 array = vg->vlan_devices_arrays[vlan_id / VLAN_GROUP_ARRAY_PART_LEN];
110 array[vlan_id % VLAN_GROUP_ARRAY_PART_LEN] = dev;
111}
112
113static inline int is_vlan_dev(struct net_device *dev) 94static inline int is_vlan_dev(struct net_device *dev)
114{ 95{
115 return dev->priv_flags & IFF_802_1Q_VLAN; 96 return dev->priv_flags & IFF_802_1Q_VLAN;
@@ -119,35 +100,18 @@ static inline int is_vlan_dev(struct net_device *dev)
119#define vlan_tx_tag_get(__skb) ((__skb)->vlan_tci & ~VLAN_TAG_PRESENT) 100#define vlan_tx_tag_get(__skb) ((__skb)->vlan_tci & ~VLAN_TAG_PRESENT)
120 101
121#if defined(CONFIG_VLAN_8021Q) || defined(CONFIG_VLAN_8021Q_MODULE) 102#if defined(CONFIG_VLAN_8021Q) || defined(CONFIG_VLAN_8021Q_MODULE)
122/* Must be invoked with rcu_read_lock or with RTNL. */
123static inline struct net_device *vlan_find_dev(struct net_device *real_dev,
124 u16 vlan_id)
125{
126 struct vlan_group *grp = rcu_dereference_rtnl(real_dev->vlgrp);
127
128 if (grp)
129 return vlan_group_get_device(grp, vlan_id);
130
131 return NULL;
132}
133 103
104extern struct net_device *__vlan_find_dev_deep(struct net_device *real_dev,
105 u16 vlan_id);
134extern struct net_device *vlan_dev_real_dev(const struct net_device *dev); 106extern struct net_device *vlan_dev_real_dev(const struct net_device *dev);
135extern u16 vlan_dev_vlan_id(const struct net_device *dev); 107extern u16 vlan_dev_vlan_id(const struct net_device *dev);
136 108
137extern int __vlan_hwaccel_rx(struct sk_buff *skb, struct vlan_group *grp,
138 u16 vlan_tci, int polling);
139extern bool vlan_do_receive(struct sk_buff **skb); 109extern bool vlan_do_receive(struct sk_buff **skb);
140extern struct sk_buff *vlan_untag(struct sk_buff *skb); 110extern struct sk_buff *vlan_untag(struct sk_buff *skb);
141extern gro_result_t
142vlan_gro_receive(struct napi_struct *napi, struct vlan_group *grp,
143 unsigned int vlan_tci, struct sk_buff *skb);
144extern gro_result_t
145vlan_gro_frags(struct napi_struct *napi, struct vlan_group *grp,
146 unsigned int vlan_tci);
147 111
148#else 112#else
149static inline struct net_device *vlan_find_dev(struct net_device *real_dev, 113static inline struct net_device *
150 u16 vlan_id) 114__vlan_find_dev_deep(struct net_device *real_dev, u16 vlan_id)
151{ 115{
152 return NULL; 116 return NULL;
153} 117}
@@ -164,13 +128,6 @@ static inline u16 vlan_dev_vlan_id(const struct net_device *dev)
164 return 0; 128 return 0;
165} 129}
166 130
167static inline int __vlan_hwaccel_rx(struct sk_buff *skb, struct vlan_group *grp,
168 u16 vlan_tci, int polling)
169{
170 BUG();
171 return NET_XMIT_SUCCESS;
172}
173
174static inline bool vlan_do_receive(struct sk_buff **skb) 131static inline bool vlan_do_receive(struct sk_buff **skb)
175{ 132{
176 if ((*skb)->vlan_tci & VLAN_VID_MASK) 133 if ((*skb)->vlan_tci & VLAN_VID_MASK)
@@ -182,50 +139,10 @@ static inline struct sk_buff *vlan_untag(struct sk_buff *skb)
182{ 139{
183 return skb; 140 return skb;
184} 141}
185
186static inline gro_result_t
187vlan_gro_receive(struct napi_struct *napi, struct vlan_group *grp,
188 unsigned int vlan_tci, struct sk_buff *skb)
189{
190 return GRO_DROP;
191}
192
193static inline gro_result_t
194vlan_gro_frags(struct napi_struct *napi, struct vlan_group *grp,
195 unsigned int vlan_tci)
196{
197 return GRO_DROP;
198}
199#endif 142#endif
200 143
201/** 144/**
202 * vlan_hwaccel_rx - netif_rx wrapper for VLAN RX acceleration 145 * vlan_insert_tag - regular VLAN tag inserting
203 * @skb: buffer
204 * @grp: vlan group
205 * @vlan_tci: VLAN TCI as received from the card
206 */
207static inline int vlan_hwaccel_rx(struct sk_buff *skb,
208 struct vlan_group *grp,
209 u16 vlan_tci)
210{
211 return __vlan_hwaccel_rx(skb, grp, vlan_tci, 0);
212}
213
214/**
215 * vlan_hwaccel_receive_skb - netif_receive_skb wrapper for VLAN RX acceleration
216 * @skb: buffer
217 * @grp: vlan group
218 * @vlan_tci: VLAN TCI as received from the card
219 */
220static inline int vlan_hwaccel_receive_skb(struct sk_buff *skb,
221 struct vlan_group *grp,
222 u16 vlan_tci)
223{
224 return __vlan_hwaccel_rx(skb, grp, vlan_tci, 1);
225}
226
227/**
228 * __vlan_put_tag - regular VLAN tag inserting
229 * @skb: skbuff to tag 146 * @skb: skbuff to tag
230 * @vlan_tci: VLAN TCI to insert 147 * @vlan_tci: VLAN TCI to insert
231 * 148 *
@@ -234,8 +151,10 @@ static inline int vlan_hwaccel_receive_skb(struct sk_buff *skb,
234 * 151 *
235 * Following the skb_unshare() example, in case of error, the calling function 152 * Following the skb_unshare() example, in case of error, the calling function
236 * doesn't have to worry about freeing the original skb. 153 * doesn't have to worry about freeing the original skb.
154 *
155 * Does not change skb->protocol so this function can be used during receive.
237 */ 156 */
238static inline struct sk_buff *__vlan_put_tag(struct sk_buff *skb, u16 vlan_tci) 157static inline struct sk_buff *vlan_insert_tag(struct sk_buff *skb, u16 vlan_tci)
239{ 158{
240 struct vlan_ethhdr *veth; 159 struct vlan_ethhdr *veth;
241 160
@@ -255,8 +174,25 @@ static inline struct sk_buff *__vlan_put_tag(struct sk_buff *skb, u16 vlan_tci)
255 /* now, the TCI */ 174 /* now, the TCI */
256 veth->h_vlan_TCI = htons(vlan_tci); 175 veth->h_vlan_TCI = htons(vlan_tci);
257 176
258 skb->protocol = htons(ETH_P_8021Q); 177 return skb;
178}
259 179
180/**
181 * __vlan_put_tag - regular VLAN tag inserting
182 * @skb: skbuff to tag
183 * @vlan_tci: VLAN TCI to insert
184 *
185 * Inserts the VLAN tag into @skb as part of the payload
186 * Returns a VLAN tagged skb. If a new skb is created, @skb is freed.
187 *
188 * Following the skb_unshare() example, in case of error, the calling function
189 * doesn't have to worry about freeing the original skb.
190 */
191static inline struct sk_buff *__vlan_put_tag(struct sk_buff *skb, u16 vlan_tci)
192{
193 skb = vlan_insert_tag(skb, vlan_tci);
194 if (skb)
195 skb->protocol = htons(ETH_P_8021Q);
260 return skb; 196 return skb;
261} 197}
262 198
diff --git a/include/linux/inet_lro.h b/include/linux/inet_lro.h
index c4335faebb63..2cf55afbcd4e 100644
--- a/include/linux/inet_lro.h
+++ b/include/linux/inet_lro.h
@@ -50,7 +50,6 @@ struct net_lro_desc {
50 struct skb_frag_struct *next_frag; 50 struct skb_frag_struct *next_frag;
51 struct iphdr *iph; 51 struct iphdr *iph;
52 struct tcphdr *tcph; 52 struct tcphdr *tcph;
53 struct vlan_group *vgrp;
54 __wsum data_csum; 53 __wsum data_csum;
55 __be32 tcp_rcv_tsecr; 54 __be32 tcp_rcv_tsecr;
56 __be32 tcp_rcv_tsval; 55 __be32 tcp_rcv_tsval;
@@ -60,7 +59,6 @@ struct net_lro_desc {
60 u16 ip_tot_len; 59 u16 ip_tot_len;
61 u16 tcp_saw_tstamp; /* timestamps enabled */ 60 u16 tcp_saw_tstamp; /* timestamps enabled */
62 __be16 tcp_window; 61 __be16 tcp_window;
63 u16 vlan_tag;
64 int pkt_aggr_cnt; /* counts aggregated packets */ 62 int pkt_aggr_cnt; /* counts aggregated packets */
65 int vlan_packet; 63 int vlan_packet;
66 int mss; 64 int mss;
@@ -137,16 +135,6 @@ void lro_receive_skb(struct net_lro_mgr *lro_mgr,
137 void *priv); 135 void *priv);
138 136
139/* 137/*
140 * Processes a SKB with VLAN HW acceleration support
141 */
142
143void lro_vlan_hwaccel_receive_skb(struct net_lro_mgr *lro_mgr,
144 struct sk_buff *skb,
145 struct vlan_group *vgrp,
146 u16 vlan_tag,
147 void *priv);
148
149/*
150 * Processes a fragment list 138 * Processes a fragment list
151 * 139 *
152 * This functions aggregate fragments and generate SKBs do pass 140 * This functions aggregate fragments and generate SKBs do pass
@@ -165,13 +153,6 @@ void lro_receive_frags(struct net_lro_mgr *lro_mgr,
165 struct skb_frag_struct *frags, 153 struct skb_frag_struct *frags,
166 int len, int true_size, void *priv, __wsum sum); 154 int len, int true_size, void *priv, __wsum sum);
167 155
168void lro_vlan_hwaccel_receive_frags(struct net_lro_mgr *lro_mgr,
169 struct skb_frag_struct *frags,
170 int len, int true_size,
171 struct vlan_group *vgrp,
172 u16 vlan_tag,
173 void *priv, __wsum sum);
174
175/* 156/*
176 * Forward all aggregated SKBs held by lro_mgr to network stack 157 * Forward all aggregated SKBs held by lro_mgr to network stack
177 */ 158 */
diff --git a/include/linux/init_task.h b/include/linux/init_task.h
index 580f70c02391..d14e058aaeed 100644
--- a/include/linux/init_task.h
+++ b/include/linux/init_task.h
@@ -176,7 +176,6 @@ extern struct cred init_cred;
176 .alloc_lock = __SPIN_LOCK_UNLOCKED(tsk.alloc_lock), \ 176 .alloc_lock = __SPIN_LOCK_UNLOCKED(tsk.alloc_lock), \
177 .journal_info = NULL, \ 177 .journal_info = NULL, \
178 .cpu_timers = INIT_CPU_TIMERS(tsk.cpu_timers), \ 178 .cpu_timers = INIT_CPU_TIMERS(tsk.cpu_timers), \
179 .fs_excl = ATOMIC_INIT(0), \
180 .pi_lock = __RAW_SPIN_LOCK_UNLOCKED(tsk.pi_lock), \ 179 .pi_lock = __RAW_SPIN_LOCK_UNLOCKED(tsk.pi_lock), \
181 .timer_slack_ns = 50000, /* 50 usec default slack */ \ 180 .timer_slack_ns = 50000, /* 50 usec default slack */ \
182 .pids = { \ 181 .pids = { \
diff --git a/include/linux/input/sh_keysc.h b/include/linux/input/sh_keysc.h
index 649dc7f12925..5d253cd93691 100644
--- a/include/linux/input/sh_keysc.h
+++ b/include/linux/input/sh_keysc.h
@@ -1,7 +1,7 @@
1#ifndef __SH_KEYSC_H__ 1#ifndef __SH_KEYSC_H__
2#define __SH_KEYSC_H__ 2#define __SH_KEYSC_H__
3 3
4#define SH_KEYSC_MAXKEYS 49 4#define SH_KEYSC_MAXKEYS 64
5 5
6struct sh_keysc_info { 6struct sh_keysc_info {
7 enum { SH_KEYSC_MODE_1, SH_KEYSC_MODE_2, SH_KEYSC_MODE_3, 7 enum { SH_KEYSC_MODE_1, SH_KEYSC_MODE_2, SH_KEYSC_MODE_3,
diff --git a/include/linux/interrupt.h b/include/linux/interrupt.h
index 6c12989839d9..f6efed0039ed 100644
--- a/include/linux/interrupt.h
+++ b/include/linux/interrupt.h
@@ -414,6 +414,7 @@ enum
414 TASKLET_SOFTIRQ, 414 TASKLET_SOFTIRQ,
415 SCHED_SOFTIRQ, 415 SCHED_SOFTIRQ,
416 HRTIMER_SOFTIRQ, 416 HRTIMER_SOFTIRQ,
417 RCU_SOFTIRQ, /* Preferable RCU should always be the last softirq */
417 418
418 NR_SOFTIRQS 419 NR_SOFTIRQS
419}; 420};
diff --git a/include/linux/iocontext.h b/include/linux/iocontext.h
index b2eee896dcbc..5037a0ad2312 100644
--- a/include/linux/iocontext.h
+++ b/include/linux/iocontext.h
@@ -5,6 +5,14 @@
5#include <linux/rcupdate.h> 5#include <linux/rcupdate.h>
6 6
7struct cfq_queue; 7struct cfq_queue;
8struct cfq_ttime {
9 unsigned long last_end_request;
10
11 unsigned long ttime_total;
12 unsigned long ttime_samples;
13 unsigned long ttime_mean;
14};
15
8struct cfq_io_context { 16struct cfq_io_context {
9 void *key; 17 void *key;
10 18
@@ -12,11 +20,7 @@ struct cfq_io_context {
12 20
13 struct io_context *ioc; 21 struct io_context *ioc;
14 22
15 unsigned long last_end_request; 23 struct cfq_ttime ttime;
16
17 unsigned long ttime_total;
18 unsigned long ttime_samples;
19 unsigned long ttime_mean;
20 24
21 struct list_head queue_list; 25 struct list_head queue_list;
22 struct hlist_node cic_list; 26 struct hlist_node cic_list;
diff --git a/include/linux/iommu.h b/include/linux/iommu.h
index 0a2ba4098996..9940319d6f9d 100644
--- a/include/linux/iommu.h
+++ b/include/linux/iommu.h
@@ -19,6 +19,8 @@
19#ifndef __LINUX_IOMMU_H 19#ifndef __LINUX_IOMMU_H
20#define __LINUX_IOMMU_H 20#define __LINUX_IOMMU_H
21 21
22#include <linux/errno.h>
23
22#define IOMMU_READ (1) 24#define IOMMU_READ (1)
23#define IOMMU_WRITE (2) 25#define IOMMU_WRITE (2)
24#define IOMMU_CACHE (4) /* DMA cache coherency */ 26#define IOMMU_CACHE (4) /* DMA cache coherency */
diff --git a/include/linux/ioport.h b/include/linux/ioport.h
index e9bb22cba764..c2ebfe66177c 100644
--- a/include/linux/ioport.h
+++ b/include/linux/ioport.h
@@ -109,6 +109,36 @@ struct resource_list {
109/* PCI control bits. Shares IORESOURCE_BITS with above PCI ROM. */ 109/* PCI control bits. Shares IORESOURCE_BITS with above PCI ROM. */
110#define IORESOURCE_PCI_FIXED (1<<4) /* Do not move resource */ 110#define IORESOURCE_PCI_FIXED (1<<4) /* Do not move resource */
111 111
112
113/* helpers to define resources */
114#define DEFINE_RES_NAMED(_start, _size, _name, _flags) \
115 { \
116 .start = (_start), \
117 .end = (_start) + (_size) - 1, \
118 .name = (_name), \
119 .flags = (_flags), \
120 }
121
122#define DEFINE_RES_IO_NAMED(_start, _size, _name) \
123 DEFINE_RES_NAMED((_start), (_size), (_name), IORESOURCE_IO)
124#define DEFINE_RES_IO(_start, _size) \
125 DEFINE_RES_IO_NAMED((_start), (_size), NULL)
126
127#define DEFINE_RES_MEM_NAMED(_start, _size, _name) \
128 DEFINE_RES_NAMED((_start), (_size), (_name), IORESOURCE_MEM)
129#define DEFINE_RES_MEM(_start, _size) \
130 DEFINE_RES_MEM_NAMED((_start), (_size), NULL)
131
132#define DEFINE_RES_IRQ_NAMED(_irq, _name) \
133 DEFINE_RES_NAMED((_irq), 1, (_name), IORESOURCE_IRQ)
134#define DEFINE_RES_IRQ(_irq) \
135 DEFINE_RES_IRQ_NAMED((_irq), NULL)
136
137#define DEFINE_RES_DMA_NAMED(_dma, _name) \
138 DEFINE_RES_NAMED((_dma), 1, (_name), IORESOURCE_DMA)
139#define DEFINE_RES_DMA(_dma) \
140 DEFINE_RES_DMA_NAMED((_dma), NULL)
141
112/* PC/ISA/whatever - the normal PC address spaces: IO and memory */ 142/* PC/ISA/whatever - the normal PC address spaces: IO and memory */
113extern struct resource ioport_resource; 143extern struct resource ioport_resource;
114extern struct resource iomem_resource; 144extern struct resource iomem_resource;
diff --git a/include/linux/irq.h b/include/linux/irq.h
index 8b4538446636..5f695041090c 100644
--- a/include/linux/irq.h
+++ b/include/linux/irq.h
@@ -96,11 +96,6 @@ enum {
96 96
97#define IRQ_NO_BALANCING_MASK (IRQ_PER_CPU | IRQ_NO_BALANCING) 97#define IRQ_NO_BALANCING_MASK (IRQ_PER_CPU | IRQ_NO_BALANCING)
98 98
99static inline __deprecated bool CHECK_IRQ_PER_CPU(unsigned int status)
100{
101 return status & IRQ_PER_CPU;
102}
103
104/* 99/*
105 * Return value for chip->irq_set_affinity() 100 * Return value for chip->irq_set_affinity()
106 * 101 *
@@ -676,7 +671,8 @@ void irq_gc_mask_disable_reg(struct irq_data *d);
676void irq_gc_mask_set_bit(struct irq_data *d); 671void irq_gc_mask_set_bit(struct irq_data *d);
677void irq_gc_mask_clr_bit(struct irq_data *d); 672void irq_gc_mask_clr_bit(struct irq_data *d);
678void irq_gc_unmask_enable_reg(struct irq_data *d); 673void irq_gc_unmask_enable_reg(struct irq_data *d);
679void irq_gc_ack(struct irq_data *d); 674void irq_gc_ack_set_bit(struct irq_data *d);
675void irq_gc_ack_clr_bit(struct irq_data *d);
680void irq_gc_mask_disable_reg_and_ack(struct irq_data *d); 676void irq_gc_mask_disable_reg_and_ack(struct irq_data *d);
681void irq_gc_eoi(struct irq_data *d); 677void irq_gc_eoi(struct irq_data *d);
682int irq_gc_set_wake(struct irq_data *d, unsigned int on); 678int irq_gc_set_wake(struct irq_data *d, unsigned int on);
diff --git a/include/linux/irqreturn.h b/include/linux/irqreturn.h
index 819acaaac3f5..714ba08dc092 100644
--- a/include/linux/irqreturn.h
+++ b/include/linux/irqreturn.h
@@ -8,9 +8,9 @@
8 * @IRQ_WAKE_THREAD handler requests to wake the handler thread 8 * @IRQ_WAKE_THREAD handler requests to wake the handler thread
9 */ 9 */
10enum irqreturn { 10enum irqreturn {
11 IRQ_NONE, 11 IRQ_NONE = (0 << 0),
12 IRQ_HANDLED, 12 IRQ_HANDLED = (1 << 0),
13 IRQ_WAKE_THREAD, 13 IRQ_WAKE_THREAD = (1 << 1),
14}; 14};
15 15
16typedef enum irqreturn irqreturn_t; 16typedef enum irqreturn irqreturn_t;
diff --git a/include/linux/iscsi_boot_sysfs.h b/include/linux/iscsi_boot_sysfs.h
index f1e6c184f14f..f0a2f8b0aa13 100644
--- a/include/linux/iscsi_boot_sysfs.h
+++ b/include/linux/iscsi_boot_sysfs.h
@@ -92,6 +92,13 @@ struct iscsi_boot_kobj {
92 * properties. 92 * properties.
93 */ 93 */
94 mode_t (*is_visible) (void *data, int type); 94 mode_t (*is_visible) (void *data, int type);
95
96 /*
97 * Driver specific release function.
98 *
99 * The function should free the data passed in.
100 */
101 void (*release) (void *data);
95}; 102};
96 103
97struct iscsi_boot_kset { 104struct iscsi_boot_kset {
@@ -103,18 +110,21 @@ struct iscsi_boot_kobj *
103iscsi_boot_create_initiator(struct iscsi_boot_kset *boot_kset, int index, 110iscsi_boot_create_initiator(struct iscsi_boot_kset *boot_kset, int index,
104 void *data, 111 void *data,
105 ssize_t (*show) (void *data, int type, char *buf), 112 ssize_t (*show) (void *data, int type, char *buf),
106 mode_t (*is_visible) (void *data, int type)); 113 mode_t (*is_visible) (void *data, int type),
114 void (*release) (void *data));
107 115
108struct iscsi_boot_kobj * 116struct iscsi_boot_kobj *
109iscsi_boot_create_ethernet(struct iscsi_boot_kset *boot_kset, int index, 117iscsi_boot_create_ethernet(struct iscsi_boot_kset *boot_kset, int index,
110 void *data, 118 void *data,
111 ssize_t (*show) (void *data, int type, char *buf), 119 ssize_t (*show) (void *data, int type, char *buf),
112 mode_t (*is_visible) (void *data, int type)); 120 mode_t (*is_visible) (void *data, int type),
121 void (*release) (void *data));
113struct iscsi_boot_kobj * 122struct iscsi_boot_kobj *
114iscsi_boot_create_target(struct iscsi_boot_kset *boot_kset, int index, 123iscsi_boot_create_target(struct iscsi_boot_kset *boot_kset, int index,
115 void *data, 124 void *data,
116 ssize_t (*show) (void *data, int type, char *buf), 125 ssize_t (*show) (void *data, int type, char *buf),
117 mode_t (*is_visible) (void *data, int type)); 126 mode_t (*is_visible) (void *data, int type),
127 void (*release) (void *data));
118 128
119struct iscsi_boot_kset *iscsi_boot_create_kset(const char *set_name); 129struct iscsi_boot_kset *iscsi_boot_create_kset(const char *set_name);
120struct iscsi_boot_kset *iscsi_boot_create_host_kset(unsigned int hostno); 130struct iscsi_boot_kset *iscsi_boot_create_host_kset(unsigned int hostno);
diff --git a/include/linux/jbd2.h b/include/linux/jbd2.h
index 4ecb7b16b278..d087c2e7b2aa 100644
--- a/include/linux/jbd2.h
+++ b/include/linux/jbd2.h
@@ -1024,7 +1024,6 @@ struct journal_s
1024 1024
1025/* Filing buffers */ 1025/* Filing buffers */
1026extern void jbd2_journal_unfile_buffer(journal_t *, struct journal_head *); 1026extern void jbd2_journal_unfile_buffer(journal_t *, struct journal_head *);
1027extern void __jbd2_journal_unfile_buffer(struct journal_head *);
1028extern void __jbd2_journal_refile_buffer(struct journal_head *); 1027extern void __jbd2_journal_refile_buffer(struct journal_head *);
1029extern void jbd2_journal_refile_buffer(journal_t *, struct journal_head *); 1028extern void jbd2_journal_refile_buffer(journal_t *, struct journal_head *);
1030extern void __jbd2_journal_file_buffer(struct journal_head *, transaction_t *, int); 1029extern void __jbd2_journal_file_buffer(struct journal_head *, transaction_t *, int);
@@ -1165,7 +1164,6 @@ extern void jbd2_journal_release_jbd_inode(journal_t *journal, struct jbd2_in
1165 */ 1164 */
1166struct journal_head *jbd2_journal_add_journal_head(struct buffer_head *bh); 1165struct journal_head *jbd2_journal_add_journal_head(struct buffer_head *bh);
1167struct journal_head *jbd2_journal_grab_journal_head(struct buffer_head *bh); 1166struct journal_head *jbd2_journal_grab_journal_head(struct buffer_head *bh);
1168void jbd2_journal_remove_journal_head(struct buffer_head *bh);
1169void jbd2_journal_put_journal_head(struct journal_head *jh); 1167void jbd2_journal_put_journal_head(struct journal_head *jh);
1170 1168
1171/* 1169/*
diff --git a/include/linux/kernel.h b/include/linux/kernel.h
index fb0e7329fee1..9a43ad792cfc 100644
--- a/include/linux/kernel.h
+++ b/include/linux/kernel.h
@@ -121,7 +121,7 @@ extern int _cond_resched(void);
121# define might_resched() do { } while (0) 121# define might_resched() do { } while (0)
122#endif 122#endif
123 123
124#ifdef CONFIG_DEBUG_SPINLOCK_SLEEP 124#ifdef CONFIG_DEBUG_ATOMIC_SLEEP
125 void __might_sleep(const char *file, int line, int preempt_offset); 125 void __might_sleep(const char *file, int line, int preempt_offset);
126/** 126/**
127 * might_sleep - annotation for functions that can sleep 127 * might_sleep - annotation for functions that can sleep
@@ -646,33 +646,10 @@ static inline void ftrace_dump(enum ftrace_dump_mode oops_dump_mode) { }
646 const typeof( ((type *)0)->member ) *__mptr = (ptr); \ 646 const typeof( ((type *)0)->member ) *__mptr = (ptr); \
647 (type *)( (char *)__mptr - offsetof(type,member) );}) 647 (type *)( (char *)__mptr - offsetof(type,member) );})
648 648
649struct sysinfo;
650extern int do_sysinfo(struct sysinfo *info);
651
652#endif /* __KERNEL__ */
653
654#define SI_LOAD_SHIFT 16
655struct sysinfo {
656 long uptime; /* Seconds since boot */
657 unsigned long loads[3]; /* 1, 5, and 15 minute load averages */
658 unsigned long totalram; /* Total usable main memory size */
659 unsigned long freeram; /* Available memory size */
660 unsigned long sharedram; /* Amount of shared memory */
661 unsigned long bufferram; /* Memory used by buffers */
662 unsigned long totalswap; /* Total swap space size */
663 unsigned long freeswap; /* swap space still available */
664 unsigned short procs; /* Number of current processes */
665 unsigned short pad; /* explicit padding for m68k */
666 unsigned long totalhigh; /* Total high memory size */
667 unsigned long freehigh; /* Available high memory size */
668 unsigned int mem_unit; /* Memory unit size in bytes */
669 char _f[20-2*sizeof(long)-sizeof(int)]; /* Padding: libc5 uses this.. */
670};
671
672#ifdef __CHECKER__ 649#ifdef __CHECKER__
673#define BUILD_BUG_ON_NOT_POWER_OF_2(n) 650#define BUILD_BUG_ON_NOT_POWER_OF_2(n)
674#define BUILD_BUG_ON_ZERO(e) 651#define BUILD_BUG_ON_ZERO(e) (0)
675#define BUILD_BUG_ON_NULL(e) 652#define BUILD_BUG_ON_NULL(e) ((void*)0)
676#define BUILD_BUG_ON(condition) 653#define BUILD_BUG_ON(condition)
677#else /* __CHECKER__ */ 654#else /* __CHECKER__ */
678 655
@@ -736,4 +713,27 @@ extern int __build_bug_on_failed;
736# define REBUILD_DUE_TO_FTRACE_MCOUNT_RECORD 713# define REBUILD_DUE_TO_FTRACE_MCOUNT_RECORD
737#endif 714#endif
738 715
716struct sysinfo;
717extern int do_sysinfo(struct sysinfo *info);
718
719#endif /* __KERNEL__ */
720
721#define SI_LOAD_SHIFT 16
722struct sysinfo {
723 long uptime; /* Seconds since boot */
724 unsigned long loads[3]; /* 1, 5, and 15 minute load averages */
725 unsigned long totalram; /* Total usable main memory size */
726 unsigned long freeram; /* Available memory size */
727 unsigned long sharedram; /* Amount of shared memory */
728 unsigned long bufferram; /* Memory used by buffers */
729 unsigned long totalswap; /* Total swap space size */
730 unsigned long freeswap; /* swap space still available */
731 unsigned short procs; /* Number of current processes */
732 unsigned short pad; /* explicit padding for m68k */
733 unsigned long totalhigh; /* Total high memory size */
734 unsigned long freehigh; /* Available high memory size */
735 unsigned int mem_unit; /* Memory unit size in bytes */
736 char _f[20-2*sizeof(long)-sizeof(int)]; /* Padding: libc5 uses this.. */
737};
738
739#endif 739#endif
diff --git a/include/linux/kmod.h b/include/linux/kmod.h
index d4a5c84c503d..0da38cf7db7b 100644
--- a/include/linux/kmod.h
+++ b/include/linux/kmod.h
@@ -45,7 +45,7 @@ static inline int request_module_nowait(const char *name, ...) { return -ENOSYS;
45#endif 45#endif
46 46
47 47
48struct key; 48struct cred;
49struct file; 49struct file;
50 50
51enum umh_wait { 51enum umh_wait {
@@ -62,7 +62,7 @@ struct subprocess_info {
62 char **envp; 62 char **envp;
63 enum umh_wait wait; 63 enum umh_wait wait;
64 int retval; 64 int retval;
65 int (*init)(struct subprocess_info *info); 65 int (*init)(struct subprocess_info *info, struct cred *new);
66 void (*cleanup)(struct subprocess_info *info); 66 void (*cleanup)(struct subprocess_info *info);
67 void *data; 67 void *data;
68}; 68};
@@ -73,7 +73,7 @@ struct subprocess_info *call_usermodehelper_setup(char *path, char **argv,
73 73
74/* Set various pieces of state into the subprocess_info structure */ 74/* Set various pieces of state into the subprocess_info structure */
75void call_usermodehelper_setfns(struct subprocess_info *info, 75void call_usermodehelper_setfns(struct subprocess_info *info,
76 int (*init)(struct subprocess_info *info), 76 int (*init)(struct subprocess_info *info, struct cred *new),
77 void (*cleanup)(struct subprocess_info *info), 77 void (*cleanup)(struct subprocess_info *info),
78 void *data); 78 void *data);
79 79
@@ -87,7 +87,7 @@ void call_usermodehelper_freeinfo(struct subprocess_info *info);
87static inline int 87static inline int
88call_usermodehelper_fns(char *path, char **argv, char **envp, 88call_usermodehelper_fns(char *path, char **argv, char **envp,
89 enum umh_wait wait, 89 enum umh_wait wait,
90 int (*init)(struct subprocess_info *info), 90 int (*init)(struct subprocess_info *info, struct cred *new),
91 void (*cleanup)(struct subprocess_info *), void *data) 91 void (*cleanup)(struct subprocess_info *), void *data)
92{ 92{
93 struct subprocess_info *info; 93 struct subprocess_info *info;
diff --git a/include/linux/kmsg_dump.h b/include/linux/kmsg_dump.h
index 2a0d7d651dc3..ee0c952188de 100644
--- a/include/linux/kmsg_dump.h
+++ b/include/linux/kmsg_dump.h
@@ -12,6 +12,7 @@
12#ifndef _LINUX_KMSG_DUMP_H 12#ifndef _LINUX_KMSG_DUMP_H
13#define _LINUX_KMSG_DUMP_H 13#define _LINUX_KMSG_DUMP_H
14 14
15#include <linux/errno.h>
15#include <linux/list.h> 16#include <linux/list.h>
16 17
17enum kmsg_dump_reason { 18enum kmsg_dump_reason {
diff --git a/include/linux/kobject_ns.h b/include/linux/kobject_ns.h
index 82cb5bf461fb..f66b065a8b5f 100644
--- a/include/linux/kobject_ns.h
+++ b/include/linux/kobject_ns.h
@@ -32,15 +32,17 @@ enum kobj_ns_type {
32 32
33/* 33/*
34 * Callbacks so sysfs can determine namespaces 34 * Callbacks so sysfs can determine namespaces
35 * @current_ns: return calling task's namespace 35 * @grab_current_ns: return a new reference to calling task's namespace
36 * @netlink_ns: return namespace to which a sock belongs (right?) 36 * @netlink_ns: return namespace to which a sock belongs (right?)
37 * @initial_ns: return the initial namespace (i.e. init_net_ns) 37 * @initial_ns: return the initial namespace (i.e. init_net_ns)
38 * @drop_ns: drops a reference to namespace
38 */ 39 */
39struct kobj_ns_type_operations { 40struct kobj_ns_type_operations {
40 enum kobj_ns_type type; 41 enum kobj_ns_type type;
41 const void *(*current_ns)(void); 42 void *(*grab_current_ns)(void);
42 const void *(*netlink_ns)(struct sock *sk); 43 const void *(*netlink_ns)(struct sock *sk);
43 const void *(*initial_ns)(void); 44 const void *(*initial_ns)(void);
45 void (*drop_ns)(void *);
44}; 46};
45 47
46int kobj_ns_type_register(const struct kobj_ns_type_operations *ops); 48int kobj_ns_type_register(const struct kobj_ns_type_operations *ops);
@@ -48,9 +50,9 @@ int kobj_ns_type_registered(enum kobj_ns_type type);
48const struct kobj_ns_type_operations *kobj_child_ns_ops(struct kobject *parent); 50const struct kobj_ns_type_operations *kobj_child_ns_ops(struct kobject *parent);
49const struct kobj_ns_type_operations *kobj_ns_ops(struct kobject *kobj); 51const struct kobj_ns_type_operations *kobj_ns_ops(struct kobject *kobj);
50 52
51const void *kobj_ns_current(enum kobj_ns_type type); 53void *kobj_ns_grab_current(enum kobj_ns_type type);
52const void *kobj_ns_netlink(enum kobj_ns_type type, struct sock *sk); 54const void *kobj_ns_netlink(enum kobj_ns_type type, struct sock *sk);
53const void *kobj_ns_initial(enum kobj_ns_type type); 55const void *kobj_ns_initial(enum kobj_ns_type type);
54void kobj_ns_exit(enum kobj_ns_type type, const void *ns); 56void kobj_ns_drop(enum kobj_ns_type type, void *ns);
55 57
56#endif /* _LINUX_KOBJECT_NS_H */ 58#endif /* _LINUX_KOBJECT_NS_H */
diff --git a/include/linux/kvm.h b/include/linux/kvm.h
index 55ef181521ff..2c366b52f505 100644
--- a/include/linux/kvm.h
+++ b/include/linux/kvm.h
@@ -161,6 +161,7 @@ struct kvm_pit_config {
161#define KVM_EXIT_NMI 16 161#define KVM_EXIT_NMI 16
162#define KVM_EXIT_INTERNAL_ERROR 17 162#define KVM_EXIT_INTERNAL_ERROR 17
163#define KVM_EXIT_OSI 18 163#define KVM_EXIT_OSI 18
164#define KVM_EXIT_PAPR_HCALL 19
164 165
165/* For KVM_EXIT_INTERNAL_ERROR */ 166/* For KVM_EXIT_INTERNAL_ERROR */
166#define KVM_INTERNAL_ERROR_EMULATION 1 167#define KVM_INTERNAL_ERROR_EMULATION 1
@@ -264,6 +265,11 @@ struct kvm_run {
264 struct { 265 struct {
265 __u64 gprs[32]; 266 __u64 gprs[32];
266 } osi; 267 } osi;
268 struct {
269 __u64 nr;
270 __u64 ret;
271 __u64 args[9];
272 } papr_hcall;
267 /* Fix the size of the union. */ 273 /* Fix the size of the union. */
268 char padding[256]; 274 char padding[256];
269 }; 275 };
@@ -544,6 +550,9 @@ struct kvm_ppc_pvinfo {
544#define KVM_CAP_TSC_CONTROL 60 550#define KVM_CAP_TSC_CONTROL 60
545#define KVM_CAP_GET_TSC_KHZ 61 551#define KVM_CAP_GET_TSC_KHZ 61
546#define KVM_CAP_PPC_BOOKE_SREGS 62 552#define KVM_CAP_PPC_BOOKE_SREGS 62
553#define KVM_CAP_SPAPR_TCE 63
554#define KVM_CAP_PPC_SMT 64
555#define KVM_CAP_PPC_RMA 65
547 556
548#ifdef KVM_CAP_IRQ_ROUTING 557#ifdef KVM_CAP_IRQ_ROUTING
549 558
@@ -746,6 +755,9 @@ struct kvm_clock_data {
746/* Available with KVM_CAP_XCRS */ 755/* Available with KVM_CAP_XCRS */
747#define KVM_GET_XCRS _IOR(KVMIO, 0xa6, struct kvm_xcrs) 756#define KVM_GET_XCRS _IOR(KVMIO, 0xa6, struct kvm_xcrs)
748#define KVM_SET_XCRS _IOW(KVMIO, 0xa7, struct kvm_xcrs) 757#define KVM_SET_XCRS _IOW(KVMIO, 0xa7, struct kvm_xcrs)
758#define KVM_CREATE_SPAPR_TCE _IOW(KVMIO, 0xa8, struct kvm_create_spapr_tce)
759/* Available with KVM_CAP_RMA */
760#define KVM_ALLOCATE_RMA _IOR(KVMIO, 0xa9, struct kvm_allocate_rma)
749 761
750#define KVM_DEV_ASSIGN_ENABLE_IOMMU (1 << 0) 762#define KVM_DEV_ASSIGN_ENABLE_IOMMU (1 << 0)
751 763
@@ -773,20 +785,14 @@ struct kvm_assigned_pci_dev {
773 785
774struct kvm_assigned_irq { 786struct kvm_assigned_irq {
775 __u32 assigned_dev_id; 787 __u32 assigned_dev_id;
776 __u32 host_irq; 788 __u32 host_irq; /* ignored (legacy field) */
777 __u32 guest_irq; 789 __u32 guest_irq;
778 __u32 flags; 790 __u32 flags;
779 union { 791 union {
780 struct {
781 __u32 addr_lo;
782 __u32 addr_hi;
783 __u32 data;
784 } guest_msi;
785 __u32 reserved[12]; 792 __u32 reserved[12];
786 }; 793 };
787}; 794};
788 795
789
790struct kvm_assigned_msix_nr { 796struct kvm_assigned_msix_nr {
791 __u32 assigned_dev_id; 797 __u32 assigned_dev_id;
792 __u16 entry_nr; 798 __u16 entry_nr;
diff --git a/include/linux/kvm_host.h b/include/linux/kvm_host.h
index 31ebb59cbd2f..eabb21a30c34 100644
--- a/include/linux/kvm_host.h
+++ b/include/linux/kvm_host.h
@@ -47,6 +47,7 @@
47#define KVM_REQ_DEACTIVATE_FPU 10 47#define KVM_REQ_DEACTIVATE_FPU 10
48#define KVM_REQ_EVENT 11 48#define KVM_REQ_EVENT 11
49#define KVM_REQ_APF_HALT 12 49#define KVM_REQ_APF_HALT 12
50#define KVM_REQ_STEAL_UPDATE 13
50 51
51#define KVM_USERSPACE_IRQ_SOURCE_ID 0 52#define KVM_USERSPACE_IRQ_SOURCE_ID 0
52 53
@@ -326,12 +327,17 @@ static inline struct kvm_memslots *kvm_memslots(struct kvm *kvm)
326static inline int is_error_hpa(hpa_t hpa) { return hpa >> HPA_MSB; } 327static inline int is_error_hpa(hpa_t hpa) { return hpa >> HPA_MSB; }
327 328
328extern struct page *bad_page; 329extern struct page *bad_page;
330extern struct page *fault_page;
331
329extern pfn_t bad_pfn; 332extern pfn_t bad_pfn;
333extern pfn_t fault_pfn;
330 334
331int is_error_page(struct page *page); 335int is_error_page(struct page *page);
332int is_error_pfn(pfn_t pfn); 336int is_error_pfn(pfn_t pfn);
333int is_hwpoison_pfn(pfn_t pfn); 337int is_hwpoison_pfn(pfn_t pfn);
334int is_fault_pfn(pfn_t pfn); 338int is_fault_pfn(pfn_t pfn);
339int is_noslot_pfn(pfn_t pfn);
340int is_invalid_pfn(pfn_t pfn);
335int kvm_is_error_hva(unsigned long addr); 341int kvm_is_error_hva(unsigned long addr);
336int kvm_set_memory_region(struct kvm *kvm, 342int kvm_set_memory_region(struct kvm *kvm,
337 struct kvm_userspace_memory_region *mem, 343 struct kvm_userspace_memory_region *mem,
@@ -381,6 +387,8 @@ int kvm_read_guest_page(struct kvm *kvm, gfn_t gfn, void *data, int offset,
381int kvm_read_guest_atomic(struct kvm *kvm, gpa_t gpa, void *data, 387int kvm_read_guest_atomic(struct kvm *kvm, gpa_t gpa, void *data,
382 unsigned long len); 388 unsigned long len);
383int kvm_read_guest(struct kvm *kvm, gpa_t gpa, void *data, unsigned long len); 389int kvm_read_guest(struct kvm *kvm, gpa_t gpa, void *data, unsigned long len);
390int kvm_read_guest_cached(struct kvm *kvm, struct gfn_to_hva_cache *ghc,
391 void *data, unsigned long len);
384int kvm_write_guest_page(struct kvm *kvm, gfn_t gfn, const void *data, 392int kvm_write_guest_page(struct kvm *kvm, gfn_t gfn, const void *data,
385 int offset, int len); 393 int offset, int len);
386int kvm_write_guest(struct kvm *kvm, gpa_t gpa, const void *data, 394int kvm_write_guest(struct kvm *kvm, gpa_t gpa, const void *data,
diff --git a/include/linux/led-lm3530.h b/include/linux/led-lm3530.h
index 58592fa67d24..8eb12357a110 100644
--- a/include/linux/led-lm3530.h
+++ b/include/linux/led-lm3530.h
@@ -84,6 +84,8 @@ enum lm3530_als_mode {
84 * @brt_ramp_rise: rate of rise of led current 84 * @brt_ramp_rise: rate of rise of led current
85 * @als1_resistor_sel: internal resistance from ALS1 input to ground 85 * @als1_resistor_sel: internal resistance from ALS1 input to ground
86 * @als2_resistor_sel: internal resistance from ALS2 input to ground 86 * @als2_resistor_sel: internal resistance from ALS2 input to ground
87 * @als_vmin: als input voltage calibrated for max brightness in mV
88 * @als_vmax: als input voltage calibrated for min brightness in mV
87 * @brt_val: brightness value (0-255) 89 * @brt_val: brightness value (0-255)
88 */ 90 */
89struct lm3530_platform_data { 91struct lm3530_platform_data {
@@ -101,6 +103,9 @@ struct lm3530_platform_data {
101 u8 als1_resistor_sel; 103 u8 als1_resistor_sel;
102 u8 als2_resistor_sel; 104 u8 als2_resistor_sel;
103 105
106 u32 als_vmin;
107 u32 als_vmax;
108
104 u8 brt_val; 109 u8 brt_val;
105}; 110};
106 111
diff --git a/include/linux/lguest.h b/include/linux/lguest.h
index 2fb1dcbcb5aa..9962c6bb1311 100644
--- a/include/linux/lguest.h
+++ b/include/linux/lguest.h
@@ -59,8 +59,6 @@ struct lguest_data {
59 unsigned long reserve_mem; 59 unsigned long reserve_mem;
60 /* KHz for the TSC clock. */ 60 /* KHz for the TSC clock. */
61 u32 tsc_khz; 61 u32 tsc_khz;
62 /* Page where the top-level pagetable is */
63 unsigned long pgdir;
64 62
65/* Fields initialized by the Guest at boot: */ 63/* Fields initialized by the Guest at boot: */
66 /* Instruction range to suppress interrupts even if enabled */ 64 /* Instruction range to suppress interrupts even if enabled */
diff --git a/include/linux/libata.h b/include/linux/libata.h
index 5a9926b34072..efd6f9800762 100644
--- a/include/linux/libata.h
+++ b/include/linux/libata.h
@@ -74,6 +74,16 @@
74 74
75#define BPRINTK(fmt, args...) if (ap->flags & ATA_FLAG_DEBUGMSG) printk(KERN_ERR "%s: " fmt, __func__, ## args) 75#define BPRINTK(fmt, args...) if (ap->flags & ATA_FLAG_DEBUGMSG) printk(KERN_ERR "%s: " fmt, __func__, ## args)
76 76
77#define ata_print_version_once(dev, version) \
78({ \
79 static bool __print_once; \
80 \
81 if (!__print_once) { \
82 __print_once = true; \
83 ata_print_version(dev, version); \
84 } \
85})
86
77/* NEW: debug levels */ 87/* NEW: debug levels */
78#define HAVE_LIBATA_MSG 1 88#define HAVE_LIBATA_MSG 1
79 89
@@ -1244,20 +1254,50 @@ static inline int sata_srst_pmp(struct ata_link *link)
1244/* 1254/*
1245 * printk helpers 1255 * printk helpers
1246 */ 1256 */
1247#define ata_port_printk(ap, lv, fmt, args...) \ 1257__attribute__((format (printf, 3, 4)))
1248 printk("%sata%u: "fmt, lv, (ap)->print_id , ##args) 1258int ata_port_printk(const struct ata_port *ap, const char *level,
1249 1259 const char *fmt, ...);
1250#define ata_link_printk(link, lv, fmt, args...) do { \ 1260__attribute__((format (printf, 3, 4)))
1251 if (sata_pmp_attached((link)->ap) || (link)->ap->slave_link) \ 1261int ata_link_printk(const struct ata_link *link, const char *level,
1252 printk("%sata%u.%02u: "fmt, lv, (link)->ap->print_id, \ 1262 const char *fmt, ...);
1253 (link)->pmp , ##args); \ 1263__attribute__((format (printf, 3, 4)))
1254 else \ 1264int ata_dev_printk(const struct ata_device *dev, const char *level,
1255 printk("%sata%u: "fmt, lv, (link)->ap->print_id , ##args); \ 1265 const char *fmt, ...);
1256 } while(0) 1266
1257 1267#define ata_port_err(ap, fmt, ...) \
1258#define ata_dev_printk(dev, lv, fmt, args...) \ 1268 ata_port_printk(ap, KERN_ERR, fmt, ##__VA_ARGS__)
1259 printk("%sata%u.%02u: "fmt, lv, (dev)->link->ap->print_id, \ 1269#define ata_port_warn(ap, fmt, ...) \
1260 (dev)->link->pmp + (dev)->devno , ##args) 1270 ata_port_printk(ap, KERN_WARNING, fmt, ##__VA_ARGS__)
1271#define ata_port_notice(ap, fmt, ...) \
1272 ata_port_printk(ap, KERN_NOTICE, fmt, ##__VA_ARGS__)
1273#define ata_port_info(ap, fmt, ...) \
1274 ata_port_printk(ap, KERN_INFO, fmt, ##__VA_ARGS__)
1275#define ata_port_dbg(ap, fmt, ...) \
1276 ata_port_printk(ap, KERN_DEBUG, fmt, ##__VA_ARGS__)
1277
1278#define ata_link_err(link, fmt, ...) \
1279 ata_link_printk(link, KERN_ERR, fmt, ##__VA_ARGS__)
1280#define ata_link_warn(link, fmt, ...) \
1281 ata_link_printk(link, KERN_WARNING, fmt, ##__VA_ARGS__)
1282#define ata_link_notice(link, fmt, ...) \
1283 ata_link_printk(link, KERN_NOTICE, fmt, ##__VA_ARGS__)
1284#define ata_link_info(link, fmt, ...) \
1285 ata_link_printk(link, KERN_INFO, fmt, ##__VA_ARGS__)
1286#define ata_link_dbg(link, fmt, ...) \
1287 ata_link_printk(link, KERN_DEBUG, fmt, ##__VA_ARGS__)
1288
1289#define ata_dev_err(dev, fmt, ...) \
1290 ata_dev_printk(dev, KERN_ERR, fmt, ##__VA_ARGS__)
1291#define ata_dev_warn(dev, fmt, ...) \
1292 ata_dev_printk(dev, KERN_WARNING, fmt, ##__VA_ARGS__)
1293#define ata_dev_notice(dev, fmt, ...) \
1294 ata_dev_printk(dev, KERN_NOTICE, fmt, ##__VA_ARGS__)
1295#define ata_dev_info(dev, fmt, ...) \
1296 ata_dev_printk(dev, KERN_INFO, fmt, ##__VA_ARGS__)
1297#define ata_dev_dbg(dev, fmt, ...) \
1298 ata_dev_printk(dev, KERN_DEBUG, fmt, ##__VA_ARGS__)
1299
1300void ata_print_version(const struct device *dev, const char *version);
1261 1301
1262/* 1302/*
1263 * ata_eh_info helpers 1303 * ata_eh_info helpers
diff --git a/include/linux/memcontrol.h b/include/linux/memcontrol.h
index 9724a38ee69d..50940da6adf3 100644
--- a/include/linux/memcontrol.h
+++ b/include/linux/memcontrol.h
@@ -84,6 +84,7 @@ int task_in_mem_cgroup(struct task_struct *task, const struct mem_cgroup *mem);
84 84
85extern struct mem_cgroup *try_get_mem_cgroup_from_page(struct page *page); 85extern struct mem_cgroup *try_get_mem_cgroup_from_page(struct page *page);
86extern struct mem_cgroup *mem_cgroup_from_task(struct task_struct *p); 86extern struct mem_cgroup *mem_cgroup_from_task(struct task_struct *p);
87extern struct mem_cgroup *try_get_mem_cgroup_from_mm(struct mm_struct *mm);
87 88
88static inline 89static inline
89int mm_match_cgroup(const struct mm_struct *mm, const struct mem_cgroup *cgroup) 90int mm_match_cgroup(const struct mm_struct *mm, const struct mem_cgroup *cgroup)
@@ -246,6 +247,11 @@ static inline struct mem_cgroup *try_get_mem_cgroup_from_page(struct page *page)
246 return NULL; 247 return NULL;
247} 248}
248 249
250static inline struct mem_cgroup *try_get_mem_cgroup_from_mm(struct mm_struct *mm)
251{
252 return NULL;
253}
254
249static inline int mm_match_cgroup(struct mm_struct *mm, struct mem_cgroup *mem) 255static inline int mm_match_cgroup(struct mm_struct *mm, struct mem_cgroup *mem)
250{ 256{
251 return 1; 257 return 1;
diff --git a/include/linux/memory.h b/include/linux/memory.h
index e1e3b2b84f85..935699b30b7c 100644
--- a/include/linux/memory.h
+++ b/include/linux/memory.h
@@ -20,6 +20,8 @@
20#include <linux/compiler.h> 20#include <linux/compiler.h>
21#include <linux/mutex.h> 21#include <linux/mutex.h>
22 22
23#define MIN_MEMORY_BLOCK_SIZE (1 << SECTION_SIZE_BITS)
24
23struct memory_block { 25struct memory_block {
24 unsigned long start_section_nr; 26 unsigned long start_section_nr;
25 unsigned long end_section_nr; 27 unsigned long end_section_nr;
diff --git a/include/linux/memory_hotplug.h b/include/linux/memory_hotplug.h
index 8122018d3000..0b8e2a742600 100644
--- a/include/linux/memory_hotplug.h
+++ b/include/linux/memory_hotplug.h
@@ -68,12 +68,19 @@ static inline void zone_seqlock_init(struct zone *zone)
68extern int zone_grow_free_lists(struct zone *zone, unsigned long new_nr_pages); 68extern int zone_grow_free_lists(struct zone *zone, unsigned long new_nr_pages);
69extern int zone_grow_waitqueues(struct zone *zone, unsigned long nr_pages); 69extern int zone_grow_waitqueues(struct zone *zone, unsigned long nr_pages);
70extern int add_one_highpage(struct page *page, int pfn, int bad_ppro); 70extern int add_one_highpage(struct page *page, int pfn, int bad_ppro);
71/* need some defines for these for archs that don't support it */
72extern void online_page(struct page *page);
73/* VM interface that may be used by firmware interface */ 71/* VM interface that may be used by firmware interface */
74extern int online_pages(unsigned long, unsigned long); 72extern int online_pages(unsigned long, unsigned long);
75extern void __offline_isolated_pages(unsigned long, unsigned long); 73extern void __offline_isolated_pages(unsigned long, unsigned long);
76 74
75typedef void (*online_page_callback_t)(struct page *page);
76
77extern int set_online_page_callback(online_page_callback_t callback);
78extern int restore_online_page_callback(online_page_callback_t callback);
79
80extern void __online_page_set_limits(struct page *page);
81extern void __online_page_increment_counters(struct page *page);
82extern void __online_page_free(struct page *page);
83
77#ifdef CONFIG_MEMORY_HOTREMOVE 84#ifdef CONFIG_MEMORY_HOTREMOVE
78extern bool is_pageblock_removable_nolock(struct page *page); 85extern bool is_pageblock_removable_nolock(struct page *page);
79#endif /* CONFIG_MEMORY_HOTREMOVE */ 86#endif /* CONFIG_MEMORY_HOTREMOVE */
diff --git a/include/linux/mfd/ds1wm.h b/include/linux/mfd/ds1wm.h
index be469a357cbb..38a372a0e285 100644
--- a/include/linux/mfd/ds1wm.h
+++ b/include/linux/mfd/ds1wm.h
@@ -3,4 +3,11 @@
3struct ds1wm_driver_data { 3struct ds1wm_driver_data {
4 int active_high; 4 int active_high;
5 int clock_rate; 5 int clock_rate;
6 /* in milliseconds, the amount of time to */
7 /* sleep following a reset pulse. Zero */
8 /* should work if your bus devices recover*/
9 /* time respects the 1-wire spec since the*/
10 /* ds1wm implements the precise timings of*/
11 /* a reset pulse/presence detect sequence.*/
12 unsigned int reset_recover_delay;
6}; 13};
diff --git a/include/linux/mfd/pm8xxx/rtc.h b/include/linux/mfd/pm8xxx/rtc.h
new file mode 100644
index 000000000000..14f1983eaecc
--- /dev/null
+++ b/include/linux/mfd/pm8xxx/rtc.h
@@ -0,0 +1,25 @@
1/* Copyright (c) 2010-2011, Code Aurora Forum. All rights reserved.
2 *
3 * This program is free software; you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License version 2 and
5 * only version 2 as published by the Free Software Foundation.
6 *
7 * This program is distributed in the hope that it will be useful,
8 * but WITHOUT ANY WARRANTY; without even the implied warranty of
9 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10 * GNU General Public License for more details.
11 */
12
13#ifndef __RTC_PM8XXX_H__
14#define __RTC_PM8XXX_H__
15
16#define PM8XXX_RTC_DEV_NAME "rtc-pm8xxx"
17/**
18 * struct pm8xxx_rtc_pdata - RTC driver platform data
19 * @rtc_write_enable: variable stating RTC write capability
20 */
21struct pm8xxx_rtc_platform_data {
22 bool rtc_write_enable;
23};
24
25#endif /* __RTC_PM8XXX_H__ */
diff --git a/include/linux/mfd/tmio.h b/include/linux/mfd/tmio.h
index 5a90266c3a5a..0dc98044d8b7 100644
--- a/include/linux/mfd/tmio.h
+++ b/include/linux/mfd/tmio.h
@@ -68,6 +68,11 @@
68 * controller and report the event to the driver. 68 * controller and report the event to the driver.
69 */ 69 */
70#define TMIO_MMC_HAS_COLD_CD (1 << 3) 70#define TMIO_MMC_HAS_COLD_CD (1 << 3)
71/*
72 * Some controllers require waiting for the SD bus to become
73 * idle before writing to some registers.
74 */
75#define TMIO_MMC_HAS_IDLE_WAIT (1 << 4)
71 76
72int tmio_core_mmc_enable(void __iomem *cnf, int shift, unsigned long base); 77int tmio_core_mmc_enable(void __iomem *cnf, int shift, unsigned long base);
73int tmio_core_mmc_resume(void __iomem *cnf, int shift, unsigned long base); 78int tmio_core_mmc_resume(void __iomem *cnf, int shift, unsigned long base);
@@ -80,6 +85,8 @@ struct tmio_mmc_dma {
80 int alignment_shift; 85 int alignment_shift;
81}; 86};
82 87
88struct tmio_mmc_host;
89
83/* 90/*
84 * data for the MMC controller 91 * data for the MMC controller
85 */ 92 */
@@ -94,6 +101,7 @@ struct tmio_mmc_data {
94 void (*set_pwr)(struct platform_device *host, int state); 101 void (*set_pwr)(struct platform_device *host, int state);
95 void (*set_clk_div)(struct platform_device *host, int state); 102 void (*set_clk_div)(struct platform_device *host, int state);
96 int (*get_cd)(struct platform_device *host); 103 int (*get_cd)(struct platform_device *host);
104 int (*write16_hook)(struct tmio_mmc_host *host, int addr);
97}; 105};
98 106
99static inline void tmio_mmc_cd_wakeup(struct tmio_mmc_data *pdata) 107static inline void tmio_mmc_cd_wakeup(struct tmio_mmc_data *pdata)
diff --git a/include/linux/mfd/tps65910.h b/include/linux/mfd/tps65910.h
index 8bb85b930c07..73572c65d04f 100644
--- a/include/linux/mfd/tps65910.h
+++ b/include/linux/mfd/tps65910.h
@@ -269,7 +269,7 @@
269#define LDO1_SEL_MASK 0xFC 269#define LDO1_SEL_MASK 0xFC
270#define LDO3_SEL_MASK 0x7C 270#define LDO3_SEL_MASK 0x7C
271#define LDO_MIN_VOLT 1000 271#define LDO_MIN_VOLT 1000
272#define LDO_MAX_VOLT 3300; 272#define LDO_MAX_VOLT 3300
273 273
274 274
275/*Register VDIG1 (0x80) register.RegisterDescription */ 275/*Register VDIG1 (0x80) register.RegisterDescription */
diff --git a/include/linux/mii.h b/include/linux/mii.h
index 359fba880274..103113a2fd18 100644
--- a/include/linux/mii.h
+++ b/include/linux/mii.h
@@ -128,6 +128,8 @@
128/* 1000BASE-T Control register */ 128/* 1000BASE-T Control register */
129#define ADVERTISE_1000FULL 0x0200 /* Advertise 1000BASE-T full duplex */ 129#define ADVERTISE_1000FULL 0x0200 /* Advertise 1000BASE-T full duplex */
130#define ADVERTISE_1000HALF 0x0100 /* Advertise 1000BASE-T half duplex */ 130#define ADVERTISE_1000HALF 0x0100 /* Advertise 1000BASE-T half duplex */
131#define CTL1000_AS_MASTER 0x0800
132#define CTL1000_ENABLE_MASTER 0x1000
131 133
132/* 1000BASE-T Status register */ 134/* 1000BASE-T Status register */
133#define LPA_1000LOCALRXOK 0x2000 /* Link partner local receiver status */ 135#define LPA_1000LOCALRXOK 0x2000 /* Link partner local receiver status */
diff --git a/include/linux/mlx4/cmd.h b/include/linux/mlx4/cmd.h
index 9a18667c13cc..b56e4587208d 100644
--- a/include/linux/mlx4/cmd.h
+++ b/include/linux/mlx4/cmd.h
@@ -123,6 +123,9 @@ enum {
123 /* debug commands */ 123 /* debug commands */
124 MLX4_CMD_QUERY_DEBUG_MSG = 0x2a, 124 MLX4_CMD_QUERY_DEBUG_MSG = 0x2a,
125 MLX4_CMD_SET_DEBUG_MSG = 0x2b, 125 MLX4_CMD_SET_DEBUG_MSG = 0x2b,
126
127 /* statistics commands */
128 MLX4_CMD_QUERY_IF_STAT = 0X54,
126}; 129};
127 130
128enum { 131enum {
diff --git a/include/linux/mlx4/device.h b/include/linux/mlx4/device.h
index 8985768e2c0d..387329e02303 100644
--- a/include/linux/mlx4/device.h
+++ b/include/linux/mlx4/device.h
@@ -58,22 +58,28 @@ enum {
58}; 58};
59 59
60enum { 60enum {
61 MLX4_DEV_CAP_FLAG_RC = 1 << 0, 61 MLX4_DEV_CAP_FLAG_RC = 1LL << 0,
62 MLX4_DEV_CAP_FLAG_UC = 1 << 1, 62 MLX4_DEV_CAP_FLAG_UC = 1LL << 1,
63 MLX4_DEV_CAP_FLAG_UD = 1 << 2, 63 MLX4_DEV_CAP_FLAG_UD = 1LL << 2,
64 MLX4_DEV_CAP_FLAG_SRQ = 1 << 6, 64 MLX4_DEV_CAP_FLAG_SRQ = 1LL << 6,
65 MLX4_DEV_CAP_FLAG_IPOIB_CSUM = 1 << 7, 65 MLX4_DEV_CAP_FLAG_IPOIB_CSUM = 1LL << 7,
66 MLX4_DEV_CAP_FLAG_BAD_PKEY_CNTR = 1 << 8, 66 MLX4_DEV_CAP_FLAG_BAD_PKEY_CNTR = 1LL << 8,
67 MLX4_DEV_CAP_FLAG_BAD_QKEY_CNTR = 1 << 9, 67 MLX4_DEV_CAP_FLAG_BAD_QKEY_CNTR = 1LL << 9,
68 MLX4_DEV_CAP_FLAG_DPDP = 1 << 12, 68 MLX4_DEV_CAP_FLAG_DPDP = 1LL << 12,
69 MLX4_DEV_CAP_FLAG_BLH = 1 << 15, 69 MLX4_DEV_CAP_FLAG_BLH = 1LL << 15,
70 MLX4_DEV_CAP_FLAG_MEM_WINDOW = 1 << 16, 70 MLX4_DEV_CAP_FLAG_MEM_WINDOW = 1LL << 16,
71 MLX4_DEV_CAP_FLAG_APM = 1 << 17, 71 MLX4_DEV_CAP_FLAG_APM = 1LL << 17,
72 MLX4_DEV_CAP_FLAG_ATOMIC = 1 << 18, 72 MLX4_DEV_CAP_FLAG_ATOMIC = 1LL << 18,
73 MLX4_DEV_CAP_FLAG_RAW_MCAST = 1 << 19, 73 MLX4_DEV_CAP_FLAG_RAW_MCAST = 1LL << 19,
74 MLX4_DEV_CAP_FLAG_UD_AV_PORT = 1 << 20, 74 MLX4_DEV_CAP_FLAG_UD_AV_PORT = 1LL << 20,
75 MLX4_DEV_CAP_FLAG_UD_MCAST = 1 << 21, 75 MLX4_DEV_CAP_FLAG_UD_MCAST = 1LL << 21,
76 MLX4_DEV_CAP_FLAG_IBOE = 1 << 30 76 MLX4_DEV_CAP_FLAG_IBOE = 1LL << 30,
77 MLX4_DEV_CAP_FLAG_UC_LOOPBACK = 1LL << 32,
78 MLX4_DEV_CAP_FLAG_WOL = 1LL << 38,
79 MLX4_DEV_CAP_FLAG_UDP_RSS = 1LL << 40,
80 MLX4_DEV_CAP_FLAG_VEP_UC_STEER = 1LL << 41,
81 MLX4_DEV_CAP_FLAG_VEP_MC_STEER = 1LL << 42,
82 MLX4_DEV_CAP_FLAG_COUNTERS = 1LL << 48
77}; 83};
78 84
79enum { 85enum {
@@ -253,15 +259,10 @@ struct mlx4_caps {
253 int mtt_entry_sz; 259 int mtt_entry_sz;
254 u32 max_msg_sz; 260 u32 max_msg_sz;
255 u32 page_size_cap; 261 u32 page_size_cap;
256 u32 flags; 262 u64 flags;
257 u32 bmme_flags; 263 u32 bmme_flags;
258 u32 reserved_lkey; 264 u32 reserved_lkey;
259 u16 stat_rate_support; 265 u16 stat_rate_support;
260 int udp_rss;
261 int loopback_support;
262 int vep_uc_steering;
263 int vep_mc_steering;
264 int wol;
265 u8 port_width_cap[MLX4_MAX_PORTS + 1]; 266 u8 port_width_cap[MLX4_MAX_PORTS + 1];
266 int max_gso_sz; 267 int max_gso_sz;
267 int reserved_qps_cnt[MLX4_NUM_QP_REGION]; 268 int reserved_qps_cnt[MLX4_NUM_QP_REGION];
@@ -274,6 +275,7 @@ struct mlx4_caps {
274 u8 supported_type[MLX4_MAX_PORTS + 1]; 275 u8 supported_type[MLX4_MAX_PORTS + 1];
275 u32 port_mask; 276 u32 port_mask;
276 enum mlx4_port_type possible_type[MLX4_MAX_PORTS + 1]; 277 enum mlx4_port_type possible_type[MLX4_MAX_PORTS + 1];
278 u32 max_counters;
277}; 279};
278 280
279struct mlx4_buf_list { 281struct mlx4_buf_list {
@@ -438,6 +440,17 @@ union mlx4_ext_av {
438 struct mlx4_eth_av eth; 440 struct mlx4_eth_av eth;
439}; 441};
440 442
443struct mlx4_counter {
444 u8 reserved1[3];
445 u8 counter_mode;
446 __be32 num_ifc;
447 u32 reserved2[2];
448 __be64 rx_frames;
449 __be64 rx_bytes;
450 __be64 tx_frames;
451 __be64 tx_bytes;
452};
453
441struct mlx4_dev { 454struct mlx4_dev {
442 struct pci_dev *pdev; 455 struct pci_dev *pdev;
443 unsigned long flags; 456 unsigned long flags;
@@ -568,4 +581,7 @@ void mlx4_release_eq(struct mlx4_dev *dev, int vec);
568int mlx4_wol_read(struct mlx4_dev *dev, u64 *config, int port); 581int mlx4_wol_read(struct mlx4_dev *dev, u64 *config, int port);
569int mlx4_wol_write(struct mlx4_dev *dev, u64 config, int port); 582int mlx4_wol_write(struct mlx4_dev *dev, u64 config, int port);
570 583
584int mlx4_counter_alloc(struct mlx4_dev *dev, u32 *idx);
585void mlx4_counter_free(struct mlx4_dev *dev, u32 idx);
586
571#endif /* MLX4_DEVICE_H */ 587#endif /* MLX4_DEVICE_H */
diff --git a/include/linux/mlx4/qp.h b/include/linux/mlx4/qp.h
index 9e9eb21056ca..4001c8249dbb 100644
--- a/include/linux/mlx4/qp.h
+++ b/include/linux/mlx4/qp.h
@@ -54,7 +54,8 @@ enum mlx4_qp_optpar {
54 MLX4_QP_OPTPAR_RETRY_COUNT = 1 << 12, 54 MLX4_QP_OPTPAR_RETRY_COUNT = 1 << 12,
55 MLX4_QP_OPTPAR_RNR_RETRY = 1 << 13, 55 MLX4_QP_OPTPAR_RNR_RETRY = 1 << 13,
56 MLX4_QP_OPTPAR_ACK_TIMEOUT = 1 << 14, 56 MLX4_QP_OPTPAR_ACK_TIMEOUT = 1 << 14,
57 MLX4_QP_OPTPAR_SCHED_QUEUE = 1 << 16 57 MLX4_QP_OPTPAR_SCHED_QUEUE = 1 << 16,
58 MLX4_QP_OPTPAR_COUNTER_INDEX = 1 << 20
58}; 59};
59 60
60enum mlx4_qp_state { 61enum mlx4_qp_state {
@@ -99,7 +100,7 @@ struct mlx4_qp_path {
99 u8 fl; 100 u8 fl;
100 u8 reserved1[2]; 101 u8 reserved1[2];
101 u8 pkey_index; 102 u8 pkey_index;
102 u8 reserved2; 103 u8 counter_index;
103 u8 grh_mylmc; 104 u8 grh_mylmc;
104 __be16 rlid; 105 __be16 rlid;
105 u8 ackto; 106 u8 ackto;
@@ -111,8 +112,7 @@ struct mlx4_qp_path {
111 u8 sched_queue; 112 u8 sched_queue;
112 u8 vlan_index; 113 u8 vlan_index;
113 u8 reserved3[2]; 114 u8 reserved3[2];
114 u8 counter_index; 115 u8 reserved4[2];
115 u8 reserved4;
116 u8 dmac[6]; 116 u8 dmac[6];
117}; 117};
118 118
diff --git a/include/linux/mm.h b/include/linux/mm.h
index 9670f71d7be9..3172a1c0f08e 100644
--- a/include/linux/mm.h
+++ b/include/linux/mm.h
@@ -15,6 +15,7 @@
15#include <linux/range.h> 15#include <linux/range.h>
16#include <linux/pfn.h> 16#include <linux/pfn.h>
17#include <linux/bit_spinlock.h> 17#include <linux/bit_spinlock.h>
18#include <linux/shrinker.h>
18 19
19struct mempolicy; 20struct mempolicy;
20struct anon_vma; 21struct anon_vma;
@@ -636,7 +637,7 @@ static inline pte_t maybe_mkwrite(pte_t pte, struct vm_area_struct *vma)
636#define SECTIONS_MASK ((1UL << SECTIONS_WIDTH) - 1) 637#define SECTIONS_MASK ((1UL << SECTIONS_WIDTH) - 1)
637#define ZONEID_MASK ((1UL << ZONEID_SHIFT) - 1) 638#define ZONEID_MASK ((1UL << ZONEID_SHIFT) - 1)
638 639
639static inline enum zone_type page_zonenum(struct page *page) 640static inline enum zone_type page_zonenum(const struct page *page)
640{ 641{
641 return (page->flags >> ZONES_PGSHIFT) & ZONES_MASK; 642 return (page->flags >> ZONES_PGSHIFT) & ZONES_MASK;
642} 643}
@@ -664,15 +665,15 @@ static inline int zone_to_nid(struct zone *zone)
664} 665}
665 666
666#ifdef NODE_NOT_IN_PAGE_FLAGS 667#ifdef NODE_NOT_IN_PAGE_FLAGS
667extern int page_to_nid(struct page *page); 668extern int page_to_nid(const struct page *page);
668#else 669#else
669static inline int page_to_nid(struct page *page) 670static inline int page_to_nid(const struct page *page)
670{ 671{
671 return (page->flags >> NODES_PGSHIFT) & NODES_MASK; 672 return (page->flags >> NODES_PGSHIFT) & NODES_MASK;
672} 673}
673#endif 674#endif
674 675
675static inline struct zone *page_zone(struct page *page) 676static inline struct zone *page_zone(const struct page *page)
676{ 677{
677 return &NODE_DATA(page_to_nid(page))->node_zones[page_zonenum(page)]; 678 return &NODE_DATA(page_to_nid(page))->node_zones[page_zonenum(page)];
678} 679}
@@ -717,9 +718,9 @@ static inline void set_page_links(struct page *page, enum zone_type zone,
717 */ 718 */
718#include <linux/vmstat.h> 719#include <linux/vmstat.h>
719 720
720static __always_inline void *lowmem_page_address(struct page *page) 721static __always_inline void *lowmem_page_address(const struct page *page)
721{ 722{
722 return __va(PFN_PHYS(page_to_pfn(page))); 723 return __va(PFN_PHYS(page_to_pfn((struct page *)page)));
723} 724}
724 725
725#if defined(CONFIG_HIGHMEM) && !defined(WANT_PAGE_VIRTUAL) 726#if defined(CONFIG_HIGHMEM) && !defined(WANT_PAGE_VIRTUAL)
@@ -910,6 +911,8 @@ unsigned long unmap_vmas(struct mmu_gather *tlb,
910 * @pte_entry: if set, called for each non-empty PTE (4th-level) entry 911 * @pte_entry: if set, called for each non-empty PTE (4th-level) entry
911 * @pte_hole: if set, called for each hole at all levels 912 * @pte_hole: if set, called for each hole at all levels
912 * @hugetlb_entry: if set, called for each hugetlb entry 913 * @hugetlb_entry: if set, called for each hugetlb entry
914 * *Caution*: The caller must hold mmap_sem() if @hugetlb_entry
915 * is used.
913 * 916 *
914 * (see walk_page_range for more details) 917 * (see walk_page_range for more details)
915 */ 918 */
@@ -985,6 +988,8 @@ int get_user_pages(struct task_struct *tsk, struct mm_struct *mm,
985int get_user_pages_fast(unsigned long start, int nr_pages, int write, 988int get_user_pages_fast(unsigned long start, int nr_pages, int write,
986 struct page **pages); 989 struct page **pages);
987struct page *get_dump_page(unsigned long addr); 990struct page *get_dump_page(unsigned long addr);
991extern int fixup_user_fault(struct task_struct *tsk, struct mm_struct *mm,
992 unsigned long address, unsigned int fault_flags);
988 993
989extern int try_to_release_page(struct page * page, gfp_t gfp_mask); 994extern int try_to_release_page(struct page * page, gfp_t gfp_mask);
990extern void do_invalidatepage(struct page *page, unsigned long offset); 995extern void do_invalidatepage(struct page *page, unsigned long offset);
@@ -1121,44 +1126,6 @@ static inline void sync_mm_rss(struct task_struct *task, struct mm_struct *mm)
1121} 1126}
1122#endif 1127#endif
1123 1128
1124/*
1125 * This struct is used to pass information from page reclaim to the shrinkers.
1126 * We consolidate the values for easier extention later.
1127 */
1128struct shrink_control {
1129 gfp_t gfp_mask;
1130
1131 /* How many slab objects shrinker() should scan and try to reclaim */
1132 unsigned long nr_to_scan;
1133};
1134
1135/*
1136 * A callback you can register to apply pressure to ageable caches.
1137 *
1138 * 'sc' is passed shrink_control which includes a count 'nr_to_scan'
1139 * and a 'gfpmask'. It should look through the least-recently-used
1140 * 'nr_to_scan' entries and attempt to free them up. It should return
1141 * the number of objects which remain in the cache. If it returns -1, it means
1142 * it cannot do any scanning at this time (eg. there is a risk of deadlock).
1143 *
1144 * The 'gfpmask' refers to the allocation we are currently trying to
1145 * fulfil.
1146 *
1147 * Note that 'shrink' will be passed nr_to_scan == 0 when the VM is
1148 * querying the cache size, so a fastpath for that case is appropriate.
1149 */
1150struct shrinker {
1151 int (*shrink)(struct shrinker *, struct shrink_control *sc);
1152 int seeks; /* seeks to recreate an obj */
1153
1154 /* These are for internal use */
1155 struct list_head list;
1156 long nr; /* objs pending delete */
1157};
1158#define DEFAULT_SEEKS 2 /* A good number if you don't know better. */
1159extern void register_shrinker(struct shrinker *);
1160extern void unregister_shrinker(struct shrinker *);
1161
1162int vma_wants_writenotify(struct vm_area_struct *vma); 1129int vma_wants_writenotify(struct vm_area_struct *vma);
1163 1130
1164extern pte_t *__get_locked_pte(struct mm_struct *mm, unsigned long addr, 1131extern pte_t *__get_locked_pte(struct mm_struct *mm, unsigned long addr,
@@ -1313,6 +1280,7 @@ extern void remove_active_range(unsigned int nid, unsigned long start_pfn,
1313 unsigned long end_pfn); 1280 unsigned long end_pfn);
1314extern void remove_all_active_ranges(void); 1281extern void remove_all_active_ranges(void);
1315void sort_node_map(void); 1282void sort_node_map(void);
1283unsigned long node_map_pfn_alignment(void);
1316unsigned long __absent_pages_in_range(int nid, unsigned long start_pfn, 1284unsigned long __absent_pages_in_range(int nid, unsigned long start_pfn,
1317 unsigned long end_pfn); 1285 unsigned long end_pfn);
1318extern unsigned long absent_pages_in_range(unsigned long start_pfn, 1286extern unsigned long absent_pages_in_range(unsigned long start_pfn,
@@ -1445,8 +1413,7 @@ extern int do_munmap(struct mm_struct *, unsigned long, size_t);
1445 1413
1446extern unsigned long do_brk(unsigned long, unsigned long); 1414extern unsigned long do_brk(unsigned long, unsigned long);
1447 1415
1448/* filemap.c */ 1416/* truncate.c */
1449extern unsigned long page_unuse(struct page *);
1450extern void truncate_inode_pages(struct address_space *, loff_t); 1417extern void truncate_inode_pages(struct address_space *, loff_t);
1451extern void truncate_inode_pages_range(struct address_space *, 1418extern void truncate_inode_pages_range(struct address_space *,
1452 loff_t lstart, loff_t lend); 1419 loff_t lstart, loff_t lend);
diff --git a/include/linux/mmc/boot.h b/include/linux/mmc/boot.h
index 39d787c229cb..23acc3baa07d 100644
--- a/include/linux/mmc/boot.h
+++ b/include/linux/mmc/boot.h
@@ -1,7 +1,7 @@
1#ifndef MMC_BOOT_H 1#ifndef LINUX_MMC_BOOT_H
2#define MMC_BOOT_H 2#define LINUX_MMC_BOOT_H
3 3
4enum { MMC_PROGRESS_ENTER, MMC_PROGRESS_INIT, 4enum { MMC_PROGRESS_ENTER, MMC_PROGRESS_INIT,
5 MMC_PROGRESS_LOAD, MMC_PROGRESS_DONE }; 5 MMC_PROGRESS_LOAD, MMC_PROGRESS_DONE };
6 6
7#endif 7#endif /* LINUX_MMC_BOOT_H */
diff --git a/include/linux/mmc/card.h b/include/linux/mmc/card.h
index c6927a4d157f..b460fc2af8a1 100644
--- a/include/linux/mmc/card.h
+++ b/include/linux/mmc/card.h
@@ -64,6 +64,19 @@ struct mmc_ext_csd {
64 unsigned long long enhanced_area_offset; /* Units: Byte */ 64 unsigned long long enhanced_area_offset; /* Units: Byte */
65 unsigned int enhanced_area_size; /* Units: KB */ 65 unsigned int enhanced_area_size; /* Units: KB */
66 unsigned int boot_size; /* in bytes */ 66 unsigned int boot_size; /* in bytes */
67 u8 raw_partition_support; /* 160 */
68 u8 raw_erased_mem_count; /* 181 */
69 u8 raw_ext_csd_structure; /* 194 */
70 u8 raw_card_type; /* 196 */
71 u8 raw_s_a_timeout; /* 217 */
72 u8 raw_hc_erase_gap_size; /* 221 */
73 u8 raw_erase_timeout_mult; /* 223 */
74 u8 raw_hc_erase_grp_size; /* 224 */
75 u8 raw_sec_trim_mult; /* 229 */
76 u8 raw_sec_erase_mult; /* 230 */
77 u8 raw_sec_feature_support;/* 231 */
78 u8 raw_trim_mult; /* 232 */
79 u8 raw_sectors[4]; /* 212 - 4 bytes */
67}; 80};
68 81
69struct sd_scr { 82struct sd_scr {
@@ -390,4 +403,4 @@ extern void mmc_unregister_driver(struct mmc_driver *);
390extern void mmc_fixup_device(struct mmc_card *card, 403extern void mmc_fixup_device(struct mmc_card *card,
391 const struct mmc_fixup *table); 404 const struct mmc_fixup *table);
392 405
393#endif 406#endif /* LINUX_MMC_CARD_H */
diff --git a/include/linux/mmc/core.h b/include/linux/mmc/core.h
index b6718e549a51..b8b1b7a311f1 100644
--- a/include/linux/mmc/core.h
+++ b/include/linux/mmc/core.h
@@ -117,6 +117,7 @@ struct mmc_data {
117 117
118 unsigned int sg_len; /* size of scatter list */ 118 unsigned int sg_len; /* size of scatter list */
119 struct scatterlist *sg; /* I/O scatter list */ 119 struct scatterlist *sg; /* I/O scatter list */
120 s32 host_cookie; /* host private data */
120}; 121};
121 122
122struct mmc_request { 123struct mmc_request {
@@ -125,13 +126,16 @@ struct mmc_request {
125 struct mmc_data *data; 126 struct mmc_data *data;
126 struct mmc_command *stop; 127 struct mmc_command *stop;
127 128
128 void *done_data; /* completion data */ 129 struct completion completion;
129 void (*done)(struct mmc_request *);/* completion function */ 130 void (*done)(struct mmc_request *);/* completion function */
130}; 131};
131 132
132struct mmc_host; 133struct mmc_host;
133struct mmc_card; 134struct mmc_card;
135struct mmc_async_req;
134 136
137extern struct mmc_async_req *mmc_start_req(struct mmc_host *,
138 struct mmc_async_req *, int *);
135extern void mmc_wait_for_req(struct mmc_host *, struct mmc_request *); 139extern void mmc_wait_for_req(struct mmc_host *, struct mmc_request *);
136extern int mmc_wait_for_cmd(struct mmc_host *, struct mmc_command *, int); 140extern int mmc_wait_for_cmd(struct mmc_host *, struct mmc_command *, int);
137extern int mmc_app_cmd(struct mmc_host *, struct mmc_card *); 141extern int mmc_app_cmd(struct mmc_host *, struct mmc_card *);
@@ -155,6 +159,7 @@ extern int mmc_can_trim(struct mmc_card *card);
155extern int mmc_can_secure_erase_trim(struct mmc_card *card); 159extern int mmc_can_secure_erase_trim(struct mmc_card *card);
156extern int mmc_erase_group_aligned(struct mmc_card *card, unsigned int from, 160extern int mmc_erase_group_aligned(struct mmc_card *card, unsigned int from,
157 unsigned int nr); 161 unsigned int nr);
162extern unsigned int mmc_calc_max_discard(struct mmc_card *card);
158 163
159extern int mmc_set_blocklen(struct mmc_card *card, unsigned int blocklen); 164extern int mmc_set_blocklen(struct mmc_card *card, unsigned int blocklen);
160 165
@@ -179,4 +184,4 @@ static inline void mmc_claim_host(struct mmc_host *host)
179 184
180extern u32 mmc_vddrange_to_ocrmask(int vdd_min, int vdd_max); 185extern u32 mmc_vddrange_to_ocrmask(int vdd_min, int vdd_max);
181 186
182#endif 187#endif /* LINUX_MMC_CORE_H */
diff --git a/include/linux/mmc/dw_mmc.h b/include/linux/mmc/dw_mmc.h
index bdd7ceeb99e4..6b46819705d1 100644
--- a/include/linux/mmc/dw_mmc.h
+++ b/include/linux/mmc/dw_mmc.h
@@ -11,8 +11,8 @@
11 * (at your option) any later version. 11 * (at your option) any later version.
12 */ 12 */
13 13
14#ifndef _LINUX_MMC_DW_MMC_H_ 14#ifndef LINUX_MMC_DW_MMC_H
15#define _LINUX_MMC_DW_MMC_H_ 15#define LINUX_MMC_DW_MMC_H
16 16
17#define MAX_MCI_SLOTS 2 17#define MAX_MCI_SLOTS 2
18 18
@@ -48,6 +48,7 @@ struct mmc_data;
48 * @data: The data currently being transferred, or NULL if no data 48 * @data: The data currently being transferred, or NULL if no data
49 * transfer is in progress. 49 * transfer is in progress.
50 * @use_dma: Whether DMA channel is initialized or not. 50 * @use_dma: Whether DMA channel is initialized or not.
51 * @using_dma: Whether DMA is in use for the current transfer.
51 * @sg_dma: Bus address of DMA buffer. 52 * @sg_dma: Bus address of DMA buffer.
52 * @sg_cpu: Virtual address of DMA buffer. 53 * @sg_cpu: Virtual address of DMA buffer.
53 * @dma_ops: Pointer to platform-specific DMA callbacks. 54 * @dma_ops: Pointer to platform-specific DMA callbacks.
@@ -74,7 +75,11 @@ struct mmc_data;
74 * @pdev: Platform device associated with the MMC controller. 75 * @pdev: Platform device associated with the MMC controller.
75 * @pdata: Platform data associated with the MMC controller. 76 * @pdata: Platform data associated with the MMC controller.
76 * @slot: Slots sharing this MMC controller. 77 * @slot: Slots sharing this MMC controller.
78 * @fifo_depth: depth of FIFO.
77 * @data_shift: log2 of FIFO item size. 79 * @data_shift: log2 of FIFO item size.
80 * @part_buf_start: Start index in part_buf.
81 * @part_buf_count: Bytes of partial data in part_buf.
82 * @part_buf: Simple buffer for partial fifo reads/writes.
78 * @push_data: Pointer to FIFO push function. 83 * @push_data: Pointer to FIFO push function.
79 * @pull_data: Pointer to FIFO pull function. 84 * @pull_data: Pointer to FIFO pull function.
80 * @quirks: Set of quirks that apply to specific versions of the IP. 85 * @quirks: Set of quirks that apply to specific versions of the IP.
@@ -117,6 +122,7 @@ struct dw_mci {
117 122
118 /* DMA interface members*/ 123 /* DMA interface members*/
119 int use_dma; 124 int use_dma;
125 int using_dma;
120 126
121 dma_addr_t sg_dma; 127 dma_addr_t sg_dma;
122 void *sg_cpu; 128 void *sg_cpu;
@@ -131,7 +137,7 @@ struct dw_mci {
131 u32 stop_cmdr; 137 u32 stop_cmdr;
132 u32 dir_status; 138 u32 dir_status;
133 struct tasklet_struct tasklet; 139 struct tasklet_struct tasklet;
134 struct tasklet_struct card_tasklet; 140 struct work_struct card_work;
135 unsigned long pending_events; 141 unsigned long pending_events;
136 unsigned long completed_events; 142 unsigned long completed_events;
137 enum dw_mci_state state; 143 enum dw_mci_state state;
@@ -146,7 +152,15 @@ struct dw_mci {
146 struct dw_mci_slot *slot[MAX_MCI_SLOTS]; 152 struct dw_mci_slot *slot[MAX_MCI_SLOTS];
147 153
148 /* FIFO push and pull */ 154 /* FIFO push and pull */
155 int fifo_depth;
149 int data_shift; 156 int data_shift;
157 u8 part_buf_start;
158 u8 part_buf_count;
159 union {
160 u16 part_buf16;
161 u32 part_buf32;
162 u64 part_buf;
163 };
150 void (*push_data)(struct dw_mci *host, void *buf, int cnt); 164 void (*push_data)(struct dw_mci *host, void *buf, int cnt);
151 void (*pull_data)(struct dw_mci *host, void *buf, int cnt); 165 void (*pull_data)(struct dw_mci *host, void *buf, int cnt);
152 166
@@ -196,6 +210,12 @@ struct dw_mci_board {
196 unsigned int bus_hz; /* Bus speed */ 210 unsigned int bus_hz; /* Bus speed */
197 211
198 unsigned int caps; /* Capabilities */ 212 unsigned int caps; /* Capabilities */
213 /*
214 * Override fifo depth. If 0, autodetect it from the FIFOTH register,
215 * but note that this may not be reliable after a bootloader has used
216 * it.
217 */
218 unsigned int fifo_depth;
199 219
200 /* delay in mS before detecting cards after interrupt */ 220 /* delay in mS before detecting cards after interrupt */
201 u32 detect_delay_ms; 221 u32 detect_delay_ms;
@@ -219,4 +239,4 @@ struct dw_mci_board {
219 struct block_settings *blk_settings; 239 struct block_settings *blk_settings;
220}; 240};
221 241
222#endif /* _LINUX_MMC_DW_MMC_H_ */ 242#endif /* LINUX_MMC_DW_MMC_H */
diff --git a/include/linux/mmc/host.h b/include/linux/mmc/host.h
index 1ee4424462eb..0f83858147a6 100644
--- a/include/linux/mmc/host.h
+++ b/include/linux/mmc/host.h
@@ -106,6 +106,15 @@ struct mmc_host_ops {
106 */ 106 */
107 int (*enable)(struct mmc_host *host); 107 int (*enable)(struct mmc_host *host);
108 int (*disable)(struct mmc_host *host, int lazy); 108 int (*disable)(struct mmc_host *host, int lazy);
109 /*
110 * It is optional for the host to implement pre_req and post_req in
111 * order to support double buffering of requests (prepare one
112 * request while another request is active).
113 */
114 void (*post_req)(struct mmc_host *host, struct mmc_request *req,
115 int err);
116 void (*pre_req)(struct mmc_host *host, struct mmc_request *req,
117 bool is_first_req);
109 void (*request)(struct mmc_host *host, struct mmc_request *req); 118 void (*request)(struct mmc_host *host, struct mmc_request *req);
110 /* 119 /*
111 * Avoid calling these three functions too often or in a "fast path", 120 * Avoid calling these three functions too often or in a "fast path",
@@ -139,11 +148,22 @@ struct mmc_host_ops {
139 int (*start_signal_voltage_switch)(struct mmc_host *host, struct mmc_ios *ios); 148 int (*start_signal_voltage_switch)(struct mmc_host *host, struct mmc_ios *ios);
140 int (*execute_tuning)(struct mmc_host *host); 149 int (*execute_tuning)(struct mmc_host *host);
141 void (*enable_preset_value)(struct mmc_host *host, bool enable); 150 void (*enable_preset_value)(struct mmc_host *host, bool enable);
151 int (*select_drive_strength)(unsigned int max_dtr, int host_drv, int card_drv);
142}; 152};
143 153
144struct mmc_card; 154struct mmc_card;
145struct device; 155struct device;
146 156
157struct mmc_async_req {
158 /* active mmc request */
159 struct mmc_request *mrq;
160 /*
161 * Check error status of completed mmc request.
162 * Returns 0 if success otherwise non zero.
163 */
164 int (*err_check) (struct mmc_card *, struct mmc_async_req *);
165};
166
147struct mmc_host { 167struct mmc_host {
148 struct device *parent; 168 struct device *parent;
149 struct device class_dev; 169 struct device class_dev;
@@ -231,6 +251,7 @@ struct mmc_host {
231 unsigned int max_req_size; /* maximum number of bytes in one req */ 251 unsigned int max_req_size; /* maximum number of bytes in one req */
232 unsigned int max_blk_size; /* maximum size of one mmc block */ 252 unsigned int max_blk_size; /* maximum size of one mmc block */
233 unsigned int max_blk_count; /* maximum number of blocks in one req */ 253 unsigned int max_blk_count; /* maximum number of blocks in one req */
254 unsigned int max_discard_to; /* max. discard timeout in ms */
234 255
235 /* private data */ 256 /* private data */
236 spinlock_t lock; /* lock for claim and bus ops */ 257 spinlock_t lock; /* lock for claim and bus ops */
@@ -281,6 +302,8 @@ struct mmc_host {
281 302
282 struct dentry *debugfs_root; 303 struct dentry *debugfs_root;
283 304
305 struct mmc_async_req *areq; /* active async req */
306
284 unsigned long private[0] ____cacheline_aligned; 307 unsigned long private[0] ____cacheline_aligned;
285}; 308};
286 309
@@ -373,5 +396,4 @@ static inline int mmc_host_cmd23(struct mmc_host *host)
373{ 396{
374 return host->caps & MMC_CAP_CMD23; 397 return host->caps & MMC_CAP_CMD23;
375} 398}
376#endif 399#endif /* LINUX_MMC_HOST_H */
377
diff --git a/include/linux/mmc/ioctl.h b/include/linux/mmc/ioctl.h
index 5baf2983a12f..8fa5bc5f8059 100644
--- a/include/linux/mmc/ioctl.h
+++ b/include/linux/mmc/ioctl.h
@@ -51,4 +51,4 @@ struct mmc_ioc_cmd {
51 * block device operations. 51 * block device operations.
52 */ 52 */
53#define MMC_IOC_MAX_BYTES (512L * 256) 53#define MMC_IOC_MAX_BYTES (512L * 256)
54#endif /* LINUX_MMC_IOCTL_H */ 54#endif /* LINUX_MMC_IOCTL_H */
diff --git a/include/linux/mmc/mmc.h b/include/linux/mmc/mmc.h
index ac26a685cca8..5a794cb503ea 100644
--- a/include/linux/mmc/mmc.h
+++ b/include/linux/mmc/mmc.h
@@ -21,8 +21,8 @@
21 * 15 May 2002 21 * 15 May 2002
22 */ 22 */
23 23
24#ifndef MMC_MMC_H 24#ifndef LINUX_MMC_MMC_H
25#define MMC_MMC_H 25#define LINUX_MMC_MMC_H
26 26
27/* Standard MMC commands (4.1) type argument response */ 27/* Standard MMC commands (4.1) type argument response */
28 /* class 1 */ 28 /* class 1 */
@@ -140,6 +140,16 @@ static inline bool mmc_op_multi(u32 opcode)
140#define R1_SWITCH_ERROR (1 << 7) /* sx, c */ 140#define R1_SWITCH_ERROR (1 << 7) /* sx, c */
141#define R1_APP_CMD (1 << 5) /* sr, c */ 141#define R1_APP_CMD (1 << 5) /* sr, c */
142 142
143#define R1_STATE_IDLE 0
144#define R1_STATE_READY 1
145#define R1_STATE_IDENT 2
146#define R1_STATE_STBY 3
147#define R1_STATE_TRAN 4
148#define R1_STATE_DATA 5
149#define R1_STATE_RCV 6
150#define R1_STATE_PRG 7
151#define R1_STATE_DIS 8
152
143/* 153/*
144 * MMC/SD in SPI mode reports R1 status always, and R2 for SEND_STATUS 154 * MMC/SD in SPI mode reports R1 status always, and R2 for SEND_STATUS
145 * R1 is the low order byte; R2 is the next highest byte, when present. 155 * R1 is the low order byte; R2 is the next highest byte, when present.
@@ -327,5 +337,4 @@ struct _mmc_csd {
327#define MMC_SWITCH_MODE_CLEAR_BITS 0x02 /* Clear bits which are 1 in value */ 337#define MMC_SWITCH_MODE_CLEAR_BITS 0x02 /* Clear bits which are 1 in value */
328#define MMC_SWITCH_MODE_WRITE_BYTE 0x03 /* Set target to value */ 338#define MMC_SWITCH_MODE_WRITE_BYTE 0x03 /* Set target to value */
329 339
330#endif /* MMC_MMC_PROTOCOL_H */ 340#endif /* LINUX_MMC_MMC_H */
331
diff --git a/include/linux/mmc/pm.h b/include/linux/mmc/pm.h
index d37aac49cf9a..4a139204c20c 100644
--- a/include/linux/mmc/pm.h
+++ b/include/linux/mmc/pm.h
@@ -27,4 +27,4 @@ typedef unsigned int mmc_pm_flag_t;
27#define MMC_PM_KEEP_POWER (1 << 0) /* preserve card power during suspend */ 27#define MMC_PM_KEEP_POWER (1 << 0) /* preserve card power during suspend */
28#define MMC_PM_WAKE_SDIO_IRQ (1 << 1) /* wake up host system on SDIO IRQ assertion */ 28#define MMC_PM_WAKE_SDIO_IRQ (1 << 1) /* wake up host system on SDIO IRQ assertion */
29 29
30#endif 30#endif /* LINUX_MMC_PM_H */
diff --git a/include/linux/mmc/sd.h b/include/linux/mmc/sd.h
index 7d35d52c3df3..1ebcf9ba1256 100644
--- a/include/linux/mmc/sd.h
+++ b/include/linux/mmc/sd.h
@@ -9,8 +9,8 @@
9 * your option) any later version. 9 * your option) any later version.
10 */ 10 */
11 11
12#ifndef MMC_SD_H 12#ifndef LINUX_MMC_SD_H
13#define MMC_SD_H 13#define LINUX_MMC_SD_H
14 14
15/* SD commands type argument response */ 15/* SD commands type argument response */
16 /* class 0 */ 16 /* class 0 */
@@ -91,5 +91,4 @@
91#define SD_SWITCH_ACCESS_DEF 0 91#define SD_SWITCH_ACCESS_DEF 0
92#define SD_SWITCH_ACCESS_HS 1 92#define SD_SWITCH_ACCESS_HS 1
93 93
94#endif 94#endif /* LINUX_MMC_SD_H */
95
diff --git a/include/linux/mmc/sdhci-pltfm.h b/include/linux/mmc/sdhci-pltfm.h
deleted file mode 100644
index 548d59d404cb..000000000000
--- a/include/linux/mmc/sdhci-pltfm.h
+++ /dev/null
@@ -1,35 +0,0 @@
1/*
2 * Platform data declarations for the sdhci-pltfm driver.
3 *
4 * Copyright (c) 2010 MontaVista Software, LLC.
5 *
6 * Author: Anton Vorontsov <avorontsov@ru.mvista.com>
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or (at
11 * your option) any later version.
12 */
13
14#ifndef _SDHCI_PLTFM_H
15#define _SDHCI_PLTFM_H
16
17struct sdhci_ops;
18struct sdhci_host;
19
20/**
21 * struct sdhci_pltfm_data - SDHCI platform-specific information & hooks
22 * @ops: optional pointer to the platform-provided SDHCI ops
23 * @quirks: optional SDHCI quirks
24 * @init: optional hook that is called during device probe, before the
25 * driver tries to access any SDHCI registers
26 * @exit: optional hook that is called during device removal
27 */
28struct sdhci_pltfm_data {
29 struct sdhci_ops *ops;
30 unsigned int quirks;
31 int (*init)(struct sdhci_host *host, struct sdhci_pltfm_data *pdata);
32 void (*exit)(struct sdhci_host *host);
33};
34
35#endif /* _SDHCI_PLTFM_H */
diff --git a/include/linux/mmc/sdhci-spear.h b/include/linux/mmc/sdhci-spear.h
index 9188c973f3e1..5cdc96da9dd5 100644
--- a/include/linux/mmc/sdhci-spear.h
+++ b/include/linux/mmc/sdhci-spear.h
@@ -11,8 +11,8 @@
11 * warranty of any kind, whether express or implied. 11 * warranty of any kind, whether express or implied.
12 */ 12 */
13 13
14#ifndef MMC_SDHCI_SPEAR_H 14#ifndef LINUX_MMC_SDHCI_SPEAR_H
15#define MMC_SDHCI_SPEAR_H 15#define LINUX_MMC_SDHCI_SPEAR_H
16 16
17#include <linux/platform_device.h> 17#include <linux/platform_device.h>
18/* 18/*
@@ -39,4 +39,4 @@ sdhci_set_plat_data(struct platform_device *pdev, struct sdhci_plat_data *data)
39 pdev->dev.platform_data = data; 39 pdev->dev.platform_data = data;
40} 40}
41 41
42#endif /* MMC_SDHCI_SPEAR_H */ 42#endif /* LINUX_MMC_SDHCI_SPEAR_H */
diff --git a/include/linux/mmc/sdhci.h b/include/linux/mmc/sdhci.h
index 6a68c4eb4e44..5666f3abfab7 100644
--- a/include/linux/mmc/sdhci.h
+++ b/include/linux/mmc/sdhci.h
@@ -8,8 +8,8 @@
8 * the Free Software Foundation; either version 2 of the License, or (at 8 * the Free Software Foundation; either version 2 of the License, or (at
9 * your option) any later version. 9 * your option) any later version.
10 */ 10 */
11#ifndef __SDHCI_H 11#ifndef LINUX_MMC_SDHCI_H
12#define __SDHCI_H 12#define LINUX_MMC_SDHCI_H
13 13
14#include <linux/scatterlist.h> 14#include <linux/scatterlist.h>
15#include <linux/compiler.h> 15#include <linux/compiler.h>
@@ -162,4 +162,4 @@ struct sdhci_host {
162 162
163 unsigned long private[0] ____cacheline_aligned; 163 unsigned long private[0] ____cacheline_aligned;
164}; 164};
165#endif /* __SDHCI_H */ 165#endif /* LINUX_MMC_SDHCI_H */
diff --git a/include/linux/mmc/sdio.h b/include/linux/mmc/sdio.h
index 245cdacee544..2a2e9905a247 100644
--- a/include/linux/mmc/sdio.h
+++ b/include/linux/mmc/sdio.h
@@ -9,8 +9,8 @@
9 * your option) any later version. 9 * your option) any later version.
10 */ 10 */
11 11
12#ifndef MMC_SDIO_H 12#ifndef LINUX_MMC_SDIO_H
13#define MMC_SDIO_H 13#define LINUX_MMC_SDIO_H
14 14
15/* SDIO commands type argument response */ 15/* SDIO commands type argument response */
16#define SD_IO_SEND_OP_COND 5 /* bcr [23:0] OCR R4 */ 16#define SD_IO_SEND_OP_COND 5 /* bcr [23:0] OCR R4 */
@@ -161,5 +161,4 @@
161 161
162#define SDIO_FBR_BLKSIZE 0x10 /* block size (2 bytes) */ 162#define SDIO_FBR_BLKSIZE 0x10 /* block size (2 bytes) */
163 163
164#endif 164#endif /* LINUX_MMC_SDIO_H */
165
diff --git a/include/linux/mmc/sdio_func.h b/include/linux/mmc/sdio_func.h
index 31baaf82f458..50f0bc952328 100644
--- a/include/linux/mmc/sdio_func.h
+++ b/include/linux/mmc/sdio_func.h
@@ -9,8 +9,8 @@
9 * your option) any later version. 9 * your option) any later version.
10 */ 10 */
11 11
12#ifndef MMC_SDIO_FUNC_H 12#ifndef LINUX_MMC_SDIO_FUNC_H
13#define MMC_SDIO_FUNC_H 13#define LINUX_MMC_SDIO_FUNC_H
14 14
15#include <linux/device.h> 15#include <linux/device.h>
16#include <linux/mod_devicetable.h> 16#include <linux/mod_devicetable.h>
@@ -161,5 +161,4 @@ extern void sdio_f0_writeb(struct sdio_func *func, unsigned char b,
161extern mmc_pm_flag_t sdio_get_host_pm_caps(struct sdio_func *func); 161extern mmc_pm_flag_t sdio_get_host_pm_caps(struct sdio_func *func);
162extern int sdio_set_host_pm_flags(struct sdio_func *func, mmc_pm_flag_t flags); 162extern int sdio_set_host_pm_flags(struct sdio_func *func, mmc_pm_flag_t flags);
163 163
164#endif 164#endif /* LINUX_MMC_SDIO_FUNC_H */
165
diff --git a/include/linux/mmc/sdio_ids.h b/include/linux/mmc/sdio_ids.h
index a36ab3bc7b03..9f03feedc8e7 100644
--- a/include/linux/mmc/sdio_ids.h
+++ b/include/linux/mmc/sdio_ids.h
@@ -2,8 +2,8 @@
2 * SDIO Classes, Interface Types, Manufacturer IDs, etc. 2 * SDIO Classes, Interface Types, Manufacturer IDs, etc.
3 */ 3 */
4 4
5#ifndef MMC_SDIO_IDS_H 5#ifndef LINUX_MMC_SDIO_IDS_H
6#define MMC_SDIO_IDS_H 6#define LINUX_MMC_SDIO_IDS_H
7 7
8/* 8/*
9 * Standard SDIO Function Interfaces 9 * Standard SDIO Function Interfaces
@@ -44,4 +44,4 @@
44#define SDIO_DEVICE_ID_SIANO_NOVA_A0 0x1100 44#define SDIO_DEVICE_ID_SIANO_NOVA_A0 0x1100
45#define SDIO_DEVICE_ID_SIANO_STELLAR 0x5347 45#define SDIO_DEVICE_ID_SIANO_STELLAR 0x5347
46 46
47#endif 47#endif /* LINUX_MMC_SDIO_IDS_H */
diff --git a/include/linux/mmc/sh_mmcif.h b/include/linux/mmc/sh_mmcif.h
index 9eb9b4b96f55..0222cd8ebe76 100644
--- a/include/linux/mmc/sh_mmcif.h
+++ b/include/linux/mmc/sh_mmcif.h
@@ -11,8 +11,8 @@
11 * 11 *
12 */ 12 */
13 13
14#ifndef __SH_MMCIF_H__ 14#ifndef LINUX_MMC_SH_MMCIF_H
15#define __SH_MMCIF_H__ 15#define LINUX_MMC_SH_MMCIF_H
16 16
17#include <linux/io.h> 17#include <linux/io.h>
18#include <linux/platform_device.h> 18#include <linux/platform_device.h>
@@ -220,4 +220,4 @@ static inline void sh_mmcif_boot_init(void __iomem *base)
220 sh_mmcif_boot_cmd(base, 0x03400040, 0x00010000); 220 sh_mmcif_boot_cmd(base, 0x03400040, 0x00010000);
221} 221}
222 222
223#endif /* __SH_MMCIF_H__ */ 223#endif /* LINUX_MMC_SH_MMCIF_H */
diff --git a/include/linux/mmc/sh_mobile_sdhi.h b/include/linux/mmc/sh_mobile_sdhi.h
index faf32b6ec185..bd50b365167f 100644
--- a/include/linux/mmc/sh_mobile_sdhi.h
+++ b/include/linux/mmc/sh_mobile_sdhi.h
@@ -1,5 +1,5 @@
1#ifndef __SH_MOBILE_SDHI_H__ 1#ifndef LINUX_MMC_SH_MOBILE_SDHI_H
2#define __SH_MOBILE_SDHI_H__ 2#define LINUX_MMC_SH_MOBILE_SDHI_H
3 3
4#include <linux/types.h> 4#include <linux/types.h>
5 5
@@ -17,4 +17,4 @@ struct sh_mobile_sdhi_info {
17 int (*get_cd)(struct platform_device *pdev); 17 int (*get_cd)(struct platform_device *pdev);
18}; 18};
19 19
20#endif /* __SH_MOBILE_SDHI_H__ */ 20#endif /* LINUX_MMC_SH_MOBILE_SDHI_H */
diff --git a/include/linux/mmc/tmio.h b/include/linux/mmc/tmio.h
index 19490b942db0..a1c1f321e519 100644
--- a/include/linux/mmc/tmio.h
+++ b/include/linux/mmc/tmio.h
@@ -12,8 +12,8 @@
12 * 12 *
13 * TC6393XB TC6391XB TC6387XB T7L66XB ASIC3 13 * TC6393XB TC6391XB TC6387XB T7L66XB ASIC3
14 */ 14 */
15#ifndef _LINUX_MMC_TMIO_H_ 15#ifndef LINUX_MMC_TMIO_H
16#define _LINUX_MMC_TMIO_H_ 16#define LINUX_MMC_TMIO_H
17 17
18#define CTL_SD_CMD 0x00 18#define CTL_SD_CMD 0x00
19#define CTL_ARG_REG 0x04 19#define CTL_ARG_REG 0x04
@@ -21,6 +21,7 @@
21#define CTL_XFER_BLK_COUNT 0xa 21#define CTL_XFER_BLK_COUNT 0xa
22#define CTL_RESPONSE 0x0c 22#define CTL_RESPONSE 0x0c
23#define CTL_STATUS 0x1c 23#define CTL_STATUS 0x1c
24#define CTL_STATUS2 0x1e
24#define CTL_IRQ_MASK 0x20 25#define CTL_IRQ_MASK 0x20
25#define CTL_SD_CARD_CLK_CTL 0x24 26#define CTL_SD_CARD_CLK_CTL 0x24
26#define CTL_SD_XFER_LEN 0x26 27#define CTL_SD_XFER_LEN 0x26
@@ -30,6 +31,7 @@
30#define CTL_TRANSACTION_CTL 0x34 31#define CTL_TRANSACTION_CTL 0x34
31#define CTL_SDIO_STATUS 0x36 32#define CTL_SDIO_STATUS 0x36
32#define CTL_SDIO_IRQ_MASK 0x38 33#define CTL_SDIO_IRQ_MASK 0x38
34#define CTL_DMA_ENABLE 0xd8
33#define CTL_RESET_SD 0xe0 35#define CTL_RESET_SD 0xe0
34#define CTL_SDIO_REGS 0x100 36#define CTL_SDIO_REGS 0x100
35#define CTL_CLK_AND_WAIT_CTL 0x138 37#define CTL_CLK_AND_WAIT_CTL 0x138
@@ -60,4 +62,4 @@
60 62
61#define TMIO_BBS 512 /* Boot block size */ 63#define TMIO_BBS 512 /* Boot block size */
62 64
63#endif /* _LINUX_MMC_TMIO_H_ */ 65#endif /* LINUX_MMC_TMIO_H */
diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h
index c928dac6cad0..9f7c3ebcbbad 100644
--- a/include/linux/mmzone.h
+++ b/include/linux/mmzone.h
@@ -647,6 +647,13 @@ typedef struct pglist_data {
647#endif 647#endif
648#define nid_page_nr(nid, pagenr) pgdat_page_nr(NODE_DATA(nid),(pagenr)) 648#define nid_page_nr(nid, pagenr) pgdat_page_nr(NODE_DATA(nid),(pagenr))
649 649
650#define node_start_pfn(nid) (NODE_DATA(nid)->node_start_pfn)
651
652#define node_end_pfn(nid) ({\
653 pg_data_t *__pgdat = NODE_DATA(nid);\
654 __pgdat->node_start_pfn + __pgdat->node_spanned_pages;\
655})
656
650#include <linux/memory_hotplug.h> 657#include <linux/memory_hotplug.h>
651 658
652extern struct mutex zonelists_mutex; 659extern struct mutex zonelists_mutex;
diff --git a/include/linux/mnt_namespace.h b/include/linux/mnt_namespace.h
index 0b89efc6f215..29304855652d 100644
--- a/include/linux/mnt_namespace.h
+++ b/include/linux/mnt_namespace.h
@@ -18,7 +18,6 @@ struct proc_mounts {
18 struct seq_file m; /* must be the first element */ 18 struct seq_file m; /* must be the first element */
19 struct mnt_namespace *ns; 19 struct mnt_namespace *ns;
20 struct path root; 20 struct path root;
21 int event;
22}; 21};
23 22
24struct fs_struct; 23struct fs_struct;
diff --git a/include/linux/module.h b/include/linux/module.h
index d9ca2d5dc6d0..1c30087a2d81 100644
--- a/include/linux/module.h
+++ b/include/linux/module.h
@@ -48,10 +48,18 @@ struct modversion_info
48 48
49struct module; 49struct module;
50 50
51struct module_kobject {
52 struct kobject kobj;
53 struct module *mod;
54 struct kobject *drivers_dir;
55 struct module_param_attrs *mp;
56};
57
51struct module_attribute { 58struct module_attribute {
52 struct attribute attr; 59 struct attribute attr;
53 ssize_t (*show)(struct module_attribute *, struct module *, char *); 60 ssize_t (*show)(struct module_attribute *, struct module_kobject *,
54 ssize_t (*store)(struct module_attribute *, struct module *, 61 char *);
62 ssize_t (*store)(struct module_attribute *, struct module_kobject *,
55 const char *, size_t count); 63 const char *, size_t count);
56 void (*setup)(struct module *, const char *); 64 void (*setup)(struct module *, const char *);
57 int (*test)(struct module *); 65 int (*test)(struct module *);
@@ -65,15 +73,9 @@ struct module_version_attribute {
65} __attribute__ ((__aligned__(sizeof(void *)))); 73} __attribute__ ((__aligned__(sizeof(void *))));
66 74
67extern ssize_t __modver_version_show(struct module_attribute *, 75extern ssize_t __modver_version_show(struct module_attribute *,
68 struct module *, char *); 76 struct module_kobject *, char *);
69 77
70struct module_kobject 78extern struct module_attribute module_uevent;
71{
72 struct kobject kobj;
73 struct module *mod;
74 struct kobject *drivers_dir;
75 struct module_param_attrs *mp;
76};
77 79
78/* These are either module local, or the kernel's dummy ones. */ 80/* These are either module local, or the kernel's dummy ones. */
79extern int init_module(void); 81extern int init_module(void);
diff --git a/include/linux/moduleloader.h b/include/linux/moduleloader.h
index c1f40c2f7ffb..b2be02ebf453 100644
--- a/include/linux/moduleloader.h
+++ b/include/linux/moduleloader.h
@@ -5,7 +5,12 @@
5#include <linux/module.h> 5#include <linux/module.h>
6#include <linux/elf.h> 6#include <linux/elf.h>
7 7
8/* These must be implemented by the specific architecture */ 8/* These may be implemented by architectures that need to hook into the
9 * module loader code. Architectures that don't need to do anything special
10 * can just rely on the 'weak' default hooks defined in kernel/module.c.
11 * Note, however, that at least one of apply_relocate or apply_relocate_add
12 * must be implemented by each architecture.
13 */
9 14
10/* Adjust arch-specific sections. Return 0 on success. */ 15/* Adjust arch-specific sections. Return 0 on success. */
11int module_frob_arch_sections(Elf_Ehdr *hdr, 16int module_frob_arch_sections(Elf_Ehdr *hdr,
diff --git a/include/linux/mtd/ubi.h b/include/linux/mtd/ubi.h
index 15da0e99f48a..db4836bed514 100644
--- a/include/linux/mtd/ubi.h
+++ b/include/linux/mtd/ubi.h
@@ -155,12 +155,14 @@ struct ubi_device_info {
155}; 155};
156 156
157/* 157/*
158 * enum - volume notification types. 158 * Volume notification types.
159 * @UBI_VOLUME_ADDED: volume has been added 159 * @UBI_VOLUME_ADDED: a volume has been added (an UBI device was attached or a
160 * @UBI_VOLUME_REMOVED: start volume volume 160 * volume was created)
161 * @UBI_VOLUME_RESIZED: volume size has been re-sized 161 * @UBI_VOLUME_REMOVED: a volume has been removed (an UBI device was detached
162 * @UBI_VOLUME_RENAMED: volume name has been re-named 162 * or a volume was removed)
163 * @UBI_VOLUME_UPDATED: volume name has been updated 163 * @UBI_VOLUME_RESIZED: a volume has been re-sized
164 * @UBI_VOLUME_RENAMED: a volume has been re-named
165 * @UBI_VOLUME_UPDATED: data has been written to a volume
164 * 166 *
165 * These constants define which type of event has happened when a volume 167 * These constants define which type of event has happened when a volume
166 * notification function is invoked. 168 * notification function is invoked.
diff --git a/include/linux/mutex.h b/include/linux/mutex.h
index a940fe435aca..7f87217e9d1f 100644
--- a/include/linux/mutex.h
+++ b/include/linux/mutex.h
@@ -92,7 +92,7 @@ do { \
92 \ 92 \
93 __mutex_init((mutex), #mutex, &__key); \ 93 __mutex_init((mutex), #mutex, &__key); \
94} while (0) 94} while (0)
95# define mutex_destroy(mutex) do { } while (0) 95static inline void mutex_destroy(struct mutex *lock) {}
96#endif 96#endif
97 97
98#ifdef CONFIG_DEBUG_LOCK_ALLOC 98#ifdef CONFIG_DEBUG_LOCK_ALLOC
diff --git a/include/linux/namei.h b/include/linux/namei.h
index eba45ea10298..76fe2c62ae71 100644
--- a/include/linux/namei.h
+++ b/include/linux/namei.h
@@ -48,7 +48,6 @@ enum {LAST_NORM, LAST_ROOT, LAST_DOT, LAST_DOTDOT, LAST_BIND};
48 */ 48 */
49#define LOOKUP_FOLLOW 0x0001 49#define LOOKUP_FOLLOW 0x0001
50#define LOOKUP_DIRECTORY 0x0002 50#define LOOKUP_DIRECTORY 0x0002
51#define LOOKUP_CONTINUE 0x0004
52 51
53#define LOOKUP_PARENT 0x0010 52#define LOOKUP_PARENT 0x0010
54#define LOOKUP_REVAL 0x0020 53#define LOOKUP_REVAL 0x0020
@@ -75,9 +74,11 @@ extern int user_path_at(int, const char __user *, unsigned, struct path *);
75 74
76extern int kern_path(const char *, unsigned, struct path *); 75extern int kern_path(const char *, unsigned, struct path *);
77 76
77extern struct dentry *kern_path_create(int, const char *, struct path *, int);
78extern struct dentry *user_path_create(int, const char __user *, struct path *, int);
78extern int kern_path_parent(const char *, struct nameidata *); 79extern int kern_path_parent(const char *, struct nameidata *);
79extern int vfs_path_lookup(struct dentry *, struct vfsmount *, 80extern int vfs_path_lookup(struct dentry *, struct vfsmount *,
80 const char *, unsigned int, struct nameidata *); 81 const char *, unsigned int, struct path *);
81 82
82extern struct file *lookup_instantiate_filp(struct nameidata *nd, struct dentry *dentry, 83extern struct file *lookup_instantiate_filp(struct nameidata *nd, struct dentry *dentry,
83 int (*open)(struct inode *, struct file *)); 84 int (*open)(struct inode *, struct file *));
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index ca333e79e10f..ea6f4aa479d4 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -34,7 +34,6 @@
34#include <linux/pm_qos_params.h> 34#include <linux/pm_qos_params.h>
35#include <linux/timer.h> 35#include <linux/timer.h>
36#include <linux/delay.h> 36#include <linux/delay.h>
37#include <linux/mm.h>
38#include <asm/atomic.h> 37#include <asm/atomic.h>
39#include <asm/cache.h> 38#include <asm/cache.h>
40#include <asm/byteorder.h> 39#include <asm/byteorder.h>
@@ -61,11 +60,6 @@ struct wireless_dev;
61#define SET_ETHTOOL_OPS(netdev,ops) \ 60#define SET_ETHTOOL_OPS(netdev,ops) \
62 ( (netdev)->ethtool_ops = (ops) ) 61 ( (netdev)->ethtool_ops = (ops) )
63 62
64#define HAVE_ALLOC_NETDEV /* feature macro: alloc_xxxdev
65 functions are available. */
66#define HAVE_FREE_NETDEV /* free_netdev() */
67#define HAVE_NETDEV_PRIV /* netdev_priv() */
68
69/* hardware address assignment types */ 63/* hardware address assignment types */
70#define NET_ADDR_PERM 0 /* address is permanent (default) */ 64#define NET_ADDR_PERM 0 /* address is permanent (default) */
71#define NET_ADDR_RANDOM 1 /* address is generated randomly */ 65#define NET_ADDR_RANDOM 1 /* address is generated randomly */
@@ -258,21 +252,8 @@ struct netdev_hw_addr_list {
258 netdev_hw_addr_list_for_each(ha, &(dev)->mc) 252 netdev_hw_addr_list_for_each(ha, &(dev)->mc)
259 253
260struct hh_cache { 254struct hh_cache {
261 struct hh_cache *hh_next; /* Next entry */ 255 u16 hh_len;
262 atomic_t hh_refcnt; /* number of users */ 256 u16 __pad;
263/*
264 * We want hh_output, hh_len, hh_lock and hh_data be a in a separate
265 * cache line on SMP.
266 * They are mostly read, but hh_refcnt may be changed quite frequently,
267 * incurring cache line ping pongs.
268 */
269 __be16 hh_type ____cacheline_aligned_in_smp;
270 /* protocol identifier, f.e ETH_P_IP
271 * NOTE: For VLANs, this will be the
272 * encapuslated type. --BLG
273 */
274 u16 hh_len; /* length of header */
275 int (*hh_output)(struct sk_buff *skb);
276 seqlock_t hh_lock; 257 seqlock_t hh_lock;
277 258
278 /* cached hardware header; allow for machine alignment needs. */ 259 /* cached hardware header; allow for machine alignment needs. */
@@ -284,12 +265,6 @@ struct hh_cache {
284 unsigned long hh_data[HH_DATA_ALIGN(LL_MAX_HEADER) / sizeof(long)]; 265 unsigned long hh_data[HH_DATA_ALIGN(LL_MAX_HEADER) / sizeof(long)];
285}; 266};
286 267
287static inline void hh_cache_put(struct hh_cache *hh)
288{
289 if (atomic_dec_and_test(&hh->hh_refcnt))
290 kfree(hh);
291}
292
293/* Reserve HH_DATA_MOD byte aligned hard_header_len, but at least that much. 268/* Reserve HH_DATA_MOD byte aligned hard_header_len, but at least that much.
294 * Alternative is: 269 * Alternative is:
295 * dev->hard_header_len ? (dev->hard_header_len + 270 * dev->hard_header_len ? (dev->hard_header_len +
@@ -314,8 +289,7 @@ struct header_ops {
314 const void *saddr, unsigned len); 289 const void *saddr, unsigned len);
315 int (*parse)(const struct sk_buff *skb, unsigned char *haddr); 290 int (*parse)(const struct sk_buff *skb, unsigned char *haddr);
316 int (*rebuild)(struct sk_buff *skb); 291 int (*rebuild)(struct sk_buff *skb);
317#define HAVE_HEADER_CACHE 292 int (*cache)(const struct neighbour *neigh, struct hh_cache *hh, __be16 type);
318 int (*cache)(const struct neighbour *neigh, struct hh_cache *hh);
319 void (*cache_update)(struct hh_cache *hh, 293 void (*cache_update)(struct hh_cache *hh,
320 const struct net_device *dev, 294 const struct net_device *dev,
321 const unsigned char *haddr); 295 const unsigned char *haddr);
@@ -556,7 +530,7 @@ struct netdev_queue {
556 struct Qdisc *qdisc; 530 struct Qdisc *qdisc;
557 unsigned long state; 531 unsigned long state;
558 struct Qdisc *qdisc_sleeping; 532 struct Qdisc *qdisc_sleeping;
559#ifdef CONFIG_RPS 533#if defined(CONFIG_RPS) || defined(CONFIG_XPS)
560 struct kobject kobj; 534 struct kobject kobj;
561#endif 535#endif
562#if defined(CONFIG_XPS) && defined(CONFIG_NUMA) 536#if defined(CONFIG_XPS) && defined(CONFIG_NUMA)
@@ -794,12 +768,6 @@ struct netdev_tc_txq {
794 * 3. Update dev->stats asynchronously and atomically, and define 768 * 3. Update dev->stats asynchronously and atomically, and define
795 * neither operation. 769 * neither operation.
796 * 770 *
797 * void (*ndo_vlan_rx_register)(struct net_device *dev, struct vlan_group *grp);
798 * If device support VLAN receive acceleration
799 * (ie. dev->features & NETIF_F_HW_VLAN_RX), then this function is called
800 * when vlan groups for the device changes. Note: grp is NULL
801 * if no vlan's groups are being used.
802 *
803 * void (*ndo_vlan_rx_add_vid)(struct net_device *dev, unsigned short vid); 771 * void (*ndo_vlan_rx_add_vid)(struct net_device *dev, unsigned short vid);
804 * If device support VLAN filtering (dev->features & NETIF_F_HW_VLAN_FILTER) 772 * If device support VLAN filtering (dev->features & NETIF_F_HW_VLAN_FILTER)
805 * this function is called when a VLAN id is registered. 773 * this function is called when a VLAN id is registered.
@@ -888,7 +856,6 @@ struct netdev_tc_txq {
888 * Must return >0 or -errno if it changed dev->features itself. 856 * Must return >0 or -errno if it changed dev->features itself.
889 * 857 *
890 */ 858 */
891#define HAVE_NET_DEVICE_OPS
892struct net_device_ops { 859struct net_device_ops {
893 int (*ndo_init)(struct net_device *dev); 860 int (*ndo_init)(struct net_device *dev);
894 void (*ndo_uninit)(struct net_device *dev); 861 void (*ndo_uninit)(struct net_device *dev);
@@ -919,8 +886,6 @@ struct net_device_ops {
919 struct rtnl_link_stats64 *storage); 886 struct rtnl_link_stats64 *storage);
920 struct net_device_stats* (*ndo_get_stats)(struct net_device *dev); 887 struct net_device_stats* (*ndo_get_stats)(struct net_device *dev);
921 888
922 void (*ndo_vlan_rx_register)(struct net_device *dev,
923 struct vlan_group *grp);
924 void (*ndo_vlan_rx_add_vid)(struct net_device *dev, 889 void (*ndo_vlan_rx_add_vid)(struct net_device *dev,
925 unsigned short vid); 890 unsigned short vid);
926 void (*ndo_vlan_rx_kill_vid)(struct net_device *dev, 891 void (*ndo_vlan_rx_kill_vid)(struct net_device *dev,
@@ -1097,12 +1062,6 @@ struct net_device {
1097#define NETIF_F_ALL_FCOE (NETIF_F_FCOE_CRC | NETIF_F_FCOE_MTU | \ 1062#define NETIF_F_ALL_FCOE (NETIF_F_FCOE_CRC | NETIF_F_FCOE_MTU | \
1098 NETIF_F_FSO) 1063 NETIF_F_FSO)
1099 1064
1100#define NETIF_F_ALL_TX_OFFLOADS (NETIF_F_ALL_CSUM | NETIF_F_SG | \
1101 NETIF_F_FRAGLIST | NETIF_F_ALL_TSO | \
1102 NETIF_F_HIGHDMA | \
1103 NETIF_F_SCTP_CSUM | \
1104 NETIF_F_ALL_FCOE)
1105
1106 /* 1065 /*
1107 * If one device supports one of these features, then enable them 1066 * If one device supports one of these features, then enable them
1108 * for all in netdev_increment_features. 1067 * for all in netdev_increment_features.
@@ -1220,7 +1179,7 @@ struct net_device {
1220 1179
1221 unsigned char broadcast[MAX_ADDR_LEN]; /* hw bcast add */ 1180 unsigned char broadcast[MAX_ADDR_LEN]; /* hw bcast add */
1222 1181
1223#ifdef CONFIG_RPS 1182#if defined(CONFIG_RPS) || defined(CONFIG_XPS)
1224 struct kset *queues_kset; 1183 struct kset *queues_kset;
1225 1184
1226 struct netdev_rx_queue *_rx; 1185 struct netdev_rx_queue *_rx;
@@ -1348,9 +1307,6 @@ struct net_device {
1348 /* max exchange id for FCoE LRO by ddp */ 1307 /* max exchange id for FCoE LRO by ddp */
1349 unsigned int fcoe_ddp_xid; 1308 unsigned int fcoe_ddp_xid;
1350#endif 1309#endif
1351 /* n-tuple filter list attached to this device */
1352 struct ethtool_rx_ntuple_list ethtool_ntuple_list;
1353
1354 /* phy device may attach itself for hardware timestamping */ 1310 /* phy device may attach itself for hardware timestamping */
1355 struct phy_device *phydev; 1311 struct phy_device *phydev;
1356 1312
@@ -1563,9 +1519,41 @@ struct packet_type {
1563 struct list_head list; 1519 struct list_head list;
1564}; 1520};
1565 1521
1566#include <linux/interrupt.h>
1567#include <linux/notifier.h> 1522#include <linux/notifier.h>
1568 1523
1524/* netdevice notifier chain. Please remember to update the rtnetlink
1525 * notification exclusion list in rtnetlink_event() when adding new
1526 * types.
1527 */
1528#define NETDEV_UP 0x0001 /* For now you can't veto a device up/down */
1529#define NETDEV_DOWN 0x0002
1530#define NETDEV_REBOOT 0x0003 /* Tell a protocol stack a network interface
1531 detected a hardware crash and restarted
1532 - we can use this eg to kick tcp sessions
1533 once done */
1534#define NETDEV_CHANGE 0x0004 /* Notify device state change */
1535#define NETDEV_REGISTER 0x0005
1536#define NETDEV_UNREGISTER 0x0006
1537#define NETDEV_CHANGEMTU 0x0007
1538#define NETDEV_CHANGEADDR 0x0008
1539#define NETDEV_GOING_DOWN 0x0009
1540#define NETDEV_CHANGENAME 0x000A
1541#define NETDEV_FEAT_CHANGE 0x000B
1542#define NETDEV_BONDING_FAILOVER 0x000C
1543#define NETDEV_PRE_UP 0x000D
1544#define NETDEV_PRE_TYPE_CHANGE 0x000E
1545#define NETDEV_POST_TYPE_CHANGE 0x000F
1546#define NETDEV_POST_INIT 0x0010
1547#define NETDEV_UNREGISTER_BATCH 0x0011
1548#define NETDEV_RELEASE 0x0012
1549#define NETDEV_NOTIFY_PEERS 0x0013
1550#define NETDEV_JOIN 0x0014
1551
1552extern int register_netdevice_notifier(struct notifier_block *nb);
1553extern int unregister_netdevice_notifier(struct notifier_block *nb);
1554extern int call_netdevice_notifiers(unsigned long val, struct net_device *dev);
1555
1556
1569extern rwlock_t dev_base_lock; /* Device list lock */ 1557extern rwlock_t dev_base_lock; /* Device list lock */
1570 1558
1571 1559
@@ -1648,12 +1636,9 @@ static inline void unregister_netdevice(struct net_device *dev)
1648extern int netdev_refcnt_read(const struct net_device *dev); 1636extern int netdev_refcnt_read(const struct net_device *dev);
1649extern void free_netdev(struct net_device *dev); 1637extern void free_netdev(struct net_device *dev);
1650extern void synchronize_net(void); 1638extern void synchronize_net(void);
1651extern int register_netdevice_notifier(struct notifier_block *nb);
1652extern int unregister_netdevice_notifier(struct notifier_block *nb);
1653extern int init_dummy_netdev(struct net_device *dev); 1639extern int init_dummy_netdev(struct net_device *dev);
1654extern void netdev_resync_ops(struct net_device *dev); 1640extern void netdev_resync_ops(struct net_device *dev);
1655 1641
1656extern int call_netdevice_notifiers(unsigned long val, struct net_device *dev);
1657extern struct net_device *dev_get_by_index(struct net *net, int ifindex); 1642extern struct net_device *dev_get_by_index(struct net *net, int ifindex);
1658extern struct net_device *__dev_get_by_index(struct net *net, int ifindex); 1643extern struct net_device *__dev_get_by_index(struct net *net, int ifindex);
1659extern struct net_device *dev_get_by_index_rcu(struct net *net, int ifindex); 1644extern struct net_device *dev_get_by_index_rcu(struct net *net, int ifindex);
@@ -1786,8 +1771,6 @@ static inline void input_queue_tail_incr_save(struct softnet_data *sd,
1786 1771
1787DECLARE_PER_CPU_ALIGNED(struct softnet_data, softnet_data); 1772DECLARE_PER_CPU_ALIGNED(struct softnet_data, softnet_data);
1788 1773
1789#define HAVE_NETIF_QUEUE
1790
1791extern void __netif_schedule(struct Qdisc *q); 1774extern void __netif_schedule(struct Qdisc *q);
1792 1775
1793static inline void netif_schedule_queue(struct netdev_queue *txq) 1776static inline void netif_schedule_queue(struct netdev_queue *txq)
@@ -2063,10 +2046,8 @@ extern void dev_kfree_skb_irq(struct sk_buff *skb);
2063 */ 2046 */
2064extern void dev_kfree_skb_any(struct sk_buff *skb); 2047extern void dev_kfree_skb_any(struct sk_buff *skb);
2065 2048
2066#define HAVE_NETIF_RX 1
2067extern int netif_rx(struct sk_buff *skb); 2049extern int netif_rx(struct sk_buff *skb);
2068extern int netif_rx_ni(struct sk_buff *skb); 2050extern int netif_rx_ni(struct sk_buff *skb);
2069#define HAVE_NETIF_RECEIVE_SKB 1
2070extern int netif_receive_skb(struct sk_buff *skb); 2051extern int netif_receive_skb(struct sk_buff *skb);
2071extern gro_result_t dev_gro_receive(struct napi_struct *napi, 2052extern gro_result_t dev_gro_receive(struct napi_struct *napi,
2072 struct sk_buff *skb); 2053 struct sk_buff *skb);
@@ -2246,7 +2227,6 @@ extern void netif_device_attach(struct net_device *dev);
2246/* 2227/*
2247 * Network interface message level settings 2228 * Network interface message level settings
2248 */ 2229 */
2249#define HAVE_NETIF_MSG 1
2250 2230
2251enum { 2231enum {
2252 NETIF_MSG_DRV = 0x0001, 2232 NETIF_MSG_DRV = 0x0001,
@@ -2555,7 +2535,7 @@ extern void netdev_class_remove_file(struct class_attribute *class_attr);
2555 2535
2556extern struct kobj_ns_type_operations net_ns_type_operations; 2536extern struct kobj_ns_type_operations net_ns_type_operations;
2557 2537
2558extern char *netdev_drivername(const struct net_device *dev, char *buffer, int len); 2538extern const char *netdev_drivername(const struct net_device *dev);
2559 2539
2560extern void linkwatch_run_queue(void); 2540extern void linkwatch_run_queue(void);
2561 2541
@@ -2564,7 +2544,6 @@ static inline u32 netdev_get_wanted_features(struct net_device *dev)
2564 return (dev->features & ~dev->hw_features) | dev->wanted_features; 2544 return (dev->features & ~dev->hw_features) | dev->wanted_features;
2565} 2545}
2566u32 netdev_increment_features(u32 all, u32 one, u32 mask); 2546u32 netdev_increment_features(u32 all, u32 one, u32 mask);
2567u32 netdev_fix_features(struct net_device *dev, u32 features);
2568int __netdev_update_features(struct net_device *dev); 2547int __netdev_update_features(struct net_device *dev);
2569void netdev_update_features(struct net_device *dev); 2548void netdev_update_features(struct net_device *dev);
2570void netdev_change_features(struct net_device *dev); 2549void netdev_change_features(struct net_device *dev);
diff --git a/include/linux/netfilter/ipset/ip_set.h b/include/linux/netfilter/ipset/ip_set.h
index 5a262e3ae715..3540c6e262f7 100644
--- a/include/linux/netfilter/ipset/ip_set.h
+++ b/include/linux/netfilter/ipset/ip_set.h
@@ -104,6 +104,8 @@ enum {
104 IPSET_ATTR_NAMEREF, 104 IPSET_ATTR_NAMEREF,
105 IPSET_ATTR_IP2, 105 IPSET_ATTR_IP2,
106 IPSET_ATTR_CIDR2, 106 IPSET_ATTR_CIDR2,
107 IPSET_ATTR_IP2_TO,
108 IPSET_ATTR_IFACE,
107 __IPSET_ATTR_ADT_MAX, 109 __IPSET_ATTR_ADT_MAX,
108}; 110};
109#define IPSET_ATTR_ADT_MAX (__IPSET_ATTR_ADT_MAX - 1) 111#define IPSET_ATTR_ADT_MAX (__IPSET_ATTR_ADT_MAX - 1)
@@ -142,12 +144,18 @@ enum ipset_errno {
142enum ipset_cmd_flags { 144enum ipset_cmd_flags {
143 IPSET_FLAG_BIT_EXIST = 0, 145 IPSET_FLAG_BIT_EXIST = 0,
144 IPSET_FLAG_EXIST = (1 << IPSET_FLAG_BIT_EXIST), 146 IPSET_FLAG_EXIST = (1 << IPSET_FLAG_BIT_EXIST),
147 IPSET_FLAG_BIT_LIST_SETNAME = 1,
148 IPSET_FLAG_LIST_SETNAME = (1 << IPSET_FLAG_BIT_LIST_SETNAME),
149 IPSET_FLAG_BIT_LIST_HEADER = 2,
150 IPSET_FLAG_LIST_HEADER = (1 << IPSET_FLAG_BIT_LIST_HEADER),
145}; 151};
146 152
147/* Flags at CADT attribute level */ 153/* Flags at CADT attribute level */
148enum ipset_cadt_flags { 154enum ipset_cadt_flags {
149 IPSET_FLAG_BIT_BEFORE = 0, 155 IPSET_FLAG_BIT_BEFORE = 0,
150 IPSET_FLAG_BEFORE = (1 << IPSET_FLAG_BIT_BEFORE), 156 IPSET_FLAG_BEFORE = (1 << IPSET_FLAG_BIT_BEFORE),
157 IPSET_FLAG_BIT_PHYSDEV = 1,
158 IPSET_FLAG_PHYSDEV = (1 << IPSET_FLAG_BIT_PHYSDEV),
151}; 159};
152 160
153/* Commands with settype-specific attributes */ 161/* Commands with settype-specific attributes */
@@ -165,6 +173,7 @@ enum ipset_adt {
165#include <linux/ipv6.h> 173#include <linux/ipv6.h>
166#include <linux/netlink.h> 174#include <linux/netlink.h>
167#include <linux/netfilter.h> 175#include <linux/netfilter.h>
176#include <linux/netfilter/x_tables.h>
168#include <linux/vmalloc.h> 177#include <linux/vmalloc.h>
169#include <net/netlink.h> 178#include <net/netlink.h>
170 179
@@ -206,6 +215,8 @@ enum ip_set_feature {
206 IPSET_TYPE_IP2 = (1 << IPSET_TYPE_IP2_FLAG), 215 IPSET_TYPE_IP2 = (1 << IPSET_TYPE_IP2_FLAG),
207 IPSET_TYPE_NAME_FLAG = 4, 216 IPSET_TYPE_NAME_FLAG = 4,
208 IPSET_TYPE_NAME = (1 << IPSET_TYPE_NAME_FLAG), 217 IPSET_TYPE_NAME = (1 << IPSET_TYPE_NAME_FLAG),
218 IPSET_TYPE_IFACE_FLAG = 5,
219 IPSET_TYPE_IFACE = (1 << IPSET_TYPE_IFACE_FLAG),
209 /* Strictly speaking not a feature, but a flag for dumping: 220 /* Strictly speaking not a feature, but a flag for dumping:
210 * this settype must be dumped last */ 221 * this settype must be dumped last */
211 IPSET_DUMP_LAST_FLAG = 7, 222 IPSET_DUMP_LAST_FLAG = 7,
@@ -214,7 +225,17 @@ enum ip_set_feature {
214 225
215struct ip_set; 226struct ip_set;
216 227
217typedef int (*ipset_adtfn)(struct ip_set *set, void *value, u32 timeout); 228typedef int (*ipset_adtfn)(struct ip_set *set, void *value,
229 u32 timeout, u32 flags);
230
231/* Kernel API function options */
232struct ip_set_adt_opt {
233 u8 family; /* Actual protocol family */
234 u8 dim; /* Dimension of match/target */
235 u8 flags; /* Direction and negation flags */
236 u32 cmdflags; /* Command-like flags */
237 u32 timeout; /* Timeout value */
238};
218 239
219/* Set type, variant-specific part */ 240/* Set type, variant-specific part */
220struct ip_set_type_variant { 241struct ip_set_type_variant {
@@ -223,14 +244,15 @@ struct ip_set_type_variant {
223 * zero for no match/success to add/delete 244 * zero for no match/success to add/delete
224 * positive for matching element */ 245 * positive for matching element */
225 int (*kadt)(struct ip_set *set, const struct sk_buff * skb, 246 int (*kadt)(struct ip_set *set, const struct sk_buff * skb,
226 enum ipset_adt adt, u8 pf, u8 dim, u8 flags); 247 const struct xt_action_param *par,
248 enum ipset_adt adt, const struct ip_set_adt_opt *opt);
227 249
228 /* Userspace: test/add/del entries 250 /* Userspace: test/add/del entries
229 * returns negative error code, 251 * returns negative error code,
230 * zero for no match/success to add/delete 252 * zero for no match/success to add/delete
231 * positive for matching element */ 253 * positive for matching element */
232 int (*uadt)(struct ip_set *set, struct nlattr *tb[], 254 int (*uadt)(struct ip_set *set, struct nlattr *tb[],
233 enum ipset_adt adt, u32 *lineno, u32 flags); 255 enum ipset_adt adt, u32 *lineno, u32 flags, bool retried);
234 256
235 /* Low level add/del/test functions */ 257 /* Low level add/del/test functions */
236 ipset_adtfn adt[IPSET_ADT_MAX]; 258 ipset_adtfn adt[IPSET_ADT_MAX];
@@ -268,8 +290,8 @@ struct ip_set_type {
268 u8 dimension; 290 u8 dimension;
269 /* Supported family: may be AF_UNSPEC for both AF_INET/AF_INET6 */ 291 /* Supported family: may be AF_UNSPEC for both AF_INET/AF_INET6 */
270 u8 family; 292 u8 family;
271 /* Type revision */ 293 /* Type revisions */
272 u8 revision; 294 u8 revision_min, revision_max;
273 295
274 /* Create set */ 296 /* Create set */
275 int (*create)(struct ip_set *set, struct nlattr *tb[], u32 flags); 297 int (*create)(struct ip_set *set, struct nlattr *tb[], u32 flags);
@@ -300,6 +322,8 @@ struct ip_set {
300 const struct ip_set_type_variant *variant; 322 const struct ip_set_type_variant *variant;
301 /* The actual INET family of the set */ 323 /* The actual INET family of the set */
302 u8 family; 324 u8 family;
325 /* The type revision */
326 u8 revision;
303 /* The type specific data */ 327 /* The type specific data */
304 void *data; 328 void *data;
305}; 329};
@@ -307,21 +331,25 @@ struct ip_set {
307/* register and unregister set references */ 331/* register and unregister set references */
308extern ip_set_id_t ip_set_get_byname(const char *name, struct ip_set **set); 332extern ip_set_id_t ip_set_get_byname(const char *name, struct ip_set **set);
309extern void ip_set_put_byindex(ip_set_id_t index); 333extern void ip_set_put_byindex(ip_set_id_t index);
310extern const char * ip_set_name_byindex(ip_set_id_t index); 334extern const char *ip_set_name_byindex(ip_set_id_t index);
311extern ip_set_id_t ip_set_nfnl_get(const char *name); 335extern ip_set_id_t ip_set_nfnl_get(const char *name);
312extern ip_set_id_t ip_set_nfnl_get_byindex(ip_set_id_t index); 336extern ip_set_id_t ip_set_nfnl_get_byindex(ip_set_id_t index);
313extern void ip_set_nfnl_put(ip_set_id_t index); 337extern void ip_set_nfnl_put(ip_set_id_t index);
314 338
315/* API for iptables set match, and SET target */ 339/* API for iptables set match, and SET target */
340
316extern int ip_set_add(ip_set_id_t id, const struct sk_buff *skb, 341extern int ip_set_add(ip_set_id_t id, const struct sk_buff *skb,
317 u8 family, u8 dim, u8 flags); 342 const struct xt_action_param *par,
343 const struct ip_set_adt_opt *opt);
318extern int ip_set_del(ip_set_id_t id, const struct sk_buff *skb, 344extern int ip_set_del(ip_set_id_t id, const struct sk_buff *skb,
319 u8 family, u8 dim, u8 flags); 345 const struct xt_action_param *par,
346 const struct ip_set_adt_opt *opt);
320extern int ip_set_test(ip_set_id_t id, const struct sk_buff *skb, 347extern int ip_set_test(ip_set_id_t id, const struct sk_buff *skb,
321 u8 family, u8 dim, u8 flags); 348 const struct xt_action_param *par,
349 const struct ip_set_adt_opt *opt);
322 350
323/* Utility functions */ 351/* Utility functions */
324extern void * ip_set_alloc(size_t size); 352extern void *ip_set_alloc(size_t size);
325extern void ip_set_free(void *members); 353extern void ip_set_free(void *members);
326extern int ip_set_get_ipaddr4(struct nlattr *nla, __be32 *ipaddr); 354extern int ip_set_get_ipaddr4(struct nlattr *nla, __be32 *ipaddr);
327extern int ip_set_get_ipaddr6(struct nlattr *nla, union nf_inet_addr *ipaddr); 355extern int ip_set_get_ipaddr6(struct nlattr *nla, union nf_inet_addr *ipaddr);
@@ -331,7 +359,7 @@ ip_set_get_hostipaddr4(struct nlattr *nla, u32 *ipaddr)
331{ 359{
332 __be32 ip; 360 __be32 ip;
333 int ret = ip_set_get_ipaddr4(nla, &ip); 361 int ret = ip_set_get_ipaddr4(nla, &ip);
334 362
335 if (ret) 363 if (ret)
336 return ret; 364 return ret;
337 *ipaddr = ntohl(ip); 365 *ipaddr = ntohl(ip);
diff --git a/include/linux/netfilter/ipset/ip_set_ahash.h b/include/linux/netfilter/ipset/ip_set_ahash.h
index ac3c822eb39a..b89fb79cb44f 100644
--- a/include/linux/netfilter/ipset/ip_set_ahash.h
+++ b/include/linux/netfilter/ipset/ip_set_ahash.h
@@ -5,6 +5,11 @@
5#include <linux/jhash.h> 5#include <linux/jhash.h>
6#include <linux/netfilter/ipset/ip_set_timeout.h> 6#include <linux/netfilter/ipset/ip_set_timeout.h>
7 7
8#define CONCAT(a, b, c) a##b##c
9#define TOKEN(a, b, c) CONCAT(a, b, c)
10
11#define type_pf_next TOKEN(TYPE, PF, _elem)
12
8/* Hashing which uses arrays to resolve clashing. The hash table is resized 13/* Hashing which uses arrays to resolve clashing. The hash table is resized
9 * (doubled) when searching becomes too long. 14 * (doubled) when searching becomes too long.
10 * Internally jhash is used with the assumption that the size of the 15 * Internally jhash is used with the assumption that the size of the
@@ -23,7 +28,32 @@
23/* Number of elements to store in an initial array block */ 28/* Number of elements to store in an initial array block */
24#define AHASH_INIT_SIZE 4 29#define AHASH_INIT_SIZE 4
25/* Max number of elements to store in an array block */ 30/* Max number of elements to store in an array block */
26#define AHASH_MAX_SIZE (3*4) 31#define AHASH_MAX_SIZE (3*AHASH_INIT_SIZE)
32
33/* Max number of elements can be tuned */
34#ifdef IP_SET_HASH_WITH_MULTI
35#define AHASH_MAX(h) ((h)->ahash_max)
36
37static inline u8
38tune_ahash_max(u8 curr, u32 multi)
39{
40 u32 n;
41
42 if (multi < curr)
43 return curr;
44
45 n = curr + AHASH_INIT_SIZE;
46 /* Currently, at listing one hash bucket must fit into a message.
47 * Therefore we have a hard limit here.
48 */
49 return n > curr && n <= 64 ? n : curr;
50}
51#define TUNE_AHASH_MAX(h, multi) \
52 ((h)->ahash_max = tune_ahash_max((h)->ahash_max, multi))
53#else
54#define AHASH_MAX(h) AHASH_MAX_SIZE
55#define TUNE_AHASH_MAX(h, multi)
56#endif
27 57
28/* A hash bucket */ 58/* A hash bucket */
29struct hbucket { 59struct hbucket {
@@ -38,7 +68,7 @@ struct htable {
38 struct hbucket bucket[0]; /* hashtable buckets */ 68 struct hbucket bucket[0]; /* hashtable buckets */
39}; 69};
40 70
41#define hbucket(h, i) &((h)->bucket[i]) 71#define hbucket(h, i) (&((h)->bucket[i]))
42 72
43/* Book-keeping of the prefixes added to the set */ 73/* Book-keeping of the prefixes added to the set */
44struct ip_set_hash_nets { 74struct ip_set_hash_nets {
@@ -54,9 +84,16 @@ struct ip_set_hash {
54 u32 initval; /* random jhash init value */ 84 u32 initval; /* random jhash init value */
55 u32 timeout; /* timeout value, if enabled */ 85 u32 timeout; /* timeout value, if enabled */
56 struct timer_list gc; /* garbage collection when timeout enabled */ 86 struct timer_list gc; /* garbage collection when timeout enabled */
87 struct type_pf_next next; /* temporary storage for uadd */
88#ifdef IP_SET_HASH_WITH_MULTI
89 u8 ahash_max; /* max elements in an array block */
90#endif
57#ifdef IP_SET_HASH_WITH_NETMASK 91#ifdef IP_SET_HASH_WITH_NETMASK
58 u8 netmask; /* netmask value for subnets to store */ 92 u8 netmask; /* netmask value for subnets to store */
59#endif 93#endif
94#ifdef IP_SET_HASH_WITH_RBTREE
95 struct rb_root rbtree;
96#endif
60#ifdef IP_SET_HASH_WITH_NETS 97#ifdef IP_SET_HASH_WITH_NETS
61 struct ip_set_hash_nets nets[0]; /* book-keeping of prefixes */ 98 struct ip_set_hash_nets nets[0]; /* book-keeping of prefixes */
62#endif 99#endif
@@ -194,17 +231,24 @@ ip_set_hash_destroy(struct ip_set *set)
194 del_timer_sync(&h->gc); 231 del_timer_sync(&h->gc);
195 232
196 ahash_destroy(h->table); 233 ahash_destroy(h->table);
234#ifdef IP_SET_HASH_WITH_RBTREE
235 rbtree_destroy(&h->rbtree);
236#endif
197 kfree(h); 237 kfree(h);
198 238
199 set->data = NULL; 239 set->data = NULL;
200} 240}
201 241
202#define HKEY(data, initval, htable_bits) \
203(jhash2((u32 *)(data), sizeof(struct type_pf_elem)/sizeof(u32), initval) \
204 & jhash_mask(htable_bits))
205
206#endif /* _IP_SET_AHASH_H */ 242#endif /* _IP_SET_AHASH_H */
207 243
244#ifndef HKEY_DATALEN
245#define HKEY_DATALEN sizeof(struct type_pf_elem)
246#endif
247
248#define HKEY(data, initval, htable_bits) \
249(jhash2((u32 *)(data), HKEY_DATALEN/sizeof(u32), initval) \
250 & jhash_mask(htable_bits))
251
208#define CONCAT(a, b, c) a##b##c 252#define CONCAT(a, b, c) a##b##c
209#define TOKEN(a, b, c) CONCAT(a, b, c) 253#define TOKEN(a, b, c) CONCAT(a, b, c)
210 254
@@ -217,6 +261,7 @@ ip_set_hash_destroy(struct ip_set *set)
217#define type_pf_data_netmask TOKEN(TYPE, PF, _data_netmask) 261#define type_pf_data_netmask TOKEN(TYPE, PF, _data_netmask)
218#define type_pf_data_list TOKEN(TYPE, PF, _data_list) 262#define type_pf_data_list TOKEN(TYPE, PF, _data_list)
219#define type_pf_data_tlist TOKEN(TYPE, PF, _data_tlist) 263#define type_pf_data_tlist TOKEN(TYPE, PF, _data_tlist)
264#define type_pf_data_next TOKEN(TYPE, PF, _data_next)
220 265
221#define type_pf_elem TOKEN(TYPE, PF, _elem) 266#define type_pf_elem TOKEN(TYPE, PF, _elem)
222#define type_pf_telem TOKEN(TYPE, PF, _telem) 267#define type_pf_telem TOKEN(TYPE, PF, _telem)
@@ -262,12 +307,13 @@ ip_set_hash_destroy(struct ip_set *set)
262/* Add an element to the hash table when resizing the set: 307/* Add an element to the hash table when resizing the set:
263 * we spare the maintenance of the internal counters. */ 308 * we spare the maintenance of the internal counters. */
264static int 309static int
265type_pf_elem_add(struct hbucket *n, const struct type_pf_elem *value) 310type_pf_elem_add(struct hbucket *n, const struct type_pf_elem *value,
311 u8 ahash_max)
266{ 312{
267 if (n->pos >= n->size) { 313 if (n->pos >= n->size) {
268 void *tmp; 314 void *tmp;
269 315
270 if (n->size >= AHASH_MAX_SIZE) 316 if (n->size >= ahash_max)
271 /* Trigger rehashing */ 317 /* Trigger rehashing */
272 return -EAGAIN; 318 return -EAGAIN;
273 319
@@ -322,7 +368,7 @@ retry:
322 for (j = 0; j < n->pos; j++) { 368 for (j = 0; j < n->pos; j++) {
323 data = ahash_data(n, j); 369 data = ahash_data(n, j);
324 m = hbucket(t, HKEY(data, h->initval, htable_bits)); 370 m = hbucket(t, HKEY(data, h->initval, htable_bits));
325 ret = type_pf_elem_add(m, data); 371 ret = type_pf_elem_add(m, data, AHASH_MAX(h));
326 if (ret < 0) { 372 if (ret < 0) {
327 read_unlock_bh(&set->lock); 373 read_unlock_bh(&set->lock);
328 ahash_destroy(t); 374 ahash_destroy(t);
@@ -346,17 +392,20 @@ retry:
346 return 0; 392 return 0;
347} 393}
348 394
395static inline void
396type_pf_data_next(struct ip_set_hash *h, const struct type_pf_elem *d);
397
349/* Add an element to a hash and update the internal counters when succeeded, 398/* Add an element to a hash and update the internal counters when succeeded,
350 * otherwise report the proper error code. */ 399 * otherwise report the proper error code. */
351static int 400static int
352type_pf_add(struct ip_set *set, void *value, u32 timeout) 401type_pf_add(struct ip_set *set, void *value, u32 timeout, u32 flags)
353{ 402{
354 struct ip_set_hash *h = set->data; 403 struct ip_set_hash *h = set->data;
355 struct htable *t; 404 struct htable *t;
356 const struct type_pf_elem *d = value; 405 const struct type_pf_elem *d = value;
357 struct hbucket *n; 406 struct hbucket *n;
358 int i, ret = 0; 407 int i, ret = 0;
359 u32 key; 408 u32 key, multi = 0;
360 409
361 if (h->elements >= h->maxelem) 410 if (h->elements >= h->maxelem)
362 return -IPSET_ERR_HASH_FULL; 411 return -IPSET_ERR_HASH_FULL;
@@ -366,14 +415,17 @@ type_pf_add(struct ip_set *set, void *value, u32 timeout)
366 key = HKEY(value, h->initval, t->htable_bits); 415 key = HKEY(value, h->initval, t->htable_bits);
367 n = hbucket(t, key); 416 n = hbucket(t, key);
368 for (i = 0; i < n->pos; i++) 417 for (i = 0; i < n->pos; i++)
369 if (type_pf_data_equal(ahash_data(n, i), d)) { 418 if (type_pf_data_equal(ahash_data(n, i), d, &multi)) {
370 ret = -IPSET_ERR_EXIST; 419 ret = -IPSET_ERR_EXIST;
371 goto out; 420 goto out;
372 } 421 }
373 422 TUNE_AHASH_MAX(h, multi);
374 ret = type_pf_elem_add(n, value); 423 ret = type_pf_elem_add(n, value, AHASH_MAX(h));
375 if (ret != 0) 424 if (ret != 0) {
425 if (ret == -EAGAIN)
426 type_pf_data_next(h, d);
376 goto out; 427 goto out;
428 }
377 429
378#ifdef IP_SET_HASH_WITH_NETS 430#ifdef IP_SET_HASH_WITH_NETS
379 add_cidr(h, d->cidr, HOST_MASK); 431 add_cidr(h, d->cidr, HOST_MASK);
@@ -388,7 +440,7 @@ out:
388 * and free up space if possible. 440 * and free up space if possible.
389 */ 441 */
390static int 442static int
391type_pf_del(struct ip_set *set, void *value, u32 timeout) 443type_pf_del(struct ip_set *set, void *value, u32 timeout, u32 flags)
392{ 444{
393 struct ip_set_hash *h = set->data; 445 struct ip_set_hash *h = set->data;
394 struct htable *t = h->table; 446 struct htable *t = h->table;
@@ -396,13 +448,13 @@ type_pf_del(struct ip_set *set, void *value, u32 timeout)
396 struct hbucket *n; 448 struct hbucket *n;
397 int i; 449 int i;
398 struct type_pf_elem *data; 450 struct type_pf_elem *data;
399 u32 key; 451 u32 key, multi = 0;
400 452
401 key = HKEY(value, h->initval, t->htable_bits); 453 key = HKEY(value, h->initval, t->htable_bits);
402 n = hbucket(t, key); 454 n = hbucket(t, key);
403 for (i = 0; i < n->pos; i++) { 455 for (i = 0; i < n->pos; i++) {
404 data = ahash_data(n, i); 456 data = ahash_data(n, i);
405 if (!type_pf_data_equal(data, d)) 457 if (!type_pf_data_equal(data, d, &multi))
406 continue; 458 continue;
407 if (i != n->pos - 1) 459 if (i != n->pos - 1)
408 /* Not last one */ 460 /* Not last one */
@@ -443,17 +495,17 @@ type_pf_test_cidrs(struct ip_set *set, struct type_pf_elem *d, u32 timeout)
443 struct hbucket *n; 495 struct hbucket *n;
444 const struct type_pf_elem *data; 496 const struct type_pf_elem *data;
445 int i, j = 0; 497 int i, j = 0;
446 u32 key; 498 u32 key, multi = 0;
447 u8 host_mask = SET_HOST_MASK(set->family); 499 u8 host_mask = SET_HOST_MASK(set->family);
448 500
449 pr_debug("test by nets\n"); 501 pr_debug("test by nets\n");
450 for (; j < host_mask && h->nets[j].cidr; j++) { 502 for (; j < host_mask && h->nets[j].cidr && !multi; j++) {
451 type_pf_data_netmask(d, h->nets[j].cidr); 503 type_pf_data_netmask(d, h->nets[j].cidr);
452 key = HKEY(d, h->initval, t->htable_bits); 504 key = HKEY(d, h->initval, t->htable_bits);
453 n = hbucket(t, key); 505 n = hbucket(t, key);
454 for (i = 0; i < n->pos; i++) { 506 for (i = 0; i < n->pos; i++) {
455 data = ahash_data(n, i); 507 data = ahash_data(n, i);
456 if (type_pf_data_equal(data, d)) 508 if (type_pf_data_equal(data, d, &multi))
457 return 1; 509 return 1;
458 } 510 }
459 } 511 }
@@ -463,7 +515,7 @@ type_pf_test_cidrs(struct ip_set *set, struct type_pf_elem *d, u32 timeout)
463 515
464/* Test whether the element is added to the set */ 516/* Test whether the element is added to the set */
465static int 517static int
466type_pf_test(struct ip_set *set, void *value, u32 timeout) 518type_pf_test(struct ip_set *set, void *value, u32 timeout, u32 flags)
467{ 519{
468 struct ip_set_hash *h = set->data; 520 struct ip_set_hash *h = set->data;
469 struct htable *t = h->table; 521 struct htable *t = h->table;
@@ -471,7 +523,7 @@ type_pf_test(struct ip_set *set, void *value, u32 timeout)
471 struct hbucket *n; 523 struct hbucket *n;
472 const struct type_pf_elem *data; 524 const struct type_pf_elem *data;
473 int i; 525 int i;
474 u32 key; 526 u32 key, multi = 0;
475 527
476#ifdef IP_SET_HASH_WITH_NETS 528#ifdef IP_SET_HASH_WITH_NETS
477 /* If we test an IP address and not a network address, 529 /* If we test an IP address and not a network address,
@@ -484,7 +536,7 @@ type_pf_test(struct ip_set *set, void *value, u32 timeout)
484 n = hbucket(t, key); 536 n = hbucket(t, key);
485 for (i = 0; i < n->pos; i++) { 537 for (i = 0; i < n->pos; i++) {
486 data = ahash_data(n, i); 538 data = ahash_data(n, i);
487 if (type_pf_data_equal(data, d)) 539 if (type_pf_data_equal(data, d, &multi))
488 return 1; 540 return 1;
489 } 541 }
490 return 0; 542 return 0;
@@ -586,10 +638,11 @@ nla_put_failure:
586 638
587static int 639static int
588type_pf_kadt(struct ip_set *set, const struct sk_buff * skb, 640type_pf_kadt(struct ip_set *set, const struct sk_buff * skb,
589 enum ipset_adt adt, u8 pf, u8 dim, u8 flags); 641 const struct xt_action_param *par,
642 enum ipset_adt adt, const struct ip_set_adt_opt *opt);
590static int 643static int
591type_pf_uadt(struct ip_set *set, struct nlattr *tb[], 644type_pf_uadt(struct ip_set *set, struct nlattr *tb[],
592 enum ipset_adt adt, u32 *lineno, u32 flags); 645 enum ipset_adt adt, u32 *lineno, u32 flags, bool retried);
593 646
594static const struct ip_set_type_variant type_pf_variant = { 647static const struct ip_set_type_variant type_pf_variant = {
595 .kadt = type_pf_kadt, 648 .kadt = type_pf_kadt,
@@ -640,14 +693,14 @@ type_pf_data_timeout_set(struct type_pf_elem *data, u32 timeout)
640 693
641static int 694static int
642type_pf_elem_tadd(struct hbucket *n, const struct type_pf_elem *value, 695type_pf_elem_tadd(struct hbucket *n, const struct type_pf_elem *value,
643 u32 timeout) 696 u8 ahash_max, u32 timeout)
644{ 697{
645 struct type_pf_elem *data; 698 struct type_pf_elem *data;
646 699
647 if (n->pos >= n->size) { 700 if (n->pos >= n->size) {
648 void *tmp; 701 void *tmp;
649 702
650 if (n->size >= AHASH_MAX_SIZE) 703 if (n->size >= ahash_max)
651 /* Trigger rehashing */ 704 /* Trigger rehashing */
652 return -EAGAIN; 705 return -EAGAIN;
653 706
@@ -752,7 +805,7 @@ retry:
752 for (j = 0; j < n->pos; j++) { 805 for (j = 0; j < n->pos; j++) {
753 data = ahash_tdata(n, j); 806 data = ahash_tdata(n, j);
754 m = hbucket(t, HKEY(data, h->initval, htable_bits)); 807 m = hbucket(t, HKEY(data, h->initval, htable_bits));
755 ret = type_pf_elem_tadd(m, data, 808 ret = type_pf_elem_tadd(m, data, AHASH_MAX(h),
756 type_pf_data_timeout(data)); 809 type_pf_data_timeout(data));
757 if (ret < 0) { 810 if (ret < 0) {
758 read_unlock_bh(&set->lock); 811 read_unlock_bh(&set->lock);
@@ -776,15 +829,16 @@ retry:
776} 829}
777 830
778static int 831static int
779type_pf_tadd(struct ip_set *set, void *value, u32 timeout) 832type_pf_tadd(struct ip_set *set, void *value, u32 timeout, u32 flags)
780{ 833{
781 struct ip_set_hash *h = set->data; 834 struct ip_set_hash *h = set->data;
782 struct htable *t = h->table; 835 struct htable *t = h->table;
783 const struct type_pf_elem *d = value; 836 const struct type_pf_elem *d = value;
784 struct hbucket *n; 837 struct hbucket *n;
785 struct type_pf_elem *data; 838 struct type_pf_elem *data;
786 int ret = 0, i, j = AHASH_MAX_SIZE + 1; 839 int ret = 0, i, j = AHASH_MAX(h) + 1;
787 u32 key; 840 bool flag_exist = flags & IPSET_FLAG_EXIST;
841 u32 key, multi = 0;
788 842
789 if (h->elements >= h->maxelem) 843 if (h->elements >= h->maxelem)
790 /* FIXME: when set is full, we slow down here */ 844 /* FIXME: when set is full, we slow down here */
@@ -798,18 +852,18 @@ type_pf_tadd(struct ip_set *set, void *value, u32 timeout)
798 n = hbucket(t, key); 852 n = hbucket(t, key);
799 for (i = 0; i < n->pos; i++) { 853 for (i = 0; i < n->pos; i++) {
800 data = ahash_tdata(n, i); 854 data = ahash_tdata(n, i);
801 if (type_pf_data_equal(data, d)) { 855 if (type_pf_data_equal(data, d, &multi)) {
802 if (type_pf_data_expired(data)) 856 if (type_pf_data_expired(data) || flag_exist)
803 j = i; 857 j = i;
804 else { 858 else {
805 ret = -IPSET_ERR_EXIST; 859 ret = -IPSET_ERR_EXIST;
806 goto out; 860 goto out;
807 } 861 }
808 } else if (j == AHASH_MAX_SIZE + 1 && 862 } else if (j == AHASH_MAX(h) + 1 &&
809 type_pf_data_expired(data)) 863 type_pf_data_expired(data))
810 j = i; 864 j = i;
811 } 865 }
812 if (j != AHASH_MAX_SIZE + 1) { 866 if (j != AHASH_MAX(h) + 1) {
813 data = ahash_tdata(n, j); 867 data = ahash_tdata(n, j);
814#ifdef IP_SET_HASH_WITH_NETS 868#ifdef IP_SET_HASH_WITH_NETS
815 del_cidr(h, data->cidr, HOST_MASK); 869 del_cidr(h, data->cidr, HOST_MASK);
@@ -819,9 +873,13 @@ type_pf_tadd(struct ip_set *set, void *value, u32 timeout)
819 type_pf_data_timeout_set(data, timeout); 873 type_pf_data_timeout_set(data, timeout);
820 goto out; 874 goto out;
821 } 875 }
822 ret = type_pf_elem_tadd(n, d, timeout); 876 TUNE_AHASH_MAX(h, multi);
823 if (ret != 0) 877 ret = type_pf_elem_tadd(n, d, AHASH_MAX(h), timeout);
878 if (ret != 0) {
879 if (ret == -EAGAIN)
880 type_pf_data_next(h, d);
824 goto out; 881 goto out;
882 }
825 883
826#ifdef IP_SET_HASH_WITH_NETS 884#ifdef IP_SET_HASH_WITH_NETS
827 add_cidr(h, d->cidr, HOST_MASK); 885 add_cidr(h, d->cidr, HOST_MASK);
@@ -833,7 +891,7 @@ out:
833} 891}
834 892
835static int 893static int
836type_pf_tdel(struct ip_set *set, void *value, u32 timeout) 894type_pf_tdel(struct ip_set *set, void *value, u32 timeout, u32 flags)
837{ 895{
838 struct ip_set_hash *h = set->data; 896 struct ip_set_hash *h = set->data;
839 struct htable *t = h->table; 897 struct htable *t = h->table;
@@ -841,13 +899,13 @@ type_pf_tdel(struct ip_set *set, void *value, u32 timeout)
841 struct hbucket *n; 899 struct hbucket *n;
842 int i; 900 int i;
843 struct type_pf_elem *data; 901 struct type_pf_elem *data;
844 u32 key; 902 u32 key, multi = 0;
845 903
846 key = HKEY(value, h->initval, t->htable_bits); 904 key = HKEY(value, h->initval, t->htable_bits);
847 n = hbucket(t, key); 905 n = hbucket(t, key);
848 for (i = 0; i < n->pos; i++) { 906 for (i = 0; i < n->pos; i++) {
849 data = ahash_tdata(n, i); 907 data = ahash_tdata(n, i);
850 if (!type_pf_data_equal(data, d)) 908 if (!type_pf_data_equal(data, d, &multi))
851 continue; 909 continue;
852 if (type_pf_data_expired(data)) 910 if (type_pf_data_expired(data))
853 return -IPSET_ERR_EXIST; 911 return -IPSET_ERR_EXIST;
@@ -887,16 +945,16 @@ type_pf_ttest_cidrs(struct ip_set *set, struct type_pf_elem *d, u32 timeout)
887 struct type_pf_elem *data; 945 struct type_pf_elem *data;
888 struct hbucket *n; 946 struct hbucket *n;
889 int i, j = 0; 947 int i, j = 0;
890 u32 key; 948 u32 key, multi = 0;
891 u8 host_mask = SET_HOST_MASK(set->family); 949 u8 host_mask = SET_HOST_MASK(set->family);
892 950
893 for (; j < host_mask && h->nets[j].cidr; j++) { 951 for (; j < host_mask && h->nets[j].cidr && !multi; j++) {
894 type_pf_data_netmask(d, h->nets[j].cidr); 952 type_pf_data_netmask(d, h->nets[j].cidr);
895 key = HKEY(d, h->initval, t->htable_bits); 953 key = HKEY(d, h->initval, t->htable_bits);
896 n = hbucket(t, key); 954 n = hbucket(t, key);
897 for (i = 0; i < n->pos; i++) { 955 for (i = 0; i < n->pos; i++) {
898 data = ahash_tdata(n, i); 956 data = ahash_tdata(n, i);
899 if (type_pf_data_equal(data, d)) 957 if (type_pf_data_equal(data, d, &multi))
900 return !type_pf_data_expired(data); 958 return !type_pf_data_expired(data);
901 } 959 }
902 } 960 }
@@ -905,14 +963,14 @@ type_pf_ttest_cidrs(struct ip_set *set, struct type_pf_elem *d, u32 timeout)
905#endif 963#endif
906 964
907static int 965static int
908type_pf_ttest(struct ip_set *set, void *value, u32 timeout) 966type_pf_ttest(struct ip_set *set, void *value, u32 timeout, u32 flags)
909{ 967{
910 struct ip_set_hash *h = set->data; 968 struct ip_set_hash *h = set->data;
911 struct htable *t = h->table; 969 struct htable *t = h->table;
912 struct type_pf_elem *data, *d = value; 970 struct type_pf_elem *data, *d = value;
913 struct hbucket *n; 971 struct hbucket *n;
914 int i; 972 int i;
915 u32 key; 973 u32 key, multi = 0;
916 974
917#ifdef IP_SET_HASH_WITH_NETS 975#ifdef IP_SET_HASH_WITH_NETS
918 if (d->cidr == SET_HOST_MASK(set->family)) 976 if (d->cidr == SET_HOST_MASK(set->family))
@@ -922,7 +980,7 @@ type_pf_ttest(struct ip_set *set, void *value, u32 timeout)
922 n = hbucket(t, key); 980 n = hbucket(t, key);
923 for (i = 0; i < n->pos; i++) { 981 for (i = 0; i < n->pos; i++) {
924 data = ahash_tdata(n, i); 982 data = ahash_tdata(n, i);
925 if (type_pf_data_equal(data, d)) 983 if (type_pf_data_equal(data, d, &multi))
926 return !type_pf_data_expired(data); 984 return !type_pf_data_expired(data);
927 } 985 }
928 return 0; 986 return 0;
@@ -1030,6 +1088,8 @@ type_pf_gc_init(struct ip_set *set)
1030 IPSET_GC_PERIOD(h->timeout)); 1088 IPSET_GC_PERIOD(h->timeout));
1031} 1089}
1032 1090
1091#undef HKEY_DATALEN
1092#undef HKEY
1033#undef type_pf_data_equal 1093#undef type_pf_data_equal
1034#undef type_pf_data_isnull 1094#undef type_pf_data_isnull
1035#undef type_pf_data_copy 1095#undef type_pf_data_copy
diff --git a/include/linux/netfilter/ipset/ip_set_hash.h b/include/linux/netfilter/ipset/ip_set_hash.h
index b86f15c04524..e2a9fae767f6 100644
--- a/include/linux/netfilter/ipset/ip_set_hash.h
+++ b/include/linux/netfilter/ipset/ip_set_hash.h
@@ -11,6 +11,10 @@ enum {
11 IPSET_ERR_INVALID_PROTO, 11 IPSET_ERR_INVALID_PROTO,
12 /* Protocol missing but must be specified */ 12 /* Protocol missing but must be specified */
13 IPSET_ERR_MISSING_PROTO, 13 IPSET_ERR_MISSING_PROTO,
14 /* Range not supported */
15 IPSET_ERR_HASH_RANGE_UNSUPPORTED,
16 /* Invalid range */
17 IPSET_ERR_HASH_RANGE,
14}; 18};
15 19
16#ifdef __KERNEL__ 20#ifdef __KERNEL__
diff --git a/include/linux/netfilter/ipset/ip_set_timeout.h b/include/linux/netfilter/ipset/ip_set_timeout.h
index bcdd40ad39ed..47923205a4ad 100644
--- a/include/linux/netfilter/ipset/ip_set_timeout.h
+++ b/include/linux/netfilter/ipset/ip_set_timeout.h
@@ -22,6 +22,9 @@
22 22
23#define with_timeout(timeout) ((timeout) != IPSET_NO_TIMEOUT) 23#define with_timeout(timeout) ((timeout) != IPSET_NO_TIMEOUT)
24 24
25#define opt_timeout(opt, map) \
26 (with_timeout((opt)->timeout) ? (opt)->timeout : (map)->timeout)
27
25static inline unsigned int 28static inline unsigned int
26ip_set_timeout_uget(struct nlattr *tb) 29ip_set_timeout_uget(struct nlattr *tb)
27{ 30{
@@ -75,7 +78,7 @@ ip_set_timeout_set(u32 timeout)
75static inline u32 78static inline u32
76ip_set_timeout_get(unsigned long timeout) 79ip_set_timeout_get(unsigned long timeout)
77{ 80{
78 return timeout == IPSET_ELEM_PERMANENT ? 0 : 81 return timeout == IPSET_ELEM_PERMANENT ? 0 :
79 jiffies_to_msecs(timeout - jiffies)/1000; 82 jiffies_to_msecs(timeout - jiffies)/1000;
80} 83}
81 84
diff --git a/include/linux/netfilter/ipset/pfxlen.h b/include/linux/netfilter/ipset/pfxlen.h
index 0e1fb50da562..199fd11fedc0 100644
--- a/include/linux/netfilter/ipset/pfxlen.h
+++ b/include/linux/netfilter/ipset/pfxlen.h
@@ -2,7 +2,8 @@
2#define _PFXLEN_H 2#define _PFXLEN_H
3 3
4#include <asm/byteorder.h> 4#include <asm/byteorder.h>
5#include <linux/netfilter.h> 5#include <linux/netfilter.h>
6#include <net/tcp.h>
6 7
7/* Prefixlen maps, by Jan Engelhardt */ 8/* Prefixlen maps, by Jan Engelhardt */
8extern const union nf_inet_addr ip_set_netmask_map[]; 9extern const union nf_inet_addr ip_set_netmask_map[];
@@ -32,4 +33,12 @@ ip_set_hostmask6(u8 pfxlen)
32 return &ip_set_hostmask_map[pfxlen].ip6[0]; 33 return &ip_set_hostmask_map[pfxlen].ip6[0];
33} 34}
34 35
36extern u32 ip_set_range_to_cidr(u32 from, u32 to, u8 *cidr);
37
38#define ip_set_mask_from_to(from, to, cidr) \
39do { \
40 from &= ip_set_hostmask(cidr); \
41 to = from | ~ip_set_hostmask(cidr); \
42} while (0)
43
35#endif /*_PFXLEN_H */ 44#endif /*_PFXLEN_H */
diff --git a/include/linux/netfilter/nf_conntrack_common.h b/include/linux/netfilter/nf_conntrack_common.h
index 50cdc2559a5a..0d3dd66322ec 100644
--- a/include/linux/netfilter/nf_conntrack_common.h
+++ b/include/linux/netfilter/nf_conntrack_common.h
@@ -18,6 +18,9 @@ enum ip_conntrack_info {
18 /* >= this indicates reply direction */ 18 /* >= this indicates reply direction */
19 IP_CT_IS_REPLY, 19 IP_CT_IS_REPLY,
20 20
21 IP_CT_ESTABLISHED_REPLY = IP_CT_ESTABLISHED + IP_CT_IS_REPLY,
22 IP_CT_RELATED_REPLY = IP_CT_RELATED + IP_CT_IS_REPLY,
23 IP_CT_NEW_REPLY = IP_CT_NEW + IP_CT_IS_REPLY,
21 /* Number of distinct IP_CT types (no NEW in reply dirn). */ 24 /* Number of distinct IP_CT types (no NEW in reply dirn). */
22 IP_CT_NUMBER = IP_CT_IS_REPLY * 2 - 1 25 IP_CT_NUMBER = IP_CT_IS_REPLY * 2 - 1
23}; 26};
diff --git a/include/linux/netfilter/nfnetlink.h b/include/linux/netfilter/nfnetlink.h
index 2b11fc1a86be..74d33861473c 100644
--- a/include/linux/netfilter/nfnetlink.h
+++ b/include/linux/netfilter/nfnetlink.h
@@ -60,6 +60,9 @@ struct nfnl_callback {
60 int (*call)(struct sock *nl, struct sk_buff *skb, 60 int (*call)(struct sock *nl, struct sk_buff *skb,
61 const struct nlmsghdr *nlh, 61 const struct nlmsghdr *nlh,
62 const struct nlattr * const cda[]); 62 const struct nlattr * const cda[]);
63 int (*call_rcu)(struct sock *nl, struct sk_buff *skb,
64 const struct nlmsghdr *nlh,
65 const struct nlattr * const cda[]);
63 const struct nla_policy *policy; /* netlink attribute policy */ 66 const struct nla_policy *policy; /* netlink attribute policy */
64 const u_int16_t attr_count; /* number of nlattr's */ 67 const u_int16_t attr_count; /* number of nlattr's */
65}; 68};
diff --git a/include/linux/netfilter/nfnetlink_queue.h b/include/linux/netfilter/nfnetlink_queue.h
index af94e0014ebd..24b32e6c009e 100644
--- a/include/linux/netfilter/nfnetlink_queue.h
+++ b/include/linux/netfilter/nfnetlink_queue.h
@@ -8,6 +8,7 @@ enum nfqnl_msg_types {
8 NFQNL_MSG_PACKET, /* packet from kernel to userspace */ 8 NFQNL_MSG_PACKET, /* packet from kernel to userspace */
9 NFQNL_MSG_VERDICT, /* verdict from userspace to kernel */ 9 NFQNL_MSG_VERDICT, /* verdict from userspace to kernel */
10 NFQNL_MSG_CONFIG, /* connect to a particular queue */ 10 NFQNL_MSG_CONFIG, /* connect to a particular queue */
11 NFQNL_MSG_VERDICT_BATCH, /* batchv from userspace to kernel */
11 12
12 NFQNL_MSG_MAX 13 NFQNL_MSG_MAX
13}; 14};
diff --git a/include/linux/netfilter/xt_set.h b/include/linux/netfilter/xt_set.h
index 081f1ded2842..c0405ac92870 100644
--- a/include/linux/netfilter/xt_set.h
+++ b/include/linux/netfilter/xt_set.h
@@ -35,7 +35,7 @@ struct xt_set_info_target_v0 {
35 struct xt_set_info_v0 del_set; 35 struct xt_set_info_v0 del_set;
36}; 36};
37 37
38/* Revision 1: current interface to netfilter/iptables */ 38/* Revision 1 match and target */
39 39
40struct xt_set_info { 40struct xt_set_info {
41 ip_set_id_t index; 41 ip_set_id_t index;
@@ -44,13 +44,22 @@ struct xt_set_info {
44}; 44};
45 45
46/* match and target infos */ 46/* match and target infos */
47struct xt_set_info_match { 47struct xt_set_info_match_v1 {
48 struct xt_set_info match_set; 48 struct xt_set_info match_set;
49}; 49};
50 50
51struct xt_set_info_target { 51struct xt_set_info_target_v1 {
52 struct xt_set_info add_set; 52 struct xt_set_info add_set;
53 struct xt_set_info del_set; 53 struct xt_set_info del_set;
54}; 54};
55 55
56/* Revision 2 target */
57
58struct xt_set_info_target_v2 {
59 struct xt_set_info add_set;
60 struct xt_set_info del_set;
61 u32 flags;
62 u32 timeout;
63};
64
56#endif /*_XT_SET_H*/ 65#endif /*_XT_SET_H*/
diff --git a/include/linux/netlink.h b/include/linux/netlink.h
index a9dd89552f9c..2e17c5dbdcb8 100644
--- a/include/linux/netlink.h
+++ b/include/linux/netlink.h
@@ -49,6 +49,7 @@ struct nlmsghdr {
49#define NLM_F_MULTI 2 /* Multipart message, terminated by NLMSG_DONE */ 49#define NLM_F_MULTI 2 /* Multipart message, terminated by NLMSG_DONE */
50#define NLM_F_ACK 4 /* Reply with ack, with zero or error code */ 50#define NLM_F_ACK 4 /* Reply with ack, with zero or error code */
51#define NLM_F_ECHO 8 /* Echo this request */ 51#define NLM_F_ECHO 8 /* Echo this request */
52#define NLM_F_DUMP_INTR 16 /* Dump was inconsistent due to sequence change */
52 53
53/* Modifiers to GET request */ 54/* Modifiers to GET request */
54#define NLM_F_ROOT 0x100 /* specify tree root */ 55#define NLM_F_ROOT 0x100 /* specify tree root */
@@ -221,7 +222,9 @@ struct netlink_callback {
221 int (*dump)(struct sk_buff * skb, 222 int (*dump)(struct sk_buff * skb,
222 struct netlink_callback *cb); 223 struct netlink_callback *cb);
223 int (*done)(struct netlink_callback *cb); 224 int (*done)(struct netlink_callback *cb);
224 int family; 225 u16 family;
226 u16 min_dump_alloc;
227 unsigned int prev_seq, seq;
225 long args[6]; 228 long args[6];
226}; 229};
227 230
@@ -259,7 +262,8 @@ __nlmsg_put(struct sk_buff *skb, u32 pid, u32 seq, int type, int len, int flags)
259extern int netlink_dump_start(struct sock *ssk, struct sk_buff *skb, 262extern int netlink_dump_start(struct sock *ssk, struct sk_buff *skb,
260 const struct nlmsghdr *nlh, 263 const struct nlmsghdr *nlh,
261 int (*dump)(struct sk_buff *skb, struct netlink_callback*), 264 int (*dump)(struct sk_buff *skb, struct netlink_callback*),
262 int (*done)(struct netlink_callback*)); 265 int (*done)(struct netlink_callback*),
266 u16 min_dump_alloc);
263 267
264 268
265#define NL_NONROOT_RECV 0x1 269#define NL_NONROOT_RECV 0x1
diff --git a/include/linux/netpoll.h b/include/linux/netpoll.h
index 79358bb712c6..5dfa091c3347 100644
--- a/include/linux/netpoll.h
+++ b/include/linux/netpoll.h
@@ -40,8 +40,6 @@ struct netpoll_info {
40 struct netpoll *netpoll; 40 struct netpoll *netpoll;
41}; 41};
42 42
43void netpoll_poll_dev(struct net_device *dev);
44void netpoll_poll(struct netpoll *np);
45void netpoll_send_udp(struct netpoll *np, const char *msg, int len); 43void netpoll_send_udp(struct netpoll *np, const char *msg, int len);
46void netpoll_print_options(struct netpoll *np); 44void netpoll_print_options(struct netpoll *np);
47int netpoll_parse_options(struct netpoll *np, char *opt); 45int netpoll_parse_options(struct netpoll *np, char *opt);
diff --git a/include/linux/nfc.h b/include/linux/nfc.h
new file mode 100644
index 000000000000..330a4c5db588
--- /dev/null
+++ b/include/linux/nfc.h
@@ -0,0 +1,126 @@
1/*
2 * Copyright (C) 2011 Instituto Nokia de Tecnologia
3 *
4 * Authors:
5 * Lauro Ramos Venancio <lauro.venancio@openbossa.org>
6 * Aloisio Almeida Jr <aloisio.almeida@openbossa.org>
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the
20 * Free Software Foundation, Inc.,
21 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
22 */
23
24#ifndef __LINUX_NFC_H
25#define __LINUX_NFC_H
26
27#include <linux/types.h>
28#include <linux/socket.h>
29
30#define NFC_GENL_NAME "nfc"
31#define NFC_GENL_VERSION 1
32
33#define NFC_GENL_MCAST_EVENT_NAME "events"
34
35/**
36 * enum nfc_commands - supported nfc commands
37 *
38 * @NFC_CMD_UNSPEC: unspecified command
39 *
40 * @NFC_CMD_GET_DEVICE: request information about a device (requires
41 * %NFC_ATTR_DEVICE_INDEX) or dump request to get a list of all nfc devices
42 * @NFC_CMD_START_POLL: start polling for targets using the given protocols
43 * (requires %NFC_ATTR_DEVICE_INDEX and %NFC_ATTR_PROTOCOLS)
44 * @NFC_CMD_STOP_POLL: stop polling for targets (requires
45 * %NFC_ATTR_DEVICE_INDEX)
46 * @NFC_CMD_GET_TARGET: dump all targets found by the previous poll (requires
47 * %NFC_ATTR_DEVICE_INDEX)
48 * @NFC_EVENT_TARGETS_FOUND: event emitted when a new target is found
49 * (it sends %NFC_ATTR_DEVICE_INDEX)
50 * @NFC_EVENT_DEVICE_ADDED: event emitted when a new device is registred
51 * (it sends %NFC_ATTR_DEVICE_NAME, %NFC_ATTR_DEVICE_INDEX and
52 * %NFC_ATTR_PROTOCOLS)
53 * @NFC_EVENT_DEVICE_REMOVED: event emitted when a device is removed
54 * (it sends %NFC_ATTR_DEVICE_INDEX)
55 */
56enum nfc_commands {
57 NFC_CMD_UNSPEC,
58 NFC_CMD_GET_DEVICE,
59 NFC_CMD_START_POLL,
60 NFC_CMD_STOP_POLL,
61 NFC_CMD_GET_TARGET,
62 NFC_EVENT_TARGETS_FOUND,
63 NFC_EVENT_DEVICE_ADDED,
64 NFC_EVENT_DEVICE_REMOVED,
65/* private: internal use only */
66 __NFC_CMD_AFTER_LAST
67};
68#define NFC_CMD_MAX (__NFC_CMD_AFTER_LAST - 1)
69
70/**
71 * enum nfc_attrs - supported nfc attributes
72 *
73 * @NFC_ATTR_UNSPEC: unspecified attribute
74 *
75 * @NFC_ATTR_DEVICE_INDEX: index of nfc device
76 * @NFC_ATTR_DEVICE_NAME: device name, max 8 chars
77 * @NFC_ATTR_PROTOCOLS: nfc protocols - bitwise or-ed combination from
78 * NFC_PROTO_*_MASK constants
79 * @NFC_ATTR_TARGET_INDEX: index of the nfc target
80 * @NFC_ATTR_TARGET_SENS_RES: NFC-A targets extra information such as NFCID
81 * @NFC_ATTR_TARGET_SEL_RES: NFC-A targets extra information (useful if the
82 * target is not NFC-Forum compliant)
83 */
84enum nfc_attrs {
85 NFC_ATTR_UNSPEC,
86 NFC_ATTR_DEVICE_INDEX,
87 NFC_ATTR_DEVICE_NAME,
88 NFC_ATTR_PROTOCOLS,
89 NFC_ATTR_TARGET_INDEX,
90 NFC_ATTR_TARGET_SENS_RES,
91 NFC_ATTR_TARGET_SEL_RES,
92/* private: internal use only */
93 __NFC_ATTR_AFTER_LAST
94};
95#define NFC_ATTR_MAX (__NFC_ATTR_AFTER_LAST - 1)
96
97#define NFC_DEVICE_NAME_MAXSIZE 8
98
99/* NFC protocols */
100#define NFC_PROTO_JEWEL 1
101#define NFC_PROTO_MIFARE 2
102#define NFC_PROTO_FELICA 3
103#define NFC_PROTO_ISO14443 4
104#define NFC_PROTO_NFC_DEP 5
105
106#define NFC_PROTO_MAX 6
107
108/* NFC protocols masks used in bitsets */
109#define NFC_PROTO_JEWEL_MASK (1 << NFC_PROTO_JEWEL)
110#define NFC_PROTO_MIFARE_MASK (1 << NFC_PROTO_MIFARE)
111#define NFC_PROTO_FELICA_MASK (1 << NFC_PROTO_FELICA)
112#define NFC_PROTO_ISO14443_MASK (1 << NFC_PROTO_ISO14443)
113#define NFC_PROTO_NFC_DEP_MASK (1 << NFC_PROTO_NFC_DEP)
114
115struct sockaddr_nfc {
116 sa_family_t sa_family;
117 __u32 dev_idx;
118 __u32 target_idx;
119 __u32 nfc_protocol;
120};
121
122/* NFC socket protocols */
123#define NFC_SOCKPROTO_RAW 0
124#define NFC_SOCKPROTO_MAX 1
125
126#endif /*__LINUX_NFC_H */
diff --git a/include/linux/nfs_fs.h b/include/linux/nfs_fs.h
index 1b93b9c60e55..8b579beb6358 100644
--- a/include/linux/nfs_fs.h
+++ b/include/linux/nfs_fs.h
@@ -85,7 +85,7 @@ struct nfs_lock_context {
85struct nfs4_state; 85struct nfs4_state;
86struct nfs_open_context { 86struct nfs_open_context {
87 struct nfs_lock_context lock_context; 87 struct nfs_lock_context lock_context;
88 struct path path; 88 struct dentry *dentry;
89 struct rpc_cred *cred; 89 struct rpc_cred *cred;
90 struct nfs4_state *state; 90 struct nfs4_state *state;
91 fmode_t mode; 91 fmode_t mode;
@@ -360,7 +360,7 @@ extern int nfs_refresh_inode(struct inode *, struct nfs_fattr *);
360extern int nfs_post_op_update_inode(struct inode *inode, struct nfs_fattr *fattr); 360extern int nfs_post_op_update_inode(struct inode *inode, struct nfs_fattr *fattr);
361extern int nfs_post_op_update_inode_force_wcc(struct inode *inode, struct nfs_fattr *fattr); 361extern int nfs_post_op_update_inode_force_wcc(struct inode *inode, struct nfs_fattr *fattr);
362extern int nfs_getattr(struct vfsmount *, struct dentry *, struct kstat *); 362extern int nfs_getattr(struct vfsmount *, struct dentry *, struct kstat *);
363extern int nfs_permission(struct inode *, int, unsigned int); 363extern int nfs_permission(struct inode *, int);
364extern int nfs_open(struct inode *, struct file *); 364extern int nfs_open(struct inode *, struct file *);
365extern int nfs_release(struct inode *, struct file *); 365extern int nfs_release(struct inode *, struct file *);
366extern int nfs_attribute_timeout(struct inode *inode); 366extern int nfs_attribute_timeout(struct inode *inode);
@@ -372,7 +372,7 @@ extern void nfs_setattr_update_inode(struct inode *inode, struct iattr *attr);
372extern struct nfs_open_context *get_nfs_open_context(struct nfs_open_context *ctx); 372extern struct nfs_open_context *get_nfs_open_context(struct nfs_open_context *ctx);
373extern void put_nfs_open_context(struct nfs_open_context *ctx); 373extern void put_nfs_open_context(struct nfs_open_context *ctx);
374extern struct nfs_open_context *nfs_find_open_context(struct inode *inode, struct rpc_cred *cred, fmode_t mode); 374extern struct nfs_open_context *nfs_find_open_context(struct inode *inode, struct rpc_cred *cred, fmode_t mode);
375extern struct nfs_open_context *alloc_nfs_open_context(struct path *path, struct rpc_cred *cred, fmode_t f_mode); 375extern struct nfs_open_context *alloc_nfs_open_context(struct dentry *dentry, struct rpc_cred *cred, fmode_t f_mode);
376extern void nfs_file_set_open_context(struct file *filp, struct nfs_open_context *ctx); 376extern void nfs_file_set_open_context(struct file *filp, struct nfs_open_context *ctx);
377extern struct nfs_lock_context *nfs_get_lock_context(struct nfs_open_context *ctx); 377extern struct nfs_lock_context *nfs_get_lock_context(struct nfs_open_context *ctx);
378extern void nfs_put_lock_context(struct nfs_lock_context *l_ctx); 378extern void nfs_put_lock_context(struct nfs_lock_context *l_ctx);
diff --git a/include/linux/nfs_page.h b/include/linux/nfs_page.h
index 3a34e80ae92f..25311b3bedf8 100644
--- a/include/linux/nfs_page.h
+++ b/include/linux/nfs_page.h
@@ -92,6 +92,9 @@ extern int nfs_pageio_add_request(struct nfs_pageio_descriptor *,
92 struct nfs_page *); 92 struct nfs_page *);
93extern void nfs_pageio_complete(struct nfs_pageio_descriptor *desc); 93extern void nfs_pageio_complete(struct nfs_pageio_descriptor *desc);
94extern void nfs_pageio_cond_complete(struct nfs_pageio_descriptor *, pgoff_t); 94extern void nfs_pageio_cond_complete(struct nfs_pageio_descriptor *, pgoff_t);
95extern bool nfs_generic_pg_test(struct nfs_pageio_descriptor *desc,
96 struct nfs_page *prev,
97 struct nfs_page *req);
95extern int nfs_wait_on_request(struct nfs_page *); 98extern int nfs_wait_on_request(struct nfs_page *);
96extern void nfs_unlock_request(struct nfs_page *req); 99extern void nfs_unlock_request(struct nfs_page *req);
97extern int nfs_set_page_tag_locked(struct nfs_page *req); 100extern int nfs_set_page_tag_locked(struct nfs_page *req);
diff --git a/include/linux/nfs_xdr.h b/include/linux/nfs_xdr.h
index 5e8444a11adf..00848d86ffb2 100644
--- a/include/linux/nfs_xdr.h
+++ b/include/linux/nfs_xdr.h
@@ -158,7 +158,6 @@ struct nfs_seqid;
158 158
159/* nfs41 sessions channel attributes */ 159/* nfs41 sessions channel attributes */
160struct nfs4_channel_attrs { 160struct nfs4_channel_attrs {
161 u32 headerpadsz;
162 u32 max_rqst_sz; 161 u32 max_rqst_sz;
163 u32 max_resp_sz; 162 u32 max_resp_sz;
164 u32 max_resp_sz_cached; 163 u32 max_resp_sz_cached;
diff --git a/include/linux/nfsd/export.h b/include/linux/nfsd/export.h
index 84058ec69390..8a31a20efe7e 100644
--- a/include/linux/nfsd/export.h
+++ b/include/linux/nfsd/export.h
@@ -133,8 +133,6 @@ __be32 check_nfsd_access(struct svc_export *exp, struct svc_rqst *rqstp);
133int nfsd_export_init(void); 133int nfsd_export_init(void);
134void nfsd_export_shutdown(void); 134void nfsd_export_shutdown(void);
135void nfsd_export_flush(void); 135void nfsd_export_flush(void);
136void exp_readlock(void);
137void exp_readunlock(void);
138struct svc_export * rqst_exp_get_by_name(struct svc_rqst *, 136struct svc_export * rqst_exp_get_by_name(struct svc_rqst *,
139 struct path *); 137 struct path *);
140struct svc_export * rqst_exp_parent(struct svc_rqst *, 138struct svc_export * rqst_exp_parent(struct svc_rqst *,
diff --git a/include/linux/nl80211.h b/include/linux/nl80211.h
index c7ccaae15af6..8ad70dcac3f9 100644
--- a/include/linux/nl80211.h
+++ b/include/linux/nl80211.h
@@ -6,7 +6,7 @@
6 * Copyright 2006-2010 Johannes Berg <johannes@sipsolutions.net> 6 * Copyright 2006-2010 Johannes Berg <johannes@sipsolutions.net>
7 * Copyright 2008 Michael Wu <flamingice@sourmilk.net> 7 * Copyright 2008 Michael Wu <flamingice@sourmilk.net>
8 * Copyright 2008 Luis Carlos Cobo <luisca@cozybit.com> 8 * Copyright 2008 Luis Carlos Cobo <luisca@cozybit.com>
9 * Copyright 2008 Michael Buesch <mb@bu3sch.de> 9 * Copyright 2008 Michael Buesch <m@bues.ch>
10 * Copyright 2008, 2009 Luis R. Rodriguez <lrodriguez@atheros.com> 10 * Copyright 2008, 2009 Luis R. Rodriguez <lrodriguez@atheros.com>
11 * Copyright 2008 Jouni Malinen <jouni.malinen@atheros.com> 11 * Copyright 2008 Jouni Malinen <jouni.malinen@atheros.com>
12 * Copyright 2008 Colin McCabe <colin@cozybit.com> 12 * Copyright 2008 Colin McCabe <colin@cozybit.com>
@@ -247,7 +247,8 @@
247 * passed, all channels allowed for the current regulatory domain 247 * passed, all channels allowed for the current regulatory domain
248 * are used. Extra IEs can also be passed from the userspace by 248 * are used. Extra IEs can also be passed from the userspace by
249 * using the %NL80211_ATTR_IE attribute. 249 * using the %NL80211_ATTR_IE attribute.
250 * @NL80211_CMD_STOP_SCHED_SCAN: stop a scheduled scan 250 * @NL80211_CMD_STOP_SCHED_SCAN: stop a scheduled scan. Returns -ENOENT
251 * if scheduled scan is not running.
251 * @NL80211_CMD_SCHED_SCAN_RESULTS: indicates that there are scheduled scan 252 * @NL80211_CMD_SCHED_SCAN_RESULTS: indicates that there are scheduled scan
252 * results available. 253 * results available.
253 * @NL80211_CMD_SCHED_SCAN_STOPPED: indicates that the scheduled scan has 254 * @NL80211_CMD_SCHED_SCAN_STOPPED: indicates that the scheduled scan has
@@ -483,6 +484,14 @@
483 * more background information, see 484 * more background information, see
484 * http://wireless.kernel.org/en/users/Documentation/WoWLAN. 485 * http://wireless.kernel.org/en/users/Documentation/WoWLAN.
485 * 486 *
487 * @NL80211_CMD_SET_REKEY_OFFLOAD: This command is used give the driver
488 * the necessary information for supporting GTK rekey offload. This
489 * feature is typically used during WoWLAN. The configuration data
490 * is contained in %NL80211_ATTR_REKEY_DATA (which is nested and
491 * contains the data in sub-attributes). After rekeying happened,
492 * this command may also be sent by the driver as an MLME event to
493 * inform userspace of the new replay counter.
494 *
486 * @NL80211_CMD_MAX: highest used command number 495 * @NL80211_CMD_MAX: highest used command number
487 * @__NL80211_CMD_AFTER_LAST: internal use 496 * @__NL80211_CMD_AFTER_LAST: internal use
488 */ 497 */
@@ -605,6 +614,8 @@ enum nl80211_commands {
605 NL80211_CMD_SCHED_SCAN_RESULTS, 614 NL80211_CMD_SCHED_SCAN_RESULTS,
606 NL80211_CMD_SCHED_SCAN_STOPPED, 615 NL80211_CMD_SCHED_SCAN_STOPPED,
607 616
617 NL80211_CMD_SET_REKEY_OFFLOAD,
618
608 /* add new commands above here */ 619 /* add new commands above here */
609 620
610 /* used to define NL80211_CMD_MAX below */ 621 /* used to define NL80211_CMD_MAX below */
@@ -745,8 +756,12 @@ enum nl80211_commands {
745 * 756 *
746 * @NL80211_ATTR_MAX_NUM_SCAN_SSIDS: number of SSIDs you can scan with 757 * @NL80211_ATTR_MAX_NUM_SCAN_SSIDS: number of SSIDs you can scan with
747 * a single scan request, a wiphy attribute. 758 * a single scan request, a wiphy attribute.
759 * @NL80211_ATTR_MAX_NUM_SCHED_SCAN_SSIDS: number of SSIDs you can
760 * scan with a single scheduled scan request, a wiphy attribute.
748 * @NL80211_ATTR_MAX_SCAN_IE_LEN: maximum length of information elements 761 * @NL80211_ATTR_MAX_SCAN_IE_LEN: maximum length of information elements
749 * that can be added to a scan request 762 * that can be added to a scan request
763 * @NL80211_ATTR_MAX_SCHED_SCAN_IE_LEN: maximum length of information
764 * elements that can be added to a scheduled scan request
750 * 765 *
751 * @NL80211_ATTR_SCAN_FREQUENCIES: nested attribute with frequencies (in MHz) 766 * @NL80211_ATTR_SCAN_FREQUENCIES: nested attribute with frequencies (in MHz)
752 * @NL80211_ATTR_SCAN_SSIDS: nested attribute with SSIDs, leave out for passive 767 * @NL80211_ATTR_SCAN_SSIDS: nested attribute with SSIDs, leave out for passive
@@ -978,8 +993,8 @@ enum nl80211_commands {
978 * driving the peer link management state machine. 993 * driving the peer link management state machine.
979 * @NL80211_MESH_SETUP_USERSPACE_AMPE must be enabled. 994 * @NL80211_MESH_SETUP_USERSPACE_AMPE must be enabled.
980 * 995 *
981 * @NL80211_ATTR_WOWLAN_SUPPORTED: indicates, as part of the wiphy capabilities, 996 * @NL80211_ATTR_WOWLAN_TRIGGERS_SUPPORTED: indicates, as part of the wiphy
982 * the supported WoWLAN triggers 997 * capabilities, the supported WoWLAN triggers
983 * @NL80211_ATTR_WOWLAN_TRIGGERS: used by %NL80211_CMD_SET_WOWLAN to 998 * @NL80211_ATTR_WOWLAN_TRIGGERS: used by %NL80211_CMD_SET_WOWLAN to
984 * indicate which WoW triggers should be enabled. This is also 999 * indicate which WoW triggers should be enabled. This is also
985 * used by %NL80211_CMD_GET_WOWLAN to get the currently enabled WoWLAN 1000 * used by %NL80211_CMD_GET_WOWLAN to get the currently enabled WoWLAN
@@ -996,6 +1011,14 @@ enum nl80211_commands {
996 * are managed in software: interfaces of these types aren't subject to 1011 * are managed in software: interfaces of these types aren't subject to
997 * any restrictions in their number or combinations. 1012 * any restrictions in their number or combinations.
998 * 1013 *
1014 * @%NL80211_ATTR_REKEY_DATA: nested attribute containing the information
1015 * necessary for GTK rekeying in the device, see &enum nl80211_rekey_data.
1016 *
1017 * @NL80211_ATTR_SCAN_SUPP_RATES: rates per to be advertised as supported in scan,
1018 * nested array attribute containing an entry for each band, with the entry
1019 * being a list of supported rates as defined by IEEE 802.11 7.3.2.2 but
1020 * without the length restriction (at most %NL80211_MAX_SUPP_RATES).
1021 *
999 * @NL80211_ATTR_MAX: highest attribute number currently defined 1022 * @NL80211_ATTR_MAX: highest attribute number currently defined
1000 * @__NL80211_ATTR_AFTER_LAST: internal use 1023 * @__NL80211_ATTR_AFTER_LAST: internal use
1001 */ 1024 */
@@ -1194,6 +1217,13 @@ enum nl80211_attrs {
1194 NL80211_ATTR_INTERFACE_COMBINATIONS, 1217 NL80211_ATTR_INTERFACE_COMBINATIONS,
1195 NL80211_ATTR_SOFTWARE_IFTYPES, 1218 NL80211_ATTR_SOFTWARE_IFTYPES,
1196 1219
1220 NL80211_ATTR_REKEY_DATA,
1221
1222 NL80211_ATTR_MAX_NUM_SCHED_SCAN_SSIDS,
1223 NL80211_ATTR_MAX_SCHED_SCAN_IE_LEN,
1224
1225 NL80211_ATTR_SCAN_SUPP_RATES,
1226
1197 /* add attributes here, update the policy in nl80211.c */ 1227 /* add attributes here, update the policy in nl80211.c */
1198 1228
1199 __NL80211_ATTR_AFTER_LAST, 1229 __NL80211_ATTR_AFTER_LAST,
@@ -2239,6 +2269,16 @@ struct nl80211_wowlan_pattern_support {
2239 * 2269 *
2240 * In %NL80211_ATTR_WOWLAN_TRIGGERS_SUPPORTED, it is a binary attribute 2270 * In %NL80211_ATTR_WOWLAN_TRIGGERS_SUPPORTED, it is a binary attribute
2241 * carrying a &struct nl80211_wowlan_pattern_support. 2271 * carrying a &struct nl80211_wowlan_pattern_support.
2272 * @NL80211_WOWLAN_TRIG_GTK_REKEY_SUPPORTED: Not a real trigger, and cannot be
2273 * used when setting, used only to indicate that GTK rekeying is supported
2274 * by the device (flag)
2275 * @NL80211_WOWLAN_TRIG_GTK_REKEY_FAILURE: wake up on GTK rekey failure (if
2276 * done by the device) (flag)
2277 * @NL80211_WOWLAN_TRIG_EAP_IDENT_REQUEST: wake up on EAP Identity Request
2278 * packet (flag)
2279 * @NL80211_WOWLAN_TRIG_4WAY_HANDSHAKE: wake up on 4-way handshake (flag)
2280 * @NL80211_WOWLAN_TRIG_RFKILL_RELEASE: wake up when rfkill is released
2281 * (on devices that have rfkill in the device) (flag)
2242 * @NUM_NL80211_WOWLAN_TRIG: number of wake on wireless triggers 2282 * @NUM_NL80211_WOWLAN_TRIG: number of wake on wireless triggers
2243 * @MAX_NL80211_WOWLAN_TRIG: highest wowlan trigger attribute number 2283 * @MAX_NL80211_WOWLAN_TRIG: highest wowlan trigger attribute number
2244 */ 2284 */
@@ -2248,6 +2288,11 @@ enum nl80211_wowlan_triggers {
2248 NL80211_WOWLAN_TRIG_DISCONNECT, 2288 NL80211_WOWLAN_TRIG_DISCONNECT,
2249 NL80211_WOWLAN_TRIG_MAGIC_PKT, 2289 NL80211_WOWLAN_TRIG_MAGIC_PKT,
2250 NL80211_WOWLAN_TRIG_PKT_PATTERN, 2290 NL80211_WOWLAN_TRIG_PKT_PATTERN,
2291 NL80211_WOWLAN_TRIG_GTK_REKEY_SUPPORTED,
2292 NL80211_WOWLAN_TRIG_GTK_REKEY_FAILURE,
2293 NL80211_WOWLAN_TRIG_EAP_IDENT_REQUEST,
2294 NL80211_WOWLAN_TRIG_4WAY_HANDSHAKE,
2295 NL80211_WOWLAN_TRIG_RFKILL_RELEASE,
2251 2296
2252 /* keep last */ 2297 /* keep last */
2253 NUM_NL80211_WOWLAN_TRIG, 2298 NUM_NL80211_WOWLAN_TRIG,
@@ -2361,4 +2406,28 @@ enum nl80211_plink_state {
2361 MAX_NL80211_PLINK_STATES = NUM_NL80211_PLINK_STATES - 1 2406 MAX_NL80211_PLINK_STATES = NUM_NL80211_PLINK_STATES - 1
2362}; 2407};
2363 2408
2409#define NL80211_KCK_LEN 16
2410#define NL80211_KEK_LEN 16
2411#define NL80211_REPLAY_CTR_LEN 8
2412
2413/**
2414 * enum nl80211_rekey_data - attributes for GTK rekey offload
2415 * @__NL80211_REKEY_DATA_INVALID: invalid number for nested attributes
2416 * @NL80211_REKEY_DATA_KEK: key encryption key (binary)
2417 * @NL80211_REKEY_DATA_KCK: key confirmation key (binary)
2418 * @NL80211_REKEY_DATA_REPLAY_CTR: replay counter (binary)
2419 * @NUM_NL80211_REKEY_DATA: number of rekey attributes (internal)
2420 * @MAX_NL80211_REKEY_DATA: highest rekey attribute (internal)
2421 */
2422enum nl80211_rekey_data {
2423 __NL80211_REKEY_DATA_INVALID,
2424 NL80211_REKEY_DATA_KEK,
2425 NL80211_REKEY_DATA_KCK,
2426 NL80211_REKEY_DATA_REPLAY_CTR,
2427
2428 /* keep last */
2429 NUM_NL80211_REKEY_DATA,
2430 MAX_NL80211_REKEY_DATA = NUM_NL80211_REKEY_DATA - 1
2431};
2432
2364#endif /* __LINUX_NL80211_H */ 2433#endif /* __LINUX_NL80211_H */
diff --git a/include/linux/notifier.h b/include/linux/notifier.h
index c0688b0168b3..d65746efc954 100644
--- a/include/linux/notifier.h
+++ b/include/linux/notifier.h
@@ -185,80 +185,17 @@ static inline int notifier_to_errno(int ret)
185 * VC switch chains (for loadable kernel svgalib VC switch helpers) etc... 185 * VC switch chains (for loadable kernel svgalib VC switch helpers) etc...
186 */ 186 */
187 187
188/* netdevice notifier chain. Please remember to update the rtnetlink 188/* CPU notfiers are defined in include/linux/cpu.h. */
189 * notification exclusion list in rtnetlink_event() when adding new
190 * types.
191 */
192#define NETDEV_UP 0x0001 /* For now you can't veto a device up/down */
193#define NETDEV_DOWN 0x0002
194#define NETDEV_REBOOT 0x0003 /* Tell a protocol stack a network interface
195 detected a hardware crash and restarted
196 - we can use this eg to kick tcp sessions
197 once done */
198#define NETDEV_CHANGE 0x0004 /* Notify device state change */
199#define NETDEV_REGISTER 0x0005
200#define NETDEV_UNREGISTER 0x0006
201#define NETDEV_CHANGEMTU 0x0007
202#define NETDEV_CHANGEADDR 0x0008
203#define NETDEV_GOING_DOWN 0x0009
204#define NETDEV_CHANGENAME 0x000A
205#define NETDEV_FEAT_CHANGE 0x000B
206#define NETDEV_BONDING_FAILOVER 0x000C
207#define NETDEV_PRE_UP 0x000D
208#define NETDEV_PRE_TYPE_CHANGE 0x000E
209#define NETDEV_POST_TYPE_CHANGE 0x000F
210#define NETDEV_POST_INIT 0x0010
211#define NETDEV_UNREGISTER_BATCH 0x0011
212#define NETDEV_RELEASE 0x0012
213#define NETDEV_NOTIFY_PEERS 0x0013
214#define NETDEV_JOIN 0x0014
215
216#define SYS_DOWN 0x0001 /* Notify of system down */
217#define SYS_RESTART SYS_DOWN
218#define SYS_HALT 0x0002 /* Notify of system halt */
219#define SYS_POWER_OFF 0x0003 /* Notify of system power off */
220 189
221#define NETLINK_URELEASE 0x0001 /* Unicast netlink socket released */ 190/* netdevice notifiers are defined in include/linux/netdevice.h */
222 191
223#define CPU_ONLINE 0x0002 /* CPU (unsigned)v is up */ 192/* reboot notifiers are defined in include/linux/reboot.h. */
224#define CPU_UP_PREPARE 0x0003 /* CPU (unsigned)v coming up */
225#define CPU_UP_CANCELED 0x0004 /* CPU (unsigned)v NOT coming up */
226#define CPU_DOWN_PREPARE 0x0005 /* CPU (unsigned)v going down */
227#define CPU_DOWN_FAILED 0x0006 /* CPU (unsigned)v NOT going down */
228#define CPU_DEAD 0x0007 /* CPU (unsigned)v dead */
229#define CPU_DYING 0x0008 /* CPU (unsigned)v not running any task,
230 * not handling interrupts, soon dead.
231 * Called on the dying cpu, interrupts
232 * are already disabled. Must not
233 * sleep, must not fail */
234#define CPU_POST_DEAD 0x0009 /* CPU (unsigned)v dead, cpu_hotplug
235 * lock is dropped */
236#define CPU_STARTING 0x000A /* CPU (unsigned)v soon running.
237 * Called on the new cpu, just before
238 * enabling interrupts. Must not sleep,
239 * must not fail */
240 193
241/* Used for CPU hotplug events occurring while tasks are frozen due to a suspend 194/* Hibernation and suspend events are defined in include/linux/suspend.h. */
242 * operation in progress
243 */
244#define CPU_TASKS_FROZEN 0x0010
245 195
246#define CPU_ONLINE_FROZEN (CPU_ONLINE | CPU_TASKS_FROZEN) 196/* Virtual Terminal events are defined in include/linux/vt.h. */
247#define CPU_UP_PREPARE_FROZEN (CPU_UP_PREPARE | CPU_TASKS_FROZEN)
248#define CPU_UP_CANCELED_FROZEN (CPU_UP_CANCELED | CPU_TASKS_FROZEN)
249#define CPU_DOWN_PREPARE_FROZEN (CPU_DOWN_PREPARE | CPU_TASKS_FROZEN)
250#define CPU_DOWN_FAILED_FROZEN (CPU_DOWN_FAILED | CPU_TASKS_FROZEN)
251#define CPU_DEAD_FROZEN (CPU_DEAD | CPU_TASKS_FROZEN)
252#define CPU_DYING_FROZEN (CPU_DYING | CPU_TASKS_FROZEN)
253#define CPU_STARTING_FROZEN (CPU_STARTING | CPU_TASKS_FROZEN)
254 197
255/* Hibernation and suspend events */ 198#define NETLINK_URELEASE 0x0001 /* Unicast netlink socket released */
256#define PM_HIBERNATION_PREPARE 0x0001 /* Going to hibernate */
257#define PM_POST_HIBERNATION 0x0002 /* Hibernation finished */
258#define PM_SUSPEND_PREPARE 0x0003 /* Going to suspend the system */
259#define PM_POST_SUSPEND 0x0004 /* Suspend finished */
260#define PM_RESTORE_PREPARE 0x0005 /* Going to restore a saved image */
261#define PM_POST_RESTORE 0x0006 /* Restore failed */
262 199
263/* Console keyboard events. 200/* Console keyboard events.
264 * Note: KBD_KEYCODE is always sent before KBD_UNBOUND_KEYCODE, KBD_UNICODE and 201 * Note: KBD_KEYCODE is always sent before KBD_UNBOUND_KEYCODE, KBD_UNICODE and
@@ -271,12 +208,5 @@ static inline int notifier_to_errno(int ret)
271 208
272extern struct blocking_notifier_head reboot_notifier_list; 209extern struct blocking_notifier_head reboot_notifier_list;
273 210
274/* Virtual Terminal events. */
275#define VT_ALLOCATE 0x0001 /* Console got allocated */
276#define VT_DEALLOCATE 0x0002 /* Console will be deallocated */
277#define VT_WRITE 0x0003 /* A char got output */
278#define VT_UPDATE 0x0004 /* A bigger update occurred */
279#define VT_PREWRITE 0x0005 /* A char is about to be written to the console */
280
281#endif /* __KERNEL__ */ 211#endif /* __KERNEL__ */
282#endif /* _LINUX_NOTIFIER_H */ 212#endif /* _LINUX_NOTIFIER_H */
diff --git a/include/linux/nsproxy.h b/include/linux/nsproxy.h
index 50d20aba57d3..cc37a55ad004 100644
--- a/include/linux/nsproxy.h
+++ b/include/linux/nsproxy.h
@@ -68,6 +68,7 @@ void switch_task_namespaces(struct task_struct *tsk, struct nsproxy *new);
68void free_nsproxy(struct nsproxy *ns); 68void free_nsproxy(struct nsproxy *ns);
69int unshare_nsproxy_namespaces(unsigned long, struct nsproxy **, 69int unshare_nsproxy_namespaces(unsigned long, struct nsproxy **,
70 struct fs_struct *); 70 struct fs_struct *);
71int __init nsproxy_cache_init(void);
71 72
72static inline void put_nsproxy(struct nsproxy *ns) 73static inline void put_nsproxy(struct nsproxy *ns)
73{ 74{
diff --git a/include/linux/of.h b/include/linux/of.h
index bfc0ed1b0ced..bd716f8908de 100644
--- a/include/linux/of.h
+++ b/include/linux/of.h
@@ -195,6 +195,13 @@ extern struct device_node *of_find_node_with_property(
195extern struct property *of_find_property(const struct device_node *np, 195extern struct property *of_find_property(const struct device_node *np,
196 const char *name, 196 const char *name,
197 int *lenp); 197 int *lenp);
198extern int of_property_read_u32_array(const struct device_node *np,
199 char *propname,
200 u32 *out_values,
201 size_t sz);
202
203extern int of_property_read_string(struct device_node *np, char *propname,
204 const char **out_string);
198extern int of_device_is_compatible(const struct device_node *device, 205extern int of_device_is_compatible(const struct device_node *device,
199 const char *); 206 const char *);
200extern int of_device_is_available(const struct device_node *device); 207extern int of_device_is_available(const struct device_node *device);
@@ -227,12 +234,32 @@ extern void of_attach_node(struct device_node *);
227extern void of_detach_node(struct device_node *); 234extern void of_detach_node(struct device_node *);
228#endif 235#endif
229 236
230#else 237#else /* CONFIG_OF */
231 238
232static inline bool of_have_populated_dt(void) 239static inline bool of_have_populated_dt(void)
233{ 240{
234 return false; 241 return false;
235} 242}
236 243
244static inline int of_property_read_u32_array(const struct device_node *np,
245 char *propname, u32 *out_values, size_t sz)
246{
247 return -ENOSYS;
248}
249
250static inline int of_property_read_string(struct device_node *np,
251 char *propname, const char **out_string)
252{
253 return -ENOSYS;
254}
255
237#endif /* CONFIG_OF */ 256#endif /* CONFIG_OF */
257
258static inline int of_property_read_u32(const struct device_node *np,
259 char *propname,
260 u32 *out_value)
261{
262 return of_property_read_u32_array(np, propname, out_value, 1);
263}
264
238#endif /* _LINUX_OF_H */ 265#endif /* _LINUX_OF_H */
diff --git a/include/linux/of_address.h b/include/linux/of_address.h
index 2feda6ee6140..3118623c2c1f 100644
--- a/include/linux/of_address.h
+++ b/include/linux/of_address.h
@@ -1,11 +1,16 @@
1#ifndef __OF_ADDRESS_H 1#ifndef __OF_ADDRESS_H
2#define __OF_ADDRESS_H 2#define __OF_ADDRESS_H
3#include <linux/ioport.h> 3#include <linux/ioport.h>
4#include <linux/errno.h>
4#include <linux/of.h> 5#include <linux/of.h>
5 6
6extern u64 of_translate_address(struct device_node *np, const __be32 *addr); 7extern u64 of_translate_address(struct device_node *np, const __be32 *addr);
7extern int of_address_to_resource(struct device_node *dev, int index, 8extern int of_address_to_resource(struct device_node *dev, int index,
8 struct resource *r); 9 struct resource *r);
10extern struct device_node *of_find_matching_node_by_address(
11 struct device_node *from,
12 const struct of_device_id *matches,
13 u64 base_address);
9extern void __iomem *of_iomap(struct device_node *device, int index); 14extern void __iomem *of_iomap(struct device_node *device, int index);
10 15
11/* Extract an address from a device, returns the region size and 16/* Extract an address from a device, returns the region size and
diff --git a/include/linux/of_gpio.h b/include/linux/of_gpio.h
index 6598c04dab01..aec8025c786a 100644
--- a/include/linux/of_gpio.h
+++ b/include/linux/of_gpio.h
@@ -46,8 +46,9 @@ static inline struct of_mm_gpio_chip *to_of_mm_gpio_chip(struct gpio_chip *gc)
46 return container_of(gc, struct of_mm_gpio_chip, gc); 46 return container_of(gc, struct of_mm_gpio_chip, gc);
47} 47}
48 48
49extern int of_get_gpio_flags(struct device_node *np, int index, 49extern int of_get_named_gpio_flags(struct device_node *np,
50 enum of_gpio_flags *flags); 50 const char *list_name, int index, enum of_gpio_flags *flags);
51
51extern unsigned int of_gpio_count(struct device_node *np); 52extern unsigned int of_gpio_count(struct device_node *np);
52 53
53extern int of_mm_gpiochip_add(struct device_node *np, 54extern int of_mm_gpiochip_add(struct device_node *np,
@@ -60,8 +61,8 @@ extern struct gpio_chip *of_node_to_gpiochip(struct device_node *np);
60#else /* CONFIG_OF_GPIO */ 61#else /* CONFIG_OF_GPIO */
61 62
62/* Drivers may not strictly depend on the GPIO support, so let them link. */ 63/* Drivers may not strictly depend on the GPIO support, so let them link. */
63static inline int of_get_gpio_flags(struct device_node *np, int index, 64static inline int of_get_named_gpio_flags(struct device_node *np,
64 enum of_gpio_flags *flags) 65 const char *list_name, int index, enum of_gpio_flags *flags)
65{ 66{
66 return -ENOSYS; 67 return -ENOSYS;
67} 68}
@@ -77,7 +78,38 @@ static inline void of_gpiochip_remove(struct gpio_chip *gc) { }
77#endif /* CONFIG_OF_GPIO */ 78#endif /* CONFIG_OF_GPIO */
78 79
79/** 80/**
80 * of_get_gpio - Get a GPIO number to use with GPIO API 81 * of_get_gpio_flags() - Get a GPIO number and flags to use with GPIO API
82 * @np: device node to get GPIO from
83 * @index: index of the GPIO
84 * @flags: a flags pointer to fill in
85 *
86 * Returns GPIO number to use with Linux generic GPIO API, or one of the errno
87 * value on the error condition. If @flags is not NULL the function also fills
88 * in flags for the GPIO.
89 */
90static inline int of_get_gpio_flags(struct device_node *np, int index,
91 enum of_gpio_flags *flags)
92{
93 return of_get_named_gpio_flags(np, "gpios", index, flags);
94}
95
96/**
97 * of_get_named_gpio() - Get a GPIO number to use with GPIO API
98 * @np: device node to get GPIO from
99 * @propname: Name of property containing gpio specifier(s)
100 * @index: index of the GPIO
101 *
102 * Returns GPIO number to use with Linux generic GPIO API, or one of the errno
103 * value on the error condition.
104 */
105static inline int of_get_named_gpio(struct device_node *np,
106 const char *propname, int index)
107{
108 return of_get_named_gpio_flags(np, propname, index, NULL);
109}
110
111/**
112 * of_get_gpio() - Get a GPIO number to use with GPIO API
81 * @np: device node to get GPIO from 113 * @np: device node to get GPIO from
82 * @index: index of the GPIO 114 * @index: index of the GPIO
83 * 115 *
diff --git a/include/linux/of_pci.h b/include/linux/of_pci.h
index 85a27b650d76..f93e21700d3e 100644
--- a/include/linux/of_pci.h
+++ b/include/linux/of_pci.h
@@ -6,4 +6,9 @@
6struct pci_dev; 6struct pci_dev;
7struct of_irq; 7struct of_irq;
8int of_irq_map_pci(struct pci_dev *pdev, struct of_irq *out_irq); 8int of_irq_map_pci(struct pci_dev *pdev, struct of_irq *out_irq);
9
10struct device_node;
11struct device_node *of_pci_find_child_device(struct device_node *parent,
12 unsigned int devfn);
13
9#endif 14#endif
diff --git a/include/linux/of_platform.h b/include/linux/of_platform.h
index fb51ae38cea7..5a6f458a4bb7 100644
--- a/include/linux/of_platform.h
+++ b/include/linux/of_platform.h
@@ -20,6 +20,40 @@
20#include <linux/platform_device.h> 20#include <linux/platform_device.h>
21 21
22/** 22/**
23 * struct of_dev_auxdata - lookup table entry for device names & platform_data
24 * @compatible: compatible value of node to match against node
25 * @phys_addr: Start address of registers to match against node
26 * @name: Name to assign for matching nodes
27 * @platform_data: platform_data to assign for matching nodes
28 *
29 * This lookup table allows the caller of of_platform_populate() to override
30 * the names of devices when creating devices from the device tree. The table
31 * should be terminated with an empty entry. It also allows the platform_data
32 * pointer to be set.
33 *
34 * The reason for this functionality is that some Linux infrastructure uses
35 * the device name to look up a specific device, but the Linux-specific names
36 * are not encoded into the device tree, so the kernel needs to provide specific
37 * values.
38 *
39 * Note: Using an auxdata lookup table should be considered a last resort when
40 * converting a platform to use the DT. Normally the automatically generated
41 * device name will not matter, and drivers should obtain data from the device
42 * node instead of from an anonymouns platform_data pointer.
43 */
44struct of_dev_auxdata {
45 char *compatible;
46 resource_size_t phys_addr;
47 char *name;
48 void *platform_data;
49};
50
51/* Macro to simplify populating a lookup table */
52#define OF_DEV_AUXDATA(_compat,_phys,_name,_pdata) \
53 { .compatible = _compat, .phys_addr = _phys, .name = _name, \
54 .platform_data = _pdata }
55
56/**
23 * of_platform_driver - Legacy of-aware driver for platform devices. 57 * of_platform_driver - Legacy of-aware driver for platform devices.
24 * 58 *
25 * An of_platform_driver driver is attached to a basic platform_device on 59 * An of_platform_driver driver is attached to a basic platform_device on
@@ -40,6 +74,8 @@ struct of_platform_driver
40#define to_of_platform_driver(drv) \ 74#define to_of_platform_driver(drv) \
41 container_of(drv,struct of_platform_driver, driver) 75 container_of(drv,struct of_platform_driver, driver)
42 76
77extern const struct of_device_id of_default_bus_match_table[];
78
43/* Platform drivers register/unregister */ 79/* Platform drivers register/unregister */
44extern struct platform_device *of_device_alloc(struct device_node *np, 80extern struct platform_device *of_device_alloc(struct device_node *np,
45 const char *bus_id, 81 const char *bus_id,
@@ -55,6 +91,10 @@ extern struct platform_device *of_platform_device_create(struct device_node *np,
55extern int of_platform_bus_probe(struct device_node *root, 91extern int of_platform_bus_probe(struct device_node *root,
56 const struct of_device_id *matches, 92 const struct of_device_id *matches,
57 struct device *parent); 93 struct device *parent);
94extern int of_platform_populate(struct device_node *root,
95 const struct of_device_id *matches,
96 const struct of_dev_auxdata *lookup,
97 struct device *parent);
58#endif /* !CONFIG_SPARC */ 98#endif /* !CONFIG_SPARC */
59 99
60#endif /* CONFIG_OF_DEVICE */ 100#endif /* CONFIG_OF_DEVICE */
diff --git a/include/linux/oom.h b/include/linux/oom.h
index 4952fb874ad3..13b7b02e599a 100644
--- a/include/linux/oom.h
+++ b/include/linux/oom.h
@@ -64,10 +64,6 @@ static inline void oom_killer_enable(void)
64 oom_killer_disabled = false; 64 oom_killer_disabled = false;
65} 65}
66 66
67/* The badness from the OOM killer */
68extern unsigned long badness(struct task_struct *p, struct mem_cgroup *mem,
69 const nodemask_t *nodemask, unsigned long uptime);
70
71extern struct task_struct *find_lock_task_mm(struct task_struct *p); 67extern struct task_struct *find_lock_task_mm(struct task_struct *p);
72 68
73/* sysctls */ 69/* sysctls */
diff --git a/include/linux/opp.h b/include/linux/opp.h
index 5449945d589f..7020e9736fc5 100644
--- a/include/linux/opp.h
+++ b/include/linux/opp.h
@@ -94,12 +94,20 @@ static inline int opp_disable(struct device *dev, unsigned long freq)
94#if defined(CONFIG_CPU_FREQ) && defined(CONFIG_PM_OPP) 94#if defined(CONFIG_CPU_FREQ) && defined(CONFIG_PM_OPP)
95int opp_init_cpufreq_table(struct device *dev, 95int opp_init_cpufreq_table(struct device *dev,
96 struct cpufreq_frequency_table **table); 96 struct cpufreq_frequency_table **table);
97void opp_free_cpufreq_table(struct device *dev,
98 struct cpufreq_frequency_table **table);
97#else 99#else
98static inline int opp_init_cpufreq_table(struct device *dev, 100static inline int opp_init_cpufreq_table(struct device *dev,
99 struct cpufreq_frequency_table **table) 101 struct cpufreq_frequency_table **table)
100{ 102{
101 return -EINVAL; 103 return -EINVAL;
102} 104}
105
106static inline
107void opp_free_cpufreq_table(struct device *dev,
108 struct cpufreq_frequency_table **table)
109{
110}
103#endif /* CONFIG_CPU_FREQ */ 111#endif /* CONFIG_CPU_FREQ */
104 112
105#endif /* __LINUX_OPP_H__ */ 113#endif /* __LINUX_OPP_H__ */
diff --git a/include/linux/page-flags.h b/include/linux/page-flags.h
index 6081493db68f..3e5a1b189a41 100644
--- a/include/linux/page-flags.h
+++ b/include/linux/page-flags.h
@@ -135,7 +135,7 @@ enum pageflags {
135 * Macros to create function definitions for page flags 135 * Macros to create function definitions for page flags
136 */ 136 */
137#define TESTPAGEFLAG(uname, lname) \ 137#define TESTPAGEFLAG(uname, lname) \
138static inline int Page##uname(struct page *page) \ 138static inline int Page##uname(const struct page *page) \
139 { return test_bit(PG_##lname, &page->flags); } 139 { return test_bit(PG_##lname, &page->flags); }
140 140
141#define SETPAGEFLAG(uname, lname) \ 141#define SETPAGEFLAG(uname, lname) \
@@ -173,7 +173,7 @@ static inline int __TestClearPage##uname(struct page *page) \
173 __SETPAGEFLAG(uname, lname) __CLEARPAGEFLAG(uname, lname) 173 __SETPAGEFLAG(uname, lname) __CLEARPAGEFLAG(uname, lname)
174 174
175#define PAGEFLAG_FALSE(uname) \ 175#define PAGEFLAG_FALSE(uname) \
176static inline int Page##uname(struct page *page) \ 176static inline int Page##uname(const struct page *page) \
177 { return 0; } 177 { return 0; }
178 178
179#define TESTSCFLAG(uname, lname) \ 179#define TESTSCFLAG(uname, lname) \
diff --git a/include/linux/pagemap.h b/include/linux/pagemap.h
index 716875e53520..cfaaa6949b8b 100644
--- a/include/linux/pagemap.h
+++ b/include/linux/pagemap.h
@@ -134,7 +134,7 @@ static inline int page_cache_get_speculative(struct page *page)
134 VM_BUG_ON(in_interrupt()); 134 VM_BUG_ON(in_interrupt());
135 135
136#if !defined(CONFIG_SMP) && defined(CONFIG_TREE_RCU) 136#if !defined(CONFIG_SMP) && defined(CONFIG_TREE_RCU)
137# ifdef CONFIG_PREEMPT 137# ifdef CONFIG_PREEMPT_COUNT
138 VM_BUG_ON(!in_atomic()); 138 VM_BUG_ON(!in_atomic());
139# endif 139# endif
140 /* 140 /*
@@ -172,7 +172,7 @@ static inline int page_cache_add_speculative(struct page *page, int count)
172 VM_BUG_ON(in_interrupt()); 172 VM_BUG_ON(in_interrupt());
173 173
174#if !defined(CONFIG_SMP) && defined(CONFIG_TREE_RCU) 174#if !defined(CONFIG_SMP) && defined(CONFIG_TREE_RCU)
175# ifdef CONFIG_PREEMPT 175# ifdef CONFIG_PREEMPT_COUNT
176 VM_BUG_ON(!in_atomic()); 176 VM_BUG_ON(!in_atomic());
177# endif 177# endif
178 VM_BUG_ON(page_count(page) == 0); 178 VM_BUG_ON(page_count(page) == 0);
@@ -255,26 +255,24 @@ static inline struct page *grab_cache_page(struct address_space *mapping,
255extern struct page * grab_cache_page_nowait(struct address_space *mapping, 255extern struct page * grab_cache_page_nowait(struct address_space *mapping,
256 pgoff_t index); 256 pgoff_t index);
257extern struct page * read_cache_page_async(struct address_space *mapping, 257extern struct page * read_cache_page_async(struct address_space *mapping,
258 pgoff_t index, filler_t *filler, 258 pgoff_t index, filler_t *filler, void *data);
259 void *data);
260extern struct page * read_cache_page(struct address_space *mapping, 259extern struct page * read_cache_page(struct address_space *mapping,
261 pgoff_t index, filler_t *filler, 260 pgoff_t index, filler_t *filler, void *data);
262 void *data);
263extern struct page * read_cache_page_gfp(struct address_space *mapping, 261extern struct page * read_cache_page_gfp(struct address_space *mapping,
264 pgoff_t index, gfp_t gfp_mask); 262 pgoff_t index, gfp_t gfp_mask);
265extern int read_cache_pages(struct address_space *mapping, 263extern int read_cache_pages(struct address_space *mapping,
266 struct list_head *pages, filler_t *filler, void *data); 264 struct list_head *pages, filler_t *filler, void *data);
267 265
268static inline struct page *read_mapping_page_async( 266static inline struct page *read_mapping_page_async(
269 struct address_space *mapping, 267 struct address_space *mapping,
270 pgoff_t index, void *data) 268 pgoff_t index, void *data)
271{ 269{
272 filler_t *filler = (filler_t *)mapping->a_ops->readpage; 270 filler_t *filler = (filler_t *)mapping->a_ops->readpage;
273 return read_cache_page_async(mapping, index, filler, data); 271 return read_cache_page_async(mapping, index, filler, data);
274} 272}
275 273
276static inline struct page *read_mapping_page(struct address_space *mapping, 274static inline struct page *read_mapping_page(struct address_space *mapping,
277 pgoff_t index, void *data) 275 pgoff_t index, void *data)
278{ 276{
279 filler_t *filler = (filler_t *)mapping->a_ops->readpage; 277 filler_t *filler = (filler_t *)mapping->a_ops->readpage;
280 return read_cache_page(mapping, index, filler, data); 278 return read_cache_page(mapping, index, filler, data);
diff --git a/include/linux/pci.h b/include/linux/pci.h
index c446b5ca2d38..4e4203a96312 100644
--- a/include/linux/pci.h
+++ b/include/linux/pci.h
@@ -1589,5 +1589,44 @@ int pci_vpd_find_tag(const u8 *buf, unsigned int off, unsigned int len, u8 rdt);
1589int pci_vpd_find_info_keyword(const u8 *buf, unsigned int off, 1589int pci_vpd_find_info_keyword(const u8 *buf, unsigned int off,
1590 unsigned int len, const char *kw); 1590 unsigned int len, const char *kw);
1591 1591
1592/* PCI <-> OF binding helpers */
1593#ifdef CONFIG_OF
1594struct device_node;
1595extern void pci_set_of_node(struct pci_dev *dev);
1596extern void pci_release_of_node(struct pci_dev *dev);
1597extern void pci_set_bus_of_node(struct pci_bus *bus);
1598extern void pci_release_bus_of_node(struct pci_bus *bus);
1599
1600/* Arch may override this (weak) */
1601extern struct device_node * __weak pcibios_get_phb_of_node(struct pci_bus *bus);
1602
1603static inline struct device_node *pci_device_to_OF_node(struct pci_dev *pdev)
1604{
1605 return pdev ? pdev->dev.of_node : NULL;
1606}
1607
1608static inline struct device_node *pci_bus_to_OF_node(struct pci_bus *bus)
1609{
1610 return bus ? bus->dev.of_node : NULL;
1611}
1612
1613#else /* CONFIG_OF */
1614static inline void pci_set_of_node(struct pci_dev *dev) { }
1615static inline void pci_release_of_node(struct pci_dev *dev) { }
1616static inline void pci_set_bus_of_node(struct pci_bus *bus) { }
1617static inline void pci_release_bus_of_node(struct pci_bus *bus) { }
1618#endif /* CONFIG_OF */
1619
1620/**
1621 * pci_find_upstream_pcie_bridge - find upstream PCIe-to-PCI bridge of a device
1622 * @pdev: the PCI device
1623 *
1624 * if the device is PCIE, return NULL
1625 * if the device isn't connected to a PCIe bridge (that is its parent is a
1626 * legacy PCI bridge and the bridge is directly connected to bus 0), return its
1627 * parent
1628 */
1629struct pci_dev *pci_find_upstream_pcie_bridge(struct pci_dev *pdev);
1630
1592#endif /* __KERNEL__ */ 1631#endif /* __KERNEL__ */
1593#endif /* LINUX_PCI_H */ 1632#endif /* LINUX_PCI_H */
diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h
index 034ebb4451c2..b00c4ec5056e 100644
--- a/include/linux/pci_ids.h
+++ b/include/linux/pci_ids.h
@@ -1308,6 +1308,7 @@
1308#define PCI_SUBDEVICE_ID_CREATIVE_SB08801 0x0041 1308#define PCI_SUBDEVICE_ID_CREATIVE_SB08801 0x0041
1309#define PCI_SUBDEVICE_ID_CREATIVE_SB08802 0x0042 1309#define PCI_SUBDEVICE_ID_CREATIVE_SB08802 0x0042
1310#define PCI_SUBDEVICE_ID_CREATIVE_SB08803 0x0043 1310#define PCI_SUBDEVICE_ID_CREATIVE_SB08803 0x0043
1311#define PCI_SUBDEVICE_ID_CREATIVE_SB1270 0x0062
1311#define PCI_SUBDEVICE_ID_CREATIVE_HENDRIX 0x6000 1312#define PCI_SUBDEVICE_ID_CREATIVE_HENDRIX 0x6000
1312 1313
1313#define PCI_VENDOR_ID_ECTIVA 0x1102 /* duplicate: CREATIVE */ 1314#define PCI_VENDOR_ID_ECTIVA 0x1102 /* duplicate: CREATIVE */
@@ -1537,6 +1538,7 @@
1537#define PCI_DEVICE_ID_RICOH_RL5C476 0x0476 1538#define PCI_DEVICE_ID_RICOH_RL5C476 0x0476
1538#define PCI_DEVICE_ID_RICOH_RL5C478 0x0478 1539#define PCI_DEVICE_ID_RICOH_RL5C478 0x0478
1539#define PCI_DEVICE_ID_RICOH_R5C822 0x0822 1540#define PCI_DEVICE_ID_RICOH_R5C822 0x0822
1541#define PCI_DEVICE_ID_RICOH_R5CE823 0xe823
1540#define PCI_DEVICE_ID_RICOH_R5C832 0x0832 1542#define PCI_DEVICE_ID_RICOH_R5C832 0x0832
1541#define PCI_DEVICE_ID_RICOH_R5C843 0x0843 1543#define PCI_DEVICE_ID_RICOH_R5C843 0x0843
1542 1544
@@ -2102,6 +2104,9 @@
2102#define PCI_DEVICE_ID_TIGON3_5761E 0x1680 2104#define PCI_DEVICE_ID_TIGON3_5761E 0x1680
2103#define PCI_DEVICE_ID_TIGON3_5761 0x1681 2105#define PCI_DEVICE_ID_TIGON3_5761 0x1681
2104#define PCI_DEVICE_ID_TIGON3_5764 0x1684 2106#define PCI_DEVICE_ID_TIGON3_5764 0x1684
2107#define PCI_DEVICE_ID_NX2_57800 0x168a
2108#define PCI_DEVICE_ID_NX2_57840 0x168d
2109#define PCI_DEVICE_ID_NX2_57810 0x168e
2105#define PCI_DEVICE_ID_TIGON3_5787M 0x1693 2110#define PCI_DEVICE_ID_TIGON3_5787M 0x1693
2106#define PCI_DEVICE_ID_TIGON3_5782 0x1696 2111#define PCI_DEVICE_ID_TIGON3_5782 0x1696
2107#define PCI_DEVICE_ID_TIGON3_5784 0x1698 2112#define PCI_DEVICE_ID_TIGON3_5784 0x1698
@@ -2109,11 +2114,17 @@
2109#define PCI_DEVICE_ID_TIGON3_5787 0x169b 2114#define PCI_DEVICE_ID_TIGON3_5787 0x169b
2110#define PCI_DEVICE_ID_TIGON3_5788 0x169c 2115#define PCI_DEVICE_ID_TIGON3_5788 0x169c
2111#define PCI_DEVICE_ID_TIGON3_5789 0x169d 2116#define PCI_DEVICE_ID_TIGON3_5789 0x169d
2117#define PCI_DEVICE_ID_NX2_57800_MF 0x16a5
2112#define PCI_DEVICE_ID_TIGON3_5702X 0x16a6 2118#define PCI_DEVICE_ID_TIGON3_5702X 0x16a6
2113#define PCI_DEVICE_ID_TIGON3_5703X 0x16a7 2119#define PCI_DEVICE_ID_TIGON3_5703X 0x16a7
2114#define PCI_DEVICE_ID_TIGON3_5704S 0x16a8 2120#define PCI_DEVICE_ID_TIGON3_5704S 0x16a8
2121#define PCI_DEVICE_ID_NX2_57800_VF 0x16a9
2115#define PCI_DEVICE_ID_NX2_5706S 0x16aa 2122#define PCI_DEVICE_ID_NX2_5706S 0x16aa
2123#define PCI_DEVICE_ID_NX2_57840_MF 0x16ab
2116#define PCI_DEVICE_ID_NX2_5708S 0x16ac 2124#define PCI_DEVICE_ID_NX2_5708S 0x16ac
2125#define PCI_DEVICE_ID_NX2_57840_VF 0x16ad
2126#define PCI_DEVICE_ID_NX2_57810_MF 0x16ae
2127#define PCI_DEVICE_ID_NX2_57810_VF 0x16af
2117#define PCI_DEVICE_ID_TIGON3_5702A3 0x16c6 2128#define PCI_DEVICE_ID_TIGON3_5702A3 0x16c6
2118#define PCI_DEVICE_ID_TIGON3_5703A3 0x16c7 2129#define PCI_DEVICE_ID_TIGON3_5703A3 0x16c7
2119#define PCI_DEVICE_ID_TIGON3_5781 0x16dd 2130#define PCI_DEVICE_ID_TIGON3_5781 0x16dd
diff --git a/include/linux/percpu.h b/include/linux/percpu.h
index 8b97308e65df..9ca008f0c542 100644
--- a/include/linux/percpu.h
+++ b/include/linux/percpu.h
@@ -259,6 +259,9 @@ extern void __bad_size_call_parameter(void);
259 * Special handling for cmpxchg_double. cmpxchg_double is passed two 259 * Special handling for cmpxchg_double. cmpxchg_double is passed two
260 * percpu variables. The first has to be aligned to a double word 260 * percpu variables. The first has to be aligned to a double word
261 * boundary and the second has to follow directly thereafter. 261 * boundary and the second has to follow directly thereafter.
262 * We enforce this on all architectures even if they don't support
263 * a double cmpxchg instruction, since it's a cheap requirement, and it
264 * avoids breaking the requirement for architectures with the instruction.
262 */ 265 */
263#define __pcpu_double_call_return_bool(stem, pcp1, pcp2, ...) \ 266#define __pcpu_double_call_return_bool(stem, pcp1, pcp2, ...) \
264({ \ 267({ \
diff --git a/include/linux/perf_event.h b/include/linux/perf_event.h
index 3412684ce5d5..3f2711ccf910 100644
--- a/include/linux/perf_event.h
+++ b/include/linux/perf_event.h
@@ -61,7 +61,7 @@ enum perf_hw_id {
61/* 61/*
62 * Generalized hardware cache events: 62 * Generalized hardware cache events:
63 * 63 *
64 * { L1-D, L1-I, LLC, ITLB, DTLB, BPU } x 64 * { L1-D, L1-I, LLC, ITLB, DTLB, BPU, NODE } x
65 * { read, write, prefetch } x 65 * { read, write, prefetch } x
66 * { accesses, misses } 66 * { accesses, misses }
67 */ 67 */
@@ -72,6 +72,7 @@ enum perf_hw_cache_id {
72 PERF_COUNT_HW_CACHE_DTLB = 3, 72 PERF_COUNT_HW_CACHE_DTLB = 3,
73 PERF_COUNT_HW_CACHE_ITLB = 4, 73 PERF_COUNT_HW_CACHE_ITLB = 4,
74 PERF_COUNT_HW_CACHE_BPU = 5, 74 PERF_COUNT_HW_CACHE_BPU = 5,
75 PERF_COUNT_HW_CACHE_NODE = 6,
75 76
76 PERF_COUNT_HW_CACHE_MAX, /* non-ABI */ 77 PERF_COUNT_HW_CACHE_MAX, /* non-ABI */
77}; 78};
@@ -137,14 +138,14 @@ enum perf_event_sample_format {
137 * 138 *
138 * struct read_format { 139 * struct read_format {
139 * { u64 value; 140 * { u64 value;
140 * { u64 time_enabled; } && PERF_FORMAT_ENABLED 141 * { u64 time_enabled; } && PERF_FORMAT_TOTAL_TIME_ENABLED
141 * { u64 time_running; } && PERF_FORMAT_RUNNING 142 * { u64 time_running; } && PERF_FORMAT_TOTAL_TIME_RUNNING
142 * { u64 id; } && PERF_FORMAT_ID 143 * { u64 id; } && PERF_FORMAT_ID
143 * } && !PERF_FORMAT_GROUP 144 * } && !PERF_FORMAT_GROUP
144 * 145 *
145 * { u64 nr; 146 * { u64 nr;
146 * { u64 time_enabled; } && PERF_FORMAT_ENABLED 147 * { u64 time_enabled; } && PERF_FORMAT_TOTAL_TIME_ENABLED
147 * { u64 time_running; } && PERF_FORMAT_RUNNING 148 * { u64 time_running; } && PERF_FORMAT_TOTAL_TIME_RUNNING
148 * { u64 value; 149 * { u64 value;
149 * { u64 id; } && PERF_FORMAT_ID 150 * { u64 id; } && PERF_FORMAT_ID
150 * } cntr[nr]; 151 * } cntr[nr];
@@ -536,6 +537,16 @@ struct perf_branch_stack {
536 537
537struct task_struct; 538struct task_struct;
538 539
540/*
541 * extra PMU register associated with an event
542 */
543struct hw_perf_event_extra {
544 u64 config; /* register value */
545 unsigned int reg; /* register address or index */
546 int alloc; /* extra register already allocated */
547 int idx; /* index in shared_regs->regs[] */
548};
549
539/** 550/**
540 * struct hw_perf_event - performance event hardware details: 551 * struct hw_perf_event - performance event hardware details:
541 */ 552 */
@@ -549,9 +560,7 @@ struct hw_perf_event {
549 unsigned long event_base; 560 unsigned long event_base;
550 int idx; 561 int idx;
551 int last_cpu; 562 int last_cpu;
552 unsigned int extra_reg; 563 struct hw_perf_event_extra extra_reg;
553 u64 extra_config;
554 int extra_alloc;
555 }; 564 };
556 struct { /* software */ 565 struct { /* software */
557 struct hrtimer hrtimer; 566 struct hrtimer hrtimer;
@@ -680,36 +689,9 @@ enum perf_event_active_state {
680}; 689};
681 690
682struct file; 691struct file;
683
684#define PERF_BUFFER_WRITABLE 0x01
685
686struct perf_buffer {
687 atomic_t refcount;
688 struct rcu_head rcu_head;
689#ifdef CONFIG_PERF_USE_VMALLOC
690 struct work_struct work;
691 int page_order; /* allocation order */
692#endif
693 int nr_pages; /* nr of data pages */
694 int writable; /* are we writable */
695
696 atomic_t poll; /* POLL_ for wakeups */
697
698 local_t head; /* write position */
699 local_t nest; /* nested writers */
700 local_t events; /* event limit */
701 local_t wakeup; /* wakeup stamp */
702 local_t lost; /* nr records lost */
703
704 long watermark; /* wakeup watermark */
705
706 struct perf_event_mmap_page *user_page;
707 void *data_pages[0];
708};
709
710struct perf_sample_data; 692struct perf_sample_data;
711 693
712typedef void (*perf_overflow_handler_t)(struct perf_event *, int, 694typedef void (*perf_overflow_handler_t)(struct perf_event *,
713 struct perf_sample_data *, 695 struct perf_sample_data *,
714 struct pt_regs *regs); 696 struct pt_regs *regs);
715 697
@@ -745,6 +727,8 @@ struct perf_cgroup {
745}; 727};
746#endif 728#endif
747 729
730struct ring_buffer;
731
748/** 732/**
749 * struct perf_event - performance event kernel representation: 733 * struct perf_event - performance event kernel representation:
750 */ 734 */
@@ -834,7 +818,7 @@ struct perf_event {
834 atomic_t mmap_count; 818 atomic_t mmap_count;
835 int mmap_locked; 819 int mmap_locked;
836 struct user_struct *mmap_user; 820 struct user_struct *mmap_user;
837 struct perf_buffer *buffer; 821 struct ring_buffer *rb;
838 822
839 /* poll related */ 823 /* poll related */
840 wait_queue_head_t waitq; 824 wait_queue_head_t waitq;
@@ -855,6 +839,7 @@ struct perf_event {
855 u64 id; 839 u64 id;
856 840
857 perf_overflow_handler_t overflow_handler; 841 perf_overflow_handler_t overflow_handler;
842 void *overflow_handler_context;
858 843
859#ifdef CONFIG_EVENT_TRACING 844#ifdef CONFIG_EVENT_TRACING
860 struct ftrace_event_call *tp_event; 845 struct ftrace_event_call *tp_event;
@@ -919,8 +904,8 @@ struct perf_event_context {
919 u64 parent_gen; 904 u64 parent_gen;
920 u64 generation; 905 u64 generation;
921 int pin_count; 906 int pin_count;
922 struct rcu_head rcu_head;
923 int nr_cgroups; /* cgroup events present */ 907 int nr_cgroups; /* cgroup events present */
908 struct rcu_head rcu_head;
924}; 909};
925 910
926/* 911/*
@@ -945,13 +930,11 @@ struct perf_cpu_context {
945 930
946struct perf_output_handle { 931struct perf_output_handle {
947 struct perf_event *event; 932 struct perf_event *event;
948 struct perf_buffer *buffer; 933 struct ring_buffer *rb;
949 unsigned long wakeup; 934 unsigned long wakeup;
950 unsigned long size; 935 unsigned long size;
951 void *addr; 936 void *addr;
952 int page; 937 int page;
953 int nmi;
954 int sample;
955}; 938};
956 939
957#ifdef CONFIG_PERF_EVENTS 940#ifdef CONFIG_PERF_EVENTS
@@ -972,13 +955,15 @@ extern void perf_pmu_disable(struct pmu *pmu);
972extern void perf_pmu_enable(struct pmu *pmu); 955extern void perf_pmu_enable(struct pmu *pmu);
973extern int perf_event_task_disable(void); 956extern int perf_event_task_disable(void);
974extern int perf_event_task_enable(void); 957extern int perf_event_task_enable(void);
958extern int perf_event_refresh(struct perf_event *event, int refresh);
975extern void perf_event_update_userpage(struct perf_event *event); 959extern void perf_event_update_userpage(struct perf_event *event);
976extern int perf_event_release_kernel(struct perf_event *event); 960extern int perf_event_release_kernel(struct perf_event *event);
977extern struct perf_event * 961extern struct perf_event *
978perf_event_create_kernel_counter(struct perf_event_attr *attr, 962perf_event_create_kernel_counter(struct perf_event_attr *attr,
979 int cpu, 963 int cpu,
980 struct task_struct *task, 964 struct task_struct *task,
981 perf_overflow_handler_t callback); 965 perf_overflow_handler_t callback,
966 void *context);
982extern u64 perf_event_read_value(struct perf_event *event, 967extern u64 perf_event_read_value(struct perf_event *event,
983 u64 *enabled, u64 *running); 968 u64 *enabled, u64 *running);
984 969
@@ -1018,7 +1003,7 @@ extern void perf_prepare_sample(struct perf_event_header *header,
1018 struct perf_event *event, 1003 struct perf_event *event,
1019 struct pt_regs *regs); 1004 struct pt_regs *regs);
1020 1005
1021extern int perf_event_overflow(struct perf_event *event, int nmi, 1006extern int perf_event_overflow(struct perf_event *event,
1022 struct perf_sample_data *data, 1007 struct perf_sample_data *data,
1023 struct pt_regs *regs); 1008 struct pt_regs *regs);
1024 1009
@@ -1037,7 +1022,7 @@ static inline int is_software_event(struct perf_event *event)
1037 1022
1038extern struct jump_label_key perf_swevent_enabled[PERF_COUNT_SW_MAX]; 1023extern struct jump_label_key perf_swevent_enabled[PERF_COUNT_SW_MAX];
1039 1024
1040extern void __perf_sw_event(u32, u64, int, struct pt_regs *, u64); 1025extern void __perf_sw_event(u32, u64, struct pt_regs *, u64);
1041 1026
1042#ifndef perf_arch_fetch_caller_regs 1027#ifndef perf_arch_fetch_caller_regs
1043static inline void perf_arch_fetch_caller_regs(struct pt_regs *regs, unsigned long ip) { } 1028static inline void perf_arch_fetch_caller_regs(struct pt_regs *regs, unsigned long ip) { }
@@ -1059,7 +1044,7 @@ static inline void perf_fetch_caller_regs(struct pt_regs *regs)
1059} 1044}
1060 1045
1061static __always_inline void 1046static __always_inline void
1062perf_sw_event(u32 event_id, u64 nr, int nmi, struct pt_regs *regs, u64 addr) 1047perf_sw_event(u32 event_id, u64 nr, struct pt_regs *regs, u64 addr)
1063{ 1048{
1064 struct pt_regs hot_regs; 1049 struct pt_regs hot_regs;
1065 1050
@@ -1068,7 +1053,7 @@ perf_sw_event(u32 event_id, u64 nr, int nmi, struct pt_regs *regs, u64 addr)
1068 perf_fetch_caller_regs(&hot_regs); 1053 perf_fetch_caller_regs(&hot_regs);
1069 regs = &hot_regs; 1054 regs = &hot_regs;
1070 } 1055 }
1071 __perf_sw_event(event_id, nr, nmi, regs, addr); 1056 __perf_sw_event(event_id, nr, regs, addr);
1072 } 1057 }
1073} 1058}
1074 1059
@@ -1082,7 +1067,7 @@ static inline void perf_event_task_sched_in(struct task_struct *task)
1082 1067
1083static inline void perf_event_task_sched_out(struct task_struct *task, struct task_struct *next) 1068static inline void perf_event_task_sched_out(struct task_struct *task, struct task_struct *next)
1084{ 1069{
1085 perf_sw_event(PERF_COUNT_SW_CONTEXT_SWITCHES, 1, 1, NULL, 0); 1070 perf_sw_event(PERF_COUNT_SW_CONTEXT_SWITCHES, 1, NULL, 0);
1086 1071
1087 __perf_event_task_sched_out(task, next); 1072 __perf_event_task_sched_out(task, next);
1088} 1073}
@@ -1143,8 +1128,7 @@ extern void perf_bp_event(struct perf_event *event, void *data);
1143#endif 1128#endif
1144 1129
1145extern int perf_output_begin(struct perf_output_handle *handle, 1130extern int perf_output_begin(struct perf_output_handle *handle,
1146 struct perf_event *event, unsigned int size, 1131 struct perf_event *event, unsigned int size);
1147 int nmi, int sample);
1148extern void perf_output_end(struct perf_output_handle *handle); 1132extern void perf_output_end(struct perf_output_handle *handle);
1149extern void perf_output_copy(struct perf_output_handle *handle, 1133extern void perf_output_copy(struct perf_output_handle *handle,
1150 const void *buf, unsigned int len); 1134 const void *buf, unsigned int len);
@@ -1166,10 +1150,13 @@ static inline void perf_event_delayed_put(struct task_struct *task) { }
1166static inline void perf_event_print_debug(void) { } 1150static inline void perf_event_print_debug(void) { }
1167static inline int perf_event_task_disable(void) { return -EINVAL; } 1151static inline int perf_event_task_disable(void) { return -EINVAL; }
1168static inline int perf_event_task_enable(void) { return -EINVAL; } 1152static inline int perf_event_task_enable(void) { return -EINVAL; }
1153static inline int perf_event_refresh(struct perf_event *event, int refresh)
1154{
1155 return -EINVAL;
1156}
1169 1157
1170static inline void 1158static inline void
1171perf_sw_event(u32 event_id, u64 nr, int nmi, 1159perf_sw_event(u32 event_id, u64 nr, struct pt_regs *regs, u64 addr) { }
1172 struct pt_regs *regs, u64 addr) { }
1173static inline void 1160static inline void
1174perf_bp_event(struct perf_event *event, void *data) { } 1161perf_bp_event(struct perf_event *event, void *data) { }
1175 1162
diff --git a/include/linux/platform_data/fsa9480.h b/include/linux/platform_data/fsa9480.h
new file mode 100644
index 000000000000..72dddcb4bed1
--- /dev/null
+++ b/include/linux/platform_data/fsa9480.h
@@ -0,0 +1,27 @@
1/*
2 * Copyright (C) 2010 Samsung Electronics
3 * Minkyu Kang <mk7.kang@samsung.com>
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 2 as
7 * published by the Free Software Foundation.
8 */
9
10#ifndef _FSA9480_H_
11#define _FSA9480_H_
12
13#define FSA9480_ATTACHED 1
14#define FSA9480_DETACHED 0
15
16struct fsa9480_platform_data {
17 void (*cfg_gpio) (void);
18 void (*usb_cb) (u8 attached);
19 void (*uart_cb) (u8 attached);
20 void (*charger_cb) (u8 attached);
21 void (*jig_cb) (u8 attached);
22 void (*reset_cb) (void);
23 void (*usb_power) (u8 on);
24 int wakeup;
25};
26
27#endif /* _FSA9480_H_ */
diff --git a/include/linux/platform_data/pxa_sdhci.h b/include/linux/platform_data/pxa_sdhci.h
new file mode 100644
index 000000000000..51ad0995abac
--- /dev/null
+++ b/include/linux/platform_data/pxa_sdhci.h
@@ -0,0 +1,60 @@
1/*
2 * include/linux/platform_data/pxa_sdhci.h
3 *
4 * Copyright 2010 Marvell
5 * Zhangfei Gao <zhangfei.gao@marvell.com>
6 *
7 * PXA Platform - SDHCI platform data definitions
8 *
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License version 2 as
11 * published by the Free Software Foundation.
12 */
13
14#ifndef _PXA_SDHCI_H_
15#define _PXA_SDHCI_H_
16
17/* pxa specific flag */
18/* Require clock free running */
19#define PXA_FLAG_ENABLE_CLOCK_GATING (1<<0)
20/* card always wired to host, like on-chip emmc */
21#define PXA_FLAG_CARD_PERMANENT (1<<1)
22/* Board design supports 8-bit data on SD/SDIO BUS */
23#define PXA_FLAG_SD_8_BIT_CAPABLE_SLOT (1<<2)
24
25/*
26 * struct pxa_sdhci_platdata() - Platform device data for PXA SDHCI
27 * @flags: flags for platform requirement
28 * @clk_delay_cycles:
29 * mmp2: each step is roughly 100ps, 5bits width
30 * pxa910: each step is 1ns, 4bits width
31 * @clk_delay_sel: select clk_delay, used on pxa910
32 * 0: choose feedback clk
33 * 1: choose feedback clk + delay value
34 * 2: choose internal clk
35 * @clk_delay_enable: enable clk_delay or not, used on pxa910
36 * @ext_cd_gpio: gpio pin used for external CD line
37 * @ext_cd_gpio_invert: invert values for external CD gpio line
38 * @max_speed: the maximum speed supported
39 * @host_caps: Standard MMC host capabilities bit field.
40 * @quirks: quirks of platfrom
41 * @pm_caps: pm_caps of platfrom
42 */
43struct sdhci_pxa_platdata {
44 unsigned int flags;
45 unsigned int clk_delay_cycles;
46 unsigned int clk_delay_sel;
47 bool clk_delay_enable;
48 unsigned int ext_cd_gpio;
49 bool ext_cd_gpio_invert;
50 unsigned int max_speed;
51 unsigned int host_caps;
52 unsigned int quirks;
53 unsigned int pm_caps;
54};
55
56struct sdhci_pxa {
57 u8 clk_enable;
58 u8 power_mode;
59};
60#endif /* _PXA_SDHCI_H_ */
diff --git a/include/linux/platform_device.h b/include/linux/platform_device.h
index ede1a80e3358..27bb05aae70d 100644
--- a/include/linux/platform_device.h
+++ b/include/linux/platform_device.h
@@ -42,6 +42,7 @@ extern void platform_device_unregister(struct platform_device *);
42extern struct bus_type platform_bus_type; 42extern struct bus_type platform_bus_type;
43extern struct device platform_bus; 43extern struct device platform_bus;
44 44
45extern void arch_setup_pdev_archdata(struct platform_device *);
45extern struct resource *platform_get_resource(struct platform_device *, unsigned int, unsigned int); 46extern struct resource *platform_get_resource(struct platform_device *, unsigned int, unsigned int);
46extern int platform_get_irq(struct platform_device *, unsigned int); 47extern int platform_get_irq(struct platform_device *, unsigned int);
47extern struct resource *platform_get_resource_byname(struct platform_device *, unsigned int, const char *); 48extern struct resource *platform_get_resource_byname(struct platform_device *, unsigned int, const char *);
diff --git a/include/linux/plist.h b/include/linux/plist.h
index c9b9f322c8d8..aa0fb390bd29 100644
--- a/include/linux/plist.h
+++ b/include/linux/plist.h
@@ -77,14 +77,9 @@
77 77
78#include <linux/kernel.h> 78#include <linux/kernel.h>
79#include <linux/list.h> 79#include <linux/list.h>
80#include <linux/spinlock_types.h>
81 80
82struct plist_head { 81struct plist_head {
83 struct list_head node_list; 82 struct list_head node_list;
84#ifdef CONFIG_DEBUG_PI_LIST
85 raw_spinlock_t *rawlock;
86 spinlock_t *spinlock;
87#endif
88}; 83};
89 84
90struct plist_node { 85struct plist_node {
@@ -93,37 +88,13 @@ struct plist_node {
93 struct list_head node_list; 88 struct list_head node_list;
94}; 89};
95 90
96#ifdef CONFIG_DEBUG_PI_LIST
97# define PLIST_HEAD_LOCK_INIT(_lock) .spinlock = _lock
98# define PLIST_HEAD_LOCK_INIT_RAW(_lock) .rawlock = _lock
99#else
100# define PLIST_HEAD_LOCK_INIT(_lock)
101# define PLIST_HEAD_LOCK_INIT_RAW(_lock)
102#endif
103
104#define _PLIST_HEAD_INIT(head) \
105 .node_list = LIST_HEAD_INIT((head).node_list)
106
107/** 91/**
108 * PLIST_HEAD_INIT - static struct plist_head initializer 92 * PLIST_HEAD_INIT - static struct plist_head initializer
109 * @head: struct plist_head variable name 93 * @head: struct plist_head variable name
110 * @_lock: lock to initialize for this list
111 */
112#define PLIST_HEAD_INIT(head, _lock) \
113{ \
114 _PLIST_HEAD_INIT(head), \
115 PLIST_HEAD_LOCK_INIT(&(_lock)) \
116}
117
118/**
119 * PLIST_HEAD_INIT_RAW - static struct plist_head initializer
120 * @head: struct plist_head variable name
121 * @_lock: lock to initialize for this list
122 */ 94 */
123#define PLIST_HEAD_INIT_RAW(head, _lock) \ 95#define PLIST_HEAD_INIT(head) \
124{ \ 96{ \
125 _PLIST_HEAD_INIT(head), \ 97 .node_list = LIST_HEAD_INIT((head).node_list) \
126 PLIST_HEAD_LOCK_INIT_RAW(&(_lock)) \
127} 98}
128 99
129/** 100/**
@@ -141,31 +112,11 @@ struct plist_node {
141/** 112/**
142 * plist_head_init - dynamic struct plist_head initializer 113 * plist_head_init - dynamic struct plist_head initializer
143 * @head: &struct plist_head pointer 114 * @head: &struct plist_head pointer
144 * @lock: spinlock protecting the list (debugging)
145 */ 115 */
146static inline void 116static inline void
147plist_head_init(struct plist_head *head, spinlock_t *lock) 117plist_head_init(struct plist_head *head)
148{ 118{
149 INIT_LIST_HEAD(&head->node_list); 119 INIT_LIST_HEAD(&head->node_list);
150#ifdef CONFIG_DEBUG_PI_LIST
151 head->spinlock = lock;
152 head->rawlock = NULL;
153#endif
154}
155
156/**
157 * plist_head_init_raw - dynamic struct plist_head initializer
158 * @head: &struct plist_head pointer
159 * @lock: raw_spinlock protecting the list (debugging)
160 */
161static inline void
162plist_head_init_raw(struct plist_head *head, raw_spinlock_t *lock)
163{
164 INIT_LIST_HEAD(&head->node_list);
165#ifdef CONFIG_DEBUG_PI_LIST
166 head->rawlock = lock;
167 head->spinlock = NULL;
168#endif
169} 120}
170 121
171/** 122/**
diff --git a/include/linux/pm.h b/include/linux/pm.h
index 3160648ccdda..f7c84c9abd30 100644
--- a/include/linux/pm.h
+++ b/include/linux/pm.h
@@ -425,7 +425,8 @@ struct dev_pm_info {
425 pm_message_t power_state; 425 pm_message_t power_state;
426 unsigned int can_wakeup:1; 426 unsigned int can_wakeup:1;
427 unsigned int async_suspend:1; 427 unsigned int async_suspend:1;
428 unsigned int in_suspend:1; /* Owned by the PM core */ 428 bool is_prepared:1; /* Owned by the PM core */
429 bool is_suspended:1; /* Ditto */
429 spinlock_t lock; 430 spinlock_t lock;
430#ifdef CONFIG_PM_SLEEP 431#ifdef CONFIG_PM_SLEEP
431 struct list_head entry; 432 struct list_head entry;
@@ -460,8 +461,8 @@ struct dev_pm_info {
460 unsigned long active_jiffies; 461 unsigned long active_jiffies;
461 unsigned long suspended_jiffies; 462 unsigned long suspended_jiffies;
462 unsigned long accounting_timestamp; 463 unsigned long accounting_timestamp;
463 void *subsys_data; /* Owned by the subsystem. */
464#endif 464#endif
465 void *subsys_data; /* Owned by the subsystem. */
465}; 466};
466 467
467extern void update_pm_runtime_accounting(struct device *dev); 468extern void update_pm_runtime_accounting(struct device *dev);
@@ -471,7 +472,7 @@ extern void update_pm_runtime_accounting(struct device *dev);
471 * hibernation, system resume and during runtime PM transitions along with 472 * hibernation, system resume and during runtime PM transitions along with
472 * subsystem-level and driver-level callbacks. 473 * subsystem-level and driver-level callbacks.
473 */ 474 */
474struct dev_power_domain { 475struct dev_pm_domain {
475 struct dev_pm_ops ops; 476 struct dev_pm_ops ops;
476}; 477};
477 478
@@ -552,11 +553,17 @@ extern void __suspend_report_result(const char *function, void *fn, int ret);
552extern int device_pm_wait_for_dev(struct device *sub, struct device *dev); 553extern int device_pm_wait_for_dev(struct device *sub, struct device *dev);
553 554
554extern int pm_generic_prepare(struct device *dev); 555extern int pm_generic_prepare(struct device *dev);
556extern int pm_generic_suspend_noirq(struct device *dev);
555extern int pm_generic_suspend(struct device *dev); 557extern int pm_generic_suspend(struct device *dev);
558extern int pm_generic_resume_noirq(struct device *dev);
556extern int pm_generic_resume(struct device *dev); 559extern int pm_generic_resume(struct device *dev);
560extern int pm_generic_freeze_noirq(struct device *dev);
557extern int pm_generic_freeze(struct device *dev); 561extern int pm_generic_freeze(struct device *dev);
562extern int pm_generic_thaw_noirq(struct device *dev);
558extern int pm_generic_thaw(struct device *dev); 563extern int pm_generic_thaw(struct device *dev);
564extern int pm_generic_restore_noirq(struct device *dev);
559extern int pm_generic_restore(struct device *dev); 565extern int pm_generic_restore(struct device *dev);
566extern int pm_generic_poweroff_noirq(struct device *dev);
560extern int pm_generic_poweroff(struct device *dev); 567extern int pm_generic_poweroff(struct device *dev);
561extern void pm_generic_complete(struct device *dev); 568extern void pm_generic_complete(struct device *dev);
562 569
diff --git a/include/linux/pm_domain.h b/include/linux/pm_domain.h
new file mode 100644
index 000000000000..21097cb086fe
--- /dev/null
+++ b/include/linux/pm_domain.h
@@ -0,0 +1,108 @@
1/*
2 * pm_domain.h - Definitions and headers related to device power domains.
3 *
4 * Copyright (C) 2011 Rafael J. Wysocki <rjw@sisk.pl>, Renesas Electronics Corp.
5 *
6 * This file is released under the GPLv2.
7 */
8
9#ifndef _LINUX_PM_DOMAIN_H
10#define _LINUX_PM_DOMAIN_H
11
12#include <linux/device.h>
13
14enum gpd_status {
15 GPD_STATE_ACTIVE = 0, /* PM domain is active */
16 GPD_STATE_BUSY, /* Something is happening to the PM domain */
17 GPD_STATE_REPEAT, /* Power off in progress, to be repeated */
18 GPD_STATE_POWER_OFF, /* PM domain is off */
19};
20
21struct dev_power_governor {
22 bool (*power_down_ok)(struct dev_pm_domain *domain);
23};
24
25struct generic_pm_domain {
26 struct dev_pm_domain domain; /* PM domain operations */
27 struct list_head gpd_list_node; /* Node in the global PM domains list */
28 struct list_head sd_node; /* Node in the parent's subdomain list */
29 struct generic_pm_domain *parent; /* Parent PM domain */
30 struct list_head sd_list; /* List of dubdomains */
31 struct list_head dev_list; /* List of devices */
32 struct mutex lock;
33 struct dev_power_governor *gov;
34 struct work_struct power_off_work;
35 unsigned int in_progress; /* Number of devices being suspended now */
36 unsigned int sd_count; /* Number of subdomains with power "on" */
37 enum gpd_status status; /* Current state of the domain */
38 wait_queue_head_t status_wait_queue;
39 struct task_struct *poweroff_task; /* Powering off task */
40 unsigned int resume_count; /* Number of devices being resumed */
41 unsigned int device_count; /* Number of devices */
42 unsigned int suspended_count; /* System suspend device counter */
43 unsigned int prepared_count; /* Suspend counter of prepared devices */
44 bool suspend_power_off; /* Power status before system suspend */
45 int (*power_off)(struct generic_pm_domain *domain);
46 int (*power_on)(struct generic_pm_domain *domain);
47 int (*start_device)(struct device *dev);
48 int (*stop_device)(struct device *dev);
49 bool (*active_wakeup)(struct device *dev);
50};
51
52static inline struct generic_pm_domain *pd_to_genpd(struct dev_pm_domain *pd)
53{
54 return container_of(pd, struct generic_pm_domain, domain);
55}
56
57struct dev_list_entry {
58 struct list_head node;
59 struct device *dev;
60 bool need_restore;
61};
62
63#ifdef CONFIG_PM_GENERIC_DOMAINS
64extern int pm_genpd_add_device(struct generic_pm_domain *genpd,
65 struct device *dev);
66extern int pm_genpd_remove_device(struct generic_pm_domain *genpd,
67 struct device *dev);
68extern int pm_genpd_add_subdomain(struct generic_pm_domain *genpd,
69 struct generic_pm_domain *new_subdomain);
70extern int pm_genpd_remove_subdomain(struct generic_pm_domain *genpd,
71 struct generic_pm_domain *target);
72extern void pm_genpd_init(struct generic_pm_domain *genpd,
73 struct dev_power_governor *gov, bool is_off);
74extern int pm_genpd_poweron(struct generic_pm_domain *genpd);
75extern void pm_genpd_poweroff_unused(void);
76extern void genpd_queue_power_off_work(struct generic_pm_domain *genpd);
77#else
78static inline int pm_genpd_add_device(struct generic_pm_domain *genpd,
79 struct device *dev)
80{
81 return -ENOSYS;
82}
83static inline int pm_genpd_remove_device(struct generic_pm_domain *genpd,
84 struct device *dev)
85{
86 return -ENOSYS;
87}
88static inline int pm_genpd_add_subdomain(struct generic_pm_domain *genpd,
89 struct generic_pm_domain *new_sd)
90{
91 return -ENOSYS;
92}
93static inline int pm_genpd_remove_subdomain(struct generic_pm_domain *genpd,
94 struct generic_pm_domain *target)
95{
96 return -ENOSYS;
97}
98static inline void pm_genpd_init(struct generic_pm_domain *genpd,
99 struct dev_power_governor *gov, bool is_off) {}
100static inline int pm_genpd_poweron(struct generic_pm_domain *genpd)
101{
102 return -ENOSYS;
103}
104static inline void pm_genpd_poweroff_unused(void) {}
105static inline void genpd_queue_power_off_work(struct generic_pm_domain *gpd) {}
106#endif
107
108#endif /* _LINUX_PM_DOMAIN_H */
diff --git a/include/linux/pm_runtime.h b/include/linux/pm_runtime.h
index 878cf84baeb1..daac05d751b2 100644
--- a/include/linux/pm_runtime.h
+++ b/include/linux/pm_runtime.h
@@ -82,6 +82,11 @@ static inline bool pm_runtime_suspended(struct device *dev)
82 && !dev->power.disable_depth; 82 && !dev->power.disable_depth;
83} 83}
84 84
85static inline bool pm_runtime_status_suspended(struct device *dev)
86{
87 return dev->power.runtime_status == RPM_SUSPENDED;
88}
89
85static inline bool pm_runtime_enabled(struct device *dev) 90static inline bool pm_runtime_enabled(struct device *dev)
86{ 91{
87 return !dev->power.disable_depth; 92 return !dev->power.disable_depth;
@@ -130,6 +135,7 @@ static inline void pm_runtime_put_noidle(struct device *dev) {}
130static inline bool device_run_wake(struct device *dev) { return false; } 135static inline bool device_run_wake(struct device *dev) { return false; }
131static inline void device_set_run_wake(struct device *dev, bool enable) {} 136static inline void device_set_run_wake(struct device *dev, bool enable) {}
132static inline bool pm_runtime_suspended(struct device *dev) { return false; } 137static inline bool pm_runtime_suspended(struct device *dev) { return false; }
138static inline bool pm_runtime_status_suspended(struct device *dev) { return false; }
133static inline bool pm_runtime_enabled(struct device *dev) { return false; } 139static inline bool pm_runtime_enabled(struct device *dev) { return false; }
134 140
135static inline int pm_generic_runtime_idle(struct device *dev) { return 0; } 141static inline int pm_generic_runtime_idle(struct device *dev) { return 0; }
@@ -247,41 +253,41 @@ static inline void pm_runtime_dont_use_autosuspend(struct device *dev)
247 253
248struct pm_clk_notifier_block { 254struct pm_clk_notifier_block {
249 struct notifier_block nb; 255 struct notifier_block nb;
250 struct dev_power_domain *pwr_domain; 256 struct dev_pm_domain *pm_domain;
251 char *con_ids[]; 257 char *con_ids[];
252}; 258};
253 259
254#ifdef CONFIG_PM_RUNTIME_CLK 260#ifdef CONFIG_PM_CLK
255extern int pm_runtime_clk_init(struct device *dev); 261extern int pm_clk_init(struct device *dev);
256extern void pm_runtime_clk_destroy(struct device *dev); 262extern void pm_clk_destroy(struct device *dev);
257extern int pm_runtime_clk_add(struct device *dev, const char *con_id); 263extern int pm_clk_add(struct device *dev, const char *con_id);
258extern void pm_runtime_clk_remove(struct device *dev, const char *con_id); 264extern void pm_clk_remove(struct device *dev, const char *con_id);
259extern int pm_runtime_clk_suspend(struct device *dev); 265extern int pm_clk_suspend(struct device *dev);
260extern int pm_runtime_clk_resume(struct device *dev); 266extern int pm_clk_resume(struct device *dev);
261#else 267#else
262static inline int pm_runtime_clk_init(struct device *dev) 268static inline int pm_clk_init(struct device *dev)
263{ 269{
264 return -EINVAL; 270 return -EINVAL;
265} 271}
266static inline void pm_runtime_clk_destroy(struct device *dev) 272static inline void pm_clk_destroy(struct device *dev)
267{ 273{
268} 274}
269static inline int pm_runtime_clk_add(struct device *dev, const char *con_id) 275static inline int pm_clk_add(struct device *dev, const char *con_id)
270{ 276{
271 return -EINVAL; 277 return -EINVAL;
272} 278}
273static inline void pm_runtime_clk_remove(struct device *dev, const char *con_id) 279static inline void pm_clk_remove(struct device *dev, const char *con_id)
274{ 280{
275} 281}
276#define pm_runtime_clock_suspend NULL 282#define pm_clk_suspend NULL
277#define pm_runtime_clock_resume NULL 283#define pm_clk_resume NULL
278#endif 284#endif
279 285
280#ifdef CONFIG_HAVE_CLK 286#ifdef CONFIG_HAVE_CLK
281extern void pm_runtime_clk_add_notifier(struct bus_type *bus, 287extern void pm_clk_add_notifier(struct bus_type *bus,
282 struct pm_clk_notifier_block *clknb); 288 struct pm_clk_notifier_block *clknb);
283#else 289#else
284static inline void pm_runtime_clk_add_notifier(struct bus_type *bus, 290static inline void pm_clk_add_notifier(struct bus_type *bus,
285 struct pm_clk_notifier_block *clknb) 291 struct pm_clk_notifier_block *clknb)
286{ 292{
287} 293}
diff --git a/include/linux/pnp.h b/include/linux/pnp.h
index 1bc1338b817b..195aafc6cd07 100644
--- a/include/linux/pnp.h
+++ b/include/linux/pnp.h
@@ -50,7 +50,7 @@ static inline resource_size_t pnp_resource_len(struct resource *res)
50{ 50{
51 if (res->start == 0 && res->end == 0) 51 if (res->start == 0 && res->end == 0)
52 return 0; 52 return 0;
53 return res->end - res->start + 1; 53 return resource_size(res);
54} 54}
55 55
56 56
diff --git a/include/linux/poison.h b/include/linux/poison.h
index 2110a81c5e2a..79159de0e341 100644
--- a/include/linux/poison.h
+++ b/include/linux/poison.h
@@ -40,6 +40,12 @@
40#define RED_INACTIVE 0x09F911029D74E35BULL /* when obj is inactive */ 40#define RED_INACTIVE 0x09F911029D74E35BULL /* when obj is inactive */
41#define RED_ACTIVE 0xD84156C5635688C0ULL /* when obj is active */ 41#define RED_ACTIVE 0xD84156C5635688C0ULL /* when obj is active */
42 42
43#ifdef CONFIG_PHYS_ADDR_T_64BIT
44#define MEMBLOCK_INACTIVE 0x3a84fb0144c9e71bULL
45#else
46#define MEMBLOCK_INACTIVE 0x44c9e71bUL
47#endif
48
43#define SLUB_RED_INACTIVE 0xbb 49#define SLUB_RED_INACTIVE 0xbb
44#define SLUB_RED_ACTIVE 0xcc 50#define SLUB_RED_ACTIVE 0xcc
45 51
diff --git a/include/linux/posix_acl.h b/include/linux/posix_acl.h
index 54211c1cd926..9a53b99818e2 100644
--- a/include/linux/posix_acl.h
+++ b/include/linux/posix_acl.h
@@ -73,13 +73,12 @@ posix_acl_release(struct posix_acl *acl)
73 73
74extern void posix_acl_init(struct posix_acl *, int); 74extern void posix_acl_init(struct posix_acl *, int);
75extern struct posix_acl *posix_acl_alloc(int, gfp_t); 75extern struct posix_acl *posix_acl_alloc(int, gfp_t);
76extern struct posix_acl *posix_acl_clone(const struct posix_acl *, gfp_t);
77extern int posix_acl_valid(const struct posix_acl *); 76extern int posix_acl_valid(const struct posix_acl *);
78extern int posix_acl_permission(struct inode *, const struct posix_acl *, int); 77extern int posix_acl_permission(struct inode *, const struct posix_acl *, int);
79extern struct posix_acl *posix_acl_from_mode(mode_t, gfp_t); 78extern struct posix_acl *posix_acl_from_mode(mode_t, gfp_t);
80extern int posix_acl_equiv_mode(const struct posix_acl *, mode_t *); 79extern int posix_acl_equiv_mode(const struct posix_acl *, mode_t *);
81extern int posix_acl_create_masq(struct posix_acl *, mode_t *); 80extern int posix_acl_create(struct posix_acl **, gfp_t, mode_t *);
82extern int posix_acl_chmod_masq(struct posix_acl *, mode_t); 81extern int posix_acl_chmod(struct posix_acl **, gfp_t, mode_t);
83 82
84extern struct posix_acl *get_posix_acl(struct inode *, int); 83extern struct posix_acl *get_posix_acl(struct inode *, int);
85extern int set_posix_acl(struct inode *, int, struct posix_acl *); 84extern int set_posix_acl(struct inode *, int, struct posix_acl *);
diff --git a/include/linux/preempt.h b/include/linux/preempt.h
index 2e681d9555bd..58969b2a8a82 100644
--- a/include/linux/preempt.h
+++ b/include/linux/preempt.h
@@ -27,6 +27,21 @@
27 27
28asmlinkage void preempt_schedule(void); 28asmlinkage void preempt_schedule(void);
29 29
30#define preempt_check_resched() \
31do { \
32 if (unlikely(test_thread_flag(TIF_NEED_RESCHED))) \
33 preempt_schedule(); \
34} while (0)
35
36#else /* !CONFIG_PREEMPT */
37
38#define preempt_check_resched() do { } while (0)
39
40#endif /* CONFIG_PREEMPT */
41
42
43#ifdef CONFIG_PREEMPT_COUNT
44
30#define preempt_disable() \ 45#define preempt_disable() \
31do { \ 46do { \
32 inc_preempt_count(); \ 47 inc_preempt_count(); \
@@ -39,12 +54,6 @@ do { \
39 dec_preempt_count(); \ 54 dec_preempt_count(); \
40} while (0) 55} while (0)
41 56
42#define preempt_check_resched() \
43do { \
44 if (unlikely(test_thread_flag(TIF_NEED_RESCHED))) \
45 preempt_schedule(); \
46} while (0)
47
48#define preempt_enable() \ 57#define preempt_enable() \
49do { \ 58do { \
50 preempt_enable_no_resched(); \ 59 preempt_enable_no_resched(); \
@@ -80,18 +89,17 @@ do { \
80 preempt_check_resched(); \ 89 preempt_check_resched(); \
81} while (0) 90} while (0)
82 91
83#else 92#else /* !CONFIG_PREEMPT_COUNT */
84 93
85#define preempt_disable() do { } while (0) 94#define preempt_disable() do { } while (0)
86#define preempt_enable_no_resched() do { } while (0) 95#define preempt_enable_no_resched() do { } while (0)
87#define preempt_enable() do { } while (0) 96#define preempt_enable() do { } while (0)
88#define preempt_check_resched() do { } while (0)
89 97
90#define preempt_disable_notrace() do { } while (0) 98#define preempt_disable_notrace() do { } while (0)
91#define preempt_enable_no_resched_notrace() do { } while (0) 99#define preempt_enable_no_resched_notrace() do { } while (0)
92#define preempt_enable_notrace() do { } while (0) 100#define preempt_enable_notrace() do { } while (0)
93 101
94#endif 102#endif /* CONFIG_PREEMPT_COUNT */
95 103
96#ifdef CONFIG_PREEMPT_NOTIFIERS 104#ifdef CONFIG_PREEMPT_NOTIFIERS
97 105
diff --git a/include/linux/ptrace.h b/include/linux/ptrace.h
index 9178d5cc0b01..800f113bea66 100644
--- a/include/linux/ptrace.h
+++ b/include/linux/ptrace.h
@@ -47,6 +47,13 @@
47#define PTRACE_GETREGSET 0x4204 47#define PTRACE_GETREGSET 0x4204
48#define PTRACE_SETREGSET 0x4205 48#define PTRACE_SETREGSET 0x4205
49 49
50#define PTRACE_SEIZE 0x4206
51#define PTRACE_INTERRUPT 0x4207
52#define PTRACE_LISTEN 0x4208
53
54/* flags in @data for PTRACE_SEIZE */
55#define PTRACE_SEIZE_DEVEL 0x80000000 /* temp flag for development */
56
50/* options set using PTRACE_SETOPTIONS */ 57/* options set using PTRACE_SETOPTIONS */
51#define PTRACE_O_TRACESYSGOOD 0x00000001 58#define PTRACE_O_TRACESYSGOOD 0x00000001
52#define PTRACE_O_TRACEFORK 0x00000002 59#define PTRACE_O_TRACEFORK 0x00000002
@@ -65,6 +72,7 @@
65#define PTRACE_EVENT_EXEC 4 72#define PTRACE_EVENT_EXEC 4
66#define PTRACE_EVENT_VFORK_DONE 5 73#define PTRACE_EVENT_VFORK_DONE 5
67#define PTRACE_EVENT_EXIT 6 74#define PTRACE_EVENT_EXIT 6
75#define PTRACE_EVENT_STOP 7
68 76
69#include <asm/ptrace.h> 77#include <asm/ptrace.h>
70 78
@@ -77,16 +85,22 @@
77 * flags. When the a task is stopped the ptracer owns task->ptrace. 85 * flags. When the a task is stopped the ptracer owns task->ptrace.
78 */ 86 */
79 87
88#define PT_SEIZED 0x00010000 /* SEIZE used, enable new behavior */
80#define PT_PTRACED 0x00000001 89#define PT_PTRACED 0x00000001
81#define PT_DTRACE 0x00000002 /* delayed trace (used on m68k, i386) */ 90#define PT_DTRACE 0x00000002 /* delayed trace (used on m68k, i386) */
82#define PT_TRACESYSGOOD 0x00000004 91#define PT_TRACESYSGOOD 0x00000004
83#define PT_PTRACE_CAP 0x00000008 /* ptracer can follow suid-exec */ 92#define PT_PTRACE_CAP 0x00000008 /* ptracer can follow suid-exec */
84#define PT_TRACE_FORK 0x00000010 93
85#define PT_TRACE_VFORK 0x00000020 94/* PT_TRACE_* event enable flags */
86#define PT_TRACE_CLONE 0x00000040 95#define PT_EVENT_FLAG_SHIFT 4
87#define PT_TRACE_EXEC 0x00000080 96#define PT_EVENT_FLAG(event) (1 << (PT_EVENT_FLAG_SHIFT + (event) - 1))
88#define PT_TRACE_VFORK_DONE 0x00000100 97
89#define PT_TRACE_EXIT 0x00000200 98#define PT_TRACE_FORK PT_EVENT_FLAG(PTRACE_EVENT_FORK)
99#define PT_TRACE_VFORK PT_EVENT_FLAG(PTRACE_EVENT_VFORK)
100#define PT_TRACE_CLONE PT_EVENT_FLAG(PTRACE_EVENT_CLONE)
101#define PT_TRACE_EXEC PT_EVENT_FLAG(PTRACE_EVENT_EXEC)
102#define PT_TRACE_VFORK_DONE PT_EVENT_FLAG(PTRACE_EVENT_VFORK_DONE)
103#define PT_TRACE_EXIT PT_EVENT_FLAG(PTRACE_EVENT_EXIT)
90 104
91#define PT_TRACE_MASK 0x000003f4 105#define PT_TRACE_MASK 0x000003f4
92 106
@@ -105,7 +119,7 @@ extern long arch_ptrace(struct task_struct *child, long request,
105extern int ptrace_readdata(struct task_struct *tsk, unsigned long src, char __user *dst, int len); 119extern int ptrace_readdata(struct task_struct *tsk, unsigned long src, char __user *dst, int len);
106extern int ptrace_writedata(struct task_struct *tsk, char __user *src, unsigned long dst, int len); 120extern int ptrace_writedata(struct task_struct *tsk, char __user *src, unsigned long dst, int len);
107extern void ptrace_disable(struct task_struct *); 121extern void ptrace_disable(struct task_struct *);
108extern int ptrace_check_attach(struct task_struct *task, int kill); 122extern int ptrace_check_attach(struct task_struct *task, bool ignore_state);
109extern int ptrace_request(struct task_struct *child, long request, 123extern int ptrace_request(struct task_struct *child, long request,
110 unsigned long addr, unsigned long data); 124 unsigned long addr, unsigned long data);
111extern void ptrace_notify(int exit_code); 125extern void ptrace_notify(int exit_code);
@@ -122,7 +136,7 @@ extern bool ptrace_may_access(struct task_struct *task, unsigned int mode);
122 136
123static inline int ptrace_reparented(struct task_struct *child) 137static inline int ptrace_reparented(struct task_struct *child)
124{ 138{
125 return child->real_parent != child->parent; 139 return !same_thread_group(child->real_parent, child->parent);
126} 140}
127 141
128static inline void ptrace_unlink(struct task_struct *child) 142static inline void ptrace_unlink(struct task_struct *child)
@@ -137,36 +151,56 @@ int generic_ptrace_pokedata(struct task_struct *tsk, unsigned long addr,
137 unsigned long data); 151 unsigned long data);
138 152
139/** 153/**
140 * task_ptrace - return %PT_* flags that apply to a task 154 * ptrace_parent - return the task that is tracing the given task
141 * @task: pointer to &task_struct in question 155 * @task: task to consider
142 * 156 *
143 * Returns the %PT_* flags that apply to @task. 157 * Returns %NULL if no one is tracing @task, or the &struct task_struct
158 * pointer to its tracer.
159 *
160 * Must called under rcu_read_lock(). The pointer returned might be kept
161 * live only by RCU. During exec, this may be called with task_lock() held
162 * on @task, still held from when check_unsafe_exec() was called.
144 */ 163 */
145static inline int task_ptrace(struct task_struct *task) 164static inline struct task_struct *ptrace_parent(struct task_struct *task)
146{ 165{
147 return task->ptrace; 166 if (unlikely(task->ptrace))
167 return rcu_dereference(task->parent);
168 return NULL;
169}
170
171/**
172 * ptrace_event_enabled - test whether a ptrace event is enabled
173 * @task: ptracee of interest
174 * @event: %PTRACE_EVENT_* to test
175 *
176 * Test whether @event is enabled for ptracee @task.
177 *
178 * Returns %true if @event is enabled, %false otherwise.
179 */
180static inline bool ptrace_event_enabled(struct task_struct *task, int event)
181{
182 return task->ptrace & PT_EVENT_FLAG(event);
148} 183}
149 184
150/** 185/**
151 * ptrace_event - possibly stop for a ptrace event notification 186 * ptrace_event - possibly stop for a ptrace event notification
152 * @mask: %PT_* bit to check in @current->ptrace 187 * @event: %PTRACE_EVENT_* value to report
153 * @event: %PTRACE_EVENT_* value to report if @mask is set
154 * @message: value for %PTRACE_GETEVENTMSG to return 188 * @message: value for %PTRACE_GETEVENTMSG to return
155 * 189 *
156 * This checks the @mask bit to see if ptrace wants stops for this event. 190 * Check whether @event is enabled and, if so, report @event and @message
157 * If so we stop, reporting @event and @message to the ptrace parent. 191 * to the ptrace parent.
158 *
159 * Returns nonzero if we did a ptrace notification, zero if not.
160 * 192 *
161 * Called without locks. 193 * Called without locks.
162 */ 194 */
163static inline int ptrace_event(int mask, int event, unsigned long message) 195static inline void ptrace_event(int event, unsigned long message)
164{ 196{
165 if (mask && likely(!(current->ptrace & mask))) 197 if (unlikely(ptrace_event_enabled(current, event))) {
166 return 0; 198 current->ptrace_message = message;
167 current->ptrace_message = message; 199 ptrace_notify((event << 8) | SIGTRAP);
168 ptrace_notify((event << 8) | SIGTRAP); 200 } else if (event == PTRACE_EVENT_EXEC && unlikely(current->ptrace)) {
169 return 1; 201 /* legacy EXEC report via SIGTRAP */
202 send_sig(SIGTRAP, current, 0);
203 }
170} 204}
171 205
172/** 206/**
@@ -183,16 +217,24 @@ static inline void ptrace_init_task(struct task_struct *child, bool ptrace)
183{ 217{
184 INIT_LIST_HEAD(&child->ptrace_entry); 218 INIT_LIST_HEAD(&child->ptrace_entry);
185 INIT_LIST_HEAD(&child->ptraced); 219 INIT_LIST_HEAD(&child->ptraced);
186 child->parent = child->real_parent; 220#ifdef CONFIG_HAVE_HW_BREAKPOINT
221 atomic_set(&child->ptrace_bp_refcnt, 1);
222#endif
223 child->jobctl = 0;
187 child->ptrace = 0; 224 child->ptrace = 0;
188 if (unlikely(ptrace) && (current->ptrace & PT_PTRACED)) { 225 child->parent = child->real_parent;
226
227 if (unlikely(ptrace) && current->ptrace) {
189 child->ptrace = current->ptrace; 228 child->ptrace = current->ptrace;
190 __ptrace_link(child, current->parent); 229 __ptrace_link(child, current->parent);
191 }
192 230
193#ifdef CONFIG_HAVE_HW_BREAKPOINT 231 if (child->ptrace & PT_SEIZED)
194 atomic_set(&child->ptrace_bp_refcnt, 1); 232 task_set_jobctl_pending(child, JOBCTL_TRAP_STOP);
195#endif 233 else
234 sigaddset(&child->pending.signal, SIGSTOP);
235
236 set_tsk_thread_flag(child, TIF_SIGPENDING);
237 }
196} 238}
197 239
198/** 240/**
diff --git a/include/linux/random.h b/include/linux/random.h
index fb7ab9de5f36..ce29a040c8dc 100644
--- a/include/linux/random.h
+++ b/include/linux/random.h
@@ -58,6 +58,7 @@ extern 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); 60extern __u32 secure_ip_id(__be32 daddr);
61extern __u32 secure_ipv6_id(const __be32 daddr[4]);
61extern u32 secure_ipv4_port_ephemeral(__be32 saddr, __be32 daddr, __be16 dport); 62extern u32 secure_ipv4_port_ephemeral(__be32 saddr, __be32 daddr, __be16 dport);
62extern u32 secure_ipv6_port_ephemeral(const __be32 *saddr, const __be32 *daddr, 63extern u32 secure_ipv6_port_ephemeral(const __be32 *saddr, const __be32 *daddr,
63 __be16 dport); 64 __be16 dport);
diff --git a/include/linux/rculist.h b/include/linux/rculist.h
index e3beb315517a..d079290843a9 100644
--- a/include/linux/rculist.h
+++ b/include/linux/rculist.h
@@ -183,7 +183,7 @@ static inline void list_splice_init_rcu(struct list_head *list,
183 struct list_head *last = list->prev; 183 struct list_head *last = list->prev;
184 struct list_head *at = head->next; 184 struct list_head *at = head->next;
185 185
186 if (list_empty(head)) 186 if (list_empty(list))
187 return; 187 return;
188 188
189 /* "first" and "last" tracking list, so initialize it. */ 189 /* "first" and "last" tracking list, so initialize it. */
diff --git a/include/linux/rcupdate.h b/include/linux/rcupdate.h
index 99f9aa7c2804..8f4f881a0ad8 100644
--- a/include/linux/rcupdate.h
+++ b/include/linux/rcupdate.h
@@ -239,7 +239,7 @@ extern int rcu_read_lock_bh_held(void);
239 * Check debug_lockdep_rcu_enabled() to prevent false positives during boot 239 * Check debug_lockdep_rcu_enabled() to prevent false positives during boot
240 * and while lockdep is disabled. 240 * and while lockdep is disabled.
241 */ 241 */
242#ifdef CONFIG_PREEMPT 242#ifdef CONFIG_PREEMPT_COUNT
243static inline int rcu_read_lock_sched_held(void) 243static inline int rcu_read_lock_sched_held(void)
244{ 244{
245 int lockdep_opinion = 0; 245 int lockdep_opinion = 0;
@@ -250,12 +250,12 @@ static inline int rcu_read_lock_sched_held(void)
250 lockdep_opinion = lock_is_held(&rcu_sched_lock_map); 250 lockdep_opinion = lock_is_held(&rcu_sched_lock_map);
251 return lockdep_opinion || preempt_count() != 0 || irqs_disabled(); 251 return lockdep_opinion || preempt_count() != 0 || irqs_disabled();
252} 252}
253#else /* #ifdef CONFIG_PREEMPT */ 253#else /* #ifdef CONFIG_PREEMPT_COUNT */
254static inline int rcu_read_lock_sched_held(void) 254static inline int rcu_read_lock_sched_held(void)
255{ 255{
256 return 1; 256 return 1;
257} 257}
258#endif /* #else #ifdef CONFIG_PREEMPT */ 258#endif /* #else #ifdef CONFIG_PREEMPT_COUNT */
259 259
260#else /* #ifdef CONFIG_DEBUG_LOCK_ALLOC */ 260#else /* #ifdef CONFIG_DEBUG_LOCK_ALLOC */
261 261
@@ -276,17 +276,17 @@ static inline int rcu_read_lock_bh_held(void)
276 return 1; 276 return 1;
277} 277}
278 278
279#ifdef CONFIG_PREEMPT 279#ifdef CONFIG_PREEMPT_COUNT
280static inline int rcu_read_lock_sched_held(void) 280static inline int rcu_read_lock_sched_held(void)
281{ 281{
282 return preempt_count() != 0 || irqs_disabled(); 282 return preempt_count() != 0 || irqs_disabled();
283} 283}
284#else /* #ifdef CONFIG_PREEMPT */ 284#else /* #ifdef CONFIG_PREEMPT_COUNT */
285static inline int rcu_read_lock_sched_held(void) 285static inline int rcu_read_lock_sched_held(void)
286{ 286{
287 return 1; 287 return 1;
288} 288}
289#endif /* #else #ifdef CONFIG_PREEMPT */ 289#endif /* #else #ifdef CONFIG_PREEMPT_COUNT */
290 290
291#endif /* #else #ifdef CONFIG_DEBUG_LOCK_ALLOC */ 291#endif /* #else #ifdef CONFIG_DEBUG_LOCK_ALLOC */
292 292
diff --git a/include/linux/reboot.h b/include/linux/reboot.h
index 3005d5a7fce5..e0879a70e830 100644
--- a/include/linux/reboot.h
+++ b/include/linux/reboot.h
@@ -39,6 +39,11 @@
39 39
40#include <linux/notifier.h> 40#include <linux/notifier.h>
41 41
42#define SYS_DOWN 0x0001 /* Notify of system down */
43#define SYS_RESTART SYS_DOWN
44#define SYS_HALT 0x0002 /* Notify of system halt */
45#define SYS_POWER_OFF 0x0003 /* Notify of system power off */
46
42extern int register_reboot_notifier(struct notifier_block *); 47extern int register_reboot_notifier(struct notifier_block *);
43extern int unregister_reboot_notifier(struct notifier_block *); 48extern int unregister_reboot_notifier(struct notifier_block *);
44 49
diff --git a/include/linux/regmap.h b/include/linux/regmap.h
new file mode 100644
index 000000000000..60a65cd7e1a0
--- /dev/null
+++ b/include/linux/regmap.h
@@ -0,0 +1,82 @@
1#ifndef __LINUX_REGMAP_H
2#define __LINUX_REGMAP_H
3
4/*
5 * Register map access API
6 *
7 * Copyright 2011 Wolfson Microelectronics plc
8 *
9 * Author: Mark Brown <broonie@opensource.wolfsonmicro.com>
10 *
11 * This program is free software; you can redistribute it and/or modify
12 * it under the terms of the GNU General Public License version 2 as
13 * published by the Free Software Foundation.
14 */
15
16#include <linux/device.h>
17#include <linux/list.h>
18#include <linux/module.h>
19
20struct i2c_client;
21struct spi_device;
22
23struct regmap_config {
24 int reg_bits;
25 int val_bits;
26};
27
28typedef int (*regmap_hw_write)(struct device *dev, const void *data,
29 size_t count);
30typedef int (*regmap_hw_gather_write)(struct device *dev,
31 const void *reg, size_t reg_len,
32 const void *val, size_t val_len);
33typedef int (*regmap_hw_read)(struct device *dev,
34 const void *reg_buf, size_t reg_size,
35 void *val_buf, size_t val_size);
36
37/**
38 * Description of a hardware bus for the register map infrastructure.
39 *
40 * @list: Internal use.
41 * @type: Bus type, used to identify bus to be used for a device.
42 * @write: Write operation.
43 * @gather_write: Write operation with split register/value, return -ENOTSUPP
44 * if not implemented on a given device.
45 * @read: Read operation. Data is returned in the buffer used to transmit
46 * data.
47 * @owner: Module with the bus implementation, used to pin the implementation
48 * in memory.
49 * @read_flag_mask: Mask to be set in the top byte of the register when doing
50 * a read.
51 */
52struct regmap_bus {
53 struct list_head list;
54 struct bus_type *type;
55 regmap_hw_write write;
56 regmap_hw_gather_write gather_write;
57 regmap_hw_read read;
58 struct module *owner;
59 u8 read_flag_mask;
60};
61
62struct regmap *regmap_init(struct device *dev,
63 const struct regmap_bus *bus,
64 const struct regmap_config *config);
65struct regmap *regmap_init_i2c(struct i2c_client *i2c,
66 const struct regmap_config *config);
67struct regmap *regmap_init_spi(struct spi_device *dev,
68 const struct regmap_config *config);
69
70void regmap_exit(struct regmap *map);
71int regmap_write(struct regmap *map, unsigned int reg, unsigned int val);
72int regmap_raw_write(struct regmap *map, unsigned int reg,
73 const void *val, size_t val_len);
74int regmap_read(struct regmap *map, unsigned int reg, unsigned int *val);
75int regmap_raw_read(struct regmap *map, unsigned int reg,
76 void *val, size_t val_len);
77int regmap_bulk_read(struct regmap *map, unsigned int reg, void *val,
78 size_t val_count);
79int regmap_update_bits(struct regmap *map, unsigned int reg,
80 unsigned int mask, unsigned int val);
81
82#endif
diff --git a/include/linux/reiserfs_acl.h b/include/linux/reiserfs_acl.h
index 3fd8c4506bbb..f096b80e73d8 100644
--- a/include/linux/reiserfs_acl.h
+++ b/include/linux/reiserfs_acl.h
@@ -59,11 +59,7 @@ extern const struct xattr_handler reiserfs_posix_acl_access_handler;
59#else 59#else
60 60
61#define reiserfs_cache_default_acl(inode) 0 61#define reiserfs_cache_default_acl(inode) 0
62 62#define reiserfs_get_acl NULL
63static inline struct posix_acl *reiserfs_get_acl(struct inode *inode, int type)
64{
65 return NULL;
66}
67 63
68static inline int reiserfs_acl_chmod(struct inode *inode) 64static inline int reiserfs_acl_chmod(struct inode *inode)
69{ 65{
diff --git a/include/linux/reiserfs_fs.h b/include/linux/reiserfs_fs.h
index eca75df00fed..96d465f8d3e6 100644
--- a/include/linux/reiserfs_fs.h
+++ b/include/linux/reiserfs_fs.h
@@ -2332,7 +2332,9 @@ __u32 keyed_hash(const signed char *msg, int len);
2332__u32 yura_hash(const signed char *msg, int len); 2332__u32 yura_hash(const signed char *msg, int len);
2333__u32 r5_hash(const signed char *msg, int len); 2333__u32 r5_hash(const signed char *msg, int len);
2334 2334
2335#define reiserfs_set_le_bit __set_bit_le
2335#define reiserfs_test_and_set_le_bit __test_and_set_bit_le 2336#define reiserfs_test_and_set_le_bit __test_and_set_bit_le
2337#define reiserfs_clear_le_bit __clear_bit_le
2336#define reiserfs_test_and_clear_le_bit __test_and_clear_bit_le 2338#define reiserfs_test_and_clear_le_bit __test_and_clear_bit_le
2337#define reiserfs_test_le_bit test_bit_le 2339#define reiserfs_test_le_bit test_bit_le
2338#define reiserfs_find_next_zero_le_bit find_next_zero_bit_le 2340#define reiserfs_find_next_zero_le_bit find_next_zero_bit_le
diff --git a/include/linux/reiserfs_xattr.h b/include/linux/reiserfs_xattr.h
index 6deef5dc95fb..c2b71473266e 100644
--- a/include/linux/reiserfs_xattr.h
+++ b/include/linux/reiserfs_xattr.h
@@ -41,7 +41,7 @@ int reiserfs_xattr_init(struct super_block *sb, int mount_flags);
41int reiserfs_lookup_privroot(struct super_block *sb); 41int reiserfs_lookup_privroot(struct super_block *sb);
42int reiserfs_delete_xattrs(struct inode *inode); 42int reiserfs_delete_xattrs(struct inode *inode);
43int reiserfs_chown_xattrs(struct inode *inode, struct iattr *attrs); 43int reiserfs_chown_xattrs(struct inode *inode, struct iattr *attrs);
44int reiserfs_permission(struct inode *inode, int mask, unsigned int flags); 44int reiserfs_permission(struct inode *inode, int mask);
45 45
46#ifdef CONFIG_REISERFS_FS_XATTR 46#ifdef CONFIG_REISERFS_FS_XATTR
47#define has_xattr_dir(inode) (REISERFS_I(inode)->i_flags & i_has_xattr_dir) 47#define has_xattr_dir(inode) (REISERFS_I(inode)->i_flags & i_has_xattr_dir)
diff --git a/include/linux/ring_buffer.h b/include/linux/ring_buffer.h
index ab38ac80b0f9..b891de96000f 100644
--- a/include/linux/ring_buffer.h
+++ b/include/linux/ring_buffer.h
@@ -169,7 +169,7 @@ void ring_buffer_set_clock(struct ring_buffer *buffer,
169size_t ring_buffer_page_len(void *page); 169size_t ring_buffer_page_len(void *page);
170 170
171 171
172void *ring_buffer_alloc_read_page(struct ring_buffer *buffer); 172void *ring_buffer_alloc_read_page(struct ring_buffer *buffer, int cpu);
173void ring_buffer_free_read_page(struct ring_buffer *buffer, void *data); 173void ring_buffer_free_read_page(struct ring_buffer *buffer, void *data);
174int ring_buffer_read_page(struct ring_buffer *buffer, void **data_page, 174int ring_buffer_read_page(struct ring_buffer *buffer, void **data_page,
175 size_t len, int cpu, int full); 175 size_t len, int cpu, int full);
diff --git a/include/linux/rtmutex.h b/include/linux/rtmutex.h
index 8d522ffeda33..de17134244f3 100644
--- a/include/linux/rtmutex.h
+++ b/include/linux/rtmutex.h
@@ -66,7 +66,7 @@ struct hrtimer_sleeper;
66 66
67#define __RT_MUTEX_INITIALIZER(mutexname) \ 67#define __RT_MUTEX_INITIALIZER(mutexname) \
68 { .wait_lock = __RAW_SPIN_LOCK_UNLOCKED(mutexname.wait_lock) \ 68 { .wait_lock = __RAW_SPIN_LOCK_UNLOCKED(mutexname.wait_lock) \
69 , .wait_list = PLIST_HEAD_INIT_RAW(mutexname.wait_list, mutexname.wait_lock) \ 69 , .wait_list = PLIST_HEAD_INIT(mutexname.wait_list) \
70 , .owner = NULL \ 70 , .owner = NULL \
71 __DEBUG_RT_MUTEX_INITIALIZER(mutexname)} 71 __DEBUG_RT_MUTEX_INITIALIZER(mutexname)}
72 72
@@ -100,7 +100,7 @@ extern void rt_mutex_unlock(struct rt_mutex *lock);
100 100
101#ifdef CONFIG_RT_MUTEXES 101#ifdef CONFIG_RT_MUTEXES
102# define INIT_RT_MUTEXES(tsk) \ 102# define INIT_RT_MUTEXES(tsk) \
103 .pi_waiters = PLIST_HEAD_INIT(tsk.pi_waiters, tsk.pi_lock), \ 103 .pi_waiters = PLIST_HEAD_INIT(tsk.pi_waiters), \
104 INIT_RT_MUTEX_DEBUG(tsk) 104 INIT_RT_MUTEX_DEBUG(tsk)
105#else 105#else
106# define INIT_RT_MUTEXES(tsk) 106# define INIT_RT_MUTEXES(tsk)
diff --git a/include/linux/rtnetlink.h b/include/linux/rtnetlink.h
index bbad657a3725..8e872ead88b5 100644
--- a/include/linux/rtnetlink.h
+++ b/include/linux/rtnetlink.h
@@ -585,6 +585,8 @@ enum rtnetlink_groups {
585#define RTNLGRP_PHONET_IFADDR RTNLGRP_PHONET_IFADDR 585#define RTNLGRP_PHONET_IFADDR RTNLGRP_PHONET_IFADDR
586 RTNLGRP_PHONET_ROUTE, 586 RTNLGRP_PHONET_ROUTE,
587#define RTNLGRP_PHONET_ROUTE RTNLGRP_PHONET_ROUTE 587#define RTNLGRP_PHONET_ROUTE RTNLGRP_PHONET_ROUTE
588 RTNLGRP_DCB,
589#define RTNLGRP_DCB RTNLGRP_DCB
588 __RTNLGRP_MAX 590 __RTNLGRP_MAX
589}; 591};
590#define RTNLGRP_MAX (__RTNLGRP_MAX - 1) 592#define RTNLGRP_MAX (__RTNLGRP_MAX - 1)
@@ -758,8 +760,7 @@ extern int lockdep_rtnl_is_held(void);
758 * or RTNL. Note : Please prefer rtnl_dereference() or rcu_dereference() 760 * or RTNL. Note : Please prefer rtnl_dereference() or rcu_dereference()
759 */ 761 */
760#define rcu_dereference_rtnl(p) \ 762#define rcu_dereference_rtnl(p) \
761 rcu_dereference_check(p, rcu_read_lock_held() || \ 763 rcu_dereference_check(p, lockdep_rtnl_is_held())
762 lockdep_rtnl_is_held())
763 764
764/** 765/**
765 * rtnl_dereference - fetch RCU pointer when updates are prevented by RTNL 766 * rtnl_dereference - fetch RCU pointer when updates are prevented by RTNL
diff --git a/include/linux/rwsem.h b/include/linux/rwsem.h
index a8afe9cd000c..77950dfa0a9e 100644
--- a/include/linux/rwsem.h
+++ b/include/linux/rwsem.h
@@ -124,19 +124,9 @@ extern void downgrade_write(struct rw_semaphore *sem);
124 */ 124 */
125extern void down_read_nested(struct rw_semaphore *sem, int subclass); 125extern void down_read_nested(struct rw_semaphore *sem, int subclass);
126extern void down_write_nested(struct rw_semaphore *sem, int subclass); 126extern void down_write_nested(struct rw_semaphore *sem, int subclass);
127/*
128 * Take/release a lock when not the owner will release it.
129 *
130 * [ This API should be avoided as much as possible - the
131 * proper abstraction for this case is completions. ]
132 */
133extern void down_read_non_owner(struct rw_semaphore *sem);
134extern void up_read_non_owner(struct rw_semaphore *sem);
135#else 127#else
136# define down_read_nested(sem, subclass) down_read(sem) 128# define down_read_nested(sem, subclass) down_read(sem)
137# define down_write_nested(sem, subclass) down_write(sem) 129# define down_write_nested(sem, subclass) down_write(sem)
138# define down_read_non_owner(sem) down_read(sem)
139# define up_read_non_owner(sem) up_read(sem)
140#endif 130#endif
141 131
142#endif /* _LINUX_RWSEM_H */ 132#endif /* _LINUX_RWSEM_H */
diff --git a/include/linux/sched.h b/include/linux/sched.h
index 2a8621c4be1e..20b03bf94748 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -808,7 +808,7 @@ enum cpu_idle_type {
808 * when BITS_PER_LONG <= 32 are pretty high and the returns do not justify the 808 * when BITS_PER_LONG <= 32 are pretty high and the returns do not justify the
809 * increased costs. 809 * increased costs.
810 */ 810 */
811#if BITS_PER_LONG > 32 811#if 0 /* BITS_PER_LONG > 32 -- currently broken: it increases power usage under light load */
812# define SCHED_LOAD_RESOLUTION 10 812# define SCHED_LOAD_RESOLUTION 10
813# define scale_load(w) ((w) << SCHED_LOAD_RESOLUTION) 813# define scale_load(w) ((w) << SCHED_LOAD_RESOLUTION)
814# define scale_load_down(w) ((w) >> SCHED_LOAD_RESOLUTION) 814# define scale_load_down(w) ((w) >> SCHED_LOAD_RESOLUTION)
@@ -844,6 +844,7 @@ enum cpu_idle_type {
844#define SD_SERIALIZE 0x0400 /* Only a single load balancing instance */ 844#define SD_SERIALIZE 0x0400 /* Only a single load balancing instance */
845#define SD_ASYM_PACKING 0x0800 /* Place busy groups earlier in the domain */ 845#define SD_ASYM_PACKING 0x0800 /* Place busy groups earlier in the domain */
846#define SD_PREFER_SIBLING 0x1000 /* Prefer to place tasks in a sibling domain */ 846#define SD_PREFER_SIBLING 0x1000 /* Prefer to place tasks in a sibling domain */
847#define SD_OVERLAP 0x2000 /* sched_domains of this level overlap */
847 848
848enum powersavings_balance_level { 849enum powersavings_balance_level {
849 POWERSAVINGS_BALANCE_NONE = 0, /* No power saving load balance */ 850 POWERSAVINGS_BALANCE_NONE = 0, /* No power saving load balance */
@@ -893,16 +894,21 @@ static inline int sd_power_saving_flags(void)
893 return 0; 894 return 0;
894} 895}
895 896
896struct sched_group { 897struct sched_group_power {
897 struct sched_group *next; /* Must be a circular list */
898 atomic_t ref; 898 atomic_t ref;
899
900 /* 899 /*
901 * CPU power of this group, SCHED_LOAD_SCALE being max power for a 900 * CPU power of this group, SCHED_LOAD_SCALE being max power for a
902 * single CPU. 901 * single CPU.
903 */ 902 */
904 unsigned int cpu_power, cpu_power_orig; 903 unsigned int power, power_orig;
904};
905
906struct sched_group {
907 struct sched_group *next; /* Must be a circular list */
908 atomic_t ref;
909
905 unsigned int group_weight; 910 unsigned int group_weight;
911 struct sched_group_power *sgp;
906 912
907 /* 913 /*
908 * The CPUs this group covers. 914 * The CPUs this group covers.
@@ -1063,6 +1069,7 @@ struct sched_domain;
1063 */ 1069 */
1064#define WF_SYNC 0x01 /* waker goes to sleep after wakup */ 1070#define WF_SYNC 0x01 /* waker goes to sleep after wakup */
1065#define WF_FORK 0x02 /* child wakeup after fork */ 1071#define WF_FORK 0x02 /* child wakeup after fork */
1072#define WF_MIGRATED 0x04 /* internal use, task got migrated */
1066 1073
1067#define ENQUEUE_WAKEUP 1 1074#define ENQUEUE_WAKEUP 1
1068#define ENQUEUE_HEAD 2 1075#define ENQUEUE_HEAD 2
@@ -1253,6 +1260,9 @@ struct task_struct {
1253#ifdef CONFIG_PREEMPT_RCU 1260#ifdef CONFIG_PREEMPT_RCU
1254 int rcu_read_lock_nesting; 1261 int rcu_read_lock_nesting;
1255 char rcu_read_unlock_special; 1262 char rcu_read_unlock_special;
1263#if defined(CONFIG_RCU_BOOST) && defined(CONFIG_TREE_PREEMPT_RCU)
1264 int rcu_boosted;
1265#endif /* #if defined(CONFIG_RCU_BOOST) && defined(CONFIG_TREE_PREEMPT_RCU) */
1256 struct list_head rcu_node_entry; 1266 struct list_head rcu_node_entry;
1257#endif /* #ifdef CONFIG_PREEMPT_RCU */ 1267#endif /* #ifdef CONFIG_PREEMPT_RCU */
1258#ifdef CONFIG_TREE_PREEMPT_RCU 1268#ifdef CONFIG_TREE_PREEMPT_RCU
@@ -1282,7 +1292,7 @@ struct task_struct {
1282 int exit_state; 1292 int exit_state;
1283 int exit_code, exit_signal; 1293 int exit_code, exit_signal;
1284 int pdeath_signal; /* The signal sent when the parent dies */ 1294 int pdeath_signal; /* The signal sent when the parent dies */
1285 unsigned int group_stop; /* GROUP_STOP_*, siglock protected */ 1295 unsigned int jobctl; /* JOBCTL_*, siglock protected */
1286 /* ??? */ 1296 /* ??? */
1287 unsigned int personality; 1297 unsigned int personality;
1288 unsigned did_exec:1; 1298 unsigned did_exec:1;
@@ -1502,7 +1512,6 @@ struct task_struct {
1502 short il_next; 1512 short il_next;
1503 short pref_node_fork; 1513 short pref_node_fork;
1504#endif 1514#endif
1505 atomic_t fs_excl; /* holding fs exclusive resources */
1506 struct rcu_head rcu; 1515 struct rcu_head rcu;
1507 1516
1508 /* 1517 /*
@@ -1803,15 +1812,34 @@ extern void thread_group_times(struct task_struct *p, cputime_t *ut, cputime_t *
1803#define used_math() tsk_used_math(current) 1812#define used_math() tsk_used_math(current)
1804 1813
1805/* 1814/*
1806 * task->group_stop flags 1815 * task->jobctl flags
1807 */ 1816 */
1808#define GROUP_STOP_SIGMASK 0xffff /* signr of the last group stop */ 1817#define JOBCTL_STOP_SIGMASK 0xffff /* signr of the last group stop */
1809#define GROUP_STOP_PENDING (1 << 16) /* task should stop for group stop */ 1818
1810#define GROUP_STOP_CONSUME (1 << 17) /* consume group stop count */ 1819#define JOBCTL_STOP_DEQUEUED_BIT 16 /* stop signal dequeued */
1811#define GROUP_STOP_TRAPPING (1 << 18) /* switching from STOPPED to TRACED */ 1820#define JOBCTL_STOP_PENDING_BIT 17 /* task should stop for group stop */
1812#define GROUP_STOP_DEQUEUED (1 << 19) /* stop signal dequeued */ 1821#define JOBCTL_STOP_CONSUME_BIT 18 /* consume group stop count */
1813 1822#define JOBCTL_TRAP_STOP_BIT 19 /* trap for STOP */
1814extern void task_clear_group_stop_pending(struct task_struct *task); 1823#define JOBCTL_TRAP_NOTIFY_BIT 20 /* trap for NOTIFY */
1824#define JOBCTL_TRAPPING_BIT 21 /* switching to TRACED */
1825#define JOBCTL_LISTENING_BIT 22 /* ptracer is listening for events */
1826
1827#define JOBCTL_STOP_DEQUEUED (1 << JOBCTL_STOP_DEQUEUED_BIT)
1828#define JOBCTL_STOP_PENDING (1 << JOBCTL_STOP_PENDING_BIT)
1829#define JOBCTL_STOP_CONSUME (1 << JOBCTL_STOP_CONSUME_BIT)
1830#define JOBCTL_TRAP_STOP (1 << JOBCTL_TRAP_STOP_BIT)
1831#define JOBCTL_TRAP_NOTIFY (1 << JOBCTL_TRAP_NOTIFY_BIT)
1832#define JOBCTL_TRAPPING (1 << JOBCTL_TRAPPING_BIT)
1833#define JOBCTL_LISTENING (1 << JOBCTL_LISTENING_BIT)
1834
1835#define JOBCTL_TRAP_MASK (JOBCTL_TRAP_STOP | JOBCTL_TRAP_NOTIFY)
1836#define JOBCTL_PENDING_MASK (JOBCTL_STOP_PENDING | JOBCTL_TRAP_MASK)
1837
1838extern bool task_set_jobctl_pending(struct task_struct *task,
1839 unsigned int mask);
1840extern void task_clear_jobctl_trapping(struct task_struct *task);
1841extern void task_clear_jobctl_pending(struct task_struct *task,
1842 unsigned int mask);
1815 1843
1816#ifdef CONFIG_PREEMPT_RCU 1844#ifdef CONFIG_PREEMPT_RCU
1817 1845
@@ -2126,7 +2154,7 @@ static inline int dequeue_signal_lock(struct task_struct *tsk, sigset_t *mask, s
2126 spin_unlock_irqrestore(&tsk->sighand->siglock, flags); 2154 spin_unlock_irqrestore(&tsk->sighand->siglock, flags);
2127 2155
2128 return ret; 2156 return ret;
2129} 2157}
2130 2158
2131extern void block_all_signals(int (*notifier)(void *priv), void *priv, 2159extern void block_all_signals(int (*notifier)(void *priv), void *priv,
2132 sigset_t *mask); 2160 sigset_t *mask);
@@ -2141,7 +2169,7 @@ extern int kill_pid_info_as_uid(int, struct siginfo *, struct pid *, uid_t, uid_
2141extern int kill_pgrp(struct pid *pid, int sig, int priv); 2169extern int kill_pgrp(struct pid *pid, int sig, int priv);
2142extern int kill_pid(struct pid *pid, int sig, int priv); 2170extern int kill_pid(struct pid *pid, int sig, int priv);
2143extern int kill_proc_info(int, struct siginfo *, pid_t); 2171extern int kill_proc_info(int, struct siginfo *, pid_t);
2144extern int do_notify_parent(struct task_struct *, int); 2172extern __must_check bool do_notify_parent(struct task_struct *, int);
2145extern void __wake_up_parent(struct task_struct *p, struct task_struct *parent); 2173extern void __wake_up_parent(struct task_struct *p, struct task_struct *parent);
2146extern void force_sig(int, struct task_struct *); 2174extern void force_sig(int, struct task_struct *);
2147extern int send_sig(int, struct task_struct *, int); 2175extern int send_sig(int, struct task_struct *, int);
@@ -2265,8 +2293,10 @@ static inline int get_nr_threads(struct task_struct *tsk)
2265 return tsk->signal->nr_threads; 2293 return tsk->signal->nr_threads;
2266} 2294}
2267 2295
2268/* de_thread depends on thread_group_leader not being a pid based check */ 2296static inline bool thread_group_leader(struct task_struct *p)
2269#define thread_group_leader(p) (p == p->group_leader) 2297{
2298 return p->exit_signal >= 0;
2299}
2270 2300
2271/* Do to the insanities of de_thread it is possible for a process 2301/* Do to the insanities of de_thread it is possible for a process
2272 * to have the pid of the thread group leader without actually being 2302 * to have the pid of the thread group leader without actually being
@@ -2299,11 +2329,6 @@ static inline int thread_group_empty(struct task_struct *p)
2299#define delay_group_leader(p) \ 2329#define delay_group_leader(p) \
2300 (thread_group_leader(p) && !thread_group_empty(p)) 2330 (thread_group_leader(p) && !thread_group_empty(p))
2301 2331
2302static inline int task_detached(struct task_struct *p)
2303{
2304 return p->exit_signal == -1;
2305}
2306
2307/* 2332/*
2308 * Protects ->fs, ->files, ->mm, ->group_info, ->comm, keyring 2333 * Protects ->fs, ->files, ->mm, ->group_info, ->comm, keyring
2309 * subscriptions and synchronises with wait4(). Also used in procfs. Also 2334 * subscriptions and synchronises with wait4(). Also used in procfs. Also
@@ -2500,7 +2525,7 @@ extern int _cond_resched(void);
2500 2525
2501extern int __cond_resched_lock(spinlock_t *lock); 2526extern int __cond_resched_lock(spinlock_t *lock);
2502 2527
2503#ifdef CONFIG_PREEMPT 2528#ifdef CONFIG_PREEMPT_COUNT
2504#define PREEMPT_LOCK_OFFSET PREEMPT_OFFSET 2529#define PREEMPT_LOCK_OFFSET PREEMPT_OFFSET
2505#else 2530#else
2506#define PREEMPT_LOCK_OFFSET 0 2531#define PREEMPT_LOCK_OFFSET 0
diff --git a/include/linux/sdla.h b/include/linux/sdla.h
index 564acd3a71c1..9995c7fc3f60 100644
--- a/include/linux/sdla.h
+++ b/include/linux/sdla.h
@@ -112,11 +112,7 @@ struct sdla_dlci_conf {
112 short Tb_max; 112 short Tb_max;
113}; 113};
114 114
115#ifndef __KERNEL__ 115#ifdef __KERNEL__
116
117void sdla(void *cfg_info, char *dev, struct frad_conf *conf, int quiet);
118
119#else
120 116
121/* important Z80 window addresses */ 117/* important Z80 window addresses */
122#define SDLA_CONTROL_WND 0xE000 118#define SDLA_CONTROL_WND 0xE000
diff --git a/include/linux/seccomp.h b/include/linux/seccomp.h
index 167c33361d9c..cc7a4e9cc7ad 100644
--- a/include/linux/seccomp.h
+++ b/include/linux/seccomp.h
@@ -19,6 +19,11 @@ static inline void secure_computing(int this_syscall)
19extern long prctl_get_seccomp(void); 19extern long prctl_get_seccomp(void);
20extern long prctl_set_seccomp(unsigned long); 20extern long prctl_set_seccomp(unsigned long);
21 21
22static inline int seccomp_mode(seccomp_t *s)
23{
24 return s->mode;
25}
26
22#else /* CONFIG_SECCOMP */ 27#else /* CONFIG_SECCOMP */
23 28
24#include <linux/errno.h> 29#include <linux/errno.h>
@@ -37,6 +42,11 @@ static inline long prctl_set_seccomp(unsigned long arg2)
37 return -EINVAL; 42 return -EINVAL;
38} 43}
39 44
45static inline int seccomp_mode(seccomp_t *s)
46{
47 return 0;
48}
49
40#endif /* CONFIG_SECCOMP */ 50#endif /* CONFIG_SECCOMP */
41 51
42#endif /* _LINUX_SECCOMP_H */ 52#endif /* _LINUX_SECCOMP_H */
diff --git a/include/linux/security.h b/include/linux/security.h
index 8ce59ef3e5af..ebd2a53a3d07 100644
--- a/include/linux/security.h
+++ b/include/linux/security.h
@@ -1456,7 +1456,7 @@ struct security_operations {
1456 struct inode *new_dir, struct dentry *new_dentry); 1456 struct inode *new_dir, struct dentry *new_dentry);
1457 int (*inode_readlink) (struct dentry *dentry); 1457 int (*inode_readlink) (struct dentry *dentry);
1458 int (*inode_follow_link) (struct dentry *dentry, struct nameidata *nd); 1458 int (*inode_follow_link) (struct dentry *dentry, struct nameidata *nd);
1459 int (*inode_permission) (struct inode *inode, int mask, unsigned flags); 1459 int (*inode_permission) (struct inode *inode, int mask);
1460 int (*inode_setattr) (struct dentry *dentry, struct iattr *attr); 1460 int (*inode_setattr) (struct dentry *dentry, struct iattr *attr);
1461 int (*inode_getattr) (struct vfsmount *mnt, struct dentry *dentry); 1461 int (*inode_getattr) (struct vfsmount *mnt, struct dentry *dentry);
1462 int (*inode_setxattr) (struct dentry *dentry, const char *name, 1462 int (*inode_setxattr) (struct dentry *dentry, const char *name,
@@ -1720,7 +1720,6 @@ int security_inode_rename(struct inode *old_dir, struct dentry *old_dentry,
1720int security_inode_readlink(struct dentry *dentry); 1720int security_inode_readlink(struct dentry *dentry);
1721int security_inode_follow_link(struct dentry *dentry, struct nameidata *nd); 1721int security_inode_follow_link(struct dentry *dentry, struct nameidata *nd);
1722int security_inode_permission(struct inode *inode, int mask); 1722int security_inode_permission(struct inode *inode, int mask);
1723int security_inode_exec_permission(struct inode *inode, unsigned int flags);
1724int security_inode_setattr(struct dentry *dentry, struct iattr *attr); 1723int security_inode_setattr(struct dentry *dentry, struct iattr *attr);
1725int security_inode_getattr(struct vfsmount *mnt, struct dentry *dentry); 1724int security_inode_getattr(struct vfsmount *mnt, struct dentry *dentry);
1726int security_inode_setxattr(struct dentry *dentry, const char *name, 1725int security_inode_setxattr(struct dentry *dentry, const char *name,
@@ -2113,12 +2112,6 @@ static inline int security_inode_permission(struct inode *inode, int mask)
2113 return 0; 2112 return 0;
2114} 2113}
2115 2114
2116static inline int security_inode_exec_permission(struct inode *inode,
2117 unsigned int flags)
2118{
2119 return 0;
2120}
2121
2122static inline int security_inode_setattr(struct dentry *dentry, 2115static inline int security_inode_setattr(struct dentry *dentry,
2123 struct iattr *attr) 2116 struct iattr *attr)
2124{ 2117{
diff --git a/include/linux/seq_file.h b/include/linux/seq_file.h
index 03c0232b4169..be720cd2038d 100644
--- a/include/linux/seq_file.h
+++ b/include/linux/seq_file.h
@@ -23,6 +23,7 @@ struct seq_file {
23 u64 version; 23 u64 version;
24 struct mutex lock; 24 struct mutex lock;
25 const struct seq_operations *op; 25 const struct seq_operations *op;
26 int poll_event;
26 void *private; 27 void *private;
27}; 28};
28 29
diff --git a/include/linux/seqlock.h b/include/linux/seqlock.h
index e9811892844f..c6db9fb33c44 100644
--- a/include/linux/seqlock.h
+++ b/include/linux/seqlock.h
@@ -28,6 +28,7 @@
28 28
29#include <linux/spinlock.h> 29#include <linux/spinlock.h>
30#include <linux/preempt.h> 30#include <linux/preempt.h>
31#include <asm/processor.h>
31 32
32typedef struct { 33typedef struct {
33 unsigned sequence; 34 unsigned sequence;
diff --git a/include/linux/shmem_fs.h b/include/linux/shmem_fs.h
index 2b7fec840517..aa08fa8fd79b 100644
--- a/include/linux/shmem_fs.h
+++ b/include/linux/shmem_fs.h
@@ -3,6 +3,7 @@
3 3
4#include <linux/swap.h> 4#include <linux/swap.h>
5#include <linux/mempolicy.h> 5#include <linux/mempolicy.h>
6#include <linux/pagemap.h>
6#include <linux/percpu_counter.h> 7#include <linux/percpu_counter.h>
7 8
8/* inode in-kernel data */ 9/* inode in-kernel data */
@@ -45,7 +46,27 @@ static inline struct shmem_inode_info *SHMEM_I(struct inode *inode)
45 return container_of(inode, struct shmem_inode_info, vfs_inode); 46 return container_of(inode, struct shmem_inode_info, vfs_inode);
46} 47}
47 48
49/*
50 * Functions in mm/shmem.c called directly from elsewhere:
51 */
48extern int init_tmpfs(void); 52extern int init_tmpfs(void);
49extern int shmem_fill_super(struct super_block *sb, void *data, int silent); 53extern int shmem_fill_super(struct super_block *sb, void *data, int silent);
54extern struct file *shmem_file_setup(const char *name,
55 loff_t size, unsigned long flags);
56extern int shmem_zero_setup(struct vm_area_struct *);
57extern int shmem_lock(struct file *file, int lock, struct user_struct *user);
58extern struct page *shmem_read_mapping_page_gfp(struct address_space *mapping,
59 pgoff_t index, gfp_t gfp_mask);
60extern void shmem_truncate_range(struct inode *inode, loff_t start, loff_t end);
61extern 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
65static inline struct page *shmem_read_mapping_page(
66 struct address_space *mapping, pgoff_t index)
67{
68 return shmem_read_mapping_page_gfp(mapping, index,
69 mapping_gfp_mask(mapping));
70}
50 71
51#endif 72#endif
diff --git a/include/linux/shrinker.h b/include/linux/shrinker.h
new file mode 100644
index 000000000000..790651b4e5ba
--- /dev/null
+++ b/include/linux/shrinker.h
@@ -0,0 +1,42 @@
1#ifndef _LINUX_SHRINKER_H
2#define _LINUX_SHRINKER_H
3
4/*
5 * This struct is used to pass information from page reclaim to the shrinkers.
6 * We consolidate the values for easier extention later.
7 */
8struct shrink_control {
9 gfp_t gfp_mask;
10
11 /* How many slab objects shrinker() should scan and try to reclaim */
12 unsigned long nr_to_scan;
13};
14
15/*
16 * A callback you can register to apply pressure to ageable caches.
17 *
18 * 'sc' is passed shrink_control which includes a count 'nr_to_scan'
19 * and a 'gfpmask'. It should look through the least-recently-used
20 * 'nr_to_scan' entries and attempt to free them up. It should return
21 * the number of objects which remain in the cache. If it returns -1, it means
22 * it cannot do any scanning at this time (eg. there is a risk of deadlock).
23 *
24 * The 'gfpmask' refers to the allocation we are currently trying to
25 * fulfil.
26 *
27 * Note that 'shrink' will be passed nr_to_scan == 0 when the VM is
28 * querying the cache size, so a fastpath for that case is appropriate.
29 */
30struct shrinker {
31 int (*shrink)(struct shrinker *, struct shrink_control *sc);
32 int seeks; /* seeks to recreate an obj */
33 long batch; /* reclaim batch size, 0 = default */
34
35 /* These are for internal use */
36 struct list_head list;
37 long nr; /* objs pending delete */
38};
39#define DEFAULT_SEEKS 2 /* A good number if you don't know better. */
40extern void register_shrinker(struct shrinker *);
41extern void unregister_shrinker(struct shrinker *);
42#endif
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
index e8b78ce14474..a24218c9c84b 100644
--- a/include/linux/skbuff.h
+++ b/include/linux/skbuff.h
@@ -187,6 +187,20 @@ enum {
187 187
188 /* ensure the originating sk reference is available on driver level */ 188 /* ensure the originating sk reference is available on driver level */
189 SKBTX_DRV_NEEDS_SK_REF = 1 << 3, 189 SKBTX_DRV_NEEDS_SK_REF = 1 << 3,
190
191 /* device driver supports TX zero-copy buffers */
192 SKBTX_DEV_ZEROCOPY = 1 << 4,
193};
194
195/*
196 * The callback notifies userspace to release buffers when skb DMA is done in
197 * lower device, the skb last reference should be 0 when calling this.
198 * The desc is used to track userspace buffer index.
199 */
200struct ubuf_info {
201 void (*callback)(void *);
202 void *arg;
203 unsigned long desc;
190}; 204};
191 205
192/* This data is invariant across clones and lives at 206/* This data is invariant across clones and lives at
@@ -211,6 +225,7 @@ struct skb_shared_info {
211 /* Intermediate layers must ensure that destructor_arg 225 /* Intermediate layers must ensure that destructor_arg
212 * remains valid until skb destructor */ 226 * remains valid until skb destructor */
213 void * destructor_arg; 227 void * destructor_arg;
228
214 /* must be last field, see pskb_expand_head() */ 229 /* must be last field, see pskb_expand_head() */
215 skb_frag_t frags[MAX_SKB_FRAGS]; 230 skb_frag_t frags[MAX_SKB_FRAGS];
216}; 231};
@@ -270,15 +285,12 @@ typedef unsigned char *sk_buff_data_t;
270 * struct sk_buff - socket buffer 285 * struct sk_buff - socket buffer
271 * @next: Next buffer in list 286 * @next: Next buffer in list
272 * @prev: Previous buffer in list 287 * @prev: Previous buffer in list
273 * @sk: Socket we are owned by
274 * @tstamp: Time we arrived 288 * @tstamp: Time we arrived
289 * @sk: Socket we are owned by
275 * @dev: Device we arrived on/are leaving by 290 * @dev: Device we arrived on/are leaving by
276 * @transport_header: Transport layer header 291 * @cb: Control buffer. Free for use by every layer. Put private vars here
277 * @network_header: Network layer header
278 * @mac_header: Link layer header
279 * @_skb_refdst: destination entry (with norefcount bit) 292 * @_skb_refdst: destination entry (with norefcount bit)
280 * @sp: the security path, used for xfrm 293 * @sp: the security path, used for xfrm
281 * @cb: Control buffer. Free for use by every layer. Put private vars here
282 * @len: Length of actual data 294 * @len: Length of actual data
283 * @data_len: Data length 295 * @data_len: Data length
284 * @mac_len: Length of link layer header 296 * @mac_len: Length of link layer header
@@ -286,40 +298,45 @@ typedef unsigned char *sk_buff_data_t;
286 * @csum: Checksum (must include start/offset pair) 298 * @csum: Checksum (must include start/offset pair)
287 * @csum_start: Offset from skb->head where checksumming should start 299 * @csum_start: Offset from skb->head where checksumming should start
288 * @csum_offset: Offset from csum_start where checksum should be stored 300 * @csum_offset: Offset from csum_start where checksum should be stored
301 * @priority: Packet queueing priority
289 * @local_df: allow local fragmentation 302 * @local_df: allow local fragmentation
290 * @cloned: Head may be cloned (check refcnt to be sure) 303 * @cloned: Head may be cloned (check refcnt to be sure)
304 * @ip_summed: Driver fed us an IP checksum
291 * @nohdr: Payload reference only, must not modify header 305 * @nohdr: Payload reference only, must not modify header
306 * @nfctinfo: Relationship of this skb to the connection
292 * @pkt_type: Packet class 307 * @pkt_type: Packet class
293 * @fclone: skbuff clone status 308 * @fclone: skbuff clone status
294 * @ip_summed: Driver fed us an IP checksum
295 * @priority: Packet queueing priority
296 * @users: User count - see {datagram,tcp}.c
297 * @protocol: Packet protocol from driver
298 * @truesize: Buffer size
299 * @head: Head of buffer
300 * @data: Data head pointer
301 * @tail: Tail pointer
302 * @end: End pointer
303 * @destructor: Destruct function
304 * @mark: Generic packet mark
305 * @nfct: Associated connection, if any
306 * @ipvs_property: skbuff is owned by ipvs 309 * @ipvs_property: skbuff is owned by ipvs
307 * @peeked: this packet has been seen already, so stats have been 310 * @peeked: this packet has been seen already, so stats have been
308 * done for it, don't do them again 311 * done for it, don't do them again
309 * @nf_trace: netfilter packet trace flag 312 * @nf_trace: netfilter packet trace flag
310 * @nfctinfo: Relationship of this skb to the connection 313 * @protocol: Packet protocol from driver
314 * @destructor: Destruct function
315 * @nfct: Associated connection, if any
311 * @nfct_reasm: netfilter conntrack re-assembly pointer 316 * @nfct_reasm: netfilter conntrack re-assembly pointer
312 * @nf_bridge: Saved data about a bridged frame - see br_netfilter.c 317 * @nf_bridge: Saved data about a bridged frame - see br_netfilter.c
313 * @skb_iif: ifindex of device we arrived on 318 * @skb_iif: ifindex of device we arrived on
314 * @rxhash: the packet hash computed on receive
315 * @queue_mapping: Queue mapping for multiqueue devices
316 * @tc_index: Traffic control index 319 * @tc_index: Traffic control index
317 * @tc_verd: traffic control verdict 320 * @tc_verd: traffic control verdict
321 * @rxhash: the packet hash computed on receive
322 * @queue_mapping: Queue mapping for multiqueue devices
318 * @ndisc_nodetype: router type (from link layer) 323 * @ndisc_nodetype: router type (from link layer)
324 * @ooo_okay: allow the mapping of a socket to a queue to be changed
319 * @dma_cookie: a cookie to one of several possible DMA operations 325 * @dma_cookie: a cookie to one of several possible DMA operations
320 * done by skb DMA functions 326 * done by skb DMA functions
321 * @secmark: security marking 327 * @secmark: security marking
328 * @mark: Generic packet mark
329 * @dropcount: total number of sk_receive_queue overflows
322 * @vlan_tci: vlan tag control information 330 * @vlan_tci: vlan tag control information
331 * @transport_header: Transport layer header
332 * @network_header: Network layer header
333 * @mac_header: Link layer header
334 * @tail: Tail pointer
335 * @end: End pointer
336 * @head: Head of buffer
337 * @data: Data head pointer
338 * @truesize: Buffer size
339 * @users: User count - see {datagram,tcp}.c
323 */ 340 */
324 341
325struct sk_buff { 342struct sk_buff {
@@ -1256,6 +1273,11 @@ static inline void skb_reserve(struct sk_buff *skb, int len)
1256 skb->tail += len; 1273 skb->tail += len;
1257} 1274}
1258 1275
1276static inline void skb_reset_mac_len(struct sk_buff *skb)
1277{
1278 skb->mac_len = skb->network_header - skb->mac_header;
1279}
1280
1259#ifdef NET_SKBUFF_DATA_USES_OFFSET 1281#ifdef NET_SKBUFF_DATA_USES_OFFSET
1260static inline unsigned char *skb_transport_header(const struct sk_buff *skb) 1282static inline unsigned char *skb_transport_header(const struct sk_buff *skb)
1261{ 1283{
@@ -1557,16 +1579,22 @@ static inline struct sk_buff *netdev_alloc_skb(struct net_device *dev,
1557 return __netdev_alloc_skb(dev, length, GFP_ATOMIC); 1579 return __netdev_alloc_skb(dev, length, GFP_ATOMIC);
1558} 1580}
1559 1581
1560static inline struct sk_buff *netdev_alloc_skb_ip_align(struct net_device *dev, 1582static inline struct sk_buff *__netdev_alloc_skb_ip_align(struct net_device *dev,
1561 unsigned int length) 1583 unsigned int length, gfp_t gfp)
1562{ 1584{
1563 struct sk_buff *skb = netdev_alloc_skb(dev, length + NET_IP_ALIGN); 1585 struct sk_buff *skb = __netdev_alloc_skb(dev, length + NET_IP_ALIGN, gfp);
1564 1586
1565 if (NET_IP_ALIGN && skb) 1587 if (NET_IP_ALIGN && skb)
1566 skb_reserve(skb, NET_IP_ALIGN); 1588 skb_reserve(skb, NET_IP_ALIGN);
1567 return skb; 1589 return skb;
1568} 1590}
1569 1591
1592static inline struct sk_buff *netdev_alloc_skb_ip_align(struct net_device *dev,
1593 unsigned int length)
1594{
1595 return __netdev_alloc_skb_ip_align(dev, length, GFP_ATOMIC);
1596}
1597
1570/** 1598/**
1571 * __netdev_alloc_page - allocate a page for ps-rx on a specific device 1599 * __netdev_alloc_page - allocate a page for ps-rx on a specific device
1572 * @dev: network device to receive on 1600 * @dev: network device to receive on
@@ -2023,8 +2051,7 @@ static inline void sw_tx_timestamp(struct sk_buff *skb)
2023 * skb_tx_timestamp() - Driver hook for transmit timestamping 2051 * skb_tx_timestamp() - Driver hook for transmit timestamping
2024 * 2052 *
2025 * Ethernet MAC Drivers should call this function in their hard_xmit() 2053 * Ethernet MAC Drivers should call this function in their hard_xmit()
2026 * function as soon as possible after giving the sk_buff to the MAC 2054 * function immediately before giving the sk_buff to the MAC hardware.
2027 * hardware, but before freeing the sk_buff.
2028 * 2055 *
2029 * @skb: A socket buffer. 2056 * @skb: A socket buffer.
2030 */ 2057 */
@@ -2261,5 +2288,6 @@ static inline void skb_checksum_none_assert(struct sk_buff *skb)
2261} 2288}
2262 2289
2263bool skb_partial_csum_set(struct sk_buff *skb, u16 start, u16 off); 2290bool skb_partial_csum_set(struct sk_buff *skb, u16 start, u16 off);
2291
2264#endif /* __KERNEL__ */ 2292#endif /* __KERNEL__ */
2265#endif /* _LINUX_SKBUFF_H */ 2293#endif /* _LINUX_SKBUFF_H */
diff --git a/include/linux/slab.h b/include/linux/slab.h
index ad4dd1c8d30a..573c809c33d9 100644
--- a/include/linux/slab.h
+++ b/include/linux/slab.h
@@ -134,6 +134,26 @@ unsigned int kmem_cache_size(struct kmem_cache *);
134#define KMALLOC_MAX_ORDER (KMALLOC_SHIFT_HIGH - PAGE_SHIFT) 134#define KMALLOC_MAX_ORDER (KMALLOC_SHIFT_HIGH - PAGE_SHIFT)
135 135
136/* 136/*
137 * Some archs want to perform DMA into kmalloc caches and need a guaranteed
138 * alignment larger than the alignment of a 64-bit integer.
139 * Setting ARCH_KMALLOC_MINALIGN in arch headers allows that.
140 */
141#ifdef ARCH_DMA_MINALIGN
142#define ARCH_KMALLOC_MINALIGN ARCH_DMA_MINALIGN
143#else
144#define ARCH_KMALLOC_MINALIGN __alignof__(unsigned long long)
145#endif
146
147/*
148 * Setting ARCH_SLAB_MINALIGN in arch headers allows a different alignment.
149 * Intended for arches that get misalignment faults even for 64 bit integer
150 * aligned buffers.
151 */
152#ifndef ARCH_SLAB_MINALIGN
153#define ARCH_SLAB_MINALIGN __alignof__(unsigned long long)
154#endif
155
156/*
137 * Common kmalloc functions provided by all allocators 157 * Common kmalloc functions provided by all allocators
138 */ 158 */
139void * __must_check __krealloc(const void *, size_t, gfp_t); 159void * __must_check __krealloc(const void *, size_t, gfp_t);
diff --git a/include/linux/slab_def.h b/include/linux/slab_def.h
index 83203ae9390b..d00e0bacda93 100644
--- a/include/linux/slab_def.h
+++ b/include/linux/slab_def.h
@@ -18,53 +18,25 @@
18#include <trace/events/kmem.h> 18#include <trace/events/kmem.h>
19 19
20/* 20/*
21 * Enforce a minimum alignment for the kmalloc caches.
22 * Usually, the kmalloc caches are cache_line_size() aligned, except when
23 * DEBUG and FORCED_DEBUG are enabled, then they are BYTES_PER_WORD aligned.
24 * Some archs want to perform DMA into kmalloc caches and need a guaranteed
25 * alignment larger than the alignment of a 64-bit integer.
26 * ARCH_KMALLOC_MINALIGN allows that.
27 * Note that increasing this value may disable some debug features.
28 */
29#ifdef ARCH_DMA_MINALIGN
30#define ARCH_KMALLOC_MINALIGN ARCH_DMA_MINALIGN
31#else
32#define ARCH_KMALLOC_MINALIGN __alignof__(unsigned long long)
33#endif
34
35#ifndef ARCH_SLAB_MINALIGN
36/*
37 * Enforce a minimum alignment for all caches.
38 * Intended for archs that get misalignment faults even for BYTES_PER_WORD
39 * aligned buffers. Includes ARCH_KMALLOC_MINALIGN.
40 * If possible: Do not enable this flag for CONFIG_DEBUG_SLAB, it disables
41 * some debug features.
42 */
43#define ARCH_SLAB_MINALIGN 0
44#endif
45
46/*
47 * struct kmem_cache 21 * struct kmem_cache
48 * 22 *
49 * manages a cache. 23 * manages a cache.
50 */ 24 */
51 25
52struct kmem_cache { 26struct kmem_cache {
53/* 1) per-cpu data, touched during every alloc/free */ 27/* 1) Cache tunables. Protected by cache_chain_mutex */
54 struct array_cache *array[NR_CPUS];
55/* 2) Cache tunables. Protected by cache_chain_mutex */
56 unsigned int batchcount; 28 unsigned int batchcount;
57 unsigned int limit; 29 unsigned int limit;
58 unsigned int shared; 30 unsigned int shared;
59 31
60 unsigned int buffer_size; 32 unsigned int buffer_size;
61 u32 reciprocal_buffer_size; 33 u32 reciprocal_buffer_size;
62/* 3) touched by every alloc & free from the backend */ 34/* 2) touched by every alloc & free from the backend */
63 35
64 unsigned int flags; /* constant flags */ 36 unsigned int flags; /* constant flags */
65 unsigned int num; /* # of objs per slab */ 37 unsigned int num; /* # of objs per slab */
66 38
67/* 4) cache_grow/shrink */ 39/* 3) cache_grow/shrink */
68 /* order of pgs per slab (2^n) */ 40 /* order of pgs per slab (2^n) */
69 unsigned int gfporder; 41 unsigned int gfporder;
70 42
@@ -80,11 +52,11 @@ struct kmem_cache {
80 /* constructor func */ 52 /* constructor func */
81 void (*ctor)(void *obj); 53 void (*ctor)(void *obj);
82 54
83/* 5) cache creation/removal */ 55/* 4) cache creation/removal */
84 const char *name; 56 const char *name;
85 struct list_head next; 57 struct list_head next;
86 58
87/* 6) statistics */ 59/* 5) statistics */
88#ifdef CONFIG_DEBUG_SLAB 60#ifdef CONFIG_DEBUG_SLAB
89 unsigned long num_active; 61 unsigned long num_active;
90 unsigned long num_allocations; 62 unsigned long num_allocations;
@@ -111,16 +83,18 @@ struct kmem_cache {
111 int obj_size; 83 int obj_size;
112#endif /* CONFIG_DEBUG_SLAB */ 84#endif /* CONFIG_DEBUG_SLAB */
113 85
86/* 6) per-cpu/per-node data, touched during every alloc/free */
114 /* 87 /*
115 * We put nodelists[] at the end of kmem_cache, because we want to size 88 * We put array[] at the end of kmem_cache, because we want to size
116 * this array to nr_node_ids slots instead of MAX_NUMNODES 89 * this array to nr_cpu_ids slots instead of NR_CPUS
117 * (see kmem_cache_init()) 90 * (see kmem_cache_init())
118 * We still use [MAX_NUMNODES] and not [1] or [0] because cache_cache 91 * We still use [NR_CPUS] and not [1] or [0] because cache_cache
119 * is statically defined, so we reserve the max number of nodes. 92 * is statically defined, so we reserve the max number of cpus.
120 */ 93 */
121 struct kmem_list3 *nodelists[MAX_NUMNODES]; 94 struct kmem_list3 **nodelists;
95 struct array_cache *array[NR_CPUS];
122 /* 96 /*
123 * Do not add fields after nodelists[] 97 * Do not add fields after array[]
124 */ 98 */
125}; 99};
126 100
diff --git a/include/linux/slob_def.h b/include/linux/slob_def.h
index 4382db09df4f..0ec00b39d006 100644
--- a/include/linux/slob_def.h
+++ b/include/linux/slob_def.h
@@ -1,16 +1,6 @@
1#ifndef __LINUX_SLOB_DEF_H 1#ifndef __LINUX_SLOB_DEF_H
2#define __LINUX_SLOB_DEF_H 2#define __LINUX_SLOB_DEF_H
3 3
4#ifdef ARCH_DMA_MINALIGN
5#define ARCH_KMALLOC_MINALIGN ARCH_DMA_MINALIGN
6#else
7#define ARCH_KMALLOC_MINALIGN __alignof__(unsigned long)
8#endif
9
10#ifndef ARCH_SLAB_MINALIGN
11#define ARCH_SLAB_MINALIGN __alignof__(unsigned long)
12#endif
13
14void *kmem_cache_alloc_node(struct kmem_cache *, gfp_t flags, int node); 4void *kmem_cache_alloc_node(struct kmem_cache *, gfp_t flags, int node);
15 5
16static __always_inline void *kmem_cache_alloc(struct kmem_cache *cachep, 6static __always_inline void *kmem_cache_alloc(struct kmem_cache *cachep,
diff --git a/include/linux/slub_def.h b/include/linux/slub_def.h
index c8668d161dd8..4b35c06dfbc5 100644
--- a/include/linux/slub_def.h
+++ b/include/linux/slub_def.h
@@ -113,16 +113,6 @@ struct kmem_cache {
113 113
114#define KMALLOC_SHIFT_LOW ilog2(KMALLOC_MIN_SIZE) 114#define KMALLOC_SHIFT_LOW ilog2(KMALLOC_MIN_SIZE)
115 115
116#ifdef ARCH_DMA_MINALIGN
117#define ARCH_KMALLOC_MINALIGN ARCH_DMA_MINALIGN
118#else
119#define ARCH_KMALLOC_MINALIGN __alignof__(unsigned long long)
120#endif
121
122#ifndef ARCH_SLAB_MINALIGN
123#define ARCH_SLAB_MINALIGN __alignof__(unsigned long long)
124#endif
125
126/* 116/*
127 * Maximum kmalloc object size handled by SLUB. Larger object allocations 117 * Maximum kmalloc object size handled by SLUB. Larger object allocations
128 * are passed through to the page allocator. The page allocator "fastpath" 118 * are passed through to the page allocator. The page allocator "fastpath"
@@ -228,6 +218,19 @@ kmalloc_order(size_t size, gfp_t flags, unsigned int order)
228 return ret; 218 return ret;
229} 219}
230 220
221/**
222 * Calling this on allocated memory will check that the memory
223 * is expected to be in use, and print warnings if not.
224 */
225#ifdef CONFIG_SLUB_DEBUG
226extern bool verify_mem_not_deleted(const void *x);
227#else
228static inline bool verify_mem_not_deleted(const void *x)
229{
230 return true;
231}
232#endif
233
231#ifdef CONFIG_TRACING 234#ifdef CONFIG_TRACING
232extern void * 235extern void *
233kmem_cache_alloc_trace(struct kmem_cache *s, gfp_t gfpflags, size_t size); 236kmem_cache_alloc_trace(struct kmem_cache *s, gfp_t gfpflags, size_t size);
diff --git a/include/linux/smp.h b/include/linux/smp.h
index 7ad824d510a2..8cc38d3bab0c 100644
--- a/include/linux/smp.h
+++ b/include/linux/smp.h
@@ -85,12 +85,15 @@ int smp_call_function_any(const struct cpumask *mask,
85 * Generic and arch helpers 85 * Generic and arch helpers
86 */ 86 */
87#ifdef CONFIG_USE_GENERIC_SMP_HELPERS 87#ifdef CONFIG_USE_GENERIC_SMP_HELPERS
88void __init call_function_init(void);
88void generic_smp_call_function_single_interrupt(void); 89void generic_smp_call_function_single_interrupt(void);
89void generic_smp_call_function_interrupt(void); 90void generic_smp_call_function_interrupt(void);
90void ipi_call_lock(void); 91void ipi_call_lock(void);
91void ipi_call_unlock(void); 92void ipi_call_unlock(void);
92void ipi_call_lock_irq(void); 93void ipi_call_lock_irq(void);
93void ipi_call_unlock_irq(void); 94void ipi_call_unlock_irq(void);
95#else
96static inline void call_function_init(void) { }
94#endif 97#endif
95 98
96/* 99/*
@@ -134,7 +137,7 @@ static inline void smp_send_reschedule(int cpu) { }
134#define smp_prepare_boot_cpu() do {} while (0) 137#define smp_prepare_boot_cpu() do {} while (0)
135#define smp_call_function_many(mask, func, info, wait) \ 138#define smp_call_function_many(mask, func, info, wait) \
136 (up_smp_call_function(func, info)) 139 (up_smp_call_function(func, info))
137static inline void init_call_single_data(void) { } 140static inline void call_function_init(void) { }
138 141
139static inline int 142static inline int
140smp_call_function_any(const struct cpumask *mask, smp_call_func_t func, 143smp_call_function_any(const struct cpumask *mask, smp_call_func_t func,
diff --git a/include/linux/socket.h b/include/linux/socket.h
index 4ef98e422fde..e17f82266639 100644
--- a/include/linux/socket.h
+++ b/include/linux/socket.h
@@ -192,7 +192,8 @@ struct ucred {
192#define AF_IEEE802154 36 /* IEEE802154 sockets */ 192#define AF_IEEE802154 36 /* IEEE802154 sockets */
193#define AF_CAIF 37 /* CAIF sockets */ 193#define AF_CAIF 37 /* CAIF sockets */
194#define AF_ALG 38 /* Algorithm sockets */ 194#define AF_ALG 38 /* Algorithm sockets */
195#define AF_MAX 39 /* For now.. */ 195#define AF_NFC 39 /* NFC sockets */
196#define AF_MAX 40 /* For now.. */
196 197
197/* Protocol families, same as address families. */ 198/* Protocol families, same as address families. */
198#define PF_UNSPEC AF_UNSPEC 199#define PF_UNSPEC AF_UNSPEC
@@ -234,6 +235,7 @@ struct ucred {
234#define PF_IEEE802154 AF_IEEE802154 235#define PF_IEEE802154 AF_IEEE802154
235#define PF_CAIF AF_CAIF 236#define PF_CAIF AF_CAIF
236#define PF_ALG AF_ALG 237#define PF_ALG AF_ALG
238#define PF_NFC AF_NFC
237#define PF_MAX AF_MAX 239#define PF_MAX AF_MAX
238 240
239/* Maximum queue length specifiable by listen. */ 241/* Maximum queue length specifiable by listen. */
diff --git a/include/linux/spi/74x164.h b/include/linux/spi/74x164.h
index d85c52f294a0..0aa6acc73317 100644
--- a/include/linux/spi/74x164.h
+++ b/include/linux/spi/74x164.h
@@ -1,8 +1,6 @@
1#ifndef LINUX_SPI_74X164_H 1#ifndef LINUX_SPI_74X164_H
2#define LINUX_SPI_74X164_H 2#define LINUX_SPI_74X164_H
3 3
4#define GEN_74X164_DRIVER_NAME "74x164"
5
6struct gen_74x164_chip_platform_data { 4struct gen_74x164_chip_platform_data {
7 /* number assigned to the first GPIO */ 5 /* number assigned to the first GPIO */
8 unsigned base; 6 unsigned base;
diff --git a/include/linux/spi/mcp23s08.h b/include/linux/spi/mcp23s08.h
index c42cff8ca191..2d676d5aaa89 100644
--- a/include/linux/spi/mcp23s08.h
+++ b/include/linux/spi/mcp23s08.h
@@ -22,13 +22,4 @@ struct mcp23s08_platform_data {
22 * base to base+15 (or base+31 for s17 variant). 22 * base to base+15 (or base+31 for s17 variant).
23 */ 23 */
24 unsigned base; 24 unsigned base;
25
26 void *context; /* param to setup/teardown */
27
28 int (*setup)(struct spi_device *spi,
29 int gpio, unsigned ngpio,
30 void *context);
31 int (*teardown)(struct spi_device *spi,
32 int gpio, unsigned ngpio,
33 void *context);
34}; 25};
diff --git a/include/linux/splice.h b/include/linux/splice.h
index 997c3b4c212b..26e5b613deda 100644
--- a/include/linux/splice.h
+++ b/include/linux/splice.h
@@ -88,5 +88,7 @@ extern ssize_t splice_direct_to_actor(struct file *, struct splice_desc *,
88extern int splice_grow_spd(struct pipe_inode_info *, struct splice_pipe_desc *); 88extern int splice_grow_spd(struct pipe_inode_info *, struct splice_pipe_desc *);
89extern void splice_shrink_spd(struct pipe_inode_info *, 89extern void splice_shrink_spd(struct pipe_inode_info *,
90 struct splice_pipe_desc *); 90 struct splice_pipe_desc *);
91extern void spd_release_page(struct splice_pipe_desc *, unsigned int);
91 92
93extern const struct pipe_buf_operations page_cache_pipe_buf_ops;
92#endif 94#endif
diff --git a/include/linux/ssb/ssb.h b/include/linux/ssb/ssb.h
index 252e44821787..8623217f84d0 100644
--- a/include/linux/ssb/ssb.h
+++ b/include/linux/ssb/ssb.h
@@ -27,6 +27,8 @@ struct ssb_sprom {
27 u8 et1mdcport; /* MDIO for enet1 */ 27 u8 et1mdcport; /* MDIO for enet1 */
28 u8 board_rev; /* Board revision number from SPROM. */ 28 u8 board_rev; /* Board revision number from SPROM. */
29 u8 country_code; /* Country Code */ 29 u8 country_code; /* Country Code */
30 u16 leddc_on_time; /* LED Powersave Duty Cycle On Count */
31 u16 leddc_off_time; /* LED Powersave Duty Cycle Off Count */
30 u8 ant_available_a; /* 2GHz antenna available bits (up to 4) */ 32 u8 ant_available_a; /* 2GHz antenna available bits (up to 4) */
31 u8 ant_available_bg; /* 5GHz antenna available bits (up to 4) */ 33 u8 ant_available_bg; /* 5GHz antenna available bits (up to 4) */
32 u16 pa0b0; 34 u16 pa0b0;
@@ -99,7 +101,7 @@ struct ssb_sprom {
99struct ssb_boardinfo { 101struct ssb_boardinfo {
100 u16 vendor; 102 u16 vendor;
101 u16 type; 103 u16 type;
102 u16 rev; 104 u8 rev;
103}; 105};
104 106
105 107
diff --git a/include/linux/ssb/ssb_driver_chipcommon.h b/include/linux/ssb/ssb_driver_chipcommon.h
index a08d693d8324..1a6b0045b06b 100644
--- a/include/linux/ssb/ssb_driver_chipcommon.h
+++ b/include/linux/ssb/ssb_driver_chipcommon.h
@@ -8,7 +8,7 @@
8 * gpio interface, extbus, and support for serial and parallel flashes. 8 * gpio interface, extbus, and support for serial and parallel flashes.
9 * 9 *
10 * Copyright 2005, Broadcom Corporation 10 * Copyright 2005, Broadcom Corporation
11 * Copyright 2006, Michael Buesch <mb@bu3sch.de> 11 * Copyright 2006, Michael Buesch <m@bues.ch>
12 * 12 *
13 * Licensed under the GPL version 2. See COPYING for details. 13 * Licensed under the GPL version 2. See COPYING for details.
14 */ 14 */
diff --git a/include/linux/stacktrace.h b/include/linux/stacktrace.h
index 25310f1d7f37..115b570e3bff 100644
--- a/include/linux/stacktrace.h
+++ b/include/linux/stacktrace.h
@@ -14,8 +14,8 @@ struct stack_trace {
14}; 14};
15 15
16extern void save_stack_trace(struct stack_trace *trace); 16extern void save_stack_trace(struct stack_trace *trace);
17extern void save_stack_trace_regs(struct stack_trace *trace, 17extern void save_stack_trace_regs(struct pt_regs *regs,
18 struct pt_regs *regs); 18 struct stack_trace *trace);
19extern void save_stack_trace_tsk(struct task_struct *tsk, 19extern void save_stack_trace_tsk(struct task_struct *tsk,
20 struct stack_trace *trace); 20 struct stack_trace *trace);
21 21
diff --git a/include/linux/stmmac.h b/include/linux/stmmac.h
index 9529e49b0385..0dddc9e42b6b 100644
--- a/include/linux/stmmac.h
+++ b/include/linux/stmmac.h
@@ -28,11 +28,21 @@
28 28
29#include <linux/platform_device.h> 29#include <linux/platform_device.h>
30 30
31/* platform data for platform device structure's platform_data field */ 31/* Platfrom data for platform device structure's platform_data field */
32
33struct stmmac_mdio_bus_data {
34 int bus_id;
35 int (*phy_reset)(void *priv);
36 unsigned int phy_mask;
37 int *irqs;
38 int probed_phy_irq;
39};
32 40
33/* Private data for the STM on-board ethernet driver */
34struct plat_stmmacenet_data { 41struct plat_stmmacenet_data {
35 int bus_id; 42 int bus_id;
43 int phy_addr;
44 int interface;
45 struct stmmac_mdio_bus_data *mdio_bus_data;
36 int pbl; 46 int pbl;
37 int clk_csr; 47 int clk_csr;
38 int has_gmac; 48 int has_gmac;
@@ -40,6 +50,7 @@ struct plat_stmmacenet_data {
40 int tx_coe; 50 int tx_coe;
41 int bugged_jumbo; 51 int bugged_jumbo;
42 int pmt; 52 int pmt;
53 int force_sf_dma_mode;
43 void (*fix_mac_speed)(void *priv, unsigned int speed); 54 void (*fix_mac_speed)(void *priv, unsigned int speed);
44 void (*bus_setup)(void __iomem *ioaddr); 55 void (*bus_setup)(void __iomem *ioaddr);
45 int (*init)(struct platform_device *pdev); 56 int (*init)(struct platform_device *pdev);
@@ -47,14 +58,4 @@ struct plat_stmmacenet_data {
47 void *custom_cfg; 58 void *custom_cfg;
48 void *bsp_priv; 59 void *bsp_priv;
49}; 60};
50
51struct plat_stmmacphy_data {
52 int bus_id;
53 int phy_addr;
54 unsigned int phy_mask;
55 int interface;
56 int (*phy_reset)(void *priv);
57 void *priv;
58};
59#endif 61#endif
60
diff --git a/include/linux/stop_machine.h b/include/linux/stop_machine.h
index 092dc9b1ce7d..2d04ea916760 100644
--- a/include/linux/stop_machine.h
+++ b/include/linux/stop_machine.h
@@ -94,7 +94,7 @@ static inline int try_stop_cpus(const struct cpumask *cpumask,
94 * stop_machine "Bogolock": stop the entire machine, disable 94 * stop_machine "Bogolock": stop the entire machine, disable
95 * interrupts. This is a very heavy lock, which is equivalent to 95 * interrupts. This is a very heavy lock, which is equivalent to
96 * grabbing every spinlock (and more). So the "read" side to such a 96 * grabbing every spinlock (and more). So the "read" side to such a
97 * lock is anything which disables preeempt. 97 * lock is anything which disables preemption.
98 */ 98 */
99#if defined(CONFIG_STOP_MACHINE) && defined(CONFIG_SMP) 99#if defined(CONFIG_STOP_MACHINE) && defined(CONFIG_SMP)
100 100
@@ -124,15 +124,19 @@ int stop_machine(int (*fn)(void *), void *data, const struct cpumask *cpus);
124 */ 124 */
125int __stop_machine(int (*fn)(void *), void *data, const struct cpumask *cpus); 125int __stop_machine(int (*fn)(void *), void *data, const struct cpumask *cpus);
126 126
127int stop_machine_from_inactive_cpu(int (*fn)(void *), void *data,
128 const struct cpumask *cpus);
129
127#else /* CONFIG_STOP_MACHINE && CONFIG_SMP */ 130#else /* CONFIG_STOP_MACHINE && CONFIG_SMP */
128 131
129static inline int __stop_machine(int (*fn)(void *), void *data, 132static inline int __stop_machine(int (*fn)(void *), void *data,
130 const struct cpumask *cpus) 133 const struct cpumask *cpus)
131{ 134{
135 unsigned long flags;
132 int ret; 136 int ret;
133 local_irq_disable(); 137 local_irq_save(flags);
134 ret = fn(data); 138 ret = fn(data);
135 local_irq_enable(); 139 local_irq_restore(flags);
136 return ret; 140 return ret;
137} 141}
138 142
@@ -142,5 +146,11 @@ static inline int stop_machine(int (*fn)(void *), void *data,
142 return __stop_machine(fn, data, cpus); 146 return __stop_machine(fn, data, cpus);
143} 147}
144 148
149static inline int stop_machine_from_inactive_cpu(int (*fn)(void *), void *data,
150 const struct cpumask *cpus)
151{
152 return __stop_machine(fn, data, cpus);
153}
154
145#endif /* CONFIG_STOP_MACHINE && CONFIG_SMP */ 155#endif /* CONFIG_STOP_MACHINE && CONFIG_SMP */
146#endif /* _LINUX_STOP_MACHINE */ 156#endif /* _LINUX_STOP_MACHINE */
diff --git a/include/linux/sunrpc/cache.h b/include/linux/sunrpc/cache.h
index 8d2eef1a8582..d1c79a906397 100644
--- a/include/linux/sunrpc/cache.h
+++ b/include/linux/sunrpc/cache.h
@@ -256,13 +256,4 @@ static inline time_t get_expiry(char **bpp)
256 return rv - boot.tv_sec; 256 return rv - boot.tv_sec;
257} 257}
258 258
259#ifdef CONFIG_NFSD_DEPRECATED
260static inline void sunrpc_invalidate(struct cache_head *h,
261 struct cache_detail *detail)
262{
263 h->expiry_time = seconds_since_boot() - 1;
264 detail->nextcheck = seconds_since_boot();
265}
266#endif /* CONFIG_NFSD_DEPRECATED */
267
268#endif /* _LINUX_SUNRPC_CACHE_H_ */ 259#endif /* _LINUX_SUNRPC_CACHE_H_ */
diff --git a/include/linux/sunrpc/gss_krb5_enctypes.h b/include/linux/sunrpc/gss_krb5_enctypes.h
new file mode 100644
index 000000000000..ec6234eee89c
--- /dev/null
+++ b/include/linux/sunrpc/gss_krb5_enctypes.h
@@ -0,0 +1,4 @@
1/*
2 * Dumb way to share this static piece of information with nfsd
3 */
4#define KRB5_SUPPORTED_ENCTYPES "18,17,16,23,3,1,2"
diff --git a/include/linux/sunrpc/sched.h b/include/linux/sunrpc/sched.h
index f73c482ec9c6..fe2d8e6b923b 100644
--- a/include/linux/sunrpc/sched.h
+++ b/include/linux/sunrpc/sched.h
@@ -84,7 +84,8 @@ struct rpc_task {
84#endif 84#endif
85 unsigned char tk_priority : 2,/* Task priority */ 85 unsigned char tk_priority : 2,/* Task priority */
86 tk_garb_retry : 2, 86 tk_garb_retry : 2,
87 tk_cred_retry : 2; 87 tk_cred_retry : 2,
88 tk_rebind_retry : 2;
88}; 89};
89#define tk_xprt tk_client->cl_xprt 90#define tk_xprt tk_client->cl_xprt
90 91
diff --git a/include/linux/sunrpc/svc.h b/include/linux/sunrpc/svc.h
index ea29330b78bd..2f1e5186e049 100644
--- a/include/linux/sunrpc/svc.h
+++ b/include/linux/sunrpc/svc.h
@@ -273,6 +273,7 @@ struct svc_rqst {
273 /* Catering to nfsd */ 273 /* Catering to nfsd */
274 struct auth_domain * rq_client; /* RPC peer info */ 274 struct auth_domain * rq_client; /* RPC peer info */
275 struct auth_domain * rq_gssclient; /* "gss/"-style peer info */ 275 struct auth_domain * rq_gssclient; /* "gss/"-style peer info */
276 int rq_cachetype;
276 struct svc_cacherep * rq_cacherep; /* cache info */ 277 struct svc_cacherep * rq_cacherep; /* cache info */
277 int rq_splice_ok; /* turned off in gss privacy 278 int rq_splice_ok; /* turned off in gss privacy
278 * to prevent encrypting page 279 * to prevent encrypting page
diff --git a/include/linux/suspend.h b/include/linux/suspend.h
index 083ffea7ba18..6bbcef22e105 100644
--- a/include/linux/suspend.h
+++ b/include/linux/suspend.h
@@ -92,6 +92,13 @@ typedef int __bitwise suspend_state_t;
92 * @enter() and @wake(), even if any of them fails. It is executed after 92 * @enter() and @wake(), even if any of them fails. It is executed after
93 * a failing @prepare. 93 * a failing @prepare.
94 * 94 *
95 * @suspend_again: Returns whether the system should suspend again (true) or
96 * not (false). If the platform wants to poll sensors or execute some
97 * code during suspended without invoking userspace and most of devices,
98 * suspend_again callback is the place assuming that periodic-wakeup or
99 * alarm-wakeup is already setup. This allows to execute some codes while
100 * being kept suspended in the view of userland and devices.
101 *
95 * @end: Called by the PM core right after resuming devices, to indicate to 102 * @end: Called by the PM core right after resuming devices, to indicate to
96 * the platform that the system has returned to the working state or 103 * the platform that the system has returned to the working state or
97 * the transition to the sleep state has been aborted. 104 * the transition to the sleep state has been aborted.
@@ -113,6 +120,7 @@ struct platform_suspend_ops {
113 int (*enter)(suspend_state_t state); 120 int (*enter)(suspend_state_t state);
114 void (*wake)(void); 121 void (*wake)(void);
115 void (*finish)(void); 122 void (*finish)(void);
123 bool (*suspend_again)(void);
116 void (*end)(void); 124 void (*end)(void);
117 void (*recover)(void); 125 void (*recover)(void);
118}; 126};
@@ -260,6 +268,14 @@ static inline int hibernate(void) { return -ENOSYS; }
260static inline bool system_entering_hibernation(void) { return false; } 268static inline bool system_entering_hibernation(void) { return false; }
261#endif /* CONFIG_HIBERNATION */ 269#endif /* CONFIG_HIBERNATION */
262 270
271/* Hibernation and suspend events */
272#define PM_HIBERNATION_PREPARE 0x0001 /* Going to hibernate */
273#define PM_POST_HIBERNATION 0x0002 /* Hibernation finished */
274#define PM_SUSPEND_PREPARE 0x0003 /* Going to suspend the system */
275#define PM_POST_SUSPEND 0x0004 /* Suspend finished */
276#define PM_RESTORE_PREPARE 0x0005 /* Going to restore a saved image */
277#define PM_POST_RESTORE 0x0006 /* Restore failed */
278
263#ifdef CONFIG_PM_SLEEP 279#ifdef CONFIG_PM_SLEEP
264void save_processor_state(void); 280void save_processor_state(void);
265void restore_processor_state(void); 281void restore_processor_state(void);
diff --git a/include/linux/swap.h b/include/linux/swap.h
index 384eb5fe530b..a273468f8285 100644
--- a/include/linux/swap.h
+++ b/include/linux/swap.h
@@ -300,16 +300,6 @@ static inline void scan_unevictable_unregister_node(struct node *node)
300extern int kswapd_run(int nid); 300extern int kswapd_run(int nid);
301extern void kswapd_stop(int nid); 301extern void kswapd_stop(int nid);
302 302
303#ifdef CONFIG_MMU
304/* linux/mm/shmem.c */
305extern int shmem_unuse(swp_entry_t entry, struct page *page);
306#endif /* CONFIG_MMU */
307
308#ifdef CONFIG_CGROUP_MEM_RES_CTLR
309extern void mem_cgroup_get_shmem_target(struct inode *inode, pgoff_t pgoff,
310 struct page **pagep, swp_entry_t *ent);
311#endif
312
313#ifdef CONFIG_SWAP 303#ifdef CONFIG_SWAP
314/* linux/mm/page_io.c */ 304/* linux/mm/page_io.c */
315extern int swap_readpage(struct page *); 305extern int swap_readpage(struct page *);
@@ -358,6 +348,7 @@ struct backing_dev_info;
358extern struct mm_struct *swap_token_mm; 348extern struct mm_struct *swap_token_mm;
359extern void grab_swap_token(struct mm_struct *); 349extern void grab_swap_token(struct mm_struct *);
360extern void __put_swap_token(struct mm_struct *); 350extern void __put_swap_token(struct mm_struct *);
351extern void disable_swap_token(struct mem_cgroup *memcg);
361 352
362static inline int has_swap_token(struct mm_struct *mm) 353static inline int has_swap_token(struct mm_struct *mm)
363{ 354{
@@ -370,11 +361,6 @@ static inline void put_swap_token(struct mm_struct *mm)
370 __put_swap_token(mm); 361 __put_swap_token(mm);
371} 362}
372 363
373static inline void disable_swap_token(void)
374{
375 put_swap_token(swap_token_mm);
376}
377
378#ifdef CONFIG_CGROUP_MEM_RES_CTLR 364#ifdef CONFIG_CGROUP_MEM_RES_CTLR
379extern void 365extern void
380mem_cgroup_uncharge_swapcache(struct page *page, swp_entry_t ent, bool swapout); 366mem_cgroup_uncharge_swapcache(struct page *page, swp_entry_t ent, bool swapout);
@@ -500,7 +486,7 @@ static inline int has_swap_token(struct mm_struct *mm)
500 return 0; 486 return 0;
501} 487}
502 488
503static inline void disable_swap_token(void) 489static inline void disable_swap_token(struct mem_cgroup *memcg)
504{ 490{
505} 491}
506 492
diff --git a/include/linux/swiotlb.h b/include/linux/swiotlb.h
index 8c0e349f4a6c..445702c60d04 100644
--- a/include/linux/swiotlb.h
+++ b/include/linux/swiotlb.h
@@ -24,6 +24,7 @@ extern int swiotlb_force;
24 24
25extern void swiotlb_init(int verbose); 25extern void swiotlb_init(int verbose);
26extern void swiotlb_init_with_tbl(char *tlb, unsigned long nslabs, int verbose); 26extern void swiotlb_init_with_tbl(char *tlb, unsigned long nslabs, int verbose);
27extern unsigned long swioltb_nr_tbl(void);
27 28
28/* 29/*
29 * Enumeration for sync targets 30 * Enumeration for sync targets
diff --git a/include/linux/sysfs.h b/include/linux/sysfs.h
index c3acda60eee0..e2696d76a599 100644
--- a/include/linux/sysfs.h
+++ b/include/linux/sysfs.h
@@ -177,9 +177,6 @@ struct sysfs_dirent *sysfs_get_dirent(struct sysfs_dirent *parent_sd,
177struct sysfs_dirent *sysfs_get(struct sysfs_dirent *sd); 177struct sysfs_dirent *sysfs_get(struct sysfs_dirent *sd);
178void sysfs_put(struct sysfs_dirent *sd); 178void sysfs_put(struct sysfs_dirent *sd);
179 179
180/* Called to clear a ns tag when it is no longer valid */
181void sysfs_exit_ns(enum kobj_ns_type type, const void *tag);
182
183int __must_check sysfs_init(void); 180int __must_check sysfs_init(void);
184 181
185#else /* CONFIG_SYSFS */ 182#else /* CONFIG_SYSFS */
@@ -338,10 +335,6 @@ static inline void sysfs_put(struct sysfs_dirent *sd)
338{ 335{
339} 336}
340 337
341static inline void sysfs_exit_ns(int type, const void *tag)
342{
343}
344
345static inline int __must_check sysfs_init(void) 338static inline int __must_check sysfs_init(void)
346{ 339{
347 return 0; 340 return 0;
diff --git a/include/linux/tc_ematch/tc_em_meta.h b/include/linux/tc_ematch/tc_em_meta.h
index 7138962664f8..b11f8ce2d3c0 100644
--- a/include/linux/tc_ematch/tc_em_meta.h
+++ b/include/linux/tc_ematch/tc_em_meta.h
@@ -67,7 +67,7 @@ enum {
67 TCF_META_ID_SK_FORWARD_ALLOCS, 67 TCF_META_ID_SK_FORWARD_ALLOCS,
68 TCF_META_ID_SK_SNDBUF, 68 TCF_META_ID_SK_SNDBUF,
69 TCF_META_ID_SK_ALLOCS, 69 TCF_META_ID_SK_ALLOCS,
70 TCF_META_ID_SK_ROUTE_CAPS, 70 __TCF_META_ID_SK_ROUTE_CAPS, /* unimplemented but in ABI already */
71 TCF_META_ID_SK_HASH, 71 TCF_META_ID_SK_HASH,
72 TCF_META_ID_SK_LINGERTIME, 72 TCF_META_ID_SK_LINGERTIME,
73 TCF_META_ID_SK_ACK_BACKLOG, 73 TCF_META_ID_SK_ACK_BACKLOG,
diff --git a/include/linux/tcp.h b/include/linux/tcp.h
index e64f4c67d0ef..531ede8006d9 100644
--- a/include/linux/tcp.h
+++ b/include/linux/tcp.h
@@ -282,6 +282,7 @@ struct tcp_request_sock {
282#endif 282#endif
283 u32 rcv_isn; 283 u32 rcv_isn;
284 u32 snt_isn; 284 u32 snt_isn;
285 u32 snt_synack; /* synack sent time */
285}; 286};
286 287
287static inline struct tcp_request_sock *tcp_rsk(const struct request_sock *req) 288static inline struct tcp_request_sock *tcp_rsk(const struct request_sock *req)
diff --git a/include/linux/topology.h b/include/linux/topology.h
index b91a40e847d2..fc839bfa7935 100644
--- a/include/linux/topology.h
+++ b/include/linux/topology.h
@@ -60,7 +60,7 @@ int arch_update_cpu_topology(void);
60 * (in whatever arch specific measurement units returned by node_distance()) 60 * (in whatever arch specific measurement units returned by node_distance())
61 * then switch on zone reclaim on boot. 61 * then switch on zone reclaim on boot.
62 */ 62 */
63#define RECLAIM_DISTANCE 20 63#define RECLAIM_DISTANCE 30
64#endif 64#endif
65#ifndef PENALTY_FOR_NODE_WITH_CPUS 65#ifndef PENALTY_FOR_NODE_WITH_CPUS
66#define PENALTY_FOR_NODE_WITH_CPUS (1) 66#define PENALTY_FOR_NODE_WITH_CPUS (1)
diff --git a/include/linux/tracehook.h b/include/linux/tracehook.h
index e95f5236611f..a71a2927a6a0 100644
--- a/include/linux/tracehook.h
+++ b/include/linux/tracehook.h
@@ -51,27 +51,12 @@
51#include <linux/security.h> 51#include <linux/security.h>
52struct linux_binprm; 52struct linux_binprm;
53 53
54/**
55 * tracehook_expect_breakpoints - guess if task memory might be touched
56 * @task: current task, making a new mapping
57 *
58 * Return nonzero if @task is expected to want breakpoint insertion in
59 * its memory at some point. A zero return is no guarantee it won't
60 * be done, but this is a hint that it's known to be likely.
61 *
62 * May be called with @task->mm->mmap_sem held for writing.
63 */
64static inline int tracehook_expect_breakpoints(struct task_struct *task)
65{
66 return (task_ptrace(task) & PT_PTRACED) != 0;
67}
68
69/* 54/*
70 * ptrace report for syscall entry and exit looks identical. 55 * ptrace report for syscall entry and exit looks identical.
71 */ 56 */
72static inline void ptrace_report_syscall(struct pt_regs *regs) 57static inline void ptrace_report_syscall(struct pt_regs *regs)
73{ 58{
74 int ptrace = task_ptrace(current); 59 int ptrace = current->ptrace;
75 60
76 if (!(ptrace & PT_PTRACED)) 61 if (!(ptrace & PT_PTRACED))
77 return; 62 return;
@@ -145,229 +130,6 @@ static inline void tracehook_report_syscall_exit(struct pt_regs *regs, int step)
145} 130}
146 131
147/** 132/**
148 * tracehook_unsafe_exec - check for exec declared unsafe due to tracing
149 * @task: current task doing exec
150 *
151 * Return %LSM_UNSAFE_* bits applied to an exec because of tracing.
152 *
153 * @task->signal->cred_guard_mutex is held by the caller through the do_execve().
154 */
155static inline int tracehook_unsafe_exec(struct task_struct *task)
156{
157 int unsafe = 0;
158 int ptrace = task_ptrace(task);
159 if (ptrace & PT_PTRACED) {
160 if (ptrace & PT_PTRACE_CAP)
161 unsafe |= LSM_UNSAFE_PTRACE_CAP;
162 else
163 unsafe |= LSM_UNSAFE_PTRACE;
164 }
165 return unsafe;
166}
167
168/**
169 * tracehook_tracer_task - return the task that is tracing the given task
170 * @tsk: task to consider
171 *
172 * Returns NULL if no one is tracing @task, or the &struct task_struct
173 * pointer to its tracer.
174 *
175 * Must called under rcu_read_lock(). The pointer returned might be kept
176 * live only by RCU. During exec, this may be called with task_lock()
177 * held on @task, still held from when tracehook_unsafe_exec() was called.
178 */
179static inline struct task_struct *tracehook_tracer_task(struct task_struct *tsk)
180{
181 if (task_ptrace(tsk) & PT_PTRACED)
182 return rcu_dereference(tsk->parent);
183 return NULL;
184}
185
186/**
187 * tracehook_report_exec - a successful exec was completed
188 * @fmt: &struct linux_binfmt that performed the exec
189 * @bprm: &struct linux_binprm containing exec details
190 * @regs: user-mode register state
191 *
192 * An exec just completed, we are shortly going to return to user mode.
193 * The freshly initialized register state can be seen and changed in @regs.
194 * The name, file and other pointers in @bprm are still on hand to be
195 * inspected, but will be freed as soon as this returns.
196 *
197 * Called with no locks, but with some kernel resources held live
198 * and a reference on @fmt->module.
199 */
200static inline void tracehook_report_exec(struct linux_binfmt *fmt,
201 struct linux_binprm *bprm,
202 struct pt_regs *regs)
203{
204 if (!ptrace_event(PT_TRACE_EXEC, PTRACE_EVENT_EXEC, 0) &&
205 unlikely(task_ptrace(current) & PT_PTRACED))
206 send_sig(SIGTRAP, current, 0);
207}
208
209/**
210 * tracehook_report_exit - task has begun to exit
211 * @exit_code: pointer to value destined for @current->exit_code
212 *
213 * @exit_code points to the value passed to do_exit(), which tracing
214 * might change here. This is almost the first thing in do_exit(),
215 * before freeing any resources or setting the %PF_EXITING flag.
216 *
217 * Called with no locks held.
218 */
219static inline void tracehook_report_exit(long *exit_code)
220{
221 ptrace_event(PT_TRACE_EXIT, PTRACE_EVENT_EXIT, *exit_code);
222}
223
224/**
225 * tracehook_prepare_clone - prepare for new child to be cloned
226 * @clone_flags: %CLONE_* flags from clone/fork/vfork system call
227 *
228 * This is called before a new user task is to be cloned.
229 * Its return value will be passed to tracehook_finish_clone().
230 *
231 * Called with no locks held.
232 */
233static inline int tracehook_prepare_clone(unsigned clone_flags)
234{
235 if (clone_flags & CLONE_UNTRACED)
236 return 0;
237
238 if (clone_flags & CLONE_VFORK) {
239 if (current->ptrace & PT_TRACE_VFORK)
240 return PTRACE_EVENT_VFORK;
241 } else if ((clone_flags & CSIGNAL) != SIGCHLD) {
242 if (current->ptrace & PT_TRACE_CLONE)
243 return PTRACE_EVENT_CLONE;
244 } else if (current->ptrace & PT_TRACE_FORK)
245 return PTRACE_EVENT_FORK;
246
247 return 0;
248}
249
250/**
251 * tracehook_finish_clone - new child created and being attached
252 * @child: new child task
253 * @clone_flags: %CLONE_* flags from clone/fork/vfork system call
254 * @trace: return value from tracehook_prepare_clone()
255 *
256 * This is called immediately after adding @child to its parent's children list.
257 * The @trace value is that returned by tracehook_prepare_clone().
258 *
259 * Called with current's siglock and write_lock_irq(&tasklist_lock) held.
260 */
261static inline void tracehook_finish_clone(struct task_struct *child,
262 unsigned long clone_flags, int trace)
263{
264 ptrace_init_task(child, (clone_flags & CLONE_PTRACE) || trace);
265}
266
267/**
268 * tracehook_report_clone - in parent, new child is about to start running
269 * @regs: parent's user register state
270 * @clone_flags: flags from parent's system call
271 * @pid: new child's PID in the parent's namespace
272 * @child: new child task
273 *
274 * Called after a child is set up, but before it has been started running.
275 * This is not a good place to block, because the child has not started
276 * yet. Suspend the child here if desired, and then block in
277 * tracehook_report_clone_complete(). This must prevent the child from
278 * self-reaping if tracehook_report_clone_complete() uses the @child
279 * pointer; otherwise it might have died and been released by the time
280 * tracehook_report_clone_complete() is called.
281 *
282 * Called with no locks held, but the child cannot run until this returns.
283 */
284static inline void tracehook_report_clone(struct pt_regs *regs,
285 unsigned long clone_flags,
286 pid_t pid, struct task_struct *child)
287{
288 if (unlikely(task_ptrace(child))) {
289 /*
290 * It doesn't matter who attached/attaching to this
291 * task, the pending SIGSTOP is right in any case.
292 */
293 sigaddset(&child->pending.signal, SIGSTOP);
294 set_tsk_thread_flag(child, TIF_SIGPENDING);
295 }
296}
297
298/**
299 * tracehook_report_clone_complete - new child is running
300 * @trace: return value from tracehook_prepare_clone()
301 * @regs: parent's user register state
302 * @clone_flags: flags from parent's system call
303 * @pid: new child's PID in the parent's namespace
304 * @child: child task, already running
305 *
306 * This is called just after the child has started running. This is
307 * just before the clone/fork syscall returns, or blocks for vfork
308 * child completion if @clone_flags has the %CLONE_VFORK bit set.
309 * The @child pointer may be invalid if a self-reaping child died and
310 * tracehook_report_clone() took no action to prevent it from self-reaping.
311 *
312 * Called with no locks held.
313 */
314static inline void tracehook_report_clone_complete(int trace,
315 struct pt_regs *regs,
316 unsigned long clone_flags,
317 pid_t pid,
318 struct task_struct *child)
319{
320 if (unlikely(trace))
321 ptrace_event(0, trace, pid);
322}
323
324/**
325 * tracehook_report_vfork_done - vfork parent's child has exited or exec'd
326 * @child: child task, already running
327 * @pid: new child's PID in the parent's namespace
328 *
329 * Called after a %CLONE_VFORK parent has waited for the child to complete.
330 * The clone/vfork system call will return immediately after this.
331 * The @child pointer may be invalid if a self-reaping child died and
332 * tracehook_report_clone() took no action to prevent it from self-reaping.
333 *
334 * Called with no locks held.
335 */
336static inline void tracehook_report_vfork_done(struct task_struct *child,
337 pid_t pid)
338{
339 ptrace_event(PT_TRACE_VFORK_DONE, PTRACE_EVENT_VFORK_DONE, pid);
340}
341
342/**
343 * tracehook_prepare_release_task - task is being reaped, clean up tracing
344 * @task: task in %EXIT_DEAD state
345 *
346 * This is called in release_task() just before @task gets finally reaped
347 * and freed. This would be the ideal place to remove and clean up any
348 * tracing-related state for @task.
349 *
350 * Called with no locks held.
351 */
352static inline void tracehook_prepare_release_task(struct task_struct *task)
353{
354}
355
356/**
357 * tracehook_finish_release_task - final tracing clean-up
358 * @task: task in %EXIT_DEAD state
359 *
360 * This is called in release_task() when @task is being in the middle of
361 * being reaped. After this, there must be no tracing entanglements.
362 *
363 * Called with write_lock_irq(&tasklist_lock) held.
364 */
365static inline void tracehook_finish_release_task(struct task_struct *task)
366{
367 ptrace_release_task(task);
368}
369
370/**
371 * tracehook_signal_handler - signal handler setup is complete 133 * tracehook_signal_handler - signal handler setup is complete
372 * @sig: number of signal being delivered 134 * @sig: number of signal being delivered
373 * @info: siginfo_t of signal being delivered 135 * @info: siginfo_t of signal being delivered
@@ -390,151 +152,6 @@ static inline void tracehook_signal_handler(int sig, siginfo_t *info,
390 ptrace_notify(SIGTRAP); 152 ptrace_notify(SIGTRAP);
391} 153}
392 154
393/**
394 * tracehook_consider_ignored_signal - suppress short-circuit of ignored signal
395 * @task: task receiving the signal
396 * @sig: signal number being sent
397 *
398 * Return zero iff tracing doesn't care to examine this ignored signal,
399 * so it can short-circuit normal delivery and never even get queued.
400 *
401 * Called with @task->sighand->siglock held.
402 */
403static inline int tracehook_consider_ignored_signal(struct task_struct *task,
404 int sig)
405{
406 return (task_ptrace(task) & PT_PTRACED) != 0;
407}
408
409/**
410 * tracehook_consider_fatal_signal - suppress special handling of fatal signal
411 * @task: task receiving the signal
412 * @sig: signal number being sent
413 *
414 * Return nonzero to prevent special handling of this termination signal.
415 * Normally handler for signal is %SIG_DFL. It can be %SIG_IGN if @sig is
416 * ignored, in which case force_sig() is about to reset it to %SIG_DFL.
417 * When this returns zero, this signal might cause a quick termination
418 * that does not give the debugger a chance to intercept the signal.
419 *
420 * Called with or without @task->sighand->siglock held.
421 */
422static inline int tracehook_consider_fatal_signal(struct task_struct *task,
423 int sig)
424{
425 return (task_ptrace(task) & PT_PTRACED) != 0;
426}
427
428/**
429 * tracehook_force_sigpending - let tracing force signal_pending(current) on
430 *
431 * Called when recomputing our signal_pending() flag. Return nonzero
432 * to force the signal_pending() flag on, so that tracehook_get_signal()
433 * will be called before the next return to user mode.
434 *
435 * Called with @current->sighand->siglock held.
436 */
437static inline int tracehook_force_sigpending(void)
438{
439 return 0;
440}
441
442/**
443 * tracehook_get_signal - deliver synthetic signal to traced task
444 * @task: @current
445 * @regs: task_pt_regs(@current)
446 * @info: details of synthetic signal
447 * @return_ka: sigaction for synthetic signal
448 *
449 * Return zero to check for a real pending signal normally.
450 * Return -1 after releasing the siglock to repeat the check.
451 * Return a signal number to induce an artificial signal delivery,
452 * setting *@info and *@return_ka to specify its details and behavior.
453 *
454 * The @return_ka->sa_handler value controls the disposition of the
455 * signal, no matter the signal number. For %SIG_DFL, the return value
456 * is a representative signal to indicate the behavior (e.g. %SIGTERM
457 * for death, %SIGQUIT for core dump, %SIGSTOP for job control stop,
458 * %SIGTSTP for stop unless in an orphaned pgrp), but the signal number
459 * reported will be @info->si_signo instead.
460 *
461 * Called with @task->sighand->siglock held, before dequeuing pending signals.
462 */
463static inline int tracehook_get_signal(struct task_struct *task,
464 struct pt_regs *regs,
465 siginfo_t *info,
466 struct k_sigaction *return_ka)
467{
468 return 0;
469}
470
471/**
472 * tracehook_finish_jctl - report about return from job control stop
473 *
474 * This is called by do_signal_stop() after wakeup.
475 */
476static inline void tracehook_finish_jctl(void)
477{
478}
479
480#define DEATH_REAP -1
481#define DEATH_DELAYED_GROUP_LEADER -2
482
483/**
484 * tracehook_notify_death - task is dead, ready to notify parent
485 * @task: @current task now exiting
486 * @death_cookie: value to pass to tracehook_report_death()
487 * @group_dead: nonzero if this was the last thread in the group to die
488 *
489 * A return value >= 0 means call do_notify_parent() with that signal
490 * number. Negative return value can be %DEATH_REAP to self-reap right
491 * now, or %DEATH_DELAYED_GROUP_LEADER to a zombie without notifying our
492 * parent. Note that a return value of 0 means a do_notify_parent() call
493 * that sends no signal, but still wakes up a parent blocked in wait*().
494 *
495 * Called with write_lock_irq(&tasklist_lock) held.
496 */
497static inline int tracehook_notify_death(struct task_struct *task,
498 void **death_cookie, int group_dead)
499{
500 if (task_detached(task))
501 return task->ptrace ? SIGCHLD : DEATH_REAP;
502
503 /*
504 * If something other than our normal parent is ptracing us, then
505 * send it a SIGCHLD instead of honoring exit_signal. exit_signal
506 * only has special meaning to our real parent.
507 */
508 if (thread_group_empty(task) && !ptrace_reparented(task))
509 return task->exit_signal;
510
511 return task->ptrace ? SIGCHLD : DEATH_DELAYED_GROUP_LEADER;
512}
513
514/**
515 * tracehook_report_death - task is dead and ready to be reaped
516 * @task: @current task now exiting
517 * @signal: return value from tracheook_notify_death()
518 * @death_cookie: value passed back from tracehook_notify_death()
519 * @group_dead: nonzero if this was the last thread in the group to die
520 *
521 * Thread has just become a zombie or is about to self-reap. If positive,
522 * @signal is the signal number just sent to the parent (usually %SIGCHLD).
523 * If @signal is %DEATH_REAP, this thread will self-reap. If @signal is
524 * %DEATH_DELAYED_GROUP_LEADER, this is a delayed_group_leader() zombie.
525 * The @death_cookie was passed back by tracehook_notify_death().
526 *
527 * If normal reaping is not inhibited, @task->exit_state might be changing
528 * in parallel.
529 *
530 * Called without locks.
531 */
532static inline void tracehook_report_death(struct task_struct *task,
533 int signal, void *death_cookie,
534 int group_dead)
535{
536}
537
538#ifdef TIF_NOTIFY_RESUME 155#ifdef TIF_NOTIFY_RESUME
539/** 156/**
540 * set_notify_resume - cause tracehook_notify_resume() to be called 157 * set_notify_resume - cause tracehook_notify_resume() to be called
diff --git a/include/linux/usb/composite.h b/include/linux/usb/composite.h
index b78cba466d3d..a316fba73518 100644
--- a/include/linux/usb/composite.h
+++ b/include/linux/usb/composite.h
@@ -59,6 +59,10 @@ struct usb_configuration;
59 * @hs_descriptors: Table of high speed descriptors, using interface and 59 * @hs_descriptors: Table of high speed descriptors, using interface and
60 * string identifiers assigned during @bind(). If this pointer is null, 60 * string identifiers assigned during @bind(). If this pointer is null,
61 * the function will not be available at high speed. 61 * the function will not be available at high speed.
62 * @ss_descriptors: Table of super speed descriptors, using interface and
63 * string identifiers assigned during @bind(). If this
64 * pointer is null after initiation, the function will not
65 * be available at super speed.
62 * @config: assigned when @usb_add_function() is called; this is the 66 * @config: assigned when @usb_add_function() is called; this is the
63 * configuration with which this function is associated. 67 * configuration with which this function is associated.
64 * @bind: Before the gadget can register, all of its functions bind() to the 68 * @bind: Before the gadget can register, all of its functions bind() to the
@@ -77,6 +81,10 @@ struct usb_configuration;
77 * @setup: Used for interface-specific control requests. 81 * @setup: Used for interface-specific control requests.
78 * @suspend: Notifies functions when the host stops sending USB traffic. 82 * @suspend: Notifies functions when the host stops sending USB traffic.
79 * @resume: Notifies functions when the host restarts USB traffic. 83 * @resume: Notifies functions when the host restarts USB traffic.
84 * @get_status: Returns function status as a reply to
85 * GetStatus() request when the recepient is Interface.
86 * @func_suspend: callback to be called when
87 * SetFeature(FUNCTION_SUSPEND) is reseived
80 * 88 *
81 * A single USB function uses one or more interfaces, and should in most 89 * A single USB function uses one or more interfaces, and should in most
82 * cases support operation at both full and high speeds. Each function is 90 * cases support operation at both full and high speeds. Each function is
@@ -106,6 +114,7 @@ struct usb_function {
106 struct usb_gadget_strings **strings; 114 struct usb_gadget_strings **strings;
107 struct usb_descriptor_header **descriptors; 115 struct usb_descriptor_header **descriptors;
108 struct usb_descriptor_header **hs_descriptors; 116 struct usb_descriptor_header **hs_descriptors;
117 struct usb_descriptor_header **ss_descriptors;
109 118
110 struct usb_configuration *config; 119 struct usb_configuration *config;
111 120
@@ -132,6 +141,10 @@ struct usb_function {
132 void (*suspend)(struct usb_function *); 141 void (*suspend)(struct usb_function *);
133 void (*resume)(struct usb_function *); 142 void (*resume)(struct usb_function *);
134 143
144 /* USB 3.0 additions */
145 int (*get_status)(struct usb_function *);
146 int (*func_suspend)(struct usb_function *,
147 u8 suspend_opt);
135 /* private: */ 148 /* private: */
136 /* internals */ 149 /* internals */
137 struct list_head list; 150 struct list_head list;
@@ -145,20 +158,8 @@ int usb_function_activate(struct usb_function *);
145 158
146int usb_interface_id(struct usb_configuration *, struct usb_function *); 159int usb_interface_id(struct usb_configuration *, struct usb_function *);
147 160
148/** 161int config_ep_by_speed(struct usb_gadget *g, struct usb_function *f,
149 * ep_choose - select descriptor endpoint at current device speed 162 struct usb_ep *_ep);
150 * @g: gadget, connected and running at some speed
151 * @hs: descriptor to use for high speed operation
152 * @fs: descriptor to use for full or low speed operation
153 */
154static inline struct usb_endpoint_descriptor *
155ep_choose(struct usb_gadget *g, struct usb_endpoint_descriptor *hs,
156 struct usb_endpoint_descriptor *fs)
157{
158 if (gadget_is_dualspeed(g) && g->speed == USB_SPEED_HIGH)
159 return hs;
160 return fs;
161}
162 163
163#define MAX_CONFIG_INTERFACES 16 /* arbitrary; max 255 */ 164#define MAX_CONFIG_INTERFACES 16 /* arbitrary; max 255 */
164 165
@@ -231,6 +232,7 @@ struct usb_configuration {
231 struct list_head list; 232 struct list_head list;
232 struct list_head functions; 233 struct list_head functions;
233 u8 next_interface_id; 234 u8 next_interface_id;
235 unsigned superspeed:1;
234 unsigned highspeed:1; 236 unsigned highspeed:1;
235 unsigned fullspeed:1; 237 unsigned fullspeed:1;
236 struct usb_function *interface[MAX_CONFIG_INTERFACES]; 238 struct usb_function *interface[MAX_CONFIG_INTERFACES];
@@ -252,6 +254,7 @@ int usb_add_config(struct usb_composite_dev *,
252 * identifiers. 254 * identifiers.
253 * @strings: tables of strings, keyed by identifiers assigned during bind() 255 * @strings: tables of strings, keyed by identifiers assigned during bind()
254 * and language IDs provided in control requests 256 * and language IDs provided in control requests
257 * @max_speed: Highest speed the driver supports.
255 * @needs_serial: set to 1 if the gadget needs userspace to provide 258 * @needs_serial: set to 1 if the gadget needs userspace to provide
256 * a serial number. If one is not provided, warning will be printed. 259 * a serial number. If one is not provided, warning will be printed.
257 * @unbind: Reverses bind; called as a side effect of unregistering 260 * @unbind: Reverses bind; called as a side effect of unregistering
@@ -279,6 +282,7 @@ struct usb_composite_driver {
279 const char *iManufacturer; 282 const char *iManufacturer;
280 const struct usb_device_descriptor *dev; 283 const struct usb_device_descriptor *dev;
281 struct usb_gadget_strings **strings; 284 struct usb_gadget_strings **strings;
285 enum usb_device_speed max_speed;
282 unsigned needs_serial:1; 286 unsigned needs_serial:1;
283 287
284 int (*unbind)(struct usb_composite_dev *); 288 int (*unbind)(struct usb_composite_dev *);
diff --git a/include/linux/usb/gadget.h b/include/linux/usb/gadget.h
index dd1571db55e7..087f4b931833 100644
--- a/include/linux/usb/gadget.h
+++ b/include/linux/usb/gadget.h
@@ -15,7 +15,13 @@
15#ifndef __LINUX_USB_GADGET_H 15#ifndef __LINUX_USB_GADGET_H
16#define __LINUX_USB_GADGET_H 16#define __LINUX_USB_GADGET_H
17 17
18#include <linux/device.h>
19#include <linux/errno.h>
20#include <linux/init.h>
21#include <linux/list.h>
18#include <linux/slab.h> 22#include <linux/slab.h>
23#include <linux/types.h>
24#include <linux/usb/ch9.h>
19 25
20struct usb_ep; 26struct usb_ep;
21 27
@@ -27,6 +33,7 @@ struct usb_ep;
27 * field, and the usb controller needs one, it is responsible 33 * field, and the usb controller needs one, it is responsible
28 * for mapping and unmapping the buffer. 34 * for mapping and unmapping the buffer.
29 * @length: Length of that data 35 * @length: Length of that data
36 * @stream_id: The stream id, when USB3.0 bulk streams are being used
30 * @no_interrupt: If true, hints that no completion irq is needed. 37 * @no_interrupt: If true, hints that no completion irq is needed.
31 * Helpful sometimes with deep request queues that are handled 38 * Helpful sometimes with deep request queues that are handled
32 * directly by DMA controllers. 39 * directly by DMA controllers.
@@ -81,6 +88,7 @@ struct usb_request {
81 unsigned length; 88 unsigned length;
82 dma_addr_t dma; 89 dma_addr_t dma;
83 90
91 unsigned stream_id:16;
84 unsigned no_interrupt:1; 92 unsigned no_interrupt:1;
85 unsigned zero:1; 93 unsigned zero:1;
86 unsigned short_not_ok:1; 94 unsigned short_not_ok:1;
@@ -131,8 +139,17 @@ struct usb_ep_ops {
131 * @maxpacket:The maximum packet size used on this endpoint. The initial 139 * @maxpacket:The maximum packet size used on this endpoint. The initial
132 * value can sometimes be reduced (hardware allowing), according to 140 * value can sometimes be reduced (hardware allowing), according to
133 * the endpoint descriptor used to configure the endpoint. 141 * the endpoint descriptor used to configure the endpoint.
134 * @driver_data:for use by the gadget driver. all other fields are 142 * @max_streams: The maximum number of streams supported
135 * read-only to gadget drivers. 143 * by this EP (0 - 16, actual number is 2^n)
144 * @mult: multiplier, 'mult' value for SS Isoc EPs
145 * @maxburst: the maximum number of bursts supported by this EP (for usb3)
146 * @driver_data:for use by the gadget driver.
147 * @address: used to identify the endpoint when finding descriptor that
148 * matches connection speed
149 * @desc: endpoint descriptor. This pointer is set before the endpoint is
150 * enabled and remains valid until the endpoint is disabled.
151 * @comp_desc: In case of SuperSpeed support, this is the endpoint companion
152 * descriptor that is used to configure the endpoint
136 * 153 *
137 * the bus controller driver lists all the general purpose endpoints in 154 * the bus controller driver lists all the general purpose endpoints in
138 * gadget->ep_list. the control endpoint (gadget->ep0) is not in that list, 155 * gadget->ep_list. the control endpoint (gadget->ep0) is not in that list,
@@ -145,6 +162,12 @@ struct usb_ep {
145 const struct usb_ep_ops *ops; 162 const struct usb_ep_ops *ops;
146 struct list_head ep_list; 163 struct list_head ep_list;
147 unsigned maxpacket:16; 164 unsigned maxpacket:16;
165 unsigned max_streams:16;
166 unsigned mult:2;
167 unsigned maxburst:4;
168 u8 address;
169 const struct usb_endpoint_descriptor *desc;
170 const struct usb_ss_ep_comp_descriptor *comp_desc;
148}; 171};
149 172
150/*-------------------------------------------------------------------------*/ 173/*-------------------------------------------------------------------------*/
@@ -153,11 +176,8 @@ struct usb_ep {
153 * usb_ep_enable - configure endpoint, making it usable 176 * usb_ep_enable - configure endpoint, making it usable
154 * @ep:the endpoint being configured. may not be the endpoint named "ep0". 177 * @ep:the endpoint being configured. may not be the endpoint named "ep0".
155 * drivers discover endpoints through the ep_list of a usb_gadget. 178 * drivers discover endpoints through the ep_list of a usb_gadget.
156 * @desc:descriptor for desired behavior. caller guarantees this pointer
157 * remains valid until the endpoint is disabled; the data byte order
158 * is little-endian (usb-standard).
159 * 179 *
160 * when configurations are set, or when interface settings change, the driver 180 * When configurations are set, or when interface settings change, the driver
161 * will enable or disable the relevant endpoints. while it is enabled, an 181 * will enable or disable the relevant endpoints. while it is enabled, an
162 * endpoint may be used for i/o until the driver receives a disconnect() from 182 * endpoint may be used for i/o until the driver receives a disconnect() from
163 * the host or until the endpoint is disabled. 183 * the host or until the endpoint is disabled.
@@ -172,10 +192,9 @@ struct usb_ep {
172 * 192 *
173 * returns zero, or a negative error code. 193 * returns zero, or a negative error code.
174 */ 194 */
175static inline int usb_ep_enable(struct usb_ep *ep, 195static inline int usb_ep_enable(struct usb_ep *ep)
176 const struct usb_endpoint_descriptor *desc)
177{ 196{
178 return ep->ops->enable(ep, desc); 197 return ep->ops->enable(ep, ep->desc);
179} 198}
180 199
181/** 200/**
@@ -416,7 +435,16 @@ static inline void usb_ep_fifo_flush(struct usb_ep *ep)
416 435
417/*-------------------------------------------------------------------------*/ 436/*-------------------------------------------------------------------------*/
418 437
438struct usb_dcd_config_params {
439 __u8 bU1devExitLat; /* U1 Device exit Latency */
440#define USB_DEFULT_U1_DEV_EXIT_LAT 0x01 /* Less then 1 microsec */
441 __le16 bU2DevExitLat; /* U2 Device exit Latency */
442#define USB_DEFULT_U2_DEV_EXIT_LAT 0x1F4 /* Less then 500 microsec */
443};
444
445
419struct usb_gadget; 446struct usb_gadget;
447struct usb_gadget_driver;
420 448
421/* the rest of the api to the controller hardware: device operations, 449/* the rest of the api to the controller hardware: device operations,
422 * which don't involve endpoints (or i/o). 450 * which don't involve endpoints (or i/o).
@@ -430,6 +458,16 @@ struct usb_gadget_ops {
430 int (*pullup) (struct usb_gadget *, int is_on); 458 int (*pullup) (struct usb_gadget *, int is_on);
431 int (*ioctl)(struct usb_gadget *, 459 int (*ioctl)(struct usb_gadget *,
432 unsigned code, unsigned long param); 460 unsigned code, unsigned long param);
461 void (*get_config_params)(struct usb_dcd_config_params *);
462 int (*udc_start)(struct usb_gadget *,
463 struct usb_gadget_driver *);
464 int (*udc_stop)(struct usb_gadget *,
465 struct usb_gadget_driver *);
466
467 /* Those two are deprecated */
468 int (*start)(struct usb_gadget_driver *,
469 int (*bind)(struct usb_gadget *));
470 int (*stop)(struct usb_gadget_driver *);
433}; 471};
434 472
435/** 473/**
@@ -521,6 +559,24 @@ static inline int gadget_is_dualspeed(struct usb_gadget *g)
521} 559}
522 560
523/** 561/**
562 * gadget_is_superspeed() - return true if the hardware handles
563 * supperspeed
564 * @g: controller that might support supper speed
565 */
566static inline int gadget_is_superspeed(struct usb_gadget *g)
567{
568#ifdef CONFIG_USB_GADGET_SUPERSPEED
569 /*
570 * runtime test would check "g->is_superspeed" ... that might be
571 * useful to work around hardware bugs, but is mostly pointless
572 */
573 return 1;
574#else
575 return 0;
576#endif
577}
578
579/**
524 * gadget_is_otg - return true iff the hardware is OTG-ready 580 * gadget_is_otg - return true iff the hardware is OTG-ready
525 * @g: controller that might have a Mini-AB connector 581 * @g: controller that might have a Mini-AB connector
526 * 582 *
@@ -821,6 +877,9 @@ int usb_gadget_probe_driver(struct usb_gadget_driver *driver,
821 */ 877 */
822int usb_gadget_unregister_driver(struct usb_gadget_driver *driver); 878int usb_gadget_unregister_driver(struct usb_gadget_driver *driver);
823 879
880extern int usb_add_gadget_udc(struct device *parent, struct usb_gadget *gadget);
881extern void usb_del_gadget_udc(struct usb_gadget *gadget);
882
824/*-------------------------------------------------------------------------*/ 883/*-------------------------------------------------------------------------*/
825 884
826/* utility to simplify dealing with string descriptors */ 885/* utility to simplify dealing with string descriptors */
@@ -870,12 +929,6 @@ int usb_gadget_config_buf(const struct usb_config_descriptor *config,
870struct usb_descriptor_header **usb_copy_descriptors( 929struct usb_descriptor_header **usb_copy_descriptors(
871 struct usb_descriptor_header **); 930 struct usb_descriptor_header **);
872 931
873/* return copy of endpoint descriptor given original descriptor set */
874struct usb_endpoint_descriptor *usb_find_endpoint(
875 struct usb_descriptor_header **src,
876 struct usb_descriptor_header **copy,
877 struct usb_endpoint_descriptor *match);
878
879/** 932/**
880 * usb_free_descriptors - free descriptors returned by usb_copy_descriptors() 933 * usb_free_descriptors - free descriptors returned by usb_copy_descriptors()
881 * @v: vector of descriptors 934 * @v: vector of descriptors
@@ -892,6 +945,11 @@ static inline void usb_free_descriptors(struct usb_descriptor_header **v)
892extern struct usb_ep *usb_ep_autoconfig(struct usb_gadget *, 945extern struct usb_ep *usb_ep_autoconfig(struct usb_gadget *,
893 struct usb_endpoint_descriptor *); 946 struct usb_endpoint_descriptor *);
894 947
948
949extern struct usb_ep *usb_ep_autoconfig_ss(struct usb_gadget *,
950 struct usb_endpoint_descriptor *,
951 struct usb_ss_ep_comp_descriptor *);
952
895extern void usb_ep_autoconfig_reset(struct usb_gadget *); 953extern void usb_ep_autoconfig_reset(struct usb_gadget *);
896 954
897#endif /* __LINUX_USB_GADGET_H */ 955#endif /* __LINUX_USB_GADGET_H */
diff --git a/include/linux/usb/m66592.h b/include/linux/usb/m66592.h
index cda9625e7df0..a4ba31ab2fed 100644
--- a/include/linux/usb/m66592.h
+++ b/include/linux/usb/m66592.h
@@ -38,6 +38,8 @@ struct m66592_platdata {
38 /* (external controller only) one = 3.3V, zero = 1.5V */ 38 /* (external controller only) one = 3.3V, zero = 1.5V */
39 unsigned vif:1; 39 unsigned vif:1;
40 40
41 /* (external controller only) set one = WR0_N shorted to WR1_N */
42 unsigned wr0_shorted_to_wr1:1;
41}; 43};
42 44
43#endif /* __LINUX_USB_M66592_H */ 45#endif /* __LINUX_USB_M66592_H */
diff --git a/include/linux/usb/r8a66597.h b/include/linux/usb/r8a66597.h
index 26d216734057..b6b8660d0c68 100644
--- a/include/linux/usb/r8a66597.h
+++ b/include/linux/usb/r8a66597.h
@@ -3,7 +3,7 @@
3 * 3 *
4 * Copyright (C) 2009 Renesas Solutions Corp. 4 * Copyright (C) 2009 Renesas Solutions Corp.
5 * 5 *
6 * Author : Yoshihiro Shimoda <shimoda.yoshihiro@renesas.com> 6 * Author : Yoshihiro Shimoda <yoshihiro.shimoda.uh@renesas.com>
7 * 7 *
8 * This program is free software; you can redistribute it and/or modify 8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by 9 * it under the terms of the GNU General Public License as published by
@@ -31,6 +31,9 @@ struct r8a66597_platdata {
31 /* This callback can control port power instead of DVSTCTR register. */ 31 /* This callback can control port power instead of DVSTCTR register. */
32 void (*port_power)(int port, int power); 32 void (*port_power)(int port, int power);
33 33
34 /* This parameter is for BUSWAIT */
35 u16 buswait;
36
34 /* set one = on chip controller, set zero = external controller */ 37 /* set one = on chip controller, set zero = external controller */
35 unsigned on_chip:1; 38 unsigned on_chip:1;
36 39
@@ -42,6 +45,9 @@ struct r8a66597_platdata {
42 45
43 /* set one = big endian, set zero = little endian */ 46 /* set one = big endian, set zero = little endian */
44 unsigned endian:1; 47 unsigned endian:1;
48
49 /* (external controller only) set one = WR0_N shorted to WR1_N */
50 unsigned wr0_shorted_to_wr1:1;
45}; 51};
46 52
47/* Register definitions */ 53/* Register definitions */
diff --git a/include/linux/usb/renesas_usbhs.h b/include/linux/usb/renesas_usbhs.h
index 3a7f1d982dd6..8977431259c6 100644
--- a/include/linux/usb/renesas_usbhs.h
+++ b/include/linux/usb/renesas_usbhs.h
@@ -110,6 +110,23 @@ struct renesas_usbhs_driver_param {
110 * delay time from notify_hotplug callback 110 * delay time from notify_hotplug callback
111 */ 111 */
112 int detection_delay; 112 int detection_delay;
113
114 /*
115 * option:
116 *
117 * dma id for dmaengine
118 */
119 int d0_tx_id;
120 int d0_rx_id;
121 int d1_tx_id;
122 int d1_rx_id;
123
124 /*
125 * option:
126 *
127 * pio <--> dma border.
128 */
129 int pio_dma_border; /* default is 64byte */
113}; 130};
114 131
115/* 132/*
diff --git a/include/linux/usb_usual.h b/include/linux/usb_usual.h
index 71693d4a4fe1..17df3600bcef 100644
--- a/include/linux/usb_usual.h
+++ b/include/linux/usb_usual.h
@@ -62,7 +62,9 @@
62 US_FLAG(NO_READ_DISC_INFO, 0x00040000) \ 62 US_FLAG(NO_READ_DISC_INFO, 0x00040000) \
63 /* cannot handle READ_DISC_INFO */ \ 63 /* cannot handle READ_DISC_INFO */ \
64 US_FLAG(NO_READ_CAPACITY_16, 0x00080000) \ 64 US_FLAG(NO_READ_CAPACITY_16, 0x00080000) \
65 /* cannot handle READ_CAPACITY_16 */ 65 /* cannot handle READ_CAPACITY_16 */ \
66 US_FLAG(INITIAL_READ10, 0x00100000) \
67 /* Initial READ(10) (and others) must be retried */
66 68
67#define US_FLAG(name, value) US_FL_##name = value , 69#define US_FLAG(name, value) US_FL_##name = value ,
68enum { US_DO_ALL_FLAGS }; 70enum { US_DO_ALL_FLAGS };
diff --git a/include/linux/uts.h b/include/linux/uts.h
index 73eb1ed36ec4..6ddbd86377de 100644
--- a/include/linux/uts.h
+++ b/include/linux/uts.h
@@ -9,7 +9,7 @@
9#endif 9#endif
10 10
11#ifndef UTS_NODENAME 11#ifndef UTS_NODENAME
12#define UTS_NODENAME "(none)" /* set by sethostname() */ 12#define UTS_NODENAME CONFIG_DEFAULT_HOSTNAME /* set by sethostname() */
13#endif 13#endif
14 14
15#ifndef UTS_DOMAINNAME 15#ifndef UTS_DOMAINNAME
diff --git a/include/linux/virtio_net.h b/include/linux/virtio_net.h
index 136040bba3e3..970d5a2a9047 100644
--- a/include/linux/virtio_net.h
+++ b/include/linux/virtio_net.h
@@ -63,6 +63,7 @@ struct virtio_net_config {
63 * specify GSO or CSUM features, you can simply ignore the header. */ 63 * specify GSO or CSUM features, you can simply ignore the header. */
64struct virtio_net_hdr { 64struct virtio_net_hdr {
65#define VIRTIO_NET_HDR_F_NEEDS_CSUM 1 // Use csum_start, csum_offset 65#define VIRTIO_NET_HDR_F_NEEDS_CSUM 1 // Use csum_start, csum_offset
66#define VIRTIO_NET_HDR_F_DATA_VALID 2 // Csum is valid
66 __u8 flags; 67 __u8 flags;
67#define VIRTIO_NET_HDR_GSO_NONE 0 // Not a GSO frame 68#define VIRTIO_NET_HDR_GSO_NONE 0 // Not a GSO frame
68#define VIRTIO_NET_HDR_GSO_TCPV4 1 // GSO frame, IPv4 TCP (TSO) 69#define VIRTIO_NET_HDR_GSO_TCPV4 1 // GSO frame, IPv4 TCP (TSO)
diff --git a/include/linux/vt.h b/include/linux/vt.h
index d5dd0bc408fd..30a8dd9c83ff 100644
--- a/include/linux/vt.h
+++ b/include/linux/vt.h
@@ -86,6 +86,13 @@ struct vt_setactivate {
86 86
87#ifdef __KERNEL__ 87#ifdef __KERNEL__
88 88
89/* Virtual Terminal events. */
90#define VT_ALLOCATE 0x0001 /* Console got allocated */
91#define VT_DEALLOCATE 0x0002 /* Console will be deallocated */
92#define VT_WRITE 0x0003 /* A char got output */
93#define VT_UPDATE 0x0004 /* A bigger update occurred */
94#define VT_PREWRITE 0x0005 /* A char is about to be written to the console */
95
89#ifdef CONFIG_VT_CONSOLE 96#ifdef CONFIG_VT_CONSOLE
90 97
91extern int vt_kmsg_redirect(int new); 98extern int vt_kmsg_redirect(int new);
diff --git a/include/linux/workqueue.h b/include/linux/workqueue.h
index f584aba78ca9..2be2887c6958 100644
--- a/include/linux/workqueue.h
+++ b/include/linux/workqueue.h
@@ -255,7 +255,7 @@ enum {
255 WQ_HIGHPRI = 1 << 4, /* high priority */ 255 WQ_HIGHPRI = 1 << 4, /* high priority */
256 WQ_CPU_INTENSIVE = 1 << 5, /* cpu instensive workqueue */ 256 WQ_CPU_INTENSIVE = 1 << 5, /* cpu instensive workqueue */
257 257
258 WQ_DYING = 1 << 6, /* internal: workqueue is dying */ 258 WQ_DRAINING = 1 << 6, /* internal: workqueue is draining */
259 WQ_RESCUER = 1 << 7, /* internal: workqueue has rescuer */ 259 WQ_RESCUER = 1 << 7, /* internal: workqueue has rescuer */
260 260
261 WQ_MAX_ACTIVE = 512, /* I like 512, better ideas? */ 261 WQ_MAX_ACTIVE = 512, /* I like 512, better ideas? */
@@ -355,6 +355,7 @@ extern int queue_delayed_work_on(int cpu, struct workqueue_struct *wq,
355 struct delayed_work *work, unsigned long delay); 355 struct delayed_work *work, unsigned long delay);
356 356
357extern void flush_workqueue(struct workqueue_struct *wq); 357extern void flush_workqueue(struct workqueue_struct *wq);
358extern void drain_workqueue(struct workqueue_struct *wq);
358extern void flush_scheduled_work(void); 359extern void flush_scheduled_work(void);
359 360
360extern int schedule_work(struct work_struct *work); 361extern int schedule_work(struct work_struct *work);
@@ -412,21 +413,6 @@ static inline bool __cancel_delayed_work(struct delayed_work *work)
412 return ret; 413 return ret;
413} 414}
414 415
415/* Obsolete. use cancel_delayed_work_sync() */
416static inline __deprecated
417void cancel_rearming_delayed_workqueue(struct workqueue_struct *wq,
418 struct delayed_work *work)
419{
420 cancel_delayed_work_sync(work);
421}
422
423/* Obsolete. use cancel_delayed_work_sync() */
424static inline __deprecated
425void cancel_rearming_delayed_work(struct delayed_work *work)
426{
427 cancel_delayed_work_sync(work);
428}
429
430#ifndef CONFIG_SMP 416#ifndef CONFIG_SMP
431static inline long work_on_cpu(unsigned int cpu, long (*fn)(void *), void *arg) 417static inline long work_on_cpu(unsigned int cpu, long (*fn)(void *), void *arg)
432{ 418{
diff --git a/include/linux/zorro.h b/include/linux/zorro.h
index 7bf9db525e9e..dff42025649b 100644
--- a/include/linux/zorro.h
+++ b/include/linux/zorro.h
@@ -187,7 +187,7 @@ extern struct zorro_dev *zorro_find_device(zorro_id id,
187 187
188#define zorro_resource_start(z) ((z)->resource.start) 188#define zorro_resource_start(z) ((z)->resource.start)
189#define zorro_resource_end(z) ((z)->resource.end) 189#define zorro_resource_end(z) ((z)->resource.end)
190#define zorro_resource_len(z) ((z)->resource.end-(z)->resource.start+1) 190#define zorro_resource_len(z) (resource_size(&(z)->resource))
191#define zorro_resource_flags(z) ((z)->resource.flags) 191#define zorro_resource_flags(z) ((z)->resource.flags)
192 192
193#define zorro_request_device(z, name) \ 193#define zorro_request_device(z, name) \
diff --git a/include/media/lirc_dev.h b/include/media/lirc_dev.h
index 630e702c9511..168dd0b1bae2 100644
--- a/include/media/lirc_dev.h
+++ b/include/media/lirc_dev.h
@@ -9,7 +9,7 @@
9#ifndef _LINUX_LIRC_DEV_H 9#ifndef _LINUX_LIRC_DEV_H
10#define _LINUX_LIRC_DEV_H 10#define _LINUX_LIRC_DEV_H
11 11
12#define MAX_IRCTL_DEVICES 4 12#define MAX_IRCTL_DEVICES 8
13#define BUFLEN 16 13#define BUFLEN 16
14 14
15#define mod(n, div) ((n) % (div)) 15#define mod(n, div) ((n) % (div))
diff --git a/include/media/m5mols.h b/include/media/m5mols.h
index 2d7e7ca2313d..aac2c0e06d5e 100644
--- a/include/media/m5mols.h
+++ b/include/media/m5mols.h
@@ -2,10 +2,10 @@
2 * Driver header for M-5MOLS 8M Pixel camera sensor with ISP 2 * Driver header for M-5MOLS 8M Pixel camera sensor with ISP
3 * 3 *
4 * Copyright (C) 2011 Samsung Electronics Co., Ltd. 4 * Copyright (C) 2011 Samsung Electronics Co., Ltd.
5 * Author: HeungJun Kim, riverful.kim@samsung.com 5 * Author: HeungJun Kim <riverful.kim@samsung.com>
6 * 6 *
7 * Copyright (C) 2009 Samsung Electronics Co., Ltd. 7 * Copyright (C) 2009 Samsung Electronics Co., Ltd.
8 * Author: Dongsoo Nathaniel Kim, dongsoo45.kim@samsung.com 8 * Author: Dongsoo Nathaniel Kim <dongsoo45.kim@samsung.com>
9 * 9 *
10 * This program is free software; you can redistribute it and/or modify 10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by 11 * it under the terms of the GNU General Public License as published by
diff --git a/include/media/v4l2-dev.h b/include/media/v4l2-dev.h
index 93e96fb93452..c7c40f1d2624 100644
--- a/include/media/v4l2-dev.h
+++ b/include/media/v4l2-dev.h
@@ -128,8 +128,8 @@ struct video_device
128 struct mutex *lock; 128 struct mutex *lock;
129}; 129};
130 130
131#define media_entity_to_video_device(entity) \ 131#define media_entity_to_video_device(__e) \
132 container_of(entity, struct video_device, entity) 132 container_of(__e, struct video_device, entity)
133/* dev to video-device */ 133/* dev to video-device */
134#define to_video_device(cd) container_of(cd, struct video_device, dev) 134#define to_video_device(cd) container_of(cd, struct video_device, dev)
135 135
diff --git a/include/media/v4l2-subdev.h b/include/media/v4l2-subdev.h
index 1562c4ff3a65..2884e3e69cb1 100644
--- a/include/media/v4l2-subdev.h
+++ b/include/media/v4l2-subdev.h
@@ -173,16 +173,20 @@ struct v4l2_subdev_core_ops {
173 struct v4l2_event_subscription *sub); 173 struct v4l2_event_subscription *sub);
174}; 174};
175 175
176/* s_mode: switch the tuner to a specific tuner mode. Replacement of s_radio. 176/* s_radio: v4l device was opened in radio mode.
177 177
178 s_radio: v4l device was opened in Radio mode, to be replaced by s_mode. 178 g_frequency: freq->type must be filled in. Normally done by video_ioctl2
179 or the bridge driver.
180
181 g_tuner:
182 s_tuner: vt->type must be filled in. Normally done by video_ioctl2 or the
183 bridge driver.
179 184
180 s_type_addr: sets tuner type and its I2C addr. 185 s_type_addr: sets tuner type and its I2C addr.
181 186
182 s_config: sets tda9887 specific stuff, like port1, port2 and qss 187 s_config: sets tda9887 specific stuff, like port1, port2 and qss
183 */ 188 */
184struct v4l2_subdev_tuner_ops { 189struct v4l2_subdev_tuner_ops {
185 int (*s_mode)(struct v4l2_subdev *sd, enum v4l2_tuner_type);
186 int (*s_radio)(struct v4l2_subdev *sd); 190 int (*s_radio)(struct v4l2_subdev *sd);
187 int (*s_frequency)(struct v4l2_subdev *sd, struct v4l2_frequency *freq); 191 int (*s_frequency)(struct v4l2_subdev *sd, struct v4l2_frequency *freq);
188 int (*g_frequency)(struct v4l2_subdev *sd, struct v4l2_frequency *freq); 192 int (*g_frequency)(struct v4l2_subdev *sd, struct v4l2_frequency *freq);
diff --git a/include/net/9p/9p.h b/include/net/9p/9p.h
index 008711e8e78f..342dcf13d039 100644
--- a/include/net/9p/9p.h
+++ b/include/net/9p/9p.h
@@ -40,6 +40,7 @@
40 * @P9_DEBUG_FID: fid allocation/deallocation tracking 40 * @P9_DEBUG_FID: fid allocation/deallocation tracking
41 * @P9_DEBUG_PKT: packet marshalling/unmarshalling 41 * @P9_DEBUG_PKT: packet marshalling/unmarshalling
42 * @P9_DEBUG_FSC: FS-cache tracing 42 * @P9_DEBUG_FSC: FS-cache tracing
43 * @P9_DEBUG_VPKT: Verbose packet debugging (full packet dump)
43 * 44 *
44 * These flags are passed at mount time to turn on various levels of 45 * These flags are passed at mount time to turn on various levels of
45 * verbosity and tracing which will be output to the system logs. 46 * verbosity and tracing which will be output to the system logs.
@@ -57,6 +58,7 @@ enum p9_debug_flags {
57 P9_DEBUG_FID = (1<<9), 58 P9_DEBUG_FID = (1<<9),
58 P9_DEBUG_PKT = (1<<10), 59 P9_DEBUG_PKT = (1<<10),
59 P9_DEBUG_FSC = (1<<11), 60 P9_DEBUG_FSC = (1<<11),
61 P9_DEBUG_VPKT = (1<<12),
60}; 62};
61 63
62#ifdef CONFIG_NET_9P_DEBUG 64#ifdef CONFIG_NET_9P_DEBUG
@@ -74,10 +76,14 @@ do { \
74 } \ 76 } \
75} while (0) 77} while (0)
76 78
79#define P9_DUMP_PKT(way, pdu) p9pdu_dump(way, pdu)
80
77#else 81#else
78#define P9_DPRINTK(level, format, arg...) do { } while (0) 82#define P9_DPRINTK(level, format, arg...) do { } while (0)
83#define P9_DUMP_PKT(way, pdu) do { } while (0)
79#endif 84#endif
80 85
86
81#define P9_EPRINTK(level, format, arg...) \ 87#define P9_EPRINTK(level, format, arg...) \
82do { \ 88do { \
83 printk(level "9p: %s (%d): " \ 89 printk(level "9p: %s (%d): " \
@@ -175,6 +181,10 @@ enum p9_msg_t {
175 P9_RLINK, 181 P9_RLINK,
176 P9_TMKDIR = 72, 182 P9_TMKDIR = 72,
177 P9_RMKDIR, 183 P9_RMKDIR,
184 P9_TRENAMEAT = 74,
185 P9_RRENAMEAT,
186 P9_TUNLINKAT = 76,
187 P9_RUNLINKAT,
178 P9_TVERSION = 100, 188 P9_TVERSION = 100,
179 P9_RVERSION, 189 P9_RVERSION,
180 P9_TAUTH = 102, 190 P9_TAUTH = 102,
@@ -321,21 +331,6 @@ enum p9_qid_t {
321#define P9_READDIRHDRSZ 24 331#define P9_READDIRHDRSZ 24
322 332
323/** 333/**
324 * struct p9_str - length prefixed string type
325 * @len: length of the string
326 * @str: the string
327 *
328 * The protocol uses length prefixed strings for all
329 * string data, so we replicate that for our internal
330 * string members.
331 */
332
333struct p9_str {
334 u16 len;
335 char *str;
336};
337
338/**
339 * struct p9_qid - file system entity information 334 * struct p9_qid - file system entity information
340 * @type: 8-bit type &p9_qid_t 335 * @type: 8-bit type &p9_qid_t
341 * @version: 16-bit monotonically incrementing version number 336 * @version: 16-bit monotonically incrementing version number
@@ -371,11 +366,11 @@ struct p9_qid {
371 * @atime: Last access/read time 366 * @atime: Last access/read time
372 * @mtime: Last modify/write time 367 * @mtime: Last modify/write time
373 * @length: file length 368 * @length: file length
374 * @name: last element of path (aka filename) in type &p9_str 369 * @name: last element of path (aka filename)
375 * @uid: owner name in type &p9_str 370 * @uid: owner name
376 * @gid: group owner in type &p9_str 371 * @gid: group owner
377 * @muid: last modifier in type &p9_str 372 * @muid: last modifier
378 * @extension: area used to encode extended UNIX support in type &p9_str 373 * @extension: area used to encode extended UNIX support
379 * @n_uid: numeric user id of owner (part of 9p2000.u extension) 374 * @n_uid: numeric user id of owner (part of 9p2000.u extension)
380 * @n_gid: numeric group id (part of 9p2000.u extension) 375 * @n_gid: numeric group id (part of 9p2000.u extension)
381 * @n_muid: numeric user id of laster modifier (part of 9p2000.u extension) 376 * @n_muid: numeric user id of laster modifier (part of 9p2000.u extension)
@@ -512,11 +507,6 @@ struct p9_getlock {
512 char *client_id; 507 char *client_id;
513}; 508};
514 509
515/* Structures for Protocol Operations */
516struct p9_tstatfs {
517 u32 fid;
518};
519
520struct p9_rstatfs { 510struct p9_rstatfs {
521 u32 type; 511 u32 type;
522 u32 bsize; 512 u32 bsize;
@@ -529,159 +519,6 @@ struct p9_rstatfs {
529 u32 namelen; 519 u32 namelen;
530}; 520};
531 521
532struct p9_trename {
533 u32 fid;
534 u32 newdirfid;
535 struct p9_str name;
536};
537
538struct p9_rrename {
539};
540
541struct p9_tversion {
542 u32 msize;
543 struct p9_str version;
544};
545
546struct p9_rversion {
547 u32 msize;
548 struct p9_str version;
549};
550
551struct p9_tauth {
552 u32 afid;
553 struct p9_str uname;
554 struct p9_str aname;
555 u32 n_uname; /* 9P2000.u extensions */
556};
557
558struct p9_rauth {
559 struct p9_qid qid;
560};
561
562struct p9_rerror {
563 struct p9_str error;
564 u32 errno; /* 9p2000.u extension */
565};
566
567struct p9_tflush {
568 u16 oldtag;
569};
570
571struct p9_rflush {
572};
573
574struct p9_tattach {
575 u32 fid;
576 u32 afid;
577 struct p9_str uname;
578 struct p9_str aname;
579 u32 n_uname; /* 9P2000.u extensions */
580};
581
582struct p9_rattach {
583 struct p9_qid qid;
584};
585
586struct p9_twalk {
587 u32 fid;
588 u32 newfid;
589 u16 nwname;
590 struct p9_str wnames[16];
591};
592
593struct p9_rwalk {
594 u16 nwqid;
595 struct p9_qid wqids[16];
596};
597
598struct p9_topen {
599 u32 fid;
600 u8 mode;
601};
602
603struct p9_ropen {
604 struct p9_qid qid;
605 u32 iounit;
606};
607
608struct p9_tcreate {
609 u32 fid;
610 struct p9_str name;
611 u32 perm;
612 u8 mode;
613 struct p9_str extension;
614};
615
616struct p9_rcreate {
617 struct p9_qid qid;
618 u32 iounit;
619};
620
621struct p9_tread {
622 u32 fid;
623 u64 offset;
624 u32 count;
625};
626
627struct p9_rread {
628 u32 count;
629 u8 *data;
630};
631
632struct p9_twrite {
633 u32 fid;
634 u64 offset;
635 u32 count;
636 u8 *data;
637};
638
639struct p9_rwrite {
640 u32 count;
641};
642
643struct p9_treaddir {
644 u32 fid;
645 u64 offset;
646 u32 count;
647};
648
649struct p9_rreaddir {
650 u32 count;
651 u8 *data;
652};
653
654
655struct p9_tclunk {
656 u32 fid;
657};
658
659struct p9_rclunk {
660};
661
662struct p9_tremove {
663 u32 fid;
664};
665
666struct p9_rremove {
667};
668
669struct p9_tstat {
670 u32 fid;
671};
672
673struct p9_rstat {
674 struct p9_wstat stat;
675};
676
677struct p9_twstat {
678 u32 fid;
679 struct p9_wstat stat;
680};
681
682struct p9_rwstat {
683};
684
685/** 522/**
686 * struct p9_fcall - primary packet structure 523 * struct p9_fcall - primary packet structure
687 * @size: prefixed length of the structure 524 * @size: prefixed length of the structure
diff --git a/include/net/9p/client.h b/include/net/9p/client.h
index d26d5e98a173..55ce72ce9861 100644
--- a/include/net/9p/client.h
+++ b/include/net/9p/client.h
@@ -36,9 +36,9 @@
36 */ 36 */
37 37
38enum p9_proto_versions{ 38enum p9_proto_versions{
39 p9_proto_legacy = 0, 39 p9_proto_legacy,
40 p9_proto_2000u = 1, 40 p9_proto_2000u,
41 p9_proto_2000L = 2, 41 p9_proto_2000L,
42}; 42};
43 43
44 44
@@ -211,7 +211,10 @@ struct p9_dirent {
211}; 211};
212 212
213int p9_client_statfs(struct p9_fid *fid, struct p9_rstatfs *sb); 213int p9_client_statfs(struct p9_fid *fid, struct p9_rstatfs *sb);
214int p9_client_rename(struct p9_fid *fid, struct p9_fid *newdirfid, char *name); 214int p9_client_rename(struct p9_fid *fid, struct p9_fid *newdirfid,
215 const char *name);
216int p9_client_renameat(struct p9_fid *olddirfid, const char *old_name,
217 struct p9_fid *newdirfid, const char *new_name);
215struct p9_client *p9_client_create(const char *dev_name, char *options); 218struct p9_client *p9_client_create(const char *dev_name, char *options);
216void p9_client_destroy(struct p9_client *clnt); 219void p9_client_destroy(struct p9_client *clnt);
217void p9_client_disconnect(struct p9_client *clnt); 220void p9_client_disconnect(struct p9_client *clnt);
@@ -231,6 +234,7 @@ int p9_client_create_dotl(struct p9_fid *ofid, char *name, u32 flags, u32 mode,
231int p9_client_clunk(struct p9_fid *fid); 234int p9_client_clunk(struct p9_fid *fid);
232int p9_client_fsync(struct p9_fid *fid, int datasync); 235int p9_client_fsync(struct p9_fid *fid, int datasync);
233int p9_client_remove(struct p9_fid *fid); 236int p9_client_remove(struct p9_fid *fid);
237int p9_client_unlinkat(struct p9_fid *dfid, const char *name, int flags);
234int p9_client_read(struct p9_fid *fid, char *data, char __user *udata, 238int p9_client_read(struct p9_fid *fid, char *data, char __user *udata,
235 u64 offset, u32 count); 239 u64 offset, u32 count);
236int p9_client_write(struct p9_fid *fid, char *data, const char __user *udata, 240int p9_client_write(struct p9_fid *fid, char *data, const char __user *udata,
diff --git a/include/net/9p/transport.h b/include/net/9p/transport.h
index d8549fb9c742..83531ebeee99 100644
--- a/include/net/9p/transport.h
+++ b/include/net/9p/transport.h
@@ -67,7 +67,7 @@ struct p9_trans_module {
67 67
68void v9fs_register_trans(struct p9_trans_module *m); 68void v9fs_register_trans(struct p9_trans_module *m);
69void v9fs_unregister_trans(struct p9_trans_module *m); 69void v9fs_unregister_trans(struct p9_trans_module *m);
70struct p9_trans_module *v9fs_get_trans_by_name(const substring_t *name); 70struct p9_trans_module *v9fs_get_trans_by_name(char *s);
71struct p9_trans_module *v9fs_get_default_trans(void); 71struct p9_trans_module *v9fs_get_default_trans(void);
72void v9fs_put_trans(struct p9_trans_module *m); 72void v9fs_put_trans(struct p9_trans_module *m);
73#endif /* NET_9P_TRANSPORT_H */ 73#endif /* NET_9P_TRANSPORT_H */
diff --git a/include/net/act_api.h b/include/net/act_api.h
index bab385f13ac3..c739531e1564 100644
--- a/include/net/act_api.h
+++ b/include/net/act_api.h
@@ -72,7 +72,7 @@ struct tcf_act_hdr {
72 72
73struct tc_action { 73struct tc_action {
74 void *priv; 74 void *priv;
75 struct tc_action_ops *ops; 75 const struct tc_action_ops *ops;
76 __u32 type; /* for backward compat(TCA_OLD_COMPAT) */ 76 __u32 type; /* for backward compat(TCA_OLD_COMPAT) */
77 __u32 order; 77 __u32 order;
78 struct tc_action *next; 78 struct tc_action *next;
@@ -86,7 +86,7 @@ struct tc_action_ops {
86 __u32 type; /* TBD to match kind */ 86 __u32 type; /* TBD to match kind */
87 __u32 capab; /* capabilities includes 4 bit version */ 87 __u32 capab; /* capabilities includes 4 bit version */
88 struct module *owner; 88 struct module *owner;
89 int (*act)(struct sk_buff *, struct tc_action *, struct tcf_result *); 89 int (*act)(struct sk_buff *, const struct tc_action *, struct tcf_result *);
90 int (*get_stats)(struct sk_buff *, struct tc_action *); 90 int (*get_stats)(struct sk_buff *, struct tc_action *);
91 int (*dump)(struct sk_buff *, struct tc_action *, int, int); 91 int (*dump)(struct sk_buff *, struct tc_action *, int, int);
92 int (*cleanup)(struct tc_action *, int bind); 92 int (*cleanup)(struct tc_action *, int bind);
@@ -115,7 +115,7 @@ extern void tcf_hash_insert(struct tcf_common *p, struct tcf_hashinfo *hinfo);
115extern int tcf_register_action(struct tc_action_ops *a); 115extern int tcf_register_action(struct tc_action_ops *a);
116extern int tcf_unregister_action(struct tc_action_ops *a); 116extern int tcf_unregister_action(struct tc_action_ops *a);
117extern void tcf_action_destroy(struct tc_action *a, int bind); 117extern void tcf_action_destroy(struct tc_action *a, int bind);
118extern int tcf_action_exec(struct sk_buff *skb, struct tc_action *a, struct tcf_result *res); 118extern int tcf_action_exec(struct sk_buff *skb, const struct tc_action *a, struct tcf_result *res);
119extern struct tc_action *tcf_action_init(struct nlattr *nla, struct nlattr *est, char *n, int ovr, int bind); 119extern struct tc_action *tcf_action_init(struct nlattr *nla, struct nlattr *est, char *n, int ovr, int bind);
120extern struct tc_action *tcf_action_init_1(struct nlattr *nla, struct nlattr *est, char *n, int ovr, int bind); 120extern struct tc_action *tcf_action_init_1(struct nlattr *nla, struct nlattr *est, char *n, int ovr, int bind);
121extern int tcf_action_dump(struct sk_buff *skb, struct tc_action *a, int, int); 121extern int tcf_action_dump(struct sk_buff *skb, struct tc_action *a, int, int);
diff --git a/include/net/arp.h b/include/net/arp.h
index 91f0568a04ef..4979af8b1559 100644
--- a/include/net/arp.h
+++ b/include/net/arp.h
@@ -8,6 +8,36 @@
8 8
9extern struct neigh_table arp_tbl; 9extern struct neigh_table arp_tbl;
10 10
11static inline u32 arp_hashfn(u32 key, const struct net_device *dev, u32 hash_rnd)
12{
13 u32 val = key ^ dev->ifindex;
14
15 return val * hash_rnd;
16}
17
18static inline struct neighbour *__ipv4_neigh_lookup(struct neigh_table *tbl, struct net_device *dev, u32 key)
19{
20 struct neigh_hash_table *nht;
21 struct neighbour *n;
22 u32 hash_val;
23
24 rcu_read_lock_bh();
25 nht = rcu_dereference_bh(tbl->nht);
26 hash_val = arp_hashfn(key, dev, nht->hash_rnd) >> (32 - nht->hash_shift);
27 for (n = rcu_dereference_bh(nht->hash_buckets[hash_val]);
28 n != NULL;
29 n = rcu_dereference_bh(n->next)) {
30 if (n->dev == dev && *(u32 *)n->primary_key == key) {
31 if (!atomic_inc_not_zero(&n->refcnt))
32 n = NULL;
33 break;
34 }
35 }
36 rcu_read_unlock_bh();
37
38 return n;
39}
40
11extern void arp_init(void); 41extern void arp_init(void);
12extern int arp_find(unsigned char *haddr, struct sk_buff *skb); 42extern int arp_find(unsigned char *haddr, struct sk_buff *skb);
13extern int arp_ioctl(struct net *net, unsigned int cmd, void __user *arg); 43extern int arp_ioctl(struct net *net, unsigned int cmd, void __user *arg);
@@ -15,7 +45,6 @@ extern void arp_send(int type, int ptype, __be32 dest_ip,
15 struct net_device *dev, __be32 src_ip, 45 struct net_device *dev, __be32 src_ip,
16 const unsigned char *dest_hw, 46 const unsigned char *dest_hw,
17 const unsigned char *src_hw, const unsigned char *th); 47 const unsigned char *src_hw, const unsigned char *th);
18extern int arp_bind_neighbour(struct dst_entry *dst);
19extern int arp_mc_map(__be32 addr, u8 *haddr, struct net_device *dev, int dir); 48extern int arp_mc_map(__be32 addr, u8 *haddr, struct net_device *dev, int dir);
20extern void arp_ifdown(struct net_device *dev); 49extern void arp_ifdown(struct net_device *dev);
21 50
diff --git a/include/net/bluetooth/bluetooth.h b/include/net/bluetooth/bluetooth.h
index 43750439c521..e727555d4ee9 100644
--- a/include/net/bluetooth/bluetooth.h
+++ b/include/net/bluetooth/bluetooth.h
@@ -56,6 +56,7 @@
56#define BT_SECURITY 4 56#define BT_SECURITY 4
57struct bt_security { 57struct bt_security {
58 __u8 level; 58 __u8 level;
59 __u8 key_size;
59}; 60};
60#define BT_SECURITY_SDP 0 61#define BT_SECURITY_SDP 0
61#define BT_SECURITY_LOW 1 62#define BT_SECURITY_LOW 1
@@ -69,9 +70,19 @@ struct bt_security {
69#define BT_FLUSHABLE_OFF 0 70#define BT_FLUSHABLE_OFF 0
70#define BT_FLUSHABLE_ON 1 71#define BT_FLUSHABLE_ON 1
71 72
72#define BT_INFO(fmt, arg...) printk(KERN_INFO "Bluetooth: " fmt "\n" , ## arg) 73#define BT_POWER 9
73#define BT_ERR(fmt, arg...) printk(KERN_ERR "%s: " fmt "\n" , __func__ , ## arg) 74struct bt_power {
74#define BT_DBG(fmt, arg...) pr_debug("%s: " fmt "\n" , __func__ , ## arg) 75 __u8 force_active;
76};
77#define BT_POWER_FORCE_ACTIVE_OFF 0
78#define BT_POWER_FORCE_ACTIVE_ON 1
79
80__attribute__((format (printf, 2, 3)))
81int bt_printk(const char *level, const char *fmt, ...);
82
83#define BT_INFO(fmt, arg...) bt_printk(KERN_INFO, pr_fmt(fmt), ##arg)
84#define BT_ERR(fmt, arg...) bt_printk(KERN_ERR, pr_fmt(fmt), ##arg)
85#define BT_DBG(fmt, arg...) pr_debug(fmt "\n", ##arg)
75 86
76/* Connection and socket states */ 87/* Connection and socket states */
77enum { 88enum {
@@ -130,7 +141,8 @@ int bt_sock_register(int proto, const struct net_proto_family *ops);
130int bt_sock_unregister(int proto); 141int bt_sock_unregister(int proto);
131void bt_sock_link(struct bt_sock_list *l, struct sock *s); 142void bt_sock_link(struct bt_sock_list *l, struct sock *s);
132void bt_sock_unlink(struct bt_sock_list *l, struct sock *s); 143void bt_sock_unlink(struct bt_sock_list *l, struct sock *s);
133int bt_sock_recvmsg(struct kiocb *iocb, struct socket *sock, struct msghdr *msg, size_t len, int flags); 144int bt_sock_recvmsg(struct kiocb *iocb, struct socket *sock,
145 struct msghdr *msg, size_t len, int flags);
134int bt_sock_stream_recvmsg(struct kiocb *iocb, struct socket *sock, 146int bt_sock_stream_recvmsg(struct kiocb *iocb, struct socket *sock,
135 struct msghdr *msg, size_t len, int flags); 147 struct msghdr *msg, size_t len, int flags);
136uint bt_sock_poll(struct file * file, struct socket *sock, poll_table *wait); 148uint bt_sock_poll(struct file * file, struct socket *sock, poll_table *wait);
@@ -150,6 +162,7 @@ struct bt_skb_cb {
150 __u8 retries; 162 __u8 retries;
151 __u8 sar; 163 __u8 sar;
152 unsigned short channel; 164 unsigned short channel;
165 __u8 force_active;
153}; 166};
154#define bt_cb(skb) ((struct bt_skb_cb *)((skb)->cb)) 167#define bt_cb(skb) ((struct bt_skb_cb *)((skb)->cb))
155 168
@@ -164,8 +177,8 @@ static inline struct sk_buff *bt_skb_alloc(unsigned int len, gfp_t how)
164 return skb; 177 return skb;
165} 178}
166 179
167static inline struct sk_buff *bt_skb_send_alloc(struct sock *sk, unsigned long len, 180static inline struct sk_buff *bt_skb_send_alloc(struct sock *sk,
168 int nb, int *err) 181 unsigned long len, int nb, int *err)
169{ 182{
170 struct sk_buff *skb; 183 struct sk_buff *skb;
171 184
@@ -195,7 +208,7 @@ out:
195 return NULL; 208 return NULL;
196} 209}
197 210
198int bt_err(__u16 code); 211int bt_to_errno(__u16 code);
199 212
200extern int hci_sock_init(void); 213extern int hci_sock_init(void);
201extern void hci_sock_cleanup(void); 214extern void hci_sock_cleanup(void);
diff --git a/include/net/bluetooth/hci.h b/include/net/bluetooth/hci.h
index 0c20227e57f6..be30aabe7b88 100644
--- a/include/net/bluetooth/hci.h
+++ b/include/net/bluetooth/hci.h
@@ -211,11 +211,16 @@ enum {
211#define LMP_EDR_3S_ESCO 0x80 211#define LMP_EDR_3S_ESCO 0x80
212 212
213#define LMP_EXT_INQ 0x01 213#define LMP_EXT_INQ 0x01
214#define LMP_SIMUL_LE_BR 0x02
214#define LMP_SIMPLE_PAIR 0x08 215#define LMP_SIMPLE_PAIR 0x08
215#define LMP_NO_FLUSH 0x40 216#define LMP_NO_FLUSH 0x40
216 217
217#define LMP_LSTO 0x01 218#define LMP_LSTO 0x01
218#define LMP_INQ_TX_PWR 0x02 219#define LMP_INQ_TX_PWR 0x02
220#define LMP_EXTFEATURES 0x80
221
222/* Extended LMP features */
223#define LMP_HOST_LE 0x02
219 224
220/* Connection modes */ 225/* Connection modes */
221#define HCI_CM_ACTIVE 0x0000 226#define HCI_CM_ACTIVE 0x0000
@@ -254,6 +259,10 @@ enum {
254#define HCI_LK_UNAUTH_COMBINATION 0x04 259#define HCI_LK_UNAUTH_COMBINATION 0x04
255#define HCI_LK_AUTH_COMBINATION 0x05 260#define HCI_LK_AUTH_COMBINATION 0x05
256#define HCI_LK_CHANGED_COMBINATION 0x06 261#define HCI_LK_CHANGED_COMBINATION 0x06
262/* The spec doesn't define types for SMP keys */
263#define HCI_LK_SMP_LTK 0x81
264#define HCI_LK_SMP_IRK 0x82
265#define HCI_LK_SMP_CSRK 0x83
257 266
258/* ----- HCI Commands ---- */ 267/* ----- HCI Commands ---- */
259#define HCI_OP_NOP 0x0000 268#define HCI_OP_NOP 0x0000
@@ -653,6 +662,12 @@ struct hci_rp_read_local_oob_data {
653 662
654#define HCI_OP_READ_INQ_RSP_TX_POWER 0x0c58 663#define HCI_OP_READ_INQ_RSP_TX_POWER 0x0c58
655 664
665#define HCI_OP_WRITE_LE_HOST_SUPPORTED 0x0c6d
666struct hci_cp_write_le_host_supported {
667 __u8 le;
668 __u8 simul;
669} __packed;
670
656#define HCI_OP_READ_LOCAL_VERSION 0x1001 671#define HCI_OP_READ_LOCAL_VERSION 0x1001
657struct hci_rp_read_local_version { 672struct hci_rp_read_local_version {
658 __u8 status; 673 __u8 status;
@@ -676,6 +691,9 @@ struct hci_rp_read_local_features {
676} __packed; 691} __packed;
677 692
678#define HCI_OP_READ_LOCAL_EXT_FEATURES 0x1004 693#define HCI_OP_READ_LOCAL_EXT_FEATURES 0x1004
694struct hci_cp_read_local_ext_features {
695 __u8 page;
696} __packed;
679struct hci_rp_read_local_ext_features { 697struct hci_rp_read_local_ext_features {
680 __u8 status; 698 __u8 status;
681 __u8 page; 699 __u8 page;
@@ -710,6 +728,12 @@ struct hci_rp_le_read_buffer_size {
710 __u8 le_max_pkt; 728 __u8 le_max_pkt;
711} __packed; 729} __packed;
712 730
731#define HCI_OP_LE_SET_SCAN_ENABLE 0x200c
732struct hci_cp_le_set_scan_enable {
733 __u8 enable;
734 __u8 filter_dup;
735} __packed;
736
713#define HCI_OP_LE_CREATE_CONN 0x200d 737#define HCI_OP_LE_CREATE_CONN 0x200d
714struct hci_cp_le_create_conn { 738struct hci_cp_le_create_conn {
715 __le16 scan_interval; 739 __le16 scan_interval;
@@ -739,6 +763,33 @@ struct hci_cp_le_conn_update {
739 __le16 max_ce_len; 763 __le16 max_ce_len;
740} __packed; 764} __packed;
741 765
766#define HCI_OP_LE_START_ENC 0x2019
767struct hci_cp_le_start_enc {
768 __le16 handle;
769 __u8 rand[8];
770 __le16 ediv;
771 __u8 ltk[16];
772} __packed;
773
774#define HCI_OP_LE_LTK_REPLY 0x201a
775struct hci_cp_le_ltk_reply {
776 __le16 handle;
777 __u8 ltk[16];
778} __packed;
779struct hci_rp_le_ltk_reply {
780 __u8 status;
781 __le16 handle;
782} __packed;
783
784#define HCI_OP_LE_LTK_NEG_REPLY 0x201b
785struct hci_cp_le_ltk_neg_reply {
786 __le16 handle;
787} __packed;
788struct hci_rp_le_ltk_neg_reply {
789 __u8 status;
790 __le16 handle;
791} __packed;
792
742/* ---- HCI Events ---- */ 793/* ---- HCI Events ---- */
743#define HCI_EV_INQUIRY_COMPLETE 0x01 794#define HCI_EV_INQUIRY_COMPLETE 0x01
744 795
@@ -1029,6 +1080,32 @@ struct hci_ev_le_conn_complete {
1029 __u8 clk_accurancy; 1080 __u8 clk_accurancy;
1030} __packed; 1081} __packed;
1031 1082
1083#define HCI_EV_LE_LTK_REQ 0x05
1084struct hci_ev_le_ltk_req {
1085 __le16 handle;
1086 __u8 random[8];
1087 __le16 ediv;
1088} __packed;
1089
1090/* Advertising report event types */
1091#define ADV_IND 0x00
1092#define ADV_DIRECT_IND 0x01
1093#define ADV_SCAN_IND 0x02
1094#define ADV_NONCONN_IND 0x03
1095#define ADV_SCAN_RSP 0x04
1096
1097#define ADDR_LE_DEV_PUBLIC 0x00
1098#define ADDR_LE_DEV_RANDOM 0x01
1099
1100#define HCI_EV_LE_ADVERTISING_REPORT 0x02
1101struct hci_ev_le_advertising_info {
1102 __u8 evt_type;
1103 __u8 bdaddr_type;
1104 bdaddr_t bdaddr;
1105 __u8 length;
1106 __u8 data[0];
1107} __packed;
1108
1032/* Internal events generated by Bluetooth stack */ 1109/* Internal events generated by Bluetooth stack */
1033#define HCI_EV_STACK_INTERNAL 0xfd 1110#define HCI_EV_STACK_INTERNAL 0xfd
1034struct hci_ev_stack_internal { 1111struct hci_ev_stack_internal {
diff --git a/include/net/bluetooth/hci_core.h b/include/net/bluetooth/hci_core.h
index 6c994c004d15..8f441b8b2963 100644
--- a/include/net/bluetooth/hci_core.h
+++ b/include/net/bluetooth/hci_core.h
@@ -25,6 +25,7 @@
25#ifndef __HCI_CORE_H 25#ifndef __HCI_CORE_H
26#define __HCI_CORE_H 26#define __HCI_CORE_H
27 27
28#include <linux/interrupt.h>
28#include <net/bluetooth/hci.h> 29#include <net/bluetooth/hci.h>
29 30
30/* HCI upper protocols */ 31/* HCI upper protocols */
@@ -74,12 +75,28 @@ struct bt_uuid {
74 u8 svc_hint; 75 u8 svc_hint;
75}; 76};
76 77
78struct key_master_id {
79 __le16 ediv;
80 u8 rand[8];
81} __packed;
82
83struct link_key_data {
84 bdaddr_t bdaddr;
85 u8 type;
86 u8 val[16];
87 u8 pin_len;
88 u8 dlen;
89 u8 data[0];
90} __packed;
91
77struct link_key { 92struct link_key {
78 struct list_head list; 93 struct list_head list;
79 bdaddr_t bdaddr; 94 bdaddr_t bdaddr;
80 u8 type; 95 u8 type;
81 u8 val[16]; 96 u8 val[16];
82 u8 pin_len; 97 u8 pin_len;
98 u8 dlen;
99 u8 data[0];
83}; 100};
84 101
85struct oob_data { 102struct oob_data {
@@ -89,6 +106,12 @@ struct oob_data {
89 u8 randomizer[16]; 106 u8 randomizer[16];
90}; 107};
91 108
109struct adv_entry {
110 struct list_head list;
111 bdaddr_t bdaddr;
112 u8 bdaddr_type;
113};
114
92#define NUM_REASSEMBLY 4 115#define NUM_REASSEMBLY 4
93struct hci_dev { 116struct hci_dev {
94 struct list_head list; 117 struct list_head list;
@@ -107,6 +130,7 @@ struct hci_dev {
107 __u8 major_class; 130 __u8 major_class;
108 __u8 minor_class; 131 __u8 minor_class;
109 __u8 features[8]; 132 __u8 features[8];
133 __u8 extfeatures[8];
110 __u8 commands[64]; 134 __u8 commands[64];
111 __u8 ssp_mode; 135 __u8 ssp_mode;
112 __u8 hci_ver; 136 __u8 hci_ver;
@@ -171,6 +195,8 @@ struct hci_dev {
171 195
172 __u16 init_last_cmd; 196 __u16 init_last_cmd;
173 197
198 struct crypto_blkcipher *tfm;
199
174 struct inquiry_cache inq_cache; 200 struct inquiry_cache inq_cache;
175 struct hci_conn_hash conn_hash; 201 struct hci_conn_hash conn_hash;
176 struct list_head blacklist; 202 struct list_head blacklist;
@@ -181,6 +207,9 @@ struct hci_dev {
181 207
182 struct list_head remote_oob_data; 208 struct list_head remote_oob_data;
183 209
210 struct list_head adv_entries;
211 struct timer_list adv_timer;
212
184 struct hci_dev_stats stat; 213 struct hci_dev_stats stat;
185 214
186 struct sk_buff_head driver_init; 215 struct sk_buff_head driver_init;
@@ -212,9 +241,9 @@ struct hci_conn {
212 struct list_head list; 241 struct list_head list;
213 242
214 atomic_t refcnt; 243 atomic_t refcnt;
215 spinlock_t lock;
216 244
217 bdaddr_t dst; 245 bdaddr_t dst;
246 __u8 dst_type;
218 __u16 handle; 247 __u16 handle;
219 __u16 state; 248 __u16 state;
220 __u8 mode; 249 __u8 mode;
@@ -233,6 +262,7 @@ struct hci_conn {
233 __u8 sec_level; 262 __u8 sec_level;
234 __u8 pending_sec_level; 263 __u8 pending_sec_level;
235 __u8 pin_length; 264 __u8 pin_length;
265 __u8 enc_key_size;
236 __u8 io_capability; 266 __u8 io_capability;
237 __u8 power_save; 267 __u8 power_save;
238 __u16 disc_timeout; 268 __u16 disc_timeout;
@@ -259,7 +289,6 @@ struct hci_conn {
259 struct hci_dev *hdev; 289 struct hci_dev *hdev;
260 void *l2cap_data; 290 void *l2cap_data;
261 void *sco_data; 291 void *sco_data;
262 void *priv;
263 292
264 struct hci_conn *link; 293 struct hci_conn *link;
265 294
@@ -307,12 +336,14 @@ static inline long inquiry_entry_age(struct inquiry_entry *e)
307 return jiffies - e->timestamp; 336 return jiffies - e->timestamp;
308} 337}
309 338
310struct inquiry_entry *hci_inquiry_cache_lookup(struct hci_dev *hdev, bdaddr_t *bdaddr); 339struct inquiry_entry *hci_inquiry_cache_lookup(struct hci_dev *hdev,
340 bdaddr_t *bdaddr);
311void hci_inquiry_cache_update(struct hci_dev *hdev, struct inquiry_data *data); 341void hci_inquiry_cache_update(struct hci_dev *hdev, struct inquiry_data *data);
312 342
313/* ----- HCI Connections ----- */ 343/* ----- HCI Connections ----- */
314enum { 344enum {
315 HCI_CONN_AUTH_PEND, 345 HCI_CONN_AUTH_PEND,
346 HCI_CONN_REAUTH_PEND,
316 HCI_CONN_ENCRYPT_PEND, 347 HCI_CONN_ENCRYPT_PEND,
317 HCI_CONN_RSWITCH_PEND, 348 HCI_CONN_RSWITCH_PEND,
318 HCI_CONN_MODE_CHANGE_PEND, 349 HCI_CONN_MODE_CHANGE_PEND,
@@ -420,14 +451,15 @@ int hci_conn_del(struct hci_conn *conn);
420void hci_conn_hash_flush(struct hci_dev *hdev); 451void hci_conn_hash_flush(struct hci_dev *hdev);
421void hci_conn_check_pending(struct hci_dev *hdev); 452void hci_conn_check_pending(struct hci_dev *hdev);
422 453
423struct hci_conn *hci_connect(struct hci_dev *hdev, int type, bdaddr_t *dst, __u8 sec_level, __u8 auth_type); 454struct hci_conn *hci_connect(struct hci_dev *hdev, int type, bdaddr_t *dst,
455 __u8 sec_level, __u8 auth_type);
424int hci_conn_check_link_mode(struct hci_conn *conn); 456int hci_conn_check_link_mode(struct hci_conn *conn);
425int hci_conn_check_secure(struct hci_conn *conn, __u8 sec_level); 457int hci_conn_check_secure(struct hci_conn *conn, __u8 sec_level);
426int hci_conn_security(struct hci_conn *conn, __u8 sec_level, __u8 auth_type); 458int hci_conn_security(struct hci_conn *conn, __u8 sec_level, __u8 auth_type);
427int hci_conn_change_link_key(struct hci_conn *conn); 459int hci_conn_change_link_key(struct hci_conn *conn);
428int hci_conn_switch_role(struct hci_conn *conn, __u8 role); 460int hci_conn_switch_role(struct hci_conn *conn, __u8 role);
429 461
430void hci_conn_enter_active_mode(struct hci_conn *conn); 462void hci_conn_enter_active_mode(struct hci_conn *conn, __u8 force_active);
431void hci_conn_enter_sniff_mode(struct hci_conn *conn); 463void hci_conn_enter_sniff_mode(struct hci_conn *conn);
432 464
433void hci_conn_hold_device(struct hci_conn *conn); 465void hci_conn_hold_device(struct hci_conn *conn);
@@ -449,10 +481,12 @@ static inline void hci_conn_put(struct hci_conn *conn)
449 timeo = msecs_to_jiffies(conn->disc_timeout); 481 timeo = msecs_to_jiffies(conn->disc_timeout);
450 if (!conn->out) 482 if (!conn->out)
451 timeo *= 2; 483 timeo *= 2;
452 } else 484 } else {
453 timeo = msecs_to_jiffies(10); 485 timeo = msecs_to_jiffies(10);
454 } else 486 }
487 } else {
455 timeo = msecs_to_jiffies(10); 488 timeo = msecs_to_jiffies(10);
489 }
456 mod_timer(&conn->disc_timer, jiffies + timeo); 490 mod_timer(&conn->disc_timer, jiffies + timeo);
457 } 491 }
458} 492}
@@ -511,6 +545,8 @@ int hci_inquiry(void __user *arg);
511 545
512struct bdaddr_list *hci_blacklist_lookup(struct hci_dev *hdev, bdaddr_t *bdaddr); 546struct bdaddr_list *hci_blacklist_lookup(struct hci_dev *hdev, bdaddr_t *bdaddr);
513int hci_blacklist_clear(struct hci_dev *hdev); 547int hci_blacklist_clear(struct hci_dev *hdev);
548int hci_blacklist_add(struct hci_dev *hdev, bdaddr_t *bdaddr);
549int hci_blacklist_del(struct hci_dev *hdev, bdaddr_t *bdaddr);
514 550
515int hci_uuids_clear(struct hci_dev *hdev); 551int hci_uuids_clear(struct hci_dev *hdev);
516 552
@@ -518,6 +554,11 @@ int hci_link_keys_clear(struct hci_dev *hdev);
518struct link_key *hci_find_link_key(struct hci_dev *hdev, bdaddr_t *bdaddr); 554struct link_key *hci_find_link_key(struct hci_dev *hdev, bdaddr_t *bdaddr);
519int hci_add_link_key(struct hci_dev *hdev, struct hci_conn *conn, int new_key, 555int hci_add_link_key(struct hci_dev *hdev, struct hci_conn *conn, int new_key,
520 bdaddr_t *bdaddr, u8 *val, u8 type, u8 pin_len); 556 bdaddr_t *bdaddr, u8 *val, u8 type, u8 pin_len);
557struct link_key *hci_find_ltk(struct hci_dev *hdev, __le16 ediv, u8 rand[8]);
558struct link_key *hci_find_link_key_type(struct hci_dev *hdev,
559 bdaddr_t *bdaddr, u8 type);
560int hci_add_ltk(struct hci_dev *hdev, int new_key, bdaddr_t *bdaddr,
561 u8 key_size, __le16 ediv, u8 rand[8], u8 ltk[16]);
521int hci_remove_link_key(struct hci_dev *hdev, bdaddr_t *bdaddr); 562int hci_remove_link_key(struct hci_dev *hdev, bdaddr_t *bdaddr);
522 563
523int hci_remote_oob_data_clear(struct hci_dev *hdev); 564int hci_remote_oob_data_clear(struct hci_dev *hdev);
@@ -527,6 +568,12 @@ int hci_add_remote_oob_data(struct hci_dev *hdev, bdaddr_t *bdaddr, u8 *hash,
527 u8 *randomizer); 568 u8 *randomizer);
528int hci_remove_remote_oob_data(struct hci_dev *hdev, bdaddr_t *bdaddr); 569int hci_remove_remote_oob_data(struct hci_dev *hdev, bdaddr_t *bdaddr);
529 570
571#define ADV_CLEAR_TIMEOUT (3*60*HZ) /* Three minutes */
572int hci_adv_entries_clear(struct hci_dev *hdev);
573struct adv_entry *hci_find_adv_entry(struct hci_dev *hdev, bdaddr_t *bdaddr);
574int hci_add_adv_entry(struct hci_dev *hdev,
575 struct hci_ev_le_advertising_info *ev);
576
530void hci_del_off_timer(struct hci_dev *hdev); 577void hci_del_off_timer(struct hci_dev *hdev);
531 578
532void hci_event_packet(struct hci_dev *hdev, struct sk_buff *skb); 579void hci_event_packet(struct hci_dev *hdev, struct sk_buff *skb);
@@ -553,6 +600,9 @@ void hci_conn_del_sysfs(struct hci_conn *conn);
553#define lmp_no_flush_capable(dev) ((dev)->features[6] & LMP_NO_FLUSH) 600#define lmp_no_flush_capable(dev) ((dev)->features[6] & LMP_NO_FLUSH)
554#define lmp_le_capable(dev) ((dev)->features[4] & LMP_LE) 601#define lmp_le_capable(dev) ((dev)->features[4] & LMP_LE)
555 602
603/* ----- Extended LMP capabilities ----- */
604#define lmp_host_le_capable(dev) ((dev)->extfeatures[0] & LMP_HOST_LE)
605
556/* ----- HCI protocols ----- */ 606/* ----- HCI protocols ----- */
557struct hci_proto { 607struct hci_proto {
558 char *name; 608 char *name;
@@ -561,16 +611,20 @@ struct hci_proto {
561 611
562 void *priv; 612 void *priv;
563 613
564 int (*connect_ind) (struct hci_dev *hdev, bdaddr_t *bdaddr, __u8 type); 614 int (*connect_ind) (struct hci_dev *hdev, bdaddr_t *bdaddr,
615 __u8 type);
565 int (*connect_cfm) (struct hci_conn *conn, __u8 status); 616 int (*connect_cfm) (struct hci_conn *conn, __u8 status);
566 int (*disconn_ind) (struct hci_conn *conn); 617 int (*disconn_ind) (struct hci_conn *conn);
567 int (*disconn_cfm) (struct hci_conn *conn, __u8 reason); 618 int (*disconn_cfm) (struct hci_conn *conn, __u8 reason);
568 int (*recv_acldata) (struct hci_conn *conn, struct sk_buff *skb, __u16 flags); 619 int (*recv_acldata) (struct hci_conn *conn, struct sk_buff *skb,
620 __u16 flags);
569 int (*recv_scodata) (struct hci_conn *conn, struct sk_buff *skb); 621 int (*recv_scodata) (struct hci_conn *conn, struct sk_buff *skb);
570 int (*security_cfm) (struct hci_conn *conn, __u8 status, __u8 encrypt); 622 int (*security_cfm) (struct hci_conn *conn, __u8 status,
623 __u8 encrypt);
571}; 624};
572 625
573static inline int hci_proto_connect_ind(struct hci_dev *hdev, bdaddr_t *bdaddr, __u8 type) 626static inline int hci_proto_connect_ind(struct hci_dev *hdev, bdaddr_t *bdaddr,
627 __u8 type)
574{ 628{
575 register struct hci_proto *hp; 629 register struct hci_proto *hp;
576 int mask = 0; 630 int mask = 0;
@@ -656,7 +710,8 @@ static inline void hci_proto_auth_cfm(struct hci_conn *conn, __u8 status)
656 conn->security_cfm_cb(conn, status); 710 conn->security_cfm_cb(conn, status);
657} 711}
658 712
659static inline void hci_proto_encrypt_cfm(struct hci_conn *conn, __u8 status, __u8 encrypt) 713static inline void hci_proto_encrypt_cfm(struct hci_conn *conn, __u8 status,
714 __u8 encrypt)
660{ 715{
661 register struct hci_proto *hp; 716 register struct hci_proto *hp;
662 717
@@ -681,7 +736,8 @@ struct hci_cb {
681 736
682 char *name; 737 char *name;
683 738
684 void (*security_cfm) (struct hci_conn *conn, __u8 status, __u8 encrypt); 739 void (*security_cfm) (struct hci_conn *conn, __u8 status,
740 __u8 encrypt);
685 void (*key_change_cfm) (struct hci_conn *conn, __u8 status); 741 void (*key_change_cfm) (struct hci_conn *conn, __u8 status);
686 void (*role_switch_cfm) (struct hci_conn *conn, __u8 status, __u8 role); 742 void (*role_switch_cfm) (struct hci_conn *conn, __u8 status, __u8 role);
687}; 743};
@@ -707,13 +763,17 @@ static inline void hci_auth_cfm(struct hci_conn *conn, __u8 status)
707 read_unlock_bh(&hci_cb_list_lock); 763 read_unlock_bh(&hci_cb_list_lock);
708} 764}
709 765
710static inline void hci_encrypt_cfm(struct hci_conn *conn, __u8 status, __u8 encrypt) 766static inline void hci_encrypt_cfm(struct hci_conn *conn, __u8 status,
767 __u8 encrypt)
711{ 768{
712 struct list_head *p; 769 struct list_head *p;
713 770
714 if (conn->sec_level == BT_SECURITY_SDP) 771 if (conn->sec_level == BT_SECURITY_SDP)
715 conn->sec_level = BT_SECURITY_LOW; 772 conn->sec_level = BT_SECURITY_LOW;
716 773
774 if (conn->pending_sec_level > conn->sec_level)
775 conn->sec_level = conn->pending_sec_level;
776
717 hci_proto_encrypt_cfm(conn, status, encrypt); 777 hci_proto_encrypt_cfm(conn, status, encrypt);
718 778
719 read_lock_bh(&hci_cb_list_lock); 779 read_lock_bh(&hci_cb_list_lock);
@@ -738,7 +798,8 @@ static inline void hci_key_change_cfm(struct hci_conn *conn, __u8 status)
738 read_unlock_bh(&hci_cb_list_lock); 798 read_unlock_bh(&hci_cb_list_lock);
739} 799}
740 800
741static inline void hci_role_switch_cfm(struct hci_conn *conn, __u8 status, __u8 role) 801static inline void hci_role_switch_cfm(struct hci_conn *conn, __u8 status,
802 __u8 role)
742{ 803{
743 struct list_head *p; 804 struct list_head *p;
744 805
@@ -830,4 +891,9 @@ void hci_req_complete(struct hci_dev *hdev, __u16 cmd, int result);
830 891
831void hci_le_conn_update(struct hci_conn *conn, u16 min, u16 max, 892void hci_le_conn_update(struct hci_conn *conn, u16 min, u16 max,
832 u16 latency, u16 to_multiplier); 893 u16 latency, u16 to_multiplier);
894void hci_le_start_enc(struct hci_conn *conn, __le16 ediv, __u8 rand[8],
895 __u8 ltk[16]);
896void hci_le_ltk_reply(struct hci_conn *conn, u8 ltk[16]);
897void hci_le_ltk_neg_reply(struct hci_conn *conn);
898
833#endif /* __HCI_CORE_H */ 899#endif /* __HCI_CORE_H */
diff --git a/include/net/bluetooth/l2cap.h b/include/net/bluetooth/l2cap.h
index d09c9b1118e3..4f34ad25e75c 100644
--- a/include/net/bluetooth/l2cap.h
+++ b/include/net/bluetooth/l2cap.h
@@ -37,7 +37,6 @@
37#define L2CAP_DEFAULT_MONITOR_TO 12000 /* 12 seconds */ 37#define L2CAP_DEFAULT_MONITOR_TO 12000 /* 12 seconds */
38#define L2CAP_DEFAULT_MAX_PDU_SIZE 1009 /* Sized for 3-DH5 packet */ 38#define L2CAP_DEFAULT_MAX_PDU_SIZE 1009 /* Sized for 3-DH5 packet */
39#define L2CAP_DEFAULT_ACK_TO 200 39#define L2CAP_DEFAULT_ACK_TO 200
40#define L2CAP_LOCAL_BUSY_TRIES 12
41#define L2CAP_LE_DEFAULT_MTU 23 40#define L2CAP_LE_DEFAULT_MTU 23
42 41
43#define L2CAP_CONN_TIMEOUT (40000) /* 40 seconds */ 42#define L2CAP_CONN_TIMEOUT (40000) /* 40 seconds */
@@ -130,6 +129,12 @@ struct l2cap_conninfo {
130#define L2CAP_SDU_END 0x8000 129#define L2CAP_SDU_END 0x8000
131#define L2CAP_SDU_CONTINUE 0xC000 130#define L2CAP_SDU_CONTINUE 0xC000
132 131
132/* L2CAP Command rej. reasons */
133#define L2CAP_REJ_NOT_UNDERSTOOD 0x0000
134#define L2CAP_REJ_MTU_EXCEEDED 0x0001
135#define L2CAP_REJ_INVALID_CID 0x0002
136
137
133/* L2CAP structures */ 138/* L2CAP structures */
134struct l2cap_hdr { 139struct l2cap_hdr {
135 __le16 len; 140 __le16 len;
@@ -144,8 +149,19 @@ struct l2cap_cmd_hdr {
144} __packed; 149} __packed;
145#define L2CAP_CMD_HDR_SIZE 4 150#define L2CAP_CMD_HDR_SIZE 4
146 151
147struct l2cap_cmd_rej { 152struct l2cap_cmd_rej_unk {
153 __le16 reason;
154} __packed;
155
156struct l2cap_cmd_rej_mtu {
157 __le16 reason;
158 __le16 max_mtu;
159} __packed;
160
161struct l2cap_cmd_rej_cid {
148 __le16 reason; 162 __le16 reason;
163 __le16 scid;
164 __le16 dcid;
149} __packed; 165} __packed;
150 166
151struct l2cap_conn_req { 167struct l2cap_conn_req {
@@ -287,6 +303,10 @@ struct l2cap_chan {
287 303
288 struct l2cap_conn *conn; 304 struct l2cap_conn *conn;
289 305
306 __u8 state;
307
308 atomic_t refcnt;
309
290 __le16 psm; 310 __le16 psm;
291 __u16 dcid; 311 __u16 dcid;
292 __u16 scid; 312 __u16 scid;
@@ -295,6 +315,7 @@ struct l2cap_chan {
295 __u16 omtu; 315 __u16 omtu;
296 __u16 flush_to; 316 __u16 flush_to;
297 __u8 mode; 317 __u8 mode;
318 __u8 chan_type;
298 319
299 __le16 sport; 320 __le16 sport;
300 321
@@ -302,6 +323,7 @@ struct l2cap_chan {
302 __u8 role_switch; 323 __u8 role_switch;
303 __u8 force_reliable; 324 __u8 force_reliable;
304 __u8 flushable; 325 __u8 flushable;
326 __u8 force_active;
305 327
306 __u8 ident; 328 __u8 ident;
307 329
@@ -318,8 +340,8 @@ struct l2cap_chan {
318 __u16 monitor_timeout; 340 __u16 monitor_timeout;
319 __u16 mps; 341 __u16 mps;
320 342
321 __u8 conf_state; 343 unsigned long conf_state;
322 __u16 conn_state; 344 unsigned long conn_state;
323 345
324 __u8 next_tx_seq; 346 __u8 next_tx_seq;
325 __u8 expected_ack_seq; 347 __u8 expected_ack_seq;
@@ -339,18 +361,29 @@ struct l2cap_chan {
339 __u8 remote_max_tx; 361 __u8 remote_max_tx;
340 __u16 remote_mps; 362 __u16 remote_mps;
341 363
364 struct timer_list chan_timer;
342 struct timer_list retrans_timer; 365 struct timer_list retrans_timer;
343 struct timer_list monitor_timer; 366 struct timer_list monitor_timer;
344 struct timer_list ack_timer; 367 struct timer_list ack_timer;
345 struct sk_buff *tx_send_head; 368 struct sk_buff *tx_send_head;
346 struct sk_buff_head tx_q; 369 struct sk_buff_head tx_q;
347 struct sk_buff_head srej_q; 370 struct sk_buff_head srej_q;
348 struct sk_buff_head busy_q;
349 struct work_struct busy_work;
350 struct list_head srej_l; 371 struct list_head srej_l;
351 372
352 struct list_head list; 373 struct list_head list;
353 struct list_head global_l; 374 struct list_head global_l;
375
376 void *data;
377 struct l2cap_ops *ops;
378};
379
380struct l2cap_ops {
381 char *name;
382
383 struct l2cap_chan *(*new_connection) (void *data);
384 int (*recv) (void *data, struct sk_buff *skb);
385 void (*close) (void *data);
386 void (*state_change) (void *data, int state);
354}; 387};
355 388
356struct l2cap_conn { 389struct l2cap_conn {
@@ -376,6 +409,15 @@ struct l2cap_conn {
376 409
377 __u8 disc_reason; 410 __u8 disc_reason;
378 411
412 __u8 preq[7]; /* SMP Pairing Request */
413 __u8 prsp[7]; /* SMP Pairing Response */
414 __u8 prnd[16]; /* SMP Pairing Random */
415 __u8 pcnf[16]; /* SMP Pairing Confirm */
416 __u8 tk[16]; /* SMP Temporary Key */
417 __u8 smp_key_size;
418
419 struct timer_list security_timer;
420
379 struct list_head chan_l; 421 struct list_head chan_l;
380 rwlock_t chan_lock; 422 rwlock_t chan_lock;
381}; 423};
@@ -384,44 +426,57 @@ struct l2cap_conn {
384#define L2CAP_INFO_FEAT_MASK_REQ_SENT 0x04 426#define L2CAP_INFO_FEAT_MASK_REQ_SENT 0x04
385#define L2CAP_INFO_FEAT_MASK_REQ_DONE 0x08 427#define L2CAP_INFO_FEAT_MASK_REQ_DONE 0x08
386 428
429#define L2CAP_CHAN_RAW 1
430#define L2CAP_CHAN_CONN_LESS 2
431#define L2CAP_CHAN_CONN_ORIENTED 3
432
387/* ----- L2CAP socket info ----- */ 433/* ----- L2CAP socket info ----- */
388#define l2cap_pi(sk) ((struct l2cap_pinfo *) sk) 434#define l2cap_pi(sk) ((struct l2cap_pinfo *) sk)
389 435
390struct l2cap_pinfo { 436struct l2cap_pinfo {
391 struct bt_sock bt; 437 struct bt_sock bt;
392 struct l2cap_chan *chan; 438 struct l2cap_chan *chan;
439 struct sk_buff *rx_busy_skb;
393}; 440};
394 441
395#define L2CAP_CONF_REQ_SENT 0x01 442enum {
396#define L2CAP_CONF_INPUT_DONE 0x02 443 CONF_REQ_SENT,
397#define L2CAP_CONF_OUTPUT_DONE 0x04 444 CONF_INPUT_DONE,
398#define L2CAP_CONF_MTU_DONE 0x08 445 CONF_OUTPUT_DONE,
399#define L2CAP_CONF_MODE_DONE 0x10 446 CONF_MTU_DONE,
400#define L2CAP_CONF_CONNECT_PEND 0x20 447 CONF_MODE_DONE,
401#define L2CAP_CONF_NO_FCS_RECV 0x40 448 CONF_CONNECT_PEND,
402#define L2CAP_CONF_STATE2_DEVICE 0x80 449 CONF_NO_FCS_RECV,
450 CONF_STATE2_DEVICE,
451};
403 452
404#define L2CAP_CONF_MAX_CONF_REQ 2 453#define L2CAP_CONF_MAX_CONF_REQ 2
405#define L2CAP_CONF_MAX_CONF_RSP 2 454#define L2CAP_CONF_MAX_CONF_RSP 2
406 455
407#define L2CAP_CONN_SAR_SDU 0x0001 456enum {
408#define L2CAP_CONN_SREJ_SENT 0x0002 457 CONN_SAR_SDU,
409#define L2CAP_CONN_WAIT_F 0x0004 458 CONN_SREJ_SENT,
410#define L2CAP_CONN_SREJ_ACT 0x0008 459 CONN_WAIT_F,
411#define L2CAP_CONN_SEND_PBIT 0x0010 460 CONN_SREJ_ACT,
412#define L2CAP_CONN_REMOTE_BUSY 0x0020 461 CONN_SEND_PBIT,
413#define L2CAP_CONN_LOCAL_BUSY 0x0040 462 CONN_REMOTE_BUSY,
414#define L2CAP_CONN_REJ_ACT 0x0080 463 CONN_LOCAL_BUSY,
415#define L2CAP_CONN_SEND_FBIT 0x0100 464 CONN_REJ_ACT,
416#define L2CAP_CONN_RNR_SENT 0x0200 465 CONN_SEND_FBIT,
417#define L2CAP_CONN_SAR_RETRY 0x0400 466 CONN_RNR_SENT,
418 467};
419#define __mod_retrans_timer() mod_timer(&chan->retrans_timer, \ 468
420 jiffies + msecs_to_jiffies(L2CAP_DEFAULT_RETRANS_TO)); 469#define __set_chan_timer(c, t) l2cap_set_timer(c, &c->chan_timer, (t))
421#define __mod_monitor_timer() mod_timer(&chan->monitor_timer, \ 470#define __clear_chan_timer(c) l2cap_clear_timer(c, &c->chan_timer)
422 jiffies + msecs_to_jiffies(L2CAP_DEFAULT_MONITOR_TO)); 471#define __set_retrans_timer(c) l2cap_set_timer(c, &c->retrans_timer, \
423#define __mod_ack_timer() mod_timer(&chan->ack_timer, \ 472 L2CAP_DEFAULT_RETRANS_TO);
424 jiffies + msecs_to_jiffies(L2CAP_DEFAULT_ACK_TO)); 473#define __clear_retrans_timer(c) l2cap_clear_timer(c, &c->retrans_timer)
474#define __set_monitor_timer(c) l2cap_set_timer(c, &c->monitor_timer, \
475 L2CAP_DEFAULT_MONITOR_TO);
476#define __clear_monitor_timer(c) l2cap_clear_timer(c, &c->monitor_timer)
477#define __set_ack_timer(c) l2cap_set_timer(c, &chan->ack_timer, \
478 L2CAP_DEFAULT_ACK_TO);
479#define __clear_ack_timer(c) l2cap_clear_timer(c, &c->ack_timer)
425 480
426static inline int l2cap_tx_window_full(struct l2cap_chan *ch) 481static inline int l2cap_tx_window_full(struct l2cap_chan *ch)
427{ 482{
@@ -446,32 +501,17 @@ extern int disable_ertm;
446int l2cap_init_sockets(void); 501int l2cap_init_sockets(void);
447void l2cap_cleanup_sockets(void); 502void l2cap_cleanup_sockets(void);
448 503
449void l2cap_send_cmd(struct l2cap_conn *conn, u8 ident, u8 code, u16 len, void *data);
450void __l2cap_connect_rsp_defer(struct l2cap_chan *chan); 504void __l2cap_connect_rsp_defer(struct l2cap_chan *chan);
451int __l2cap_wait_ack(struct sock *sk); 505int __l2cap_wait_ack(struct sock *sk);
452 506
453struct sk_buff *l2cap_create_connless_pdu(struct l2cap_chan *chan, struct msghdr *msg, size_t len);
454struct sk_buff *l2cap_create_basic_pdu(struct l2cap_chan *chan, struct msghdr *msg, size_t len);
455struct sk_buff *l2cap_create_iframe_pdu(struct l2cap_chan *chan, struct msghdr *msg, size_t len, u16 control, u16 sdulen);
456int l2cap_sar_segment_sdu(struct l2cap_chan *chan, struct msghdr *msg, size_t len);
457void l2cap_do_send(struct l2cap_chan *chan, struct sk_buff *skb);
458void l2cap_streaming_send(struct l2cap_chan *chan);
459int l2cap_ertm_send(struct l2cap_chan *chan);
460
461int l2cap_add_psm(struct l2cap_chan *chan, bdaddr_t *src, __le16 psm); 507int l2cap_add_psm(struct l2cap_chan *chan, bdaddr_t *src, __le16 psm);
462int l2cap_add_scid(struct l2cap_chan *chan, __u16 scid); 508int l2cap_add_scid(struct l2cap_chan *chan, __u16 scid);
463 509
464void l2cap_sock_set_timer(struct sock *sk, long timeout);
465void l2cap_sock_clear_timer(struct sock *sk);
466void __l2cap_sock_close(struct sock *sk, int reason);
467void l2cap_sock_kill(struct sock *sk);
468void l2cap_sock_init(struct sock *sk, struct sock *parent);
469struct sock *l2cap_sock_alloc(struct net *net, struct socket *sock,
470 int proto, gfp_t prio);
471void l2cap_send_disconn_req(struct l2cap_conn *conn, struct l2cap_chan *chan, int err);
472struct l2cap_chan *l2cap_chan_create(struct sock *sk); 510struct l2cap_chan *l2cap_chan_create(struct sock *sk);
473void l2cap_chan_del(struct l2cap_chan *chan, int err); 511void l2cap_chan_close(struct l2cap_chan *chan, int reason);
474void l2cap_chan_destroy(struct l2cap_chan *chan); 512void l2cap_chan_destroy(struct l2cap_chan *chan);
475int l2cap_chan_connect(struct l2cap_chan *chan); 513int l2cap_chan_connect(struct l2cap_chan *chan);
514int l2cap_chan_send(struct l2cap_chan *chan, struct msghdr *msg, size_t len);
515void l2cap_chan_busy(struct l2cap_chan *chan, int busy);
476 516
477#endif /* __L2CAP_H */ 517#endif /* __L2CAP_H */
diff --git a/include/net/bluetooth/mgmt.h b/include/net/bluetooth/mgmt.h
index 4899286ed4e4..5428fd32ccec 100644
--- a/include/net/bluetooth/mgmt.h
+++ b/include/net/bluetooth/mgmt.h
@@ -101,6 +101,8 @@ struct mgmt_key_info {
101 u8 type; 101 u8 type;
102 u8 val[16]; 102 u8 val[16];
103 u8 pin_len; 103 u8 pin_len;
104 u8 dlen;
105 u8 data[0];
104} __packed; 106} __packed;
105 107
106#define MGMT_OP_LOAD_KEYS 0x000D 108#define MGMT_OP_LOAD_KEYS 0x000D
@@ -199,6 +201,16 @@ struct mgmt_cp_remove_remote_oob_data {
199 201
200#define MGMT_OP_STOP_DISCOVERY 0x001C 202#define MGMT_OP_STOP_DISCOVERY 0x001C
201 203
204#define MGMT_OP_BLOCK_DEVICE 0x001D
205struct mgmt_cp_block_device {
206 bdaddr_t bdaddr;
207} __packed;
208
209#define MGMT_OP_UNBLOCK_DEVICE 0x001E
210struct mgmt_cp_unblock_device {
211 bdaddr_t bdaddr;
212} __packed;
213
202#define MGMT_EV_CMD_COMPLETE 0x0001 214#define MGMT_EV_CMD_COMPLETE 0x0001
203struct mgmt_ev_cmd_complete { 215struct mgmt_ev_cmd_complete {
204 __le16 opcode; 216 __le16 opcode;
diff --git a/include/net/bluetooth/rfcomm.h b/include/net/bluetooth/rfcomm.h
index 6eac4a760c3b..d5eee2093b1e 100644
--- a/include/net/bluetooth/rfcomm.h
+++ b/include/net/bluetooth/rfcomm.h
@@ -234,7 +234,8 @@ int rfcomm_send_rpn(struct rfcomm_session *s, int cr, u8 dlci,
234/* ---- RFCOMM DLCs (channels) ---- */ 234/* ---- RFCOMM DLCs (channels) ---- */
235struct rfcomm_dlc *rfcomm_dlc_alloc(gfp_t prio); 235struct rfcomm_dlc *rfcomm_dlc_alloc(gfp_t prio);
236void rfcomm_dlc_free(struct rfcomm_dlc *d); 236void rfcomm_dlc_free(struct rfcomm_dlc *d);
237int rfcomm_dlc_open(struct rfcomm_dlc *d, bdaddr_t *src, bdaddr_t *dst, u8 channel); 237int rfcomm_dlc_open(struct rfcomm_dlc *d, bdaddr_t *src, bdaddr_t *dst,
238 u8 channel);
238int rfcomm_dlc_close(struct rfcomm_dlc *d, int reason); 239int rfcomm_dlc_close(struct rfcomm_dlc *d, int reason);
239int rfcomm_dlc_send(struct rfcomm_dlc *d, struct sk_buff *skb); 240int rfcomm_dlc_send(struct rfcomm_dlc *d, struct sk_buff *skb);
240int rfcomm_dlc_set_modem_status(struct rfcomm_dlc *d, u8 v24_sig); 241int rfcomm_dlc_set_modem_status(struct rfcomm_dlc *d, u8 v24_sig);
@@ -271,7 +272,8 @@ static inline void rfcomm_dlc_unthrottle(struct rfcomm_dlc *d)
271} 272}
272 273
273/* ---- RFCOMM sessions ---- */ 274/* ---- RFCOMM sessions ---- */
274void rfcomm_session_getaddr(struct rfcomm_session *s, bdaddr_t *src, bdaddr_t *dst); 275void rfcomm_session_getaddr(struct rfcomm_session *s, bdaddr_t *src,
276 bdaddr_t *dst);
275 277
276static inline void rfcomm_session_hold(struct rfcomm_session *s) 278static inline void rfcomm_session_hold(struct rfcomm_session *s)
277{ 279{
@@ -312,7 +314,8 @@ struct rfcomm_pinfo {
312int rfcomm_init_sockets(void); 314int rfcomm_init_sockets(void);
313void rfcomm_cleanup_sockets(void); 315void rfcomm_cleanup_sockets(void);
314 316
315int rfcomm_connect_ind(struct rfcomm_session *s, u8 channel, struct rfcomm_dlc **d); 317int rfcomm_connect_ind(struct rfcomm_session *s, u8 channel,
318 struct rfcomm_dlc **d);
316 319
317/* ---- RFCOMM TTY ---- */ 320/* ---- RFCOMM TTY ---- */
318#define RFCOMM_MAX_DEV 256 321#define RFCOMM_MAX_DEV 256
diff --git a/include/net/bluetooth/smp.h b/include/net/bluetooth/smp.h
index 8f2edbf979dc..46c457612300 100644
--- a/include/net/bluetooth/smp.h
+++ b/include/net/bluetooth/smp.h
@@ -1,3 +1,25 @@
1/*
2 BlueZ - Bluetooth protocol stack for Linux
3 Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
4
5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License version 2 as
7 published by the Free Software Foundation;
8
9 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
10 OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
11 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD PARTY RIGHTS.
12 IN NO EVENT SHALL THE COPYRIGHT HOLDER(S) AND AUTHOR(S) BE LIABLE FOR ANY
13 CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES
14 WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
15 ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
16 OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
17
18 ALL LIABILITY, INCLUDING LIABILITY FOR INFRINGEMENT OF ANY PATENTS,
19 COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS, RELATING TO USE OF THIS
20 SOFTWARE IS DISCLAIMED.
21*/
22
1#ifndef __SMP_H 23#ifndef __SMP_H
2#define __SMP_H 24#define __SMP_H
3 25
@@ -16,6 +38,23 @@ struct smp_cmd_pairing {
16 __u8 resp_key_dist; 38 __u8 resp_key_dist;
17} __packed; 39} __packed;
18 40
41#define SMP_IO_DISPLAY_ONLY 0x00
42#define SMP_IO_DISPLAY_YESNO 0x01
43#define SMP_IO_KEYBOARD_ONLY 0x02
44#define SMP_IO_NO_INPUT_OUTPUT 0x03
45#define SMP_IO_KEYBOARD_DISPLAY 0x04
46
47#define SMP_OOB_NOT_PRESENT 0x00
48#define SMP_OOB_PRESENT 0x01
49
50#define SMP_DIST_ENC_KEY 0x01
51#define SMP_DIST_ID_KEY 0x02
52#define SMP_DIST_SIGN 0x04
53
54#define SMP_AUTH_NONE 0x00
55#define SMP_AUTH_BONDING 0x01
56#define SMP_AUTH_MITM 0x04
57
19#define SMP_CMD_PAIRING_CONFIRM 0x03 58#define SMP_CMD_PAIRING_CONFIRM 0x03
20struct smp_cmd_pairing_confirm { 59struct smp_cmd_pairing_confirm {
21 __u8 confirm_val[16]; 60 __u8 confirm_val[16];
@@ -73,4 +112,12 @@ struct smp_cmd_security_req {
73#define SMP_UNSPECIFIED 0x08 112#define SMP_UNSPECIFIED 0x08
74#define SMP_REPEATED_ATTEMPTS 0x09 113#define SMP_REPEATED_ATTEMPTS 0x09
75 114
115#define SMP_MIN_ENC_KEY_SIZE 7
116#define SMP_MAX_ENC_KEY_SIZE 16
117
118/* SMP Commands */
119int smp_conn_security(struct l2cap_conn *conn, __u8 sec_level);
120int smp_sig_channel(struct l2cap_conn *conn, struct sk_buff *skb);
121int smp_distribute_keys(struct l2cap_conn *conn, __u8 force);
122
76#endif /* __SMP_H */ 123#endif /* __SMP_H */
diff --git a/include/net/caif/caif_hsi.h b/include/net/caif/caif_hsi.h
new file mode 100644
index 000000000000..c5dedd87b4cb
--- /dev/null
+++ b/include/net/caif/caif_hsi.h
@@ -0,0 +1,145 @@
1/*
2 * Copyright (C) ST-Ericsson AB 2010
3 * Contact: Sjur Brendeland / sjur.brandeland@stericsson.com
4 * Author: Daniel Martensson / daniel.martensson@stericsson.com
5 * Dmitry.Tarnyagin / dmitry.tarnyagin@stericsson.com
6 * License terms: GNU General Public License (GPL) version 2
7 */
8
9#ifndef CAIF_HSI_H_
10#define CAIF_HSI_H_
11
12#include <net/caif/caif_layer.h>
13#include <net/caif/caif_device.h>
14#include <linux/atomic.h>
15
16/*
17 * Maximum number of CAIF frames that can reside in the same HSI frame.
18 */
19#define CFHSI_MAX_PKTS 15
20
21/*
22 * Maximum number of bytes used for the frame that can be embedded in the
23 * HSI descriptor.
24 */
25#define CFHSI_MAX_EMB_FRM_SZ 96
26
27/*
28 * Decides if HSI buffers should be prefilled with 0xFF pattern for easier
29 * debugging. Both TX and RX buffers will be filled before the transfer.
30 */
31#define CFHSI_DBG_PREFILL 0
32
33/* Structure describing a HSI packet descriptor. */
34#pragma pack(1) /* Byte alignment. */
35struct cfhsi_desc {
36 u8 header;
37 u8 offset;
38 u16 cffrm_len[CFHSI_MAX_PKTS];
39 u8 emb_frm[CFHSI_MAX_EMB_FRM_SZ];
40};
41#pragma pack() /* Default alignment. */
42
43/* Size of the complete HSI packet descriptor. */
44#define CFHSI_DESC_SZ (sizeof(struct cfhsi_desc))
45
46/*
47 * Size of the complete HSI packet descriptor excluding the optional embedded
48 * CAIF frame.
49 */
50#define CFHSI_DESC_SHORT_SZ (CFHSI_DESC_SZ - CFHSI_MAX_EMB_FRM_SZ)
51
52/*
53 * Maximum bytes transferred in one transfer.
54 */
55/* TODO: 4096 is temporary... */
56#define CFHSI_MAX_PAYLOAD_SZ (CFHSI_MAX_PKTS * 4096)
57
58/* Size of the complete HSI TX buffer. */
59#define CFHSI_BUF_SZ_TX (CFHSI_DESC_SZ + CFHSI_MAX_PAYLOAD_SZ)
60
61/* Size of the complete HSI RX buffer. */
62#define CFHSI_BUF_SZ_RX ((2 * CFHSI_DESC_SZ) + CFHSI_MAX_PAYLOAD_SZ)
63
64/* Bitmasks for the HSI descriptor. */
65#define CFHSI_PIGGY_DESC (0x01 << 7)
66
67#define CFHSI_TX_STATE_IDLE 0
68#define CFHSI_TX_STATE_XFER 1
69
70#define CFHSI_RX_STATE_DESC 0
71#define CFHSI_RX_STATE_PAYLOAD 1
72
73/* Bitmasks for power management. */
74#define CFHSI_WAKE_UP 0
75#define CFHSI_WAKE_UP_ACK 1
76#define CFHSI_WAKE_DOWN_ACK 2
77#define CFHSI_AWAKE 3
78#define CFHSI_PENDING_RX 4
79#define CFHSI_SHUTDOWN 6
80#define CFHSI_FLUSH_FIFO 7
81
82#ifndef CFHSI_INACTIVITY_TOUT
83#define CFHSI_INACTIVITY_TOUT (1 * HZ)
84#endif /* CFHSI_INACTIVITY_TOUT */
85
86#ifndef CFHSI_WAKEUP_TOUT
87#define CFHSI_WAKEUP_TOUT (3 * HZ)
88#endif /* CFHSI_WAKEUP_TOUT */
89
90
91/* Structure implemented by the CAIF HSI driver. */
92struct cfhsi_drv {
93 void (*tx_done_cb) (struct cfhsi_drv *drv);
94 void (*rx_done_cb) (struct cfhsi_drv *drv);
95 void (*wake_up_cb) (struct cfhsi_drv *drv);
96 void (*wake_down_cb) (struct cfhsi_drv *drv);
97};
98
99/* Structure implemented by HSI device. */
100struct cfhsi_dev {
101 int (*cfhsi_up) (struct cfhsi_dev *dev);
102 int (*cfhsi_down) (struct cfhsi_dev *dev);
103 int (*cfhsi_tx) (u8 *ptr, int len, struct cfhsi_dev *dev);
104 int (*cfhsi_rx) (u8 *ptr, int len, struct cfhsi_dev *dev);
105 int (*cfhsi_wake_up) (struct cfhsi_dev *dev);
106 int (*cfhsi_wake_down) (struct cfhsi_dev *dev);
107 int (*cfhsi_fifo_occupancy)(struct cfhsi_dev *dev, size_t *occupancy);
108 int (*cfhsi_rx_cancel)(struct cfhsi_dev *dev);
109 struct cfhsi_drv *drv;
110};
111
112/* Structure implemented by CAIF HSI drivers. */
113struct cfhsi {
114 struct caif_dev_common cfdev;
115 struct net_device *ndev;
116 struct platform_device *pdev;
117 struct sk_buff_head qhead;
118 struct cfhsi_drv drv;
119 struct cfhsi_dev *dev;
120 int tx_state;
121 int rx_state;
122 int rx_len;
123 u8 *rx_ptr;
124 u8 *tx_buf;
125 u8 *rx_buf;
126 spinlock_t lock;
127 int flow_off_sent;
128 u32 q_low_mark;
129 u32 q_high_mark;
130 struct list_head list;
131 struct work_struct wake_up_work;
132 struct work_struct wake_down_work;
133 struct work_struct rx_done_work;
134 struct work_struct tx_done_work;
135 struct workqueue_struct *wq;
136 wait_queue_head_t wake_up_wait;
137 wait_queue_head_t wake_down_wait;
138 wait_queue_head_t flush_fifo_wait;
139 struct timer_list timer;
140 unsigned long bits;
141};
142
143extern struct platform_driver cfhsi_driver;
144
145#endif /* CAIF_HSI_H_ */
diff --git a/include/net/cfg80211.h b/include/net/cfg80211.h
index 0589f554788a..d17f47fc9e31 100644
--- a/include/net/cfg80211.h
+++ b/include/net/cfg80211.h
@@ -777,6 +777,7 @@ struct cfg80211_ssid {
777 * @n_channels: total number of channels to scan 777 * @n_channels: total number of channels to scan
778 * @ie: optional information element(s) to add into Probe Request or %NULL 778 * @ie: optional information element(s) to add into Probe Request or %NULL
779 * @ie_len: length of ie in octets 779 * @ie_len: length of ie in octets
780 * @rates: bitmap of rates to advertise for each band
780 * @wiphy: the wiphy this was for 781 * @wiphy: the wiphy this was for
781 * @dev: the interface 782 * @dev: the interface
782 * @aborted: (internal) scan request was notified as aborted 783 * @aborted: (internal) scan request was notified as aborted
@@ -788,6 +789,8 @@ struct cfg80211_scan_request {
788 const u8 *ie; 789 const u8 *ie;
789 size_t ie_len; 790 size_t ie_len;
790 791
792 u32 rates[IEEE80211_NUM_BANDS];
793
791 /* internal */ 794 /* internal */
792 struct wiphy *wiphy; 795 struct wiphy *wiphy;
793 struct net_device *dev; 796 struct net_device *dev;
@@ -1146,14 +1149,32 @@ struct cfg80211_wowlan_trig_pkt_pattern {
1146 * @magic_pkt: wake up on receiving magic packet 1149 * @magic_pkt: wake up on receiving magic packet
1147 * @patterns: wake up on receiving packet matching a pattern 1150 * @patterns: wake up on receiving packet matching a pattern
1148 * @n_patterns: number of patterns 1151 * @n_patterns: number of patterns
1152 * @gtk_rekey_failure: wake up on GTK rekey failure
1153 * @eap_identity_req: wake up on EAP identity request packet
1154 * @four_way_handshake: wake up on 4-way handshake
1155 * @rfkill_release: wake up when rfkill is released
1149 */ 1156 */
1150struct cfg80211_wowlan { 1157struct cfg80211_wowlan {
1151 bool any, disconnect, magic_pkt; 1158 bool any, disconnect, magic_pkt, gtk_rekey_failure,
1159 eap_identity_req, four_way_handshake,
1160 rfkill_release;
1152 struct cfg80211_wowlan_trig_pkt_pattern *patterns; 1161 struct cfg80211_wowlan_trig_pkt_pattern *patterns;
1153 int n_patterns; 1162 int n_patterns;
1154}; 1163};
1155 1164
1156/** 1165/**
1166 * struct cfg80211_gtk_rekey_data - rekey data
1167 * @kek: key encryption key
1168 * @kck: key confirmation key
1169 * @replay_ctr: replay counter
1170 */
1171struct cfg80211_gtk_rekey_data {
1172 u8 kek[NL80211_KEK_LEN];
1173 u8 kck[NL80211_KCK_LEN];
1174 u8 replay_ctr[NL80211_REPLAY_CTR_LEN];
1175};
1176
1177/**
1157 * struct cfg80211_ops - backend description for wireless configuration 1178 * struct cfg80211_ops - backend description for wireless configuration
1158 * 1179 *
1159 * This struct is registered by fullmac card drivers and/or wireless stacks 1180 * This struct is registered by fullmac card drivers and/or wireless stacks
@@ -1197,6 +1218,8 @@ struct cfg80211_wowlan {
1197 * 1218 *
1198 * @set_default_mgmt_key: set the default management frame key on an interface 1219 * @set_default_mgmt_key: set the default management frame key on an interface
1199 * 1220 *
1221 * @set_rekey_data: give the data necessary for GTK rekeying to the driver
1222 *
1200 * @add_beacon: Add a beacon with given parameters, @head, @interval 1223 * @add_beacon: Add a beacon with given parameters, @head, @interval
1201 * and @dtim_period will be valid, @tail is optional. 1224 * and @dtim_period will be valid, @tail is optional.
1202 * @set_beacon: Change the beacon parameters for an access point mode 1225 * @set_beacon: Change the beacon parameters for an access point mode
@@ -1284,6 +1307,12 @@ struct cfg80211_wowlan {
1284 * frame on another channel 1307 * frame on another channel
1285 * 1308 *
1286 * @testmode_cmd: run a test mode command 1309 * @testmode_cmd: run a test mode command
1310 * @testmode_dump: Implement a test mode dump. The cb->args[2] and up may be
1311 * used by the function, but 0 and 1 must not be touched. Additionally,
1312 * return error codes other than -ENOBUFS and -ENOENT will terminate the
1313 * dump and return to userspace with an error, so be careful. If any data
1314 * was passed in from userspace then the data/len arguments will be present
1315 * and point to the data contained in %NL80211_ATTR_TESTDATA.
1287 * 1316 *
1288 * @set_bitrate_mask: set the bitrate mask configuration 1317 * @set_bitrate_mask: set the bitrate mask configuration
1289 * 1318 *
@@ -1433,6 +1462,9 @@ struct cfg80211_ops {
1433 1462
1434#ifdef CONFIG_NL80211_TESTMODE 1463#ifdef CONFIG_NL80211_TESTMODE
1435 int (*testmode_cmd)(struct wiphy *wiphy, void *data, int len); 1464 int (*testmode_cmd)(struct wiphy *wiphy, void *data, int len);
1465 int (*testmode_dump)(struct wiphy *wiphy, struct sk_buff *skb,
1466 struct netlink_callback *cb,
1467 void *data, int len);
1436#endif 1468#endif
1437 1469
1438 int (*set_bitrate_mask)(struct wiphy *wiphy, 1470 int (*set_bitrate_mask)(struct wiphy *wiphy,
@@ -1490,6 +1522,9 @@ struct cfg80211_ops {
1490 struct net_device *dev, 1522 struct net_device *dev,
1491 struct cfg80211_sched_scan_request *request); 1523 struct cfg80211_sched_scan_request *request);
1492 int (*sched_scan_stop)(struct wiphy *wiphy, struct net_device *dev); 1524 int (*sched_scan_stop)(struct wiphy *wiphy, struct net_device *dev);
1525
1526 int (*set_rekey_data)(struct wiphy *wiphy, struct net_device *dev,
1527 struct cfg80211_gtk_rekey_data *data);
1493}; 1528};
1494 1529
1495/* 1530/*
@@ -1647,11 +1682,21 @@ struct ieee80211_txrx_stypes {
1647 * @WIPHY_WOWLAN_MAGIC_PKT: supports wakeup on magic packet 1682 * @WIPHY_WOWLAN_MAGIC_PKT: supports wakeup on magic packet
1648 * (see nl80211.h) 1683 * (see nl80211.h)
1649 * @WIPHY_WOWLAN_DISCONNECT: supports wakeup on disconnect 1684 * @WIPHY_WOWLAN_DISCONNECT: supports wakeup on disconnect
1685 * @WIPHY_WOWLAN_SUPPORTS_GTK_REKEY: supports GTK rekeying while asleep
1686 * @WIPHY_WOWLAN_GTK_REKEY_FAILURE: supports wakeup on GTK rekey failure
1687 * @WIPHY_WOWLAN_EAP_IDENTITY_REQ: supports wakeup on EAP identity request
1688 * @WIPHY_WOWLAN_4WAY_HANDSHAKE: supports wakeup on 4-way handshake failure
1689 * @WIPHY_WOWLAN_RFKILL_RELEASE: supports wakeup on RF-kill release
1650 */ 1690 */
1651enum wiphy_wowlan_support_flags { 1691enum wiphy_wowlan_support_flags {
1652 WIPHY_WOWLAN_ANY = BIT(0), 1692 WIPHY_WOWLAN_ANY = BIT(0),
1653 WIPHY_WOWLAN_MAGIC_PKT = BIT(1), 1693 WIPHY_WOWLAN_MAGIC_PKT = BIT(1),
1654 WIPHY_WOWLAN_DISCONNECT = BIT(2), 1694 WIPHY_WOWLAN_DISCONNECT = BIT(2),
1695 WIPHY_WOWLAN_SUPPORTS_GTK_REKEY = BIT(3),
1696 WIPHY_WOWLAN_GTK_REKEY_FAILURE = BIT(4),
1697 WIPHY_WOWLAN_EAP_IDENTITY_REQ = BIT(5),
1698 WIPHY_WOWLAN_4WAY_HANDSHAKE = BIT(6),
1699 WIPHY_WOWLAN_RFKILL_RELEASE = BIT(7),
1655}; 1700};
1656 1701
1657/** 1702/**
@@ -1716,9 +1761,13 @@ struct wiphy_wowlan_support {
1716 * this variable determines its size 1761 * this variable determines its size
1717 * @max_scan_ssids: maximum number of SSIDs the device can scan for in 1762 * @max_scan_ssids: maximum number of SSIDs the device can scan for in
1718 * any given scan 1763 * any given scan
1764 * @max_sched_scan_ssids: maximum number of SSIDs the device can scan
1765 * for in any given scheduled scan
1719 * @max_scan_ie_len: maximum length of user-controlled IEs device can 1766 * @max_scan_ie_len: maximum length of user-controlled IEs device can
1720 * add to probe request frames transmitted during a scan, must not 1767 * add to probe request frames transmitted during a scan, must not
1721 * include fixed IEs like supported rates 1768 * include fixed IEs like supported rates
1769 * @max_sched_scan_ie_len: same as max_scan_ie_len, but for scheduled
1770 * scans
1722 * @coverage_class: current coverage class 1771 * @coverage_class: current coverage class
1723 * @fw_version: firmware version for ethtool reporting 1772 * @fw_version: firmware version for ethtool reporting
1724 * @hw_version: hardware version for ethtool reporting 1773 * @hw_version: hardware version for ethtool reporting
@@ -1770,7 +1819,9 @@ struct wiphy {
1770 1819
1771 int bss_priv_size; 1820 int bss_priv_size;
1772 u8 max_scan_ssids; 1821 u8 max_scan_ssids;
1822 u8 max_sched_scan_ssids;
1773 u16 max_scan_ie_len; 1823 u16 max_scan_ie_len;
1824 u16 max_sched_scan_ie_len;
1774 1825
1775 int n_cipher_suites; 1826 int n_cipher_suites;
1776 const u32 *cipher_suites; 1827 const u32 *cipher_suites;
@@ -2688,7 +2739,7 @@ void cfg80211_send_unprot_disassoc(struct net_device *dev, const u8 *buf,
2688 * @dev: network device 2739 * @dev: network device
2689 * @addr: The source MAC address of the frame 2740 * @addr: The source MAC address of the frame
2690 * @key_type: The key type that the received frame used 2741 * @key_type: The key type that the received frame used
2691 * @key_id: Key identifier (0..3) 2742 * @key_id: Key identifier (0..3). Can be -1 if missing.
2692 * @tsc: The TSC value of the frame that generated the MIC failure (6 octets) 2743 * @tsc: The TSC value of the frame that generated the MIC failure (6 octets)
2693 * @gfp: allocation flags 2744 * @gfp: allocation flags
2694 * 2745 *
@@ -2849,8 +2900,10 @@ struct sk_buff *cfg80211_testmode_alloc_event_skb(struct wiphy *wiphy,
2849void cfg80211_testmode_event(struct sk_buff *skb, gfp_t gfp); 2900void cfg80211_testmode_event(struct sk_buff *skb, gfp_t gfp);
2850 2901
2851#define CFG80211_TESTMODE_CMD(cmd) .testmode_cmd = (cmd), 2902#define CFG80211_TESTMODE_CMD(cmd) .testmode_cmd = (cmd),
2903#define CFG80211_TESTMODE_DUMP(cmd) .testmode_dump = (cmd),
2852#else 2904#else
2853#define CFG80211_TESTMODE_CMD(cmd) 2905#define CFG80211_TESTMODE_CMD(cmd)
2906#define CFG80211_TESTMODE_DUMP(cmd)
2854#endif 2907#endif
2855 2908
2856/** 2909/**
@@ -3022,6 +3075,16 @@ void cfg80211_cqm_rssi_notify(struct net_device *dev,
3022void cfg80211_cqm_pktloss_notify(struct net_device *dev, 3075void cfg80211_cqm_pktloss_notify(struct net_device *dev,
3023 const u8 *peer, u32 num_packets, gfp_t gfp); 3076 const u8 *peer, u32 num_packets, gfp_t gfp);
3024 3077
3078/**
3079 * cfg80211_gtk_rekey_notify - notify userspace about driver rekeying
3080 * @dev: network device
3081 * @bssid: BSSID of AP (to avoid races)
3082 * @replay_ctr: new replay counter
3083 * @gfp: allocation flags
3084 */
3085void cfg80211_gtk_rekey_notify(struct net_device *dev, const u8 *bssid,
3086 const u8 *replay_ctr, gfp_t gfp);
3087
3025/* Logging, debugging and troubleshooting/diagnostic helpers. */ 3088/* Logging, debugging and troubleshooting/diagnostic helpers. */
3026 3089
3027/* wiphy_printk helpers, similar to dev_printk */ 3090/* wiphy_printk helpers, similar to dev_printk */
diff --git a/include/net/dcbnl.h b/include/net/dcbnl.h
index e5983c9053dc..f5aa39997f0b 100644
--- a/include/net/dcbnl.h
+++ b/include/net/dcbnl.h
@@ -28,8 +28,16 @@ struct dcb_app_type {
28 struct list_head list; 28 struct list_head list;
29}; 29};
30 30
31u8 dcb_setapp(struct net_device *, struct dcb_app *); 31int dcb_setapp(struct net_device *, struct dcb_app *);
32u8 dcb_getapp(struct net_device *, struct dcb_app *); 32u8 dcb_getapp(struct net_device *, struct dcb_app *);
33int dcb_ieee_setapp(struct net_device *, struct dcb_app *);
34int dcb_ieee_delapp(struct net_device *, struct dcb_app *);
35u8 dcb_ieee_getapp_mask(struct net_device *, struct dcb_app *);
36
37int dcbnl_ieee_notify(struct net_device *dev, int event, int cmd,
38 u32 seq, u32 pid);
39int dcbnl_cee_notify(struct net_device *dev, int event, int cmd,
40 u32 seq, u32 pid);
33 41
34/* 42/*
35 * Ops struct for the netlink callbacks. Used by DCB-enabled drivers through 43 * Ops struct for the netlink callbacks. Used by DCB-enabled drivers through
@@ -43,6 +51,7 @@ struct dcbnl_rtnl_ops {
43 int (*ieee_setpfc) (struct net_device *, struct ieee_pfc *); 51 int (*ieee_setpfc) (struct net_device *, struct ieee_pfc *);
44 int (*ieee_getapp) (struct net_device *, struct dcb_app *); 52 int (*ieee_getapp) (struct net_device *, struct dcb_app *);
45 int (*ieee_setapp) (struct net_device *, struct dcb_app *); 53 int (*ieee_setapp) (struct net_device *, struct dcb_app *);
54 int (*ieee_delapp) (struct net_device *, struct dcb_app *);
46 int (*ieee_peer_getets) (struct net_device *, struct ieee_ets *); 55 int (*ieee_peer_getets) (struct net_device *, struct ieee_ets *);
47 int (*ieee_peer_getpfc) (struct net_device *, struct ieee_pfc *); 56 int (*ieee_peer_getpfc) (struct net_device *, struct ieee_pfc *);
48 57
diff --git a/include/net/dst.h b/include/net/dst.h
index 7d15d238b6ec..29e255796ce1 100644
--- a/include/net/dst.h
+++ b/include/net/dst.h
@@ -37,8 +37,7 @@ struct dst_entry {
37 unsigned long _metrics; 37 unsigned long _metrics;
38 unsigned long expires; 38 unsigned long expires;
39 struct dst_entry *path; 39 struct dst_entry *path;
40 struct neighbour *neighbour; 40 struct neighbour *_neighbour;
41 struct hh_cache *hh;
42#ifdef CONFIG_XFRM 41#ifdef CONFIG_XFRM
43 struct xfrm_state *xfrm; 42 struct xfrm_state *xfrm;
44#else 43#else
@@ -47,6 +46,14 @@ struct dst_entry {
47 int (*input)(struct sk_buff*); 46 int (*input)(struct sk_buff*);
48 int (*output)(struct sk_buff*); 47 int (*output)(struct sk_buff*);
49 48
49 int flags;
50#define DST_HOST 0x0001
51#define DST_NOXFRM 0x0002
52#define DST_NOPOLICY 0x0004
53#define DST_NOHASH 0x0008
54#define DST_NOCACHE 0x0010
55#define DST_NOCOUNT 0x0020
56
50 short error; 57 short error;
51 short obsolete; 58 short obsolete;
52 unsigned short header_len; /* more space at head required */ 59 unsigned short header_len; /* more space at head required */
@@ -62,7 +69,7 @@ struct dst_entry {
62 * (L1_CACHE_SIZE would be too much) 69 * (L1_CACHE_SIZE would be too much)
63 */ 70 */
64#ifdef CONFIG_64BIT 71#ifdef CONFIG_64BIT
65 long __pad_to_align_refcnt[1]; 72 long __pad_to_align_refcnt[2];
66#endif 73#endif
67 /* 74 /*
68 * __refcnt wants to be on a different cache line from 75 * __refcnt wants to be on a different cache line from
@@ -71,12 +78,6 @@ struct dst_entry {
71 atomic_t __refcnt; /* client references */ 78 atomic_t __refcnt; /* client references */
72 int __use; 79 int __use;
73 unsigned long lastuse; 80 unsigned long lastuse;
74 int flags;
75#define DST_HOST 0x0001
76#define DST_NOXFRM 0x0002
77#define DST_NOPOLICY 0x0004
78#define DST_NOHASH 0x0008
79#define DST_NOCACHE 0x0010
80 union { 81 union {
81 struct dst_entry *next; 82 struct dst_entry *next;
82 struct rtable __rcu *rt_next; 83 struct rtable __rcu *rt_next;
@@ -85,6 +86,16 @@ struct dst_entry {
85 }; 86 };
86}; 87};
87 88
89static inline struct neighbour *dst_get_neighbour(struct dst_entry *dst)
90{
91 return dst->_neighbour;
92}
93
94static inline void dst_set_neighbour(struct dst_entry *dst, struct neighbour *neigh)
95{
96 dst->_neighbour = neigh;
97}
98
88extern u32 *dst_cow_metrics_generic(struct dst_entry *dst, unsigned long old); 99extern u32 *dst_cow_metrics_generic(struct dst_entry *dst, unsigned long old);
89extern const u32 dst_default_metrics[RTAX_MAX]; 100extern const u32 dst_default_metrics[RTAX_MAX];
90 101
@@ -370,8 +381,15 @@ static inline void dst_rcu_free(struct rcu_head *head)
370 381
371static inline void dst_confirm(struct dst_entry *dst) 382static inline void dst_confirm(struct dst_entry *dst)
372{ 383{
373 if (dst) 384 if (dst) {
374 neigh_confirm(dst->neighbour); 385 struct neighbour *n = dst_get_neighbour(dst);
386 neigh_confirm(n);
387 }
388}
389
390static inline struct neighbour *dst_neigh_lookup(const struct dst_entry *dst, const void *daddr)
391{
392 return dst->ops->neigh_lookup(dst, daddr);
375} 393}
376 394
377static inline void dst_link_failure(struct sk_buff *skb) 395static inline void dst_link_failure(struct sk_buff *skb)
diff --git a/include/net/dst_ops.h b/include/net/dst_ops.h
index dc0746328947..9adb99845a56 100644
--- a/include/net/dst_ops.h
+++ b/include/net/dst_ops.h
@@ -26,6 +26,7 @@ struct dst_ops {
26 void (*link_failure)(struct sk_buff *); 26 void (*link_failure)(struct sk_buff *);
27 void (*update_pmtu)(struct dst_entry *dst, u32 mtu); 27 void (*update_pmtu)(struct dst_entry *dst, u32 mtu);
28 int (*local_out)(struct sk_buff *skb); 28 int (*local_out)(struct sk_buff *skb);
29 struct neighbour * (*neigh_lookup)(const struct dst_entry *dst, const void *daddr);
29 30
30 struct kmem_cache *kmem_cachep; 31 struct kmem_cache *kmem_cachep;
31 32
diff --git a/include/net/genetlink.h b/include/net/genetlink.h
index d420f28b6d60..82d8d09faa44 100644
--- a/include/net/genetlink.h
+++ b/include/net/genetlink.h
@@ -160,6 +160,38 @@ static inline void *genlmsg_put(struct sk_buff *skb, u32 pid, u32 seq,
160} 160}
161 161
162/** 162/**
163 * genlmsg_nlhdr - Obtain netlink header from user specified header
164 * @user_hdr: user header as returned from genlmsg_put()
165 * @family: generic netlink family
166 *
167 * Returns pointer to netlink header.
168 */
169static inline struct nlmsghdr *genlmsg_nlhdr(void *user_hdr,
170 struct genl_family *family)
171{
172 return (struct nlmsghdr *)((char *)user_hdr -
173 family->hdrsize -
174 GENL_HDRLEN -
175 NLMSG_HDRLEN);
176}
177
178/**
179 * genl_dump_check_consistent - check if sequence is consistent and advertise if not
180 * @cb: netlink callback structure that stores the sequence number
181 * @user_hdr: user header as returned from genlmsg_put()
182 * @family: generic netlink family
183 *
184 * Cf. nl_dump_check_consistent(), this just provides a wrapper to make it
185 * simpler to use with generic netlink.
186 */
187static inline void genl_dump_check_consistent(struct netlink_callback *cb,
188 void *user_hdr,
189 struct genl_family *family)
190{
191 nl_dump_check_consistent(cb, genlmsg_nlhdr(user_hdr, family));
192}
193
194/**
163 * genlmsg_put_reply - Add generic netlink header to a reply message 195 * genlmsg_put_reply - Add generic netlink header to a reply message
164 * @skb: socket buffer holding the message 196 * @skb: socket buffer holding the message
165 * @info: receiver info 197 * @info: receiver info
diff --git a/include/net/inetpeer.h b/include/net/inetpeer.h
index 8a159cc3d68b..4233e6f9841d 100644
--- a/include/net/inetpeer.h
+++ b/include/net/inetpeer.h
@@ -32,13 +32,17 @@ struct inet_peer {
32 struct inet_peer __rcu *avl_left, *avl_right; 32 struct inet_peer __rcu *avl_left, *avl_right;
33 struct inetpeer_addr daddr; 33 struct inetpeer_addr daddr;
34 __u32 avl_height; 34 __u32 avl_height;
35 struct list_head unused; 35
36 __u32 dtime; /* the time of last use of not 36 u32 metrics[RTAX_MAX];
37 * referenced entries */ 37 u32 rate_tokens; /* rate limiting for ICMP */
38 atomic_t refcnt; 38 unsigned long rate_last;
39 unsigned long pmtu_expires;
40 u32 pmtu_orig;
41 u32 pmtu_learned;
42 struct inetpeer_addr_base redirect_learned;
39 /* 43 /*
40 * Once inet_peer is queued for deletion (refcnt == -1), following fields 44 * Once inet_peer is queued for deletion (refcnt == -1), following fields
41 * are not available: rid, ip_id_count, tcp_ts, tcp_ts_stamp, metrics 45 * are not available: rid, ip_id_count, tcp_ts, tcp_ts_stamp
42 * We can share memory with rcu_head to help keep inet_peer small. 46 * We can share memory with rcu_head to help keep inet_peer small.
43 */ 47 */
44 union { 48 union {
@@ -47,16 +51,14 @@ struct inet_peer {
47 atomic_t ip_id_count; /* IP ID for the next packet */ 51 atomic_t ip_id_count; /* IP ID for the next packet */
48 __u32 tcp_ts; 52 __u32 tcp_ts;
49 __u32 tcp_ts_stamp; 53 __u32 tcp_ts_stamp;
50 u32 metrics[RTAX_MAX];
51 u32 rate_tokens; /* rate limiting for ICMP */
52 unsigned long rate_last;
53 unsigned long pmtu_expires;
54 u32 pmtu_orig;
55 u32 pmtu_learned;
56 struct inetpeer_addr_base redirect_learned;
57 }; 54 };
58 struct rcu_head rcu; 55 struct rcu_head rcu;
56 struct inet_peer *gc_next;
59 }; 57 };
58
59 /* following fields might be frequently dirtied */
60 __u32 dtime; /* the time of last use of not referenced entries */
61 atomic_t refcnt;
60}; 62};
61 63
62void inet_initpeers(void) __init; 64void inet_initpeers(void) __init;
@@ -69,7 +71,7 @@ static inline bool inet_metrics_new(const struct inet_peer *p)
69} 71}
70 72
71/* can be called with or without local BH being disabled */ 73/* can be called with or without local BH being disabled */
72struct inet_peer *inet_getpeer(struct inetpeer_addr *daddr, int create); 74struct inet_peer *inet_getpeer(const struct inetpeer_addr *daddr, int create);
73 75
74static inline struct inet_peer *inet_getpeer_v4(__be32 v4daddr, int create) 76static inline struct inet_peer *inet_getpeer_v4(__be32 v4daddr, int create)
75{ 77{
@@ -104,11 +106,18 @@ static inline void inet_peer_refcheck(const struct inet_peer *p)
104 106
105 107
106/* can be called with or without local BH being disabled */ 108/* can be called with or without local BH being disabled */
107static inline __u16 inet_getid(struct inet_peer *p, int more) 109static inline int inet_getid(struct inet_peer *p, int more)
108{ 110{
111 int old, new;
109 more++; 112 more++;
110 inet_peer_refcheck(p); 113 inet_peer_refcheck(p);
111 return atomic_add_return(more, &p->ip_id_count) - more; 114 do {
115 old = atomic_read(&p->ip_id_count);
116 new = old + more;
117 if (!new)
118 new = 1;
119 } while (atomic_cmpxchg(&p->ip_id_count, old, new) != old);
120 return new;
112} 121}
113 122
114#endif /* _NET_INETPEER_H */ 123#endif /* _NET_INETPEER_H */
diff --git a/include/net/ip.h b/include/net/ip.h
index 66dd49149208..aa76c7a4d9c3 100644
--- a/include/net/ip.h
+++ b/include/net/ip.h
@@ -228,8 +228,6 @@ extern struct ctl_path net_ipv4_ctl_path[];
228extern int inet_peer_threshold; 228extern int inet_peer_threshold;
229extern int inet_peer_minttl; 229extern int inet_peer_minttl;
230extern int inet_peer_maxttl; 230extern int inet_peer_maxttl;
231extern int inet_peer_gc_mintime;
232extern int inet_peer_gc_maxtime;
233 231
234/* From ip_output.c */ 232/* From ip_output.c */
235extern int sysctl_ip_dynaddr; 233extern int sysctl_ip_dynaddr;
@@ -238,6 +236,11 @@ extern void ipfrag_init(void);
238 236
239extern void ip_static_sysctl_init(void); 237extern void ip_static_sysctl_init(void);
240 238
239static inline bool ip_is_fragment(const struct iphdr *iph)
240{
241 return (iph->frag_off & htons(IP_MF | IP_OFFSET)) != 0;
242}
243
241#ifdef CONFIG_INET 244#ifdef CONFIG_INET
242#include <net/dst.h> 245#include <net/dst.h>
243 246
@@ -401,7 +404,8 @@ enum ip_defrag_users {
401 __IP_DEFRAG_CONNTRACK_BRIDGE_IN = IP_DEFRAG_CONNTRACK_BRIDGE_IN + USHRT_MAX, 404 __IP_DEFRAG_CONNTRACK_BRIDGE_IN = IP_DEFRAG_CONNTRACK_BRIDGE_IN + USHRT_MAX,
402 IP_DEFRAG_VS_IN, 405 IP_DEFRAG_VS_IN,
403 IP_DEFRAG_VS_OUT, 406 IP_DEFRAG_VS_OUT,
404 IP_DEFRAG_VS_FWD 407 IP_DEFRAG_VS_FWD,
408 IP_DEFRAG_AF_PACKET,
405}; 409};
406 410
407int ip_defrag(struct sk_buff *skb, u32 user); 411int ip_defrag(struct sk_buff *skb, u32 user);
diff --git a/include/net/ip6_fib.h b/include/net/ip6_fib.h
index 477ef75f3873..5735a0f979c3 100644
--- a/include/net/ip6_fib.h
+++ b/include/net/ip6_fib.h
@@ -87,7 +87,6 @@ struct rt6_info {
87 struct dst_entry dst; 87 struct dst_entry dst;
88 88
89#define rt6i_dev dst.dev 89#define rt6i_dev dst.dev
90#define rt6i_nexthop dst.neighbour
91#define rt6i_expires dst.expires 90#define rt6i_expires dst.expires
92 91
93 /* 92 /*
diff --git a/include/net/ip_vs.h b/include/net/ip_vs.h
index 481f856c650f..b1370c4015b6 100644
--- a/include/net/ip_vs.h
+++ b/include/net/ip_vs.h
@@ -836,8 +836,6 @@ struct netns_ipvs {
836 int num_services; /* no of virtual services */ 836 int num_services; /* no of virtual services */
837 837
838 rwlock_t rs_lock; /* real services table */ 838 rwlock_t rs_lock; /* real services table */
839 /* semaphore for IPVS sockopts. And, [gs]etsockopt may sleep. */
840 struct lock_class_key ctl_key; /* ctl_mutex debuging */
841 /* Trash for destinations */ 839 /* Trash for destinations */
842 struct list_head dest_trash; 840 struct list_head dest_trash;
843 /* Service counters */ 841 /* Service counters */
@@ -1089,19 +1087,19 @@ ip_vs_control_add(struct ip_vs_conn *cp, struct ip_vs_conn *ctl_cp)
1089/* 1087/*
1090 * IPVS netns init & cleanup functions 1088 * IPVS netns init & cleanup functions
1091 */ 1089 */
1092extern int __ip_vs_estimator_init(struct net *net); 1090extern int ip_vs_estimator_net_init(struct net *net);
1093extern int __ip_vs_control_init(struct net *net); 1091extern int ip_vs_control_net_init(struct net *net);
1094extern int __ip_vs_protocol_init(struct net *net); 1092extern int ip_vs_protocol_net_init(struct net *net);
1095extern int __ip_vs_app_init(struct net *net); 1093extern int ip_vs_app_net_init(struct net *net);
1096extern int __ip_vs_conn_init(struct net *net); 1094extern int ip_vs_conn_net_init(struct net *net);
1097extern int __ip_vs_sync_init(struct net *net); 1095extern int ip_vs_sync_net_init(struct net *net);
1098extern void __ip_vs_conn_cleanup(struct net *net); 1096extern void ip_vs_conn_net_cleanup(struct net *net);
1099extern void __ip_vs_app_cleanup(struct net *net); 1097extern void ip_vs_app_net_cleanup(struct net *net);
1100extern void __ip_vs_protocol_cleanup(struct net *net); 1098extern void ip_vs_protocol_net_cleanup(struct net *net);
1101extern void __ip_vs_control_cleanup(struct net *net); 1099extern void ip_vs_control_net_cleanup(struct net *net);
1102extern void __ip_vs_estimator_cleanup(struct net *net); 1100extern void ip_vs_estimator_net_cleanup(struct net *net);
1103extern void __ip_vs_sync_cleanup(struct net *net); 1101extern void ip_vs_sync_net_cleanup(struct net *net);
1104extern void __ip_vs_service_cleanup(struct net *net); 1102extern void ip_vs_service_net_cleanup(struct net *net);
1105 1103
1106/* 1104/*
1107 * IPVS application functions 1105 * IPVS application functions
@@ -1119,8 +1117,6 @@ extern void ip_vs_app_inc_put(struct ip_vs_app *inc);
1119 1117
1120extern int ip_vs_app_pkt_out(struct ip_vs_conn *, struct sk_buff *skb); 1118extern int ip_vs_app_pkt_out(struct ip_vs_conn *, struct sk_buff *skb);
1121extern int ip_vs_app_pkt_in(struct ip_vs_conn *, struct sk_buff *skb); 1119extern int ip_vs_app_pkt_in(struct ip_vs_conn *, struct sk_buff *skb);
1122extern int ip_vs_app_init(void);
1123extern void ip_vs_app_cleanup(void);
1124 1120
1125void ip_vs_bind_pe(struct ip_vs_service *svc, struct ip_vs_pe *pe); 1121void ip_vs_bind_pe(struct ip_vs_service *svc, struct ip_vs_pe *pe);
1126void ip_vs_unbind_pe(struct ip_vs_service *svc); 1122void ip_vs_unbind_pe(struct ip_vs_service *svc);
@@ -1223,15 +1219,11 @@ extern int start_sync_thread(struct net *net, int state, char *mcast_ifn,
1223 __u8 syncid); 1219 __u8 syncid);
1224extern int stop_sync_thread(struct net *net, int state); 1220extern int stop_sync_thread(struct net *net, int state);
1225extern void ip_vs_sync_conn(struct net *net, struct ip_vs_conn *cp); 1221extern void ip_vs_sync_conn(struct net *net, struct ip_vs_conn *cp);
1226extern int ip_vs_sync_init(void);
1227extern void ip_vs_sync_cleanup(void);
1228 1222
1229 1223
1230/* 1224/*
1231 * IPVS rate estimator prototypes (from ip_vs_est.c) 1225 * IPVS rate estimator prototypes (from ip_vs_est.c)
1232 */ 1226 */
1233extern int ip_vs_estimator_init(void);
1234extern void ip_vs_estimator_cleanup(void);
1235extern void ip_vs_start_estimator(struct net *net, struct ip_vs_stats *stats); 1227extern void ip_vs_start_estimator(struct net *net, struct ip_vs_stats *stats);
1236extern void ip_vs_stop_estimator(struct net *net, struct ip_vs_stats *stats); 1228extern void ip_vs_stop_estimator(struct net *net, struct ip_vs_stats *stats);
1237extern void ip_vs_zero_estimator(struct ip_vs_stats *stats); 1229extern void ip_vs_zero_estimator(struct ip_vs_stats *stats);
diff --git a/include/net/ipv6.h b/include/net/ipv6.h
index c033ed00df7d..3b5ac1fbff39 100644
--- a/include/net/ipv6.h
+++ b/include/net/ipv6.h
@@ -463,17 +463,7 @@ static inline int ipv6_addr_diff(const struct in6_addr *a1, const struct in6_add
463 return __ipv6_addr_diff(a1, a2, sizeof(struct in6_addr)); 463 return __ipv6_addr_diff(a1, a2, sizeof(struct in6_addr));
464} 464}
465 465
466static __inline__ void ipv6_select_ident(struct frag_hdr *fhdr) 466extern void ipv6_select_ident(struct frag_hdr *fhdr, struct rt6_info *rt);
467{
468 static u32 ipv6_fragmentation_id = 1;
469 static DEFINE_SPINLOCK(ip6_id_lock);
470
471 spin_lock_bh(&ip6_id_lock);
472 fhdr->identification = htonl(ipv6_fragmentation_id);
473 if (++ipv6_fragmentation_id == 0)
474 ipv6_fragmentation_id = 1;
475 spin_unlock_bh(&ip6_id_lock);
476}
477 467
478/* 468/*
479 * Prototypes exported by ipv6 469 * Prototypes exported by ipv6
diff --git a/include/net/mac80211.h b/include/net/mac80211.h
index e6d6a66a8f71..9259e97864d7 100644
--- a/include/net/mac80211.h
+++ b/include/net/mac80211.h
@@ -20,6 +20,7 @@
20#include <linux/device.h> 20#include <linux/device.h>
21#include <linux/ieee80211.h> 21#include <linux/ieee80211.h>
22#include <net/cfg80211.h> 22#include <net/cfg80211.h>
23#include <asm/unaligned.h>
23 24
24/** 25/**
25 * DOC: Introduction 26 * DOC: Introduction
@@ -193,6 +194,17 @@ enum ieee80211_bss_change {
193#define IEEE80211_BSS_ARP_ADDR_LIST_LEN 4 194#define IEEE80211_BSS_ARP_ADDR_LIST_LEN 4
194 195
195/** 196/**
197 * enum ieee80211_rssi_event - RSSI threshold event
198 * An indicator for when RSSI goes below/above a certain threshold.
199 * @RSSI_EVENT_HIGH: AP's rssi crossed the high threshold set by the driver.
200 * @RSSI_EVENT_LOW: AP's rssi crossed the low threshold set by the driver.
201 */
202enum ieee80211_rssi_event {
203 RSSI_EVENT_HIGH,
204 RSSI_EVENT_LOW,
205};
206
207/**
196 * struct ieee80211_bss_conf - holds the BSS's changing parameters 208 * struct ieee80211_bss_conf - holds the BSS's changing parameters
197 * 209 *
198 * This structure keeps information about a BSS (and an association 210 * This structure keeps information about a BSS (and an association
@@ -933,6 +945,7 @@ enum set_key_cmd {
933 * @aid: AID we assigned to the station if we're an AP 945 * @aid: AID we assigned to the station if we're an AP
934 * @supp_rates: Bitmap of supported rates (per band) 946 * @supp_rates: Bitmap of supported rates (per band)
935 * @ht_cap: HT capabilities of this STA; restricted to our own TX capabilities 947 * @ht_cap: HT capabilities of this STA; restricted to our own TX capabilities
948 * @wme: indicates whether the STA supports WME. Only valid during AP-mode.
936 * @drv_priv: data area for driver use, will always be aligned to 949 * @drv_priv: data area for driver use, will always be aligned to
937 * sizeof(void *), size is determined in hw information. 950 * sizeof(void *), size is determined in hw information.
938 */ 951 */
@@ -941,6 +954,7 @@ struct ieee80211_sta {
941 u8 addr[ETH_ALEN]; 954 u8 addr[ETH_ALEN];
942 u16 aid; 955 u16 aid;
943 struct ieee80211_sta_ht_cap ht_cap; 956 struct ieee80211_sta_ht_cap ht_cap;
957 bool wme;
944 958
945 /* must be last */ 959 /* must be last */
946 u8 drv_priv[0] __attribute__((__aligned__(sizeof(void *)))); 960 u8 drv_priv[0] __attribute__((__aligned__(sizeof(void *))));
@@ -960,21 +974,6 @@ enum sta_notify_cmd {
960}; 974};
961 975
962/** 976/**
963 * enum ieee80211_tkip_key_type - get tkip key
964 *
965 * Used by drivers which need to get a tkip key for skb. Some drivers need a
966 * phase 1 key, others need a phase 2 key. A single function allows the driver
967 * to get the key, this enum indicates what type of key is required.
968 *
969 * @IEEE80211_TKIP_P1_KEY: the driver needs a phase 1 key
970 * @IEEE80211_TKIP_P2_KEY: the driver needs a phase 2 key
971 */
972enum ieee80211_tkip_key_type {
973 IEEE80211_TKIP_P1_KEY,
974 IEEE80211_TKIP_P2_KEY,
975};
976
977/**
978 * enum ieee80211_hw_flags - hardware flags 977 * enum ieee80211_hw_flags - hardware flags
979 * 978 *
980 * These flags are used to indicate hardware capabilities to 979 * These flags are used to indicate hardware capabilities to
@@ -1587,6 +1586,20 @@ enum ieee80211_ampdu_mlme_action {
1587}; 1586};
1588 1587
1589/** 1588/**
1589 * enum ieee80211_tx_sync_type - TX sync type
1590 * @IEEE80211_TX_SYNC_AUTH: sync TX for authentication
1591 * (and possibly also before direct probe)
1592 * @IEEE80211_TX_SYNC_ASSOC: sync TX for association
1593 * @IEEE80211_TX_SYNC_ACTION: sync TX for action frame
1594 * (not implemented yet)
1595 */
1596enum ieee80211_tx_sync_type {
1597 IEEE80211_TX_SYNC_AUTH,
1598 IEEE80211_TX_SYNC_ASSOC,
1599 IEEE80211_TX_SYNC_ACTION,
1600};
1601
1602/**
1590 * struct ieee80211_ops - callbacks from mac80211 to the driver 1603 * struct ieee80211_ops - callbacks from mac80211 to the driver
1591 * 1604 *
1592 * This structure contains various callbacks that the driver may 1605 * This structure contains various callbacks that the driver may
@@ -1626,6 +1639,10 @@ enum ieee80211_ampdu_mlme_action {
1626 * ask the device to suspend. This is only invoked when WoWLAN is 1639 * ask the device to suspend. This is only invoked when WoWLAN is
1627 * configured, otherwise the device is deconfigured completely and 1640 * configured, otherwise the device is deconfigured completely and
1628 * reconfigured at resume time. 1641 * reconfigured at resume time.
1642 * The driver may also impose special conditions under which it
1643 * wants to use the "normal" suspend (deconfigure), say if it only
1644 * supports WoWLAN when the device is associated. In this case, it
1645 * must return 1 from this function.
1629 * 1646 *
1630 * @resume: If WoWLAN was configured, this indicates that mac80211 is 1647 * @resume: If WoWLAN was configured, this indicates that mac80211 is
1631 * now resuming its operation, after this the device must be fully 1648 * now resuming its operation, after this the device must be fully
@@ -1671,6 +1688,26 @@ enum ieee80211_ampdu_mlme_action {
1671 * of the bss parameters has changed when a call is made. The callback 1688 * of the bss parameters has changed when a call is made. The callback
1672 * can sleep. 1689 * can sleep.
1673 * 1690 *
1691 * @tx_sync: Called before a frame is sent to an AP/GO. In the GO case, the
1692 * driver should sync with the GO's powersaving so the device doesn't
1693 * transmit the frame while the GO is asleep. In the regular AP case
1694 * it may be used by drivers for devices implementing other restrictions
1695 * on talking to APs, e.g. due to regulatory enforcement or just HW
1696 * restrictions.
1697 * This function is called for every authentication, association and
1698 * action frame separately since applications might attempt to auth
1699 * with multiple APs before chosing one to associate to. If it returns
1700 * an error, the corresponding authentication, association or frame
1701 * transmission is aborted and reported as having failed. It is always
1702 * called after tuning to the correct channel.
1703 * The callback might be called multiple times before @finish_tx_sync
1704 * (but @finish_tx_sync will be called once for each) but in practice
1705 * this is unlikely to happen. It can also refuse in that case if the
1706 * driver cannot handle that situation.
1707 * This callback can sleep.
1708 * @finish_tx_sync: Called as a counterpart to @tx_sync, unless that returned
1709 * an error. This callback can sleep.
1710 *
1674 * @prepare_multicast: Prepare for multicast filter configuration. 1711 * @prepare_multicast: Prepare for multicast filter configuration.
1675 * This callback is optional, and its return value is passed 1712 * This callback is optional, and its return value is passed
1676 * to configure_filter(). This callback must be atomic. 1713 * to configure_filter(). This callback must be atomic.
@@ -1694,6 +1731,12 @@ enum ieee80211_ampdu_mlme_action {
1694 * which set IEEE80211_KEY_FLAG_TKIP_REQ_RX_P1_KEY. 1731 * which set IEEE80211_KEY_FLAG_TKIP_REQ_RX_P1_KEY.
1695 * The callback must be atomic. 1732 * The callback must be atomic.
1696 * 1733 *
1734 * @set_rekey_data: If the device supports GTK rekeying, for example while the
1735 * host is suspended, it can assign this callback to retrieve the data
1736 * necessary to do GTK rekeying, this is the KEK, KCK and replay counter.
1737 * After rekeying was done it should (for example during resume) notify
1738 * userspace of the new replay counter using ieee80211_gtk_rekey_notify().
1739 *
1697 * @hw_scan: Ask the hardware to service the scan request, no need to start 1740 * @hw_scan: Ask the hardware to service the scan request, no need to start
1698 * the scan state machine in stack. The scan must honour the channel 1741 * the scan state machine in stack. The scan must honour the channel
1699 * configuration done by the regulatory agent in the wiphy's 1742 * configuration done by the regulatory agent in the wiphy's
@@ -1708,6 +1751,14 @@ enum ieee80211_ampdu_mlme_action {
1708 * any error unless this callback returned a negative error code. 1751 * any error unless this callback returned a negative error code.
1709 * The callback can sleep. 1752 * The callback can sleep.
1710 * 1753 *
1754 * @cancel_hw_scan: Ask the low-level tp cancel the active hw scan.
1755 * The driver should ask the hardware to cancel the scan (if possible),
1756 * but the scan will be completed only after the driver will call
1757 * ieee80211_scan_completed().
1758 * This callback is needed for wowlan, to prevent enqueueing a new
1759 * scan_work after the low-level driver was already suspended.
1760 * The callback can sleep.
1761 *
1711 * @sched_scan_start: Ask the hardware to start scanning repeatedly at 1762 * @sched_scan_start: Ask the hardware to start scanning repeatedly at
1712 * specific intervals. The driver must call the 1763 * specific intervals. The driver must call the
1713 * ieee80211_sched_scan_results() function whenever it finds results. 1764 * ieee80211_sched_scan_results() function whenever it finds results.
@@ -1816,6 +1867,7 @@ enum ieee80211_ampdu_mlme_action {
1816 * 1867 *
1817 * @testmode_cmd: Implement a cfg80211 test mode command. 1868 * @testmode_cmd: Implement a cfg80211 test mode command.
1818 * The callback can sleep. 1869 * The callback can sleep.
1870 * @testmode_dump: Implement a cfg80211 test mode dump. The callback can sleep.
1819 * 1871 *
1820 * @flush: Flush all pending frames from the hardware queue, making sure 1872 * @flush: Flush all pending frames from the hardware queue, making sure
1821 * that the hardware queues are empty. If the parameter @drop is set 1873 * that the hardware queues are empty. If the parameter @drop is set
@@ -1860,6 +1912,8 @@ enum ieee80211_ampdu_mlme_action {
1860 * @set_bitrate_mask: Set a mask of rates to be used for rate control selection 1912 * @set_bitrate_mask: Set a mask of rates to be used for rate control selection
1861 * when transmitting a frame. Currently only legacy rates are handled. 1913 * when transmitting a frame. Currently only legacy rates are handled.
1862 * The callback can sleep. 1914 * The callback can sleep.
1915 * @rssi_callback: Notify driver when the average RSSI goes above/below
1916 * thresholds that were registered previously. The callback can sleep.
1863 */ 1917 */
1864struct ieee80211_ops { 1918struct ieee80211_ops {
1865 void (*tx)(struct ieee80211_hw *hw, struct sk_buff *skb); 1919 void (*tx)(struct ieee80211_hw *hw, struct sk_buff *skb);
@@ -1881,6 +1935,14 @@ struct ieee80211_ops {
1881 struct ieee80211_vif *vif, 1935 struct ieee80211_vif *vif,
1882 struct ieee80211_bss_conf *info, 1936 struct ieee80211_bss_conf *info,
1883 u32 changed); 1937 u32 changed);
1938
1939 int (*tx_sync)(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
1940 const u8 *bssid, enum ieee80211_tx_sync_type type);
1941 void (*finish_tx_sync)(struct ieee80211_hw *hw,
1942 struct ieee80211_vif *vif,
1943 const u8 *bssid,
1944 enum ieee80211_tx_sync_type type);
1945
1884 u64 (*prepare_multicast)(struct ieee80211_hw *hw, 1946 u64 (*prepare_multicast)(struct ieee80211_hw *hw,
1885 struct netdev_hw_addr_list *mc_list); 1947 struct netdev_hw_addr_list *mc_list);
1886 void (*configure_filter)(struct ieee80211_hw *hw, 1948 void (*configure_filter)(struct ieee80211_hw *hw,
@@ -1897,8 +1959,13 @@ struct ieee80211_ops {
1897 struct ieee80211_key_conf *conf, 1959 struct ieee80211_key_conf *conf,
1898 struct ieee80211_sta *sta, 1960 struct ieee80211_sta *sta,
1899 u32 iv32, u16 *phase1key); 1961 u32 iv32, u16 *phase1key);
1962 void (*set_rekey_data)(struct ieee80211_hw *hw,
1963 struct ieee80211_vif *vif,
1964 struct cfg80211_gtk_rekey_data *data);
1900 int (*hw_scan)(struct ieee80211_hw *hw, struct ieee80211_vif *vif, 1965 int (*hw_scan)(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
1901 struct cfg80211_scan_request *req); 1966 struct cfg80211_scan_request *req);
1967 void (*cancel_hw_scan)(struct ieee80211_hw *hw,
1968 struct ieee80211_vif *vif);
1902 int (*sched_scan_start)(struct ieee80211_hw *hw, 1969 int (*sched_scan_start)(struct ieee80211_hw *hw,
1903 struct ieee80211_vif *vif, 1970 struct ieee80211_vif *vif,
1904 struct cfg80211_sched_scan_request *req, 1971 struct cfg80211_sched_scan_request *req,
@@ -1936,6 +2003,9 @@ struct ieee80211_ops {
1936 void (*set_coverage_class)(struct ieee80211_hw *hw, u8 coverage_class); 2003 void (*set_coverage_class)(struct ieee80211_hw *hw, u8 coverage_class);
1937#ifdef CONFIG_NL80211_TESTMODE 2004#ifdef CONFIG_NL80211_TESTMODE
1938 int (*testmode_cmd)(struct ieee80211_hw *hw, void *data, int len); 2005 int (*testmode_cmd)(struct ieee80211_hw *hw, void *data, int len);
2006 int (*testmode_dump)(struct ieee80211_hw *hw, struct sk_buff *skb,
2007 struct netlink_callback *cb,
2008 void *data, int len);
1939#endif 2009#endif
1940 void (*flush)(struct ieee80211_hw *hw, bool drop); 2010 void (*flush)(struct ieee80211_hw *hw, bool drop);
1941 void (*channel_switch)(struct ieee80211_hw *hw, 2011 void (*channel_switch)(struct ieee80211_hw *hw,
@@ -1960,6 +2030,8 @@ struct ieee80211_ops {
1960 bool (*tx_frames_pending)(struct ieee80211_hw *hw); 2030 bool (*tx_frames_pending)(struct ieee80211_hw *hw);
1961 int (*set_bitrate_mask)(struct ieee80211_hw *hw, struct ieee80211_vif *vif, 2031 int (*set_bitrate_mask)(struct ieee80211_hw *hw, struct ieee80211_vif *vif,
1962 const struct cfg80211_bitrate_mask *mask); 2032 const struct cfg80211_bitrate_mask *mask);
2033 void (*rssi_callback)(struct ieee80211_hw *hw,
2034 enum ieee80211_rssi_event rssi_event);
1963}; 2035};
1964 2036
1965/** 2037/**
@@ -2550,21 +2622,136 @@ struct sk_buff *
2550ieee80211_get_buffered_bc(struct ieee80211_hw *hw, struct ieee80211_vif *vif); 2622ieee80211_get_buffered_bc(struct ieee80211_hw *hw, struct ieee80211_vif *vif);
2551 2623
2552/** 2624/**
2553 * ieee80211_get_tkip_key - get a TKIP rc4 for skb 2625 * ieee80211_get_tkip_p1k_iv - get a TKIP phase 1 key for IV32
2626 *
2627 * This function returns the TKIP phase 1 key for the given IV32.
2628 *
2629 * @keyconf: the parameter passed with the set key
2630 * @iv32: IV32 to get the P1K for
2631 * @p1k: a buffer to which the key will be written, as 5 u16 values
2632 */
2633void ieee80211_get_tkip_p1k_iv(struct ieee80211_key_conf *keyconf,
2634 u32 iv32, u16 *p1k);
2635
2636/**
2637 * ieee80211_get_tkip_p1k - get a TKIP phase 1 key
2638 *
2639 * This function returns the TKIP phase 1 key for the IV32 taken
2640 * from the given packet.
2641 *
2642 * @keyconf: the parameter passed with the set key
2643 * @skb: the packet to take the IV32 value from that will be encrypted
2644 * with this P1K
2645 * @p1k: a buffer to which the key will be written, as 5 u16 values
2646 */
2647static inline void ieee80211_get_tkip_p1k(struct ieee80211_key_conf *keyconf,
2648 struct sk_buff *skb, u16 *p1k)
2649{
2650 struct ieee80211_hdr *hdr = (struct ieee80211_hdr *)skb->data;
2651 const u8 *data = (u8 *)hdr + ieee80211_hdrlen(hdr->frame_control);
2652 u32 iv32 = get_unaligned_le32(&data[4]);
2653
2654 ieee80211_get_tkip_p1k_iv(keyconf, iv32, p1k);
2655}
2656
2657/**
2658 * ieee80211_get_tkip_rx_p1k - get a TKIP phase 1 key for RX
2659 *
2660 * This function returns the TKIP phase 1 key for the given IV32
2661 * and transmitter address.
2662 *
2663 * @keyconf: the parameter passed with the set key
2664 * @ta: TA that will be used with the key
2665 * @iv32: IV32 to get the P1K for
2666 * @p1k: a buffer to which the key will be written, as 5 u16 values
2667 */
2668void ieee80211_get_tkip_rx_p1k(struct ieee80211_key_conf *keyconf,
2669 const u8 *ta, u32 iv32, u16 *p1k);
2670
2671/**
2672 * ieee80211_get_tkip_p2k - get a TKIP phase 2 key
2673 *
2674 * This function computes the TKIP RC4 key for the IV values
2675 * in the packet.
2676 *
2677 * @keyconf: the parameter passed with the set key
2678 * @skb: the packet to take the IV32/IV16 values from that will be
2679 * encrypted with this key
2680 * @p2k: a buffer to which the key will be written, 16 bytes
2681 */
2682void ieee80211_get_tkip_p2k(struct ieee80211_key_conf *keyconf,
2683 struct sk_buff *skb, u8 *p2k);
2684
2685/**
2686 * struct ieee80211_key_seq - key sequence counter
2554 * 2687 *
2555 * This function computes a TKIP rc4 key for an skb. It computes 2688 * @tkip: TKIP data, containing IV32 and IV16 in host byte order
2556 * a phase 1 key if needed (iv16 wraps around). This function is to 2689 * @ccmp: PN data, most significant byte first (big endian,
2557 * be used by drivers which can do HW encryption but need to compute 2690 * reverse order than in packet)
2558 * to phase 1/2 key in SW. 2691 * @aes_cmac: PN data, most significant byte first (big endian,
2692 * reverse order than in packet)
2693 */
2694struct ieee80211_key_seq {
2695 union {
2696 struct {
2697 u32 iv32;
2698 u16 iv16;
2699 } tkip;
2700 struct {
2701 u8 pn[6];
2702 } ccmp;
2703 struct {
2704 u8 pn[6];
2705 } aes_cmac;
2706 };
2707};
2708
2709/**
2710 * ieee80211_get_key_tx_seq - get key TX sequence counter
2711 *
2712 * @keyconf: the parameter passed with the set key
2713 * @seq: buffer to receive the sequence data
2714 *
2715 * This function allows a driver to retrieve the current TX IV/PN
2716 * for the given key. It must not be called if IV generation is
2717 * offloaded to the device.
2718 *
2719 * Note that this function may only be called when no TX processing
2720 * can be done concurrently, for example when queues are stopped
2721 * and the stop has been synchronized.
2722 */
2723void ieee80211_get_key_tx_seq(struct ieee80211_key_conf *keyconf,
2724 struct ieee80211_key_seq *seq);
2725
2726/**
2727 * ieee80211_get_key_rx_seq - get key RX sequence counter
2559 * 2728 *
2560 * @keyconf: the parameter passed with the set key 2729 * @keyconf: the parameter passed with the set key
2561 * @skb: the skb for which the key is needed 2730 * @tid: The TID, or -1 for the management frame value (CCMP only);
2562 * @type: TBD 2731 * the value on TID 0 is also used for non-QoS frames. For
2563 * @key: a buffer to which the key will be written 2732 * CMAC, only TID 0 is valid.
2733 * @seq: buffer to receive the sequence data
2734 *
2735 * This function allows a driver to retrieve the current RX IV/PNs
2736 * for the given key. It must not be called if IV checking is done
2737 * by the device and not by mac80211.
2738 *
2739 * Note that this function may only be called when no RX processing
2740 * can be done concurrently.
2564 */ 2741 */
2565void ieee80211_get_tkip_key(struct ieee80211_key_conf *keyconf, 2742void ieee80211_get_key_rx_seq(struct ieee80211_key_conf *keyconf,
2566 struct sk_buff *skb, 2743 int tid, struct ieee80211_key_seq *seq);
2567 enum ieee80211_tkip_key_type type, u8 *key); 2744
2745/**
2746 * ieee80211_gtk_rekey_notify - notify userspace supplicant of rekeying
2747 * @vif: virtual interface the rekeying was done on
2748 * @bssid: The BSSID of the AP, for checking association
2749 * @replay_ctr: the new replay counter after GTK rekeying
2750 * @gfp: allocation flags
2751 */
2752void ieee80211_gtk_rekey_notify(struct ieee80211_vif *vif, const u8 *bssid,
2753 const u8 *replay_ctr, gfp_t gfp);
2754
2568/** 2755/**
2569 * ieee80211_wake_queue - wake specific queue 2756 * ieee80211_wake_queue - wake specific queue
2570 * @hw: pointer as obtained from ieee80211_alloc_hw(). 2757 * @hw: pointer as obtained from ieee80211_alloc_hw().
@@ -2830,6 +3017,33 @@ void ieee80211_sta_block_awake(struct ieee80211_hw *hw,
2830 struct ieee80211_sta *pubsta, bool block); 3017 struct ieee80211_sta *pubsta, bool block);
2831 3018
2832/** 3019/**
3020 * ieee80211_iter_keys - iterate keys programmed into the device
3021 * @hw: pointer obtained from ieee80211_alloc_hw()
3022 * @vif: virtual interface to iterate, may be %NULL for all
3023 * @iter: iterator function that will be called for each key
3024 * @iter_data: custom data to pass to the iterator function
3025 *
3026 * This function can be used to iterate all the keys known to
3027 * mac80211, even those that weren't previously programmed into
3028 * the device. This is intended for use in WoWLAN if the device
3029 * needs reprogramming of the keys during suspend. Note that due
3030 * to locking reasons, it is also only safe to call this at few
3031 * spots since it must hold the RTNL and be able to sleep.
3032 *
3033 * The order in which the keys are iterated matches the order
3034 * in which they were originally installed and handed to the
3035 * set_key callback.
3036 */
3037void ieee80211_iter_keys(struct ieee80211_hw *hw,
3038 struct ieee80211_vif *vif,
3039 void (*iter)(struct ieee80211_hw *hw,
3040 struct ieee80211_vif *vif,
3041 struct ieee80211_sta *sta,
3042 struct ieee80211_key_conf *key,
3043 void *data),
3044 void *iter_data);
3045
3046/**
2833 * ieee80211_ap_probereq_get - retrieve a Probe Request template 3047 * ieee80211_ap_probereq_get - retrieve a Probe Request template
2834 * @hw: pointer obtained from ieee80211_alloc_hw(). 3048 * @hw: pointer obtained from ieee80211_alloc_hw().
2835 * @vif: &struct ieee80211_vif pointer from the add_interface callback. 3049 * @vif: &struct ieee80211_vif pointer from the add_interface callback.
@@ -2870,6 +3084,29 @@ void ieee80211_beacon_loss(struct ieee80211_vif *vif);
2870void ieee80211_connection_loss(struct ieee80211_vif *vif); 3084void ieee80211_connection_loss(struct ieee80211_vif *vif);
2871 3085
2872/** 3086/**
3087 * ieee80211_resume_disconnect - disconnect from AP after resume
3088 *
3089 * @vif: &struct ieee80211_vif pointer from the add_interface callback.
3090 *
3091 * Instructs mac80211 to disconnect from the AP after resume.
3092 * Drivers can use this after WoWLAN if they know that the
3093 * connection cannot be kept up, for example because keys were
3094 * used while the device was asleep but the replay counters or
3095 * similar cannot be retrieved from the device during resume.
3096 *
3097 * Note that due to implementation issues, if the driver uses
3098 * the reconfiguration functionality during resume the interface
3099 * will still be added as associated first during resume and then
3100 * disconnect normally later.
3101 *
3102 * This function can only be called from the resume callback and
3103 * the driver must not be holding any of its own locks while it
3104 * calls this function, or at least not any locks it needs in the
3105 * key configuration paths (if it supports HW crypto).
3106 */
3107void ieee80211_resume_disconnect(struct ieee80211_vif *vif);
3108
3109/**
2873 * ieee80211_disable_dyn_ps - force mac80211 to temporarily disable dynamic psm 3110 * ieee80211_disable_dyn_ps - force mac80211 to temporarily disable dynamic psm
2874 * 3111 *
2875 * @vif: &struct ieee80211_vif pointer from the add_interface callback. 3112 * @vif: &struct ieee80211_vif pointer from the add_interface callback.
@@ -2916,6 +3153,16 @@ void ieee80211_cqm_rssi_notify(struct ieee80211_vif *vif,
2916 gfp_t gfp); 3153 gfp_t gfp);
2917 3154
2918/** 3155/**
3156 * ieee80211_get_operstate - get the operstate of the vif
3157 *
3158 * @vif: &struct ieee80211_vif pointer from the add_interface callback.
3159 *
3160 * The driver might need to know the operstate of the net_device
3161 * (specifically, whether the link is IF_OPER_UP after resume)
3162 */
3163unsigned char ieee80211_get_operstate(struct ieee80211_vif *vif);
3164
3165/**
2919 * ieee80211_chswitch_done - Complete channel switch process 3166 * ieee80211_chswitch_done - Complete channel switch process
2920 * @vif: &struct ieee80211_vif pointer from the add_interface callback. 3167 * @vif: &struct ieee80211_vif pointer from the add_interface callback.
2921 * @success: make the channel switch successful or not 3168 * @success: make the channel switch successful or not
@@ -2965,6 +3212,23 @@ void ieee80211_ready_on_channel(struct ieee80211_hw *hw);
2965 */ 3212 */
2966void ieee80211_remain_on_channel_expired(struct ieee80211_hw *hw); 3213void ieee80211_remain_on_channel_expired(struct ieee80211_hw *hw);
2967 3214
3215/**
3216 * ieee80211_stop_rx_ba_session - callback to stop existing BA sessions
3217 *
3218 * in order not to harm the system performance and user experience, the device
3219 * may request not to allow any rx ba session and tear down existing rx ba
3220 * sessions based on system constraints such as periodic BT activity that needs
3221 * to limit wlan activity (eg.sco or a2dp)."
3222 * in such cases, the intention is to limit the duration of the rx ppdu and
3223 * therefore prevent the peer device to use a-mpdu aggregation.
3224 *
3225 * @vif: &struct ieee80211_vif pointer from the add_interface callback.
3226 * @ba_rx_bitmap: Bit map of open rx ba per tid
3227 * @addr: & to bssid mac address
3228 */
3229void ieee80211_stop_rx_ba_session(struct ieee80211_vif *vif, u16 ba_rx_bitmap,
3230 const u8 *addr);
3231
2968/* Rate control API */ 3232/* Rate control API */
2969 3233
2970/** 3234/**
@@ -3150,4 +3414,9 @@ ieee80211_vif_type_p2p(struct ieee80211_vif *vif)
3150 return ieee80211_iftype_p2p(vif->type, vif->p2p); 3414 return ieee80211_iftype_p2p(vif->type, vif->p2p);
3151} 3415}
3152 3416
3417void ieee80211_enable_rssi_reports(struct ieee80211_vif *vif,
3418 int rssi_min_thold,
3419 int rssi_max_thold);
3420
3421void ieee80211_disable_rssi_reports(struct ieee80211_vif *vif);
3153#endif /* MAC80211_H */ 3422#endif /* MAC80211_H */
diff --git a/include/net/neighbour.h b/include/net/neighbour.h
index 4014b623880c..4ba8521490ba 100644
--- a/include/net/neighbour.h
+++ b/include/net/neighbour.h
@@ -108,8 +108,8 @@ struct neighbour {
108 __u8 dead; 108 __u8 dead;
109 seqlock_t ha_lock; 109 seqlock_t ha_lock;
110 unsigned char ha[ALIGN(MAX_ADDR_LEN, sizeof(unsigned long))]; 110 unsigned char ha[ALIGN(MAX_ADDR_LEN, sizeof(unsigned long))];
111 struct hh_cache *hh; 111 struct hh_cache hh;
112 int (*output)(struct sk_buff *skb); 112 int (*output)(struct neighbour *, struct sk_buff *);
113 const struct neigh_ops *ops; 113 const struct neigh_ops *ops;
114 struct rcu_head rcu; 114 struct rcu_head rcu;
115 struct net_device *dev; 115 struct net_device *dev;
@@ -118,12 +118,10 @@ struct neighbour {
118 118
119struct neigh_ops { 119struct neigh_ops {
120 int family; 120 int family;
121 void (*solicit)(struct neighbour *, struct sk_buff*); 121 void (*solicit)(struct neighbour *, struct sk_buff *);
122 void (*error_report)(struct neighbour *, struct sk_buff*); 122 void (*error_report)(struct neighbour *, struct sk_buff *);
123 int (*output)(struct sk_buff*); 123 int (*output)(struct neighbour *, struct sk_buff *);
124 int (*connected_output)(struct sk_buff*); 124 int (*connected_output)(struct neighbour *, struct sk_buff *);
125 int (*hh_output)(struct sk_buff*);
126 int (*queue_xmit)(struct sk_buff*);
127}; 125};
128 126
129struct pneigh_entry { 127struct pneigh_entry {
@@ -142,7 +140,7 @@ struct pneigh_entry {
142 140
143struct neigh_hash_table { 141struct neigh_hash_table {
144 struct neighbour __rcu **hash_buckets; 142 struct neighbour __rcu **hash_buckets;
145 unsigned int hash_mask; 143 unsigned int hash_shift;
146 __u32 hash_rnd; 144 __u32 hash_rnd;
147 struct rcu_head rcu; 145 struct rcu_head rcu;
148}; 146};
@@ -205,9 +203,10 @@ extern int neigh_update(struct neighbour *neigh, const u8 *lladdr, u8 new,
205 u32 flags); 203 u32 flags);
206extern void neigh_changeaddr(struct neigh_table *tbl, struct net_device *dev); 204extern void neigh_changeaddr(struct neigh_table *tbl, struct net_device *dev);
207extern int neigh_ifdown(struct neigh_table *tbl, struct net_device *dev); 205extern int neigh_ifdown(struct neigh_table *tbl, struct net_device *dev);
208extern int neigh_resolve_output(struct sk_buff *skb); 206extern int neigh_resolve_output(struct neighbour *neigh, struct sk_buff *skb);
209extern int neigh_connected_output(struct sk_buff *skb); 207extern int neigh_connected_output(struct neighbour *neigh, struct sk_buff *skb);
210extern int neigh_compat_output(struct sk_buff *skb); 208extern int neigh_compat_output(struct neighbour *neigh, struct sk_buff *skb);
209extern int neigh_direct_output(struct neighbour *neigh, struct sk_buff *skb);
211extern struct neighbour *neigh_event_ns(struct neigh_table *tbl, 210extern struct neighbour *neigh_event_ns(struct neigh_table *tbl,
212 u8 *lladdr, void *saddr, 211 u8 *lladdr, void *saddr,
213 struct net_device *dev); 212 struct net_device *dev);
@@ -341,7 +340,16 @@ static inline int neigh_hh_output(struct hh_cache *hh, struct sk_buff *skb)
341 } while (read_seqretry(&hh->hh_lock, seq)); 340 } while (read_seqretry(&hh->hh_lock, seq));
342 341
343 skb_push(skb, hh_len); 342 skb_push(skb, hh_len);
344 return hh->hh_output(skb); 343 return dev_queue_xmit(skb);
344}
345
346static inline int neigh_output(struct neighbour *n, struct sk_buff *skb)
347{
348 struct hh_cache *hh = &n->hh;
349 if ((n->nud_state & NUD_CONNECTED) && hh->hh_len)
350 return neigh_hh_output(hh, skb);
351 else
352 return n->output(n, skb);
345} 353}
346 354
347static inline struct neighbour * 355static inline struct neighbour *
diff --git a/include/net/net_namespace.h b/include/net/net_namespace.h
index 2bf9ed9ef26b..1ab1aec209ac 100644
--- a/include/net/net_namespace.h
+++ b/include/net/net_namespace.h
@@ -35,8 +35,11 @@ struct netns_ipvs;
35#define NETDEV_HASHENTRIES (1 << NETDEV_HASHBITS) 35#define NETDEV_HASHENTRIES (1 << NETDEV_HASHBITS)
36 36
37struct net { 37struct net {
38 atomic_t passive; /* To decided when the network
39 * namespace should be freed.
40 */
38 atomic_t count; /* To decided when the network 41 atomic_t count; /* To decided when the network
39 * namespace should be freed. 42 * namespace should be shut down.
40 */ 43 */
41#ifdef NETNS_REFCNT_DEBUG 44#ifdef NETNS_REFCNT_DEBUG
42 atomic_t use_count; /* To track references we 45 atomic_t use_count; /* To track references we
@@ -62,6 +65,7 @@ struct net {
62 struct list_head dev_base_head; 65 struct list_head dev_base_head;
63 struct hlist_head *dev_name_head; 66 struct hlist_head *dev_name_head;
64 struct hlist_head *dev_index_head; 67 struct hlist_head *dev_index_head;
68 unsigned int dev_base_seq; /* protected by rtnl_mutex */
65 69
66 /* core fib_rules */ 70 /* core fib_rules */
67 struct list_head rules_ops; 71 struct list_head rules_ops;
@@ -154,6 +158,9 @@ int net_eq(const struct net *net1, const struct net *net2)
154{ 158{
155 return net1 == net2; 159 return net1 == net2;
156} 160}
161
162extern void net_drop_ns(void *);
163
157#else 164#else
158 165
159static inline struct net *get_net(struct net *net) 166static inline struct net *get_net(struct net *net)
@@ -175,6 +182,8 @@ int net_eq(const struct net *net1, const struct net *net2)
175{ 182{
176 return 1; 183 return 1;
177} 184}
185
186#define net_drop_ns NULL
178#endif 187#endif
179 188
180 189
diff --git a/include/net/netfilter/nf_conntrack.h b/include/net/netfilter/nf_conntrack.h
index c7c42e7acc31..5d4f8e586e32 100644
--- a/include/net/netfilter/nf_conntrack.h
+++ b/include/net/netfilter/nf_conntrack.h
@@ -307,6 +307,12 @@ static inline int nf_ct_is_untracked(const struct nf_conn *ct)
307 return test_bit(IPS_UNTRACKED_BIT, &ct->status); 307 return test_bit(IPS_UNTRACKED_BIT, &ct->status);
308} 308}
309 309
310/* Packet is received from loopback */
311static inline bool nf_is_loopback_packet(const struct sk_buff *skb)
312{
313 return skb->dev && skb->skb_iif && skb->dev->flags & IFF_LOOPBACK;
314}
315
310extern int nf_conntrack_set_hashsize(const char *val, struct kernel_param *kp); 316extern int nf_conntrack_set_hashsize(const char *val, struct kernel_param *kp);
311extern unsigned int nf_conntrack_htable_size; 317extern unsigned int nf_conntrack_htable_size;
312extern unsigned int nf_conntrack_max; 318extern unsigned int nf_conntrack_max;
diff --git a/include/net/netlink.h b/include/net/netlink.h
index 02740a94f108..98c185441bee 100644
--- a/include/net/netlink.h
+++ b/include/net/netlink.h
@@ -638,6 +638,30 @@ static inline int nlmsg_unicast(struct sock *sk, struct sk_buff *skb, u32 pid)
638 nlmsg_ok(pos, rem); \ 638 nlmsg_ok(pos, rem); \
639 pos = nlmsg_next(pos, &(rem))) 639 pos = nlmsg_next(pos, &(rem)))
640 640
641/**
642 * nl_dump_check_consistent - check if sequence is consistent and advertise if not
643 * @cb: netlink callback structure that stores the sequence number
644 * @nlh: netlink message header to write the flag to
645 *
646 * This function checks if the sequence (generation) number changed during dump
647 * and if it did, advertises it in the netlink message header.
648 *
649 * The correct way to use it is to set cb->seq to the generation counter when
650 * all locks for dumping have been acquired, and then call this function for
651 * each message that is generated.
652 *
653 * Note that due to initialisation concerns, 0 is an invalid sequence number
654 * and must not be used by code that uses this functionality.
655 */
656static inline void
657nl_dump_check_consistent(struct netlink_callback *cb,
658 struct nlmsghdr *nlh)
659{
660 if (cb->prev_seq && cb->seq != cb->prev_seq)
661 nlh->nlmsg_flags |= NLM_F_DUMP_INTR;
662 cb->prev_seq = cb->seq;
663}
664
641/************************************************************************** 665/**************************************************************************
642 * Netlink Attributes 666 * Netlink Attributes
643 **************************************************************************/ 667 **************************************************************************/
diff --git a/include/net/nfc.h b/include/net/nfc.h
new file mode 100644
index 000000000000..cc0130312f70
--- /dev/null
+++ b/include/net/nfc.h
@@ -0,0 +1,156 @@
1/*
2 * Copyright (C) 2011 Instituto Nokia de Tecnologia
3 *
4 * Authors:
5 * Lauro Ramos Venancio <lauro.venancio@openbossa.org>
6 * Aloisio Almeida Jr <aloisio.almeida@openbossa.org>
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the
20 * Free Software Foundation, Inc.,
21 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
22 */
23
24#ifndef __NET_NFC_H
25#define __NET_NFC_H
26
27#include <linux/device.h>
28#include <linux/skbuff.h>
29
30#define nfc_dev_info(dev, fmt, arg...) dev_info((dev), "NFC: " fmt "\n", ## arg)
31#define nfc_dev_err(dev, fmt, arg...) dev_err((dev), "NFC: " fmt "\n", ## arg)
32#define nfc_dev_dbg(dev, fmt, arg...) dev_dbg((dev), fmt "\n", ## arg)
33
34struct nfc_dev;
35
36/**
37 * data_exchange_cb_t - Definition of nfc_data_exchange callback
38 *
39 * @context: nfc_data_exchange cb_context parameter
40 * @skb: response data
41 * @err: If an error has occurred during data exchange, it is the
42 * error number. Zero means no error.
43 *
44 * When a rx or tx package is lost or corrupted or the target gets out
45 * of the operating field, err is -EIO.
46 */
47typedef void (*data_exchange_cb_t)(void *context, struct sk_buff *skb,
48 int err);
49
50struct nfc_ops {
51 int (*start_poll)(struct nfc_dev *dev, u32 protocols);
52 void (*stop_poll)(struct nfc_dev *dev);
53 int (*activate_target)(struct nfc_dev *dev, u32 target_idx,
54 u32 protocol);
55 void (*deactivate_target)(struct nfc_dev *dev, u32 target_idx);
56 int (*data_exchange)(struct nfc_dev *dev, u32 target_idx,
57 struct sk_buff *skb, data_exchange_cb_t cb,
58 void *cb_context);
59};
60
61struct nfc_target {
62 u32 idx;
63 u32 supported_protocols;
64 u16 sens_res;
65 u8 sel_res;
66};
67
68struct nfc_genl_data {
69 u32 poll_req_pid;
70 struct mutex genl_data_mutex;
71};
72
73struct nfc_dev {
74 unsigned idx;
75 unsigned target_idx;
76 struct nfc_target *targets;
77 int n_targets;
78 int targets_generation;
79 spinlock_t targets_lock;
80 struct device dev;
81 bool polling;
82 struct nfc_genl_data genl_data;
83 u32 supported_protocols;
84
85 struct nfc_ops *ops;
86};
87#define to_nfc_dev(_dev) container_of(_dev, struct nfc_dev, dev)
88
89extern struct class nfc_class;
90
91struct nfc_dev *nfc_allocate_device(struct nfc_ops *ops,
92 u32 supported_protocols);
93
94/**
95 * nfc_free_device - free nfc device
96 *
97 * @dev: The nfc device to free
98 */
99static inline void nfc_free_device(struct nfc_dev *dev)
100{
101 put_device(&dev->dev);
102}
103
104int nfc_register_device(struct nfc_dev *dev);
105
106void nfc_unregister_device(struct nfc_dev *dev);
107
108/**
109 * nfc_set_parent_dev - set the parent device
110 *
111 * @nfc_dev: The nfc device whose parent is being set
112 * @dev: The parent device
113 */
114static inline void nfc_set_parent_dev(struct nfc_dev *nfc_dev,
115 struct device *dev)
116{
117 nfc_dev->dev.parent = dev;
118}
119
120/**
121 * nfc_set_drvdata - set driver specifc data
122 *
123 * @dev: The nfc device
124 * @data: Pointer to driver specifc data
125 */
126static inline void nfc_set_drvdata(struct nfc_dev *dev, void *data)
127{
128 dev_set_drvdata(&dev->dev, data);
129}
130
131/**
132 * nfc_get_drvdata - get driver specifc data
133 *
134 * @dev: The nfc device
135 */
136static inline void *nfc_get_drvdata(struct nfc_dev *dev)
137{
138 return dev_get_drvdata(&dev->dev);
139}
140
141/**
142 * nfc_device_name - get the nfc device name
143 *
144 * @dev: The nfc device whose name to return
145 */
146static inline const char *nfc_device_name(struct nfc_dev *dev)
147{
148 return dev_name(&dev->dev);
149}
150
151struct sk_buff *nfc_alloc_skb(unsigned int size, gfp_t gfp);
152
153int nfc_targets_found(struct nfc_dev *dev, struct nfc_target *targets,
154 int ntargets);
155
156#endif /* __NET_NFC_H */
diff --git a/include/net/pkt_sched.h b/include/net/pkt_sched.h
index 65afc4966204..fffdc603f4c8 100644
--- a/include/net/pkt_sched.h
+++ b/include/net/pkt_sched.h
@@ -99,9 +99,9 @@ static inline void qdisc_run(struct Qdisc *q)
99 __qdisc_run(q); 99 __qdisc_run(q);
100} 100}
101 101
102extern int tc_classify_compat(struct sk_buff *skb, struct tcf_proto *tp, 102extern int tc_classify_compat(struct sk_buff *skb, const struct tcf_proto *tp,
103 struct tcf_result *res); 103 struct tcf_result *res);
104extern int tc_classify(struct sk_buff *skb, struct tcf_proto *tp, 104extern int tc_classify(struct sk_buff *skb, const struct tcf_proto *tp,
105 struct tcf_result *res); 105 struct tcf_result *res);
106 106
107/* Calculate maximal size of packet seen by hard_start_xmit 107/* Calculate maximal size of packet seen by hard_start_xmit
diff --git a/include/net/rtnetlink.h b/include/net/rtnetlink.h
index 4093ca78cf60..678f1ffaf843 100644
--- a/include/net/rtnetlink.h
+++ b/include/net/rtnetlink.h
@@ -6,11 +6,14 @@
6 6
7typedef int (*rtnl_doit_func)(struct sk_buff *, struct nlmsghdr *, void *); 7typedef int (*rtnl_doit_func)(struct sk_buff *, struct nlmsghdr *, void *);
8typedef int (*rtnl_dumpit_func)(struct sk_buff *, struct netlink_callback *); 8typedef int (*rtnl_dumpit_func)(struct sk_buff *, struct netlink_callback *);
9typedef u16 (*rtnl_calcit_func)(struct sk_buff *);
9 10
10extern int __rtnl_register(int protocol, int msgtype, 11extern int __rtnl_register(int protocol, int msgtype,
11 rtnl_doit_func, rtnl_dumpit_func); 12 rtnl_doit_func, rtnl_dumpit_func,
13 rtnl_calcit_func);
12extern void rtnl_register(int protocol, int msgtype, 14extern void rtnl_register(int protocol, int msgtype,
13 rtnl_doit_func, rtnl_dumpit_func); 15 rtnl_doit_func, rtnl_dumpit_func,
16 rtnl_calcit_func);
14extern int rtnl_unregister(int protocol, int msgtype); 17extern int rtnl_unregister(int protocol, int msgtype);
15extern void rtnl_unregister_all(int protocol); 18extern void rtnl_unregister_all(int protocol);
16 19
diff --git a/include/net/sch_generic.h b/include/net/sch_generic.h
index b931f021d7ab..4fc88f3ccd5f 100644
--- a/include/net/sch_generic.h
+++ b/include/net/sch_generic.h
@@ -181,8 +181,9 @@ struct tcf_proto_ops {
181 struct tcf_proto_ops *next; 181 struct tcf_proto_ops *next;
182 char kind[IFNAMSIZ]; 182 char kind[IFNAMSIZ];
183 183
184 int (*classify)(struct sk_buff*, struct tcf_proto*, 184 int (*classify)(struct sk_buff *,
185 struct tcf_result *); 185 const struct tcf_proto *,
186 struct tcf_result *);
186 int (*init)(struct tcf_proto*); 187 int (*init)(struct tcf_proto*);
187 void (*destroy)(struct tcf_proto*); 188 void (*destroy)(struct tcf_proto*);
188 189
@@ -205,8 +206,9 @@ struct tcf_proto {
205 /* Fast access part */ 206 /* Fast access part */
206 struct tcf_proto *next; 207 struct tcf_proto *next;
207 void *root; 208 void *root;
208 int (*classify)(struct sk_buff*, struct tcf_proto*, 209 int (*classify)(struct sk_buff *,
209 struct tcf_result *); 210 const struct tcf_proto *,
211 struct tcf_result *);
210 __be16 protocol; 212 __be16 protocol;
211 213
212 /* All the rest */ 214 /* All the rest */
@@ -214,7 +216,7 @@ struct tcf_proto {
214 u32 classid; 216 u32 classid;
215 struct Qdisc *q; 217 struct Qdisc *q;
216 void *data; 218 void *data;
217 struct tcf_proto_ops *ops; 219 const struct tcf_proto_ops *ops;
218}; 220};
219 221
220struct qdisc_skb_cb { 222struct qdisc_skb_cb {
diff --git a/include/net/sctp/command.h b/include/net/sctp/command.h
index dd6847e5d6e4..6506458ccd33 100644
--- a/include/net/sctp/command.h
+++ b/include/net/sctp/command.h
@@ -63,6 +63,7 @@ typedef enum {
63 SCTP_CMD_ECN_ECNE, /* Do delayed ECNE processing. */ 63 SCTP_CMD_ECN_ECNE, /* Do delayed ECNE processing. */
64 SCTP_CMD_ECN_CWR, /* Do delayed CWR processing. */ 64 SCTP_CMD_ECN_CWR, /* Do delayed CWR processing. */
65 SCTP_CMD_TIMER_START, /* Start a timer. */ 65 SCTP_CMD_TIMER_START, /* Start a timer. */
66 SCTP_CMD_TIMER_START_ONCE, /* Start a timer once */
66 SCTP_CMD_TIMER_RESTART, /* Restart a timer. */ 67 SCTP_CMD_TIMER_RESTART, /* Restart a timer. */
67 SCTP_CMD_TIMER_STOP, /* Stop a timer. */ 68 SCTP_CMD_TIMER_STOP, /* Stop a timer. */
68 SCTP_CMD_INIT_CHOOSE_TRANSPORT, /* Choose transport for an INIT. */ 69 SCTP_CMD_INIT_CHOOSE_TRANSPORT, /* Choose transport for an INIT. */
diff --git a/include/net/sctp/sctp.h b/include/net/sctp/sctp.h
index b2c2366676a7..6a72a58cde59 100644
--- a/include/net/sctp/sctp.h
+++ b/include/net/sctp/sctp.h
@@ -120,6 +120,7 @@ extern int sctp_copy_local_addr_list(struct sctp_bind_addr *,
120 int flags); 120 int flags);
121extern struct sctp_pf *sctp_get_pf_specific(sa_family_t family); 121extern struct sctp_pf *sctp_get_pf_specific(sa_family_t family);
122extern int sctp_register_pf(struct sctp_pf *, sa_family_t); 122extern int sctp_register_pf(struct sctp_pf *, sa_family_t);
123extern void sctp_addr_wq_mgmt(struct sctp_sockaddr_entry *, int);
123 124
124/* 125/*
125 * sctp/socket.c 126 * sctp/socket.c
@@ -134,6 +135,7 @@ void sctp_sock_rfree(struct sk_buff *skb);
134void sctp_copy_sock(struct sock *newsk, struct sock *sk, 135void sctp_copy_sock(struct sock *newsk, struct sock *sk,
135 struct sctp_association *asoc); 136 struct sctp_association *asoc);
136extern struct percpu_counter sctp_sockets_allocated; 137extern struct percpu_counter sctp_sockets_allocated;
138extern int sctp_asconf_mgmt(struct sctp_sock *, struct sctp_sockaddr_entry *);
137 139
138/* 140/*
139 * sctp/primitive.c 141 * sctp/primitive.c
@@ -285,20 +287,21 @@ do { \
285 pr_cont(fmt, ##args); \ 287 pr_cont(fmt, ##args); \
286} while (0) 288} while (0)
287#define SCTP_DEBUG_PRINTK_IPADDR(fmt_lead, fmt_trail, \ 289#define SCTP_DEBUG_PRINTK_IPADDR(fmt_lead, fmt_trail, \
288 args_lead, saddr, args_trail...) \ 290 args_lead, addr, args_trail...) \
289do { \ 291do { \
292 const union sctp_addr *_addr = (addr); \
290 if (sctp_debug_flag) { \ 293 if (sctp_debug_flag) { \
291 if (saddr->sa.sa_family == AF_INET6) { \ 294 if (_addr->sa.sa_family == AF_INET6) { \
292 printk(KERN_DEBUG \ 295 printk(KERN_DEBUG \
293 pr_fmt(fmt_lead "%pI6" fmt_trail), \ 296 pr_fmt(fmt_lead "%pI6" fmt_trail), \
294 args_lead, \ 297 args_lead, \
295 &saddr->v6.sin6_addr, \ 298 &_addr->v6.sin6_addr, \
296 args_trail); \ 299 args_trail); \
297 } else { \ 300 } else { \
298 printk(KERN_DEBUG \ 301 printk(KERN_DEBUG \
299 pr_fmt(fmt_lead "%pI4" fmt_trail), \ 302 pr_fmt(fmt_lead "%pI4" fmt_trail), \
300 args_lead, \ 303 args_lead, \
301 &saddr->v4.sin_addr.s_addr, \ 304 &_addr->v4.sin_addr.s_addr, \
302 args_trail); \ 305 args_trail); \
303 } \ 306 } \
304 } \ 307 } \
@@ -598,7 +601,7 @@ static inline int ipver2af(__u8 ipver)
598 return AF_INET6; 601 return AF_INET6;
599 default: 602 default:
600 return 0; 603 return 0;
601 }; 604 }
602} 605}
603 606
604/* Convert from an address parameter type to an address family. */ 607/* Convert from an address parameter type to an address family. */
@@ -611,7 +614,7 @@ static inline int param_type2af(__be16 type)
611 return AF_INET6; 614 return AF_INET6;
612 default: 615 default:
613 return 0; 616 return 0;
614 }; 617 }
615} 618}
616 619
617/* Perform some sanity checks. */ 620/* Perform some sanity checks. */
diff --git a/include/net/sctp/structs.h b/include/net/sctp/structs.h
index 7df327a6d564..31d7ea2e1d2a 100644
--- a/include/net/sctp/structs.h
+++ b/include/net/sctp/structs.h
@@ -205,6 +205,11 @@ extern struct sctp_globals {
205 * It is a list of sctp_sockaddr_entry. 205 * It is a list of sctp_sockaddr_entry.
206 */ 206 */
207 struct list_head local_addr_list; 207 struct list_head local_addr_list;
208 int default_auto_asconf;
209 struct list_head addr_waitq;
210 struct timer_list addr_wq_timer;
211 struct list_head auto_asconf_splist;
212 spinlock_t addr_wq_lock;
208 213
209 /* Lock that protects the local_addr_list writers */ 214 /* Lock that protects the local_addr_list writers */
210 spinlock_t addr_list_lock; 215 spinlock_t addr_list_lock;
@@ -264,6 +269,11 @@ extern struct sctp_globals {
264#define sctp_port_hashtable (sctp_globals.port_hashtable) 269#define sctp_port_hashtable (sctp_globals.port_hashtable)
265#define sctp_local_addr_list (sctp_globals.local_addr_list) 270#define sctp_local_addr_list (sctp_globals.local_addr_list)
266#define sctp_local_addr_lock (sctp_globals.addr_list_lock) 271#define sctp_local_addr_lock (sctp_globals.addr_list_lock)
272#define sctp_auto_asconf_splist (sctp_globals.auto_asconf_splist)
273#define sctp_addr_waitq (sctp_globals.addr_waitq)
274#define sctp_addr_wq_timer (sctp_globals.addr_wq_timer)
275#define sctp_addr_wq_lock (sctp_globals.addr_wq_lock)
276#define sctp_default_auto_asconf (sctp_globals.default_auto_asconf)
267#define sctp_scope_policy (sctp_globals.ipv4_scope_policy) 277#define sctp_scope_policy (sctp_globals.ipv4_scope_policy)
268#define sctp_addip_enable (sctp_globals.addip_enable) 278#define sctp_addip_enable (sctp_globals.addip_enable)
269#define sctp_addip_noauth (sctp_globals.addip_noauth_enable) 279#define sctp_addip_noauth (sctp_globals.addip_noauth_enable)
@@ -341,6 +351,8 @@ struct sctp_sock {
341 atomic_t pd_mode; 351 atomic_t pd_mode;
342 /* Receive to here while partial delivery is in effect. */ 352 /* Receive to here while partial delivery is in effect. */
343 struct sk_buff_head pd_lobby; 353 struct sk_buff_head pd_lobby;
354 struct list_head auto_asconf_list;
355 int do_auto_asconf;
344}; 356};
345 357
346static inline struct sctp_sock *sctp_sk(const struct sock *sk) 358static inline struct sctp_sock *sctp_sk(const struct sock *sk)
@@ -792,6 +804,8 @@ struct sctp_sockaddr_entry {
792 __u8 valid; 804 __u8 valid;
793}; 805};
794 806
807#define SCTP_ADDRESS_TICK_DELAY 500
808
795typedef struct sctp_chunk *(sctp_packet_phandler_t)(struct sctp_association *); 809typedef struct sctp_chunk *(sctp_packet_phandler_t)(struct sctp_association *);
796 810
797/* This structure holds lists of chunks as we are assembling for 811/* This structure holds lists of chunks as we are assembling for
@@ -1236,6 +1250,7 @@ sctp_scope_t sctp_scope(const union sctp_addr *);
1236int sctp_in_scope(const union sctp_addr *addr, const sctp_scope_t scope); 1250int sctp_in_scope(const union sctp_addr *addr, const sctp_scope_t scope);
1237int sctp_is_any(struct sock *sk, const union sctp_addr *addr); 1251int sctp_is_any(struct sock *sk, const union sctp_addr *addr);
1238int sctp_addr_is_valid(const union sctp_addr *addr); 1252int sctp_addr_is_valid(const union sctp_addr *addr);
1253int sctp_is_ep_boundall(struct sock *sk);
1239 1254
1240 1255
1241/* What type of endpoint? */ 1256/* What type of endpoint? */
@@ -1898,6 +1913,8 @@ struct sctp_association {
1898 * after reaching 4294967295. 1913 * after reaching 4294967295.
1899 */ 1914 */
1900 __u32 addip_serial; 1915 __u32 addip_serial;
1916 union sctp_addr *asconf_addr_del_pending;
1917 int src_out_of_asoc_ok;
1901 1918
1902 /* SCTP AUTH: list of the endpoint shared keys. These 1919 /* SCTP AUTH: list of the endpoint shared keys. These
1903 * keys are provided out of band by the user applicaton 1920 * keys are provided out of band by the user applicaton
diff --git a/include/net/sctp/ulpevent.h b/include/net/sctp/ulpevent.h
index 99b027b2adce..ca4693b4e09e 100644
--- a/include/net/sctp/ulpevent.h
+++ b/include/net/sctp/ulpevent.h
@@ -80,7 +80,7 @@ static inline struct sctp_ulpevent *sctp_skb2event(struct sk_buff *skb)
80 80
81void sctp_ulpevent_free(struct sctp_ulpevent *); 81void sctp_ulpevent_free(struct sctp_ulpevent *);
82int sctp_ulpevent_is_notification(const struct sctp_ulpevent *); 82int sctp_ulpevent_is_notification(const struct sctp_ulpevent *);
83void sctp_queue_purge_ulpevents(struct sk_buff_head *list); 83unsigned int sctp_queue_purge_ulpevents(struct sk_buff_head *list);
84 84
85struct sctp_ulpevent *sctp_ulpevent_make_assoc_change( 85struct sctp_ulpevent *sctp_ulpevent_make_assoc_change(
86 const struct sctp_association *asoc, 86 const struct sctp_association *asoc,
diff --git a/include/net/sctp/user.h b/include/net/sctp/user.h
index 32fd51274037..0842ef00b2fe 100644
--- a/include/net/sctp/user.h
+++ b/include/net/sctp/user.h
@@ -92,6 +92,7 @@ typedef __s32 sctp_assoc_t;
92#define SCTP_LOCAL_AUTH_CHUNKS 27 /* Read only */ 92#define SCTP_LOCAL_AUTH_CHUNKS 27 /* Read only */
93#define SCTP_GET_ASSOC_NUMBER 28 /* Read only */ 93#define SCTP_GET_ASSOC_NUMBER 28 /* Read only */
94#define SCTP_GET_ASSOC_ID_LIST 29 /* Read only */ 94#define SCTP_GET_ASSOC_ID_LIST 29 /* Read only */
95#define SCTP_AUTO_ASCONF 30
95 96
96/* Internal Socket Options. Some of the sctp library functions are 97/* Internal Socket Options. Some of the sctp library functions are
97 * implemented using these socket options. 98 * implemented using these socket options.
diff --git a/include/net/snmp.h b/include/net/snmp.h
index 479083a78b0c..8f0f9ac0307f 100644
--- a/include/net/snmp.h
+++ b/include/net/snmp.h
@@ -116,57 +116,51 @@ struct linux_xfrm_mib {
116 unsigned long mibs[LINUX_MIB_XFRMMAX]; 116 unsigned long mibs[LINUX_MIB_XFRMMAX];
117}; 117};
118 118
119/* 119#define SNMP_ARRAY_SZ 1
120 * FIXME: On x86 and some other CPUs the split into user and softirq parts 120
121 * is not needed because addl $1,memory is atomic against interrupts (but
122 * atomic_inc would be overkill because of the lock cycles). Wants new
123 * nonlocked_atomic_inc() primitives -AK
124 */
125#define DEFINE_SNMP_STAT(type, name) \ 121#define DEFINE_SNMP_STAT(type, name) \
126 __typeof__(type) __percpu *name[2] 122 __typeof__(type) __percpu *name[SNMP_ARRAY_SZ]
127#define DEFINE_SNMP_STAT_ATOMIC(type, name) \ 123#define DEFINE_SNMP_STAT_ATOMIC(type, name) \
128 __typeof__(type) *name 124 __typeof__(type) *name
129#define DECLARE_SNMP_STAT(type, name) \ 125#define DECLARE_SNMP_STAT(type, name) \
130 extern __typeof__(type) __percpu *name[2] 126 extern __typeof__(type) __percpu *name[SNMP_ARRAY_SZ]
131
132#define SNMP_STAT_BHPTR(name) (name[0])
133#define SNMP_STAT_USRPTR(name) (name[1])
134 127
135#define SNMP_INC_STATS_BH(mib, field) \ 128#define SNMP_INC_STATS_BH(mib, field) \
136 __this_cpu_inc(mib[0]->mibs[field]) 129 __this_cpu_inc(mib[0]->mibs[field])
130
137#define SNMP_INC_STATS_USER(mib, field) \ 131#define SNMP_INC_STATS_USER(mib, field) \
138 this_cpu_inc(mib[1]->mibs[field]) 132 irqsafe_cpu_inc(mib[0]->mibs[field])
133
139#define SNMP_INC_STATS_ATOMIC_LONG(mib, field) \ 134#define SNMP_INC_STATS_ATOMIC_LONG(mib, field) \
140 atomic_long_inc(&mib->mibs[field]) 135 atomic_long_inc(&mib->mibs[field])
136
141#define SNMP_INC_STATS(mib, field) \ 137#define SNMP_INC_STATS(mib, field) \
142 this_cpu_inc(mib[!in_softirq()]->mibs[field]) 138 irqsafe_cpu_inc(mib[0]->mibs[field])
139
143#define SNMP_DEC_STATS(mib, field) \ 140#define SNMP_DEC_STATS(mib, field) \
144 this_cpu_dec(mib[!in_softirq()]->mibs[field]) 141 irqsafe_cpu_dec(mib[0]->mibs[field])
142
145#define SNMP_ADD_STATS_BH(mib, field, addend) \ 143#define SNMP_ADD_STATS_BH(mib, field, addend) \
146 __this_cpu_add(mib[0]->mibs[field], addend) 144 __this_cpu_add(mib[0]->mibs[field], addend)
145
147#define SNMP_ADD_STATS_USER(mib, field, addend) \ 146#define SNMP_ADD_STATS_USER(mib, field, addend) \
148 this_cpu_add(mib[1]->mibs[field], addend) 147 irqsafe_cpu_add(mib[0]->mibs[field], addend)
148
149#define SNMP_ADD_STATS(mib, field, addend) \ 149#define SNMP_ADD_STATS(mib, field, addend) \
150 this_cpu_add(mib[!in_softirq()]->mibs[field], addend) 150 irqsafe_cpu_add(mib[0]->mibs[field], addend)
151/* 151/*
152 * Use "__typeof__(*mib[0]) *ptr" instead of "__typeof__(mib[0]) ptr" 152 * Use "__typeof__(*mib[0]) *ptr" instead of "__typeof__(mib[0]) ptr"
153 * to make @ptr a non-percpu pointer. 153 * to make @ptr a non-percpu pointer.
154 */ 154 */
155#define SNMP_UPD_PO_STATS(mib, basefield, addend) \ 155#define SNMP_UPD_PO_STATS(mib, basefield, addend) \
156 do { \ 156 do { \
157 __typeof__(*mib[0]) *ptr; \ 157 irqsafe_cpu_inc(mib[0]->mibs[basefield##PKTS]); \
158 preempt_disable(); \ 158 irqsafe_cpu_add(mib[0]->mibs[basefield##OCTETS], addend); \
159 ptr = this_cpu_ptr((mib)[!in_softirq()]); \
160 ptr->mibs[basefield##PKTS]++; \
161 ptr->mibs[basefield##OCTETS] += addend;\
162 preempt_enable(); \
163 } while (0) 159 } while (0)
164#define SNMP_UPD_PO_STATS_BH(mib, basefield, addend) \ 160#define SNMP_UPD_PO_STATS_BH(mib, basefield, addend) \
165 do { \ 161 do { \
166 __typeof__(*mib[0]) *ptr = \ 162 __this_cpu_inc(mib[0]->mibs[basefield##PKTS]); \
167 __this_cpu_ptr((mib)[0]); \ 163 __this_cpu_add(mib[0]->mibs[basefield##OCTETS], addend); \
168 ptr->mibs[basefield##PKTS]++; \
169 ptr->mibs[basefield##OCTETS] += addend;\
170 } while (0) 164 } while (0)
171 165
172 166
@@ -179,40 +173,20 @@ struct linux_xfrm_mib {
179 ptr->mibs[field] += addend; \ 173 ptr->mibs[field] += addend; \
180 u64_stats_update_end(&ptr->syncp); \ 174 u64_stats_update_end(&ptr->syncp); \
181 } while (0) 175 } while (0)
176
182#define SNMP_ADD_STATS64_USER(mib, field, addend) \ 177#define SNMP_ADD_STATS64_USER(mib, field, addend) \
183 do { \ 178 do { \
184 __typeof__(*mib[0]) *ptr; \ 179 local_bh_disable(); \
185 preempt_disable(); \ 180 SNMP_ADD_STATS64_BH(mib, field, addend); \
186 ptr = __this_cpu_ptr((mib)[1]); \ 181 local_bh_enable(); \
187 u64_stats_update_begin(&ptr->syncp); \
188 ptr->mibs[field] += addend; \
189 u64_stats_update_end(&ptr->syncp); \
190 preempt_enable(); \
191 } while (0) 182 } while (0)
183
192#define SNMP_ADD_STATS64(mib, field, addend) \ 184#define SNMP_ADD_STATS64(mib, field, addend) \
193 do { \ 185 SNMP_ADD_STATS64_USER(mib, field, addend)
194 __typeof__(*mib[0]) *ptr; \ 186
195 preempt_disable(); \
196 ptr = __this_cpu_ptr((mib)[!in_softirq()]); \
197 u64_stats_update_begin(&ptr->syncp); \
198 ptr->mibs[field] += addend; \
199 u64_stats_update_end(&ptr->syncp); \
200 preempt_enable(); \
201 } while (0)
202#define SNMP_INC_STATS64_BH(mib, field) SNMP_ADD_STATS64_BH(mib, field, 1) 187#define SNMP_INC_STATS64_BH(mib, field) SNMP_ADD_STATS64_BH(mib, field, 1)
203#define SNMP_INC_STATS64_USER(mib, field) SNMP_ADD_STATS64_USER(mib, field, 1) 188#define SNMP_INC_STATS64_USER(mib, field) SNMP_ADD_STATS64_USER(mib, field, 1)
204#define SNMP_INC_STATS64(mib, field) SNMP_ADD_STATS64(mib, field, 1) 189#define SNMP_INC_STATS64(mib, field) SNMP_ADD_STATS64(mib, field, 1)
205#define SNMP_UPD_PO_STATS64(mib, basefield, addend) \
206 do { \
207 __typeof__(*mib[0]) *ptr; \
208 preempt_disable(); \
209 ptr = __this_cpu_ptr((mib)[!in_softirq()]); \
210 u64_stats_update_begin(&ptr->syncp); \
211 ptr->mibs[basefield##PKTS]++; \
212 ptr->mibs[basefield##OCTETS] += addend; \
213 u64_stats_update_end(&ptr->syncp); \
214 preempt_enable(); \
215 } while (0)
216#define SNMP_UPD_PO_STATS64_BH(mib, basefield, addend) \ 190#define SNMP_UPD_PO_STATS64_BH(mib, basefield, addend) \
217 do { \ 191 do { \
218 __typeof__(*mib[0]) *ptr; \ 192 __typeof__(*mib[0]) *ptr; \
@@ -222,6 +196,12 @@ struct linux_xfrm_mib {
222 ptr->mibs[basefield##OCTETS] += addend; \ 196 ptr->mibs[basefield##OCTETS] += addend; \
223 u64_stats_update_end(&ptr->syncp); \ 197 u64_stats_update_end(&ptr->syncp); \
224 } while (0) 198 } while (0)
199#define SNMP_UPD_PO_STATS64(mib, basefield, addend) \
200 do { \
201 local_bh_disable(); \
202 SNMP_UPD_PO_STATS64_BH(mib, basefield, addend); \
203 local_bh_enable(); \
204 } while (0)
225#else 205#else
226#define SNMP_INC_STATS64_BH(mib, field) SNMP_INC_STATS_BH(mib, field) 206#define SNMP_INC_STATS64_BH(mib, field) SNMP_INC_STATS_BH(mib, field)
227#define SNMP_INC_STATS64_USER(mib, field) SNMP_INC_STATS_USER(mib, field) 207#define SNMP_INC_STATS64_USER(mib, field) SNMP_INC_STATS_USER(mib, field)
diff --git a/include/net/sock.h b/include/net/sock.h
index f2046e404a61..8e4062f165b8 100644
--- a/include/net/sock.h
+++ b/include/net/sock.h
@@ -40,6 +40,7 @@
40#ifndef _SOCK_H 40#ifndef _SOCK_H
41#define _SOCK_H 41#define _SOCK_H
42 42
43#include <linux/hardirq.h>
43#include <linux/kernel.h> 44#include <linux/kernel.h>
44#include <linux/list.h> 45#include <linux/list.h>
45#include <linux/list_nulls.h> 46#include <linux/list_nulls.h>
@@ -178,7 +179,6 @@ struct sock_common {
178 * @sk_dst_cache: destination cache 179 * @sk_dst_cache: destination cache
179 * @sk_dst_lock: destination cache lock 180 * @sk_dst_lock: destination cache lock
180 * @sk_policy: flow policy 181 * @sk_policy: flow policy
181 * @sk_rmem_alloc: receive queue bytes committed
182 * @sk_receive_queue: incoming packets 182 * @sk_receive_queue: incoming packets
183 * @sk_wmem_alloc: transmit queue bytes committed 183 * @sk_wmem_alloc: transmit queue bytes committed
184 * @sk_write_queue: Packet sending queue 184 * @sk_write_queue: Packet sending queue
@@ -563,6 +563,7 @@ enum sock_flags {
563 SOCK_TIMESTAMPING_SYS_HARDWARE, /* %SOF_TIMESTAMPING_SYS_HARDWARE */ 563 SOCK_TIMESTAMPING_SYS_HARDWARE, /* %SOF_TIMESTAMPING_SYS_HARDWARE */
564 SOCK_FASYNC, /* fasync() active */ 564 SOCK_FASYNC, /* fasync() active */
565 SOCK_RXQ_OVFL, 565 SOCK_RXQ_OVFL,
566 SOCK_ZEROCOPY, /* buffers from userspace */
566}; 567};
567 568
568static inline void sock_copy_flags(struct sock *nsk, struct sock *osk) 569static inline void sock_copy_flags(struct sock *nsk, struct sock *osk)
@@ -1302,8 +1303,7 @@ extern unsigned long sock_i_ino(struct sock *sk);
1302static inline struct dst_entry * 1303static inline struct dst_entry *
1303__sk_dst_get(struct sock *sk) 1304__sk_dst_get(struct sock *sk)
1304{ 1305{
1305 return rcu_dereference_check(sk->sk_dst_cache, rcu_read_lock_held() || 1306 return rcu_dereference_check(sk->sk_dst_cache, sock_owned_by_user(sk) ||
1306 sock_owned_by_user(sk) ||
1307 lockdep_is_held(&sk->sk_lock.slock)); 1307 lockdep_is_held(&sk->sk_lock.slock));
1308} 1308}
1309 1309
diff --git a/include/net/tcp.h b/include/net/tcp.h
index cda30ea354a2..149a415d1e0a 100644
--- a/include/net/tcp.h
+++ b/include/net/tcp.h
@@ -122,7 +122,13 @@ extern void tcp_time_wait(struct sock *sk, int state, int timeo);
122#endif 122#endif
123#define TCP_RTO_MAX ((unsigned)(120*HZ)) 123#define TCP_RTO_MAX ((unsigned)(120*HZ))
124#define TCP_RTO_MIN ((unsigned)(HZ/5)) 124#define TCP_RTO_MIN ((unsigned)(HZ/5))
125#define TCP_TIMEOUT_INIT ((unsigned)(3*HZ)) /* RFC 1122 initial RTO value */ 125#define TCP_TIMEOUT_INIT ((unsigned)(1*HZ)) /* RFC2988bis initial RTO value */
126#define TCP_TIMEOUT_FALLBACK ((unsigned)(3*HZ)) /* RFC 1122 initial RTO value, now
127 * used as a fallback RTO for the
128 * initial data transmission if no
129 * valid RTT sample has been acquired,
130 * most likely due to retrans in 3WHS.
131 */
126 132
127#define TCP_RESOURCE_PROBE_INTERVAL ((unsigned)(HZ/2U)) /* Maximal interval between probes 133#define TCP_RESOURCE_PROBE_INTERVAL ((unsigned)(HZ/2U)) /* Maximal interval between probes
128 * for local resources. 134 * for local resources.
@@ -295,7 +301,7 @@ static inline void tcp_synq_overflow(struct sock *sk)
295static inline int tcp_synq_no_recent_overflow(const struct sock *sk) 301static inline int tcp_synq_no_recent_overflow(const struct sock *sk)
296{ 302{
297 unsigned long last_overflow = tcp_sk(sk)->rx_opt.ts_recent_stamp; 303 unsigned long last_overflow = tcp_sk(sk)->rx_opt.ts_recent_stamp;
298 return time_after(jiffies, last_overflow + TCP_TIMEOUT_INIT); 304 return time_after(jiffies, last_overflow + TCP_TIMEOUT_FALLBACK);
299} 305}
300 306
301extern struct proto tcp_prot; 307extern struct proto tcp_prot;
@@ -508,6 +514,7 @@ extern void tcp_initialize_rcv_mss(struct sock *sk);
508extern int tcp_mtu_to_mss(struct sock *sk, int pmtu); 514extern int tcp_mtu_to_mss(struct sock *sk, int pmtu);
509extern int tcp_mss_to_mtu(struct sock *sk, int mss); 515extern int tcp_mss_to_mtu(struct sock *sk, int mss);
510extern void tcp_mtup_init(struct sock *sk); 516extern void tcp_mtup_init(struct sock *sk);
517extern void tcp_valid_rtt_meas(struct sock *sk, u32 seq_rtt);
511 518
512static inline void tcp_bound_rto(const struct sock *sk) 519static inline void tcp_bound_rto(const struct sock *sk)
513{ 520{
diff --git a/include/net/wimax.h b/include/net/wimax.h
index 7328d5019d88..322ff4fbdb4a 100644
--- a/include/net/wimax.h
+++ b/include/net/wimax.h
@@ -423,7 +423,6 @@ struct wimax_dev {
423 int (*op_reset)(struct wimax_dev *wimax_dev); 423 int (*op_reset)(struct wimax_dev *wimax_dev);
424 424
425 struct rfkill *rfkill; 425 struct rfkill *rfkill;
426 struct input_dev *rfkill_input;
427 unsigned rf_hw; 426 unsigned rf_hw;
428 unsigned rf_sw; 427 unsigned rf_sw;
429 char name[32]; 428 char name[32];
diff --git a/include/rdma/ib_pma.h b/include/rdma/ib_pma.h
new file mode 100644
index 000000000000..a5889f18807b
--- /dev/null
+++ b/include/rdma/ib_pma.h
@@ -0,0 +1,156 @@
1/*
2 * Copyright (c) 2006, 2007, 2008, 2009, 2010 QLogic Corporation.
3 * All rights reserved.
4 * Copyright (c) 2005, 2006 PathScale, Inc. All rights reserved.
5 *
6 * This software is available to you under a choice of one of two
7 * licenses. You may choose to be licensed under the terms of the GNU
8 * General Public License (GPL) Version 2, available from the file
9 * COPYING in the main directory of this source tree, or the
10 * OpenIB.org BSD license below:
11 *
12 * Redistribution and use in source and binary forms, with or
13 * without modification, are permitted provided that the following
14 * conditions are met:
15 *
16 * - Redistributions of source code must retain the above
17 * copyright notice, this list of conditions and the following
18 * disclaimer.
19 *
20 * - Redistributions in binary form must reproduce the above
21 * copyright notice, this list of conditions and the following
22 * disclaimer in the documentation and/or other materials
23 * provided with the distribution.
24 *
25 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
26 * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
27 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
28 * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
29 * BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
30 * ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
31 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
32 * SOFTWARE.
33 */
34
35#if !defined(IB_PMA_H)
36#define IB_PMA_H
37
38#include <rdma/ib_mad.h>
39
40/*
41 * PMA class portinfo capability mask bits
42 */
43#define IB_PMA_CLASS_CAP_ALLPORTSELECT cpu_to_be16(1 << 8)
44#define IB_PMA_CLASS_CAP_EXT_WIDTH cpu_to_be16(1 << 9)
45#define IB_PMA_CLASS_CAP_XMIT_WAIT cpu_to_be16(1 << 12)
46
47#define IB_PMA_CLASS_PORT_INFO cpu_to_be16(0x0001)
48#define IB_PMA_PORT_SAMPLES_CONTROL cpu_to_be16(0x0010)
49#define IB_PMA_PORT_SAMPLES_RESULT cpu_to_be16(0x0011)
50#define IB_PMA_PORT_COUNTERS cpu_to_be16(0x0012)
51#define IB_PMA_PORT_COUNTERS_EXT cpu_to_be16(0x001D)
52#define IB_PMA_PORT_SAMPLES_RESULT_EXT cpu_to_be16(0x001E)
53
54struct ib_pma_mad {
55 struct ib_mad_hdr mad_hdr;
56 u8 reserved[40];
57 u8 data[192];
58} __packed;
59
60struct ib_pma_portsamplescontrol {
61 u8 opcode;
62 u8 port_select;
63 u8 tick;
64 u8 counter_width; /* resv: 7:3, counter width: 2:0 */
65 __be32 counter_mask0_9; /* 2, 10 3-bit fields */
66 __be16 counter_mask10_14; /* 1, 5 3-bit fields */
67 u8 sample_mechanisms;
68 u8 sample_status; /* only lower 2 bits */
69 __be64 option_mask;
70 __be64 vendor_mask;
71 __be32 sample_start;
72 __be32 sample_interval;
73 __be16 tag;
74 __be16 counter_select[15];
75 __be32 reserved1;
76 __be64 samples_only_option_mask;
77 __be32 reserved2[28];
78};
79
80struct ib_pma_portsamplesresult {
81 __be16 tag;
82 __be16 sample_status; /* only lower 2 bits */
83 __be32 counter[15];
84};
85
86struct ib_pma_portsamplesresult_ext {
87 __be16 tag;
88 __be16 sample_status; /* only lower 2 bits */
89 __be32 extended_width; /* only upper 2 bits */
90 __be64 counter[15];
91};
92
93struct ib_pma_portcounters {
94 u8 reserved;
95 u8 port_select;
96 __be16 counter_select;
97 __be16 symbol_error_counter;
98 u8 link_error_recovery_counter;
99 u8 link_downed_counter;
100 __be16 port_rcv_errors;
101 __be16 port_rcv_remphys_errors;
102 __be16 port_rcv_switch_relay_errors;
103 __be16 port_xmit_discards;
104 u8 port_xmit_constraint_errors;
105 u8 port_rcv_constraint_errors;
106 u8 reserved1;
107 u8 link_overrun_errors; /* LocalLink: 7:4, BufferOverrun: 3:0 */
108 __be16 reserved2;
109 __be16 vl15_dropped;
110 __be32 port_xmit_data;
111 __be32 port_rcv_data;
112 __be32 port_xmit_packets;
113 __be32 port_rcv_packets;
114 __be32 port_xmit_wait;
115} __packed;
116
117
118#define IB_PMA_SEL_SYMBOL_ERROR cpu_to_be16(0x0001)
119#define IB_PMA_SEL_LINK_ERROR_RECOVERY cpu_to_be16(0x0002)
120#define IB_PMA_SEL_LINK_DOWNED cpu_to_be16(0x0004)
121#define IB_PMA_SEL_PORT_RCV_ERRORS cpu_to_be16(0x0008)
122#define IB_PMA_SEL_PORT_RCV_REMPHYS_ERRORS cpu_to_be16(0x0010)
123#define IB_PMA_SEL_PORT_XMIT_DISCARDS cpu_to_be16(0x0040)
124#define IB_PMA_SEL_LOCAL_LINK_INTEGRITY_ERRORS cpu_to_be16(0x0200)
125#define IB_PMA_SEL_EXCESSIVE_BUFFER_OVERRUNS cpu_to_be16(0x0400)
126#define IB_PMA_SEL_PORT_VL15_DROPPED cpu_to_be16(0x0800)
127#define IB_PMA_SEL_PORT_XMIT_DATA cpu_to_be16(0x1000)
128#define IB_PMA_SEL_PORT_RCV_DATA cpu_to_be16(0x2000)
129#define IB_PMA_SEL_PORT_XMIT_PACKETS cpu_to_be16(0x4000)
130#define IB_PMA_SEL_PORT_RCV_PACKETS cpu_to_be16(0x8000)
131
132struct ib_pma_portcounters_ext {
133 u8 reserved;
134 u8 port_select;
135 __be16 counter_select;
136 __be32 reserved1;
137 __be64 port_xmit_data;
138 __be64 port_rcv_data;
139 __be64 port_xmit_packets;
140 __be64 port_rcv_packets;
141 __be64 port_unicast_xmit_packets;
142 __be64 port_unicast_rcv_packets;
143 __be64 port_multicast_xmit_packets;
144 __be64 port_multicast_rcv_packets;
145} __packed;
146
147#define IB_PMA_SELX_PORT_XMIT_DATA cpu_to_be16(0x0001)
148#define IB_PMA_SELX_PORT_RCV_DATA cpu_to_be16(0x0002)
149#define IB_PMA_SELX_PORT_XMIT_PACKETS cpu_to_be16(0x0004)
150#define IB_PMA_SELX_PORT_RCV_PACKETS cpu_to_be16(0x0008)
151#define IB_PMA_SELX_PORT_UNI_XMIT_PACKETS cpu_to_be16(0x0010)
152#define IB_PMA_SELX_PORT_UNI_RCV_PACKETS cpu_to_be16(0x0020)
153#define IB_PMA_SELX_PORT_MULTI_XMIT_PACKETS cpu_to_be16(0x0040)
154#define IB_PMA_SELX_PORT_MULTI_RCV_PACKETS cpu_to_be16(0x0080)
155
156#endif /* IB_PMA_H */
diff --git a/include/rdma/ib_verbs.h b/include/rdma/ib_verbs.h
index 55cd0a0bc977..bf4306aea169 100644
--- a/include/rdma/ib_verbs.h
+++ b/include/rdma/ib_verbs.h
@@ -350,7 +350,8 @@ enum ib_event_type {
350 IB_EVENT_SRQ_ERR, 350 IB_EVENT_SRQ_ERR,
351 IB_EVENT_SRQ_LIMIT_REACHED, 351 IB_EVENT_SRQ_LIMIT_REACHED,
352 IB_EVENT_QP_LAST_WQE_REACHED, 352 IB_EVENT_QP_LAST_WQE_REACHED,
353 IB_EVENT_CLIENT_REREGISTER 353 IB_EVENT_CLIENT_REREGISTER,
354 IB_EVENT_GID_CHANGE,
354}; 355};
355 356
356struct ib_event { 357struct ib_event {
diff --git a/include/scsi/iscsi_proto.h b/include/scsi/iscsi_proto.h
index dd0a52cea95a..ea68b3c56dbf 100644
--- a/include/scsi/iscsi_proto.h
+++ b/include/scsi/iscsi_proto.h
@@ -60,7 +60,7 @@ struct iscsi_hdr {
60 uint8_t rsvd2[2]; 60 uint8_t rsvd2[2];
61 uint8_t hlength; /* AHSs total length */ 61 uint8_t hlength; /* AHSs total length */
62 uint8_t dlength[3]; /* Data length */ 62 uint8_t dlength[3]; /* Data length */
63 uint8_t lun[8]; 63 struct scsi_lun lun;
64 itt_t itt; /* Initiator Task Tag, opaque for target */ 64 itt_t itt; /* Initiator Task Tag, opaque for target */
65 __be32 ttt; /* Target Task Tag */ 65 __be32 ttt; /* Target Task Tag */
66 __be32 statsn; 66 __be32 statsn;
@@ -122,7 +122,7 @@ struct iscsi_cmd {
122 __be16 rsvd2; 122 __be16 rsvd2;
123 uint8_t hlength; 123 uint8_t hlength;
124 uint8_t dlength[3]; 124 uint8_t dlength[3];
125 uint8_t lun[8]; 125 struct scsi_lun lun;
126 itt_t itt; /* Initiator Task Tag */ 126 itt_t itt; /* Initiator Task Tag */
127 __be32 data_length; 127 __be32 data_length;
128 __be32 cmdsn; 128 __be32 cmdsn;
@@ -198,7 +198,7 @@ struct iscsi_async {
198 uint8_t rsvd2[2]; 198 uint8_t rsvd2[2];
199 uint8_t rsvd3; 199 uint8_t rsvd3;
200 uint8_t dlength[3]; 200 uint8_t dlength[3];
201 uint8_t lun[8]; 201 struct scsi_lun lun;
202 uint8_t rsvd4[8]; 202 uint8_t rsvd4[8];
203 __be32 statsn; 203 __be32 statsn;
204 __be32 exp_cmdsn; 204 __be32 exp_cmdsn;
@@ -226,7 +226,7 @@ struct iscsi_nopout {
226 __be16 rsvd2; 226 __be16 rsvd2;
227 uint8_t rsvd3; 227 uint8_t rsvd3;
228 uint8_t dlength[3]; 228 uint8_t dlength[3];
229 uint8_t lun[8]; 229 struct scsi_lun lun;
230 itt_t itt; /* Initiator Task Tag */ 230 itt_t itt; /* Initiator Task Tag */
231 __be32 ttt; /* Target Transfer Tag */ 231 __be32 ttt; /* Target Transfer Tag */
232 __be32 cmdsn; 232 __be32 cmdsn;
@@ -241,7 +241,7 @@ struct iscsi_nopin {
241 __be16 rsvd2; 241 __be16 rsvd2;
242 uint8_t rsvd3; 242 uint8_t rsvd3;
243 uint8_t dlength[3]; 243 uint8_t dlength[3];
244 uint8_t lun[8]; 244 struct scsi_lun lun;
245 itt_t itt; /* Initiator Task Tag */ 245 itt_t itt; /* Initiator Task Tag */
246 __be32 ttt; /* Target Transfer Tag */ 246 __be32 ttt; /* Target Transfer Tag */
247 __be32 statsn; 247 __be32 statsn;
@@ -257,7 +257,7 @@ struct iscsi_tm {
257 uint8_t rsvd1[2]; 257 uint8_t rsvd1[2];
258 uint8_t hlength; 258 uint8_t hlength;
259 uint8_t dlength[3]; 259 uint8_t dlength[3];
260 uint8_t lun[8]; 260 struct scsi_lun lun;
261 itt_t itt; /* Initiator Task Tag */ 261 itt_t itt; /* Initiator Task Tag */
262 itt_t rtt; /* Reference Task Tag */ 262 itt_t rtt; /* Reference Task Tag */
263 __be32 cmdsn; 263 __be32 cmdsn;
@@ -315,7 +315,7 @@ struct iscsi_r2t_rsp {
315 uint8_t rsvd2[2]; 315 uint8_t rsvd2[2];
316 uint8_t hlength; 316 uint8_t hlength;
317 uint8_t dlength[3]; 317 uint8_t dlength[3];
318 uint8_t lun[8]; 318 struct scsi_lun lun;
319 itt_t itt; /* Initiator Task Tag */ 319 itt_t itt; /* Initiator Task Tag */
320 __be32 ttt; /* Target Transfer Tag */ 320 __be32 ttt; /* Target Transfer Tag */
321 __be32 statsn; 321 __be32 statsn;
@@ -333,7 +333,7 @@ struct iscsi_data {
333 uint8_t rsvd2[2]; 333 uint8_t rsvd2[2];
334 uint8_t rsvd3; 334 uint8_t rsvd3;
335 uint8_t dlength[3]; 335 uint8_t dlength[3];
336 uint8_t lun[8]; 336 struct scsi_lun lun;
337 itt_t itt; 337 itt_t itt;
338 __be32 ttt; 338 __be32 ttt;
339 __be32 rsvd4; 339 __be32 rsvd4;
@@ -353,7 +353,7 @@ struct iscsi_data_rsp {
353 uint8_t cmd_status; 353 uint8_t cmd_status;
354 uint8_t hlength; 354 uint8_t hlength;
355 uint8_t dlength[3]; 355 uint8_t dlength[3];
356 uint8_t lun[8]; 356 struct scsi_lun lun;
357 itt_t itt; 357 itt_t itt;
358 __be32 ttt; 358 __be32 ttt;
359 __be32 statsn; 359 __be32 statsn;
diff --git a/include/scsi/libfc.h b/include/scsi/libfc.h
index a3cbda4ddb5c..7d96829b0c00 100644
--- a/include/scsi/libfc.h
+++ b/include/scsi/libfc.h
@@ -511,6 +511,14 @@ struct libfc_function_template {
511 */ 511 */
512 int (*ddp_done)(struct fc_lport *, u16); 512 int (*ddp_done)(struct fc_lport *, u16);
513 /* 513 /*
514 * Sets up the DDP context for a given exchange id on the given
515 * scatterlist if LLD supports DDP for FCoE target.
516 *
517 * STATUS: OPTIONAL
518 */
519 int (*ddp_target)(struct fc_lport *, u16, struct scatterlist *,
520 unsigned int);
521 /*
514 * Allow LLD to fill its own Link Error Status Block 522 * Allow LLD to fill its own Link Error Status Block
515 * 523 *
516 * STATUS: OPTIONAL 524 * STATUS: OPTIONAL
diff --git a/include/scsi/libiscsi.h b/include/scsi/libiscsi.h
index 0f4367751b71..cedcff371c88 100644
--- a/include/scsi/libiscsi.h
+++ b/include/scsi/libiscsi.h
@@ -115,7 +115,7 @@ struct iscsi_task {
115 /* copied values in case we need to send tmfs */ 115 /* copied values in case we need to send tmfs */
116 itt_t hdr_itt; 116 itt_t hdr_itt;
117 __be32 cmdsn; 117 __be32 cmdsn;
118 uint8_t lun[8]; 118 struct scsi_lun lun;
119 119
120 int itt; /* this ITT */ 120 int itt; /* this ITT */
121 121
diff --git a/include/scsi/osd_initiator.h b/include/scsi/osd_initiator.h
index 0a5079974fe9..572fb5493661 100644
--- a/include/scsi/osd_initiator.h
+++ b/include/scsi/osd_initiator.h
@@ -262,7 +262,7 @@ int osd_execute_request_async(struct osd_request *or,
262 * osd_req_decode_sense_full - Decode sense information after execution. 262 * osd_req_decode_sense_full - Decode sense information after execution.
263 * 263 *
264 * @or: - osd_request to examine 264 * @or: - osd_request to examine
265 * @osi - Recievs a more detailed error report information (optional). 265 * @osi - Receives a more detailed error report information (optional).
266 * @silent - Do not print to dmsg (Even if enabled) 266 * @silent - Do not print to dmsg (Even if enabled)
267 * @bad_obj_list - Some commands act on multiple objects. Failed objects will 267 * @bad_obj_list - Some commands act on multiple objects. Failed objects will
268 * be received here (optional) 268 * be received here (optional)
diff --git a/include/scsi/scsi.h b/include/scsi/scsi.h
index 3668903e397b..8001ae4cd7ba 100644
--- a/include/scsi/scsi.h
+++ b/include/scsi/scsi.h
@@ -495,7 +495,7 @@ static inline int scsi_is_wlun(unsigned int lun)
495 495
496#define sense_class(sense) (((sense) >> 4) & 0x7) 496#define sense_class(sense) (((sense) >> 4) & 0x7)
497#define sense_error(sense) ((sense) & 0xf) 497#define sense_error(sense) ((sense) & 0xf)
498#define sense_valid(sense) ((sense) & 0x80); 498#define sense_valid(sense) ((sense) & 0x80)
499 499
500/* 500/*
501 * default timeouts 501 * default timeouts
diff --git a/include/sound/rawmidi.h b/include/sound/rawmidi.h
index 2480e7d10dcf..6b14359d9fed 100644
--- a/include/sound/rawmidi.h
+++ b/include/sound/rawmidi.h
@@ -27,6 +27,7 @@
27#include <linux/spinlock.h> 27#include <linux/spinlock.h>
28#include <linux/wait.h> 28#include <linux/wait.h>
29#include <linux/mutex.h> 29#include <linux/mutex.h>
30#include <linux/workqueue.h>
30 31
31#if defined(CONFIG_SND_SEQUENCER) || defined(CONFIG_SND_SEQUENCER_MODULE) 32#if defined(CONFIG_SND_SEQUENCER) || defined(CONFIG_SND_SEQUENCER_MODULE)
32#include "seq_device.h" 33#include "seq_device.h"
@@ -63,6 +64,7 @@ struct snd_rawmidi_global_ops {
63}; 64};
64 65
65struct snd_rawmidi_runtime { 66struct snd_rawmidi_runtime {
67 struct snd_rawmidi_substream *substream;
66 unsigned int drain: 1, /* drain stage */ 68 unsigned int drain: 1, /* drain stage */
67 oss: 1; /* OSS compatible mode */ 69 oss: 1; /* OSS compatible mode */
68 /* midi stream buffer */ 70 /* midi stream buffer */
@@ -79,7 +81,7 @@ struct snd_rawmidi_runtime {
79 /* event handler (new bytes, input only) */ 81 /* event handler (new bytes, input only) */
80 void (*event)(struct snd_rawmidi_substream *substream); 82 void (*event)(struct snd_rawmidi_substream *substream);
81 /* defers calls to event [input] or ops->trigger [output] */ 83 /* defers calls to event [input] or ops->trigger [output] */
82 struct tasklet_struct tasklet; 84 struct work_struct event_work;
83 /* private data */ 85 /* private data */
84 void *private_data; 86 void *private_data;
85 void (*private_free)(struct snd_rawmidi_substream *substream); 87 void (*private_free)(struct snd_rawmidi_substream *substream);
diff --git a/include/sound/sb16_csp.h b/include/sound/sb16_csp.h
index 736eac71d053..af1b49e982df 100644
--- a/include/sound/sb16_csp.h
+++ b/include/sound/sb16_csp.h
@@ -99,7 +99,14 @@ struct snd_sb_csp_info {
99/* get CSP information */ 99/* get CSP information */
100#define SNDRV_SB_CSP_IOCTL_INFO _IOR('H', 0x10, struct snd_sb_csp_info) 100#define SNDRV_SB_CSP_IOCTL_INFO _IOR('H', 0x10, struct snd_sb_csp_info)
101/* load microcode to CSP */ 101/* load microcode to CSP */
102#define SNDRV_SB_CSP_IOCTL_LOAD_CODE _IOW('H', 0x11, struct snd_sb_csp_microcode) 102/* NOTE: struct snd_sb_csp_microcode overflows the max size (13 bits)
103 * defined for some architectures like MIPS, and it leads to build errors.
104 * (x86 and co have 14-bit size, thus it's valid, though.)
105 * As a workaround for skipping the size-limit check, here we don't use the
106 * normal _IOW() macro but _IOC() with the manual argument.
107 */
108#define SNDRV_SB_CSP_IOCTL_LOAD_CODE \
109 _IOC(_IOC_WRITE, 'H', 0x11, sizeof(struct snd_sb_csp_microcode))
103/* unload microcode from CSP */ 110/* unload microcode from CSP */
104#define SNDRV_SB_CSP_IOCTL_UNLOAD_CODE _IO('H', 0x12) 111#define SNDRV_SB_CSP_IOCTL_UNLOAD_CODE _IO('H', 0x12)
105/* start CSP */ 112/* start CSP */
diff --git a/include/sound/soc-dai.h b/include/sound/soc-dai.h
index 1bafe95dcf41..5ad5f3a50c68 100644
--- a/include/sound/soc-dai.h
+++ b/include/sound/soc-dai.h
@@ -209,6 +209,10 @@ struct snd_soc_dai_driver {
209 struct snd_soc_pcm_stream capture; 209 struct snd_soc_pcm_stream capture;
210 struct snd_soc_pcm_stream playback; 210 struct snd_soc_pcm_stream playback;
211 unsigned int symmetric_rates:1; 211 unsigned int symmetric_rates:1;
212
213 /* probe ordering - for components with runtime dependencies */
214 int probe_order;
215 int remove_order;
212}; 216};
213 217
214/* 218/*
diff --git a/include/sound/soc-dapm.h b/include/sound/soc-dapm.h
index c46e7d89561d..e09505c5a490 100644
--- a/include/sound/soc-dapm.h
+++ b/include/sound/soc-dapm.h
@@ -348,6 +348,8 @@ int snd_soc_dapm_new_widgets(struct snd_soc_dapm_context *dapm);
348void snd_soc_dapm_free(struct snd_soc_dapm_context *dapm); 348void snd_soc_dapm_free(struct snd_soc_dapm_context *dapm);
349int snd_soc_dapm_add_routes(struct snd_soc_dapm_context *dapm, 349int snd_soc_dapm_add_routes(struct snd_soc_dapm_context *dapm,
350 const struct snd_soc_dapm_route *route, int num); 350 const struct snd_soc_dapm_route *route, int num);
351int snd_soc_dapm_weak_routes(struct snd_soc_dapm_context *dapm,
352 const struct snd_soc_dapm_route *route, int num);
351 353
352/* dapm events */ 354/* dapm events */
353int snd_soc_dapm_stream_event(struct snd_soc_pcm_runtime *rtd, 355int snd_soc_dapm_stream_event(struct snd_soc_pcm_runtime *rtd,
@@ -429,6 +431,7 @@ struct snd_soc_dapm_path {
429 /* status */ 431 /* status */
430 u32 connect:1; /* source and sink widgets are connected */ 432 u32 connect:1; /* source and sink widgets are connected */
431 u32 walked:1; /* path has been walked */ 433 u32 walked:1; /* path has been walked */
434 u32 weak:1; /* path ignored for power management */
432 435
433 int (*connected)(struct snd_soc_dapm_widget *source, 436 int (*connected)(struct snd_soc_dapm_widget *source,
434 struct snd_soc_dapm_widget *sink); 437 struct snd_soc_dapm_widget *sink);
@@ -444,6 +447,7 @@ struct snd_soc_dapm_widget {
444 char *name; /* widget name */ 447 char *name; /* widget name */
445 char *sname; /* stream name */ 448 char *sname; /* stream name */
446 struct snd_soc_codec *codec; 449 struct snd_soc_codec *codec;
450 struct snd_soc_platform *platform;
447 struct list_head list; 451 struct list_head list;
448 struct snd_soc_dapm_context *dapm; 452 struct snd_soc_dapm_context *dapm;
449 453
@@ -507,10 +511,11 @@ struct snd_soc_dapm_context {
507 511
508 struct device *dev; /* from parent - for debug */ 512 struct device *dev; /* from parent - for debug */
509 struct snd_soc_codec *codec; /* parent codec */ 513 struct snd_soc_codec *codec; /* parent codec */
514 struct snd_soc_platform *platform; /* parent platform */
510 struct snd_soc_card *card; /* parent card */ 515 struct snd_soc_card *card; /* parent card */
511 516
512 /* used during DAPM updates */ 517 /* used during DAPM updates */
513 int dev_power; 518 enum snd_soc_bias_level target_bias_level;
514 struct list_head list; 519 struct list_head list;
515 520
516#ifdef CONFIG_DEBUG_FS 521#ifdef CONFIG_DEBUG_FS
diff --git a/include/sound/soc.h b/include/sound/soc.h
index f1de3e0c75bc..aa19f5a32ba8 100644
--- a/include/sound/soc.h
+++ b/include/sound/soc.h
@@ -203,6 +203,16 @@
203 SOC_VALUE_ENUM_DOUBLE_DECL(name, xreg, xshift, xshift, xmask, xtexts, xvalues) 203 SOC_VALUE_ENUM_DOUBLE_DECL(name, xreg, xshift, xshift, xmask, xtexts, xvalues)
204 204
205/* 205/*
206 * Component probe and remove ordering levels for components with runtime
207 * dependencies.
208 */
209#define SND_SOC_COMP_ORDER_FIRST -2
210#define SND_SOC_COMP_ORDER_EARLY -1
211#define SND_SOC_COMP_ORDER_NORMAL 0
212#define SND_SOC_COMP_ORDER_LATE 1
213#define SND_SOC_COMP_ORDER_LAST 2
214
215/*
206 * Bias levels 216 * Bias levels
207 * 217 *
208 * @ON: Bias is fully on for audio playback and capture operations. 218 * @ON: Bias is fully on for audio playback and capture operations.
@@ -214,10 +224,10 @@
214 * @OFF: Power Off. No restrictions on transition times. 224 * @OFF: Power Off. No restrictions on transition times.
215 */ 225 */
216enum snd_soc_bias_level { 226enum snd_soc_bias_level {
217 SND_SOC_BIAS_OFF, 227 SND_SOC_BIAS_OFF = 0,
218 SND_SOC_BIAS_STANDBY, 228 SND_SOC_BIAS_STANDBY = 1,
219 SND_SOC_BIAS_PREPARE, 229 SND_SOC_BIAS_PREPARE = 2,
220 SND_SOC_BIAS_ON, 230 SND_SOC_BIAS_ON = 3,
221}; 231};
222 232
223struct snd_jack; 233struct snd_jack;
@@ -248,8 +258,7 @@ typedef int (*hw_write_t)(void *,const char* ,int);
248extern struct snd_ac97_bus_ops soc_ac97_ops; 258extern struct snd_ac97_bus_ops soc_ac97_ops;
249 259
250enum snd_soc_control_type { 260enum snd_soc_control_type {
251 SND_SOC_CUSTOM = 1, 261 SND_SOC_I2C = 1,
252 SND_SOC_I2C,
253 SND_SOC_SPI, 262 SND_SOC_SPI,
254}; 263};
255 264
@@ -259,6 +268,11 @@ enum snd_soc_compress_type {
259 SND_SOC_RBTREE_COMPRESSION 268 SND_SOC_RBTREE_COMPRESSION
260}; 269};
261 270
271enum snd_soc_pcm_subclass {
272 SND_SOC_PCM_CLASS_PCM = 0,
273 SND_SOC_PCM_CLASS_BE = 1,
274};
275
262int snd_soc_codec_set_sysclk(struct snd_soc_codec *codec, int clk_id, 276int snd_soc_codec_set_sysclk(struct snd_soc_codec *codec, int clk_id,
263 unsigned int freq, int dir); 277 unsigned int freq, int dir);
264int snd_soc_codec_set_pll(struct snd_soc_codec *codec, int pll_id, int source, 278int snd_soc_codec_set_pll(struct snd_soc_codec *codec, int pll_id, int source,
@@ -298,6 +312,10 @@ int snd_soc_default_readable_register(struct snd_soc_codec *codec,
298 unsigned int reg); 312 unsigned int reg);
299int snd_soc_default_writable_register(struct snd_soc_codec *codec, 313int snd_soc_default_writable_register(struct snd_soc_codec *codec,
300 unsigned int reg); 314 unsigned int reg);
315int snd_soc_platform_read(struct snd_soc_platform *platform,
316 unsigned int reg);
317int snd_soc_platform_write(struct snd_soc_platform *platform,
318 unsigned int reg, unsigned int val);
301 319
302/* Utility functions to get clock rates from various things */ 320/* Utility functions to get clock rates from various things */
303int snd_soc_calc_frame_size(int sample_size, int channels, int tdm_slots); 321int snd_soc_calc_frame_size(int sample_size, int channels, int tdm_slots);
@@ -350,6 +368,8 @@ struct snd_kcontrol *snd_soc_cnew(const struct snd_kcontrol_new *_template,
350 const char *prefix); 368 const char *prefix);
351int snd_soc_add_controls(struct snd_soc_codec *codec, 369int snd_soc_add_controls(struct snd_soc_codec *codec,
352 const struct snd_kcontrol_new *controls, int num_controls); 370 const struct snd_kcontrol_new *controls, int num_controls);
371int snd_soc_add_platform_controls(struct snd_soc_platform *platform,
372 const struct snd_kcontrol_new *controls, int num_controls);
353int snd_soc_info_enum_double(struct snd_kcontrol *kcontrol, 373int snd_soc_info_enum_double(struct snd_kcontrol *kcontrol,
354 struct snd_ctl_elem_info *uinfo); 374 struct snd_ctl_elem_info *uinfo);
355int snd_soc_info_enum_ext(struct snd_kcontrol *kcontrol, 375int snd_soc_info_enum_ext(struct snd_kcontrol *kcontrol,
@@ -613,6 +633,10 @@ struct snd_soc_codec_driver {
613 633
614 void (*seq_notifier)(struct snd_soc_dapm_context *, 634 void (*seq_notifier)(struct snd_soc_dapm_context *,
615 enum snd_soc_dapm_type, int); 635 enum snd_soc_dapm_type, int);
636
637 /* probe ordering - for components with runtime dependencies */
638 int probe_order;
639 int remove_order;
616}; 640};
617 641
618/* SoC platform interface */ 642/* SoC platform interface */
@@ -624,10 +648,17 @@ struct snd_soc_platform_driver {
624 int (*resume)(struct snd_soc_dai *dai); 648 int (*resume)(struct snd_soc_dai *dai);
625 649
626 /* pcm creation and destruction */ 650 /* pcm creation and destruction */
627 int (*pcm_new)(struct snd_card *, struct snd_soc_dai *, 651 int (*pcm_new)(struct snd_soc_pcm_runtime *);
628 struct snd_pcm *);
629 void (*pcm_free)(struct snd_pcm *); 652 void (*pcm_free)(struct snd_pcm *);
630 653
654 /* Default control and setup, added after probe() is run */
655 const struct snd_kcontrol_new *controls;
656 int num_controls;
657 const struct snd_soc_dapm_widget *dapm_widgets;
658 int num_dapm_widgets;
659 const struct snd_soc_dapm_route *dapm_routes;
660 int num_dapm_routes;
661
631 /* 662 /*
632 * For platform caused delay reporting. 663 * For platform caused delay reporting.
633 * Optional. 664 * Optional.
@@ -637,6 +668,14 @@ struct snd_soc_platform_driver {
637 668
638 /* platform stream ops */ 669 /* platform stream ops */
639 struct snd_pcm_ops *ops; 670 struct snd_pcm_ops *ops;
671
672 /* probe ordering - for components with runtime dependencies */
673 int probe_order;
674 int remove_order;
675
676 /* platform IO - used for platform DAPM */
677 unsigned int (*read)(struct snd_soc_platform *, unsigned int);
678 int (*write)(struct snd_soc_platform *, unsigned int, unsigned int);
640}; 679};
641 680
642struct snd_soc_platform { 681struct snd_soc_platform {
@@ -651,6 +690,8 @@ struct snd_soc_platform {
651 struct snd_soc_card *card; 690 struct snd_soc_card *card;
652 struct list_head list; 691 struct list_head list;
653 struct list_head card_list; 692 struct list_head card_list;
693
694 struct snd_soc_dapm_context dapm;
654}; 695};
655 696
656struct snd_soc_dai_link { 697struct snd_soc_dai_link {
@@ -726,8 +767,10 @@ struct snd_soc_card {
726 767
727 /* callbacks */ 768 /* callbacks */
728 int (*set_bias_level)(struct snd_soc_card *, 769 int (*set_bias_level)(struct snd_soc_card *,
770 struct snd_soc_dapm_context *dapm,
729 enum snd_soc_bias_level level); 771 enum snd_soc_bias_level level);
730 int (*set_bias_level_post)(struct snd_soc_card *, 772 int (*set_bias_level_post)(struct snd_soc_card *,
773 struct snd_soc_dapm_context *dapm,
731 enum snd_soc_bias_level level); 774 enum snd_soc_bias_level level);
732 775
733 long pmdown_time; 776 long pmdown_time;
@@ -790,6 +833,9 @@ struct snd_soc_pcm_runtime {
790 struct device dev; 833 struct device dev;
791 struct snd_soc_card *card; 834 struct snd_soc_card *card;
792 struct snd_soc_dai_link *dai_link; 835 struct snd_soc_dai_link *dai_link;
836 struct mutex pcm_mutex;
837 enum snd_soc_pcm_subclass pcm_subclass;
838 struct snd_pcm_ops ops;
793 839
794 unsigned int complete:1; 840 unsigned int complete:1;
795 unsigned int dev_registered:1; 841 unsigned int dev_registered:1;
diff --git a/include/sound/soundfont.h b/include/sound/soundfont.h
index f95d99ba7f74..679df0574066 100644
--- a/include/sound/soundfont.h
+++ b/include/sound/soundfont.h
@@ -121,7 +121,7 @@ int snd_soundfont_search_zone(struct snd_sf_list *sflist, int *notep, int vel,
121int snd_sf_calc_parm_hold(int msec); 121int snd_sf_calc_parm_hold(int msec);
122int snd_sf_calc_parm_attack(int msec); 122int snd_sf_calc_parm_attack(int msec);
123int snd_sf_calc_parm_decay(int msec); 123int snd_sf_calc_parm_decay(int msec);
124#define snd_sf_calc_parm_delay(msec) (0x8000 - (msec) * 1000 / 725); 124#define snd_sf_calc_parm_delay(msec) (0x8000 - (msec) * 1000 / 725)
125extern int snd_sf_vol_table[128]; 125extern int snd_sf_vol_table[128];
126int snd_sf_linear_to_log(unsigned int amount, int offset, int ratio); 126int snd_sf_linear_to_log(unsigned int amount, int offset, int ratio);
127 127
diff --git a/include/staging/altera.h b/include/staging/altera.h
deleted file mode 100644
index 94c0c6181daf..000000000000
--- a/include/staging/altera.h
+++ /dev/null
@@ -1,49 +0,0 @@
1/*
2 * altera.h
3 *
4 * altera FPGA driver
5 *
6 * Copyright (C) Altera Corporation 1998-2001
7 * Copyright (C) 2010 NetUP Inc.
8 * Copyright (C) 2010 Igor M. Liplianin <liplianin@netup.ru>
9 *
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License as published by
12 * the Free Software Foundation; either version 2 of the License, or
13 * (at your option) any later version.
14 *
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 *
19 * GNU General Public License for more details.
20 *
21 * You should have received a copy of the GNU General Public License
22 * along with this program; if not, write to the Free Software
23 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
24 */
25
26#ifndef _ALTERA_H_
27#define _ALTERA_H_
28
29struct altera_config {
30 void *dev;
31 u8 *action;
32 int (*jtag_io) (void *dev, int tms, int tdi, int tdo);
33};
34
35#if defined(CONFIG_ALTERA_STAPL) || \
36 (defined(CONFIG_ALTERA_STAPL_MODULE) && defined(MODULE))
37
38extern int altera_init(struct altera_config *config, const struct firmware *fw);
39#else
40
41static inline int altera_init(struct altera_config *config,
42 const struct firmware *fw)
43{
44 printk(KERN_WARNING "%s: driver disabled by Kconfig\n", __func__);
45 return 0;
46}
47#endif /* CONFIG_ALTERA_STAPL */
48
49#endif /* _ALTERA_H_ */
diff --git a/include/target/target_core_base.h b/include/target/target_core_base.h
index 561ac99def5a..27040653005e 100644
--- a/include/target/target_core_base.h
+++ b/include/target/target_core_base.h
@@ -9,12 +9,13 @@
9#include <net/sock.h> 9#include <net/sock.h>
10#include <net/tcp.h> 10#include <net/tcp.h>
11 11
12#define TARGET_CORE_MOD_VERSION "v4.0.0-rc7-ml" 12#define TARGET_CORE_MOD_VERSION "v4.1.0-rc1-ml"
13#define SHUTDOWN_SIGS (sigmask(SIGKILL)|sigmask(SIGINT)|sigmask(SIGABRT)) 13#define SHUTDOWN_SIGS (sigmask(SIGKILL)|sigmask(SIGINT)|sigmask(SIGABRT))
14 14
15/* Used by transport_generic_allocate_iovecs() */ 15/* Used by transport_generic_allocate_iovecs() */
16#define TRANSPORT_IOV_DATA_BUFFER 5 16#define TRANSPORT_IOV_DATA_BUFFER 5
17/* Maximum Number of LUNs per Target Portal Group */ 17/* Maximum Number of LUNs per Target Portal Group */
18/* Don't raise above 511 or REPORT_LUNS needs to handle >1 page */
18#define TRANSPORT_MAX_LUNS_PER_TPG 256 19#define TRANSPORT_MAX_LUNS_PER_TPG 256
19/* 20/*
20 * By default we use 32-byte CDBs in TCM Core and subsystem plugin code. 21 * By default we use 32-byte CDBs in TCM Core and subsystem plugin code.
@@ -99,6 +100,7 @@ enum transport_state_table {
99 TRANSPORT_FREE = 15, 100 TRANSPORT_FREE = 15,
100 TRANSPORT_NEW_CMD_MAP = 16, 101 TRANSPORT_NEW_CMD_MAP = 16,
101 TRANSPORT_FREE_CMD_INTR = 17, 102 TRANSPORT_FREE_CMD_INTR = 17,
103 TRANSPORT_COMPLETE_QF_WP = 18,
102}; 104};
103 105
104/* Used for struct se_cmd->se_cmd_flags */ 106/* Used for struct se_cmd->se_cmd_flags */
@@ -108,27 +110,22 @@ enum se_cmd_flags_table {
108 SCF_EMULATED_TASK_SENSE = 0x00000004, 110 SCF_EMULATED_TASK_SENSE = 0x00000004,
109 SCF_SCSI_DATA_SG_IO_CDB = 0x00000008, 111 SCF_SCSI_DATA_SG_IO_CDB = 0x00000008,
110 SCF_SCSI_CONTROL_SG_IO_CDB = 0x00000010, 112 SCF_SCSI_CONTROL_SG_IO_CDB = 0x00000010,
111 SCF_SCSI_CONTROL_NONSG_IO_CDB = 0x00000020,
112 SCF_SCSI_NON_DATA_CDB = 0x00000040, 113 SCF_SCSI_NON_DATA_CDB = 0x00000040,
113 SCF_SCSI_CDB_EXCEPTION = 0x00000080, 114 SCF_SCSI_CDB_EXCEPTION = 0x00000080,
114 SCF_SCSI_RESERVATION_CONFLICT = 0x00000100, 115 SCF_SCSI_RESERVATION_CONFLICT = 0x00000100,
115 SCF_CMD_PASSTHROUGH_NOALLOC = 0x00000200,
116 SCF_SE_CMD_FAILED = 0x00000400, 116 SCF_SE_CMD_FAILED = 0x00000400,
117 SCF_SE_LUN_CMD = 0x00000800, 117 SCF_SE_LUN_CMD = 0x00000800,
118 SCF_SE_ALLOW_EOO = 0x00001000, 118 SCF_SE_ALLOW_EOO = 0x00001000,
119 SCF_SE_DISABLE_ONLINE_CHECK = 0x00002000,
120 SCF_SENT_CHECK_CONDITION = 0x00004000, 119 SCF_SENT_CHECK_CONDITION = 0x00004000,
121 SCF_OVERFLOW_BIT = 0x00008000, 120 SCF_OVERFLOW_BIT = 0x00008000,
122 SCF_UNDERFLOW_BIT = 0x00010000, 121 SCF_UNDERFLOW_BIT = 0x00010000,
123 SCF_SENT_DELAYED_TAS = 0x00020000, 122 SCF_SENT_DELAYED_TAS = 0x00020000,
124 SCF_ALUA_NON_OPTIMIZED = 0x00040000, 123 SCF_ALUA_NON_OPTIMIZED = 0x00040000,
125 SCF_DELAYED_CMD_FROM_SAM_ATTR = 0x00080000, 124 SCF_DELAYED_CMD_FROM_SAM_ATTR = 0x00080000,
126 SCF_PASSTHROUGH_SG_TO_MEM = 0x00100000, 125 SCF_UNUSED = 0x00100000,
127 SCF_PASSTHROUGH_CONTIG_TO_SG = 0x00200000,
128 SCF_PASSTHROUGH_SG_TO_MEM_NOALLOC = 0x00400000, 126 SCF_PASSTHROUGH_SG_TO_MEM_NOALLOC = 0x00400000,
129 SCF_EMULATE_SYNC_CACHE = 0x00800000,
130 SCF_EMULATE_CDB_ASYNC = 0x01000000, 127 SCF_EMULATE_CDB_ASYNC = 0x01000000,
131 SCF_EMULATE_SYNC_UNMAP = 0x02000000 128 SCF_EMULATE_QUEUE_FULL = 0x02000000,
132}; 129};
133 130
134/* struct se_dev_entry->lun_flags and struct se_lun->lun_access */ 131/* struct se_dev_entry->lun_flags and struct se_lun->lun_access */
@@ -205,11 +202,6 @@ typedef enum {
205 SCSI_INDEX_TYPE_MAX 202 SCSI_INDEX_TYPE_MAX
206} scsi_index_t; 203} scsi_index_t;
207 204
208struct scsi_index_table {
209 spinlock_t lock;
210 u32 scsi_mib_index[SCSI_INDEX_TYPE_MAX];
211} ____cacheline_aligned;
212
213struct se_cmd; 205struct se_cmd;
214 206
215struct t10_alua { 207struct t10_alua {
@@ -235,7 +227,7 @@ struct t10_alua_lu_gp {
235 atomic_t lu_gp_ref_cnt; 227 atomic_t lu_gp_ref_cnt;
236 spinlock_t lu_gp_lock; 228 spinlock_t lu_gp_lock;
237 struct config_group lu_gp_group; 229 struct config_group lu_gp_group;
238 struct list_head lu_gp_list; 230 struct list_head lu_gp_node;
239 struct list_head lu_gp_mem_list; 231 struct list_head lu_gp_mem_list;
240} ____cacheline_aligned; 232} ____cacheline_aligned;
241 233
@@ -291,10 +283,10 @@ struct t10_vpd {
291} ____cacheline_aligned; 283} ____cacheline_aligned;
292 284
293struct t10_wwn { 285struct t10_wwn {
294 unsigned char vendor[8]; 286 char vendor[8];
295 unsigned char model[16]; 287 char model[16];
296 unsigned char revision[4]; 288 char revision[4];
297 unsigned char unit_serial[INQUIRY_VPD_SERIAL_LEN]; 289 char unit_serial[INQUIRY_VPD_SERIAL_LEN];
298 spinlock_t t10_vpd_lock; 290 spinlock_t t10_vpd_lock;
299 struct se_subsystem_dev *t10_sub_dev; 291 struct se_subsystem_dev *t10_sub_dev;
300 struct config_group t10_wwn_group; 292 struct config_group t10_wwn_group;
@@ -366,13 +358,13 @@ struct t10_reservation_ops {
366 int (*t10_pr_clear)(struct se_cmd *); 358 int (*t10_pr_clear)(struct se_cmd *);
367}; 359};
368 360
369struct t10_reservation_template { 361struct t10_reservation {
370 /* Reservation effects all target ports */ 362 /* Reservation effects all target ports */
371 int pr_all_tg_pt; 363 int pr_all_tg_pt;
372 /* Activate Persistence across Target Power Loss enabled 364 /* Activate Persistence across Target Power Loss enabled
373 * for SCSI device */ 365 * for SCSI device */
374 int pr_aptpl_active; 366 int pr_aptpl_active;
375 /* Used by struct t10_reservation_template->pr_aptpl_buf_len */ 367 /* Used by struct t10_reservation->pr_aptpl_buf_len */
376#define PR_APTPL_BUF_LEN 8192 368#define PR_APTPL_BUF_LEN 8192
377 u32 pr_aptpl_buf_len; 369 u32 pr_aptpl_buf_len;
378 u32 pr_generation; 370 u32 pr_generation;
@@ -397,7 +389,7 @@ struct t10_reservation_template {
397 389
398struct se_queue_req { 390struct se_queue_req {
399 int state; 391 int state;
400 void *cmd; 392 struct se_cmd *cmd;
401 struct list_head qr_list; 393 struct list_head qr_list;
402} ____cacheline_aligned; 394} ____cacheline_aligned;
403 395
@@ -408,64 +400,10 @@ struct se_queue_obj {
408 wait_queue_head_t thread_wq; 400 wait_queue_head_t thread_wq;
409} ____cacheline_aligned; 401} ____cacheline_aligned;
410 402
411/*
412 * Used one per struct se_cmd to hold all extra struct se_task
413 * metadata. This structure is setup and allocated in
414 * drivers/target/target_core_transport.c:__transport_alloc_se_cmd()
415 */
416struct se_transport_task {
417 unsigned char *t_task_cdb;
418 unsigned char __t_task_cdb[TCM_MAX_COMMAND_SIZE];
419 unsigned long long t_task_lba;
420 int t_tasks_failed;
421 int t_tasks_fua;
422 bool t_tasks_bidi;
423 u32 t_task_cdbs;
424 u32 t_tasks_check;
425 u32 t_tasks_no;
426 u32 t_tasks_sectors;
427 u32 t_tasks_se_num;
428 u32 t_tasks_se_bidi_num;
429 u32 t_tasks_sg_chained_no;
430 atomic_t t_fe_count;
431 atomic_t t_se_count;
432 atomic_t t_task_cdbs_left;
433 atomic_t t_task_cdbs_ex_left;
434 atomic_t t_task_cdbs_timeout_left;
435 atomic_t t_task_cdbs_sent;
436 atomic_t t_transport_aborted;
437 atomic_t t_transport_active;
438 atomic_t t_transport_complete;
439 atomic_t t_transport_queue_active;
440 atomic_t t_transport_sent;
441 atomic_t t_transport_stop;
442 atomic_t t_transport_timeout;
443 atomic_t transport_dev_active;
444 atomic_t transport_lun_active;
445 atomic_t transport_lun_fe_stop;
446 atomic_t transport_lun_stop;
447 spinlock_t t_state_lock;
448 struct completion t_transport_stop_comp;
449 struct completion transport_lun_fe_stop_comp;
450 struct completion transport_lun_stop_comp;
451 struct scatterlist *t_tasks_sg_chained;
452 struct scatterlist t_tasks_sg_bounce;
453 void *t_task_buf;
454 /*
455 * Used for pre-registered fabric SGL passthrough WRITE and READ
456 * with the special SCF_PASSTHROUGH_CONTIG_TO_SG case for TCM_Loop
457 * and other HW target mode fabric modules.
458 */
459 struct scatterlist *t_task_pt_sgl;
460 struct list_head *t_mem_list;
461 /* Used for BIDI READ */
462 struct list_head *t_mem_bidi_list;
463 struct list_head t_task_list;
464} ____cacheline_aligned;
465
466struct se_task { 403struct se_task {
467 unsigned char task_sense; 404 unsigned char task_sense;
468 struct scatterlist *task_sg; 405 struct scatterlist *task_sg;
406 u32 task_sg_nents;
469 struct scatterlist *task_sg_bidi; 407 struct scatterlist *task_sg_bidi;
470 u8 task_scsi_status; 408 u8 task_scsi_status;
471 u8 task_flags; 409 u8 task_flags;
@@ -476,8 +414,6 @@ struct se_task {
476 u32 task_no; 414 u32 task_no;
477 u32 task_sectors; 415 u32 task_sectors;
478 u32 task_size; 416 u32 task_size;
479 u32 task_sg_num;
480 u32 task_sg_offset;
481 enum dma_data_direction task_data_direction; 417 enum dma_data_direction task_data_direction;
482 struct se_cmd *task_se_cmd; 418 struct se_cmd *task_se_cmd;
483 struct se_device *se_dev; 419 struct se_device *se_dev;
@@ -495,9 +431,6 @@ struct se_task {
495 struct list_head t_state_list; 431 struct list_head t_state_list;
496} ____cacheline_aligned; 432} ____cacheline_aligned;
497 433
498#define TASK_CMD(task) ((task)->task_se_cmd)
499#define TASK_DEV(task) ((task)->se_dev)
500
501struct se_cmd { 434struct se_cmd {
502 /* SAM response code being sent to initiator */ 435 /* SAM response code being sent to initiator */
503 u8 scsi_status; 436 u8 scsi_status;
@@ -531,9 +464,10 @@ struct se_cmd {
531 atomic_t transport_sent; 464 atomic_t transport_sent;
532 /* Used for sense data */ 465 /* Used for sense data */
533 void *sense_buffer; 466 void *sense_buffer;
534 struct list_head se_delayed_list; 467 struct list_head se_delayed_node;
535 struct list_head se_ordered_list; 468 struct list_head se_ordered_node;
536 struct list_head se_lun_list; 469 struct list_head se_lun_node;
470 struct list_head se_qf_node;
537 struct se_device *se_dev; 471 struct se_device *se_dev;
538 struct se_dev_entry *se_deve; 472 struct se_dev_entry *se_deve;
539 struct se_device *se_obj_ptr; 473 struct se_device *se_obj_ptr;
@@ -542,18 +476,62 @@ struct se_cmd {
542 /* Only used for internal passthrough and legacy TCM fabric modules */ 476 /* Only used for internal passthrough and legacy TCM fabric modules */
543 struct se_session *se_sess; 477 struct se_session *se_sess;
544 struct se_tmr_req *se_tmr_req; 478 struct se_tmr_req *se_tmr_req;
545 /* t_task is setup to t_task_backstore in transport_init_se_cmd() */ 479 struct list_head se_queue_node;
546 struct se_transport_task *t_task;
547 struct se_transport_task t_task_backstore;
548 struct target_core_fabric_ops *se_tfo; 480 struct target_core_fabric_ops *se_tfo;
549 int (*transport_emulate_cdb)(struct se_cmd *); 481 int (*transport_emulate_cdb)(struct se_cmd *);
550 void (*transport_split_cdb)(unsigned long long, u32 *, unsigned char *); 482 void (*transport_split_cdb)(unsigned long long, u32, unsigned char *);
551 void (*transport_wait_for_tasks)(struct se_cmd *, int, int); 483 void (*transport_wait_for_tasks)(struct se_cmd *, int, int);
552 void (*transport_complete_callback)(struct se_cmd *); 484 void (*transport_complete_callback)(struct se_cmd *);
553} ____cacheline_aligned; 485 int (*transport_qf_callback)(struct se_cmd *);
554 486
555#define T_TASK(cmd) ((cmd)->t_task) 487 unsigned char *t_task_cdb;
556#define CMD_TFO(cmd) ((cmd)->se_tfo) 488 unsigned char __t_task_cdb[TCM_MAX_COMMAND_SIZE];
489 unsigned long long t_task_lba;
490 int t_tasks_failed;
491 int t_tasks_fua;
492 bool t_tasks_bidi;
493 u32 t_tasks_sg_chained_no;
494 atomic_t t_fe_count;
495 atomic_t t_se_count;
496 atomic_t t_task_cdbs_left;
497 atomic_t t_task_cdbs_ex_left;
498 atomic_t t_task_cdbs_timeout_left;
499 atomic_t t_task_cdbs_sent;
500 atomic_t t_transport_aborted;
501 atomic_t t_transport_active;
502 atomic_t t_transport_complete;
503 atomic_t t_transport_queue_active;
504 atomic_t t_transport_sent;
505 atomic_t t_transport_stop;
506 atomic_t t_transport_timeout;
507 atomic_t transport_dev_active;
508 atomic_t transport_lun_active;
509 atomic_t transport_lun_fe_stop;
510 atomic_t transport_lun_stop;
511 spinlock_t t_state_lock;
512 struct completion t_transport_stop_comp;
513 struct completion transport_lun_fe_stop_comp;
514 struct completion transport_lun_stop_comp;
515 struct scatterlist *t_tasks_sg_chained;
516
517 /*
518 * Used for pre-registered fabric SGL passthrough WRITE and READ
519 * with the special SCF_PASSTHROUGH_CONTIG_TO_SG case for TCM_Loop
520 * and other HW target mode fabric modules.
521 */
522 struct scatterlist *t_task_pt_sgl;
523 u32 t_task_pt_sgl_num;
524
525 struct scatterlist *t_data_sg;
526 unsigned int t_data_nents;
527 struct scatterlist *t_bidi_data_sg;
528 unsigned int t_bidi_data_nents;
529
530 /* Used for BIDI READ */
531 struct list_head t_task_list;
532 u32 t_task_list_num;
533
534} ____cacheline_aligned;
557 535
558struct se_tmr_req { 536struct se_tmr_req {
559 /* Task Management function to be preformed */ 537 /* Task Management function to be preformed */
@@ -617,9 +595,6 @@ struct se_session {
617 struct list_head sess_acl_list; 595 struct list_head sess_acl_list;
618} ____cacheline_aligned; 596} ____cacheline_aligned;
619 597
620#define SE_SESS(cmd) ((cmd)->se_sess)
621#define SE_NODE_ACL(sess) ((sess)->se_node_acl)
622
623struct se_device; 598struct se_device;
624struct se_transform_info; 599struct se_transform_info;
625struct scatterlist; 600struct scatterlist;
@@ -640,8 +615,6 @@ struct se_lun_acl {
640 struct se_ml_stat_grps ml_stat_grps; 615 struct se_ml_stat_grps ml_stat_grps;
641} ____cacheline_aligned; 616} ____cacheline_aligned;
642 617
643#define ML_STAT_GRPS(lacl) (&(lacl)->ml_stat_grps)
644
645struct se_dev_entry { 618struct se_dev_entry {
646 bool def_pr_registered; 619 bool def_pr_registered;
647 /* See transport_lunflags_table */ 620 /* See transport_lunflags_table */
@@ -688,6 +661,8 @@ struct se_dev_attrib {
688 int emulate_reservations; 661 int emulate_reservations;
689 int emulate_alua; 662 int emulate_alua;
690 int enforce_pr_isids; 663 int enforce_pr_isids;
664 int is_nonrot;
665 int emulate_rest_reord;
691 u32 hw_block_size; 666 u32 hw_block_size;
692 u32 block_size; 667 u32 block_size;
693 u32 hw_max_sectors; 668 u32 hw_max_sectors;
@@ -727,10 +702,10 @@ struct se_subsystem_dev {
727 /* T10 Inquiry and VPD WWN Information */ 702 /* T10 Inquiry and VPD WWN Information */
728 struct t10_wwn t10_wwn; 703 struct t10_wwn t10_wwn;
729 /* T10 SPC-2 + SPC-3 Reservations */ 704 /* T10 SPC-2 + SPC-3 Reservations */
730 struct t10_reservation_template t10_reservation; 705 struct t10_reservation t10_pr;
731 spinlock_t se_dev_lock; 706 spinlock_t se_dev_lock;
732 void *se_dev_su_ptr; 707 void *se_dev_su_ptr;
733 struct list_head g_se_dev_list; 708 struct list_head se_dev_node;
734 struct config_group se_dev_group; 709 struct config_group se_dev_group;
735 /* For T10 Reservations */ 710 /* For T10 Reservations */
736 struct config_group se_dev_pr_group; 711 struct config_group se_dev_pr_group;
@@ -738,11 +713,6 @@ struct se_subsystem_dev {
738 struct se_dev_stat_grps dev_stat_grps; 713 struct se_dev_stat_grps dev_stat_grps;
739} ____cacheline_aligned; 714} ____cacheline_aligned;
740 715
741#define T10_ALUA(su_dev) (&(su_dev)->t10_alua)
742#define T10_RES(su_dev) (&(su_dev)->t10_reservation)
743#define T10_PR_OPS(su_dev) (&(su_dev)->t10_reservation.pr_ops)
744#define DEV_STAT_GRP(dev) (&(dev)->dev_stat_grps)
745
746struct se_device { 716struct se_device {
747 /* Set to 1 if thread is NOT sleeping on thread_sem */ 717 /* Set to 1 if thread is NOT sleeping on thread_sem */
748 u8 thread_active; 718 u8 thread_active;
@@ -780,11 +750,11 @@ struct se_device {
780 atomic_t dev_status_thr_count; 750 atomic_t dev_status_thr_count;
781 atomic_t dev_hoq_count; 751 atomic_t dev_hoq_count;
782 atomic_t dev_ordered_sync; 752 atomic_t dev_ordered_sync;
753 atomic_t dev_qf_count;
783 struct se_obj dev_obj; 754 struct se_obj dev_obj;
784 struct se_obj dev_access_obj; 755 struct se_obj dev_access_obj;
785 struct se_obj dev_export_obj; 756 struct se_obj dev_export_obj;
786 struct se_queue_obj *dev_queue_obj; 757 struct se_queue_obj dev_queue_obj;
787 struct se_queue_obj *dev_status_queue_obj;
788 spinlock_t delayed_cmd_lock; 758 spinlock_t delayed_cmd_lock;
789 spinlock_t ordered_cmd_lock; 759 spinlock_t ordered_cmd_lock;
790 spinlock_t execute_task_lock; 760 spinlock_t execute_task_lock;
@@ -796,6 +766,7 @@ struct se_device {
796 spinlock_t dev_status_thr_lock; 766 spinlock_t dev_status_thr_lock;
797 spinlock_t se_port_lock; 767 spinlock_t se_port_lock;
798 spinlock_t se_tmr_lock; 768 spinlock_t se_tmr_lock;
769 spinlock_t qf_cmd_lock;
799 /* Used for legacy SPC-2 reservationsa */ 770 /* Used for legacy SPC-2 reservationsa */
800 struct se_node_acl *dev_reserved_node_acl; 771 struct se_node_acl *dev_reserved_node_acl;
801 /* Used for ALUA Logical Unit Group membership */ 772 /* Used for ALUA Logical Unit Group membership */
@@ -809,10 +780,12 @@ struct se_device {
809 struct task_struct *process_thread; 780 struct task_struct *process_thread;
810 pid_t process_thread_pid; 781 pid_t process_thread_pid;
811 struct task_struct *dev_mgmt_thread; 782 struct task_struct *dev_mgmt_thread;
783 struct work_struct qf_work_queue;
812 struct list_head delayed_cmd_list; 784 struct list_head delayed_cmd_list;
813 struct list_head ordered_cmd_list; 785 struct list_head ordered_cmd_list;
814 struct list_head execute_task_list; 786 struct list_head execute_task_list;
815 struct list_head state_task_list; 787 struct list_head state_task_list;
788 struct list_head qf_cmd_list;
816 /* Pointer to associated SE HBA */ 789 /* Pointer to associated SE HBA */
817 struct se_hba *se_hba; 790 struct se_hba *se_hba;
818 struct se_subsystem_dev *se_sub_dev; 791 struct se_subsystem_dev *se_sub_dev;
@@ -824,11 +797,6 @@ struct se_device {
824 struct list_head g_se_dev_list; 797 struct list_head g_se_dev_list;
825} ____cacheline_aligned; 798} ____cacheline_aligned;
826 799
827#define SE_DEV(cmd) ((cmd)->se_lun->lun_se_dev)
828#define SU_DEV(dev) ((dev)->se_sub_dev)
829#define DEV_ATTRIB(dev) (&(dev)->se_sub_dev->se_dev_attrib)
830#define DEV_T10_WWN(dev) (&(dev)->se_sub_dev->t10_wwn)
831
832struct se_hba { 800struct se_hba {
833 u16 hba_tpgt; 801 u16 hba_tpgt;
834 u32 hba_id; 802 u32 hba_id;
@@ -837,24 +805,17 @@ struct se_hba {
837 /* Virtual iSCSI devices attached. */ 805 /* Virtual iSCSI devices attached. */
838 u32 dev_count; 806 u32 dev_count;
839 u32 hba_index; 807 u32 hba_index;
840 atomic_t load_balance_queue;
841 atomic_t left_queue_depth;
842 /* Maximum queue depth the HBA can handle. */
843 atomic_t max_queue_depth;
844 /* Pointer to transport specific host structure. */ 808 /* Pointer to transport specific host structure. */
845 void *hba_ptr; 809 void *hba_ptr;
846 /* Linked list for struct se_device */ 810 /* Linked list for struct se_device */
847 struct list_head hba_dev_list; 811 struct list_head hba_dev_list;
848 struct list_head hba_list; 812 struct list_head hba_node;
849 spinlock_t device_lock; 813 spinlock_t device_lock;
850 spinlock_t hba_queue_lock;
851 struct config_group hba_group; 814 struct config_group hba_group;
852 struct mutex hba_access_mutex; 815 struct mutex hba_access_mutex;
853 struct se_subsystem_api *transport; 816 struct se_subsystem_api *transport;
854} ____cacheline_aligned; 817} ____cacheline_aligned;
855 818
856#define SE_HBA(dev) ((dev)->se_hba)
857
858struct se_port_stat_grps { 819struct se_port_stat_grps {
859 struct config_group stat_group; 820 struct config_group stat_group;
860 struct config_group scsi_port_group; 821 struct config_group scsi_port_group;
@@ -881,9 +842,6 @@ struct se_lun {
881 struct se_port_stat_grps port_stat_grps; 842 struct se_port_stat_grps port_stat_grps;
882} ____cacheline_aligned; 843} ____cacheline_aligned;
883 844
884#define SE_LUN(cmd) ((cmd)->se_lun)
885#define PORT_STAT_GRP(lun) (&(lun)->port_stat_grps)
886
887struct scsi_port_stats { 845struct scsi_port_stats {
888 u64 cmd_pdus; 846 u64 cmd_pdus;
889 u64 tx_data_octets; 847 u64 tx_data_octets;
@@ -930,7 +888,7 @@ struct se_portal_group {
930 spinlock_t tpg_lun_lock; 888 spinlock_t tpg_lun_lock;
931 /* Pointer to $FABRIC_MOD portal group */ 889 /* Pointer to $FABRIC_MOD portal group */
932 void *se_tpg_fabric_ptr; 890 void *se_tpg_fabric_ptr;
933 struct list_head se_tpg_list; 891 struct list_head se_tpg_node;
934 /* linked list for initiator ACL list */ 892 /* linked list for initiator ACL list */
935 struct list_head acl_node_list; 893 struct list_head acl_node_list;
936 struct se_lun *tpg_lun_list; 894 struct se_lun *tpg_lun_list;
@@ -949,8 +907,6 @@ struct se_portal_group {
949 struct config_group tpg_param_group; 907 struct config_group tpg_param_group;
950} ____cacheline_aligned; 908} ____cacheline_aligned;
951 909
952#define TPG_TFO(se_tpg) ((se_tpg)->se_tpg_tfo)
953
954struct se_wwn { 910struct se_wwn {
955 struct target_fabric_configfs *wwn_tf; 911 struct target_fabric_configfs *wwn_tf;
956 struct config_group wwn_group; 912 struct config_group wwn_group;
@@ -958,28 +914,4 @@ struct se_wwn {
958 struct config_group fabric_stat_group; 914 struct config_group fabric_stat_group;
959} ____cacheline_aligned; 915} ____cacheline_aligned;
960 916
961struct se_global {
962 u16 alua_lu_gps_counter;
963 int g_sub_api_initialized;
964 u32 in_shutdown;
965 u32 alua_lu_gps_count;
966 u32 g_hba_id_counter;
967 struct config_group target_core_hbagroup;
968 struct config_group alua_group;
969 struct config_group alua_lu_gps_group;
970 struct list_head g_lu_gps_list;
971 struct list_head g_se_tpg_list;
972 struct list_head g_hba_list;
973 struct list_head g_se_dev_list;
974 struct se_hba *g_lun0_hba;
975 struct se_subsystem_dev *g_lun0_su_dev;
976 struct se_device *g_lun0_dev;
977 struct t10_alua_lu_gp *default_lu_gp;
978 spinlock_t g_device_lock;
979 spinlock_t hba_lock;
980 spinlock_t se_tpg_lock;
981 spinlock_t lu_gps_lock;
982 spinlock_t plugin_class_lock;
983} ____cacheline_aligned;
984
985#endif /* TARGET_CORE_BASE_H */ 917#endif /* TARGET_CORE_BASE_H */
diff --git a/include/target/target_core_device.h b/include/target/target_core_device.h
index 52b18a5752c9..46571912086c 100644
--- a/include/target/target_core_device.h
+++ b/include/target/target_core_device.h
@@ -1,8 +1,8 @@
1#ifndef TARGET_CORE_DEVICE_H 1#ifndef TARGET_CORE_DEVICE_H
2#define TARGET_CORE_DEVICE_H 2#define TARGET_CORE_DEVICE_H
3 3
4extern int transport_get_lun_for_cmd(struct se_cmd *, unsigned char *, u32); 4extern int transport_lookup_cmd_lun(struct se_cmd *, u32);
5extern int transport_get_lun_for_tmr(struct se_cmd *, u32); 5extern int transport_lookup_tmr_lun(struct se_cmd *, u32);
6extern struct se_dev_entry *core_get_se_deve_from_rtpi( 6extern struct se_dev_entry *core_get_se_deve_from_rtpi(
7 struct se_node_acl *, u16); 7 struct se_node_acl *, u16);
8extern int core_free_device_list_for_node(struct se_node_acl *, 8extern int core_free_device_list_for_node(struct se_node_acl *,
@@ -39,6 +39,8 @@ extern int se_dev_set_emulate_tas(struct se_device *, int);
39extern int se_dev_set_emulate_tpu(struct se_device *, int); 39extern int se_dev_set_emulate_tpu(struct se_device *, int);
40extern int se_dev_set_emulate_tpws(struct se_device *, int); 40extern int se_dev_set_emulate_tpws(struct se_device *, int);
41extern int se_dev_set_enforce_pr_isids(struct se_device *, int); 41extern int se_dev_set_enforce_pr_isids(struct se_device *, int);
42extern int se_dev_set_is_nonrot(struct se_device *, int);
43extern int se_dev_set_emulate_rest_reord(struct se_device *dev, int);
42extern int se_dev_set_queue_depth(struct se_device *, u32); 44extern int se_dev_set_queue_depth(struct se_device *, u32);
43extern int se_dev_set_max_sectors(struct se_device *, u32); 45extern int se_dev_set_max_sectors(struct se_device *, u32);
44extern int se_dev_set_optimal_sectors(struct se_device *, u32); 46extern int se_dev_set_optimal_sectors(struct se_device *, u32);
diff --git a/include/target/target_core_fabric_ops.h b/include/target/target_core_fabric_ops.h
index 747e1404dca0..2de8fe907596 100644
--- a/include/target/target_core_fabric_ops.h
+++ b/include/target/target_core_fabric_ops.h
@@ -39,17 +39,11 @@ struct target_core_fabric_ops {
39 */ 39 */
40 int (*new_cmd_map)(struct se_cmd *); 40 int (*new_cmd_map)(struct se_cmd *);
41 /* 41 /*
42 * Optional function pointer for TCM fabric modules that use
43 * Linux/NET sockets to allocate struct iovec array to struct se_cmd
44 */
45 int (*alloc_cmd_iovecs)(struct se_cmd *);
46 /*
47 * Optional to release struct se_cmd and fabric dependent allocated 42 * Optional to release struct se_cmd and fabric dependent allocated
48 * I/O descriptor in transport_cmd_check_stop() 43 * I/O descriptor in transport_cmd_check_stop()
49 */ 44 */
50 void (*check_stop_free)(struct se_cmd *); 45 void (*check_stop_free)(struct se_cmd *);
51 void (*release_cmd_to_pool)(struct se_cmd *); 46 void (*release_cmd)(struct se_cmd *);
52 void (*release_cmd_direct)(struct se_cmd *);
53 /* 47 /*
54 * Called with spin_lock_bh(struct se_portal_group->session_lock held. 48 * Called with spin_lock_bh(struct se_portal_group->session_lock held.
55 */ 49 */
@@ -70,7 +64,6 @@ struct target_core_fabric_ops {
70 void (*set_default_node_attributes)(struct se_node_acl *); 64 void (*set_default_node_attributes)(struct se_node_acl *);
71 u32 (*get_task_tag)(struct se_cmd *); 65 u32 (*get_task_tag)(struct se_cmd *);
72 int (*get_cmd_state)(struct se_cmd *); 66 int (*get_cmd_state)(struct se_cmd *);
73 void (*new_cmd_failure)(struct se_cmd *);
74 int (*queue_data_in)(struct se_cmd *); 67 int (*queue_data_in)(struct se_cmd *);
75 int (*queue_status)(struct se_cmd *); 68 int (*queue_status)(struct se_cmd *);
76 int (*queue_tm_rsp)(struct se_cmd *); 69 int (*queue_tm_rsp)(struct se_cmd *);
diff --git a/include/target/target_core_transport.h b/include/target/target_core_transport.h
index 24a1c6cb83c3..46aae4f94ede 100644
--- a/include/target/target_core_transport.h
+++ b/include/target/target_core_transport.h
@@ -101,6 +101,10 @@
101#define DA_ENFORCE_PR_ISIDS 1 101#define DA_ENFORCE_PR_ISIDS 1
102#define DA_STATUS_MAX_SECTORS_MIN 16 102#define DA_STATUS_MAX_SECTORS_MIN 16
103#define DA_STATUS_MAX_SECTORS_MAX 8192 103#define DA_STATUS_MAX_SECTORS_MAX 8192
104/* By default don't report non-rotating (solid state) medium */
105#define DA_IS_NONROT 0
106/* Queue Algorithm Modifier default for restricted reordering in control mode page */
107#define DA_EMULATE_REST_REORD 0
104 108
105#define SE_MODE_PAGE_BUF 512 109#define SE_MODE_PAGE_BUF 512
106 110
@@ -111,9 +115,8 @@ struct se_subsystem_api;
111 115
112extern struct kmem_cache *se_mem_cache; 116extern struct kmem_cache *se_mem_cache;
113 117
114extern int init_se_global(void); 118extern int init_se_kmem_caches(void);
115extern void release_se_global(void); 119extern void release_se_kmem_caches(void);
116extern void init_scsi_index_table(void);
117extern u32 scsi_get_new_index(scsi_index_t); 120extern u32 scsi_get_new_index(scsi_index_t);
118extern void transport_init_queue_obj(struct se_queue_obj *); 121extern void transport_init_queue_obj(struct se_queue_obj *);
119extern int transport_subsystem_check_init(void); 122extern int transport_subsystem_check_init(void);
@@ -160,36 +163,38 @@ extern struct se_device *transport_add_device_to_core_hba(struct se_hba *,
160 struct se_subsystem_dev *, u32, 163 struct se_subsystem_dev *, u32,
161 void *, struct se_dev_limits *, 164 void *, struct se_dev_limits *,
162 const char *, const char *); 165 const char *, const char *);
163extern void transport_device_setup_cmd(struct se_cmd *);
164extern void transport_init_se_cmd(struct se_cmd *, 166extern void transport_init_se_cmd(struct se_cmd *,
165 struct target_core_fabric_ops *, 167 struct target_core_fabric_ops *,
166 struct se_session *, u32, int, int, 168 struct se_session *, u32, int, int,
167 unsigned char *); 169 unsigned char *);
170void *transport_kmap_first_data_page(struct se_cmd *cmd);
171void transport_kunmap_first_data_page(struct se_cmd *cmd);
168extern void transport_free_se_cmd(struct se_cmd *); 172extern void transport_free_se_cmd(struct se_cmd *);
169extern int transport_generic_allocate_tasks(struct se_cmd *, unsigned char *); 173extern int transport_generic_allocate_tasks(struct se_cmd *, unsigned char *);
170extern int transport_generic_handle_cdb(struct se_cmd *); 174extern int transport_generic_handle_cdb(struct se_cmd *);
175extern int transport_handle_cdb_direct(struct se_cmd *);
171extern int transport_generic_handle_cdb_map(struct se_cmd *); 176extern int transport_generic_handle_cdb_map(struct se_cmd *);
172extern int transport_generic_handle_data(struct se_cmd *); 177extern int transport_generic_handle_data(struct se_cmd *);
173extern void transport_new_cmd_failure(struct se_cmd *); 178extern void transport_new_cmd_failure(struct se_cmd *);
174extern int transport_generic_handle_tmr(struct se_cmd *); 179extern int transport_generic_handle_tmr(struct se_cmd *);
175extern void transport_generic_free_cmd_intr(struct se_cmd *); 180extern void transport_generic_free_cmd_intr(struct se_cmd *);
176extern void __transport_stop_task_timer(struct se_task *, unsigned long *); 181extern void __transport_stop_task_timer(struct se_task *, unsigned long *);
177extern unsigned char transport_asciihex_to_binaryhex(unsigned char val[2]);
178extern int transport_generic_map_mem_to_cmd(struct se_cmd *cmd, struct scatterlist *, u32, 182extern int transport_generic_map_mem_to_cmd(struct se_cmd *cmd, struct scatterlist *, u32,
179 struct scatterlist *, u32); 183 struct scatterlist *, u32);
180extern int transport_clear_lun_from_sessions(struct se_lun *); 184extern int transport_clear_lun_from_sessions(struct se_lun *);
181extern int transport_check_aborted_status(struct se_cmd *, int); 185extern int transport_check_aborted_status(struct se_cmd *, int);
182extern int transport_send_check_condition_and_sense(struct se_cmd *, u8, int); 186extern int transport_send_check_condition_and_sense(struct se_cmd *, u8, int);
183extern void transport_send_task_abort(struct se_cmd *); 187extern void transport_send_task_abort(struct se_cmd *);
184extern void transport_release_cmd_to_pool(struct se_cmd *); 188extern void transport_release_cmd(struct se_cmd *);
185extern void transport_generic_free_cmd(struct se_cmd *, int, int, int); 189extern void transport_generic_free_cmd(struct se_cmd *, int, int);
186extern void transport_generic_wait_for_cmds(struct se_cmd *, int); 190extern void transport_generic_wait_for_cmds(struct se_cmd *, int);
187extern u32 transport_calc_sg_num(struct se_task *, struct se_mem *, u32); 191extern int transport_init_task_sg(struct se_task *, struct se_mem *, u32);
188extern int transport_map_mem_to_sg(struct se_task *, struct list_head *, 192extern int transport_map_mem_to_sg(struct se_task *, struct list_head *,
189 void *, struct se_mem *, 193 struct scatterlist *, struct se_mem *,
190 struct se_mem **, u32 *, u32 *); 194 struct se_mem **, u32 *, u32 *);
191extern void transport_do_task_sg_chain(struct se_cmd *); 195extern void transport_do_task_sg_chain(struct se_cmd *);
192extern void transport_generic_process_write(struct se_cmd *); 196extern void transport_generic_process_write(struct se_cmd *);
197extern int transport_generic_new_cmd(struct se_cmd *);
193extern int transport_generic_do_tmr(struct se_cmd *); 198extern int transport_generic_do_tmr(struct se_cmd *);
194/* From target_core_alua.c */ 199/* From target_core_alua.c */
195extern int core_alua_check_nonop_delay(struct se_cmd *); 200extern int core_alua_check_nonop_delay(struct se_cmd *);
@@ -235,13 +240,13 @@ struct se_subsystem_api {
235 */ 240 */
236 int (*cdb_none)(struct se_task *); 241 int (*cdb_none)(struct se_task *);
237 /* 242 /*
238 * For SCF_SCSI_CONTROL_NONSG_IO_CDB 243 * For SCF_SCSI_DATA_SG_IO_CDB
239 */ 244 */
240 int (*map_task_non_SG)(struct se_task *); 245 int (*map_data_SG)(struct se_task *);
241 /* 246 /*
242 * For SCF_SCSI_DATA_SG_IO_CDB and SCF_SCSI_CONTROL_SG_IO_CDB 247 * For SCF_SCSI_CONTROL_SG_IO_CDB
243 */ 248 */
244 int (*map_task_SG)(struct se_task *); 249 int (*map_control_SG)(struct se_task *);
245 /* 250 /*
246 * attach_hba(): 251 * attach_hba():
247 */ 252 */
@@ -292,7 +297,7 @@ struct se_subsystem_api {
292 * drivers. Provided out of convenience. 297 * drivers. Provided out of convenience.
293 */ 298 */
294 int (*transport_complete)(struct se_task *task); 299 int (*transport_complete)(struct se_task *task);
295 struct se_task *(*alloc_task)(struct se_cmd *); 300 struct se_task *(*alloc_task)(unsigned char *cdb);
296 /* 301 /*
297 * do_task(): 302 * do_task():
298 */ 303 */
@@ -342,19 +347,9 @@ struct se_subsystem_api {
342 */ 347 */
343 sector_t (*get_blocks)(struct se_device *); 348 sector_t (*get_blocks)(struct se_device *);
344 /* 349 /*
345 * do_se_mem_map():
346 */
347 int (*do_se_mem_map)(struct se_task *, struct list_head *, void *,
348 struct se_mem *, struct se_mem **, u32 *, u32 *);
349 /*
350 * get_sense_buffer(): 350 * get_sense_buffer():
351 */ 351 */
352 unsigned char *(*get_sense_buffer)(struct se_task *); 352 unsigned char *(*get_sense_buffer)(struct se_task *);
353} ____cacheline_aligned; 353} ____cacheline_aligned;
354 354
355#define TRANSPORT(dev) ((dev)->transport)
356#define HBA_TRANSPORT(hba) ((hba)->transport)
357
358extern struct se_global *se_global;
359
360#endif /* TARGET_CORE_TRANSPORT_H */ 355#endif /* TARGET_CORE_TRANSPORT_H */
diff --git a/include/trace/events/asoc.h b/include/trace/events/asoc.h
index ae973d2e27a1..603f5a0f0365 100644
--- a/include/trace/events/asoc.h
+++ b/include/trace/events/asoc.h
@@ -9,6 +9,7 @@
9 9
10struct snd_soc_jack; 10struct snd_soc_jack;
11struct snd_soc_codec; 11struct snd_soc_codec;
12struct snd_soc_platform;
12struct snd_soc_card; 13struct snd_soc_card;
13struct snd_soc_dapm_widget; 14struct snd_soc_dapm_widget;
14 15
@@ -59,6 +60,50 @@ DEFINE_EVENT(snd_soc_reg, snd_soc_reg_read,
59 60
60); 61);
61 62
63DECLARE_EVENT_CLASS(snd_soc_preg,
64
65 TP_PROTO(struct snd_soc_platform *platform, unsigned int reg,
66 unsigned int val),
67
68 TP_ARGS(platform, reg, val),
69
70 TP_STRUCT__entry(
71 __string( name, platform->name )
72 __field( int, id )
73 __field( unsigned int, reg )
74 __field( unsigned int, val )
75 ),
76
77 TP_fast_assign(
78 __assign_str(name, platform->name);
79 __entry->id = platform->id;
80 __entry->reg = reg;
81 __entry->val = val;
82 ),
83
84 TP_printk("platform=%s.%d reg=%x val=%x", __get_str(name),
85 (int)__entry->id, (unsigned int)__entry->reg,
86 (unsigned int)__entry->val)
87);
88
89DEFINE_EVENT(snd_soc_preg, snd_soc_preg_write,
90
91 TP_PROTO(struct snd_soc_platform *platform, unsigned int reg,
92 unsigned int val),
93
94 TP_ARGS(platform, reg, val)
95
96);
97
98DEFINE_EVENT(snd_soc_preg, snd_soc_preg_read,
99
100 TP_PROTO(struct snd_soc_platform *platform, unsigned int reg,
101 unsigned int val),
102
103 TP_ARGS(platform, reg, val)
104
105);
106
62DECLARE_EVENT_CLASS(snd_soc_card, 107DECLARE_EVENT_CLASS(snd_soc_card,
63 108
64 TP_PROTO(struct snd_soc_card *card, int val), 109 TP_PROTO(struct snd_soc_card *card, int val),
diff --git a/include/trace/events/ext4.h b/include/trace/events/ext4.h
index e09592d2f916..5ce2b2f5f524 100644
--- a/include/trace/events/ext4.h
+++ b/include/trace/events/ext4.h
@@ -26,7 +26,7 @@ TRACE_EVENT(ext4_free_inode,
26 __field( umode_t, mode ) 26 __field( umode_t, mode )
27 __field( uid_t, uid ) 27 __field( uid_t, uid )
28 __field( gid_t, gid ) 28 __field( gid_t, gid )
29 __field( blkcnt_t, blocks ) 29 __field( __u64, blocks )
30 ), 30 ),
31 31
32 TP_fast_assign( 32 TP_fast_assign(
@@ -40,9 +40,8 @@ TRACE_EVENT(ext4_free_inode,
40 40
41 TP_printk("dev %d,%d ino %lu mode 0%o uid %u gid %u blocks %llu", 41 TP_printk("dev %d,%d ino %lu mode 0%o uid %u gid %u blocks %llu",
42 MAJOR(__entry->dev), MINOR(__entry->dev), 42 MAJOR(__entry->dev), MINOR(__entry->dev),
43 (unsigned long) __entry->ino, 43 (unsigned long) __entry->ino, __entry->mode,
44 __entry->mode, __entry->uid, __entry->gid, 44 __entry->uid, __entry->gid, __entry->blocks)
45 (unsigned long long) __entry->blocks)
46); 45);
47 46
48TRACE_EVENT(ext4_request_inode, 47TRACE_EVENT(ext4_request_inode,
@@ -178,7 +177,7 @@ TRACE_EVENT(ext4_begin_ordered_truncate,
178 TP_printk("dev %d,%d ino %lu new_size %lld", 177 TP_printk("dev %d,%d ino %lu new_size %lld",
179 MAJOR(__entry->dev), MINOR(__entry->dev), 178 MAJOR(__entry->dev), MINOR(__entry->dev),
180 (unsigned long) __entry->ino, 179 (unsigned long) __entry->ino,
181 (long long) __entry->new_size) 180 __entry->new_size)
182); 181);
183 182
184DECLARE_EVENT_CLASS(ext4__write_begin, 183DECLARE_EVENT_CLASS(ext4__write_begin,
@@ -204,7 +203,7 @@ DECLARE_EVENT_CLASS(ext4__write_begin,
204 __entry->flags = flags; 203 __entry->flags = flags;
205 ), 204 ),
206 205
207 TP_printk("dev %d,%d ino %lu pos %llu len %u flags %u", 206 TP_printk("dev %d,%d ino %lu pos %lld len %u flags %u",
208 MAJOR(__entry->dev), MINOR(__entry->dev), 207 MAJOR(__entry->dev), MINOR(__entry->dev),
209 (unsigned long) __entry->ino, 208 (unsigned long) __entry->ino,
210 __entry->pos, __entry->len, __entry->flags) 209 __entry->pos, __entry->len, __entry->flags)
@@ -248,7 +247,7 @@ DECLARE_EVENT_CLASS(ext4__write_end,
248 __entry->copied = copied; 247 __entry->copied = copied;
249 ), 248 ),
250 249
251 TP_printk("dev %d,%d ino %lu pos %llu len %u copied %u", 250 TP_printk("dev %d,%d ino %lu pos %lld len %u copied %u",
252 MAJOR(__entry->dev), MINOR(__entry->dev), 251 MAJOR(__entry->dev), MINOR(__entry->dev),
253 (unsigned long) __entry->ino, 252 (unsigned long) __entry->ino,
254 __entry->pos, __entry->len, __entry->copied) 253 __entry->pos, __entry->len, __entry->copied)
@@ -286,29 +285,6 @@ DEFINE_EVENT(ext4__write_end, ext4_da_write_end,
286 TP_ARGS(inode, pos, len, copied) 285 TP_ARGS(inode, pos, len, copied)
287); 286);
288 287
289TRACE_EVENT(ext4_writepage,
290 TP_PROTO(struct inode *inode, struct page *page),
291
292 TP_ARGS(inode, page),
293
294 TP_STRUCT__entry(
295 __field( dev_t, dev )
296 __field( ino_t, ino )
297 __field( pgoff_t, index )
298
299 ),
300
301 TP_fast_assign(
302 __entry->dev = inode->i_sb->s_dev;
303 __entry->ino = inode->i_ino;
304 __entry->index = page->index;
305 ),
306
307 TP_printk("dev %d,%d ino %lu page_index %lu",
308 MAJOR(__entry->dev), MINOR(__entry->dev),
309 (unsigned long) __entry->ino, __entry->index)
310);
311
312TRACE_EVENT(ext4_da_writepages, 288TRACE_EVENT(ext4_da_writepages,
313 TP_PROTO(struct inode *inode, struct writeback_control *wbc), 289 TP_PROTO(struct inode *inode, struct writeback_control *wbc),
314 290
@@ -341,7 +317,7 @@ TRACE_EVENT(ext4_da_writepages,
341 ), 317 ),
342 318
343 TP_printk("dev %d,%d ino %lu nr_to_write %ld pages_skipped %ld " 319 TP_printk("dev %d,%d ino %lu nr_to_write %ld pages_skipped %ld "
344 "range_start %llu range_end %llu sync_mode %d" 320 "range_start %lld range_end %lld sync_mode %d"
345 "for_kupdate %d range_cyclic %d writeback_index %lu", 321 "for_kupdate %d range_cyclic %d writeback_index %lu",
346 MAJOR(__entry->dev), MINOR(__entry->dev), 322 MAJOR(__entry->dev), MINOR(__entry->dev),
347 (unsigned long) __entry->ino, __entry->nr_to_write, 323 (unsigned long) __entry->ino, __entry->nr_to_write,
@@ -449,7 +425,14 @@ DECLARE_EVENT_CLASS(ext4__page_op,
449 TP_printk("dev %d,%d ino %lu page_index %lu", 425 TP_printk("dev %d,%d ino %lu page_index %lu",
450 MAJOR(__entry->dev), MINOR(__entry->dev), 426 MAJOR(__entry->dev), MINOR(__entry->dev),
451 (unsigned long) __entry->ino, 427 (unsigned long) __entry->ino,
452 __entry->index) 428 (unsigned long) __entry->index)
429);
430
431DEFINE_EVENT(ext4__page_op, ext4_writepage,
432
433 TP_PROTO(struct page *page),
434
435 TP_ARGS(page)
453); 436);
454 437
455DEFINE_EVENT(ext4__page_op, ext4_readpage, 438DEFINE_EVENT(ext4__page_op, ext4_readpage,
@@ -489,7 +472,7 @@ TRACE_EVENT(ext4_invalidatepage,
489 TP_printk("dev %d,%d ino %lu page_index %lu offset %lu", 472 TP_printk("dev %d,%d ino %lu page_index %lu offset %lu",
490 MAJOR(__entry->dev), MINOR(__entry->dev), 473 MAJOR(__entry->dev), MINOR(__entry->dev),
491 (unsigned long) __entry->ino, 474 (unsigned long) __entry->ino,
492 __entry->index, __entry->offset) 475 (unsigned long) __entry->index, __entry->offset)
493); 476);
494 477
495TRACE_EVENT(ext4_discard_blocks, 478TRACE_EVENT(ext4_discard_blocks,
@@ -562,12 +545,10 @@ DEFINE_EVENT(ext4__mb_new_pa, ext4_mb_new_group_pa,
562); 545);
563 546
564TRACE_EVENT(ext4_mb_release_inode_pa, 547TRACE_EVENT(ext4_mb_release_inode_pa,
565 TP_PROTO(struct super_block *sb, 548 TP_PROTO(struct ext4_prealloc_space *pa,
566 struct inode *inode,
567 struct ext4_prealloc_space *pa,
568 unsigned long long block, unsigned int count), 549 unsigned long long block, unsigned int count),
569 550
570 TP_ARGS(sb, inode, pa, block, count), 551 TP_ARGS(pa, block, count),
571 552
572 TP_STRUCT__entry( 553 TP_STRUCT__entry(
573 __field( dev_t, dev ) 554 __field( dev_t, dev )
@@ -578,8 +559,8 @@ TRACE_EVENT(ext4_mb_release_inode_pa,
578 ), 559 ),
579 560
580 TP_fast_assign( 561 TP_fast_assign(
581 __entry->dev = sb->s_dev; 562 __entry->dev = pa->pa_inode->i_sb->s_dev;
582 __entry->ino = inode->i_ino; 563 __entry->ino = pa->pa_inode->i_ino;
583 __entry->block = block; 564 __entry->block = block;
584 __entry->count = count; 565 __entry->count = count;
585 ), 566 ),
@@ -591,10 +572,9 @@ TRACE_EVENT(ext4_mb_release_inode_pa,
591); 572);
592 573
593TRACE_EVENT(ext4_mb_release_group_pa, 574TRACE_EVENT(ext4_mb_release_group_pa,
594 TP_PROTO(struct super_block *sb, 575 TP_PROTO(struct ext4_prealloc_space *pa),
595 struct ext4_prealloc_space *pa),
596 576
597 TP_ARGS(sb, pa), 577 TP_ARGS(pa),
598 578
599 TP_STRUCT__entry( 579 TP_STRUCT__entry(
600 __field( dev_t, dev ) 580 __field( dev_t, dev )
@@ -604,7 +584,7 @@ TRACE_EVENT(ext4_mb_release_group_pa,
604 ), 584 ),
605 585
606 TP_fast_assign( 586 TP_fast_assign(
607 __entry->dev = sb->s_dev; 587 __entry->dev = pa->pa_inode->i_sb->s_dev;
608 __entry->pa_pstart = pa->pa_pstart; 588 __entry->pa_pstart = pa->pa_pstart;
609 __entry->pa_len = pa->pa_len; 589 __entry->pa_len = pa->pa_len;
610 ), 590 ),
@@ -666,10 +646,10 @@ TRACE_EVENT(ext4_request_blocks,
666 __field( ino_t, ino ) 646 __field( ino_t, ino )
667 __field( unsigned int, flags ) 647 __field( unsigned int, flags )
668 __field( unsigned int, len ) 648 __field( unsigned int, len )
669 __field( __u64, logical ) 649 __field( __u32, logical )
650 __field( __u32, lleft )
651 __field( __u32, lright )
670 __field( __u64, goal ) 652 __field( __u64, goal )
671 __field( __u64, lleft )
672 __field( __u64, lright )
673 __field( __u64, pleft ) 653 __field( __u64, pleft )
674 __field( __u64, pright ) 654 __field( __u64, pright )
675 ), 655 ),
@@ -687,17 +667,13 @@ TRACE_EVENT(ext4_request_blocks,
687 __entry->pright = ar->pright; 667 __entry->pright = ar->pright;
688 ), 668 ),
689 669
690 TP_printk("dev %d,%d ino %lu flags %u len %u lblk %llu goal %llu " 670 TP_printk("dev %d,%d ino %lu flags %u len %u lblk %u goal %llu "
691 "lleft %llu lright %llu pleft %llu pright %llu ", 671 "lleft %u lright %u pleft %llu pright %llu ",
692 MAJOR(__entry->dev), MINOR(__entry->dev), 672 MAJOR(__entry->dev), MINOR(__entry->dev),
693 (unsigned long) __entry->ino, 673 (unsigned long) __entry->ino, __entry->flags,
694 __entry->flags, __entry->len, 674 __entry->len, __entry->logical, __entry->goal,
695 (unsigned long long) __entry->logical, 675 __entry->lleft, __entry->lright, __entry->pleft,
696 (unsigned long long) __entry->goal, 676 __entry->pright)
697 (unsigned long long) __entry->lleft,
698 (unsigned long long) __entry->lright,
699 (unsigned long long) __entry->pleft,
700 (unsigned long long) __entry->pright)
701); 677);
702 678
703TRACE_EVENT(ext4_allocate_blocks, 679TRACE_EVENT(ext4_allocate_blocks,
@@ -711,10 +687,10 @@ TRACE_EVENT(ext4_allocate_blocks,
711 __field( __u64, block ) 687 __field( __u64, block )
712 __field( unsigned int, flags ) 688 __field( unsigned int, flags )
713 __field( unsigned int, len ) 689 __field( unsigned int, len )
714 __field( __u64, logical ) 690 __field( __u32, logical )
691 __field( __u32, lleft )
692 __field( __u32, lright )
715 __field( __u64, goal ) 693 __field( __u64, goal )
716 __field( __u64, lleft )
717 __field( __u64, lright )
718 __field( __u64, pleft ) 694 __field( __u64, pleft )
719 __field( __u64, pright ) 695 __field( __u64, pright )
720 ), 696 ),
@@ -733,17 +709,13 @@ TRACE_EVENT(ext4_allocate_blocks,
733 __entry->pright = ar->pright; 709 __entry->pright = ar->pright;
734 ), 710 ),
735 711
736 TP_printk("dev %d,%d ino %lu flags %u len %u block %llu lblk %llu " 712 TP_printk("dev %d,%d ino %lu flags %u len %u block %llu lblk %u "
737 "goal %llu lleft %llu lright %llu pleft %llu pright %llu", 713 "goal %llu lleft %u lright %u pleft %llu pright %llu",
738 MAJOR(__entry->dev), MINOR(__entry->dev), 714 MAJOR(__entry->dev), MINOR(__entry->dev),
739 (unsigned long) __entry->ino, 715 (unsigned long) __entry->ino, __entry->flags,
740 __entry->flags, __entry->len, __entry->block, 716 __entry->len, __entry->block, __entry->logical,
741 (unsigned long long) __entry->logical, 717 __entry->goal, __entry->lleft, __entry->lright,
742 (unsigned long long) __entry->goal, 718 __entry->pleft, __entry->pright)
743 (unsigned long long) __entry->lleft,
744 (unsigned long long) __entry->lright,
745 (unsigned long long) __entry->pleft,
746 (unsigned long long) __entry->pright)
747); 719);
748 720
749TRACE_EVENT(ext4_free_blocks, 721TRACE_EVENT(ext4_free_blocks,
@@ -755,10 +727,10 @@ TRACE_EVENT(ext4_free_blocks,
755 TP_STRUCT__entry( 727 TP_STRUCT__entry(
756 __field( dev_t, dev ) 728 __field( dev_t, dev )
757 __field( ino_t, ino ) 729 __field( ino_t, ino )
758 __field( umode_t, mode ) 730 __field( umode_t, mode )
759 __field( __u64, block ) 731 __field( __u64, block )
760 __field( unsigned long, count ) 732 __field( unsigned long, count )
761 __field( int, flags ) 733 __field( int, flags )
762 ), 734 ),
763 735
764 TP_fast_assign( 736 TP_fast_assign(
@@ -798,7 +770,7 @@ TRACE_EVENT(ext4_sync_file_enter,
798 __entry->parent = dentry->d_parent->d_inode->i_ino; 770 __entry->parent = dentry->d_parent->d_inode->i_ino;
799 ), 771 ),
800 772
801 TP_printk("dev %d,%d ino %ld parent %ld datasync %d ", 773 TP_printk("dev %d,%d ino %lu parent %lu datasync %d ",
802 MAJOR(__entry->dev), MINOR(__entry->dev), 774 MAJOR(__entry->dev), MINOR(__entry->dev),
803 (unsigned long) __entry->ino, 775 (unsigned long) __entry->ino,
804 (unsigned long) __entry->parent, __entry->datasync) 776 (unsigned long) __entry->parent, __entry->datasync)
@@ -821,7 +793,7 @@ TRACE_EVENT(ext4_sync_file_exit,
821 __entry->dev = inode->i_sb->s_dev; 793 __entry->dev = inode->i_sb->s_dev;
822 ), 794 ),
823 795
824 TP_printk("dev %d,%d ino %ld ret %d", 796 TP_printk("dev %d,%d ino %lu ret %d",
825 MAJOR(__entry->dev), MINOR(__entry->dev), 797 MAJOR(__entry->dev), MINOR(__entry->dev),
826 (unsigned long) __entry->ino, 798 (unsigned long) __entry->ino,
827 __entry->ret) 799 __entry->ret)
@@ -1005,7 +977,7 @@ DECLARE_EVENT_CLASS(ext4__mballoc,
1005 __entry->result_len = len; 977 __entry->result_len = len;
1006 ), 978 ),
1007 979
1008 TP_printk("dev %d,%d inode %lu extent %u/%d/%u ", 980 TP_printk("dev %d,%d inode %lu extent %u/%d/%d ",
1009 MAJOR(__entry->dev), MINOR(__entry->dev), 981 MAJOR(__entry->dev), MINOR(__entry->dev),
1010 (unsigned long) __entry->ino, 982 (unsigned long) __entry->ino,
1011 __entry->result_group, __entry->result_start, 983 __entry->result_group, __entry->result_start,
@@ -1093,7 +1065,7 @@ TRACE_EVENT(ext4_da_update_reserve_space,
1093 "allocated_meta_blocks %d", 1065 "allocated_meta_blocks %d",
1094 MAJOR(__entry->dev), MINOR(__entry->dev), 1066 MAJOR(__entry->dev), MINOR(__entry->dev),
1095 (unsigned long) __entry->ino, 1067 (unsigned long) __entry->ino,
1096 __entry->mode, (unsigned long long) __entry->i_blocks, 1068 __entry->mode, __entry->i_blocks,
1097 __entry->used_blocks, __entry->reserved_data_blocks, 1069 __entry->used_blocks, __entry->reserved_data_blocks,
1098 __entry->reserved_meta_blocks, __entry->allocated_meta_blocks) 1070 __entry->reserved_meta_blocks, __entry->allocated_meta_blocks)
1099); 1071);
@@ -1127,7 +1099,7 @@ TRACE_EVENT(ext4_da_reserve_space,
1127 "reserved_data_blocks %d reserved_meta_blocks %d", 1099 "reserved_data_blocks %d reserved_meta_blocks %d",
1128 MAJOR(__entry->dev), MINOR(__entry->dev), 1100 MAJOR(__entry->dev), MINOR(__entry->dev),
1129 (unsigned long) __entry->ino, 1101 (unsigned long) __entry->ino,
1130 __entry->mode, (unsigned long long) __entry->i_blocks, 1102 __entry->mode, __entry->i_blocks,
1131 __entry->md_needed, __entry->reserved_data_blocks, 1103 __entry->md_needed, __entry->reserved_data_blocks,
1132 __entry->reserved_meta_blocks) 1104 __entry->reserved_meta_blocks)
1133); 1105);
@@ -1164,7 +1136,7 @@ TRACE_EVENT(ext4_da_release_space,
1164 "allocated_meta_blocks %d", 1136 "allocated_meta_blocks %d",
1165 MAJOR(__entry->dev), MINOR(__entry->dev), 1137 MAJOR(__entry->dev), MINOR(__entry->dev),
1166 (unsigned long) __entry->ino, 1138 (unsigned long) __entry->ino,
1167 __entry->mode, (unsigned long long) __entry->i_blocks, 1139 __entry->mode, __entry->i_blocks,
1168 __entry->freed_blocks, __entry->reserved_data_blocks, 1140 __entry->freed_blocks, __entry->reserved_data_blocks,
1169 __entry->reserved_meta_blocks, __entry->allocated_meta_blocks) 1141 __entry->reserved_meta_blocks, __entry->allocated_meta_blocks)
1170); 1142);
@@ -1239,14 +1211,15 @@ TRACE_EVENT(ext4_direct_IO_enter,
1239 __entry->rw = rw; 1211 __entry->rw = rw;
1240 ), 1212 ),
1241 1213
1242 TP_printk("dev %d,%d ino %lu pos %llu len %lu rw %d", 1214 TP_printk("dev %d,%d ino %lu pos %lld len %lu rw %d",
1243 MAJOR(__entry->dev), MINOR(__entry->dev), 1215 MAJOR(__entry->dev), MINOR(__entry->dev),
1244 (unsigned long) __entry->ino, 1216 (unsigned long) __entry->ino,
1245 (unsigned long long) __entry->pos, __entry->len, __entry->rw) 1217 __entry->pos, __entry->len, __entry->rw)
1246); 1218);
1247 1219
1248TRACE_EVENT(ext4_direct_IO_exit, 1220TRACE_EVENT(ext4_direct_IO_exit,
1249 TP_PROTO(struct inode *inode, loff_t offset, unsigned long len, int rw, int ret), 1221 TP_PROTO(struct inode *inode, loff_t offset, unsigned long len,
1222 int rw, int ret),
1250 1223
1251 TP_ARGS(inode, offset, len, rw, ret), 1224 TP_ARGS(inode, offset, len, rw, ret),
1252 1225
@@ -1268,10 +1241,10 @@ TRACE_EVENT(ext4_direct_IO_exit,
1268 __entry->ret = ret; 1241 __entry->ret = ret;
1269 ), 1242 ),
1270 1243
1271 TP_printk("dev %d,%d ino %lu pos %llu len %lu rw %d ret %d", 1244 TP_printk("dev %d,%d ino %lu pos %lld len %lu rw %d ret %d",
1272 MAJOR(__entry->dev), MINOR(__entry->dev), 1245 MAJOR(__entry->dev), MINOR(__entry->dev),
1273 (unsigned long) __entry->ino, 1246 (unsigned long) __entry->ino,
1274 (unsigned long long) __entry->pos, __entry->len, 1247 __entry->pos, __entry->len,
1275 __entry->rw, __entry->ret) 1248 __entry->rw, __entry->ret)
1276); 1249);
1277 1250
@@ -1296,15 +1269,15 @@ TRACE_EVENT(ext4_fallocate_enter,
1296 __entry->mode = mode; 1269 __entry->mode = mode;
1297 ), 1270 ),
1298 1271
1299 TP_printk("dev %d,%d ino %ld pos %llu len %llu mode %d", 1272 TP_printk("dev %d,%d ino %lu pos %lld len %lld mode %d",
1300 MAJOR(__entry->dev), MINOR(__entry->dev), 1273 MAJOR(__entry->dev), MINOR(__entry->dev),
1301 (unsigned long) __entry->ino, 1274 (unsigned long) __entry->ino, __entry->pos,
1302 (unsigned long long) __entry->pos, 1275 __entry->len, __entry->mode)
1303 (unsigned long long) __entry->len, __entry->mode)
1304); 1276);
1305 1277
1306TRACE_EVENT(ext4_fallocate_exit, 1278TRACE_EVENT(ext4_fallocate_exit,
1307 TP_PROTO(struct inode *inode, loff_t offset, unsigned int max_blocks, int ret), 1279 TP_PROTO(struct inode *inode, loff_t offset,
1280 unsigned int max_blocks, int ret),
1308 1281
1309 TP_ARGS(inode, offset, max_blocks, ret), 1282 TP_ARGS(inode, offset, max_blocks, ret),
1310 1283
@@ -1312,7 +1285,7 @@ TRACE_EVENT(ext4_fallocate_exit,
1312 __field( ino_t, ino ) 1285 __field( ino_t, ino )
1313 __field( dev_t, dev ) 1286 __field( dev_t, dev )
1314 __field( loff_t, pos ) 1287 __field( loff_t, pos )
1315 __field( unsigned, blocks ) 1288 __field( unsigned int, blocks )
1316 __field( int, ret ) 1289 __field( int, ret )
1317 ), 1290 ),
1318 1291
@@ -1324,10 +1297,10 @@ TRACE_EVENT(ext4_fallocate_exit,
1324 __entry->ret = ret; 1297 __entry->ret = ret;
1325 ), 1298 ),
1326 1299
1327 TP_printk("dev %d,%d ino %ld pos %llu blocks %d ret %d", 1300 TP_printk("dev %d,%d ino %lu pos %lld blocks %u ret %d",
1328 MAJOR(__entry->dev), MINOR(__entry->dev), 1301 MAJOR(__entry->dev), MINOR(__entry->dev),
1329 (unsigned long) __entry->ino, 1302 (unsigned long) __entry->ino,
1330 (unsigned long long) __entry->pos, __entry->blocks, 1303 __entry->pos, __entry->blocks,
1331 __entry->ret) 1304 __entry->ret)
1332); 1305);
1333 1306
@@ -1350,7 +1323,7 @@ TRACE_EVENT(ext4_unlink_enter,
1350 __entry->dev = dentry->d_inode->i_sb->s_dev; 1323 __entry->dev = dentry->d_inode->i_sb->s_dev;
1351 ), 1324 ),
1352 1325
1353 TP_printk("dev %d,%d ino %ld size %lld parent %ld", 1326 TP_printk("dev %d,%d ino %lu size %lld parent %lu",
1354 MAJOR(__entry->dev), MINOR(__entry->dev), 1327 MAJOR(__entry->dev), MINOR(__entry->dev),
1355 (unsigned long) __entry->ino, __entry->size, 1328 (unsigned long) __entry->ino, __entry->size,
1356 (unsigned long) __entry->parent) 1329 (unsigned long) __entry->parent)
@@ -1373,7 +1346,7 @@ TRACE_EVENT(ext4_unlink_exit,
1373 __entry->ret = ret; 1346 __entry->ret = ret;
1374 ), 1347 ),
1375 1348
1376 TP_printk("dev %d,%d ino %ld ret %d", 1349 TP_printk("dev %d,%d ino %lu ret %d",
1377 MAJOR(__entry->dev), MINOR(__entry->dev), 1350 MAJOR(__entry->dev), MINOR(__entry->dev),
1378 (unsigned long) __entry->ino, 1351 (unsigned long) __entry->ino,
1379 __entry->ret) 1352 __entry->ret)
@@ -1387,7 +1360,7 @@ DECLARE_EVENT_CLASS(ext4__truncate,
1387 TP_STRUCT__entry( 1360 TP_STRUCT__entry(
1388 __field( ino_t, ino ) 1361 __field( ino_t, ino )
1389 __field( dev_t, dev ) 1362 __field( dev_t, dev )
1390 __field( blkcnt_t, blocks ) 1363 __field( __u64, blocks )
1391 ), 1364 ),
1392 1365
1393 TP_fast_assign( 1366 TP_fast_assign(
@@ -1396,9 +1369,9 @@ DECLARE_EVENT_CLASS(ext4__truncate,
1396 __entry->blocks = inode->i_blocks; 1369 __entry->blocks = inode->i_blocks;
1397 ), 1370 ),
1398 1371
1399 TP_printk("dev %d,%d ino %lu blocks %lu", 1372 TP_printk("dev %d,%d ino %lu blocks %llu",
1400 MAJOR(__entry->dev), MINOR(__entry->dev), 1373 MAJOR(__entry->dev), MINOR(__entry->dev),
1401 (unsigned long) __entry->ino, (unsigned long) __entry->blocks) 1374 (unsigned long) __entry->ino, __entry->blocks)
1402); 1375);
1403 1376
1404DEFINE_EVENT(ext4__truncate, ext4_truncate_enter, 1377DEFINE_EVENT(ext4__truncate, ext4_truncate_enter,
@@ -1417,7 +1390,7 @@ DEFINE_EVENT(ext4__truncate, ext4_truncate_exit,
1417 1390
1418DECLARE_EVENT_CLASS(ext4__map_blocks_enter, 1391DECLARE_EVENT_CLASS(ext4__map_blocks_enter,
1419 TP_PROTO(struct inode *inode, ext4_lblk_t lblk, 1392 TP_PROTO(struct inode *inode, ext4_lblk_t lblk,
1420 unsigned len, unsigned flags), 1393 unsigned int len, unsigned int flags),
1421 1394
1422 TP_ARGS(inode, lblk, len, flags), 1395 TP_ARGS(inode, lblk, len, flags),
1423 1396
@@ -1425,8 +1398,8 @@ DECLARE_EVENT_CLASS(ext4__map_blocks_enter,
1425 __field( ino_t, ino ) 1398 __field( ino_t, ino )
1426 __field( dev_t, dev ) 1399 __field( dev_t, dev )
1427 __field( ext4_lblk_t, lblk ) 1400 __field( ext4_lblk_t, lblk )
1428 __field( unsigned, len ) 1401 __field( unsigned int, len )
1429 __field( unsigned, flags ) 1402 __field( unsigned int, flags )
1430 ), 1403 ),
1431 1404
1432 TP_fast_assign( 1405 TP_fast_assign(
@@ -1440,7 +1413,7 @@ DECLARE_EVENT_CLASS(ext4__map_blocks_enter,
1440 TP_printk("dev %d,%d ino %lu lblk %u len %u flags %u", 1413 TP_printk("dev %d,%d ino %lu lblk %u len %u flags %u",
1441 MAJOR(__entry->dev), MINOR(__entry->dev), 1414 MAJOR(__entry->dev), MINOR(__entry->dev),
1442 (unsigned long) __entry->ino, 1415 (unsigned long) __entry->ino,
1443 (unsigned) __entry->lblk, __entry->len, __entry->flags) 1416 __entry->lblk, __entry->len, __entry->flags)
1444); 1417);
1445 1418
1446DEFINE_EVENT(ext4__map_blocks_enter, ext4_ext_map_blocks_enter, 1419DEFINE_EVENT(ext4__map_blocks_enter, ext4_ext_map_blocks_enter,
@@ -1459,7 +1432,7 @@ DEFINE_EVENT(ext4__map_blocks_enter, ext4_ind_map_blocks_enter,
1459 1432
1460DECLARE_EVENT_CLASS(ext4__map_blocks_exit, 1433DECLARE_EVENT_CLASS(ext4__map_blocks_exit,
1461 TP_PROTO(struct inode *inode, ext4_lblk_t lblk, 1434 TP_PROTO(struct inode *inode, ext4_lblk_t lblk,
1462 ext4_fsblk_t pblk, unsigned len, int ret), 1435 ext4_fsblk_t pblk, unsigned int len, int ret),
1463 1436
1464 TP_ARGS(inode, lblk, pblk, len, ret), 1437 TP_ARGS(inode, lblk, pblk, len, ret),
1465 1438
@@ -1468,7 +1441,7 @@ DECLARE_EVENT_CLASS(ext4__map_blocks_exit,
1468 __field( dev_t, dev ) 1441 __field( dev_t, dev )
1469 __field( ext4_lblk_t, lblk ) 1442 __field( ext4_lblk_t, lblk )
1470 __field( ext4_fsblk_t, pblk ) 1443 __field( ext4_fsblk_t, pblk )
1471 __field( unsigned, len ) 1444 __field( unsigned int, len )
1472 __field( int, ret ) 1445 __field( int, ret )
1473 ), 1446 ),
1474 1447
@@ -1484,7 +1457,7 @@ DECLARE_EVENT_CLASS(ext4__map_blocks_exit,
1484 TP_printk("dev %d,%d ino %lu lblk %u pblk %llu len %u ret %d", 1457 TP_printk("dev %d,%d ino %lu lblk %u pblk %llu len %u ret %d",
1485 MAJOR(__entry->dev), MINOR(__entry->dev), 1458 MAJOR(__entry->dev), MINOR(__entry->dev),
1486 (unsigned long) __entry->ino, 1459 (unsigned long) __entry->ino,
1487 (unsigned) __entry->lblk, (unsigned long long) __entry->pblk, 1460 __entry->lblk, __entry->pblk,
1488 __entry->len, __entry->ret) 1461 __entry->len, __entry->ret)
1489); 1462);
1490 1463
@@ -1524,7 +1497,7 @@ TRACE_EVENT(ext4_ext_load_extent,
1524 TP_printk("dev %d,%d ino %lu lblk %u pblk %llu", 1497 TP_printk("dev %d,%d ino %lu lblk %u pblk %llu",
1525 MAJOR(__entry->dev), MINOR(__entry->dev), 1498 MAJOR(__entry->dev), MINOR(__entry->dev),
1526 (unsigned long) __entry->ino, 1499 (unsigned long) __entry->ino,
1527 (unsigned) __entry->lblk, (unsigned long long) __entry->pblk) 1500 __entry->lblk, __entry->pblk)
1528); 1501);
1529 1502
1530TRACE_EVENT(ext4_load_inode, 1503TRACE_EVENT(ext4_load_inode,
diff --git a/include/trace/events/irq.h b/include/trace/events/irq.h
index ae045ca7d356..1c09820df585 100644
--- a/include/trace/events/irq.h
+++ b/include/trace/events/irq.h
@@ -20,7 +20,8 @@ struct softirq_action;
20 softirq_name(BLOCK_IOPOLL), \ 20 softirq_name(BLOCK_IOPOLL), \
21 softirq_name(TASKLET), \ 21 softirq_name(TASKLET), \
22 softirq_name(SCHED), \ 22 softirq_name(SCHED), \
23 softirq_name(HRTIMER)) 23 softirq_name(HRTIMER), \
24 softirq_name(RCU))
24 25
25/** 26/**
26 * irq_handler_entry - called immediately before the irq action handler 27 * irq_handler_entry - called immediately before the irq action handler
diff --git a/include/trace/events/sock.h b/include/trace/events/sock.h
new file mode 100644
index 000000000000..779abb91df81
--- /dev/null
+++ b/include/trace/events/sock.h
@@ -0,0 +1,68 @@
1#undef TRACE_SYSTEM
2#define TRACE_SYSTEM sock
3
4#if !defined(_TRACE_SOCK_H) || defined(TRACE_HEADER_MULTI_READ)
5#define _TRACE_SOCK_H
6
7#include <net/sock.h>
8#include <linux/tracepoint.h>
9
10TRACE_EVENT(sock_rcvqueue_full,
11
12 TP_PROTO(struct sock *sk, struct sk_buff *skb),
13
14 TP_ARGS(sk, skb),
15
16 TP_STRUCT__entry(
17 __field(int, rmem_alloc)
18 __field(unsigned int, truesize)
19 __field(int, sk_rcvbuf)
20 ),
21
22 TP_fast_assign(
23 __entry->rmem_alloc = atomic_read(&sk->sk_rmem_alloc);
24 __entry->truesize = skb->truesize;
25 __entry->sk_rcvbuf = sk->sk_rcvbuf;
26 ),
27
28 TP_printk("rmem_alloc=%d truesize=%u sk_rcvbuf=%d",
29 __entry->rmem_alloc, __entry->truesize, __entry->sk_rcvbuf)
30);
31
32TRACE_EVENT(sock_exceed_buf_limit,
33
34 TP_PROTO(struct sock *sk, struct proto *prot, long allocated),
35
36 TP_ARGS(sk, prot, allocated),
37
38 TP_STRUCT__entry(
39 __array(char, name, 32)
40 __field(long *, sysctl_mem)
41 __field(long, allocated)
42 __field(int, sysctl_rmem)
43 __field(int, rmem_alloc)
44 ),
45
46 TP_fast_assign(
47 strncpy(__entry->name, prot->name, 32);
48 __entry->sysctl_mem = prot->sysctl_mem;
49 __entry->allocated = allocated;
50 __entry->sysctl_rmem = prot->sysctl_rmem[0];
51 __entry->rmem_alloc = atomic_read(&sk->sk_rmem_alloc);
52 ),
53
54 TP_printk("proto:%s sysctl_mem=%ld,%ld,%ld allocated=%ld "
55 "sysctl_rmem=%d rmem_alloc=%d",
56 __entry->name,
57 __entry->sysctl_mem[0],
58 __entry->sysctl_mem[1],
59 __entry->sysctl_mem[2],
60 __entry->allocated,
61 __entry->sysctl_rmem,
62 __entry->rmem_alloc)
63);
64
65#endif /* _TRACE_SOCK_H */
66
67/* This part must be outside protection */
68#include <trace/define_trace.h>
diff --git a/include/trace/events/udp.h b/include/trace/events/udp.h
new file mode 100644
index 000000000000..a664bb940973
--- /dev/null
+++ b/include/trace/events/udp.h
@@ -0,0 +1,32 @@
1#undef TRACE_SYSTEM
2#define TRACE_SYSTEM udp
3
4#if !defined(_TRACE_UDP_H) || defined(TRACE_HEADER_MULTI_READ)
5#define _TRACE_UDP_H
6
7#include <linux/udp.h>
8#include <linux/tracepoint.h>
9
10TRACE_EVENT(udp_fail_queue_rcv_skb,
11
12 TP_PROTO(int rc, struct sock *sk),
13
14 TP_ARGS(rc, sk),
15
16 TP_STRUCT__entry(
17 __field(int, rc)
18 __field(__u16, lport)
19 ),
20
21 TP_fast_assign(
22 __entry->rc = rc;
23 __entry->lport = inet_sk(sk)->inet_num;
24 ),
25
26 TP_printk("rc=%d port=%hu", __entry->rc, __entry->lport)
27);
28
29#endif /* _TRACE_UDP_H */
30
31/* This part must be outside protection */
32#include <trace/define_trace.h>
diff --git a/include/trace/events/vmscan.h b/include/trace/events/vmscan.h
index ea422aaa23e1..36851f7f13da 100644
--- a/include/trace/events/vmscan.h
+++ b/include/trace/events/vmscan.h
@@ -6,6 +6,8 @@
6 6
7#include <linux/types.h> 7#include <linux/types.h>
8#include <linux/tracepoint.h> 8#include <linux/tracepoint.h>
9#include <linux/mm.h>
10#include <linux/memcontrol.h>
9#include "gfpflags.h" 11#include "gfpflags.h"
10 12
11#define RECLAIM_WB_ANON 0x0001u 13#define RECLAIM_WB_ANON 0x0001u
@@ -177,6 +179,83 @@ DEFINE_EVENT(mm_vmscan_direct_reclaim_end_template, mm_vmscan_memcg_softlimit_re
177 TP_ARGS(nr_reclaimed) 179 TP_ARGS(nr_reclaimed)
178); 180);
179 181
182TRACE_EVENT(mm_shrink_slab_start,
183 TP_PROTO(struct shrinker *shr, struct shrink_control *sc,
184 long nr_objects_to_shrink, unsigned long pgs_scanned,
185 unsigned long lru_pgs, unsigned long cache_items,
186 unsigned long long delta, unsigned long total_scan),
187
188 TP_ARGS(shr, sc, nr_objects_to_shrink, pgs_scanned, lru_pgs,
189 cache_items, delta, total_scan),
190
191 TP_STRUCT__entry(
192 __field(struct shrinker *, shr)
193 __field(void *, shrink)
194 __field(long, nr_objects_to_shrink)
195 __field(gfp_t, gfp_flags)
196 __field(unsigned long, pgs_scanned)
197 __field(unsigned long, lru_pgs)
198 __field(unsigned long, cache_items)
199 __field(unsigned long long, delta)
200 __field(unsigned long, total_scan)
201 ),
202
203 TP_fast_assign(
204 __entry->shr = shr;
205 __entry->shrink = shr->shrink;
206 __entry->nr_objects_to_shrink = nr_objects_to_shrink;
207 __entry->gfp_flags = sc->gfp_mask;
208 __entry->pgs_scanned = pgs_scanned;
209 __entry->lru_pgs = lru_pgs;
210 __entry->cache_items = cache_items;
211 __entry->delta = delta;
212 __entry->total_scan = total_scan;
213 ),
214
215 TP_printk("%pF %p: objects to shrink %ld gfp_flags %s pgs_scanned %ld lru_pgs %ld cache items %ld delta %lld total_scan %ld",
216 __entry->shrink,
217 __entry->shr,
218 __entry->nr_objects_to_shrink,
219 show_gfp_flags(__entry->gfp_flags),
220 __entry->pgs_scanned,
221 __entry->lru_pgs,
222 __entry->cache_items,
223 __entry->delta,
224 __entry->total_scan)
225);
226
227TRACE_EVENT(mm_shrink_slab_end,
228 TP_PROTO(struct shrinker *shr, int shrinker_retval,
229 long unused_scan_cnt, long new_scan_cnt),
230
231 TP_ARGS(shr, shrinker_retval, unused_scan_cnt, new_scan_cnt),
232
233 TP_STRUCT__entry(
234 __field(struct shrinker *, shr)
235 __field(void *, shrink)
236 __field(long, unused_scan)
237 __field(long, new_scan)
238 __field(int, retval)
239 __field(long, total_scan)
240 ),
241
242 TP_fast_assign(
243 __entry->shr = shr;
244 __entry->shrink = shr->shrink;
245 __entry->unused_scan = unused_scan_cnt;
246 __entry->new_scan = new_scan_cnt;
247 __entry->retval = shrinker_retval;
248 __entry->total_scan = new_scan_cnt - unused_scan_cnt;
249 ),
250
251 TP_printk("%pF %p: unused scan count %ld new scan count %ld total_scan %ld last shrinker return val %d",
252 __entry->shrink,
253 __entry->shr,
254 __entry->unused_scan,
255 __entry->new_scan,
256 __entry->total_scan,
257 __entry->retval)
258);
180 259
181DECLARE_EVENT_CLASS(mm_vmscan_lru_isolate_template, 260DECLARE_EVENT_CLASS(mm_vmscan_lru_isolate_template,
182 261
@@ -310,6 +389,87 @@ TRACE_EVENT(mm_vmscan_lru_shrink_inactive,
310 show_reclaim_flags(__entry->reclaim_flags)) 389 show_reclaim_flags(__entry->reclaim_flags))
311); 390);
312 391
392TRACE_EVENT(replace_swap_token,
393 TP_PROTO(struct mm_struct *old_mm,
394 struct mm_struct *new_mm),
395
396 TP_ARGS(old_mm, new_mm),
397
398 TP_STRUCT__entry(
399 __field(struct mm_struct*, old_mm)
400 __field(unsigned int, old_prio)
401 __field(struct mm_struct*, new_mm)
402 __field(unsigned int, new_prio)
403 ),
404
405 TP_fast_assign(
406 __entry->old_mm = old_mm;
407 __entry->old_prio = old_mm ? old_mm->token_priority : 0;
408 __entry->new_mm = new_mm;
409 __entry->new_prio = new_mm->token_priority;
410 ),
411
412 TP_printk("old_token_mm=%p old_prio=%u new_token_mm=%p new_prio=%u",
413 __entry->old_mm, __entry->old_prio,
414 __entry->new_mm, __entry->new_prio)
415);
416
417DECLARE_EVENT_CLASS(put_swap_token_template,
418 TP_PROTO(struct mm_struct *swap_token_mm),
419
420 TP_ARGS(swap_token_mm),
421
422 TP_STRUCT__entry(
423 __field(struct mm_struct*, swap_token_mm)
424 ),
425
426 TP_fast_assign(
427 __entry->swap_token_mm = swap_token_mm;
428 ),
429
430 TP_printk("token_mm=%p", __entry->swap_token_mm)
431);
432
433DEFINE_EVENT(put_swap_token_template, put_swap_token,
434 TP_PROTO(struct mm_struct *swap_token_mm),
435 TP_ARGS(swap_token_mm)
436);
437
438DEFINE_EVENT_CONDITION(put_swap_token_template, disable_swap_token,
439 TP_PROTO(struct mm_struct *swap_token_mm),
440 TP_ARGS(swap_token_mm),
441 TP_CONDITION(swap_token_mm != NULL)
442);
443
444TRACE_EVENT_CONDITION(update_swap_token_priority,
445 TP_PROTO(struct mm_struct *mm,
446 unsigned int old_prio,
447 struct mm_struct *swap_token_mm),
448
449 TP_ARGS(mm, old_prio, swap_token_mm),
450
451 TP_CONDITION(mm->token_priority != old_prio),
452
453 TP_STRUCT__entry(
454 __field(struct mm_struct*, mm)
455 __field(unsigned int, old_prio)
456 __field(unsigned int, new_prio)
457 __field(struct mm_struct*, swap_token_mm)
458 __field(unsigned int, swap_token_prio)
459 ),
460
461 TP_fast_assign(
462 __entry->mm = mm;
463 __entry->old_prio = old_prio;
464 __entry->new_prio = mm->token_priority;
465 __entry->swap_token_mm = swap_token_mm;
466 __entry->swap_token_prio = swap_token_mm ? swap_token_mm->token_priority : 0;
467 ),
468
469 TP_printk("mm=%p old_prio=%u new_prio=%u swap_token_mm=%p token_prio=%u",
470 __entry->mm, __entry->old_prio, __entry->new_prio,
471 __entry->swap_token_mm, __entry->swap_token_prio)
472);
313 473
314#endif /* _TRACE_VMSCAN_H */ 474#endif /* _TRACE_VMSCAN_H */
315 475
diff --git a/include/trace/events/xen.h b/include/trace/events/xen.h
new file mode 100644
index 000000000000..44d8decee09e
--- /dev/null
+++ b/include/trace/events/xen.h
@@ -0,0 +1,504 @@
1#undef TRACE_SYSTEM
2#define TRACE_SYSTEM xen
3
4#if !defined(_TRACE_XEN_H) || defined(TRACE_HEADER_MULTI_READ)
5#define _TRACE_XEN_H
6
7#include <linux/tracepoint.h>
8#include <asm/paravirt_types.h>
9#include <asm/xen/trace_types.h>
10
11/* Multicalls */
12DECLARE_EVENT_CLASS(xen_mc__batch,
13 TP_PROTO(enum paravirt_lazy_mode mode),
14 TP_ARGS(mode),
15 TP_STRUCT__entry(
16 __field(enum paravirt_lazy_mode, mode)
17 ),
18 TP_fast_assign(__entry->mode = mode),
19 TP_printk("start batch LAZY_%s",
20 (__entry->mode == PARAVIRT_LAZY_MMU) ? "MMU" :
21 (__entry->mode == PARAVIRT_LAZY_CPU) ? "CPU" : "NONE")
22 );
23#define DEFINE_XEN_MC_BATCH(name) \
24 DEFINE_EVENT(xen_mc__batch, name, \
25 TP_PROTO(enum paravirt_lazy_mode mode), \
26 TP_ARGS(mode))
27
28DEFINE_XEN_MC_BATCH(xen_mc_batch);
29DEFINE_XEN_MC_BATCH(xen_mc_issue);
30
31TRACE_EVENT(xen_mc_entry,
32 TP_PROTO(struct multicall_entry *mc, unsigned nargs),
33 TP_ARGS(mc, nargs),
34 TP_STRUCT__entry(
35 __field(unsigned int, op)
36 __field(unsigned int, nargs)
37 __array(unsigned long, args, 6)
38 ),
39 TP_fast_assign(__entry->op = mc->op;
40 __entry->nargs = nargs;
41 memcpy(__entry->args, mc->args, sizeof(unsigned long) * nargs);
42 memset(__entry->args + nargs, 0, sizeof(unsigned long) * (6 - nargs));
43 ),
44 TP_printk("op %u%s args [%lx, %lx, %lx, %lx, %lx, %lx]",
45 __entry->op, xen_hypercall_name(__entry->op),
46 __entry->args[0], __entry->args[1], __entry->args[2],
47 __entry->args[3], __entry->args[4], __entry->args[5])
48 );
49
50TRACE_EVENT(xen_mc_entry_alloc,
51 TP_PROTO(size_t args),
52 TP_ARGS(args),
53 TP_STRUCT__entry(
54 __field(size_t, args)
55 ),
56 TP_fast_assign(__entry->args = args),
57 TP_printk("alloc entry %zu arg bytes", __entry->args)
58 );
59
60TRACE_EVENT(xen_mc_callback,
61 TP_PROTO(xen_mc_callback_fn_t fn, void *data),
62 TP_ARGS(fn, data),
63 TP_STRUCT__entry(
64 __field(xen_mc_callback_fn_t, fn)
65 __field(void *, data)
66 ),
67 TP_fast_assign(
68 __entry->fn = fn;
69 __entry->data = data;
70 ),
71 TP_printk("callback %pf, data %p",
72 __entry->fn, __entry->data)
73 );
74
75TRACE_EVENT(xen_mc_flush_reason,
76 TP_PROTO(enum xen_mc_flush_reason reason),
77 TP_ARGS(reason),
78 TP_STRUCT__entry(
79 __field(enum xen_mc_flush_reason, reason)
80 ),
81 TP_fast_assign(__entry->reason = reason),
82 TP_printk("flush reason %s",
83 (__entry->reason == XEN_MC_FL_NONE) ? "NONE" :
84 (__entry->reason == XEN_MC_FL_BATCH) ? "BATCH" :
85 (__entry->reason == XEN_MC_FL_ARGS) ? "ARGS" :
86 (__entry->reason == XEN_MC_FL_CALLBACK) ? "CALLBACK" : "??")
87 );
88
89TRACE_EVENT(xen_mc_flush,
90 TP_PROTO(unsigned mcidx, unsigned argidx, unsigned cbidx),
91 TP_ARGS(mcidx, argidx, cbidx),
92 TP_STRUCT__entry(
93 __field(unsigned, mcidx)
94 __field(unsigned, argidx)
95 __field(unsigned, cbidx)
96 ),
97 TP_fast_assign(__entry->mcidx = mcidx;
98 __entry->argidx = argidx;
99 __entry->cbidx = cbidx),
100 TP_printk("flushing %u hypercalls, %u arg bytes, %u callbacks",
101 __entry->mcidx, __entry->argidx, __entry->cbidx)
102 );
103
104TRACE_EVENT(xen_mc_extend_args,
105 TP_PROTO(unsigned long op, size_t args, enum xen_mc_extend_args res),
106 TP_ARGS(op, args, res),
107 TP_STRUCT__entry(
108 __field(unsigned int, op)
109 __field(size_t, args)
110 __field(enum xen_mc_extend_args, res)
111 ),
112 TP_fast_assign(__entry->op = op;
113 __entry->args = args;
114 __entry->res = res),
115 TP_printk("extending op %u%s by %zu bytes res %s",
116 __entry->op, xen_hypercall_name(__entry->op),
117 __entry->args,
118 __entry->res == XEN_MC_XE_OK ? "OK" :
119 __entry->res == XEN_MC_XE_BAD_OP ? "BAD_OP" :
120 __entry->res == XEN_MC_XE_NO_SPACE ? "NO_SPACE" : "???")
121 );
122
123/* mmu */
124DECLARE_EVENT_CLASS(xen_mmu__set_pte,
125 TP_PROTO(pte_t *ptep, pte_t pteval),
126 TP_ARGS(ptep, pteval),
127 TP_STRUCT__entry(
128 __field(pte_t *, ptep)
129 __field(pteval_t, pteval)
130 ),
131 TP_fast_assign(__entry->ptep = ptep;
132 __entry->pteval = pteval.pte),
133 TP_printk("ptep %p pteval %0*llx (raw %0*llx)",
134 __entry->ptep,
135 (int)sizeof(pteval_t) * 2, (unsigned long long)pte_val(native_make_pte(__entry->pteval)),
136 (int)sizeof(pteval_t) * 2, (unsigned long long)__entry->pteval)
137 );
138
139#define DEFINE_XEN_MMU_SET_PTE(name) \
140 DEFINE_EVENT(xen_mmu__set_pte, name, \
141 TP_PROTO(pte_t *ptep, pte_t pteval), \
142 TP_ARGS(ptep, pteval))
143
144DEFINE_XEN_MMU_SET_PTE(xen_mmu_set_pte);
145DEFINE_XEN_MMU_SET_PTE(xen_mmu_set_pte_atomic);
146
147TRACE_EVENT(xen_mmu_set_domain_pte,
148 TP_PROTO(pte_t *ptep, pte_t pteval, unsigned domid),
149 TP_ARGS(ptep, pteval, domid),
150 TP_STRUCT__entry(
151 __field(pte_t *, ptep)
152 __field(pteval_t, pteval)
153 __field(unsigned, domid)
154 ),
155 TP_fast_assign(__entry->ptep = ptep;
156 __entry->pteval = pteval.pte;
157 __entry->domid = domid),
158 TP_printk("ptep %p pteval %0*llx (raw %0*llx) domid %u",
159 __entry->ptep,
160 (int)sizeof(pteval_t) * 2, (unsigned long long)pte_val(native_make_pte(__entry->pteval)),
161 (int)sizeof(pteval_t) * 2, (unsigned long long)__entry->pteval,
162 __entry->domid)
163 );
164
165TRACE_EVENT(xen_mmu_set_pte_at,
166 TP_PROTO(struct mm_struct *mm, unsigned long addr,
167 pte_t *ptep, pte_t pteval),
168 TP_ARGS(mm, addr, ptep, pteval),
169 TP_STRUCT__entry(
170 __field(struct mm_struct *, mm)
171 __field(unsigned long, addr)
172 __field(pte_t *, ptep)
173 __field(pteval_t, pteval)
174 ),
175 TP_fast_assign(__entry->mm = mm;
176 __entry->addr = addr;
177 __entry->ptep = ptep;
178 __entry->pteval = pteval.pte),
179 TP_printk("mm %p addr %lx ptep %p pteval %0*llx (raw %0*llx)",
180 __entry->mm, __entry->addr, __entry->ptep,
181 (int)sizeof(pteval_t) * 2, (unsigned long long)pte_val(native_make_pte(__entry->pteval)),
182 (int)sizeof(pteval_t) * 2, (unsigned long long)__entry->pteval)
183 );
184
185TRACE_EVENT(xen_mmu_pte_clear,
186 TP_PROTO(struct mm_struct *mm, unsigned long addr, pte_t *ptep),
187 TP_ARGS(mm, addr, ptep),
188 TP_STRUCT__entry(
189 __field(struct mm_struct *, mm)
190 __field(unsigned long, addr)
191 __field(pte_t *, ptep)
192 ),
193 TP_fast_assign(__entry->mm = mm;
194 __entry->addr = addr;
195 __entry->ptep = ptep),
196 TP_printk("mm %p addr %lx ptep %p",
197 __entry->mm, __entry->addr, __entry->ptep)
198 );
199
200TRACE_EVENT(xen_mmu_set_pmd,
201 TP_PROTO(pmd_t *pmdp, pmd_t pmdval),
202 TP_ARGS(pmdp, pmdval),
203 TP_STRUCT__entry(
204 __field(pmd_t *, pmdp)
205 __field(pmdval_t, pmdval)
206 ),
207 TP_fast_assign(__entry->pmdp = pmdp;
208 __entry->pmdval = pmdval.pmd),
209 TP_printk("pmdp %p pmdval %0*llx (raw %0*llx)",
210 __entry->pmdp,
211 (int)sizeof(pmdval_t) * 2, (unsigned long long)pmd_val(native_make_pmd(__entry->pmdval)),
212 (int)sizeof(pmdval_t) * 2, (unsigned long long)__entry->pmdval)
213 );
214
215TRACE_EVENT(xen_mmu_pmd_clear,
216 TP_PROTO(pmd_t *pmdp),
217 TP_ARGS(pmdp),
218 TP_STRUCT__entry(
219 __field(pmd_t *, pmdp)
220 ),
221 TP_fast_assign(__entry->pmdp = pmdp),
222 TP_printk("pmdp %p", __entry->pmdp)
223 );
224
225#if PAGETABLE_LEVELS >= 4
226
227TRACE_EVENT(xen_mmu_set_pud,
228 TP_PROTO(pud_t *pudp, pud_t pudval),
229 TP_ARGS(pudp, pudval),
230 TP_STRUCT__entry(
231 __field(pud_t *, pudp)
232 __field(pudval_t, pudval)
233 ),
234 TP_fast_assign(__entry->pudp = pudp;
235 __entry->pudval = native_pud_val(pudval)),
236 TP_printk("pudp %p pudval %0*llx (raw %0*llx)",
237 __entry->pudp,
238 (int)sizeof(pudval_t) * 2, (unsigned long long)pud_val(native_make_pud(__entry->pudval)),
239 (int)sizeof(pudval_t) * 2, (unsigned long long)__entry->pudval)
240 );
241
242TRACE_EVENT(xen_mmu_set_pgd,
243 TP_PROTO(pgd_t *pgdp, pgd_t *user_pgdp, pgd_t pgdval),
244 TP_ARGS(pgdp, user_pgdp, pgdval),
245 TP_STRUCT__entry(
246 __field(pgd_t *, pgdp)
247 __field(pgd_t *, user_pgdp)
248 __field(pgdval_t, pgdval)
249 ),
250 TP_fast_assign(__entry->pgdp = pgdp;
251 __entry->user_pgdp = user_pgdp;
252 __entry->pgdval = pgdval.pgd),
253 TP_printk("pgdp %p user_pgdp %p pgdval %0*llx (raw %0*llx)",
254 __entry->pgdp, __entry->user_pgdp,
255 (int)sizeof(pgdval_t) * 2, (unsigned long long)pgd_val(native_make_pgd(__entry->pgdval)),
256 (int)sizeof(pgdval_t) * 2, (unsigned long long)__entry->pgdval)
257 );
258
259TRACE_EVENT(xen_mmu_pud_clear,
260 TP_PROTO(pud_t *pudp),
261 TP_ARGS(pudp),
262 TP_STRUCT__entry(
263 __field(pud_t *, pudp)
264 ),
265 TP_fast_assign(__entry->pudp = pudp),
266 TP_printk("pudp %p", __entry->pudp)
267 );
268#else
269
270TRACE_EVENT(xen_mmu_set_pud,
271 TP_PROTO(pud_t *pudp, pud_t pudval),
272 TP_ARGS(pudp, pudval),
273 TP_STRUCT__entry(
274 __field(pud_t *, pudp)
275 __field(pudval_t, pudval)
276 ),
277 TP_fast_assign(__entry->pudp = pudp;
278 __entry->pudval = native_pud_val(pudval)),
279 TP_printk("pudp %p pudval %0*llx (raw %0*llx)",
280 __entry->pudp,
281 (int)sizeof(pudval_t) * 2, (unsigned long long)pgd_val(native_make_pgd(__entry->pudval)),
282 (int)sizeof(pudval_t) * 2, (unsigned long long)__entry->pudval)
283 );
284
285#endif
286
287TRACE_EVENT(xen_mmu_pgd_clear,
288 TP_PROTO(pgd_t *pgdp),
289 TP_ARGS(pgdp),
290 TP_STRUCT__entry(
291 __field(pgd_t *, pgdp)
292 ),
293 TP_fast_assign(__entry->pgdp = pgdp),
294 TP_printk("pgdp %p", __entry->pgdp)
295 );
296
297DECLARE_EVENT_CLASS(xen_mmu_ptep_modify_prot,
298 TP_PROTO(struct mm_struct *mm, unsigned long addr,
299 pte_t *ptep, pte_t pteval),
300 TP_ARGS(mm, addr, ptep, pteval),
301 TP_STRUCT__entry(
302 __field(struct mm_struct *, mm)
303 __field(unsigned long, addr)
304 __field(pte_t *, ptep)
305 __field(pteval_t, pteval)
306 ),
307 TP_fast_assign(__entry->mm = mm;
308 __entry->addr = addr;
309 __entry->ptep = ptep;
310 __entry->pteval = pteval.pte),
311 TP_printk("mm %p addr %lx ptep %p pteval %0*llx (raw %0*llx)",
312 __entry->mm, __entry->addr, __entry->ptep,
313 (int)sizeof(pteval_t) * 2, (unsigned long long)pte_val(native_make_pte(__entry->pteval)),
314 (int)sizeof(pteval_t) * 2, (unsigned long long)__entry->pteval)
315 );
316#define DEFINE_XEN_MMU_PTEP_MODIFY_PROT(name) \
317 DEFINE_EVENT(xen_mmu_ptep_modify_prot, name, \
318 TP_PROTO(struct mm_struct *mm, unsigned long addr, \
319 pte_t *ptep, pte_t pteval), \
320 TP_ARGS(mm, addr, ptep, pteval))
321
322DEFINE_XEN_MMU_PTEP_MODIFY_PROT(xen_mmu_ptep_modify_prot_start);
323DEFINE_XEN_MMU_PTEP_MODIFY_PROT(xen_mmu_ptep_modify_prot_commit);
324
325TRACE_EVENT(xen_mmu_alloc_ptpage,
326 TP_PROTO(struct mm_struct *mm, unsigned long pfn, unsigned level, bool pinned),
327 TP_ARGS(mm, pfn, level, pinned),
328 TP_STRUCT__entry(
329 __field(struct mm_struct *, mm)
330 __field(unsigned long, pfn)
331 __field(unsigned, level)
332 __field(bool, pinned)
333 ),
334 TP_fast_assign(__entry->mm = mm;
335 __entry->pfn = pfn;
336 __entry->level = level;
337 __entry->pinned = pinned),
338 TP_printk("mm %p pfn %lx level %d %spinned",
339 __entry->mm, __entry->pfn, __entry->level,
340 __entry->pinned ? "" : "un")
341 );
342
343TRACE_EVENT(xen_mmu_release_ptpage,
344 TP_PROTO(unsigned long pfn, unsigned level, bool pinned),
345 TP_ARGS(pfn, level, pinned),
346 TP_STRUCT__entry(
347 __field(unsigned long, pfn)
348 __field(unsigned, level)
349 __field(bool, pinned)
350 ),
351 TP_fast_assign(__entry->pfn = pfn;
352 __entry->level = level;
353 __entry->pinned = pinned),
354 TP_printk("pfn %lx level %d %spinned",
355 __entry->pfn, __entry->level,
356 __entry->pinned ? "" : "un")
357 );
358
359DECLARE_EVENT_CLASS(xen_mmu_pgd,
360 TP_PROTO(struct mm_struct *mm, pgd_t *pgd),
361 TP_ARGS(mm, pgd),
362 TP_STRUCT__entry(
363 __field(struct mm_struct *, mm)
364 __field(pgd_t *, pgd)
365 ),
366 TP_fast_assign(__entry->mm = mm;
367 __entry->pgd = pgd),
368 TP_printk("mm %p pgd %p", __entry->mm, __entry->pgd)
369 );
370#define DEFINE_XEN_MMU_PGD_EVENT(name) \
371 DEFINE_EVENT(xen_mmu_pgd, name, \
372 TP_PROTO(struct mm_struct *mm, pgd_t *pgd), \
373 TP_ARGS(mm, pgd))
374
375DEFINE_XEN_MMU_PGD_EVENT(xen_mmu_pgd_pin);
376DEFINE_XEN_MMU_PGD_EVENT(xen_mmu_pgd_unpin);
377
378TRACE_EVENT(xen_mmu_flush_tlb,
379 TP_PROTO(int x),
380 TP_ARGS(x),
381 TP_STRUCT__entry(__array(char, x, 0)),
382 TP_fast_assign((void)x),
383 TP_printk("%s", "")
384 );
385
386TRACE_EVENT(xen_mmu_flush_tlb_single,
387 TP_PROTO(unsigned long addr),
388 TP_ARGS(addr),
389 TP_STRUCT__entry(
390 __field(unsigned long, addr)
391 ),
392 TP_fast_assign(__entry->addr = addr),
393 TP_printk("addr %lx", __entry->addr)
394 );
395
396TRACE_EVENT(xen_mmu_flush_tlb_others,
397 TP_PROTO(const struct cpumask *cpus, struct mm_struct *mm,
398 unsigned long addr),
399 TP_ARGS(cpus, mm, addr),
400 TP_STRUCT__entry(
401 __field(unsigned, ncpus)
402 __field(struct mm_struct *, mm)
403 __field(unsigned long, addr)
404 ),
405 TP_fast_assign(__entry->ncpus = cpumask_weight(cpus);
406 __entry->mm = mm;
407 __entry->addr = addr),
408 TP_printk("ncpus %d mm %p addr %lx",
409 __entry->ncpus, __entry->mm, __entry->addr)
410 );
411
412TRACE_EVENT(xen_mmu_write_cr3,
413 TP_PROTO(bool kernel, unsigned long cr3),
414 TP_ARGS(kernel, cr3),
415 TP_STRUCT__entry(
416 __field(bool, kernel)
417 __field(unsigned long, cr3)
418 ),
419 TP_fast_assign(__entry->kernel = kernel;
420 __entry->cr3 = cr3),
421 TP_printk("%s cr3 %lx",
422 __entry->kernel ? "kernel" : "user", __entry->cr3)
423 );
424
425
426/* CPU */
427TRACE_EVENT(xen_cpu_write_ldt_entry,
428 TP_PROTO(struct desc_struct *dt, int entrynum, u64 desc),
429 TP_ARGS(dt, entrynum, desc),
430 TP_STRUCT__entry(
431 __field(struct desc_struct *, dt)
432 __field(int, entrynum)
433 __field(u64, desc)
434 ),
435 TP_fast_assign(__entry->dt = dt;
436 __entry->entrynum = entrynum;
437 __entry->desc = desc;
438 ),
439 TP_printk("dt %p entrynum %d entry %016llx",
440 __entry->dt, __entry->entrynum,
441 (unsigned long long)__entry->desc)
442 );
443
444TRACE_EVENT(xen_cpu_write_idt_entry,
445 TP_PROTO(gate_desc *dt, int entrynum, const gate_desc *ent),
446 TP_ARGS(dt, entrynum, ent),
447 TP_STRUCT__entry(
448 __field(gate_desc *, dt)
449 __field(int, entrynum)
450 ),
451 TP_fast_assign(__entry->dt = dt;
452 __entry->entrynum = entrynum;
453 ),
454 TP_printk("dt %p entrynum %d",
455 __entry->dt, __entry->entrynum)
456 );
457
458TRACE_EVENT(xen_cpu_load_idt,
459 TP_PROTO(const struct desc_ptr *desc),
460 TP_ARGS(desc),
461 TP_STRUCT__entry(
462 __field(unsigned long, addr)
463 ),
464 TP_fast_assign(__entry->addr = desc->address),
465 TP_printk("addr %lx", __entry->addr)
466 );
467
468TRACE_EVENT(xen_cpu_write_gdt_entry,
469 TP_PROTO(struct desc_struct *dt, int entrynum, const void *desc, int type),
470 TP_ARGS(dt, entrynum, desc, type),
471 TP_STRUCT__entry(
472 __field(u64, desc)
473 __field(struct desc_struct *, dt)
474 __field(int, entrynum)
475 __field(int, type)
476 ),
477 TP_fast_assign(__entry->dt = dt;
478 __entry->entrynum = entrynum;
479 __entry->desc = *(u64 *)desc;
480 __entry->type = type;
481 ),
482 TP_printk("dt %p entrynum %d type %d desc %016llx",
483 __entry->dt, __entry->entrynum, __entry->type,
484 (unsigned long long)__entry->desc)
485 );
486
487TRACE_EVENT(xen_cpu_set_ldt,
488 TP_PROTO(const void *addr, unsigned entries),
489 TP_ARGS(addr, entries),
490 TP_STRUCT__entry(
491 __field(const void *, addr)
492 __field(unsigned, entries)
493 ),
494 TP_fast_assign(__entry->addr = addr;
495 __entry->entries = entries),
496 TP_printk("addr %p entries %u",
497 __entry->addr, __entry->entries)
498 );
499
500
501#endif /* _TRACE_XEN_H */
502
503/* This part must be outside protection */
504#include <trace/define_trace.h>
diff --git a/include/xen/balloon.h b/include/xen/balloon.h
index a2b22f01a51d..76f7538bb339 100644
--- a/include/xen/balloon.h
+++ b/include/xen/balloon.h
@@ -15,6 +15,10 @@ struct balloon_stats {
15 unsigned long max_schedule_delay; 15 unsigned long max_schedule_delay;
16 unsigned long retry_count; 16 unsigned long retry_count;
17 unsigned long max_retry_count; 17 unsigned long max_retry_count;
18#ifdef CONFIG_XEN_BALLOON_MEMORY_HOTPLUG
19 unsigned long hotplug_pages;
20 unsigned long balloon_hotplug;
21#endif
18}; 22};
19 23
20extern struct balloon_stats balloon_stats; 24extern struct balloon_stats balloon_stats;
@@ -23,3 +27,13 @@ void balloon_set_new_target(unsigned long target);
23 27
24int alloc_xenballooned_pages(int nr_pages, struct page** pages); 28int alloc_xenballooned_pages(int nr_pages, struct page** pages);
25void free_xenballooned_pages(int nr_pages, struct page** pages); 29void free_xenballooned_pages(int nr_pages, struct page** pages);
30
31struct sys_device;
32#ifdef CONFIG_XEN_SELFBALLOONING
33extern int register_xen_selfballooning(struct sys_device *sysdev);
34#else
35static inline int register_xen_selfballooning(struct sys_device *sysdev)
36{
37 return -ENOSYS;
38}
39#endif
diff --git a/include/xen/events.h b/include/xen/events.h
index 9af21e19545a..d287997d3eab 100644
--- a/include/xen/events.h
+++ b/include/xen/events.h
@@ -74,8 +74,6 @@ int xen_set_callback_via(uint64_t via);
74void xen_evtchn_do_upcall(struct pt_regs *regs); 74void xen_evtchn_do_upcall(struct pt_regs *regs);
75void xen_hvm_evtchn_do_upcall(void); 75void xen_hvm_evtchn_do_upcall(void);
76 76
77/* Allocate a pirq for a physical interrupt, given a gsi. */
78int xen_allocate_pirq_gsi(unsigned gsi);
79/* Bind a pirq for a physical interrupt to an irq. */ 77/* Bind a pirq for a physical interrupt to an irq. */
80int xen_bind_pirq_gsi_to_irq(unsigned gsi, 78int xen_bind_pirq_gsi_to_irq(unsigned gsi,
81 unsigned pirq, int shareable, char *name); 79 unsigned pirq, int shareable, char *name);
diff --git a/include/xen/hvc-console.h b/include/xen/hvc-console.h
index c3adde32669b..901724dc528d 100644
--- a/include/xen/hvc-console.h
+++ b/include/xen/hvc-console.h
@@ -6,11 +6,13 @@ extern struct console xenboot_console;
6#ifdef CONFIG_HVC_XEN 6#ifdef CONFIG_HVC_XEN
7void xen_console_resume(void); 7void xen_console_resume(void);
8void xen_raw_console_write(const char *str); 8void xen_raw_console_write(const char *str);
9__attribute__((format(printf, 1, 2)))
9void xen_raw_printk(const char *fmt, ...); 10void xen_raw_printk(const char *fmt, ...);
10#else 11#else
11static inline void xen_console_resume(void) { } 12static inline void xen_console_resume(void) { }
12static inline void xen_raw_console_write(const char *str) { } 13static inline void xen_raw_console_write(const char *str) { }
13static inline void xen_raw_printk(const char *fmt, ...) { } 14static inline __attribute__((format(printf, 1, 2)))
15void xen_raw_printk(const char *fmt, ...) { }
14#endif 16#endif
15 17
16#endif /* XEN_HVC_CONSOLE_H */ 18#endif /* XEN_HVC_CONSOLE_H */
diff --git a/include/xen/interface/xen.h b/include/xen/interface/xen.h
index 70213b4515eb..6acd9cefd517 100644
--- a/include/xen/interface/xen.h
+++ b/include/xen/interface/xen.h
@@ -450,6 +450,45 @@ struct start_info {
450 int8_t cmd_line[MAX_GUEST_CMDLINE]; 450 int8_t cmd_line[MAX_GUEST_CMDLINE];
451}; 451};
452 452
453struct dom0_vga_console_info {
454 uint8_t video_type;
455#define XEN_VGATYPE_TEXT_MODE_3 0x03
456#define XEN_VGATYPE_VESA_LFB 0x23
457
458 union {
459 struct {
460 /* Font height, in pixels. */
461 uint16_t font_height;
462 /* Cursor location (column, row). */
463 uint16_t cursor_x, cursor_y;
464 /* Number of rows and columns (dimensions in characters). */
465 uint16_t rows, columns;
466 } text_mode_3;
467
468 struct {
469 /* Width and height, in pixels. */
470 uint16_t width, height;
471 /* Bytes per scan line. */
472 uint16_t bytes_per_line;
473 /* Bits per pixel. */
474 uint16_t bits_per_pixel;
475 /* LFB physical address, and size (in units of 64kB). */
476 uint32_t lfb_base;
477 uint32_t lfb_size;
478 /* RGB mask offsets and sizes, as defined by VBE 1.2+ */
479 uint8_t red_pos, red_size;
480 uint8_t green_pos, green_size;
481 uint8_t blue_pos, blue_size;
482 uint8_t rsvd_pos, rsvd_size;
483
484 /* VESA capabilities (offset 0xa, VESA command 0x4f00). */
485 uint32_t gbl_caps;
486 /* Mode attributes (offset 0x0, VESA command 0x4f01). */
487 uint16_t mode_attrs;
488 } vesa_lfb;
489 } u;
490};
491
453/* These flags are passed in the 'flags' field of start_info_t. */ 492/* These flags are passed in the 'flags' field of start_info_t. */
454#define SIF_PRIVILEGED (1<<0) /* Is the domain privileged? */ 493#define SIF_PRIVILEGED (1<<0) /* Is the domain privileged? */
455#define SIF_INITDOMAIN (1<<1) /* Is this the initial control domain? */ 494#define SIF_INITDOMAIN (1<<1) /* Is this the initial control domain? */
diff --git a/include/xen/tmem.h b/include/xen/tmem.h
new file mode 100644
index 000000000000..82e2c83a32f5
--- /dev/null
+++ b/include/xen/tmem.h
@@ -0,0 +1,5 @@
1#ifndef _XEN_TMEM_H
2#define _XEN_TMEM_H
3/* defined in drivers/xen/tmem.c */
4extern int tmem_enabled;
5#endif /* _XEN_TMEM_H */
diff --git a/include/xen/xenbus.h b/include/xen/xenbus.h
index 5467369e0889..aceeca799fd7 100644
--- a/include/xen/xenbus.h
+++ b/include/xen/xenbus.h
@@ -223,7 +223,9 @@ int xenbus_free_evtchn(struct xenbus_device *dev, int port);
223 223
224enum xenbus_state xenbus_read_driver_state(const char *path); 224enum xenbus_state xenbus_read_driver_state(const char *path);
225 225
226__attribute__((format(printf, 3, 4)))
226void xenbus_dev_error(struct xenbus_device *dev, int err, const char *fmt, ...); 227void xenbus_dev_error(struct xenbus_device *dev, int err, const char *fmt, ...);
228__attribute__((format(printf, 3, 4)))
227void xenbus_dev_fatal(struct xenbus_device *dev, int err, const char *fmt, ...); 229void xenbus_dev_fatal(struct xenbus_device *dev, int err, const char *fmt, ...);
228 230
229const char *xenbus_strstate(enum xenbus_state state); 231const char *xenbus_strstate(enum xenbus_state state);