aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/acpi.h8
-rw-r--r--include/linux/ahci_platform.h29
-rw-r--r--include/linux/aio.h5
-rw-r--r--include/linux/altera_jtaguart.h16
-rw-r--r--include/linux/altera_uart.h14
-rw-r--r--include/linux/amba/mmci.h23
-rw-r--r--include/linux/amba/pl022.h32
-rw-r--r--include/linux/amba/pl330.h45
-rw-r--r--include/linux/ata.h2
-rw-r--r--include/linux/backing-dev.h8
-rw-r--r--include/linux/bitops.h30
-rw-r--r--include/linux/blkdev.h72
-rw-r--r--include/linux/buffer_head.h11
-rw-r--r--include/linux/can/platform/sja1000.h2
-rw-r--r--include/linux/cgroup.h3
-rw-r--r--include/linux/clocksource.h19
-rw-r--r--include/linux/coda_psdev.h3
-rw-r--r--include/linux/compaction.h89
-rw-r--r--include/linux/compat.h4
-rw-r--r--include/linux/completion.h2
-rw-r--r--include/linux/cper.h314
-rw-r--r--include/linux/cpufreq.h30
-rw-r--r--include/linux/cpuidle.h8
-rw-r--r--include/linux/cpuset.h65
-rw-r--r--include/linux/cred.h1
-rw-r--r--include/linux/crypto.h6
-rw-r--r--include/linux/dcache.h14
-rw-r--r--include/linux/debugfs.h2
-rw-r--r--include/linux/debugobjects.h11
-rw-r--r--include/linux/device.h24
-rw-r--r--include/linux/dma-mapping.h25
-rw-r--r--include/linux/dmaengine.h127
-rw-r--r--include/linux/dqblk_xfs.h9
-rw-r--r--include/linux/drbd.h5
-rw-r--r--include/linux/drbd_limits.h16
-rw-r--r--include/linux/drbd_nl.h5
-rw-r--r--include/linux/ds2782_battery.h8
-rw-r--r--include/linux/dynamic_debug.h2
-rw-r--r--include/linux/elevator.h6
-rw-r--r--include/linux/elf.h1
-rw-r--r--include/linux/elfcore.h4
-rw-r--r--include/linux/err.h10
-rw-r--r--include/linux/ext2_fs_sb.h9
-rw-r--r--include/linux/ext3_fs.h2
-rw-r--r--include/linux/fb.h26
-rw-r--r--include/linux/fcntl.h6
-rw-r--r--include/linux/fec.h21
-rw-r--r--include/linux/file.h1
-rw-r--r--include/linux/firewire-cdev.h2
-rw-r--r--include/linux/firewire-constants.h2
-rw-r--r--include/linux/firewire.h5
-rw-r--r--include/linux/firmware.h1
-rw-r--r--include/linux/fs.h76
-rw-r--r--include/linux/ftrace.h61
-rw-r--r--include/linux/ftrace_event.h107
-rw-r--r--include/linux/fuse.h5
-rw-r--r--include/linux/generic_acl.h4
-rw-r--r--include/linux/gfp.h18
-rw-r--r--include/linux/gpio.h5
-rw-r--r--include/linux/gsmmux.h25
-rw-r--r--include/linux/hdpu_features.h26
-rw-r--r--include/linux/hid.h10
-rw-r--r--include/linux/highmem.h2
-rw-r--r--include/linux/hrtimer.h2
-rw-r--r--include/linux/hw_breakpoint.h25
-rw-r--r--include/linux/i2c-omap.h9
-rw-r--r--include/linux/i2c.h6
-rw-r--r--include/linux/i2c/adp8860.h154
-rw-r--r--include/linux/i2c/max732x.h3
-rw-r--r--include/linux/i2c/pca953x.h2
-rw-r--r--include/linux/i2c/twl.h14
-rw-r--r--include/linux/ide.h6
-rw-r--r--include/linux/if_link.h98
-rw-r--r--include/linux/if_macvlan.h3
-rw-r--r--include/linux/init_task.h14
-rw-r--r--include/linux/input.h13
-rw-r--r--include/linux/input/ad714x.h63
-rw-r--r--include/linux/input/tps6507x-ts.h24
-rw-r--r--include/linux/interrupt.h32
-rw-r--r--include/linux/iommu.h24
-rw-r--r--include/linux/ioport.h4
-rw-r--r--include/linux/ipv6.h2
-rw-r--r--include/linux/irq.h1
-rw-r--r--include/linux/isapnp.h8
-rw-r--r--include/linux/ivtvfb.h1
-rw-r--r--include/linux/jbd.h3
-rw-r--r--include/linux/jffs2.h4
-rw-r--r--include/linux/joystick.h4
-rw-r--r--include/linux/kdb.h117
-rw-r--r--include/linux/kernel.h43
-rw-r--r--include/linux/kfifo.h4
-rw-r--r--include/linux/kgdb.h55
-rw-r--r--include/linux/kmod.h64
-rw-r--r--include/linux/kobj_map.h9
-rw-r--r--include/linux/kobject.h38
-rw-r--r--include/linux/kref.h3
-rw-r--r--include/linux/ktime.h10
-rw-r--r--include/linux/kvm.h26
-rw-r--r--include/linux/kvm_host.h23
-rw-r--r--include/linux/lcd.h23
-rw-r--r--include/linux/leds.h12
-rw-r--r--include/linux/libata.h116
-rw-r--r--include/linux/lis3lv02d.h12
-rw-r--r--include/linux/lockdep.h8
-rw-r--r--include/linux/lsm_audit.h2
-rw-r--r--include/linux/matroxfb.h3
-rw-r--r--include/linux/memcontrol.h19
-rw-r--r--include/linux/memory_hotplug.h1
-rw-r--r--include/linux/mempolicy.h15
-rw-r--r--include/linux/meye.h12
-rw-r--r--include/linux/mfd/88pm860x.h7
-rw-r--r--include/linux/mfd/ab4500.h262
-rw-r--r--include/linux/mfd/ab8500.h128
-rw-r--r--include/linux/mfd/abx500.h (renamed from include/linux/mfd/ab3100.h)134
-rw-r--r--include/linux/mfd/davinci_voicecodec.h126
-rw-r--r--include/linux/mfd/janz.h54
-rw-r--r--include/linux/mfd/mc13783.h66
-rw-r--r--include/linux/mfd/pcf50633/backlight.h51
-rw-r--r--include/linux/mfd/pcf50633/core.h4
-rw-r--r--include/linux/mfd/rdc321x.h26
-rw-r--r--include/linux/mfd/sh_mobile_sdhi.h6
-rw-r--r--include/linux/mfd/tc35892.h132
-rw-r--r--include/linux/mfd/tmio.h11
-rw-r--r--include/linux/mfd/tps6507x.h169
-rw-r--r--include/linux/mfd/wm831x/core.h5
-rw-r--r--include/linux/mfd/wm8350/audio.h2
-rw-r--r--include/linux/mfd/wm8994/core.h53
-rw-r--r--include/linux/mfd/wm8994/pdata.h1
-rw-r--r--include/linux/migrate.h6
-rw-r--r--include/linux/miscdevice.h2
-rw-r--r--include/linux/mlx4/device.h4
-rw-r--r--include/linux/mlx4/qp.h7
-rw-r--r--include/linux/mm.h11
-rw-r--r--include/linux/mmc/host.h5
-rw-r--r--include/linux/mmc/sdhci-spear.h42
-rw-r--r--include/linux/mmc/sdio_func.h3
-rw-r--r--include/linux/mmc/sh_mmcif.h39
-rw-r--r--include/linux/mmzone.h20
-rw-r--r--include/linux/mod_devicetable.h16
-rw-r--r--include/linux/module.h6
-rw-r--r--include/linux/mroute6.h35
-rw-r--r--include/linux/msm_mdp.h78
-rw-r--r--include/linux/mtd/blktrans.h15
-rw-r--r--include/linux/mtd/cfi.h30
-rw-r--r--include/linux/mtd/flashchip.h4
-rw-r--r--include/linux/mtd/map.h3
-rw-r--r--include/linux/mtd/mtd.h8
-rw-r--r--include/linux/mtd/mtdram.h2
-rw-r--r--include/linux/mtd/nand.h25
-rw-r--r--include/linux/mtd/onenand.h9
-rw-r--r--include/linux/mtd/sh_flctl.h7
-rw-r--r--include/linux/ncp_fs.h2
-rw-r--r--include/linux/ncp_fs_sb.h2
-rw-r--r--include/linux/netdevice.h29
-rw-r--r--include/linux/netfilter/Kbuild1
-rw-r--r--include/linux/netfilter/nf_conntrack_common.h1
-rw-r--r--include/linux/netfilter/nf_conntrack_tuple_common.h3
-rw-r--r--include/linux/netfilter/x_tables.h95
-rw-r--r--include/linux/netfilter/xt_CONNMARK.h22
-rw-r--r--include/linux/netfilter/xt_MARK.h6
-rw-r--r--include/linux/netfilter/xt_TEE.h12
-rw-r--r--include/linux/netfilter/xt_connmark.h11
-rw-r--r--include/linux/netfilter/xt_mark.h4
-rw-r--r--include/linux/netfilter/xt_recent.h7
-rw-r--r--include/linux/netfilter_bridge.h29
-rw-r--r--include/linux/netfilter_ipv6/ip6_tables.h4
-rw-r--r--include/linux/netlink.h4
-rw-r--r--include/linux/nfs_fs.h15
-rw-r--r--include/linux/nfs_fs_sb.h1
-rw-r--r--include/linux/nfs_xdr.h7
-rw-r--r--include/linux/nfsd/nfsfh.h6
-rw-r--r--include/linux/nilfs2_fs.h17
-rw-r--r--include/linux/nl80211.h13
-rw-r--r--include/linux/notifier.h5
-rw-r--r--include/linux/of_device.h4
-rw-r--r--include/linux/of_fdt.h4
-rw-r--r--include/linux/of_platform.h6
-rw-r--r--include/linux/padata.h55
-rw-r--r--include/linux/page_cgroup.h5
-rw-r--r--include/linux/pci.h13
-rw-r--r--include/linux/pci_ids.h4
-rw-r--r--include/linux/pci_regs.h3
-rw-r--r--include/linux/pda_power.h2
-rw-r--r--include/linux/perf_event.h111
-rw-r--r--include/linux/pipe_fs_i.h13
-rw-r--r--include/linux/platform_device.h6
-rw-r--r--include/linux/pm_qos_params.h14
-rw-r--r--include/linux/pm_runtime.h7
-rw-r--r--include/linux/pm_wakeup.h38
-rw-r--r--include/linux/poison.h9
-rw-r--r--include/linux/power_supply.h6
-rw-r--r--include/linux/ptrace.h12
-rw-r--r--include/linux/quota.h44
-rw-r--r--include/linux/quotaops.h127
-rw-r--r--include/linux/ramfs.h5
-rw-r--r--include/linux/random.h28
-rw-r--r--include/linux/ratelimit.h13
-rw-r--r--include/linux/rbtree.h5
-rw-r--r--include/linux/rcupdate.h52
-rw-r--r--include/linux/rcutiny.h31
-rw-r--r--include/linux/rcutree.h7
-rw-r--r--include/linux/regulator/consumer.h8
-rw-r--r--include/linux/regulator/machine.h9
-rw-r--r--include/linux/reiserfs_acl.h4
-rw-r--r--include/linux/reiserfs_xattr.h6
-rw-r--r--include/linux/ring_buffer.h10
-rw-r--r--include/linux/rio.h55
-rw-r--r--include/linux/rio_drv.h6
-rw-r--r--include/linux/rio_ids.h14
-rw-r--r--include/linux/rio_regs.h80
-rw-r--r--include/linux/rmap.h27
-rw-r--r--include/linux/rtc-v3020.h2
-rw-r--r--include/linux/rtnetlink.h3
-rw-r--r--include/linux/sched.h100
-rw-r--r--include/linux/sdhci-pltfm.h35
-rw-r--r--include/linux/security.h180
-rw-r--r--include/linux/sem.h4
-rw-r--r--include/linux/serial_core.h5
-rw-r--r--include/linux/serial_sci.h4
-rw-r--r--include/linux/serio.h1
-rw-r--r--include/linux/sfi.h24
-rw-r--r--include/linux/sh_clk.h150
-rw-r--r--include/linux/sh_dma.h102
-rw-r--r--include/linux/sh_intc.h26
-rw-r--r--include/linux/skbuff.h65
-rw-r--r--include/linux/slab_def.h24
-rw-r--r--include/linux/slob_def.h8
-rw-r--r--include/linux/slub_def.h19
-rw-r--r--include/linux/smb_fs_sb.h3
-rw-r--r--include/linux/spi/spi_bitbang.h101
-rw-r--r--include/linux/splice.h7
-rw-r--r--include/linux/srcu.h6
-rw-r--r--include/linux/stop_machine.h122
-rw-r--r--include/linux/sunrpc/auth.h1
-rw-r--r--include/linux/sunrpc/auth_gss.h1
-rw-r--r--include/linux/sunrpc/gss_api.h8
-rw-r--r--include/linux/sunrpc/gss_krb5.h184
-rw-r--r--include/linux/sunrpc/metrics.h7
-rw-r--r--include/linux/sunrpc/sched.h20
-rw-r--r--include/linux/sunrpc/xdr.h8
-rw-r--r--include/linux/sunrpc/xprt.h13
-rw-r--r--include/linux/swap.h20
-rw-r--r--include/linux/swiotlb.h10
-rw-r--r--include/linux/syscalls.h57
-rw-r--r--include/linux/sysctl.h2
-rw-r--r--include/linux/sysfs.h26
-rw-r--r--include/linux/sysrq.h23
-rw-r--r--include/linux/tboot.h1
-rw-r--r--include/linux/tca6416_keypad.h34
-rw-r--r--include/linux/threads.h9
-rw-r--r--include/linux/tick.h5
-rw-r--r--include/linux/timb_dma.h55
-rw-r--r--include/linux/time.h1
-rw-r--r--include/linux/timer.h10
-rw-r--r--include/linux/timex.h5
-rw-r--r--include/linux/tipc.h6
-rw-r--r--include/linux/tipc_config.h1
-rw-r--r--include/linux/topology.h112
-rw-r--r--include/linux/tracepoint.h196
-rw-r--r--include/linux/tty.h3
-rw-r--r--include/linux/types.h4
-rw-r--r--include/linux/uinput.h10
-rw-r--r--include/linux/usb.h131
-rw-r--r--include/linux/usb/Kbuild1
-rw-r--r--include/linux/usb/atmel_usba_udc.h2
-rw-r--r--include/linux/usb/audio-v2.h394
-rw-r--r--include/linux/usb/audio.h233
-rw-r--r--include/linux/usb/cdc.h94
-rw-r--r--include/linux/usb/ch11.h167
-rw-r--r--include/linux/usb/ch9.h16
-rw-r--r--include/linux/usb/composite.h1
-rw-r--r--include/linux/usb/ehci_def.h6
-rw-r--r--include/linux/usb/functionfs.h199
-rw-r--r--include/linux/usb/g_hid.h32
-rw-r--r--include/linux/usb/gadget.h6
-rw-r--r--include/linux/usb/gadgetfs.h2
-rw-r--r--include/linux/usb/hcd.h625
-rw-r--r--include/linux/usb/langwell_udc.h2
-rw-r--r--include/linux/usb/musb.h40
-rw-r--r--include/linux/usb/ncm.h114
-rw-r--r--include/linux/usb/net2280.h6
-rw-r--r--include/linux/usb/quirks.h4
-rw-r--r--include/linux/usb/rndis_host.h66
-rw-r--r--include/linux/usb/serial.h36
-rw-r--r--include/linux/usb/ulpi.h140
-rw-r--r--include/linux/usb/usbnet.h40
-rw-r--r--include/linux/usb/wusb-wa.h2
-rw-r--r--include/linux/uuid.h70
-rw-r--r--include/linux/via-core.h219
-rw-r--r--include/linux/via-gpio.h14
-rw-r--r--include/linux/via_i2c.h42
-rw-r--r--include/linux/videodev2.h75
-rw-r--r--include/linux/virtio.h55
-rw-r--r--include/linux/virtio_blk.h5
-rw-r--r--include/linux/virtio_console.h25
-rw-r--r--include/linux/vmstat.h4
-rw-r--r--include/linux/wait.h184
-rw-r--r--include/linux/writeback.h18
-rw-r--r--include/linux/xattr.h2
-rw-r--r--include/linux/z2_battery.h17
-rw-r--r--include/linux/zorro.h22
301 files changed, 8394 insertions, 1951 deletions
diff --git a/include/linux/acpi.h b/include/linux/acpi.h
index b926afe8c03e..224a38c960d4 100644
--- a/include/linux/acpi.h
+++ b/include/linux/acpi.h
@@ -116,11 +116,12 @@ extern unsigned long acpi_realmode_flags;
116 116
117int acpi_register_gsi (struct device *dev, u32 gsi, int triggering, int polarity); 117int acpi_register_gsi (struct device *dev, u32 gsi, int triggering, int polarity);
118int acpi_gsi_to_irq (u32 gsi, unsigned int *irq); 118int acpi_gsi_to_irq (u32 gsi, unsigned int *irq);
119int acpi_isa_irq_to_gsi (unsigned isa_irq, u32 *gsi);
119 120
120#ifdef CONFIG_X86_IO_APIC 121#ifdef CONFIG_X86_IO_APIC
121extern int acpi_get_override_irq(int bus_irq, int *trigger, int *polarity); 122extern int acpi_get_override_irq(u32 gsi, int *trigger, int *polarity);
122#else 123#else
123#define acpi_get_override_irq(bus, trigger, polarity) (-1) 124#define acpi_get_override_irq(gsi, trigger, polarity) (-1)
124#endif 125#endif
125/* 126/*
126 * This function undoes the effect of one call to acpi_register_gsi(). 127 * This function undoes the effect of one call to acpi_register_gsi().
@@ -247,11 +248,12 @@ int acpi_check_region(resource_size_t start, resource_size_t n,
247int acpi_check_mem_region(resource_size_t start, resource_size_t n, 248int acpi_check_mem_region(resource_size_t start, resource_size_t n,
248 const char *name); 249 const char *name);
249 250
251int acpi_resources_are_enforced(void);
252
250#ifdef CONFIG_PM_SLEEP 253#ifdef CONFIG_PM_SLEEP
251void __init acpi_no_s4_hw_signature(void); 254void __init acpi_no_s4_hw_signature(void);
252void __init acpi_old_suspend_ordering(void); 255void __init acpi_old_suspend_ordering(void);
253void __init acpi_s4_no_nvs(void); 256void __init acpi_s4_no_nvs(void);
254void __init acpi_set_sci_en_on_resume(void);
255#endif /* CONFIG_PM_SLEEP */ 257#endif /* CONFIG_PM_SLEEP */
256 258
257struct acpi_osc_context { 259struct acpi_osc_context {
diff --git a/include/linux/ahci_platform.h b/include/linux/ahci_platform.h
new file mode 100644
index 000000000000..f7dd576dd5a4
--- /dev/null
+++ b/include/linux/ahci_platform.h
@@ -0,0 +1,29 @@
1/*
2 * AHCI SATA platform driver
3 *
4 * Copyright 2004-2005 Red Hat, Inc.
5 * Jeff Garzik <jgarzik@pobox.com>
6 * Copyright 2010 MontaVista Software, LLC.
7 * Anton Vorontsov <avorontsov@ru.mvista.com>
8 *
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2, or (at your option)
12 * any later version.
13 */
14
15#ifndef _AHCI_PLATFORM_H
16#define _AHCI_PLATFORM_H
17
18struct device;
19struct ata_port_info;
20
21struct ahci_platform_data {
22 int (*init)(struct device *dev);
23 void (*exit)(struct device *dev);
24 const struct ata_port_info *ata_port_info;
25 unsigned int force_port_map;
26 unsigned int mask_port_map;
27};
28
29#endif /* _AHCI_PLATFORM_H */
diff --git a/include/linux/aio.h b/include/linux/aio.h
index 811dbb369379..7a8db4155281 100644
--- a/include/linux/aio.h
+++ b/include/linux/aio.h
@@ -212,6 +212,8 @@ extern void kick_iocb(struct kiocb *iocb);
212extern int aio_complete(struct kiocb *iocb, long res, long res2); 212extern int aio_complete(struct kiocb *iocb, long res, long res2);
213struct mm_struct; 213struct mm_struct;
214extern void exit_aio(struct mm_struct *mm); 214extern void exit_aio(struct mm_struct *mm);
215extern long do_io_submit(aio_context_t ctx_id, long nr,
216 struct iocb __user *__user *iocbpp, bool compat);
215#else 217#else
216static inline ssize_t wait_on_sync_kiocb(struct kiocb *iocb) { return 0; } 218static inline ssize_t wait_on_sync_kiocb(struct kiocb *iocb) { return 0; }
217static inline int aio_put_req(struct kiocb *iocb) { return 0; } 219static inline int aio_put_req(struct kiocb *iocb) { return 0; }
@@ -219,6 +221,9 @@ static inline void kick_iocb(struct kiocb *iocb) { }
219static inline int aio_complete(struct kiocb *iocb, long res, long res2) { return 0; } 221static inline int aio_complete(struct kiocb *iocb, long res, long res2) { return 0; }
220struct mm_struct; 222struct mm_struct;
221static inline void exit_aio(struct mm_struct *mm) { } 223static inline void exit_aio(struct mm_struct *mm) { }
224static inline long do_io_submit(aio_context_t ctx_id, long nr,
225 struct iocb __user * __user *iocbpp,
226 bool compat) { return 0; }
222#endif /* CONFIG_AIO */ 227#endif /* CONFIG_AIO */
223 228
224static inline struct kiocb *list_kiocb(struct list_head *h) 229static inline struct kiocb *list_kiocb(struct list_head *h)
diff --git a/include/linux/altera_jtaguart.h b/include/linux/altera_jtaguart.h
new file mode 100644
index 000000000000..953b178a1650
--- /dev/null
+++ b/include/linux/altera_jtaguart.h
@@ -0,0 +1,16 @@
1/*
2 * altera_jtaguart.h -- Altera JTAG UART driver defines.
3 */
4
5#ifndef __ALTJUART_H
6#define __ALTJUART_H
7
8#define ALTERA_JTAGUART_MAJOR 204
9#define ALTERA_JTAGUART_MINOR 186
10
11struct altera_jtaguart_platform_uart {
12 unsigned long mapbase; /* Physical address base */
13 unsigned int irq; /* Interrupt vector */
14};
15
16#endif /* __ALTJUART_H */
diff --git a/include/linux/altera_uart.h b/include/linux/altera_uart.h
new file mode 100644
index 000000000000..8d441064a30d
--- /dev/null
+++ b/include/linux/altera_uart.h
@@ -0,0 +1,14 @@
1/*
2 * altera_uart.h -- Altera UART driver defines.
3 */
4
5#ifndef __ALTUART_H
6#define __ALTUART_H
7
8struct altera_uart_platform_uart {
9 unsigned long mapbase; /* Physical address base */
10 unsigned int irq; /* Interrupt vector */
11 unsigned int uartclk; /* UART clock rate */
12};
13
14#endif /* __ALTUART_H */
diff --git a/include/linux/amba/mmci.h b/include/linux/amba/mmci.h
index 6b4241748dda..7e466fe72025 100644
--- a/include/linux/amba/mmci.h
+++ b/include/linux/amba/mmci.h
@@ -6,8 +6,29 @@
6 6
7#include <linux/mmc/host.h> 7#include <linux/mmc/host.h>
8 8
9/**
10 * struct mmci_platform_data - platform configuration for the MMCI
11 * (also known as PL180) block.
12 * @f_max: the maximum operational frequency for this host in this
13 * platform configuration. When this is specified it takes precedence
14 * over the module parameter for the same frequency.
15 * @ocr_mask: available voltages on the 4 pins from the block, this
16 * is ignored if a regulator is used, see the MMC_VDD_* masks in
17 * mmc/host.h
18 * @translate_vdd: a callback function to translate a MMC_VDD_*
19 * mask into a value to be binary or:ed and written into the
20 * MMCIPWR register of the block
21 * @status: if no GPIO read function was given to the block in
22 * gpio_wp (below) this function will be called to determine
23 * whether a card is present in the MMC slot or not
24 * @gpio_wp: read this GPIO pin to see if the card is write protected
25 * @gpio_cd: read this GPIO pin to detect card insertion
26 * @capabilities: the capabilities of the block as implemented in
27 * this platform, signify anything MMC_CAP_* from mmc/host.h
28 */
9struct mmci_platform_data { 29struct mmci_platform_data {
10 unsigned int ocr_mask; /* available voltages */ 30 unsigned int f_max;
31 unsigned int ocr_mask;
11 u32 (*translate_vdd)(struct device *, unsigned int); 32 u32 (*translate_vdd)(struct device *, unsigned int);
12 unsigned int (*status)(struct device *); 33 unsigned int (*status)(struct device *);
13 int gpio_wp; 34 int gpio_wp;
diff --git a/include/linux/amba/pl022.h b/include/linux/amba/pl022.h
index e4836c6b3dd7..abf26cc47a2b 100644
--- a/include/linux/amba/pl022.h
+++ b/include/linux/amba/pl022.h
@@ -71,6 +71,7 @@ struct ssp_clock_params {
71 71
72/** 72/**
73 * enum ssp_rx_endian - endianess of Rx FIFO Data 73 * enum ssp_rx_endian - endianess of Rx FIFO Data
74 * this feature is only available in ST versionf of PL022
74 */ 75 */
75enum ssp_rx_endian { 76enum ssp_rx_endian {
76 SSP_RX_MSB, 77 SSP_RX_MSB,
@@ -181,7 +182,8 @@ enum ssp_microwire_wait_state {
181}; 182};
182 183
183/** 184/**
184 * enum Microwire - whether Full/Half Duplex 185 * enum ssp_duplex - whether Full/Half Duplex on microwire, only
186 * available in the ST Micro variant.
185 * @SSP_MICROWIRE_CHANNEL_FULL_DUPLEX: SSPTXD becomes bi-directional, 187 * @SSP_MICROWIRE_CHANNEL_FULL_DUPLEX: SSPTXD becomes bi-directional,
186 * SSPRXD not used 188 * SSPRXD not used
187 * @SSP_MICROWIRE_CHANNEL_HALF_DUPLEX: SSPTXD is an output, SSPRXD is 189 * @SSP_MICROWIRE_CHANNEL_HALF_DUPLEX: SSPTXD is an output, SSPRXD is
@@ -193,6 +195,31 @@ enum ssp_duplex {
193}; 195};
194 196
195/** 197/**
198 * enum ssp_clkdelay - an optional clock delay on the feedback clock
199 * only available in the ST Micro PL023 variant.
200 * @SSP_FEEDBACK_CLK_DELAY_NONE: no delay, the data coming in from the
201 * slave is sampled directly
202 * @SSP_FEEDBACK_CLK_DELAY_1T: the incoming slave data is sampled with
203 * a delay of T-dt
204 * @SSP_FEEDBACK_CLK_DELAY_2T: dito with a delay if 2T-dt
205 * @SSP_FEEDBACK_CLK_DELAY_3T: dito with a delay if 3T-dt
206 * @SSP_FEEDBACK_CLK_DELAY_4T: dito with a delay if 4T-dt
207 * @SSP_FEEDBACK_CLK_DELAY_5T: dito with a delay if 5T-dt
208 * @SSP_FEEDBACK_CLK_DELAY_6T: dito with a delay if 6T-dt
209 * @SSP_FEEDBACK_CLK_DELAY_7T: dito with a delay if 7T-dt
210 */
211enum ssp_clkdelay {
212 SSP_FEEDBACK_CLK_DELAY_NONE,
213 SSP_FEEDBACK_CLK_DELAY_1T,
214 SSP_FEEDBACK_CLK_DELAY_2T,
215 SSP_FEEDBACK_CLK_DELAY_3T,
216 SSP_FEEDBACK_CLK_DELAY_4T,
217 SSP_FEEDBACK_CLK_DELAY_5T,
218 SSP_FEEDBACK_CLK_DELAY_6T,
219 SSP_FEEDBACK_CLK_DELAY_7T
220};
221
222/**
196 * CHIP select/deselect commands 223 * CHIP select/deselect commands
197 */ 224 */
198enum ssp_chip_select { 225enum ssp_chip_select {
@@ -235,6 +262,8 @@ struct pl022_ssp_controller {
235 * @ctrl_len: Microwire interface: Control length 262 * @ctrl_len: Microwire interface: Control length
236 * @wait_state: Microwire interface: Wait state 263 * @wait_state: Microwire interface: Wait state
237 * @duplex: Microwire interface: Full/Half duplex 264 * @duplex: Microwire interface: Full/Half duplex
265 * @clkdelay: on the PL023 variant, the delay in feeback clock cycles
266 * before sampling the incoming line
238 * @cs_control: function pointer to board-specific function to 267 * @cs_control: function pointer to board-specific function to
239 * assert/deassert I/O port to control HW generation of devices chip-select. 268 * assert/deassert I/O port to control HW generation of devices chip-select.
240 * @dma_xfer_type: Type of DMA xfer (Mem-to-periph or Periph-to-Periph) 269 * @dma_xfer_type: Type of DMA xfer (Mem-to-periph or Periph-to-Periph)
@@ -258,6 +287,7 @@ struct pl022_config_chip {
258 enum ssp_microwire_ctrl_len ctrl_len; 287 enum ssp_microwire_ctrl_len ctrl_len;
259 enum ssp_microwire_wait_state wait_state; 288 enum ssp_microwire_wait_state wait_state;
260 enum ssp_duplex duplex; 289 enum ssp_duplex duplex;
290 enum ssp_clkdelay clkdelay;
261 void (*cs_control) (u32 control); 291 void (*cs_control) (u32 control);
262}; 292};
263 293
diff --git a/include/linux/amba/pl330.h b/include/linux/amba/pl330.h
new file mode 100644
index 000000000000..cbee7de7dd36
--- /dev/null
+++ b/include/linux/amba/pl330.h
@@ -0,0 +1,45 @@
1/* linux/include/linux/amba/pl330.h
2 *
3 * Copyright (C) 2010 Samsung Electronics Co. Ltd.
4 * Jaswinder Singh <jassi.brar@samsung.com>
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 */
11
12#ifndef __AMBA_PL330_H_
13#define __AMBA_PL330_H_
14
15#include <asm/hardware/pl330.h>
16
17struct dma_pl330_peri {
18 /*
19 * Peri_Req i/f of the DMAC that is
20 * peripheral could be reached from.
21 */
22 u8 peri_id; /* {0, 31} */
23 enum pl330_reqtype rqtype;
24
25 /* For M->D and D->M Channels */
26 int burst_sz; /* in power of 2 */
27 dma_addr_t fifo_addr;
28};
29
30struct dma_pl330_platdata {
31 /*
32 * Number of valid peripherals connected to DMAC.
33 * This may be different from the value read from
34 * CR0, as the PL330 implementation might have 'holes'
35 * in the peri list or the peri could also be reached
36 * from another DMAC which the platform prefers.
37 */
38 u8 nr_valid_peri;
39 /* Array of valid peripherals */
40 struct dma_pl330_peri *peri;
41 /* Bytes to allocate for MC buffer */
42 unsigned mcbuf_sz;
43};
44
45#endif /* __AMBA_PL330_H_ */
diff --git a/include/linux/ata.h b/include/linux/ata.h
index 700c5b9b3583..fe6e681a9d74 100644
--- a/include/linux/ata.h
+++ b/include/linux/ata.h
@@ -467,7 +467,7 @@ enum ata_ioctls {
467 467
468/* core structures */ 468/* core structures */
469 469
470struct ata_prd { 470struct ata_bmdma_prd {
471 __le32 addr; 471 __le32 addr;
472 __le32 flags_len; 472 __le32 flags_len;
473}; 473};
diff --git a/include/linux/backing-dev.h b/include/linux/backing-dev.h
index fcbc26af00e4..e6e0cb5437e6 100644
--- a/include/linux/backing-dev.h
+++ b/include/linux/backing-dev.h
@@ -14,6 +14,7 @@
14#include <linux/kernel.h> 14#include <linux/kernel.h>
15#include <linux/fs.h> 15#include <linux/fs.h>
16#include <linux/sched.h> 16#include <linux/sched.h>
17#include <linux/timer.h>
17#include <linux/writeback.h> 18#include <linux/writeback.h>
18#include <asm/atomic.h> 19#include <asm/atomic.h>
19 20
@@ -88,6 +89,8 @@ struct backing_dev_info {
88 89
89 struct device *dev; 90 struct device *dev;
90 91
92 struct timer_list laptop_mode_wb_timer;
93
91#ifdef CONFIG_DEBUG_FS 94#ifdef CONFIG_DEBUG_FS
92 struct dentry *debug_dir; 95 struct dentry *debug_dir;
93 struct dentry *debug_stats; 96 struct dentry *debug_stats;
@@ -101,10 +104,12 @@ int bdi_register(struct backing_dev_info *bdi, struct device *parent,
101 const char *fmt, ...); 104 const char *fmt, ...);
102int bdi_register_dev(struct backing_dev_info *bdi, dev_t dev); 105int bdi_register_dev(struct backing_dev_info *bdi, dev_t dev);
103void bdi_unregister(struct backing_dev_info *bdi); 106void bdi_unregister(struct backing_dev_info *bdi);
107int bdi_setup_and_register(struct backing_dev_info *, char *, unsigned int);
104void bdi_start_writeback(struct backing_dev_info *bdi, struct super_block *sb, 108void bdi_start_writeback(struct backing_dev_info *bdi, struct super_block *sb,
105 long nr_pages); 109 long nr_pages, int sb_locked);
106int bdi_writeback_task(struct bdi_writeback *wb); 110int bdi_writeback_task(struct bdi_writeback *wb);
107int bdi_has_dirty_io(struct backing_dev_info *bdi); 111int bdi_has_dirty_io(struct backing_dev_info *bdi);
112void bdi_arm_supers_timer(void);
108 113
109extern spinlock_t bdi_lock; 114extern spinlock_t bdi_lock;
110extern struct list_head bdi_list; 115extern struct list_head bdi_list;
@@ -246,6 +251,7 @@ int bdi_set_max_ratio(struct backing_dev_info *bdi, unsigned int max_ratio);
246#endif 251#endif
247 252
248extern struct backing_dev_info default_backing_dev_info; 253extern struct backing_dev_info default_backing_dev_info;
254extern struct backing_dev_info noop_backing_dev_info;
249void default_unplug_io_fn(struct backing_dev_info *bdi, struct page *page); 255void default_unplug_io_fn(struct backing_dev_info *bdi, struct page *page);
250 256
251int writeback_in_progress(struct backing_dev_info *bdi); 257int writeback_in_progress(struct backing_dev_info *bdi);
diff --git a/include/linux/bitops.h b/include/linux/bitops.h
index b796eab5ca75..fc68053378ce 100644
--- a/include/linux/bitops.h
+++ b/include/linux/bitops.h
@@ -10,6 +10,11 @@
10#define BITS_TO_LONGS(nr) DIV_ROUND_UP(nr, BITS_PER_BYTE * sizeof(long)) 10#define BITS_TO_LONGS(nr) DIV_ROUND_UP(nr, BITS_PER_BYTE * sizeof(long))
11#endif 11#endif
12 12
13extern unsigned int __sw_hweight8(unsigned int w);
14extern unsigned int __sw_hweight16(unsigned int w);
15extern unsigned int __sw_hweight32(unsigned int w);
16extern unsigned long __sw_hweight64(__u64 w);
17
13/* 18/*
14 * Include this here because some architectures need generic_ffs/fls in 19 * Include this here because some architectures need generic_ffs/fls in
15 * scope 20 * scope
@@ -44,31 +49,6 @@ static inline unsigned long hweight_long(unsigned long w)
44 return sizeof(w) == 4 ? hweight32(w) : hweight64(w); 49 return sizeof(w) == 4 ? hweight32(w) : hweight64(w);
45} 50}
46 51
47/*
48 * Clearly slow versions of the hweightN() functions, their benefit is
49 * of course compile time evaluation of constant arguments.
50 */
51#define HWEIGHT8(w) \
52 ( BUILD_BUG_ON_ZERO(!__builtin_constant_p(w)) + \
53 (!!((w) & (1ULL << 0))) + \
54 (!!((w) & (1ULL << 1))) + \
55 (!!((w) & (1ULL << 2))) + \
56 (!!((w) & (1ULL << 3))) + \
57 (!!((w) & (1ULL << 4))) + \
58 (!!((w) & (1ULL << 5))) + \
59 (!!((w) & (1ULL << 6))) + \
60 (!!((w) & (1ULL << 7))) )
61
62#define HWEIGHT16(w) (HWEIGHT8(w) + HWEIGHT8((w) >> 8))
63#define HWEIGHT32(w) (HWEIGHT16(w) + HWEIGHT16((w) >> 16))
64#define HWEIGHT64(w) (HWEIGHT32(w) + HWEIGHT32((w) >> 32))
65
66/*
67 * Type invariant version that simply casts things to the
68 * largest type.
69 */
70#define HWEIGHT(w) HWEIGHT64((u64)(w))
71
72/** 52/**
73 * rol32 - rotate a 32-bit value left 53 * rol32 - rotate a 32-bit value left
74 * @word: value to rotate 54 * @word: value to rotate
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
index 6690e8bae7bb..8b7f5e0914ad 100644
--- a/include/linux/blkdev.h
+++ b/include/linux/blkdev.h
@@ -186,15 +186,19 @@ struct request {
186 }; 186 };
187 187
188 /* 188 /*
189 * two pointers are available for the IO schedulers, if they need 189 * Three pointers are available for the IO schedulers, if they need
190 * more they have to dynamically allocate it. 190 * more they have to dynamically allocate it.
191 */ 191 */
192 void *elevator_private; 192 void *elevator_private;
193 void *elevator_private2; 193 void *elevator_private2;
194 void *elevator_private3;
194 195
195 struct gendisk *rq_disk; 196 struct gendisk *rq_disk;
196 unsigned long start_time; 197 unsigned long start_time;
197 198#ifdef CONFIG_BLK_CGROUP
199 unsigned long long start_time_ns;
200 unsigned long long io_start_time_ns; /* when passed to hardware */
201#endif
198 /* Number of scatter-gather DMA addr+len pairs after 202 /* Number of scatter-gather DMA addr+len pairs after
199 * physical address coalescing is performed. 203 * physical address coalescing is performed.
200 */ 204 */
@@ -917,7 +921,12 @@ extern void blk_abort_queue(struct request_queue *);
917 */ 921 */
918extern struct request_queue *blk_init_queue_node(request_fn_proc *rfn, 922extern struct request_queue *blk_init_queue_node(request_fn_proc *rfn,
919 spinlock_t *lock, int node_id); 923 spinlock_t *lock, int node_id);
924extern struct request_queue *blk_init_allocated_queue_node(struct request_queue *,
925 request_fn_proc *,
926 spinlock_t *, int node_id);
920extern struct request_queue *blk_init_queue(request_fn_proc *, spinlock_t *); 927extern struct request_queue *blk_init_queue(request_fn_proc *, spinlock_t *);
928extern struct request_queue *blk_init_allocated_queue(struct request_queue *,
929 request_fn_proc *, spinlock_t *);
921extern void blk_cleanup_queue(struct request_queue *); 930extern void blk_cleanup_queue(struct request_queue *);
922extern void blk_queue_make_request(struct request_queue *, make_request_fn *); 931extern void blk_queue_make_request(struct request_queue *, make_request_fn *);
923extern void blk_queue_bounce_limit(struct request_queue *, u64); 932extern void blk_queue_bounce_limit(struct request_queue *, u64);
@@ -994,20 +1003,25 @@ static inline struct request *blk_map_queue_find_tag(struct blk_queue_tag *bqt,
994 return NULL; 1003 return NULL;
995 return bqt->tag_index[tag]; 1004 return bqt->tag_index[tag];
996} 1005}
997 1006enum{
998extern int blkdev_issue_flush(struct block_device *, sector_t *); 1007 BLKDEV_WAIT, /* wait for completion */
999#define DISCARD_FL_WAIT 0x01 /* wait for completion */ 1008 BLKDEV_BARRIER, /*issue request with barrier */
1000#define DISCARD_FL_BARRIER 0x02 /* issue DISCARD_BARRIER request */ 1009};
1001extern int blkdev_issue_discard(struct block_device *, sector_t sector, 1010#define BLKDEV_IFL_WAIT (1 << BLKDEV_WAIT)
1002 sector_t nr_sects, gfp_t, int flags); 1011#define BLKDEV_IFL_BARRIER (1 << BLKDEV_BARRIER)
1003 1012extern int blkdev_issue_flush(struct block_device *, gfp_t, sector_t *,
1013 unsigned long);
1014extern int blkdev_issue_discard(struct block_device *bdev, sector_t sector,
1015 sector_t nr_sects, gfp_t gfp_mask, unsigned long flags);
1016extern int blkdev_issue_zeroout(struct block_device *bdev, sector_t sector,
1017 sector_t nr_sects, gfp_t gfp_mask, unsigned long flags);
1004static inline int sb_issue_discard(struct super_block *sb, 1018static inline int sb_issue_discard(struct super_block *sb,
1005 sector_t block, sector_t nr_blocks) 1019 sector_t block, sector_t nr_blocks)
1006{ 1020{
1007 block <<= (sb->s_blocksize_bits - 9); 1021 block <<= (sb->s_blocksize_bits - 9);
1008 nr_blocks <<= (sb->s_blocksize_bits - 9); 1022 nr_blocks <<= (sb->s_blocksize_bits - 9);
1009 return blkdev_issue_discard(sb->s_bdev, block, nr_blocks, GFP_KERNEL, 1023 return blkdev_issue_discard(sb->s_bdev, block, nr_blocks, GFP_KERNEL,
1010 DISCARD_FL_BARRIER); 1024 BLKDEV_IFL_WAIT | BLKDEV_IFL_BARRIER);
1011} 1025}
1012 1026
1013extern int blk_verify_command(unsigned char *cmd, fmode_t has_write_perm); 1027extern int blk_verify_command(unsigned char *cmd, fmode_t has_write_perm);
@@ -1196,6 +1210,39 @@ static inline void put_dev_sector(Sector p)
1196struct work_struct; 1210struct work_struct;
1197int kblockd_schedule_work(struct request_queue *q, struct work_struct *work); 1211int kblockd_schedule_work(struct request_queue *q, struct work_struct *work);
1198 1212
1213#ifdef CONFIG_BLK_CGROUP
1214static inline void set_start_time_ns(struct request *req)
1215{
1216 req->start_time_ns = sched_clock();
1217}
1218
1219static inline void set_io_start_time_ns(struct request *req)
1220{
1221 req->io_start_time_ns = sched_clock();
1222}
1223
1224static inline uint64_t rq_start_time_ns(struct request *req)
1225{
1226 return req->start_time_ns;
1227}
1228
1229static inline uint64_t rq_io_start_time_ns(struct request *req)
1230{
1231 return req->io_start_time_ns;
1232}
1233#else
1234static inline void set_start_time_ns(struct request *req) {}
1235static inline void set_io_start_time_ns(struct request *req) {}
1236static inline uint64_t rq_start_time_ns(struct request *req)
1237{
1238 return 0;
1239}
1240static inline uint64_t rq_io_start_time_ns(struct request *req)
1241{
1242 return 0;
1243}
1244#endif
1245
1199#define MODULE_ALIAS_BLOCKDEV(major,minor) \ 1246#define MODULE_ALIAS_BLOCKDEV(major,minor) \
1200 MODULE_ALIAS("block-major-" __stringify(major) "-" __stringify(minor)) 1247 MODULE_ALIAS("block-major-" __stringify(major) "-" __stringify(minor))
1201#define MODULE_ALIAS_BLOCKDEV_MAJOR(major) \ 1248#define MODULE_ALIAS_BLOCKDEV_MAJOR(major) \
@@ -1283,10 +1330,11 @@ struct block_device_operations {
1283 int (*direct_access) (struct block_device *, sector_t, 1330 int (*direct_access) (struct block_device *, sector_t,
1284 void **, unsigned long *); 1331 void **, unsigned long *);
1285 int (*media_changed) (struct gendisk *); 1332 int (*media_changed) (struct gendisk *);
1286 unsigned long long (*set_capacity) (struct gendisk *, 1333 void (*unlock_native_capacity) (struct gendisk *);
1287 unsigned long long);
1288 int (*revalidate_disk) (struct gendisk *); 1334 int (*revalidate_disk) (struct gendisk *);
1289 int (*getgeo)(struct block_device *, struct hd_geometry *); 1335 int (*getgeo)(struct block_device *, struct hd_geometry *);
1336 /* this callback is with swap_lock and sometimes page table lock held */
1337 void (*swap_slot_free_notify) (struct block_device *, unsigned long);
1290 struct module *owner; 1338 struct module *owner;
1291}; 1339};
1292 1340
diff --git a/include/linux/buffer_head.h b/include/linux/buffer_head.h
index 16ed0284d780..1b9ba193b789 100644
--- a/include/linux/buffer_head.h
+++ b/include/linux/buffer_head.h
@@ -203,6 +203,9 @@ int block_write_full_page_endio(struct page *page, get_block_t *get_block,
203int block_read_full_page(struct page*, get_block_t*); 203int block_read_full_page(struct page*, get_block_t*);
204int block_is_partially_uptodate(struct page *page, read_descriptor_t *desc, 204int block_is_partially_uptodate(struct page *page, read_descriptor_t *desc,
205 unsigned long from); 205 unsigned long from);
206int block_write_begin_newtrunc(struct file *, struct address_space *,
207 loff_t, unsigned, unsigned,
208 struct page **, void **, get_block_t*);
206int block_write_begin(struct file *, struct address_space *, 209int block_write_begin(struct file *, struct address_space *,
207 loff_t, unsigned, unsigned, 210 loff_t, unsigned, unsigned,
208 struct page **, void **, get_block_t*); 211 struct page **, void **, get_block_t*);
@@ -214,6 +217,9 @@ int generic_write_end(struct file *, struct address_space *,
214 struct page *, void *); 217 struct page *, void *);
215void page_zero_new_buffers(struct page *page, unsigned from, unsigned to); 218void page_zero_new_buffers(struct page *page, unsigned from, unsigned to);
216int block_prepare_write(struct page*, unsigned, unsigned, get_block_t*); 219int block_prepare_write(struct page*, unsigned, unsigned, get_block_t*);
220int cont_write_begin_newtrunc(struct file *, struct address_space *, loff_t,
221 unsigned, unsigned, struct page **, void **,
222 get_block_t *, loff_t *);
217int cont_write_begin(struct file *, struct address_space *, loff_t, 223int cont_write_begin(struct file *, struct address_space *, loff_t,
218 unsigned, unsigned, struct page **, void **, 224 unsigned, unsigned, struct page **, void **,
219 get_block_t *, loff_t *); 225 get_block_t *, loff_t *);
@@ -224,7 +230,10 @@ int block_page_mkwrite(struct vm_area_struct *vma, struct vm_fault *vmf,
224void block_sync_page(struct page *); 230void block_sync_page(struct page *);
225sector_t generic_block_bmap(struct address_space *, sector_t, get_block_t *); 231sector_t generic_block_bmap(struct address_space *, sector_t, get_block_t *);
226int block_truncate_page(struct address_space *, loff_t, get_block_t *); 232int block_truncate_page(struct address_space *, loff_t, get_block_t *);
227int file_fsync(struct file *, struct dentry *, int); 233int file_fsync(struct file *, int);
234int nobh_write_begin_newtrunc(struct file *, struct address_space *,
235 loff_t, unsigned, unsigned,
236 struct page **, void **, get_block_t*);
228int nobh_write_begin(struct file *, struct address_space *, 237int nobh_write_begin(struct file *, struct address_space *,
229 loff_t, unsigned, unsigned, 238 loff_t, unsigned, unsigned,
230 struct page **, void **, get_block_t*); 239 struct page **, void **, get_block_t*);
diff --git a/include/linux/can/platform/sja1000.h b/include/linux/can/platform/sja1000.h
index 01ee2aeb048d..96f8fcc78d78 100644
--- a/include/linux/can/platform/sja1000.h
+++ b/include/linux/can/platform/sja1000.h
@@ -26,7 +26,7 @@
26#define OCR_TX_SHIFT 2 26#define OCR_TX_SHIFT 2
27 27
28struct sja1000_platform_data { 28struct sja1000_platform_data {
29 u32 clock; /* CAN bus oscillator frequency in Hz */ 29 u32 osc_freq; /* CAN bus oscillator frequency in Hz */
30 30
31 u8 ocr; /* output control register */ 31 u8 ocr; /* output control register */
32 u8 cdr; /* clock divider register */ 32 u8 cdr; /* clock divider register */
diff --git a/include/linux/cgroup.h b/include/linux/cgroup.h
index b8ad1ea99586..0c621604baa1 100644
--- a/include/linux/cgroup.h
+++ b/include/linux/cgroup.h
@@ -397,7 +397,7 @@ struct cftype {
397 * This callback must be implemented, if you want provide 397 * This callback must be implemented, if you want provide
398 * notification functionality. 398 * notification functionality.
399 */ 399 */
400 int (*unregister_event)(struct cgroup *cgrp, struct cftype *cft, 400 void (*unregister_event)(struct cgroup *cgrp, struct cftype *cft,
401 struct eventfd_ctx *eventfd); 401 struct eventfd_ctx *eventfd);
402}; 402};
403 403
@@ -530,6 +530,7 @@ static inline struct cgroup_subsys_state *task_subsys_state(
530{ 530{
531 return rcu_dereference_check(task->cgroups->subsys[subsys_id], 531 return rcu_dereference_check(task->cgroups->subsys[subsys_id],
532 rcu_read_lock_held() || 532 rcu_read_lock_held() ||
533 lockdep_is_held(&task->alloc_lock) ||
533 cgroup_lock_is_held()); 534 cgroup_lock_is_held());
534} 535}
535 536
diff --git a/include/linux/clocksource.h b/include/linux/clocksource.h
index 4bca8b60cdf7..5ea3c60c160c 100644
--- a/include/linux/clocksource.h
+++ b/include/linux/clocksource.h
@@ -273,7 +273,6 @@ static inline s64 clocksource_cyc2ns(cycle_t cycles, u32 mult, u32 shift)
273} 273}
274 274
275 275
276/* used to install a new clocksource */
277extern int clocksource_register(struct clocksource*); 276extern int clocksource_register(struct clocksource*);
278extern void clocksource_unregister(struct clocksource*); 277extern void clocksource_unregister(struct clocksource*);
279extern void clocksource_touch_watchdog(void); 278extern void clocksource_touch_watchdog(void);
@@ -287,6 +286,24 @@ extern void clocksource_mark_unstable(struct clocksource *cs);
287extern void 286extern void
288clocks_calc_mult_shift(u32 *mult, u32 *shift, u32 from, u32 to, u32 minsec); 287clocks_calc_mult_shift(u32 *mult, u32 *shift, u32 from, u32 to, u32 minsec);
289 288
289/*
290 * Don't call __clocksource_register_scale directly, use
291 * clocksource_register_hz/khz
292 */
293extern int
294__clocksource_register_scale(struct clocksource *cs, u32 scale, u32 freq);
295
296static inline int clocksource_register_hz(struct clocksource *cs, u32 hz)
297{
298 return __clocksource_register_scale(cs, 1, hz);
299}
300
301static inline int clocksource_register_khz(struct clocksource *cs, u32 khz)
302{
303 return __clocksource_register_scale(cs, 1000, khz);
304}
305
306
290static inline void 307static inline void
291clocksource_calc_mult_shift(struct clocksource *cs, u32 freq, u32 minsec) 308clocksource_calc_mult_shift(struct clocksource *cs, u32 freq, u32 minsec)
292{ 309{
diff --git a/include/linux/coda_psdev.h b/include/linux/coda_psdev.h
index 5b5d4731f956..8859e2ede9fe 100644
--- a/include/linux/coda_psdev.h
+++ b/include/linux/coda_psdev.h
@@ -7,6 +7,8 @@
7#define MAX_CODADEVS 5 /* how many do we allow */ 7#define MAX_CODADEVS 5 /* how many do we allow */
8 8
9#ifdef __KERNEL__ 9#ifdef __KERNEL__
10#include <linux/backing-dev.h>
11
10struct kstatfs; 12struct kstatfs;
11 13
12/* communication pending/processing queues */ 14/* communication pending/processing queues */
@@ -17,6 +19,7 @@ struct venus_comm {
17 struct list_head vc_processing; 19 struct list_head vc_processing;
18 int vc_inuse; 20 int vc_inuse;
19 struct super_block *vc_sb; 21 struct super_block *vc_sb;
22 struct backing_dev_info bdi;
20}; 23};
21 24
22 25
diff --git a/include/linux/compaction.h b/include/linux/compaction.h
new file mode 100644
index 000000000000..5ac51552d908
--- /dev/null
+++ b/include/linux/compaction.h
@@ -0,0 +1,89 @@
1#ifndef _LINUX_COMPACTION_H
2#define _LINUX_COMPACTION_H
3
4/* Return values for compact_zone() and try_to_compact_pages() */
5/* compaction didn't start as it was not possible or direct reclaim was more suitable */
6#define COMPACT_SKIPPED 0
7/* compaction should continue to another pageblock */
8#define COMPACT_CONTINUE 1
9/* direct compaction partially compacted a zone and there are suitable pages */
10#define COMPACT_PARTIAL 2
11/* The full zone was compacted */
12#define COMPACT_COMPLETE 3
13
14#ifdef CONFIG_COMPACTION
15extern int sysctl_compact_memory;
16extern int sysctl_compaction_handler(struct ctl_table *table, int write,
17 void __user *buffer, size_t *length, loff_t *ppos);
18extern int sysctl_extfrag_threshold;
19extern int sysctl_extfrag_handler(struct ctl_table *table, int write,
20 void __user *buffer, size_t *length, loff_t *ppos);
21
22extern int fragmentation_index(struct zone *zone, unsigned int order);
23extern unsigned long try_to_compact_pages(struct zonelist *zonelist,
24 int order, gfp_t gfp_mask, nodemask_t *mask);
25
26/* Do not skip compaction more than 64 times */
27#define COMPACT_MAX_DEFER_SHIFT 6
28
29/*
30 * Compaction is deferred when compaction fails to result in a page
31 * allocation success. 1 << compact_defer_limit compactions are skipped up
32 * to a limit of 1 << COMPACT_MAX_DEFER_SHIFT
33 */
34static inline void defer_compaction(struct zone *zone)
35{
36 zone->compact_considered = 0;
37 zone->compact_defer_shift++;
38
39 if (zone->compact_defer_shift > COMPACT_MAX_DEFER_SHIFT)
40 zone->compact_defer_shift = COMPACT_MAX_DEFER_SHIFT;
41}
42
43/* Returns true if compaction should be skipped this time */
44static inline bool compaction_deferred(struct zone *zone)
45{
46 unsigned long defer_limit = 1UL << zone->compact_defer_shift;
47
48 /* Avoid possible overflow */
49 if (++zone->compact_considered > defer_limit)
50 zone->compact_considered = defer_limit;
51
52 return zone->compact_considered < (1UL << zone->compact_defer_shift);
53}
54
55#else
56static inline unsigned long try_to_compact_pages(struct zonelist *zonelist,
57 int order, gfp_t gfp_mask, nodemask_t *nodemask)
58{
59 return COMPACT_CONTINUE;
60}
61
62static inline void defer_compaction(struct zone *zone)
63{
64}
65
66static inline bool compaction_deferred(struct zone *zone)
67{
68 return 1;
69}
70
71#endif /* CONFIG_COMPACTION */
72
73#if defined(CONFIG_COMPACTION) && defined(CONFIG_SYSFS) && defined(CONFIG_NUMA)
74extern int compaction_register_node(struct node *node);
75extern void compaction_unregister_node(struct node *node);
76
77#else
78
79static inline int compaction_register_node(struct node *node)
80{
81 return 0;
82}
83
84static inline void compaction_unregister_node(struct node *node)
85{
86}
87#endif /* CONFIG_COMPACTION && CONFIG_SYSFS && CONFIG_NUMA */
88
89#endif /* _LINUX_COMPACTION_H */
diff --git a/include/linux/compat.h b/include/linux/compat.h
index 717c691ecd8e..168f7daa7bde 100644
--- a/include/linux/compat.h
+++ b/include/linux/compat.h
@@ -356,5 +356,9 @@ asmlinkage long compat_sys_newfstatat(unsigned int dfd, char __user * filename,
356asmlinkage long compat_sys_openat(unsigned int dfd, const char __user *filename, 356asmlinkage long compat_sys_openat(unsigned int dfd, const char __user *filename,
357 int flags, int mode); 357 int flags, int mode);
358 358
359extern ssize_t compat_rw_copy_check_uvector(int type,
360 const struct compat_iovec __user *uvector, unsigned long nr_segs,
361 unsigned long fast_segs, struct iovec *fast_pointer,
362 struct iovec **ret_pointer);
359#endif /* CONFIG_COMPAT */ 363#endif /* CONFIG_COMPAT */
360#endif /* _LINUX_COMPAT_H */ 364#endif /* _LINUX_COMPAT_H */
diff --git a/include/linux/completion.h b/include/linux/completion.h
index 4a6b604ef7e4..51e3145196f6 100644
--- a/include/linux/completion.h
+++ b/include/linux/completion.h
@@ -83,6 +83,8 @@ extern unsigned long wait_for_completion_timeout(struct completion *x,
83 unsigned long timeout); 83 unsigned long timeout);
84extern unsigned long wait_for_completion_interruptible_timeout( 84extern unsigned long wait_for_completion_interruptible_timeout(
85 struct completion *x, unsigned long timeout); 85 struct completion *x, unsigned long timeout);
86extern unsigned long wait_for_completion_killable_timeout(
87 struct completion *x, unsigned long timeout);
86extern bool try_wait_for_completion(struct completion *x); 88extern bool try_wait_for_completion(struct completion *x);
87extern bool completion_done(struct completion *x); 89extern bool completion_done(struct completion *x);
88 90
diff --git a/include/linux/cper.h b/include/linux/cper.h
new file mode 100644
index 000000000000..4b38f905b705
--- /dev/null
+++ b/include/linux/cper.h
@@ -0,0 +1,314 @@
1/*
2 * UEFI Common Platform Error Record
3 *
4 * Copyright (C) 2010, Intel Corp.
5 * Author: Huang Ying <ying.huang@intel.com>
6 *
7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License version
9 * 2 as published by the Free Software Foundation.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 */
20
21#ifndef LINUX_CPER_H
22#define LINUX_CPER_H
23
24#include <linux/uuid.h>
25
26/* CPER record signature and the size */
27#define CPER_SIG_RECORD "CPER"
28#define CPER_SIG_SIZE 4
29/* Used in signature_end field in struct cper_record_header */
30#define CPER_SIG_END 0xffffffff
31
32/*
33 * CPER record header revision, used in revision field in struct
34 * cper_record_header
35 */
36#define CPER_RECORD_REV 0x0100
37
38/*
39 * Severity difinition for error_severity in struct cper_record_header
40 * and section_severity in struct cper_section_descriptor
41 */
42#define CPER_SER_RECOVERABLE 0x0
43#define CPER_SER_FATAL 0x1
44#define CPER_SER_CORRECTED 0x2
45#define CPER_SER_INFORMATIONAL 0x3
46
47/*
48 * Validation bits difinition for validation_bits in struct
49 * cper_record_header. If set, corresponding fields in struct
50 * cper_record_header contain valid information.
51 *
52 * corresponds platform_id
53 */
54#define CPER_VALID_PLATFORM_ID 0x0001
55/* corresponds timestamp */
56#define CPER_VALID_TIMESTAMP 0x0002
57/* corresponds partition_id */
58#define CPER_VALID_PARTITION_ID 0x0004
59
60/*
61 * Notification type used to generate error record, used in
62 * notification_type in struct cper_record_header
63 *
64 * Corrected Machine Check
65 */
66#define CPER_NOTIFY_CMC \
67 UUID_LE(0x2DCE8BB1, 0xBDD7, 0x450e, 0xB9, 0xAD, 0x9C, 0xF4, \
68 0xEB, 0xD4, 0xF8, 0x90)
69/* Corrected Platform Error */
70#define CPER_NOTIFY_CPE \
71 UUID_LE(0x4E292F96, 0xD843, 0x4a55, 0xA8, 0xC2, 0xD4, 0x81, \
72 0xF2, 0x7E, 0xBE, 0xEE)
73/* Machine Check Exception */
74#define CPER_NOTIFY_MCE \
75 UUID_LE(0xE8F56FFE, 0x919C, 0x4cc5, 0xBA, 0x88, 0x65, 0xAB, \
76 0xE1, 0x49, 0x13, 0xBB)
77/* PCI Express Error */
78#define CPER_NOTIFY_PCIE \
79 UUID_LE(0xCF93C01F, 0x1A16, 0x4dfc, 0xB8, 0xBC, 0x9C, 0x4D, \
80 0xAF, 0x67, 0xC1, 0x04)
81/* INIT Record (for IPF) */
82#define CPER_NOTIFY_INIT \
83 UUID_LE(0xCC5263E8, 0x9308, 0x454a, 0x89, 0xD0, 0x34, 0x0B, \
84 0xD3, 0x9B, 0xC9, 0x8E)
85/* Non-Maskable Interrupt */
86#define CPER_NOTIFY_NMI \
87 UUID_LE(0x5BAD89FF, 0xB7E6, 0x42c9, 0x81, 0x4A, 0xCF, 0x24, \
88 0x85, 0xD6, 0xE9, 0x8A)
89/* BOOT Error Record */
90#define CPER_NOTIFY_BOOT \
91 UUID_LE(0x3D61A466, 0xAB40, 0x409a, 0xA6, 0x98, 0xF3, 0x62, \
92 0xD4, 0x64, 0xB3, 0x8F)
93/* DMA Remapping Error */
94#define CPER_NOTIFY_DMAR \
95 UUID_LE(0x667DD791, 0xC6B3, 0x4c27, 0x8A, 0x6B, 0x0F, 0x8E, \
96 0x72, 0x2D, 0xEB, 0x41)
97
98/*
99 * Flags bits definitions for flags in struct cper_record_header
100 * If set, the error has been recovered
101 */
102#define CPER_HW_ERROR_FLAGS_RECOVERED 0x1
103/* If set, the error is for previous boot */
104#define CPER_HW_ERROR_FLAGS_PREVERR 0x2
105/* If set, the error is injected for testing */
106#define CPER_HW_ERROR_FLAGS_SIMULATED 0x4
107
108/*
109 * CPER section header revision, used in revision field in struct
110 * cper_section_descriptor
111 */
112#define CPER_SEC_REV 0x0100
113
114/*
115 * Validation bits difinition for validation_bits in struct
116 * cper_section_descriptor. If set, corresponding fields in struct
117 * cper_section_descriptor contain valid information.
118 *
119 * corresponds fru_id
120 */
121#define CPER_SEC_VALID_FRU_ID 0x1
122/* corresponds fru_text */
123#define CPER_SEC_VALID_FRU_TEXT 0x2
124
125/*
126 * Flags bits definitions for flags in struct cper_section_descriptor
127 *
128 * If set, the section is associated with the error condition
129 * directly, and should be focused on
130 */
131#define CPER_SEC_PRIMARY 0x0001
132/*
133 * If set, the error was not contained within the processor or memory
134 * hierarchy and the error may have propagated to persistent storage
135 * or network
136 */
137#define CPER_SEC_CONTAINMENT_WARNING 0x0002
138/* If set, the component must be re-initialized or re-enabled prior to use */
139#define CPER_SEC_RESET 0x0004
140/* If set, Linux may choose to discontinue use of the resource */
141#define CPER_SEC_ERROR_THRESHOLD_EXCEEDED 0x0008
142/*
143 * If set, resource could not be queried for error information due to
144 * conflicts with other system software or resources. Some fields of
145 * the section will be invalid
146 */
147#define CPER_SEC_RESOURCE_NOT_ACCESSIBLE 0x0010
148/*
149 * If set, action has been taken to ensure error containment (such as
150 * poisoning data), but the error has not been fully corrected and the
151 * data has not been consumed. Linux may choose to take further
152 * corrective action before the data is consumed
153 */
154#define CPER_SEC_LATENT_ERROR 0x0020
155
156/*
157 * Section type definitions, used in section_type field in struct
158 * cper_section_descriptor
159 *
160 * Processor Generic
161 */
162#define CPER_SEC_PROC_GENERIC \
163 UUID_LE(0x9876CCAD, 0x47B4, 0x4bdb, 0xB6, 0x5E, 0x16, 0xF1, \
164 0x93, 0xC4, 0xF3, 0xDB)
165/* Processor Specific: X86/X86_64 */
166#define CPER_SEC_PROC_IA \
167 UUID_LE(0xDC3EA0B0, 0xA144, 0x4797, 0xB9, 0x5B, 0x53, 0xFA, \
168 0x24, 0x2B, 0x6E, 0x1D)
169/* Processor Specific: IA64 */
170#define CPER_SEC_PROC_IPF \
171 UUID_LE(0xE429FAF1, 0x3CB7, 0x11D4, 0x0B, 0xCA, 0x07, 0x00, \
172 0x80, 0xC7, 0x3C, 0x88, 0x81)
173/* Platform Memory */
174#define CPER_SEC_PLATFORM_MEM \
175 UUID_LE(0xA5BC1114, 0x6F64, 0x4EDE, 0xB8, 0x63, 0x3E, 0x83, \
176 0xED, 0x7C, 0x83, 0xB1)
177#define CPER_SEC_PCIE \
178 UUID_LE(0xD995E954, 0xBBC1, 0x430F, 0xAD, 0x91, 0xB4, 0x4D, \
179 0xCB, 0x3C, 0x6F, 0x35)
180/* Firmware Error Record Reference */
181#define CPER_SEC_FW_ERR_REC_REF \
182 UUID_LE(0x81212A96, 0x09ED, 0x4996, 0x94, 0x71, 0x8D, 0x72, \
183 0x9C, 0x8E, 0x69, 0xED)
184/* PCI/PCI-X Bus */
185#define CPER_SEC_PCI_X_BUS \
186 UUID_LE(0xC5753963, 0x3B84, 0x4095, 0xBF, 0x78, 0xED, 0xDA, \
187 0xD3, 0xF9, 0xC9, 0xDD)
188/* PCI Component/Device */
189#define CPER_SEC_PCI_DEV \
190 UUID_LE(0xEB5E4685, 0xCA66, 0x4769, 0xB6, 0xA2, 0x26, 0x06, \
191 0x8B, 0x00, 0x13, 0x26)
192#define CPER_SEC_DMAR_GENERIC \
193 UUID_LE(0x5B51FEF7, 0xC79D, 0x4434, 0x8F, 0x1B, 0xAA, 0x62, \
194 0xDE, 0x3E, 0x2C, 0x64)
195/* Intel VT for Directed I/O specific DMAr */
196#define CPER_SEC_DMAR_VT \
197 UUID_LE(0x71761D37, 0x32B2, 0x45cd, 0xA7, 0xD0, 0xB0, 0xFE, \
198 0xDD, 0x93, 0xE8, 0xCF)
199/* IOMMU specific DMAr */
200#define CPER_SEC_DMAR_IOMMU \
201 UUID_LE(0x036F84E1, 0x7F37, 0x428c, 0xA7, 0x9E, 0x57, 0x5F, \
202 0xDF, 0xAA, 0x84, 0xEC)
203
204/*
205 * All tables and structs must be byte-packed to match CPER
206 * specification, since the tables are provided by the system BIOS
207 */
208#pragma pack(1)
209
210struct cper_record_header {
211 char signature[CPER_SIG_SIZE]; /* must be CPER_SIG_RECORD */
212 __u16 revision; /* must be CPER_RECORD_REV */
213 __u32 signature_end; /* must be CPER_SIG_END */
214 __u16 section_count;
215 __u32 error_severity;
216 __u32 validation_bits;
217 __u32 record_length;
218 __u64 timestamp;
219 uuid_le platform_id;
220 uuid_le partition_id;
221 uuid_le creator_id;
222 uuid_le notification_type;
223 __u64 record_id;
224 __u32 flags;
225 __u64 persistence_information;
226 __u8 reserved[12]; /* must be zero */
227};
228
229struct cper_section_descriptor {
230 __u32 section_offset; /* Offset in bytes of the
231 * section body from the base
232 * of the record header */
233 __u32 section_length;
234 __u16 revision; /* must be CPER_RECORD_REV */
235 __u8 validation_bits;
236 __u8 reserved; /* must be zero */
237 __u32 flags;
238 uuid_le section_type;
239 uuid_le fru_id;
240 __u32 section_severity;
241 __u8 fru_text[20];
242};
243
244/* Generic Processor Error Section */
245struct cper_sec_proc_generic {
246 __u64 validation_bits;
247 __u8 proc_type;
248 __u8 proc_isa;
249 __u8 proc_error_type;
250 __u8 operation;
251 __u8 flags;
252 __u8 level;
253 __u16 reserved;
254 __u64 cpu_version;
255 char cpu_brand[128];
256 __u64 proc_id;
257 __u64 target_addr;
258 __u64 requestor_id;
259 __u64 responder_id;
260 __u64 ip;
261};
262
263/* IA32/X64 Processor Error Section */
264struct cper_sec_proc_ia {
265 __u64 validation_bits;
266 __u8 lapic_id;
267 __u8 cpuid[48];
268};
269
270/* IA32/X64 Processor Error Infomation Structure */
271struct cper_ia_err_info {
272 uuid_le err_type;
273 __u64 validation_bits;
274 __u64 check_info;
275 __u64 target_id;
276 __u64 requestor_id;
277 __u64 responder_id;
278 __u64 ip;
279};
280
281/* IA32/X64 Processor Context Information Structure */
282struct cper_ia_proc_ctx {
283 __u16 reg_ctx_type;
284 __u16 reg_arr_size;
285 __u32 msr_addr;
286 __u64 mm_reg_addr;
287};
288
289/* Memory Error Section */
290struct cper_sec_mem_err {
291 __u64 validation_bits;
292 __u64 error_status;
293 __u64 physical_addr;
294 __u64 physical_addr_mask;
295 __u16 node;
296 __u16 card;
297 __u16 module;
298 __u16 bank;
299 __u16 device;
300 __u16 row;
301 __u16 column;
302 __u16 bit_pos;
303 __u64 requestor_id;
304 __u64 responder_id;
305 __u64 target_id;
306 __u8 error_type;
307};
308
309/* Reset to default packing */
310#pragma pack()
311
312u64 cper_next_record_id(void);
313
314#endif
diff --git a/include/linux/cpufreq.h b/include/linux/cpufreq.h
index 4de02b10007f..9f15150ce8d6 100644
--- a/include/linux/cpufreq.h
+++ b/include/linux/cpufreq.h
@@ -278,6 +278,27 @@ struct freq_attr {
278 ssize_t (*store)(struct cpufreq_policy *, const char *, size_t count); 278 ssize_t (*store)(struct cpufreq_policy *, const char *, size_t count);
279}; 279};
280 280
281#define cpufreq_freq_attr_ro(_name) \
282static struct freq_attr _name = \
283__ATTR(_name, 0444, show_##_name, NULL)
284
285#define cpufreq_freq_attr_ro_perm(_name, _perm) \
286static struct freq_attr _name = \
287__ATTR(_name, _perm, show_##_name, NULL)
288
289#define cpufreq_freq_attr_ro_old(_name) \
290static struct freq_attr _name##_old = \
291__ATTR(_name, 0444, show_##_name##_old, NULL)
292
293#define cpufreq_freq_attr_rw(_name) \
294static struct freq_attr _name = \
295__ATTR(_name, 0644, show_##_name, store_##_name)
296
297#define cpufreq_freq_attr_rw_old(_name) \
298static struct freq_attr _name##_old = \
299__ATTR(_name, 0644, show_##_name##_old, store_##_name##_old)
300
301
281struct global_attr { 302struct global_attr {
282 struct attribute attr; 303 struct attribute attr;
283 ssize_t (*show)(struct kobject *kobj, 304 ssize_t (*show)(struct kobject *kobj,
@@ -286,6 +307,15 @@ struct global_attr {
286 const char *c, size_t count); 307 const char *c, size_t count);
287}; 308};
288 309
310#define define_one_global_ro(_name) \
311static struct global_attr _name = \
312__ATTR(_name, 0444, show_##_name, NULL)
313
314#define define_one_global_rw(_name) \
315static struct global_attr _name = \
316__ATTR(_name, 0644, show_##_name, store_##_name)
317
318
289/********************************************************************* 319/*********************************************************************
290 * CPUFREQ 2.6. INTERFACE * 320 * CPUFREQ 2.6. INTERFACE *
291 *********************************************************************/ 321 *********************************************************************/
diff --git a/include/linux/cpuidle.h b/include/linux/cpuidle.h
index dcf77fa826b5..55215cce5005 100644
--- a/include/linux/cpuidle.h
+++ b/include/linux/cpuidle.h
@@ -125,6 +125,7 @@ struct cpuidle_driver {
125#ifdef CONFIG_CPU_IDLE 125#ifdef CONFIG_CPU_IDLE
126 126
127extern int cpuidle_register_driver(struct cpuidle_driver *drv); 127extern int cpuidle_register_driver(struct cpuidle_driver *drv);
128struct cpuidle_driver *cpuidle_get_driver(void);
128extern void cpuidle_unregister_driver(struct cpuidle_driver *drv); 129extern void cpuidle_unregister_driver(struct cpuidle_driver *drv);
129extern int cpuidle_register_device(struct cpuidle_device *dev); 130extern int cpuidle_register_device(struct cpuidle_device *dev);
130extern void cpuidle_unregister_device(struct cpuidle_device *dev); 131extern void cpuidle_unregister_device(struct cpuidle_device *dev);
@@ -137,16 +138,17 @@ extern void cpuidle_disable_device(struct cpuidle_device *dev);
137#else 138#else
138 139
139static inline int cpuidle_register_driver(struct cpuidle_driver *drv) 140static inline int cpuidle_register_driver(struct cpuidle_driver *drv)
140{return 0;} 141{return -ENODEV; }
142static inline struct cpuidle_driver *cpuidle_get_driver(void) {return NULL; }
141static inline void cpuidle_unregister_driver(struct cpuidle_driver *drv) { } 143static inline void cpuidle_unregister_driver(struct cpuidle_driver *drv) { }
142static inline int cpuidle_register_device(struct cpuidle_device *dev) 144static inline int cpuidle_register_device(struct cpuidle_device *dev)
143{return 0;} 145{return -ENODEV; }
144static inline void cpuidle_unregister_device(struct cpuidle_device *dev) { } 146static inline void cpuidle_unregister_device(struct cpuidle_device *dev) { }
145 147
146static inline void cpuidle_pause_and_lock(void) { } 148static inline void cpuidle_pause_and_lock(void) { }
147static inline void cpuidle_resume_and_unlock(void) { } 149static inline void cpuidle_resume_and_unlock(void) { }
148static inline int cpuidle_enable_device(struct cpuidle_device *dev) 150static inline int cpuidle_enable_device(struct cpuidle_device *dev)
149{return 0;} 151{return -ENODEV; }
150static inline void cpuidle_disable_device(struct cpuidle_device *dev) { } 152static inline void cpuidle_disable_device(struct cpuidle_device *dev) { }
151 153
152#endif 154#endif
diff --git a/include/linux/cpuset.h b/include/linux/cpuset.h
index a5740fc4d04b..457ed765a116 100644
--- a/include/linux/cpuset.h
+++ b/include/linux/cpuset.h
@@ -21,8 +21,7 @@ extern int number_of_cpusets; /* How many cpusets are defined in system? */
21extern int cpuset_init(void); 21extern int cpuset_init(void);
22extern void cpuset_init_smp(void); 22extern void cpuset_init_smp(void);
23extern void cpuset_cpus_allowed(struct task_struct *p, struct cpumask *mask); 23extern void cpuset_cpus_allowed(struct task_struct *p, struct cpumask *mask);
24extern void cpuset_cpus_allowed_locked(struct task_struct *p, 24extern int cpuset_cpus_allowed_fallback(struct task_struct *p);
25 struct cpumask *mask);
26extern nodemask_t cpuset_mems_allowed(struct task_struct *p); 25extern nodemask_t cpuset_mems_allowed(struct task_struct *p);
27#define cpuset_current_mems_allowed (current->mems_allowed) 26#define cpuset_current_mems_allowed (current->mems_allowed)
28void cpuset_init_current_mems_allowed(void); 27void cpuset_init_current_mems_allowed(void);
@@ -69,10 +68,8 @@ struct seq_file;
69extern void cpuset_task_status_allowed(struct seq_file *m, 68extern void cpuset_task_status_allowed(struct seq_file *m,
70 struct task_struct *task); 69 struct task_struct *task);
71 70
72extern void cpuset_lock(void);
73extern void cpuset_unlock(void);
74
75extern int cpuset_mem_spread_node(void); 71extern int cpuset_mem_spread_node(void);
72extern int cpuset_slab_spread_node(void);
76 73
77static inline int cpuset_do_page_mem_spread(void) 74static inline int cpuset_do_page_mem_spread(void)
78{ 75{
@@ -90,9 +87,44 @@ extern void rebuild_sched_domains(void);
90 87
91extern void cpuset_print_task_mems_allowed(struct task_struct *p); 88extern void cpuset_print_task_mems_allowed(struct task_struct *p);
92 89
90/*
91 * reading current mems_allowed and mempolicy in the fastpath must protected
92 * by get_mems_allowed()
93 */
94static inline void get_mems_allowed(void)
95{
96 current->mems_allowed_change_disable++;
97
98 /*
99 * ensure that reading mems_allowed and mempolicy happens after the
100 * update of ->mems_allowed_change_disable.
101 *
102 * the write-side task finds ->mems_allowed_change_disable is not 0,
103 * and knows the read-side task is reading mems_allowed or mempolicy,
104 * so it will clear old bits lazily.
105 */
106 smp_mb();
107}
108
109static inline void put_mems_allowed(void)
110{
111 /*
112 * ensure that reading mems_allowed and mempolicy before reducing
113 * mems_allowed_change_disable.
114 *
115 * the write-side task will know that the read-side task is still
116 * reading mems_allowed or mempolicy, don't clears old bits in the
117 * nodemask.
118 */
119 smp_mb();
120 --ACCESS_ONCE(current->mems_allowed_change_disable);
121}
122
93static inline void set_mems_allowed(nodemask_t nodemask) 123static inline void set_mems_allowed(nodemask_t nodemask)
94{ 124{
125 task_lock(current);
95 current->mems_allowed = nodemask; 126 current->mems_allowed = nodemask;
127 task_unlock(current);
96} 128}
97 129
98#else /* !CONFIG_CPUSETS */ 130#else /* !CONFIG_CPUSETS */
@@ -105,10 +137,11 @@ static inline void cpuset_cpus_allowed(struct task_struct *p,
105{ 137{
106 cpumask_copy(mask, cpu_possible_mask); 138 cpumask_copy(mask, cpu_possible_mask);
107} 139}
108static inline void cpuset_cpus_allowed_locked(struct task_struct *p, 140
109 struct cpumask *mask) 141static inline int cpuset_cpus_allowed_fallback(struct task_struct *p)
110{ 142{
111 cpumask_copy(mask, cpu_possible_mask); 143 cpumask_copy(&p->cpus_allowed, cpu_possible_mask);
144 return cpumask_any(cpu_active_mask);
112} 145}
113 146
114static inline nodemask_t cpuset_mems_allowed(struct task_struct *p) 147static inline nodemask_t cpuset_mems_allowed(struct task_struct *p)
@@ -157,14 +190,16 @@ static inline void cpuset_task_status_allowed(struct seq_file *m,
157{ 190{
158} 191}
159 192
160static inline void cpuset_lock(void) {}
161static inline void cpuset_unlock(void) {}
162
163static inline int cpuset_mem_spread_node(void) 193static inline int cpuset_mem_spread_node(void)
164{ 194{
165 return 0; 195 return 0;
166} 196}
167 197
198static inline int cpuset_slab_spread_node(void)
199{
200 return 0;
201}
202
168static inline int cpuset_do_page_mem_spread(void) 203static inline int cpuset_do_page_mem_spread(void)
169{ 204{
170 return 0; 205 return 0;
@@ -193,6 +228,14 @@ static inline void set_mems_allowed(nodemask_t nodemask)
193{ 228{
194} 229}
195 230
231static inline void get_mems_allowed(void)
232{
233}
234
235static inline void put_mems_allowed(void)
236{
237}
238
196#endif /* !CONFIG_CPUSETS */ 239#endif /* !CONFIG_CPUSETS */
197 240
198#endif /* _LINUX_CPUSET_H */ 241#endif /* _LINUX_CPUSET_H */
diff --git a/include/linux/cred.h b/include/linux/cred.h
index 52507c3e1387..75c0fa881308 100644
--- a/include/linux/cred.h
+++ b/include/linux/cred.h
@@ -156,7 +156,6 @@ extern int copy_creds(struct task_struct *, unsigned long);
156extern struct cred *cred_alloc_blank(void); 156extern struct cred *cred_alloc_blank(void);
157extern struct cred *prepare_creds(void); 157extern struct cred *prepare_creds(void);
158extern struct cred *prepare_exec_creds(void); 158extern struct cred *prepare_exec_creds(void);
159extern struct cred *prepare_usermodehelper_creds(void);
160extern int commit_creds(struct cred *); 159extern int commit_creds(struct cred *);
161extern void abort_creds(struct cred *); 160extern void abort_creds(struct cred *);
162extern const struct cred *override_creds(const struct cred *); 161extern const struct cred *override_creds(const struct cred *);
diff --git a/include/linux/crypto.h b/include/linux/crypto.h
index 24d2e30f1b46..a6a7a1c83f54 100644
--- a/include/linux/crypto.h
+++ b/include/linux/crypto.h
@@ -99,13 +99,7 @@
99 * as arm where pointers are 32-bit aligned but there are data types such as 99 * as arm where pointers are 32-bit aligned but there are data types such as
100 * u64 which require 64-bit alignment. 100 * u64 which require 64-bit alignment.
101 */ 101 */
102#if defined(ARCH_KMALLOC_MINALIGN)
103#define CRYPTO_MINALIGN ARCH_KMALLOC_MINALIGN 102#define CRYPTO_MINALIGN ARCH_KMALLOC_MINALIGN
104#elif defined(ARCH_SLAB_MINALIGN)
105#define CRYPTO_MINALIGN ARCH_SLAB_MINALIGN
106#else
107#define CRYPTO_MINALIGN __alignof__(unsigned long long)
108#endif
109 103
110#define CRYPTO_MINALIGN_ATTR __attribute__ ((__aligned__(CRYPTO_MINALIGN))) 104#define CRYPTO_MINALIGN_ATTR __attribute__ ((__aligned__(CRYPTO_MINALIGN)))
111 105
diff --git a/include/linux/dcache.h b/include/linux/dcache.h
index 30b93b2a01a4..eebb617c17d8 100644
--- a/include/linux/dcache.h
+++ b/include/linux/dcache.h
@@ -186,6 +186,8 @@ d_iput: no no no yes
186 186
187#define DCACHE_FSNOTIFY_PARENT_WATCHED 0x0080 /* Parent inode is watched by some fsnotify listener */ 187#define DCACHE_FSNOTIFY_PARENT_WATCHED 0x0080 /* Parent inode is watched by some fsnotify listener */
188 188
189#define DCACHE_CANT_MOUNT 0x0100
190
189extern spinlock_t dcache_lock; 191extern spinlock_t dcache_lock;
190extern seqlock_t rename_lock; 192extern seqlock_t rename_lock;
191 193
@@ -358,6 +360,18 @@ static inline int d_unlinked(struct dentry *dentry)
358 return d_unhashed(dentry) && !IS_ROOT(dentry); 360 return d_unhashed(dentry) && !IS_ROOT(dentry);
359} 361}
360 362
363static inline int cant_mount(struct dentry *dentry)
364{
365 return (dentry->d_flags & DCACHE_CANT_MOUNT);
366}
367
368static inline void dont_mount(struct dentry *dentry)
369{
370 spin_lock(&dentry->d_lock);
371 dentry->d_flags |= DCACHE_CANT_MOUNT;
372 spin_unlock(&dentry->d_lock);
373}
374
361static inline struct dentry *dget_parent(struct dentry *dentry) 375static inline struct dentry *dget_parent(struct dentry *dentry)
362{ 376{
363 struct dentry *ret; 377 struct dentry *ret;
diff --git a/include/linux/debugfs.h b/include/linux/debugfs.h
index fc1b930f246c..e7d9b20ddc5b 100644
--- a/include/linux/debugfs.h
+++ b/include/linux/debugfs.h
@@ -63,6 +63,8 @@ struct dentry *debugfs_create_x16(const char *name, mode_t mode,
63 struct dentry *parent, u16 *value); 63 struct dentry *parent, u16 *value);
64struct dentry *debugfs_create_x32(const char *name, mode_t mode, 64struct dentry *debugfs_create_x32(const char *name, mode_t mode,
65 struct dentry *parent, u32 *value); 65 struct dentry *parent, u32 *value);
66struct dentry *debugfs_create_x64(const char *name, mode_t mode,
67 struct dentry *parent, u64 *value);
66struct dentry *debugfs_create_size_t(const char *name, mode_t mode, 68struct dentry *debugfs_create_size_t(const char *name, mode_t mode,
67 struct dentry *parent, size_t *value); 69 struct dentry *parent, size_t *value);
68struct dentry *debugfs_create_bool(const char *name, mode_t mode, 70struct dentry *debugfs_create_bool(const char *name, mode_t mode,
diff --git a/include/linux/debugobjects.h b/include/linux/debugobjects.h
index 8c243aaa86a7..597692f1fc8d 100644
--- a/include/linux/debugobjects.h
+++ b/include/linux/debugobjects.h
@@ -20,12 +20,14 @@ struct debug_obj_descr;
20 * struct debug_obj - representaion of an tracked object 20 * struct debug_obj - representaion of an tracked object
21 * @node: hlist node to link the object into the tracker list 21 * @node: hlist node to link the object into the tracker list
22 * @state: tracked object state 22 * @state: tracked object state
23 * @astate: current active state
23 * @object: pointer to the real object 24 * @object: pointer to the real object
24 * @descr: pointer to an object type specific debug description structure 25 * @descr: pointer to an object type specific debug description structure
25 */ 26 */
26struct debug_obj { 27struct debug_obj {
27 struct hlist_node node; 28 struct hlist_node node;
28 enum debug_obj_state state; 29 enum debug_obj_state state;
30 unsigned int astate;
29 void *object; 31 void *object;
30 struct debug_obj_descr *descr; 32 struct debug_obj_descr *descr;
31}; 33};
@@ -60,6 +62,15 @@ extern void debug_object_deactivate(void *addr, struct debug_obj_descr *descr);
60extern void debug_object_destroy (void *addr, struct debug_obj_descr *descr); 62extern void debug_object_destroy (void *addr, struct debug_obj_descr *descr);
61extern void debug_object_free (void *addr, struct debug_obj_descr *descr); 63extern void debug_object_free (void *addr, struct debug_obj_descr *descr);
62 64
65/*
66 * Active state:
67 * - Set at 0 upon initialization.
68 * - Must return to 0 before deactivation.
69 */
70extern void
71debug_object_active_state(void *addr, struct debug_obj_descr *descr,
72 unsigned int expect, unsigned int next);
73
63extern void debug_objects_early_init(void); 74extern void debug_objects_early_init(void);
64extern void debug_objects_mem_init(void); 75extern void debug_objects_mem_init(void);
65#else 76#else
diff --git a/include/linux/device.h b/include/linux/device.h
index 182192892d45..0713e10571dd 100644
--- a/include/linux/device.h
+++ b/include/linux/device.h
@@ -22,7 +22,6 @@
22#include <linux/types.h> 22#include <linux/types.h>
23#include <linux/module.h> 23#include <linux/module.h>
24#include <linux/pm.h> 24#include <linux/pm.h>
25#include <linux/semaphore.h>
26#include <asm/atomic.h> 25#include <asm/atomic.h>
27#include <asm/device.h> 26#include <asm/device.h>
28 27
@@ -34,6 +33,7 @@ struct class;
34struct class_private; 33struct class_private;
35struct bus_type; 34struct bus_type;
36struct bus_type_private; 35struct bus_type_private;
36struct device_node;
37 37
38struct bus_attribute { 38struct bus_attribute {
39 struct attribute attr; 39 struct attribute attr;
@@ -128,6 +128,10 @@ struct device_driver {
128 128
129 bool suppress_bind_attrs; /* disables bind/unbind via sysfs */ 129 bool suppress_bind_attrs; /* disables bind/unbind via sysfs */
130 130
131#if defined(CONFIG_OF)
132 const struct of_device_id *of_match_table;
133#endif
134
131 int (*probe) (struct device *dev); 135 int (*probe) (struct device *dev);
132 int (*remove) (struct device *dev); 136 int (*remove) (struct device *dev);
133 void (*shutdown) (struct device *dev); 137 void (*shutdown) (struct device *dev);
@@ -203,6 +207,9 @@ struct class {
203 int (*suspend)(struct device *dev, pm_message_t state); 207 int (*suspend)(struct device *dev, pm_message_t state);
204 int (*resume)(struct device *dev); 208 int (*resume)(struct device *dev);
205 209
210 const struct kobj_ns_type_operations *ns_type;
211 const void *(*namespace)(struct device *dev);
212
206 const struct dev_pm_ops *pm; 213 const struct dev_pm_ops *pm;
207 214
208 struct class_private *p; 215 struct class_private *p;
@@ -404,7 +411,7 @@ struct device {
404 const char *init_name; /* initial name of the device */ 411 const char *init_name; /* initial name of the device */
405 struct device_type *type; 412 struct device_type *type;
406 413
407 struct semaphore sem; /* semaphore to synchronize calls to 414 struct mutex mutex; /* mutex to synchronize calls to
408 * its driver. 415 * its driver.
409 */ 416 */
410 417
@@ -433,6 +440,9 @@ struct device {
433 override */ 440 override */
434 /* arch specific additions */ 441 /* arch specific additions */
435 struct dev_archdata archdata; 442 struct dev_archdata archdata;
443#ifdef CONFIG_OF
444 struct device_node *of_node;
445#endif
436 446
437 dev_t devt; /* dev_t, creates the sysfs "dev" */ 447 dev_t devt; /* dev_t, creates the sysfs "dev" */
438 448
@@ -451,6 +461,10 @@ struct device {
451 461
452static inline const char *dev_name(const struct device *dev) 462static inline const char *dev_name(const struct device *dev)
453{ 463{
464 /* Use the init name until the kobject becomes available */
465 if (dev->init_name)
466 return dev->init_name;
467
454 return kobject_name(&dev->kobj); 468 return kobject_name(&dev->kobj);
455} 469}
456 470
@@ -510,17 +524,17 @@ static inline bool device_async_suspend_enabled(struct device *dev)
510 524
511static inline void device_lock(struct device *dev) 525static inline void device_lock(struct device *dev)
512{ 526{
513 down(&dev->sem); 527 mutex_lock(&dev->mutex);
514} 528}
515 529
516static inline int device_trylock(struct device *dev) 530static inline int device_trylock(struct device *dev)
517{ 531{
518 return down_trylock(&dev->sem); 532 return mutex_trylock(&dev->mutex);
519} 533}
520 534
521static inline void device_unlock(struct device *dev) 535static inline void device_unlock(struct device *dev)
522{ 536{
523 up(&dev->sem); 537 mutex_unlock(&dev->mutex);
524} 538}
525 539
526void driver_init(void); 540void driver_init(void);
diff --git a/include/linux/dma-mapping.h b/include/linux/dma-mapping.h
index ca32ed78b057..89b7e1a605b8 100644
--- a/include/linux/dma-mapping.h
+++ b/include/linux/dma-mapping.h
@@ -40,16 +40,6 @@ struct dma_map_ops {
40 void (*sync_single_for_device)(struct device *dev, 40 void (*sync_single_for_device)(struct device *dev,
41 dma_addr_t dma_handle, size_t size, 41 dma_addr_t dma_handle, size_t size,
42 enum dma_data_direction dir); 42 enum dma_data_direction dir);
43 void (*sync_single_range_for_cpu)(struct device *dev,
44 dma_addr_t dma_handle,
45 unsigned long offset,
46 size_t size,
47 enum dma_data_direction dir);
48 void (*sync_single_range_for_device)(struct device *dev,
49 dma_addr_t dma_handle,
50 unsigned long offset,
51 size_t size,
52 enum dma_data_direction dir);
53 void (*sync_sg_for_cpu)(struct device *dev, 43 void (*sync_sg_for_cpu)(struct device *dev,
54 struct scatterlist *sg, int nents, 44 struct scatterlist *sg, int nents,
55 enum dma_data_direction dir); 45 enum dma_data_direction dir);
@@ -105,21 +95,6 @@ static inline int is_device_dma_capable(struct device *dev)
105#include <asm-generic/dma-mapping-broken.h> 95#include <asm-generic/dma-mapping-broken.h>
106#endif 96#endif
107 97
108/* for backwards compatibility, removed soon */
109static inline void __deprecated dma_sync_single(struct device *dev,
110 dma_addr_t addr, size_t size,
111 enum dma_data_direction dir)
112{
113 dma_sync_single_for_cpu(dev, addr, size, dir);
114}
115
116static inline void __deprecated dma_sync_sg(struct device *dev,
117 struct scatterlist *sg, int nelems,
118 enum dma_data_direction dir)
119{
120 dma_sync_sg_for_cpu(dev, sg, nelems, dir);
121}
122
123static inline u64 dma_get_mask(struct device *dev) 98static inline u64 dma_get_mask(struct device *dev)
124{ 99{
125 if (dev && dev->dma_mask && *dev->dma_mask) 100 if (dev && dev->dma_mask && *dev->dma_mask)
diff --git a/include/linux/dmaengine.h b/include/linux/dmaengine.h
index 20ea12c86fd0..5204f018931b 100644
--- a/include/linux/dmaengine.h
+++ b/include/linux/dmaengine.h
@@ -40,11 +40,13 @@ typedef s32 dma_cookie_t;
40 * enum dma_status - DMA transaction status 40 * enum dma_status - DMA transaction status
41 * @DMA_SUCCESS: transaction completed successfully 41 * @DMA_SUCCESS: transaction completed successfully
42 * @DMA_IN_PROGRESS: transaction not yet processed 42 * @DMA_IN_PROGRESS: transaction not yet processed
43 * @DMA_PAUSED: transaction is paused
43 * @DMA_ERROR: transaction failed 44 * @DMA_ERROR: transaction failed
44 */ 45 */
45enum dma_status { 46enum dma_status {
46 DMA_SUCCESS, 47 DMA_SUCCESS,
47 DMA_IN_PROGRESS, 48 DMA_IN_PROGRESS,
49 DMA_PAUSED,
48 DMA_ERROR, 50 DMA_ERROR,
49}; 51};
50 52
@@ -107,6 +109,19 @@ enum dma_ctrl_flags {
107}; 109};
108 110
109/** 111/**
112 * enum dma_ctrl_cmd - DMA operations that can optionally be exercised
113 * on a running channel.
114 * @DMA_TERMINATE_ALL: terminate all ongoing transfers
115 * @DMA_PAUSE: pause ongoing transfers
116 * @DMA_RESUME: resume paused transfer
117 */
118enum dma_ctrl_cmd {
119 DMA_TERMINATE_ALL,
120 DMA_PAUSE,
121 DMA_RESUME,
122};
123
124/**
110 * enum sum_check_bits - bit position of pq_check_flags 125 * enum sum_check_bits - bit position of pq_check_flags
111 */ 126 */
112enum sum_check_bits { 127enum sum_check_bits {
@@ -230,9 +245,84 @@ struct dma_async_tx_descriptor {
230 dma_cookie_t (*tx_submit)(struct dma_async_tx_descriptor *tx); 245 dma_cookie_t (*tx_submit)(struct dma_async_tx_descriptor *tx);
231 dma_async_tx_callback callback; 246 dma_async_tx_callback callback;
232 void *callback_param; 247 void *callback_param;
248#ifndef CONFIG_ASYNC_TX_DISABLE_CHANNEL_SWITCH
233 struct dma_async_tx_descriptor *next; 249 struct dma_async_tx_descriptor *next;
234 struct dma_async_tx_descriptor *parent; 250 struct dma_async_tx_descriptor *parent;
235 spinlock_t lock; 251 spinlock_t lock;
252#endif
253};
254
255#ifdef CONFIG_ASYNC_TX_DISABLE_CHANNEL_SWITCH
256static inline void txd_lock(struct dma_async_tx_descriptor *txd)
257{
258}
259static inline void txd_unlock(struct dma_async_tx_descriptor *txd)
260{
261}
262static inline void txd_chain(struct dma_async_tx_descriptor *txd, struct dma_async_tx_descriptor *next)
263{
264 BUG();
265}
266static inline void txd_clear_parent(struct dma_async_tx_descriptor *txd)
267{
268}
269static inline void txd_clear_next(struct dma_async_tx_descriptor *txd)
270{
271}
272static inline struct dma_async_tx_descriptor *txd_next(struct dma_async_tx_descriptor *txd)
273{
274 return NULL;
275}
276static inline struct dma_async_tx_descriptor *txd_parent(struct dma_async_tx_descriptor *txd)
277{
278 return NULL;
279}
280
281#else
282static inline void txd_lock(struct dma_async_tx_descriptor *txd)
283{
284 spin_lock_bh(&txd->lock);
285}
286static inline void txd_unlock(struct dma_async_tx_descriptor *txd)
287{
288 spin_unlock_bh(&txd->lock);
289}
290static inline void txd_chain(struct dma_async_tx_descriptor *txd, struct dma_async_tx_descriptor *next)
291{
292 txd->next = next;
293 next->parent = txd;
294}
295static inline void txd_clear_parent(struct dma_async_tx_descriptor *txd)
296{
297 txd->parent = NULL;
298}
299static inline void txd_clear_next(struct dma_async_tx_descriptor *txd)
300{
301 txd->next = NULL;
302}
303static inline struct dma_async_tx_descriptor *txd_parent(struct dma_async_tx_descriptor *txd)
304{
305 return txd->parent;
306}
307static inline struct dma_async_tx_descriptor *txd_next(struct dma_async_tx_descriptor *txd)
308{
309 return txd->next;
310}
311#endif
312
313/**
314 * struct dma_tx_state - filled in to report the status of
315 * a transfer.
316 * @last: last completed DMA cookie
317 * @used: last issued DMA cookie (i.e. the one in progress)
318 * @residue: the remaining number of bytes left to transmit
319 * on the selected transfer for states DMA_IN_PROGRESS and
320 * DMA_PAUSED if this is implemented in the driver, else 0
321 */
322struct dma_tx_state {
323 dma_cookie_t last;
324 dma_cookie_t used;
325 u32 residue;
236}; 326};
237 327
238/** 328/**
@@ -261,8 +351,12 @@ struct dma_async_tx_descriptor {
261 * @device_prep_dma_memset: prepares a memset operation 351 * @device_prep_dma_memset: prepares a memset operation
262 * @device_prep_dma_interrupt: prepares an end of chain interrupt operation 352 * @device_prep_dma_interrupt: prepares an end of chain interrupt operation
263 * @device_prep_slave_sg: prepares a slave dma operation 353 * @device_prep_slave_sg: prepares a slave dma operation
264 * @device_terminate_all: terminate all pending operations 354 * @device_control: manipulate all pending operations on a channel, returns
265 * @device_is_tx_complete: poll for transaction completion 355 * zero or error code
356 * @device_tx_status: poll for transaction completion, the optional
357 * txstate parameter can be supplied with a pointer to get a
358 * struct with auxilary transfer status information, otherwise the call
359 * will just return a simple status code
266 * @device_issue_pending: push pending transactions to hardware 360 * @device_issue_pending: push pending transactions to hardware
267 */ 361 */
268struct dma_device { 362struct dma_device {
@@ -313,11 +407,12 @@ struct dma_device {
313 struct dma_chan *chan, struct scatterlist *sgl, 407 struct dma_chan *chan, struct scatterlist *sgl,
314 unsigned int sg_len, enum dma_data_direction direction, 408 unsigned int sg_len, enum dma_data_direction direction,
315 unsigned long flags); 409 unsigned long flags);
316 void (*device_terminate_all)(struct dma_chan *chan); 410 int (*device_control)(struct dma_chan *chan, enum dma_ctrl_cmd cmd,
411 unsigned long arg);
317 412
318 enum dma_status (*device_is_tx_complete)(struct dma_chan *chan, 413 enum dma_status (*device_tx_status)(struct dma_chan *chan,
319 dma_cookie_t cookie, dma_cookie_t *last, 414 dma_cookie_t cookie,
320 dma_cookie_t *used); 415 struct dma_tx_state *txstate);
321 void (*device_issue_pending)(struct dma_chan *chan); 416 void (*device_issue_pending)(struct dma_chan *chan);
322}; 417};
323 418
@@ -558,7 +653,15 @@ static inline void dma_async_issue_pending(struct dma_chan *chan)
558static inline enum dma_status dma_async_is_tx_complete(struct dma_chan *chan, 653static inline enum dma_status dma_async_is_tx_complete(struct dma_chan *chan,
559 dma_cookie_t cookie, dma_cookie_t *last, dma_cookie_t *used) 654 dma_cookie_t cookie, dma_cookie_t *last, dma_cookie_t *used)
560{ 655{
561 return chan->device->device_is_tx_complete(chan, cookie, last, used); 656 struct dma_tx_state state;
657 enum dma_status status;
658
659 status = chan->device->device_tx_status(chan, cookie, &state);
660 if (last)
661 *last = state.last;
662 if (used)
663 *used = state.used;
664 return status;
562} 665}
563 666
564#define dma_async_memcpy_complete(chan, cookie, last, used)\ 667#define dma_async_memcpy_complete(chan, cookie, last, used)\
@@ -586,6 +689,16 @@ static inline enum dma_status dma_async_is_complete(dma_cookie_t cookie,
586 return DMA_IN_PROGRESS; 689 return DMA_IN_PROGRESS;
587} 690}
588 691
692static inline void
693dma_set_tx_state(struct dma_tx_state *st, dma_cookie_t last, dma_cookie_t used, u32 residue)
694{
695 if (st) {
696 st->last = last;
697 st->used = used;
698 st->residue = residue;
699 }
700}
701
589enum dma_status dma_sync_wait(struct dma_chan *chan, dma_cookie_t cookie); 702enum dma_status dma_sync_wait(struct dma_chan *chan, dma_cookie_t cookie);
590#ifdef CONFIG_DMA_ENGINE 703#ifdef CONFIG_DMA_ENGINE
591enum dma_status dma_wait_for_async_tx(struct dma_async_tx_descriptor *tx); 704enum dma_status dma_wait_for_async_tx(struct dma_async_tx_descriptor *tx);
diff --git a/include/linux/dqblk_xfs.h b/include/linux/dqblk_xfs.h
index 527504c11c5e..4389ae72024e 100644
--- a/include/linux/dqblk_xfs.h
+++ b/include/linux/dqblk_xfs.h
@@ -110,6 +110,15 @@ typedef struct fs_disk_quota {
110#define FS_DQ_WARNS_MASK (FS_DQ_BWARNS | FS_DQ_IWARNS | FS_DQ_RTBWARNS) 110#define FS_DQ_WARNS_MASK (FS_DQ_BWARNS | FS_DQ_IWARNS | FS_DQ_RTBWARNS)
111 111
112/* 112/*
113 * Accounting values. These can only be set for filesystem with
114 * non-transactional quotas that require quotacheck(8) in userspace.
115 */
116#define FS_DQ_BCOUNT (1<<12)
117#define FS_DQ_ICOUNT (1<<13)
118#define FS_DQ_RTBCOUNT (1<<14)
119#define FS_DQ_ACCT_MASK (FS_DQ_BCOUNT | FS_DQ_ICOUNT | FS_DQ_RTBCOUNT)
120
121/*
113 * Various flags related to quotactl(2). Only relevant to XFS filesystems. 122 * Various flags related to quotactl(2). Only relevant to XFS filesystems.
114 */ 123 */
115#define XFS_QUOTA_UDQ_ACCT (1<<0) /* user quota accounting */ 124#define XFS_QUOTA_UDQ_ACCT (1<<0) /* user quota accounting */
diff --git a/include/linux/drbd.h b/include/linux/drbd.h
index 4341b1a97a34..68530521ad00 100644
--- a/include/linux/drbd.h
+++ b/include/linux/drbd.h
@@ -53,10 +53,10 @@
53 53
54 54
55extern const char *drbd_buildtag(void); 55extern const char *drbd_buildtag(void);
56#define REL_VERSION "8.3.7" 56#define REL_VERSION "8.3.8rc1"
57#define API_VERSION 88 57#define API_VERSION 88
58#define PRO_VERSION_MIN 86 58#define PRO_VERSION_MIN 86
59#define PRO_VERSION_MAX 92 59#define PRO_VERSION_MAX 94
60 60
61 61
62enum drbd_io_error_p { 62enum drbd_io_error_p {
@@ -139,6 +139,7 @@ enum drbd_ret_codes {
139 ERR_DATA_NOT_CURRENT = 150, 139 ERR_DATA_NOT_CURRENT = 150,
140 ERR_CONNECTED = 151, /* DRBD 8.3 only */ 140 ERR_CONNECTED = 151, /* DRBD 8.3 only */
141 ERR_PERM = 152, 141 ERR_PERM = 152,
142 ERR_NEED_APV_93 = 153,
142 143
143 /* insert new ones above this line */ 144 /* insert new ones above this line */
144 AFTER_LAST_ERR_CODE 145 AFTER_LAST_ERR_CODE
diff --git a/include/linux/drbd_limits.h b/include/linux/drbd_limits.h
index 51f47a586ad8..440b42e38e89 100644
--- a/include/linux/drbd_limits.h
+++ b/include/linux/drbd_limits.h
@@ -133,5 +133,21 @@
133#define DRBD_MAX_BIO_BVECS_MAX 128 133#define DRBD_MAX_BIO_BVECS_MAX 128
134#define DRBD_MAX_BIO_BVECS_DEF 0 134#define DRBD_MAX_BIO_BVECS_DEF 0
135 135
136#define DRBD_DP_VOLUME_MIN 4
137#define DRBD_DP_VOLUME_MAX 1048576
138#define DRBD_DP_VOLUME_DEF 16384
139
140#define DRBD_DP_INTERVAL_MIN 1
141#define DRBD_DP_INTERVAL_MAX 600
142#define DRBD_DP_INTERVAL_DEF 5
143
144#define DRBD_RS_THROTTLE_TH_MIN 1
145#define DRBD_RS_THROTTLE_TH_MAX 600
146#define DRBD_RS_THROTTLE_TH_DEF 20
147
148#define DRBD_RS_HOLD_OFF_TH_MIN 1
149#define DRBD_RS_HOLD_OFF_TH_MAX 6000
150#define DRBD_RS_HOLD_OFF_TH_DEF 100
151
136#undef RANGE 152#undef RANGE
137#endif 153#endif
diff --git a/include/linux/drbd_nl.h b/include/linux/drbd_nl.h
index f7431a4ca608..ce77a746fc9d 100644
--- a/include/linux/drbd_nl.h
+++ b/include/linux/drbd_nl.h
@@ -71,12 +71,17 @@ NL_PACKET(disconnect, 6, )
71NL_PACKET(resize, 7, 71NL_PACKET(resize, 7,
72 NL_INT64( 29, T_MAY_IGNORE, resize_size) 72 NL_INT64( 29, T_MAY_IGNORE, resize_size)
73 NL_BIT( 68, T_MAY_IGNORE, resize_force) 73 NL_BIT( 68, T_MAY_IGNORE, resize_force)
74 NL_BIT( 69, T_MANDATORY, no_resync)
74) 75)
75 76
76NL_PACKET(syncer_conf, 8, 77NL_PACKET(syncer_conf, 8,
77 NL_INTEGER( 30, T_MAY_IGNORE, rate) 78 NL_INTEGER( 30, T_MAY_IGNORE, rate)
78 NL_INTEGER( 31, T_MAY_IGNORE, after) 79 NL_INTEGER( 31, T_MAY_IGNORE, after)
79 NL_INTEGER( 32, T_MAY_IGNORE, al_extents) 80 NL_INTEGER( 32, T_MAY_IGNORE, al_extents)
81 NL_INTEGER( 71, T_MAY_IGNORE, dp_volume)
82 NL_INTEGER( 72, T_MAY_IGNORE, dp_interval)
83 NL_INTEGER( 73, T_MAY_IGNORE, throttle_th)
84 NL_INTEGER( 74, T_MAY_IGNORE, hold_off_th)
80 NL_STRING( 52, T_MAY_IGNORE, verify_alg, SHARED_SECRET_MAX) 85 NL_STRING( 52, T_MAY_IGNORE, verify_alg, SHARED_SECRET_MAX)
81 NL_STRING( 51, T_MAY_IGNORE, cpu_mask, 32) 86 NL_STRING( 51, T_MAY_IGNORE, cpu_mask, 32)
82 NL_STRING( 64, T_MAY_IGNORE, csums_alg, SHARED_SECRET_MAX) 87 NL_STRING( 64, T_MAY_IGNORE, csums_alg, SHARED_SECRET_MAX)
diff --git a/include/linux/ds2782_battery.h b/include/linux/ds2782_battery.h
new file mode 100644
index 000000000000..b4e281f65c15
--- /dev/null
+++ b/include/linux/ds2782_battery.h
@@ -0,0 +1,8 @@
1#ifndef __LINUX_DS2782_BATTERY_H
2#define __LINUX_DS2782_BATTERY_H
3
4struct ds278x_platform_data {
5 int rsns;
6};
7
8#endif
diff --git a/include/linux/dynamic_debug.h b/include/linux/dynamic_debug.h
index f8c2e1767500..b3cd4de9432b 100644
--- a/include/linux/dynamic_debug.h
+++ b/include/linux/dynamic_debug.h
@@ -28,7 +28,7 @@ struct _ddebug {
28 /* 28 /*
29 * The flags field controls the behaviour at the callsite. 29 * The flags field controls the behaviour at the callsite.
30 * The bits here are changed dynamically when the user 30 * The bits here are changed dynamically when the user
31 * writes commands to <debugfs>/dynamic_debug/ddebug 31 * writes commands to <debugfs>/dynamic_debug/control
32 */ 32 */
33#define _DPRINTK_FLAGS_PRINT (1<<0) /* printk() a message using the format */ 33#define _DPRINTK_FLAGS_PRINT (1<<0) /* printk() a message using the format */
34#define _DPRINTK_FLAGS_DEFAULT 0 34#define _DPRINTK_FLAGS_DEFAULT 0
diff --git a/include/linux/elevator.h b/include/linux/elevator.h
index 1cb3372e65d8..2c958f4fce1e 100644
--- a/include/linux/elevator.h
+++ b/include/linux/elevator.h
@@ -14,6 +14,9 @@ typedef void (elevator_merged_fn) (struct request_queue *, struct request *, int
14 14
15typedef int (elevator_allow_merge_fn) (struct request_queue *, struct request *, struct bio *); 15typedef int (elevator_allow_merge_fn) (struct request_queue *, struct request *, struct bio *);
16 16
17typedef void (elevator_bio_merged_fn) (struct request_queue *,
18 struct request *, struct bio *);
19
17typedef int (elevator_dispatch_fn) (struct request_queue *, int); 20typedef int (elevator_dispatch_fn) (struct request_queue *, int);
18 21
19typedef void (elevator_add_req_fn) (struct request_queue *, struct request *); 22typedef void (elevator_add_req_fn) (struct request_queue *, struct request *);
@@ -36,6 +39,7 @@ struct elevator_ops
36 elevator_merged_fn *elevator_merged_fn; 39 elevator_merged_fn *elevator_merged_fn;
37 elevator_merge_req_fn *elevator_merge_req_fn; 40 elevator_merge_req_fn *elevator_merge_req_fn;
38 elevator_allow_merge_fn *elevator_allow_merge_fn; 41 elevator_allow_merge_fn *elevator_allow_merge_fn;
42 elevator_bio_merged_fn *elevator_bio_merged_fn;
39 43
40 elevator_dispatch_fn *elevator_dispatch_fn; 44 elevator_dispatch_fn *elevator_dispatch_fn;
41 elevator_add_req_fn *elevator_add_req_fn; 45 elevator_add_req_fn *elevator_add_req_fn;
@@ -103,6 +107,8 @@ extern int elv_merge(struct request_queue *, struct request **, struct bio *);
103extern void elv_merge_requests(struct request_queue *, struct request *, 107extern void elv_merge_requests(struct request_queue *, struct request *,
104 struct request *); 108 struct request *);
105extern void elv_merged_request(struct request_queue *, struct request *, int); 109extern void elv_merged_request(struct request_queue *, struct request *, int);
110extern void elv_bio_merged(struct request_queue *q, struct request *,
111 struct bio *);
106extern void elv_requeue_request(struct request_queue *, struct request *); 112extern void elv_requeue_request(struct request_queue *, struct request *);
107extern int elv_queue_empty(struct request_queue *); 113extern int elv_queue_empty(struct request_queue *);
108extern struct request *elv_former_request(struct request_queue *, struct request *); 114extern struct request *elv_former_request(struct request_queue *, struct request *);
diff --git a/include/linux/elf.h b/include/linux/elf.h
index 597858418051..4d608014753a 100644
--- a/include/linux/elf.h
+++ b/include/linux/elf.h
@@ -394,6 +394,7 @@ typedef struct elf64_shdr {
394#define NT_S390_TODPREG 0x303 /* s390 TOD programmable register */ 394#define NT_S390_TODPREG 0x303 /* s390 TOD programmable register */
395#define NT_S390_CTRS 0x304 /* s390 control registers */ 395#define NT_S390_CTRS 0x304 /* s390 control registers */
396#define NT_S390_PREFIX 0x305 /* s390 prefix register */ 396#define NT_S390_PREFIX 0x305 /* s390 prefix register */
397#define NT_S390_LAST_BREAK 0x306 /* s390 breaking event address */
397 398
398 399
399/* Note header in a PT_NOTE section */ 400/* Note header in a PT_NOTE section */
diff --git a/include/linux/elfcore.h b/include/linux/elfcore.h
index e687bc3ba4da..394a3e0e4a6b 100644
--- a/include/linux/elfcore.h
+++ b/include/linux/elfcore.h
@@ -150,8 +150,6 @@ static inline int elf_core_copy_task_xfpregs(struct task_struct *t, elf_fpxregse
150} 150}
151#endif 151#endif
152 152
153#endif /* __KERNEL__ */
154
155/* 153/*
156 * These functions parameterize elf_core_dump in fs/binfmt_elf.c to write out 154 * These functions parameterize elf_core_dump in fs/binfmt_elf.c to write out
157 * extra segments containing the gate DSO contents. Dumping its 155 * extra segments containing the gate DSO contents. Dumping its
@@ -168,4 +166,6 @@ extern int
168elf_core_write_extra_data(struct file *file, size_t *size, unsigned long limit); 166elf_core_write_extra_data(struct file *file, size_t *size, unsigned long limit);
169extern size_t elf_core_extra_data_size(void); 167extern size_t elf_core_extra_data_size(void);
170 168
169#endif /* __KERNEL__ */
170
171#endif /* _LINUX_ELFCORE_H */ 171#endif /* _LINUX_ELFCORE_H */
diff --git a/include/linux/err.h b/include/linux/err.h
index 1b12642636c7..448afc12c78a 100644
--- a/include/linux/err.h
+++ b/include/linux/err.h
@@ -19,22 +19,22 @@
19 19
20#define IS_ERR_VALUE(x) unlikely((x) >= (unsigned long)-MAX_ERRNO) 20#define IS_ERR_VALUE(x) unlikely((x) >= (unsigned long)-MAX_ERRNO)
21 21
22static inline void *ERR_PTR(long error) 22static inline void * __must_check ERR_PTR(long error)
23{ 23{
24 return (void *) error; 24 return (void *) error;
25} 25}
26 26
27static inline long PTR_ERR(const void *ptr) 27static inline long __must_check PTR_ERR(const void *ptr)
28{ 28{
29 return (long) ptr; 29 return (long) ptr;
30} 30}
31 31
32static inline long IS_ERR(const void *ptr) 32static inline long __must_check IS_ERR(const void *ptr)
33{ 33{
34 return IS_ERR_VALUE((unsigned long)ptr); 34 return IS_ERR_VALUE((unsigned long)ptr);
35} 35}
36 36
37static inline long IS_ERR_OR_NULL(const void *ptr) 37static inline long __must_check IS_ERR_OR_NULL(const void *ptr)
38{ 38{
39 return !ptr || IS_ERR_VALUE((unsigned long)ptr); 39 return !ptr || IS_ERR_VALUE((unsigned long)ptr);
40} 40}
@@ -46,7 +46,7 @@ static inline long IS_ERR_OR_NULL(const void *ptr)
46 * Explicitly cast an error-valued pointer to another pointer type in such a 46 * Explicitly cast an error-valued pointer to another pointer type in such a
47 * way as to make it clear that's what's going on. 47 * way as to make it clear that's what's going on.
48 */ 48 */
49static inline void *ERR_CAST(const void *ptr) 49static inline void * __must_check ERR_CAST(const void *ptr)
50{ 50{
51 /* cast away the const */ 51 /* cast away the const */
52 return (void *) ptr; 52 return (void *) ptr;
diff --git a/include/linux/ext2_fs_sb.h b/include/linux/ext2_fs_sb.h
index 1cdb66367c98..db4d9f586bb6 100644
--- a/include/linux/ext2_fs_sb.h
+++ b/include/linux/ext2_fs_sb.h
@@ -106,6 +106,15 @@ struct ext2_sb_info {
106 spinlock_t s_rsv_window_lock; 106 spinlock_t s_rsv_window_lock;
107 struct rb_root s_rsv_window_root; 107 struct rb_root s_rsv_window_root;
108 struct ext2_reserve_window_node s_rsv_window_head; 108 struct ext2_reserve_window_node s_rsv_window_head;
109 /*
110 * s_lock protects against concurrent modifications of s_mount_state,
111 * s_blocks_last, s_overhead_last and the content of superblock's
112 * buffer pointed to by sbi->s_es.
113 *
114 * Note: It is used in ext2_show_options() to provide a consistent view
115 * of the mount options.
116 */
117 spinlock_t s_lock;
109}; 118};
110 119
111static inline spinlock_t * 120static inline spinlock_t *
diff --git a/include/linux/ext3_fs.h b/include/linux/ext3_fs.h
index 5f494b465097..7fc62d4550b2 100644
--- a/include/linux/ext3_fs.h
+++ b/include/linux/ext3_fs.h
@@ -868,7 +868,7 @@ extern int ext3_htree_store_dirent(struct file *dir_file, __u32 hash,
868extern void ext3_htree_free_dir_info(struct dir_private_info *p); 868extern void ext3_htree_free_dir_info(struct dir_private_info *p);
869 869
870/* fsync.c */ 870/* fsync.c */
871extern int ext3_sync_file (struct file *, struct dentry *, int); 871extern int ext3_sync_file(struct file *, int);
872 872
873/* hash.c */ 873/* hash.c */
874extern int ext3fs_dirhash(const char *name, int len, struct 874extern int ext3fs_dirhash(const char *name, int len, struct
diff --git a/include/linux/fb.h b/include/linux/fb.h
index c10163b4c40e..907ace3a64c8 100644
--- a/include/linux/fb.h
+++ b/include/linux/fb.h
@@ -4,8 +4,6 @@
4#include <linux/types.h> 4#include <linux/types.h>
5#include <linux/i2c.h> 5#include <linux/i2c.h>
6 6
7struct dentry;
8
9/* Definitions of frame buffers */ 7/* Definitions of frame buffers */
10 8
11#define FB_MAX 32 /* sufficient for now */ 9#define FB_MAX 32 /* sufficient for now */
@@ -37,7 +35,7 @@ struct dentry;
37#define FBIOGET_HWCINFO 0x4616 35#define FBIOGET_HWCINFO 0x4616
38#define FBIOPUT_MODEINFO 0x4617 36#define FBIOPUT_MODEINFO 0x4617
39#define FBIOGET_DISPINFO 0x4618 37#define FBIOGET_DISPINFO 0x4618
40 38#define FBIO_WAITFORVSYNC _IOW('F', 0x20, __u32)
41 39
42#define FB_TYPE_PACKED_PIXELS 0 /* Packed Pixels */ 40#define FB_TYPE_PACKED_PIXELS 0 /* Packed Pixels */
43#define FB_TYPE_PLANES 1 /* Non interleaved planes */ 41#define FB_TYPE_PLANES 1 /* Non interleaved planes */
@@ -403,6 +401,7 @@ struct fb_cursor {
403#include <linux/notifier.h> 401#include <linux/notifier.h>
404#include <linux/list.h> 402#include <linux/list.h>
405#include <linux/backlight.h> 403#include <linux/backlight.h>
404#include <linux/slab.h>
406#include <asm/io.h> 405#include <asm/io.h>
407 406
408struct vm_area_struct; 407struct vm_area_struct;
@@ -862,10 +861,22 @@ struct fb_info {
862 /* we need the PCI or similiar aperture base/size not 861 /* we need the PCI or similiar aperture base/size not
863 smem_start/size as smem_start may just be an object 862 smem_start/size as smem_start may just be an object
864 allocated inside the aperture so may not actually overlap */ 863 allocated inside the aperture so may not actually overlap */
865 resource_size_t aperture_base; 864 struct apertures_struct {
866 resource_size_t aperture_size; 865 unsigned int count;
866 struct aperture {
867 resource_size_t base;
868 resource_size_t size;
869 } ranges[0];
870 } *apertures;
867}; 871};
868 872
873static inline struct apertures_struct *alloc_apertures(unsigned int max_num) {
874 struct apertures_struct *a = kzalloc(sizeof(struct apertures_struct)
875 + max_num * sizeof(struct aperture), GFP_KERNEL);
876 a->count = max_num;
877 return a;
878}
879
869#ifdef MODULE 880#ifdef MODULE
870#define FBINFO_DEFAULT FBINFO_MODULE 881#define FBINFO_DEFAULT FBINFO_MODULE
871#else 882#else
@@ -958,6 +969,8 @@ extern ssize_t fb_sys_write(struct fb_info *info, const char __user *buf,
958/* drivers/video/fbmem.c */ 969/* drivers/video/fbmem.c */
959extern int register_framebuffer(struct fb_info *fb_info); 970extern int register_framebuffer(struct fb_info *fb_info);
960extern int unregister_framebuffer(struct fb_info *fb_info); 971extern int unregister_framebuffer(struct fb_info *fb_info);
972extern void remove_conflicting_framebuffers(struct apertures_struct *a,
973 const char *name, bool primary);
961extern int fb_prepare_logo(struct fb_info *fb_info, int rotate); 974extern int fb_prepare_logo(struct fb_info *fb_info, int rotate);
962extern int fb_show_logo(struct fb_info *fb_info, int rotate); 975extern int fb_show_logo(struct fb_info *fb_info, int rotate);
963extern char* fb_get_buffer_offset(struct fb_info *info, struct fb_pixmap *buf, u32 size); 976extern char* fb_get_buffer_offset(struct fb_info *info, struct fb_pixmap *buf, u32 size);
@@ -1002,8 +1015,7 @@ extern void fb_deferred_io_open(struct fb_info *info,
1002 struct inode *inode, 1015 struct inode *inode,
1003 struct file *file); 1016 struct file *file);
1004extern void fb_deferred_io_cleanup(struct fb_info *info); 1017extern void fb_deferred_io_cleanup(struct fb_info *info);
1005extern int fb_deferred_io_fsync(struct file *file, struct dentry *dentry, 1018extern int fb_deferred_io_fsync(struct file *file, int datasync);
1006 int datasync);
1007 1019
1008static inline bool fb_be_math(struct fb_info *info) 1020static inline bool fb_be_math(struct fb_info *info)
1009{ 1021{
diff --git a/include/linux/fcntl.h b/include/linux/fcntl.h
index 86037400a6e3..afc00af3229b 100644
--- a/include/linux/fcntl.h
+++ b/include/linux/fcntl.h
@@ -22,6 +22,12 @@
22#define F_NOTIFY (F_LINUX_SPECIFIC_BASE+2) 22#define F_NOTIFY (F_LINUX_SPECIFIC_BASE+2)
23 23
24/* 24/*
25 * Set and get of pipe page size array
26 */
27#define F_SETPIPE_SZ (F_LINUX_SPECIFIC_BASE + 7)
28#define F_GETPIPE_SZ (F_LINUX_SPECIFIC_BASE + 8)
29
30/*
25 * Types of directory notifications that may be requested. 31 * Types of directory notifications that may be requested.
26 */ 32 */
27#define DN_ACCESS 0x00000001 /* File accessed */ 33#define DN_ACCESS 0x00000001 /* File accessed */
diff --git a/include/linux/fec.h b/include/linux/fec.h
new file mode 100644
index 000000000000..5d3523d8dd0c
--- /dev/null
+++ b/include/linux/fec.h
@@ -0,0 +1,21 @@
1/* include/linux/fec.h
2 *
3 * Copyright (c) 2009 Orex Computed Radiography
4 * Baruch Siach <baruch@tkos.co.il>
5 *
6 * Header file for the FEC platform data
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11 */
12#ifndef __LINUX_FEC_H__
13#define __LINUX_FEC_H__
14
15#include <linux/phy.h>
16
17struct fec_platform_data {
18 phy_interface_t phy;
19};
20
21#endif
diff --git a/include/linux/file.h b/include/linux/file.h
index 5555508fd517..b1e12970f617 100644
--- a/include/linux/file.h
+++ b/include/linux/file.h
@@ -11,7 +11,6 @@
11 11
12struct file; 12struct file;
13 13
14extern void __fput(struct file *);
15extern void fput(struct file *); 14extern void fput(struct file *);
16extern void drop_file_write_access(struct file *file); 15extern void drop_file_write_access(struct file *file);
17 16
diff --git a/include/linux/firewire-cdev.h b/include/linux/firewire-cdev.h
index 81f3b14d5d76..68f883b30a53 100644
--- a/include/linux/firewire-cdev.h
+++ b/include/linux/firewire-cdev.h
@@ -17,7 +17,7 @@
17 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 19 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
20 * PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR 20 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
21 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 21 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
22 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 22 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
23 * DEALINGS IN THE SOFTWARE. 23 * DEALINGS IN THE SOFTWARE.
diff --git a/include/linux/firewire-constants.h b/include/linux/firewire-constants.h
index 9c63f06e67f2..9b4bb5fbba4b 100644
--- a/include/linux/firewire-constants.h
+++ b/include/linux/firewire-constants.h
@@ -17,7 +17,7 @@
17 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 17 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 18 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 19 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
20 * PRECISION INSIGHT AND/OR ITS SUPPLIERS BE LIABLE FOR ANY CLAIM, DAMAGES OR 20 * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR
21 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 21 * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
22 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 22 * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
23 * DEALINGS IN THE SOFTWARE. 23 * DEALINGS IN THE SOFTWARE.
diff --git a/include/linux/firewire.h b/include/linux/firewire.h
index 4bd94bf5e739..72e2b8ac2a5a 100644
--- a/include/linux/firewire.h
+++ b/include/linux/firewire.h
@@ -55,13 +55,11 @@
55#define CSR_DESCRIPTOR 0x01 55#define CSR_DESCRIPTOR 0x01
56#define CSR_VENDOR 0x03 56#define CSR_VENDOR 0x03
57#define CSR_HARDWARE_VERSION 0x04 57#define CSR_HARDWARE_VERSION 0x04
58#define CSR_NODE_CAPABILITIES 0x0c
59#define CSR_UNIT 0x11 58#define CSR_UNIT 0x11
60#define CSR_SPECIFIER_ID 0x12 59#define CSR_SPECIFIER_ID 0x12
61#define CSR_VERSION 0x13 60#define CSR_VERSION 0x13
62#define CSR_DEPENDENT_INFO 0x14 61#define CSR_DEPENDENT_INFO 0x14
63#define CSR_MODEL 0x17 62#define CSR_MODEL 0x17
64#define CSR_INSTANCE 0x18
65#define CSR_DIRECTORY_ID 0x20 63#define CSR_DIRECTORY_ID 0x20
66 64
67struct fw_csr_iterator { 65struct fw_csr_iterator {
@@ -89,7 +87,6 @@ struct fw_card {
89 int current_tlabel; 87 int current_tlabel;
90 u64 tlabel_mask; 88 u64 tlabel_mask;
91 struct list_head transaction_list; 89 struct list_head transaction_list;
92 struct timer_list flush_timer;
93 unsigned long reset_jiffies; 90 unsigned long reset_jiffies;
94 91
95 unsigned long long guid; 92 unsigned long long guid;
@@ -290,6 +287,8 @@ struct fw_transaction {
290 int tlabel; 287 int tlabel;
291 int timestamp; 288 int timestamp;
292 struct list_head link; 289 struct list_head link;
290 struct fw_card *card;
291 struct timer_list split_timeout_timer;
293 292
294 struct fw_packet packet; 293 struct fw_packet packet;
295 294
diff --git a/include/linux/firmware.h b/include/linux/firmware.h
index 043811f0d277..53d1e6c4f848 100644
--- a/include/linux/firmware.h
+++ b/include/linux/firmware.h
@@ -12,6 +12,7 @@
12struct firmware { 12struct firmware {
13 size_t size; 13 size_t size;
14 const u8 *data; 14 const u8 *data;
15 struct page **pages;
15}; 16};
16 17
17struct device; 18struct device;
diff --git a/include/linux/fs.h b/include/linux/fs.h
index 018d382f6f92..3428393942a6 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -651,6 +651,7 @@ struct block_device {
651 int bd_openers; 651 int bd_openers;
652 struct mutex bd_mutex; /* open/close mutex */ 652 struct mutex bd_mutex; /* open/close mutex */
653 struct list_head bd_inodes; 653 struct list_head bd_inodes;
654 void * bd_claiming;
654 void * bd_holder; 655 void * bd_holder;
655 int bd_holders; 656 int bd_holders;
656#ifdef CONFIG_SYSFS 657#ifdef CONFIG_SYSFS
@@ -953,6 +954,7 @@ extern spinlock_t files_lock;
953#define file_list_unlock() spin_unlock(&files_lock); 954#define file_list_unlock() spin_unlock(&files_lock);
954 955
955#define get_file(x) atomic_long_inc(&(x)->f_count) 956#define get_file(x) atomic_long_inc(&(x)->f_count)
957#define fput_atomic(x) atomic_long_add_unless(&(x)->f_count, -1, 1)
956#define file_count(x) atomic_long_read(&(x)->f_count) 958#define file_count(x) atomic_long_read(&(x)->f_count)
957 959
958#ifdef CONFIG_DEBUG_WRITECOUNT 960#ifdef CONFIG_DEBUG_WRITECOUNT
@@ -1314,8 +1316,6 @@ extern int send_sigurg(struct fown_struct *fown);
1314extern struct list_head super_blocks; 1316extern struct list_head super_blocks;
1315extern spinlock_t sb_lock; 1317extern spinlock_t sb_lock;
1316 1318
1317#define sb_entry(list) list_entry((list), struct super_block, s_list)
1318#define S_BIAS (1<<30)
1319struct super_block { 1319struct super_block {
1320 struct list_head s_list; /* Keep this first */ 1320 struct list_head s_list; /* Keep this first */
1321 dev_t s_dev; /* search index; _not_ kdev_t */ 1321 dev_t s_dev; /* search index; _not_ kdev_t */
@@ -1334,12 +1334,11 @@ struct super_block {
1334 struct rw_semaphore s_umount; 1334 struct rw_semaphore s_umount;
1335 struct mutex s_lock; 1335 struct mutex s_lock;
1336 int s_count; 1336 int s_count;
1337 int s_need_sync;
1338 atomic_t s_active; 1337 atomic_t s_active;
1339#ifdef CONFIG_SECURITY 1338#ifdef CONFIG_SECURITY
1340 void *s_security; 1339 void *s_security;
1341#endif 1340#endif
1342 struct xattr_handler **s_xattr; 1341 const struct xattr_handler **s_xattr;
1343 1342
1344 struct list_head s_inodes; /* all inodes */ 1343 struct list_head s_inodes; /* all inodes */
1345 struct hlist_head s_anon; /* anonymous dentries for (nfs) exporting */ 1344 struct hlist_head s_anon; /* anonymous dentries for (nfs) exporting */
@@ -1431,7 +1430,8 @@ extern void dentry_unhash(struct dentry *dentry);
1431 * VFS file helper functions. 1430 * VFS file helper functions.
1432 */ 1431 */
1433extern int file_permission(struct file *, int); 1432extern int file_permission(struct file *, int);
1434 1433extern void inode_init_owner(struct inode *inode, const struct inode *dir,
1434 mode_t mode);
1435/* 1435/*
1436 * VFS FS_IOC_FIEMAP helper definitions. 1436 * VFS FS_IOC_FIEMAP helper definitions.
1437 */ 1437 */
@@ -1498,7 +1498,7 @@ struct file_operations {
1498 int (*open) (struct inode *, struct file *); 1498 int (*open) (struct inode *, struct file *);
1499 int (*flush) (struct file *, fl_owner_t id); 1499 int (*flush) (struct file *, fl_owner_t id);
1500 int (*release) (struct inode *, struct file *); 1500 int (*release) (struct inode *, struct file *);
1501 int (*fsync) (struct file *, struct dentry *, int datasync); 1501 int (*fsync) (struct file *, int datasync);
1502 int (*aio_fsync) (struct kiocb *, int datasync); 1502 int (*aio_fsync) (struct kiocb *, int datasync);
1503 int (*fasync) (int, struct file *, int); 1503 int (*fasync) (int, struct file *, int);
1504 int (*lock) (struct file *, int, struct file_lock *); 1504 int (*lock) (struct file *, int, struct file_lock *);
@@ -1744,6 +1744,7 @@ struct file_system_type {
1744 1744
1745 struct lock_class_key s_lock_key; 1745 struct lock_class_key s_lock_key;
1746 struct lock_class_key s_umount_key; 1746 struct lock_class_key s_umount_key;
1747 struct lock_class_key s_vfs_rename_key;
1747 1748
1748 struct lock_class_key i_lock_key; 1749 struct lock_class_key i_lock_key;
1749 struct lock_class_key i_mutex_key; 1750 struct lock_class_key i_mutex_key;
@@ -1781,8 +1782,6 @@ extern int get_sb_pseudo(struct file_system_type *, char *,
1781 const struct super_operations *ops, unsigned long, 1782 const struct super_operations *ops, unsigned long,
1782 struct vfsmount *mnt); 1783 struct vfsmount *mnt);
1783extern void simple_set_mnt(struct vfsmount *mnt, struct super_block *sb); 1784extern void simple_set_mnt(struct vfsmount *mnt, struct super_block *sb);
1784int __put_super_and_need_restart(struct super_block *sb);
1785void put_super(struct super_block *sb);
1786 1785
1787/* Alas, no aliases. Too much hassle with bringing module.h everywhere */ 1786/* Alas, no aliases. Too much hassle with bringing module.h everywhere */
1788#define fops_get(fops) \ 1787#define fops_get(fops) \
@@ -1802,6 +1801,8 @@ extern void drop_collected_mounts(struct vfsmount *);
1802extern int iterate_mounts(int (*)(struct vfsmount *, void *), void *, 1801extern int iterate_mounts(int (*)(struct vfsmount *, void *), void *,
1803 struct vfsmount *); 1802 struct vfsmount *);
1804extern int vfs_statfs(struct dentry *, struct kstatfs *); 1803extern int vfs_statfs(struct dentry *, struct kstatfs *);
1804extern int freeze_super(struct super_block *super);
1805extern int thaw_super(struct super_block *super);
1805 1806
1806extern int current_umask(void); 1807extern int current_umask(void);
1807 1808
@@ -2087,9 +2088,9 @@ extern int __filemap_fdatawrite_range(struct address_space *mapping,
2087extern int filemap_fdatawrite_range(struct address_space *mapping, 2088extern int filemap_fdatawrite_range(struct address_space *mapping,
2088 loff_t start, loff_t end); 2089 loff_t start, loff_t end);
2089 2090
2090extern int vfs_fsync_range(struct file *file, struct dentry *dentry, 2091extern int vfs_fsync_range(struct file *file, loff_t start, loff_t end,
2091 loff_t start, loff_t end, int datasync); 2092 int datasync);
2092extern int vfs_fsync(struct file *file, struct dentry *dentry, int datasync); 2093extern int vfs_fsync(struct file *file, int datasync);
2093extern int generic_write_sync(struct file *file, loff_t pos, loff_t count); 2094extern int generic_write_sync(struct file *file, loff_t pos, loff_t count);
2094extern void sync_supers(void); 2095extern void sync_supers(void);
2095extern void emergency_sync(void); 2096extern void emergency_sync(void);
@@ -2212,7 +2213,7 @@ extern int generic_segment_checks(const struct iovec *iov,
2212/* fs/block_dev.c */ 2213/* fs/block_dev.c */
2213extern ssize_t blkdev_aio_write(struct kiocb *iocb, const struct iovec *iov, 2214extern ssize_t blkdev_aio_write(struct kiocb *iocb, const struct iovec *iov,
2214 unsigned long nr_segs, loff_t pos); 2215 unsigned long nr_segs, loff_t pos);
2215extern int blkdev_fsync(struct file *filp, struct dentry *dentry, int datasync); 2216extern int blkdev_fsync(struct file *filp, int datasync);
2216 2217
2217/* fs/splice.c */ 2218/* fs/splice.c */
2218extern ssize_t generic_file_splice_read(struct file *, loff_t *, 2219extern ssize_t generic_file_splice_read(struct file *, loff_t *,
@@ -2228,6 +2229,7 @@ extern long do_splice_direct(struct file *in, loff_t *ppos, struct file *out,
2228 2229
2229extern void 2230extern void
2230file_ra_state_init(struct file_ra_state *ra, struct address_space *mapping); 2231file_ra_state_init(struct file_ra_state *ra, struct address_space *mapping);
2232extern loff_t noop_llseek(struct file *file, loff_t offset, int origin);
2231extern loff_t no_llseek(struct file *file, loff_t offset, int origin); 2233extern loff_t no_llseek(struct file *file, loff_t offset, int origin);
2232extern loff_t generic_file_llseek(struct file *file, loff_t offset, int origin); 2234extern loff_t generic_file_llseek(struct file *file, loff_t offset, int origin);
2233extern loff_t generic_file_llseek_unlocked(struct file *file, loff_t offset, 2235extern loff_t generic_file_llseek_unlocked(struct file *file, loff_t offset,
@@ -2250,10 +2252,19 @@ static inline int xip_truncate_page(struct address_space *mapping, loff_t from)
2250#endif 2252#endif
2251 2253
2252#ifdef CONFIG_BLOCK 2254#ifdef CONFIG_BLOCK
2255struct bio;
2256typedef void (dio_submit_t)(int rw, struct bio *bio, struct inode *inode,
2257 loff_t file_offset);
2258void dio_end_io(struct bio *bio, int error);
2259
2260ssize_t __blockdev_direct_IO_newtrunc(int rw, struct kiocb *iocb, struct inode *inode,
2261 struct block_device *bdev, const struct iovec *iov, loff_t offset,
2262 unsigned long nr_segs, get_block_t get_block, dio_iodone_t end_io,
2263 dio_submit_t submit_io, int lock_type);
2253ssize_t __blockdev_direct_IO(int rw, struct kiocb *iocb, struct inode *inode, 2264ssize_t __blockdev_direct_IO(int rw, struct kiocb *iocb, struct inode *inode,
2254 struct block_device *bdev, const struct iovec *iov, loff_t offset, 2265 struct block_device *bdev, const struct iovec *iov, loff_t offset,
2255 unsigned long nr_segs, get_block_t get_block, dio_iodone_t end_io, 2266 unsigned long nr_segs, get_block_t get_block, dio_iodone_t end_io,
2256 int lock_type); 2267 dio_submit_t submit_io, int lock_type);
2257 2268
2258enum { 2269enum {
2259 /* need locking between buffered and direct access */ 2270 /* need locking between buffered and direct access */
@@ -2263,13 +2274,31 @@ enum {
2263 DIO_SKIP_HOLES = 0x02, 2274 DIO_SKIP_HOLES = 0x02,
2264}; 2275};
2265 2276
2277static inline ssize_t blockdev_direct_IO_newtrunc(int rw, struct kiocb *iocb,
2278 struct inode *inode, struct block_device *bdev, const struct iovec *iov,
2279 loff_t offset, unsigned long nr_segs, get_block_t get_block,
2280 dio_iodone_t end_io)
2281{
2282 return __blockdev_direct_IO_newtrunc(rw, iocb, inode, bdev, iov, offset,
2283 nr_segs, get_block, end_io, NULL,
2284 DIO_LOCKING | DIO_SKIP_HOLES);
2285}
2286
2287static inline ssize_t blockdev_direct_IO_no_locking_newtrunc(int rw, struct kiocb *iocb,
2288 struct inode *inode, struct block_device *bdev, const struct iovec *iov,
2289 loff_t offset, unsigned long nr_segs, get_block_t get_block,
2290 dio_iodone_t end_io)
2291{
2292 return __blockdev_direct_IO_newtrunc(rw, iocb, inode, bdev, iov, offset,
2293 nr_segs, get_block, end_io, NULL, 0);
2294}
2266static inline ssize_t blockdev_direct_IO(int rw, struct kiocb *iocb, 2295static inline ssize_t blockdev_direct_IO(int rw, struct kiocb *iocb,
2267 struct inode *inode, struct block_device *bdev, const struct iovec *iov, 2296 struct inode *inode, struct block_device *bdev, const struct iovec *iov,
2268 loff_t offset, unsigned long nr_segs, get_block_t get_block, 2297 loff_t offset, unsigned long nr_segs, get_block_t get_block,
2269 dio_iodone_t end_io) 2298 dio_iodone_t end_io)
2270{ 2299{
2271 return __blockdev_direct_IO(rw, iocb, inode, bdev, iov, offset, 2300 return __blockdev_direct_IO(rw, iocb, inode, bdev, iov, offset,
2272 nr_segs, get_block, end_io, 2301 nr_segs, get_block, end_io, NULL,
2273 DIO_LOCKING | DIO_SKIP_HOLES); 2302 DIO_LOCKING | DIO_SKIP_HOLES);
2274} 2303}
2275 2304
@@ -2279,7 +2308,7 @@ static inline ssize_t blockdev_direct_IO_no_locking(int rw, struct kiocb *iocb,
2279 dio_iodone_t end_io) 2308 dio_iodone_t end_io)
2280{ 2309{
2281 return __blockdev_direct_IO(rw, iocb, inode, bdev, iov, offset, 2310 return __blockdev_direct_IO(rw, iocb, inode, bdev, iov, offset,
2282 nr_segs, get_block, end_io, 0); 2311 nr_segs, get_block, end_io, NULL, 0);
2283} 2312}
2284#endif 2313#endif
2285 2314
@@ -2315,8 +2344,9 @@ extern int vfs_fstatat(int , char __user *, struct kstat *, int);
2315extern int do_vfs_ioctl(struct file *filp, unsigned int fd, unsigned int cmd, 2344extern int do_vfs_ioctl(struct file *filp, unsigned int fd, unsigned int cmd,
2316 unsigned long arg); 2345 unsigned long arg);
2317extern int __generic_block_fiemap(struct inode *inode, 2346extern int __generic_block_fiemap(struct inode *inode,
2318 struct fiemap_extent_info *fieinfo, u64 start, 2347 struct fiemap_extent_info *fieinfo,
2319 u64 len, get_block_t *get_block); 2348 loff_t start, loff_t len,
2349 get_block_t *get_block);
2320extern int generic_block_fiemap(struct inode *inode, 2350extern int generic_block_fiemap(struct inode *inode,
2321 struct fiemap_extent_info *fieinfo, u64 start, 2351 struct fiemap_extent_info *fieinfo, u64 start,
2322 u64 len, get_block_t *get_block); 2352 u64 len, get_block_t *get_block);
@@ -2328,18 +2358,21 @@ extern struct super_block *get_super(struct block_device *);
2328extern struct super_block *get_active_super(struct block_device *bdev); 2358extern struct super_block *get_active_super(struct block_device *bdev);
2329extern struct super_block *user_get_super(dev_t); 2359extern struct super_block *user_get_super(dev_t);
2330extern void drop_super(struct super_block *sb); 2360extern void drop_super(struct super_block *sb);
2361extern void iterate_supers(void (*)(struct super_block *, void *), void *);
2331 2362
2332extern int dcache_dir_open(struct inode *, struct file *); 2363extern int dcache_dir_open(struct inode *, struct file *);
2333extern int dcache_dir_close(struct inode *, struct file *); 2364extern int dcache_dir_close(struct inode *, struct file *);
2334extern loff_t dcache_dir_lseek(struct file *, loff_t, int); 2365extern loff_t dcache_dir_lseek(struct file *, loff_t, int);
2335extern int dcache_readdir(struct file *, void *, filldir_t); 2366extern int dcache_readdir(struct file *, void *, filldir_t);
2367extern int simple_setattr(struct dentry *, struct iattr *);
2336extern int simple_getattr(struct vfsmount *, struct dentry *, struct kstat *); 2368extern int simple_getattr(struct vfsmount *, struct dentry *, struct kstat *);
2337extern int simple_statfs(struct dentry *, struct kstatfs *); 2369extern int simple_statfs(struct dentry *, struct kstatfs *);
2338extern int simple_link(struct dentry *, struct inode *, struct dentry *); 2370extern int simple_link(struct dentry *, struct inode *, struct dentry *);
2339extern int simple_unlink(struct inode *, struct dentry *); 2371extern int simple_unlink(struct inode *, struct dentry *);
2340extern int simple_rmdir(struct inode *, struct dentry *); 2372extern int simple_rmdir(struct inode *, struct dentry *);
2341extern int simple_rename(struct inode *, struct dentry *, struct inode *, struct dentry *); 2373extern int simple_rename(struct inode *, struct dentry *, struct inode *, struct dentry *);
2342extern int simple_sync_file(struct file *, struct dentry *, int); 2374extern int simple_setsize(struct inode *, loff_t);
2375extern int noop_fsync(struct file *, int);
2343extern int simple_empty(struct dentry *); 2376extern int simple_empty(struct dentry *);
2344extern int simple_readpage(struct file *file, struct page *page); 2377extern int simple_readpage(struct file *file, struct page *page);
2345extern int simple_write_begin(struct file *file, struct address_space *mapping, 2378extern int simple_write_begin(struct file *file, struct address_space *mapping,
@@ -2361,8 +2394,10 @@ extern void simple_release_fs(struct vfsmount **mount, int *count);
2361 2394
2362extern ssize_t simple_read_from_buffer(void __user *to, size_t count, 2395extern ssize_t simple_read_from_buffer(void __user *to, size_t count,
2363 loff_t *ppos, const void *from, size_t available); 2396 loff_t *ppos, const void *from, size_t available);
2397extern ssize_t simple_write_to_buffer(void *to, size_t available, loff_t *ppos,
2398 const void __user *from, size_t count);
2364 2399
2365extern int simple_fsync(struct file *, struct dentry *, int); 2400extern int generic_file_fsync(struct file *, int);
2366 2401
2367#ifdef CONFIG_MIGRATION 2402#ifdef CONFIG_MIGRATION
2368extern int buffer_migrate_page(struct address_space *, 2403extern int buffer_migrate_page(struct address_space *,
@@ -2373,7 +2408,8 @@ extern int buffer_migrate_page(struct address_space *,
2373 2408
2374extern int inode_change_ok(const struct inode *, struct iattr *); 2409extern int inode_change_ok(const struct inode *, struct iattr *);
2375extern int inode_newsize_ok(const struct inode *, loff_t offset); 2410extern int inode_newsize_ok(const struct inode *, loff_t offset);
2376extern int __must_check inode_setattr(struct inode *, struct iattr *); 2411extern int __must_check inode_setattr(struct inode *, const struct iattr *);
2412extern void generic_setattr(struct inode *inode, const struct iattr *attr);
2377 2413
2378extern void file_update_time(struct file *file); 2414extern void file_update_time(struct file *file);
2379 2415
diff --git a/include/linux/ftrace.h b/include/linux/ftrace.h
index 01e6adea07ec..41e46330d9be 100644
--- a/include/linux/ftrace.h
+++ b/include/linux/ftrace.h
@@ -82,9 +82,13 @@ void clear_ftrace_function(void);
82extern void ftrace_stub(unsigned long a0, unsigned long a1); 82extern void ftrace_stub(unsigned long a0, unsigned long a1);
83 83
84#else /* !CONFIG_FUNCTION_TRACER */ 84#else /* !CONFIG_FUNCTION_TRACER */
85# define register_ftrace_function(ops) do { } while (0) 85/*
86# define unregister_ftrace_function(ops) do { } while (0) 86 * (un)register_ftrace_function must be a macro since the ops parameter
87# define clear_ftrace_function(ops) do { } while (0) 87 * must not be evaluated.
88 */
89#define register_ftrace_function(ops) ({ 0; })
90#define unregister_ftrace_function(ops) ({ 0; })
91static inline void clear_ftrace_function(void) { }
88static inline void ftrace_kill(void) { } 92static inline void ftrace_kill(void) { }
89static inline void ftrace_stop(void) { } 93static inline void ftrace_stop(void) { }
90static inline void ftrace_start(void) { } 94static inline void ftrace_start(void) { }
@@ -237,11 +241,13 @@ extern int skip_trace(unsigned long ip);
237extern void ftrace_disable_daemon(void); 241extern void ftrace_disable_daemon(void);
238extern void ftrace_enable_daemon(void); 242extern void ftrace_enable_daemon(void);
239#else 243#else
240# define skip_trace(ip) ({ 0; }) 244static inline int skip_trace(unsigned long ip) { return 0; }
241# define ftrace_force_update() ({ 0; }) 245static inline int ftrace_force_update(void) { return 0; }
242# define ftrace_set_filter(buf, len, reset) do { } while (0) 246static inline void ftrace_set_filter(unsigned char *buf, int len, int reset)
243# define ftrace_disable_daemon() do { } while (0) 247{
244# define ftrace_enable_daemon() do { } while (0) 248}
249static inline void ftrace_disable_daemon(void) { }
250static inline void ftrace_enable_daemon(void) { }
245static inline void ftrace_release_mod(struct module *mod) {} 251static inline void ftrace_release_mod(struct module *mod) {}
246static inline int register_ftrace_command(struct ftrace_func_command *cmd) 252static inline int register_ftrace_command(struct ftrace_func_command *cmd)
247{ 253{
@@ -314,16 +320,16 @@ static inline void __ftrace_enabled_restore(int enabled)
314 extern void time_hardirqs_on(unsigned long a0, unsigned long a1); 320 extern void time_hardirqs_on(unsigned long a0, unsigned long a1);
315 extern void time_hardirqs_off(unsigned long a0, unsigned long a1); 321 extern void time_hardirqs_off(unsigned long a0, unsigned long a1);
316#else 322#else
317# define time_hardirqs_on(a0, a1) do { } while (0) 323 static inline void time_hardirqs_on(unsigned long a0, unsigned long a1) { }
318# define time_hardirqs_off(a0, a1) do { } while (0) 324 static inline void time_hardirqs_off(unsigned long a0, unsigned long a1) { }
319#endif 325#endif
320 326
321#ifdef CONFIG_PREEMPT_TRACER 327#ifdef CONFIG_PREEMPT_TRACER
322 extern void trace_preempt_on(unsigned long a0, unsigned long a1); 328 extern void trace_preempt_on(unsigned long a0, unsigned long a1);
323 extern void trace_preempt_off(unsigned long a0, unsigned long a1); 329 extern void trace_preempt_off(unsigned long a0, unsigned long a1);
324#else 330#else
325# define trace_preempt_on(a0, a1) do { } while (0) 331 static inline void trace_preempt_on(unsigned long a0, unsigned long a1) { }
326# define trace_preempt_off(a0, a1) do { } while (0) 332 static inline void trace_preempt_off(unsigned long a0, unsigned long a1) { }
327#endif 333#endif
328 334
329#ifdef CONFIG_FTRACE_MCOUNT_RECORD 335#ifdef CONFIG_FTRACE_MCOUNT_RECORD
@@ -352,6 +358,10 @@ struct ftrace_graph_ret {
352 int depth; 358 int depth;
353}; 359};
354 360
361/* Type of the callback handlers for tracing function graph*/
362typedef void (*trace_func_graph_ret_t)(struct ftrace_graph_ret *); /* return */
363typedef int (*trace_func_graph_ent_t)(struct ftrace_graph_ent *); /* entry */
364
355#ifdef CONFIG_FUNCTION_GRAPH_TRACER 365#ifdef CONFIG_FUNCTION_GRAPH_TRACER
356 366
357/* for init task */ 367/* for init task */
@@ -400,10 +410,6 @@ extern char __irqentry_text_end[];
400 410
401#define FTRACE_RETFUNC_DEPTH 50 411#define FTRACE_RETFUNC_DEPTH 50
402#define FTRACE_RETSTACK_ALLOC_SIZE 32 412#define FTRACE_RETSTACK_ALLOC_SIZE 32
403/* Type of the callback handlers for tracing function graph*/
404typedef void (*trace_func_graph_ret_t)(struct ftrace_graph_ret *); /* return */
405typedef int (*trace_func_graph_ent_t)(struct ftrace_graph_ent *); /* entry */
406
407extern int register_ftrace_graph(trace_func_graph_ret_t retfunc, 413extern int register_ftrace_graph(trace_func_graph_ret_t retfunc,
408 trace_func_graph_ent_t entryfunc); 414 trace_func_graph_ent_t entryfunc);
409 415
@@ -441,6 +447,13 @@ static inline void unpause_graph_tracing(void)
441static inline void ftrace_graph_init_task(struct task_struct *t) { } 447static inline void ftrace_graph_init_task(struct task_struct *t) { }
442static inline void ftrace_graph_exit_task(struct task_struct *t) { } 448static inline void ftrace_graph_exit_task(struct task_struct *t) { }
443 449
450static inline int register_ftrace_graph(trace_func_graph_ret_t retfunc,
451 trace_func_graph_ent_t entryfunc)
452{
453 return -1;
454}
455static inline void unregister_ftrace_graph(void) { }
456
444static inline int task_curr_ret_stack(struct task_struct *tsk) 457static inline int task_curr_ret_stack(struct task_struct *tsk)
445{ 458{
446 return -1; 459 return -1;
@@ -492,7 +505,9 @@ static inline int test_tsk_trace_graph(struct task_struct *tsk)
492 return tsk->trace & TSK_TRACE_FL_GRAPH; 505 return tsk->trace & TSK_TRACE_FL_GRAPH;
493} 506}
494 507
495extern int ftrace_dump_on_oops; 508enum ftrace_dump_mode;
509
510extern enum ftrace_dump_mode ftrace_dump_on_oops;
496 511
497#ifdef CONFIG_PREEMPT 512#ifdef CONFIG_PREEMPT
498#define INIT_TRACE_RECURSION .trace_recursion = 0, 513#define INIT_TRACE_RECURSION .trace_recursion = 0,
@@ -504,18 +519,6 @@ extern int ftrace_dump_on_oops;
504#define INIT_TRACE_RECURSION 519#define INIT_TRACE_RECURSION
505#endif 520#endif
506 521
507#ifdef CONFIG_HW_BRANCH_TRACER
508
509void trace_hw_branch(u64 from, u64 to);
510void trace_hw_branch_oops(void);
511
512#else /* CONFIG_HW_BRANCH_TRACER */
513
514static inline void trace_hw_branch(u64 from, u64 to) {}
515static inline void trace_hw_branch_oops(void) {}
516
517#endif /* CONFIG_HW_BRANCH_TRACER */
518
519#ifdef CONFIG_FTRACE_SYSCALLS 522#ifdef CONFIG_FTRACE_SYSCALLS
520 523
521unsigned long arch_syscall_addr(int nr); 524unsigned long arch_syscall_addr(int nr);
diff --git a/include/linux/ftrace_event.h b/include/linux/ftrace_event.h
index c0f4b364c711..3167f2df4126 100644
--- a/include/linux/ftrace_event.h
+++ b/include/linux/ftrace_event.h
@@ -25,6 +25,9 @@ const char *ftrace_print_flags_seq(struct trace_seq *p, const char *delim,
25const char *ftrace_print_symbols_seq(struct trace_seq *p, unsigned long val, 25const char *ftrace_print_symbols_seq(struct trace_seq *p, unsigned long val,
26 const struct trace_print_flags *symbol_array); 26 const struct trace_print_flags *symbol_array);
27 27
28const char *ftrace_print_hex_seq(struct trace_seq *p,
29 const unsigned char *buf, int len);
30
28/* 31/*
29 * The trace entry - the most basic unit of tracing. This is what 32 * The trace entry - the most basic unit of tracing. This is what
30 * is printed in the end as a single line in the trace output, such as: 33 * is printed in the end as a single line in the trace output, such as:
@@ -58,6 +61,7 @@ struct trace_iterator {
58 /* The below is zeroed out in pipe_read */ 61 /* The below is zeroed out in pipe_read */
59 struct trace_seq seq; 62 struct trace_seq seq;
60 struct trace_entry *ent; 63 struct trace_entry *ent;
64 unsigned long lost_events;
61 int leftover; 65 int leftover;
62 int cpu; 66 int cpu;
63 u64 ts; 67 u64 ts;
@@ -69,18 +73,25 @@ struct trace_iterator {
69}; 73};
70 74
71 75
76struct trace_event;
77
72typedef enum print_line_t (*trace_print_func)(struct trace_iterator *iter, 78typedef enum print_line_t (*trace_print_func)(struct trace_iterator *iter,
73 int flags); 79 int flags, struct trace_event *event);
74struct trace_event { 80
75 struct hlist_node node; 81struct trace_event_functions {
76 struct list_head list;
77 int type;
78 trace_print_func trace; 82 trace_print_func trace;
79 trace_print_func raw; 83 trace_print_func raw;
80 trace_print_func hex; 84 trace_print_func hex;
81 trace_print_func binary; 85 trace_print_func binary;
82}; 86};
83 87
88struct trace_event {
89 struct hlist_node node;
90 struct list_head list;
91 int type;
92 struct trace_event_functions *funcs;
93};
94
84extern int register_ftrace_event(struct trace_event *event); 95extern int register_ftrace_event(struct trace_event *event);
85extern int unregister_ftrace_event(struct trace_event *event); 96extern int unregister_ftrace_event(struct trace_event *event);
86 97
@@ -112,28 +123,70 @@ void tracing_record_cmdline(struct task_struct *tsk);
112 123
113struct event_filter; 124struct event_filter;
114 125
126enum trace_reg {
127 TRACE_REG_REGISTER,
128 TRACE_REG_UNREGISTER,
129 TRACE_REG_PERF_REGISTER,
130 TRACE_REG_PERF_UNREGISTER,
131};
132
133struct ftrace_event_call;
134
135struct ftrace_event_class {
136 char *system;
137 void *probe;
138#ifdef CONFIG_PERF_EVENTS
139 void *perf_probe;
140#endif
141 int (*reg)(struct ftrace_event_call *event,
142 enum trace_reg type);
143 int (*define_fields)(struct ftrace_event_call *);
144 struct list_head *(*get_fields)(struct ftrace_event_call *);
145 struct list_head fields;
146 int (*raw_init)(struct ftrace_event_call *);
147};
148
149enum {
150 TRACE_EVENT_FL_ENABLED_BIT,
151 TRACE_EVENT_FL_FILTERED_BIT,
152};
153
154enum {
155 TRACE_EVENT_FL_ENABLED = (1 << TRACE_EVENT_FL_ENABLED_BIT),
156 TRACE_EVENT_FL_FILTERED = (1 << TRACE_EVENT_FL_FILTERED_BIT),
157};
158
115struct ftrace_event_call { 159struct ftrace_event_call {
116 struct list_head list; 160 struct list_head list;
161 struct ftrace_event_class *class;
117 char *name; 162 char *name;
118 char *system;
119 struct dentry *dir; 163 struct dentry *dir;
120 struct trace_event *event; 164 struct trace_event event;
121 int enabled;
122 int (*regfunc)(struct ftrace_event_call *);
123 void (*unregfunc)(struct ftrace_event_call *);
124 int id;
125 const char *print_fmt; 165 const char *print_fmt;
126 int (*raw_init)(struct ftrace_event_call *);
127 int (*define_fields)(struct ftrace_event_call *);
128 struct list_head fields;
129 int filter_active;
130 struct event_filter *filter; 166 struct event_filter *filter;
131 void *mod; 167 void *mod;
132 void *data; 168 void *data;
133 169
170 /*
171 * 32 bit flags:
172 * bit 1: enabled
173 * bit 2: filter_active
174 *
175 * Changes to flags must hold the event_mutex.
176 *
177 * Note: Reads of flags do not hold the event_mutex since
178 * they occur in critical sections. But the way flags
179 * is currently used, these changes do no affect the code
180 * except that when a change is made, it may have a slight
181 * delay in propagating the changes to other CPUs due to
182 * caching and such.
183 */
184 unsigned int flags;
185
186#ifdef CONFIG_PERF_EVENTS
134 int perf_refcount; 187 int perf_refcount;
135 int (*perf_event_enable)(struct ftrace_event_call *); 188 struct hlist_head *perf_events;
136 void (*perf_event_disable)(struct ftrace_event_call *); 189#endif
137}; 190};
138 191
139#define PERF_MAX_TRACE_SIZE 2048 192#define PERF_MAX_TRACE_SIZE 2048
@@ -190,24 +243,22 @@ struct perf_event;
190 243
191DECLARE_PER_CPU(struct pt_regs, perf_trace_regs); 244DECLARE_PER_CPU(struct pt_regs, perf_trace_regs);
192 245
193extern int perf_trace_enable(int event_id); 246extern int perf_trace_init(struct perf_event *event);
194extern void perf_trace_disable(int event_id); 247extern void perf_trace_destroy(struct perf_event *event);
195extern int ftrace_profile_set_filter(struct perf_event *event, int event_id, 248extern int perf_trace_enable(struct perf_event *event);
249extern void perf_trace_disable(struct perf_event *event);
250extern int ftrace_profile_set_filter(struct perf_event *event, int event_id,
196 char *filter_str); 251 char *filter_str);
197extern void ftrace_profile_free_filter(struct perf_event *event); 252extern void ftrace_profile_free_filter(struct perf_event *event);
198extern void * 253extern void *perf_trace_buf_prepare(int size, unsigned short type,
199perf_trace_buf_prepare(int size, unsigned short type, int *rctxp, 254 struct pt_regs *regs, int *rctxp);
200 unsigned long *irq_flags);
201 255
202static inline void 256static inline void
203perf_trace_buf_submit(void *raw_data, int size, int rctx, u64 addr, 257perf_trace_buf_submit(void *raw_data, int size, int rctx, u64 addr,
204 u64 count, unsigned long irq_flags, struct pt_regs *regs) 258 u64 count, struct pt_regs *regs, void *head)
205{ 259{
206 struct trace_entry *entry = raw_data; 260 perf_tp_event(addr, count, raw_data, size, regs, head);
207
208 perf_tp_event(entry->type, addr, count, raw_data, size, regs);
209 perf_swevent_put_recursion_context(rctx); 261 perf_swevent_put_recursion_context(rctx);
210 local_irq_restore(irq_flags);
211} 262}
212#endif 263#endif
213 264
diff --git a/include/linux/fuse.h b/include/linux/fuse.h
index 3e2925a34bf0..88e0eb596919 100644
--- a/include/linux/fuse.h
+++ b/include/linux/fuse.h
@@ -34,6 +34,9 @@
34 * 7.13 34 * 7.13
35 * - make max number of background requests and congestion threshold 35 * - make max number of background requests and congestion threshold
36 * tunables 36 * tunables
37 *
38 * 7.14
39 * - add splice support to fuse device
37 */ 40 */
38 41
39#ifndef _LINUX_FUSE_H 42#ifndef _LINUX_FUSE_H
@@ -65,7 +68,7 @@
65#define FUSE_KERNEL_VERSION 7 68#define FUSE_KERNEL_VERSION 7
66 69
67/** Minor version number of this interface */ 70/** Minor version number of this interface */
68#define FUSE_KERNEL_MINOR_VERSION 13 71#define FUSE_KERNEL_MINOR_VERSION 14
69 72
70/** The node ID of the root inode */ 73/** The node ID of the root inode */
71#define FUSE_ROOT_ID 1 74#define FUSE_ROOT_ID 1
diff --git a/include/linux/generic_acl.h b/include/linux/generic_acl.h
index ca666d18ed67..574bea4013b6 100644
--- a/include/linux/generic_acl.h
+++ b/include/linux/generic_acl.h
@@ -5,8 +5,8 @@
5 5
6struct inode; 6struct inode;
7 7
8extern struct xattr_handler generic_acl_access_handler; 8extern const struct xattr_handler generic_acl_access_handler;
9extern struct xattr_handler generic_acl_default_handler; 9extern 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 *);
diff --git a/include/linux/gfp.h b/include/linux/gfp.h
index 4c6d41333f98..975609cb8548 100644
--- a/include/linux/gfp.h
+++ b/include/linux/gfp.h
@@ -15,7 +15,7 @@ struct vm_area_struct;
15 * Zone modifiers (see linux/mmzone.h - low three bits) 15 * Zone modifiers (see linux/mmzone.h - low three bits)
16 * 16 *
17 * Do not put any conditional on these. If necessary modify the definitions 17 * Do not put any conditional on these. If necessary modify the definitions
18 * without the underscores and use the consistently. The definitions here may 18 * without the underscores and use them consistently. The definitions here may
19 * be used in bit comparisons. 19 * be used in bit comparisons.
20 */ 20 */
21#define __GFP_DMA ((__force gfp_t)0x01u) 21#define __GFP_DMA ((__force gfp_t)0x01u)
@@ -101,7 +101,7 @@ struct vm_area_struct;
101 __GFP_NORETRY|__GFP_NOMEMALLOC) 101 __GFP_NORETRY|__GFP_NOMEMALLOC)
102 102
103/* Control slab gfp mask during early boot */ 103/* Control slab gfp mask during early boot */
104#define GFP_BOOT_MASK __GFP_BITS_MASK & ~(__GFP_WAIT|__GFP_IO|__GFP_FS) 104#define GFP_BOOT_MASK (__GFP_BITS_MASK & ~(__GFP_WAIT|__GFP_IO|__GFP_FS))
105 105
106/* Control allocation constraints */ 106/* Control allocation constraints */
107#define GFP_CONSTRAINT_MASK (__GFP_HARDWALL|__GFP_THISNODE) 107#define GFP_CONSTRAINT_MASK (__GFP_HARDWALL|__GFP_THISNODE)
@@ -152,12 +152,12 @@ static inline int allocflags_to_migratetype(gfp_t gfp_flags)
152 * GFP_ZONE_TABLE is a word size bitstring that is used for looking up the 152 * GFP_ZONE_TABLE is a word size bitstring that is used for looking up the
153 * zone to use given the lowest 4 bits of gfp_t. Entries are ZONE_SHIFT long 153 * zone to use given the lowest 4 bits of gfp_t. Entries are ZONE_SHIFT long
154 * and there are 16 of them to cover all possible combinations of 154 * and there are 16 of them to cover all possible combinations of
155 * __GFP_DMA, __GFP_DMA32, __GFP_MOVABLE and __GFP_HIGHMEM 155 * __GFP_DMA, __GFP_DMA32, __GFP_MOVABLE and __GFP_HIGHMEM.
156 * 156 *
157 * The zone fallback order is MOVABLE=>HIGHMEM=>NORMAL=>DMA32=>DMA. 157 * The zone fallback order is MOVABLE=>HIGHMEM=>NORMAL=>DMA32=>DMA.
158 * But GFP_MOVABLE is not only a zone specifier but also an allocation 158 * But GFP_MOVABLE is not only a zone specifier but also an allocation
159 * policy. Therefore __GFP_MOVABLE plus another zone selector is valid. 159 * policy. Therefore __GFP_MOVABLE plus another zone selector is valid.
160 * Only 1bit of the lowest 3 bit (DMA,DMA32,HIGHMEM) can be set to "1". 160 * Only 1 bit of the lowest 3 bits (DMA,DMA32,HIGHMEM) can be set to "1".
161 * 161 *
162 * bit result 162 * bit result
163 * ================= 163 * =================
@@ -187,7 +187,7 @@ static inline int allocflags_to_migratetype(gfp_t gfp_flags)
187 187
188#define GFP_ZONE_TABLE ( \ 188#define GFP_ZONE_TABLE ( \
189 (ZONE_NORMAL << 0 * ZONES_SHIFT) \ 189 (ZONE_NORMAL << 0 * ZONES_SHIFT) \
190 | (OPT_ZONE_DMA << __GFP_DMA * ZONES_SHIFT) \ 190 | (OPT_ZONE_DMA << __GFP_DMA * ZONES_SHIFT) \
191 | (OPT_ZONE_HIGHMEM << __GFP_HIGHMEM * ZONES_SHIFT) \ 191 | (OPT_ZONE_HIGHMEM << __GFP_HIGHMEM * ZONES_SHIFT) \
192 | (OPT_ZONE_DMA32 << __GFP_DMA32 * ZONES_SHIFT) \ 192 | (OPT_ZONE_DMA32 << __GFP_DMA32 * ZONES_SHIFT) \
193 | (ZONE_NORMAL << __GFP_MOVABLE * ZONES_SHIFT) \ 193 | (ZONE_NORMAL << __GFP_MOVABLE * ZONES_SHIFT) \
@@ -197,7 +197,7 @@ static inline int allocflags_to_migratetype(gfp_t gfp_flags)
197) 197)
198 198
199/* 199/*
200 * GFP_ZONE_BAD is a bitmap for all combination of __GFP_DMA, __GFP_DMA32 200 * GFP_ZONE_BAD is a bitmap for all combinations of __GFP_DMA, __GFP_DMA32
201 * __GFP_HIGHMEM and __GFP_MOVABLE that are not permitted. One flag per 201 * __GFP_HIGHMEM and __GFP_MOVABLE that are not permitted. One flag per
202 * entry starting with bit 0. Bit is set if the combination is not 202 * entry starting with bit 0. Bit is set if the combination is not
203 * allowed. 203 * allowed.
@@ -320,17 +320,17 @@ void *alloc_pages_exact(size_t size, gfp_t gfp_mask);
320void free_pages_exact(void *virt, size_t size); 320void free_pages_exact(void *virt, size_t size);
321 321
322#define __get_free_page(gfp_mask) \ 322#define __get_free_page(gfp_mask) \
323 __get_free_pages((gfp_mask),0) 323 __get_free_pages((gfp_mask), 0)
324 324
325#define __get_dma_pages(gfp_mask, order) \ 325#define __get_dma_pages(gfp_mask, order) \
326 __get_free_pages((gfp_mask) | GFP_DMA,(order)) 326 __get_free_pages((gfp_mask) | GFP_DMA, (order))
327 327
328extern void __free_pages(struct page *page, unsigned int order); 328extern void __free_pages(struct page *page, unsigned int order);
329extern void free_pages(unsigned long addr, unsigned int order); 329extern void free_pages(unsigned long addr, unsigned int order);
330extern void free_hot_cold_page(struct page *page, int cold); 330extern void free_hot_cold_page(struct page *page, int cold);
331 331
332#define __free_page(page) __free_pages((page), 0) 332#define __free_page(page) __free_pages((page), 0)
333#define free_page(addr) free_pages((addr),0) 333#define free_page(addr) free_pages((addr), 0)
334 334
335void page_alloc_init(void); 335void page_alloc_init(void);
336void drain_zone_pages(struct zone *zone, struct per_cpu_pages *pcp); 336void drain_zone_pages(struct zone *zone, struct per_cpu_pages *pcp);
diff --git a/include/linux/gpio.h b/include/linux/gpio.h
index 4e949a5b5b85..03f616b78cfa 100644
--- a/include/linux/gpio.h
+++ b/include/linux/gpio.h
@@ -51,6 +51,11 @@ static inline int gpio_direction_output(unsigned gpio, int value)
51 return -ENOSYS; 51 return -ENOSYS;
52} 52}
53 53
54static inline int gpio_set_debounce(unsigned gpio, unsigned debounce)
55{
56 return -ENOSYS;
57}
58
54static inline int gpio_get_value(unsigned gpio) 59static inline int gpio_get_value(unsigned gpio)
55{ 60{
56 /* GPIO can never have been requested or set as {in,out}put */ 61 /* GPIO can never have been requested or set as {in,out}put */
diff --git a/include/linux/gsmmux.h b/include/linux/gsmmux.h
new file mode 100644
index 000000000000..378de4195caf
--- /dev/null
+++ b/include/linux/gsmmux.h
@@ -0,0 +1,25 @@
1#ifndef _LINUX_GSMMUX_H
2#define _LINUX_GSMMUX_H
3
4struct gsm_config
5{
6 unsigned int adaption;
7 unsigned int encapsulation;
8 unsigned int initiator;
9 unsigned int t1;
10 unsigned int t2;
11 unsigned int t3;
12 unsigned int n2;
13 unsigned int mru;
14 unsigned int mtu;
15 unsigned int k;
16 unsigned int i;
17 unsigned int unused[8]; /* Padding for expansion without
18 breaking stuff */
19};
20
21#define GSMIOC_GETCONF _IOR('G', 0, struct gsm_config)
22#define GSMIOC_SETCONF _IOW('G', 1, struct gsm_config)
23
24
25#endif
diff --git a/include/linux/hdpu_features.h b/include/linux/hdpu_features.h
deleted file mode 100644
index 6a8715431ae4..000000000000
--- a/include/linux/hdpu_features.h
+++ /dev/null
@@ -1,26 +0,0 @@
1#include <linux/spinlock.h>
2
3struct cpustate_t {
4 spinlock_t lock;
5 int excl;
6 int open_count;
7 unsigned char cached_val;
8 int inited;
9 unsigned long *set_addr;
10 unsigned long *clr_addr;
11};
12
13
14#define HDPU_CPUSTATE_NAME "hdpu cpustate"
15#define HDPU_NEXUS_NAME "hdpu nexus"
16
17#define CPUSTATE_KERNEL_MAJOR 0x10
18
19#define CPUSTATE_KERNEL_INIT_DRV 0 /* CPU State Driver Initialized */
20#define CPUSTATE_KERNEL_INIT_PCI 1 /* 64360 PCI Busses Init */
21#define CPUSTATE_KERNEL_INIT_REG 2 /* 64360 Bridge Init */
22#define CPUSTATE_KERNEL_CPU1_KICK 3 /* Boot cpu 1 */
23#define CPUSTATE_KERNEL_CPU1_OK 4 /* Cpu 1 has checked in */
24#define CPUSTATE_KERNEL_OK 5 /* Terminal state */
25#define CPUSTATE_KERNEL_RESET 14 /* Board reset via SW*/
26#define CPUSTATE_KERNEL_HALT 15 /* Board halted via SW*/
diff --git a/include/linux/hid.h b/include/linux/hid.h
index b1344ec4b7fc..895001f7f4b2 100644
--- a/include/linux/hid.h
+++ b/include/linux/hid.h
@@ -308,11 +308,13 @@ struct hid_item {
308#define HID_QUIRK_NOTOUCH 0x00000002 308#define HID_QUIRK_NOTOUCH 0x00000002
309#define HID_QUIRK_IGNORE 0x00000004 309#define HID_QUIRK_IGNORE 0x00000004
310#define HID_QUIRK_NOGET 0x00000008 310#define HID_QUIRK_NOGET 0x00000008
311#define HID_QUIRK_HIDDEV_FORCE 0x00000010
311#define HID_QUIRK_BADPAD 0x00000020 312#define HID_QUIRK_BADPAD 0x00000020
312#define HID_QUIRK_MULTI_INPUT 0x00000040 313#define HID_QUIRK_MULTI_INPUT 0x00000040
313#define HID_QUIRK_SKIP_OUTPUT_REPORTS 0x00010000 314#define HID_QUIRK_SKIP_OUTPUT_REPORTS 0x00010000
314#define HID_QUIRK_FULLSPEED_INTERVAL 0x10000000 315#define HID_QUIRK_FULLSPEED_INTERVAL 0x10000000
315#define HID_QUIRK_NO_INIT_REPORTS 0x20000000 316#define HID_QUIRK_NO_INIT_REPORTS 0x20000000
317#define HID_QUIRK_NO_IGNORE 0x40000000
316 318
317/* 319/*
318 * This is the global environment of the parser. This information is 320 * This is the global environment of the parser. This information is
@@ -589,6 +591,9 @@ struct hid_usage_id {
589 * @report_fixup: called before report descriptor parsing (NULL means nop) 591 * @report_fixup: called before report descriptor parsing (NULL means nop)
590 * @input_mapping: invoked on input registering before mapping an usage 592 * @input_mapping: invoked on input registering before mapping an usage
591 * @input_mapped: invoked on input registering after mapping an usage 593 * @input_mapped: invoked on input registering after mapping an usage
594 * @suspend: invoked on suspend (NULL means nop)
595 * @resume: invoked on resume if device was not reset (NULL means nop)
596 * @reset_resume: invoked on resume if device was reset (NULL means nop)
592 * 597 *
593 * raw_event and event should return 0 on no action performed, 1 when no 598 * raw_event and event should return 0 on no action performed, 1 when no
594 * further processing should be done and negative on error 599 * further processing should be done and negative on error
@@ -629,6 +634,11 @@ struct hid_driver {
629 int (*input_mapped)(struct hid_device *hdev, 634 int (*input_mapped)(struct hid_device *hdev,
630 struct hid_input *hidinput, struct hid_field *field, 635 struct hid_input *hidinput, struct hid_field *field,
631 struct hid_usage *usage, unsigned long **bit, int *max); 636 struct hid_usage *usage, unsigned long **bit, int *max);
637#ifdef CONFIG_PM
638 int (*suspend)(struct hid_device *hdev, pm_message_t message);
639 int (*resume)(struct hid_device *hdev);
640 int (*reset_resume)(struct hid_device *hdev);
641#endif
632/* private: */ 642/* private: */
633 struct device_driver driver; 643 struct device_driver driver;
634}; 644};
diff --git a/include/linux/highmem.h b/include/linux/highmem.h
index 74152c08ad07..caafd0561aa1 100644
--- a/include/linux/highmem.h
+++ b/include/linux/highmem.h
@@ -27,7 +27,7 @@ static inline void invalidate_kernel_vmap_range(void *vaddr, int size)
27 27
28#include <asm/kmap_types.h> 28#include <asm/kmap_types.h>
29 29
30#if defined(CONFIG_DEBUG_HIGHMEM) && defined(CONFIG_TRACE_IRQFLAGS_SUPPORT) 30#ifdef CONFIG_DEBUG_HIGHMEM
31 31
32void debug_kmap_atomic(enum km_type type); 32void debug_kmap_atomic(enum km_type type);
33 33
diff --git a/include/linux/hrtimer.h b/include/linux/hrtimer.h
index 5d86fb2309d2..fd0c1b857d3d 100644
--- a/include/linux/hrtimer.h
+++ b/include/linux/hrtimer.h
@@ -422,6 +422,8 @@ extern void hrtimer_init_sleeper(struct hrtimer_sleeper *sl,
422 422
423extern int schedule_hrtimeout_range(ktime_t *expires, unsigned long delta, 423extern int schedule_hrtimeout_range(ktime_t *expires, unsigned long delta,
424 const enum hrtimer_mode mode); 424 const enum hrtimer_mode mode);
425extern int schedule_hrtimeout_range_clock(ktime_t *expires,
426 unsigned long delta, const enum hrtimer_mode mode, int clock);
425extern int schedule_hrtimeout(ktime_t *expires, const enum hrtimer_mode mode); 427extern int schedule_hrtimeout(ktime_t *expires, const enum hrtimer_mode mode);
426 428
427/* Soft interrupt function to run the hrtimer queues: */ 429/* Soft interrupt function to run the hrtimer queues: */
diff --git a/include/linux/hw_breakpoint.h b/include/linux/hw_breakpoint.h
index c70d27af03f9..a2d6ea49ec56 100644
--- a/include/linux/hw_breakpoint.h
+++ b/include/linux/hw_breakpoint.h
@@ -9,9 +9,22 @@ enum {
9}; 9};
10 10
11enum { 11enum {
12 HW_BREAKPOINT_R = 1, 12 HW_BREAKPOINT_EMPTY = 0,
13 HW_BREAKPOINT_W = 2, 13 HW_BREAKPOINT_R = 1,
14 HW_BREAKPOINT_X = 4, 14 HW_BREAKPOINT_W = 2,
15 HW_BREAKPOINT_RW = HW_BREAKPOINT_R | HW_BREAKPOINT_W,
16 HW_BREAKPOINT_X = 4,
17 HW_BREAKPOINT_INVALID = HW_BREAKPOINT_RW | HW_BREAKPOINT_X,
18};
19
20enum bp_type_idx {
21 TYPE_INST = 0,
22#ifdef CONFIG_HAVE_MIXED_BREAKPOINTS_REGS
23 TYPE_DATA = 0,
24#else
25 TYPE_DATA = 1,
26#endif
27 TYPE_MAX
15}; 28};
16 29
17#ifdef __KERNEL__ 30#ifdef __KERNEL__
@@ -34,6 +47,12 @@ static inline void hw_breakpoint_init(struct perf_event_attr *attr)
34 attr->sample_period = 1; 47 attr->sample_period = 1;
35} 48}
36 49
50static inline void ptrace_breakpoint_init(struct perf_event_attr *attr)
51{
52 hw_breakpoint_init(attr);
53 attr->exclude_kernel = 1;
54}
55
37static inline unsigned long hw_breakpoint_addr(struct perf_event *bp) 56static inline unsigned long hw_breakpoint_addr(struct perf_event *bp)
38{ 57{
39 return bp->attr.bp_addr; 58 return bp->attr.bp_addr;
diff --git a/include/linux/i2c-omap.h b/include/linux/i2c-omap.h
new file mode 100644
index 000000000000..78ebf507ce56
--- /dev/null
+++ b/include/linux/i2c-omap.h
@@ -0,0 +1,9 @@
1#ifndef __I2C_OMAP_H__
2#define __I2C_OMAP_H__
3
4struct omap_i2c_bus_platform_data {
5 u32 clkrate;
6 void (*set_mpu_wkup_lat)(struct device *dev, long set);
7};
8
9#endif
diff --git a/include/linux/i2c.h b/include/linux/i2c.h
index 0a5da639b327..21067b418536 100644
--- a/include/linux/i2c.h
+++ b/include/linux/i2c.h
@@ -34,6 +34,7 @@
34#include <linux/device.h> /* for struct device */ 34#include <linux/device.h> /* for struct device */
35#include <linux/sched.h> /* for completion */ 35#include <linux/sched.h> /* for completion */
36#include <linux/mutex.h> 36#include <linux/mutex.h>
37#include <linux/of.h> /* for struct device_node */
37 38
38extern struct bus_type i2c_bus_type; 39extern struct bus_type i2c_bus_type;
39 40
@@ -251,6 +252,9 @@ struct i2c_board_info {
251 unsigned short addr; 252 unsigned short addr;
252 void *platform_data; 253 void *platform_data;
253 struct dev_archdata *archdata; 254 struct dev_archdata *archdata;
255#ifdef CONFIG_OF
256 struct device_node *of_node;
257#endif
254 int irq; 258 int irq;
255}; 259};
256 260
@@ -355,6 +359,8 @@ struct i2c_adapter {
355 int nr; 359 int nr;
356 char name[48]; 360 char name[48];
357 struct completion dev_released; 361 struct completion dev_released;
362
363 struct list_head userspace_clients;
358}; 364};
359#define to_i2c_adapter(d) container_of(d, struct i2c_adapter, dev) 365#define to_i2c_adapter(d) container_of(d, struct i2c_adapter, dev)
360 366
diff --git a/include/linux/i2c/adp8860.h b/include/linux/i2c/adp8860.h
new file mode 100644
index 000000000000..0b4d39855c91
--- /dev/null
+++ b/include/linux/i2c/adp8860.h
@@ -0,0 +1,154 @@
1/*
2 * Definitions and platform data for Analog Devices
3 * Backlight drivers ADP8860
4 *
5 * Copyright 2009-2010 Analog Devices Inc.
6 *
7 * Licensed under the GPL-2 or later.
8 */
9
10#ifndef __LINUX_I2C_ADP8860_H
11#define __LINUX_I2C_ADP8860_H
12
13#include <linux/leds.h>
14#include <linux/types.h>
15
16#define ID_ADP8860 8860
17
18#define ADP8860_MAX_BRIGHTNESS 0x7F
19#define FLAG_OFFT_SHIFT 8
20
21/*
22 * LEDs subdevice platform data
23 */
24
25#define ADP8860_LED_DIS_BLINK (0 << FLAG_OFFT_SHIFT)
26#define ADP8860_LED_OFFT_600ms (1 << FLAG_OFFT_SHIFT)
27#define ADP8860_LED_OFFT_1200ms (2 << FLAG_OFFT_SHIFT)
28#define ADP8860_LED_OFFT_1800ms (3 << FLAG_OFFT_SHIFT)
29
30#define ADP8860_LED_ONT_200ms 0
31#define ADP8860_LED_ONT_600ms 1
32#define ADP8860_LED_ONT_800ms 2
33#define ADP8860_LED_ONT_1200ms 3
34
35#define ADP8860_LED_D7 (7)
36#define ADP8860_LED_D6 (6)
37#define ADP8860_LED_D5 (5)
38#define ADP8860_LED_D4 (4)
39#define ADP8860_LED_D3 (3)
40#define ADP8860_LED_D2 (2)
41#define ADP8860_LED_D1 (1)
42
43/*
44 * Backlight subdevice platform data
45 */
46
47#define ADP8860_BL_D7 (1 << 6)
48#define ADP8860_BL_D6 (1 << 5)
49#define ADP8860_BL_D5 (1 << 4)
50#define ADP8860_BL_D4 (1 << 3)
51#define ADP8860_BL_D3 (1 << 2)
52#define ADP8860_BL_D2 (1 << 1)
53#define ADP8860_BL_D1 (1 << 0)
54
55#define ADP8860_FADE_T_DIS 0 /* Fade Timer Disabled */
56#define ADP8860_FADE_T_300ms 1 /* 0.3 Sec */
57#define ADP8860_FADE_T_600ms 2
58#define ADP8860_FADE_T_900ms 3
59#define ADP8860_FADE_T_1200ms 4
60#define ADP8860_FADE_T_1500ms 5
61#define ADP8860_FADE_T_1800ms 6
62#define ADP8860_FADE_T_2100ms 7
63#define ADP8860_FADE_T_2400ms 8
64#define ADP8860_FADE_T_2700ms 9
65#define ADP8860_FADE_T_3000ms 10
66#define ADP8860_FADE_T_3500ms 11
67#define ADP8860_FADE_T_4000ms 12
68#define ADP8860_FADE_T_4500ms 13
69#define ADP8860_FADE_T_5000ms 14
70#define ADP8860_FADE_T_5500ms 15 /* 5.5 Sec */
71
72#define ADP8860_FADE_LAW_LINEAR 0
73#define ADP8860_FADE_LAW_SQUARE 1
74#define ADP8860_FADE_LAW_CUBIC1 2
75#define ADP8860_FADE_LAW_CUBIC2 3
76
77#define ADP8860_BL_AMBL_FILT_80ms 0 /* Light sensor filter time */
78#define ADP8860_BL_AMBL_FILT_160ms 1
79#define ADP8860_BL_AMBL_FILT_320ms 2
80#define ADP8860_BL_AMBL_FILT_640ms 3
81#define ADP8860_BL_AMBL_FILT_1280ms 4
82#define ADP8860_BL_AMBL_FILT_2560ms 5
83#define ADP8860_BL_AMBL_FILT_5120ms 6
84#define ADP8860_BL_AMBL_FILT_10240ms 7 /* 10.24 sec */
85
86/*
87 * Blacklight current 0..30mA
88 */
89#define ADP8860_BL_CUR_mA(I) ((I * 127) / 30)
90
91/*
92 * L2 comparator current 0..1106uA
93 */
94#define ADP8860_L2_COMP_CURR_uA(I) ((I * 255) / 1106)
95
96/*
97 * L3 comparator current 0..138uA
98 */
99#define ADP8860_L3_COMP_CURR_uA(I) ((I * 255) / 138)
100
101struct adp8860_backlight_platform_data {
102 u8 bl_led_assign; /* 1 = Backlight 0 = Individual LED */
103
104 u8 bl_fade_in; /* Backlight Fade-In Timer */
105 u8 bl_fade_out; /* Backlight Fade-Out Timer */
106 u8 bl_fade_law; /* fade-on/fade-off transfer characteristic */
107
108 u8 en_ambl_sens; /* 1 = enable ambient light sensor */
109 u8 abml_filt; /* Light sensor filter time */
110
111 u8 l1_daylight_max; /* use BL_CUR_mA(I) 0 <= I <= 30 mA */
112 u8 l1_daylight_dim; /* typ = 0, use BL_CUR_mA(I) 0 <= I <= 30 mA */
113 u8 l2_office_max; /* use BL_CUR_mA(I) 0 <= I <= 30 mA */
114 u8 l2_office_dim; /* typ = 0, use BL_CUR_mA(I) 0 <= I <= 30 mA */
115 u8 l3_dark_max; /* use BL_CUR_mA(I) 0 <= I <= 30 mA */
116 u8 l3_dark_dim; /* typ = 0, use BL_CUR_mA(I) 0 <= I <= 30 mA */
117
118 u8 l2_trip; /* use L2_COMP_CURR_uA(I) 0 <= I <= 1106 uA */
119 u8 l2_hyst; /* use L2_COMP_CURR_uA(I) 0 <= I <= 1106 uA */
120 u8 l3_trip; /* use L3_COMP_CURR_uA(I) 0 <= I <= 551 uA */
121 u8 l3_hyst; /* use L3_COMP_CURR_uA(I) 0 <= I <= 551 uA */
122
123 /**
124 * Independent Current Sinks / LEDS
125 * Sinks not assigned to the Backlight can be exposed to
126 * user space using the LEDS CLASS interface
127 */
128
129 int num_leds;
130 struct led_info *leds;
131 u8 led_fade_in; /* LED Fade-In Timer */
132 u8 led_fade_out; /* LED Fade-Out Timer */
133 u8 led_fade_law; /* fade-on/fade-off transfer characteristic */
134 u8 led_on_time;
135
136 /**
137 * Gain down disable. Setting this option does not allow the
138 * charge pump to switch to lower gains. NOT AVAILABLE on ADP8860
139 * 1 = the charge pump doesn't switch down in gain until all LEDs are 0.
140 * The charge pump switches up in gain as needed. This feature is
141 * useful if the ADP8863 charge pump is used to drive an external load.
142 * This feature must be used when utilizing small fly capacitors
143 * (0402 or smaller).
144 * 0 = the charge pump automatically switches up and down in gain.
145 * This provides optimal efficiency, but is not suitable for driving
146 * loads that are not connected through the ADP8863 diode drivers.
147 * Additionally, the charge pump fly capacitors should be low ESR
148 * and sized 0603 or greater.
149 */
150
151 u8 gdwn_dis;
152};
153
154#endif /* __LINUX_I2C_ADP8860_H */
diff --git a/include/linux/i2c/max732x.h b/include/linux/i2c/max732x.h
index e10336631c62..c04bac8bf2fe 100644
--- a/include/linux/i2c/max732x.h
+++ b/include/linux/i2c/max732x.h
@@ -7,6 +7,9 @@ struct max732x_platform_data {
7 /* number of the first GPIO */ 7 /* number of the first GPIO */
8 unsigned gpio_base; 8 unsigned gpio_base;
9 9
10 /* interrupt base */
11 int irq_base;
12
10 void *context; /* param to setup/teardown */ 13 void *context; /* param to setup/teardown */
11 14
12 int (*setup)(struct i2c_client *client, 15 int (*setup)(struct i2c_client *client,
diff --git a/include/linux/i2c/pca953x.h b/include/linux/i2c/pca953x.h
index d5c5a60c8a0b..139ba52667c8 100644
--- a/include/linux/i2c/pca953x.h
+++ b/include/linux/i2c/pca953x.h
@@ -24,7 +24,7 @@ struct pca953x_platform_data {
24 int (*teardown)(struct i2c_client *client, 24 int (*teardown)(struct i2c_client *client,
25 unsigned gpio, unsigned ngpio, 25 unsigned gpio, unsigned ngpio,
26 void *context); 26 void *context);
27 char **names; 27 const char *const *names;
28}; 28};
29 29
30#endif /* _LINUX_PCA953X_H */ 30#endif /* _LINUX_PCA953X_H */
diff --git a/include/linux/i2c/twl.h b/include/linux/i2c/twl.h
index fb6784e86d5f..6de90bfc6acd 100644
--- a/include/linux/i2c/twl.h
+++ b/include/linux/i2c/twl.h
@@ -496,7 +496,7 @@ struct twl4030_madc_platform_data {
496 int irq_line; 496 int irq_line;
497}; 497};
498 498
499/* Boards have uniqe mappings of {row, col} --> keycode. 499/* Boards have unique mappings of {row, col} --> keycode.
500 * Column and row are 8 bits each, but range only from 0..7. 500 * Column and row are 8 bits each, but range only from 0..7.
501 * a PERSISTENT_KEY is "always on" and never reported. 501 * a PERSISTENT_KEY is "always on" and never reported.
502 */ 502 */
@@ -569,9 +569,9 @@ struct twl4030_codec_data {
569 struct twl4030_codec_audio_data *audio; 569 struct twl4030_codec_audio_data *audio;
570 struct twl4030_codec_vibra_data *vibra; 570 struct twl4030_codec_vibra_data *vibra;
571 571
572 /* twl6030 */ 572 /* twl6040 */
573 int audpwron_gpio; /* audio power-on gpio */ 573 int audpwron_gpio; /* audio power-on gpio */
574 int naudint_irq; /* audio interrupt */ 574 int naudint_irq; /* audio interrupt */
575}; 575};
576 576
577struct twl4030_platform_data { 577struct twl4030_platform_data {
@@ -664,15 +664,15 @@ static inline int twl4030charger_usb_en(int enable) { return 0; }
664#define TWL4030_REG_VUSB3V1 19 664#define TWL4030_REG_VUSB3V1 19
665 665
666/* TWL6030 SMPS/LDO's */ 666/* TWL6030 SMPS/LDO's */
667/* EXTERNAL dc-to-dc buck convertor contollable via SR */ 667/* EXTERNAL dc-to-dc buck convertor controllable via SR */
668#define TWL6030_REG_VDD1 30 668#define TWL6030_REG_VDD1 30
669#define TWL6030_REG_VDD2 31 669#define TWL6030_REG_VDD2 31
670#define TWL6030_REG_VDD3 32 670#define TWL6030_REG_VDD3 32
671 671
672/* Non SR compliant dc-to-dc buck convertors */ 672/* Non SR compliant dc-to-dc buck convertors */
673#define TWL6030_REG_VMEM 33 673#define TWL6030_REG_VMEM 33
674#define TWL6030_REG_V2V1 34 674#define TWL6030_REG_V2V1 34
675#define TWL6030_REG_V1V29 35 675#define TWL6030_REG_V1V29 35
676#define TWL6030_REG_V1V8 36 676#define TWL6030_REG_V1V8 36
677 677
678/* EXTERNAL LDOs */ 678/* EXTERNAL LDOs */
diff --git a/include/linux/ide.h b/include/linux/ide.h
index 3239d1c10acb..7b02aa5ce9b4 100644
--- a/include/linux/ide.h
+++ b/include/linux/ide.h
@@ -362,7 +362,7 @@ struct ide_drive_s;
362struct ide_disk_ops { 362struct ide_disk_ops {
363 int (*check)(struct ide_drive_s *, const char *); 363 int (*check)(struct ide_drive_s *, const char *);
364 int (*get_capacity)(struct ide_drive_s *); 364 int (*get_capacity)(struct ide_drive_s *);
365 u64 (*set_capacity)(struct ide_drive_s *, u64); 365 void (*unlock_native_capacity)(struct ide_drive_s *);
366 void (*setup)(struct ide_drive_s *); 366 void (*setup)(struct ide_drive_s *);
367 void (*flush)(struct ide_drive_s *); 367 void (*flush)(struct ide_drive_s *);
368 int (*init_media)(struct ide_drive_s *, struct gendisk *); 368 int (*init_media)(struct ide_drive_s *, struct gendisk *);
@@ -516,8 +516,8 @@ struct ide_drive_s {
516 u8 current_speed; /* current transfer rate set */ 516 u8 current_speed; /* current transfer rate set */
517 u8 desired_speed; /* desired transfer rate set */ 517 u8 desired_speed; /* desired transfer rate set */
518 u8 pio_mode; /* for ->set_pio_mode _only_ */ 518 u8 pio_mode; /* for ->set_pio_mode _only_ */
519 u8 dma_mode; /* for ->dma_pio_mode _only_ */ 519 u8 dma_mode; /* for ->set_dma_mode _only_ */
520 u8 dn; /* now wide spread use */ 520 u8 dn; /* now wide spread use */
521 u8 acoustic; /* acoustic management */ 521 u8 acoustic; /* acoustic management */
522 u8 media; /* disk, cdrom, tape, floppy, ... */ 522 u8 media; /* disk, cdrom, tape, floppy, ... */
523 u8 ready_stat; /* min status value for drive ready */ 523 u8 ready_stat; /* min status value for drive ready */
diff --git a/include/linux/if_link.h b/include/linux/if_link.h
index cfd420ba72df..85c812db5a3f 100644
--- a/include/linux/if_link.h
+++ b/include/linux/if_link.h
@@ -111,11 +111,10 @@ enum {
111 IFLA_NET_NS_PID, 111 IFLA_NET_NS_PID,
112 IFLA_IFALIAS, 112 IFLA_IFALIAS,
113 IFLA_NUM_VF, /* Number of VFs if device is SR-IOV PF */ 113 IFLA_NUM_VF, /* Number of VFs if device is SR-IOV PF */
114 IFLA_VF_MAC, /* Hardware queue specific attributes */ 114 IFLA_VFINFO_LIST,
115 IFLA_VF_VLAN,
116 IFLA_VF_TX_RATE, /* TX Bandwidth Allocation */
117 IFLA_VFINFO,
118 IFLA_STATS64, 115 IFLA_STATS64,
116 IFLA_VF_PORTS,
117 IFLA_PORT_SELF,
119 __IFLA_MAX 118 __IFLA_MAX
120}; 119};
121 120
@@ -236,6 +235,24 @@ enum macvlan_mode {
236 235
237/* SR-IOV virtual function managment section */ 236/* SR-IOV virtual function managment section */
238 237
238enum {
239 IFLA_VF_INFO_UNSPEC,
240 IFLA_VF_INFO,
241 __IFLA_VF_INFO_MAX,
242};
243
244#define IFLA_VF_INFO_MAX (__IFLA_VF_INFO_MAX - 1)
245
246enum {
247 IFLA_VF_UNSPEC,
248 IFLA_VF_MAC, /* Hardware queue specific attributes */
249 IFLA_VF_VLAN,
250 IFLA_VF_TX_RATE, /* TX Bandwidth Allocation */
251 __IFLA_VF_MAX,
252};
253
254#define IFLA_VF_MAX (__IFLA_VF_MAX - 1)
255
239struct ifla_vf_mac { 256struct ifla_vf_mac {
240 __u32 vf; 257 __u32 vf;
241 __u8 mac[32]; /* MAX_ADDR_LEN */ 258 __u8 mac[32]; /* MAX_ADDR_LEN */
@@ -259,4 +276,77 @@ struct ifla_vf_info {
259 __u32 qos; 276 __u32 qos;
260 __u32 tx_rate; 277 __u32 tx_rate;
261}; 278};
279
280/* VF ports management section
281 *
282 * Nested layout of set/get msg is:
283 *
284 * [IFLA_NUM_VF]
285 * [IFLA_VF_PORTS]
286 * [IFLA_VF_PORT]
287 * [IFLA_PORT_*], ...
288 * [IFLA_VF_PORT]
289 * [IFLA_PORT_*], ...
290 * ...
291 * [IFLA_PORT_SELF]
292 * [IFLA_PORT_*], ...
293 */
294
295enum {
296 IFLA_VF_PORT_UNSPEC,
297 IFLA_VF_PORT, /* nest */
298 __IFLA_VF_PORT_MAX,
299};
300
301#define IFLA_VF_PORT_MAX (__IFLA_VF_PORT_MAX - 1)
302
303enum {
304 IFLA_PORT_UNSPEC,
305 IFLA_PORT_VF, /* __u32 */
306 IFLA_PORT_PROFILE, /* string */
307 IFLA_PORT_VSI_TYPE, /* 802.1Qbg (pre-)standard VDP */
308 IFLA_PORT_INSTANCE_UUID, /* binary UUID */
309 IFLA_PORT_HOST_UUID, /* binary UUID */
310 IFLA_PORT_REQUEST, /* __u8 */
311 IFLA_PORT_RESPONSE, /* __u16, output only */
312 __IFLA_PORT_MAX,
313};
314
315#define IFLA_PORT_MAX (__IFLA_PORT_MAX - 1)
316
317#define PORT_PROFILE_MAX 40
318#define PORT_UUID_MAX 16
319#define PORT_SELF_VF -1
320
321enum {
322 PORT_REQUEST_PREASSOCIATE = 0,
323 PORT_REQUEST_PREASSOCIATE_RR,
324 PORT_REQUEST_ASSOCIATE,
325 PORT_REQUEST_DISASSOCIATE,
326};
327
328enum {
329 PORT_VDP_RESPONSE_SUCCESS = 0,
330 PORT_VDP_RESPONSE_INVALID_FORMAT,
331 PORT_VDP_RESPONSE_INSUFFICIENT_RESOURCES,
332 PORT_VDP_RESPONSE_UNUSED_VTID,
333 PORT_VDP_RESPONSE_VTID_VIOLATION,
334 PORT_VDP_RESPONSE_VTID_VERSION_VIOALTION,
335 PORT_VDP_RESPONSE_OUT_OF_SYNC,
336 /* 0x08-0xFF reserved for future VDP use */
337 PORT_PROFILE_RESPONSE_SUCCESS = 0x100,
338 PORT_PROFILE_RESPONSE_INPROGRESS,
339 PORT_PROFILE_RESPONSE_INVALID,
340 PORT_PROFILE_RESPONSE_BADSTATE,
341 PORT_PROFILE_RESPONSE_INSUFFICIENT_RESOURCES,
342 PORT_PROFILE_RESPONSE_ERROR,
343};
344
345struct ifla_port_vsi {
346 __u8 vsi_mgr_id;
347 __u8 vsi_type_id[3];
348 __u8 vsi_type_version;
349 __u8 pad[3];
350};
351
262#endif /* _LINUX_IF_LINK_H */ 352#endif /* _LINUX_IF_LINK_H */
diff --git a/include/linux/if_macvlan.h b/include/linux/if_macvlan.h
index b78a712247da..9ea047aca795 100644
--- a/include/linux/if_macvlan.h
+++ b/include/linux/if_macvlan.h
@@ -85,6 +85,7 @@ extern netdev_tx_t macvlan_start_xmit(struct sk_buff *skb,
85 struct net_device *dev); 85 struct net_device *dev);
86 86
87 87
88extern struct sk_buff *(*macvlan_handle_frame_hook)(struct sk_buff *); 88extern struct sk_buff *(*macvlan_handle_frame_hook)(struct macvlan_port *,
89 struct sk_buff *);
89 90
90#endif /* _LINUX_IF_MACVLAN_H */ 91#endif /* _LINUX_IF_MACVLAN_H */
diff --git a/include/linux/init_task.h b/include/linux/init_task.h
index b1ed1cd8e2a8..2beaa13492be 100644
--- a/include/linux/init_task.h
+++ b/include/linux/init_task.h
@@ -16,7 +16,7 @@ extern struct files_struct init_files;
16extern struct fs_struct init_fs; 16extern struct fs_struct init_fs;
17 17
18#define INIT_SIGNALS(sig) { \ 18#define INIT_SIGNALS(sig) { \
19 .count = ATOMIC_INIT(1), \ 19 .nr_threads = 1, \
20 .wait_chldexit = __WAIT_QUEUE_HEAD_INITIALIZER(sig.wait_chldexit),\ 20 .wait_chldexit = __WAIT_QUEUE_HEAD_INITIALIZER(sig.wait_chldexit),\
21 .shared_pending = { \ 21 .shared_pending = { \
22 .list = LIST_HEAD_INIT(sig.shared_pending.list), \ 22 .list = LIST_HEAD_INIT(sig.shared_pending.list), \
@@ -35,7 +35,7 @@ extern struct nsproxy init_nsproxy;
35 35
36#define INIT_SIGHAND(sighand) { \ 36#define INIT_SIGHAND(sighand) { \
37 .count = ATOMIC_INIT(1), \ 37 .count = ATOMIC_INIT(1), \
38 .action = { { { .sa_handler = NULL, } }, }, \ 38 .action = { { { .sa_handler = SIG_DFL, } }, }, \
39 .siglock = __SPIN_LOCK_UNLOCKED(sighand.siglock), \ 39 .siglock = __SPIN_LOCK_UNLOCKED(sighand.siglock), \
40 .signalfd_wqh = __WAIT_QUEUE_HEAD_INITIALIZER(sighand.signalfd_wqh), \ 40 .signalfd_wqh = __WAIT_QUEUE_HEAD_INITIALIZER(sighand.signalfd_wqh), \
41} 41}
@@ -45,11 +45,10 @@ extern struct group_info init_groups;
45#define INIT_STRUCT_PID { \ 45#define INIT_STRUCT_PID { \
46 .count = ATOMIC_INIT(1), \ 46 .count = ATOMIC_INIT(1), \
47 .tasks = { \ 47 .tasks = { \
48 { .first = &init_task.pids[PIDTYPE_PID].node }, \ 48 { .first = NULL }, \
49 { .first = &init_task.pids[PIDTYPE_PGID].node }, \ 49 { .first = NULL }, \
50 { .first = &init_task.pids[PIDTYPE_SID].node }, \ 50 { .first = NULL }, \
51 }, \ 51 }, \
52 .rcu = RCU_HEAD_INIT, \
53 .level = 0, \ 52 .level = 0, \
54 .numbers = { { \ 53 .numbers = { { \
55 .nr = 0, \ 54 .nr = 0, \
@@ -62,7 +61,7 @@ extern struct group_info init_groups;
62{ \ 61{ \
63 .node = { \ 62 .node = { \
64 .next = NULL, \ 63 .next = NULL, \
65 .pprev = &init_struct_pid.tasks[type].first, \ 64 .pprev = NULL, \
66 }, \ 65 }, \
67 .pid = &init_struct_pid, \ 66 .pid = &init_struct_pid, \
68} 67}
@@ -164,6 +163,7 @@ extern struct cred init_cred;
164 [PIDTYPE_PGID] = INIT_PID_LINK(PIDTYPE_PGID), \ 163 [PIDTYPE_PGID] = INIT_PID_LINK(PIDTYPE_PGID), \
165 [PIDTYPE_SID] = INIT_PID_LINK(PIDTYPE_SID), \ 164 [PIDTYPE_SID] = INIT_PID_LINK(PIDTYPE_SID), \
166 }, \ 165 }, \
166 .thread_group = LIST_HEAD_INIT(tsk.thread_group), \
167 .dirties = INIT_PROP_LOCAL_SINGLE(dirties), \ 167 .dirties = INIT_PROP_LOCAL_SINGLE(dirties), \
168 INIT_IDS \ 168 INIT_IDS \
169 INIT_PERF_EVENTS(tsk) \ 169 INIT_PERF_EVENTS(tsk) \
diff --git a/include/linux/input.h b/include/linux/input.h
index 7ed2251b33f1..6fcc9101beeb 100644
--- a/include/linux/input.h
+++ b/include/linux/input.h
@@ -806,6 +806,7 @@ struct input_absinfo {
806#define BUS_HOST 0x19 806#define BUS_HOST 0x19
807#define BUS_GSC 0x1A 807#define BUS_GSC 0x1A
808#define BUS_ATARI 0x1B 808#define BUS_ATARI 0x1B
809#define BUS_SPI 0x1C
809 810
810/* 811/*
811 * MT_TOOL types 812 * MT_TOOL types
@@ -1154,7 +1155,7 @@ struct input_dev {
1154 1155
1155 int sync; 1156 int sync;
1156 1157
1157 int abs[ABS_MAX + 1]; 1158 int abs[ABS_CNT];
1158 int rep[REP_MAX + 1]; 1159 int rep[REP_MAX + 1];
1159 1160
1160 unsigned long key[BITS_TO_LONGS(KEY_CNT)]; 1161 unsigned long key[BITS_TO_LONGS(KEY_CNT)];
@@ -1162,11 +1163,11 @@ struct input_dev {
1162 unsigned long snd[BITS_TO_LONGS(SND_CNT)]; 1163 unsigned long snd[BITS_TO_LONGS(SND_CNT)];
1163 unsigned long sw[BITS_TO_LONGS(SW_CNT)]; 1164 unsigned long sw[BITS_TO_LONGS(SW_CNT)];
1164 1165
1165 int absmax[ABS_MAX + 1]; 1166 int absmax[ABS_CNT];
1166 int absmin[ABS_MAX + 1]; 1167 int absmin[ABS_CNT];
1167 int absfuzz[ABS_MAX + 1]; 1168 int absfuzz[ABS_CNT];
1168 int absflat[ABS_MAX + 1]; 1169 int absflat[ABS_CNT];
1169 int absres[ABS_MAX + 1]; 1170 int absres[ABS_CNT];
1170 1171
1171 int (*open)(struct input_dev *dev); 1172 int (*open)(struct input_dev *dev);
1172 void (*close)(struct input_dev *dev); 1173 void (*close)(struct input_dev *dev);
diff --git a/include/linux/input/ad714x.h b/include/linux/input/ad714x.h
new file mode 100644
index 000000000000..0cbe5e81482e
--- /dev/null
+++ b/include/linux/input/ad714x.h
@@ -0,0 +1,63 @@
1/*
2 * include/linux/input/ad714x.h
3 *
4 * AD714x is very flexible, it can be used as buttons, scrollwheel,
5 * slider, touchpad at the same time. That depends on the boards.
6 * The platform_data for the device's "struct device" holds this
7 * information.
8 *
9 * Copyright 2009 Analog Devices Inc.
10 *
11 * Licensed under the GPL-2 or later.
12 */
13
14#ifndef __LINUX_INPUT_AD714X_H__
15#define __LINUX_INPUT_AD714X_H__
16
17#define STAGE_NUM 12
18#define STAGE_CFGREG_NUM 8
19#define SYS_CFGREG_NUM 8
20
21/* board information which need be initialized in arch/mach... */
22struct ad714x_slider_plat {
23 int start_stage;
24 int end_stage;
25 int max_coord;
26};
27
28struct ad714x_wheel_plat {
29 int start_stage;
30 int end_stage;
31 int max_coord;
32};
33
34struct ad714x_touchpad_plat {
35 int x_start_stage;
36 int x_end_stage;
37 int x_max_coord;
38
39 int y_start_stage;
40 int y_end_stage;
41 int y_max_coord;
42};
43
44struct ad714x_button_plat {
45 int keycode;
46 unsigned short l_mask;
47 unsigned short h_mask;
48};
49
50struct ad714x_platform_data {
51 int slider_num;
52 int wheel_num;
53 int touchpad_num;
54 int button_num;
55 struct ad714x_slider_plat *slider;
56 struct ad714x_wheel_plat *wheel;
57 struct ad714x_touchpad_plat *touchpad;
58 struct ad714x_button_plat *button;
59 unsigned short stage_cfg_reg[STAGE_NUM][STAGE_CFGREG_NUM];
60 unsigned short sys_cfg_reg[SYS_CFGREG_NUM];
61};
62
63#endif
diff --git a/include/linux/input/tps6507x-ts.h b/include/linux/input/tps6507x-ts.h
new file mode 100644
index 000000000000..ab1440313924
--- /dev/null
+++ b/include/linux/input/tps6507x-ts.h
@@ -0,0 +1,24 @@
1/* linux/i2c/tps6507x-ts.h
2 *
3 * Functions to access TPS65070 touch screen chip.
4 *
5 * Copyright (c) 2009 RidgeRun (todd.fischer@ridgerun.com)
6 *
7 *
8 * For licencing details see kernel-base/COPYING
9 */
10
11#ifndef __LINUX_I2C_TPS6507X_TS_H
12#define __LINUX_I2C_TPS6507X_TS_H
13
14/* Board specific touch screen initial values */
15struct touchscreen_init_data {
16 int poll_period; /* ms */
17 int vref; /* non-zero to leave vref on */
18 __u16 min_pressure; /* min reading to be treated as a touch */
19 __u16 vendor;
20 __u16 product;
21 __u16 version;
22};
23
24#endif /* __LINUX_I2C_TPS6507X_TS_H */
diff --git a/include/linux/interrupt.h b/include/linux/interrupt.h
index 75f3f00ac1e5..c2331138ca1b 100644
--- a/include/linux/interrupt.h
+++ b/include/linux/interrupt.h
@@ -39,7 +39,8 @@
39 * These flags used only by the kernel as part of the 39 * These flags used only by the kernel as part of the
40 * irq handling routines. 40 * irq handling routines.
41 * 41 *
42 * IRQF_DISABLED - keep irqs disabled when calling the action handler 42 * IRQF_DISABLED - keep irqs disabled when calling the action handler.
43 * DEPRECATED. This flag is a NOOP and scheduled to be removed
43 * IRQF_SAMPLE_RANDOM - irq is used to feed the random generator 44 * IRQF_SAMPLE_RANDOM - irq is used to feed the random generator
44 * IRQF_SHARED - allow sharing the irq among several devices 45 * IRQF_SHARED - allow sharing the irq among several devices
45 * IRQF_PROBE_SHARED - set by callers when they expect sharing mismatches to occur 46 * IRQF_PROBE_SHARED - set by callers when they expect sharing mismatches to occur
@@ -77,6 +78,18 @@ enum {
77 IRQTF_AFFINITY, 78 IRQTF_AFFINITY,
78}; 79};
79 80
81/*
82 * These values can be returned by request_any_context_irq() and
83 * describe the context the interrupt will be run in.
84 *
85 * IRQC_IS_HARDIRQ - interrupt runs in hardirq context
86 * IRQC_IS_NESTED - interrupt runs in a nested threaded context
87 */
88enum {
89 IRQC_IS_HARDIRQ = 0,
90 IRQC_IS_NESTED,
91};
92
80typedef irqreturn_t (*irq_handler_t)(int, void *); 93typedef irqreturn_t (*irq_handler_t)(int, void *);
81 94
82/** 95/**
@@ -120,6 +133,10 @@ request_irq(unsigned int irq, irq_handler_t handler, unsigned long flags,
120 return request_threaded_irq(irq, handler, NULL, flags, name, dev); 133 return request_threaded_irq(irq, handler, NULL, flags, name, dev);
121} 134}
122 135
136extern int __must_check
137request_any_context_irq(unsigned int irq, irq_handler_t handler,
138 unsigned long flags, const char *name, void *dev_id);
139
123extern void exit_irq_thread(void); 140extern void exit_irq_thread(void);
124#else 141#else
125 142
@@ -141,6 +158,13 @@ request_threaded_irq(unsigned int irq, irq_handler_t handler,
141 return request_irq(irq, handler, flags, name, dev); 158 return request_irq(irq, handler, flags, name, dev);
142} 159}
143 160
161static inline int __must_check
162request_any_context_irq(unsigned int irq, irq_handler_t handler,
163 unsigned long flags, const char *name, void *dev_id)
164{
165 return request_irq(irq, handler, flags, name, dev_id);
166}
167
144static inline void exit_irq_thread(void) { } 168static inline void exit_irq_thread(void) { }
145#endif 169#endif
146 170
@@ -209,6 +233,7 @@ extern int irq_set_affinity(unsigned int irq, const struct cpumask *cpumask);
209extern int irq_can_set_affinity(unsigned int irq); 233extern int irq_can_set_affinity(unsigned int irq);
210extern int irq_select_affinity(unsigned int irq); 234extern int irq_select_affinity(unsigned int irq);
211 235
236extern int irq_set_affinity_hint(unsigned int irq, const struct cpumask *m);
212#else /* CONFIG_SMP */ 237#else /* CONFIG_SMP */
213 238
214static inline int irq_set_affinity(unsigned int irq, const struct cpumask *m) 239static inline int irq_set_affinity(unsigned int irq, const struct cpumask *m)
@@ -223,6 +248,11 @@ static inline int irq_can_set_affinity(unsigned int irq)
223 248
224static inline int irq_select_affinity(unsigned int irq) { return 0; } 249static inline int irq_select_affinity(unsigned int irq) { return 0; }
225 250
251static inline int irq_set_affinity_hint(unsigned int irq,
252 const struct cpumask *m)
253{
254 return -EINVAL;
255}
226#endif /* CONFIG_SMP && CONFIG_GENERIC_HARDIRQS */ 256#endif /* CONFIG_SMP && CONFIG_GENERIC_HARDIRQS */
227 257
228#ifdef CONFIG_GENERIC_HARDIRQS 258#ifdef CONFIG_GENERIC_HARDIRQS
diff --git a/include/linux/iommu.h b/include/linux/iommu.h
index 3af4ffd591b9..be22ad83689c 100644
--- a/include/linux/iommu.h
+++ b/include/linux/iommu.h
@@ -37,9 +37,9 @@ struct iommu_ops {
37 int (*attach_dev)(struct iommu_domain *domain, struct device *dev); 37 int (*attach_dev)(struct iommu_domain *domain, struct device *dev);
38 void (*detach_dev)(struct iommu_domain *domain, struct device *dev); 38 void (*detach_dev)(struct iommu_domain *domain, struct device *dev);
39 int (*map)(struct iommu_domain *domain, unsigned long iova, 39 int (*map)(struct iommu_domain *domain, unsigned long iova,
40 phys_addr_t paddr, size_t size, int prot); 40 phys_addr_t paddr, int gfp_order, int prot);
41 void (*unmap)(struct iommu_domain *domain, unsigned long iova, 41 int (*unmap)(struct iommu_domain *domain, unsigned long iova,
42 size_t size); 42 int gfp_order);
43 phys_addr_t (*iova_to_phys)(struct iommu_domain *domain, 43 phys_addr_t (*iova_to_phys)(struct iommu_domain *domain,
44 unsigned long iova); 44 unsigned long iova);
45 int (*domain_has_cap)(struct iommu_domain *domain, 45 int (*domain_has_cap)(struct iommu_domain *domain,
@@ -56,10 +56,10 @@ extern int iommu_attach_device(struct iommu_domain *domain,
56 struct device *dev); 56 struct device *dev);
57extern void iommu_detach_device(struct iommu_domain *domain, 57extern void iommu_detach_device(struct iommu_domain *domain,
58 struct device *dev); 58 struct device *dev);
59extern int iommu_map_range(struct iommu_domain *domain, unsigned long iova, 59extern int iommu_map(struct iommu_domain *domain, unsigned long iova,
60 phys_addr_t paddr, size_t size, int prot); 60 phys_addr_t paddr, int gfp_order, int prot);
61extern void iommu_unmap_range(struct iommu_domain *domain, unsigned long iova, 61extern int iommu_unmap(struct iommu_domain *domain, unsigned long iova,
62 size_t size); 62 int gfp_order);
63extern phys_addr_t iommu_iova_to_phys(struct iommu_domain *domain, 63extern phys_addr_t iommu_iova_to_phys(struct iommu_domain *domain,
64 unsigned long iova); 64 unsigned long iova);
65extern int iommu_domain_has_cap(struct iommu_domain *domain, 65extern int iommu_domain_has_cap(struct iommu_domain *domain,
@@ -96,16 +96,16 @@ static inline void iommu_detach_device(struct iommu_domain *domain,
96{ 96{
97} 97}
98 98
99static inline int iommu_map_range(struct iommu_domain *domain, 99static inline int iommu_map(struct iommu_domain *domain, unsigned long iova,
100 unsigned long iova, phys_addr_t paddr, 100 phys_addr_t paddr, int gfp_order, int prot)
101 size_t size, int prot)
102{ 101{
103 return -ENODEV; 102 return -ENODEV;
104} 103}
105 104
106static inline void iommu_unmap_range(struct iommu_domain *domain, 105static inline int iommu_unmap(struct iommu_domain *domain, unsigned long iova,
107 unsigned long iova, size_t size) 106 int gfp_order)
108{ 107{
108 return -ENODEV;
109} 109}
110 110
111static inline phys_addr_t iommu_iova_to_phys(struct iommu_domain *domain, 111static inline phys_addr_t iommu_iova_to_phys(struct iommu_domain *domain,
diff --git a/include/linux/ioport.h b/include/linux/ioport.h
index 26fad187d661..b22790268b64 100644
--- a/include/linux/ioport.h
+++ b/include/linux/ioport.h
@@ -52,6 +52,7 @@ struct resource_list {
52 52
53#define IORESOURCE_MEM_64 0x00100000 53#define IORESOURCE_MEM_64 0x00100000
54#define IORESOURCE_WINDOW 0x00200000 /* forwarded by bridge */ 54#define IORESOURCE_WINDOW 0x00200000 /* forwarded by bridge */
55#define IORESOURCE_MUXED 0x00400000 /* Resource is software muxed */
55 56
56#define IORESOURCE_EXCLUSIVE 0x08000000 /* Userland may not map this resource */ 57#define IORESOURCE_EXCLUSIVE 0x08000000 /* Userland may not map this resource */
57#define IORESOURCE_DISABLED 0x10000000 58#define IORESOURCE_DISABLED 0x10000000
@@ -143,7 +144,8 @@ static inline unsigned long resource_type(const struct resource *res)
143} 144}
144 145
145/* Convenience shorthand with allocation */ 146/* Convenience shorthand with allocation */
146#define request_region(start,n,name) __request_region(&ioport_resource, (start), (n), (name), 0) 147#define request_region(start,n,name) __request_region(&ioport_resource, (start), (n), (name), 0)
148#define request_muxed_region(start,n,name) __request_region(&ioport_resource, (start), (n), (name), IORESOURCE_MUXED)
147#define __request_mem_region(start,n,name, excl) __request_region(&iomem_resource, (start), (n), (name), excl) 149#define __request_mem_region(start,n,name, excl) __request_region(&iomem_resource, (start), (n), (name), excl)
148#define request_mem_region(start,n,name) __request_region(&iomem_resource, (start), (n), (name), 0) 150#define request_mem_region(start,n,name) __request_region(&iomem_resource, (start), (n), (name), 0)
149#define request_mem_region_exclusive(start,n,name) \ 151#define request_mem_region_exclusive(start,n,name) \
diff --git a/include/linux/ipv6.h b/include/linux/ipv6.h
index 2ab5509f6d49..99e1ab7e3eec 100644
--- a/include/linux/ipv6.h
+++ b/include/linux/ipv6.h
@@ -254,6 +254,7 @@ struct inet6_skb_parm {
254 254
255#define IP6SKB_XFRM_TRANSFORMED 1 255#define IP6SKB_XFRM_TRANSFORMED 1
256#define IP6SKB_FORWARDED 2 256#define IP6SKB_FORWARDED 2
257#define IP6SKB_REROUTED 4
257}; 258};
258 259
259#define IP6CB(skb) ((struct inet6_skb_parm*)((skb)->cb)) 260#define IP6CB(skb) ((struct inet6_skb_parm*)((skb)->cb))
@@ -382,6 +383,7 @@ struct raw6_sock {
382 __u32 checksum; /* perform checksum */ 383 __u32 checksum; /* perform checksum */
383 __u32 offset; /* checksum offset */ 384 __u32 offset; /* checksum offset */
384 struct icmp6_filter filter; 385 struct icmp6_filter filter;
386 __u32 ip6mr_table;
385 /* ipv6_pinfo has to be the last member of raw6_sock, see inet6_sk_generic */ 387 /* ipv6_pinfo has to be the last member of raw6_sock, see inet6_sk_generic */
386 struct ipv6_pinfo inet6; 388 struct ipv6_pinfo inet6;
387}; 389};
diff --git a/include/linux/irq.h b/include/linux/irq.h
index 707ab122e2e6..c03243ad84b4 100644
--- a/include/linux/irq.h
+++ b/include/linux/irq.h
@@ -195,6 +195,7 @@ struct irq_desc {
195 raw_spinlock_t lock; 195 raw_spinlock_t lock;
196#ifdef CONFIG_SMP 196#ifdef CONFIG_SMP
197 cpumask_var_t affinity; 197 cpumask_var_t affinity;
198 const struct cpumask *affinity_hint;
198 unsigned int node; 199 unsigned int node;
199#ifdef CONFIG_GENERIC_PENDING_IRQ 200#ifdef CONFIG_GENERIC_PENDING_IRQ
200 cpumask_var_t pending_mask; 201 cpumask_var_t pending_mask;
diff --git a/include/linux/isapnp.h b/include/linux/isapnp.h
index cd5a269fdb5e..e2d28b026a8c 100644
--- a/include/linux/isapnp.h
+++ b/include/linux/isapnp.h
@@ -43,10 +43,10 @@
43 */ 43 */
44 44
45#ifdef __KERNEL__ 45#ifdef __KERNEL__
46#include <linux/mod_devicetable.h>
46 47
47#define DEVICE_COUNT_COMPATIBLE 4 48#define DEVICE_COUNT_COMPATIBLE 4
48 49
49#define ISAPNP_ANY_ID 0xffff
50#define ISAPNP_CARD_DEVS 8 50#define ISAPNP_CARD_DEVS 8
51 51
52#define ISAPNP_CARD_ID(_va, _vb, _vc, _device) \ 52#define ISAPNP_CARD_ID(_va, _vb, _vc, _device) \
@@ -74,12 +74,6 @@ struct isapnp_card_id {
74#define ISAPNP_DEVICE_SINGLE_END \ 74#define ISAPNP_DEVICE_SINGLE_END \
75 .card_vendor = 0, .card_device = 0 75 .card_vendor = 0, .card_device = 0
76 76
77struct isapnp_device_id {
78 unsigned short card_vendor, card_device;
79 unsigned short vendor, function;
80 unsigned long driver_data; /* data private to the driver */
81};
82
83#if defined(CONFIG_ISAPNP) || (defined(CONFIG_ISAPNP_MODULE) && defined(MODULE)) 77#if defined(CONFIG_ISAPNP) || (defined(CONFIG_ISAPNP_MODULE) && defined(MODULE))
84 78
85#define __ISAPNP__ 79#define __ISAPNP__
diff --git a/include/linux/ivtvfb.h b/include/linux/ivtvfb.h
index 9d88b29ddf55..e8b92f67f10d 100644
--- a/include/linux/ivtvfb.h
+++ b/include/linux/ivtvfb.h
@@ -33,6 +33,5 @@ struct ivtvfb_dma_frame {
33}; 33};
34 34
35#define IVTVFB_IOC_DMA_FRAME _IOW('V', BASE_VIDIOC_PRIVATE+0, struct ivtvfb_dma_frame) 35#define IVTVFB_IOC_DMA_FRAME _IOW('V', BASE_VIDIOC_PRIVATE+0, struct ivtvfb_dma_frame)
36#define FBIO_WAITFORVSYNC _IOW('F', 0x20, __u32)
37 36
38#endif 37#endif
diff --git a/include/linux/jbd.h b/include/linux/jbd.h
index 516a2a27e87a..e06965081ba5 100644
--- a/include/linux/jbd.h
+++ b/include/linux/jbd.h
@@ -427,9 +427,9 @@ struct transaction_s
427 enum { 427 enum {
428 T_RUNNING, 428 T_RUNNING,
429 T_LOCKED, 429 T_LOCKED,
430 T_RUNDOWN,
431 T_FLUSH, 430 T_FLUSH,
432 T_COMMIT, 431 T_COMMIT,
432 T_COMMIT_RECORD,
433 T_FINISHED 433 T_FINISHED
434 } t_state; 434 } t_state;
435 435
@@ -991,6 +991,7 @@ int journal_start_commit(journal_t *journal, tid_t *tid);
991int journal_force_commit_nested(journal_t *journal); 991int journal_force_commit_nested(journal_t *journal);
992int log_wait_commit(journal_t *journal, tid_t tid); 992int log_wait_commit(journal_t *journal, tid_t tid);
993int log_do_checkpoint(journal_t *journal); 993int log_do_checkpoint(journal_t *journal);
994int journal_trans_will_send_data_barrier(journal_t *journal, tid_t tid);
994 995
995void __log_wait_for_space(journal_t *journal); 996void __log_wait_for_space(journal_t *journal);
996extern void __journal_drop_transaction(journal_t *, transaction_t *); 997extern void __journal_drop_transaction(journal_t *, transaction_t *);
diff --git a/include/linux/jffs2.h b/include/linux/jffs2.h
index 2b32d638147d..0874ab59ffef 100644
--- a/include/linux/jffs2.h
+++ b/include/linux/jffs2.h
@@ -215,8 +215,8 @@ union jffs2_node_union
215 215
216/* Data payload for device nodes. */ 216/* Data payload for device nodes. */
217union jffs2_device_node { 217union jffs2_device_node {
218 jint16_t old; 218 jint16_t old_id;
219 jint32_t new; 219 jint32_t new_id;
220}; 220};
221 221
222#endif /* __LINUX_JFFS2_H__ */ 222#endif /* __LINUX_JFFS2_H__ */
diff --git a/include/linux/joystick.h b/include/linux/joystick.h
index 9e20c29c1e14..47199b13e0eb 100644
--- a/include/linux/joystick.h
+++ b/include/linux/joystick.h
@@ -64,8 +64,8 @@ struct js_event {
64#define JSIOCSCORR _IOW('j', 0x21, struct js_corr) /* set correction values */ 64#define JSIOCSCORR _IOW('j', 0x21, struct js_corr) /* set correction values */
65#define JSIOCGCORR _IOR('j', 0x22, struct js_corr) /* get correction values */ 65#define JSIOCGCORR _IOR('j', 0x22, struct js_corr) /* get correction values */
66 66
67#define JSIOCSAXMAP _IOW('j', 0x31, __u8[ABS_MAX + 1]) /* set axis mapping */ 67#define JSIOCSAXMAP _IOW('j', 0x31, __u8[ABS_CNT]) /* set axis mapping */
68#define JSIOCGAXMAP _IOR('j', 0x32, __u8[ABS_MAX + 1]) /* get axis mapping */ 68#define JSIOCGAXMAP _IOR('j', 0x32, __u8[ABS_CNT]) /* get axis mapping */
69#define JSIOCSBTNMAP _IOW('j', 0x33, __u16[KEY_MAX - BTN_MISC + 1]) /* set button mapping */ 69#define JSIOCSBTNMAP _IOW('j', 0x33, __u16[KEY_MAX - BTN_MISC + 1]) /* set button mapping */
70#define JSIOCGBTNMAP _IOR('j', 0x34, __u16[KEY_MAX - BTN_MISC + 1]) /* get button mapping */ 70#define JSIOCGBTNMAP _IOR('j', 0x34, __u16[KEY_MAX - BTN_MISC + 1]) /* get button mapping */
71 71
diff --git a/include/linux/kdb.h b/include/linux/kdb.h
new file mode 100644
index 000000000000..ccb2b3ec0fe8
--- /dev/null
+++ b/include/linux/kdb.h
@@ -0,0 +1,117 @@
1#ifndef _KDB_H
2#define _KDB_H
3
4/*
5 * Kernel Debugger Architecture Independent Global Headers
6 *
7 * This file is subject to the terms and conditions of the GNU General Public
8 * License. See the file "COPYING" in the main directory of this archive
9 * for more details.
10 *
11 * Copyright (c) 2000-2007 Silicon Graphics, Inc. All Rights Reserved.
12 * Copyright (C) 2000 Stephane Eranian <eranian@hpl.hp.com>
13 * Copyright (C) 2009 Jason Wessel <jason.wessel@windriver.com>
14 */
15
16#ifdef CONFIG_KGDB_KDB
17#include <linux/init.h>
18#include <linux/sched.h>
19#include <asm/atomic.h>
20
21#define KDB_POLL_FUNC_MAX 5
22extern int kdb_poll_idx;
23
24/*
25 * kdb_initial_cpu is initialized to -1, and is set to the cpu
26 * number whenever the kernel debugger is entered.
27 */
28extern int kdb_initial_cpu;
29extern atomic_t kdb_event;
30
31/*
32 * kdb_diemsg
33 *
34 * Contains a pointer to the last string supplied to the
35 * kernel 'die' panic function.
36 */
37extern const char *kdb_diemsg;
38
39#define KDB_FLAG_EARLYKDB (1 << 0) /* set from boot parameter kdb=early */
40#define KDB_FLAG_CATASTROPHIC (1 << 1) /* A catastrophic event has occurred */
41#define KDB_FLAG_CMD_INTERRUPT (1 << 2) /* Previous command was interrupted */
42#define KDB_FLAG_NOIPI (1 << 3) /* Do not send IPIs */
43#define KDB_FLAG_ONLY_DO_DUMP (1 << 4) /* Only do a dump, used when
44 * kdb is off */
45#define KDB_FLAG_NO_CONSOLE (1 << 5) /* No console is available,
46 * kdb is disabled */
47#define KDB_FLAG_NO_VT_CONSOLE (1 << 6) /* No VT console is available, do
48 * not use keyboard */
49#define KDB_FLAG_NO_I8042 (1 << 7) /* No i8042 chip is available, do
50 * not use keyboard */
51
52extern int kdb_flags; /* Global flags, see kdb_state for per cpu state */
53
54extern void kdb_save_flags(void);
55extern void kdb_restore_flags(void);
56
57#define KDB_FLAG(flag) (kdb_flags & KDB_FLAG_##flag)
58#define KDB_FLAG_SET(flag) ((void)(kdb_flags |= KDB_FLAG_##flag))
59#define KDB_FLAG_CLEAR(flag) ((void)(kdb_flags &= ~KDB_FLAG_##flag))
60
61/*
62 * External entry point for the kernel debugger. The pt_regs
63 * at the time of entry are supplied along with the reason for
64 * entry to the kernel debugger.
65 */
66
67typedef enum {
68 KDB_REASON_ENTER = 1, /* KDB_ENTER() trap/fault - regs valid */
69 KDB_REASON_ENTER_SLAVE, /* KDB_ENTER_SLAVE() trap/fault - regs valid */
70 KDB_REASON_BREAK, /* Breakpoint inst. - regs valid */
71 KDB_REASON_DEBUG, /* Debug Fault - regs valid */
72 KDB_REASON_OOPS, /* Kernel Oops - regs valid */
73 KDB_REASON_SWITCH, /* CPU switch - regs valid*/
74 KDB_REASON_KEYBOARD, /* Keyboard entry - regs valid */
75 KDB_REASON_NMI, /* Non-maskable interrupt; regs valid */
76 KDB_REASON_RECURSE, /* Recursive entry to kdb;
77 * regs probably valid */
78 KDB_REASON_SSTEP, /* Single Step trap. - regs valid */
79} kdb_reason_t;
80
81extern int kdb_trap_printk;
82extern int vkdb_printf(const char *fmt, va_list args)
83 __attribute__ ((format (printf, 1, 0)));
84extern int kdb_printf(const char *, ...)
85 __attribute__ ((format (printf, 1, 2)));
86typedef int (*kdb_printf_t)(const char *, ...)
87 __attribute__ ((format (printf, 1, 2)));
88
89extern void kdb_init(int level);
90
91/* Access to kdb specific polling devices */
92typedef int (*get_char_func)(void);
93extern get_char_func kdb_poll_funcs[];
94extern int kdb_get_kbd_char(void);
95
96static inline
97int kdb_process_cpu(const struct task_struct *p)
98{
99 unsigned int cpu = task_thread_info(p)->cpu;
100 if (cpu > num_possible_cpus())
101 cpu = 0;
102 return cpu;
103}
104
105/* kdb access to register set for stack dumping */
106extern struct pt_regs *kdb_current_regs;
107
108#else /* ! CONFIG_KGDB_KDB */
109#define kdb_printf(...)
110#define kdb_init(x)
111#endif /* CONFIG_KGDB_KDB */
112enum {
113 KDB_NOT_INITIALIZED,
114 KDB_INIT_EARLY,
115 KDB_INIT_FULL,
116};
117#endif /* !_KDB_H */
diff --git a/include/linux/kernel.h b/include/linux/kernel.h
index 9365227dbaf6..8317ec4b9f3b 100644
--- a/include/linux/kernel.h
+++ b/include/linux/kernel.h
@@ -4,6 +4,8 @@
4/* 4/*
5 * 'kernel.h' contains some often-used function prototypes etc 5 * 'kernel.h' contains some often-used function prototypes etc
6 */ 6 */
7#define __ALIGN_KERNEL(x, a) __ALIGN_KERNEL_MASK(x, (typeof(x))(a) - 1)
8#define __ALIGN_KERNEL_MASK(x, mask) (((x) + (mask)) & ~(mask))
7 9
8#ifdef __KERNEL__ 10#ifdef __KERNEL__
9 11
@@ -22,9 +24,9 @@
22extern const char linux_banner[]; 24extern const char linux_banner[];
23extern const char linux_proc_banner[]; 25extern const char linux_proc_banner[];
24 26
25#define USHORT_MAX ((u16)(~0U)) 27#define USHRT_MAX ((u16)(~0U))
26#define SHORT_MAX ((s16)(USHORT_MAX>>1)) 28#define SHRT_MAX ((s16)(USHRT_MAX>>1))
27#define SHORT_MIN (-SHORT_MAX - 1) 29#define SHRT_MIN ((s16)(-SHRT_MAX - 1))
28#define INT_MAX ((int)(~0U>>1)) 30#define INT_MAX ((int)(~0U>>1))
29#define INT_MIN (-INT_MAX - 1) 31#define INT_MIN (-INT_MAX - 1)
30#define UINT_MAX (~0U) 32#define UINT_MAX (~0U)
@@ -37,8 +39,8 @@ extern const char linux_proc_banner[];
37 39
38#define STACK_MAGIC 0xdeadbeef 40#define STACK_MAGIC 0xdeadbeef
39 41
40#define ALIGN(x,a) __ALIGN_MASK(x,(typeof(x))(a)-1) 42#define ALIGN(x, a) __ALIGN_KERNEL((x), (a))
41#define __ALIGN_MASK(x,mask) (((x)+(mask))&~(mask)) 43#define __ALIGN_MASK(x, mask) __ALIGN_KERNEL_MASK((x), (mask))
42#define PTR_ALIGN(p, a) ((typeof(p))ALIGN((unsigned long)(p), (a))) 44#define PTR_ALIGN(p, a) ((typeof(p))ALIGN((unsigned long)(p), (a)))
43#define IS_ALIGNED(x, a) (((x) & ((typeof(x))(a) - 1)) == 0) 45#define IS_ALIGNED(x, a) (((x) & ((typeof(x))(a) - 1)) == 0)
44 46
@@ -344,6 +346,7 @@ extern enum system_states {
344#define TAINT_OVERRIDDEN_ACPI_TABLE 8 346#define TAINT_OVERRIDDEN_ACPI_TABLE 8
345#define TAINT_WARN 9 347#define TAINT_WARN 9
346#define TAINT_CRAP 10 348#define TAINT_CRAP 10
349#define TAINT_FIRMWARE_WORKAROUND 11
347 350
348extern void dump_stack(void) __cold; 351extern void dump_stack(void) __cold;
349 352
@@ -372,6 +375,8 @@ static inline char *pack_hex_byte(char *buf, u8 byte)
372 return buf; 375 return buf;
373} 376}
374 377
378extern int hex_to_bin(char ch);
379
375#ifndef pr_fmt 380#ifndef pr_fmt
376#define pr_fmt(fmt) fmt 381#define pr_fmt(fmt) fmt
377#endif 382#endif
@@ -386,6 +391,7 @@ static inline char *pack_hex_byte(char *buf, u8 byte)
386 printk(KERN_ERR pr_fmt(fmt), ##__VA_ARGS__) 391 printk(KERN_ERR pr_fmt(fmt), ##__VA_ARGS__)
387#define pr_warning(fmt, ...) \ 392#define pr_warning(fmt, ...) \
388 printk(KERN_WARNING pr_fmt(fmt), ##__VA_ARGS__) 393 printk(KERN_WARNING pr_fmt(fmt), ##__VA_ARGS__)
394#define pr_warn pr_warning
389#define pr_notice(fmt, ...) \ 395#define pr_notice(fmt, ...) \
390 printk(KERN_NOTICE pr_fmt(fmt), ##__VA_ARGS__) 396 printk(KERN_NOTICE pr_fmt(fmt), ##__VA_ARGS__)
391#define pr_info(fmt, ...) \ 397#define pr_info(fmt, ...) \
@@ -420,14 +426,13 @@ static inline char *pack_hex_byte(char *buf, u8 byte)
420 * no local ratelimit_state used in the !PRINTK case 426 * no local ratelimit_state used in the !PRINTK case
421 */ 427 */
422#ifdef CONFIG_PRINTK 428#ifdef CONFIG_PRINTK
423#define printk_ratelimited(fmt, ...) ({ \ 429#define printk_ratelimited(fmt, ...) ({ \
424 static struct ratelimit_state _rs = { \ 430 static DEFINE_RATELIMIT_STATE(_rs, \
425 .interval = DEFAULT_RATELIMIT_INTERVAL, \ 431 DEFAULT_RATELIMIT_INTERVAL, \
426 .burst = DEFAULT_RATELIMIT_BURST, \ 432 DEFAULT_RATELIMIT_BURST); \
427 }; \ 433 \
428 \ 434 if (__ratelimit(&_rs)) \
429 if (__ratelimit(&_rs)) \ 435 printk(fmt, ##__VA_ARGS__); \
430 printk(fmt, ##__VA_ARGS__); \
431}) 436})
432#else 437#else
433/* No effect, but we still get type checking even in the !PRINTK case: */ 438/* No effect, but we still get type checking even in the !PRINTK case: */
@@ -444,6 +449,7 @@ static inline char *pack_hex_byte(char *buf, u8 byte)
444 printk_ratelimited(KERN_ERR pr_fmt(fmt), ##__VA_ARGS__) 449 printk_ratelimited(KERN_ERR pr_fmt(fmt), ##__VA_ARGS__)
445#define pr_warning_ratelimited(fmt, ...) \ 450#define pr_warning_ratelimited(fmt, ...) \
446 printk_ratelimited(KERN_WARNING pr_fmt(fmt), ##__VA_ARGS__) 451 printk_ratelimited(KERN_WARNING pr_fmt(fmt), ##__VA_ARGS__)
452#define pr_warn_ratelimited pr_warning_ratelimited
447#define pr_notice_ratelimited(fmt, ...) \ 453#define pr_notice_ratelimited(fmt, ...) \
448 printk_ratelimited(KERN_NOTICE pr_fmt(fmt), ##__VA_ARGS__) 454 printk_ratelimited(KERN_NOTICE pr_fmt(fmt), ##__VA_ARGS__)
449#define pr_info_ratelimited(fmt, ...) \ 455#define pr_info_ratelimited(fmt, ...) \
@@ -490,6 +496,13 @@ static inline void tracing_off(void) { }
490static inline void tracing_off_permanent(void) { } 496static inline void tracing_off_permanent(void) { }
491static inline int tracing_is_on(void) { return 0; } 497static inline int tracing_is_on(void) { return 0; }
492#endif 498#endif
499
500enum ftrace_dump_mode {
501 DUMP_NONE,
502 DUMP_ALL,
503 DUMP_ORIG,
504};
505
493#ifdef CONFIG_TRACING 506#ifdef CONFIG_TRACING
494extern void tracing_start(void); 507extern void tracing_start(void);
495extern void tracing_stop(void); 508extern void tracing_stop(void);
@@ -571,7 +584,7 @@ __ftrace_vbprintk(unsigned long ip, const char *fmt, va_list ap);
571extern int 584extern int
572__ftrace_vprintk(unsigned long ip, const char *fmt, va_list ap); 585__ftrace_vprintk(unsigned long ip, const char *fmt, va_list ap);
573 586
574extern void ftrace_dump(void); 587extern void ftrace_dump(enum ftrace_dump_mode oops_dump_mode);
575#else 588#else
576static inline void 589static inline void
577ftrace_special(unsigned long arg1, unsigned long arg2, unsigned long arg3) { } 590ftrace_special(unsigned long arg1, unsigned long arg2, unsigned long arg3) { }
@@ -592,7 +605,7 @@ ftrace_vprintk(const char *fmt, va_list ap)
592{ 605{
593 return 0; 606 return 0;
594} 607}
595static inline void ftrace_dump(void) { } 608static inline void ftrace_dump(enum ftrace_dump_mode oops_dump_mode) { }
596#endif /* CONFIG_TRACING */ 609#endif /* CONFIG_TRACING */
597 610
598/* 611/*
diff --git a/include/linux/kfifo.h b/include/linux/kfifo.h
index e117b1aee69c..9fad0527344f 100644
--- a/include/linux/kfifo.h
+++ b/include/linux/kfifo.h
@@ -201,7 +201,7 @@ static inline __must_check unsigned int kfifo_avail(struct kfifo *fifo)
201 * @n: the length of the data to be added. 201 * @n: the length of the data to be added.
202 * @lock: pointer to the spinlock to use for locking. 202 * @lock: pointer to the spinlock to use for locking.
203 * 203 *
204 * This function copies at most @len bytes from the @from buffer into 204 * This function copies at most @n bytes from the @from buffer into
205 * the FIFO depending on the free space, and returns the number of 205 * the FIFO depending on the free space, and returns the number of
206 * bytes copied. 206 * bytes copied.
207 */ 207 */
@@ -227,7 +227,7 @@ static inline unsigned int kfifo_in_locked(struct kfifo *fifo,
227 * @n: the size of the destination buffer. 227 * @n: the size of the destination buffer.
228 * @lock: pointer to the spinlock to use for locking. 228 * @lock: pointer to the spinlock to use for locking.
229 * 229 *
230 * This function copies at most @len bytes from the FIFO into the 230 * This function copies at most @n bytes from the FIFO into the
231 * @to buffer and returns the number of copied bytes. 231 * @to buffer and returns the number of copied bytes.
232 */ 232 */
233static inline __must_check unsigned int kfifo_out_locked(struct kfifo *fifo, 233static inline __must_check unsigned int kfifo_out_locked(struct kfifo *fifo,
diff --git a/include/linux/kgdb.h b/include/linux/kgdb.h
index 19ec41a183f5..9340f34d1bb5 100644
--- a/include/linux/kgdb.h
+++ b/include/linux/kgdb.h
@@ -16,10 +16,12 @@
16#include <linux/serial_8250.h> 16#include <linux/serial_8250.h>
17#include <linux/linkage.h> 17#include <linux/linkage.h>
18#include <linux/init.h> 18#include <linux/init.h>
19
20#include <asm/atomic.h> 19#include <asm/atomic.h>
20#ifdef CONFIG_HAVE_ARCH_KGDB
21#include <asm/kgdb.h> 21#include <asm/kgdb.h>
22#endif
22 23
24#ifdef CONFIG_KGDB
23struct pt_regs; 25struct pt_regs;
24 26
25/** 27/**
@@ -34,20 +36,6 @@ struct pt_regs;
34extern int kgdb_skipexception(int exception, struct pt_regs *regs); 36extern int kgdb_skipexception(int exception, struct pt_regs *regs);
35 37
36/** 38/**
37 * kgdb_post_primary_code - (optional) Save error vector/code numbers.
38 * @regs: Original pt_regs.
39 * @e_vector: Original error vector.
40 * @err_code: Original error code.
41 *
42 * This is usually needed on architectures which support SMP and
43 * KGDB. This function is called after all the secondary cpus have
44 * been put to a know spin state and the primary CPU has control over
45 * KGDB.
46 */
47extern void kgdb_post_primary_code(struct pt_regs *regs, int e_vector,
48 int err_code);
49
50/**
51 * kgdb_disable_hw_debug - (optional) Disable hardware debugging hook 39 * kgdb_disable_hw_debug - (optional) Disable hardware debugging hook
52 * @regs: Current &struct pt_regs. 40 * @regs: Current &struct pt_regs.
53 * 41 *
@@ -72,6 +60,7 @@ struct uart_port;
72void kgdb_breakpoint(void); 60void kgdb_breakpoint(void);
73 61
74extern int kgdb_connected; 62extern int kgdb_connected;
63extern int kgdb_io_module_registered;
75 64
76extern atomic_t kgdb_setting_breakpoint; 65extern atomic_t kgdb_setting_breakpoint;
77extern atomic_t kgdb_cpu_doing_single_step; 66extern atomic_t kgdb_cpu_doing_single_step;
@@ -202,12 +191,34 @@ kgdb_arch_handle_exception(int vector, int signo, int err_code,
202 */ 191 */
203extern void kgdb_roundup_cpus(unsigned long flags); 192extern void kgdb_roundup_cpus(unsigned long flags);
204 193
194/**
195 * kgdb_arch_set_pc - Generic call back to the program counter
196 * @regs: Current &struct pt_regs.
197 * @pc: The new value for the program counter
198 *
199 * This function handles updating the program counter and requires an
200 * architecture specific implementation.
201 */
202extern void kgdb_arch_set_pc(struct pt_regs *regs, unsigned long pc);
203
204
205/* Optional functions. */ 205/* Optional functions. */
206extern int kgdb_validate_break_address(unsigned long addr); 206extern int kgdb_validate_break_address(unsigned long addr);
207extern int kgdb_arch_set_breakpoint(unsigned long addr, char *saved_instr); 207extern int kgdb_arch_set_breakpoint(unsigned long addr, char *saved_instr);
208extern int kgdb_arch_remove_breakpoint(unsigned long addr, char *bundle); 208extern int kgdb_arch_remove_breakpoint(unsigned long addr, char *bundle);
209 209
210/** 210/**
211 * kgdb_arch_late - Perform any architecture specific initalization.
212 *
213 * This function will handle the late initalization of any
214 * architecture specific callbacks. This is an optional function for
215 * handling things like late initialization of hw breakpoints. The
216 * default implementation does nothing.
217 */
218extern void kgdb_arch_late(void);
219
220
221/**
211 * struct kgdb_arch - Describe architecture specific values. 222 * struct kgdb_arch - Describe architecture specific values.
212 * @gdb_bpt_instr: The instruction to trigger a breakpoint. 223 * @gdb_bpt_instr: The instruction to trigger a breakpoint.
213 * @flags: Flags for the breakpoint, currently just %KGDB_HW_BREAKPOINT. 224 * @flags: Flags for the breakpoint, currently just %KGDB_HW_BREAKPOINT.
@@ -247,6 +258,8 @@ struct kgdb_arch {
247 * the I/O driver. 258 * the I/O driver.
248 * @post_exception: Pointer to a function that will do any cleanup work 259 * @post_exception: Pointer to a function that will do any cleanup work
249 * for the I/O driver. 260 * for the I/O driver.
261 * @is_console: 1 if the end device is a console 0 if the I/O device is
262 * not a console
250 */ 263 */
251struct kgdb_io { 264struct kgdb_io {
252 const char *name; 265 const char *name;
@@ -256,6 +269,7 @@ struct kgdb_io {
256 int (*init) (void); 269 int (*init) (void);
257 void (*pre_exception) (void); 270 void (*pre_exception) (void);
258 void (*post_exception) (void); 271 void (*post_exception) (void);
272 int is_console;
259}; 273};
260 274
261extern struct kgdb_arch arch_kgdb_ops; 275extern struct kgdb_arch arch_kgdb_ops;
@@ -264,12 +278,14 @@ extern unsigned long __weak kgdb_arch_pc(int exception, struct pt_regs *regs);
264 278
265extern int kgdb_register_io_module(struct kgdb_io *local_kgdb_io_ops); 279extern int kgdb_register_io_module(struct kgdb_io *local_kgdb_io_ops);
266extern void kgdb_unregister_io_module(struct kgdb_io *local_kgdb_io_ops); 280extern void kgdb_unregister_io_module(struct kgdb_io *local_kgdb_io_ops);
281extern struct kgdb_io *dbg_io_ops;
267 282
268extern int kgdb_hex2long(char **ptr, unsigned long *long_val); 283extern int kgdb_hex2long(char **ptr, unsigned long *long_val);
269extern int kgdb_mem2hex(char *mem, char *buf, int count); 284extern int kgdb_mem2hex(char *mem, char *buf, int count);
270extern int kgdb_hex2mem(char *buf, char *mem, int count); 285extern int kgdb_hex2mem(char *buf, char *mem, int count);
271 286
272extern int kgdb_isremovedbreak(unsigned long addr); 287extern int kgdb_isremovedbreak(unsigned long addr);
288extern void kgdb_schedule_breakpoint(void);
273 289
274extern int 290extern int
275kgdb_handle_exception(int ex_vector, int signo, int err_code, 291kgdb_handle_exception(int ex_vector, int signo, int err_code,
@@ -278,5 +294,12 @@ extern int kgdb_nmicallback(int cpu, void *regs);
278 294
279extern int kgdb_single_step; 295extern int kgdb_single_step;
280extern atomic_t kgdb_active; 296extern atomic_t kgdb_active;
281 297#define in_dbg_master() \
298 (raw_smp_processor_id() == atomic_read(&kgdb_active))
299extern bool dbg_is_early;
300extern void __init dbg_late_init(void);
301#else /* ! CONFIG_KGDB */
302#define in_dbg_master() (0)
303#define dbg_late_init()
304#endif /* ! CONFIG_KGDB */
282#endif /* _KGDB_H_ */ 305#endif /* _KGDB_H_ */
diff --git a/include/linux/kmod.h b/include/linux/kmod.h
index facb27fe7de0..6efd7a78de6a 100644
--- a/include/linux/kmod.h
+++ b/include/linux/kmod.h
@@ -23,6 +23,7 @@
23#include <linux/stddef.h> 23#include <linux/stddef.h>
24#include <linux/errno.h> 24#include <linux/errno.h>
25#include <linux/compiler.h> 25#include <linux/compiler.h>
26#include <linux/workqueue.h>
26 27
27#define KMOD_PATH_LEN 256 28#define KMOD_PATH_LEN 256
28 29
@@ -45,19 +46,6 @@ static inline int request_module_nowait(const char *name, ...) { return -ENOSYS;
45 46
46struct key; 47struct key;
47struct file; 48struct file;
48struct subprocess_info;
49
50/* Allocate a subprocess_info structure */
51struct subprocess_info *call_usermodehelper_setup(char *path, char **argv,
52 char **envp, gfp_t gfp_mask);
53
54/* Set various pieces of state into the subprocess_info structure */
55void call_usermodehelper_setkeys(struct subprocess_info *info,
56 struct key *session_keyring);
57int call_usermodehelper_stdinpipe(struct subprocess_info *sub_info,
58 struct file **filp);
59void call_usermodehelper_setcleanup(struct subprocess_info *info,
60 void (*cleanup)(char **argv, char **envp));
61 49
62enum umh_wait { 50enum umh_wait {
63 UMH_NO_WAIT = -1, /* don't wait at all */ 51 UMH_NO_WAIT = -1, /* don't wait at all */
@@ -65,6 +53,29 @@ enum umh_wait {
65 UMH_WAIT_PROC = 1, /* wait for the process to complete */ 53 UMH_WAIT_PROC = 1, /* wait for the process to complete */
66}; 54};
67 55
56struct subprocess_info {
57 struct work_struct work;
58 struct completion *complete;
59 char *path;
60 char **argv;
61 char **envp;
62 enum umh_wait wait;
63 int retval;
64 int (*init)(struct subprocess_info *info);
65 void (*cleanup)(struct subprocess_info *info);
66 void *data;
67};
68
69/* Allocate a subprocess_info structure */
70struct subprocess_info *call_usermodehelper_setup(char *path, char **argv,
71 char **envp, gfp_t gfp_mask);
72
73/* Set various pieces of state into the subprocess_info structure */
74void call_usermodehelper_setfns(struct subprocess_info *info,
75 int (*init)(struct subprocess_info *info),
76 void (*cleanup)(struct subprocess_info *info),
77 void *data);
78
68/* Actually execute the sub-process */ 79/* Actually execute the sub-process */
69int call_usermodehelper_exec(struct subprocess_info *info, enum umh_wait wait); 80int call_usermodehelper_exec(struct subprocess_info *info, enum umh_wait wait);
70 81
@@ -73,38 +84,33 @@ int call_usermodehelper_exec(struct subprocess_info *info, enum umh_wait wait);
73void call_usermodehelper_freeinfo(struct subprocess_info *info); 84void call_usermodehelper_freeinfo(struct subprocess_info *info);
74 85
75static inline int 86static inline int
76call_usermodehelper(char *path, char **argv, char **envp, enum umh_wait wait) 87call_usermodehelper_fns(char *path, char **argv, char **envp,
88 enum umh_wait wait,
89 int (*init)(struct subprocess_info *info),
90 void (*cleanup)(struct subprocess_info *), void *data)
77{ 91{
78 struct subprocess_info *info; 92 struct subprocess_info *info;
79 gfp_t gfp_mask = (wait == UMH_NO_WAIT) ? GFP_ATOMIC : GFP_KERNEL; 93 gfp_t gfp_mask = (wait == UMH_NO_WAIT) ? GFP_ATOMIC : GFP_KERNEL;
80 94
81 info = call_usermodehelper_setup(path, argv, envp, gfp_mask); 95 info = call_usermodehelper_setup(path, argv, envp, gfp_mask);
96
82 if (info == NULL) 97 if (info == NULL)
83 return -ENOMEM; 98 return -ENOMEM;
99
100 call_usermodehelper_setfns(info, init, cleanup, data);
101
84 return call_usermodehelper_exec(info, wait); 102 return call_usermodehelper_exec(info, wait);
85} 103}
86 104
87static inline int 105static inline int
88call_usermodehelper_keys(char *path, char **argv, char **envp, 106call_usermodehelper(char *path, char **argv, char **envp, enum umh_wait wait)
89 struct key *session_keyring, enum umh_wait wait)
90{ 107{
91 struct subprocess_info *info; 108 return call_usermodehelper_fns(path, argv, envp, wait,
92 gfp_t gfp_mask = (wait == UMH_NO_WAIT) ? GFP_ATOMIC : GFP_KERNEL; 109 NULL, NULL, NULL);
93
94 info = call_usermodehelper_setup(path, argv, envp, gfp_mask);
95 if (info == NULL)
96 return -ENOMEM;
97
98 call_usermodehelper_setkeys(info, session_keyring);
99 return call_usermodehelper_exec(info, wait);
100} 110}
101 111
102extern void usermodehelper_init(void); 112extern void usermodehelper_init(void);
103 113
104struct file;
105extern int call_usermodehelper_pipe(char *path, char *argv[], char *envp[],
106 struct file **filp);
107
108extern int usermodehelper_disable(void); 114extern int usermodehelper_disable(void);
109extern void usermodehelper_enable(void); 115extern void usermodehelper_enable(void);
110 116
diff --git a/include/linux/kobj_map.h b/include/linux/kobj_map.h
index 73717ed9ea79..18ca75ffcc5a 100644
--- a/include/linux/kobj_map.h
+++ b/include/linux/kobj_map.h
@@ -1,3 +1,10 @@
1/*
2 * kobj_map.h
3 */
4
5#ifndef _KOBJ_MAP_H_
6#define _KOBJ_MAP_H_
7
1#include <linux/mutex.h> 8#include <linux/mutex.h>
2 9
3typedef struct kobject *kobj_probe_t(dev_t, int *, void *); 10typedef struct kobject *kobj_probe_t(dev_t, int *, void *);
@@ -8,3 +15,5 @@ int kobj_map(struct kobj_map *, dev_t, unsigned long, struct module *,
8void kobj_unmap(struct kobj_map *, dev_t, unsigned long); 15void kobj_unmap(struct kobj_map *, dev_t, unsigned long);
9struct kobject *kobj_lookup(struct kobj_map *, dev_t, int *); 16struct kobject *kobj_lookup(struct kobj_map *, dev_t, int *);
10struct kobj_map *kobj_map_init(kobj_probe_t *, struct mutex *); 17struct kobj_map *kobj_map_init(kobj_probe_t *, struct mutex *);
18
19#endif /* _KOBJ_MAP_H_ */
diff --git a/include/linux/kobject.h b/include/linux/kobject.h
index 3950d3c2850d..cf343a852534 100644
--- a/include/linux/kobject.h
+++ b/include/linux/kobject.h
@@ -108,6 +108,8 @@ struct kobj_type {
108 void (*release)(struct kobject *kobj); 108 void (*release)(struct kobject *kobj);
109 const struct sysfs_ops *sysfs_ops; 109 const struct sysfs_ops *sysfs_ops;
110 struct attribute **default_attrs; 110 struct attribute **default_attrs;
111 const struct kobj_ns_type_operations *(*child_ns_type)(struct kobject *kobj);
112 const void *(*namespace)(struct kobject *kobj);
111}; 113};
112 114
113struct kobj_uevent_env { 115struct kobj_uevent_env {
@@ -134,6 +136,42 @@ struct kobj_attribute {
134 136
135extern const struct sysfs_ops kobj_sysfs_ops; 137extern const struct sysfs_ops kobj_sysfs_ops;
136 138
139/*
140 * Namespace types which are used to tag kobjects and sysfs entries.
141 * Network namespace will likely be the first.
142 */
143enum kobj_ns_type {
144 KOBJ_NS_TYPE_NONE = 0,
145 KOBJ_NS_TYPE_NET,
146 KOBJ_NS_TYPES
147};
148
149struct sock;
150
151/*
152 * Callbacks so sysfs can determine namespaces
153 * @current_ns: return calling task's namespace
154 * @netlink_ns: return namespace to which a sock belongs (right?)
155 * @initial_ns: return the initial namespace (i.e. init_net_ns)
156 */
157struct kobj_ns_type_operations {
158 enum kobj_ns_type type;
159 const void *(*current_ns)(void);
160 const void *(*netlink_ns)(struct sock *sk);
161 const void *(*initial_ns)(void);
162};
163
164int kobj_ns_type_register(const struct kobj_ns_type_operations *ops);
165int kobj_ns_type_registered(enum kobj_ns_type type);
166const struct kobj_ns_type_operations *kobj_child_ns_ops(struct kobject *parent);
167const struct kobj_ns_type_operations *kobj_ns_ops(struct kobject *kobj);
168
169const void *kobj_ns_current(enum kobj_ns_type type);
170const void *kobj_ns_netlink(enum kobj_ns_type type, struct sock *sk);
171const void *kobj_ns_initial(enum kobj_ns_type type);
172void kobj_ns_exit(enum kobj_ns_type type, const void *ns);
173
174
137/** 175/**
138 * struct kset - a set of kobjects of a specific type, belonging to a specific subsystem. 176 * struct kset - a set of kobjects of a specific type, belonging to a specific subsystem.
139 * 177 *
diff --git a/include/linux/kref.h b/include/linux/kref.h
index b0cb0ebad9e6..6cc38fc07ab7 100644
--- a/include/linux/kref.h
+++ b/include/linux/kref.h
@@ -1,5 +1,5 @@
1/* 1/*
2 * kref.c - library routines for handling generic reference counted objects 2 * kref.h - library routines for handling generic reference counted objects
3 * 3 *
4 * Copyright (C) 2004 Greg Kroah-Hartman <greg@kroah.com> 4 * Copyright (C) 2004 Greg Kroah-Hartman <greg@kroah.com>
5 * Copyright (C) 2004 IBM Corp. 5 * Copyright (C) 2004 IBM Corp.
@@ -21,7 +21,6 @@ struct kref {
21 atomic_t refcount; 21 atomic_t refcount;
22}; 22};
23 23
24void kref_set(struct kref *kref, int num);
25void kref_init(struct kref *kref); 24void kref_init(struct kref *kref);
26void kref_get(struct kref *kref); 25void kref_get(struct kref *kref);
27int kref_put(struct kref *kref, void (*release) (struct kref *kref)); 26int kref_put(struct kref *kref, void (*release) (struct kref *kref));
diff --git a/include/linux/ktime.h b/include/linux/ktime.h
index ce5983225be4..e1ceaa9b36bb 100644
--- a/include/linux/ktime.h
+++ b/include/linux/ktime.h
@@ -130,7 +130,7 @@ static inline ktime_t timeval_to_ktime(struct timeval tv)
130/* Convert ktime_t to nanoseconds - NOP in the scalar storage format: */ 130/* Convert ktime_t to nanoseconds - NOP in the scalar storage format: */
131#define ktime_to_ns(kt) ((kt).tv64) 131#define ktime_to_ns(kt) ((kt).tv64)
132 132
133#else 133#else /* !((BITS_PER_LONG == 64) || defined(CONFIG_KTIME_SCALAR)) */
134 134
135/* 135/*
136 * Helper macros/inlines to get the ktime_t math right in the timespec 136 * Helper macros/inlines to get the ktime_t math right in the timespec
@@ -275,7 +275,7 @@ static inline s64 ktime_to_ns(const ktime_t kt)
275 return (s64) kt.tv.sec * NSEC_PER_SEC + kt.tv.nsec; 275 return (s64) kt.tv.sec * NSEC_PER_SEC + kt.tv.nsec;
276} 276}
277 277
278#endif 278#endif /* !((BITS_PER_LONG == 64) || defined(CONFIG_KTIME_SCALAR)) */
279 279
280/** 280/**
281 * ktime_equal - Compares two ktime_t variables to see if they are equal 281 * ktime_equal - Compares two ktime_t variables to see if they are equal
@@ -295,6 +295,12 @@ static inline s64 ktime_to_us(const ktime_t kt)
295 return (s64) tv.tv_sec * USEC_PER_SEC + tv.tv_usec; 295 return (s64) tv.tv_sec * USEC_PER_SEC + tv.tv_usec;
296} 296}
297 297
298static inline s64 ktime_to_ms(const ktime_t kt)
299{
300 struct timeval tv = ktime_to_timeval(kt);
301 return (s64) tv.tv_sec * MSEC_PER_SEC + tv.tv_usec / USEC_PER_MSEC;
302}
303
298static inline s64 ktime_us_delta(const ktime_t later, const ktime_t earlier) 304static inline s64 ktime_us_delta(const ktime_t later, const ktime_t earlier)
299{ 305{
300 return ktime_to_us(ktime_sub(later, earlier)); 306 return ktime_to_us(ktime_sub(later, earlier));
diff --git a/include/linux/kvm.h b/include/linux/kvm.h
index 60df9c84ecae..23ea02253900 100644
--- a/include/linux/kvm.h
+++ b/include/linux/kvm.h
@@ -160,6 +160,7 @@ struct kvm_pit_config {
160#define KVM_EXIT_DCR 15 160#define KVM_EXIT_DCR 15
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 164
164/* For KVM_EXIT_INTERNAL_ERROR */ 165/* For KVM_EXIT_INTERNAL_ERROR */
165#define KVM_INTERNAL_ERROR_EMULATION 1 166#define KVM_INTERNAL_ERROR_EMULATION 1
@@ -259,6 +260,10 @@ struct kvm_run {
259 __u32 ndata; 260 __u32 ndata;
260 __u64 data[16]; 261 __u64 data[16];
261 } internal; 262 } internal;
263 /* KVM_EXIT_OSI */
264 struct {
265 __u64 gprs[32];
266 } osi;
262 /* Fix the size of the union. */ 267 /* Fix the size of the union. */
263 char padding[256]; 268 char padding[256];
264 }; 269 };
@@ -400,6 +405,15 @@ struct kvm_ioeventfd {
400 __u8 pad[36]; 405 __u8 pad[36];
401}; 406};
402 407
408/* for KVM_ENABLE_CAP */
409struct kvm_enable_cap {
410 /* in */
411 __u32 cap;
412 __u32 flags;
413 __u64 args[4];
414 __u8 pad[64];
415};
416
403#define KVMIO 0xAE 417#define KVMIO 0xAE
404 418
405/* 419/*
@@ -501,7 +515,15 @@ struct kvm_ioeventfd {
501#define KVM_CAP_HYPERV_VAPIC 45 515#define KVM_CAP_HYPERV_VAPIC 45
502#define KVM_CAP_HYPERV_SPIN 46 516#define KVM_CAP_HYPERV_SPIN 46
503#define KVM_CAP_PCI_SEGMENT 47 517#define KVM_CAP_PCI_SEGMENT 47
518#define KVM_CAP_PPC_PAIRED_SINGLES 48
519#define KVM_CAP_INTR_SHADOW 49
520#ifdef __KVM_HAVE_DEBUGREGS
521#define KVM_CAP_DEBUGREGS 50
522#endif
504#define KVM_CAP_X86_ROBUST_SINGLESTEP 51 523#define KVM_CAP_X86_ROBUST_SINGLESTEP 51
524#define KVM_CAP_PPC_OSI 52
525#define KVM_CAP_PPC_UNSET_IRQ 53
526#define KVM_CAP_ENABLE_CAP 54
505 527
506#ifdef KVM_CAP_IRQ_ROUTING 528#ifdef KVM_CAP_IRQ_ROUTING
507 529
@@ -688,6 +710,10 @@ struct kvm_clock_data {
688/* Available with KVM_CAP_VCPU_EVENTS */ 710/* Available with KVM_CAP_VCPU_EVENTS */
689#define KVM_GET_VCPU_EVENTS _IOR(KVMIO, 0x9f, struct kvm_vcpu_events) 711#define KVM_GET_VCPU_EVENTS _IOR(KVMIO, 0x9f, struct kvm_vcpu_events)
690#define KVM_SET_VCPU_EVENTS _IOW(KVMIO, 0xa0, struct kvm_vcpu_events) 712#define KVM_SET_VCPU_EVENTS _IOW(KVMIO, 0xa0, struct kvm_vcpu_events)
713/* Available with KVM_CAP_DEBUGREGS */
714#define KVM_GET_DEBUGREGS _IOR(KVMIO, 0xa1, struct kvm_debugregs)
715#define KVM_SET_DEBUGREGS _IOW(KVMIO, 0xa2, struct kvm_debugregs)
716#define KVM_ENABLE_CAP _IOW(KVMIO, 0xa3, struct kvm_enable_cap)
691 717
692#define KVM_DEV_ASSIGN_ENABLE_IOMMU (1 << 0) 718#define KVM_DEV_ASSIGN_ENABLE_IOMMU (1 << 0)
693 719
diff --git a/include/linux/kvm_host.h b/include/linux/kvm_host.h
index a3fd0f91d943..7cb116afa1cd 100644
--- a/include/linux/kvm_host.h
+++ b/include/linux/kvm_host.h
@@ -54,7 +54,7 @@ extern struct kmem_cache *kvm_vcpu_cache;
54 */ 54 */
55struct kvm_io_bus { 55struct kvm_io_bus {
56 int dev_count; 56 int dev_count;
57#define NR_IOBUS_DEVS 6 57#define NR_IOBUS_DEVS 200
58 struct kvm_io_device *devs[NR_IOBUS_DEVS]; 58 struct kvm_io_device *devs[NR_IOBUS_DEVS];
59}; 59};
60 60
@@ -105,6 +105,12 @@ struct kvm_vcpu {
105 struct kvm_vcpu_arch arch; 105 struct kvm_vcpu_arch arch;
106}; 106};
107 107
108/*
109 * Some of the bitops functions do not support too long bitmaps.
110 * This number must be determined not to exceed such limits.
111 */
112#define KVM_MEM_MAX_NR_PAGES ((1UL << 31) - 1)
113
108struct kvm_memory_slot { 114struct kvm_memory_slot {
109 gfn_t base_gfn; 115 gfn_t base_gfn;
110 unsigned long npages; 116 unsigned long npages;
@@ -119,6 +125,11 @@ struct kvm_memory_slot {
119 int user_alloc; 125 int user_alloc;
120}; 126};
121 127
128static inline unsigned long kvm_dirty_bitmap_bytes(struct kvm_memory_slot *memslot)
129{
130 return ALIGN(memslot->npages, BITS_PER_LONG) / 8;
131}
132
122struct kvm_kernel_irq_routing_entry { 133struct kvm_kernel_irq_routing_entry {
123 u32 gsi; 134 u32 gsi;
124 u32 type; 135 u32 type;
@@ -232,17 +243,23 @@ void kvm_vcpu_uninit(struct kvm_vcpu *vcpu);
232void vcpu_load(struct kvm_vcpu *vcpu); 243void vcpu_load(struct kvm_vcpu *vcpu);
233void vcpu_put(struct kvm_vcpu *vcpu); 244void vcpu_put(struct kvm_vcpu *vcpu);
234 245
235int kvm_init(void *opaque, unsigned int vcpu_size, 246int kvm_init(void *opaque, unsigned vcpu_size, unsigned vcpu_align,
236 struct module *module); 247 struct module *module);
237void kvm_exit(void); 248void kvm_exit(void);
238 249
239void kvm_get_kvm(struct kvm *kvm); 250void kvm_get_kvm(struct kvm *kvm);
240void kvm_put_kvm(struct kvm *kvm); 251void kvm_put_kvm(struct kvm *kvm);
241 252
253static inline struct kvm_memslots *kvm_memslots(struct kvm *kvm)
254{
255 return rcu_dereference_check(kvm->memslots,
256 srcu_read_lock_held(&kvm->srcu)
257 || lockdep_is_held(&kvm->slots_lock));
258}
259
242#define HPA_MSB ((sizeof(hpa_t) * 8) - 1) 260#define HPA_MSB ((sizeof(hpa_t) * 8) - 1)
243#define HPA_ERR_MASK ((hpa_t)1 << HPA_MSB) 261#define HPA_ERR_MASK ((hpa_t)1 << HPA_MSB)
244static inline int is_error_hpa(hpa_t hpa) { return hpa >> HPA_MSB; } 262static inline int is_error_hpa(hpa_t hpa) { return hpa >> HPA_MSB; }
245struct page *gva_to_page(struct kvm_vcpu *vcpu, gva_t gva);
246 263
247extern struct page *bad_page; 264extern struct page *bad_page;
248extern pfn_t bad_pfn; 265extern pfn_t bad_pfn;
diff --git a/include/linux/lcd.h b/include/linux/lcd.h
index c67fecafff90..8877123f2d6e 100644
--- a/include/linux/lcd.h
+++ b/include/linux/lcd.h
@@ -69,6 +69,29 @@ struct lcd_device {
69 struct device dev; 69 struct device dev;
70}; 70};
71 71
72struct lcd_platform_data {
73 /* reset lcd panel device. */
74 int (*reset)(struct lcd_device *ld);
75 /* on or off to lcd panel. if 'enable' is 0 then
76 lcd power off and 1, lcd power on. */
77 int (*power_on)(struct lcd_device *ld, int enable);
78
79 /* it indicates whether lcd panel was enabled
80 from bootloader or not. */
81 int lcd_enabled;
82 /* it means delay for stable time when it becomes low to high
83 or high to low that is dependent on whether reset gpio is
84 low active or high active. */
85 unsigned int reset_delay;
86 /* stable time needing to become lcd power on. */
87 unsigned int power_on_delay;
88 /* stable time needing to become lcd power off. */
89 unsigned int power_off_delay;
90
91 /* it could be used for any purpose. */
92 void *pdata;
93};
94
72static inline void lcd_set_power(struct lcd_device *ld, int power) 95static inline void lcd_set_power(struct lcd_device *ld, int power)
73{ 96{
74 mutex_lock(&ld->update_lock); 97 mutex_lock(&ld->update_lock);
diff --git a/include/linux/leds.h b/include/linux/leds.h
index d8bf9665e70c..ba6986a11663 100644
--- a/include/linux/leds.h
+++ b/include/linux/leds.h
@@ -149,14 +149,18 @@ struct gpio_led {
149 unsigned default_state : 2; 149 unsigned default_state : 2;
150 /* default_state should be one of LEDS_GPIO_DEFSTATE_(ON|OFF|KEEP) */ 150 /* default_state should be one of LEDS_GPIO_DEFSTATE_(ON|OFF|KEEP) */
151}; 151};
152#define LEDS_GPIO_DEFSTATE_OFF 0 152#define LEDS_GPIO_DEFSTATE_OFF 0
153#define LEDS_GPIO_DEFSTATE_ON 1 153#define LEDS_GPIO_DEFSTATE_ON 1
154#define LEDS_GPIO_DEFSTATE_KEEP 2 154#define LEDS_GPIO_DEFSTATE_KEEP 2
155 155
156struct gpio_led_platform_data { 156struct gpio_led_platform_data {
157 int num_leds; 157 int num_leds;
158 struct gpio_led *leds; 158 struct gpio_led *leds;
159 int (*gpio_blink_set)(unsigned gpio, 159
160#define GPIO_LED_NO_BLINK_LOW 0 /* No blink GPIO state low */
161#define GPIO_LED_NO_BLINK_HIGH 1 /* No blink GPIO state high */
162#define GPIO_LED_BLINK 2 /* Plase, blink */
163 int (*gpio_blink_set)(unsigned gpio, int state,
160 unsigned long *delay_on, 164 unsigned long *delay_on,
161 unsigned long *delay_off); 165 unsigned long *delay_off);
162}; 166};
diff --git a/include/linux/libata.h b/include/linux/libata.h
index b2f2003b92e5..3bad2701bfa6 100644
--- a/include/linux/libata.h
+++ b/include/linux/libata.h
@@ -202,12 +202,6 @@ enum {
202 ATA_FLAG_SW_ACTIVITY = (1 << 22), /* driver supports sw activity 202 ATA_FLAG_SW_ACTIVITY = (1 << 22), /* driver supports sw activity
203 * led */ 203 * led */
204 204
205 /* The following flag belongs to ap->pflags but is kept in
206 * ap->flags because it's referenced in many LLDs and will be
207 * removed in not-too-distant future.
208 */
209 ATA_FLAG_DISABLED = (1 << 23), /* port is disabled, ignore it */
210
211 /* bits 24:31 of ap->flags are reserved for LLD specific flags */ 205 /* bits 24:31 of ap->flags are reserved for LLD specific flags */
212 206
213 207
@@ -256,12 +250,13 @@ enum {
256 ATA_TMOUT_INTERNAL_QUICK = 5000, 250 ATA_TMOUT_INTERNAL_QUICK = 5000,
257 ATA_TMOUT_MAX_PARK = 30000, 251 ATA_TMOUT_MAX_PARK = 30000,
258 252
259 /* FIXME: GoVault needs 2s but we can't afford that without 253 /*
260 * parallel probing. 800ms is enough for iVDR disk 254 * GoVault needs 2s and iVDR disk HHD424020F7SV00 800ms. 2s
261 * HHD424020F7SV00. Increase to 2secs when parallel probing 255 * is too much without parallel probing. Use 2s if parallel
262 * is in place. 256 * probing is available, 800ms otherwise.
263 */ 257 */
264 ATA_TMOUT_FF_WAIT = 800, 258 ATA_TMOUT_FF_WAIT_LONG = 2000,
259 ATA_TMOUT_FF_WAIT = 800,
265 260
266 /* Spec mandates to wait for ">= 2ms" before checking status 261 /* Spec mandates to wait for ">= 2ms" before checking status
267 * after reset. We wait 150ms, because that was the magic 262 * after reset. We wait 150ms, because that was the magic
@@ -391,6 +386,7 @@ enum {
391 ATA_HORKAGE_1_5_GBPS = (1 << 13), /* force 1.5 Gbps */ 386 ATA_HORKAGE_1_5_GBPS = (1 << 13), /* force 1.5 Gbps */
392 ATA_HORKAGE_NOSETXFER = (1 << 14), /* skip SETXFER, SATA only */ 387 ATA_HORKAGE_NOSETXFER = (1 << 14), /* skip SETXFER, SATA only */
393 ATA_HORKAGE_BROKEN_FPDMA_AA = (1 << 15), /* skip AA */ 388 ATA_HORKAGE_BROKEN_FPDMA_AA = (1 << 15), /* skip AA */
389 ATA_HORKAGE_DUMP_ID = (1 << 16), /* dump IDENTIFY data */
394 390
395 /* DMA mask for user DMA control: User visible values; DO NOT 391 /* DMA mask for user DMA control: User visible values; DO NOT
396 renumber */ 392 renumber */
@@ -518,7 +514,9 @@ struct ata_ioports {
518 void __iomem *command_addr; 514 void __iomem *command_addr;
519 void __iomem *altstatus_addr; 515 void __iomem *altstatus_addr;
520 void __iomem *ctl_addr; 516 void __iomem *ctl_addr;
517#ifdef CONFIG_ATA_BMDMA
521 void __iomem *bmdma_addr; 518 void __iomem *bmdma_addr;
519#endif /* CONFIG_ATA_BMDMA */
522 void __iomem *scr_addr; 520 void __iomem *scr_addr;
523}; 521};
524#endif /* CONFIG_ATA_SFF */ 522#endif /* CONFIG_ATA_SFF */
@@ -721,15 +719,17 @@ struct ata_port {
721 unsigned int print_id; /* user visible unique port ID */ 719 unsigned int print_id; /* user visible unique port ID */
722 unsigned int port_no; /* 0 based port no. inside the host */ 720 unsigned int port_no; /* 0 based port no. inside the host */
723 721
724 struct ata_prd *prd; /* our SG list */
725 dma_addr_t prd_dma; /* and its DMA mapping */
726
727#ifdef CONFIG_ATA_SFF 722#ifdef CONFIG_ATA_SFF
728 struct ata_ioports ioaddr; /* ATA cmd/ctl/dma register blocks */ 723 struct ata_ioports ioaddr; /* ATA cmd/ctl/dma register blocks */
729#endif /* CONFIG_ATA_SFF */
730
731 u8 ctl; /* cache of ATA control register */ 724 u8 ctl; /* cache of ATA control register */
732 u8 last_ctl; /* Cache last written value */ 725 u8 last_ctl; /* Cache last written value */
726 struct delayed_work sff_pio_task;
727#ifdef CONFIG_ATA_BMDMA
728 struct ata_bmdma_prd *bmdma_prd; /* BMDMA SG list */
729 dma_addr_t bmdma_prd_dma; /* and its DMA mapping */
730#endif /* CONFIG_ATA_BMDMA */
731#endif /* CONFIG_ATA_SFF */
732
733 unsigned int pio_mask; 733 unsigned int pio_mask;
734 unsigned int mwdma_mask; 734 unsigned int mwdma_mask;
735 unsigned int udma_mask; 735 unsigned int udma_mask;
@@ -751,8 +751,6 @@ struct ata_port {
751 struct ata_host *host; 751 struct ata_host *host;
752 struct device *dev; 752 struct device *dev;
753 753
754 void *port_task_data;
755 struct delayed_work port_task;
756 struct delayed_work hotplug_task; 754 struct delayed_work hotplug_task;
757 struct work_struct scsi_rescan_task; 755 struct work_struct scsi_rescan_task;
758 756
@@ -849,6 +847,7 @@ struct ata_port_operations {
849 * SFF / taskfile oriented ops 847 * SFF / taskfile oriented ops
850 */ 848 */
851 void (*sff_dev_select)(struct ata_port *ap, unsigned int device); 849 void (*sff_dev_select)(struct ata_port *ap, unsigned int device);
850 void (*sff_set_devctl)(struct ata_port *ap, u8 ctl);
852 u8 (*sff_check_status)(struct ata_port *ap); 851 u8 (*sff_check_status)(struct ata_port *ap);
853 u8 (*sff_check_altstatus)(struct ata_port *ap); 852 u8 (*sff_check_altstatus)(struct ata_port *ap);
854 void (*sff_tf_load)(struct ata_port *ap, const struct ata_taskfile *tf); 853 void (*sff_tf_load)(struct ata_port *ap, const struct ata_taskfile *tf);
@@ -857,16 +856,17 @@ struct ata_port_operations {
857 const struct ata_taskfile *tf); 856 const struct ata_taskfile *tf);
858 unsigned int (*sff_data_xfer)(struct ata_device *dev, 857 unsigned int (*sff_data_xfer)(struct ata_device *dev,
859 unsigned char *buf, unsigned int buflen, int rw); 858 unsigned char *buf, unsigned int buflen, int rw);
860 u8 (*sff_irq_on)(struct ata_port *); 859 void (*sff_irq_on)(struct ata_port *);
861 bool (*sff_irq_check)(struct ata_port *); 860 bool (*sff_irq_check)(struct ata_port *);
862 void (*sff_irq_clear)(struct ata_port *); 861 void (*sff_irq_clear)(struct ata_port *);
862 void (*sff_drain_fifo)(struct ata_queued_cmd *qc);
863 863
864#ifdef CONFIG_ATA_BMDMA
864 void (*bmdma_setup)(struct ata_queued_cmd *qc); 865 void (*bmdma_setup)(struct ata_queued_cmd *qc);
865 void (*bmdma_start)(struct ata_queued_cmd *qc); 866 void (*bmdma_start)(struct ata_queued_cmd *qc);
866 void (*bmdma_stop)(struct ata_queued_cmd *qc); 867 void (*bmdma_stop)(struct ata_queued_cmd *qc);
867 u8 (*bmdma_status)(struct ata_port *ap); 868 u8 (*bmdma_status)(struct ata_port *ap);
868 869#endif /* CONFIG_ATA_BMDMA */
869 void (*drain_fifo)(struct ata_queued_cmd *qc);
870#endif /* CONFIG_ATA_SFF */ 870#endif /* CONFIG_ATA_SFF */
871 871
872 ssize_t (*em_show)(struct ata_port *ap, char *buf); 872 ssize_t (*em_show)(struct ata_port *ap, char *buf);
@@ -935,7 +935,6 @@ static inline int ata_port_is_dummy(struct ata_port *ap)
935 return ap->ops == &ata_dummy_port_ops; 935 return ap->ops == &ata_dummy_port_ops;
936} 936}
937 937
938extern void ata_port_probe(struct ata_port *);
939extern int sata_set_spd(struct ata_link *link); 938extern int sata_set_spd(struct ata_link *link);
940extern int ata_std_prereset(struct ata_link *link, unsigned long deadline); 939extern int ata_std_prereset(struct ata_link *link, unsigned long deadline);
941extern int ata_wait_after_reset(struct ata_link *link, unsigned long deadline, 940extern int ata_wait_after_reset(struct ata_link *link, unsigned long deadline,
@@ -950,7 +949,6 @@ extern int sata_link_hardreset(struct ata_link *link,
950extern int sata_std_hardreset(struct ata_link *link, unsigned int *class, 949extern int sata_std_hardreset(struct ata_link *link, unsigned int *class,
951 unsigned long deadline); 950 unsigned long deadline);
952extern void ata_std_postreset(struct ata_link *link, unsigned int *classes); 951extern void ata_std_postreset(struct ata_link *link, unsigned int *classes);
953extern void ata_port_disable(struct ata_port *);
954 952
955extern struct ata_host *ata_host_alloc(struct device *dev, int max_ports); 953extern struct ata_host *ata_host_alloc(struct device *dev, int max_ports);
956extern struct ata_host *ata_host_alloc_pinfo(struct device *dev, 954extern struct ata_host *ata_host_alloc_pinfo(struct device *dev,
@@ -1006,7 +1004,6 @@ extern unsigned long ata_xfer_mode2mask(u8 xfer_mode);
1006extern int ata_xfer_mode2shift(unsigned long xfer_mode); 1004extern int ata_xfer_mode2shift(unsigned long xfer_mode);
1007extern const char *ata_mode_string(unsigned long xfer_mask); 1005extern const char *ata_mode_string(unsigned long xfer_mask);
1008extern unsigned long ata_id_xfermask(const u16 *id); 1006extern unsigned long ata_id_xfermask(const u16 *id);
1009extern int ata_port_start(struct ata_port *ap);
1010extern int ata_std_qc_defer(struct ata_queued_cmd *qc); 1007extern int ata_std_qc_defer(struct ata_queued_cmd *qc);
1011extern void ata_noop_qc_prep(struct ata_queued_cmd *qc); 1008extern void ata_noop_qc_prep(struct ata_queued_cmd *qc);
1012extern void ata_sg_init(struct ata_queued_cmd *qc, struct scatterlist *sg, 1009extern void ata_sg_init(struct ata_queued_cmd *qc, struct scatterlist *sg,
@@ -1039,9 +1036,6 @@ extern int ata_cable_sata(struct ata_port *ap);
1039extern int ata_cable_ignore(struct ata_port *ap); 1036extern int ata_cable_ignore(struct ata_port *ap);
1040extern int ata_cable_unknown(struct ata_port *ap); 1037extern int ata_cable_unknown(struct ata_port *ap);
1041 1038
1042extern void ata_pio_queue_task(struct ata_port *ap, void *data,
1043 unsigned long delay);
1044
1045/* Timing helpers */ 1039/* Timing helpers */
1046extern unsigned int ata_pio_need_iordy(const struct ata_device *); 1040extern unsigned int ata_pio_need_iordy(const struct ata_device *);
1047extern const struct ata_timing *ata_timing_find_mode(u8 xfer_mode); 1041extern const struct ata_timing *ata_timing_find_mode(u8 xfer_mode);
@@ -1443,7 +1437,11 @@ static inline void ata_tf_init(struct ata_device *dev, struct ata_taskfile *tf)
1443{ 1437{
1444 memset(tf, 0, sizeof(*tf)); 1438 memset(tf, 0, sizeof(*tf));
1445 1439
1440#ifdef CONFIG_ATA_SFF
1446 tf->ctl = dev->link->ap->ctl; 1441 tf->ctl = dev->link->ap->ctl;
1442#else
1443 tf->ctl = ATA_DEVCTL_OBS;
1444#endif
1447 if (dev->devno == 0) 1445 if (dev->devno == 0)
1448 tf->device = ATA_DEVICE_OBS; 1446 tf->device = ATA_DEVICE_OBS;
1449 else 1447 else
@@ -1564,7 +1562,6 @@ extern void sata_pmp_error_handler(struct ata_port *ap);
1564#ifdef CONFIG_ATA_SFF 1562#ifdef CONFIG_ATA_SFF
1565 1563
1566extern const struct ata_port_operations ata_sff_port_ops; 1564extern const struct ata_port_operations ata_sff_port_ops;
1567extern const struct ata_port_operations ata_bmdma_port_ops;
1568extern const struct ata_port_operations ata_bmdma32_port_ops; 1565extern const struct ata_port_operations ata_bmdma32_port_ops;
1569 1566
1570/* PIO only, sg_tablesize and dma_boundary limits can be removed */ 1567/* PIO only, sg_tablesize and dma_boundary limits can be removed */
@@ -1573,13 +1570,6 @@ extern const struct ata_port_operations ata_bmdma32_port_ops;
1573 .sg_tablesize = LIBATA_MAX_PRD, \ 1570 .sg_tablesize = LIBATA_MAX_PRD, \
1574 .dma_boundary = ATA_DMA_BOUNDARY 1571 .dma_boundary = ATA_DMA_BOUNDARY
1575 1572
1576#define ATA_BMDMA_SHT(drv_name) \
1577 ATA_BASE_SHT(drv_name), \
1578 .sg_tablesize = LIBATA_MAX_PRD, \
1579 .dma_boundary = ATA_DMA_BOUNDARY
1580
1581extern void ata_sff_qc_prep(struct ata_queued_cmd *qc);
1582extern void ata_sff_dumb_qc_prep(struct ata_queued_cmd *qc);
1583extern void ata_sff_dev_select(struct ata_port *ap, unsigned int device); 1573extern void ata_sff_dev_select(struct ata_port *ap, unsigned int device);
1584extern u8 ata_sff_check_status(struct ata_port *ap); 1574extern u8 ata_sff_check_status(struct ata_port *ap);
1585extern void ata_sff_pause(struct ata_port *ap); 1575extern void ata_sff_pause(struct ata_port *ap);
@@ -1597,13 +1587,14 @@ extern unsigned int ata_sff_data_xfer32(struct ata_device *dev,
1597 unsigned char *buf, unsigned int buflen, int rw); 1587 unsigned char *buf, unsigned int buflen, int rw);
1598extern unsigned int ata_sff_data_xfer_noirq(struct ata_device *dev, 1588extern unsigned int ata_sff_data_xfer_noirq(struct ata_device *dev,
1599 unsigned char *buf, unsigned int buflen, int rw); 1589 unsigned char *buf, unsigned int buflen, int rw);
1600extern u8 ata_sff_irq_on(struct ata_port *ap); 1590extern void ata_sff_irq_on(struct ata_port *ap);
1601extern void ata_sff_irq_clear(struct ata_port *ap); 1591extern void ata_sff_irq_clear(struct ata_port *ap);
1602extern int ata_sff_hsm_move(struct ata_port *ap, struct ata_queued_cmd *qc, 1592extern int ata_sff_hsm_move(struct ata_port *ap, struct ata_queued_cmd *qc,
1603 u8 status, int in_wq); 1593 u8 status, int in_wq);
1594extern void ata_sff_queue_pio_task(struct ata_port *ap, unsigned long delay);
1604extern unsigned int ata_sff_qc_issue(struct ata_queued_cmd *qc); 1595extern unsigned int ata_sff_qc_issue(struct ata_queued_cmd *qc);
1605extern bool ata_sff_qc_fill_rtf(struct ata_queued_cmd *qc); 1596extern bool ata_sff_qc_fill_rtf(struct ata_queued_cmd *qc);
1606extern unsigned int ata_sff_host_intr(struct ata_port *ap, 1597extern unsigned int ata_sff_port_intr(struct ata_port *ap,
1607 struct ata_queued_cmd *qc); 1598 struct ata_queued_cmd *qc);
1608extern irqreturn_t ata_sff_interrupt(int irq, void *dev_instance); 1599extern irqreturn_t ata_sff_interrupt(int irq, void *dev_instance);
1609extern void ata_sff_lost_interrupt(struct ata_port *ap); 1600extern void ata_sff_lost_interrupt(struct ata_port *ap);
@@ -1621,21 +1612,8 @@ extern int sata_sff_hardreset(struct ata_link *link, unsigned int *class,
1621extern void ata_sff_postreset(struct ata_link *link, unsigned int *classes); 1612extern void ata_sff_postreset(struct ata_link *link, unsigned int *classes);
1622extern void ata_sff_drain_fifo(struct ata_queued_cmd *qc); 1613extern void ata_sff_drain_fifo(struct ata_queued_cmd *qc);
1623extern void ata_sff_error_handler(struct ata_port *ap); 1614extern void ata_sff_error_handler(struct ata_port *ap);
1624extern void ata_sff_post_internal_cmd(struct ata_queued_cmd *qc);
1625extern int ata_sff_port_start(struct ata_port *ap);
1626extern int ata_sff_port_start32(struct ata_port *ap);
1627extern void ata_sff_std_ports(struct ata_ioports *ioaddr); 1615extern void ata_sff_std_ports(struct ata_ioports *ioaddr);
1628extern unsigned long ata_bmdma_mode_filter(struct ata_device *dev,
1629 unsigned long xfer_mask);
1630extern void ata_bmdma_setup(struct ata_queued_cmd *qc);
1631extern void ata_bmdma_start(struct ata_queued_cmd *qc);
1632extern void ata_bmdma_stop(struct ata_queued_cmd *qc);
1633extern u8 ata_bmdma_status(struct ata_port *ap);
1634extern void ata_bus_reset(struct ata_port *ap);
1635
1636#ifdef CONFIG_PCI 1616#ifdef CONFIG_PCI
1637extern int ata_pci_bmdma_clear_simplex(struct pci_dev *pdev);
1638extern int ata_pci_bmdma_init(struct ata_host *host);
1639extern int ata_pci_sff_init_host(struct ata_host *host); 1617extern int ata_pci_sff_init_host(struct ata_host *host);
1640extern int ata_pci_sff_prepare_host(struct pci_dev *pdev, 1618extern int ata_pci_sff_prepare_host(struct pci_dev *pdev,
1641 const struct ata_port_info * const * ppi, 1619 const struct ata_port_info * const * ppi,
@@ -1648,6 +1626,44 @@ extern int ata_pci_sff_init_one(struct pci_dev *pdev,
1648 struct scsi_host_template *sht, void *host_priv, int hflags); 1626 struct scsi_host_template *sht, void *host_priv, int hflags);
1649#endif /* CONFIG_PCI */ 1627#endif /* CONFIG_PCI */
1650 1628
1629#ifdef CONFIG_ATA_BMDMA
1630
1631extern const struct ata_port_operations ata_bmdma_port_ops;
1632
1633#define ATA_BMDMA_SHT(drv_name) \
1634 ATA_BASE_SHT(drv_name), \
1635 .sg_tablesize = LIBATA_MAX_PRD, \
1636 .dma_boundary = ATA_DMA_BOUNDARY
1637
1638extern void ata_bmdma_qc_prep(struct ata_queued_cmd *qc);
1639extern unsigned int ata_bmdma_qc_issue(struct ata_queued_cmd *qc);
1640extern void ata_bmdma_dumb_qc_prep(struct ata_queued_cmd *qc);
1641extern unsigned int ata_bmdma_port_intr(struct ata_port *ap,
1642 struct ata_queued_cmd *qc);
1643extern irqreturn_t ata_bmdma_interrupt(int irq, void *dev_instance);
1644extern void ata_bmdma_error_handler(struct ata_port *ap);
1645extern void ata_bmdma_post_internal_cmd(struct ata_queued_cmd *qc);
1646extern void ata_bmdma_irq_clear(struct ata_port *ap);
1647extern void ata_bmdma_setup(struct ata_queued_cmd *qc);
1648extern void ata_bmdma_start(struct ata_queued_cmd *qc);
1649extern void ata_bmdma_stop(struct ata_queued_cmd *qc);
1650extern u8 ata_bmdma_status(struct ata_port *ap);
1651extern int ata_bmdma_port_start(struct ata_port *ap);
1652extern int ata_bmdma_port_start32(struct ata_port *ap);
1653
1654#ifdef CONFIG_PCI
1655extern int ata_pci_bmdma_clear_simplex(struct pci_dev *pdev);
1656extern void ata_pci_bmdma_init(struct ata_host *host);
1657extern int ata_pci_bmdma_prepare_host(struct pci_dev *pdev,
1658 const struct ata_port_info * const * ppi,
1659 struct ata_host **r_host);
1660extern int ata_pci_bmdma_init_one(struct pci_dev *pdev,
1661 const struct ata_port_info * const * ppi,
1662 struct scsi_host_template *sht,
1663 void *host_priv, int hflags);
1664#endif /* CONFIG_PCI */
1665#endif /* CONFIG_ATA_BMDMA */
1666
1651/** 1667/**
1652 * ata_sff_busy_wait - Wait for a port status register 1668 * ata_sff_busy_wait - Wait for a port status register
1653 * @ap: Port to wait for. 1669 * @ap: Port to wait for.
diff --git a/include/linux/lis3lv02d.h b/include/linux/lis3lv02d.h
index f1ca0dcc1628..0e8a346424bb 100644
--- a/include/linux/lis3lv02d.h
+++ b/include/linux/lis3lv02d.h
@@ -25,12 +25,14 @@ struct lis3lv02d_platform_data {
25#define LIS3_IRQ1_FF_WU_12 (3 << 0) 25#define LIS3_IRQ1_FF_WU_12 (3 << 0)
26#define LIS3_IRQ1_DATA_READY (4 << 0) 26#define LIS3_IRQ1_DATA_READY (4 << 0)
27#define LIS3_IRQ1_CLICK (7 << 0) 27#define LIS3_IRQ1_CLICK (7 << 0)
28#define LIS3_IRQ1_MASK (7 << 0)
28#define LIS3_IRQ2_DISABLE (0 << 3) 29#define LIS3_IRQ2_DISABLE (0 << 3)
29#define LIS3_IRQ2_FF_WU_1 (1 << 3) 30#define LIS3_IRQ2_FF_WU_1 (1 << 3)
30#define LIS3_IRQ2_FF_WU_2 (2 << 3) 31#define LIS3_IRQ2_FF_WU_2 (2 << 3)
31#define LIS3_IRQ2_FF_WU_12 (3 << 3) 32#define LIS3_IRQ2_FF_WU_12 (3 << 3)
32#define LIS3_IRQ2_DATA_READY (4 << 3) 33#define LIS3_IRQ2_DATA_READY (4 << 3)
33#define LIS3_IRQ2_CLICK (7 << 3) 34#define LIS3_IRQ2_CLICK (7 << 3)
35#define LIS3_IRQ2_MASK (7 << 3)
34#define LIS3_IRQ_OPEN_DRAIN (1 << 6) 36#define LIS3_IRQ_OPEN_DRAIN (1 << 6)
35#define LIS3_IRQ_ACTIVE_LOW (1 << 7) 37#define LIS3_IRQ_ACTIVE_LOW (1 << 7)
36 unsigned char irq_cfg; 38 unsigned char irq_cfg;
@@ -43,6 +45,15 @@ struct lis3lv02d_platform_data {
43#define LIS3_WAKEUP_Z_HI (1 << 5) 45#define LIS3_WAKEUP_Z_HI (1 << 5)
44 unsigned char wakeup_flags; 46 unsigned char wakeup_flags;
45 unsigned char wakeup_thresh; 47 unsigned char wakeup_thresh;
48 unsigned char wakeup_flags2;
49 unsigned char wakeup_thresh2;
50#define LIS3_HIPASS_CUTFF_8HZ 0
51#define LIS3_HIPASS_CUTFF_4HZ 1
52#define LIS3_HIPASS_CUTFF_2HZ 2
53#define LIS3_HIPASS_CUTFF_1HZ 3
54#define LIS3_HIPASS1_DISABLE (1 << 2)
55#define LIS3_HIPASS2_DISABLE (1 << 3)
56 unsigned char hipass_ctrl;
46#define LIS3_NO_MAP 0 57#define LIS3_NO_MAP 0
47#define LIS3_DEV_X 1 58#define LIS3_DEV_X 1
48#define LIS3_DEV_Y 2 59#define LIS3_DEV_Y 2
@@ -58,6 +69,7 @@ struct lis3lv02d_platform_data {
58 /* Limits for selftest are specified in chip data sheet */ 69 /* Limits for selftest are specified in chip data sheet */
59 s16 st_min_limits[3]; /* min pass limit x, y, z */ 70 s16 st_min_limits[3]; /* min pass limit x, y, z */
60 s16 st_max_limits[3]; /* max pass limit x, y, z */ 71 s16 st_max_limits[3]; /* max pass limit x, y, z */
72 int irq2;
61}; 73};
62 74
63#endif /* __LIS3LV02D_H_ */ 75#endif /* __LIS3LV02D_H_ */
diff --git a/include/linux/lockdep.h b/include/linux/lockdep.h
index a03977a96d7e..06aed8305bf3 100644
--- a/include/linux/lockdep.h
+++ b/include/linux/lockdep.h
@@ -44,6 +44,8 @@ struct lock_class_key {
44 struct lockdep_subclass_key subkeys[MAX_LOCKDEP_SUBCLASSES]; 44 struct lockdep_subclass_key subkeys[MAX_LOCKDEP_SUBCLASSES];
45}; 45};
46 46
47extern struct lock_class_key __lockdep_no_validate__;
48
47#define LOCKSTAT_POINTS 4 49#define LOCKSTAT_POINTS 4
48 50
49/* 51/*
@@ -270,6 +272,9 @@ extern void lockdep_init_map(struct lockdep_map *lock, const char *name,
270#define lockdep_set_subclass(lock, sub) \ 272#define lockdep_set_subclass(lock, sub) \
271 lockdep_init_map(&(lock)->dep_map, #lock, \ 273 lockdep_init_map(&(lock)->dep_map, #lock, \
272 (lock)->dep_map.key, sub) 274 (lock)->dep_map.key, sub)
275
276#define lockdep_set_novalidate_class(lock) \
277 lockdep_set_class(lock, &__lockdep_no_validate__)
273/* 278/*
274 * Compare locking classes 279 * Compare locking classes
275 */ 280 */
@@ -354,6 +359,9 @@ static inline void lockdep_on(void)
354#define lockdep_set_class_and_subclass(lock, key, sub) \ 359#define lockdep_set_class_and_subclass(lock, key, sub) \
355 do { (void)(key); } while (0) 360 do { (void)(key); } while (0)
356#define lockdep_set_subclass(lock, sub) do { } while (0) 361#define lockdep_set_subclass(lock, sub) do { } while (0)
362
363#define lockdep_set_novalidate_class(lock) do { } while (0)
364
357/* 365/*
358 * We don't define lockdep_match_class() and lockdep_match_key() for !LOCKDEP 366 * We don't define lockdep_match_class() and lockdep_match_key() for !LOCKDEP
359 * case since the result is not well defined and the caller should rather 367 * case since the result is not well defined and the caller should rather
diff --git a/include/linux/lsm_audit.h b/include/linux/lsm_audit.h
index f78f83d7663f..6907251d5200 100644
--- a/include/linux/lsm_audit.h
+++ b/include/linux/lsm_audit.h
@@ -33,7 +33,7 @@ struct common_audit_data {
33#define LSM_AUDIT_DATA_IPC 4 33#define LSM_AUDIT_DATA_IPC 4
34#define LSM_AUDIT_DATA_TASK 5 34#define LSM_AUDIT_DATA_TASK 5
35#define LSM_AUDIT_DATA_KEY 6 35#define LSM_AUDIT_DATA_KEY 6
36#define LSM_AUDIT_NO_AUDIT 7 36#define LSM_AUDIT_DATA_NONE 7
37#define LSM_AUDIT_DATA_KMOD 8 37#define LSM_AUDIT_DATA_KMOD 8
38 struct task_struct *tsk; 38 struct task_struct *tsk;
39 union { 39 union {
diff --git a/include/linux/matroxfb.h b/include/linux/matroxfb.h
index 2203121a43e9..8c22a8938642 100644
--- a/include/linux/matroxfb.h
+++ b/include/linux/matroxfb.h
@@ -4,6 +4,7 @@
4#include <asm/ioctl.h> 4#include <asm/ioctl.h>
5#include <linux/types.h> 5#include <linux/types.h>
6#include <linux/videodev2.h> 6#include <linux/videodev2.h>
7#include <linux/fb.h>
7 8
8struct matroxioc_output_mode { 9struct matroxioc_output_mode {
9 __u32 output; /* which output */ 10 __u32 output; /* which output */
@@ -37,7 +38,5 @@ enum matroxfb_ctrl_id {
37 MATROXFB_CID_LAST 38 MATROXFB_CID_LAST
38}; 39};
39 40
40#define FBIO_WAITFORVSYNC _IOW('F', 0x20, __u32)
41
42#endif 41#endif
43 42
diff --git a/include/linux/memcontrol.h b/include/linux/memcontrol.h
index 44301c6affa8..9411d32840b0 100644
--- a/include/linux/memcontrol.h
+++ b/include/linux/memcontrol.h
@@ -25,6 +25,13 @@ struct page_cgroup;
25struct page; 25struct page;
26struct mm_struct; 26struct mm_struct;
27 27
28extern unsigned long mem_cgroup_isolate_pages(unsigned long nr_to_scan,
29 struct list_head *dst,
30 unsigned long *scanned, int order,
31 int mode, struct zone *z,
32 struct mem_cgroup *mem_cont,
33 int active, int file);
34
28#ifdef CONFIG_CGROUP_MEM_RES_CTLR 35#ifdef CONFIG_CGROUP_MEM_RES_CTLR
29/* 36/*
30 * All "charge" functions with gfp_mask should use GFP_KERNEL or 37 * All "charge" functions with gfp_mask should use GFP_KERNEL or
@@ -64,12 +71,6 @@ extern void mem_cgroup_uncharge_cache_page(struct page *page);
64extern int mem_cgroup_shmem_charge_fallback(struct page *page, 71extern int mem_cgroup_shmem_charge_fallback(struct page *page,
65 struct mm_struct *mm, gfp_t gfp_mask); 72 struct mm_struct *mm, gfp_t gfp_mask);
66 73
67extern unsigned long mem_cgroup_isolate_pages(unsigned long nr_to_scan,
68 struct list_head *dst,
69 unsigned long *scanned, int order,
70 int mode, struct zone *z,
71 struct mem_cgroup *mem_cont,
72 int active, int file);
73extern void mem_cgroup_out_of_memory(struct mem_cgroup *mem, gfp_t gfp_mask); 74extern void mem_cgroup_out_of_memory(struct mem_cgroup *mem, gfp_t gfp_mask);
74int task_in_mem_cgroup(struct task_struct *task, const struct mem_cgroup *mem); 75int task_in_mem_cgroup(struct task_struct *task, const struct mem_cgroup *mem);
75 76
@@ -89,7 +90,8 @@ int mm_match_cgroup(const struct mm_struct *mm, const struct mem_cgroup *cgroup)
89extern struct cgroup_subsys_state *mem_cgroup_css(struct mem_cgroup *mem); 90extern struct cgroup_subsys_state *mem_cgroup_css(struct mem_cgroup *mem);
90 91
91extern int 92extern int
92mem_cgroup_prepare_migration(struct page *page, struct mem_cgroup **ptr); 93mem_cgroup_prepare_migration(struct page *page,
94 struct page *newpage, struct mem_cgroup **ptr);
93extern void mem_cgroup_end_migration(struct mem_cgroup *mem, 95extern void mem_cgroup_end_migration(struct mem_cgroup *mem,
94 struct page *oldpage, struct page *newpage); 96 struct page *oldpage, struct page *newpage);
95 97
@@ -226,7 +228,8 @@ static inline struct cgroup_subsys_state *mem_cgroup_css(struct mem_cgroup *mem)
226} 228}
227 229
228static inline int 230static inline int
229mem_cgroup_prepare_migration(struct page *page, struct mem_cgroup **ptr) 231mem_cgroup_prepare_migration(struct page *page, struct page *newpage,
232 struct mem_cgroup **ptr)
230{ 233{
231 return 0; 234 return 0;
232} 235}
diff --git a/include/linux/memory_hotplug.h b/include/linux/memory_hotplug.h
index 35b07b773e6c..864035fb8f8a 100644
--- a/include/linux/memory_hotplug.h
+++ b/include/linux/memory_hotplug.h
@@ -202,6 +202,7 @@ static inline int is_mem_section_removable(unsigned long pfn,
202} 202}
203#endif /* CONFIG_MEMORY_HOTREMOVE */ 203#endif /* CONFIG_MEMORY_HOTREMOVE */
204 204
205extern int mem_online_node(int nid);
205extern int add_memory(int nid, u64 start, u64 size); 206extern int add_memory(int nid, u64 start, u64 size);
206extern int arch_add_memory(int nid, u64 start, u64 size); 207extern int arch_add_memory(int nid, u64 start, u64 size);
207extern int remove_memory(u64 start, u64 size); 208extern int remove_memory(u64 start, u64 size);
diff --git a/include/linux/mempolicy.h b/include/linux/mempolicy.h
index 1cc966cd3e5f..7b9ef6bf45aa 100644
--- a/include/linux/mempolicy.h
+++ b/include/linux/mempolicy.h
@@ -23,6 +23,13 @@ enum {
23 MPOL_MAX, /* always last member of enum */ 23 MPOL_MAX, /* always last member of enum */
24}; 24};
25 25
26enum mpol_rebind_step {
27 MPOL_REBIND_ONCE, /* do rebind work at once(not by two step) */
28 MPOL_REBIND_STEP1, /* first step(set all the newly nodes) */
29 MPOL_REBIND_STEP2, /* second step(clean all the disallowed nodes)*/
30 MPOL_REBIND_NSTEP,
31};
32
26/* Flags for set_mempolicy */ 33/* Flags for set_mempolicy */
27#define MPOL_F_STATIC_NODES (1 << 15) 34#define MPOL_F_STATIC_NODES (1 << 15)
28#define MPOL_F_RELATIVE_NODES (1 << 14) 35#define MPOL_F_RELATIVE_NODES (1 << 14)
@@ -51,6 +58,7 @@ enum {
51 */ 58 */
52#define MPOL_F_SHARED (1 << 0) /* identify shared policies */ 59#define MPOL_F_SHARED (1 << 0) /* identify shared policies */
53#define MPOL_F_LOCAL (1 << 1) /* preferred local allocation */ 60#define MPOL_F_LOCAL (1 << 1) /* preferred local allocation */
61#define MPOL_F_REBINDING (1 << 2) /* identify policies in rebinding */
54 62
55#ifdef __KERNEL__ 63#ifdef __KERNEL__
56 64
@@ -193,8 +201,8 @@ struct mempolicy *mpol_shared_policy_lookup(struct shared_policy *sp,
193 201
194extern void numa_default_policy(void); 202extern void numa_default_policy(void);
195extern void numa_policy_init(void); 203extern void numa_policy_init(void);
196extern void mpol_rebind_task(struct task_struct *tsk, 204extern void mpol_rebind_task(struct task_struct *tsk, const nodemask_t *new,
197 const nodemask_t *new); 205 enum mpol_rebind_step step);
198extern void mpol_rebind_mm(struct mm_struct *mm, nodemask_t *new); 206extern void mpol_rebind_mm(struct mm_struct *mm, nodemask_t *new);
199extern void mpol_fix_fork_child_flag(struct task_struct *p); 207extern void mpol_fix_fork_child_flag(struct task_struct *p);
200 208
@@ -308,7 +316,8 @@ static inline void numa_default_policy(void)
308} 316}
309 317
310static inline void mpol_rebind_task(struct task_struct *tsk, 318static inline void mpol_rebind_task(struct task_struct *tsk,
311 const nodemask_t *new) 319 const nodemask_t *new,
320 enum mpol_rebind_step step)
312{ 321{
313} 322}
314 323
diff --git a/include/linux/meye.h b/include/linux/meye.h
index 12010ace1f04..0dd49954f746 100644
--- a/include/linux/meye.h
+++ b/include/linux/meye.h
@@ -44,17 +44,17 @@ struct meye_params {
44}; 44};
45 45
46/* query the extended parameters */ 46/* query the extended parameters */
47#define MEYEIOC_G_PARAMS _IOR ('v', BASE_VIDIOCPRIVATE+0, struct meye_params) 47#define MEYEIOC_G_PARAMS _IOR ('v', BASE_VIDIOC_PRIVATE+0, struct meye_params)
48/* set the extended parameters */ 48/* set the extended parameters */
49#define MEYEIOC_S_PARAMS _IOW ('v', BASE_VIDIOCPRIVATE+1, struct meye_params) 49#define MEYEIOC_S_PARAMS _IOW ('v', BASE_VIDIOC_PRIVATE+1, struct meye_params)
50/* queue a buffer for mjpeg capture */ 50/* queue a buffer for mjpeg capture */
51#define MEYEIOC_QBUF_CAPT _IOW ('v', BASE_VIDIOCPRIVATE+2, int) 51#define MEYEIOC_QBUF_CAPT _IOW ('v', BASE_VIDIOC_PRIVATE+2, int)
52/* sync a previously queued mjpeg buffer */ 52/* sync a previously queued mjpeg buffer */
53#define MEYEIOC_SYNC _IOWR('v', BASE_VIDIOCPRIVATE+3, int) 53#define MEYEIOC_SYNC _IOWR('v', BASE_VIDIOC_PRIVATE+3, int)
54/* get a still uncompressed snapshot */ 54/* get a still uncompressed snapshot */
55#define MEYEIOC_STILLCAPT _IO ('v', BASE_VIDIOCPRIVATE+4) 55#define MEYEIOC_STILLCAPT _IO ('v', BASE_VIDIOC_PRIVATE+4)
56/* get a jpeg compressed snapshot */ 56/* get a jpeg compressed snapshot */
57#define MEYEIOC_STILLJCAPT _IOR ('v', BASE_VIDIOCPRIVATE+5, int) 57#define MEYEIOC_STILLJCAPT _IOR ('v', BASE_VIDIOC_PRIVATE+5, int)
58 58
59/* V4L2 private controls */ 59/* V4L2 private controls */
60#define V4L2_CID_AGC V4L2_CID_PRIVATE_BASE 60#define V4L2_CID_AGC V4L2_CID_PRIVATE_BASE
diff --git a/include/linux/mfd/88pm860x.h b/include/linux/mfd/88pm860x.h
index 73f92c5feea2..bfd23bef7363 100644
--- a/include/linux/mfd/88pm860x.h
+++ b/include/linux/mfd/88pm860x.h
@@ -132,6 +132,7 @@ enum {
132 PM8607_ID_LDO9, 132 PM8607_ID_LDO9,
133 PM8607_ID_LDO10, 133 PM8607_ID_LDO10,
134 PM8607_ID_LDO12, 134 PM8607_ID_LDO12,
135 PM8607_ID_LDO13,
135 PM8607_ID_LDO14, 136 PM8607_ID_LDO14,
136 137
137 PM8607_ID_RG_MAX, 138 PM8607_ID_RG_MAX,
@@ -309,7 +310,7 @@ struct pm860x_chip {
309 310
310}; 311};
311 312
312#define PM8607_MAX_REGULATOR 15 /* 3 Bucks, 12 LDOs */ 313#define PM8607_MAX_REGULATOR PM8607_ID_RG_MAX /* 3 Bucks, 13 LDOs */
313 314
314enum { 315enum {
315 GI2C_PORT = 0, 316 GI2C_PORT = 0,
@@ -369,7 +370,7 @@ extern int pm860x_set_bits(struct i2c_client *, int, unsigned char,
369 unsigned char); 370 unsigned char);
370 371
371extern int pm860x_device_init(struct pm860x_chip *chip, 372extern int pm860x_device_init(struct pm860x_chip *chip,
372 struct pm860x_platform_data *pdata); 373 struct pm860x_platform_data *pdata) __devinit ;
373extern void pm860x_device_exit(struct pm860x_chip *chip); 374extern void pm860x_device_exit(struct pm860x_chip *chip) __devexit ;
374 375
375#endif /* __LINUX_MFD_88PM860X_H */ 376#endif /* __LINUX_MFD_88PM860X_H */
diff --git a/include/linux/mfd/ab4500.h b/include/linux/mfd/ab4500.h
deleted file mode 100644
index a42a7033ae53..000000000000
--- a/include/linux/mfd/ab4500.h
+++ /dev/null
@@ -1,262 +0,0 @@
1/*
2 * Copyright (C) 2009 ST-Ericsson
3 *
4 * Author: Srinidhi KASAGAR <srinidhi.kasagar@stericsson.com>
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2, as
8 * published by the Free Software Foundation.
9 *
10 * AB4500 device core funtions, for client access
11 */
12#ifndef MFD_AB4500_H
13#define MFD_AB4500_H
14
15#include <linux/device.h>
16
17/*
18 * AB4500 bank addresses
19 */
20#define AB4500_SYS_CTRL1_BLOCK 0x1
21#define AB4500_SYS_CTRL2_BLOCK 0x2
22#define AB4500_REGU_CTRL1 0x3
23#define AB4500_REGU_CTRL2 0x4
24#define AB4500_USB 0x5
25#define AB4500_TVOUT 0x6
26#define AB4500_DBI 0x7
27#define AB4500_ECI_AV_ACC 0x8
28#define AB4500_RESERVED 0x9
29#define AB4500_GPADC 0xA
30#define AB4500_CHARGER 0xB
31#define AB4500_GAS_GAUGE 0xC
32#define AB4500_AUDIO 0xD
33#define AB4500_INTERRUPT 0xE
34#define AB4500_RTC 0xF
35#define AB4500_MISC 0x10
36#define AB4500_DEBUG 0x12
37#define AB4500_PROD_TEST 0x13
38#define AB4500_OTP_EMUL 0x15
39
40/*
41 * System control 1 register offsets.
42 * Bank = 0x01
43 */
44#define AB4500_TURNON_STAT_REG 0x0100
45#define AB4500_RESET_STAT_REG 0x0101
46#define AB4500_PONKEY1_PRESS_STAT_REG 0x0102
47
48#define AB4500_FSM_STAT1_REG 0x0140
49#define AB4500_FSM_STAT2_REG 0x0141
50#define AB4500_SYSCLK_REQ_STAT_REG 0x0142
51#define AB4500_USB_STAT1_REG 0x0143
52#define AB4500_USB_STAT2_REG 0x0144
53#define AB4500_STATUS_SPARE1_REG 0x0145
54#define AB4500_STATUS_SPARE2_REG 0x0146
55
56#define AB4500_CTRL1_REG 0x0180
57#define AB4500_CTRL2_REG 0x0181
58
59/*
60 * System control 2 register offsets.
61 * bank = 0x02
62 */
63#define AB4500_CTRL3_REG 0x0200
64#define AB4500_MAIN_WDOG_CTRL_REG 0x0201
65#define AB4500_MAIN_WDOG_TIMER_REG 0x0202
66#define AB4500_LOW_BAT_REG 0x0203
67#define AB4500_BATT_OK_REG 0x0204
68#define AB4500_SYSCLK_TIMER_REG 0x0205
69#define AB4500_SMPSCLK_CTRL_REG 0x0206
70#define AB4500_SMPSCLK_SEL1_REG 0x0207
71#define AB4500_SMPSCLK_SEL2_REG 0x0208
72#define AB4500_SMPSCLK_SEL3_REG 0x0209
73#define AB4500_SYSULPCLK_CONF_REG 0x020A
74#define AB4500_SYSULPCLK_CTRL1_REG 0x020B
75#define AB4500_SYSCLK_CTRL_REG 0x020C
76#define AB4500_SYSCLK_REQ1_VALID_REG 0x020D
77#define AB4500_SYSCLK_REQ_VALID_REG 0x020E
78#define AB4500_SYSCTRL_SPARE_REG 0x020F
79#define AB4500_PAD_CONF_REG 0x0210
80
81/*
82 * Regu control1 register offsets
83 * Bank = 0x03
84 */
85#define AB4500_REGU_SERIAL_CTRL1_REG 0x0300
86#define AB4500_REGU_SERIAL_CTRL2_REG 0x0301
87#define AB4500_REGU_SERIAL_CTRL3_REG 0x0302
88#define AB4500_REGU_REQ_CTRL1_REG 0x0303
89#define AB4500_REGU_REQ_CTRL2_REG 0x0304
90#define AB4500_REGU_REQ_CTRL3_REG 0x0305
91#define AB4500_REGU_REQ_CTRL4_REG 0x0306
92#define AB4500_REGU_MISC1_REG 0x0380
93#define AB4500_REGU_OTGSUPPLY_CTRL_REG 0x0381
94#define AB4500_REGU_VUSB_CTRL_REG 0x0382
95#define AB4500_REGU_VAUDIO_SUPPLY_REG 0x0383
96#define AB4500_REGU_CTRL1_SPARE_REG 0x0384
97
98/*
99 * Regu control2 Vmod register offsets
100 */
101#define AB4500_REGU_VMOD_REGU_REG 0x0440
102#define AB4500_REGU_VMOD_SEL1_REG 0x0441
103#define AB4500_REGU_VMOD_SEL2_REG 0x0442
104#define AB4500_REGU_CTRL_DISCH_REG 0x0443
105#define AB4500_REGU_CTRL_DISCH2_REG 0x0444
106
107/*
108 * USB/ULPI register offsets
109 * Bank : 0x5
110 */
111#define AB4500_USB_LINE_STAT_REG 0x0580
112#define AB4500_USB_LINE_CTRL1_REG 0x0581
113#define AB4500_USB_LINE_CTRL2_REG 0x0582
114#define AB4500_USB_LINE_CTRL3_REG 0x0583
115#define AB4500_USB_LINE_CTRL4_REG 0x0584
116#define AB4500_USB_LINE_CTRL5_REG 0x0585
117#define AB4500_USB_OTG_CTRL_REG 0x0587
118#define AB4500_USB_OTG_STAT_REG 0x0588
119#define AB4500_USB_OTG_STAT_REG 0x0588
120#define AB4500_USB_CTRL_SPARE_REG 0x0589
121#define AB4500_USB_PHY_CTRL_REG 0x058A
122
123/*
124 * TVOUT / CTRL register offsets
125 * Bank : 0x06
126 */
127#define AB4500_TVOUT_CTRL_REG 0x0680
128
129/*
130 * DBI register offsets
131 * Bank : 0x07
132 */
133#define AB4500_DBI_REG1_REG 0x0700
134#define AB4500_DBI_REG2_REG 0x0701
135
136/*
137 * ECI regsiter offsets
138 * Bank : 0x08
139 */
140#define AB4500_ECI_CTRL_REG 0x0800
141#define AB4500_ECI_HOOKLEVEL_REG 0x0801
142#define AB4500_ECI_DATAOUT_REG 0x0802
143#define AB4500_ECI_DATAIN_REG 0x0803
144
145/*
146 * AV Connector register offsets
147 * Bank : 0x08
148 */
149#define AB4500_AV_CONN_REG 0x0840
150
151/*
152 * Accessory detection register offsets
153 * Bank : 0x08
154 */
155#define AB4500_ACC_DET_DB1_REG 0x0880
156#define AB4500_ACC_DET_DB2_REG 0x0881
157
158/*
159 * GPADC register offsets
160 * Bank : 0x0A
161 */
162#define AB4500_GPADC_CTRL1_REG 0x0A00
163#define AB4500_GPADC_CTRL2_REG 0x0A01
164#define AB4500_GPADC_CTRL3_REG 0x0A02
165#define AB4500_GPADC_AUTO_TIMER_REG 0x0A03
166#define AB4500_GPADC_STAT_REG 0x0A04
167#define AB4500_GPADC_MANDATAL_REG 0x0A05
168#define AB4500_GPADC_MANDATAH_REG 0x0A06
169#define AB4500_GPADC_AUTODATAL_REG 0x0A07
170#define AB4500_GPADC_AUTODATAH_REG 0x0A08
171#define AB4500_GPADC_MUX_CTRL_REG 0x0A09
172
173/*
174 * Charger / status register offfsets
175 * Bank : 0x0B
176 */
177#define AB4500_CH_STATUS1_REG 0x0B00
178#define AB4500_CH_STATUS2_REG 0x0B01
179#define AB4500_CH_USBCH_STAT1_REG 0x0B02
180#define AB4500_CH_USBCH_STAT2_REG 0x0B03
181#define AB4500_CH_FSM_STAT_REG 0x0B04
182#define AB4500_CH_STAT_REG 0x0B05
183
184/*
185 * Charger / control register offfsets
186 * Bank : 0x0B
187 */
188#define AB4500_CH_VOLT_LVL_REG 0x0B40
189
190/*
191 * Charger / main control register offfsets
192 * Bank : 0x0B
193 */
194#define AB4500_MCH_CTRL1 0x0B80
195#define AB4500_MCH_CTRL2 0x0B81
196#define AB4500_MCH_IPT_CURLVL_REG 0x0B82
197#define AB4500_CH_WD_REG 0x0B83
198
199/*
200 * Charger / USB control register offsets
201 * Bank : 0x0B
202 */
203#define AB4500_USBCH_CTRL1_REG 0x0BC0
204#define AB4500_USBCH_CTRL2_REG 0x0BC1
205#define AB4500_USBCH_IPT_CRNTLVL_REG 0x0BC2
206
207/*
208 * RTC bank register offsets
209 * Bank : 0xF
210 */
211#define AB4500_RTC_SOFF_STAT_REG 0x0F00
212#define AB4500_RTC_CC_CONF_REG 0x0F01
213#define AB4500_RTC_READ_REQ_REG 0x0F02
214#define AB4500_RTC_WATCH_TSECMID_REG 0x0F03
215#define AB4500_RTC_WATCH_TSECHI_REG 0x0F04
216#define AB4500_RTC_WATCH_TMIN_LOW_REG 0x0F05
217#define AB4500_RTC_WATCH_TMIN_MID_REG 0x0F06
218#define AB4500_RTC_WATCH_TMIN_HI_REG 0x0F07
219#define AB4500_RTC_ALRM_MIN_LOW_REG 0x0F08
220#define AB4500_RTC_ALRM_MIN_MID_REG 0x0F09
221#define AB4500_RTC_ALRM_MIN_HI_REG 0x0F0A
222#define AB4500_RTC_STAT_REG 0x0F0B
223#define AB4500_RTC_BKUP_CHG_REG 0x0F0C
224#define AB4500_RTC_FORCE_BKUP_REG 0x0F0D
225#define AB4500_RTC_CALIB_REG 0x0F0E
226#define AB4500_RTC_SWITCH_STAT_REG 0x0F0F
227
228/*
229 * PWM Out generators
230 * Bank: 0x10
231 */
232#define AB4500_PWM_OUT_CTRL1_REG 0x1060
233#define AB4500_PWM_OUT_CTRL2_REG 0x1061
234#define AB4500_PWM_OUT_CTRL3_REG 0x1062
235#define AB4500_PWM_OUT_CTRL4_REG 0x1063
236#define AB4500_PWM_OUT_CTRL5_REG 0x1064
237#define AB4500_PWM_OUT_CTRL6_REG 0x1065
238#define AB4500_PWM_OUT_CTRL7_REG 0x1066
239
240#define AB4500_I2C_PAD_CTRL_REG 0x1067
241#define AB4500_REV_REG 0x1080
242
243/**
244 * struct ab4500
245 * @spi: spi device structure
246 * @tx_buf: transmit buffer
247 * @rx_buf: receive buffer
248 * @lock: sync primitive
249 */
250struct ab4500 {
251 struct spi_device *spi;
252 unsigned long tx_buf[4];
253 unsigned long rx_buf[4];
254 struct mutex lock;
255};
256
257int ab4500_write(struct ab4500 *ab4500, unsigned char block,
258 unsigned long addr, unsigned char data);
259int ab4500_read(struct ab4500 *ab4500, unsigned char block,
260 unsigned long addr);
261
262#endif /* MFD_AB4500_H */
diff --git a/include/linux/mfd/ab8500.h b/include/linux/mfd/ab8500.h
new file mode 100644
index 000000000000..b63ff3ba3351
--- /dev/null
+++ b/include/linux/mfd/ab8500.h
@@ -0,0 +1,128 @@
1/*
2 * Copyright (C) ST-Ericsson SA 2010
3 *
4 * License Terms: GNU General Public License v2
5 * Author: Srinidhi Kasagar <srinidhi.kasagar@stericsson.com>
6 */
7#ifndef MFD_AB8500_H
8#define MFD_AB8500_H
9
10#include <linux/device.h>
11
12/*
13 * Interrupts
14 */
15
16#define AB8500_INT_MAIN_EXT_CH_NOT_OK 0
17#define AB8500_INT_UN_PLUG_TV_DET 1
18#define AB8500_INT_PLUG_TV_DET 2
19#define AB8500_INT_TEMP_WARM 3
20#define AB8500_INT_PON_KEY2DB_F 4
21#define AB8500_INT_PON_KEY2DB_R 5
22#define AB8500_INT_PON_KEY1DB_F 6
23#define AB8500_INT_PON_KEY1DB_R 7
24#define AB8500_INT_BATT_OVV 8
25#define AB8500_INT_MAIN_CH_UNPLUG_DET 10
26#define AB8500_INT_MAIN_CH_PLUG_DET 11
27#define AB8500_INT_USB_ID_DET_F 12
28#define AB8500_INT_USB_ID_DET_R 13
29#define AB8500_INT_VBUS_DET_F 14
30#define AB8500_INT_VBUS_DET_R 15
31#define AB8500_INT_VBUS_CH_DROP_END 16
32#define AB8500_INT_RTC_60S 17
33#define AB8500_INT_RTC_ALARM 18
34#define AB8500_INT_BAT_CTRL_INDB 20
35#define AB8500_INT_CH_WD_EXP 21
36#define AB8500_INT_VBUS_OVV 22
37#define AB8500_INT_MAIN_CH_DROP_END 23
38#define AB8500_INT_CCN_CONV_ACC 24
39#define AB8500_INT_INT_AUD 25
40#define AB8500_INT_CCEOC 26
41#define AB8500_INT_CC_INT_CALIB 27
42#define AB8500_INT_LOW_BAT_F 28
43#define AB8500_INT_LOW_BAT_R 29
44#define AB8500_INT_BUP_CHG_NOT_OK 30
45#define AB8500_INT_BUP_CHG_OK 31
46#define AB8500_INT_GP_HW_ADC_CONV_END 32
47#define AB8500_INT_ACC_DETECT_1DB_F 33
48#define AB8500_INT_ACC_DETECT_1DB_R 34
49#define AB8500_INT_ACC_DETECT_22DB_F 35
50#define AB8500_INT_ACC_DETECT_22DB_R 36
51#define AB8500_INT_ACC_DETECT_21DB_F 37
52#define AB8500_INT_ACC_DETECT_21DB_R 38
53#define AB8500_INT_GP_SW_ADC_CONV_END 39
54#define AB8500_INT_BTEMP_LOW 72
55#define AB8500_INT_BTEMP_LOW_MEDIUM 73
56#define AB8500_INT_BTEMP_MEDIUM_HIGH 74
57#define AB8500_INT_BTEMP_HIGH 75
58#define AB8500_INT_USB_CHARGER_NOT_OK 81
59#define AB8500_INT_ID_WAKEUP_R 82
60#define AB8500_INT_ID_DET_R1R 84
61#define AB8500_INT_ID_DET_R2R 85
62#define AB8500_INT_ID_DET_R3R 86
63#define AB8500_INT_ID_DET_R4R 87
64#define AB8500_INT_ID_WAKEUP_F 88
65#define AB8500_INT_ID_DET_R1F 90
66#define AB8500_INT_ID_DET_R2F 91
67#define AB8500_INT_ID_DET_R3F 92
68#define AB8500_INT_ID_DET_R4F 93
69#define AB8500_INT_USB_CHG_DET_DONE 94
70#define AB8500_INT_USB_CH_TH_PROT_F 96
71#define AB8500_INT_USB_CH_TH_PROP_R 97
72#define AB8500_INT_MAIN_CH_TH_PROP_F 98
73#define AB8500_INT_MAIN_CH_TH_PROT_R 99
74#define AB8500_INT_USB_CHARGER_NOT_OKF 103
75
76#define AB8500_NR_IRQS 104
77#define AB8500_NUM_IRQ_REGS 13
78
79/**
80 * struct ab8500 - ab8500 internal structure
81 * @dev: parent device
82 * @lock: read/write operations lock
83 * @irq_lock: genirq bus lock
84 * @revision: chip revision
85 * @irq: irq line
86 * @write: register write
87 * @read: register read
88 * @rx_buf: rx buf for SPI
89 * @tx_buf: tx buf for SPI
90 * @mask: cache of IRQ regs for bus lock
91 * @oldmask: cache of previous IRQ regs for bus lock
92 */
93struct ab8500 {
94 struct device *dev;
95 struct mutex lock;
96 struct mutex irq_lock;
97 int revision;
98 int irq_base;
99 int irq;
100
101 int (*write) (struct ab8500 *a8500, u16 addr, u8 data);
102 int (*read) (struct ab8500 *a8500, u16 addr);
103
104 unsigned long tx_buf[4];
105 unsigned long rx_buf[4];
106
107 u8 mask[AB8500_NUM_IRQ_REGS];
108 u8 oldmask[AB8500_NUM_IRQ_REGS];
109};
110
111/**
112 * struct ab8500_platform_data - AB8500 platform data
113 * @irq_base: start of AB8500 IRQs, AB8500_NR_IRQS will be used
114 * @init: board-specific initialization after detection of ab8500
115 */
116struct ab8500_platform_data {
117 int irq_base;
118 void (*init) (struct ab8500 *);
119};
120
121extern int ab8500_write(struct ab8500 *a8500, u16 addr, u8 data);
122extern int ab8500_read(struct ab8500 *a8500, u16 addr);
123extern int ab8500_set_bits(struct ab8500 *a8500, u16 addr, u8 mask, u8 data);
124
125extern int __devinit ab8500_init(struct ab8500 *ab8500);
126extern int __devexit ab8500_exit(struct ab8500 *ab8500);
127
128#endif /* MFD_AB8500_H */
diff --git a/include/linux/mfd/ab3100.h b/include/linux/mfd/abx500.h
index 9a881c305a50..390726fcbcb1 100644
--- a/include/linux/mfd/ab3100.h
+++ b/include/linux/mfd/abx500.h
@@ -3,17 +3,37 @@
3 * License terms: GNU General Public License (GPL) version 2 3 * License terms: GNU General Public License (GPL) version 2
4 * AB3100 core access functions 4 * AB3100 core access functions
5 * Author: Linus Walleij <linus.walleij@stericsson.com> 5 * Author: Linus Walleij <linus.walleij@stericsson.com>
6 *
7 * ABX500 core access functions.
8 * The abx500 interface is used for the Analog Baseband chip
9 * ab3100, ab3550, ab5500 and possibly comming. It is not used for
10 * ab4500 and ab8500 since they are another family of chip.
11 *
12 * Author: Mattias Wallin <mattias.wallin@stericsson.com>
13 * Author: Mattias Nilsson <mattias.i.nilsson@stericsson.com>
14 * Author: Bengt Jonsson <bengt.g.jonsson@stericsson.com>
15 * Author: Rickard Andersson <rickard.andersson@stericsson.com>
6 */ 16 */
7 17
8#include <linux/device.h> 18#include <linux/device.h>
9#include <linux/regulator/machine.h> 19#include <linux/regulator/machine.h>
10 20
11#ifndef MFD_AB3100_H 21#ifndef MFD_ABX500_H
12#define MFD_AB3100_H 22#define MFD_ABX500_H
13 23
14#define ABUNKNOWN 0 24#define AB3100_P1A 0xc0
15#define AB3000 1 25#define AB3100_P1B 0xc1
16#define AB3100 2 26#define AB3100_P1C 0xc2
27#define AB3100_P1D 0xc3
28#define AB3100_P1E 0xc4
29#define AB3100_P1F 0xc5
30#define AB3100_P1G 0xc6
31#define AB3100_R2A 0xc7
32#define AB3100_R2B 0xc8
33#define AB3550_P1A 0x10
34#define AB5500_1_0 0x20
35#define AB5500_2_0 0x21
36#define AB5500_2_1 0x22
17 37
18/* 38/*
19 * AB3100, EVENTA1, A2 and A3 event register flags 39 * AB3100, EVENTA1, A2 and A3 event register flags
@@ -89,7 +109,7 @@ struct ab3100 {
89 char chip_name[32]; 109 char chip_name[32];
90 u8 chip_id; 110 u8 chip_id;
91 struct blocking_notifier_head event_subscribers; 111 struct blocking_notifier_head event_subscribers;
92 u32 startup_events; 112 u8 startup_events[3];
93 bool startup_events_read; 113 bool startup_events_read;
94}; 114};
95 115
@@ -112,18 +132,102 @@ struct ab3100_platform_data {
112 int external_voltage; 132 int external_voltage;
113}; 133};
114 134
115int ab3100_set_register_interruptible(struct ab3100 *ab3100, u8 reg, u8 regval);
116int ab3100_get_register_interruptible(struct ab3100 *ab3100, u8 reg, u8 *regval);
117int ab3100_get_register_page_interruptible(struct ab3100 *ab3100,
118 u8 first_reg, u8 *regvals, u8 numregs);
119int ab3100_mask_and_set_register_interruptible(struct ab3100 *ab3100,
120 u8 reg, u8 andmask, u8 ormask);
121u8 ab3100_get_chip_type(struct ab3100 *ab3100);
122int ab3100_event_register(struct ab3100 *ab3100, 135int ab3100_event_register(struct ab3100 *ab3100,
123 struct notifier_block *nb); 136 struct notifier_block *nb);
124int ab3100_event_unregister(struct ab3100 *ab3100, 137int ab3100_event_unregister(struct ab3100 *ab3100,
125 struct notifier_block *nb); 138 struct notifier_block *nb);
126int ab3100_event_registers_startup_state_get(struct ab3100 *ab3100,
127 u32 *fatevent);
128 139
140/* AB3550, STR register flags */
141#define AB3550_STR_ONSWA (0x01)
142#define AB3550_STR_ONSWB (0x02)
143#define AB3550_STR_ONSWC (0x04)
144#define AB3550_STR_DCIO (0x08)
145#define AB3550_STR_BOOT_MODE (0x10)
146#define AB3550_STR_SIM_OFF (0x20)
147#define AB3550_STR_BATT_REMOVAL (0x40)
148#define AB3550_STR_VBUS (0x80)
149
150/* Interrupt mask registers */
151#define AB3550_IMR1 0x29
152#define AB3550_IMR2 0x2a
153#define AB3550_IMR3 0x2b
154#define AB3550_IMR4 0x2c
155#define AB3550_IMR5 0x2d
156
157enum ab3550_devid {
158 AB3550_DEVID_ADC,
159 AB3550_DEVID_DAC,
160 AB3550_DEVID_LEDS,
161 AB3550_DEVID_POWER,
162 AB3550_DEVID_REGULATORS,
163 AB3550_DEVID_SIM,
164 AB3550_DEVID_UART,
165 AB3550_DEVID_RTC,
166 AB3550_DEVID_CHARGER,
167 AB3550_DEVID_FUELGAUGE,
168 AB3550_DEVID_VIBRATOR,
169 AB3550_DEVID_CODEC,
170 AB3550_NUM_DEVICES,
171};
172
173/**
174 * struct abx500_init_setting
175 * Initial value of the registers for driver to use during setup.
176 */
177struct abx500_init_settings {
178 u8 bank;
179 u8 reg;
180 u8 setting;
181};
182
183/**
184 * struct ab3550_platform_data
185 * Data supplied to initialize board connections to the AB3550
186 */
187struct ab3550_platform_data {
188 struct {unsigned int base; unsigned int count; } irq;
189 void *dev_data[AB3550_NUM_DEVICES];
190 size_t dev_data_sz[AB3550_NUM_DEVICES];
191 struct abx500_init_settings *init_settings;
192 unsigned int init_settings_sz;
193};
194
195int abx500_set_register_interruptible(struct device *dev, u8 bank, u8 reg,
196 u8 value);
197int abx500_get_register_interruptible(struct device *dev, u8 bank, u8 reg,
198 u8 *value);
199int abx500_get_register_page_interruptible(struct device *dev, u8 bank,
200 u8 first_reg, u8 *regvals, u8 numregs);
201int abx500_set_register_page_interruptible(struct device *dev, u8 bank,
202 u8 first_reg, u8 *regvals, u8 numregs);
203/**
204 * abx500_mask_and_set_register_inerruptible() - Modifies selected bits of a
205 * target register
206 *
207 * @dev: The AB sub device.
208 * @bank: The i2c bank number.
209 * @bitmask: The bit mask to use.
210 * @bitvalues: The new bit values.
211 *
212 * Updates the value of an AB register:
213 * value -> ((value & ~bitmask) | (bitvalues & bitmask))
214 */
215int abx500_mask_and_set_register_interruptible(struct device *dev, u8 bank,
216 u8 reg, u8 bitmask, u8 bitvalues);
217int abx500_get_chip_id(struct device *dev);
218int abx500_event_registers_startup_state_get(struct device *dev, u8 *event);
219int abx500_startup_irq_enabled(struct device *dev, unsigned int irq);
220
221struct abx500_ops {
222 int (*get_chip_id) (struct device *);
223 int (*get_register) (struct device *, u8, u8, u8 *);
224 int (*set_register) (struct device *, u8, u8, u8);
225 int (*get_register_page) (struct device *, u8, u8, u8 *, u8);
226 int (*set_register_page) (struct device *, u8, u8, u8 *, u8);
227 int (*mask_and_set_register) (struct device *, u8, u8, u8, u8);
228 int (*event_registers_startup_state_get) (struct device *, u8 *);
229 int (*startup_irq_enabled) (struct device *, unsigned int);
230};
231
232int abx500_register_ops(struct device *core_dev, struct abx500_ops *ops);
129#endif 233#endif
diff --git a/include/linux/mfd/davinci_voicecodec.h b/include/linux/mfd/davinci_voicecodec.h
new file mode 100644
index 000000000000..0ab61320ffa8
--- /dev/null
+++ b/include/linux/mfd/davinci_voicecodec.h
@@ -0,0 +1,126 @@
1/*
2 * DaVinci Voice Codec Core Interface for TI platforms
3 *
4 * Copyright (C) 2010 Texas Instruments, Inc
5 *
6 * Author: Miguel Aguilar <miguel.aguilar@ridgerun.com>
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License as published by
10 * the Free Software Foundation; either version 2 of the License, or
11 * (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful,
14 * but WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 * GNU General Public License for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21 */
22
23#ifndef __LINUX_MFD_DAVINCI_VOICECODEC_H_
24#define __LINUX_MFD_DAVINIC_VOICECODEC_H_
25
26#include <linux/kernel.h>
27#include <linux/platform_device.h>
28#include <linux/mfd/core.h>
29
30#include <mach/edma.h>
31
32/*
33 * Register values.
34 */
35#define DAVINCI_VC_PID 0x00
36#define DAVINCI_VC_CTRL 0x04
37#define DAVINCI_VC_INTEN 0x08
38#define DAVINCI_VC_INTSTATUS 0x0c
39#define DAVINCI_VC_INTCLR 0x10
40#define DAVINCI_VC_EMUL_CTRL 0x14
41#define DAVINCI_VC_RFIFO 0x20
42#define DAVINCI_VC_WFIFO 0x24
43#define DAVINCI_VC_FIFOSTAT 0x28
44#define DAVINCI_VC_TST_CTRL 0x2C
45#define DAVINCI_VC_REG05 0x94
46#define DAVINCI_VC_REG09 0xA4
47#define DAVINCI_VC_REG12 0xB0
48
49/* DAVINCI_VC_CTRL bit fields */
50#define DAVINCI_VC_CTRL_MASK 0x5500
51#define DAVINCI_VC_CTRL_RSTADC BIT(0)
52#define DAVINCI_VC_CTRL_RSTDAC BIT(1)
53#define DAVINCI_VC_CTRL_RD_BITS_8 BIT(4)
54#define DAVINCI_VC_CTRL_RD_UNSIGNED BIT(5)
55#define DAVINCI_VC_CTRL_WD_BITS_8 BIT(6)
56#define DAVINCI_VC_CTRL_WD_UNSIGNED BIT(7)
57#define DAVINCI_VC_CTRL_RFIFOEN BIT(8)
58#define DAVINCI_VC_CTRL_RFIFOCL BIT(9)
59#define DAVINCI_VC_CTRL_RFIFOMD_WORD_1 BIT(10)
60#define DAVINCI_VC_CTRL_WFIFOEN BIT(12)
61#define DAVINCI_VC_CTRL_WFIFOCL BIT(13)
62#define DAVINCI_VC_CTRL_WFIFOMD_WORD_1 BIT(14)
63
64/* DAVINCI_VC_INT bit fields */
65#define DAVINCI_VC_INT_MASK 0x3F
66#define DAVINCI_VC_INT_RDRDY_MASK BIT(0)
67#define DAVINCI_VC_INT_RERROVF_MASK BIT(1)
68#define DAVINCI_VC_INT_RERRUDR_MASK BIT(2)
69#define DAVINCI_VC_INT_WDREQ_MASK BIT(3)
70#define DAVINCI_VC_INT_WERROVF_MASKBIT BIT(4)
71#define DAVINCI_VC_INT_WERRUDR_MASK BIT(5)
72
73/* DAVINCI_VC_REG05 bit fields */
74#define DAVINCI_VC_REG05_PGA_GAIN 0x07
75
76/* DAVINCI_VC_REG09 bit fields */
77#define DAVINCI_VC_REG09_MUTE 0x40
78#define DAVINCI_VC_REG09_DIG_ATTEN 0x3F
79
80/* DAVINCI_VC_REG12 bit fields */
81#define DAVINCI_VC_REG12_POWER_ALL_ON 0xFD
82#define DAVINCI_VC_REG12_POWER_ALL_OFF 0x00
83
84#define DAVINCI_VC_CELLS 2
85
86enum davinci_vc_cells {
87 DAVINCI_VC_VCIF_CELL,
88 DAVINCI_VC_CQ93VC_CELL,
89};
90
91struct davinci_vcif {
92 struct platform_device *pdev;
93 u32 dma_tx_channel;
94 u32 dma_rx_channel;
95 dma_addr_t dma_tx_addr;
96 dma_addr_t dma_rx_addr;
97};
98
99struct cq93vc {
100 struct platform_device *pdev;
101 struct snd_soc_codec *codec;
102 u32 sysclk;
103};
104
105struct davinci_vc;
106
107struct davinci_vc {
108 /* Device data */
109 struct device *dev;
110 struct platform_device *pdev;
111 struct clk *clk;
112
113 /* Memory resources */
114 void __iomem *base;
115 resource_size_t pbase;
116 size_t base_size;
117
118 /* MFD cells */
119 struct mfd_cell cells[DAVINCI_VC_CELLS];
120
121 /* Client devices */
122 struct davinci_vcif davinci_vcif;
123 struct cq93vc cq93vc;
124};
125
126#endif
diff --git a/include/linux/mfd/janz.h b/include/linux/mfd/janz.h
new file mode 100644
index 000000000000..e9994c469803
--- /dev/null
+++ b/include/linux/mfd/janz.h
@@ -0,0 +1,54 @@
1/*
2 * Common Definitions for Janz MODULbus devices
3 *
4 * Copyright (c) 2010 Ira W. Snyder <iws@ovro.caltech.edu>
5 *
6 * This program is free software; you can redistribute it and/or modify it
7 * under the terms of the GNU General Public License as published by the
8 * Free Software Foundation; either version 2 of the License, or (at your
9 * option) any later version.
10 */
11
12#ifndef JANZ_H
13#define JANZ_H
14
15struct janz_platform_data {
16 /* MODULbus Module Number */
17 unsigned int modno;
18};
19
20/* PLX bridge chip onboard registers */
21struct janz_cmodio_onboard_regs {
22 u8 unused1;
23
24 /*
25 * Read access: interrupt status
26 * Write access: interrupt disable
27 */
28 u8 int_disable;
29 u8 unused2;
30
31 /*
32 * Read access: MODULbus number (hex switch)
33 * Write access: interrupt enable
34 */
35 u8 int_enable;
36 u8 unused3;
37
38 /* write-only */
39 u8 reset_assert;
40 u8 unused4;
41
42 /* write-only */
43 u8 reset_deassert;
44 u8 unused5;
45
46 /* read-write access to serial EEPROM */
47 u8 eep;
48 u8 unused6;
49
50 /* write-only access to EEPROM chip select */
51 u8 enid;
52};
53
54#endif /* JANZ_H */
diff --git a/include/linux/mfd/mc13783.h b/include/linux/mfd/mc13783.h
index 8895d9d8879c..4a894f688549 100644
--- a/include/linux/mfd/mc13783.h
+++ b/include/linux/mfd/mc13783.h
@@ -64,6 +64,70 @@ static inline int mc13783_ackirq(struct mc13783 *mc13783, int irq)
64 MC13783_ADC0_TSMOD1 | \ 64 MC13783_ADC0_TSMOD1 | \
65 MC13783_ADC0_TSMOD2) 65 MC13783_ADC0_TSMOD2)
66 66
67struct mc13783_led_platform_data {
68#define MC13783_LED_MD 0
69#define MC13783_LED_AD 1
70#define MC13783_LED_KP 2
71#define MC13783_LED_R1 3
72#define MC13783_LED_G1 4
73#define MC13783_LED_B1 5
74#define MC13783_LED_R2 6
75#define MC13783_LED_G2 7
76#define MC13783_LED_B2 8
77#define MC13783_LED_R3 9
78#define MC13783_LED_G3 10
79#define MC13783_LED_B3 11
80#define MC13783_LED_MAX MC13783_LED_B3
81 int id;
82 const char *name;
83 const char *default_trigger;
84
85/* Three or two bits current selection depending on the led */
86 char max_current;
87};
88
89struct mc13783_leds_platform_data {
90 int num_leds;
91 struct mc13783_led_platform_data *led;
92
93#define MC13783_LED_TRIODE_MD (1 << 0)
94#define MC13783_LED_TRIODE_AD (1 << 1)
95#define MC13783_LED_TRIODE_KP (1 << 2)
96#define MC13783_LED_BOOST_EN (1 << 3)
97#define MC13783_LED_TC1HALF (1 << 4)
98#define MC13783_LED_SLEWLIMTC (1 << 5)
99#define MC13783_LED_SLEWLIMBL (1 << 6)
100#define MC13783_LED_TRIODE_TC1 (1 << 7)
101#define MC13783_LED_TRIODE_TC2 (1 << 8)
102#define MC13783_LED_TRIODE_TC3 (1 << 9)
103 int flags;
104
105#define MC13783_LED_AB_DISABLED 0
106#define MC13783_LED_AB_MD1 1
107#define MC13783_LED_AB_MD12 2
108#define MC13783_LED_AB_MD123 3
109#define MC13783_LED_AB_MD1234 4
110#define MC13783_LED_AB_MD1234_AD1 5
111#define MC13783_LED_AB_MD1234_AD12 6
112#define MC13783_LED_AB_MD1_AD 7
113 char abmode;
114
115#define MC13783_LED_ABREF_200MV 0
116#define MC13783_LED_ABREF_400MV 1
117#define MC13783_LED_ABREF_600MV 2
118#define MC13783_LED_ABREF_800MV 3
119 char abref;
120
121#define MC13783_LED_PERIOD_10MS 0
122#define MC13783_LED_PERIOD_100MS 1
123#define MC13783_LED_PERIOD_500MS 2
124#define MC13783_LED_PERIOD_2S 3
125 char bl_period;
126 char tc1_period;
127 char tc2_period;
128 char tc3_period;
129};
130
67/* to be cleaned up */ 131/* to be cleaned up */
68struct regulator_init_data; 132struct regulator_init_data;
69 133
@@ -80,12 +144,14 @@ struct mc13783_regulator_platform_data {
80struct mc13783_platform_data { 144struct mc13783_platform_data {
81 int num_regulators; 145 int num_regulators;
82 struct mc13783_regulator_init_data *regulators; 146 struct mc13783_regulator_init_data *regulators;
147 struct mc13783_leds_platform_data *leds;
83 148
84#define MC13783_USE_TOUCHSCREEN (1 << 0) 149#define MC13783_USE_TOUCHSCREEN (1 << 0)
85#define MC13783_USE_CODEC (1 << 1) 150#define MC13783_USE_CODEC (1 << 1)
86#define MC13783_USE_ADC (1 << 2) 151#define MC13783_USE_ADC (1 << 2)
87#define MC13783_USE_RTC (1 << 3) 152#define MC13783_USE_RTC (1 << 3)
88#define MC13783_USE_REGULATOR (1 << 4) 153#define MC13783_USE_REGULATOR (1 << 4)
154#define MC13783_USE_LED (1 << 5)
89 unsigned int flags; 155 unsigned int flags;
90}; 156};
91 157
diff --git a/include/linux/mfd/pcf50633/backlight.h b/include/linux/mfd/pcf50633/backlight.h
new file mode 100644
index 000000000000..83747e217b27
--- /dev/null
+++ b/include/linux/mfd/pcf50633/backlight.h
@@ -0,0 +1,51 @@
1/*
2 * Copyright (C) 2009-2010, Lars-Peter Clausen <lars@metafoo.de>
3 * PCF50633 backlight device driver
4 *
5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License as published by the
7 * Free Software Foundation; either version 2 of the License, or (at your
8 * option) any later version.
9 *
10 * You should have received a copy of the GNU General Public License along
11 * with this program; if not, write to the Free Software Foundation, Inc.,
12 * 675 Mass Ave, Cambridge, MA 02139, USA.
13 *
14 */
15
16#ifndef __LINUX_MFD_PCF50633_BACKLIGHT
17#define __LINUX_MFD_PCF50633_BACKLIGHT
18
19/*
20* @default_brightness: Backlight brightness is initialized to this value
21*
22* Brightness to be used after the driver has been probed.
23* Valid range 0-63.
24*
25* @default_brightness_limit: The actual brightness is limited by this value
26*
27* Brightness limit to be used after the driver has been probed. This is useful
28* when it is not known how much power is available for the backlight during
29* probe.
30* Valid range 0-63. Can be changed later with pcf50633_bl_set_brightness_limit.
31*
32* @ramp_time: Display ramp time when changing brightness
33*
34* When changing the backlights brightness the change is not instant, instead
35* it fades smooth from one state to another. This value specifies how long
36* the fade should take. The lower the value the higher the fade time.
37* Valid range 0-255
38*/
39struct pcf50633_bl_platform_data {
40 unsigned int default_brightness;
41 unsigned int default_brightness_limit;
42 uint8_t ramp_time;
43};
44
45
46struct pcf50633;
47
48int pcf50633_bl_set_brightness_limit(struct pcf50633 *pcf, unsigned int limit);
49
50#endif
51
diff --git a/include/linux/mfd/pcf50633/core.h b/include/linux/mfd/pcf50633/core.h
index 3398bd9aab11..ad411a78870c 100644
--- a/include/linux/mfd/pcf50633/core.h
+++ b/include/linux/mfd/pcf50633/core.h
@@ -18,6 +18,7 @@
18#include <linux/regulator/driver.h> 18#include <linux/regulator/driver.h>
19#include <linux/regulator/machine.h> 19#include <linux/regulator/machine.h>
20#include <linux/power_supply.h> 20#include <linux/power_supply.h>
21#include <linux/mfd/pcf50633/backlight.h>
21 22
22struct pcf50633; 23struct pcf50633;
23 24
@@ -43,6 +44,8 @@ struct pcf50633_platform_data {
43 void (*force_shutdown)(struct pcf50633 *); 44 void (*force_shutdown)(struct pcf50633 *);
44 45
45 u8 resumers[5]; 46 u8 resumers[5];
47
48 struct pcf50633_bl_platform_data *backlight_data;
46}; 49};
47 50
48struct pcf50633_irq { 51struct pcf50633_irq {
@@ -152,6 +155,7 @@ struct pcf50633 {
152 struct platform_device *mbc_pdev; 155 struct platform_device *mbc_pdev;
153 struct platform_device *adc_pdev; 156 struct platform_device *adc_pdev;
154 struct platform_device *input_pdev; 157 struct platform_device *input_pdev;
158 struct platform_device *bl_pdev;
155 struct platform_device *regulator_pdev[PCF50633_NUM_REGULATORS]; 159 struct platform_device *regulator_pdev[PCF50633_NUM_REGULATORS];
156}; 160};
157 161
diff --git a/include/linux/mfd/rdc321x.h b/include/linux/mfd/rdc321x.h
new file mode 100644
index 000000000000..4bdf19c8eedf
--- /dev/null
+++ b/include/linux/mfd/rdc321x.h
@@ -0,0 +1,26 @@
1#ifndef __RDC321X_MFD_H
2#define __RDC321X_MFD_H
3
4#include <linux/types.h>
5#include <linux/pci.h>
6
7/* Offsets to be accessed in the southbridge PCI
8 * device configuration register */
9#define RDC321X_WDT_CTRL 0x44
10#define RDC321X_GPIO_CTRL_REG1 0x48
11#define RDC321X_GPIO_DATA_REG1 0x4c
12#define RDC321X_GPIO_CTRL_REG2 0x84
13#define RDC321X_GPIO_DATA_REG2 0x88
14
15#define RDC321X_MAX_GPIO 58
16
17struct rdc321x_gpio_pdata {
18 struct pci_dev *sb_pdev;
19 unsigned max_gpios;
20};
21
22struct rdc321x_wdt_pdata {
23 struct pci_dev *sb_pdev;
24};
25
26#endif /* __RDC321X_MFD_H */
diff --git a/include/linux/mfd/sh_mobile_sdhi.h b/include/linux/mfd/sh_mobile_sdhi.h
index 3bcd7163485c..49067802a6d7 100644
--- a/include/linux/mfd/sh_mobile_sdhi.h
+++ b/include/linux/mfd/sh_mobile_sdhi.h
@@ -1,7 +1,13 @@
1#ifndef __SH_MOBILE_SDHI_H__ 1#ifndef __SH_MOBILE_SDHI_H__
2#define __SH_MOBILE_SDHI_H__ 2#define __SH_MOBILE_SDHI_H__
3 3
4#include <linux/types.h>
5
4struct sh_mobile_sdhi_info { 6struct sh_mobile_sdhi_info {
7 int dma_slave_tx;
8 int dma_slave_rx;
9 unsigned long tmio_flags;
10 u32 tmio_ocr_mask; /* available MMC voltages */
5 void (*set_pwr)(struct platform_device *pdev, int state); 11 void (*set_pwr)(struct platform_device *pdev, int state);
6}; 12};
7 13
diff --git a/include/linux/mfd/tc35892.h b/include/linux/mfd/tc35892.h
new file mode 100644
index 000000000000..e47f770d3068
--- /dev/null
+++ b/include/linux/mfd/tc35892.h
@@ -0,0 +1,132 @@
1/*
2 * Copyright (C) ST-Ericsson SA 2010
3 *
4 * License Terms: GNU General Public License, version 2
5 */
6
7#ifndef __LINUX_MFD_TC35892_H
8#define __LINUX_MFD_TC35892_H
9
10#include <linux/device.h>
11
12#define TC35892_RSTCTRL_IRQRST (1 << 4)
13#define TC35892_RSTCTRL_TIMRST (1 << 3)
14#define TC35892_RSTCTRL_ROTRST (1 << 2)
15#define TC35892_RSTCTRL_KBDRST (1 << 1)
16#define TC35892_RSTCTRL_GPIRST (1 << 0)
17
18#define TC35892_IRQST 0x91
19
20#define TC35892_MANFCODE_MAGIC 0x03
21#define TC35892_MANFCODE 0x80
22#define TC35892_VERSION 0x81
23#define TC35892_IOCFG 0xA7
24
25#define TC35892_CLKMODE 0x88
26#define TC35892_CLKCFG 0x89
27#define TC35892_CLKEN 0x8A
28
29#define TC35892_RSTCTRL 0x82
30#define TC35892_EXTRSTN 0x83
31#define TC35892_RSTINTCLR 0x84
32
33#define TC35892_GPIOIS0 0xC9
34#define TC35892_GPIOIS1 0xCA
35#define TC35892_GPIOIS2 0xCB
36#define TC35892_GPIOIBE0 0xCC
37#define TC35892_GPIOIBE1 0xCD
38#define TC35892_GPIOIBE2 0xCE
39#define TC35892_GPIOIEV0 0xCF
40#define TC35892_GPIOIEV1 0xD0
41#define TC35892_GPIOIEV2 0xD1
42#define TC35892_GPIOIE0 0xD2
43#define TC35892_GPIOIE1 0xD3
44#define TC35892_GPIOIE2 0xD4
45#define TC35892_GPIORIS0 0xD6
46#define TC35892_GPIORIS1 0xD7
47#define TC35892_GPIORIS2 0xD8
48#define TC35892_GPIOMIS0 0xD9
49#define TC35892_GPIOMIS1 0xDA
50#define TC35892_GPIOMIS2 0xDB
51#define TC35892_GPIOIC0 0xDC
52#define TC35892_GPIOIC1 0xDD
53#define TC35892_GPIOIC2 0xDE
54
55#define TC35892_GPIODATA0 0xC0
56#define TC35892_GPIOMASK0 0xc1
57#define TC35892_GPIODATA1 0xC2
58#define TC35892_GPIOMASK1 0xc3
59#define TC35892_GPIODATA2 0xC4
60#define TC35892_GPIOMASK2 0xC5
61
62#define TC35892_GPIODIR0 0xC6
63#define TC35892_GPIODIR1 0xC7
64#define TC35892_GPIODIR2 0xC8
65
66#define TC35892_GPIOSYNC0 0xE6
67#define TC35892_GPIOSYNC1 0xE7
68#define TC35892_GPIOSYNC2 0xE8
69
70#define TC35892_GPIOWAKE0 0xE9
71#define TC35892_GPIOWAKE1 0xEA
72#define TC35892_GPIOWAKE2 0xEB
73
74#define TC35892_GPIOODM0 0xE0
75#define TC35892_GPIOODE0 0xE1
76#define TC35892_GPIOODM1 0xE2
77#define TC35892_GPIOODE1 0xE3
78#define TC35892_GPIOODM2 0xE4
79#define TC35892_GPIOODE2 0xE5
80
81#define TC35892_INT_GPIIRQ 0
82#define TC35892_INT_TI0IRQ 1
83#define TC35892_INT_TI1IRQ 2
84#define TC35892_INT_TI2IRQ 3
85#define TC35892_INT_ROTIRQ 5
86#define TC35892_INT_KBDIRQ 6
87#define TC35892_INT_PORIRQ 7
88
89#define TC35892_NR_INTERNAL_IRQS 8
90#define TC35892_INT_GPIO(x) (TC35892_NR_INTERNAL_IRQS + (x))
91
92struct tc35892 {
93 struct mutex lock;
94 struct device *dev;
95 struct i2c_client *i2c;
96
97 int irq_base;
98 int num_gpio;
99 struct tc35892_platform_data *pdata;
100};
101
102extern int tc35892_reg_write(struct tc35892 *tc35892, u8 reg, u8 data);
103extern int tc35892_reg_read(struct tc35892 *tc35892, u8 reg);
104extern int tc35892_block_read(struct tc35892 *tc35892, u8 reg, u8 length,
105 u8 *values);
106extern int tc35892_block_write(struct tc35892 *tc35892, u8 reg, u8 length,
107 const u8 *values);
108extern int tc35892_set_bits(struct tc35892 *tc35892, u8 reg, u8 mask, u8 val);
109
110/**
111 * struct tc35892_gpio_platform_data - TC35892 GPIO platform data
112 * @gpio_base: first gpio number assigned to TC35892. A maximum of
113 * %TC35892_NR_GPIOS GPIOs will be allocated.
114 */
115struct tc35892_gpio_platform_data {
116 int gpio_base;
117};
118
119/**
120 * struct tc35892_platform_data - TC35892 platform data
121 * @irq_base: base IRQ number. %TC35892_NR_IRQS irqs will be used.
122 * @gpio: GPIO-specific platform data
123 */
124struct tc35892_platform_data {
125 int irq_base;
126 struct tc35892_gpio_platform_data *gpio;
127};
128
129#define TC35892_NR_GPIOS 24
130#define TC35892_NR_IRQS TC35892_INT_GPIO(TC35892_NR_GPIOS)
131
132#endif
diff --git a/include/linux/mfd/tmio.h b/include/linux/mfd/tmio.h
index c3f7dff8effc..f07425bc3dcd 100644
--- a/include/linux/mfd/tmio.h
+++ b/include/linux/mfd/tmio.h
@@ -50,17 +50,28 @@
50 tmio_iowrite16((val) >> 16, (base) + ((reg + 2) << (shift))); \ 50 tmio_iowrite16((val) >> 16, (base) + ((reg + 2) << (shift))); \
51 } while (0) 51 } while (0)
52 52
53/* tmio MMC platform flags */
54#define TMIO_MMC_WRPROTECT_DISABLE (1 << 0)
55
53int tmio_core_mmc_enable(void __iomem *cnf, int shift, unsigned long base); 56int tmio_core_mmc_enable(void __iomem *cnf, int shift, unsigned long base);
54int tmio_core_mmc_resume(void __iomem *cnf, int shift, unsigned long base); 57int tmio_core_mmc_resume(void __iomem *cnf, int shift, unsigned long base);
55void tmio_core_mmc_pwr(void __iomem *cnf, int shift, int state); 58void tmio_core_mmc_pwr(void __iomem *cnf, int shift, int state);
56void tmio_core_mmc_clk_div(void __iomem *cnf, int shift, int state); 59void tmio_core_mmc_clk_div(void __iomem *cnf, int shift, int state);
57 60
61struct tmio_mmc_dma {
62 void *chan_priv_tx;
63 void *chan_priv_rx;
64};
65
58/* 66/*
59 * data for the MMC controller 67 * data for the MMC controller
60 */ 68 */
61struct tmio_mmc_data { 69struct tmio_mmc_data {
62 unsigned int hclk; 70 unsigned int hclk;
63 unsigned long capabilities; 71 unsigned long capabilities;
72 unsigned long flags;
73 u32 ocr_mask; /* available voltages */
74 struct tmio_mmc_dma *dma;
64 void (*set_pwr)(struct platform_device *host, int state); 75 void (*set_pwr)(struct platform_device *host, int state);
65 void (*set_clk_div)(struct platform_device *host, int state); 76 void (*set_clk_div)(struct platform_device *host, int state);
66}; 77};
diff --git a/include/linux/mfd/tps6507x.h b/include/linux/mfd/tps6507x.h
new file mode 100644
index 000000000000..c923e4864f55
--- /dev/null
+++ b/include/linux/mfd/tps6507x.h
@@ -0,0 +1,169 @@
1/* linux/mfd/tps6507x.h
2 *
3 * Functions to access TPS65070 power management chip.
4 *
5 * Copyright (c) 2009 RidgeRun (todd.fischer@ridgerun.com)
6 *
7 *
8 * For licencing details see kernel-base/COPYING
9 */
10
11#ifndef __LINUX_MFD_TPS6507X_H
12#define __LINUX_MFD_TPS6507X_H
13
14/*
15 * ----------------------------------------------------------------------------
16 * Registers, all 8 bits
17 * ----------------------------------------------------------------------------
18 */
19
20
21/* Register definitions */
22#define TPS6507X_REG_PPATH1 0X01
23#define TPS6507X_CHG_USB BIT(7)
24#define TPS6507X_CHG_AC BIT(6)
25#define TPS6507X_CHG_USB_PW_ENABLE BIT(5)
26#define TPS6507X_CHG_AC_PW_ENABLE BIT(4)
27#define TPS6507X_CHG_AC_CURRENT BIT(2)
28#define TPS6507X_CHG_USB_CURRENT BIT(0)
29
30#define TPS6507X_REG_INT 0X02
31#define TPS6507X_REG_MASK_AC_USB BIT(7)
32#define TPS6507X_REG_MASK_TSC BIT(6)
33#define TPS6507X_REG_MASK_PB_IN BIT(5)
34#define TPS6507X_REG_TSC_INT BIT(3)
35#define TPS6507X_REG_PB_IN_INT BIT(2)
36#define TPS6507X_REG_AC_USB_APPLIED BIT(1)
37#define TPS6507X_REG_AC_USB_REMOVED BIT(0)
38
39#define TPS6507X_REG_CHGCONFIG0 0X03
40
41#define TPS6507X_REG_CHGCONFIG1 0X04
42#define TPS6507X_CON_CTRL1_DCDC1_ENABLE BIT(4)
43#define TPS6507X_CON_CTRL1_DCDC2_ENABLE BIT(3)
44#define TPS6507X_CON_CTRL1_DCDC3_ENABLE BIT(2)
45#define TPS6507X_CON_CTRL1_LDO1_ENABLE BIT(1)
46#define TPS6507X_CON_CTRL1_LDO2_ENABLE BIT(0)
47
48#define TPS6507X_REG_CHGCONFIG2 0X05
49
50#define TPS6507X_REG_CHGCONFIG3 0X06
51
52#define TPS6507X_REG_ADCONFIG 0X07
53#define TPS6507X_ADCONFIG_AD_ENABLE BIT(7)
54#define TPS6507X_ADCONFIG_START_CONVERSION BIT(6)
55#define TPS6507X_ADCONFIG_CONVERSION_DONE BIT(5)
56#define TPS6507X_ADCONFIG_VREF_ENABLE BIT(4)
57#define TPS6507X_ADCONFIG_INPUT_AD_IN1 0
58#define TPS6507X_ADCONFIG_INPUT_AD_IN2 1
59#define TPS6507X_ADCONFIG_INPUT_AD_IN3 2
60#define TPS6507X_ADCONFIG_INPUT_AD_IN4 3
61#define TPS6507X_ADCONFIG_INPUT_TS_PIN 4
62#define TPS6507X_ADCONFIG_INPUT_BAT_CURRENT 5
63#define TPS6507X_ADCONFIG_INPUT_AC_VOLTAGE 6
64#define TPS6507X_ADCONFIG_INPUT_SYS_VOLTAGE 7
65#define TPS6507X_ADCONFIG_INPUT_CHARGER_VOLTAGE 8
66#define TPS6507X_ADCONFIG_INPUT_BAT_VOLTAGE 9
67#define TPS6507X_ADCONFIG_INPUT_THRESHOLD_VOLTAGE 10
68#define TPS6507X_ADCONFIG_INPUT_ISET1_VOLTAGE 11
69#define TPS6507X_ADCONFIG_INPUT_ISET2_VOLTAGE 12
70#define TPS6507X_ADCONFIG_INPUT_REAL_TSC 14
71#define TPS6507X_ADCONFIG_INPUT_TSC 15
72
73#define TPS6507X_REG_TSCMODE 0X08
74#define TPS6507X_TSCMODE_X_POSITION 0
75#define TPS6507X_TSCMODE_Y_POSITION 1
76#define TPS6507X_TSCMODE_PRESSURE 2
77#define TPS6507X_TSCMODE_X_PLATE 3
78#define TPS6507X_TSCMODE_Y_PLATE 4
79#define TPS6507X_TSCMODE_STANDBY 5
80#define TPS6507X_TSCMODE_ADC_INPUT 6
81#define TPS6507X_TSCMODE_DISABLE 7
82
83#define TPS6507X_REG_ADRESULT_1 0X09
84
85#define TPS6507X_REG_ADRESULT_2 0X0A
86#define TPS6507X_REG_ADRESULT_2_MASK (BIT(1) | BIT(0))
87
88#define TPS6507X_REG_PGOOD 0X0B
89
90#define TPS6507X_REG_PGOODMASK 0X0C
91
92#define TPS6507X_REG_CON_CTRL1 0X0D
93#define TPS6507X_CON_CTRL1_DCDC1_ENABLE BIT(4)
94#define TPS6507X_CON_CTRL1_DCDC2_ENABLE BIT(3)
95#define TPS6507X_CON_CTRL1_DCDC3_ENABLE BIT(2)
96#define TPS6507X_CON_CTRL1_LDO1_ENABLE BIT(1)
97#define TPS6507X_CON_CTRL1_LDO2_ENABLE BIT(0)
98
99#define TPS6507X_REG_CON_CTRL2 0X0E
100
101#define TPS6507X_REG_CON_CTRL3 0X0F
102
103#define TPS6507X_REG_DEFDCDC1 0X10
104#define TPS6507X_DEFDCDC1_DCDC1_EXT_ADJ_EN BIT(7)
105#define TPS6507X_DEFDCDC1_DCDC1_MASK 0X3F
106
107#define TPS6507X_REG_DEFDCDC2_LOW 0X11
108#define TPS6507X_DEFDCDC2_LOW_DCDC2_MASK 0X3F
109
110#define TPS6507X_REG_DEFDCDC2_HIGH 0X12
111#define TPS6507X_DEFDCDC2_HIGH_DCDC2_MASK 0X3F
112
113#define TPS6507X_REG_DEFDCDC3_LOW 0X13
114#define TPS6507X_DEFDCDC3_LOW_DCDC3_MASK 0X3F
115
116#define TPS6507X_REG_DEFDCDC3_HIGH 0X14
117#define TPS6507X_DEFDCDC3_HIGH_DCDC3_MASK 0X3F
118
119#define TPS6507X_REG_DEFSLEW 0X15
120
121#define TPS6507X_REG_LDO_CTRL1 0X16
122#define TPS6507X_REG_LDO_CTRL1_LDO1_MASK 0X0F
123
124#define TPS6507X_REG_DEFLDO2 0X17
125#define TPS6507X_REG_DEFLDO2_LDO2_MASK 0X3F
126
127#define TPS6507X_REG_WLED_CTRL1 0X18
128
129#define TPS6507X_REG_WLED_CTRL2 0X19
130
131/* VDCDC MASK */
132#define TPS6507X_DEFDCDCX_DCDC_MASK 0X3F
133
134#define TPS6507X_MAX_REGISTER 0X19
135
136/**
137 * struct tps6507x_board - packages regulator and touchscreen init data
138 * @tps6507x_regulator_data: regulator initialization values
139 *
140 * Board data may be used to initialize regulator and touchscreen.
141 */
142
143struct tps6507x_board {
144 struct regulator_init_data *tps6507x_pmic_init_data;
145 struct touchscreen_init_data *tps6507x_ts_init_data;
146};
147
148/**
149 * struct tps6507x_dev - tps6507x sub-driver chip access routines
150 * @read_dev() - I2C register read function
151 * @write_dev() - I2C register write function
152 *
153 * Device data may be used to access the TPS6507x chip
154 */
155
156struct tps6507x_dev {
157 struct device *dev;
158 struct i2c_client *i2c_client;
159 int (*read_dev)(struct tps6507x_dev *tps6507x, char reg, int size,
160 void *dest);
161 int (*write_dev)(struct tps6507x_dev *tps6507x, char reg, int size,
162 void *src);
163
164 /* Client devices */
165 struct tps6507x_pmic *pmic;
166 struct tps6507x_ts *ts;
167};
168
169#endif /* __LINUX_MFD_TPS6507X_H */
diff --git a/include/linux/mfd/wm831x/core.h b/include/linux/mfd/wm831x/core.h
index 5915f6e3d9ab..eb5bd4e0e03c 100644
--- a/include/linux/mfd/wm831x/core.h
+++ b/include/linux/mfd/wm831x/core.h
@@ -256,8 +256,9 @@ struct wm831x {
256 int irq_masks_cache[WM831X_NUM_IRQ_REGS]; /* Cached hardware value */ 256 int irq_masks_cache[WM831X_NUM_IRQ_REGS]; /* Cached hardware value */
257 257
258 /* Chip revision based flags */ 258 /* Chip revision based flags */
259 unsigned has_gpio_ena:1; /* Has GPIO enable bit */ 259 unsigned has_gpio_ena:1; /* Has GPIO enable bit */
260 unsigned has_cs_sts:1; /* Has current sink status bit */ 260 unsigned has_cs_sts:1; /* Has current sink status bit */
261 unsigned charger_irq_wake:1; /* Are charger IRQs a wake source? */
261 262
262 int num_gpio; 263 int num_gpio;
263 264
diff --git a/include/linux/mfd/wm8350/audio.h b/include/linux/mfd/wm8350/audio.h
index d899dc0223ba..a95141eafce3 100644
--- a/include/linux/mfd/wm8350/audio.h
+++ b/include/linux/mfd/wm8350/audio.h
@@ -492,6 +492,8 @@
492 */ 492 */
493#define WM8350_JACK_L_LVL 0x0800 493#define WM8350_JACK_L_LVL 0x0800
494#define WM8350_JACK_R_LVL 0x0400 494#define WM8350_JACK_R_LVL 0x0400
495#define WM8350_JACK_MICSCD_LVL 0x0200
496#define WM8350_JACK_MICSD_LVL 0x0100
495 497
496/* 498/*
497 * WM8350 Platform setup 499 * WM8350 Platform setup
diff --git a/include/linux/mfd/wm8994/core.h b/include/linux/mfd/wm8994/core.h
index b06ff2846748..de79baee4925 100644
--- a/include/linux/mfd/wm8994/core.h
+++ b/include/linux/mfd/wm8994/core.h
@@ -15,14 +15,38 @@
15#ifndef __MFD_WM8994_CORE_H__ 15#ifndef __MFD_WM8994_CORE_H__
16#define __MFD_WM8994_CORE_H__ 16#define __MFD_WM8994_CORE_H__
17 17
18#include <linux/interrupt.h>
19
18struct regulator_dev; 20struct regulator_dev;
19struct regulator_bulk_data; 21struct regulator_bulk_data;
20 22
21#define WM8994_NUM_GPIO_REGS 11 23#define WM8994_NUM_GPIO_REGS 11
22#define WM8994_NUM_LDO_REGS 2 24#define WM8994_NUM_LDO_REGS 2
25#define WM8994_NUM_IRQ_REGS 2
26
27#define WM8994_IRQ_TEMP_SHUT 0
28#define WM8994_IRQ_MIC1_DET 1
29#define WM8994_IRQ_MIC1_SHRT 2
30#define WM8994_IRQ_MIC2_DET 3
31#define WM8994_IRQ_MIC2_SHRT 4
32#define WM8994_IRQ_FLL1_LOCK 5
33#define WM8994_IRQ_FLL2_LOCK 6
34#define WM8994_IRQ_SRC1_LOCK 7
35#define WM8994_IRQ_SRC2_LOCK 8
36#define WM8994_IRQ_AIF1DRC1_SIG_DET 9
37#define WM8994_IRQ_AIF1DRC2_SIG_DET 10
38#define WM8994_IRQ_AIF2DRC_SIG_DET 11
39#define WM8994_IRQ_FIFOS_ERR 12
40#define WM8994_IRQ_WSEQ_DONE 13
41#define WM8994_IRQ_DCS_DONE 14
42#define WM8994_IRQ_TEMP_WARN 15
43
44/* GPIOs in the chip are numbered from 1-11 */
45#define WM8994_IRQ_GPIO(x) (x + WM8994_IRQ_TEMP_WARN)
23 46
24struct wm8994 { 47struct wm8994 {
25 struct mutex io_lock; 48 struct mutex io_lock;
49 struct mutex irq_lock;
26 50
27 struct device *dev; 51 struct device *dev;
28 int (*read_dev)(struct wm8994 *wm8994, unsigned short reg, 52 int (*read_dev)(struct wm8994 *wm8994, unsigned short reg,
@@ -33,6 +57,11 @@ struct wm8994 {
33 void *control_data; 57 void *control_data;
34 58
35 int gpio_base; 59 int gpio_base;
60 int irq_base;
61
62 int irq;
63 u16 irq_masks_cur[WM8994_NUM_IRQ_REGS];
64 u16 irq_masks_cache[WM8994_NUM_IRQ_REGS];
36 65
37 /* Used over suspend/resume */ 66 /* Used over suspend/resume */
38 u16 ldo_regs[WM8994_NUM_LDO_REGS]; 67 u16 ldo_regs[WM8994_NUM_LDO_REGS];
@@ -51,4 +80,26 @@ int wm8994_set_bits(struct wm8994 *wm8994, unsigned short reg,
51int wm8994_bulk_read(struct wm8994 *wm8994, unsigned short reg, 80int wm8994_bulk_read(struct wm8994 *wm8994, unsigned short reg,
52 int count, u16 *buf); 81 int count, u16 *buf);
53 82
83
84/* Helper to save on boilerplate */
85static inline int wm8994_request_irq(struct wm8994 *wm8994, int irq,
86 irq_handler_t handler, const char *name,
87 void *data)
88{
89 if (!wm8994->irq_base)
90 return -EINVAL;
91 return request_threaded_irq(wm8994->irq_base + irq, NULL, handler,
92 IRQF_TRIGGER_RISING, name,
93 data);
94}
95static inline void wm8994_free_irq(struct wm8994 *wm8994, int irq, void *data)
96{
97 if (!wm8994->irq_base)
98 return;
99 free_irq(wm8994->irq_base + irq, data);
100}
101
102int wm8994_irq_init(struct wm8994 *wm8994);
103void wm8994_irq_exit(struct wm8994 *wm8994);
104
54#endif 105#endif
diff --git a/include/linux/mfd/wm8994/pdata.h b/include/linux/mfd/wm8994/pdata.h
index 70d6a8687dc5..5c51f367c061 100644
--- a/include/linux/mfd/wm8994/pdata.h
+++ b/include/linux/mfd/wm8994/pdata.h
@@ -70,6 +70,7 @@ struct wm8994_pdata {
70 70
71 struct wm8994_ldo_pdata ldo[WM8994_NUM_LDO]; 71 struct wm8994_ldo_pdata ldo[WM8994_NUM_LDO];
72 72
73 int irq_base; /** Base IRQ number for WM8994, required for IRQs */
73 74
74 int num_drc_cfgs; 75 int num_drc_cfgs;
75 struct wm8994_drc_cfg *drc_cfgs; 76 struct wm8994_drc_cfg *drc_cfgs;
diff --git a/include/linux/migrate.h b/include/linux/migrate.h
index 7f085c97c799..7238231b8dd4 100644
--- a/include/linux/migrate.h
+++ b/include/linux/migrate.h
@@ -9,7 +9,7 @@ typedef struct page *new_page_t(struct page *, unsigned long private, int **);
9#ifdef CONFIG_MIGRATION 9#ifdef CONFIG_MIGRATION
10#define PAGE_MIGRATION 1 10#define PAGE_MIGRATION 1
11 11
12extern int putback_lru_pages(struct list_head *l); 12extern void putback_lru_pages(struct list_head *l);
13extern int migrate_page(struct address_space *, 13extern int migrate_page(struct address_space *,
14 struct page *, struct page *); 14 struct page *, struct page *);
15extern int migrate_pages(struct list_head *l, new_page_t x, 15extern int migrate_pages(struct list_head *l, new_page_t x,
@@ -19,17 +19,19 @@ extern int fail_migrate_page(struct address_space *,
19 struct page *, struct page *); 19 struct page *, struct page *);
20 20
21extern int migrate_prep(void); 21extern int migrate_prep(void);
22extern int migrate_prep_local(void);
22extern int migrate_vmas(struct mm_struct *mm, 23extern int migrate_vmas(struct mm_struct *mm,
23 const nodemask_t *from, const nodemask_t *to, 24 const nodemask_t *from, const nodemask_t *to,
24 unsigned long flags); 25 unsigned long flags);
25#else 26#else
26#define PAGE_MIGRATION 0 27#define PAGE_MIGRATION 0
27 28
28static inline int putback_lru_pages(struct list_head *l) { return 0; } 29static inline void putback_lru_pages(struct list_head *l) {}
29static inline int migrate_pages(struct list_head *l, new_page_t x, 30static inline int migrate_pages(struct list_head *l, new_page_t x,
30 unsigned long private, int offlining) { return -ENOSYS; } 31 unsigned long private, int offlining) { return -ENOSYS; }
31 32
32static inline int migrate_prep(void) { return -ENOSYS; } 33static inline int migrate_prep(void) { return -ENOSYS; }
34static inline int migrate_prep_local(void) { return -ENOSYS; }
33 35
34static inline int migrate_vmas(struct mm_struct *mm, 36static inline int migrate_vmas(struct mm_struct *mm,
35 const nodemask_t *from, const nodemask_t *to, 37 const nodemask_t *from, const nodemask_t *to,
diff --git a/include/linux/miscdevice.h b/include/linux/miscdevice.h
index 8b5f7cc0fba6..b631c46cffd9 100644
--- a/include/linux/miscdevice.h
+++ b/include/linux/miscdevice.h
@@ -31,6 +31,8 @@
31#define FUSE_MINOR 229 31#define FUSE_MINOR 229
32#define KVM_MINOR 232 32#define KVM_MINOR 232
33#define VHOST_NET_MINOR 233 33#define VHOST_NET_MINOR 233
34#define BTRFS_MINOR 234
35#define AUTOFS_MINOR 235
34#define MISC_DYNAMIC_MINOR 255 36#define MISC_DYNAMIC_MINOR 255
35 37
36struct device; 38struct device;
diff --git a/include/linux/mlx4/device.h b/include/linux/mlx4/device.h
index e92d1bfdb330..7a7f9c1e679a 100644
--- a/include/linux/mlx4/device.h
+++ b/include/linux/mlx4/device.h
@@ -123,8 +123,8 @@ enum {
123 MLX4_OPCODE_RDMA_READ = 0x10, 123 MLX4_OPCODE_RDMA_READ = 0x10,
124 MLX4_OPCODE_ATOMIC_CS = 0x11, 124 MLX4_OPCODE_ATOMIC_CS = 0x11,
125 MLX4_OPCODE_ATOMIC_FA = 0x12, 125 MLX4_OPCODE_ATOMIC_FA = 0x12,
126 MLX4_OPCODE_ATOMIC_MASK_CS = 0x14, 126 MLX4_OPCODE_MASKED_ATOMIC_CS = 0x14,
127 MLX4_OPCODE_ATOMIC_MASK_FA = 0x15, 127 MLX4_OPCODE_MASKED_ATOMIC_FA = 0x15,
128 MLX4_OPCODE_BIND_MW = 0x18, 128 MLX4_OPCODE_BIND_MW = 0x18,
129 MLX4_OPCODE_FMR = 0x19, 129 MLX4_OPCODE_FMR = 0x19,
130 MLX4_OPCODE_LOCAL_INVAL = 0x1b, 130 MLX4_OPCODE_LOCAL_INVAL = 0x1b,
diff --git a/include/linux/mlx4/qp.h b/include/linux/mlx4/qp.h
index 9f29d86e5dc9..7abe64326f72 100644
--- a/include/linux/mlx4/qp.h
+++ b/include/linux/mlx4/qp.h
@@ -285,6 +285,13 @@ struct mlx4_wqe_atomic_seg {
285 __be64 compare; 285 __be64 compare;
286}; 286};
287 287
288struct mlx4_wqe_masked_atomic_seg {
289 __be64 swap_add;
290 __be64 compare;
291 __be64 swap_add_mask;
292 __be64 compare_mask;
293};
294
288struct mlx4_wqe_data_seg { 295struct mlx4_wqe_data_seg {
289 __be32 byte_count; 296 __be32 byte_count;
290 __be32 lkey; 297 __be32 lkey;
diff --git a/include/linux/mm.h b/include/linux/mm.h
index 462acaf36f3a..b969efb03787 100644
--- a/include/linux/mm.h
+++ b/include/linux/mm.h
@@ -13,13 +13,13 @@
13#include <linux/debug_locks.h> 13#include <linux/debug_locks.h>
14#include <linux/mm_types.h> 14#include <linux/mm_types.h>
15#include <linux/range.h> 15#include <linux/range.h>
16#include <linux/pfn.h>
16 17
17struct mempolicy; 18struct mempolicy;
18struct anon_vma; 19struct anon_vma;
19struct file_ra_state; 20struct file_ra_state;
20struct user_struct; 21struct user_struct;
21struct writeback_control; 22struct writeback_control;
22struct rlimit;
23 23
24#ifndef CONFIG_DISCONTIGMEM /* Don't use mapnrs, do it properly */ 24#ifndef CONFIG_DISCONTIGMEM /* Don't use mapnrs, do it properly */
25extern unsigned long max_mapnr; 25extern unsigned long max_mapnr;
@@ -107,6 +107,9 @@ extern unsigned int kobjsize(const void *objp);
107#define VM_PFN_AT_MMAP 0x40000000 /* PFNMAP vma that is fully mapped at mmap time */ 107#define VM_PFN_AT_MMAP 0x40000000 /* PFNMAP vma that is fully mapped at mmap time */
108#define VM_MERGEABLE 0x80000000 /* KSM may merge identical pages */ 108#define VM_MERGEABLE 0x80000000 /* KSM may merge identical pages */
109 109
110/* Bits set in the VMA until the stack is in its final location */
111#define VM_STACK_INCOMPLETE_SETUP (VM_RAND_READ | VM_SEQ_READ)
112
110#ifndef VM_STACK_DEFAULT_FLAGS /* arch can override this */ 113#ifndef VM_STACK_DEFAULT_FLAGS /* arch can override this */
111#define VM_STACK_DEFAULT_FLAGS VM_DATA_DEFAULT_FLAGS 114#define VM_STACK_DEFAULT_FLAGS VM_DATA_DEFAULT_FLAGS
112#endif 115#endif
@@ -335,6 +338,7 @@ void put_page(struct page *page);
335void put_pages_list(struct list_head *pages); 338void put_pages_list(struct list_head *pages);
336 339
337void split_page(struct page *page, unsigned int order); 340void split_page(struct page *page, unsigned int order);
341int split_free_page(struct page *page);
338 342
339/* 343/*
340 * Compound pages have a destructor function. Provide a 344 * Compound pages have a destructor function. Provide a
@@ -592,7 +596,7 @@ static inline void set_page_links(struct page *page, enum zone_type zone,
592 596
593static __always_inline void *lowmem_page_address(struct page *page) 597static __always_inline void *lowmem_page_address(struct page *page)
594{ 598{
595 return __va(page_to_pfn(page) << PAGE_SHIFT); 599 return __va(PFN_PHYS(page_to_pfn(page)));
596} 600}
597 601
598#if defined(CONFIG_HIGHMEM) && !defined(WANT_PAGE_VIRTUAL) 602#if defined(CONFIG_HIGHMEM) && !defined(WANT_PAGE_VIRTUAL)
@@ -1449,9 +1453,6 @@ int vmemmap_populate_basepages(struct page *start_page,
1449int vmemmap_populate(struct page *start_page, unsigned long pages, int node); 1453int vmemmap_populate(struct page *start_page, unsigned long pages, int node);
1450void vmemmap_populate_print_last(void); 1454void vmemmap_populate_print_last(void);
1451 1455
1452extern int account_locked_memory(struct mm_struct *mm, struct rlimit *rlim,
1453 size_t size);
1454extern void refund_locked_memory(struct mm_struct *mm, size_t size);
1455 1456
1456enum mf_flags { 1457enum mf_flags {
1457 MF_COUNT_INCREASED = 1 << 0, 1458 MF_COUNT_INCREASED = 1 << 0,
diff --git a/include/linux/mmc/host.h b/include/linux/mmc/host.h
index 43eaf5ca5848..f65913c9f5a4 100644
--- a/include/linux/mmc/host.h
+++ b/include/linux/mmc/host.h
@@ -108,6 +108,9 @@ struct mmc_host_ops {
108 int (*get_cd)(struct mmc_host *host); 108 int (*get_cd)(struct mmc_host *host);
109 109
110 void (*enable_sdio_irq)(struct mmc_host *host, int enable); 110 void (*enable_sdio_irq)(struct mmc_host *host, int enable);
111
112 /* optional callback for HC quirks */
113 void (*init_card)(struct mmc_host *host, struct mmc_card *card);
111}; 114};
112 115
113struct mmc_card; 116struct mmc_card;
@@ -227,7 +230,7 @@ static inline void *mmc_priv(struct mmc_host *host)
227#define mmc_classdev(x) (&(x)->class_dev) 230#define mmc_classdev(x) (&(x)->class_dev)
228#define mmc_hostname(x) (dev_name(&(x)->class_dev)) 231#define mmc_hostname(x) (dev_name(&(x)->class_dev))
229 232
230extern int mmc_suspend_host(struct mmc_host *, pm_message_t); 233extern int mmc_suspend_host(struct mmc_host *);
231extern int mmc_resume_host(struct mmc_host *); 234extern int mmc_resume_host(struct mmc_host *);
232 235
233extern void mmc_power_save_host(struct mmc_host *host); 236extern void mmc_power_save_host(struct mmc_host *host);
diff --git a/include/linux/mmc/sdhci-spear.h b/include/linux/mmc/sdhci-spear.h
new file mode 100644
index 000000000000..9188c973f3e1
--- /dev/null
+++ b/include/linux/mmc/sdhci-spear.h
@@ -0,0 +1,42 @@
1/*
2 * include/linux/mmc/sdhci-spear.h
3 *
4 * SDHCI declarations specific to ST SPEAr platform
5 *
6 * Copyright (C) 2010 ST Microelectronics
7 * Viresh Kumar<viresh.kumar@st.com>
8 *
9 * This file is licensed under the terms of the GNU General Public
10 * License version 2. This program is licensed "as is" without any
11 * warranty of any kind, whether express or implied.
12 */
13
14#ifndef MMC_SDHCI_SPEAR_H
15#define MMC_SDHCI_SPEAR_H
16
17#include <linux/platform_device.h>
18/*
19 * struct sdhci_plat_data: spear sdhci platform data structure
20 *
21 * @card_power_gpio: gpio pin for enabling/disabling power to sdhci socket
22 * @power_active_high: if set, enable power to sdhci socket by setting
23 * card_power_gpio
24 * @power_always_enb: If set, then enable power on probe, otherwise enable only
25 * on card insertion and disable on card removal.
26 * card_int_gpio: gpio pin used for card detection
27 */
28struct sdhci_plat_data {
29 int card_power_gpio;
30 int power_active_high;
31 int power_always_enb;
32 int card_int_gpio;
33};
34
35/* This function is used to set platform_data field of pdev->dev */
36static inline void
37sdhci_set_plat_data(struct platform_device *pdev, struct sdhci_plat_data *data)
38{
39 pdev->dev.platform_data = data;
40}
41
42#endif /* MMC_SDHCI_SPEAR_H */
diff --git a/include/linux/mmc/sdio_func.h b/include/linux/mmc/sdio_func.h
index c6c0cceba5fe..31baaf82f458 100644
--- a/include/linux/mmc/sdio_func.h
+++ b/include/linux/mmc/sdio_func.h
@@ -145,6 +145,9 @@ extern void sdio_writew(struct sdio_func *func, u16 b,
145extern void sdio_writel(struct sdio_func *func, u32 b, 145extern void sdio_writel(struct sdio_func *func, u32 b,
146 unsigned int addr, int *err_ret); 146 unsigned int addr, int *err_ret);
147 147
148extern u8 sdio_writeb_readb(struct sdio_func *func, u8 write_byte,
149 unsigned int addr, int *err_ret);
150
148extern int sdio_memcpy_toio(struct sdio_func *func, unsigned int addr, 151extern int sdio_memcpy_toio(struct sdio_func *func, unsigned int addr,
149 void *src, int count); 152 void *src, int count);
150extern int sdio_writesb(struct sdio_func *func, unsigned int addr, 153extern int sdio_writesb(struct sdio_func *func, unsigned int addr,
diff --git a/include/linux/mmc/sh_mmcif.h b/include/linux/mmc/sh_mmcif.h
new file mode 100644
index 000000000000..aafe832f18aa
--- /dev/null
+++ b/include/linux/mmc/sh_mmcif.h
@@ -0,0 +1,39 @@
1/*
2 * include/linux/mmc/sh_mmcif.h
3 *
4 * platform data for eMMC driver
5 *
6 * Copyright (C) 2010 Renesas Solutions Corp.
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.
11 *
12 */
13
14#ifndef __SH_MMCIF_H__
15#define __SH_MMCIF_H__
16
17/*
18 * MMCIF : CE_CLK_CTRL [19:16]
19 * 1000 : Peripheral clock / 512
20 * 0111 : Peripheral clock / 256
21 * 0110 : Peripheral clock / 128
22 * 0101 : Peripheral clock / 64
23 * 0100 : Peripheral clock / 32
24 * 0011 : Peripheral clock / 16
25 * 0010 : Peripheral clock / 8
26 * 0001 : Peripheral clock / 4
27 * 0000 : Peripheral clock / 2
28 * 1111 : Peripheral clock (sup_pclk set '1')
29 */
30
31struct sh_mmcif_plat_data {
32 void (*set_pwr)(struct platform_device *pdev, int state);
33 void (*down_pwr)(struct platform_device *pdev);
34 u8 sup_pclk; /* 1 :SH7757, 0: SH7724/SH7372 */
35 unsigned long caps;
36 u32 ocr;
37};
38
39#endif /* __SH_MMCIF_H__ */
diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h
index cf9e458e96b0..b4d109e389b8 100644
--- a/include/linux/mmzone.h
+++ b/include/linux/mmzone.h
@@ -321,6 +321,15 @@ struct zone {
321 unsigned long *pageblock_flags; 321 unsigned long *pageblock_flags;
322#endif /* CONFIG_SPARSEMEM */ 322#endif /* CONFIG_SPARSEMEM */
323 323
324#ifdef CONFIG_COMPACTION
325 /*
326 * On compaction failure, 1<<compact_defer_shift compactions
327 * are skipped before trying again. The number attempted since
328 * last failure is tracked with compact_considered.
329 */
330 unsigned int compact_considered;
331 unsigned int compact_defer_shift;
332#endif
324 333
325 ZONE_PADDING(_pad1_) 334 ZONE_PADDING(_pad1_)
326 335
@@ -641,9 +650,10 @@ typedef struct pglist_data {
641 650
642#include <linux/memory_hotplug.h> 651#include <linux/memory_hotplug.h>
643 652
653extern struct mutex zonelists_mutex;
644void get_zone_counts(unsigned long *active, unsigned long *inactive, 654void get_zone_counts(unsigned long *active, unsigned long *inactive,
645 unsigned long *free); 655 unsigned long *free);
646void build_all_zonelists(void); 656void build_all_zonelists(void *data);
647void wakeup_kswapd(struct zone *zone, int order); 657void wakeup_kswapd(struct zone *zone, int order);
648int zone_watermark_ok(struct zone *z, int order, unsigned long mark, 658int zone_watermark_ok(struct zone *z, int order, unsigned long mark,
649 int classzone_idx, int alloc_flags); 659 int classzone_idx, int alloc_flags);
@@ -661,6 +671,12 @@ void memory_present(int nid, unsigned long start, unsigned long end);
661static inline void memory_present(int nid, unsigned long start, unsigned long end) {} 671static inline void memory_present(int nid, unsigned long start, unsigned long end) {}
662#endif 672#endif
663 673
674#ifdef CONFIG_HAVE_MEMORYLESS_NODES
675int local_memory_node(int node_id);
676#else
677static inline int local_memory_node(int node_id) { return node_id; };
678#endif
679
664#ifdef CONFIG_NEED_NODE_MEMMAP_SIZE 680#ifdef CONFIG_NEED_NODE_MEMMAP_SIZE
665unsigned long __init node_memmap_size_bytes(int, unsigned long, unsigned long); 681unsigned long __init node_memmap_size_bytes(int, unsigned long, unsigned long);
666#endif 682#endif
@@ -972,7 +988,7 @@ struct mem_section {
972#endif 988#endif
973 989
974#define SECTION_NR_TO_ROOT(sec) ((sec) / SECTIONS_PER_ROOT) 990#define SECTION_NR_TO_ROOT(sec) ((sec) / SECTIONS_PER_ROOT)
975#define NR_SECTION_ROOTS (NR_MEM_SECTIONS / SECTIONS_PER_ROOT) 991#define NR_SECTION_ROOTS DIV_ROUND_UP(NR_MEM_SECTIONS, SECTIONS_PER_ROOT)
976#define SECTION_ROOT_MASK (SECTIONS_PER_ROOT - 1) 992#define SECTION_ROOT_MASK (SECTIONS_PER_ROOT - 1)
977 993
978#ifdef CONFIG_SPARSEMEM_EXTREME 994#ifdef CONFIG_SPARSEMEM_EXTREME
diff --git a/include/linux/mod_devicetable.h b/include/linux/mod_devicetable.h
index 55f1f9c9506c..48c007dae476 100644
--- a/include/linux/mod_devicetable.h
+++ b/include/linux/mod_devicetable.h
@@ -500,4 +500,20 @@ struct mdio_device_id {
500 __u32 phy_id_mask; 500 __u32 phy_id_mask;
501}; 501};
502 502
503struct zorro_device_id {
504 __u32 id; /* Device ID or ZORRO_WILDCARD */
505 kernel_ulong_t driver_data; /* Data private to the driver */
506};
507
508#define ZORRO_WILDCARD (0xffffffff) /* not official */
509
510#define ZORRO_DEVICE_MODALIAS_FMT "zorro:i%08X"
511
512#define ISAPNP_ANY_ID 0xffff
513struct isapnp_device_id {
514 unsigned short card_vendor, card_device;
515 unsigned short vendor, function;
516 kernel_ulong_t driver_data; /* data private to the driver */
517};
518
503#endif /* LINUX_MOD_DEVICETABLE_H */ 519#endif /* LINUX_MOD_DEVICETABLE_H */
diff --git a/include/linux/module.h b/include/linux/module.h
index 515d53ae6a79..6914fcad4673 100644
--- a/include/linux/module.h
+++ b/include/linux/module.h
@@ -465,8 +465,7 @@ static inline void __module_get(struct module *module)
465 if (module) { 465 if (module) {
466 preempt_disable(); 466 preempt_disable();
467 __this_cpu_inc(module->refptr->incs); 467 __this_cpu_inc(module->refptr->incs);
468 trace_module_get(module, _THIS_IP_, 468 trace_module_get(module, _THIS_IP_);
469 __this_cpu_read(module->refptr->incs));
470 preempt_enable(); 469 preempt_enable();
471 } 470 }
472} 471}
@@ -480,8 +479,7 @@ static inline int try_module_get(struct module *module)
480 479
481 if (likely(module_is_live(module))) { 480 if (likely(module_is_live(module))) {
482 __this_cpu_inc(module->refptr->incs); 481 __this_cpu_inc(module->refptr->incs);
483 trace_module_get(module, _THIS_IP_, 482 trace_module_get(module, _THIS_IP_);
484 __this_cpu_read(module->refptr->incs));
485 } else 483 } else
486 ret = 0; 484 ret = 0;
487 485
diff --git a/include/linux/mroute6.h b/include/linux/mroute6.h
index 2caa1a8e525d..6091ab77f388 100644
--- a/include/linux/mroute6.h
+++ b/include/linux/mroute6.h
@@ -24,7 +24,8 @@
24#define MRT6_DEL_MFC (MRT6_BASE+5) /* Delete a multicast forwarding entry */ 24#define MRT6_DEL_MFC (MRT6_BASE+5) /* Delete a multicast forwarding entry */
25#define MRT6_VERSION (MRT6_BASE+6) /* Get the kernel multicast version */ 25#define MRT6_VERSION (MRT6_BASE+6) /* Get the kernel multicast version */
26#define MRT6_ASSERT (MRT6_BASE+7) /* Activate PIM assert mode */ 26#define MRT6_ASSERT (MRT6_BASE+7) /* Activate PIM assert mode */
27#define MRT6_PIM (MRT6_BASE+8) /* enable PIM code */ 27#define MRT6_PIM (MRT6_BASE+8) /* enable PIM code */
28#define MRT6_TABLE (MRT6_BASE+9) /* Specify mroute table ID */
28 29
29#define SIOCGETMIFCNT_IN6 SIOCPROTOPRIVATE /* IP protocol privates */ 30#define SIOCGETMIFCNT_IN6 SIOCPROTOPRIVATE /* IP protocol privates */
30#define SIOCGETSGCNT_IN6 (SIOCPROTOPRIVATE+1) 31#define SIOCGETSGCNT_IN6 (SIOCPROTOPRIVATE+1)
@@ -182,10 +183,7 @@ struct mif_device {
182#define VIFF_STATIC 0x8000 183#define VIFF_STATIC 0x8000
183 184
184struct mfc6_cache { 185struct mfc6_cache {
185 struct mfc6_cache *next; /* Next entry on cache line */ 186 struct list_head list;
186#ifdef CONFIG_NET_NS
187 struct net *mfc6_net;
188#endif
189 struct in6_addr mf6c_mcastgrp; /* Group the entry belongs to */ 187 struct in6_addr mf6c_mcastgrp; /* Group the entry belongs to */
190 struct in6_addr mf6c_origin; /* Source of packet */ 188 struct in6_addr mf6c_origin; /* Source of packet */
191 mifi_t mf6c_parent; /* Source interface */ 189 mifi_t mf6c_parent; /* Source interface */
@@ -208,18 +206,6 @@ struct mfc6_cache {
208 } mfc_un; 206 } mfc_un;
209}; 207};
210 208
211static inline
212struct net *mfc6_net(const struct mfc6_cache *mfc)
213{
214 return read_pnet(&mfc->mfc6_net);
215}
216
217static inline
218void mfc6_net_set(struct mfc6_cache *mfc, struct net *net)
219{
220 write_pnet(&mfc->mfc6_net, hold_net(net));
221}
222
223#define MFC_STATIC 1 209#define MFC_STATIC 1
224#define MFC_NOTIFY 2 210#define MFC_NOTIFY 2
225 211
@@ -244,14 +230,17 @@ extern int ip6mr_get_route(struct net *net, struct sk_buff *skb,
244 struct rtmsg *rtm, int nowait); 230 struct rtmsg *rtm, int nowait);
245 231
246#ifdef CONFIG_IPV6_MROUTE 232#ifdef CONFIG_IPV6_MROUTE
247static inline struct sock *mroute6_socket(struct net *net) 233extern struct sock *mroute6_socket(struct net *net, struct sk_buff *skb);
248{
249 return net->ipv6.mroute6_sk;
250}
251extern int ip6mr_sk_done(struct sock *sk); 234extern int ip6mr_sk_done(struct sock *sk);
252#else 235#else
253static inline struct sock *mroute6_socket(struct net *net) { return NULL; } 236static inline struct sock *mroute6_socket(struct net *net, struct sk_buff *skb)
254static inline int ip6mr_sk_done(struct sock *sk) { return 0; } 237{
238 return NULL;
239}
240static inline int ip6mr_sk_done(struct sock *sk)
241{
242 return 0;
243}
255#endif 244#endif
256#endif 245#endif
257 246
diff --git a/include/linux/msm_mdp.h b/include/linux/msm_mdp.h
new file mode 100644
index 000000000000..d11fe0f2f956
--- /dev/null
+++ b/include/linux/msm_mdp.h
@@ -0,0 +1,78 @@
1/* include/linux/msm_mdp.h
2 *
3 * Copyright (C) 2007 Google Incorporated
4 *
5 * This software is licensed under the terms of the GNU General Public
6 * License version 2, as published by the Free Software Foundation, and
7 * may be copied, distributed, and modified under those terms.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 */
14#ifndef _MSM_MDP_H_
15#define _MSM_MDP_H_
16
17#include <linux/types.h>
18
19#define MSMFB_IOCTL_MAGIC 'm'
20#define MSMFB_GRP_DISP _IOW(MSMFB_IOCTL_MAGIC, 1, unsigned int)
21#define MSMFB_BLIT _IOW(MSMFB_IOCTL_MAGIC, 2, unsigned int)
22
23enum {
24 MDP_RGB_565, /* RGB 565 planar */
25 MDP_XRGB_8888, /* RGB 888 padded */
26 MDP_Y_CBCR_H2V2, /* Y and CbCr, pseudo planar w/ Cb is in MSB */
27 MDP_ARGB_8888, /* ARGB 888 */
28 MDP_RGB_888, /* RGB 888 planar */
29 MDP_Y_CRCB_H2V2, /* Y and CrCb, pseudo planar w/ Cr is in MSB */
30 MDP_YCRYCB_H2V1, /* YCrYCb interleave */
31 MDP_Y_CRCB_H2V1, /* Y and CrCb, pseduo planar w/ Cr is in MSB */
32 MDP_Y_CBCR_H2V1, /* Y and CrCb, pseduo planar w/ Cr is in MSB */
33 MDP_RGBA_8888, /* ARGB 888 */
34 MDP_BGRA_8888, /* ABGR 888 */
35 MDP_IMGTYPE_LIMIT /* Non valid image type after this enum */
36};
37
38enum {
39 PMEM_IMG,
40 FB_IMG,
41};
42
43/* flag values */
44#define MDP_ROT_NOP 0
45#define MDP_FLIP_LR 0x1
46#define MDP_FLIP_UD 0x2
47#define MDP_ROT_90 0x4
48#define MDP_ROT_180 (MDP_FLIP_UD|MDP_FLIP_LR)
49#define MDP_ROT_270 (MDP_ROT_90|MDP_FLIP_UD|MDP_FLIP_LR)
50#define MDP_DITHER 0x8
51#define MDP_BLUR 0x10
52
53#define MDP_TRANSP_NOP 0xffffffff
54#define MDP_ALPHA_NOP 0xff
55
56struct mdp_rect {
57 u32 x, y, w, h;
58};
59
60struct mdp_img {
61 u32 width, height, format, offset;
62 int memory_id; /* the file descriptor */
63};
64
65struct mdp_blit_req {
66 struct mdp_img src;
67 struct mdp_img dst;
68 struct mdp_rect src_rect;
69 struct mdp_rect dst_rect;
70 u32 alpha, transp_mask, flags;
71};
72
73struct mdp_blit_req_list {
74 u32 count;
75 struct mdp_blit_req req[];
76};
77
78#endif /* _MSM_MDP_H_ */
diff --git a/include/linux/mtd/blktrans.h b/include/linux/mtd/blktrans.h
index 8b4aa0523db7..b481ccd7ff3c 100644
--- a/include/linux/mtd/blktrans.h
+++ b/include/linux/mtd/blktrans.h
@@ -9,6 +9,8 @@
9#define __MTD_TRANS_H__ 9#define __MTD_TRANS_H__
10 10
11#include <linux/mutex.h> 11#include <linux/mutex.h>
12#include <linux/kref.h>
13#include <linux/sysfs.h>
12 14
13struct hd_geometry; 15struct hd_geometry;
14struct mtd_info; 16struct mtd_info;
@@ -24,11 +26,16 @@ struct mtd_blktrans_dev {
24 int devnum; 26 int devnum;
25 unsigned long size; 27 unsigned long size;
26 int readonly; 28 int readonly;
27 void *blkcore_priv; /* gendisk in 2.5, devfs_handle in 2.4 */ 29 int open;
30 struct kref ref;
31 struct gendisk *disk;
32 struct attribute_group *disk_attributes;
33 struct task_struct *thread;
34 struct request_queue *rq;
35 spinlock_t queue_lock;
36 void *priv;
28}; 37};
29 38
30struct blkcore_priv; /* Differs for 2.4 and 2.5 kernels; private */
31
32struct mtd_blktrans_ops { 39struct mtd_blktrans_ops {
33 char *name; 40 char *name;
34 int major; 41 int major;
@@ -60,8 +67,6 @@ struct mtd_blktrans_ops {
60 struct list_head devs; 67 struct list_head devs;
61 struct list_head list; 68 struct list_head list;
62 struct module *owner; 69 struct module *owner;
63
64 struct mtd_blkcore_priv *blkcore_priv;
65}; 70};
66 71
67extern int register_mtd_blktrans(struct mtd_blktrans_ops *tr); 72extern int register_mtd_blktrans(struct mtd_blktrans_ops *tr);
diff --git a/include/linux/mtd/cfi.h b/include/linux/mtd/cfi.h
index df89f4275232..574d9ee066f1 100644
--- a/include/linux/mtd/cfi.h
+++ b/include/linux/mtd/cfi.h
@@ -253,6 +253,7 @@ struct cfi_bri_query {
253#define P_ID_MITSUBISHI_STD 0x0100 253#define P_ID_MITSUBISHI_STD 0x0100
254#define P_ID_MITSUBISHI_EXT 0x0101 254#define P_ID_MITSUBISHI_EXT 0x0101
255#define P_ID_SST_PAGE 0x0102 255#define P_ID_SST_PAGE 0x0102
256#define P_ID_SST_OLD 0x0701
256#define P_ID_INTEL_PERFORMANCE 0x0200 257#define P_ID_INTEL_PERFORMANCE 0x0200
257#define P_ID_INTEL_DATA 0x0210 258#define P_ID_INTEL_DATA 0x0210
258#define P_ID_RESERVED 0xffff 259#define P_ID_RESERVED 0xffff
@@ -297,7 +298,7 @@ static inline uint32_t cfi_build_cmd_addr(uint32_t cmd_ofs,
297 * and 32bit devices on 16 bit busses 298 * and 32bit devices on 16 bit busses
298 * set the low bit of the alternating bit sequence of the address. 299 * set the low bit of the alternating bit sequence of the address.
299 */ 300 */
300 if (((type * interleave) > bankwidth) && ((uint8_t)cmd_ofs == 0xaa)) 301 if (((type * interleave) > bankwidth) && ((cmd_ofs & 0xff) == 0xaa))
301 addr |= (type >> 1)*interleave; 302 addr |= (type >> 1)*interleave;
302 303
303 return addr; 304 return addr;
@@ -515,14 +516,25 @@ struct cfi_fixup {
515 void* param; 516 void* param;
516}; 517};
517 518
518#define CFI_MFR_ANY 0xffff 519#define CFI_MFR_ANY 0xFFFF
519#define CFI_ID_ANY 0xffff 520#define CFI_ID_ANY 0xFFFF
520 521#define CFI_MFR_CONTINUATION 0x007F
521#define CFI_MFR_AMD 0x0001 522
522#define CFI_MFR_INTEL 0x0089 523#define CFI_MFR_AMD 0x0001
523#define CFI_MFR_ATMEL 0x001F 524#define CFI_MFR_ATMEL 0x001F
524#define CFI_MFR_SAMSUNG 0x00EC 525#define CFI_MFR_EON 0x001C
525#define CFI_MFR_ST 0x0020 /* STMicroelectronics */ 526#define CFI_MFR_FUJITSU 0x0004
527#define CFI_MFR_HYUNDAI 0x00AD
528#define CFI_MFR_INTEL 0x0089
529#define CFI_MFR_MACRONIX 0x00C2
530#define CFI_MFR_NEC 0x0010
531#define CFI_MFR_PMC 0x009D
532#define CFI_MFR_SAMSUNG 0x00EC
533#define CFI_MFR_SHARP 0x00B0
534#define CFI_MFR_SST 0x00BF
535#define CFI_MFR_ST 0x0020 /* STMicroelectronics */
536#define CFI_MFR_TOSHIBA 0x0098
537#define CFI_MFR_WINBOND 0x00DA
526 538
527void cfi_fixup(struct mtd_info *mtd, struct cfi_fixup* fixups); 539void cfi_fixup(struct mtd_info *mtd, struct cfi_fixup* fixups);
528 540
diff --git a/include/linux/mtd/flashchip.h b/include/linux/mtd/flashchip.h
index d0bf422ae374..f43e9b49b751 100644
--- a/include/linux/mtd/flashchip.h
+++ b/include/linux/mtd/flashchip.h
@@ -15,6 +15,7 @@
15 * has asm/spinlock.h, or 2.4, which has linux/spinlock.h 15 * has asm/spinlock.h, or 2.4, which has linux/spinlock.h
16 */ 16 */
17#include <linux/sched.h> 17#include <linux/sched.h>
18#include <linux/mutex.h>
18 19
19typedef enum { 20typedef enum {
20 FL_READY, 21 FL_READY,
@@ -74,8 +75,7 @@ struct flchip {
74 unsigned int erase_suspended:1; 75 unsigned int erase_suspended:1;
75 unsigned long in_progress_block_addr; 76 unsigned long in_progress_block_addr;
76 77
77 spinlock_t *mutex; 78 struct mutex mutex;
78 spinlock_t _spinlock; /* We do it like this because sometimes they'll be shared. */
79 wait_queue_head_t wq; /* Wait on here when we're waiting for the chip 79 wait_queue_head_t wq; /* Wait on here when we're waiting for the chip
80 to be ready */ 80 to be ready */
81 int word_write_time; 81 int word_write_time;
diff --git a/include/linux/mtd/map.h b/include/linux/mtd/map.h
index b981b8772217..de89eca864ce 100644
--- a/include/linux/mtd/map.h
+++ b/include/linux/mtd/map.h
@@ -7,6 +7,7 @@
7#include <linux/types.h> 7#include <linux/types.h>
8#include <linux/list.h> 8#include <linux/list.h>
9#include <linux/string.h> 9#include <linux/string.h>
10#include <linux/bug.h>
10 11
11#include <linux/mtd/compatmac.h> 12#include <linux/mtd/compatmac.h>
12 13
@@ -386,6 +387,8 @@ static inline map_word inline_map_read(struct map_info *map, unsigned long ofs)
386#endif 387#endif
387 else if (map_bankwidth_is_large(map)) 388 else if (map_bankwidth_is_large(map))
388 memcpy_fromio(r.x, map->virt+ofs, map->bankwidth); 389 memcpy_fromio(r.x, map->virt+ofs, map->bankwidth);
390 else
391 BUG();
389 392
390 return r; 393 return r;
391} 394}
diff --git a/include/linux/mtd/mtd.h b/include/linux/mtd/mtd.h
index 0f32a9b6ff55..5326435a7571 100644
--- a/include/linux/mtd/mtd.h
+++ b/include/linux/mtd/mtd.h
@@ -20,7 +20,6 @@
20 20
21#define MTD_CHAR_MAJOR 90 21#define MTD_CHAR_MAJOR 90
22#define MTD_BLOCK_MAJOR 31 22#define MTD_BLOCK_MAJOR 31
23#define MAX_MTD_DEVICES 32
24 23
25#define MTD_ERASE_PENDING 0x01 24#define MTD_ERASE_PENDING 0x01
26#define MTD_ERASING 0x02 25#define MTD_ERASING 0x02
@@ -61,9 +60,7 @@ struct mtd_erase_region_info {
61 * MTD_OOB_PLACE: oob data are placed at the given offset 60 * MTD_OOB_PLACE: oob data are placed at the given offset
62 * MTD_OOB_AUTO: oob data are automatically placed at the free areas 61 * MTD_OOB_AUTO: oob data are automatically placed at the free areas
63 * which are defined by the ecclayout 62 * which are defined by the ecclayout
64 * MTD_OOB_RAW: mode to read raw data+oob in one chunk. The oob data 63 * MTD_OOB_RAW: mode to read oob and data without doing ECC checking
65 * is inserted into the data. Thats a raw image of the
66 * flash contents.
67 */ 64 */
68typedef enum { 65typedef enum {
69 MTD_OOB_PLACE, 66 MTD_OOB_PLACE,
@@ -290,8 +287,9 @@ extern int add_mtd_device(struct mtd_info *mtd);
290extern int del_mtd_device (struct mtd_info *mtd); 287extern int del_mtd_device (struct mtd_info *mtd);
291 288
292extern struct mtd_info *get_mtd_device(struct mtd_info *mtd, int num); 289extern struct mtd_info *get_mtd_device(struct mtd_info *mtd, int num);
290extern int __get_mtd_device(struct mtd_info *mtd);
291extern void __put_mtd_device(struct mtd_info *mtd);
293extern struct mtd_info *get_mtd_device_nm(const char *name); 292extern struct mtd_info *get_mtd_device_nm(const char *name);
294
295extern void put_mtd_device(struct mtd_info *mtd); 293extern void put_mtd_device(struct mtd_info *mtd);
296 294
297 295
diff --git a/include/linux/mtd/mtdram.h b/include/linux/mtd/mtdram.h
index 04fdc07b7353..68891313875d 100644
--- a/include/linux/mtd/mtdram.h
+++ b/include/linux/mtd/mtdram.h
@@ -3,6 +3,6 @@
3 3
4#include <linux/mtd/mtd.h> 4#include <linux/mtd/mtd.h>
5int mtdram_init_device(struct mtd_info *mtd, void *mapped_address, 5int mtdram_init_device(struct mtd_info *mtd, void *mapped_address,
6 unsigned long size, char *name); 6 unsigned long size, char *name);
7 7
8#endif /* __MTD_MTDRAM_H__ */ 8#endif /* __MTD_MTDRAM_H__ */
diff --git a/include/linux/mtd/nand.h b/include/linux/mtd/nand.h
index ccab9dfc5217..a81b185e23a7 100644
--- a/include/linux/mtd/nand.h
+++ b/include/linux/mtd/nand.h
@@ -25,11 +25,13 @@
25#include <linux/mtd/bbm.h> 25#include <linux/mtd/bbm.h>
26 26
27struct mtd_info; 27struct mtd_info;
28struct nand_flash_dev;
28/* Scan and identify a NAND device */ 29/* Scan and identify a NAND device */
29extern int nand_scan (struct mtd_info *mtd, int max_chips); 30extern int nand_scan (struct mtd_info *mtd, int max_chips);
30/* Separate phases of nand_scan(), allowing board driver to intervene 31/* Separate phases of nand_scan(), allowing board driver to intervene
31 * and override command or ECC setup according to flash type */ 32 * and override command or ECC setup according to flash type */
32extern int nand_scan_ident(struct mtd_info *mtd, int max_chips); 33extern int nand_scan_ident(struct mtd_info *mtd, int max_chips,
34 struct nand_flash_dev *table);
33extern int nand_scan_tail(struct mtd_info *mtd); 35extern int nand_scan_tail(struct mtd_info *mtd);
34 36
35/* Free resources held by the NAND device */ 37/* Free resources held by the NAND device */
@@ -38,6 +40,12 @@ extern void nand_release (struct mtd_info *mtd);
38/* Internal helper for board drivers which need to override command function */ 40/* Internal helper for board drivers which need to override command function */
39extern void nand_wait_ready(struct mtd_info *mtd); 41extern void nand_wait_ready(struct mtd_info *mtd);
40 42
43/* locks all blockes present in the device */
44extern int nand_lock(struct mtd_info *mtd, loff_t ofs, uint64_t len);
45
46/* unlocks specified locked blockes */
47extern int nand_unlock(struct mtd_info *mtd, loff_t ofs, uint64_t len);
48
41/* The maximum number of NAND chips in an array */ 49/* The maximum number of NAND chips in an array */
42#define NAND_MAX_CHIPS 8 50#define NAND_MAX_CHIPS 8
43 51
@@ -45,7 +53,7 @@ extern void nand_wait_ready(struct mtd_info *mtd);
45 * is supported now. If you add a chip with bigger oobsize/page 53 * is supported now. If you add a chip with bigger oobsize/page
46 * adjust this accordingly. 54 * adjust this accordingly.
47 */ 55 */
48#define NAND_MAX_OOBSIZE 128 56#define NAND_MAX_OOBSIZE 256
49#define NAND_MAX_PAGESIZE 4096 57#define NAND_MAX_PAGESIZE 4096
50 58
51/* 59/*
@@ -82,6 +90,10 @@ extern void nand_wait_ready(struct mtd_info *mtd);
82#define NAND_CMD_ERASE2 0xd0 90#define NAND_CMD_ERASE2 0xd0
83#define NAND_CMD_RESET 0xff 91#define NAND_CMD_RESET 0xff
84 92
93#define NAND_CMD_LOCK 0x2a
94#define NAND_CMD_UNLOCK1 0x23
95#define NAND_CMD_UNLOCK2 0x24
96
85/* Extended commands for large page devices */ 97/* Extended commands for large page devices */
86#define NAND_CMD_READSTART 0x30 98#define NAND_CMD_READSTART 0x30
87#define NAND_CMD_RNDOUTSTART 0xE0 99#define NAND_CMD_RNDOUTSTART 0xE0
@@ -169,6 +181,14 @@ typedef enum {
169#define NAND_NO_READRDY 0x00000100 181#define NAND_NO_READRDY 0x00000100
170/* Chip does not allow subpage writes */ 182/* Chip does not allow subpage writes */
171#define NAND_NO_SUBPAGE_WRITE 0x00000200 183#define NAND_NO_SUBPAGE_WRITE 0x00000200
184/* Chip stores bad block marker on the last page of the eraseblock */
185#define NAND_BB_LAST_PAGE 0x00000400
186
187/* Device is one of 'new' xD cards that expose fake nand command set */
188#define NAND_BROKEN_XD 0x00000400
189
190/* Device behaves just like nand, but is readonly */
191#define NAND_ROM 0x00000800
172 192
173/* Options valid for Samsung large page devices */ 193/* Options valid for Samsung large page devices */
174#define NAND_SAMSUNG_LP_OPTIONS \ 194#define NAND_SAMSUNG_LP_OPTIONS \
@@ -391,6 +411,7 @@ struct nand_chip {
391 int subpagesize; 411 int subpagesize;
392 uint8_t cellinfo; 412 uint8_t cellinfo;
393 int badblockpos; 413 int badblockpos;
414 int badblockbits;
394 415
395 flstate_t state; 416 flstate_t state;
396 417
diff --git a/include/linux/mtd/onenand.h b/include/linux/mtd/onenand.h
index 5509eb06b326..c26ff86ad08a 100644
--- a/include/linux/mtd/onenand.h
+++ b/include/linux/mtd/onenand.h
@@ -125,6 +125,9 @@ struct onenand_chip {
125 flstate_t state; 125 flstate_t state;
126 unsigned char *page_buf; 126 unsigned char *page_buf;
127 unsigned char *oob_buf; 127 unsigned char *oob_buf;
128#ifdef CONFIG_MTD_ONENAND_VERIFY_WRITE
129 unsigned char *verify_buf;
130#endif
128 131
129 int subpagesize; 132 int subpagesize;
130 struct nand_ecclayout *ecclayout; 133 struct nand_ecclayout *ecclayout;
@@ -175,10 +178,14 @@ struct onenand_chip {
175#define ONENAND_HAS_CONT_LOCK (0x0001) 178#define ONENAND_HAS_CONT_LOCK (0x0001)
176#define ONENAND_HAS_UNLOCK_ALL (0x0002) 179#define ONENAND_HAS_UNLOCK_ALL (0x0002)
177#define ONENAND_HAS_2PLANE (0x0004) 180#define ONENAND_HAS_2PLANE (0x0004)
181#define ONENAND_HAS_4KB_PAGE (0x0008)
178#define ONENAND_SKIP_UNLOCK_CHECK (0x0100) 182#define ONENAND_SKIP_UNLOCK_CHECK (0x0100)
179#define ONENAND_PAGEBUF_ALLOC (0x1000) 183#define ONENAND_PAGEBUF_ALLOC (0x1000)
180#define ONENAND_OOBBUF_ALLOC (0x2000) 184#define ONENAND_OOBBUF_ALLOC (0x2000)
181 185
186#define ONENAND_IS_4KB_PAGE(this) \
187 (this->options & ONENAND_HAS_4KB_PAGE)
188
182/* 189/*
183 * OneNAND Flash Manufacturer ID Codes 190 * OneNAND Flash Manufacturer ID Codes
184 */ 191 */
@@ -205,6 +212,8 @@ struct mtd_partition;
205 212
206struct onenand_platform_data { 213struct onenand_platform_data {
207 void (*mmcontrol)(struct mtd_info *mtd, int sync_read); 214 void (*mmcontrol)(struct mtd_info *mtd, int sync_read);
215 int (*read_bufferram)(struct mtd_info *mtd, int area,
216 unsigned char *buffer, int offset, size_t count);
208 struct mtd_partition *parts; 217 struct mtd_partition *parts;
209 unsigned int nr_parts; 218 unsigned int nr_parts;
210}; 219};
diff --git a/include/linux/mtd/sh_flctl.h b/include/linux/mtd/sh_flctl.h
index ab77609ec337..9cf4c4c79555 100644
--- a/include/linux/mtd/sh_flctl.h
+++ b/include/linux/mtd/sh_flctl.h
@@ -93,8 +93,6 @@
93#define INIT_FL4ECCRESULT_VAL 0x03FF03FF 93#define INIT_FL4ECCRESULT_VAL 0x03FF03FF
94#define LOOP_TIMEOUT_MAX 0x00010000 94#define LOOP_TIMEOUT_MAX 0x00010000
95 95
96#define mtd_to_flctl(mtd) container_of(mtd, struct sh_flctl, mtd)
97
98struct sh_flctl { 96struct sh_flctl {
99 struct mtd_info mtd; 97 struct mtd_info mtd;
100 struct nand_chip chip; 98 struct nand_chip chip;
@@ -125,4 +123,9 @@ struct sh_flctl_platform_data {
125 unsigned has_hwecc:1; 123 unsigned has_hwecc:1;
126}; 124};
127 125
126static inline struct sh_flctl *mtd_to_flctl(struct mtd_info *mtdinfo)
127{
128 return container_of(mtdinfo, struct sh_flctl, mtd);
129}
130
128#endif /* __SH_FLCTL_H__ */ 131#endif /* __SH_FLCTL_H__ */
diff --git a/include/linux/ncp_fs.h b/include/linux/ncp_fs.h
index 30b06c893944..4522aed00906 100644
--- a/include/linux/ncp_fs.h
+++ b/include/linux/ncp_fs.h
@@ -210,7 +210,7 @@ int ncp_date_dos2unix(__le16 time, __le16 date);
210void ncp_date_unix2dos(int unix_date, __le16 * time, __le16 * date); 210void ncp_date_unix2dos(int unix_date, __le16 * time, __le16 * date);
211 211
212/* linux/fs/ncpfs/ioctl.c */ 212/* linux/fs/ncpfs/ioctl.c */
213int ncp_ioctl(struct inode *, struct file *, unsigned int, unsigned long); 213long ncp_ioctl(struct file *, unsigned int, unsigned long);
214long ncp_compat_ioctl(struct file *, unsigned int, unsigned long); 214long ncp_compat_ioctl(struct file *, unsigned int, unsigned long);
215 215
216/* linux/fs/ncpfs/sock.c */ 216/* linux/fs/ncpfs/sock.c */
diff --git a/include/linux/ncp_fs_sb.h b/include/linux/ncp_fs_sb.h
index 6330fc76b00f..5ec9ca671687 100644
--- a/include/linux/ncp_fs_sb.h
+++ b/include/linux/ncp_fs_sb.h
@@ -12,6 +12,7 @@
12#include <linux/ncp_mount.h> 12#include <linux/ncp_mount.h>
13#include <linux/net.h> 13#include <linux/net.h>
14#include <linux/mutex.h> 14#include <linux/mutex.h>
15#include <linux/backing-dev.h>
15 16
16#ifdef __KERNEL__ 17#ifdef __KERNEL__
17 18
@@ -127,6 +128,7 @@ struct ncp_server {
127 size_t len; 128 size_t len;
128 __u8 data[128]; 129 __u8 data[128];
129 } unexpected_packet; 130 } unexpected_packet;
131 struct backing_dev_info bdi;
130}; 132};
131 133
132extern void ncp_tcp_rcv_proc(struct work_struct *work); 134extern void ncp_tcp_rcv_proc(struct work_struct *work);
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index 69022d47d6f2..40291f375024 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -31,6 +31,7 @@
31#include <linux/if_link.h> 31#include <linux/if_link.h>
32 32
33#ifdef __KERNEL__ 33#ifdef __KERNEL__
34#include <linux/pm_qos_params.h>
34#include <linux/timer.h> 35#include <linux/timer.h>
35#include <linux/delay.h> 36#include <linux/delay.h>
36#include <linux/mm.h> 37#include <linux/mm.h>
@@ -686,6 +687,9 @@ struct netdev_rx_queue {
686 * int (*ndo_set_vf_tx_rate)(struct net_device *dev, int vf, int rate); 687 * int (*ndo_set_vf_tx_rate)(struct net_device *dev, int vf, int rate);
687 * int (*ndo_get_vf_config)(struct net_device *dev, 688 * int (*ndo_get_vf_config)(struct net_device *dev,
688 * int vf, struct ifla_vf_info *ivf); 689 * int vf, struct ifla_vf_info *ivf);
690 * int (*ndo_set_vf_port)(struct net_device *dev, int vf,
691 * struct nlattr *port[]);
692 * int (*ndo_get_vf_port)(struct net_device *dev, int vf, struct sk_buff *skb);
689 */ 693 */
690#define HAVE_NET_DEVICE_OPS 694#define HAVE_NET_DEVICE_OPS
691struct net_device_ops { 695struct net_device_ops {
@@ -735,6 +739,11 @@ struct net_device_ops {
735 int (*ndo_get_vf_config)(struct net_device *dev, 739 int (*ndo_get_vf_config)(struct net_device *dev,
736 int vf, 740 int vf,
737 struct ifla_vf_info *ivf); 741 struct ifla_vf_info *ivf);
742 int (*ndo_set_vf_port)(struct net_device *dev,
743 int vf,
744 struct nlattr *port[]);
745 int (*ndo_get_vf_port)(struct net_device *dev,
746 int vf, struct sk_buff *skb);
738#if defined(CONFIG_FCOE) || defined(CONFIG_FCOE_MODULE) 747#if defined(CONFIG_FCOE) || defined(CONFIG_FCOE_MODULE)
739 int (*ndo_fcoe_enable)(struct net_device *dev); 748 int (*ndo_fcoe_enable)(struct net_device *dev);
740 int (*ndo_fcoe_disable)(struct net_device *dev); 749 int (*ndo_fcoe_disable)(struct net_device *dev);
@@ -769,6 +778,9 @@ struct net_device {
769 * the interface. 778 * the interface.
770 */ 779 */
771 char name[IFNAMSIZ]; 780 char name[IFNAMSIZ];
781
782 struct pm_qos_request_list *pm_qos_req;
783
772 /* device name hash chain */ 784 /* device name hash chain */
773 struct hlist_node name_hlist; 785 struct hlist_node name_hlist;
774 /* snmp alias */ 786 /* snmp alias */
@@ -1395,17 +1407,25 @@ struct softnet_data {
1395 struct softnet_data *rps_ipi_next; 1407 struct softnet_data *rps_ipi_next;
1396 unsigned int cpu; 1408 unsigned int cpu;
1397 unsigned int input_queue_head; 1409 unsigned int input_queue_head;
1410 unsigned int input_queue_tail;
1398#endif 1411#endif
1399 unsigned dropped; 1412 unsigned dropped;
1400 struct sk_buff_head input_pkt_queue; 1413 struct sk_buff_head input_pkt_queue;
1401 struct napi_struct backlog; 1414 struct napi_struct backlog;
1402}; 1415};
1403 1416
1404static inline void input_queue_head_add(struct softnet_data *sd, 1417static inline void input_queue_head_incr(struct softnet_data *sd)
1405 unsigned int len) 1418{
1419#ifdef CONFIG_RPS
1420 sd->input_queue_head++;
1421#endif
1422}
1423
1424static inline void input_queue_tail_incr_save(struct softnet_data *sd,
1425 unsigned int *qtail)
1406{ 1426{
1407#ifdef CONFIG_RPS 1427#ifdef CONFIG_RPS
1408 sd->input_queue_head += len; 1428 *qtail = ++sd->input_queue_tail;
1409#endif 1429#endif
1410} 1430}
1411 1431
@@ -2100,6 +2120,7 @@ extern const struct net_device_stats *dev_get_stats(struct net_device *dev);
2100extern void dev_txq_stats_fold(const struct net_device *dev, struct net_device_stats *stats); 2120extern void dev_txq_stats_fold(const struct net_device *dev, struct net_device_stats *stats);
2101 2121
2102extern int netdev_max_backlog; 2122extern int netdev_max_backlog;
2123extern int netdev_tstamp_prequeue;
2103extern int weight_p; 2124extern int weight_p;
2104extern int netdev_set_master(struct net_device *dev, struct net_device *master); 2125extern int netdev_set_master(struct net_device *dev, struct net_device *master);
2105extern int skb_checksum_help(struct sk_buff *skb); 2126extern int skb_checksum_help(struct sk_buff *skb);
@@ -2313,7 +2334,7 @@ do { \
2313#define netif_vdbg(priv, type, dev, format, args...) \ 2334#define netif_vdbg(priv, type, dev, format, args...) \
2314({ \ 2335({ \
2315 if (0) \ 2336 if (0) \
2316 netif_printk(KERN_DEBUG, dev, format, ##args); \ 2337 netif_printk(priv, type, KERN_DEBUG, dev, format, ##args); \
2317 0; \ 2338 0; \
2318}) 2339})
2319#endif 2340#endif
diff --git a/include/linux/netfilter/Kbuild b/include/linux/netfilter/Kbuild
index a5a63e41b8af..48767cd16453 100644
--- a/include/linux/netfilter/Kbuild
+++ b/include/linux/netfilter/Kbuild
@@ -16,6 +16,7 @@ header-y += xt_RATEEST.h
16header-y += xt_SECMARK.h 16header-y += xt_SECMARK.h
17header-y += xt_TCPMSS.h 17header-y += xt_TCPMSS.h
18header-y += xt_TCPOPTSTRIP.h 18header-y += xt_TCPOPTSTRIP.h
19header-y += xt_TEE.h
19header-y += xt_TPROXY.h 20header-y += xt_TPROXY.h
20header-y += xt_comment.h 21header-y += xt_comment.h
21header-y += xt_connbytes.h 22header-y += xt_connbytes.h
diff --git a/include/linux/netfilter/nf_conntrack_common.h b/include/linux/netfilter/nf_conntrack_common.h
index c608677dda60..14e6d32002c4 100644
--- a/include/linux/netfilter/nf_conntrack_common.h
+++ b/include/linux/netfilter/nf_conntrack_common.h
@@ -113,6 +113,7 @@ struct ip_conntrack_stat {
113 unsigned int expect_new; 113 unsigned int expect_new;
114 unsigned int expect_create; 114 unsigned int expect_create;
115 unsigned int expect_delete; 115 unsigned int expect_delete;
116 unsigned int search_restart;
116}; 117};
117 118
118/* call to create an explicit dependency on nf_conntrack. */ 119/* call to create an explicit dependency on nf_conntrack. */
diff --git a/include/linux/netfilter/nf_conntrack_tuple_common.h b/include/linux/netfilter/nf_conntrack_tuple_common.h
index 8e145f0d61cb..2ea22b018a87 100644
--- a/include/linux/netfilter/nf_conntrack_tuple_common.h
+++ b/include/linux/netfilter/nf_conntrack_tuple_common.h
@@ -1,8 +1,7 @@
1#ifndef _NF_CONNTRACK_TUPLE_COMMON_H 1#ifndef _NF_CONNTRACK_TUPLE_COMMON_H
2#define _NF_CONNTRACK_TUPLE_COMMON_H 2#define _NF_CONNTRACK_TUPLE_COMMON_H
3 3
4enum ip_conntrack_dir 4enum ip_conntrack_dir {
5{
6 IP_CT_DIR_ORIGINAL, 5 IP_CT_DIR_ORIGINAL,
7 IP_CT_DIR_REPLY, 6 IP_CT_DIR_REPLY,
8 IP_CT_DIR_MAX 7 IP_CT_DIR_MAX
diff --git a/include/linux/netfilter/x_tables.h b/include/linux/netfilter/x_tables.h
index 84c7c928e9eb..24e5d01d27d0 100644
--- a/include/linux/netfilter/x_tables.h
+++ b/include/linux/netfilter/x_tables.h
@@ -1,9 +1,10 @@
1#ifndef _X_TABLES_H 1#ifndef _X_TABLES_H
2#define _X_TABLES_H 2#define _X_TABLES_H
3 3#include <linux/kernel.h>
4#include <linux/types.h> 4#include <linux/types.h>
5 5
6#define XT_FUNCTION_MAXNAMELEN 30 6#define XT_FUNCTION_MAXNAMELEN 30
7#define XT_EXTENSION_MAXNAMELEN 29
7#define XT_TABLE_MAXNAMELEN 32 8#define XT_TABLE_MAXNAMELEN 32
8 9
9struct xt_entry_match { 10struct xt_entry_match {
@@ -12,8 +13,7 @@ struct xt_entry_match {
12 __u16 match_size; 13 __u16 match_size;
13 14
14 /* Used by userspace */ 15 /* Used by userspace */
15 char name[XT_FUNCTION_MAXNAMELEN-1]; 16 char name[XT_EXTENSION_MAXNAMELEN];
16
17 __u8 revision; 17 __u8 revision;
18 } user; 18 } user;
19 struct { 19 struct {
@@ -36,8 +36,7 @@ struct xt_entry_target {
36 __u16 target_size; 36 __u16 target_size;
37 37
38 /* Used by userspace */ 38 /* Used by userspace */
39 char name[XT_FUNCTION_MAXNAMELEN-1]; 39 char name[XT_EXTENSION_MAXNAMELEN];
40
41 __u8 revision; 40 __u8 revision;
42 } user; 41 } user;
43 struct { 42 struct {
@@ -70,8 +69,7 @@ struct xt_standard_target {
70/* The argument to IPT_SO_GET_REVISION_*. Returns highest revision 69/* The argument to IPT_SO_GET_REVISION_*. Returns highest revision
71 * kernel supports, if >= revision. */ 70 * kernel supports, if >= revision. */
72struct xt_get_revision { 71struct xt_get_revision {
73 char name[XT_FUNCTION_MAXNAMELEN-1]; 72 char name[XT_EXTENSION_MAXNAMELEN];
74
75 __u8 revision; 73 __u8 revision;
76}; 74};
77 75
@@ -93,7 +91,7 @@ struct _xt_align {
93 __u64 u64; 91 __u64 u64;
94}; 92};
95 93
96#define XT_ALIGN(s) ALIGN((s), __alignof__(struct _xt_align)) 94#define XT_ALIGN(s) __ALIGN_KERNEL((s), __alignof__(struct _xt_align))
97 95
98/* Standard return verdict, or do jump. */ 96/* Standard return verdict, or do jump. */
99#define XT_STANDARD_TARGET "" 97#define XT_STANDARD_TARGET ""
@@ -185,40 +183,53 @@ struct xt_counters_info {
185#include <linux/netdevice.h> 183#include <linux/netdevice.h>
186 184
187/** 185/**
188 * struct xt_match_param - parameters for match extensions' match functions 186 * struct xt_action_param - parameters for matches/targets
189 * 187 *
188 * @match: the match extension
189 * @target: the target extension
190 * @matchinfo: per-match data
191 * @targetinfo: per-target data
190 * @in: input netdevice 192 * @in: input netdevice
191 * @out: output netdevice 193 * @out: output netdevice
192 * @match: struct xt_match through which this function was invoked
193 * @matchinfo: per-match data
194 * @fragoff: packet is a fragment, this is the data offset 194 * @fragoff: packet is a fragment, this is the data offset
195 * @thoff: position of transport header relative to skb->data 195 * @thoff: position of transport header relative to skb->data
196 * @hook: hook number given packet came from 196 * @hook: hook number given packet came from
197 * @family: Actual NFPROTO_* through which the function is invoked 197 * @family: Actual NFPROTO_* through which the function is invoked
198 * (helpful when match->family == NFPROTO_UNSPEC) 198 * (helpful when match->family == NFPROTO_UNSPEC)
199 *
200 * Fields written to by extensions:
201 *
199 * @hotdrop: drop packet if we had inspection problems 202 * @hotdrop: drop packet if we had inspection problems
203 * Network namespace obtainable using dev_net(in/out)
200 */ 204 */
201struct xt_match_param { 205struct xt_action_param {
206 union {
207 const struct xt_match *match;
208 const struct xt_target *target;
209 };
210 union {
211 const void *matchinfo, *targinfo;
212 };
202 const struct net_device *in, *out; 213 const struct net_device *in, *out;
203 const struct xt_match *match;
204 const void *matchinfo;
205 int fragoff; 214 int fragoff;
206 unsigned int thoff; 215 unsigned int thoff;
207 unsigned int hooknum; 216 unsigned int hooknum;
208 u_int8_t family; 217 u_int8_t family;
209 bool *hotdrop; 218 bool hotdrop;
210}; 219};
211 220
212/** 221/**
213 * struct xt_mtchk_param - parameters for match extensions' 222 * struct xt_mtchk_param - parameters for match extensions'
214 * checkentry functions 223 * checkentry functions
215 * 224 *
225 * @net: network namespace through which the check was invoked
216 * @table: table the rule is tried to be inserted into 226 * @table: table the rule is tried to be inserted into
217 * @entryinfo: the family-specific rule data 227 * @entryinfo: the family-specific rule data
218 * (struct ipt_ip, ip6t_ip, ebt_entry) 228 * (struct ipt_ip, ip6t_ip, arpt_arp or (note) ebt_entry)
219 * @match: struct xt_match through which this function was invoked 229 * @match: struct xt_match through which this function was invoked
220 * @matchinfo: per-match data 230 * @matchinfo: per-match data
221 * @hook_mask: via which hooks the new rule is reachable 231 * @hook_mask: via which hooks the new rule is reachable
232 * Other fields as above.
222 */ 233 */
223struct xt_mtchk_param { 234struct xt_mtchk_param {
224 struct net *net; 235 struct net *net;
@@ -230,7 +241,10 @@ struct xt_mtchk_param {
230 u_int8_t family; 241 u_int8_t family;
231}; 242};
232 243
233/* Match destructor parameters */ 244/**
245 * struct xt_mdtor_param - match destructor parameters
246 * Fields as above.
247 */
234struct xt_mtdtor_param { 248struct xt_mtdtor_param {
235 struct net *net; 249 struct net *net;
236 const struct xt_match *match; 250 const struct xt_match *match;
@@ -239,23 +253,6 @@ struct xt_mtdtor_param {
239}; 253};
240 254
241/** 255/**
242 * struct xt_target_param - parameters for target extensions' target functions
243 *
244 * @hooknum: hook through which this target was invoked
245 * @target: struct xt_target through which this function was invoked
246 * @targinfo: per-target data
247 *
248 * Other fields see above.
249 */
250struct xt_target_param {
251 const struct net_device *in, *out;
252 const struct xt_target *target;
253 const void *targinfo;
254 unsigned int hooknum;
255 u_int8_t family;
256};
257
258/**
259 * struct xt_tgchk_param - parameters for target extensions' 256 * struct xt_tgchk_param - parameters for target extensions'
260 * checkentry functions 257 * checkentry functions
261 * 258 *
@@ -285,7 +282,7 @@ struct xt_tgdtor_param {
285struct xt_match { 282struct xt_match {
286 struct list_head list; 283 struct list_head list;
287 284
288 const char name[XT_FUNCTION_MAXNAMELEN-1]; 285 const char name[XT_EXTENSION_MAXNAMELEN];
289 u_int8_t revision; 286 u_int8_t revision;
290 287
291 /* Return true or false: return FALSE and set *hotdrop = 1 to 288 /* Return true or false: return FALSE and set *hotdrop = 1 to
@@ -294,10 +291,10 @@ struct xt_match {
294 non-linear skb, using skb_header_pointer and 291 non-linear skb, using skb_header_pointer and
295 skb_ip_make_writable. */ 292 skb_ip_make_writable. */
296 bool (*match)(const struct sk_buff *skb, 293 bool (*match)(const struct sk_buff *skb,
297 const struct xt_match_param *); 294 struct xt_action_param *);
298 295
299 /* Called when user tries to insert an entry of this type. */ 296 /* Called when user tries to insert an entry of this type. */
300 bool (*checkentry)(const struct xt_mtchk_param *); 297 int (*checkentry)(const struct xt_mtchk_param *);
301 298
302 /* Called when entry of this type deleted. */ 299 /* Called when entry of this type deleted. */
303 void (*destroy)(const struct xt_mtdtor_param *); 300 void (*destroy)(const struct xt_mtdtor_param *);
@@ -309,9 +306,6 @@ struct xt_match {
309 /* Set this to THIS_MODULE if you are a module, otherwise NULL */ 306 /* Set this to THIS_MODULE if you are a module, otherwise NULL */
310 struct module *me; 307 struct module *me;
311 308
312 /* Free to use by each match */
313 unsigned long data;
314
315 const char *table; 309 const char *table;
316 unsigned int matchsize; 310 unsigned int matchsize;
317#ifdef CONFIG_COMPAT 311#ifdef CONFIG_COMPAT
@@ -327,19 +321,20 @@ struct xt_match {
327struct xt_target { 321struct xt_target {
328 struct list_head list; 322 struct list_head list;
329 323
330 const char name[XT_FUNCTION_MAXNAMELEN-1]; 324 const char name[XT_EXTENSION_MAXNAMELEN];
325 u_int8_t revision;
331 326
332 /* Returns verdict. Argument order changed since 2.6.9, as this 327 /* Returns verdict. Argument order changed since 2.6.9, as this
333 must now handle non-linear skbs, using skb_copy_bits and 328 must now handle non-linear skbs, using skb_copy_bits and
334 skb_ip_make_writable. */ 329 skb_ip_make_writable. */
335 unsigned int (*target)(struct sk_buff *skb, 330 unsigned int (*target)(struct sk_buff *skb,
336 const struct xt_target_param *); 331 const struct xt_action_param *);
337 332
338 /* Called when user tries to insert an entry of this type: 333 /* Called when user tries to insert an entry of this type:
339 hook_mask is a bitmask of hooks from which it can be 334 hook_mask is a bitmask of hooks from which it can be
340 called. */ 335 called. */
341 /* Should return true or false. */ 336 /* Should return 0 on success or an error code otherwise (-Exxxx). */
342 bool (*checkentry)(const struct xt_tgchk_param *); 337 int (*checkentry)(const struct xt_tgchk_param *);
343 338
344 /* Called when entry of this type deleted. */ 339 /* Called when entry of this type deleted. */
345 void (*destroy)(const struct xt_tgdtor_param *); 340 void (*destroy)(const struct xt_tgdtor_param *);
@@ -360,7 +355,6 @@ struct xt_target {
360 unsigned short proto; 355 unsigned short proto;
361 356
362 unsigned short family; 357 unsigned short family;
363 u_int8_t revision;
364}; 358};
365 359
366/* Furniture shopping... */ 360/* Furniture shopping... */
@@ -398,6 +392,13 @@ struct xt_table_info {
398 unsigned int hook_entry[NF_INET_NUMHOOKS]; 392 unsigned int hook_entry[NF_INET_NUMHOOKS];
399 unsigned int underflow[NF_INET_NUMHOOKS]; 393 unsigned int underflow[NF_INET_NUMHOOKS];
400 394
395 /*
396 * Number of user chains. Since tables cannot have loops, at most
397 * @stacksize jumps (number of user chains) can possibly be made.
398 */
399 unsigned int stacksize;
400 unsigned int __percpu *stackptr;
401 void ***jumpstack;
401 /* ipt_entry tables: one per CPU */ 402 /* ipt_entry tables: one per CPU */
402 /* Note : this field MUST be the last one, see XT_TABLE_INFO_SZ */ 403 /* Note : this field MUST be the last one, see XT_TABLE_INFO_SZ */
403 void *entries[1]; 404 void *entries[1];
@@ -433,6 +434,8 @@ extern struct xt_table_info *xt_replace_table(struct xt_table *table,
433 434
434extern struct xt_match *xt_find_match(u8 af, const char *name, u8 revision); 435extern struct xt_match *xt_find_match(u8 af, const char *name, u8 revision);
435extern struct xt_target *xt_find_target(u8 af, const char *name, u8 revision); 436extern struct xt_target *xt_find_target(u8 af, const char *name, u8 revision);
437extern struct xt_match *xt_request_find_match(u8 af, const char *name,
438 u8 revision);
436extern struct xt_target *xt_request_find_target(u8 af, const char *name, 439extern struct xt_target *xt_request_find_target(u8 af, const char *name,
437 u8 revision); 440 u8 revision);
438extern int xt_find_revision(u8 af, const char *name, u8 revision, 441extern int xt_find_revision(u8 af, const char *name, u8 revision,
@@ -598,7 +601,7 @@ struct _compat_xt_align {
598 compat_u64 u64; 601 compat_u64 u64;
599}; 602};
600 603
601#define COMPAT_XT_ALIGN(s) ALIGN((s), __alignof__(struct _compat_xt_align)) 604#define COMPAT_XT_ALIGN(s) __ALIGN_KERNEL((s), __alignof__(struct _compat_xt_align))
602 605
603extern void xt_compat_lock(u_int8_t af); 606extern void xt_compat_lock(u_int8_t af);
604extern void xt_compat_unlock(u_int8_t af); 607extern void xt_compat_unlock(u_int8_t af);
diff --git a/include/linux/netfilter/xt_CONNMARK.h b/include/linux/netfilter/xt_CONNMARK.h
index 0a8545866752..2f2e48ec8023 100644
--- a/include/linux/netfilter/xt_CONNMARK.h
+++ b/include/linux/netfilter/xt_CONNMARK.h
@@ -1,26 +1,6 @@
1#ifndef _XT_CONNMARK_H_target 1#ifndef _XT_CONNMARK_H_target
2#define _XT_CONNMARK_H_target 2#define _XT_CONNMARK_H_target
3 3
4#include <linux/types.h> 4#include <linux/netfilter/xt_connmark.h>
5
6/* Copyright (C) 2002,2004 MARA Systems AB <http://www.marasystems.com>
7 * by Henrik Nordstrom <hno@marasystems.com>
8 *
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License as published by
11 * the Free Software Foundation; either version 2 of the License, or
12 * (at your option) any later version.
13 */
14
15enum {
16 XT_CONNMARK_SET = 0,
17 XT_CONNMARK_SAVE,
18 XT_CONNMARK_RESTORE
19};
20
21struct xt_connmark_tginfo1 {
22 __u32 ctmark, ctmask, nfmask;
23 __u8 mode;
24};
25 5
26#endif /*_XT_CONNMARK_H_target*/ 6#endif /*_XT_CONNMARK_H_target*/
diff --git a/include/linux/netfilter/xt_MARK.h b/include/linux/netfilter/xt_MARK.h
index bc9561bdef79..41c456deba22 100644
--- a/include/linux/netfilter/xt_MARK.h
+++ b/include/linux/netfilter/xt_MARK.h
@@ -1,10 +1,6 @@
1#ifndef _XT_MARK_H_target 1#ifndef _XT_MARK_H_target
2#define _XT_MARK_H_target 2#define _XT_MARK_H_target
3 3
4#include <linux/types.h> 4#include <linux/netfilter/xt_mark.h>
5
6struct xt_mark_tginfo2 {
7 __u32 mark, mask;
8};
9 5
10#endif /*_XT_MARK_H_target */ 6#endif /*_XT_MARK_H_target */
diff --git a/include/linux/netfilter/xt_TEE.h b/include/linux/netfilter/xt_TEE.h
new file mode 100644
index 000000000000..5c21d5c829af
--- /dev/null
+++ b/include/linux/netfilter/xt_TEE.h
@@ -0,0 +1,12 @@
1#ifndef _XT_TEE_TARGET_H
2#define _XT_TEE_TARGET_H
3
4struct xt_tee_tginfo {
5 union nf_inet_addr gw;
6 char oif[16];
7
8 /* used internally by the kernel */
9 struct xt_tee_priv *priv __attribute__((aligned(8)));
10};
11
12#endif /* _XT_TEE_TARGET_H */
diff --git a/include/linux/netfilter/xt_connmark.h b/include/linux/netfilter/xt_connmark.h
index 619e47cde01a..efc17a8305fb 100644
--- a/include/linux/netfilter/xt_connmark.h
+++ b/include/linux/netfilter/xt_connmark.h
@@ -12,6 +12,17 @@
12 * (at your option) any later version. 12 * (at your option) any later version.
13 */ 13 */
14 14
15enum {
16 XT_CONNMARK_SET = 0,
17 XT_CONNMARK_SAVE,
18 XT_CONNMARK_RESTORE
19};
20
21struct xt_connmark_tginfo1 {
22 __u32 ctmark, ctmask, nfmask;
23 __u8 mode;
24};
25
15struct xt_connmark_mtinfo1 { 26struct xt_connmark_mtinfo1 {
16 __u32 mark, mask; 27 __u32 mark, mask;
17 __u8 invert; 28 __u8 invert;
diff --git a/include/linux/netfilter/xt_mark.h b/include/linux/netfilter/xt_mark.h
index 6607c8f38ea5..ecadc40d5cde 100644
--- a/include/linux/netfilter/xt_mark.h
+++ b/include/linux/netfilter/xt_mark.h
@@ -3,6 +3,10 @@
3 3
4#include <linux/types.h> 4#include <linux/types.h>
5 5
6struct xt_mark_tginfo2 {
7 __u32 mark, mask;
8};
9
6struct xt_mark_mtinfo1 { 10struct xt_mark_mtinfo1 {
7 __u32 mark, mask; 11 __u32 mark, mask;
8 __u8 invert; 12 __u8 invert;
diff --git a/include/linux/netfilter/xt_recent.h b/include/linux/netfilter/xt_recent.h
index d2c276609925..83318e01425e 100644
--- a/include/linux/netfilter/xt_recent.h
+++ b/include/linux/netfilter/xt_recent.h
@@ -9,6 +9,7 @@ enum {
9 XT_RECENT_UPDATE = 1 << 2, 9 XT_RECENT_UPDATE = 1 << 2,
10 XT_RECENT_REMOVE = 1 << 3, 10 XT_RECENT_REMOVE = 1 << 3,
11 XT_RECENT_TTL = 1 << 4, 11 XT_RECENT_TTL = 1 << 4,
12 XT_RECENT_REAP = 1 << 5,
12 13
13 XT_RECENT_SOURCE = 0, 14 XT_RECENT_SOURCE = 0,
14 XT_RECENT_DEST = 1, 15 XT_RECENT_DEST = 1,
@@ -16,6 +17,12 @@ enum {
16 XT_RECENT_NAME_LEN = 200, 17 XT_RECENT_NAME_LEN = 200,
17}; 18};
18 19
20/* Only allowed with --rcheck and --update */
21#define XT_RECENT_MODIFIERS (XT_RECENT_TTL|XT_RECENT_REAP)
22
23#define XT_RECENT_VALID_FLAGS (XT_RECENT_CHECK|XT_RECENT_SET|XT_RECENT_UPDATE|\
24 XT_RECENT_REMOVE|XT_RECENT_TTL|XT_RECENT_REAP)
25
19struct xt_recent_mtinfo { 26struct xt_recent_mtinfo {
20 __u32 seconds; 27 __u32 seconds;
21 __u32 hit_count; 28 __u32 hit_count;
diff --git a/include/linux/netfilter_bridge.h b/include/linux/netfilter_bridge.h
index f8105e54716a..0ddd161f3b06 100644
--- a/include/linux/netfilter_bridge.h
+++ b/include/linux/netfilter_bridge.h
@@ -41,10 +41,10 @@ enum nf_br_hook_priorities {
41 41
42#define BRNF_PKT_TYPE 0x01 42#define BRNF_PKT_TYPE 0x01
43#define BRNF_BRIDGED_DNAT 0x02 43#define BRNF_BRIDGED_DNAT 0x02
44#define BRNF_DONT_TAKE_PARENT 0x04 44#define BRNF_BRIDGED 0x04
45#define BRNF_BRIDGED 0x08 45#define BRNF_NF_BRIDGE_PREROUTING 0x08
46#define BRNF_NF_BRIDGE_PREROUTING 0x10 46#define BRNF_8021Q 0x10
47 47#define BRNF_PPPoE 0x20
48 48
49/* Only used in br_forward.c */ 49/* Only used in br_forward.c */
50extern int nf_bridge_copy_header(struct sk_buff *skb); 50extern int nf_bridge_copy_header(struct sk_buff *skb);
@@ -68,6 +68,27 @@ static inline unsigned int nf_bridge_encap_header_len(const struct sk_buff *skb)
68 } 68 }
69} 69}
70 70
71static inline unsigned int nf_bridge_mtu_reduction(const struct sk_buff *skb)
72{
73 if (unlikely(skb->nf_bridge->mask & BRNF_PPPoE))
74 return PPPOE_SES_HLEN;
75 return 0;
76}
77
78extern int br_handle_frame_finish(struct sk_buff *skb);
79/* Only used in br_device.c */
80static inline int br_nf_pre_routing_finish_bridge_slow(struct sk_buff *skb)
81{
82 struct nf_bridge_info *nf_bridge = skb->nf_bridge;
83
84 skb_pull(skb, ETH_HLEN);
85 nf_bridge->mask ^= BRNF_BRIDGED_DNAT;
86 skb_copy_to_linear_data_offset(skb, -(ETH_HLEN-ETH_ALEN),
87 skb->nf_bridge->data, ETH_HLEN-ETH_ALEN);
88 skb->dev = nf_bridge->physindev;
89 return br_handle_frame_finish(skb);
90}
91
71/* This is called by the IP fragmenting code and it ensures there is 92/* This is called by the IP fragmenting code and it ensures there is
72 * enough room for the encapsulating header (if there is one). */ 93 * enough room for the encapsulating header (if there is one). */
73static inline unsigned int nf_bridge_pad(const struct sk_buff *skb) 94static inline unsigned int nf_bridge_pad(const struct sk_buff *skb)
diff --git a/include/linux/netfilter_ipv6/ip6_tables.h b/include/linux/netfilter_ipv6/ip6_tables.h
index e5ba03d783c6..18442ff19c07 100644
--- a/include/linux/netfilter_ipv6/ip6_tables.h
+++ b/include/linux/netfilter_ipv6/ip6_tables.h
@@ -316,10 +316,6 @@ extern int ip6t_ext_hdr(u8 nexthdr);
316extern int ipv6_find_hdr(const struct sk_buff *skb, unsigned int *offset, 316extern int ipv6_find_hdr(const struct sk_buff *skb, unsigned int *offset,
317 int target, unsigned short *fragoff); 317 int target, unsigned short *fragoff);
318 318
319extern int ip6_masked_addrcmp(const struct in6_addr *addr1,
320 const struct in6_addr *mask,
321 const struct in6_addr *addr2);
322
323#define IP6T_ALIGN(s) XT_ALIGN(s) 319#define IP6T_ALIGN(s) XT_ALIGN(s)
324 320
325#ifdef CONFIG_COMPAT 321#ifdef CONFIG_COMPAT
diff --git a/include/linux/netlink.h b/include/linux/netlink.h
index 6eaca5e1e8ca..59d066936ab9 100644
--- a/include/linux/netlink.h
+++ b/include/linux/netlink.h
@@ -188,6 +188,10 @@ extern int netlink_has_listeners(struct sock *sk, unsigned int group);
188extern int netlink_unicast(struct sock *ssk, struct sk_buff *skb, __u32 pid, int nonblock); 188extern int netlink_unicast(struct sock *ssk, struct sk_buff *skb, __u32 pid, int nonblock);
189extern int netlink_broadcast(struct sock *ssk, struct sk_buff *skb, __u32 pid, 189extern int netlink_broadcast(struct sock *ssk, struct sk_buff *skb, __u32 pid,
190 __u32 group, gfp_t allocation); 190 __u32 group, gfp_t allocation);
191extern int netlink_broadcast_filtered(struct sock *ssk, struct sk_buff *skb,
192 __u32 pid, __u32 group, gfp_t allocation,
193 int (*filter)(struct sock *dsk, struct sk_buff *skb, void *data),
194 void *filter_data);
191extern int netlink_set_err(struct sock *ssk, __u32 pid, __u32 group, int code); 195extern int netlink_set_err(struct sock *ssk, __u32 pid, __u32 group, int code);
192extern int netlink_register_notifier(struct notifier_block *nb); 196extern int netlink_register_notifier(struct notifier_block *nb);
193extern int netlink_unregister_notifier(struct notifier_block *nb); 197extern int netlink_unregister_notifier(struct notifier_block *nb);
diff --git a/include/linux/nfs_fs.h b/include/linux/nfs_fs.h
index 1a0b85aa151e..77c2ae53431c 100644
--- a/include/linux/nfs_fs.h
+++ b/include/linux/nfs_fs.h
@@ -209,6 +209,7 @@ struct nfs_inode {
209#define NFS_INO_FLUSHING (4) /* inode is flushing out data */ 209#define NFS_INO_FLUSHING (4) /* inode is flushing out data */
210#define NFS_INO_FSCACHE (5) /* inode can be cached by FS-Cache */ 210#define NFS_INO_FSCACHE (5) /* inode can be cached by FS-Cache */
211#define NFS_INO_FSCACHE_LOCK (6) /* FS-Cache cookie management lock */ 211#define NFS_INO_FSCACHE_LOCK (6) /* FS-Cache cookie management lock */
212#define NFS_INO_COMMIT (7) /* inode is committing unstable writes */
212 213
213static inline struct nfs_inode *NFS_I(const struct inode *inode) 214static inline struct nfs_inode *NFS_I(const struct inode *inode)
214{ 215{
@@ -355,6 +356,20 @@ extern struct nfs_open_context *nfs_find_open_context(struct inode *inode, struc
355extern u64 nfs_compat_user_ino64(u64 fileid); 356extern u64 nfs_compat_user_ino64(u64 fileid);
356extern void nfs_fattr_init(struct nfs_fattr *fattr); 357extern void nfs_fattr_init(struct nfs_fattr *fattr);
357 358
359extern struct nfs_fattr *nfs_alloc_fattr(void);
360
361static inline void nfs_free_fattr(const struct nfs_fattr *fattr)
362{
363 kfree(fattr);
364}
365
366extern struct nfs_fh *nfs_alloc_fhandle(void);
367
368static inline void nfs_free_fhandle(const struct nfs_fh *fh)
369{
370 kfree(fh);
371}
372
358/* linux/net/ipv4/ipconfig.c: trims ip addr off front of name, too. */ 373/* linux/net/ipv4/ipconfig.c: trims ip addr off front of name, too. */
359extern __be32 root_nfs_parse_addr(char *name); /*__init*/ 374extern __be32 root_nfs_parse_addr(char *name); /*__init*/
360extern unsigned long nfs_inc_attr_generation_counter(void); 375extern unsigned long nfs_inc_attr_generation_counter(void);
diff --git a/include/linux/nfs_fs_sb.h b/include/linux/nfs_fs_sb.h
index e82957acea56..d6e10a4c06e5 100644
--- a/include/linux/nfs_fs_sb.h
+++ b/include/linux/nfs_fs_sb.h
@@ -44,7 +44,6 @@ struct nfs_client {
44 44
45#ifdef CONFIG_NFS_V4 45#ifdef CONFIG_NFS_V4
46 u64 cl_clientid; /* constant */ 46 u64 cl_clientid; /* constant */
47 nfs4_verifier cl_confirm;
48 unsigned long cl_state; 47 unsigned long cl_state;
49 48
50 struct rb_root cl_openowner_id; 49 struct rb_root cl_openowner_id;
diff --git a/include/linux/nfs_xdr.h b/include/linux/nfs_xdr.h
index 89b28812ec24..51914d7d6cc4 100644
--- a/include/linux/nfs_xdr.h
+++ b/include/linux/nfs_xdr.h
@@ -386,8 +386,8 @@ struct nfs_removeargs {
386 386
387struct nfs_removeres { 387struct nfs_removeres {
388 const struct nfs_server *server; 388 const struct nfs_server *server;
389 struct nfs_fattr *dir_attr;
389 struct nfs4_change_info cinfo; 390 struct nfs4_change_info cinfo;
390 struct nfs_fattr dir_attr;
391 struct nfs4_sequence_res seq_res; 391 struct nfs4_sequence_res seq_res;
392}; 392};
393 393
@@ -824,6 +824,11 @@ struct nfs4_setclientid {
824 u32 sc_cb_ident; 824 u32 sc_cb_ident;
825}; 825};
826 826
827struct nfs4_setclientid_res {
828 u64 clientid;
829 nfs4_verifier confirm;
830};
831
827struct nfs4_statfs_arg { 832struct nfs4_statfs_arg {
828 const struct nfs_fh * fh; 833 const struct nfs_fh * fh;
829 const u32 * bitmask; 834 const u32 * bitmask;
diff --git a/include/linux/nfsd/nfsfh.h b/include/linux/nfsd/nfsfh.h
index 65e333afaee4..80d55bbc5365 100644
--- a/include/linux/nfsd/nfsfh.h
+++ b/include/linux/nfsd/nfsfh.h
@@ -40,12 +40,12 @@ struct nfs_fhbase_old {
40 * This is the new flexible, extensible style NFSv2/v3 file handle. 40 * This is the new flexible, extensible style NFSv2/v3 file handle.
41 * by Neil Brown <neilb@cse.unsw.edu.au> - March 2000 41 * by Neil Brown <neilb@cse.unsw.edu.au> - March 2000
42 * 42 *
43 * The file handle is seens as a list of 4byte words. 43 * The file handle starts with a sequence of four-byte words.
44 * The first word contains a version number (1) and four descriptor bytes 44 * The first word contains a version number (1) and three descriptor bytes
45 * that tell how the remaining 3 variable length fields should be handled. 45 * that tell how the remaining 3 variable length fields should be handled.
46 * These three bytes are auth_type, fsid_type and fileid_type. 46 * These three bytes are auth_type, fsid_type and fileid_type.
47 * 47 *
48 * All 4byte values are in host-byte-order. 48 * All four-byte values are in host-byte-order.
49 * 49 *
50 * The auth_type field specifies how the filehandle can be authenticated 50 * The auth_type field specifies how the filehandle can be authenticated
51 * This might allow a file to be confirmed to be in a writable part of a 51 * This might allow a file to be confirmed to be in a writable part of a
diff --git a/include/linux/nilfs2_fs.h b/include/linux/nilfs2_fs.h
index 640702e97457..8c2c6116e788 100644
--- a/include/linux/nilfs2_fs.h
+++ b/include/linux/nilfs2_fs.h
@@ -199,16 +199,15 @@ struct nilfs_super_block {
199 __le32 s_creator_os; /* OS */ 199 __le32 s_creator_os; /* OS */
200 __le16 s_def_resuid; /* Default uid for reserved blocks */ 200 __le16 s_def_resuid; /* Default uid for reserved blocks */
201 __le16 s_def_resgid; /* Default gid for reserved blocks */ 201 __le16 s_def_resgid; /* Default gid for reserved blocks */
202 __le32 s_first_ino; /* First non-reserved inode */ 202 __le32 s_first_ino; /* First non-reserved inode */
203 203
204 __le16 s_inode_size; /* Size of an inode */ 204 __le16 s_inode_size; /* Size of an inode */
205 __le16 s_dat_entry_size; /* Size of a dat entry */ 205 __le16 s_dat_entry_size; /* Size of a dat entry */
206 __le16 s_checkpoint_size; /* Size of a checkpoint */ 206 __le16 s_checkpoint_size; /* Size of a checkpoint */
207 __le16 s_segment_usage_size; /* Size of a segment usage */ 207 __le16 s_segment_usage_size; /* Size of a segment usage */
208 208
209 __u8 s_uuid[16]; /* 128-bit uuid for volume */ 209 __u8 s_uuid[16]; /* 128-bit uuid for volume */
210 char s_volume_name[16]; /* volume name */ 210 char s_volume_name[80]; /* volume name */
211 char s_last_mounted[64]; /* directory where last mounted */
212 211
213 __le32 s_c_interval; /* Commit interval of segment */ 212 __le32 s_c_interval; /* Commit interval of segment */
214 __le32 s_c_block_max; /* Threshold of data amount for 213 __le32 s_c_block_max; /* Threshold of data amount for
@@ -377,6 +376,7 @@ union nilfs_binfo {
377 * @ss_nfinfo: number of finfo structures 376 * @ss_nfinfo: number of finfo structures
378 * @ss_sumbytes: total size of segment summary in bytes 377 * @ss_sumbytes: total size of segment summary in bytes
379 * @ss_pad: padding 378 * @ss_pad: padding
379 * @ss_cno: checkpoint number
380 */ 380 */
381struct nilfs_segment_summary { 381struct nilfs_segment_summary {
382 __le32 ss_datasum; 382 __le32 ss_datasum;
@@ -391,6 +391,7 @@ struct nilfs_segment_summary {
391 __le32 ss_nfinfo; 391 __le32 ss_nfinfo;
392 __le32 ss_sumbytes; 392 __le32 ss_sumbytes;
393 __le32 ss_pad; 393 __le32 ss_pad;
394 __le64 ss_cno;
394 /* array of finfo structures */ 395 /* array of finfo structures */
395}; 396};
396 397
@@ -437,10 +438,10 @@ struct nilfs_palloc_group_desc {
437 438
438/** 439/**
439 * struct nilfs_dat_entry - disk address translation entry 440 * struct nilfs_dat_entry - disk address translation entry
440 * @dt_blocknr: block number 441 * @de_blocknr: block number
441 * @dt_start: start checkpoint number 442 * @de_start: start checkpoint number
442 * @dt_end: end checkpoint number 443 * @de_end: end checkpoint number
443 * @dt_rsv: reserved for future use 444 * @de_rsv: reserved for future use
444 */ 445 */
445struct nilfs_dat_entry { 446struct nilfs_dat_entry {
446 __le64 de_blocknr; 447 __le64 de_blocknr;
diff --git a/include/linux/nl80211.h b/include/linux/nl80211.h
index f8750f9a65b8..b7c77f9712f4 100644
--- a/include/linux/nl80211.h
+++ b/include/linux/nl80211.h
@@ -52,6 +52,8 @@
52 * %NL80211_ATTR_WIPHY_CHANNEL_TYPE, %NL80211_ATTR_WIPHY_RETRY_SHORT, 52 * %NL80211_ATTR_WIPHY_CHANNEL_TYPE, %NL80211_ATTR_WIPHY_RETRY_SHORT,
53 * %NL80211_ATTR_WIPHY_RETRY_LONG, %NL80211_ATTR_WIPHY_FRAG_THRESHOLD, 53 * %NL80211_ATTR_WIPHY_RETRY_LONG, %NL80211_ATTR_WIPHY_FRAG_THRESHOLD,
54 * and/or %NL80211_ATTR_WIPHY_RTS_THRESHOLD. 54 * and/or %NL80211_ATTR_WIPHY_RTS_THRESHOLD.
55 * However, for setting the channel, see %NL80211_CMD_SET_CHANNEL
56 * instead, the support here is for backward compatibility only.
55 * @NL80211_CMD_NEW_WIPHY: Newly created wiphy, response to get request 57 * @NL80211_CMD_NEW_WIPHY: Newly created wiphy, response to get request
56 * or rename notification. Has attributes %NL80211_ATTR_WIPHY and 58 * or rename notification. Has attributes %NL80211_ATTR_WIPHY and
57 * %NL80211_ATTR_WIPHY_NAME. 59 * %NL80211_ATTR_WIPHY_NAME.
@@ -329,6 +331,15 @@
329 * @NL80211_CMD_NOTIFY_CQM: Connection quality monitor notification. This 331 * @NL80211_CMD_NOTIFY_CQM: Connection quality monitor notification. This
330 * command is used as an event to indicate the that a trigger level was 332 * command is used as an event to indicate the that a trigger level was
331 * reached. 333 * reached.
334 * @NL80211_CMD_SET_CHANNEL: Set the channel (using %NL80211_ATTR_WIPHY_FREQ
335 * and %NL80211_ATTR_WIPHY_CHANNEL_TYPE) the given interface (identifed
336 * by %NL80211_ATTR_IFINDEX) shall operate on.
337 * In case multiple channels are supported by the device, the mechanism
338 * with which it switches channels is implementation-defined.
339 * When a monitor interface is given, it can only switch channel while
340 * no other interfaces are operating to avoid disturbing the operation
341 * of any other interfaces, and other interfaces will again take
342 * precedence when they are used.
332 * 343 *
333 * @NL80211_CMD_MAX: highest used command number 344 * @NL80211_CMD_MAX: highest used command number
334 * @__NL80211_CMD_AFTER_LAST: internal use 345 * @__NL80211_CMD_AFTER_LAST: internal use
@@ -428,6 +439,8 @@ enum nl80211_commands {
428 NL80211_CMD_SET_CQM, 439 NL80211_CMD_SET_CQM,
429 NL80211_CMD_NOTIFY_CQM, 440 NL80211_CMD_NOTIFY_CQM,
430 441
442 NL80211_CMD_SET_CHANNEL,
443
431 /* add new commands above here */ 444 /* add new commands above here */
432 445
433 /* used to define NL80211_CMD_MAX below */ 446 /* used to define NL80211_CMD_MAX below */
diff --git a/include/linux/notifier.h b/include/linux/notifier.h
index 7c3609622334..540703b555cb 100644
--- a/include/linux/notifier.h
+++ b/include/linux/notifier.h
@@ -164,7 +164,10 @@ extern int __srcu_notifier_call_chain(struct srcu_notifier_head *nh,
164/* Encapsulate (negative) errno value (in particular, NOTIFY_BAD <=> EPERM). */ 164/* Encapsulate (negative) errno value (in particular, NOTIFY_BAD <=> EPERM). */
165static inline int notifier_from_errno(int err) 165static inline int notifier_from_errno(int err)
166{ 166{
167 return NOTIFY_STOP_MASK | (NOTIFY_OK - err); 167 if (err)
168 return NOTIFY_STOP_MASK | (NOTIFY_OK - err);
169
170 return NOTIFY_OK;
168} 171}
169 172
170/* Restore (negative) errno value from notify return value. */ 173/* Restore (negative) errno value from notify return value. */
diff --git a/include/linux/of_device.h b/include/linux/of_device.h
index d3a74e00a3e1..11651facc5f1 100644
--- a/include/linux/of_device.h
+++ b/include/linux/of_device.h
@@ -1,6 +1,7 @@
1#ifndef _LINUX_OF_DEVICE_H 1#ifndef _LINUX_OF_DEVICE_H
2#define _LINUX_OF_DEVICE_H 2#define _LINUX_OF_DEVICE_H
3 3
4#ifdef CONFIG_OF_DEVICE
4#include <linux/device.h> 5#include <linux/device.h>
5#include <linux/of.h> 6#include <linux/of.h>
6#include <linux/mod_devicetable.h> 7#include <linux/mod_devicetable.h>
@@ -10,7 +11,7 @@
10#define to_of_device(d) container_of(d, struct of_device, dev) 11#define to_of_device(d) container_of(d, struct of_device, dev)
11 12
12extern const struct of_device_id *of_match_device( 13extern const struct of_device_id *of_match_device(
13 const struct of_device_id *matches, const struct of_device *dev); 14 const struct of_device_id *matches, const struct device *dev);
14 15
15extern struct of_device *of_dev_get(struct of_device *dev); 16extern struct of_device *of_dev_get(struct of_device *dev);
16extern void of_dev_put(struct of_device *dev); 17extern void of_dev_put(struct of_device *dev);
@@ -26,5 +27,6 @@ static inline void of_device_free(struct of_device *dev)
26 27
27extern ssize_t of_device_get_modalias(struct of_device *ofdev, 28extern ssize_t of_device_get_modalias(struct of_device *ofdev,
28 char *str, ssize_t len); 29 char *str, ssize_t len);
30#endif /* CONFIG_OF_DEVICE */
29 31
30#endif /* _LINUX_OF_DEVICE_H */ 32#endif /* _LINUX_OF_DEVICE_H */
diff --git a/include/linux/of_fdt.h b/include/linux/of_fdt.h
index a1ca92ccb0ff..71e1a916d3fa 100644
--- a/include/linux/of_fdt.h
+++ b/include/linux/of_fdt.h
@@ -57,6 +57,7 @@ struct boot_param_header {
57 __be32 dt_struct_size; /* size of the DT structure block */ 57 __be32 dt_struct_size; /* size of the DT structure block */
58}; 58};
59 59
60#if defined(CONFIG_OF_FLATTREE)
60/* TBD: Temporary export of fdt globals - remove when code fully merged */ 61/* TBD: Temporary export of fdt globals - remove when code fully merged */
61extern int __initdata dt_root_addr_cells; 62extern int __initdata dt_root_addr_cells;
62extern int __initdata dt_root_size_cells; 63extern int __initdata dt_root_size_cells;
@@ -98,6 +99,9 @@ extern int early_init_dt_scan_root(unsigned long node, const char *uname,
98/* Other Prototypes */ 99/* Other Prototypes */
99extern void unflatten_device_tree(void); 100extern void unflatten_device_tree(void);
100extern void early_init_devtree(void *); 101extern void early_init_devtree(void *);
102#else /* CONFIG_OF_FLATTREE */
103static inline void unflatten_device_tree(void) {}
104#endif /* CONFIG_OF_FLATTREE */
101 105
102#endif /* __ASSEMBLY__ */ 106#endif /* __ASSEMBLY__ */
103#endif /* _LINUX_OF_FDT_H */ 107#endif /* _LINUX_OF_FDT_H */
diff --git a/include/linux/of_platform.h b/include/linux/of_platform.h
index 908406651330..1643d3761eb4 100644
--- a/include/linux/of_platform.h
+++ b/include/linux/of_platform.h
@@ -11,6 +11,7 @@
11 * 11 *
12 */ 12 */
13 13
14#ifdef CONFIG_OF_DEVICE
14#include <linux/module.h> 15#include <linux/module.h>
15#include <linux/device.h> 16#include <linux/device.h>
16#include <linux/mod_devicetable.h> 17#include <linux/mod_devicetable.h>
@@ -30,10 +31,6 @@ extern struct bus_type of_platform_bus_type;
30 */ 31 */
31struct of_platform_driver 32struct of_platform_driver
32{ 33{
33 const char *name;
34 const struct of_device_id *match_table;
35 struct module *owner;
36
37 int (*probe)(struct of_device* dev, 34 int (*probe)(struct of_device* dev,
38 const struct of_device_id *match); 35 const struct of_device_id *match);
39 int (*remove)(struct of_device* dev); 36 int (*remove)(struct of_device* dev);
@@ -66,5 +63,6 @@ static inline void of_unregister_platform_driver(struct of_platform_driver *drv)
66extern struct of_device *of_find_device_by_node(struct device_node *np); 63extern struct of_device *of_find_device_by_node(struct device_node *np);
67 64
68extern int of_bus_type_init(struct bus_type *bus, const char *name); 65extern int of_bus_type_init(struct bus_type *bus, const char *name);
66#endif /* CONFIG_OF_DEVICE */
69 67
70#endif /* _LINUX_OF_PLATFORM_H */ 68#endif /* _LINUX_OF_PLATFORM_H */
diff --git a/include/linux/padata.h b/include/linux/padata.h
index 51611da9c498..8d8406246eef 100644
--- a/include/linux/padata.h
+++ b/include/linux/padata.h
@@ -24,7 +24,19 @@
24#include <linux/workqueue.h> 24#include <linux/workqueue.h>
25#include <linux/spinlock.h> 25#include <linux/spinlock.h>
26#include <linux/list.h> 26#include <linux/list.h>
27#include <linux/timer.h>
27 28
29/**
30 * struct padata_priv - Embedded to the users data structure.
31 *
32 * @list: List entry, to attach to the padata lists.
33 * @pd: Pointer to the internal control structure.
34 * @cb_cpu: Callback cpu for serializatioon.
35 * @seq_nr: Sequence number of the parallelized data object.
36 * @info: Used to pass information from the parallel to the serial function.
37 * @parallel: Parallel execution function.
38 * @serial: Serial complete function.
39 */
28struct padata_priv { 40struct padata_priv {
29 struct list_head list; 41 struct list_head list;
30 struct parallel_data *pd; 42 struct parallel_data *pd;
@@ -35,11 +47,29 @@ struct padata_priv {
35 void (*serial)(struct padata_priv *padata); 47 void (*serial)(struct padata_priv *padata);
36}; 48};
37 49
50/**
51 * struct padata_list
52 *
53 * @list: List head.
54 * @lock: List lock.
55 */
38struct padata_list { 56struct padata_list {
39 struct list_head list; 57 struct list_head list;
40 spinlock_t lock; 58 spinlock_t lock;
41}; 59};
42 60
61/**
62 * struct padata_queue - The percpu padata queues.
63 *
64 * @parallel: List to wait for parallelization.
65 * @reorder: List to wait for reordering after parallel processing.
66 * @serial: List to wait for serialization after reordering.
67 * @pwork: work struct for parallelization.
68 * @swork: work struct for serialization.
69 * @pd: Backpointer to the internal control structure.
70 * @num_obj: Number of objects that are processed by this cpu.
71 * @cpu_index: Index of the cpu.
72 */
43struct padata_queue { 73struct padata_queue {
44 struct padata_list parallel; 74 struct padata_list parallel;
45 struct padata_list reorder; 75 struct padata_list reorder;
@@ -51,6 +81,20 @@ struct padata_queue {
51 int cpu_index; 81 int cpu_index;
52}; 82};
53 83
84/**
85 * struct parallel_data - Internal control structure, covers everything
86 * that depends on the cpumask in use.
87 *
88 * @pinst: padata instance.
89 * @queue: percpu padata queues.
90 * @seq_nr: The sequence number that will be attached to the next object.
91 * @reorder_objects: Number of objects waiting in the reorder queues.
92 * @refcnt: Number of objects holding a reference on this parallel_data.
93 * @max_seq_nr: Maximal used sequence number.
94 * @cpumask: cpumask in use.
95 * @lock: Reorder lock.
96 * @timer: Reorder timer.
97 */
54struct parallel_data { 98struct parallel_data {
55 struct padata_instance *pinst; 99 struct padata_instance *pinst;
56 struct padata_queue *queue; 100 struct padata_queue *queue;
@@ -60,8 +104,19 @@ struct parallel_data {
60 unsigned int max_seq_nr; 104 unsigned int max_seq_nr;
61 cpumask_var_t cpumask; 105 cpumask_var_t cpumask;
62 spinlock_t lock; 106 spinlock_t lock;
107 struct timer_list timer;
63}; 108};
64 109
110/**
111 * struct padata_instance - The overall control structure.
112 *
113 * @cpu_notifier: cpu hotplug notifier.
114 * @wq: The workqueue in use.
115 * @pd: The internal control structure.
116 * @cpumask: User supplied cpumask.
117 * @lock: padata instance lock.
118 * @flags: padata flags.
119 */
65struct padata_instance { 120struct padata_instance {
66 struct notifier_block cpu_notifier; 121 struct notifier_block cpu_notifier;
67 struct workqueue_struct *wq; 122 struct workqueue_struct *wq;
diff --git a/include/linux/page_cgroup.h b/include/linux/page_cgroup.h
index aef22ae2af47..5bb13b3db84d 100644
--- a/include/linux/page_cgroup.h
+++ b/include/linux/page_cgroup.h
@@ -40,6 +40,7 @@ enum {
40 PCG_USED, /* this object is in use. */ 40 PCG_USED, /* this object is in use. */
41 PCG_ACCT_LRU, /* page has been accounted for */ 41 PCG_ACCT_LRU, /* page has been accounted for */
42 PCG_FILE_MAPPED, /* page is accounted as "mapped" */ 42 PCG_FILE_MAPPED, /* page is accounted as "mapped" */
43 PCG_MIGRATION, /* under page migration */
43}; 44};
44 45
45#define TESTPCGFLAG(uname, lname) \ 46#define TESTPCGFLAG(uname, lname) \
@@ -79,6 +80,10 @@ SETPCGFLAG(FileMapped, FILE_MAPPED)
79CLEARPCGFLAG(FileMapped, FILE_MAPPED) 80CLEARPCGFLAG(FileMapped, FILE_MAPPED)
80TESTPCGFLAG(FileMapped, FILE_MAPPED) 81TESTPCGFLAG(FileMapped, FILE_MAPPED)
81 82
83SETPCGFLAG(Migration, MIGRATION)
84CLEARPCGFLAG(Migration, MIGRATION)
85TESTPCGFLAG(Migration, MIGRATION)
86
82static inline int page_cgroup_nid(struct page_cgroup *pc) 87static inline int page_cgroup_nid(struct page_cgroup *pc)
83{ 88{
84 return page_to_nid(pc->page); 89 return page_to_nid(pc->page);
diff --git a/include/linux/pci.h b/include/linux/pci.h
index a788fa12ff31..6a471aba3b07 100644
--- a/include/linux/pci.h
+++ b/include/linux/pci.h
@@ -311,7 +311,8 @@ struct pci_dev {
311 unsigned int is_virtfn:1; 311 unsigned int is_virtfn:1;
312 unsigned int reset_fn:1; 312 unsigned int reset_fn:1;
313 unsigned int is_hotplug_bridge:1; 313 unsigned int is_hotplug_bridge:1;
314 unsigned int aer_firmware_first:1; 314 unsigned int __aer_firmware_first_valid:1;
315 unsigned int __aer_firmware_first:1;
315 pci_dev_flags_t dev_flags; 316 pci_dev_flags_t dev_flags;
316 atomic_t enable_cnt; /* pci_enable_device has been called */ 317 atomic_t enable_cnt; /* pci_enable_device has been called */
317 318
@@ -334,6 +335,16 @@ struct pci_dev {
334#endif 335#endif
335}; 336};
336 337
338static inline struct pci_dev *pci_physfn(struct pci_dev *dev)
339{
340#ifdef CONFIG_PCI_IOV
341 if (dev->is_virtfn)
342 dev = dev->physfn;
343#endif
344
345 return dev;
346}
347
337extern struct pci_dev *alloc_pci_dev(void); 348extern struct pci_dev *alloc_pci_dev(void);
338 349
339#define pci_dev_b(n) list_entry(n, struct pci_dev, bus_list) 350#define pci_dev_b(n) list_entry(n, struct pci_dev, bus_list)
diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h
index 9f688d243b86..ae66851870be 100644
--- a/include/linux/pci_ids.h
+++ b/include/linux/pci_ids.h
@@ -2419,8 +2419,8 @@
2419#define PCI_DEVICE_ID_INTEL_82845_HB 0x1a30 2419#define PCI_DEVICE_ID_INTEL_82845_HB 0x1a30
2420#define PCI_DEVICE_ID_INTEL_IOAT 0x1a38 2420#define PCI_DEVICE_ID_INTEL_IOAT 0x1a38
2421#define PCI_DEVICE_ID_INTEL_CPT_SMBUS 0x1c22 2421#define PCI_DEVICE_ID_INTEL_CPT_SMBUS 0x1c22
2422#define PCI_DEVICE_ID_INTEL_CPT_LPC1 0x1c42 2422#define PCI_DEVICE_ID_INTEL_CPT_LPC_MIN 0x1c41
2423#define PCI_DEVICE_ID_INTEL_CPT_LPC2 0x1c43 2423#define PCI_DEVICE_ID_INTEL_CPT_LPC_MAX 0x1c5f
2424#define PCI_DEVICE_ID_INTEL_82801AA_0 0x2410 2424#define PCI_DEVICE_ID_INTEL_82801AA_0 0x2410
2425#define PCI_DEVICE_ID_INTEL_82801AA_1 0x2411 2425#define PCI_DEVICE_ID_INTEL_82801AA_1 0x2411
2426#define PCI_DEVICE_ID_INTEL_82801AA_3 0x2413 2426#define PCI_DEVICE_ID_INTEL_82801AA_3 0x2413
diff --git a/include/linux/pci_regs.h b/include/linux/pci_regs.h
index c4c3d68be19a..455b9ccdfca7 100644
--- a/include/linux/pci_regs.h
+++ b/include/linux/pci_regs.h
@@ -566,8 +566,7 @@
566#define PCI_ERR_ROOT_FIRST_FATAL 0x00000010 /* First Fatal */ 566#define PCI_ERR_ROOT_FIRST_FATAL 0x00000010 /* First Fatal */
567#define PCI_ERR_ROOT_NONFATAL_RCV 0x00000020 /* Non-Fatal Received */ 567#define PCI_ERR_ROOT_NONFATAL_RCV 0x00000020 /* Non-Fatal Received */
568#define PCI_ERR_ROOT_FATAL_RCV 0x00000040 /* Fatal Received */ 568#define PCI_ERR_ROOT_FATAL_RCV 0x00000040 /* Fatal Received */
569#define PCI_ERR_ROOT_COR_SRC 52 569#define PCI_ERR_ROOT_ERR_SRC 52 /* Error Source Identification */
570#define PCI_ERR_ROOT_SRC 54
571 570
572/* Virtual Channel */ 571/* Virtual Channel */
573#define PCI_VC_PORT_REG1 4 572#define PCI_VC_PORT_REG1 4
diff --git a/include/linux/pda_power.h b/include/linux/pda_power.h
index d4cf7a2ceb3e..c9e4d814ff77 100644
--- a/include/linux/pda_power.h
+++ b/include/linux/pda_power.h
@@ -24,6 +24,8 @@ struct pda_power_pdata {
24 int (*is_usb_online)(void); 24 int (*is_usb_online)(void);
25 void (*set_charge)(int flags); 25 void (*set_charge)(int flags);
26 void (*exit)(struct device *dev); 26 void (*exit)(struct device *dev);
27 int (*suspend)(pm_message_t state);
28 int (*resume)(void);
27 29
28 char **supplied_to; 30 char **supplied_to;
29 size_t num_supplicants; 31 size_t num_supplicants;
diff --git a/include/linux/perf_event.h b/include/linux/perf_event.h
index c8e375440403..fb6c91eac7e3 100644
--- a/include/linux/perf_event.h
+++ b/include/linux/perf_event.h
@@ -203,8 +203,19 @@ struct perf_event_attr {
203 enable_on_exec : 1, /* next exec enables */ 203 enable_on_exec : 1, /* next exec enables */
204 task : 1, /* trace fork/exit */ 204 task : 1, /* trace fork/exit */
205 watermark : 1, /* wakeup_watermark */ 205 watermark : 1, /* wakeup_watermark */
206 206 /*
207 __reserved_1 : 49; 207 * precise_ip:
208 *
209 * 0 - SAMPLE_IP can have arbitrary skid
210 * 1 - SAMPLE_IP must have constant skid
211 * 2 - SAMPLE_IP requested to have 0 skid
212 * 3 - SAMPLE_IP must have 0 skid
213 *
214 * See also PERF_RECORD_MISC_EXACT_IP
215 */
216 precise_ip : 2, /* skid constraint */
217
218 __reserved_1 : 47;
208 219
209 union { 220 union {
210 __u32 wakeup_events; /* wakeup every n events */ 221 __u32 wakeup_events; /* wakeup every n events */
@@ -287,11 +298,24 @@ struct perf_event_mmap_page {
287 __u64 data_tail; /* user-space written tail */ 298 __u64 data_tail; /* user-space written tail */
288}; 299};
289 300
290#define PERF_RECORD_MISC_CPUMODE_MASK (3 << 0) 301#define PERF_RECORD_MISC_CPUMODE_MASK (7 << 0)
291#define PERF_RECORD_MISC_CPUMODE_UNKNOWN (0 << 0) 302#define PERF_RECORD_MISC_CPUMODE_UNKNOWN (0 << 0)
292#define PERF_RECORD_MISC_KERNEL (1 << 0) 303#define PERF_RECORD_MISC_KERNEL (1 << 0)
293#define PERF_RECORD_MISC_USER (2 << 0) 304#define PERF_RECORD_MISC_USER (2 << 0)
294#define PERF_RECORD_MISC_HYPERVISOR (3 << 0) 305#define PERF_RECORD_MISC_HYPERVISOR (3 << 0)
306#define PERF_RECORD_MISC_GUEST_KERNEL (4 << 0)
307#define PERF_RECORD_MISC_GUEST_USER (5 << 0)
308
309/*
310 * Indicates that the content of PERF_SAMPLE_IP points to
311 * the actual instruction that triggered the event. See also
312 * perf_event_attr::precise_ip.
313 */
314#define PERF_RECORD_MISC_EXACT_IP (1 << 14)
315/*
316 * Reserve the last bit to indicate some extended misc field
317 */
318#define PERF_RECORD_MISC_EXT_RESERVED (1 << 15)
295 319
296struct perf_event_header { 320struct perf_event_header {
297 __u32 type; 321 __u32 type;
@@ -439,6 +463,12 @@ enum perf_callchain_context {
439# include <asm/perf_event.h> 463# include <asm/perf_event.h>
440#endif 464#endif
441 465
466struct perf_guest_info_callbacks {
467 int (*is_in_guest) (void);
468 int (*is_user_mode) (void);
469 unsigned long (*get_guest_ip) (void);
470};
471
442#ifdef CONFIG_HAVE_HW_BREAKPOINT 472#ifdef CONFIG_HAVE_HW_BREAKPOINT
443#include <asm/hw_breakpoint.h> 473#include <asm/hw_breakpoint.h>
444#endif 474#endif
@@ -455,6 +485,7 @@ enum perf_callchain_context {
455#include <linux/ftrace.h> 485#include <linux/ftrace.h>
456#include <linux/cpu.h> 486#include <linux/cpu.h>
457#include <asm/atomic.h> 487#include <asm/atomic.h>
488#include <asm/local.h>
458 489
459#define PERF_MAX_STACK_DEPTH 255 490#define PERF_MAX_STACK_DEPTH 255
460 491
@@ -468,6 +499,17 @@ struct perf_raw_record {
468 void *data; 499 void *data;
469}; 500};
470 501
502struct perf_branch_entry {
503 __u64 from;
504 __u64 to;
505 __u64 flags;
506};
507
508struct perf_branch_stack {
509 __u64 nr;
510 struct perf_branch_entry entries[0];
511};
512
471struct task_struct; 513struct task_struct;
472 514
473/** 515/**
@@ -506,6 +548,8 @@ struct hw_perf_event {
506 548
507struct perf_event; 549struct perf_event;
508 550
551#define PERF_EVENT_TXN_STARTED 1
552
509/** 553/**
510 * struct pmu - generic performance monitoring unit 554 * struct pmu - generic performance monitoring unit
511 */ 555 */
@@ -516,6 +560,16 @@ struct pmu {
516 void (*stop) (struct perf_event *event); 560 void (*stop) (struct perf_event *event);
517 void (*read) (struct perf_event *event); 561 void (*read) (struct perf_event *event);
518 void (*unthrottle) (struct perf_event *event); 562 void (*unthrottle) (struct perf_event *event);
563
564 /*
565 * group events scheduling is treated as a transaction,
566 * add group events as a whole and perform one schedulability test.
567 * If test fails, roll back the whole group
568 */
569
570 void (*start_txn) (const struct pmu *pmu);
571 void (*cancel_txn) (const struct pmu *pmu);
572 int (*commit_txn) (const struct pmu *pmu);
519}; 573};
520 574
521/** 575/**
@@ -534,21 +588,19 @@ struct perf_mmap_data {
534 struct rcu_head rcu_head; 588 struct rcu_head rcu_head;
535#ifdef CONFIG_PERF_USE_VMALLOC 589#ifdef CONFIG_PERF_USE_VMALLOC
536 struct work_struct work; 590 struct work_struct work;
591 int page_order; /* allocation order */
537#endif 592#endif
538 int data_order;
539 int nr_pages; /* nr of data pages */ 593 int nr_pages; /* nr of data pages */
540 int writable; /* are we writable */ 594 int writable; /* are we writable */
541 int nr_locked; /* nr pages mlocked */ 595 int nr_locked; /* nr pages mlocked */
542 596
543 atomic_t poll; /* POLL_ for wakeups */ 597 atomic_t poll; /* POLL_ for wakeups */
544 atomic_t events; /* event_id limit */
545 598
546 atomic_long_t head; /* write position */ 599 local_t head; /* write position */
547 atomic_long_t done_head; /* completed head */ 600 local_t nest; /* nested writers */
548 601 local_t events; /* event limit */
549 atomic_t lock; /* concurrent writes */ 602 local_t wakeup; /* wakeup stamp */
550 atomic_t wakeup; /* needs a wakeup */ 603 local_t lost; /* nr records lost */
551 atomic_t lost; /* nr records lost */
552 604
553 long watermark; /* wakeup watermark */ 605 long watermark; /* wakeup watermark */
554 606
@@ -571,6 +623,14 @@ enum perf_group_flag {
571 PERF_GROUP_SOFTWARE = 0x1, 623 PERF_GROUP_SOFTWARE = 0x1,
572}; 624};
573 625
626#define SWEVENT_HLIST_BITS 8
627#define SWEVENT_HLIST_SIZE (1 << SWEVENT_HLIST_BITS)
628
629struct swevent_hlist {
630 struct hlist_head heads[SWEVENT_HLIST_SIZE];
631 struct rcu_head rcu_head;
632};
633
574/** 634/**
575 * struct perf_event - performance event kernel representation: 635 * struct perf_event - performance event kernel representation:
576 */ 636 */
@@ -579,6 +639,7 @@ struct perf_event {
579 struct list_head group_entry; 639 struct list_head group_entry;
580 struct list_head event_entry; 640 struct list_head event_entry;
581 struct list_head sibling_list; 641 struct list_head sibling_list;
642 struct hlist_node hlist_entry;
582 int nr_siblings; 643 int nr_siblings;
583 int group_flags; 644 int group_flags;
584 struct perf_event *group_leader; 645 struct perf_event *group_leader;
@@ -666,6 +727,7 @@ struct perf_event {
666 perf_overflow_handler_t overflow_handler; 727 perf_overflow_handler_t overflow_handler;
667 728
668#ifdef CONFIG_EVENT_TRACING 729#ifdef CONFIG_EVENT_TRACING
730 struct ftrace_event_call *tp_event;
669 struct event_filter *filter; 731 struct event_filter *filter;
670#endif 732#endif
671 733
@@ -726,6 +788,9 @@ struct perf_cpu_context {
726 int active_oncpu; 788 int active_oncpu;
727 int max_pertask; 789 int max_pertask;
728 int exclusive; 790 int exclusive;
791 struct swevent_hlist *swevent_hlist;
792 struct mutex hlist_mutex;
793 int hlist_refcount;
729 794
730 /* 795 /*
731 * Recursion avoidance: 796 * Recursion avoidance:
@@ -738,11 +803,12 @@ struct perf_cpu_context {
738struct perf_output_handle { 803struct perf_output_handle {
739 struct perf_event *event; 804 struct perf_event *event;
740 struct perf_mmap_data *data; 805 struct perf_mmap_data *data;
741 unsigned long head; 806 unsigned long wakeup;
742 unsigned long offset; 807 unsigned long size;
808 void *addr;
809 int page;
743 int nmi; 810 int nmi;
744 int sample; 811 int sample;
745 int locked;
746}; 812};
747 813
748#ifdef CONFIG_PERF_EVENTS 814#ifdef CONFIG_PERF_EVENTS
@@ -769,9 +835,6 @@ extern void perf_disable(void);
769extern void perf_enable(void); 835extern void perf_enable(void);
770extern int perf_event_task_disable(void); 836extern int perf_event_task_disable(void);
771extern int perf_event_task_enable(void); 837extern int perf_event_task_enable(void);
772extern int hw_perf_group_sched_in(struct perf_event *group_leader,
773 struct perf_cpu_context *cpuctx,
774 struct perf_event_context *ctx);
775extern void perf_event_update_userpage(struct perf_event *event); 838extern void perf_event_update_userpage(struct perf_event *event);
776extern int perf_event_release_kernel(struct perf_event *event); 839extern int perf_event_release_kernel(struct perf_event *event);
777extern struct perf_event * 840extern struct perf_event *
@@ -902,6 +965,10 @@ static inline void perf_event_mmap(struct vm_area_struct *vma)
902 __perf_event_mmap(vma); 965 __perf_event_mmap(vma);
903} 966}
904 967
968extern struct perf_guest_info_callbacks *perf_guest_cbs;
969extern int perf_register_guest_info_callbacks(struct perf_guest_info_callbacks *callbacks);
970extern int perf_unregister_guest_info_callbacks(struct perf_guest_info_callbacks *callbacks);
971
905extern void perf_event_comm(struct task_struct *tsk); 972extern void perf_event_comm(struct task_struct *tsk);
906extern void perf_event_fork(struct task_struct *tsk); 973extern void perf_event_fork(struct task_struct *tsk);
907 974
@@ -927,8 +994,9 @@ static inline bool perf_paranoid_kernel(void)
927} 994}
928 995
929extern void perf_event_init(void); 996extern void perf_event_init(void);
930extern void perf_tp_event(int event_id, u64 addr, u64 count, void *record, 997extern void perf_tp_event(u64 addr, u64 count, void *record,
931 int entry_size, struct pt_regs *regs); 998 int entry_size, struct pt_regs *regs,
999 struct hlist_head *head);
932extern void perf_bp_event(struct perf_event *event, void *data); 1000extern void perf_bp_event(struct perf_event *event, void *data);
933 1001
934#ifndef perf_misc_flags 1002#ifndef perf_misc_flags
@@ -971,6 +1039,11 @@ perf_sw_event(u32 event_id, u64 nr, int nmi,
971static inline void 1039static inline void
972perf_bp_event(struct perf_event *event, void *data) { } 1040perf_bp_event(struct perf_event *event, void *data) { }
973 1041
1042static inline int perf_register_guest_info_callbacks
1043(struct perf_guest_info_callbacks *callbacks) { return 0; }
1044static inline int perf_unregister_guest_info_callbacks
1045(struct perf_guest_info_callbacks *callbacks) { return 0; }
1046
974static inline void perf_event_mmap(struct vm_area_struct *vma) { } 1047static inline void perf_event_mmap(struct vm_area_struct *vma) { }
975static inline void perf_event_comm(struct task_struct *tsk) { } 1048static inline void perf_event_comm(struct task_struct *tsk) { }
976static inline void perf_event_fork(struct task_struct *tsk) { } 1049static inline void perf_event_fork(struct task_struct *tsk) { }
diff --git a/include/linux/pipe_fs_i.h b/include/linux/pipe_fs_i.h
index b43a9e039059..16de3933c45e 100644
--- a/include/linux/pipe_fs_i.h
+++ b/include/linux/pipe_fs_i.h
@@ -3,7 +3,7 @@
3 3
4#define PIPEFS_MAGIC 0x50495045 4#define PIPEFS_MAGIC 0x50495045
5 5
6#define PIPE_BUFFERS (16) 6#define PIPE_DEF_BUFFERS 16
7 7
8#define PIPE_BUF_FLAG_LRU 0x01 /* page is on the LRU */ 8#define PIPE_BUF_FLAG_LRU 0x01 /* page is on the LRU */
9#define PIPE_BUF_FLAG_ATOMIC 0x02 /* was atomically mapped */ 9#define PIPE_BUF_FLAG_ATOMIC 0x02 /* was atomically mapped */
@@ -44,17 +44,17 @@ struct pipe_buffer {
44 **/ 44 **/
45struct pipe_inode_info { 45struct pipe_inode_info {
46 wait_queue_head_t wait; 46 wait_queue_head_t wait;
47 unsigned int nrbufs, curbuf; 47 unsigned int nrbufs, curbuf, buffers;
48 struct page *tmp_page;
49 unsigned int readers; 48 unsigned int readers;
50 unsigned int writers; 49 unsigned int writers;
51 unsigned int waiting_writers; 50 unsigned int waiting_writers;
52 unsigned int r_counter; 51 unsigned int r_counter;
53 unsigned int w_counter; 52 unsigned int w_counter;
53 struct page *tmp_page;
54 struct fasync_struct *fasync_readers; 54 struct fasync_struct *fasync_readers;
55 struct fasync_struct *fasync_writers; 55 struct fasync_struct *fasync_writers;
56 struct inode *inode; 56 struct inode *inode;
57 struct pipe_buffer bufs[PIPE_BUFFERS]; 57 struct pipe_buffer *bufs;
58}; 58};
59 59
60/* 60/*
@@ -139,6 +139,8 @@ void pipe_lock(struct pipe_inode_info *);
139void pipe_unlock(struct pipe_inode_info *); 139void pipe_unlock(struct pipe_inode_info *);
140void pipe_double_lock(struct pipe_inode_info *, struct pipe_inode_info *); 140void pipe_double_lock(struct pipe_inode_info *, struct pipe_inode_info *);
141 141
142extern unsigned int pipe_max_pages;
143
142/* Drop the inode semaphore and wait for a pipe event, atomically */ 144/* Drop the inode semaphore and wait for a pipe event, atomically */
143void pipe_wait(struct pipe_inode_info *pipe); 145void pipe_wait(struct pipe_inode_info *pipe);
144 146
@@ -154,4 +156,7 @@ int generic_pipe_buf_confirm(struct pipe_inode_info *, struct pipe_buffer *);
154int generic_pipe_buf_steal(struct pipe_inode_info *, struct pipe_buffer *); 156int generic_pipe_buf_steal(struct pipe_inode_info *, struct pipe_buffer *);
155void generic_pipe_buf_release(struct pipe_inode_info *, struct pipe_buffer *); 157void generic_pipe_buf_release(struct pipe_inode_info *, struct pipe_buffer *);
156 158
159/* for F_SETPIPE_SZ and F_GETPIPE_SZ */
160long pipe_fcntl(struct file *, unsigned int, unsigned long arg);
161
157#endif 162#endif
diff --git a/include/linux/platform_device.h b/include/linux/platform_device.h
index 212da17d06af..5417944d3687 100644
--- a/include/linux/platform_device.h
+++ b/include/linux/platform_device.h
@@ -44,12 +44,14 @@ extern int platform_get_irq_byname(struct platform_device *, const char *);
44extern int platform_add_devices(struct platform_device **, int); 44extern int platform_add_devices(struct platform_device **, int);
45 45
46extern struct platform_device *platform_device_register_simple(const char *, int id, 46extern struct platform_device *platform_device_register_simple(const char *, int id,
47 struct resource *, unsigned int); 47 const struct resource *, unsigned int);
48extern struct platform_device *platform_device_register_data(struct device *, 48extern struct platform_device *platform_device_register_data(struct device *,
49 const char *, int, const void *, size_t); 49 const char *, int, const void *, size_t);
50 50
51extern struct platform_device *platform_device_alloc(const char *name, int id); 51extern struct platform_device *platform_device_alloc(const char *name, int id);
52extern int platform_device_add_resources(struct platform_device *pdev, struct resource *res, unsigned int num); 52extern int platform_device_add_resources(struct platform_device *pdev,
53 const struct resource *res,
54 unsigned int num);
53extern int platform_device_add_data(struct platform_device *pdev, const void *data, size_t size); 55extern int platform_device_add_data(struct platform_device *pdev, const void *data, size_t size);
54extern int platform_device_add(struct platform_device *pdev); 56extern int platform_device_add(struct platform_device *pdev);
55extern void platform_device_del(struct platform_device *pdev); 57extern void platform_device_del(struct platform_device *pdev);
diff --git a/include/linux/pm_qos_params.h b/include/linux/pm_qos_params.h
index d74f75ed1e47..8ba440e5eb7f 100644
--- a/include/linux/pm_qos_params.h
+++ b/include/linux/pm_qos_params.h
@@ -14,12 +14,14 @@
14#define PM_QOS_NUM_CLASSES 4 14#define PM_QOS_NUM_CLASSES 4
15#define PM_QOS_DEFAULT_VALUE -1 15#define PM_QOS_DEFAULT_VALUE -1
16 16
17int pm_qos_add_requirement(int qos, char *name, s32 value); 17struct pm_qos_request_list;
18int pm_qos_update_requirement(int qos, char *name, s32 new_value);
19void pm_qos_remove_requirement(int qos, char *name);
20 18
21int pm_qos_requirement(int qos); 19struct pm_qos_request_list *pm_qos_add_request(int pm_qos_class, s32 value);
20void pm_qos_update_request(struct pm_qos_request_list *pm_qos_req,
21 s32 new_value);
22void pm_qos_remove_request(struct pm_qos_request_list *pm_qos_req);
22 23
23int pm_qos_add_notifier(int qos, struct notifier_block *notifier); 24int pm_qos_request(int pm_qos_class);
24int pm_qos_remove_notifier(int qos, struct notifier_block *notifier); 25int pm_qos_add_notifier(int pm_qos_class, struct notifier_block *notifier);
26int pm_qos_remove_notifier(int pm_qos_class, struct notifier_block *notifier);
25 27
diff --git a/include/linux/pm_runtime.h b/include/linux/pm_runtime.h
index b776db737244..6e81888c6222 100644
--- a/include/linux/pm_runtime.h
+++ b/include/linux/pm_runtime.h
@@ -30,6 +30,9 @@ extern void pm_runtime_enable(struct device *dev);
30extern void __pm_runtime_disable(struct device *dev, bool check_resume); 30extern void __pm_runtime_disable(struct device *dev, bool check_resume);
31extern void pm_runtime_allow(struct device *dev); 31extern void pm_runtime_allow(struct device *dev);
32extern void pm_runtime_forbid(struct device *dev); 32extern void pm_runtime_forbid(struct device *dev);
33extern int pm_generic_runtime_idle(struct device *dev);
34extern int pm_generic_runtime_suspend(struct device *dev);
35extern int pm_generic_runtime_resume(struct device *dev);
33 36
34static inline bool pm_children_suspended(struct device *dev) 37static inline bool pm_children_suspended(struct device *dev)
35{ 38{
@@ -96,6 +99,10 @@ static inline bool device_run_wake(struct device *dev) { return false; }
96static inline void device_set_run_wake(struct device *dev, bool enable) {} 99static inline void device_set_run_wake(struct device *dev, bool enable) {}
97static inline bool pm_runtime_suspended(struct device *dev) { return false; } 100static inline bool pm_runtime_suspended(struct device *dev) { return false; }
98 101
102static inline int pm_generic_runtime_idle(struct device *dev) { return 0; }
103static inline int pm_generic_runtime_suspend(struct device *dev) { return 0; }
104static inline int pm_generic_runtime_resume(struct device *dev) { return 0; }
105
99#endif /* !CONFIG_PM_RUNTIME */ 106#endif /* !CONFIG_PM_RUNTIME */
100 107
101static inline int pm_runtime_get(struct device *dev) 108static inline int pm_runtime_get(struct device *dev)
diff --git a/include/linux/pm_wakeup.h b/include/linux/pm_wakeup.h
index 0aae7776185e..22d64c18056c 100644
--- a/include/linux/pm_wakeup.h
+++ b/include/linux/pm_wakeup.h
@@ -25,32 +25,34 @@
25# error "please don't include this file directly" 25# error "please don't include this file directly"
26#endif 26#endif
27 27
28#include <linux/types.h>
29
28#ifdef CONFIG_PM 30#ifdef CONFIG_PM
29 31
30/* changes to device_may_wakeup take effect on the next pm state change. 32/* changes to device_may_wakeup take effect on the next pm state change.
31 * by default, devices should wakeup if they can. 33 * by default, devices should wakeup if they can.
32 */ 34 */
33static inline void device_init_wakeup(struct device *dev, int val) 35static inline void device_init_wakeup(struct device *dev, bool val)
34{ 36{
35 dev->power.can_wakeup = dev->power.should_wakeup = !!val; 37 dev->power.can_wakeup = dev->power.should_wakeup = val;
36} 38}
37 39
38static inline void device_set_wakeup_capable(struct device *dev, int val) 40static inline void device_set_wakeup_capable(struct device *dev, bool capable)
39{ 41{
40 dev->power.can_wakeup = !!val; 42 dev->power.can_wakeup = capable;
41} 43}
42 44
43static inline int device_can_wakeup(struct device *dev) 45static inline bool device_can_wakeup(struct device *dev)
44{ 46{
45 return dev->power.can_wakeup; 47 return dev->power.can_wakeup;
46} 48}
47 49
48static inline void device_set_wakeup_enable(struct device *dev, int val) 50static inline void device_set_wakeup_enable(struct device *dev, bool enable)
49{ 51{
50 dev->power.should_wakeup = !!val; 52 dev->power.should_wakeup = enable;
51} 53}
52 54
53static inline int device_may_wakeup(struct device *dev) 55static inline bool device_may_wakeup(struct device *dev)
54{ 56{
55 return dev->power.can_wakeup && dev->power.should_wakeup; 57 return dev->power.can_wakeup && dev->power.should_wakeup;
56} 58}
@@ -58,20 +60,28 @@ static inline int device_may_wakeup(struct device *dev)
58#else /* !CONFIG_PM */ 60#else /* !CONFIG_PM */
59 61
60/* For some reason the next two routines work even without CONFIG_PM */ 62/* For some reason the next two routines work even without CONFIG_PM */
61static inline void device_init_wakeup(struct device *dev, int val) 63static inline void device_init_wakeup(struct device *dev, bool val)
62{ 64{
63 dev->power.can_wakeup = !!val; 65 dev->power.can_wakeup = val;
64} 66}
65 67
66static inline void device_set_wakeup_capable(struct device *dev, int val) { } 68static inline void device_set_wakeup_capable(struct device *dev, bool capable)
69{
70}
67 71
68static inline int device_can_wakeup(struct device *dev) 72static inline bool device_can_wakeup(struct device *dev)
69{ 73{
70 return dev->power.can_wakeup; 74 return dev->power.can_wakeup;
71} 75}
72 76
73#define device_set_wakeup_enable(dev, val) do {} while (0) 77static inline void device_set_wakeup_enable(struct device *dev, bool enable)
74#define device_may_wakeup(dev) 0 78{
79}
80
81static inline bool device_may_wakeup(struct device *dev)
82{
83 return false;
84}
75 85
76#endif /* !CONFIG_PM */ 86#endif /* !CONFIG_PM */
77 87
diff --git a/include/linux/poison.h b/include/linux/poison.h
index 2110a81c5e2a..34066ffd893d 100644
--- a/include/linux/poison.h
+++ b/include/linux/poison.h
@@ -48,6 +48,15 @@
48#define POISON_FREE 0x6b /* for use-after-free poisoning */ 48#define POISON_FREE 0x6b /* for use-after-free poisoning */
49#define POISON_END 0xa5 /* end-byte of poisoning */ 49#define POISON_END 0xa5 /* end-byte of poisoning */
50 50
51/********** mm/hugetlb.c **********/
52/*
53 * Private mappings of hugetlb pages use this poisoned value for
54 * page->mapping. The core VM should not be doing anything with this mapping
55 * but futex requires the existence of some page->mapping value even though it
56 * is unused if PAGE_MAPPING_ANON is set.
57 */
58#define HUGETLB_POISON ((void *)(0x00300300 + POISON_POINTER_DELTA + PAGE_MAPPING_ANON))
59
51/********** arch/$ARCH/mm/init.c **********/ 60/********** arch/$ARCH/mm/init.c **********/
52#define POISON_FREE_INITMEM 0xcc 61#define POISON_FREE_INITMEM 0xcc
53 62
diff --git a/include/linux/power_supply.h b/include/linux/power_supply.h
index ebd2b8fb00d0..30083a896f36 100644
--- a/include/linux/power_supply.h
+++ b/include/linux/power_supply.h
@@ -114,6 +114,7 @@ enum power_supply_property {
114 POWER_SUPPLY_PROP_TIME_TO_EMPTY_AVG, 114 POWER_SUPPLY_PROP_TIME_TO_EMPTY_AVG,
115 POWER_SUPPLY_PROP_TIME_TO_FULL_NOW, 115 POWER_SUPPLY_PROP_TIME_TO_FULL_NOW,
116 POWER_SUPPLY_PROP_TIME_TO_FULL_AVG, 116 POWER_SUPPLY_PROP_TIME_TO_FULL_AVG,
117 POWER_SUPPLY_PROP_TYPE, /* use power_supply.type instead */
117 /* Properties of type `const char *' */ 118 /* Properties of type `const char *' */
118 POWER_SUPPLY_PROP_MODEL_NAME, 119 POWER_SUPPLY_PROP_MODEL_NAME,
119 POWER_SUPPLY_PROP_MANUFACTURER, 120 POWER_SUPPLY_PROP_MANUFACTURER,
@@ -144,6 +145,11 @@ struct power_supply {
144 int (*get_property)(struct power_supply *psy, 145 int (*get_property)(struct power_supply *psy,
145 enum power_supply_property psp, 146 enum power_supply_property psp,
146 union power_supply_propval *val); 147 union power_supply_propval *val);
148 int (*set_property)(struct power_supply *psy,
149 enum power_supply_property psp,
150 const union power_supply_propval *val);
151 int (*property_is_writeable)(struct power_supply *psy,
152 enum power_supply_property psp);
147 void (*external_power_changed)(struct power_supply *psy); 153 void (*external_power_changed)(struct power_supply *psy);
148 void (*set_charged)(struct power_supply *psy); 154 void (*set_charged)(struct power_supply *psy);
149 155
diff --git a/include/linux/ptrace.h b/include/linux/ptrace.h
index e1fb60729979..4272521e29e9 100644
--- a/include/linux/ptrace.h
+++ b/include/linux/ptrace.h
@@ -345,18 +345,6 @@ static inline void user_single_step_siginfo(struct task_struct *tsk,
345#define arch_ptrace_stop(code, info) do { } while (0) 345#define arch_ptrace_stop(code, info) do { } while (0)
346#endif 346#endif
347 347
348#ifndef arch_ptrace_untrace
349/*
350 * Do machine-specific work before untracing child.
351 *
352 * This is called for a normal detach as well as from ptrace_exit()
353 * when the tracing task dies.
354 *
355 * Called with write_lock(&tasklist_lock) held.
356 */
357#define arch_ptrace_untrace(task) do { } while (0)
358#endif
359
360extern int task_current_syscall(struct task_struct *target, long *callno, 348extern int task_current_syscall(struct task_struct *target, long *callno,
361 unsigned long args[6], unsigned int maxargs, 349 unsigned long args[6], unsigned int maxargs,
362 unsigned long *sp, unsigned long *pc); 350 unsigned long *sp, unsigned long *pc);
diff --git a/include/linux/quota.h b/include/linux/quota.h
index b462916b2a0a..94c1f03b50eb 100644
--- a/include/linux/quota.h
+++ b/include/linux/quota.h
@@ -174,6 +174,7 @@ enum {
174#include <linux/rwsem.h> 174#include <linux/rwsem.h>
175#include <linux/spinlock.h> 175#include <linux/spinlock.h>
176#include <linux/wait.h> 176#include <linux/wait.h>
177#include <linux/percpu_counter.h>
177 178
178#include <linux/dqblk_xfs.h> 179#include <linux/dqblk_xfs.h>
179#include <linux/dqblk_v1.h> 180#include <linux/dqblk_v1.h>
@@ -238,19 +239,36 @@ static inline int info_dirty(struct mem_dqinfo *info)
238 return test_bit(DQF_INFO_DIRTY_B, &info->dqi_flags); 239 return test_bit(DQF_INFO_DIRTY_B, &info->dqi_flags);
239} 240}
240 241
242enum {
243 DQST_LOOKUPS,
244 DQST_DROPS,
245 DQST_READS,
246 DQST_WRITES,
247 DQST_CACHE_HITS,
248 DQST_ALLOC_DQUOTS,
249 DQST_FREE_DQUOTS,
250 DQST_SYNCS,
251 _DQST_DQSTAT_LAST
252};
253
241struct dqstats { 254struct dqstats {
242 int lookups; 255 int stat[_DQST_DQSTAT_LAST];
243 int drops; 256 struct percpu_counter counter[_DQST_DQSTAT_LAST];
244 int reads;
245 int writes;
246 int cache_hits;
247 int allocated_dquots;
248 int free_dquots;
249 int syncs;
250}; 257};
251 258
259extern struct dqstats *dqstats_pcpu;
252extern struct dqstats dqstats; 260extern struct dqstats dqstats;
253 261
262static inline void dqstats_inc(unsigned int type)
263{
264 percpu_counter_inc(&dqstats.counter[type]);
265}
266
267static inline void dqstats_dec(unsigned int type)
268{
269 percpu_counter_dec(&dqstats.counter[type]);
270}
271
254#define DQ_MOD_B 0 /* dquot modified since read */ 272#define DQ_MOD_B 0 /* dquot modified since read */
255#define DQ_BLKS_B 1 /* uid/gid has been warned about blk limit */ 273#define DQ_BLKS_B 1 /* uid/gid has been warned about blk limit */
256#define DQ_INODES_B 2 /* uid/gid has been warned about inode limit */ 274#define DQ_INODES_B 2 /* uid/gid has been warned about inode limit */
@@ -306,17 +324,15 @@ struct dquot_operations {
306 324
307/* Operations handling requests from userspace */ 325/* Operations handling requests from userspace */
308struct quotactl_ops { 326struct quotactl_ops {
309 int (*quota_on)(struct super_block *, int, int, char *, int); 327 int (*quota_on)(struct super_block *, int, int, char *);
310 int (*quota_off)(struct super_block *, int, int); 328 int (*quota_off)(struct super_block *, int);
311 int (*quota_sync)(struct super_block *, int, int); 329 int (*quota_sync)(struct super_block *, int, int);
312 int (*get_info)(struct super_block *, int, struct if_dqinfo *); 330 int (*get_info)(struct super_block *, int, struct if_dqinfo *);
313 int (*set_info)(struct super_block *, int, struct if_dqinfo *); 331 int (*set_info)(struct super_block *, int, struct if_dqinfo *);
314 int (*get_dqblk)(struct super_block *, int, qid_t, struct if_dqblk *); 332 int (*get_dqblk)(struct super_block *, int, qid_t, struct fs_disk_quota *);
315 int (*set_dqblk)(struct super_block *, int, qid_t, struct if_dqblk *); 333 int (*set_dqblk)(struct super_block *, int, qid_t, struct fs_disk_quota *);
316 int (*get_xstate)(struct super_block *, struct fs_quota_stat *); 334 int (*get_xstate)(struct super_block *, struct fs_quota_stat *);
317 int (*set_xstate)(struct super_block *, unsigned int, int); 335 int (*set_xstate)(struct super_block *, unsigned int, int);
318 int (*get_xquota)(struct super_block *, int, qid_t, struct fs_disk_quota *);
319 int (*set_xquota)(struct super_block *, int, qid_t, struct fs_disk_quota *);
320}; 336};
321 337
322struct quota_format_type { 338struct quota_format_type {
diff --git a/include/linux/quotaops.h b/include/linux/quotaops.h
index e6fa7acce290..aa36793b48bd 100644
--- a/include/linux/quotaops.h
+++ b/include/linux/quotaops.h
@@ -9,11 +9,23 @@
9 9
10#include <linux/fs.h> 10#include <linux/fs.h>
11 11
12#define DQUOT_SPACE_WARN 0x1
13#define DQUOT_SPACE_RESERVE 0x2
14#define DQUOT_SPACE_NOFAIL 0x4
15
12static inline struct quota_info *sb_dqopt(struct super_block *sb) 16static inline struct quota_info *sb_dqopt(struct super_block *sb)
13{ 17{
14 return &sb->s_dquot; 18 return &sb->s_dquot;
15} 19}
16 20
21/* i_mutex must being held */
22static inline bool is_quota_modification(struct inode *inode, struct iattr *ia)
23{
24 return (ia->ia_valid & ATTR_SIZE && ia->ia_size != inode->i_size) ||
25 (ia->ia_valid & ATTR_UID && ia->ia_uid != inode->i_uid) ||
26 (ia->ia_valid & ATTR_GID && ia->ia_gid != inode->i_gid);
27}
28
17#if defined(CONFIG_QUOTA) 29#if defined(CONFIG_QUOTA)
18 30
19/* 31/*
@@ -33,15 +45,22 @@ int dquot_scan_active(struct super_block *sb,
33struct dquot *dquot_alloc(struct super_block *sb, int type); 45struct dquot *dquot_alloc(struct super_block *sb, int type);
34void dquot_destroy(struct dquot *dquot); 46void dquot_destroy(struct dquot *dquot);
35 47
36int __dquot_alloc_space(struct inode *inode, qsize_t number, 48int __dquot_alloc_space(struct inode *inode, qsize_t number, int flags);
37 int warn, int reserve); 49void __dquot_free_space(struct inode *inode, qsize_t number, int flags);
38void __dquot_free_space(struct inode *inode, qsize_t number, int reserve);
39 50
40int dquot_alloc_inode(const struct inode *inode); 51int dquot_alloc_inode(const struct inode *inode);
41 52
42int dquot_claim_space_nodirty(struct inode *inode, qsize_t number); 53int dquot_claim_space_nodirty(struct inode *inode, qsize_t number);
43void dquot_free_inode(const struct inode *inode); 54void dquot_free_inode(const struct inode *inode);
44 55
56int dquot_disable(struct super_block *sb, int type, unsigned int flags);
57/* Suspend quotas on remount RO */
58static inline int dquot_suspend(struct super_block *sb, int type)
59{
60 return dquot_disable(sb, type, DQUOT_SUSPENDED);
61}
62int dquot_resume(struct super_block *sb, int type);
63
45int dquot_commit(struct dquot *dquot); 64int dquot_commit(struct dquot *dquot);
46int dquot_acquire(struct dquot *dquot); 65int dquot_acquire(struct dquot *dquot);
47int dquot_release(struct dquot *dquot); 66int dquot_release(struct dquot *dquot);
@@ -50,24 +69,25 @@ int dquot_mark_dquot_dirty(struct dquot *dquot);
50 69
51int dquot_file_open(struct inode *inode, struct file *file); 70int dquot_file_open(struct inode *inode, struct file *file);
52 71
53int vfs_quota_on(struct super_block *sb, int type, int format_id, 72int dquot_quota_on(struct super_block *sb, int type, int format_id,
54 char *path, int remount); 73 char *path);
55int vfs_quota_enable(struct inode *inode, int type, int format_id, 74int dquot_enable(struct inode *inode, int type, int format_id,
56 unsigned int flags); 75 unsigned int flags);
57int vfs_quota_on_path(struct super_block *sb, int type, int format_id, 76int dquot_quota_on_path(struct super_block *sb, int type, int format_id,
58 struct path *path); 77 struct path *path);
59int vfs_quota_on_mount(struct super_block *sb, char *qf_name, 78int dquot_quota_on_mount(struct super_block *sb, char *qf_name,
60 int format_id, int type); 79 int format_id, int type);
61int vfs_quota_off(struct super_block *sb, int type, int remount); 80int dquot_quota_off(struct super_block *sb, int type);
62int vfs_quota_disable(struct super_block *sb, int type, unsigned int flags); 81int dquot_quota_sync(struct super_block *sb, int type, int wait);
63int vfs_quota_sync(struct super_block *sb, int type, int wait); 82int dquot_get_dqinfo(struct super_block *sb, int type, struct if_dqinfo *ii);
64int vfs_get_dqinfo(struct super_block *sb, int type, struct if_dqinfo *ii); 83int dquot_set_dqinfo(struct super_block *sb, int type, struct if_dqinfo *ii);
65int vfs_set_dqinfo(struct super_block *sb, int type, struct if_dqinfo *ii); 84int dquot_get_dqblk(struct super_block *sb, int type, qid_t id,
66int vfs_get_dqblk(struct super_block *sb, int type, qid_t id, struct if_dqblk *di); 85 struct fs_disk_quota *di);
67int vfs_set_dqblk(struct super_block *sb, int type, qid_t id, struct if_dqblk *di); 86int dquot_set_dqblk(struct super_block *sb, int type, qid_t id,
68 87 struct fs_disk_quota *di);
88
89int __dquot_transfer(struct inode *inode, struct dquot **transfer_to);
69int dquot_transfer(struct inode *inode, struct iattr *iattr); 90int dquot_transfer(struct inode *inode, struct iattr *iattr);
70int vfs_dq_quota_on_remount(struct super_block *sb);
71 91
72static inline struct mem_dqinfo *sb_dqinfo(struct super_block *sb, int type) 92static inline struct mem_dqinfo *sb_dqinfo(struct super_block *sb, int type)
73{ 93{
@@ -134,20 +154,7 @@ static inline unsigned sb_any_quota_active(struct super_block *sb)
134 * Operations supported for diskquotas. 154 * Operations supported for diskquotas.
135 */ 155 */
136extern const struct dquot_operations dquot_operations; 156extern const struct dquot_operations dquot_operations;
137extern const struct quotactl_ops vfs_quotactl_ops; 157extern const struct quotactl_ops dquot_quotactl_ops;
138
139#define sb_dquot_ops (&dquot_operations)
140#define sb_quotactl_ops (&vfs_quotactl_ops)
141
142/* Cannot be called inside a transaction */
143static inline int vfs_dq_off(struct super_block *sb, int remount)
144{
145 int ret = -ENOSYS;
146
147 if (sb->s_qcop && sb->s_qcop->quota_off)
148 ret = sb->s_qcop->quota_off(sb, -1, remount);
149 return ret;
150}
151 158
152#else 159#else
153 160
@@ -192,12 +199,6 @@ static inline int sb_any_quota_active(struct super_block *sb)
192 return 0; 199 return 0;
193} 200}
194 201
195/*
196 * NO-OP when quota not configured.
197 */
198#define sb_dquot_ops (NULL)
199#define sb_quotactl_ops (NULL)
200
201static inline void dquot_initialize(struct inode *inode) 202static inline void dquot_initialize(struct inode *inode)
202{ 203{
203} 204}
@@ -215,39 +216,45 @@ static inline void dquot_free_inode(const struct inode *inode)
215{ 216{
216} 217}
217 218
218static inline int vfs_dq_off(struct super_block *sb, int remount) 219static inline int dquot_transfer(struct inode *inode, struct iattr *iattr)
219{ 220{
220 return 0; 221 return 0;
221} 222}
222 223
223static inline int vfs_dq_quota_on_remount(struct super_block *sb) 224static inline int __dquot_alloc_space(struct inode *inode, qsize_t number,
225 int flags)
224{ 226{
227 if (!(flags & DQUOT_SPACE_RESERVE))
228 inode_add_bytes(inode, number);
225 return 0; 229 return 0;
226} 230}
227 231
228static inline int dquot_transfer(struct inode *inode, struct iattr *iattr) 232static inline void __dquot_free_space(struct inode *inode, qsize_t number,
233 int flags)
234{
235 if (!(flags & DQUOT_SPACE_RESERVE))
236 inode_sub_bytes(inode, number);
237}
238
239static inline int dquot_claim_space_nodirty(struct inode *inode, qsize_t number)
229{ 240{
241 inode_add_bytes(inode, number);
230 return 0; 242 return 0;
231} 243}
232 244
233static inline int __dquot_alloc_space(struct inode *inode, qsize_t number, 245static inline int dquot_disable(struct super_block *sb, int type,
234 int warn, int reserve) 246 unsigned int flags)
235{ 247{
236 if (!reserve)
237 inode_add_bytes(inode, number);
238 return 0; 248 return 0;
239} 249}
240 250
241static inline void __dquot_free_space(struct inode *inode, qsize_t number, 251static inline int dquot_suspend(struct super_block *sb, int type)
242 int reserve)
243{ 252{
244 if (!reserve) 253 return 0;
245 inode_sub_bytes(inode, number);
246} 254}
247 255
248static inline int dquot_claim_space_nodirty(struct inode *inode, qsize_t number) 256static inline int dquot_resume(struct super_block *sb, int type)
249{ 257{
250 inode_add_bytes(inode, number);
251 return 0; 258 return 0;
252} 259}
253 260
@@ -257,7 +264,13 @@ static inline int dquot_claim_space_nodirty(struct inode *inode, qsize_t number)
257 264
258static inline int dquot_alloc_space_nodirty(struct inode *inode, qsize_t nr) 265static inline int dquot_alloc_space_nodirty(struct inode *inode, qsize_t nr)
259{ 266{
260 return __dquot_alloc_space(inode, nr, 1, 0); 267 return __dquot_alloc_space(inode, nr, DQUOT_SPACE_WARN);
268}
269
270static inline void dquot_alloc_space_nofail(struct inode *inode, qsize_t nr)
271{
272 __dquot_alloc_space(inode, nr, DQUOT_SPACE_WARN|DQUOT_SPACE_NOFAIL);
273 mark_inode_dirty(inode);
261} 274}
262 275
263static inline int dquot_alloc_space(struct inode *inode, qsize_t nr) 276static inline int dquot_alloc_space(struct inode *inode, qsize_t nr)
@@ -275,6 +288,11 @@ static inline int dquot_alloc_block_nodirty(struct inode *inode, qsize_t nr)
275 return dquot_alloc_space_nodirty(inode, nr << inode->i_blkbits); 288 return dquot_alloc_space_nodirty(inode, nr << inode->i_blkbits);
276} 289}
277 290
291static inline void dquot_alloc_block_nofail(struct inode *inode, qsize_t nr)
292{
293 dquot_alloc_space_nofail(inode, nr << inode->i_blkbits);
294}
295
278static inline int dquot_alloc_block(struct inode *inode, qsize_t nr) 296static inline int dquot_alloc_block(struct inode *inode, qsize_t nr)
279{ 297{
280 return dquot_alloc_space(inode, nr << inode->i_blkbits); 298 return dquot_alloc_space(inode, nr << inode->i_blkbits);
@@ -282,7 +300,7 @@ static inline int dquot_alloc_block(struct inode *inode, qsize_t nr)
282 300
283static inline int dquot_prealloc_block_nodirty(struct inode *inode, qsize_t nr) 301static inline int dquot_prealloc_block_nodirty(struct inode *inode, qsize_t nr)
284{ 302{
285 return __dquot_alloc_space(inode, nr << inode->i_blkbits, 0, 0); 303 return __dquot_alloc_space(inode, nr << inode->i_blkbits, 0);
286} 304}
287 305
288static inline int dquot_prealloc_block(struct inode *inode, qsize_t nr) 306static inline int dquot_prealloc_block(struct inode *inode, qsize_t nr)
@@ -297,7 +315,8 @@ static inline int dquot_prealloc_block(struct inode *inode, qsize_t nr)
297 315
298static inline int dquot_reserve_block(struct inode *inode, qsize_t nr) 316static inline int dquot_reserve_block(struct inode *inode, qsize_t nr)
299{ 317{
300 return __dquot_alloc_space(inode, nr << inode->i_blkbits, 1, 1); 318 return __dquot_alloc_space(inode, nr << inode->i_blkbits,
319 DQUOT_SPACE_WARN|DQUOT_SPACE_RESERVE);
301} 320}
302 321
303static inline int dquot_claim_block(struct inode *inode, qsize_t nr) 322static inline int dquot_claim_block(struct inode *inode, qsize_t nr)
@@ -334,7 +353,7 @@ static inline void dquot_free_block(struct inode *inode, qsize_t nr)
334static inline void dquot_release_reservation_block(struct inode *inode, 353static inline void dquot_release_reservation_block(struct inode *inode,
335 qsize_t nr) 354 qsize_t nr)
336{ 355{
337 __dquot_free_space(inode, nr << inode->i_blkbits, 1); 356 __dquot_free_space(inode, nr << inode->i_blkbits, DQUOT_SPACE_RESERVE);
338} 357}
339 358
340#endif /* _LINUX_QUOTAOPS_ */ 359#endif /* _LINUX_QUOTAOPS_ */
diff --git a/include/linux/ramfs.h b/include/linux/ramfs.h
index 4e768dda87b0..e7320b5e82fb 100644
--- a/include/linux/ramfs.h
+++ b/include/linux/ramfs.h
@@ -1,7 +1,8 @@
1#ifndef _LINUX_RAMFS_H 1#ifndef _LINUX_RAMFS_H
2#define _LINUX_RAMFS_H 2#define _LINUX_RAMFS_H
3 3
4struct inode *ramfs_get_inode(struct super_block *sb, int mode, dev_t dev); 4struct inode *ramfs_get_inode(struct super_block *sb, const struct inode *dir,
5 int mode, dev_t dev);
5extern int ramfs_get_sb(struct file_system_type *fs_type, 6extern int ramfs_get_sb(struct file_system_type *fs_type,
6 int flags, const char *dev_name, void *data, struct vfsmount *mnt); 7 int flags, const char *dev_name, void *data, struct vfsmount *mnt);
7 8
@@ -20,4 +21,6 @@ extern const struct file_operations ramfs_file_operations;
20extern const struct vm_operations_struct generic_file_vm_ops; 21extern const struct vm_operations_struct generic_file_vm_ops;
21extern int __init init_rootfs(void); 22extern int __init init_rootfs(void);
22 23
24int ramfs_fill_super(struct super_block *sb, void *data, int silent);
25
23#endif 26#endif
diff --git a/include/linux/random.h b/include/linux/random.h
index 25d02fe5c9b5..fb7ab9de5f36 100644
--- a/include/linux/random.h
+++ b/include/linux/random.h
@@ -40,6 +40,10 @@ struct rand_pool_info {
40 __u32 buf[0]; 40 __u32 buf[0];
41}; 41};
42 42
43struct rnd_state {
44 __u32 s1, s2, s3;
45};
46
43/* Exported functions */ 47/* Exported functions */
44 48
45#ifdef __KERNEL__ 49#ifdef __KERNEL__
@@ -74,6 +78,30 @@ unsigned long randomize_range(unsigned long start, unsigned long end, unsigned l
74u32 random32(void); 78u32 random32(void);
75void srandom32(u32 seed); 79void srandom32(u32 seed);
76 80
81u32 prandom32(struct rnd_state *);
82
83/*
84 * Handle minimum values for seeds
85 */
86static inline u32 __seed(u32 x, u32 m)
87{
88 return (x < m) ? x + m : x;
89}
90
91/**
92 * prandom32_seed - set seed for prandom32().
93 * @state: pointer to state structure to receive the seed.
94 * @seed: arbitrary 64-bit value to use as a seed.
95 */
96static inline void prandom32_seed(struct rnd_state *state, u64 seed)
97{
98 u32 i = (seed >> 32) ^ (seed << 10) ^ seed;
99
100 state->s1 = __seed(i, 1);
101 state->s2 = __seed(i, 7);
102 state->s3 = __seed(i, 15);
103}
104
77#endif /* __KERNEL___ */ 105#endif /* __KERNEL___ */
78 106
79#endif /* _LINUX_RANDOM_H */ 107#endif /* _LINUX_RANDOM_H */
diff --git a/include/linux/ratelimit.h b/include/linux/ratelimit.h
index 668cf1bef030..8f69d09a41a5 100644
--- a/include/linux/ratelimit.h
+++ b/include/linux/ratelimit.h
@@ -2,7 +2,7 @@
2#define _LINUX_RATELIMIT_H 2#define _LINUX_RATELIMIT_H
3 3
4#include <linux/param.h> 4#include <linux/param.h>
5#include <linux/spinlock_types.h> 5#include <linux/spinlock.h>
6 6
7#define DEFAULT_RATELIMIT_INTERVAL (5 * HZ) 7#define DEFAULT_RATELIMIT_INTERVAL (5 * HZ)
8#define DEFAULT_RATELIMIT_BURST 10 8#define DEFAULT_RATELIMIT_BURST 10
@@ -25,6 +25,17 @@ struct ratelimit_state {
25 .burst = burst_init, \ 25 .burst = burst_init, \
26 } 26 }
27 27
28static inline void ratelimit_state_init(struct ratelimit_state *rs,
29 int interval, int burst)
30{
31 spin_lock_init(&rs->lock);
32 rs->interval = interval;
33 rs->burst = burst;
34 rs->printed = 0;
35 rs->missed = 0;
36 rs->begin = 0;
37}
38
28extern int ___ratelimit(struct ratelimit_state *rs, const char *func); 39extern int ___ratelimit(struct ratelimit_state *rs, const char *func);
29#define __ratelimit(state) ___ratelimit(state, __func__) 40#define __ratelimit(state) ___ratelimit(state, __func__)
30 41
diff --git a/include/linux/rbtree.h b/include/linux/rbtree.h
index 5210a5c60877..fe1872e5b37e 100644
--- a/include/linux/rbtree.h
+++ b/include/linux/rbtree.h
@@ -110,6 +110,7 @@ struct rb_node
110struct rb_root 110struct rb_root
111{ 111{
112 struct rb_node *rb_node; 112 struct rb_node *rb_node;
113 void (*augment_cb)(struct rb_node *node);
113}; 114};
114 115
115 116
@@ -129,7 +130,9 @@ static inline void rb_set_color(struct rb_node *rb, int color)
129 rb->rb_parent_color = (rb->rb_parent_color & ~1) | color; 130 rb->rb_parent_color = (rb->rb_parent_color & ~1) | color;
130} 131}
131 132
132#define RB_ROOT (struct rb_root) { NULL, } 133#define RB_ROOT (struct rb_root) { NULL, NULL, }
134#define RB_AUGMENT_ROOT(x) (struct rb_root) { NULL, x}
135
133#define rb_entry(ptr, type, member) container_of(ptr, type, member) 136#define rb_entry(ptr, type, member) container_of(ptr, type, member)
134 137
135#define RB_EMPTY_ROOT(root) ((root)->rb_node == NULL) 138#define RB_EMPTY_ROOT(root) ((root)->rb_node == NULL)
diff --git a/include/linux/rcupdate.h b/include/linux/rcupdate.h
index 07db2feb8572..b653b4aaa8a6 100644
--- a/include/linux/rcupdate.h
+++ b/include/linux/rcupdate.h
@@ -56,8 +56,6 @@ struct rcu_head {
56}; 56};
57 57
58/* Exported common interfaces */ 58/* Exported common interfaces */
59extern void synchronize_rcu_bh(void);
60extern void synchronize_sched(void);
61extern void rcu_barrier(void); 59extern void rcu_barrier(void);
62extern void rcu_barrier_bh(void); 60extern void rcu_barrier_bh(void);
63extern void rcu_barrier_sched(void); 61extern void rcu_barrier_sched(void);
@@ -66,8 +64,6 @@ extern int sched_expedited_torture_stats(char *page);
66 64
67/* Internal to kernel */ 65/* Internal to kernel */
68extern void rcu_init(void); 66extern void rcu_init(void);
69extern int rcu_scheduler_active;
70extern void rcu_scheduler_starting(void);
71 67
72#if defined(CONFIG_TREE_RCU) || defined(CONFIG_TREE_PREEMPT_RCU) 68#if defined(CONFIG_TREE_RCU) || defined(CONFIG_TREE_PREEMPT_RCU)
73#include <linux/rcutree.h> 69#include <linux/rcutree.h>
@@ -83,6 +79,14 @@ extern void rcu_scheduler_starting(void);
83 (ptr)->next = NULL; (ptr)->func = NULL; \ 79 (ptr)->next = NULL; (ptr)->func = NULL; \
84} while (0) 80} while (0)
85 81
82static inline void init_rcu_head_on_stack(struct rcu_head *head)
83{
84}
85
86static inline void destroy_rcu_head_on_stack(struct rcu_head *head)
87{
88}
89
86#ifdef CONFIG_DEBUG_LOCK_ALLOC 90#ifdef CONFIG_DEBUG_LOCK_ALLOC
87 91
88extern struct lockdep_map rcu_lock_map; 92extern struct lockdep_map rcu_lock_map;
@@ -106,12 +110,13 @@ extern int debug_lockdep_rcu_enabled(void);
106/** 110/**
107 * rcu_read_lock_held - might we be in RCU read-side critical section? 111 * rcu_read_lock_held - might we be in RCU read-side critical section?
108 * 112 *
109 * If CONFIG_PROVE_LOCKING is selected and enabled, returns nonzero iff in 113 * If CONFIG_DEBUG_LOCK_ALLOC is selected, returns nonzero iff in an RCU
110 * an RCU read-side critical section. In absence of CONFIG_PROVE_LOCKING, 114 * read-side critical section. In absence of CONFIG_DEBUG_LOCK_ALLOC,
111 * this assumes we are in an RCU read-side critical section unless it can 115 * this assumes we are in an RCU read-side critical section unless it can
112 * prove otherwise. 116 * prove otherwise.
113 * 117 *
114 * Check rcu_scheduler_active to prevent false positives during boot. 118 * Check debug_lockdep_rcu_enabled() to prevent false positives during boot
119 * and while lockdep is disabled.
115 */ 120 */
116static inline int rcu_read_lock_held(void) 121static inline int rcu_read_lock_held(void)
117{ 122{
@@ -129,13 +134,15 @@ extern int rcu_read_lock_bh_held(void);
129/** 134/**
130 * rcu_read_lock_sched_held - might we be in RCU-sched read-side critical section? 135 * rcu_read_lock_sched_held - might we be in RCU-sched read-side critical section?
131 * 136 *
132 * If CONFIG_PROVE_LOCKING is selected and enabled, returns nonzero iff in an 137 * If CONFIG_DEBUG_LOCK_ALLOC is selected, returns nonzero iff in an
133 * RCU-sched read-side critical section. In absence of CONFIG_PROVE_LOCKING, 138 * RCU-sched read-side critical section. In absence of
134 * this assumes we are in an RCU-sched read-side critical section unless it 139 * CONFIG_DEBUG_LOCK_ALLOC, this assumes we are in an RCU-sched read-side
135 * can prove otherwise. Note that disabling of preemption (including 140 * critical section unless it can prove otherwise. Note that disabling
136 * disabling irqs) counts as an RCU-sched read-side critical section. 141 * of preemption (including disabling irqs) counts as an RCU-sched
142 * read-side critical section.
137 * 143 *
138 * Check rcu_scheduler_active to prevent false positives during boot. 144 * Check debug_lockdep_rcu_enabled() to prevent false positives during boot
145 * and while lockdep is disabled.
139 */ 146 */
140#ifdef CONFIG_PREEMPT 147#ifdef CONFIG_PREEMPT
141static inline int rcu_read_lock_sched_held(void) 148static inline int rcu_read_lock_sched_held(void)
@@ -177,7 +184,7 @@ static inline int rcu_read_lock_bh_held(void)
177#ifdef CONFIG_PREEMPT 184#ifdef CONFIG_PREEMPT
178static inline int rcu_read_lock_sched_held(void) 185static inline int rcu_read_lock_sched_held(void)
179{ 186{
180 return !rcu_scheduler_active || preempt_count() != 0 || irqs_disabled(); 187 return preempt_count() != 0 || irqs_disabled();
181} 188}
182#else /* #ifdef CONFIG_PREEMPT */ 189#else /* #ifdef CONFIG_PREEMPT */
183static inline int rcu_read_lock_sched_held(void) 190static inline int rcu_read_lock_sched_held(void)
@@ -190,6 +197,17 @@ static inline int rcu_read_lock_sched_held(void)
190 197
191#ifdef CONFIG_PROVE_RCU 198#ifdef CONFIG_PROVE_RCU
192 199
200extern int rcu_my_thread_group_empty(void);
201
202#define __do_rcu_dereference_check(c) \
203 do { \
204 static bool __warned; \
205 if (debug_lockdep_rcu_enabled() && !__warned && !(c)) { \
206 __warned = true; \
207 lockdep_rcu_dereference(__FILE__, __LINE__); \
208 } \
209 } while (0)
210
193/** 211/**
194 * rcu_dereference_check - rcu_dereference with debug checking 212 * rcu_dereference_check - rcu_dereference with debug checking
195 * @p: The pointer to read, prior to dereferencing 213 * @p: The pointer to read, prior to dereferencing
@@ -219,8 +237,7 @@ static inline int rcu_read_lock_sched_held(void)
219 */ 237 */
220#define rcu_dereference_check(p, c) \ 238#define rcu_dereference_check(p, c) \
221 ({ \ 239 ({ \
222 if (debug_lockdep_rcu_enabled() && !(c)) \ 240 __do_rcu_dereference_check(c); \
223 lockdep_rcu_dereference(__FILE__, __LINE__); \
224 rcu_dereference_raw(p); \ 241 rcu_dereference_raw(p); \
225 }) 242 })
226 243
@@ -237,8 +254,7 @@ static inline int rcu_read_lock_sched_held(void)
237 */ 254 */
238#define rcu_dereference_protected(p, c) \ 255#define rcu_dereference_protected(p, c) \
239 ({ \ 256 ({ \
240 if (debug_lockdep_rcu_enabled() && !(c)) \ 257 __do_rcu_dereference_check(c); \
241 lockdep_rcu_dereference(__FILE__, __LINE__); \
242 (p); \ 258 (p); \
243 }) 259 })
244 260
diff --git a/include/linux/rcutiny.h b/include/linux/rcutiny.h
index a5195875480a..e2e893144a84 100644
--- a/include/linux/rcutiny.h
+++ b/include/linux/rcutiny.h
@@ -29,6 +29,10 @@
29 29
30void rcu_sched_qs(int cpu); 30void rcu_sched_qs(int cpu);
31void rcu_bh_qs(int cpu); 31void rcu_bh_qs(int cpu);
32static inline void rcu_note_context_switch(int cpu)
33{
34 rcu_sched_qs(cpu);
35}
32 36
33#define __rcu_read_lock() preempt_disable() 37#define __rcu_read_lock() preempt_disable()
34#define __rcu_read_unlock() preempt_enable() 38#define __rcu_read_unlock() preempt_enable()
@@ -60,8 +64,6 @@ static inline long rcu_batches_completed_bh(void)
60 return 0; 64 return 0;
61} 65}
62 66
63extern int rcu_expedited_torture_stats(char *page);
64
65static inline void rcu_force_quiescent_state(void) 67static inline void rcu_force_quiescent_state(void)
66{ 68{
67} 69}
@@ -74,7 +76,17 @@ static inline void rcu_sched_force_quiescent_state(void)
74{ 76{
75} 77}
76 78
77#define synchronize_rcu synchronize_sched 79extern void synchronize_sched(void);
80
81static inline void synchronize_rcu(void)
82{
83 synchronize_sched();
84}
85
86static inline void synchronize_rcu_bh(void)
87{
88 synchronize_sched();
89}
78 90
79static inline void synchronize_rcu_expedited(void) 91static inline void synchronize_rcu_expedited(void)
80{ 92{
@@ -114,4 +126,17 @@ static inline int rcu_preempt_depth(void)
114 return 0; 126 return 0;
115} 127}
116 128
129#ifdef CONFIG_DEBUG_LOCK_ALLOC
130
131extern int rcu_scheduler_active __read_mostly;
132extern void rcu_scheduler_starting(void);
133
134#else /* #ifdef CONFIG_DEBUG_LOCK_ALLOC */
135
136static inline void rcu_scheduler_starting(void)
137{
138}
139
140#endif /* #else #ifdef CONFIG_DEBUG_LOCK_ALLOC */
141
117#endif /* __LINUX_RCUTINY_H */ 142#endif /* __LINUX_RCUTINY_H */
diff --git a/include/linux/rcutree.h b/include/linux/rcutree.h
index 42cc3a04779e..c0ed1c056f29 100644
--- a/include/linux/rcutree.h
+++ b/include/linux/rcutree.h
@@ -34,8 +34,8 @@ struct notifier_block;
34 34
35extern void rcu_sched_qs(int cpu); 35extern void rcu_sched_qs(int cpu);
36extern void rcu_bh_qs(int cpu); 36extern void rcu_bh_qs(int cpu);
37extern void rcu_note_context_switch(int cpu);
37extern int rcu_needs_cpu(int cpu); 38extern int rcu_needs_cpu(int cpu);
38extern int rcu_expedited_torture_stats(char *page);
39 39
40#ifdef CONFIG_TREE_PREEMPT_RCU 40#ifdef CONFIG_TREE_PREEMPT_RCU
41 41
@@ -86,6 +86,8 @@ static inline void __rcu_read_unlock_bh(void)
86 86
87extern void call_rcu_sched(struct rcu_head *head, 87extern void call_rcu_sched(struct rcu_head *head,
88 void (*func)(struct rcu_head *rcu)); 88 void (*func)(struct rcu_head *rcu));
89extern void synchronize_rcu_bh(void);
90extern void synchronize_sched(void);
89extern void synchronize_rcu_expedited(void); 91extern void synchronize_rcu_expedited(void);
90 92
91static inline void synchronize_rcu_bh_expedited(void) 93static inline void synchronize_rcu_bh_expedited(void)
@@ -120,4 +122,7 @@ static inline int rcu_blocking_is_gp(void)
120 return num_online_cpus() == 1; 122 return num_online_cpus() == 1;
121} 123}
122 124
125extern void rcu_scheduler_starting(void);
126extern int rcu_scheduler_active __read_mostly;
127
123#endif /* __LINUX_RCUTREE_H */ 128#endif /* __LINUX_RCUTREE_H */
diff --git a/include/linux/regulator/consumer.h b/include/linux/regulator/consumer.h
index 28c9fd020d39..ebd747265294 100644
--- a/include/linux/regulator/consumer.h
+++ b/include/linux/regulator/consumer.h
@@ -183,9 +183,13 @@ static inline struct regulator *__must_check regulator_get(struct device *dev,
183{ 183{
184 /* Nothing except the stubbed out regulator API should be 184 /* Nothing except the stubbed out regulator API should be
185 * looking at the value except to check if it is an error 185 * looking at the value except to check if it is an error
186 * value so the actual return value doesn't matter. 186 * value. Drivers are free to handle NULL specifically by
187 * skipping all regulator API calls, but they don't have to.
188 * Drivers which don't, should make sure they properly handle
189 * corner cases of the API, such as regulator_get_voltage()
190 * returning 0.
187 */ 191 */
188 return (struct regulator *)id; 192 return NULL;
189} 193}
190static inline void regulator_put(struct regulator *regulator) 194static inline void regulator_put(struct regulator *regulator)
191{ 195{
diff --git a/include/linux/regulator/machine.h b/include/linux/regulator/machine.h
index 234a8476cba8..e2980287245e 100644
--- a/include/linux/regulator/machine.h
+++ b/include/linux/regulator/machine.h
@@ -157,7 +157,11 @@ struct regulator_consumer_supply {
157 * 157 *
158 * Initialisation constraints, our supply and consumers supplies. 158 * Initialisation constraints, our supply and consumers supplies.
159 * 159 *
160 * @supply_regulator_dev: Parent regulator (if any). 160 * @supply_regulator: Parent regulator. Specified using the regulator name
161 * as it appears in the name field in sysfs, which can
162 * be explicitly set using the constraints field 'name'.
163 * @supply_regulator_dev: Parent regulator (if any) - DEPRECATED in favour
164 * of supply_regulator.
161 * 165 *
162 * @constraints: Constraints. These must be specified for the regulator to 166 * @constraints: Constraints. These must be specified for the regulator to
163 * be usable. 167 * be usable.
@@ -168,7 +172,8 @@ struct regulator_consumer_supply {
168 * @driver_data: Data passed to regulator_init. 172 * @driver_data: Data passed to regulator_init.
169 */ 173 */
170struct regulator_init_data { 174struct regulator_init_data {
171 struct device *supply_regulator_dev; /* or NULL for LINE */ 175 const char *supply_regulator; /* or NULL for system supply */
176 struct device *supply_regulator_dev; /* or NULL for system supply */
172 177
173 struct regulation_constraints constraints; 178 struct regulation_constraints constraints;
174 179
diff --git a/include/linux/reiserfs_acl.h b/include/linux/reiserfs_acl.h
index b4448853900e..3fd8c4506bbb 100644
--- a/include/linux/reiserfs_acl.h
+++ b/include/linux/reiserfs_acl.h
@@ -53,8 +53,8 @@ int reiserfs_inherit_default_acl(struct reiserfs_transaction_handle *th,
53 struct inode *dir, struct dentry *dentry, 53 struct inode *dir, struct dentry *dentry,
54 struct inode *inode); 54 struct inode *inode);
55int reiserfs_cache_default_acl(struct inode *dir); 55int reiserfs_cache_default_acl(struct inode *dir);
56extern struct xattr_handler reiserfs_posix_acl_default_handler; 56extern const struct xattr_handler reiserfs_posix_acl_default_handler;
57extern struct xattr_handler reiserfs_posix_acl_access_handler; 57extern const struct xattr_handler reiserfs_posix_acl_access_handler;
58 58
59#else 59#else
60 60
diff --git a/include/linux/reiserfs_xattr.h b/include/linux/reiserfs_xattr.h
index 7fa02b4af838..b2cf2089769b 100644
--- a/include/linux/reiserfs_xattr.h
+++ b/include/linux/reiserfs_xattr.h
@@ -58,9 +58,9 @@ int reiserfs_xattr_set_handle(struct reiserfs_transaction_handle *,
58 struct inode *, const char *, const void *, 58 struct inode *, const char *, const void *,
59 size_t, int); 59 size_t, int);
60 60
61extern struct xattr_handler reiserfs_xattr_user_handler; 61extern const struct xattr_handler reiserfs_xattr_user_handler;
62extern struct xattr_handler reiserfs_xattr_trusted_handler; 62extern const struct xattr_handler reiserfs_xattr_trusted_handler;
63extern struct xattr_handler reiserfs_xattr_security_handler; 63extern const struct xattr_handler reiserfs_xattr_security_handler;
64#ifdef CONFIG_REISERFS_FS_SECURITY 64#ifdef CONFIG_REISERFS_FS_SECURITY
65int reiserfs_security_init(struct inode *dir, struct inode *inode, 65int reiserfs_security_init(struct inode *dir, struct inode *inode,
66 struct reiserfs_security_handle *sec); 66 struct reiserfs_security_handle *sec);
diff --git a/include/linux/ring_buffer.h b/include/linux/ring_buffer.h
index 5fcc31ed5771..25b4f686d918 100644
--- a/include/linux/ring_buffer.h
+++ b/include/linux/ring_buffer.h
@@ -120,12 +120,16 @@ int ring_buffer_write(struct ring_buffer *buffer,
120 unsigned long length, void *data); 120 unsigned long length, void *data);
121 121
122struct ring_buffer_event * 122struct ring_buffer_event *
123ring_buffer_peek(struct ring_buffer *buffer, int cpu, u64 *ts); 123ring_buffer_peek(struct ring_buffer *buffer, int cpu, u64 *ts,
124 unsigned long *lost_events);
124struct ring_buffer_event * 125struct ring_buffer_event *
125ring_buffer_consume(struct ring_buffer *buffer, int cpu, u64 *ts); 126ring_buffer_consume(struct ring_buffer *buffer, int cpu, u64 *ts,
127 unsigned long *lost_events);
126 128
127struct ring_buffer_iter * 129struct ring_buffer_iter *
128ring_buffer_read_start(struct ring_buffer *buffer, int cpu); 130ring_buffer_read_prepare(struct ring_buffer *buffer, int cpu);
131void ring_buffer_read_prepare_sync(void);
132void ring_buffer_read_start(struct ring_buffer_iter *iter);
129void ring_buffer_read_finish(struct ring_buffer_iter *iter); 133void ring_buffer_read_finish(struct ring_buffer_iter *iter);
130 134
131struct ring_buffer_event * 135struct ring_buffer_event *
diff --git a/include/linux/rio.h b/include/linux/rio.h
index dc0c75556c63..bd6eb0ed34a7 100644
--- a/include/linux/rio.h
+++ b/include/linux/rio.h
@@ -64,10 +64,13 @@
64#define RIO_INB_MBOX_RESOURCE 1 64#define RIO_INB_MBOX_RESOURCE 1
65#define RIO_OUTB_MBOX_RESOURCE 2 65#define RIO_OUTB_MBOX_RESOURCE 2
66 66
67#define RIO_PW_MSG_SIZE 64
68
67extern struct bus_type rio_bus_type; 69extern struct bus_type rio_bus_type;
68extern struct list_head rio_devices; /* list of all devices */ 70extern struct list_head rio_devices; /* list of all devices */
69 71
70struct rio_mport; 72struct rio_mport;
73union rio_pw_msg;
71 74
72/** 75/**
73 * struct rio_dev - RIO device info 76 * struct rio_dev - RIO device info
@@ -85,11 +88,15 @@ struct rio_mport;
85 * @swpinfo: Switch port info 88 * @swpinfo: Switch port info
86 * @src_ops: Source operation capabilities 89 * @src_ops: Source operation capabilities
87 * @dst_ops: Destination operation capabilities 90 * @dst_ops: Destination operation capabilities
91 * @comp_tag: RIO component tag
92 * @phys_efptr: RIO device extended features pointer
93 * @em_efptr: RIO Error Management features pointer
88 * @dma_mask: Mask of bits of RIO address this device implements 94 * @dma_mask: Mask of bits of RIO address this device implements
89 * @rswitch: Pointer to &struct rio_switch if valid for this device 95 * @rswitch: Pointer to &struct rio_switch if valid for this device
90 * @driver: Driver claiming this device 96 * @driver: Driver claiming this device
91 * @dev: Device model device 97 * @dev: Device model device
92 * @riores: RIO resources this device owns 98 * @riores: RIO resources this device owns
99 * @pwcback: port-write callback function for this device
93 * @destid: Network destination ID 100 * @destid: Network destination ID
94 */ 101 */
95struct rio_dev { 102struct rio_dev {
@@ -107,11 +114,15 @@ struct rio_dev {
107 u32 swpinfo; /* Only used for switches */ 114 u32 swpinfo; /* Only used for switches */
108 u32 src_ops; 115 u32 src_ops;
109 u32 dst_ops; 116 u32 dst_ops;
117 u32 comp_tag;
118 u32 phys_efptr;
119 u32 em_efptr;
110 u64 dma_mask; 120 u64 dma_mask;
111 struct rio_switch *rswitch; /* RIO switch info */ 121 struct rio_switch *rswitch; /* RIO switch info */
112 struct rio_driver *driver; /* RIO driver claiming this device */ 122 struct rio_driver *driver; /* RIO driver claiming this device */
113 struct device dev; /* LDM device structure */ 123 struct device dev; /* LDM device structure */
114 struct resource riores[RIO_MAX_DEV_RESOURCES]; 124 struct resource riores[RIO_MAX_DEV_RESOURCES];
125 int (*pwcback) (struct rio_dev *rdev, union rio_pw_msg *msg, int step);
115 u16 destid; 126 u16 destid;
116}; 127};
117 128
@@ -211,8 +222,14 @@ struct rio_net {
211 * @hopcount: Hopcount to this switch 222 * @hopcount: Hopcount to this switch
212 * @destid: Associated destid in the path 223 * @destid: Associated destid in the path
213 * @route_table: Copy of switch routing table 224 * @route_table: Copy of switch routing table
225 * @port_ok: Status of each port (one bit per port) - OK=1 or UNINIT=0
214 * @add_entry: Callback for switch-specific route add function 226 * @add_entry: Callback for switch-specific route add function
215 * @get_entry: Callback for switch-specific route get function 227 * @get_entry: Callback for switch-specific route get function
228 * @clr_table: Callback for switch-specific clear route table function
229 * @set_domain: Callback for switch-specific domain setting function
230 * @get_domain: Callback for switch-specific domain get function
231 * @em_init: Callback for switch-specific error management initialization function
232 * @em_handle: Callback for switch-specific error management handler function
216 */ 233 */
217struct rio_switch { 234struct rio_switch {
218 struct list_head node; 235 struct list_head node;
@@ -220,10 +237,19 @@ struct rio_switch {
220 u16 hopcount; 237 u16 hopcount;
221 u16 destid; 238 u16 destid;
222 u8 *route_table; 239 u8 *route_table;
240 u32 port_ok;
223 int (*add_entry) (struct rio_mport * mport, u16 destid, u8 hopcount, 241 int (*add_entry) (struct rio_mport * mport, u16 destid, u8 hopcount,
224 u16 table, u16 route_destid, u8 route_port); 242 u16 table, u16 route_destid, u8 route_port);
225 int (*get_entry) (struct rio_mport * mport, u16 destid, u8 hopcount, 243 int (*get_entry) (struct rio_mport * mport, u16 destid, u8 hopcount,
226 u16 table, u16 route_destid, u8 * route_port); 244 u16 table, u16 route_destid, u8 * route_port);
245 int (*clr_table) (struct rio_mport *mport, u16 destid, u8 hopcount,
246 u16 table);
247 int (*set_domain) (struct rio_mport *mport, u16 destid, u8 hopcount,
248 u8 sw_domain);
249 int (*get_domain) (struct rio_mport *mport, u16 destid, u8 hopcount,
250 u8 *sw_domain);
251 int (*em_init) (struct rio_dev *dev);
252 int (*em_handle) (struct rio_dev *dev, u8 swport);
227}; 253};
228 254
229/* Low-level architecture-dependent routines */ 255/* Low-level architecture-dependent routines */
@@ -235,6 +261,7 @@ struct rio_switch {
235 * @cread: Callback to perform network read of config space. 261 * @cread: Callback to perform network read of config space.
236 * @cwrite: Callback to perform network write of config space. 262 * @cwrite: Callback to perform network write of config space.
237 * @dsend: Callback to send a doorbell message. 263 * @dsend: Callback to send a doorbell message.
264 * @pwenable: Callback to enable/disable port-write message handling.
238 */ 265 */
239struct rio_ops { 266struct rio_ops {
240 int (*lcread) (struct rio_mport *mport, int index, u32 offset, int len, 267 int (*lcread) (struct rio_mport *mport, int index, u32 offset, int len,
@@ -246,6 +273,7 @@ struct rio_ops {
246 int (*cwrite) (struct rio_mport *mport, int index, u16 destid, 273 int (*cwrite) (struct rio_mport *mport, int index, u16 destid,
247 u8 hopcount, u32 offset, int len, u32 data); 274 u8 hopcount, u32 offset, int len, u32 data);
248 int (*dsend) (struct rio_mport *mport, int index, u16 destid, u16 data); 275 int (*dsend) (struct rio_mport *mport, int index, u16 destid, u16 data);
276 int (*pwenable) (struct rio_mport *mport, int enable);
249}; 277};
250 278
251#define RIO_RESOURCE_MEM 0x00000100 279#define RIO_RESOURCE_MEM 0x00000100
@@ -302,21 +330,28 @@ struct rio_device_id {
302}; 330};
303 331
304/** 332/**
305 * struct rio_route_ops - Per-switch route operations 333 * struct rio_switch_ops - Per-switch operations
306 * @vid: RIO vendor ID 334 * @vid: RIO vendor ID
307 * @did: RIO device ID 335 * @did: RIO device ID
308 * @add_hook: Callback that adds a route entry 336 * @init_hook: Callback that performs switch device initialization
309 * @get_hook: Callback that gets a route entry
310 * 337 *
311 * Defines the operations that are necessary to manipulate the route 338 * Defines the operations that are necessary to initialize/control
312 * tables for a particular RIO switch device. 339 * a particular RIO switch device.
313 */ 340 */
314struct rio_route_ops { 341struct rio_switch_ops {
315 u16 vid, did; 342 u16 vid, did;
316 int (*add_hook) (struct rio_mport * mport, u16 destid, u8 hopcount, 343 int (*init_hook) (struct rio_dev *rdev, int do_enum);
317 u16 table, u16 route_destid, u8 route_port); 344};
318 int (*get_hook) (struct rio_mport * mport, u16 destid, u8 hopcount, 345
319 u16 table, u16 route_destid, u8 * route_port); 346union rio_pw_msg {
347 struct {
348 u32 comptag; /* Component Tag CSR */
349 u32 errdetect; /* Port N Error Detect CSR */
350 u32 is_port; /* Implementation specific + PortID */
351 u32 ltlerrdet; /* LTL Error Detect CSR */
352 u32 padding[12];
353 } em;
354 u32 raw[RIO_PW_MSG_SIZE/sizeof(u32)];
320}; 355};
321 356
322/* Architecture and hardware-specific functions */ 357/* Architecture and hardware-specific functions */
diff --git a/include/linux/rio_drv.h b/include/linux/rio_drv.h
index c93a58a40033..edc55da717b3 100644
--- a/include/linux/rio_drv.h
+++ b/include/linux/rio_drv.h
@@ -413,6 +413,12 @@ void rio_release_regions(struct rio_dev *);
413int rio_request_region(struct rio_dev *, int, char *); 413int rio_request_region(struct rio_dev *, int, char *);
414void rio_release_region(struct rio_dev *, int); 414void rio_release_region(struct rio_dev *, int);
415 415
416/* Port-Write management */
417extern int rio_request_inb_pwrite(struct rio_dev *,
418 int (*)(struct rio_dev *, union rio_pw_msg*, int));
419extern int rio_release_inb_pwrite(struct rio_dev *);
420extern int rio_inb_pwrite_handler(union rio_pw_msg *pw_msg);
421
416/* LDM support */ 422/* LDM support */
417int rio_register_driver(struct rio_driver *); 423int rio_register_driver(struct rio_driver *);
418void rio_unregister_driver(struct rio_driver *); 424void rio_unregister_driver(struct rio_driver *);
diff --git a/include/linux/rio_ids.h b/include/linux/rio_ids.h
index 919d4e07d54e..db50e1c288b7 100644
--- a/include/linux/rio_ids.h
+++ b/include/linux/rio_ids.h
@@ -20,5 +20,19 @@
20 20
21#define RIO_VID_TUNDRA 0x000d 21#define RIO_VID_TUNDRA 0x000d
22#define RIO_DID_TSI500 0x0500 22#define RIO_DID_TSI500 0x0500
23#define RIO_DID_TSI568 0x0568
24#define RIO_DID_TSI572 0x0572
25#define RIO_DID_TSI574 0x0574
26#define RIO_DID_TSI576 0x0578 /* Same ID as Tsi578 */
27#define RIO_DID_TSI577 0x0577
28#define RIO_DID_TSI578 0x0578
29
30#define RIO_VID_IDT 0x0038
31#define RIO_DID_IDT70K200 0x0310
32#define RIO_DID_IDTCPS8 0x035c
33#define RIO_DID_IDTCPS12 0x035d
34#define RIO_DID_IDTCPS16 0x035b
35#define RIO_DID_IDTCPS6Q 0x035f
36#define RIO_DID_IDTCPS10Q 0x035e
23 37
24#endif /* LINUX_RIO_IDS_H */ 38#endif /* LINUX_RIO_IDS_H */
diff --git a/include/linux/rio_regs.h b/include/linux/rio_regs.h
index 326540f9b54e..aedee0489fb4 100644
--- a/include/linux/rio_regs.h
+++ b/include/linux/rio_regs.h
@@ -39,6 +39,8 @@
39#define RIO_PEF_INB_MBOX2 0x00200000 /* [II] Mailbox 2 */ 39#define RIO_PEF_INB_MBOX2 0x00200000 /* [II] Mailbox 2 */
40#define RIO_PEF_INB_MBOX3 0x00100000 /* [II] Mailbox 3 */ 40#define RIO_PEF_INB_MBOX3 0x00100000 /* [II] Mailbox 3 */
41#define RIO_PEF_INB_DOORBELL 0x00080000 /* [II] Doorbells */ 41#define RIO_PEF_INB_DOORBELL 0x00080000 /* [II] Doorbells */
42#define RIO_PEF_EXT_RT 0x00000200 /* [III, 1.3] Extended route table support */
43#define RIO_PEF_STD_RT 0x00000100 /* [III, 1.3] Standard route table support */
42#define RIO_PEF_CTLS 0x00000010 /* [III] CTLS */ 44#define RIO_PEF_CTLS 0x00000010 /* [III] CTLS */
43#define RIO_PEF_EXT_FEATURES 0x00000008 /* [I] EFT_PTR valid */ 45#define RIO_PEF_EXT_FEATURES 0x00000008 /* [I] EFT_PTR valid */
44#define RIO_PEF_ADDR_66 0x00000004 /* [I] 66 bits */ 46#define RIO_PEF_ADDR_66 0x00000004 /* [I] 66 bits */
@@ -91,7 +93,10 @@
91#define RIO_OPS_ATOMIC_CLR 0x00000010 /* [I] Atomic clr op */ 93#define RIO_OPS_ATOMIC_CLR 0x00000010 /* [I] Atomic clr op */
92#define RIO_OPS_PORT_WRITE 0x00000004 /* [I] Port-write op */ 94#define RIO_OPS_PORT_WRITE 0x00000004 /* [I] Port-write op */
93 95
94 /* 0x20-0x3c *//* Reserved */ 96 /* 0x20-0x30 *//* Reserved */
97
98#define RIO_SWITCH_RT_LIMIT 0x34 /* [III, 1.3] Switch Route Table Destination ID Limit CAR */
99#define RIO_RT_MAX_DESTID 0x0000ffff
95 100
96#define RIO_MBOX_CSR 0x40 /* [II] Mailbox CSR */ 101#define RIO_MBOX_CSR 0x40 /* [II] Mailbox CSR */
97#define RIO_MBOX0_AVAIL 0x80000000 /* [II] Mbox 0 avail */ 102#define RIO_MBOX0_AVAIL 0x80000000 /* [II] Mbox 0 avail */
@@ -153,7 +158,11 @@
153#define RIO_HOST_DID_LOCK_CSR 0x68 /* [III] Host Base Device ID Lock CSR */ 158#define RIO_HOST_DID_LOCK_CSR 0x68 /* [III] Host Base Device ID Lock CSR */
154#define RIO_COMPONENT_TAG_CSR 0x6c /* [III] Component Tag CSR */ 159#define RIO_COMPONENT_TAG_CSR 0x6c /* [III] Component Tag CSR */
155 160
156 /* 0x70-0xf8 *//* Reserved */ 161#define RIO_STD_RTE_CONF_DESTID_SEL_CSR 0x70
162#define RIO_STD_RTE_CONF_PORT_SEL_CSR 0x74
163#define RIO_STD_RTE_DEFAULT_PORT 0x78
164
165 /* 0x7c-0xf8 *//* Reserved */
157 /* 0x100-0xfff8 *//* [I] Extended Features Space */ 166 /* 0x100-0xfff8 *//* [I] Extended Features Space */
158 /* 0x10000-0xfffff8 *//* [I] Implementation-defined Space */ 167 /* 0x10000-0xfffff8 *//* [I] Implementation-defined Space */
159 168
@@ -183,9 +192,14 @@
183#define RIO_EFB_PAR_EP_ID 0x0001 /* [IV] LP/LVDS EP Devices */ 192#define RIO_EFB_PAR_EP_ID 0x0001 /* [IV] LP/LVDS EP Devices */
184#define RIO_EFB_PAR_EP_REC_ID 0x0002 /* [IV] LP/LVDS EP Recovery Devices */ 193#define RIO_EFB_PAR_EP_REC_ID 0x0002 /* [IV] LP/LVDS EP Recovery Devices */
185#define RIO_EFB_PAR_EP_FREE_ID 0x0003 /* [IV] LP/LVDS EP Free Devices */ 194#define RIO_EFB_PAR_EP_FREE_ID 0x0003 /* [IV] LP/LVDS EP Free Devices */
195#define RIO_EFB_SER_EP_ID_V13P 0x0001 /* [VI] LP/Serial EP Devices, RapidIO Spec ver 1.3 and above */
196#define RIO_EFB_SER_EP_REC_ID_V13P 0x0002 /* [VI] LP/Serial EP Recovery Devices, RapidIO Spec ver 1.3 and above */
197#define RIO_EFB_SER_EP_FREE_ID_V13P 0x0003 /* [VI] LP/Serial EP Free Devices, RapidIO Spec ver 1.3 and above */
186#define RIO_EFB_SER_EP_ID 0x0004 /* [VI] LP/Serial EP Devices */ 198#define RIO_EFB_SER_EP_ID 0x0004 /* [VI] LP/Serial EP Devices */
187#define RIO_EFB_SER_EP_REC_ID 0x0005 /* [VI] LP/Serial EP Recovery Devices */ 199#define RIO_EFB_SER_EP_REC_ID 0x0005 /* [VI] LP/Serial EP Recovery Devices */
188#define RIO_EFB_SER_EP_FREE_ID 0x0006 /* [VI] LP/Serial EP Free Devices */ 200#define RIO_EFB_SER_EP_FREE_ID 0x0006 /* [VI] LP/Serial EP Free Devices */
201#define RIO_EFB_SER_EP_FREC_ID 0x0009 /* [VI] LP/Serial EP Free Recovery Devices */
202#define RIO_EFB_ERR_MGMNT 0x0007 /* [VIII] Error Management Extensions */
189 203
190/* 204/*
191 * Physical 8/16 LP-LVDS 205 * Physical 8/16 LP-LVDS
@@ -201,15 +215,71 @@
201#define RIO_PORT_MNT_HEADER 0x0000 215#define RIO_PORT_MNT_HEADER 0x0000
202#define RIO_PORT_REQ_CTL_CSR 0x0020 216#define RIO_PORT_REQ_CTL_CSR 0x0020
203#define RIO_PORT_RSP_CTL_CSR 0x0024 /* 0x0001/0x0002 */ 217#define RIO_PORT_RSP_CTL_CSR 0x0024 /* 0x0001/0x0002 */
218#define RIO_PORT_LINKTO_CTL_CSR 0x0020 /* Serial */
219#define RIO_PORT_RSPTO_CTL_CSR 0x0024 /* Serial */
204#define RIO_PORT_GEN_CTL_CSR 0x003c 220#define RIO_PORT_GEN_CTL_CSR 0x003c
205#define RIO_PORT_GEN_HOST 0x80000000 221#define RIO_PORT_GEN_HOST 0x80000000
206#define RIO_PORT_GEN_MASTER 0x40000000 222#define RIO_PORT_GEN_MASTER 0x40000000
207#define RIO_PORT_GEN_DISCOVERED 0x20000000 223#define RIO_PORT_GEN_DISCOVERED 0x20000000
208#define RIO_PORT_N_MNT_REQ_CSR(x) (0x0040 + x*0x20) /* 0x0002 */ 224#define RIO_PORT_N_MNT_REQ_CSR(x) (0x0040 + x*0x20) /* 0x0002 */
209#define RIO_PORT_N_MNT_RSP_CSR(x) (0x0044 + x*0x20) /* 0x0002 */ 225#define RIO_PORT_N_MNT_RSP_CSR(x) (0x0044 + x*0x20) /* 0x0002 */
226#define RIO_PORT_N_MNT_RSP_RVAL 0x80000000 /* Response Valid */
227#define RIO_PORT_N_MNT_RSP_ASTAT 0x000003e0 /* ackID Status */
228#define RIO_PORT_N_MNT_RSP_LSTAT 0x0000001f /* Link Status */
210#define RIO_PORT_N_ACK_STS_CSR(x) (0x0048 + x*0x20) /* 0x0002 */ 229#define RIO_PORT_N_ACK_STS_CSR(x) (0x0048 + x*0x20) /* 0x0002 */
211#define RIO_PORT_N_ERR_STS_CSR(x) (0x58 + x*0x20) 230#define RIO_PORT_N_ACK_CLEAR 0x80000000
212#define PORT_N_ERR_STS_PORT_OK 0x00000002 231#define RIO_PORT_N_ACK_INBOUND 0x1f000000
213#define RIO_PORT_N_CTL_CSR(x) (0x5c + x*0x20) 232#define RIO_PORT_N_ACK_OUTSTAND 0x00001f00
233#define RIO_PORT_N_ACK_OUTBOUND 0x0000001f
234#define RIO_PORT_N_ERR_STS_CSR(x) (0x0058 + x*0x20)
235#define RIO_PORT_N_ERR_STS_PW_OUT_ES 0x00010000 /* Output Error-stopped */
236#define RIO_PORT_N_ERR_STS_PW_INP_ES 0x00000100 /* Input Error-stopped */
237#define RIO_PORT_N_ERR_STS_PW_PEND 0x00000010 /* Port-Write Pending */
238#define RIO_PORT_N_ERR_STS_PORT_ERR 0x00000004
239#define RIO_PORT_N_ERR_STS_PORT_OK 0x00000002
240#define RIO_PORT_N_ERR_STS_PORT_UNINIT 0x00000001
241#define RIO_PORT_N_ERR_STS_CLR_MASK 0x07120204
242#define RIO_PORT_N_CTL_CSR(x) (0x005c + x*0x20)
243#define RIO_PORT_N_CTL_PWIDTH 0xc0000000
244#define RIO_PORT_N_CTL_PWIDTH_1 0x00000000
245#define RIO_PORT_N_CTL_PWIDTH_4 0x40000000
246#define RIO_PORT_N_CTL_P_TYP_SER 0x00000001
247#define RIO_PORT_N_CTL_LOCKOUT 0x00000002
248#define RIO_PORT_N_CTL_EN_RX_SER 0x00200000
249#define RIO_PORT_N_CTL_EN_TX_SER 0x00400000
250#define RIO_PORT_N_CTL_EN_RX_PAR 0x08000000
251#define RIO_PORT_N_CTL_EN_TX_PAR 0x40000000
252
253/*
254 * Error Management Extensions (RapidIO 1.3+, Part 8)
255 *
256 * Extended Features Block ID=0x0007
257 */
258
259/* General EM Registers (Common for all Ports) */
260
261#define RIO_EM_EFB_HEADER 0x000 /* Error Management Extensions Block Header */
262#define RIO_EM_LTL_ERR_DETECT 0x008 /* Logical/Transport Layer Error Detect CSR */
263#define RIO_EM_LTL_ERR_EN 0x00c /* Logical/Transport Layer Error Enable CSR */
264#define RIO_EM_LTL_HIADDR_CAP 0x010 /* Logical/Transport Layer High Address Capture CSR */
265#define RIO_EM_LTL_ADDR_CAP 0x014 /* Logical/Transport Layer Address Capture CSR */
266#define RIO_EM_LTL_DEVID_CAP 0x018 /* Logical/Transport Layer Device ID Capture CSR */
267#define RIO_EM_LTL_CTRL_CAP 0x01c /* Logical/Transport Layer Control Capture CSR */
268#define RIO_EM_PW_TGT_DEVID 0x028 /* Port-write Target deviceID CSR */
269#define RIO_EM_PKT_TTL 0x02c /* Packet Time-to-live CSR */
270
271/* Per-Port EM Registers */
272
273#define RIO_EM_PN_ERR_DETECT(x) (0x040 + x*0x40) /* Port N Error Detect CSR */
274#define REM_PED_IMPL_SPEC 0x80000000
275#define REM_PED_LINK_TO 0x00000001
276#define RIO_EM_PN_ERRRATE_EN(x) (0x044 + x*0x40) /* Port N Error Rate Enable CSR */
277#define RIO_EM_PN_ATTRIB_CAP(x) (0x048 + x*0x40) /* Port N Attributes Capture CSR */
278#define RIO_EM_PN_PKT_CAP_0(x) (0x04c + x*0x40) /* Port N Packet/Control Symbol Capture 0 CSR */
279#define RIO_EM_PN_PKT_CAP_1(x) (0x050 + x*0x40) /* Port N Packet Capture 1 CSR */
280#define RIO_EM_PN_PKT_CAP_2(x) (0x054 + x*0x40) /* Port N Packet Capture 2 CSR */
281#define RIO_EM_PN_PKT_CAP_3(x) (0x058 + x*0x40) /* Port N Packet Capture 3 CSR */
282#define RIO_EM_PN_ERRRATE(x) (0x068 + x*0x40) /* Port N Error Rate CSR */
283#define RIO_EM_PN_ERRRATE_TR(x) (0x06c + x*0x40) /* Port N Error Rate Threshold CSR */
214 284
215#endif /* LINUX_RIO_REGS_H */ 285#endif /* LINUX_RIO_REGS_H */
diff --git a/include/linux/rmap.h b/include/linux/rmap.h
index d25bd224d370..77216742c178 100644
--- a/include/linux/rmap.h
+++ b/include/linux/rmap.h
@@ -26,8 +26,17 @@
26 */ 26 */
27struct anon_vma { 27struct anon_vma {
28 spinlock_t lock; /* Serialize access to vma list */ 28 spinlock_t lock; /* Serialize access to vma list */
29#ifdef CONFIG_KSM 29#if defined(CONFIG_KSM) || defined(CONFIG_MIGRATION)
30 atomic_t ksm_refcount; 30
31 /*
32 * The external_refcount is taken by either KSM or page migration
33 * to take a reference to an anon_vma when there is no
34 * guarantee that the vma of page tables will exist for
35 * the duration of the operation. A caller that takes
36 * the reference is responsible for clearing up the
37 * anon_vma if they are the last user on release
38 */
39 atomic_t external_refcount;
31#endif 40#endif
32 /* 41 /*
33 * NOTE: the LSB of the head.next is set by 42 * NOTE: the LSB of the head.next is set by
@@ -61,22 +70,22 @@ struct anon_vma_chain {
61}; 70};
62 71
63#ifdef CONFIG_MMU 72#ifdef CONFIG_MMU
64#ifdef CONFIG_KSM 73#if defined(CONFIG_KSM) || defined(CONFIG_MIGRATION)
65static inline void ksm_refcount_init(struct anon_vma *anon_vma) 74static inline void anonvma_external_refcount_init(struct anon_vma *anon_vma)
66{ 75{
67 atomic_set(&anon_vma->ksm_refcount, 0); 76 atomic_set(&anon_vma->external_refcount, 0);
68} 77}
69 78
70static inline int ksm_refcount(struct anon_vma *anon_vma) 79static inline int anonvma_external_refcount(struct anon_vma *anon_vma)
71{ 80{
72 return atomic_read(&anon_vma->ksm_refcount); 81 return atomic_read(&anon_vma->external_refcount);
73} 82}
74#else 83#else
75static inline void ksm_refcount_init(struct anon_vma *anon_vma) 84static inline void anonvma_external_refcount_init(struct anon_vma *anon_vma)
76{ 85{
77} 86}
78 87
79static inline int ksm_refcount(struct anon_vma *anon_vma) 88static inline int anonvma_external_refcount(struct anon_vma *anon_vma)
80{ 89{
81 return 0; 90 return 0;
82} 91}
diff --git a/include/linux/rtc-v3020.h b/include/linux/rtc-v3020.h
index 8ba646e610d9..e55d82cebf80 100644
--- a/include/linux/rtc-v3020.h
+++ b/include/linux/rtc-v3020.h
@@ -15,7 +15,7 @@
15struct v3020_platform_data { 15struct v3020_platform_data {
16 int leftshift; /* (1<<(leftshift)) & readl() */ 16 int leftshift; /* (1<<(leftshift)) & readl() */
17 17
18 int use_gpio:1; 18 unsigned int use_gpio:1;
19 unsigned int gpio_cs; 19 unsigned int gpio_cs;
20 unsigned int gpio_wr; 20 unsigned int gpio_wr;
21 unsigned int gpio_rd; 21 unsigned int gpio_rd;
diff --git a/include/linux/rtnetlink.h b/include/linux/rtnetlink.h
index 5a42c36cb6aa..fbc8cb0d48c3 100644
--- a/include/linux/rtnetlink.h
+++ b/include/linux/rtnetlink.h
@@ -11,7 +11,8 @@
11 * families, values above 128 may be used arbitrarily. 11 * families, values above 128 may be used arbitrarily.
12 */ 12 */
13#define RTNL_FAMILY_IPMR 128 13#define RTNL_FAMILY_IPMR 128
14#define RTNL_FAMILY_MAX 128 14#define RTNL_FAMILY_IP6MR 129
15#define RTNL_FAMILY_MAX 129
15 16
16/**** 17/****
17 * Routing/neighbour discovery messages. 18 * Routing/neighbour discovery messages.
diff --git a/include/linux/sched.h b/include/linux/sched.h
index dad7f668ebf7..f118809c953f 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -99,7 +99,6 @@ struct futex_pi_state;
99struct robust_list_head; 99struct robust_list_head;
100struct bio_list; 100struct bio_list;
101struct fs_struct; 101struct fs_struct;
102struct bts_context;
103struct perf_event_context; 102struct perf_event_context;
104 103
105/* 104/*
@@ -269,17 +268,22 @@ extern void init_idle(struct task_struct *idle, int cpu);
269extern void init_idle_bootup_task(struct task_struct *idle); 268extern void init_idle_bootup_task(struct task_struct *idle);
270 269
271extern int runqueue_is_locked(int cpu); 270extern int runqueue_is_locked(int cpu);
272extern void task_rq_unlock_wait(struct task_struct *p);
273 271
274extern cpumask_var_t nohz_cpu_mask; 272extern cpumask_var_t nohz_cpu_mask;
275#if defined(CONFIG_SMP) && defined(CONFIG_NO_HZ) 273#if defined(CONFIG_SMP) && defined(CONFIG_NO_HZ)
276extern int select_nohz_load_balancer(int cpu); 274extern int select_nohz_load_balancer(int cpu);
277extern int get_nohz_load_balancer(void); 275extern int get_nohz_load_balancer(void);
276extern int nohz_ratelimit(int cpu);
278#else 277#else
279static inline int select_nohz_load_balancer(int cpu) 278static inline int select_nohz_load_balancer(int cpu)
280{ 279{
281 return 0; 280 return 0;
282} 281}
282
283static inline int nohz_ratelimit(int cpu)
284{
285 return 0;
286}
283#endif 287#endif
284 288
285/* 289/*
@@ -379,7 +383,7 @@ struct user_namespace;
379 * 1-3 now and depends on arch. We use "5" as safe margin, here. 383 * 1-3 now and depends on arch. We use "5" as safe margin, here.
380 */ 384 */
381#define MAPCOUNT_ELF_CORE_MARGIN (5) 385#define MAPCOUNT_ELF_CORE_MARGIN (5)
382#define DEFAULT_MAX_MAP_COUNT (USHORT_MAX - MAPCOUNT_ELF_CORE_MARGIN) 386#define DEFAULT_MAX_MAP_COUNT (USHRT_MAX - MAPCOUNT_ELF_CORE_MARGIN)
383 387
384extern int sysctl_max_map_count; 388extern int sysctl_max_map_count;
385 389
@@ -522,8 +526,9 @@ struct thread_group_cputimer {
522 * the locking of signal_struct. 526 * the locking of signal_struct.
523 */ 527 */
524struct signal_struct { 528struct signal_struct {
525 atomic_t count; 529 atomic_t sigcnt;
526 atomic_t live; 530 atomic_t live;
531 int nr_threads;
527 532
528 wait_queue_head_t wait_chldexit; /* for wait4() */ 533 wait_queue_head_t wait_chldexit; /* for wait4() */
529 534
@@ -954,6 +959,7 @@ struct sched_domain {
954 char *name; 959 char *name;
955#endif 960#endif
956 961
962 unsigned int span_weight;
957 /* 963 /*
958 * Span of all CPUs in this domain. 964 * Span of all CPUs in this domain.
959 * 965 *
@@ -1026,12 +1032,17 @@ struct sched_domain;
1026#define WF_SYNC 0x01 /* waker goes to sleep after wakup */ 1032#define WF_SYNC 0x01 /* waker goes to sleep after wakup */
1027#define WF_FORK 0x02 /* child wakeup after fork */ 1033#define WF_FORK 0x02 /* child wakeup after fork */
1028 1034
1035#define ENQUEUE_WAKEUP 1
1036#define ENQUEUE_WAKING 2
1037#define ENQUEUE_HEAD 4
1038
1039#define DEQUEUE_SLEEP 1
1040
1029struct sched_class { 1041struct sched_class {
1030 const struct sched_class *next; 1042 const struct sched_class *next;
1031 1043
1032 void (*enqueue_task) (struct rq *rq, struct task_struct *p, int wakeup, 1044 void (*enqueue_task) (struct rq *rq, struct task_struct *p, int flags);
1033 bool head); 1045 void (*dequeue_task) (struct rq *rq, struct task_struct *p, int flags);
1034 void (*dequeue_task) (struct rq *rq, struct task_struct *p, int sleep);
1035 void (*yield_task) (struct rq *rq); 1046 void (*yield_task) (struct rq *rq);
1036 1047
1037 void (*check_preempt_curr) (struct rq *rq, struct task_struct *p, int flags); 1048 void (*check_preempt_curr) (struct rq *rq, struct task_struct *p, int flags);
@@ -1040,7 +1051,8 @@ struct sched_class {
1040 void (*put_prev_task) (struct rq *rq, struct task_struct *p); 1051 void (*put_prev_task) (struct rq *rq, struct task_struct *p);
1041 1052
1042#ifdef CONFIG_SMP 1053#ifdef CONFIG_SMP
1043 int (*select_task_rq)(struct task_struct *p, int sd_flag, int flags); 1054 int (*select_task_rq)(struct rq *rq, struct task_struct *p,
1055 int sd_flag, int flags);
1044 1056
1045 void (*pre_schedule) (struct rq *this_rq, struct task_struct *task); 1057 void (*pre_schedule) (struct rq *this_rq, struct task_struct *task);
1046 void (*post_schedule) (struct rq *this_rq); 1058 void (*post_schedule) (struct rq *this_rq);
@@ -1077,36 +1089,8 @@ struct load_weight {
1077 unsigned long weight, inv_weight; 1089 unsigned long weight, inv_weight;
1078}; 1090};
1079 1091
1080/*
1081 * CFS stats for a schedulable entity (task, task-group etc)
1082 *
1083 * Current field usage histogram:
1084 *
1085 * 4 se->block_start
1086 * 4 se->run_node
1087 * 4 se->sleep_start
1088 * 6 se->load.weight
1089 */
1090struct sched_entity {
1091 struct load_weight load; /* for load-balancing */
1092 struct rb_node run_node;
1093 struct list_head group_node;
1094 unsigned int on_rq;
1095
1096 u64 exec_start;
1097 u64 sum_exec_runtime;
1098 u64 vruntime;
1099 u64 prev_sum_exec_runtime;
1100
1101 u64 last_wakeup;
1102 u64 avg_overlap;
1103
1104 u64 nr_migrations;
1105
1106 u64 start_runtime;
1107 u64 avg_wakeup;
1108
1109#ifdef CONFIG_SCHEDSTATS 1092#ifdef CONFIG_SCHEDSTATS
1093struct sched_statistics {
1110 u64 wait_start; 1094 u64 wait_start;
1111 u64 wait_max; 1095 u64 wait_max;
1112 u64 wait_count; 1096 u64 wait_count;
@@ -1138,6 +1122,24 @@ struct sched_entity {
1138 u64 nr_wakeups_affine_attempts; 1122 u64 nr_wakeups_affine_attempts;
1139 u64 nr_wakeups_passive; 1123 u64 nr_wakeups_passive;
1140 u64 nr_wakeups_idle; 1124 u64 nr_wakeups_idle;
1125};
1126#endif
1127
1128struct sched_entity {
1129 struct load_weight load; /* for load-balancing */
1130 struct rb_node run_node;
1131 struct list_head group_node;
1132 unsigned int on_rq;
1133
1134 u64 exec_start;
1135 u64 sum_exec_runtime;
1136 u64 vruntime;
1137 u64 prev_sum_exec_runtime;
1138
1139 u64 nr_migrations;
1140
1141#ifdef CONFIG_SCHEDSTATS
1142 struct sched_statistics statistics;
1141#endif 1143#endif
1142 1144
1143#ifdef CONFIG_FAIR_GROUP_SCHED 1145#ifdef CONFIG_FAIR_GROUP_SCHED
@@ -1272,12 +1274,6 @@ struct task_struct {
1272 struct list_head ptraced; 1274 struct list_head ptraced;
1273 struct list_head ptrace_entry; 1275 struct list_head ptrace_entry;
1274 1276
1275 /*
1276 * This is the tracer handle for the ptrace BTS extension.
1277 * This field actually belongs to the ptracer task.
1278 */
1279 struct bts_context *bts;
1280
1281 /* PID/PID hash table linkage. */ 1277 /* PID/PID hash table linkage. */
1282 struct pid_link pids[PIDTYPE_MAX]; 1278 struct pid_link pids[PIDTYPE_MAX];
1283 struct list_head thread_group; 1279 struct list_head thread_group;
@@ -1425,7 +1421,9 @@ struct task_struct {
1425#endif 1421#endif
1426#ifdef CONFIG_CPUSETS 1422#ifdef CONFIG_CPUSETS
1427 nodemask_t mems_allowed; /* Protected by alloc_lock */ 1423 nodemask_t mems_allowed; /* Protected by alloc_lock */
1424 int mems_allowed_change_disable;
1428 int cpuset_mem_spread_rotor; 1425 int cpuset_mem_spread_rotor;
1426 int cpuset_slab_spread_rotor;
1429#endif 1427#endif
1430#ifdef CONFIG_CGROUPS 1428#ifdef CONFIG_CGROUPS
1431 /* Control Group info protected by css_set_lock */ 1429 /* Control Group info protected by css_set_lock */
@@ -1497,7 +1495,6 @@ struct task_struct {
1497 /* bitmask of trace recursion */ 1495 /* bitmask of trace recursion */
1498 unsigned long trace_recursion; 1496 unsigned long trace_recursion;
1499#endif /* CONFIG_TRACING */ 1497#endif /* CONFIG_TRACING */
1500 unsigned long stack_start;
1501#ifdef CONFIG_CGROUP_MEM_RES_CTLR /* memcg uses this to do batch job */ 1498#ifdef CONFIG_CGROUP_MEM_RES_CTLR /* memcg uses this to do batch job */
1502 struct memcg_batch_info { 1499 struct memcg_batch_info {
1503 int do_batch; /* incremented when batch uncharge started */ 1500 int do_batch; /* incremented when batch uncharge started */
@@ -1847,6 +1844,7 @@ extern void sched_clock_idle_sleep_event(void);
1847extern void sched_clock_idle_wakeup_event(u64 delta_ns); 1844extern void sched_clock_idle_wakeup_event(u64 delta_ns);
1848 1845
1849#ifdef CONFIG_HOTPLUG_CPU 1846#ifdef CONFIG_HOTPLUG_CPU
1847extern void move_task_off_dead_cpu(int dead_cpu, struct task_struct *p);
1850extern void idle_task_exit(void); 1848extern void idle_task_exit(void);
1851#else 1849#else
1852static inline void idle_task_exit(void) {} 1850static inline void idle_task_exit(void) {}
@@ -2038,7 +2036,7 @@ extern int do_notify_parent(struct task_struct *, int);
2038extern void __wake_up_parent(struct task_struct *p, struct task_struct *parent); 2036extern void __wake_up_parent(struct task_struct *p, struct task_struct *parent);
2039extern void force_sig(int, struct task_struct *); 2037extern void force_sig(int, struct task_struct *);
2040extern int send_sig(int, struct task_struct *, int); 2038extern int send_sig(int, struct task_struct *, int);
2041extern void zap_other_threads(struct task_struct *p); 2039extern int zap_other_threads(struct task_struct *p);
2042extern struct sigqueue *sigqueue_alloc(void); 2040extern struct sigqueue *sigqueue_alloc(void);
2043extern void sigqueue_free(struct sigqueue *); 2041extern void sigqueue_free(struct sigqueue *);
2044extern int send_sigqueue(struct sigqueue *, struct task_struct *, int group); 2042extern int send_sigqueue(struct sigqueue *, struct task_struct *, int group);
@@ -2103,7 +2101,6 @@ extern void flush_thread(void);
2103extern void exit_thread(void); 2101extern void exit_thread(void);
2104 2102
2105extern void exit_files(struct task_struct *); 2103extern void exit_files(struct task_struct *);
2106extern void __cleanup_signal(struct signal_struct *);
2107extern void __cleanup_sighand(struct sighand_struct *); 2104extern void __cleanup_sighand(struct sighand_struct *);
2108 2105
2109extern void exit_itimers(struct signal_struct *); 2106extern void exit_itimers(struct signal_struct *);
@@ -2123,10 +2120,8 @@ extern void set_task_comm(struct task_struct *tsk, char *from);
2123extern char *get_task_comm(char *to, struct task_struct *tsk); 2120extern char *get_task_comm(char *to, struct task_struct *tsk);
2124 2121
2125#ifdef CONFIG_SMP 2122#ifdef CONFIG_SMP
2126extern void wait_task_context_switch(struct task_struct *p);
2127extern unsigned long wait_task_inactive(struct task_struct *, long match_state); 2123extern unsigned long wait_task_inactive(struct task_struct *, long match_state);
2128#else 2124#else
2129static inline void wait_task_context_switch(struct task_struct *p) {}
2130static inline unsigned long wait_task_inactive(struct task_struct *p, 2125static inline unsigned long wait_task_inactive(struct task_struct *p,
2131 long match_state) 2126 long match_state)
2132{ 2127{
@@ -2152,6 +2147,11 @@ extern bool current_is_single_threaded(void);
2152#define while_each_thread(g, t) \ 2147#define while_each_thread(g, t) \
2153 while ((t = next_thread(t)) != g) 2148 while ((t = next_thread(t)) != g)
2154 2149
2150static inline int get_nr_threads(struct task_struct *tsk)
2151{
2152 return tsk->signal->nr_threads;
2153}
2154
2155/* de_thread depends on thread_group_leader not being a pid based check */ 2155/* de_thread depends on thread_group_leader not being a pid based check */
2156#define thread_group_leader(p) (p == p->group_leader) 2156#define thread_group_leader(p) (p == p->group_leader)
2157 2157
@@ -2398,10 +2398,6 @@ static inline void thread_group_cputime_init(struct signal_struct *sig)
2398 spin_lock_init(&sig->cputimer.lock); 2398 spin_lock_init(&sig->cputimer.lock);
2399} 2399}
2400 2400
2401static inline void thread_group_cputime_free(struct signal_struct *sig)
2402{
2403}
2404
2405/* 2401/*
2406 * Reevaluate whether the task has signals pending delivery. 2402 * Reevaluate whether the task has signals pending delivery.
2407 * Wake the task if so. 2403 * Wake the task if so.
diff --git a/include/linux/sdhci-pltfm.h b/include/linux/sdhci-pltfm.h
new file mode 100644
index 000000000000..0239bd70241e
--- /dev/null
+++ b/include/linux/sdhci-pltfm.h
@@ -0,0 +1,35 @@
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);
32 void (*exit)(struct sdhci_host *host);
33};
34
35#endif /* _SDHCI_PLTFM_H */
diff --git a/include/linux/security.h b/include/linux/security.h
index 3158dd982d27..0c8819170463 100644
--- a/include/linux/security.h
+++ b/include/linux/security.h
@@ -267,49 +267,16 @@ static inline void security_free_mnt_opts(struct security_mnt_opts *opts)
267 * @orig the original mount data copied from userspace. 267 * @orig the original mount data copied from userspace.
268 * @copy copied data which will be passed to the security module. 268 * @copy copied data which will be passed to the security module.
269 * Returns 0 if the copy was successful. 269 * Returns 0 if the copy was successful.
270 * @sb_check_sb:
271 * Check permission before the device with superblock @mnt->sb is mounted
272 * on the mount point named by @nd.
273 * @mnt contains the vfsmount for device being mounted.
274 * @path contains the path for the mount point.
275 * Return 0 if permission is granted.
276 * @sb_umount: 270 * @sb_umount:
277 * Check permission before the @mnt file system is unmounted. 271 * Check permission before the @mnt file system is unmounted.
278 * @mnt contains the mounted file system. 272 * @mnt contains the mounted file system.
279 * @flags contains the unmount flags, e.g. MNT_FORCE. 273 * @flags contains the unmount flags, e.g. MNT_FORCE.
280 * Return 0 if permission is granted. 274 * Return 0 if permission is granted.
281 * @sb_umount_close:
282 * Close any files in the @mnt mounted filesystem that are held open by
283 * the security module. This hook is called during an umount operation
284 * prior to checking whether the filesystem is still busy.
285 * @mnt contains the mounted filesystem.
286 * @sb_umount_busy:
287 * Handle a failed umount of the @mnt mounted filesystem, e.g. re-opening
288 * any files that were closed by umount_close. This hook is called during
289 * an umount operation if the umount fails after a call to the
290 * umount_close hook.
291 * @mnt contains the mounted filesystem.
292 * @sb_post_remount:
293 * Update the security module's state when a filesystem is remounted.
294 * This hook is only called if the remount was successful.
295 * @mnt contains the mounted file system.
296 * @flags contains the new filesystem flags.
297 * @data contains the filesystem-specific data.
298 * @sb_post_addmount:
299 * Update the security module's state when a filesystem is mounted.
300 * This hook is called any time a mount is successfully grafetd to
301 * the tree.
302 * @mnt contains the mounted filesystem.
303 * @mountpoint contains the path for the mount point.
304 * @sb_pivotroot: 275 * @sb_pivotroot:
305 * Check permission before pivoting the root filesystem. 276 * Check permission before pivoting the root filesystem.
306 * @old_path contains the path for the new location of the current root (put_old). 277 * @old_path contains the path for the new location of the current root (put_old).
307 * @new_path contains the path for the new root (new_root). 278 * @new_path contains the path for the new root (new_root).
308 * Return 0 if permission is granted. 279 * Return 0 if permission is granted.
309 * @sb_post_pivotroot:
310 * Update module state after a successful pivot.
311 * @old_path contains the path for the old root.
312 * @new_path contains the path for the new root.
313 * @sb_set_mnt_opts: 280 * @sb_set_mnt_opts:
314 * Set the security relevant mount options used for a superblock 281 * Set the security relevant mount options used for a superblock
315 * @sb the superblock to set security mount options for 282 * @sb the superblock to set security mount options for
@@ -511,12 +478,6 @@ static inline void security_free_mnt_opts(struct security_mnt_opts *opts)
511 * @mnt is the vfsmount where the dentry was looked up 478 * @mnt is the vfsmount where the dentry was looked up
512 * @dentry contains the dentry structure for the file. 479 * @dentry contains the dentry structure for the file.
513 * Return 0 if permission is granted. 480 * Return 0 if permission is granted.
514 * @inode_delete:
515 * @inode contains the inode structure for deleted inode.
516 * This hook is called when a deleted inode is released (i.e. an inode
517 * with no hard links has its use count drop to zero). A security module
518 * can use this hook to release any persistent label associated with the
519 * inode.
520 * @inode_setxattr: 481 * @inode_setxattr:
521 * Check permission before setting the extended attributes 482 * Check permission before setting the extended attributes
522 * @value identified by @name for @dentry. 483 * @value identified by @name for @dentry.
@@ -691,10 +652,6 @@ static inline void security_free_mnt_opts(struct security_mnt_opts *opts)
691 * @old points to the original credentials. 652 * @old points to the original credentials.
692 * @gfp indicates the atomicity of any memory allocations. 653 * @gfp indicates the atomicity of any memory allocations.
693 * Prepare a new set of credentials by copying the data from the old set. 654 * Prepare a new set of credentials by copying the data from the old set.
694 * @cred_commit:
695 * @new points to the new credentials.
696 * @old points to the original credentials.
697 * Install a new set of credentials.
698 * @cred_transfer: 655 * @cred_transfer:
699 * @new points to the new credentials. 656 * @new points to the new credentials.
700 * @old points to the original credentials. 657 * @old points to the original credentials.
@@ -717,18 +674,6 @@ static inline void security_free_mnt_opts(struct security_mnt_opts *opts)
717 * userspace to load a kernel module with the given name. 674 * userspace to load a kernel module with the given name.
718 * @kmod_name name of the module requested by the kernel 675 * @kmod_name name of the module requested by the kernel
719 * Return 0 if successful. 676 * Return 0 if successful.
720 * @task_setuid:
721 * Check permission before setting one or more of the user identity
722 * attributes of the current process. The @flags parameter indicates
723 * which of the set*uid system calls invoked this hook and how to
724 * interpret the @id0, @id1, and @id2 parameters. See the LSM_SETID
725 * definitions at the beginning of this file for the @flags values and
726 * their meanings.
727 * @id0 contains a uid.
728 * @id1 contains a uid.
729 * @id2 contains a uid.
730 * @flags contains one of the LSM_SETID_* values.
731 * Return 0 if permission is granted.
732 * @task_fix_setuid: 677 * @task_fix_setuid:
733 * Update the module's state after setting one or more of the user 678 * Update the module's state after setting one or more of the user
734 * identity attributes of the current process. The @flags parameter 679 * identity attributes of the current process. The @flags parameter
@@ -738,18 +683,6 @@ static inline void security_free_mnt_opts(struct security_mnt_opts *opts)
738 * @old is the set of credentials that are being replaces 683 * @old is the set of credentials that are being replaces
739 * @flags contains one of the LSM_SETID_* values. 684 * @flags contains one of the LSM_SETID_* values.
740 * Return 0 on success. 685 * Return 0 on success.
741 * @task_setgid:
742 * Check permission before setting one or more of the group identity
743 * attributes of the current process. The @flags parameter indicates
744 * which of the set*gid system calls invoked this hook and how to
745 * interpret the @id0, @id1, and @id2 parameters. See the LSM_SETID
746 * definitions at the beginning of this file for the @flags values and
747 * their meanings.
748 * @id0 contains a gid.
749 * @id1 contains a gid.
750 * @id2 contains a gid.
751 * @flags contains one of the LSM_SETID_* values.
752 * Return 0 if permission is granted.
753 * @task_setpgid: 686 * @task_setpgid:
754 * Check permission before setting the process group identifier of the 687 * Check permission before setting the process group identifier of the
755 * process @p to @pgid. 688 * process @p to @pgid.
@@ -771,11 +704,6 @@ static inline void security_free_mnt_opts(struct security_mnt_opts *opts)
771 * @p contains the task_struct for the process and place is into @secid. 704 * @p contains the task_struct for the process and place is into @secid.
772 * In case of failure, @secid will be set to zero. 705 * In case of failure, @secid will be set to zero.
773 * 706 *
774 * @task_setgroups:
775 * Check permission before setting the supplementary group set of the
776 * current process.
777 * @group_info contains the new group information.
778 * Return 0 if permission is granted.
779 * @task_setnice: 707 * @task_setnice:
780 * Check permission before setting the nice value of @p to @nice. 708 * Check permission before setting the nice value of @p to @nice.
781 * @p contains the task_struct of process. 709 * @p contains the task_struct of process.
@@ -1139,13 +1067,6 @@ static inline void security_free_mnt_opts(struct security_mnt_opts *opts)
1139 * Return the length of the string (including terminating NUL) or -ve if 1067 * Return the length of the string (including terminating NUL) or -ve if
1140 * an error. 1068 * an error.
1141 * May also return 0 (and a NULL buffer pointer) if there is no label. 1069 * May also return 0 (and a NULL buffer pointer) if there is no label.
1142 * @key_session_to_parent:
1143 * Forcibly assign the session keyring from a process to its parent
1144 * process.
1145 * @cred: Pointer to process's credentials
1146 * @parent_cred: Pointer to parent process's credentials
1147 * @keyring: Proposed new session keyring
1148 * Return 0 if permission is granted, -ve error otherwise.
1149 * 1070 *
1150 * Security hooks affecting all System V IPC operations. 1071 * Security hooks affecting all System V IPC operations.
1151 * 1072 *
@@ -1333,13 +1254,6 @@ static inline void security_free_mnt_opts(struct security_mnt_opts *opts)
1333 * @cap contains the capability <include/linux/capability.h>. 1254 * @cap contains the capability <include/linux/capability.h>.
1334 * @audit: Whether to write an audit message or not 1255 * @audit: Whether to write an audit message or not
1335 * Return 0 if the capability is granted for @tsk. 1256 * Return 0 if the capability is granted for @tsk.
1336 * @acct:
1337 * Check permission before enabling or disabling process accounting. If
1338 * accounting is being enabled, then @file refers to the open file used to
1339 * store accounting records. If accounting is being disabled, then @file
1340 * is NULL.
1341 * @file contains the file structure for the accounting file (may be NULL).
1342 * Return 0 if permission is granted.
1343 * @sysctl: 1257 * @sysctl:
1344 * Check permission before accessing the @table sysctl variable in the 1258 * Check permission before accessing the @table sysctl variable in the
1345 * manner specified by @op. 1259 * manner specified by @op.
@@ -1462,7 +1376,6 @@ struct security_operations {
1462 const kernel_cap_t *permitted); 1376 const kernel_cap_t *permitted);
1463 int (*capable) (struct task_struct *tsk, const struct cred *cred, 1377 int (*capable) (struct task_struct *tsk, const struct cred *cred,
1464 int cap, int audit); 1378 int cap, int audit);
1465 int (*acct) (struct file *file);
1466 int (*sysctl) (struct ctl_table *table, int op); 1379 int (*sysctl) (struct ctl_table *table, int op);
1467 int (*quotactl) (int cmds, int type, int id, struct super_block *sb); 1380 int (*quotactl) (int cmds, int type, int id, struct super_block *sb);
1468 int (*quota_on) (struct dentry *dentry); 1381 int (*quota_on) (struct dentry *dentry);
@@ -1484,18 +1397,9 @@ struct security_operations {
1484 int (*sb_statfs) (struct dentry *dentry); 1397 int (*sb_statfs) (struct dentry *dentry);
1485 int (*sb_mount) (char *dev_name, struct path *path, 1398 int (*sb_mount) (char *dev_name, struct path *path,
1486 char *type, unsigned long flags, void *data); 1399 char *type, unsigned long flags, void *data);
1487 int (*sb_check_sb) (struct vfsmount *mnt, struct path *path);
1488 int (*sb_umount) (struct vfsmount *mnt, int flags); 1400 int (*sb_umount) (struct vfsmount *mnt, int flags);
1489 void (*sb_umount_close) (struct vfsmount *mnt);
1490 void (*sb_umount_busy) (struct vfsmount *mnt);
1491 void (*sb_post_remount) (struct vfsmount *mnt,
1492 unsigned long flags, void *data);
1493 void (*sb_post_addmount) (struct vfsmount *mnt,
1494 struct path *mountpoint);
1495 int (*sb_pivotroot) (struct path *old_path, 1401 int (*sb_pivotroot) (struct path *old_path,
1496 struct path *new_path); 1402 struct path *new_path);
1497 void (*sb_post_pivotroot) (struct path *old_path,
1498 struct path *new_path);
1499 int (*sb_set_mnt_opts) (struct super_block *sb, 1403 int (*sb_set_mnt_opts) (struct super_block *sb,
1500 struct security_mnt_opts *opts); 1404 struct security_mnt_opts *opts);
1501 void (*sb_clone_mnt_opts) (const struct super_block *oldsb, 1405 void (*sb_clone_mnt_opts) (const struct super_block *oldsb,
@@ -1544,7 +1448,6 @@ struct security_operations {
1544 int (*inode_permission) (struct inode *inode, int mask); 1448 int (*inode_permission) (struct inode *inode, int mask);
1545 int (*inode_setattr) (struct dentry *dentry, struct iattr *attr); 1449 int (*inode_setattr) (struct dentry *dentry, struct iattr *attr);
1546 int (*inode_getattr) (struct vfsmount *mnt, struct dentry *dentry); 1450 int (*inode_getattr) (struct vfsmount *mnt, struct dentry *dentry);
1547 void (*inode_delete) (struct inode *inode);
1548 int (*inode_setxattr) (struct dentry *dentry, const char *name, 1451 int (*inode_setxattr) (struct dentry *dentry, const char *name,
1549 const void *value, size_t size, int flags); 1452 const void *value, size_t size, int flags);
1550 void (*inode_post_setxattr) (struct dentry *dentry, const char *name, 1453 void (*inode_post_setxattr) (struct dentry *dentry, const char *name,
@@ -1585,20 +1488,16 @@ struct security_operations {
1585 void (*cred_free) (struct cred *cred); 1488 void (*cred_free) (struct cred *cred);
1586 int (*cred_prepare)(struct cred *new, const struct cred *old, 1489 int (*cred_prepare)(struct cred *new, const struct cred *old,
1587 gfp_t gfp); 1490 gfp_t gfp);
1588 void (*cred_commit)(struct cred *new, const struct cred *old);
1589 void (*cred_transfer)(struct cred *new, const struct cred *old); 1491 void (*cred_transfer)(struct cred *new, const struct cred *old);
1590 int (*kernel_act_as)(struct cred *new, u32 secid); 1492 int (*kernel_act_as)(struct cred *new, u32 secid);
1591 int (*kernel_create_files_as)(struct cred *new, struct inode *inode); 1493 int (*kernel_create_files_as)(struct cred *new, struct inode *inode);
1592 int (*kernel_module_request)(char *kmod_name); 1494 int (*kernel_module_request)(char *kmod_name);
1593 int (*task_setuid) (uid_t id0, uid_t id1, uid_t id2, int flags);
1594 int (*task_fix_setuid) (struct cred *new, const struct cred *old, 1495 int (*task_fix_setuid) (struct cred *new, const struct cred *old,
1595 int flags); 1496 int flags);
1596 int (*task_setgid) (gid_t id0, gid_t id1, gid_t id2, int flags);
1597 int (*task_setpgid) (struct task_struct *p, pid_t pgid); 1497 int (*task_setpgid) (struct task_struct *p, pid_t pgid);
1598 int (*task_getpgid) (struct task_struct *p); 1498 int (*task_getpgid) (struct task_struct *p);
1599 int (*task_getsid) (struct task_struct *p); 1499 int (*task_getsid) (struct task_struct *p);
1600 void (*task_getsecid) (struct task_struct *p, u32 *secid); 1500 void (*task_getsecid) (struct task_struct *p, u32 *secid);
1601 int (*task_setgroups) (struct group_info *group_info);
1602 int (*task_setnice) (struct task_struct *p, int nice); 1501 int (*task_setnice) (struct task_struct *p, int nice);
1603 int (*task_setioprio) (struct task_struct *p, int ioprio); 1502 int (*task_setioprio) (struct task_struct *p, int ioprio);
1604 int (*task_getioprio) (struct task_struct *p); 1503 int (*task_getioprio) (struct task_struct *p);
@@ -1728,9 +1627,6 @@ struct security_operations {
1728 const struct cred *cred, 1627 const struct cred *cred,
1729 key_perm_t perm); 1628 key_perm_t perm);
1730 int (*key_getsecurity)(struct key *key, char **_buffer); 1629 int (*key_getsecurity)(struct key *key, char **_buffer);
1731 int (*key_session_to_parent)(const struct cred *cred,
1732 const struct cred *parent_cred,
1733 struct key *key);
1734#endif /* CONFIG_KEYS */ 1630#endif /* CONFIG_KEYS */
1735 1631
1736#ifdef CONFIG_AUDIT 1632#ifdef CONFIG_AUDIT
@@ -1761,7 +1657,6 @@ int security_capset(struct cred *new, const struct cred *old,
1761int security_capable(int cap); 1657int security_capable(int cap);
1762int security_real_capable(struct task_struct *tsk, int cap); 1658int security_real_capable(struct task_struct *tsk, int cap);
1763int security_real_capable_noaudit(struct task_struct *tsk, int cap); 1659int security_real_capable_noaudit(struct task_struct *tsk, int cap);
1764int security_acct(struct file *file);
1765int security_sysctl(struct ctl_table *table, int op); 1660int security_sysctl(struct ctl_table *table, int op);
1766int security_quotactl(int cmds, int type, int id, struct super_block *sb); 1661int security_quotactl(int cmds, int type, int id, struct super_block *sb);
1767int security_quota_on(struct dentry *dentry); 1662int security_quota_on(struct dentry *dentry);
@@ -1783,14 +1678,8 @@ int security_sb_show_options(struct seq_file *m, struct super_block *sb);
1783int security_sb_statfs(struct dentry *dentry); 1678int security_sb_statfs(struct dentry *dentry);
1784int security_sb_mount(char *dev_name, struct path *path, 1679int security_sb_mount(char *dev_name, struct path *path,
1785 char *type, unsigned long flags, void *data); 1680 char *type, unsigned long flags, void *data);
1786int security_sb_check_sb(struct vfsmount *mnt, struct path *path);
1787int security_sb_umount(struct vfsmount *mnt, int flags); 1681int security_sb_umount(struct vfsmount *mnt, int flags);
1788void security_sb_umount_close(struct vfsmount *mnt);
1789void security_sb_umount_busy(struct vfsmount *mnt);
1790void security_sb_post_remount(struct vfsmount *mnt, unsigned long flags, void *data);
1791void security_sb_post_addmount(struct vfsmount *mnt, struct path *mountpoint);
1792int security_sb_pivotroot(struct path *old_path, struct path *new_path); 1682int security_sb_pivotroot(struct path *old_path, struct path *new_path);
1793void security_sb_post_pivotroot(struct path *old_path, struct path *new_path);
1794int security_sb_set_mnt_opts(struct super_block *sb, struct security_mnt_opts *opts); 1683int security_sb_set_mnt_opts(struct super_block *sb, struct security_mnt_opts *opts);
1795void security_sb_clone_mnt_opts(const struct super_block *oldsb, 1684void security_sb_clone_mnt_opts(const struct super_block *oldsb,
1796 struct super_block *newsb); 1685 struct super_block *newsb);
@@ -1816,7 +1705,6 @@ int security_inode_follow_link(struct dentry *dentry, struct nameidata *nd);
1816int security_inode_permission(struct inode *inode, int mask); 1705int security_inode_permission(struct inode *inode, int mask);
1817int security_inode_setattr(struct dentry *dentry, struct iattr *attr); 1706int security_inode_setattr(struct dentry *dentry, struct iattr *attr);
1818int security_inode_getattr(struct vfsmount *mnt, struct dentry *dentry); 1707int security_inode_getattr(struct vfsmount *mnt, struct dentry *dentry);
1819void security_inode_delete(struct inode *inode);
1820int security_inode_setxattr(struct dentry *dentry, const char *name, 1708int security_inode_setxattr(struct dentry *dentry, const char *name,
1821 const void *value, size_t size, int flags); 1709 const void *value, size_t size, int flags);
1822void security_inode_post_setxattr(struct dentry *dentry, const char *name, 1710void security_inode_post_setxattr(struct dentry *dentry, const char *name,
@@ -1850,20 +1738,16 @@ int security_task_create(unsigned long clone_flags);
1850int security_cred_alloc_blank(struct cred *cred, gfp_t gfp); 1738int security_cred_alloc_blank(struct cred *cred, gfp_t gfp);
1851void security_cred_free(struct cred *cred); 1739void security_cred_free(struct cred *cred);
1852int security_prepare_creds(struct cred *new, const struct cred *old, gfp_t gfp); 1740int security_prepare_creds(struct cred *new, const struct cred *old, gfp_t gfp);
1853void security_commit_creds(struct cred *new, const struct cred *old);
1854void security_transfer_creds(struct cred *new, const struct cred *old); 1741void security_transfer_creds(struct cred *new, const struct cred *old);
1855int security_kernel_act_as(struct cred *new, u32 secid); 1742int security_kernel_act_as(struct cred *new, u32 secid);
1856int security_kernel_create_files_as(struct cred *new, struct inode *inode); 1743int security_kernel_create_files_as(struct cred *new, struct inode *inode);
1857int security_kernel_module_request(char *kmod_name); 1744int security_kernel_module_request(char *kmod_name);
1858int security_task_setuid(uid_t id0, uid_t id1, uid_t id2, int flags);
1859int security_task_fix_setuid(struct cred *new, const struct cred *old, 1745int security_task_fix_setuid(struct cred *new, const struct cred *old,
1860 int flags); 1746 int flags);
1861int security_task_setgid(gid_t id0, gid_t id1, gid_t id2, int flags);
1862int security_task_setpgid(struct task_struct *p, pid_t pgid); 1747int security_task_setpgid(struct task_struct *p, pid_t pgid);
1863int security_task_getpgid(struct task_struct *p); 1748int security_task_getpgid(struct task_struct *p);
1864int security_task_getsid(struct task_struct *p); 1749int security_task_getsid(struct task_struct *p);
1865void security_task_getsecid(struct task_struct *p, u32 *secid); 1750void security_task_getsecid(struct task_struct *p, u32 *secid);
1866int security_task_setgroups(struct group_info *group_info);
1867int security_task_setnice(struct task_struct *p, int nice); 1751int security_task_setnice(struct task_struct *p, int nice);
1868int security_task_setioprio(struct task_struct *p, int ioprio); 1752int security_task_setioprio(struct task_struct *p, int ioprio);
1869int security_task_getioprio(struct task_struct *p); 1753int security_task_getioprio(struct task_struct *p);
@@ -1990,11 +1874,6 @@ int security_real_capable_noaudit(struct task_struct *tsk, int cap)
1990 return ret; 1874 return ret;
1991} 1875}
1992 1876
1993static inline int security_acct(struct file *file)
1994{
1995 return 0;
1996}
1997
1998static inline int security_sysctl(struct ctl_table *table, int op) 1877static inline int security_sysctl(struct ctl_table *table, int op)
1999{ 1878{
2000 return 0; 1879 return 0;
@@ -2099,41 +1978,17 @@ static inline int security_sb_mount(char *dev_name, struct path *path,
2099 return 0; 1978 return 0;
2100} 1979}
2101 1980
2102static inline int security_sb_check_sb(struct vfsmount *mnt,
2103 struct path *path)
2104{
2105 return 0;
2106}
2107
2108static inline int security_sb_umount(struct vfsmount *mnt, int flags) 1981static inline int security_sb_umount(struct vfsmount *mnt, int flags)
2109{ 1982{
2110 return 0; 1983 return 0;
2111} 1984}
2112 1985
2113static inline void security_sb_umount_close(struct vfsmount *mnt)
2114{ }
2115
2116static inline void security_sb_umount_busy(struct vfsmount *mnt)
2117{ }
2118
2119static inline void security_sb_post_remount(struct vfsmount *mnt,
2120 unsigned long flags, void *data)
2121{ }
2122
2123static inline void security_sb_post_addmount(struct vfsmount *mnt,
2124 struct path *mountpoint)
2125{ }
2126
2127static inline int security_sb_pivotroot(struct path *old_path, 1986static inline int security_sb_pivotroot(struct path *old_path,
2128 struct path *new_path) 1987 struct path *new_path)
2129{ 1988{
2130 return 0; 1989 return 0;
2131} 1990}
2132 1991
2133static inline void security_sb_post_pivotroot(struct path *old_path,
2134 struct path *new_path)
2135{ }
2136
2137static inline int security_sb_set_mnt_opts(struct super_block *sb, 1992static inline int security_sb_set_mnt_opts(struct super_block *sb,
2138 struct security_mnt_opts *opts) 1993 struct security_mnt_opts *opts)
2139{ 1994{
@@ -2249,9 +2104,6 @@ static inline int security_inode_getattr(struct vfsmount *mnt,
2249 return 0; 2104 return 0;
2250} 2105}
2251 2106
2252static inline void security_inode_delete(struct inode *inode)
2253{ }
2254
2255static inline int security_inode_setxattr(struct dentry *dentry, 2107static inline int security_inode_setxattr(struct dentry *dentry,
2256 const char *name, const void *value, size_t size, int flags) 2108 const char *name, const void *value, size_t size, int flags)
2257{ 2109{
@@ -2398,11 +2250,6 @@ static inline int security_prepare_creds(struct cred *new,
2398 return 0; 2250 return 0;
2399} 2251}
2400 2252
2401static inline void security_commit_creds(struct cred *new,
2402 const struct cred *old)
2403{
2404}
2405
2406static inline void security_transfer_creds(struct cred *new, 2253static inline void security_transfer_creds(struct cred *new,
2407 const struct cred *old) 2254 const struct cred *old)
2408{ 2255{
@@ -2424,12 +2271,6 @@ static inline int security_kernel_module_request(char *kmod_name)
2424 return 0; 2271 return 0;
2425} 2272}
2426 2273
2427static inline int security_task_setuid(uid_t id0, uid_t id1, uid_t id2,
2428 int flags)
2429{
2430 return 0;
2431}
2432
2433static inline int security_task_fix_setuid(struct cred *new, 2274static inline int security_task_fix_setuid(struct cred *new,
2434 const struct cred *old, 2275 const struct cred *old,
2435 int flags) 2276 int flags)
@@ -2437,12 +2278,6 @@ static inline int security_task_fix_setuid(struct cred *new,
2437 return cap_task_fix_setuid(new, old, flags); 2278 return cap_task_fix_setuid(new, old, flags);
2438} 2279}
2439 2280
2440static inline int security_task_setgid(gid_t id0, gid_t id1, gid_t id2,
2441 int flags)
2442{
2443 return 0;
2444}
2445
2446static inline int security_task_setpgid(struct task_struct *p, pid_t pgid) 2281static inline int security_task_setpgid(struct task_struct *p, pid_t pgid)
2447{ 2282{
2448 return 0; 2283 return 0;
@@ -2463,11 +2298,6 @@ static inline void security_task_getsecid(struct task_struct *p, u32 *secid)
2463 *secid = 0; 2298 *secid = 0;
2464} 2299}
2465 2300
2466static inline int security_task_setgroups(struct group_info *group_info)
2467{
2468 return 0;
2469}
2470
2471static inline int security_task_setnice(struct task_struct *p, int nice) 2301static inline int security_task_setnice(struct task_struct *p, int nice)
2472{ 2302{
2473 return cap_task_setnice(p, nice); 2303 return cap_task_setnice(p, nice);
@@ -3064,9 +2894,6 @@ void security_key_free(struct key *key);
3064int security_key_permission(key_ref_t key_ref, 2894int security_key_permission(key_ref_t key_ref,
3065 const struct cred *cred, key_perm_t perm); 2895 const struct cred *cred, key_perm_t perm);
3066int security_key_getsecurity(struct key *key, char **_buffer); 2896int security_key_getsecurity(struct key *key, char **_buffer);
3067int security_key_session_to_parent(const struct cred *cred,
3068 const struct cred *parent_cred,
3069 struct key *key);
3070 2897
3071#else 2898#else
3072 2899
@@ -3094,13 +2921,6 @@ static inline int security_key_getsecurity(struct key *key, char **_buffer)
3094 return 0; 2921 return 0;
3095} 2922}
3096 2923
3097static inline int security_key_session_to_parent(const struct cred *cred,
3098 const struct cred *parent_cred,
3099 struct key *key)
3100{
3101 return 0;
3102}
3103
3104#endif 2924#endif
3105#endif /* CONFIG_KEYS */ 2925#endif /* CONFIG_KEYS */
3106 2926
diff --git a/include/linux/sem.h b/include/linux/sem.h
index 8a4adbef8a0f..f2961afa2f66 100644
--- a/include/linux/sem.h
+++ b/include/linux/sem.h
@@ -79,6 +79,7 @@ struct seminfo {
79#ifdef __KERNEL__ 79#ifdef __KERNEL__
80#include <asm/atomic.h> 80#include <asm/atomic.h>
81#include <linux/rcupdate.h> 81#include <linux/rcupdate.h>
82#include <linux/cache.h>
82 83
83struct task_struct; 84struct task_struct;
84 85
@@ -91,7 +92,8 @@ struct sem {
91 92
92/* One sem_array data structure for each set of semaphores in the system. */ 93/* One sem_array data structure for each set of semaphores in the system. */
93struct sem_array { 94struct sem_array {
94 struct kern_ipc_perm sem_perm; /* permissions .. see ipc.h */ 95 struct kern_ipc_perm ____cacheline_aligned_in_smp
96 sem_perm; /* permissions .. see ipc.h */
95 time_t sem_otime; /* last semop time */ 97 time_t sem_otime; /* last semop time */
96 time_t sem_ctime; /* last change time */ 98 time_t sem_ctime; /* last change time */
97 struct sem *sem_base; /* ptr to first semaphore in array */ 99 struct sem *sem_base; /* ptr to first semaphore in array */
diff --git a/include/linux/serial_core.h b/include/linux/serial_core.h
index 78dd1e7120a9..f10db6e5f3b5 100644
--- a/include/linux/serial_core.h
+++ b/include/linux/serial_core.h
@@ -182,6 +182,10 @@
182/* Aeroflex Gaisler GRLIB APBUART */ 182/* Aeroflex Gaisler GRLIB APBUART */
183#define PORT_APBUART 90 183#define PORT_APBUART 90
184 184
185/* Altera UARTs */
186#define PORT_ALTERA_JTAGUART 91
187#define PORT_ALTERA_UART 92
188
185#ifdef __KERNEL__ 189#ifdef __KERNEL__
186 190
187#include <linux/compiler.h> 191#include <linux/compiler.h>
@@ -246,6 +250,7 @@ struct uart_ops {
246#endif 250#endif
247}; 251};
248 252
253#define NO_POLL_CHAR 0x00ff0000
249#define UART_CONFIG_TYPE (1 << 0) 254#define UART_CONFIG_TYPE (1 << 0)
250#define UART_CONFIG_IRQ (1 << 1) 255#define UART_CONFIG_IRQ (1 << 1)
251 256
diff --git a/include/linux/serial_sci.h b/include/linux/serial_sci.h
index 193d4bfe42ff..f5364a1de68b 100644
--- a/include/linux/serial_sci.h
+++ b/include/linux/serial_sci.h
@@ -33,8 +33,8 @@ struct plat_sci_port {
33 char *clk; /* clock string */ 33 char *clk; /* clock string */
34 struct device *dma_dev; 34 struct device *dma_dev;
35#ifdef CONFIG_SERIAL_SH_SCI_DMA 35#ifdef CONFIG_SERIAL_SH_SCI_DMA
36 enum sh_dmae_slave_chan_id dma_slave_tx; 36 unsigned int dma_slave_tx;
37 enum sh_dmae_slave_chan_id dma_slave_rx; 37 unsigned int dma_slave_rx;
38#endif 38#endif
39}; 39};
40 40
diff --git a/include/linux/serio.h b/include/linux/serio.h
index 64b473066b9a..b5552568178d 100644
--- a/include/linux/serio.h
+++ b/include/linux/serio.h
@@ -196,5 +196,6 @@ static inline void serio_continue_rx(struct serio *serio)
196#define SERIO_TOUCHIT213 0x38 196#define SERIO_TOUCHIT213 0x38
197#define SERIO_W8001 0x39 197#define SERIO_W8001 0x39
198#define SERIO_DYNAPRO 0x3a 198#define SERIO_DYNAPRO 0x3a
199#define SERIO_HAMPSHIRE 0x3b
199 200
200#endif 201#endif
diff --git a/include/linux/sfi.h b/include/linux/sfi.h
index 9a6f7607174e..0299b4ce63db 100644
--- a/include/linux/sfi.h
+++ b/include/linux/sfi.h
@@ -73,6 +73,8 @@
73#define SFI_SIG_SPIB "SPIB" 73#define SFI_SIG_SPIB "SPIB"
74#define SFI_SIG_I2CB "I2CB" 74#define SFI_SIG_I2CB "I2CB"
75#define SFI_SIG_GPEM "GPEM" 75#define SFI_SIG_GPEM "GPEM"
76#define SFI_SIG_DEVS "DEVS"
77#define SFI_SIG_GPIO "GPIO"
76 78
77#define SFI_SIGNATURE_SIZE 4 79#define SFI_SIGNATURE_SIZE 4
78#define SFI_OEM_ID_SIZE 6 80#define SFI_OEM_ID_SIZE 6
@@ -145,6 +147,27 @@ struct sfi_rtc_table_entry {
145 u32 irq; 147 u32 irq;
146} __packed; 148} __packed;
147 149
150struct sfi_device_table_entry {
151 u8 type; /* bus type, I2C, SPI or ...*/
152#define SFI_DEV_TYPE_SPI 0
153#define SFI_DEV_TYPE_I2C 1
154#define SFI_DEV_TYPE_UART 2
155#define SFI_DEV_TYPE_HSI 3
156#define SFI_DEV_TYPE_IPC 4
157
158 u8 host_num; /* attached to host 0, 1...*/
159 u16 addr;
160 u8 irq;
161 u32 max_freq;
162 char name[16];
163} __packed;
164
165struct sfi_gpio_table_entry {
166 char controller_name[16];
167 u16 pin_no;
168 char pin_name[16];
169} __packed;
170
148struct sfi_spi_table_entry { 171struct sfi_spi_table_entry {
149 u16 host_num; /* attached to host 0, 1...*/ 172 u16 host_num; /* attached to host 0, 1...*/
150 u16 cs; /* chip select */ 173 u16 cs; /* chip select */
@@ -166,7 +189,6 @@ struct sfi_gpe_table_entry {
166 u16 phys_id; /* physical GPE id */ 189 u16 phys_id; /* physical GPE id */
167} __packed; 190} __packed;
168 191
169
170typedef int (*sfi_table_handler) (struct sfi_table_header *table); 192typedef int (*sfi_table_handler) (struct sfi_table_header *table);
171 193
172#ifdef CONFIG_SFI 194#ifdef CONFIG_SFI
diff --git a/include/linux/sh_clk.h b/include/linux/sh_clk.h
new file mode 100644
index 000000000000..1636d1e2a5f1
--- /dev/null
+++ b/include/linux/sh_clk.h
@@ -0,0 +1,150 @@
1#ifndef __SH_CLOCK_H
2#define __SH_CLOCK_H
3
4#include <linux/list.h>
5#include <linux/seq_file.h>
6#include <linux/cpufreq.h>
7#include <linux/clk.h>
8#include <linux/err.h>
9
10struct clk;
11
12struct clk_ops {
13 void (*init)(struct clk *clk);
14 int (*enable)(struct clk *clk);
15 void (*disable)(struct clk *clk);
16 unsigned long (*recalc)(struct clk *clk);
17 int (*set_rate)(struct clk *clk, unsigned long rate, int algo_id);
18 int (*set_parent)(struct clk *clk, struct clk *parent);
19 long (*round_rate)(struct clk *clk, unsigned long rate);
20};
21
22struct clk {
23 struct list_head node;
24 const char *name;
25 int id;
26
27 struct clk *parent;
28 struct clk_ops *ops;
29
30 struct list_head children;
31 struct list_head sibling; /* node for children */
32
33 int usecount;
34
35 unsigned long rate;
36 unsigned long flags;
37
38 void __iomem *enable_reg;
39 unsigned int enable_bit;
40
41 unsigned long arch_flags;
42 void *priv;
43 struct dentry *dentry;
44 struct cpufreq_frequency_table *freq_table;
45};
46
47#define CLK_ENABLE_ON_INIT (1 << 0)
48
49/* drivers/sh/clk.c */
50unsigned long followparent_recalc(struct clk *);
51void recalculate_root_clocks(void);
52void propagate_rate(struct clk *);
53int clk_reparent(struct clk *child, struct clk *parent);
54int clk_register(struct clk *);
55void clk_unregister(struct clk *);
56void clk_enable_init_clocks(void);
57
58/**
59 * clk_set_rate_ex - set the clock rate for a clock source, with additional parameter
60 * @clk: clock source
61 * @rate: desired clock rate in Hz
62 * @algo_id: algorithm id to be passed down to ops->set_rate
63 *
64 * Returns success (0) or negative errno.
65 */
66int clk_set_rate_ex(struct clk *clk, unsigned long rate, int algo_id);
67
68enum clk_sh_algo_id {
69 NO_CHANGE = 0,
70
71 IUS_N1_N1,
72 IUS_322,
73 IUS_522,
74 IUS_N11,
75
76 SB_N1,
77
78 SB3_N1,
79 SB3_32,
80 SB3_43,
81 SB3_54,
82
83 BP_N1,
84
85 IP_N1,
86};
87
88struct clk_div_mult_table {
89 unsigned int *divisors;
90 unsigned int nr_divisors;
91 unsigned int *multipliers;
92 unsigned int nr_multipliers;
93};
94
95struct cpufreq_frequency_table;
96void clk_rate_table_build(struct clk *clk,
97 struct cpufreq_frequency_table *freq_table,
98 int nr_freqs,
99 struct clk_div_mult_table *src_table,
100 unsigned long *bitmap);
101
102long clk_rate_table_round(struct clk *clk,
103 struct cpufreq_frequency_table *freq_table,
104 unsigned long rate);
105
106int clk_rate_table_find(struct clk *clk,
107 struct cpufreq_frequency_table *freq_table,
108 unsigned long rate);
109
110#define SH_CLK_MSTP32(_parent, _enable_reg, _enable_bit, _flags) \
111{ \
112 .parent = _parent, \
113 .enable_reg = (void __iomem *)_enable_reg, \
114 .enable_bit = _enable_bit, \
115 .flags = _flags, \
116}
117
118int sh_clk_mstp32_register(struct clk *clks, int nr);
119
120#define SH_CLK_DIV4(_parent, _reg, _shift, _div_bitmap, _flags) \
121{ \
122 .parent = _parent, \
123 .enable_reg = (void __iomem *)_reg, \
124 .enable_bit = _shift, \
125 .arch_flags = _div_bitmap, \
126 .flags = _flags, \
127}
128
129struct clk_div4_table {
130 struct clk_div_mult_table *div_mult_table;
131 void (*kick)(struct clk *clk);
132};
133
134int sh_clk_div4_register(struct clk *clks, int nr,
135 struct clk_div4_table *table);
136int sh_clk_div4_enable_register(struct clk *clks, int nr,
137 struct clk_div4_table *table);
138int sh_clk_div4_reparent_register(struct clk *clks, int nr,
139 struct clk_div4_table *table);
140
141#define SH_CLK_DIV6(_parent, _reg, _flags) \
142{ \
143 .parent = _parent, \
144 .enable_reg = (void __iomem *)_reg, \
145 .flags = _flags, \
146}
147
148int sh_clk_div6_register(struct clk *clks, int nr);
149
150#endif /* __SH_CLOCK_H */
diff --git a/include/linux/sh_dma.h b/include/linux/sh_dma.h
new file mode 100644
index 000000000000..b08cd4efa15c
--- /dev/null
+++ b/include/linux/sh_dma.h
@@ -0,0 +1,102 @@
1/*
2 * Header for the new SH dmaengine driver
3 *
4 * Copyright (C) 2010 Guennadi Liakhovetski <g.liakhovetski@gmx.de>
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 */
10#ifndef SH_DMA_H
11#define SH_DMA_H
12
13#include <linux/list.h>
14#include <linux/dmaengine.h>
15
16/* Used by slave DMA clients to request DMA to/from a specific peripheral */
17struct sh_dmae_slave {
18 unsigned int slave_id; /* Set by the platform */
19 struct device *dma_dev; /* Set by the platform */
20 const struct sh_dmae_slave_config *config; /* Set by the driver */
21};
22
23struct sh_dmae_regs {
24 u32 sar; /* SAR / source address */
25 u32 dar; /* DAR / destination address */
26 u32 tcr; /* TCR / transfer count */
27};
28
29struct sh_desc {
30 struct sh_dmae_regs hw;
31 struct list_head node;
32 struct dma_async_tx_descriptor async_tx;
33 enum dma_data_direction direction;
34 dma_cookie_t cookie;
35 size_t partial;
36 int chunks;
37 int mark;
38};
39
40struct sh_dmae_slave_config {
41 unsigned int slave_id;
42 dma_addr_t addr;
43 u32 chcr;
44 char mid_rid;
45};
46
47struct sh_dmae_channel {
48 unsigned int offset;
49 unsigned int dmars;
50 unsigned int dmars_bit;
51};
52
53struct sh_dmae_pdata {
54 const struct sh_dmae_slave_config *slave;
55 int slave_num;
56 const struct sh_dmae_channel *channel;
57 int channel_num;
58 unsigned int ts_low_shift;
59 unsigned int ts_low_mask;
60 unsigned int ts_high_shift;
61 unsigned int ts_high_mask;
62 const unsigned int *ts_shift;
63 int ts_shift_num;
64 u16 dmaor_init;
65};
66
67/* DMA register */
68#define SAR 0x00
69#define DAR 0x04
70#define TCR 0x08
71#define CHCR 0x0C
72#define DMAOR 0x40
73
74/* DMAOR definitions */
75#define DMAOR_AE 0x00000004
76#define DMAOR_NMIF 0x00000002
77#define DMAOR_DME 0x00000001
78
79/* Definitions for the SuperH DMAC */
80#define REQ_L 0x00000000
81#define REQ_E 0x00080000
82#define RACK_H 0x00000000
83#define RACK_L 0x00040000
84#define ACK_R 0x00000000
85#define ACK_W 0x00020000
86#define ACK_H 0x00000000
87#define ACK_L 0x00010000
88#define DM_INC 0x00004000
89#define DM_DEC 0x00008000
90#define DM_FIX 0x0000c000
91#define SM_INC 0x00001000
92#define SM_DEC 0x00002000
93#define SM_FIX 0x00003000
94#define RS_IN 0x00000200
95#define RS_OUT 0x00000300
96#define TS_BLK 0x00000040
97#define TM_BUR 0x00000020
98#define CHCR_DE 0x00000001
99#define CHCR_TE 0x00000002
100#define CHCR_IE 0x00000004
101
102#endif
diff --git a/include/linux/sh_intc.h b/include/linux/sh_intc.h
index 51d288d8ac88..0d6cd38e673d 100644
--- a/include/linux/sh_intc.h
+++ b/include/linux/sh_intc.h
@@ -1,6 +1,8 @@
1#ifndef __SH_INTC_H 1#ifndef __SH_INTC_H
2#define __SH_INTC_H 2#define __SH_INTC_H
3 3
4#include <linux/ioport.h>
5
4typedef unsigned char intc_enum; 6typedef unsigned char intc_enum;
5 7
6struct intc_vect { 8struct intc_vect {
@@ -21,6 +23,9 @@ struct intc_group {
21struct intc_mask_reg { 23struct intc_mask_reg {
22 unsigned long set_reg, clr_reg, reg_width; 24 unsigned long set_reg, clr_reg, reg_width;
23 intc_enum enum_ids[32]; 25 intc_enum enum_ids[32];
26#ifdef CONFIG_INTC_BALANCING
27 unsigned long dist_reg;
28#endif
24#ifdef CONFIG_SMP 29#ifdef CONFIG_SMP
25 unsigned long smp; 30 unsigned long smp;
26#endif 31#endif
@@ -39,8 +44,14 @@ struct intc_sense_reg {
39 intc_enum enum_ids[16]; 44 intc_enum enum_ids[16];
40}; 45};
41 46
47#ifdef CONFIG_INTC_BALANCING
48#define INTC_SMP_BALANCING(reg) .dist_reg = (reg)
49#else
50#define INTC_SMP_BALANCING(reg)
51#endif
52
42#ifdef CONFIG_SMP 53#ifdef CONFIG_SMP
43#define INTC_SMP(stride, nr) .smp = (stride) | ((nr) << 8) 54#define INTC_SMP(stride, nr) .smp = (stride) | ((nr) << 8)
44#else 55#else
45#define INTC_SMP(stride, nr) 56#define INTC_SMP(stride, nr)
46#endif 57#endif
@@ -71,6 +82,8 @@ struct intc_hw_desc {
71 82
72struct intc_desc { 83struct intc_desc {
73 char *name; 84 char *name;
85 struct resource *resource;
86 unsigned int num_resources;
74 intc_enum force_enable; 87 intc_enum force_enable;
75 intc_enum force_disable; 88 intc_enum force_disable;
76 struct intc_hw_desc hw; 89 struct intc_hw_desc hw;
@@ -92,9 +105,18 @@ struct intc_desc symbol __initdata = { \
92 prio_regs, sense_regs, ack_regs), \ 105 prio_regs, sense_regs, ack_regs), \
93} 106}
94 107
95void __init register_intc_controller(struct intc_desc *desc); 108int __init register_intc_controller(struct intc_desc *desc);
96int intc_set_priority(unsigned int irq, unsigned int prio); 109int intc_set_priority(unsigned int irq, unsigned int prio);
97 110
111#ifdef CONFIG_INTC_USERIMASK
112int register_intc_userimask(unsigned long addr);
113#else
114static inline int register_intc_userimask(unsigned long addr)
115{
116 return 0;
117}
118#endif
119
98int reserve_irq_vector(unsigned int irq); 120int reserve_irq_vector(unsigned int irq);
99void reserve_irq_legacy(void); 121void reserve_irq_legacy(void);
100 122
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
index c9525bce80f6..f89e7fd59a4c 100644
--- a/include/linux/skbuff.h
+++ b/include/linux/skbuff.h
@@ -264,7 +264,7 @@ typedef unsigned char *sk_buff_data_t;
264 * @transport_header: Transport layer header 264 * @transport_header: Transport layer header
265 * @network_header: Network layer header 265 * @network_header: Network layer header
266 * @mac_header: Link layer header 266 * @mac_header: Link layer header
267 * @_skb_dst: destination entry 267 * @_skb_refdst: destination entry (with norefcount bit)
268 * @sp: the security path, used for xfrm 268 * @sp: the security path, used for xfrm
269 * @cb: Control buffer. Free for use by every layer. Put private vars here 269 * @cb: Control buffer. Free for use by every layer. Put private vars here
270 * @len: Length of actual data 270 * @len: Length of actual data
@@ -328,7 +328,7 @@ struct sk_buff {
328 */ 328 */
329 char cb[48] __aligned(8); 329 char cb[48] __aligned(8);
330 330
331 unsigned long _skb_dst; 331 unsigned long _skb_refdst;
332#ifdef CONFIG_XFRM 332#ifdef CONFIG_XFRM
333 struct sec_path *sp; 333 struct sec_path *sp;
334#endif 334#endif
@@ -380,7 +380,10 @@ struct sk_buff {
380 kmemcheck_bitfield_begin(flags2); 380 kmemcheck_bitfield_begin(flags2);
381 __u16 queue_mapping:16; 381 __u16 queue_mapping:16;
382#ifdef CONFIG_IPV6_NDISC_NODETYPE 382#ifdef CONFIG_IPV6_NDISC_NODETYPE
383 __u8 ndisc_nodetype:2; 383 __u8 ndisc_nodetype:2,
384 deliver_no_wcard:1;
385#else
386 __u8 deliver_no_wcard:1;
384#endif 387#endif
385 kmemcheck_bitfield_end(flags2); 388 kmemcheck_bitfield_end(flags2);
386 389
@@ -419,14 +422,64 @@ struct sk_buff {
419 422
420#include <asm/system.h> 423#include <asm/system.h>
421 424
425/*
426 * skb might have a dst pointer attached, refcounted or not.
427 * _skb_refdst low order bit is set if refcount was _not_ taken
428 */
429#define SKB_DST_NOREF 1UL
430#define SKB_DST_PTRMASK ~(SKB_DST_NOREF)
431
432/**
433 * skb_dst - returns skb dst_entry
434 * @skb: buffer
435 *
436 * Returns skb dst_entry, regardless of reference taken or not.
437 */
422static inline struct dst_entry *skb_dst(const struct sk_buff *skb) 438static inline struct dst_entry *skb_dst(const struct sk_buff *skb)
423{ 439{
424 return (struct dst_entry *)skb->_skb_dst; 440 /* If refdst was not refcounted, check we still are in a
441 * rcu_read_lock section
442 */
443 WARN_ON((skb->_skb_refdst & SKB_DST_NOREF) &&
444 !rcu_read_lock_held() &&
445 !rcu_read_lock_bh_held());
446 return (struct dst_entry *)(skb->_skb_refdst & SKB_DST_PTRMASK);
425} 447}
426 448
449/**
450 * skb_dst_set - sets skb dst
451 * @skb: buffer
452 * @dst: dst entry
453 *
454 * Sets skb dst, assuming a reference was taken on dst and should
455 * be released by skb_dst_drop()
456 */
427static inline void skb_dst_set(struct sk_buff *skb, struct dst_entry *dst) 457static inline void skb_dst_set(struct sk_buff *skb, struct dst_entry *dst)
428{ 458{
429 skb->_skb_dst = (unsigned long)dst; 459 skb->_skb_refdst = (unsigned long)dst;
460}
461
462/**
463 * skb_dst_set_noref - sets skb dst, without a reference
464 * @skb: buffer
465 * @dst: dst entry
466 *
467 * Sets skb dst, assuming a reference was not taken on dst
468 * skb_dst_drop() should not dst_release() this dst
469 */
470static inline void skb_dst_set_noref(struct sk_buff *skb, struct dst_entry *dst)
471{
472 WARN_ON(!rcu_read_lock_held() && !rcu_read_lock_bh_held());
473 skb->_skb_refdst = (unsigned long)dst | SKB_DST_NOREF;
474}
475
476/**
477 * skb_dst_is_noref - Test if skb dst isnt refcounted
478 * @skb: buffer
479 */
480static inline bool skb_dst_is_noref(const struct sk_buff *skb)
481{
482 return (skb->_skb_refdst & SKB_DST_NOREF) && skb_dst(skb);
430} 483}
431 484
432static inline struct rtable *skb_rtable(const struct sk_buff *skb) 485static inline struct rtable *skb_rtable(const struct sk_buff *skb)
@@ -451,7 +504,7 @@ static inline struct sk_buff *alloc_skb_fclone(unsigned int size,
451 return __alloc_skb(size, priority, 1, -1); 504 return __alloc_skb(size, priority, 1, -1);
452} 505}
453 506
454extern int skb_recycle_check(struct sk_buff *skb, int skb_size); 507extern bool skb_recycle_check(struct sk_buff *skb, int skb_size);
455 508
456extern struct sk_buff *skb_morph(struct sk_buff *dst, struct sk_buff *src); 509extern struct sk_buff *skb_morph(struct sk_buff *dst, struct sk_buff *src);
457extern struct sk_buff *skb_clone(struct sk_buff *skb, 510extern struct sk_buff *skb_clone(struct sk_buff *skb,
diff --git a/include/linux/slab_def.h b/include/linux/slab_def.h
index ca6b2b317991..1812dac8c496 100644
--- a/include/linux/slab_def.h
+++ b/include/linux/slab_def.h
@@ -16,6 +16,30 @@
16#include <linux/compiler.h> 16#include <linux/compiler.h>
17#include <linux/kmemtrace.h> 17#include <linux/kmemtrace.h>
18 18
19#ifndef ARCH_KMALLOC_MINALIGN
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#define ARCH_KMALLOC_MINALIGN __alignof__(unsigned long long)
30#endif
31
32#ifndef ARCH_SLAB_MINALIGN
33/*
34 * Enforce a minimum alignment for all caches.
35 * Intended for archs that get misalignment faults even for BYTES_PER_WORD
36 * aligned buffers. Includes ARCH_KMALLOC_MINALIGN.
37 * If possible: Do not enable this flag for CONFIG_DEBUG_SLAB, it disables
38 * some debug features.
39 */
40#define ARCH_SLAB_MINALIGN 0
41#endif
42
19/* 43/*
20 * struct kmem_cache 44 * struct kmem_cache
21 * 45 *
diff --git a/include/linux/slob_def.h b/include/linux/slob_def.h
index 0ec00b39d006..62667f72c2ef 100644
--- a/include/linux/slob_def.h
+++ b/include/linux/slob_def.h
@@ -1,6 +1,14 @@
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#ifndef ARCH_KMALLOC_MINALIGN
5#define ARCH_KMALLOC_MINALIGN __alignof__(unsigned long)
6#endif
7
8#ifndef ARCH_SLAB_MINALIGN
9#define ARCH_SLAB_MINALIGN __alignof__(unsigned long)
10#endif
11
4void *kmem_cache_alloc_node(struct kmem_cache *, gfp_t flags, int node); 12void *kmem_cache_alloc_node(struct kmem_cache *, gfp_t flags, int node);
5 13
6static __always_inline void *kmem_cache_alloc(struct kmem_cache *cachep, 14static __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 0249d4175bac..4ba59cfc1f75 100644
--- a/include/linux/slub_def.h
+++ b/include/linux/slub_def.h
@@ -75,12 +75,6 @@ struct kmem_cache {
75 int offset; /* Free pointer offset. */ 75 int offset; /* Free pointer offset. */
76 struct kmem_cache_order_objects oo; 76 struct kmem_cache_order_objects oo;
77 77
78 /*
79 * Avoid an extra cache line for UP, SMP and for the node local to
80 * struct kmem_cache.
81 */
82 struct kmem_cache_node local_node;
83
84 /* Allocation and freeing of slabs */ 78 /* Allocation and freeing of slabs */
85 struct kmem_cache_order_objects max; 79 struct kmem_cache_order_objects max;
86 struct kmem_cache_order_objects min; 80 struct kmem_cache_order_objects min;
@@ -102,6 +96,9 @@ struct kmem_cache {
102 */ 96 */
103 int remote_node_defrag_ratio; 97 int remote_node_defrag_ratio;
104 struct kmem_cache_node *node[MAX_NUMNODES]; 98 struct kmem_cache_node *node[MAX_NUMNODES];
99#else
100 /* Avoid an extra cache line for UP */
101 struct kmem_cache_node local_node;
105#endif 102#endif
106}; 103};
107 104
@@ -116,6 +113,14 @@ struct kmem_cache {
116 113
117#define KMALLOC_SHIFT_LOW ilog2(KMALLOC_MIN_SIZE) 114#define KMALLOC_SHIFT_LOW ilog2(KMALLOC_MIN_SIZE)
118 115
116#ifndef ARCH_KMALLOC_MINALIGN
117#define ARCH_KMALLOC_MINALIGN __alignof__(unsigned long long)
118#endif
119
120#ifndef ARCH_SLAB_MINALIGN
121#define ARCH_SLAB_MINALIGN __alignof__(unsigned long long)
122#endif
123
119/* 124/*
120 * Maximum kmalloc object size handled by SLUB. Larger object allocations 125 * Maximum kmalloc object size handled by SLUB. Larger object allocations
121 * are passed through to the page allocator. The page allocator "fastpath" 126 * are passed through to the page allocator. The page allocator "fastpath"
@@ -132,7 +137,7 @@ struct kmem_cache {
132#ifdef CONFIG_ZONE_DMA 137#ifdef CONFIG_ZONE_DMA
133#define SLUB_DMA __GFP_DMA 138#define SLUB_DMA __GFP_DMA
134/* Reserve extra caches for potential DMA use */ 139/* Reserve extra caches for potential DMA use */
135#define KMALLOC_CACHES (2 * SLUB_PAGE_SHIFT - 6) 140#define KMALLOC_CACHES (2 * SLUB_PAGE_SHIFT)
136#else 141#else
137/* Disable DMA functionality */ 142/* Disable DMA functionality */
138#define SLUB_DMA (__force gfp_t)0 143#define SLUB_DMA (__force gfp_t)0
diff --git a/include/linux/smb_fs_sb.h b/include/linux/smb_fs_sb.h
index 8a060a7040d8..bb947dd1fba9 100644
--- a/include/linux/smb_fs_sb.h
+++ b/include/linux/smb_fs_sb.h
@@ -10,6 +10,7 @@
10#define _SMB_FS_SB 10#define _SMB_FS_SB
11 11
12#include <linux/types.h> 12#include <linux/types.h>
13#include <linux/backing-dev.h>
13#include <linux/smb.h> 14#include <linux/smb.h>
14 15
15/* 16/*
@@ -74,6 +75,8 @@ struct smb_sb_info {
74 struct smb_ops *ops; 75 struct smb_ops *ops;
75 76
76 struct super_block *super_block; 77 struct super_block *super_block;
78
79 struct backing_dev_info bdi;
77}; 80};
78 81
79static inline int 82static inline int
diff --git a/include/linux/spi/spi_bitbang.h b/include/linux/spi/spi_bitbang.h
index 3274c507b8a9..f987a2bee16a 100644
--- a/include/linux/spi/spi_bitbang.h
+++ b/include/linux/spi/spi_bitbang.h
@@ -1,24 +1,6 @@
1#ifndef __SPI_BITBANG_H 1#ifndef __SPI_BITBANG_H
2#define __SPI_BITBANG_H 2#define __SPI_BITBANG_H
3 3
4/*
5 * Mix this utility code with some glue code to get one of several types of
6 * simple SPI master driver. Two do polled word-at-a-time I/O:
7 *
8 * - GPIO/parport bitbangers. Provide chipselect() and txrx_word[](),
9 * expanding the per-word routines from the inline templates below.
10 *
11 * - Drivers for controllers resembling bare shift registers. Provide
12 * chipselect() and txrx_word[](), with custom setup()/cleanup() methods
13 * that use your controller's clock and chipselect registers.
14 *
15 * Some hardware works well with requests at spi_transfer scope:
16 *
17 * - Drivers leveraging smarter hardware, with fifos or DMA; or for half
18 * duplex (MicroWire) controllers. Provide chipselect() and txrx_bufs(),
19 * and custom setup()/cleanup() methods.
20 */
21
22#include <linux/workqueue.h> 4#include <linux/workqueue.h>
23 5
24struct spi_bitbang { 6struct spi_bitbang {
@@ -68,86 +50,3 @@ extern int spi_bitbang_start(struct spi_bitbang *spi);
68extern int spi_bitbang_stop(struct spi_bitbang *spi); 50extern int spi_bitbang_stop(struct spi_bitbang *spi);
69 51
70#endif /* __SPI_BITBANG_H */ 52#endif /* __SPI_BITBANG_H */
71
72/*-------------------------------------------------------------------------*/
73
74#ifdef EXPAND_BITBANG_TXRX
75
76/*
77 * The code that knows what GPIO pins do what should have declared four
78 * functions, ideally as inlines, before #defining EXPAND_BITBANG_TXRX
79 * and including this header:
80 *
81 * void setsck(struct spi_device *, int is_on);
82 * void setmosi(struct spi_device *, int is_on);
83 * int getmiso(struct spi_device *);
84 * void spidelay(unsigned);
85 *
86 * setsck()'s is_on parameter is a zero/nonzero boolean.
87 *
88 * setmosi()'s is_on parameter is a zero/nonzero boolean.
89 *
90 * getmiso() is required to return 0 or 1 only. Any other value is invalid
91 * and will result in improper operation.
92 *
93 * A non-inlined routine would call bitbang_txrx_*() routines. The
94 * main loop could easily compile down to a handful of instructions,
95 * especially if the delay is a NOP (to run at peak speed).
96 *
97 * Since this is software, the timings may not be exactly what your board's
98 * chips need ... there may be several reasons you'd need to tweak timings
99 * in these routines, not just make to make it faster or slower to match a
100 * particular CPU clock rate.
101 */
102
103static inline u32
104bitbang_txrx_be_cpha0(struct spi_device *spi,
105 unsigned nsecs, unsigned cpol,
106 u32 word, u8 bits)
107{
108 /* if (cpol == 0) this is SPI_MODE_0; else this is SPI_MODE_2 */
109
110 /* clock starts at inactive polarity */
111 for (word <<= (32 - bits); likely(bits); bits--) {
112
113 /* setup MSB (to slave) on trailing edge */
114 setmosi(spi, word & (1 << 31));
115 spidelay(nsecs); /* T(setup) */
116
117 setsck(spi, !cpol);
118 spidelay(nsecs);
119
120 /* sample MSB (from slave) on leading edge */
121 word <<= 1;
122 word |= getmiso(spi);
123 setsck(spi, cpol);
124 }
125 return word;
126}
127
128static inline u32
129bitbang_txrx_be_cpha1(struct spi_device *spi,
130 unsigned nsecs, unsigned cpol,
131 u32 word, u8 bits)
132{
133 /* if (cpol == 0) this is SPI_MODE_1; else this is SPI_MODE_3 */
134
135 /* clock starts at inactive polarity */
136 for (word <<= (32 - bits); likely(bits); bits--) {
137
138 /* setup MSB (to slave) on leading edge */
139 setsck(spi, !cpol);
140 setmosi(spi, word & (1 << 31));
141 spidelay(nsecs); /* T(setup) */
142
143 setsck(spi, cpol);
144 spidelay(nsecs);
145
146 /* sample MSB (from slave) on trailing edge */
147 word <<= 1;
148 word |= getmiso(spi);
149 }
150 return word;
151}
152
153#endif /* EXPAND_BITBANG_TXRX */
diff --git a/include/linux/splice.h b/include/linux/splice.h
index 18e7c7c0cae6..997c3b4c212b 100644
--- a/include/linux/splice.h
+++ b/include/linux/splice.h
@@ -82,4 +82,11 @@ extern ssize_t splice_to_pipe(struct pipe_inode_info *,
82extern ssize_t splice_direct_to_actor(struct file *, struct splice_desc *, 82extern ssize_t splice_direct_to_actor(struct file *, struct splice_desc *,
83 splice_direct_actor *); 83 splice_direct_actor *);
84 84
85/*
86 * for dynamic pipe sizing
87 */
88extern int splice_grow_spd(struct pipe_inode_info *, struct splice_pipe_desc *);
89extern void splice_shrink_spd(struct pipe_inode_info *,
90 struct splice_pipe_desc *);
91
85#endif 92#endif
diff --git a/include/linux/srcu.h b/include/linux/srcu.h
index 4d5ecb222af9..4d5d2f546dbf 100644
--- a/include/linux/srcu.h
+++ b/include/linux/srcu.h
@@ -27,6 +27,8 @@
27#ifndef _LINUX_SRCU_H 27#ifndef _LINUX_SRCU_H
28#define _LINUX_SRCU_H 28#define _LINUX_SRCU_H
29 29
30#include <linux/mutex.h>
31
30struct srcu_struct_array { 32struct srcu_struct_array {
31 int c[2]; 33 int c[2];
32}; 34};
@@ -84,8 +86,8 @@ long srcu_batches_completed(struct srcu_struct *sp);
84/** 86/**
85 * srcu_read_lock_held - might we be in SRCU read-side critical section? 87 * srcu_read_lock_held - might we be in SRCU read-side critical section?
86 * 88 *
87 * If CONFIG_PROVE_LOCKING is selected and enabled, returns nonzero iff in 89 * If CONFIG_DEBUG_LOCK_ALLOC is selected, returns nonzero iff in an SRCU
88 * an SRCU read-side critical section. In absence of CONFIG_PROVE_LOCKING, 90 * read-side critical section. In absence of CONFIG_DEBUG_LOCK_ALLOC,
89 * this assumes we are in an SRCU read-side critical section unless it can 91 * this assumes we are in an SRCU read-side critical section unless it can
90 * prove otherwise. 92 * prove otherwise.
91 */ 93 */
diff --git a/include/linux/stop_machine.h b/include/linux/stop_machine.h
index baba3a23a814..6b524a0d02e4 100644
--- a/include/linux/stop_machine.h
+++ b/include/linux/stop_machine.h
@@ -1,13 +1,101 @@
1#ifndef _LINUX_STOP_MACHINE 1#ifndef _LINUX_STOP_MACHINE
2#define _LINUX_STOP_MACHINE 2#define _LINUX_STOP_MACHINE
3/* "Bogolock": stop the entire machine, disable interrupts. This is a 3
4 very heavy lock, which is equivalent to grabbing every spinlock
5 (and more). So the "read" side to such a lock is anything which
6 disables preeempt. */
7#include <linux/cpu.h> 4#include <linux/cpu.h>
8#include <linux/cpumask.h> 5#include <linux/cpumask.h>
6#include <linux/list.h>
9#include <asm/system.h> 7#include <asm/system.h>
10 8
9/*
10 * stop_cpu[s]() is simplistic per-cpu maximum priority cpu
11 * monopolization mechanism. The caller can specify a non-sleeping
12 * function to be executed on a single or multiple cpus preempting all
13 * other processes and monopolizing those cpus until it finishes.
14 *
15 * Resources for this mechanism are preallocated when a cpu is brought
16 * up and requests are guaranteed to be served as long as the target
17 * cpus are online.
18 */
19typedef int (*cpu_stop_fn_t)(void *arg);
20
21#ifdef CONFIG_SMP
22
23struct cpu_stop_work {
24 struct list_head list; /* cpu_stopper->works */
25 cpu_stop_fn_t fn;
26 void *arg;
27 struct cpu_stop_done *done;
28};
29
30int stop_one_cpu(unsigned int cpu, cpu_stop_fn_t fn, void *arg);
31void stop_one_cpu_nowait(unsigned int cpu, cpu_stop_fn_t fn, void *arg,
32 struct cpu_stop_work *work_buf);
33int stop_cpus(const struct cpumask *cpumask, cpu_stop_fn_t fn, void *arg);
34int try_stop_cpus(const struct cpumask *cpumask, cpu_stop_fn_t fn, void *arg);
35
36#else /* CONFIG_SMP */
37
38#include <linux/workqueue.h>
39
40struct cpu_stop_work {
41 struct work_struct work;
42 cpu_stop_fn_t fn;
43 void *arg;
44};
45
46static inline int stop_one_cpu(unsigned int cpu, cpu_stop_fn_t fn, void *arg)
47{
48 int ret = -ENOENT;
49 preempt_disable();
50 if (cpu == smp_processor_id())
51 ret = fn(arg);
52 preempt_enable();
53 return ret;
54}
55
56static void stop_one_cpu_nowait_workfn(struct work_struct *work)
57{
58 struct cpu_stop_work *stwork =
59 container_of(work, struct cpu_stop_work, work);
60 preempt_disable();
61 stwork->fn(stwork->arg);
62 preempt_enable();
63}
64
65static inline void stop_one_cpu_nowait(unsigned int cpu,
66 cpu_stop_fn_t fn, void *arg,
67 struct cpu_stop_work *work_buf)
68{
69 if (cpu == smp_processor_id()) {
70 INIT_WORK(&work_buf->work, stop_one_cpu_nowait_workfn);
71 work_buf->fn = fn;
72 work_buf->arg = arg;
73 schedule_work(&work_buf->work);
74 }
75}
76
77static inline int stop_cpus(const struct cpumask *cpumask,
78 cpu_stop_fn_t fn, void *arg)
79{
80 if (cpumask_test_cpu(raw_smp_processor_id(), cpumask))
81 return stop_one_cpu(raw_smp_processor_id(), fn, arg);
82 return -ENOENT;
83}
84
85static inline int try_stop_cpus(const struct cpumask *cpumask,
86 cpu_stop_fn_t fn, void *arg)
87{
88 return stop_cpus(cpumask, fn, arg);
89}
90
91#endif /* CONFIG_SMP */
92
93/*
94 * stop_machine "Bogolock": stop the entire machine, disable
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
97 * lock is anything which disables preeempt.
98 */
11#if defined(CONFIG_STOP_MACHINE) && defined(CONFIG_SMP) 99#if defined(CONFIG_STOP_MACHINE) && defined(CONFIG_SMP)
12 100
13/** 101/**
@@ -36,24 +124,7 @@ int stop_machine(int (*fn)(void *), void *data, const struct cpumask *cpus);
36 */ 124 */
37int __stop_machine(int (*fn)(void *), void *data, const struct cpumask *cpus); 125int __stop_machine(int (*fn)(void *), void *data, const struct cpumask *cpus);
38 126
39/** 127#else /* CONFIG_STOP_MACHINE && CONFIG_SMP */
40 * stop_machine_create: create all stop_machine threads
41 *
42 * Description: This causes all stop_machine threads to be created before
43 * stop_machine actually gets called. This can be used by subsystems that
44 * need a non failing stop_machine infrastructure.
45 */
46int stop_machine_create(void);
47
48/**
49 * stop_machine_destroy: destroy all stop_machine threads
50 *
51 * Description: This causes all stop_machine threads which were created with
52 * stop_machine_create to be destroyed again.
53 */
54void stop_machine_destroy(void);
55
56#else
57 128
58static inline int stop_machine(int (*fn)(void *), void *data, 129static inline int stop_machine(int (*fn)(void *), void *data,
59 const struct cpumask *cpus) 130 const struct cpumask *cpus)
@@ -65,8 +136,5 @@ static inline int stop_machine(int (*fn)(void *), void *data,
65 return ret; 136 return ret;
66} 137}
67 138
68static inline int stop_machine_create(void) { return 0; } 139#endif /* CONFIG_STOP_MACHINE && CONFIG_SMP */
69static inline void stop_machine_destroy(void) { } 140#endif /* _LINUX_STOP_MACHINE */
70
71#endif /* CONFIG_SMP */
72#endif /* _LINUX_STOP_MACHINE */
diff --git a/include/linux/sunrpc/auth.h b/include/linux/sunrpc/auth.h
index 996df4dac7d4..87d7ec0bf779 100644
--- a/include/linux/sunrpc/auth.h
+++ b/include/linux/sunrpc/auth.h
@@ -54,6 +54,7 @@ struct rpc_cred {
54#define RPCAUTH_CRED_NEW 0 54#define RPCAUTH_CRED_NEW 0
55#define RPCAUTH_CRED_UPTODATE 1 55#define RPCAUTH_CRED_UPTODATE 1
56#define RPCAUTH_CRED_HASHED 2 56#define RPCAUTH_CRED_HASHED 2
57#define RPCAUTH_CRED_NEGATIVE 3
57 58
58#define RPCAUTH_CRED_MAGIC 0x0f4aa4f0 59#define RPCAUTH_CRED_MAGIC 0x0f4aa4f0
59 60
diff --git a/include/linux/sunrpc/auth_gss.h b/include/linux/sunrpc/auth_gss.h
index d48d4e605f74..671538d25bc1 100644
--- a/include/linux/sunrpc/auth_gss.h
+++ b/include/linux/sunrpc/auth_gss.h
@@ -82,6 +82,7 @@ struct gss_cred {
82 enum rpc_gss_svc gc_service; 82 enum rpc_gss_svc gc_service;
83 struct gss_cl_ctx *gc_ctx; 83 struct gss_cl_ctx *gc_ctx;
84 struct gss_upcall_msg *gc_upcall; 84 struct gss_upcall_msg *gc_upcall;
85 unsigned long gc_upcall_timestamp;
85 unsigned char gc_machine_cred : 1; 86 unsigned char gc_machine_cred : 1;
86}; 87};
87 88
diff --git a/include/linux/sunrpc/gss_api.h b/include/linux/sunrpc/gss_api.h
index 03f33330ece2..5d8048beb051 100644
--- a/include/linux/sunrpc/gss_api.h
+++ b/include/linux/sunrpc/gss_api.h
@@ -35,7 +35,8 @@ int gss_import_sec_context(
35 const void* input_token, 35 const void* input_token,
36 size_t bufsize, 36 size_t bufsize,
37 struct gss_api_mech *mech, 37 struct gss_api_mech *mech,
38 struct gss_ctx **ctx_id); 38 struct gss_ctx **ctx_id,
39 gfp_t gfp_mask);
39u32 gss_get_mic( 40u32 gss_get_mic(
40 struct gss_ctx *ctx_id, 41 struct gss_ctx *ctx_id,
41 struct xdr_buf *message, 42 struct xdr_buf *message,
@@ -80,6 +81,8 @@ struct gss_api_mech {
80 /* pseudoflavors supported by this mechanism: */ 81 /* pseudoflavors supported by this mechanism: */
81 int gm_pf_num; 82 int gm_pf_num;
82 struct pf_desc * gm_pfs; 83 struct pf_desc * gm_pfs;
84 /* Should the following be a callback operation instead? */
85 const char *gm_upcall_enctypes;
83}; 86};
84 87
85/* and must provide the following operations: */ 88/* and must provide the following operations: */
@@ -87,7 +90,8 @@ struct gss_api_ops {
87 int (*gss_import_sec_context)( 90 int (*gss_import_sec_context)(
88 const void *input_token, 91 const void *input_token,
89 size_t bufsize, 92 size_t bufsize,
90 struct gss_ctx *ctx_id); 93 struct gss_ctx *ctx_id,
94 gfp_t gfp_mask);
91 u32 (*gss_get_mic)( 95 u32 (*gss_get_mic)(
92 struct gss_ctx *ctx_id, 96 struct gss_ctx *ctx_id,
93 struct xdr_buf *message, 97 struct xdr_buf *message,
diff --git a/include/linux/sunrpc/gss_krb5.h b/include/linux/sunrpc/gss_krb5.h
index e7bbdba474d5..5af2931cf58d 100644
--- a/include/linux/sunrpc/gss_krb5.h
+++ b/include/linux/sunrpc/gss_krb5.h
@@ -4,7 +4,7 @@
4 * Adapted from MIT Kerberos 5-1.2.1 lib/include/krb5.h, 4 * Adapted from MIT Kerberos 5-1.2.1 lib/include/krb5.h,
5 * lib/gssapi/krb5/gssapiP_krb5.h, and others 5 * lib/gssapi/krb5/gssapiP_krb5.h, and others
6 * 6 *
7 * Copyright (c) 2000 The Regents of the University of Michigan. 7 * Copyright (c) 2000-2008 The Regents of the University of Michigan.
8 * All rights reserved. 8 * All rights reserved.
9 * 9 *
10 * Andy Adamson <andros@umich.edu> 10 * Andy Adamson <andros@umich.edu>
@@ -36,17 +36,86 @@
36 * 36 *
37 */ 37 */
38 38
39#include <linux/crypto.h>
39#include <linux/sunrpc/auth_gss.h> 40#include <linux/sunrpc/auth_gss.h>
40#include <linux/sunrpc/gss_err.h> 41#include <linux/sunrpc/gss_err.h>
41#include <linux/sunrpc/gss_asn1.h> 42#include <linux/sunrpc/gss_asn1.h>
42 43
44/* Length of constant used in key derivation */
45#define GSS_KRB5_K5CLENGTH (5)
46
47/* Maximum key length (in bytes) for the supported crypto algorithms*/
48#define GSS_KRB5_MAX_KEYLEN (32)
49
50/* Maximum checksum function output for the supported crypto algorithms */
51#define GSS_KRB5_MAX_CKSUM_LEN (20)
52
53/* Maximum blocksize for the supported crypto algorithms */
54#define GSS_KRB5_MAX_BLOCKSIZE (16)
55
56struct krb5_ctx;
57
58struct gss_krb5_enctype {
59 const u32 etype; /* encryption (key) type */
60 const u32 ctype; /* checksum type */
61 const char *name; /* "friendly" name */
62 const char *encrypt_name; /* crypto encrypt name */
63 const char *cksum_name; /* crypto checksum name */
64 const u16 signalg; /* signing algorithm */
65 const u16 sealalg; /* sealing algorithm */
66 const u32 blocksize; /* encryption blocksize */
67 const u32 conflen; /* confounder length
68 (normally the same as
69 the blocksize) */
70 const u32 cksumlength; /* checksum length */
71 const u32 keyed_cksum; /* is it a keyed cksum? */
72 const u32 keybytes; /* raw key len, in bytes */
73 const u32 keylength; /* final key len, in bytes */
74 u32 (*encrypt) (struct crypto_blkcipher *tfm,
75 void *iv, void *in, void *out,
76 int length); /* encryption function */
77 u32 (*decrypt) (struct crypto_blkcipher *tfm,
78 void *iv, void *in, void *out,
79 int length); /* decryption function */
80 u32 (*mk_key) (const struct gss_krb5_enctype *gk5e,
81 struct xdr_netobj *in,
82 struct xdr_netobj *out); /* complete key generation */
83 u32 (*encrypt_v2) (struct krb5_ctx *kctx, u32 offset,
84 struct xdr_buf *buf, int ec,
85 struct page **pages); /* v2 encryption function */
86 u32 (*decrypt_v2) (struct krb5_ctx *kctx, u32 offset,
87 struct xdr_buf *buf, u32 *headskip,
88 u32 *tailskip); /* v2 decryption function */
89};
90
91/* krb5_ctx flags definitions */
92#define KRB5_CTX_FLAG_INITIATOR 0x00000001
93#define KRB5_CTX_FLAG_CFX 0x00000002
94#define KRB5_CTX_FLAG_ACCEPTOR_SUBKEY 0x00000004
95
43struct krb5_ctx { 96struct krb5_ctx {
44 int initiate; /* 1 = initiating, 0 = accepting */ 97 int initiate; /* 1 = initiating, 0 = accepting */
98 u32 enctype;
99 u32 flags;
100 const struct gss_krb5_enctype *gk5e; /* enctype-specific info */
45 struct crypto_blkcipher *enc; 101 struct crypto_blkcipher *enc;
46 struct crypto_blkcipher *seq; 102 struct crypto_blkcipher *seq;
103 struct crypto_blkcipher *acceptor_enc;
104 struct crypto_blkcipher *initiator_enc;
105 struct crypto_blkcipher *acceptor_enc_aux;
106 struct crypto_blkcipher *initiator_enc_aux;
107 u8 Ksess[GSS_KRB5_MAX_KEYLEN]; /* session key */
108 u8 cksum[GSS_KRB5_MAX_KEYLEN];
47 s32 endtime; 109 s32 endtime;
48 u32 seq_send; 110 u32 seq_send;
111 u64 seq_send64;
49 struct xdr_netobj mech_used; 112 struct xdr_netobj mech_used;
113 u8 initiator_sign[GSS_KRB5_MAX_KEYLEN];
114 u8 acceptor_sign[GSS_KRB5_MAX_KEYLEN];
115 u8 initiator_seal[GSS_KRB5_MAX_KEYLEN];
116 u8 acceptor_seal[GSS_KRB5_MAX_KEYLEN];
117 u8 initiator_integ[GSS_KRB5_MAX_KEYLEN];
118 u8 acceptor_integ[GSS_KRB5_MAX_KEYLEN];
50}; 119};
51 120
52extern spinlock_t krb5_seq_lock; 121extern spinlock_t krb5_seq_lock;
@@ -57,6 +126,18 @@ extern spinlock_t krb5_seq_lock;
57#define KG_TOK_MIC_MSG 0x0101 126#define KG_TOK_MIC_MSG 0x0101
58#define KG_TOK_WRAP_MSG 0x0201 127#define KG_TOK_WRAP_MSG 0x0201
59 128
129#define KG2_TOK_INITIAL 0x0101
130#define KG2_TOK_RESPONSE 0x0202
131#define KG2_TOK_MIC 0x0404
132#define KG2_TOK_WRAP 0x0504
133
134#define KG2_TOKEN_FLAG_SENTBYACCEPTOR 0x01
135#define KG2_TOKEN_FLAG_SEALED 0x02
136#define KG2_TOKEN_FLAG_ACCEPTORSUBKEY 0x04
137
138#define KG2_RESP_FLAG_ERROR 0x0001
139#define KG2_RESP_FLAG_DELEG_OK 0x0002
140
60enum sgn_alg { 141enum sgn_alg {
61 SGN_ALG_DES_MAC_MD5 = 0x0000, 142 SGN_ALG_DES_MAC_MD5 = 0x0000,
62 SGN_ALG_MD2_5 = 0x0001, 143 SGN_ALG_MD2_5 = 0x0001,
@@ -81,6 +162,9 @@ enum seal_alg {
81#define CKSUMTYPE_RSA_MD5_DES 0x0008 162#define CKSUMTYPE_RSA_MD5_DES 0x0008
82#define CKSUMTYPE_NIST_SHA 0x0009 163#define CKSUMTYPE_NIST_SHA 0x0009
83#define CKSUMTYPE_HMAC_SHA1_DES3 0x000c 164#define CKSUMTYPE_HMAC_SHA1_DES3 0x000c
165#define CKSUMTYPE_HMAC_SHA1_96_AES128 0x000f
166#define CKSUMTYPE_HMAC_SHA1_96_AES256 0x0010
167#define CKSUMTYPE_HMAC_MD5_ARCFOUR -138 /* Microsoft md5 hmac cksumtype */
84 168
85/* from gssapi_err_krb5.h */ 169/* from gssapi_err_krb5.h */
86#define KG_CCACHE_NOMATCH (39756032L) 170#define KG_CCACHE_NOMATCH (39756032L)
@@ -111,11 +195,56 @@ enum seal_alg {
111#define ENCTYPE_DES3_CBC_RAW 0x0006 /* DES-3 cbc mode raw */ 195#define ENCTYPE_DES3_CBC_RAW 0x0006 /* DES-3 cbc mode raw */
112#define ENCTYPE_DES_HMAC_SHA1 0x0008 196#define ENCTYPE_DES_HMAC_SHA1 0x0008
113#define ENCTYPE_DES3_CBC_SHA1 0x0010 197#define ENCTYPE_DES3_CBC_SHA1 0x0010
198#define ENCTYPE_AES128_CTS_HMAC_SHA1_96 0x0011
199#define ENCTYPE_AES256_CTS_HMAC_SHA1_96 0x0012
200#define ENCTYPE_ARCFOUR_HMAC 0x0017
201#define ENCTYPE_ARCFOUR_HMAC_EXP 0x0018
114#define ENCTYPE_UNKNOWN 0x01ff 202#define ENCTYPE_UNKNOWN 0x01ff
115 203
116s32 204/*
117make_checksum(char *, char *header, int hdrlen, struct xdr_buf *body, 205 * Constants used for key derivation
118 int body_offset, struct xdr_netobj *cksum); 206 */
207/* for 3DES */
208#define KG_USAGE_SEAL (22)
209#define KG_USAGE_SIGN (23)
210#define KG_USAGE_SEQ (24)
211
212/* from rfc3961 */
213#define KEY_USAGE_SEED_CHECKSUM (0x99)
214#define KEY_USAGE_SEED_ENCRYPTION (0xAA)
215#define KEY_USAGE_SEED_INTEGRITY (0x55)
216
217/* from rfc4121 */
218#define KG_USAGE_ACCEPTOR_SEAL (22)
219#define KG_USAGE_ACCEPTOR_SIGN (23)
220#define KG_USAGE_INITIATOR_SEAL (24)
221#define KG_USAGE_INITIATOR_SIGN (25)
222
223/*
224 * This compile-time check verifies that we will not exceed the
225 * slack space allotted by the client and server auth_gss code
226 * before they call gss_wrap().
227 */
228#define GSS_KRB5_MAX_SLACK_NEEDED \
229 (GSS_KRB5_TOK_HDR_LEN /* gss token header */ \
230 + GSS_KRB5_MAX_CKSUM_LEN /* gss token checksum */ \
231 + GSS_KRB5_MAX_BLOCKSIZE /* confounder */ \
232 + GSS_KRB5_MAX_BLOCKSIZE /* possible padding */ \
233 + GSS_KRB5_TOK_HDR_LEN /* encrypted hdr in v2 token */\
234 + GSS_KRB5_MAX_CKSUM_LEN /* encryption hmac */ \
235 + 4 + 4 /* RPC verifier */ \
236 + GSS_KRB5_TOK_HDR_LEN \
237 + GSS_KRB5_MAX_CKSUM_LEN)
238
239u32
240make_checksum(struct krb5_ctx *kctx, char *header, int hdrlen,
241 struct xdr_buf *body, int body_offset, u8 *cksumkey,
242 unsigned int usage, struct xdr_netobj *cksumout);
243
244u32
245make_checksum_v2(struct krb5_ctx *, char *header, int hdrlen,
246 struct xdr_buf *body, int body_offset, u8 *key,
247 unsigned int usage, struct xdr_netobj *cksum);
119 248
120u32 gss_get_mic_kerberos(struct gss_ctx *, struct xdr_buf *, 249u32 gss_get_mic_kerberos(struct gss_ctx *, struct xdr_buf *,
121 struct xdr_netobj *); 250 struct xdr_netobj *);
@@ -149,11 +278,54 @@ gss_decrypt_xdr_buf(struct crypto_blkcipher *tfm, struct xdr_buf *inbuf,
149 int offset); 278 int offset);
150 279
151s32 280s32
152krb5_make_seq_num(struct crypto_blkcipher *key, 281krb5_make_seq_num(struct krb5_ctx *kctx,
282 struct crypto_blkcipher *key,
153 int direction, 283 int direction,
154 u32 seqnum, unsigned char *cksum, unsigned char *buf); 284 u32 seqnum, unsigned char *cksum, unsigned char *buf);
155 285
156s32 286s32
157krb5_get_seq_num(struct crypto_blkcipher *key, 287krb5_get_seq_num(struct krb5_ctx *kctx,
158 unsigned char *cksum, 288 unsigned char *cksum,
159 unsigned char *buf, int *direction, u32 *seqnum); 289 unsigned char *buf, int *direction, u32 *seqnum);
290
291int
292xdr_extend_head(struct xdr_buf *buf, unsigned int base, unsigned int shiftlen);
293
294u32
295krb5_derive_key(const struct gss_krb5_enctype *gk5e,
296 const struct xdr_netobj *inkey,
297 struct xdr_netobj *outkey,
298 const struct xdr_netobj *in_constant,
299 gfp_t gfp_mask);
300
301u32
302gss_krb5_des3_make_key(const struct gss_krb5_enctype *gk5e,
303 struct xdr_netobj *randombits,
304 struct xdr_netobj *key);
305
306u32
307gss_krb5_aes_make_key(const struct gss_krb5_enctype *gk5e,
308 struct xdr_netobj *randombits,
309 struct xdr_netobj *key);
310
311u32
312gss_krb5_aes_encrypt(struct krb5_ctx *kctx, u32 offset,
313 struct xdr_buf *buf, int ec,
314 struct page **pages);
315
316u32
317gss_krb5_aes_decrypt(struct krb5_ctx *kctx, u32 offset,
318 struct xdr_buf *buf, u32 *plainoffset,
319 u32 *plainlen);
320
321int
322krb5_rc4_setup_seq_key(struct krb5_ctx *kctx,
323 struct crypto_blkcipher *cipher,
324 unsigned char *cksum);
325
326int
327krb5_rc4_setup_enc_key(struct krb5_ctx *kctx,
328 struct crypto_blkcipher *cipher,
329 s32 seqnum);
330void
331gss_krb5_make_confounder(char *p, u32 conflen);
diff --git a/include/linux/sunrpc/metrics.h b/include/linux/sunrpc/metrics.h
index 77f78e56c481..b6edbc0ea83d 100644
--- a/include/linux/sunrpc/metrics.h
+++ b/include/linux/sunrpc/metrics.h
@@ -26,6 +26,7 @@
26#define _LINUX_SUNRPC_METRICS_H 26#define _LINUX_SUNRPC_METRICS_H
27 27
28#include <linux/seq_file.h> 28#include <linux/seq_file.h>
29#include <linux/ktime.h>
29 30
30#define RPC_IOSTATS_VERS "1.0" 31#define RPC_IOSTATS_VERS "1.0"
31 32
@@ -58,9 +59,9 @@ struct rpc_iostats {
58 * and the total time the request spent from init to release 59 * and the total time the request spent from init to release
59 * are measured. 60 * are measured.
60 */ 61 */
61 unsigned long long om_queue, /* jiffies queued for xmit */ 62 ktime_t om_queue, /* queued for xmit */
62 om_rtt, /* jiffies for RPC RTT */ 63 om_rtt, /* RPC RTT */
63 om_execute; /* jiffies for RPC execution */ 64 om_execute; /* RPC execution */
64} ____cacheline_aligned; 65} ____cacheline_aligned;
65 66
66struct rpc_task; 67struct rpc_task;
diff --git a/include/linux/sunrpc/sched.h b/include/linux/sunrpc/sched.h
index 7bc7fd5291ce..7be4f3a6d246 100644
--- a/include/linux/sunrpc/sched.h
+++ b/include/linux/sunrpc/sched.h
@@ -10,6 +10,7 @@
10#define _LINUX_SUNRPC_SCHED_H_ 10#define _LINUX_SUNRPC_SCHED_H_
11 11
12#include <linux/timer.h> 12#include <linux/timer.h>
13#include <linux/ktime.h>
13#include <linux/sunrpc/types.h> 14#include <linux/sunrpc/types.h>
14#include <linux/spinlock.h> 15#include <linux/spinlock.h>
15#include <linux/wait.h> 16#include <linux/wait.h>
@@ -40,21 +41,15 @@ struct rpc_wait {
40 * This is the RPC task struct 41 * This is the RPC task struct
41 */ 42 */
42struct rpc_task { 43struct rpc_task {
43#ifdef RPC_DEBUG
44 unsigned long tk_magic; /* 0xf00baa */
45#endif
46 atomic_t tk_count; /* Reference count */ 44 atomic_t tk_count; /* Reference count */
47 struct list_head tk_task; /* global list of tasks */ 45 struct list_head tk_task; /* global list of tasks */
48 struct rpc_clnt * tk_client; /* RPC client */ 46 struct rpc_clnt * tk_client; /* RPC client */
49 struct rpc_rqst * tk_rqstp; /* RPC request */ 47 struct rpc_rqst * tk_rqstp; /* RPC request */
50 int tk_status; /* result of last operation */
51 48
52 /* 49 /*
53 * RPC call state 50 * RPC call state
54 */ 51 */
55 struct rpc_message tk_msg; /* RPC call info */ 52 struct rpc_message tk_msg; /* RPC call info */
56 __u8 tk_garb_retry;
57 __u8 tk_cred_retry;
58 53
59 /* 54 /*
60 * callback to be executed after waking up 55 * callback to be executed after waking up
@@ -67,7 +62,6 @@ struct rpc_task {
67 void * tk_calldata; 62 void * tk_calldata;
68 63
69 unsigned long tk_timeout; /* timeout for rpc_sleep() */ 64 unsigned long tk_timeout; /* timeout for rpc_sleep() */
70 unsigned short tk_flags; /* misc flags */
71 unsigned long tk_runstate; /* Task run status */ 65 unsigned long tk_runstate; /* Task run status */
72 struct workqueue_struct *tk_workqueue; /* Normally rpciod, but could 66 struct workqueue_struct *tk_workqueue; /* Normally rpciod, but could
73 * be any workqueue 67 * be any workqueue
@@ -78,17 +72,19 @@ struct rpc_task {
78 struct rpc_wait tk_wait; /* RPC wait */ 72 struct rpc_wait tk_wait; /* RPC wait */
79 } u; 73 } u;
80 74
81 unsigned short tk_timeouts; /* maj timeouts */ 75 ktime_t tk_start; /* RPC task init timestamp */
82 size_t tk_bytes_sent; /* total bytes sent */
83 unsigned long tk_start; /* RPC task init timestamp */
84 long tk_rtt; /* round-trip time (jiffies) */
85 76
86 pid_t tk_owner; /* Process id for batching tasks */ 77 pid_t tk_owner; /* Process id for batching tasks */
87 unsigned char tk_priority : 2;/* Task priority */ 78 int tk_status; /* result of last operation */
79 unsigned short tk_flags; /* misc flags */
80 unsigned short tk_timeouts; /* maj timeouts */
88 81
89#ifdef RPC_DEBUG 82#ifdef RPC_DEBUG
90 unsigned short tk_pid; /* debugging aid */ 83 unsigned short tk_pid; /* debugging aid */
91#endif 84#endif
85 unsigned char tk_priority : 2,/* Task priority */
86 tk_garb_retry : 2,
87 tk_cred_retry : 2;
92}; 88};
93#define tk_xprt tk_client->cl_xprt 89#define tk_xprt tk_client->cl_xprt
94 90
diff --git a/include/linux/sunrpc/xdr.h b/include/linux/sunrpc/xdr.h
index f5cc0898bc53..35cf2e8cd7c6 100644
--- a/include/linux/sunrpc/xdr.h
+++ b/include/linux/sunrpc/xdr.h
@@ -1,7 +1,10 @@
1/* 1/*
2 * include/linux/sunrpc/xdr.h 2 * XDR standard data types and function declarations
3 * 3 *
4 * Copyright (C) 1995-1997 Olaf Kirch <okir@monad.swb.de> 4 * Copyright (C) 1995-1997 Olaf Kirch <okir@monad.swb.de>
5 *
6 * Based on:
7 * RFC 4506 "XDR: External Data Representation Standard", May 2006
5 */ 8 */
6 9
7#ifndef _SUNRPC_XDR_H_ 10#ifndef _SUNRPC_XDR_H_
@@ -62,7 +65,6 @@ struct xdr_buf {
62 65
63 unsigned int buflen, /* Total length of storage buffer */ 66 unsigned int buflen, /* Total length of storage buffer */
64 len; /* Length of XDR encoded message */ 67 len; /* Length of XDR encoded message */
65
66}; 68};
67 69
68/* 70/*
@@ -178,7 +180,7 @@ struct xdr_array2_desc {
178}; 180};
179 181
180extern int xdr_decode_array2(struct xdr_buf *buf, unsigned int base, 182extern int xdr_decode_array2(struct xdr_buf *buf, unsigned int base,
181 struct xdr_array2_desc *desc); 183 struct xdr_array2_desc *desc);
182extern int xdr_encode_array2(struct xdr_buf *buf, unsigned int base, 184extern int xdr_encode_array2(struct xdr_buf *buf, unsigned int base,
183 struct xdr_array2_desc *desc); 185 struct xdr_array2_desc *desc);
184 186
diff --git a/include/linux/sunrpc/xprt.h b/include/linux/sunrpc/xprt.h
index 6f9457a75b8f..b51470302399 100644
--- a/include/linux/sunrpc/xprt.h
+++ b/include/linux/sunrpc/xprt.h
@@ -13,6 +13,7 @@
13#include <linux/socket.h> 13#include <linux/socket.h>
14#include <linux/in.h> 14#include <linux/in.h>
15#include <linux/kref.h> 15#include <linux/kref.h>
16#include <linux/ktime.h>
16#include <linux/sunrpc/sched.h> 17#include <linux/sunrpc/sched.h>
17#include <linux/sunrpc/xdr.h> 18#include <linux/sunrpc/xdr.h>
18#include <linux/sunrpc/msg_prot.h> 19#include <linux/sunrpc/msg_prot.h>
@@ -65,8 +66,6 @@ struct rpc_rqst {
65 struct rpc_task * rq_task; /* RPC task data */ 66 struct rpc_task * rq_task; /* RPC task data */
66 __be32 rq_xid; /* request XID */ 67 __be32 rq_xid; /* request XID */
67 int rq_cong; /* has incremented xprt->cong */ 68 int rq_cong; /* has incremented xprt->cong */
68 int rq_reply_bytes_recvd; /* number of reply */
69 /* bytes received */
70 u32 rq_seqno; /* gss seq no. used on req. */ 69 u32 rq_seqno; /* gss seq no. used on req. */
71 int rq_enc_pages_num; 70 int rq_enc_pages_num;
72 struct page **rq_enc_pages; /* scratch pages for use by 71 struct page **rq_enc_pages; /* scratch pages for use by
@@ -77,12 +76,16 @@ struct rpc_rqst {
77 __u32 * rq_buffer; /* XDR encode buffer */ 76 __u32 * rq_buffer; /* XDR encode buffer */
78 size_t rq_callsize, 77 size_t rq_callsize,
79 rq_rcvsize; 78 rq_rcvsize;
79 size_t rq_xmit_bytes_sent; /* total bytes sent */
80 size_t rq_reply_bytes_recvd; /* total reply bytes */
81 /* received */
80 82
81 struct xdr_buf rq_private_buf; /* The receive buffer 83 struct xdr_buf rq_private_buf; /* The receive buffer
82 * used in the softirq. 84 * used in the softirq.
83 */ 85 */
84 unsigned long rq_majortimeo; /* major timeout alarm */ 86 unsigned long rq_majortimeo; /* major timeout alarm */
85 unsigned long rq_timeout; /* Current timeout value */ 87 unsigned long rq_timeout; /* Current timeout value */
88 ktime_t rq_rtt; /* round-trip time */
86 unsigned int rq_retries; /* # of retries */ 89 unsigned int rq_retries; /* # of retries */
87 unsigned int rq_connect_cookie; 90 unsigned int rq_connect_cookie;
88 /* A cookie used to track the 91 /* A cookie used to track the
@@ -94,7 +97,7 @@ struct rpc_rqst {
94 */ 97 */
95 u32 rq_bytes_sent; /* Bytes we have sent */ 98 u32 rq_bytes_sent; /* Bytes we have sent */
96 99
97 unsigned long rq_xtime; /* when transmitted */ 100 ktime_t rq_xtime; /* transmit time stamp */
98 int rq_ntrans; 101 int rq_ntrans;
99 102
100#if defined(CONFIG_NFS_V4_1) 103#if defined(CONFIG_NFS_V4_1)
@@ -174,8 +177,7 @@ struct rpc_xprt {
174 /* 177 /*
175 * Connection of transports 178 * Connection of transports
176 */ 179 */
177 unsigned long connect_timeout, 180 unsigned long bind_timeout,
178 bind_timeout,
179 reestablish_timeout; 181 reestablish_timeout;
180 unsigned int connect_cookie; /* A cookie that gets bumped 182 unsigned int connect_cookie; /* A cookie that gets bumped
181 every time the transport 183 every time the transport
@@ -294,7 +296,6 @@ void xprt_set_retrans_timeout_rtt(struct rpc_task *task);
294void xprt_wake_pending_tasks(struct rpc_xprt *xprt, int status); 296void xprt_wake_pending_tasks(struct rpc_xprt *xprt, int status);
295void xprt_wait_for_buffer_space(struct rpc_task *task, rpc_action action); 297void xprt_wait_for_buffer_space(struct rpc_task *task, rpc_action action);
296void xprt_write_space(struct rpc_xprt *xprt); 298void xprt_write_space(struct rpc_xprt *xprt);
297void xprt_update_rtt(struct rpc_task *task);
298void xprt_adjust_cwnd(struct rpc_task *task, int result); 299void xprt_adjust_cwnd(struct rpc_task *task, int result);
299struct rpc_rqst * xprt_lookup_rqst(struct rpc_xprt *xprt, __be32 xid); 300struct rpc_rqst * xprt_lookup_rqst(struct rpc_xprt *xprt, __be32 xid);
300void xprt_complete_rqst(struct rpc_task *task, int copied); 301void xprt_complete_rqst(struct rpc_task *task, int copied);
diff --git a/include/linux/swap.h b/include/linux/swap.h
index 1f59d9340c4d..ff4acea9bbdb 100644
--- a/include/linux/swap.h
+++ b/include/linux/swap.h
@@ -146,11 +146,13 @@ enum {
146 SWP_DISCARDING = (1 << 3), /* now discarding a free cluster */ 146 SWP_DISCARDING = (1 << 3), /* now discarding a free cluster */
147 SWP_SOLIDSTATE = (1 << 4), /* blkdev seeks are cheap */ 147 SWP_SOLIDSTATE = (1 << 4), /* blkdev seeks are cheap */
148 SWP_CONTINUED = (1 << 5), /* swap_map has count continuation */ 148 SWP_CONTINUED = (1 << 5), /* swap_map has count continuation */
149 SWP_BLKDEV = (1 << 6), /* its a block device */
149 /* add others here before... */ 150 /* add others here before... */
150 SWP_SCANNING = (1 << 8), /* refcount in scan_swap_map */ 151 SWP_SCANNING = (1 << 8), /* refcount in scan_swap_map */
151}; 152};
152 153
153#define SWAP_CLUSTER_MAX 32 154#define SWAP_CLUSTER_MAX 32
155#define COMPACT_CLUSTER_MAX SWAP_CLUSTER_MAX
154 156
155#define SWAP_MAP_MAX 0x3e /* Max duplication count, in first swap_map */ 157#define SWAP_MAP_MAX 0x3e /* Max duplication count, in first swap_map */
156#define SWAP_MAP_BAD 0x3f /* Note pageblock is bad, in first swap_map */ 158#define SWAP_MAP_BAD 0x3f /* Note pageblock is bad, in first swap_map */
@@ -223,20 +225,15 @@ static inline void lru_cache_add_anon(struct page *page)
223 __lru_cache_add(page, LRU_INACTIVE_ANON); 225 __lru_cache_add(page, LRU_INACTIVE_ANON);
224} 226}
225 227
226static inline void lru_cache_add_active_anon(struct page *page)
227{
228 __lru_cache_add(page, LRU_ACTIVE_ANON);
229}
230
231static inline void lru_cache_add_file(struct page *page) 228static inline void lru_cache_add_file(struct page *page)
232{ 229{
233 __lru_cache_add(page, LRU_INACTIVE_FILE); 230 __lru_cache_add(page, LRU_INACTIVE_FILE);
234} 231}
235 232
236static inline void lru_cache_add_active_file(struct page *page) 233/* LRU Isolation modes. */
237{ 234#define ISOLATE_INACTIVE 0 /* Isolate inactive pages. */
238 __lru_cache_add(page, LRU_ACTIVE_FILE); 235#define ISOLATE_ACTIVE 1 /* Isolate active pages. */
239} 236#define ISOLATE_BOTH 2 /* Isolate both active and inactive pages. */
240 237
241/* linux/mm/vmscan.c */ 238/* linux/mm/vmscan.c */
242extern unsigned long try_to_free_pages(struct zonelist *zonelist, int order, 239extern unsigned long try_to_free_pages(struct zonelist *zonelist, int order,
@@ -285,6 +282,11 @@ extern void kswapd_stop(int nid);
285extern int shmem_unuse(swp_entry_t entry, struct page *page); 282extern int shmem_unuse(swp_entry_t entry, struct page *page);
286#endif /* CONFIG_MMU */ 283#endif /* CONFIG_MMU */
287 284
285#ifdef CONFIG_CGROUP_MEM_RES_CTLR
286extern void mem_cgroup_get_shmem_target(struct inode *inode, pgoff_t pgoff,
287 struct page **pagep, swp_entry_t *ent);
288#endif
289
288extern void swap_unplug_io_fn(struct backing_dev_info *, struct page *); 290extern void swap_unplug_io_fn(struct backing_dev_info *, struct page *);
289 291
290#ifdef CONFIG_SWAP 292#ifdef CONFIG_SWAP
diff --git a/include/linux/swiotlb.h b/include/linux/swiotlb.h
index febedcf67c7e..81a4e213c6cf 100644
--- a/include/linux/swiotlb.h
+++ b/include/linux/swiotlb.h
@@ -73,16 +73,6 @@ extern void
73swiotlb_sync_sg_for_device(struct device *hwdev, struct scatterlist *sg, 73swiotlb_sync_sg_for_device(struct device *hwdev, struct scatterlist *sg,
74 int nelems, enum dma_data_direction dir); 74 int nelems, enum dma_data_direction dir);
75 75
76extern void
77swiotlb_sync_single_range_for_cpu(struct device *hwdev, dma_addr_t dev_addr,
78 unsigned long offset, size_t size,
79 enum dma_data_direction dir);
80
81extern void
82swiotlb_sync_single_range_for_device(struct device *hwdev, dma_addr_t dev_addr,
83 unsigned long offset, size_t size,
84 enum dma_data_direction dir);
85
86extern int 76extern int
87swiotlb_dma_mapping_error(struct device *hwdev, dma_addr_t dma_addr); 77swiotlb_dma_mapping_error(struct device *hwdev, dma_addr_t dma_addr);
88 78
diff --git a/include/linux/syscalls.h b/include/linux/syscalls.h
index 057929b0a651..a1a86a53bc73 100644
--- a/include/linux/syscalls.h
+++ b/include/linux/syscalls.h
@@ -103,22 +103,6 @@ struct perf_event_attr;
103#define __SC_TEST5(t5, a5, ...) __SC_TEST(t5); __SC_TEST4(__VA_ARGS__) 103#define __SC_TEST5(t5, a5, ...) __SC_TEST(t5); __SC_TEST4(__VA_ARGS__)
104#define __SC_TEST6(t6, a6, ...) __SC_TEST(t6); __SC_TEST5(__VA_ARGS__) 104#define __SC_TEST6(t6, a6, ...) __SC_TEST(t6); __SC_TEST5(__VA_ARGS__)
105 105
106#ifdef CONFIG_PERF_EVENTS
107
108#define TRACE_SYS_ENTER_PERF_INIT(sname) \
109 .perf_event_enable = perf_sysenter_enable, \
110 .perf_event_disable = perf_sysenter_disable,
111
112#define TRACE_SYS_EXIT_PERF_INIT(sname) \
113 .perf_event_enable = perf_sysexit_enable, \
114 .perf_event_disable = perf_sysexit_disable,
115#else
116#define TRACE_SYS_ENTER_PERF(sname)
117#define TRACE_SYS_ENTER_PERF_INIT(sname)
118#define TRACE_SYS_EXIT_PERF(sname)
119#define TRACE_SYS_EXIT_PERF_INIT(sname)
120#endif /* CONFIG_PERF_EVENTS */
121
122#ifdef CONFIG_FTRACE_SYSCALLS 106#ifdef CONFIG_FTRACE_SYSCALLS
123#define __SC_STR_ADECL1(t, a) #a 107#define __SC_STR_ADECL1(t, a) #a
124#define __SC_STR_ADECL2(t, a, ...) #a, __SC_STR_ADECL1(__VA_ARGS__) 108#define __SC_STR_ADECL2(t, a, ...) #a, __SC_STR_ADECL1(__VA_ARGS__)
@@ -134,54 +118,43 @@ struct perf_event_attr;
134#define __SC_STR_TDECL5(t, a, ...) #t, __SC_STR_TDECL4(__VA_ARGS__) 118#define __SC_STR_TDECL5(t, a, ...) #t, __SC_STR_TDECL4(__VA_ARGS__)
135#define __SC_STR_TDECL6(t, a, ...) #t, __SC_STR_TDECL5(__VA_ARGS__) 119#define __SC_STR_TDECL6(t, a, ...) #t, __SC_STR_TDECL5(__VA_ARGS__)
136 120
121extern struct ftrace_event_class event_class_syscall_enter;
122extern struct ftrace_event_class event_class_syscall_exit;
123extern struct trace_event_functions enter_syscall_print_funcs;
124extern struct trace_event_functions exit_syscall_print_funcs;
125
137#define SYSCALL_TRACE_ENTER_EVENT(sname) \ 126#define SYSCALL_TRACE_ENTER_EVENT(sname) \
138 static const struct syscall_metadata __syscall_meta_##sname; \ 127 static struct syscall_metadata __syscall_meta_##sname; \
139 static struct ftrace_event_call \ 128 static struct ftrace_event_call \
140 __attribute__((__aligned__(4))) event_enter_##sname; \ 129 __attribute__((__aligned__(4))) event_enter_##sname; \
141 static struct trace_event enter_syscall_print_##sname = { \
142 .trace = print_syscall_enter, \
143 }; \
144 static struct ftrace_event_call __used \ 130 static struct ftrace_event_call __used \
145 __attribute__((__aligned__(4))) \ 131 __attribute__((__aligned__(4))) \
146 __attribute__((section("_ftrace_events"))) \ 132 __attribute__((section("_ftrace_events"))) \
147 event_enter_##sname = { \ 133 event_enter_##sname = { \
148 .name = "sys_enter"#sname, \ 134 .name = "sys_enter"#sname, \
149 .system = "syscalls", \ 135 .class = &event_class_syscall_enter, \
150 .event = &enter_syscall_print_##sname, \ 136 .event.funcs = &enter_syscall_print_funcs, \
151 .raw_init = init_syscall_trace, \
152 .define_fields = syscall_enter_define_fields, \
153 .regfunc = reg_event_syscall_enter, \
154 .unregfunc = unreg_event_syscall_enter, \
155 .data = (void *)&__syscall_meta_##sname,\ 137 .data = (void *)&__syscall_meta_##sname,\
156 TRACE_SYS_ENTER_PERF_INIT(sname) \
157 } 138 }
158 139
159#define SYSCALL_TRACE_EXIT_EVENT(sname) \ 140#define SYSCALL_TRACE_EXIT_EVENT(sname) \
160 static const struct syscall_metadata __syscall_meta_##sname; \ 141 static struct syscall_metadata __syscall_meta_##sname; \
161 static struct ftrace_event_call \ 142 static struct ftrace_event_call \
162 __attribute__((__aligned__(4))) event_exit_##sname; \ 143 __attribute__((__aligned__(4))) event_exit_##sname; \
163 static struct trace_event exit_syscall_print_##sname = { \
164 .trace = print_syscall_exit, \
165 }; \
166 static struct ftrace_event_call __used \ 144 static struct ftrace_event_call __used \
167 __attribute__((__aligned__(4))) \ 145 __attribute__((__aligned__(4))) \
168 __attribute__((section("_ftrace_events"))) \ 146 __attribute__((section("_ftrace_events"))) \
169 event_exit_##sname = { \ 147 event_exit_##sname = { \
170 .name = "sys_exit"#sname, \ 148 .name = "sys_exit"#sname, \
171 .system = "syscalls", \ 149 .class = &event_class_syscall_exit, \
172 .event = &exit_syscall_print_##sname, \ 150 .event.funcs = &exit_syscall_print_funcs, \
173 .raw_init = init_syscall_trace, \
174 .define_fields = syscall_exit_define_fields, \
175 .regfunc = reg_event_syscall_exit, \
176 .unregfunc = unreg_event_syscall_exit, \
177 .data = (void *)&__syscall_meta_##sname,\ 151 .data = (void *)&__syscall_meta_##sname,\
178 TRACE_SYS_EXIT_PERF_INIT(sname) \
179 } 152 }
180 153
181#define SYSCALL_METADATA(sname, nb) \ 154#define SYSCALL_METADATA(sname, nb) \
182 SYSCALL_TRACE_ENTER_EVENT(sname); \ 155 SYSCALL_TRACE_ENTER_EVENT(sname); \
183 SYSCALL_TRACE_EXIT_EVENT(sname); \ 156 SYSCALL_TRACE_EXIT_EVENT(sname); \
184 static const struct syscall_metadata __used \ 157 static struct syscall_metadata __used \
185 __attribute__((__aligned__(4))) \ 158 __attribute__((__aligned__(4))) \
186 __attribute__((section("__syscalls_metadata"))) \ 159 __attribute__((section("__syscalls_metadata"))) \
187 __syscall_meta_##sname = { \ 160 __syscall_meta_##sname = { \
@@ -191,12 +164,14 @@ struct perf_event_attr;
191 .args = args_##sname, \ 164 .args = args_##sname, \
192 .enter_event = &event_enter_##sname, \ 165 .enter_event = &event_enter_##sname, \
193 .exit_event = &event_exit_##sname, \ 166 .exit_event = &event_exit_##sname, \
167 .enter_fields = LIST_HEAD_INIT(__syscall_meta_##sname.enter_fields), \
168 .exit_fields = LIST_HEAD_INIT(__syscall_meta_##sname.exit_fields), \
194 }; 169 };
195 170
196#define SYSCALL_DEFINE0(sname) \ 171#define SYSCALL_DEFINE0(sname) \
197 SYSCALL_TRACE_ENTER_EVENT(_##sname); \ 172 SYSCALL_TRACE_ENTER_EVENT(_##sname); \
198 SYSCALL_TRACE_EXIT_EVENT(_##sname); \ 173 SYSCALL_TRACE_EXIT_EVENT(_##sname); \
199 static const struct syscall_metadata __used \ 174 static struct syscall_metadata __used \
200 __attribute__((__aligned__(4))) \ 175 __attribute__((__aligned__(4))) \
201 __attribute__((section("__syscalls_metadata"))) \ 176 __attribute__((section("__syscalls_metadata"))) \
202 __syscall_meta__##sname = { \ 177 __syscall_meta__##sname = { \
@@ -204,6 +179,8 @@ struct perf_event_attr;
204 .nb_args = 0, \ 179 .nb_args = 0, \
205 .enter_event = &event_enter__##sname, \ 180 .enter_event = &event_enter__##sname, \
206 .exit_event = &event_exit__##sname, \ 181 .exit_event = &event_exit__##sname, \
182 .enter_fields = LIST_HEAD_INIT(__syscall_meta__##sname.enter_fields), \
183 .exit_fields = LIST_HEAD_INIT(__syscall_meta__##sname.exit_fields), \
207 }; \ 184 }; \
208 asmlinkage long sys_##sname(void) 185 asmlinkage long sys_##sname(void)
209#else 186#else
diff --git a/include/linux/sysctl.h b/include/linux/sysctl.h
index f66014c90c9f..7bb5cb64f3b8 100644
--- a/include/linux/sysctl.h
+++ b/include/linux/sysctl.h
@@ -980,6 +980,8 @@ extern int proc_doulongvec_minmax(struct ctl_table *, int,
980 void __user *, size_t *, loff_t *); 980 void __user *, size_t *, loff_t *);
981extern int proc_doulongvec_ms_jiffies_minmax(struct ctl_table *table, int, 981extern int proc_doulongvec_ms_jiffies_minmax(struct ctl_table *table, int,
982 void __user *, size_t *, loff_t *); 982 void __user *, size_t *, loff_t *);
983extern int proc_do_large_bitmap(struct ctl_table *, int,
984 void __user *, size_t *, loff_t *);
983 985
984/* 986/*
985 * Register a set of sysctl names by calling register_sysctl_table 987 * Register a set of sysctl names by calling register_sysctl_table
diff --git a/include/linux/sysfs.h b/include/linux/sysfs.h
index f0496b3d1811..f2694eb4dd3d 100644
--- a/include/linux/sysfs.h
+++ b/include/linux/sysfs.h
@@ -20,6 +20,7 @@
20 20
21struct kobject; 21struct kobject;
22struct module; 22struct module;
23enum kobj_ns_type;
23 24
24/* FIXME 25/* FIXME
25 * The *owner field is no longer used. 26 * The *owner field is no longer used.
@@ -86,17 +87,18 @@ struct attribute_group {
86 87
87#define attr_name(_attr) (_attr).attr.name 88#define attr_name(_attr) (_attr).attr.name
88 89
90struct file;
89struct vm_area_struct; 91struct vm_area_struct;
90 92
91struct bin_attribute { 93struct bin_attribute {
92 struct attribute attr; 94 struct attribute attr;
93 size_t size; 95 size_t size;
94 void *private; 96 void *private;
95 ssize_t (*read)(struct kobject *, struct bin_attribute *, 97 ssize_t (*read)(struct file *, struct kobject *, struct bin_attribute *,
96 char *, loff_t, size_t); 98 char *, loff_t, size_t);
97 ssize_t (*write)(struct kobject *, struct bin_attribute *, 99 ssize_t (*write)(struct file *,struct kobject *, struct bin_attribute *,
98 char *, loff_t, size_t); 100 char *, loff_t, size_t);
99 int (*mmap)(struct kobject *, struct bin_attribute *attr, 101 int (*mmap)(struct file *, struct kobject *, struct bin_attribute *attr,
100 struct vm_area_struct *vma); 102 struct vm_area_struct *vma);
101}; 103};
102 104
@@ -154,6 +156,9 @@ void sysfs_remove_link(struct kobject *kobj, const char *name);
154int sysfs_rename_link(struct kobject *kobj, struct kobject *target, 156int sysfs_rename_link(struct kobject *kobj, struct kobject *target,
155 const char *old_name, const char *new_name); 157 const char *old_name, const char *new_name);
156 158
159void sysfs_delete_link(struct kobject *dir, struct kobject *targ,
160 const char *name);
161
157int __must_check sysfs_create_group(struct kobject *kobj, 162int __must_check sysfs_create_group(struct kobject *kobj,
158 const struct attribute_group *grp); 163 const struct attribute_group *grp);
159int sysfs_update_group(struct kobject *kobj, 164int sysfs_update_group(struct kobject *kobj,
@@ -168,10 +173,15 @@ void sysfs_remove_file_from_group(struct kobject *kobj,
168void sysfs_notify(struct kobject *kobj, const char *dir, const char *attr); 173void sysfs_notify(struct kobject *kobj, const char *dir, const char *attr);
169void sysfs_notify_dirent(struct sysfs_dirent *sd); 174void sysfs_notify_dirent(struct sysfs_dirent *sd);
170struct sysfs_dirent *sysfs_get_dirent(struct sysfs_dirent *parent_sd, 175struct sysfs_dirent *sysfs_get_dirent(struct sysfs_dirent *parent_sd,
176 const void *ns,
171 const unsigned char *name); 177 const unsigned char *name);
172struct sysfs_dirent *sysfs_get(struct sysfs_dirent *sd); 178struct sysfs_dirent *sysfs_get(struct sysfs_dirent *sd);
173void sysfs_put(struct sysfs_dirent *sd); 179void sysfs_put(struct sysfs_dirent *sd);
174void sysfs_printk_last_file(void); 180void sysfs_printk_last_file(void);
181
182/* Called to clear a ns tag when it is no longer valid */
183void sysfs_exit_ns(enum kobj_ns_type type, const void *tag);
184
175int __must_check sysfs_init(void); 185int __must_check sysfs_init(void);
176 186
177#else /* CONFIG_SYSFS */ 187#else /* CONFIG_SYSFS */
@@ -264,6 +274,11 @@ static inline int sysfs_rename_link(struct kobject *k, struct kobject *t,
264 return 0; 274 return 0;
265} 275}
266 276
277static inline void sysfs_delete_link(struct kobject *k, struct kobject *t,
278 const char *name)
279{
280}
281
267static inline int sysfs_create_group(struct kobject *kobj, 282static inline int sysfs_create_group(struct kobject *kobj,
268 const struct attribute_group *grp) 283 const struct attribute_group *grp)
269{ 284{
@@ -301,6 +316,7 @@ static inline void sysfs_notify_dirent(struct sysfs_dirent *sd)
301} 316}
302static inline 317static inline
303struct sysfs_dirent *sysfs_get_dirent(struct sysfs_dirent *parent_sd, 318struct sysfs_dirent *sysfs_get_dirent(struct sysfs_dirent *parent_sd,
319 const void *ns,
304 const unsigned char *name) 320 const unsigned char *name)
305{ 321{
306 return NULL; 322 return NULL;
@@ -313,6 +329,10 @@ static inline void sysfs_put(struct sysfs_dirent *sd)
313{ 329{
314} 330}
315 331
332static inline void sysfs_exit_ns(int type, const void *tag)
333{
334}
335
316static inline int __must_check sysfs_init(void) 336static inline int __must_check sysfs_init(void)
317{ 337{
318 return 0; 338 return 0;
diff --git a/include/linux/sysrq.h b/include/linux/sysrq.h
index 99adcdc0d3ca..4496322e28dd 100644
--- a/include/linux/sysrq.h
+++ b/include/linux/sysrq.h
@@ -39,41 +39,34 @@ struct sysrq_key_op {
39 39
40#ifdef CONFIG_MAGIC_SYSRQ 40#ifdef CONFIG_MAGIC_SYSRQ
41 41
42extern int sysrq_on(void);
43
44/*
45 * Do not use this one directly:
46 */
47extern int __sysrq_enabled;
48
49/* Generic SysRq interface -- you may call it from any device driver, supplying 42/* Generic SysRq interface -- you may call it from any device driver, supplying
50 * ASCII code of the key, pointer to registers and kbd/tty structs (if they 43 * ASCII code of the key, pointer to registers and kbd/tty structs (if they
51 * are available -- else NULL's). 44 * are available -- else NULL's).
52 */ 45 */
53 46
54void handle_sysrq(int key, struct tty_struct *tty); 47void handle_sysrq(int key, struct tty_struct *tty);
55void __handle_sysrq(int key, struct tty_struct *tty, int check_mask);
56int register_sysrq_key(int key, struct sysrq_key_op *op); 48int register_sysrq_key(int key, struct sysrq_key_op *op);
57int unregister_sysrq_key(int key, struct sysrq_key_op *op); 49int unregister_sysrq_key(int key, struct sysrq_key_op *op);
58struct sysrq_key_op *__sysrq_get_key_op(int key); 50struct sysrq_key_op *__sysrq_get_key_op(int key);
59 51
52int sysrq_toggle_support(int enable_mask);
53
60#else 54#else
61 55
62static inline int sysrq_on(void) 56static inline void handle_sysrq(int key, struct tty_struct *tty)
63{ 57{
64 return 0;
65} 58}
66static inline int __reterr(void) 59
60static inline int register_sysrq_key(int key, struct sysrq_key_op *op)
67{ 61{
68 return -EINVAL; 62 return -EINVAL;
69} 63}
70static inline void handle_sysrq(int key, struct tty_struct *tty) 64
65static inline int unregister_sysrq_key(int key, struct sysrq_key_op *op)
71{ 66{
67 return -EINVAL;
72} 68}
73 69
74#define register_sysrq_key(ig,nore) __reterr()
75#define unregister_sysrq_key(ig,nore) __reterr()
76
77#endif 70#endif
78 71
79#endif /* _LINUX_SYSRQ_H */ 72#endif /* _LINUX_SYSRQ_H */
diff --git a/include/linux/tboot.h b/include/linux/tboot.h
index bf2a0c748878..1dba6ee55203 100644
--- a/include/linux/tboot.h
+++ b/include/linux/tboot.h
@@ -150,6 +150,7 @@ extern int tboot_force_iommu(void);
150 150
151#else 151#else
152 152
153#define tboot_enabled() 0
153#define tboot_probe() do { } while (0) 154#define tboot_probe() do { } while (0)
154#define tboot_shutdown(shutdown_type) do { } while (0) 155#define tboot_shutdown(shutdown_type) do { } while (0)
155#define tboot_sleep(sleep_state, pm1a_control, pm1b_control) \ 156#define tboot_sleep(sleep_state, pm1a_control, pm1b_control) \
diff --git a/include/linux/tca6416_keypad.h b/include/linux/tca6416_keypad.h
new file mode 100644
index 000000000000..7bd266f3525c
--- /dev/null
+++ b/include/linux/tca6416_keypad.h
@@ -0,0 +1,34 @@
1/*
2 * tca6416 keypad platform support
3 *
4 * Copyright (C) 2010 Texas Instruments
5 *
6 * Author: Sriramakrishnan <srk@ti.com>
7 *
8 * This program is free software; you can redistribute it and/or modify
9 * it under the terms of the GNU General Public License version 2 as
10 * published by the Free Software Foundation.
11 */
12
13#ifndef _TCA6416_KEYS_H
14#define _TCA6416_KEYS_H
15
16#include <linux/types.h>
17
18struct tca6416_button {
19 /* Configuration parameters */
20 int code; /* input event code (KEY_*, SW_*) */
21 int active_low;
22 int type; /* input event type (EV_KEY, EV_SW) */
23};
24
25struct tca6416_keys_platform_data {
26 struct tca6416_button *buttons;
27 int nbuttons;
28 unsigned int rep:1; /* enable input subsystem auto repeat */
29 uint16_t pinmask;
30 uint16_t invert;
31 int irq_is_gpio;
32 int use_polling; /* use polling if Interrupt is not connected*/
33};
34#endif
diff --git a/include/linux/threads.h b/include/linux/threads.h
index 052b12bec8bd..383ab9592bec 100644
--- a/include/linux/threads.h
+++ b/include/linux/threads.h
@@ -33,4 +33,13 @@
33#define PID_MAX_LIMIT (CONFIG_BASE_SMALL ? PAGE_SIZE * 8 : \ 33#define PID_MAX_LIMIT (CONFIG_BASE_SMALL ? PAGE_SIZE * 8 : \
34 (sizeof(long) > 4 ? 4 * 1024 * 1024 : PID_MAX_DEFAULT)) 34 (sizeof(long) > 4 ? 4 * 1024 * 1024 : PID_MAX_DEFAULT))
35 35
36/*
37 * Define a minimum number of pids per cpu. Heuristically based
38 * on original pid max of 32k for 32 cpus. Also, increase the
39 * minimum settable value for pid_max on the running system based
40 * on similar defaults. See kernel/pid.c:pidmap_init() for details.
41 */
42#define PIDS_PER_CPU_DEFAULT 1024
43#define PIDS_PER_CPU_MIN 8
44
36#endif 45#endif
diff --git a/include/linux/tick.h b/include/linux/tick.h
index d2ae79e21be3..b232ccc0ee29 100644
--- a/include/linux/tick.h
+++ b/include/linux/tick.h
@@ -42,6 +42,7 @@ enum tick_nohz_mode {
42 * @idle_waketime: Time when the idle was interrupted 42 * @idle_waketime: Time when the idle was interrupted
43 * @idle_exittime: Time when the idle state was left 43 * @idle_exittime: Time when the idle state was left
44 * @idle_sleeptime: Sum of the time slept in idle with sched tick stopped 44 * @idle_sleeptime: Sum of the time slept in idle with sched tick stopped
45 * @iowait_sleeptime: Sum of the time slept in idle with sched tick stopped, with IO outstanding
45 * @sleep_length: Duration of the current idle sleep 46 * @sleep_length: Duration of the current idle sleep
46 * @do_timer_lst: CPU was the last one doing do_timer before going idle 47 * @do_timer_lst: CPU was the last one doing do_timer before going idle
47 */ 48 */
@@ -60,7 +61,7 @@ struct tick_sched {
60 ktime_t idle_waketime; 61 ktime_t idle_waketime;
61 ktime_t idle_exittime; 62 ktime_t idle_exittime;
62 ktime_t idle_sleeptime; 63 ktime_t idle_sleeptime;
63 ktime_t idle_lastupdate; 64 ktime_t iowait_sleeptime;
64 ktime_t sleep_length; 65 ktime_t sleep_length;
65 unsigned long last_jiffies; 66 unsigned long last_jiffies;
66 unsigned long next_jiffies; 67 unsigned long next_jiffies;
@@ -124,6 +125,7 @@ extern void tick_nohz_stop_sched_tick(int inidle);
124extern void tick_nohz_restart_sched_tick(void); 125extern void tick_nohz_restart_sched_tick(void);
125extern ktime_t tick_nohz_get_sleep_length(void); 126extern ktime_t tick_nohz_get_sleep_length(void);
126extern u64 get_cpu_idle_time_us(int cpu, u64 *last_update_time); 127extern u64 get_cpu_idle_time_us(int cpu, u64 *last_update_time);
128extern u64 get_cpu_iowait_time_us(int cpu, u64 *last_update_time);
127# else 129# else
128static inline void tick_nohz_stop_sched_tick(int inidle) { } 130static inline void tick_nohz_stop_sched_tick(int inidle) { }
129static inline void tick_nohz_restart_sched_tick(void) { } 131static inline void tick_nohz_restart_sched_tick(void) { }
@@ -134,6 +136,7 @@ static inline ktime_t tick_nohz_get_sleep_length(void)
134 return len; 136 return len;
135} 137}
136static inline u64 get_cpu_idle_time_us(int cpu, u64 *unused) { return -1; } 138static inline u64 get_cpu_idle_time_us(int cpu, u64 *unused) { return -1; }
139static inline u64 get_cpu_iowait_time_us(int cpu, u64 *unused) { return -1; }
137# endif /* !NO_HZ */ 140# endif /* !NO_HZ */
138 141
139#endif 142#endif
diff --git a/include/linux/timb_dma.h b/include/linux/timb_dma.h
new file mode 100644
index 000000000000..bb043e970b96
--- /dev/null
+++ b/include/linux/timb_dma.h
@@ -0,0 +1,55 @@
1/*
2 * timb_dma.h timberdale FPGA DMA driver defines
3 * Copyright (c) 2010 Intel Corporation
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License version 2 as
7 * published by the Free Software Foundation.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
17 */
18
19/* Supports:
20 * Timberdale FPGA DMA engine
21 */
22
23#ifndef _LINUX_TIMB_DMA_H
24#define _LINUX_TIMB_DMA_H
25
26/**
27 * struct timb_dma_platform_data_channel - Description of each individual
28 * DMA channel for the timberdale DMA driver
29 * @rx: true if this channel handles data in the direction to
30 * the CPU.
31 * @bytes_per_line: Number of bytes per line, this is specific for channels
32 * handling video data. For other channels this shall be left to 0.
33 * @descriptors: Number of descriptors to allocate for this channel.
34 * @descriptor_elements: Number of elements in each descriptor.
35 *
36 */
37struct timb_dma_platform_data_channel {
38 bool rx;
39 unsigned int bytes_per_line;
40 unsigned int descriptors;
41 unsigned int descriptor_elements;
42};
43
44/**
45 * struct timb_dma_platform_data - Platform data of the timberdale DMA driver
46 * @nr_channels: Number of defined channels in the channels array.
47 * @channels: Definition of the each channel.
48 *
49 */
50struct timb_dma_platform_data {
51 unsigned nr_channels;
52 struct timb_dma_platform_data_channel channels[32];
53};
54
55#endif
diff --git a/include/linux/time.h b/include/linux/time.h
index 6e026e45a179..ea3559f0b3f2 100644
--- a/include/linux/time.h
+++ b/include/linux/time.h
@@ -150,7 +150,6 @@ extern struct timespec timespec_trunc(struct timespec t, unsigned gran);
150extern int timekeeping_valid_for_hres(void); 150extern int timekeeping_valid_for_hres(void);
151extern u64 timekeeping_max_deferment(void); 151extern u64 timekeeping_max_deferment(void);
152extern void update_wall_time(void); 152extern void update_wall_time(void);
153extern void update_xtime_cache(u64 nsec);
154extern void timekeeping_leap_insert(int leapsecond); 153extern void timekeeping_leap_insert(int leapsecond);
155 154
156struct tms; 155struct tms;
diff --git a/include/linux/timer.h b/include/linux/timer.h
index a2d1eb6cb3f0..ea965b857a50 100644
--- a/include/linux/timer.h
+++ b/include/linux/timer.h
@@ -10,13 +10,19 @@
10struct tvec_base; 10struct tvec_base;
11 11
12struct timer_list { 12struct timer_list {
13 /*
14 * All fields that change during normal runtime grouped to the
15 * same cacheline
16 */
13 struct list_head entry; 17 struct list_head entry;
14 unsigned long expires; 18 unsigned long expires;
19 struct tvec_base *base;
15 20
16 void (*function)(unsigned long); 21 void (*function)(unsigned long);
17 unsigned long data; 22 unsigned long data;
18 23
19 struct tvec_base *base; 24 int slack;
25
20#ifdef CONFIG_TIMER_STATS 26#ifdef CONFIG_TIMER_STATS
21 void *start_site; 27 void *start_site;
22 char start_comm[16]; 28 char start_comm[16];
@@ -165,6 +171,8 @@ extern int mod_timer(struct timer_list *timer, unsigned long expires);
165extern int mod_timer_pending(struct timer_list *timer, unsigned long expires); 171extern int mod_timer_pending(struct timer_list *timer, unsigned long expires);
166extern int mod_timer_pinned(struct timer_list *timer, unsigned long expires); 172extern int mod_timer_pinned(struct timer_list *timer, unsigned long expires);
167 173
174extern void set_timer_slack(struct timer_list *time, int slack_hz);
175
168#define TIMER_NOT_PINNED 0 176#define TIMER_NOT_PINNED 0
169#define TIMER_PINNED 1 177#define TIMER_PINNED 1
170/* 178/*
diff --git a/include/linux/timex.h b/include/linux/timex.h
index 7a082b32d8e1..32d852f8cbe4 100644
--- a/include/linux/timex.h
+++ b/include/linux/timex.h
@@ -232,13 +232,11 @@ struct timex {
232 */ 232 */
233extern unsigned long tick_usec; /* USER_HZ period (usec) */ 233extern unsigned long tick_usec; /* USER_HZ period (usec) */
234extern unsigned long tick_nsec; /* ACTHZ period (nsec) */ 234extern unsigned long tick_nsec; /* ACTHZ period (nsec) */
235extern int tickadj; /* amount of adjustment per tick */
236 235
237/* 236/*
238 * phase-lock loop variables 237 * phase-lock loop variables
239 */ 238 */
240extern int time_status; /* clock synchronization status bits */ 239extern int time_status; /* clock synchronization status bits */
241extern long time_adjust; /* The amount of adjtime left */
242 240
243extern void ntp_init(void); 241extern void ntp_init(void);
244extern void ntp_clear(void); 242extern void ntp_clear(void);
@@ -271,9 +269,6 @@ extern void second_overflow(void);
271extern void update_ntp_one_tick(void); 269extern void update_ntp_one_tick(void);
272extern int do_adjtimex(struct timex *); 270extern int do_adjtimex(struct timex *);
273 271
274/* Don't use! Compatibility define for existing users. */
275#define tickadj (500/HZ ? : 1)
276
277int read_current_timer(unsigned long *timer_val); 272int read_current_timer(unsigned long *timer_val);
278 273
279/* The clock frequency of the i8253/i8254 PIT */ 274/* The clock frequency of the i8253/i8254 PIT */
diff --git a/include/linux/tipc.h b/include/linux/tipc.h
index 9536d8aeadf1..181c8d0e6f73 100644
--- a/include/linux/tipc.h
+++ b/include/linux/tipc.h
@@ -107,7 +107,7 @@ static inline unsigned int tipc_node(__u32 addr)
107 * Message importance levels 107 * Message importance levels
108 */ 108 */
109 109
110#define TIPC_LOW_IMPORTANCE 0 /* default */ 110#define TIPC_LOW_IMPORTANCE 0
111#define TIPC_MEDIUM_IMPORTANCE 1 111#define TIPC_MEDIUM_IMPORTANCE 1
112#define TIPC_HIGH_IMPORTANCE 2 112#define TIPC_HIGH_IMPORTANCE 2
113#define TIPC_CRITICAL_IMPORTANCE 3 113#define TIPC_CRITICAL_IMPORTANCE 3
@@ -182,7 +182,7 @@ struct sockaddr_tipc {
182 struct tipc_name_seq nameseq; 182 struct tipc_name_seq nameseq;
183 struct { 183 struct {
184 struct tipc_name name; 184 struct tipc_name name;
185 __u32 domain; /* 0: own zone */ 185 __u32 domain;
186 } name; 186 } name;
187 } addr; 187 } addr;
188}; 188};
@@ -200,7 +200,7 @@ struct sockaddr_tipc {
200 */ 200 */
201 201
202#define TIPC_IMPORTANCE 127 /* Default: TIPC_LOW_IMPORTANCE */ 202#define TIPC_IMPORTANCE 127 /* Default: TIPC_LOW_IMPORTANCE */
203#define TIPC_SRC_DROPPABLE 128 /* Default: 0 (resend congested msg) */ 203#define TIPC_SRC_DROPPABLE 128 /* Default: based on socket type */
204#define TIPC_DEST_DROPPABLE 129 /* Default: based on socket type */ 204#define TIPC_DEST_DROPPABLE 129 /* Default: based on socket type */
205#define TIPC_CONN_TIMEOUT 130 /* Default: 8000 (ms) */ 205#define TIPC_CONN_TIMEOUT 130 /* Default: 8000 (ms) */
206#define TIPC_NODE_RECVQ_DEPTH 131 /* Default: none (read only) */ 206#define TIPC_NODE_RECVQ_DEPTH 131 /* Default: none (read only) */
diff --git a/include/linux/tipc_config.h b/include/linux/tipc_config.h
index 2bc6fa4adeb5..9cde86c32412 100644
--- a/include/linux/tipc_config.h
+++ b/include/linux/tipc_config.h
@@ -74,6 +74,7 @@
74#define TIPC_CMD_SHOW_NAME_TABLE 0x0005 /* tx name_tbl_query, rx ultra_string */ 74#define TIPC_CMD_SHOW_NAME_TABLE 0x0005 /* tx name_tbl_query, rx ultra_string */
75#define TIPC_CMD_SHOW_PORTS 0x0006 /* tx none, rx ultra_string */ 75#define TIPC_CMD_SHOW_PORTS 0x0006 /* tx none, rx ultra_string */
76#define TIPC_CMD_SHOW_LINK_STATS 0x000B /* tx link_name, rx ultra_string */ 76#define TIPC_CMD_SHOW_LINK_STATS 0x000B /* tx link_name, rx ultra_string */
77#define TIPC_CMD_SHOW_STATS 0x000F /* tx unsigned, rx ultra_string */
77 78
78#if 0 79#if 0
79#define TIPC_CMD_SHOW_PORT_STATS 0x0008 /* tx port_ref, rx ultra_string */ 80#define TIPC_CMD_SHOW_PORT_STATS 0x0008 /* tx port_ref, rx ultra_string */
diff --git a/include/linux/topology.h b/include/linux/topology.h
index 5b81156780b1..c44df50a05ab 100644
--- a/include/linux/topology.h
+++ b/include/linux/topology.h
@@ -31,6 +31,7 @@
31#include <linux/bitops.h> 31#include <linux/bitops.h>
32#include <linux/mmzone.h> 32#include <linux/mmzone.h>
33#include <linux/smp.h> 33#include <linux/smp.h>
34#include <linux/percpu.h>
34#include <asm/topology.h> 35#include <asm/topology.h>
35 36
36#ifndef node_has_online_mem 37#ifndef node_has_online_mem
@@ -203,8 +204,114 @@ int arch_update_cpu_topology(void);
203#ifndef SD_NODE_INIT 204#ifndef SD_NODE_INIT
204#error Please define an appropriate SD_NODE_INIT in include/asm/topology.h!!! 205#error Please define an appropriate SD_NODE_INIT in include/asm/topology.h!!!
205#endif 206#endif
207
206#endif /* CONFIG_NUMA */ 208#endif /* CONFIG_NUMA */
207 209
210#ifdef CONFIG_USE_PERCPU_NUMA_NODE_ID
211DECLARE_PER_CPU(int, numa_node);
212
213#ifndef numa_node_id
214/* Returns the number of the current Node. */
215static inline int numa_node_id(void)
216{
217 return __this_cpu_read(numa_node);
218}
219#endif
220
221#ifndef cpu_to_node
222static inline int cpu_to_node(int cpu)
223{
224 return per_cpu(numa_node, cpu);
225}
226#endif
227
228#ifndef set_numa_node
229static inline void set_numa_node(int node)
230{
231 percpu_write(numa_node, node);
232}
233#endif
234
235#ifndef set_cpu_numa_node
236static inline void set_cpu_numa_node(int cpu, int node)
237{
238 per_cpu(numa_node, cpu) = node;
239}
240#endif
241
242#else /* !CONFIG_USE_PERCPU_NUMA_NODE_ID */
243
244/* Returns the number of the current Node. */
245#ifndef numa_node_id
246static inline int numa_node_id(void)
247{
248 return cpu_to_node(raw_smp_processor_id());
249}
250#endif
251
252#endif /* [!]CONFIG_USE_PERCPU_NUMA_NODE_ID */
253
254#ifdef CONFIG_HAVE_MEMORYLESS_NODES
255
256/*
257 * N.B., Do NOT reference the '_numa_mem_' per cpu variable directly.
258 * It will not be defined when CONFIG_HAVE_MEMORYLESS_NODES is not defined.
259 * Use the accessor functions set_numa_mem(), numa_mem_id() and cpu_to_mem().
260 */
261DECLARE_PER_CPU(int, _numa_mem_);
262
263#ifndef set_numa_mem
264static inline void set_numa_mem(int node)
265{
266 percpu_write(_numa_mem_, node);
267}
268#endif
269
270#ifndef numa_mem_id
271/* Returns the number of the nearest Node with memory */
272static inline int numa_mem_id(void)
273{
274 return __this_cpu_read(_numa_mem_);
275}
276#endif
277
278#ifndef cpu_to_mem
279static inline int cpu_to_mem(int cpu)
280{
281 return per_cpu(_numa_mem_, cpu);
282}
283#endif
284
285#ifndef set_cpu_numa_mem
286static inline void set_cpu_numa_mem(int cpu, int node)
287{
288 per_cpu(_numa_mem_, cpu) = node;
289}
290#endif
291
292#else /* !CONFIG_HAVE_MEMORYLESS_NODES */
293
294static inline void set_numa_mem(int node) {}
295
296static inline void set_cpu_numa_mem(int cpu, int node) {}
297
298#ifndef numa_mem_id
299/* Returns the number of the nearest Node with memory */
300static inline int numa_mem_id(void)
301{
302 return numa_node_id();
303}
304#endif
305
306#ifndef cpu_to_mem
307static inline int cpu_to_mem(int cpu)
308{
309 return cpu_to_node(cpu);
310}
311#endif
312
313#endif /* [!]CONFIG_HAVE_MEMORYLESS_NODES */
314
208#ifndef topology_physical_package_id 315#ifndef topology_physical_package_id
209#define topology_physical_package_id(cpu) ((void)(cpu), -1) 316#define topology_physical_package_id(cpu) ((void)(cpu), -1)
210#endif 317#endif
@@ -218,9 +325,4 @@ int arch_update_cpu_topology(void);
218#define topology_core_cpumask(cpu) cpumask_of(cpu) 325#define topology_core_cpumask(cpu) cpumask_of(cpu)
219#endif 326#endif
220 327
221/* Returns the number of the current Node. */
222#ifndef numa_node_id
223#define numa_node_id() (cpu_to_node(raw_smp_processor_id()))
224#endif
225
226#endif /* _LINUX_TOPOLOGY_H */ 328#endif /* _LINUX_TOPOLOGY_H */
diff --git a/include/linux/tracepoint.h b/include/linux/tracepoint.h
index 78b4bd3be496..9a59d1f98cd4 100644
--- a/include/linux/tracepoint.h
+++ b/include/linux/tracepoint.h
@@ -20,12 +20,17 @@
20struct module; 20struct module;
21struct tracepoint; 21struct tracepoint;
22 22
23struct tracepoint_func {
24 void *func;
25 void *data;
26};
27
23struct tracepoint { 28struct tracepoint {
24 const char *name; /* Tracepoint name */ 29 const char *name; /* Tracepoint name */
25 int state; /* State. */ 30 int state; /* State. */
26 void (*regfunc)(void); 31 void (*regfunc)(void);
27 void (*unregfunc)(void); 32 void (*unregfunc)(void);
28 void **funcs; 33 struct tracepoint_func *funcs;
29} __attribute__((aligned(32))); /* 34} __attribute__((aligned(32))); /*
30 * Aligned on 32 bytes because it is 35 * Aligned on 32 bytes because it is
31 * globally visible and gcc happily 36 * globally visible and gcc happily
@@ -33,6 +38,68 @@ struct tracepoint {
33 * Keep in sync with vmlinux.lds.h. 38 * Keep in sync with vmlinux.lds.h.
34 */ 39 */
35 40
41/*
42 * Connect a probe to a tracepoint.
43 * Internal API, should not be used directly.
44 */
45extern int tracepoint_probe_register(const char *name, void *probe, void *data);
46
47/*
48 * Disconnect a probe from a tracepoint.
49 * Internal API, should not be used directly.
50 */
51extern int
52tracepoint_probe_unregister(const char *name, void *probe, void *data);
53
54extern int tracepoint_probe_register_noupdate(const char *name, void *probe,
55 void *data);
56extern int tracepoint_probe_unregister_noupdate(const char *name, void *probe,
57 void *data);
58extern void tracepoint_probe_update_all(void);
59
60struct tracepoint_iter {
61 struct module *module;
62 struct tracepoint *tracepoint;
63};
64
65extern void tracepoint_iter_start(struct tracepoint_iter *iter);
66extern void tracepoint_iter_next(struct tracepoint_iter *iter);
67extern void tracepoint_iter_stop(struct tracepoint_iter *iter);
68extern void tracepoint_iter_reset(struct tracepoint_iter *iter);
69extern int tracepoint_get_iter_range(struct tracepoint **tracepoint,
70 struct tracepoint *begin, struct tracepoint *end);
71
72/*
73 * tracepoint_synchronize_unregister must be called between the last tracepoint
74 * probe unregistration and the end of module exit to make sure there is no
75 * caller executing a probe when it is freed.
76 */
77static inline void tracepoint_synchronize_unregister(void)
78{
79 synchronize_sched();
80}
81
82#define PARAMS(args...) args
83
84#ifdef CONFIG_TRACEPOINTS
85extern void tracepoint_update_probe_range(struct tracepoint *begin,
86 struct tracepoint *end);
87#else
88static inline void tracepoint_update_probe_range(struct tracepoint *begin,
89 struct tracepoint *end)
90{ }
91#endif /* CONFIG_TRACEPOINTS */
92
93#endif /* _LINUX_TRACEPOINT_H */
94
95/*
96 * Note: we keep the TRACE_EVENT and DECLARE_TRACE outside the include
97 * file ifdef protection.
98 * This is due to the way trace events work. If a file includes two
99 * trace event headers under one "CREATE_TRACE_POINTS" the first include
100 * will override the TRACE_EVENT and break the second include.
101 */
102
36#ifndef DECLARE_TRACE 103#ifndef DECLARE_TRACE
37 104
38#define TP_PROTO(args...) args 105#define TP_PROTO(args...) args
@@ -43,17 +110,27 @@ struct tracepoint {
43/* 110/*
44 * it_func[0] is never NULL because there is at least one element in the array 111 * it_func[0] is never NULL because there is at least one element in the array
45 * when the array itself is non NULL. 112 * when the array itself is non NULL.
113 *
114 * Note, the proto and args passed in includes "__data" as the first parameter.
115 * The reason for this is to handle the "void" prototype. If a tracepoint
116 * has a "void" prototype, then it is invalid to declare a function
117 * as "(void *, void)". The DECLARE_TRACE_NOARGS() will pass in just
118 * "void *data", where as the DECLARE_TRACE() will pass in "void *data, proto".
46 */ 119 */
47#define __DO_TRACE(tp, proto, args) \ 120#define __DO_TRACE(tp, proto, args) \
48 do { \ 121 do { \
49 void **it_func; \ 122 struct tracepoint_func *it_func_ptr; \
123 void *it_func; \
124 void *__data; \
50 \ 125 \
51 rcu_read_lock_sched_notrace(); \ 126 rcu_read_lock_sched_notrace(); \
52 it_func = rcu_dereference_sched((tp)->funcs); \ 127 it_func_ptr = rcu_dereference_sched((tp)->funcs); \
53 if (it_func) { \ 128 if (it_func_ptr) { \
54 do { \ 129 do { \
55 ((void(*)(proto))(*it_func))(args); \ 130 it_func = (it_func_ptr)->func; \
56 } while (*(++it_func)); \ 131 __data = (it_func_ptr)->data; \
132 ((void(*)(proto))(it_func))(args); \
133 } while ((++it_func_ptr)->func); \
57 } \ 134 } \
58 rcu_read_unlock_sched_notrace(); \ 135 rcu_read_unlock_sched_notrace(); \
59 } while (0) 136 } while (0)
@@ -63,24 +140,32 @@ struct tracepoint {
63 * not add unwanted padding between the beginning of the section and the 140 * not add unwanted padding between the beginning of the section and the
64 * structure. Force alignment to the same alignment as the section start. 141 * structure. Force alignment to the same alignment as the section start.
65 */ 142 */
66#define DECLARE_TRACE(name, proto, args) \ 143#define __DECLARE_TRACE(name, proto, args, data_proto, data_args) \
67 extern struct tracepoint __tracepoint_##name; \ 144 extern struct tracepoint __tracepoint_##name; \
68 static inline void trace_##name(proto) \ 145 static inline void trace_##name(proto) \
69 { \ 146 { \
70 if (unlikely(__tracepoint_##name.state)) \ 147 if (unlikely(__tracepoint_##name.state)) \
71 __DO_TRACE(&__tracepoint_##name, \ 148 __DO_TRACE(&__tracepoint_##name, \
72 TP_PROTO(proto), TP_ARGS(args)); \ 149 TP_PROTO(data_proto), \
150 TP_ARGS(data_args)); \
73 } \ 151 } \
74 static inline int register_trace_##name(void (*probe)(proto)) \ 152 static inline int \
153 register_trace_##name(void (*probe)(data_proto), void *data) \
75 { \ 154 { \
76 return tracepoint_probe_register(#name, (void *)probe); \ 155 return tracepoint_probe_register(#name, (void *)probe, \
156 data); \
77 } \ 157 } \
78 static inline int unregister_trace_##name(void (*probe)(proto)) \ 158 static inline int \
159 unregister_trace_##name(void (*probe)(data_proto), void *data) \
160 { \
161 return tracepoint_probe_unregister(#name, (void *)probe, \
162 data); \
163 } \
164 static inline void \
165 check_trace_callback_type_##name(void (*cb)(data_proto)) \
79 { \ 166 { \
80 return tracepoint_probe_unregister(#name, (void *)probe);\
81 } 167 }
82 168
83
84#define DEFINE_TRACE_FN(name, reg, unreg) \ 169#define DEFINE_TRACE_FN(name, reg, unreg) \
85 static const char __tpstrtab_##name[] \ 170 static const char __tpstrtab_##name[] \
86 __attribute__((section("__tracepoints_strings"))) = #name; \ 171 __attribute__((section("__tracepoints_strings"))) = #name; \
@@ -96,22 +181,24 @@ struct tracepoint {
96#define EXPORT_TRACEPOINT_SYMBOL(name) \ 181#define EXPORT_TRACEPOINT_SYMBOL(name) \
97 EXPORT_SYMBOL(__tracepoint_##name) 182 EXPORT_SYMBOL(__tracepoint_##name)
98 183
99extern void tracepoint_update_probe_range(struct tracepoint *begin,
100 struct tracepoint *end);
101
102#else /* !CONFIG_TRACEPOINTS */ 184#else /* !CONFIG_TRACEPOINTS */
103#define DECLARE_TRACE(name, proto, args) \ 185#define __DECLARE_TRACE(name, proto, args, data_proto, data_args) \
104 static inline void _do_trace_##name(struct tracepoint *tp, proto) \
105 { } \
106 static inline void trace_##name(proto) \ 186 static inline void trace_##name(proto) \
107 { } \ 187 { } \
108 static inline int register_trace_##name(void (*probe)(proto)) \ 188 static inline int \
189 register_trace_##name(void (*probe)(data_proto), \
190 void *data) \
109 { \ 191 { \
110 return -ENOSYS; \ 192 return -ENOSYS; \
111 } \ 193 } \
112 static inline int unregister_trace_##name(void (*probe)(proto)) \ 194 static inline int \
195 unregister_trace_##name(void (*probe)(data_proto), \
196 void *data) \
113 { \ 197 { \
114 return -ENOSYS; \ 198 return -ENOSYS; \
199 } \
200 static inline void check_trace_callback_type_##name(void (*cb)(data_proto)) \
201 { \
115 } 202 }
116 203
117#define DEFINE_TRACE_FN(name, reg, unreg) 204#define DEFINE_TRACE_FN(name, reg, unreg)
@@ -119,60 +206,31 @@ extern void tracepoint_update_probe_range(struct tracepoint *begin,
119#define EXPORT_TRACEPOINT_SYMBOL_GPL(name) 206#define EXPORT_TRACEPOINT_SYMBOL_GPL(name)
120#define EXPORT_TRACEPOINT_SYMBOL(name) 207#define EXPORT_TRACEPOINT_SYMBOL(name)
121 208
122static inline void tracepoint_update_probe_range(struct tracepoint *begin,
123 struct tracepoint *end)
124{ }
125#endif /* CONFIG_TRACEPOINTS */ 209#endif /* CONFIG_TRACEPOINTS */
126#endif /* DECLARE_TRACE */
127
128/*
129 * Connect a probe to a tracepoint.
130 * Internal API, should not be used directly.
131 */
132extern int tracepoint_probe_register(const char *name, void *probe);
133
134/*
135 * Disconnect a probe from a tracepoint.
136 * Internal API, should not be used directly.
137 */
138extern int tracepoint_probe_unregister(const char *name, void *probe);
139
140extern int tracepoint_probe_register_noupdate(const char *name, void *probe);
141extern int tracepoint_probe_unregister_noupdate(const char *name, void *probe);
142extern void tracepoint_probe_update_all(void);
143
144struct tracepoint_iter {
145 struct module *module;
146 struct tracepoint *tracepoint;
147};
148
149extern void tracepoint_iter_start(struct tracepoint_iter *iter);
150extern void tracepoint_iter_next(struct tracepoint_iter *iter);
151extern void tracepoint_iter_stop(struct tracepoint_iter *iter);
152extern void tracepoint_iter_reset(struct tracepoint_iter *iter);
153extern int tracepoint_get_iter_range(struct tracepoint **tracepoint,
154 struct tracepoint *begin, struct tracepoint *end);
155 210
156/* 211/*
157 * tracepoint_synchronize_unregister must be called between the last tracepoint 212 * The need for the DECLARE_TRACE_NOARGS() is to handle the prototype
158 * probe unregistration and the end of module exit to make sure there is no 213 * (void). "void" is a special value in a function prototype and can
159 * caller executing a probe when it is freed. 214 * not be combined with other arguments. Since the DECLARE_TRACE()
215 * macro adds a data element at the beginning of the prototype,
216 * we need a way to differentiate "(void *data, proto)" from
217 * "(void *data, void)". The second prototype is invalid.
218 *
219 * DECLARE_TRACE_NOARGS() passes "void" as the tracepoint prototype
220 * and "void *__data" as the callback prototype.
221 *
222 * DECLARE_TRACE() passes "proto" as the tracepoint protoype and
223 * "void *__data, proto" as the callback prototype.
160 */ 224 */
161static inline void tracepoint_synchronize_unregister(void) 225#define DECLARE_TRACE_NOARGS(name) \
162{ 226 __DECLARE_TRACE(name, void, , void *__data, __data)
163 synchronize_sched();
164}
165 227
166#define PARAMS(args...) args 228#define DECLARE_TRACE(name, proto, args) \
167 229 __DECLARE_TRACE(name, PARAMS(proto), PARAMS(args), \
168#endif /* _LINUX_TRACEPOINT_H */ 230 PARAMS(void *__data, proto), \
231 PARAMS(__data, args))
169 232
170/* 233#endif /* DECLARE_TRACE */
171 * Note: we keep the TRACE_EVENT outside the include file ifdef protection.
172 * This is due to the way trace events work. If a file includes two
173 * trace event headers under one "CREATE_TRACE_POINTS" the first include
174 * will override the TRACE_EVENT and break the second include.
175 */
176 234
177#ifndef TRACE_EVENT 235#ifndef TRACE_EVENT
178/* 236/*
diff --git a/include/linux/tty.h b/include/linux/tty.h
index bb44fa9ae135..931078b73226 100644
--- a/include/linux/tty.h
+++ b/include/linux/tty.h
@@ -23,7 +23,7 @@
23 */ 23 */
24#define NR_UNIX98_PTY_DEFAULT 4096 /* Default maximum for Unix98 ptys */ 24#define NR_UNIX98_PTY_DEFAULT 4096 /* Default maximum for Unix98 ptys */
25#define NR_UNIX98_PTY_MAX (1 << MINORBITS) /* Absolute limit */ 25#define NR_UNIX98_PTY_MAX (1 << MINORBITS) /* Absolute limit */
26#define NR_LDISCS 21 26#define NR_LDISCS 30
27 27
28/* line disciplines */ 28/* line disciplines */
29#define N_TTY 0 29#define N_TTY 0
@@ -48,6 +48,7 @@
48#define N_PPS 18 /* Pulse per Second */ 48#define N_PPS 18 /* Pulse per Second */
49#define N_V253 19 /* Codec control over voice modem */ 49#define N_V253 19 /* Codec control over voice modem */
50#define N_CAIF 20 /* CAIF protocol for talking to modems */ 50#define N_CAIF 20 /* CAIF protocol for talking to modems */
51#define N_GSM0710 21 /* GSM 0710 Mux */
51 52
52/* 53/*
53 * This character is the same as _POSIX_VDISABLE: it cannot be used as 54 * This character is the same as _POSIX_VDISABLE: it cannot be used as
diff --git a/include/linux/types.h b/include/linux/types.h
index c42724f8c802..23d237a075e2 100644
--- a/include/linux/types.h
+++ b/include/linux/types.h
@@ -188,12 +188,12 @@ typedef u32 phys_addr_t;
188typedef phys_addr_t resource_size_t; 188typedef phys_addr_t resource_size_t;
189 189
190typedef struct { 190typedef struct {
191 volatile int counter; 191 int counter;
192} atomic_t; 192} atomic_t;
193 193
194#ifdef CONFIG_64BIT 194#ifdef CONFIG_64BIT
195typedef struct { 195typedef struct {
196 volatile long counter; 196 long counter;
197} atomic64_t; 197} atomic64_t;
198#endif 198#endif
199 199
diff --git a/include/linux/uinput.h b/include/linux/uinput.h
index 15ddd4483b09..60c81da77f0f 100644
--- a/include/linux/uinput.h
+++ b/include/linux/uinput.h
@@ -166,11 +166,11 @@ struct uinput_ff_erase {
166struct uinput_user_dev { 166struct uinput_user_dev {
167 char name[UINPUT_MAX_NAME_SIZE]; 167 char name[UINPUT_MAX_NAME_SIZE];
168 struct input_id id; 168 struct input_id id;
169 int ff_effects_max; 169 int ff_effects_max;
170 int absmax[ABS_MAX + 1]; 170 int absmax[ABS_CNT];
171 int absmin[ABS_MAX + 1]; 171 int absmin[ABS_CNT];
172 int absfuzz[ABS_MAX + 1]; 172 int absfuzz[ABS_CNT];
173 int absflat[ABS_MAX + 1]; 173 int absflat[ABS_CNT];
174}; 174};
175#endif /* __UINPUT_H_ */ 175#endif /* __UINPUT_H_ */
176 176
diff --git a/include/linux/usb.h b/include/linux/usb.h
index ce1323c4e47c..d5922a877994 100644
--- a/include/linux/usb.h
+++ b/include/linux/usb.h
@@ -45,27 +45,14 @@ struct wusb_dev;
45 45
46struct ep_device; 46struct ep_device;
47 47
48/* For SS devices */
49/**
50 * struct usb_host_ss_ep_comp - Valid for SuperSpeed devices only
51 * @desc: endpoint companion descriptor, wMaxPacketSize in native byteorder
52 * @extra: descriptors following this endpoint companion descriptor
53 * @extralen: how many bytes of "extra" are valid
54 */
55struct usb_host_ss_ep_comp {
56 struct usb_ss_ep_comp_descriptor desc;
57 unsigned char *extra; /* Extra descriptors */
58 int extralen;
59};
60
61/** 48/**
62 * struct usb_host_endpoint - host-side endpoint descriptor and queue 49 * struct usb_host_endpoint - host-side endpoint descriptor and queue
63 * @desc: descriptor for this endpoint, wMaxPacketSize in native byteorder 50 * @desc: descriptor for this endpoint, wMaxPacketSize in native byteorder
51 * @ss_ep_comp: SuperSpeed companion descriptor for this endpoint
64 * @urb_list: urbs queued to this endpoint; maintained by usbcore 52 * @urb_list: urbs queued to this endpoint; maintained by usbcore
65 * @hcpriv: for use by HCD; typically holds hardware dma queue head (QH) 53 * @hcpriv: for use by HCD; typically holds hardware dma queue head (QH)
66 * with one or more transfer descriptors (TDs) per urb 54 * with one or more transfer descriptors (TDs) per urb
67 * @ep_dev: ep_device for sysfs info 55 * @ep_dev: ep_device for sysfs info
68 * @ss_ep_comp: companion descriptor information for this endpoint
69 * @extra: descriptors following this endpoint in the configuration 56 * @extra: descriptors following this endpoint in the configuration
70 * @extralen: how many bytes of "extra" are valid 57 * @extralen: how many bytes of "extra" are valid
71 * @enabled: URBs may be submitted to this endpoint 58 * @enabled: URBs may be submitted to this endpoint
@@ -74,11 +61,11 @@ struct usb_host_ss_ep_comp {
74 * descriptor within an active interface in a given USB configuration. 61 * descriptor within an active interface in a given USB configuration.
75 */ 62 */
76struct usb_host_endpoint { 63struct usb_host_endpoint {
77 struct usb_endpoint_descriptor desc; 64 struct usb_endpoint_descriptor desc;
65 struct usb_ss_ep_comp_descriptor ss_ep_comp;
78 struct list_head urb_list; 66 struct list_head urb_list;
79 void *hcpriv; 67 void *hcpriv;
80 struct ep_device *ep_dev; /* For sysfs info */ 68 struct ep_device *ep_dev; /* For sysfs info */
81 struct usb_host_ss_ep_comp *ss_ep_comp; /* For SS devices */
82 69
83 unsigned char *extra; /* Extra descriptors */ 70 unsigned char *extra; /* Extra descriptors */
84 int extralen; 71 int extralen;
@@ -109,8 +96,8 @@ enum usb_interface_condition {
109/** 96/**
110 * struct usb_interface - what usb device drivers talk to 97 * struct usb_interface - what usb device drivers talk to
111 * @altsetting: array of interface structures, one for each alternate 98 * @altsetting: array of interface structures, one for each alternate
112 * setting that may be selected. Each one includes a set of 99 * setting that may be selected. Each one includes a set of
113 * endpoint configurations. They will be in no particular order. 100 * endpoint configurations. They will be in no particular order.
114 * @cur_altsetting: the current altsetting. 101 * @cur_altsetting: the current altsetting.
115 * @num_altsetting: number of altsettings defined. 102 * @num_altsetting: number of altsettings defined.
116 * @intf_assoc: interface association descriptor 103 * @intf_assoc: interface association descriptor
@@ -197,8 +184,6 @@ struct usb_interface {
197 struct work_struct reset_ws; /* for resets in atomic context */ 184 struct work_struct reset_ws; /* for resets in atomic context */
198}; 185};
199#define to_usb_interface(d) container_of(d, struct usb_interface, dev) 186#define to_usb_interface(d) container_of(d, struct usb_interface, dev)
200#define interface_to_usbdev(intf) \
201 container_of(intf->dev.parent, struct usb_device, dev)
202 187
203static inline void *usb_get_intfdata(struct usb_interface *intf) 188static inline void *usb_get_intfdata(struct usb_interface *intf)
204{ 189{
@@ -215,7 +200,7 @@ void usb_put_intf(struct usb_interface *intf);
215 200
216/* this maximum is arbitrary */ 201/* this maximum is arbitrary */
217#define USB_MAXINTERFACES 32 202#define USB_MAXINTERFACES 32
218#define USB_MAXIADS USB_MAXINTERFACES/2 203#define USB_MAXIADS (USB_MAXINTERFACES/2)
219 204
220/** 205/**
221 * struct usb_interface_cache - long-term representation of a device interface 206 * struct usb_interface_cache - long-term representation of a device interface
@@ -425,7 +410,6 @@ struct usb_tt;
425 * @connect_time: time device was first connected 410 * @connect_time: time device was first connected
426 * @do_remote_wakeup: remote wakeup should be enabled 411 * @do_remote_wakeup: remote wakeup should be enabled
427 * @reset_resume: needs reset instead of resume 412 * @reset_resume: needs reset instead of resume
428 * @autosuspend_disabled: autosuspend disabled by the user
429 * @wusb_dev: if this is a Wireless USB device, link to the WUSB 413 * @wusb_dev: if this is a Wireless USB device, link to the WUSB
430 * specific data for the device. 414 * specific data for the device.
431 * @slot_id: Slot ID assigned by xHCI 415 * @slot_id: Slot ID assigned by xHCI
@@ -436,7 +420,7 @@ struct usb_tt;
436 */ 420 */
437struct usb_device { 421struct usb_device {
438 int devnum; 422 int devnum;
439 char devpath [16]; 423 char devpath[16];
440 u32 route; 424 u32 route;
441 enum usb_device_state state; 425 enum usb_device_state state;
442 enum usb_device_speed speed; 426 enum usb_device_speed speed;
@@ -469,7 +453,7 @@ struct usb_device {
469 unsigned persist_enabled:1; 453 unsigned persist_enabled:1;
470 unsigned have_langid:1; 454 unsigned have_langid:1;
471 unsigned authorized:1; 455 unsigned authorized:1;
472 unsigned authenticated:1; 456 unsigned authenticated:1;
473 unsigned wusb:1; 457 unsigned wusb:1;
474 int string_langid; 458 int string_langid;
475 459
@@ -501,13 +485,17 @@ struct usb_device {
501 485
502 unsigned do_remote_wakeup:1; 486 unsigned do_remote_wakeup:1;
503 unsigned reset_resume:1; 487 unsigned reset_resume:1;
504 unsigned autosuspend_disabled:1;
505#endif 488#endif
506 struct wusb_dev *wusb_dev; 489 struct wusb_dev *wusb_dev;
507 int slot_id; 490 int slot_id;
508}; 491};
509#define to_usb_device(d) container_of(d, struct usb_device, dev) 492#define to_usb_device(d) container_of(d, struct usb_device, dev)
510 493
494static inline struct usb_device *interface_to_usbdev(struct usb_interface *intf)
495{
496 return to_usb_device(intf->dev.parent);
497}
498
511extern struct usb_device *usb_get_dev(struct usb_device *dev); 499extern struct usb_device *usb_get_dev(struct usb_device *dev);
512extern void usb_put_dev(struct usb_device *dev); 500extern void usb_put_dev(struct usb_device *dev);
513 501
@@ -522,12 +510,11 @@ extern int usb_lock_device_for_reset(struct usb_device *udev,
522extern int usb_reset_device(struct usb_device *dev); 510extern int usb_reset_device(struct usb_device *dev);
523extern void usb_queue_reset_device(struct usb_interface *dev); 511extern void usb_queue_reset_device(struct usb_interface *dev);
524 512
525extern struct usb_device *usb_find_device(u16 vendor_id, u16 product_id);
526 513
527/* USB autosuspend and autoresume */ 514/* USB autosuspend and autoresume */
528#ifdef CONFIG_USB_SUSPEND 515#ifdef CONFIG_USB_SUSPEND
529extern int usb_enable_autosuspend(struct usb_device *udev); 516extern void usb_enable_autosuspend(struct usb_device *udev);
530extern int usb_disable_autosuspend(struct usb_device *udev); 517extern void usb_disable_autosuspend(struct usb_device *udev);
531 518
532extern int usb_autopm_get_interface(struct usb_interface *intf); 519extern int usb_autopm_get_interface(struct usb_interface *intf);
533extern void usb_autopm_put_interface(struct usb_interface *intf); 520extern void usb_autopm_put_interface(struct usb_interface *intf);
@@ -572,6 +559,16 @@ static inline void usb_mark_last_busy(struct usb_device *udev)
572/* for drivers using iso endpoints */ 559/* for drivers using iso endpoints */
573extern int usb_get_current_frame_number(struct usb_device *usb_dev); 560extern int usb_get_current_frame_number(struct usb_device *usb_dev);
574 561
562/* Sets up a group of bulk endpoints to support multiple stream IDs. */
563extern int usb_alloc_streams(struct usb_interface *interface,
564 struct usb_host_endpoint **eps, unsigned int num_eps,
565 unsigned int num_streams, gfp_t mem_flags);
566
567/* Reverts a group of bulk endpoints back to not using stream IDs. */
568extern void usb_free_streams(struct usb_interface *interface,
569 struct usb_host_endpoint **eps, unsigned int num_eps,
570 gfp_t mem_flags);
571
575/* used these for multi-interface device registration */ 572/* used these for multi-interface device registration */
576extern int usb_driver_claim_interface(struct usb_driver *driver, 573extern int usb_driver_claim_interface(struct usb_driver *driver,
577 struct usb_interface *iface, void *priv); 574 struct usb_interface *iface, void *priv);
@@ -667,7 +664,7 @@ static inline int usb_make_path(struct usb_device *dev, char *buf, size_t size)
667 * This macro is used to create a struct usb_device_id that matches a 664 * This macro is used to create a struct usb_device_id that matches a
668 * specific device. 665 * specific device.
669 */ 666 */
670#define USB_DEVICE(vend,prod) \ 667#define USB_DEVICE(vend, prod) \
671 .match_flags = USB_DEVICE_ID_MATCH_DEVICE, \ 668 .match_flags = USB_DEVICE_ID_MATCH_DEVICE, \
672 .idVendor = (vend), \ 669 .idVendor = (vend), \
673 .idProduct = (prod) 670 .idProduct = (prod)
@@ -958,17 +955,25 @@ extern int usb_disabled(void);
958#define URB_ISO_ASAP 0x0002 /* iso-only, urb->start_frame 955#define URB_ISO_ASAP 0x0002 /* iso-only, urb->start_frame
959 * ignored */ 956 * ignored */
960#define URB_NO_TRANSFER_DMA_MAP 0x0004 /* urb->transfer_dma valid on submit */ 957#define URB_NO_TRANSFER_DMA_MAP 0x0004 /* urb->transfer_dma valid on submit */
961#define URB_NO_SETUP_DMA_MAP 0x0008 /* urb->setup_dma valid on submit */
962#define URB_NO_FSBR 0x0020 /* UHCI-specific */ 958#define URB_NO_FSBR 0x0020 /* UHCI-specific */
963#define URB_ZERO_PACKET 0x0040 /* Finish bulk OUT with short packet */ 959#define URB_ZERO_PACKET 0x0040 /* Finish bulk OUT with short packet */
964#define URB_NO_INTERRUPT 0x0080 /* HINT: no non-error interrupt 960#define URB_NO_INTERRUPT 0x0080 /* HINT: no non-error interrupt
965 * needed */ 961 * needed */
966#define URB_FREE_BUFFER 0x0100 /* Free transfer buffer with the URB */ 962#define URB_FREE_BUFFER 0x0100 /* Free transfer buffer with the URB */
967 963
964/* The following flags are used internally by usbcore and HCDs */
968#define URB_DIR_IN 0x0200 /* Transfer from device to host */ 965#define URB_DIR_IN 0x0200 /* Transfer from device to host */
969#define URB_DIR_OUT 0 966#define URB_DIR_OUT 0
970#define URB_DIR_MASK URB_DIR_IN 967#define URB_DIR_MASK URB_DIR_IN
971 968
969#define URB_DMA_MAP_SINGLE 0x00010000 /* Non-scatter-gather mapping */
970#define URB_DMA_MAP_PAGE 0x00020000 /* HCD-unsupported S-G */
971#define URB_DMA_MAP_SG 0x00040000 /* HCD-supported S-G */
972#define URB_MAP_LOCAL 0x00080000 /* HCD-local-memory mapping */
973#define URB_SETUP_MAP_SINGLE 0x00100000 /* Setup packet DMA mapped */
974#define URB_SETUP_MAP_LOCAL 0x00200000 /* HCD-local setup packet */
975#define URB_DMA_SG_COMBINED 0x00400000 /* S-G entries were combined */
976
972struct usb_iso_packet_descriptor { 977struct usb_iso_packet_descriptor {
973 unsigned int offset; 978 unsigned int offset;
974 unsigned int length; /* expected length */ 979 unsigned int length; /* expected length */
@@ -1045,12 +1050,8 @@ typedef void (*usb_complete_t)(struct urb *);
1045 * @setup_packet: Only used for control transfers, this points to eight bytes 1050 * @setup_packet: Only used for control transfers, this points to eight bytes
1046 * of setup data. Control transfers always start by sending this data 1051 * of setup data. Control transfers always start by sending this data
1047 * to the device. Then transfer_buffer is read or written, if needed. 1052 * to the device. Then transfer_buffer is read or written, if needed.
1048 * @setup_dma: For control transfers with URB_NO_SETUP_DMA_MAP set, the 1053 * @setup_dma: DMA pointer for the setup packet. The caller must not use
1049 * device driver has provided this DMA address for the setup packet. 1054 * this field; setup_packet must point to a valid buffer.
1050 * The host controller driver should use this in preference to
1051 * setup_packet, but the HCD may chose to ignore the address if it must
1052 * copy the setup packet into internal structures. Therefore, setup_packet
1053 * must always point to a valid buffer.
1054 * @start_frame: Returns the initial frame for isochronous transfers. 1055 * @start_frame: Returns the initial frame for isochronous transfers.
1055 * @number_of_packets: Lists the number of ISO transfer buffers. 1056 * @number_of_packets: Lists the number of ISO transfer buffers.
1056 * @interval: Specifies the polling interval for interrupt or isochronous 1057 * @interval: Specifies the polling interval for interrupt or isochronous
@@ -1082,13 +1083,14 @@ typedef void (*usb_complete_t)(struct urb *);
1082 * bounce buffer or talking to an IOMMU), 1083 * bounce buffer or talking to an IOMMU),
1083 * although they're cheap on commodity x86 and ppc hardware. 1084 * although they're cheap on commodity x86 and ppc hardware.
1084 * 1085 *
1085 * Alternatively, drivers may pass the URB_NO_xxx_DMA_MAP transfer flags, 1086 * Alternatively, drivers may pass the URB_NO_TRANSFER_DMA_MAP transfer flag,
1086 * which tell the host controller driver that no such mapping is needed since 1087 * which tells the host controller driver that no such mapping is needed for
1088 * the transfer_buffer since
1087 * the device driver is DMA-aware. For example, a device driver might 1089 * the device driver is DMA-aware. For example, a device driver might
1088 * allocate a DMA buffer with usb_buffer_alloc() or call usb_buffer_map(). 1090 * allocate a DMA buffer with usb_alloc_coherent() or call usb_buffer_map().
1089 * When these transfer flags are provided, host controller drivers will 1091 * When this transfer flag is provided, host controller drivers will
1090 * attempt to use the dma addresses found in the transfer_dma and/or 1092 * attempt to use the dma address found in the transfer_dma
1091 * setup_dma fields rather than determining a dma address themselves. 1093 * field rather than determining a dma address themselves.
1092 * 1094 *
1093 * Note that transfer_buffer must still be set if the controller 1095 * Note that transfer_buffer must still be set if the controller
1094 * does not support DMA (as indicated by bus.uses_dma) and when talking 1096 * does not support DMA (as indicated by bus.uses_dma) and when talking
@@ -1111,11 +1113,9 @@ typedef void (*usb_complete_t)(struct urb *);
1111 * should always terminate with a short packet, even if it means adding an 1113 * should always terminate with a short packet, even if it means adding an
1112 * extra zero length packet. 1114 * extra zero length packet.
1113 * 1115 *
1114 * Control URBs must provide a setup_packet. The setup_packet and 1116 * Control URBs must provide a valid pointer in the setup_packet field.
1115 * transfer_buffer may each be mapped for DMA or not, independently of 1117 * Unlike the transfer_buffer, the setup_packet may not be mapped for DMA
1116 * the other. The transfer_flags bits URB_NO_TRANSFER_DMA_MAP and 1118 * beforehand.
1117 * URB_NO_SETUP_DMA_MAP indicate which buffers have already been mapped.
1118 * URB_NO_SETUP_DMA_MAP is ignored for non-control URBs.
1119 * 1119 *
1120 * Interrupt URBs must provide an interval, saying how often (in milliseconds 1120 * Interrupt URBs must provide an interval, saying how often (in milliseconds
1121 * or, for highspeed devices, 125 microsecond units) 1121 * or, for highspeed devices, 125 microsecond units)
@@ -1186,14 +1186,15 @@ struct urb {
1186 * current owner */ 1186 * current owner */
1187 struct list_head anchor_list; /* the URB may be anchored */ 1187 struct list_head anchor_list; /* the URB may be anchored */
1188 struct usb_anchor *anchor; 1188 struct usb_anchor *anchor;
1189 struct usb_device *dev; /* (in) pointer to associated device */ 1189 struct usb_device *dev; /* (in) pointer to associated device */
1190 struct usb_host_endpoint *ep; /* (internal) pointer to endpoint */ 1190 struct usb_host_endpoint *ep; /* (internal) pointer to endpoint */
1191 unsigned int pipe; /* (in) pipe information */ 1191 unsigned int pipe; /* (in) pipe information */
1192 unsigned int stream_id; /* (in) stream ID */
1192 int status; /* (return) non-ISO status */ 1193 int status; /* (return) non-ISO status */
1193 unsigned int transfer_flags; /* (in) URB_SHORT_NOT_OK | ...*/ 1194 unsigned int transfer_flags; /* (in) URB_SHORT_NOT_OK | ...*/
1194 void *transfer_buffer; /* (in) associated data buffer */ 1195 void *transfer_buffer; /* (in) associated data buffer */
1195 dma_addr_t transfer_dma; /* (in) dma addr for transfer_buffer */ 1196 dma_addr_t transfer_dma; /* (in) dma addr for transfer_buffer */
1196 struct usb_sg_request *sg; /* (in) scatter gather buffer list */ 1197 struct scatterlist *sg; /* (in) scatter gather buffer list */
1197 int num_sgs; /* (in) number of entries in the sg list */ 1198 int num_sgs; /* (in) number of entries in the sg list */
1198 u32 transfer_buffer_length; /* (in) data buffer length */ 1199 u32 transfer_buffer_length; /* (in) data buffer length */
1199 u32 actual_length; /* (return) actual transfer length */ 1200 u32 actual_length; /* (return) actual transfer length */
@@ -1366,9 +1367,9 @@ static inline int usb_urb_dir_out(struct urb *urb)
1366 return (urb->transfer_flags & URB_DIR_MASK) == URB_DIR_OUT; 1367 return (urb->transfer_flags & URB_DIR_MASK) == URB_DIR_OUT;
1367} 1368}
1368 1369
1369void *usb_buffer_alloc(struct usb_device *dev, size_t size, 1370void *usb_alloc_coherent(struct usb_device *dev, size_t size,
1370 gfp_t mem_flags, dma_addr_t *dma); 1371 gfp_t mem_flags, dma_addr_t *dma);
1371void usb_buffer_free(struct usb_device *dev, size_t size, 1372void usb_free_coherent(struct usb_device *dev, size_t size,
1372 void *addr, dma_addr_t dma); 1373 void *addr, dma_addr_t dma);
1373 1374
1374#if 0 1375#if 0
@@ -1455,8 +1456,6 @@ struct usb_sg_request {
1455 1456
1456 struct usb_device *dev; 1457 struct usb_device *dev;
1457 int pipe; 1458 int pipe;
1458 struct scatterlist *sg;
1459 int nents;
1460 1459
1461 int entries; 1460 int entries;
1462 struct urb **urbs; 1461 struct urb **urbs;
@@ -1524,23 +1523,31 @@ static inline unsigned int __create_pipe(struct usb_device *dev,
1524} 1523}
1525 1524
1526/* Create various pipes... */ 1525/* Create various pipes... */
1527#define usb_sndctrlpipe(dev,endpoint) \ 1526#define usb_sndctrlpipe(dev, endpoint) \
1528 ((PIPE_CONTROL << 30) | __create_pipe(dev, endpoint)) 1527 ((PIPE_CONTROL << 30) | __create_pipe(dev, endpoint))
1529#define usb_rcvctrlpipe(dev,endpoint) \ 1528#define usb_rcvctrlpipe(dev, endpoint) \
1530 ((PIPE_CONTROL << 30) | __create_pipe(dev, endpoint) | USB_DIR_IN) 1529 ((PIPE_CONTROL << 30) | __create_pipe(dev, endpoint) | USB_DIR_IN)
1531#define usb_sndisocpipe(dev,endpoint) \ 1530#define usb_sndisocpipe(dev, endpoint) \
1532 ((PIPE_ISOCHRONOUS << 30) | __create_pipe(dev, endpoint)) 1531 ((PIPE_ISOCHRONOUS << 30) | __create_pipe(dev, endpoint))
1533#define usb_rcvisocpipe(dev,endpoint) \ 1532#define usb_rcvisocpipe(dev, endpoint) \
1534 ((PIPE_ISOCHRONOUS << 30) | __create_pipe(dev, endpoint) | USB_DIR_IN) 1533 ((PIPE_ISOCHRONOUS << 30) | __create_pipe(dev, endpoint) | USB_DIR_IN)
1535#define usb_sndbulkpipe(dev,endpoint) \ 1534#define usb_sndbulkpipe(dev, endpoint) \
1536 ((PIPE_BULK << 30) | __create_pipe(dev, endpoint)) 1535 ((PIPE_BULK << 30) | __create_pipe(dev, endpoint))
1537#define usb_rcvbulkpipe(dev,endpoint) \ 1536#define usb_rcvbulkpipe(dev, endpoint) \
1538 ((PIPE_BULK << 30) | __create_pipe(dev, endpoint) | USB_DIR_IN) 1537 ((PIPE_BULK << 30) | __create_pipe(dev, endpoint) | USB_DIR_IN)
1539#define usb_sndintpipe(dev,endpoint) \ 1538#define usb_sndintpipe(dev, endpoint) \
1540 ((PIPE_INTERRUPT << 30) | __create_pipe(dev, endpoint)) 1539 ((PIPE_INTERRUPT << 30) | __create_pipe(dev, endpoint))
1541#define usb_rcvintpipe(dev,endpoint) \ 1540#define usb_rcvintpipe(dev, endpoint) \
1542 ((PIPE_INTERRUPT << 30) | __create_pipe(dev, endpoint) | USB_DIR_IN) 1541 ((PIPE_INTERRUPT << 30) | __create_pipe(dev, endpoint) | USB_DIR_IN)
1543 1542
1543static inline struct usb_host_endpoint *
1544usb_pipe_endpoint(struct usb_device *dev, unsigned int pipe)
1545{
1546 struct usb_host_endpoint **eps;
1547 eps = usb_pipein(pipe) ? dev->ep_in : dev->ep_out;
1548 return eps[usb_pipeendpoint(pipe)];
1549}
1550
1544/*-------------------------------------------------------------------------*/ 1551/*-------------------------------------------------------------------------*/
1545 1552
1546static inline __u16 1553static inline __u16
diff --git a/include/linux/usb/Kbuild b/include/linux/usb/Kbuild
index 29fd73b0bffc..51410e0200cf 100644
--- a/include/linux/usb/Kbuild
+++ b/include/linux/usb/Kbuild
@@ -1,6 +1,7 @@
1header-y += audio.h 1header-y += audio.h
2header-y += cdc.h 2header-y += cdc.h
3header-y += ch9.h 3header-y += ch9.h
4header-y += ch11.h
4header-y += gadgetfs.h 5header-y += gadgetfs.h
5header-y += midi.h 6header-y += midi.h
6header-y += g_printer.h 7header-y += g_printer.h
diff --git a/include/linux/usb/atmel_usba_udc.h b/include/linux/usb/atmel_usba_udc.h
index baf41c8616e9..ba99af275a31 100644
--- a/include/linux/usb/atmel_usba_udc.h
+++ b/include/linux/usb/atmel_usba_udc.h
@@ -15,7 +15,7 @@ struct usba_ep_data {
15 15
16struct usba_platform_data { 16struct usba_platform_data {
17 int vbus_pin; 17 int vbus_pin;
18 int vbus_pin_inverted; 18 int vbus_pin_inverted;
19 int num_ep; 19 int num_ep;
20 struct usba_ep_data ep[0]; 20 struct usba_ep_data ep[0];
21}; 21};
diff --git a/include/linux/usb/audio-v2.h b/include/linux/usb/audio-v2.h
new file mode 100644
index 000000000000..92f1d99f0f17
--- /dev/null
+++ b/include/linux/usb/audio-v2.h
@@ -0,0 +1,394 @@
1/*
2 * Copyright (c) 2010 Daniel Mack <daniel@caiaq.de>
3 *
4 * This software is distributed under the terms of the GNU General Public
5 * License ("GPL") version 2, as published by the Free Software Foundation.
6 *
7 * This file holds USB constants and structures defined
8 * by the USB Device Class Definition for Audio Devices in version 2.0.
9 * Comments below reference relevant sections of the documents contained
10 * in http://www.usb.org/developers/devclass_docs/Audio2.0_final.zip
11 */
12
13#ifndef __LINUX_USB_AUDIO_V2_H
14#define __LINUX_USB_AUDIO_V2_H
15
16#include <linux/types.h>
17
18/* v1.0 and v2.0 of this standard have many things in common. For the rest
19 * of the definitions, please refer to audio.h */
20
21/* 4.7.2.1 Clock Source Descriptor */
22
23struct uac_clock_source_descriptor {
24 __u8 bLength;
25 __u8 bDescriptorType;
26 __u8 bDescriptorSubtype;
27 __u8 bClockID;
28 __u8 bmAttributes;
29 __u8 bmControls;
30 __u8 bAssocTerminal;
31 __u8 iClockSource;
32} __attribute__((packed));
33
34/* 4.7.2.2 Clock Source Descriptor */
35
36struct uac_clock_selector_descriptor {
37 __u8 bLength;
38 __u8 bDescriptorType;
39 __u8 bDescriptorSubtype;
40 __u8 bClockID;
41 __u8 bNrInPins;
42 __u8 bmControls;
43 __u8 baCSourceID[];
44} __attribute__((packed));
45
46/* 4.7.2.4 Input terminal descriptor */
47
48struct uac2_input_terminal_descriptor {
49 __u8 bLength;
50 __u8 bDescriptorType;
51 __u8 bDescriptorSubtype;
52 __u8 bTerminalID;
53 __u16 wTerminalType;
54 __u8 bAssocTerminal;
55 __u8 bCSourceID;
56 __u8 bNrChannels;
57 __u32 bmChannelConfig;
58 __u8 iChannelNames;
59 __u16 bmControls;
60 __u8 iTerminal;
61} __attribute__((packed));
62
63/* 4.7.2.5 Output terminal descriptor */
64
65struct uac2_output_terminal_descriptor {
66 __u8 bLength;
67 __u8 bDescriptorType;
68 __u8 bDescriptorSubtype;
69 __u8 bTerminalID;
70 __u16 wTerminalType;
71 __u8 bAssocTerminal;
72 __u8 bSourceID;
73 __u8 bCSourceID;
74 __u16 bmControls;
75 __u8 iTerminal;
76} __attribute__((packed));
77
78
79
80/* 4.7.2.8 Feature Unit Descriptor */
81
82struct uac2_feature_unit_descriptor {
83 __u8 bLength;
84 __u8 bDescriptorType;
85 __u8 bDescriptorSubtype;
86 __u8 bUnitID;
87 __u8 bSourceID;
88 /* bmaControls is actually u32,
89 * but u8 is needed for the hybrid parser */
90 __u8 bmaControls[0]; /* variable length */
91} __attribute__((packed));
92
93/* 4.9.2 Class-Specific AS Interface Descriptor */
94
95struct uac_as_header_descriptor_v2 {
96 __u8 bLength;
97 __u8 bDescriptorType;
98 __u8 bDescriptorSubtype;
99 __u8 bTerminalLink;
100 __u8 bmControls;
101 __u8 bFormatType;
102 __u32 bmFormats;
103 __u8 bNrChannels;
104 __u32 bmChannelConfig;
105 __u8 iChannelNames;
106} __attribute__((packed));
107
108/* 4.10.1.2 Class-Specific AS Isochronous Audio Data Endpoint Descriptor */
109
110struct uac2_iso_endpoint_descriptor {
111 __u8 bLength; /* in bytes: 8 */
112 __u8 bDescriptorType; /* USB_DT_CS_ENDPOINT */
113 __u8 bDescriptorSubtype; /* EP_GENERAL */
114 __u8 bmAttributes;
115 __u8 bmControls;
116 __u8 bLockDelayUnits;
117 __le16 wLockDelay;
118} __attribute__((packed));
119
120#define UAC2_CONTROL_PITCH (3 << 0)
121#define UAC2_CONTROL_DATA_OVERRUN (3 << 2)
122#define UAC2_CONTROL_DATA_UNDERRUN (3 << 4)
123
124/* 6.1 Interrupt Data Message */
125
126#define UAC2_INTERRUPT_DATA_MSG_VENDOR (1 << 0)
127#define UAC2_INTERRUPT_DATA_MSG_EP (1 << 1)
128
129struct uac2_interrupt_data_msg {
130 __u8 bInfo;
131 __u8 bAttribute;
132 __le16 wValue;
133 __le16 wIndex;
134} __attribute__((packed));
135
136/* A.7 Audio Function Category Codes */
137#define UAC2_FUNCTION_SUBCLASS_UNDEFINED 0x00
138#define UAC2_FUNCTION_DESKTOP_SPEAKER 0x01
139#define UAC2_FUNCTION_HOME_THEATER 0x02
140#define UAC2_FUNCTION_MICROPHONE 0x03
141#define UAC2_FUNCTION_HEADSET 0x04
142#define UAC2_FUNCTION_TELEPHONE 0x05
143#define UAC2_FUNCTION_CONVERTER 0x06
144#define UAC2_FUNCTION_SOUND_RECORDER 0x07
145#define UAC2_FUNCTION_IO_BOX 0x08
146#define UAC2_FUNCTION_MUSICAL_INSTRUMENT 0x09
147#define UAC2_FUNCTION_PRO_AUDIO 0x0a
148#define UAC2_FUNCTION_AUDIO_VIDEO 0x0b
149#define UAC2_FUNCTION_CONTROL_PANEL 0x0c
150#define UAC2_FUNCTION_OTHER 0xff
151
152/* A.9 Audio Class-Specific AC Interface Descriptor Subtypes */
153/* see audio.h for the rest, which is identical to v1 */
154#define UAC2_EFFECT_UNIT 0x07
155#define UAC2_PROCESSING_UNIT_V2 0x08
156#define UAC2_EXTENSION_UNIT_V2 0x09
157#define UAC2_CLOCK_SOURCE 0x0a
158#define UAC2_CLOCK_SELECTOR 0x0b
159#define UAC2_CLOCK_MULTIPLIER 0x0c
160#define UAC2_SAMPLE_RATE_CONVERTER 0x0d
161
162/* A.10 Audio Class-Specific AS Interface Descriptor Subtypes */
163/* see audio.h for the rest, which is identical to v1 */
164#define UAC2_ENCODER 0x03
165#define UAC2_DECODER 0x04
166
167/* A.11 Effect Unit Effect Types */
168#define UAC2_EFFECT_UNDEFINED 0x00
169#define UAC2_EFFECT_PARAM_EQ 0x01
170#define UAC2_EFFECT_REVERB 0x02
171#define UAC2_EFFECT_MOD_DELAY 0x03
172#define UAC2_EFFECT_DYN_RANGE_COMP 0x04
173
174/* A.12 Processing Unit Process Types */
175#define UAC2_PROCESS_UNDEFINED 0x00
176#define UAC2_PROCESS_UP_DOWNMIX 0x01
177#define UAC2_PROCESS_DOLBY_PROLOCIC 0x02
178#define UAC2_PROCESS_STEREO_EXTENDER 0x03
179
180/* A.14 Audio Class-Specific Request Codes */
181#define UAC2_CS_CUR 0x01
182#define UAC2_CS_RANGE 0x02
183#define UAC2_CS_MEM 0x03
184
185/* A.15 Encoder Type Codes */
186#define UAC2_ENCODER_UNDEFINED 0x00
187#define UAC2_ENCODER_OTHER 0x01
188#define UAC2_ENCODER_MPEG 0x02
189#define UAC2_ENCODER_AC3 0x03
190#define UAC2_ENCODER_WMA 0x04
191#define UAC2_ENCODER_DTS 0x05
192
193/* A.16 Decoder Type Codes */
194#define UAC2_DECODER_UNDEFINED 0x00
195#define UAC2_DECODER_OTHER 0x01
196#define UAC2_DECODER_MPEG 0x02
197#define UAC2_DECODER_AC3 0x03
198#define UAC2_DECODER_WMA 0x04
199#define UAC2_DECODER_DTS 0x05
200
201/* A.17.1 Clock Source Control Selectors */
202#define UAC2_CS_UNDEFINED 0x00
203#define UAC2_CS_CONTROL_SAM_FREQ 0x01
204#define UAC2_CS_CONTROL_CLOCK_VALID 0x02
205
206/* A.17.2 Clock Selector Control Selectors */
207#define UAC2_CX_UNDEFINED 0x00
208#define UAC2_CX_CLOCK_SELECTOR 0x01
209
210/* A.17.3 Clock Multiplier Control Selectors */
211#define UAC2_CM_UNDEFINED 0x00
212#define UAC2_CM_NUMERATOR 0x01
213#define UAC2_CM_DENOMINTATOR 0x02
214
215/* A.17.4 Terminal Control Selectors */
216#define UAC2_TE_UNDEFINED 0x00
217#define UAC2_TE_COPY_PROTECT 0x01
218#define UAC2_TE_CONNECTOR 0x02
219#define UAC2_TE_OVERLOAD 0x03
220#define UAC2_TE_CLUSTER 0x04
221#define UAC2_TE_UNDERFLOW 0x05
222#define UAC2_TE_OVERFLOW 0x06
223#define UAC2_TE_LATENCY 0x07
224
225/* A.17.5 Mixer Control Selectors */
226#define UAC2_MU_UNDEFINED 0x00
227#define UAC2_MU_MIXER 0x01
228#define UAC2_MU_CLUSTER 0x02
229#define UAC2_MU_UNDERFLOW 0x03
230#define UAC2_MU_OVERFLOW 0x04
231#define UAC2_MU_LATENCY 0x05
232
233/* A.17.6 Selector Control Selectors */
234#define UAC2_SU_UNDEFINED 0x00
235#define UAC2_SU_SELECTOR 0x01
236#define UAC2_SU_LATENCY 0x02
237
238/* A.17.7 Feature Unit Control Selectors */
239/* see audio.h for the rest, which is identical to v1 */
240#define UAC2_FU_INPUT_GAIN 0x0b
241#define UAC2_FU_INPUT_GAIN_PAD 0x0c
242#define UAC2_FU_PHASE_INVERTER 0x0d
243#define UAC2_FU_UNDERFLOW 0x0e
244#define UAC2_FU_OVERFLOW 0x0f
245#define UAC2_FU_LATENCY 0x10
246
247/* A.17.8.1 Parametric Equalizer Section Effect Unit Control Selectors */
248#define UAC2_PE_UNDEFINED 0x00
249#define UAC2_PE_ENABLE 0x01
250#define UAC2_PE_CENTERFREQ 0x02
251#define UAC2_PE_QFACTOR 0x03
252#define UAC2_PE_GAIN 0x04
253#define UAC2_PE_UNDERFLOW 0x05
254#define UAC2_PE_OVERFLOW 0x06
255#define UAC2_PE_LATENCY 0x07
256
257/* A.17.8.2 Reverberation Effect Unit Control Selectors */
258#define UAC2_RV_UNDEFINED 0x00
259#define UAC2_RV_ENABLE 0x01
260#define UAC2_RV_TYPE 0x02
261#define UAC2_RV_LEVEL 0x03
262#define UAC2_RV_TIME 0x04
263#define UAC2_RV_FEEDBACK 0x05
264#define UAC2_RV_PREDELAY 0x06
265#define UAC2_RV_DENSITY 0x07
266#define UAC2_RV_HIFREQ_ROLLOFF 0x08
267#define UAC2_RV_UNDERFLOW 0x09
268#define UAC2_RV_OVERFLOW 0x0a
269#define UAC2_RV_LATENCY 0x0b
270
271/* A.17.8.3 Modulation Delay Effect Control Selectors */
272#define UAC2_MD_UNDEFINED 0x00
273#define UAC2_MD_ENABLE 0x01
274#define UAC2_MD_BALANCE 0x02
275#define UAC2_MD_RATE 0x03
276#define UAC2_MD_DEPTH 0x04
277#define UAC2_MD_TIME 0x05
278#define UAC2_MD_FEEDBACK 0x06
279#define UAC2_MD_UNDERFLOW 0x07
280#define UAC2_MD_OVERFLOW 0x08
281#define UAC2_MD_LATENCY 0x09
282
283/* A.17.8.4 Dynamic Range Compressor Effect Unit Control Selectors */
284#define UAC2_DR_UNDEFINED 0x00
285#define UAC2_DR_ENABLE 0x01
286#define UAC2_DR_COMPRESSION_RATE 0x02
287#define UAC2_DR_MAXAMPL 0x03
288#define UAC2_DR_THRESHOLD 0x04
289#define UAC2_DR_ATTACK_TIME 0x05
290#define UAC2_DR_RELEASE_TIME 0x06
291#define UAC2_DR_UNDEFLOW 0x07
292#define UAC2_DR_OVERFLOW 0x08
293#define UAC2_DR_LATENCY 0x09
294
295/* A.17.9.1 Up/Down-mix Processing Unit Control Selectors */
296#define UAC2_UD_UNDEFINED 0x00
297#define UAC2_UD_ENABLE 0x01
298#define UAC2_UD_MODE_SELECT 0x02
299#define UAC2_UD_CLUSTER 0x03
300#define UAC2_UD_UNDERFLOW 0x04
301#define UAC2_UD_OVERFLOW 0x05
302#define UAC2_UD_LATENCY 0x06
303
304/* A.17.9.2 Dolby Prologic[tm] Processing Unit Control Selectors */
305#define UAC2_DP_UNDEFINED 0x00
306#define UAC2_DP_ENABLE 0x01
307#define UAC2_DP_MODE_SELECT 0x02
308#define UAC2_DP_CLUSTER 0x03
309#define UAC2_DP_UNDERFFLOW 0x04
310#define UAC2_DP_OVERFLOW 0x05
311#define UAC2_DP_LATENCY 0x06
312
313/* A.17.9.3 Stereo Expander Processing Unit Control Selectors */
314#define UAC2_ST_EXT_UNDEFINED 0x00
315#define UAC2_ST_EXT_ENABLE 0x01
316#define UAC2_ST_EXT_WIDTH 0x02
317#define UAC2_ST_EXT_UNDEFLOW 0x03
318#define UAC2_ST_EXT_OVERFLOW 0x04
319#define UAC2_ST_EXT_LATENCY 0x05
320
321/* A.17.10 Extension Unit Control Selectors */
322#define UAC2_XU_UNDEFINED 0x00
323#define UAC2_XU_ENABLE 0x01
324#define UAC2_XU_CLUSTER 0x02
325#define UAC2_XU_UNDERFLOW 0x03
326#define UAC2_XU_OVERFLOW 0x04
327#define UAC2_XU_LATENCY 0x05
328
329/* A.17.11 AudioStreaming Interface Control Selectors */
330#define UAC2_AS_UNDEFINED 0x00
331#define UAC2_AS_ACT_ALT_SETTING 0x01
332#define UAC2_AS_VAL_ALT_SETTINGS 0x02
333#define UAC2_AS_AUDIO_DATA_FORMAT 0x03
334
335/* A.17.12 Encoder Control Selectors */
336#define UAC2_EN_UNDEFINED 0x00
337#define UAC2_EN_BIT_RATE 0x01
338#define UAC2_EN_QUALITY 0x02
339#define UAC2_EN_VBR 0x03
340#define UAC2_EN_TYPE 0x04
341#define UAC2_EN_UNDERFLOW 0x05
342#define UAC2_EN_OVERFLOW 0x06
343#define UAC2_EN_ENCODER_ERROR 0x07
344#define UAC2_EN_PARAM1 0x08
345#define UAC2_EN_PARAM2 0x09
346#define UAC2_EN_PARAM3 0x0a
347#define UAC2_EN_PARAM4 0x0b
348#define UAC2_EN_PARAM5 0x0c
349#define UAC2_EN_PARAM6 0x0d
350#define UAC2_EN_PARAM7 0x0e
351#define UAC2_EN_PARAM8 0x0f
352
353/* A.17.13.1 MPEG Decoder Control Selectors */
354#define UAC2_MPEG_UNDEFINED 0x00
355#define UAC2_MPEG_DUAL_CHANNEL 0x01
356#define UAC2_MPEG_SECOND_STEREO 0x02
357#define UAC2_MPEG_MULTILINGUAL 0x03
358#define UAC2_MPEG_DYN_RANGE 0x04
359#define UAC2_MPEG_SCALING 0x05
360#define UAC2_MPEG_HILO_SCALING 0x06
361#define UAC2_MPEG_UNDERFLOW 0x07
362#define UAC2_MPEG_OVERFLOW 0x08
363#define UAC2_MPEG_DECODER_ERROR 0x09
364
365/* A17.13.2 AC3 Decoder Control Selectors */
366#define UAC2_AC3_UNDEFINED 0x00
367#define UAC2_AC3_MODE 0x01
368#define UAC2_AC3_DYN_RANGE 0x02
369#define UAC2_AC3_SCALING 0x03
370#define UAC2_AC3_HILO_SCALING 0x04
371#define UAC2_AC3_UNDERFLOW 0x05
372#define UAC2_AC3_OVERFLOW 0x06
373#define UAC2_AC3_DECODER_ERROR 0x07
374
375/* A17.13.3 WMA Decoder Control Selectors */
376#define UAC2_WMA_UNDEFINED 0x00
377#define UAC2_WMA_UNDERFLOW 0x01
378#define UAC2_WMA_OVERFLOW 0x02
379#define UAC2_WMA_DECODER_ERROR 0x03
380
381/* A17.13.4 DTS Decoder Control Selectors */
382#define UAC2_DTS_UNDEFINED 0x00
383#define UAC2_DTS_UNDERFLOW 0x01
384#define UAC2_DTS_OVERFLOW 0x02
385#define UAC2_DTS_DECODER_ERROR 0x03
386
387/* A17.14 Endpoint Control Selectors */
388#define UAC2_EP_CS_UNDEFINED 0x00
389#define UAC2_EP_CS_PITCH 0x01
390#define UAC2_EP_CS_DATA_OVERRUN 0x02
391#define UAC2_EP_CS_DATA_UNDERRUN 0x03
392
393#endif /* __LINUX_USB_AUDIO_V2_H */
394
diff --git a/include/linux/usb/audio.h b/include/linux/usb/audio.h
index 4d3e450e2b03..5d646c388752 100644
--- a/include/linux/usb/audio.h
+++ b/include/linux/usb/audio.h
@@ -13,6 +13,9 @@
13 * Comments below reference relevant sections of that document: 13 * Comments below reference relevant sections of that document:
14 * 14 *
15 * http://www.usb.org/developers/devclass_docs/audio10.pdf 15 * http://www.usb.org/developers/devclass_docs/audio10.pdf
16 *
17 * Types and defines in this file are either specific to version 1.0 of
18 * this standard or common for newer versions.
16 */ 19 */
17 20
18#ifndef __LINUX_USB_AUDIO_H 21#ifndef __LINUX_USB_AUDIO_H
@@ -20,14 +23,15 @@
20 23
21#include <linux/types.h> 24#include <linux/types.h>
22 25
26/* bInterfaceProtocol values to denote the version of the standard used */
27#define UAC_VERSION_1 0x00
28#define UAC_VERSION_2 0x20
29
23/* A.2 Audio Interface Subclass Codes */ 30/* A.2 Audio Interface Subclass Codes */
24#define USB_SUBCLASS_AUDIOCONTROL 0x01 31#define USB_SUBCLASS_AUDIOCONTROL 0x01
25#define USB_SUBCLASS_AUDIOSTREAMING 0x02 32#define USB_SUBCLASS_AUDIOSTREAMING 0x02
26#define USB_SUBCLASS_MIDISTREAMING 0x03 33#define USB_SUBCLASS_MIDISTREAMING 0x03
27 34
28#define UAC_VERSION_1 0x00
29#define UAC_VERSION_2 0x20
30
31/* A.5 Audio Class-Specific AC Interface Descriptor Subtypes */ 35/* A.5 Audio Class-Specific AC Interface Descriptor Subtypes */
32#define UAC_HEADER 0x01 36#define UAC_HEADER 0x01
33#define UAC_INPUT_TERMINAL 0x02 37#define UAC_INPUT_TERMINAL 0x02
@@ -38,15 +42,6 @@
38#define UAC_PROCESSING_UNIT_V1 0x07 42#define UAC_PROCESSING_UNIT_V1 0x07
39#define UAC_EXTENSION_UNIT_V1 0x08 43#define UAC_EXTENSION_UNIT_V1 0x08
40 44
41/* UAC v2.0 types */
42#define UAC_EFFECT_UNIT 0x07
43#define UAC_PROCESSING_UNIT_V2 0x08
44#define UAC_EXTENSION_UNIT_V2 0x09
45#define UAC_CLOCK_SOURCE 0x0a
46#define UAC_CLOCK_SELECTOR 0x0b
47#define UAC_CLOCK_MULTIPLIER 0x0c
48#define UAC_SAMPLE_RATE_CONVERTER 0x0d
49
50/* A.6 Audio Class-Specific AS Interface Descriptor Subtypes */ 45/* A.6 Audio Class-Specific AS Interface Descriptor Subtypes */
51#define UAC_AS_GENERAL 0x01 46#define UAC_AS_GENERAL 0x01
52#define UAC_FORMAT_TYPE 0x02 47#define UAC_FORMAT_TYPE 0x02
@@ -78,10 +73,6 @@
78 73
79#define UAC_GET_STAT 0xff 74#define UAC_GET_STAT 0xff
80 75
81/* Audio class v2.0 handles all the parameter calls differently */
82#define UAC2_CS_CUR 0x01
83#define UAC2_CS_RANGE 0x02
84
85/* MIDI - A.1 MS Class-Specific Interface Descriptor Subtypes */ 76/* MIDI - A.1 MS Class-Specific Interface Descriptor Subtypes */
86#define UAC_MS_HEADER 0x01 77#define UAC_MS_HEADER 0x01
87#define UAC_MIDI_IN_JACK 0x02 78#define UAC_MIDI_IN_JACK 0x02
@@ -110,7 +101,7 @@ struct uac_ac_header_descriptor_v1 {
110#define UAC_DT_AC_HEADER_SIZE(n) (8 + (n)) 101#define UAC_DT_AC_HEADER_SIZE(n) (8 + (n))
111 102
112/* As above, but more useful for defining your own descriptors: */ 103/* As above, but more useful for defining your own descriptors: */
113#define DECLARE_UAC_AC_HEADER_DESCRIPTOR(n) \ 104#define DECLARE_UAC_AC_HEADER_DESCRIPTOR(n) \
114struct uac_ac_header_descriptor_v1_##n { \ 105struct uac_ac_header_descriptor_v1_##n { \
115 __u8 bLength; \ 106 __u8 bLength; \
116 __u8 bDescriptorType; \ 107 __u8 bDescriptorType; \
@@ -178,7 +169,7 @@ struct uac_output_terminal_descriptor_v1 {
178#define UAC_DT_FEATURE_UNIT_SIZE(ch) (7 + ((ch) + 1) * 2) 169#define UAC_DT_FEATURE_UNIT_SIZE(ch) (7 + ((ch) + 1) * 2)
179 170
180/* As above, but more useful for defining your own descriptors: */ 171/* As above, but more useful for defining your own descriptors: */
181#define DECLARE_UAC_FEATURE_UNIT_DESCRIPTOR(ch) \ 172#define DECLARE_UAC_FEATURE_UNIT_DESCRIPTOR(ch) \
182struct uac_feature_unit_descriptor_##ch { \ 173struct uac_feature_unit_descriptor_##ch { \
183 __u8 bLength; \ 174 __u8 bLength; \
184 __u8 bDescriptorType; \ 175 __u8 bDescriptorType; \
@@ -190,6 +181,156 @@ struct uac_feature_unit_descriptor_##ch { \
190 __u8 iFeature; \ 181 __u8 iFeature; \
191} __attribute__ ((packed)) 182} __attribute__ ((packed))
192 183
184/* 4.3.2.3 Mixer Unit Descriptor */
185struct uac_mixer_unit_descriptor {
186 __u8 bLength;
187 __u8 bDescriptorType;
188 __u8 bDescriptorSubtype;
189 __u8 bUnitID;
190 __u8 bNrInPins;
191 __u8 baSourceID[];
192} __attribute__ ((packed));
193
194static inline __u8 uac_mixer_unit_bNrChannels(struct uac_mixer_unit_descriptor *desc)
195{
196 return desc->baSourceID[desc->bNrInPins];
197}
198
199static inline __u32 uac_mixer_unit_wChannelConfig(struct uac_mixer_unit_descriptor *desc,
200 int protocol)
201{
202 if (protocol == UAC_VERSION_1)
203 return (desc->baSourceID[desc->bNrInPins + 2] << 8) |
204 desc->baSourceID[desc->bNrInPins + 1];
205 else
206 return (desc->baSourceID[desc->bNrInPins + 4] << 24) |
207 (desc->baSourceID[desc->bNrInPins + 3] << 16) |
208 (desc->baSourceID[desc->bNrInPins + 2] << 8) |
209 (desc->baSourceID[desc->bNrInPins + 1]);
210}
211
212static inline __u8 uac_mixer_unit_iChannelNames(struct uac_mixer_unit_descriptor *desc,
213 int protocol)
214{
215 return (protocol == UAC_VERSION_1) ?
216 desc->baSourceID[desc->bNrInPins + 3] :
217 desc->baSourceID[desc->bNrInPins + 5];
218}
219
220static inline __u8 *uac_mixer_unit_bmControls(struct uac_mixer_unit_descriptor *desc,
221 int protocol)
222{
223 return (protocol == UAC_VERSION_1) ?
224 &desc->baSourceID[desc->bNrInPins + 4] :
225 &desc->baSourceID[desc->bNrInPins + 6];
226}
227
228static inline __u8 uac_mixer_unit_iMixer(struct uac_mixer_unit_descriptor *desc)
229{
230 __u8 *raw = (__u8 *) desc;
231 return raw[desc->bLength - 1];
232}
233
234/* 4.3.2.4 Selector Unit Descriptor */
235struct uac_selector_unit_descriptor {
236 __u8 bLength;
237 __u8 bDescriptorType;
238 __u8 bDescriptorSubtype;
239 __u8 bUintID;
240 __u8 bNrInPins;
241 __u8 baSourceID[];
242} __attribute__ ((packed));
243
244static inline __u8 uac_selector_unit_iSelector(struct uac_selector_unit_descriptor *desc)
245{
246 __u8 *raw = (__u8 *) desc;
247 return raw[9 + desc->bLength - 1];
248}
249
250/* 4.3.2.5 Feature Unit Descriptor */
251struct uac_feature_unit_descriptor {
252 __u8 bLength;
253 __u8 bDescriptorType;
254 __u8 bDescriptorSubtype;
255 __u8 bUnitID;
256 __u8 bSourceID;
257 __u8 bControlSize;
258 __u8 bmaControls[0]; /* variable length */
259} __attribute__((packed));
260
261static inline __u8 uac_feature_unit_iFeature(struct uac_feature_unit_descriptor *desc)
262{
263 __u8 *raw = (__u8 *) desc;
264 return raw[desc->bLength - 1];
265}
266
267/* 4.3.2.6 Processing Unit Descriptors */
268struct uac_processing_unit_descriptor {
269 __u8 bLength;
270 __u8 bDescriptorType;
271 __u8 bDescriptorSubtype;
272 __u8 bUnitID;
273 __u16 wProcessType;
274 __u8 bNrInPins;
275 __u8 baSourceID[];
276} __attribute__ ((packed));
277
278static inline __u8 uac_processing_unit_bNrChannels(struct uac_processing_unit_descriptor *desc)
279{
280 return desc->baSourceID[desc->bNrInPins];
281}
282
283static inline __u32 uac_processing_unit_wChannelConfig(struct uac_processing_unit_descriptor *desc,
284 int protocol)
285{
286 if (protocol == UAC_VERSION_1)
287 return (desc->baSourceID[desc->bNrInPins + 2] << 8) |
288 desc->baSourceID[desc->bNrInPins + 1];
289 else
290 return (desc->baSourceID[desc->bNrInPins + 4] << 24) |
291 (desc->baSourceID[desc->bNrInPins + 3] << 16) |
292 (desc->baSourceID[desc->bNrInPins + 2] << 8) |
293 (desc->baSourceID[desc->bNrInPins + 1]);
294}
295
296static inline __u8 uac_processing_unit_iChannelNames(struct uac_processing_unit_descriptor *desc,
297 int protocol)
298{
299 return (protocol == UAC_VERSION_1) ?
300 desc->baSourceID[desc->bNrInPins + 3] :
301 desc->baSourceID[desc->bNrInPins + 5];
302}
303
304static inline __u8 uac_processing_unit_bControlSize(struct uac_processing_unit_descriptor *desc,
305 int protocol)
306{
307 return (protocol == UAC_VERSION_1) ?
308 desc->baSourceID[desc->bNrInPins + 4] :
309 desc->baSourceID[desc->bNrInPins + 6];
310}
311
312static inline __u8 *uac_processing_unit_bmControls(struct uac_processing_unit_descriptor *desc,
313 int protocol)
314{
315 return (protocol == UAC_VERSION_1) ?
316 &desc->baSourceID[desc->bNrInPins + 5] :
317 &desc->baSourceID[desc->bNrInPins + 7];
318}
319
320static inline __u8 uac_processing_unit_iProcessing(struct uac_processing_unit_descriptor *desc,
321 int protocol)
322{
323 __u8 control_size = uac_processing_unit_bControlSize(desc, protocol);
324 return desc->baSourceID[desc->bNrInPins + control_size];
325}
326
327static inline __u8 *uac_processing_unit_specific(struct uac_processing_unit_descriptor *desc,
328 int protocol)
329{
330 __u8 control_size = uac_processing_unit_bControlSize(desc, protocol);
331 return &desc->baSourceID[desc->bNrInPins + control_size + 1];
332}
333
193/* 4.5.2 Class-Specific AS Interface Descriptor */ 334/* 4.5.2 Class-Specific AS Interface Descriptor */
194struct uac_as_header_descriptor_v1 { 335struct uac_as_header_descriptor_v1 {
195 __u8 bLength; /* in bytes: 7 */ 336 __u8 bLength; /* in bytes: 7 */
@@ -200,19 +341,6 @@ struct uac_as_header_descriptor_v1 {
200 __le16 wFormatTag; /* The Audio Data Format */ 341 __le16 wFormatTag; /* The Audio Data Format */
201} __attribute__ ((packed)); 342} __attribute__ ((packed));
202 343
203struct uac_as_header_descriptor_v2 {
204 __u8 bLength;
205 __u8 bDescriptorType;
206 __u8 bDescriptorSubtype;
207 __u8 bTerminalLink;
208 __u8 bmControls;
209 __u8 bFormatType;
210 __u32 bmFormats;
211 __u8 bNrChannels;
212 __u32 bmChannelConfig;
213 __u8 iChannelNames;
214} __attribute__((packed));
215
216#define UAC_DT_AS_HEADER_SIZE 7 344#define UAC_DT_AS_HEADER_SIZE 7
217 345
218/* Formats - A.1.1 Audio Data Format Type I Codes */ 346/* Formats - A.1.1 Audio Data Format Type I Codes */
@@ -250,7 +378,7 @@ struct uac_format_type_i_discrete_descriptor {
250 __u8 tSamFreq[][3]; 378 __u8 tSamFreq[][3];
251} __attribute__ ((packed)); 379} __attribute__ ((packed));
252 380
253#define DECLARE_UAC_FORMAT_TYPE_I_DISCRETE_DESC(n) \ 381#define DECLARE_UAC_FORMAT_TYPE_I_DISCRETE_DESC(n) \
254struct uac_format_type_i_discrete_descriptor_##n { \ 382struct uac_format_type_i_discrete_descriptor_##n { \
255 __u8 bLength; \ 383 __u8 bLength; \
256 __u8 bDescriptorType; \ 384 __u8 bDescriptorType; \
@@ -277,7 +405,6 @@ struct uac_format_type_i_ext_descriptor {
277 __u8 bSideBandProtocol; 405 __u8 bSideBandProtocol;
278} __attribute__((packed)); 406} __attribute__((packed));
279 407
280
281/* Formats - Audio Data Format Type I Codes */ 408/* Formats - Audio Data Format Type I Codes */
282 409
283#define UAC_FORMAT_TYPE_II_MPEG 0x1001 410#define UAC_FORMAT_TYPE_II_MPEG 0x1001
@@ -329,38 +456,15 @@ struct uac_iso_endpoint_descriptor {
329 __u8 bmAttributes; 456 __u8 bmAttributes;
330 __u8 bLockDelayUnits; 457 __u8 bLockDelayUnits;
331 __le16 wLockDelay; 458 __le16 wLockDelay;
332}; 459} __attribute__((packed));
333#define UAC_ISO_ENDPOINT_DESC_SIZE 7 460#define UAC_ISO_ENDPOINT_DESC_SIZE 7
334 461
335#define UAC_EP_CS_ATTR_SAMPLE_RATE 0x01 462#define UAC_EP_CS_ATTR_SAMPLE_RATE 0x01
336#define UAC_EP_CS_ATTR_PITCH_CONTROL 0x02 463#define UAC_EP_CS_ATTR_PITCH_CONTROL 0x02
337#define UAC_EP_CS_ATTR_FILL_MAX 0x80 464#define UAC_EP_CS_ATTR_FILL_MAX 0x80
338 465
339/* Audio class v2.0: CLOCK_SOURCE descriptor */
340
341struct uac_clock_source_descriptor {
342 __u8 bLength;
343 __u8 bDescriptorType;
344 __u8 bDescriptorSubtype;
345 __u8 bClockID;
346 __u8 bmAttributes;
347 __u8 bmControls;
348 __u8 bAssocTerminal;
349 __u8 iClockSource;
350} __attribute__((packed));
351
352/* A.10.2 Feature Unit Control Selectors */ 466/* A.10.2 Feature Unit Control Selectors */
353 467
354struct uac_feature_unit_descriptor {
355 __u8 bLength;
356 __u8 bDescriptorType;
357 __u8 bDescriptorSubtype;
358 __u8 bUnitID;
359 __u8 bSourceID;
360 __u8 bControlSize;
361 __u8 controls[0]; /* variable length */
362} __attribute__((packed));
363
364#define UAC_FU_CONTROL_UNDEFINED 0x00 468#define UAC_FU_CONTROL_UNDEFINED 0x00
365#define UAC_MUTE_CONTROL 0x01 469#define UAC_MUTE_CONTROL 0x01
366#define UAC_VOLUME_CONTROL 0x02 470#define UAC_VOLUME_CONTROL 0x02
@@ -384,6 +488,21 @@ struct uac_feature_unit_descriptor {
384#define UAC_FU_BASS_BOOST (1 << (UAC_BASS_BOOST_CONTROL - 1)) 488#define UAC_FU_BASS_BOOST (1 << (UAC_BASS_BOOST_CONTROL - 1))
385#define UAC_FU_LOUDNESS (1 << (UAC_LOUDNESS_CONTROL - 1)) 489#define UAC_FU_LOUDNESS (1 << (UAC_LOUDNESS_CONTROL - 1))
386 490
491/* status word format (3.7.1.1) */
492
493#define UAC1_STATUS_TYPE_ORIG_MASK 0x0f
494#define UAC1_STATUS_TYPE_ORIG_AUDIO_CONTROL_IF 0x0
495#define UAC1_STATUS_TYPE_ORIG_AUDIO_STREAM_IF 0x1
496#define UAC1_STATUS_TYPE_ORIG_AUDIO_STREAM_EP 0x2
497
498#define UAC1_STATUS_TYPE_IRQ_PENDING (1 << 7)
499#define UAC1_STATUS_TYPE_MEM_CHANGED (1 << 6)
500
501struct uac1_status_word {
502 __u8 bStatusType;
503 __u8 bOriginator;
504} __attribute__((packed));
505
387#ifdef __KERNEL__ 506#ifdef __KERNEL__
388 507
389struct usb_audio_control { 508struct usb_audio_control {
diff --git a/include/linux/usb/cdc.h b/include/linux/usb/cdc.h
index c24124a42ce5..c117a68d04a7 100644
--- a/include/linux/usb/cdc.h
+++ b/include/linux/usb/cdc.h
@@ -18,6 +18,7 @@
18#define USB_CDC_SUBCLASS_MDLM 0x0a 18#define USB_CDC_SUBCLASS_MDLM 0x0a
19#define USB_CDC_SUBCLASS_OBEX 0x0b 19#define USB_CDC_SUBCLASS_OBEX 0x0b
20#define USB_CDC_SUBCLASS_EEM 0x0c 20#define USB_CDC_SUBCLASS_EEM 0x0c
21#define USB_CDC_SUBCLASS_NCM 0x0d
21 22
22#define USB_CDC_PROTO_NONE 0 23#define USB_CDC_PROTO_NONE 0
23 24
@@ -49,6 +50,7 @@
49#define USB_CDC_MDLM_DETAIL_TYPE 0x13 /* mdlm_detail_desc */ 50#define USB_CDC_MDLM_DETAIL_TYPE 0x13 /* mdlm_detail_desc */
50#define USB_CDC_DMM_TYPE 0x14 51#define USB_CDC_DMM_TYPE 0x14
51#define USB_CDC_OBEX_TYPE 0x15 52#define USB_CDC_OBEX_TYPE 0x15
53#define USB_CDC_NCM_TYPE 0x1a
52 54
53/* "Header Functional Descriptor" from CDC spec 5.2.3.1 */ 55/* "Header Functional Descriptor" from CDC spec 5.2.3.1 */
54struct usb_cdc_header_desc { 56struct usb_cdc_header_desc {
@@ -174,6 +176,15 @@ struct usb_cdc_obex_desc {
174 __le16 bcdVersion; 176 __le16 bcdVersion;
175} __attribute__ ((packed)); 177} __attribute__ ((packed));
176 178
179/* "NCM Control Model Functional Descriptor" */
180struct usb_cdc_ncm_desc {
181 __u8 bLength;
182 __u8 bDescriptorType;
183 __u8 bDescriptorSubType;
184
185 __le16 bcdNcmVersion;
186 __u8 bmNetworkCapabilities;
187} __attribute__ ((packed));
177/*-------------------------------------------------------------------------*/ 188/*-------------------------------------------------------------------------*/
178 189
179/* 190/*
@@ -197,6 +208,17 @@ struct usb_cdc_obex_desc {
197#define USB_CDC_GET_ETHERNET_PM_PATTERN_FILTER 0x42 208#define USB_CDC_GET_ETHERNET_PM_PATTERN_FILTER 0x42
198#define USB_CDC_SET_ETHERNET_PACKET_FILTER 0x43 209#define USB_CDC_SET_ETHERNET_PACKET_FILTER 0x43
199#define USB_CDC_GET_ETHERNET_STATISTIC 0x44 210#define USB_CDC_GET_ETHERNET_STATISTIC 0x44
211#define USB_CDC_GET_NTB_PARAMETERS 0x80
212#define USB_CDC_GET_NET_ADDRESS 0x81
213#define USB_CDC_SET_NET_ADDRESS 0x82
214#define USB_CDC_GET_NTB_FORMAT 0x83
215#define USB_CDC_SET_NTB_FORMAT 0x84
216#define USB_CDC_GET_NTB_INPUT_SIZE 0x85
217#define USB_CDC_SET_NTB_INPUT_SIZE 0x86
218#define USB_CDC_GET_MAX_DATAGRAM_SIZE 0x87
219#define USB_CDC_SET_MAX_DATAGRAM_SIZE 0x88
220#define USB_CDC_GET_CRC_MODE 0x89
221#define USB_CDC_SET_CRC_MODE 0x8a
200 222
201/* Line Coding Structure from CDC spec 6.2.13 */ 223/* Line Coding Structure from CDC spec 6.2.13 */
202struct usb_cdc_line_coding { 224struct usb_cdc_line_coding {
@@ -247,4 +269,76 @@ struct usb_cdc_notification {
247 __le16 wLength; 269 __le16 wLength;
248} __attribute__ ((packed)); 270} __attribute__ ((packed));
249 271
272/*-------------------------------------------------------------------------*/
273
274/*
275 * Class Specific structures and constants
276 *
277 * CDC NCM parameter structure, CDC NCM subclass 6.2.1
278 *
279 */
280
281struct usb_cdc_ncm_ntb_parameter {
282 __le16 wLength;
283 __le16 bmNtbFormatSupported;
284 __le32 dwNtbInMaxSize;
285 __le16 wNdpInDivisor;
286 __le16 wNdpInPayloadRemainder;
287 __le16 wNdpInAlignment;
288 __le16 wPadding1;
289 __le32 dwNtbOutMaxSize;
290 __le16 wNdpOutDivisor;
291 __le16 wNdpOutPayloadRemainder;
292 __le16 wNdpOutAlignment;
293 __le16 wPadding2;
294} __attribute__ ((packed));
295
296/*
297 * CDC NCM transfer headers, CDC NCM subclass 3.2
298 */
299
300#define NCM_NTH16_SIGN 0x484D434E /* NCMH */
301#define NCM_NTH32_SIGN 0x686D636E /* ncmh */
302
303struct usb_cdc_ncm_nth16 {
304 __le32 dwSignature;
305 __le16 wHeaderLength;
306 __le16 wSequence;
307 __le16 wBlockLength;
308 __le16 wFpIndex;
309} __attribute__ ((packed));
310
311struct usb_cdc_ncm_nth32 {
312 __le32 dwSignature;
313 __le16 wHeaderLength;
314 __le16 wSequence;
315 __le32 dwBlockLength;
316 __le32 dwFpIndex;
317} __attribute__ ((packed));
318
319/*
320 * CDC NCM datagram pointers, CDC NCM subclass 3.3
321 */
322
323#define NCM_NDP16_CRC_SIGN 0x314D434E /* NCM1 */
324#define NCM_NDP16_NOCRC_SIGN 0x304D434E /* NCM0 */
325#define NCM_NDP32_CRC_SIGN 0x316D636E /* ncm1 */
326#define NCM_NDP32_NOCRC_SIGN 0x306D636E /* ncm0 */
327
328struct usb_cdc_ncm_ndp16 {
329 __le32 dwSignature;
330 __le16 wLength;
331 __le16 wNextFpIndex;
332 __u8 data[0];
333} __attribute__ ((packed));
334
335struct usb_cdc_ncm_ndp32 {
336 __le32 dwSignature;
337 __le16 wLength;
338 __le16 wReserved6;
339 __le32 dwNextFpIndex;
340 __le32 dwReserved12;
341 __u8 data[0];
342} __attribute__ ((packed));
343
250#endif /* __LINUX_USB_CDC_H */ 344#endif /* __LINUX_USB_CDC_H */
diff --git a/include/linux/usb/ch11.h b/include/linux/usb/ch11.h
new file mode 100644
index 000000000000..119194c85d10
--- /dev/null
+++ b/include/linux/usb/ch11.h
@@ -0,0 +1,167 @@
1/*
2 * This file holds Hub protocol constants and data structures that are
3 * defined in chapter 11 (Hub Specification) of the USB 2.0 specification.
4 *
5 * It is used/shared between the USB core, the HCDs and couple of other USB
6 * drivers.
7 */
8
9#ifndef __LINUX_CH11_H
10#define __LINUX_CH11_H
11
12#include <linux/types.h> /* __u8 etc */
13
14/*
15 * Hub request types
16 */
17
18#define USB_RT_HUB (USB_TYPE_CLASS | USB_RECIP_DEVICE)
19#define USB_RT_PORT (USB_TYPE_CLASS | USB_RECIP_OTHER)
20
21/*
22 * Hub class requests
23 * See USB 2.0 spec Table 11-16
24 */
25#define HUB_CLEAR_TT_BUFFER 8
26#define HUB_RESET_TT 9
27#define HUB_GET_TT_STATE 10
28#define HUB_STOP_TT 11
29
30/*
31 * Hub Class feature numbers
32 * See USB 2.0 spec Table 11-17
33 */
34#define C_HUB_LOCAL_POWER 0
35#define C_HUB_OVER_CURRENT 1
36
37/*
38 * Port feature numbers
39 * See USB 2.0 spec Table 11-17
40 */
41#define USB_PORT_FEAT_CONNECTION 0
42#define USB_PORT_FEAT_ENABLE 1
43#define USB_PORT_FEAT_SUSPEND 2 /* L2 suspend */
44#define USB_PORT_FEAT_OVER_CURRENT 3
45#define USB_PORT_FEAT_RESET 4
46#define USB_PORT_FEAT_L1 5 /* L1 suspend */
47#define USB_PORT_FEAT_POWER 8
48#define USB_PORT_FEAT_LOWSPEED 9 /* Should never be used */
49#define USB_PORT_FEAT_C_CONNECTION 16
50#define USB_PORT_FEAT_C_ENABLE 17
51#define USB_PORT_FEAT_C_SUSPEND 18
52#define USB_PORT_FEAT_C_OVER_CURRENT 19
53#define USB_PORT_FEAT_C_RESET 20
54#define USB_PORT_FEAT_TEST 21
55#define USB_PORT_FEAT_INDICATOR 22
56#define USB_PORT_FEAT_C_PORT_L1 23
57
58/*
59 * Hub Status and Hub Change results
60 * See USB 2.0 spec Table 11-19 and Table 11-20
61 */
62struct usb_port_status {
63 __le16 wPortStatus;
64 __le16 wPortChange;
65} __attribute__ ((packed));
66
67/*
68 * wPortStatus bit field
69 * See USB 2.0 spec Table 11-21
70 */
71#define USB_PORT_STAT_CONNECTION 0x0001
72#define USB_PORT_STAT_ENABLE 0x0002
73#define USB_PORT_STAT_SUSPEND 0x0004
74#define USB_PORT_STAT_OVERCURRENT 0x0008
75#define USB_PORT_STAT_RESET 0x0010
76#define USB_PORT_STAT_L1 0x0020
77/* bits 6 to 7 are reserved */
78#define USB_PORT_STAT_POWER 0x0100
79#define USB_PORT_STAT_LOW_SPEED 0x0200
80#define USB_PORT_STAT_HIGH_SPEED 0x0400
81#define USB_PORT_STAT_TEST 0x0800
82#define USB_PORT_STAT_INDICATOR 0x1000
83/* bits 13 to 15 are reserved */
84#define USB_PORT_STAT_SUPER_SPEED 0x8000 /* Linux-internal */
85
86/*
87 * wPortChange bit field
88 * See USB 2.0 spec Table 11-22
89 * Bits 0 to 4 shown, bits 5 to 15 are reserved
90 */
91#define USB_PORT_STAT_C_CONNECTION 0x0001
92#define USB_PORT_STAT_C_ENABLE 0x0002
93#define USB_PORT_STAT_C_SUSPEND 0x0004
94#define USB_PORT_STAT_C_OVERCURRENT 0x0008
95#define USB_PORT_STAT_C_RESET 0x0010
96#define USB_PORT_STAT_C_L1 0x0020
97
98/*
99 * wHubCharacteristics (masks)
100 * See USB 2.0 spec Table 11-13, offset 3
101 */
102#define HUB_CHAR_LPSM 0x0003 /* D1 .. D0 */
103#define HUB_CHAR_COMPOUND 0x0004 /* D2 */
104#define HUB_CHAR_OCPM 0x0018 /* D4 .. D3 */
105#define HUB_CHAR_TTTT 0x0060 /* D6 .. D5 */
106#define HUB_CHAR_PORTIND 0x0080 /* D7 */
107
108struct usb_hub_status {
109 __le16 wHubStatus;
110 __le16 wHubChange;
111} __attribute__ ((packed));
112
113/*
114 * Hub Status & Hub Change bit masks
115 * See USB 2.0 spec Table 11-19 and Table 11-20
116 * Bits 0 and 1 for wHubStatus and wHubChange
117 * Bits 2 to 15 are reserved for both
118 */
119#define HUB_STATUS_LOCAL_POWER 0x0001
120#define HUB_STATUS_OVERCURRENT 0x0002
121#define HUB_CHANGE_LOCAL_POWER 0x0001
122#define HUB_CHANGE_OVERCURRENT 0x0002
123
124
125/*
126 * Hub descriptor
127 * See USB 2.0 spec Table 11-13
128 */
129
130#define USB_DT_HUB (USB_TYPE_CLASS | 0x09)
131#define USB_DT_HUB_NONVAR_SIZE 7
132
133struct usb_hub_descriptor {
134 __u8 bDescLength;
135 __u8 bDescriptorType;
136 __u8 bNbrPorts;
137 __le16 wHubCharacteristics;
138 __u8 bPwrOn2PwrGood;
139 __u8 bHubContrCurrent;
140 /* add 1 bit for hub status change; round to bytes */
141 __u8 DeviceRemovable[(USB_MAXCHILDREN + 1 + 7) / 8];
142 __u8 PortPwrCtrlMask[(USB_MAXCHILDREN + 1 + 7) / 8];
143} __attribute__ ((packed));
144
145
146/* port indicator status selectors, tables 11-7 and 11-25 */
147#define HUB_LED_AUTO 0
148#define HUB_LED_AMBER 1
149#define HUB_LED_GREEN 2
150#define HUB_LED_OFF 3
151
152enum hub_led_mode {
153 INDICATOR_AUTO = 0,
154 INDICATOR_CYCLE,
155 /* software blinks for attention: software, hardware, reserved */
156 INDICATOR_GREEN_BLINK, INDICATOR_GREEN_BLINK_OFF,
157 INDICATOR_AMBER_BLINK, INDICATOR_AMBER_BLINK_OFF,
158 INDICATOR_ALT_BLINK, INDICATOR_ALT_BLINK_OFF
159} __attribute__ ((packed));
160
161/* Transaction Translator Think Times, in bits */
162#define HUB_TTTT_8_BITS 0x00
163#define HUB_TTTT_16_BITS 0x20
164#define HUB_TTTT_24_BITS 0x40
165#define HUB_TTTT_32_BITS 0x60
166
167#endif /* __LINUX_CH11_H */
diff --git a/include/linux/usb/ch9.h b/include/linux/usb/ch9.h
index e58369ff8168..da2ed77d3e8d 100644
--- a/include/linux/usb/ch9.h
+++ b/include/linux/usb/ch9.h
@@ -191,6 +191,8 @@ struct usb_ctrlrequest {
191#define USB_DT_WIRE_ADAPTER 0x21 191#define USB_DT_WIRE_ADAPTER 0x21
192#define USB_DT_RPIPE 0x22 192#define USB_DT_RPIPE 0x22
193#define USB_DT_CS_RADIO_CONTROL 0x23 193#define USB_DT_CS_RADIO_CONTROL 0x23
194/* From the T10 UAS specification */
195#define USB_DT_PIPE_USAGE 0x24
194/* From the USB 3.0 spec */ 196/* From the USB 3.0 spec */
195#define USB_DT_SS_ENDPOINT_COMP 0x30 197#define USB_DT_SS_ENDPOINT_COMP 0x30
196 198
@@ -475,7 +477,7 @@ static inline int usb_endpoint_xfer_isoc(
475static inline int usb_endpoint_is_bulk_in( 477static inline int usb_endpoint_is_bulk_in(
476 const struct usb_endpoint_descriptor *epd) 478 const struct usb_endpoint_descriptor *epd)
477{ 479{
478 return (usb_endpoint_xfer_bulk(epd) && usb_endpoint_dir_in(epd)); 480 return usb_endpoint_xfer_bulk(epd) && usb_endpoint_dir_in(epd);
479} 481}
480 482
481/** 483/**
@@ -488,7 +490,7 @@ static inline int usb_endpoint_is_bulk_in(
488static inline int usb_endpoint_is_bulk_out( 490static inline int usb_endpoint_is_bulk_out(
489 const struct usb_endpoint_descriptor *epd) 491 const struct usb_endpoint_descriptor *epd)
490{ 492{
491 return (usb_endpoint_xfer_bulk(epd) && usb_endpoint_dir_out(epd)); 493 return usb_endpoint_xfer_bulk(epd) && usb_endpoint_dir_out(epd);
492} 494}
493 495
494/** 496/**
@@ -501,7 +503,7 @@ static inline int usb_endpoint_is_bulk_out(
501static inline int usb_endpoint_is_int_in( 503static inline int usb_endpoint_is_int_in(
502 const struct usb_endpoint_descriptor *epd) 504 const struct usb_endpoint_descriptor *epd)
503{ 505{
504 return (usb_endpoint_xfer_int(epd) && usb_endpoint_dir_in(epd)); 506 return usb_endpoint_xfer_int(epd) && usb_endpoint_dir_in(epd);
505} 507}
506 508
507/** 509/**
@@ -514,7 +516,7 @@ static inline int usb_endpoint_is_int_in(
514static inline int usb_endpoint_is_int_out( 516static inline int usb_endpoint_is_int_out(
515 const struct usb_endpoint_descriptor *epd) 517 const struct usb_endpoint_descriptor *epd)
516{ 518{
517 return (usb_endpoint_xfer_int(epd) && usb_endpoint_dir_out(epd)); 519 return usb_endpoint_xfer_int(epd) && usb_endpoint_dir_out(epd);
518} 520}
519 521
520/** 522/**
@@ -527,7 +529,7 @@ static inline int usb_endpoint_is_int_out(
527static inline int usb_endpoint_is_isoc_in( 529static inline int usb_endpoint_is_isoc_in(
528 const struct usb_endpoint_descriptor *epd) 530 const struct usb_endpoint_descriptor *epd)
529{ 531{
530 return (usb_endpoint_xfer_isoc(epd) && usb_endpoint_dir_in(epd)); 532 return usb_endpoint_xfer_isoc(epd) && usb_endpoint_dir_in(epd);
531} 533}
532 534
533/** 535/**
@@ -540,7 +542,7 @@ static inline int usb_endpoint_is_isoc_in(
540static inline int usb_endpoint_is_isoc_out( 542static inline int usb_endpoint_is_isoc_out(
541 const struct usb_endpoint_descriptor *epd) 543 const struct usb_endpoint_descriptor *epd)
542{ 544{
543 return (usb_endpoint_xfer_isoc(epd) && usb_endpoint_dir_out(epd)); 545 return usb_endpoint_xfer_isoc(epd) && usb_endpoint_dir_out(epd);
544} 546}
545 547
546/*-------------------------------------------------------------------------*/ 548/*-------------------------------------------------------------------------*/
@@ -556,6 +558,8 @@ struct usb_ss_ep_comp_descriptor {
556} __attribute__ ((packed)); 558} __attribute__ ((packed));
557 559
558#define USB_DT_SS_EP_COMP_SIZE 6 560#define USB_DT_SS_EP_COMP_SIZE 6
561/* Bits 4:0 of bmAttributes if this is a bulk endpoint */
562#define USB_SS_MAX_STREAMS(p) (1 << (p & 0x1f))
559 563
560/*-------------------------------------------------------------------------*/ 564/*-------------------------------------------------------------------------*/
561 565
diff --git a/include/linux/usb/composite.h b/include/linux/usb/composite.h
index 738ea1a691cb..139353efad34 100644
--- a/include/linux/usb/composite.h
+++ b/include/linux/usb/composite.h
@@ -326,6 +326,7 @@ struct usb_composite_dev {
326 326
327 /* private: */ 327 /* private: */
328 /* internals */ 328 /* internals */
329 unsigned int suspended:1;
329 struct usb_device_descriptor desc; 330 struct usb_device_descriptor desc;
330 struct list_head configs; 331 struct list_head configs;
331 struct usb_composite_driver *driver; 332 struct usb_composite_driver *driver;
diff --git a/include/linux/usb/ehci_def.h b/include/linux/usb/ehci_def.h
index af4b86f3aca3..80287af2a738 100644
--- a/include/linux/usb/ehci_def.h
+++ b/include/linux/usb/ehci_def.h
@@ -45,7 +45,7 @@ struct ehci_caps {
45#define HCC_CANPARK(p) ((p)&(1 << 2)) /* true: can park on async qh */ 45#define HCC_CANPARK(p) ((p)&(1 << 2)) /* true: can park on async qh */
46#define HCC_PGM_FRAMELISTLEN(p) ((p)&(1 << 1)) /* true: periodic_size changes*/ 46#define HCC_PGM_FRAMELISTLEN(p) ((p)&(1 << 1)) /* true: periodic_size changes*/
47#define HCC_64BIT_ADDR(p) ((p)&(1)) /* true: can use 64-bit addr */ 47#define HCC_64BIT_ADDR(p) ((p)&(1)) /* true: can use 64-bit addr */
48 u8 portroute [8]; /* nibbles for routing - offset 0xC */ 48 u8 portroute[8]; /* nibbles for routing - offset 0xC */
49} __attribute__ ((packed)); 49} __attribute__ ((packed));
50 50
51 51
@@ -92,14 +92,14 @@ struct ehci_regs {
92 /* ASYNCLISTADDR: offset 0x18 */ 92 /* ASYNCLISTADDR: offset 0x18 */
93 u32 async_next; /* address of next async queue head */ 93 u32 async_next; /* address of next async queue head */
94 94
95 u32 reserved [9]; 95 u32 reserved[9];
96 96
97 /* CONFIGFLAG: offset 0x40 */ 97 /* CONFIGFLAG: offset 0x40 */
98 u32 configured_flag; 98 u32 configured_flag;
99#define FLAG_CF (1<<0) /* true: we'll support "high speed" */ 99#define FLAG_CF (1<<0) /* true: we'll support "high speed" */
100 100
101 /* PORTSC: offset 0x44 */ 101 /* PORTSC: offset 0x44 */
102 u32 port_status [0]; /* up to N_PORTS */ 102 u32 port_status[0]; /* up to N_PORTS */
103/* 31:23 reserved */ 103/* 31:23 reserved */
104#define PORT_WKOC_E (1<<22) /* wake on overcurrent (enable) */ 104#define PORT_WKOC_E (1<<22) /* wake on overcurrent (enable) */
105#define PORT_WKDISC_E (1<<21) /* wake on disconnect (enable) */ 105#define PORT_WKDISC_E (1<<21) /* wake on disconnect (enable) */
diff --git a/include/linux/usb/functionfs.h b/include/linux/usb/functionfs.h
new file mode 100644
index 000000000000..a34a2a043b21
--- /dev/null
+++ b/include/linux/usb/functionfs.h
@@ -0,0 +1,199 @@
1#ifndef __LINUX_FUNCTIONFS_H__
2#define __LINUX_FUNCTIONFS_H__ 1
3
4
5#include <linux/types.h>
6#include <linux/ioctl.h>
7
8#include <linux/usb/ch9.h>
9
10
11enum {
12 FUNCTIONFS_DESCRIPTORS_MAGIC = 1,
13 FUNCTIONFS_STRINGS_MAGIC = 2
14};
15
16
17#ifndef __KERNEL__
18
19/* Descriptor of an non-audio endpoint */
20struct usb_endpoint_descriptor_no_audio {
21 __u8 bLength;
22 __u8 bDescriptorType;
23
24 __u8 bEndpointAddress;
25 __u8 bmAttributes;
26 __le16 wMaxPacketSize;
27 __u8 bInterval;
28} __attribute__((packed));
29
30
31/*
32 * All numbers must be in little endian order.
33 */
34
35struct usb_functionfs_descs_head {
36 __le32 magic;
37 __le32 length;
38 __le32 fs_count;
39 __le32 hs_count;
40} __attribute__((packed));
41
42/*
43 * Descriptors format:
44 *
45 * | off | name | type | description |
46 * |-----+-----------+--------------+--------------------------------------|
47 * | 0 | magic | LE32 | FUNCTIONFS_{FS,HS}_DESCRIPTORS_MAGIC |
48 * | 4 | lenght | LE32 | length of the whole data chunk |
49 * | 8 | fs_count | LE32 | number of full-speed descriptors |
50 * | 12 | hs_count | LE32 | number of high-speed descriptors |
51 * | 16 | fs_descrs | Descriptor[] | list of full-speed descriptors |
52 * | | hs_descrs | Descriptor[] | list of high-speed descriptors |
53 *
54 * descs are just valid USB descriptors and have the following format:
55 *
56 * | off | name | type | description |
57 * |-----+-----------------+------+--------------------------|
58 * | 0 | bLength | U8 | length of the descriptor |
59 * | 1 | bDescriptorType | U8 | descriptor type |
60 * | 2 | payload | | descriptor's payload |
61 */
62
63struct usb_functionfs_strings_head {
64 __le32 magic;
65 __le32 length;
66 __le32 str_count;
67 __le32 lang_count;
68} __attribute__((packed));
69
70/*
71 * Strings format:
72 *
73 * | off | name | type | description |
74 * |-----+------------+-----------------------+----------------------------|
75 * | 0 | magic | LE32 | FUNCTIONFS_STRINGS_MAGIC |
76 * | 4 | length | LE32 | length of the data chunk |
77 * | 8 | str_count | LE32 | number of strings |
78 * | 12 | lang_count | LE32 | number of languages |
79 * | 16 | stringtab | StringTab[lang_count] | table of strings per lang |
80 *
81 * For each language there is one stringtab entry (ie. there are lang_count
82 * stringtab entires). Each StringTab has following format:
83 *
84 * | off | name | type | description |
85 * |-----+---------+-------------------+------------------------------------|
86 * | 0 | lang | LE16 | language code |
87 * | 2 | strings | String[str_count] | array of strings in given language |
88 *
89 * For each string ther is one strings entry (ie. there are str_count
90 * string entries). Each String is a NUL terminated string encoded in
91 * UTF-8.
92 */
93
94#endif
95
96
97/*
98 * Events are delivered on the ep0 file descriptor, when the user mode driver
99 * reads from this file descriptor after writing the descriptors. Don't
100 * stop polling this descriptor.
101 */
102
103enum usb_functionfs_event_type {
104 FUNCTIONFS_BIND,
105 FUNCTIONFS_UNBIND,
106
107 FUNCTIONFS_ENABLE,
108 FUNCTIONFS_DISABLE,
109
110 FUNCTIONFS_SETUP,
111
112 FUNCTIONFS_SUSPEND,
113 FUNCTIONFS_RESUME
114};
115
116/* NOTE: this structure must stay the same size and layout on
117 * both 32-bit and 64-bit kernels.
118 */
119struct usb_functionfs_event {
120 union {
121 /* SETUP: packet; DATA phase i/o precedes next event
122 *(setup.bmRequestType & USB_DIR_IN) flags direction */
123 struct usb_ctrlrequest setup;
124 } __attribute__((packed)) u;
125
126 /* enum usb_functionfs_event_type */
127 __u8 type;
128 __u8 _pad[3];
129} __attribute__((packed));
130
131
132/* Endpoint ioctls */
133/* The same as in gadgetfs */
134
135/* IN transfers may be reported to the gadget driver as complete
136 * when the fifo is loaded, before the host reads the data;
137 * OUT transfers may be reported to the host's "client" driver as
138 * complete when they're sitting in the FIFO unread.
139 * THIS returns how many bytes are "unclaimed" in the endpoint fifo
140 * (needed for precise fault handling, when the hardware allows it)
141 */
142#define FUNCTIONFS_FIFO_STATUS _IO('g', 1)
143
144/* discards any unclaimed data in the fifo. */
145#define FUNCTIONFS_FIFO_FLUSH _IO('g', 2)
146
147/* resets endpoint halt+toggle; used to implement set_interface.
148 * some hardware (like pxa2xx) can't support this.
149 */
150#define FUNCTIONFS_CLEAR_HALT _IO('g', 3)
151
152/* Specific for functionfs */
153
154/*
155 * Returns reverse mapping of an interface. Called on EP0. If there
156 * is no such interface returns -EDOM. If function is not active
157 * returns -ENODEV.
158 */
159#define FUNCTIONFS_INTERFACE_REVMAP _IO('g', 128)
160
161/*
162 * Returns real bEndpointAddress of an endpoint. If function is not
163 * active returns -ENODEV.
164 */
165#define FUNCTIONFS_ENDPOINT_REVMAP _IO('g', 129)
166
167
168#ifdef __KERNEL__
169
170struct ffs_data;
171struct usb_composite_dev;
172struct usb_configuration;
173
174
175static int functionfs_init(void) __attribute__((warn_unused_result));
176static void functionfs_cleanup(void);
177
178static int functionfs_bind(struct ffs_data *ffs, struct usb_composite_dev *cdev)
179 __attribute__((warn_unused_result, nonnull));
180static void functionfs_unbind(struct ffs_data *ffs)
181 __attribute__((nonnull));
182
183static int functionfs_add(struct usb_composite_dev *cdev,
184 struct usb_configuration *c,
185 struct ffs_data *ffs)
186 __attribute__((warn_unused_result, nonnull));
187
188
189static int functionfs_ready_callback(struct ffs_data *ffs)
190 __attribute__((warn_unused_result, nonnull));
191static void functionfs_closed_callback(struct ffs_data *ffs)
192 __attribute__((nonnull));
193static int functionfs_check_dev_callback(const char *dev_name)
194 __attribute__((warn_unused_result, nonnull));
195
196
197#endif
198
199#endif
diff --git a/include/linux/usb/g_hid.h b/include/linux/usb/g_hid.h
new file mode 100644
index 000000000000..50f5745df28c
--- /dev/null
+++ b/include/linux/usb/g_hid.h
@@ -0,0 +1,32 @@
1/*
2 * g_hid.h -- Header file for USB HID gadget driver
3 *
4 * Copyright (C) 2010 Fabien Chouteau <fabien.chouteau@barco.com>
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; either version 2 of the License, or
9 * (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 */
20
21#ifndef __LINUX_USB_G_HID_H
22#define __LINUX_USB_G_HID_H
23
24struct hidg_func_descriptor {
25 unsigned char subclass;
26 unsigned char protocol;
27 unsigned short report_length;
28 unsigned short report_desc_length;
29 unsigned char report_desc[];
30};
31
32#endif /* __LINUX_USB_G_HID_H */
diff --git a/include/linux/usb/gadget.h b/include/linux/usb/gadget.h
index f4b7ca516cdd..d3ef42d7d2f0 100644
--- a/include/linux/usb/gadget.h
+++ b/include/linux/usb/gadget.h
@@ -494,9 +494,13 @@ static inline void set_gadget_data(struct usb_gadget *gadget, void *data)
494 { dev_set_drvdata(&gadget->dev, data); } 494 { dev_set_drvdata(&gadget->dev, data); }
495static inline void *get_gadget_data(struct usb_gadget *gadget) 495static inline void *get_gadget_data(struct usb_gadget *gadget)
496 { return dev_get_drvdata(&gadget->dev); } 496 { return dev_get_drvdata(&gadget->dev); }
497static inline struct usb_gadget *dev_to_usb_gadget(struct device *dev)
498{
499 return container_of(dev, struct usb_gadget, dev);
500}
497 501
498/* iterates the non-control endpoints; 'tmp' is a struct usb_ep pointer */ 502/* iterates the non-control endpoints; 'tmp' is a struct usb_ep pointer */
499#define gadget_for_each_ep(tmp,gadget) \ 503#define gadget_for_each_ep(tmp, gadget) \
500 list_for_each_entry(tmp, &(gadget)->ep_list, ep_list) 504 list_for_each_entry(tmp, &(gadget)->ep_list, ep_list)
501 505
502 506
diff --git a/include/linux/usb/gadgetfs.h b/include/linux/usb/gadgetfs.h
index 612102e4d75e..0bb12e0d4f8f 100644
--- a/include/linux/usb/gadgetfs.h
+++ b/include/linux/usb/gadgetfs.h
@@ -19,7 +19,7 @@
19#define __LINUX_USB_GADGETFS_H 19#define __LINUX_USB_GADGETFS_H
20 20
21#include <linux/types.h> 21#include <linux/types.h>
22#include <asm/ioctl.h> 22#include <linux/ioctl.h>
23 23
24#include <linux/usb/ch9.h> 24#include <linux/usb/ch9.h>
25 25
diff --git a/include/linux/usb/hcd.h b/include/linux/usb/hcd.h
new file mode 100644
index 000000000000..2e3a4ea1a3da
--- /dev/null
+++ b/include/linux/usb/hcd.h
@@ -0,0 +1,625 @@
1/*
2 * Copyright (c) 2001-2002 by David Brownell
3 *
4 * This program is free software; you can redistribute it and/or modify it
5 * under the terms of the GNU General Public License as published by the
6 * Free Software Foundation; either version 2 of the License, or (at your
7 * option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful, but
10 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
11 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software Foundation,
16 * Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
17 */
18
19#ifndef __USB_CORE_HCD_H
20#define __USB_CORE_HCD_H
21
22#ifdef __KERNEL__
23
24#include <linux/rwsem.h>
25
26#define MAX_TOPO_LEVEL 6
27
28/* This file contains declarations of usbcore internals that are mostly
29 * used or exposed by Host Controller Drivers.
30 */
31
32/*
33 * USB Packet IDs (PIDs)
34 */
35#define USB_PID_EXT 0xf0 /* USB 2.0 LPM ECN */
36#define USB_PID_OUT 0xe1
37#define USB_PID_ACK 0xd2
38#define USB_PID_DATA0 0xc3
39#define USB_PID_PING 0xb4 /* USB 2.0 */
40#define USB_PID_SOF 0xa5
41#define USB_PID_NYET 0x96 /* USB 2.0 */
42#define USB_PID_DATA2 0x87 /* USB 2.0 */
43#define USB_PID_SPLIT 0x78 /* USB 2.0 */
44#define USB_PID_IN 0x69
45#define USB_PID_NAK 0x5a
46#define USB_PID_DATA1 0x4b
47#define USB_PID_PREAMBLE 0x3c /* Token mode */
48#define USB_PID_ERR 0x3c /* USB 2.0: handshake mode */
49#define USB_PID_SETUP 0x2d
50#define USB_PID_STALL 0x1e
51#define USB_PID_MDATA 0x0f /* USB 2.0 */
52
53/*-------------------------------------------------------------------------*/
54
55/*
56 * USB Host Controller Driver (usb_hcd) framework
57 *
58 * Since "struct usb_bus" is so thin, you can't share much code in it.
59 * This framework is a layer over that, and should be more sharable.
60 *
61 * @authorized_default: Specifies if new devices are authorized to
62 * connect by default or they require explicit
63 * user space authorization; this bit is settable
64 * through /sys/class/usb_host/X/authorized_default.
65 * For the rest is RO, so we don't lock to r/w it.
66 */
67
68/*-------------------------------------------------------------------------*/
69
70struct usb_hcd {
71
72 /*
73 * housekeeping
74 */
75 struct usb_bus self; /* hcd is-a bus */
76 struct kref kref; /* reference counter */
77
78 const char *product_desc; /* product/vendor string */
79 char irq_descr[24]; /* driver + bus # */
80
81 struct timer_list rh_timer; /* drives root-hub polling */
82 struct urb *status_urb; /* the current status urb */
83#ifdef CONFIG_USB_SUSPEND
84 struct work_struct wakeup_work; /* for remote wakeup */
85#endif
86
87 /*
88 * hardware info/state
89 */
90 const struct hc_driver *driver; /* hw-specific hooks */
91
92 /* Flags that need to be manipulated atomically */
93 unsigned long flags;
94#define HCD_FLAG_HW_ACCESSIBLE 0x00000001
95#define HCD_FLAG_SAW_IRQ 0x00000002
96
97 unsigned rh_registered:1;/* is root hub registered? */
98
99 /* The next flag is a stopgap, to be removed when all the HCDs
100 * support the new root-hub polling mechanism. */
101 unsigned uses_new_polling:1;
102 unsigned poll_rh:1; /* poll for rh status? */
103 unsigned poll_pending:1; /* status has changed? */
104 unsigned wireless:1; /* Wireless USB HCD */
105 unsigned authorized_default:1;
106 unsigned has_tt:1; /* Integrated TT in root hub */
107
108 int irq; /* irq allocated */
109 void __iomem *regs; /* device memory/io */
110 u64 rsrc_start; /* memory/io resource start */
111 u64 rsrc_len; /* memory/io resource length */
112 unsigned power_budget; /* in mA, 0 = no limit */
113
114 /* bandwidth_mutex should be taken before adding or removing
115 * any new bus bandwidth constraints:
116 * 1. Before adding a configuration for a new device.
117 * 2. Before removing the configuration to put the device into
118 * the addressed state.
119 * 3. Before selecting a different configuration.
120 * 4. Before selecting an alternate interface setting.
121 *
122 * bandwidth_mutex should be dropped after a successful control message
123 * to the device, or resetting the bandwidth after a failed attempt.
124 */
125 struct mutex bandwidth_mutex;
126
127
128#define HCD_BUFFER_POOLS 4
129 struct dma_pool *pool[HCD_BUFFER_POOLS];
130
131 int state;
132# define __ACTIVE 0x01
133# define __SUSPEND 0x04
134# define __TRANSIENT 0x80
135
136# define HC_STATE_HALT 0
137# define HC_STATE_RUNNING (__ACTIVE)
138# define HC_STATE_QUIESCING (__SUSPEND|__TRANSIENT|__ACTIVE)
139# define HC_STATE_RESUMING (__SUSPEND|__TRANSIENT)
140# define HC_STATE_SUSPENDED (__SUSPEND)
141
142#define HC_IS_RUNNING(state) ((state) & __ACTIVE)
143#define HC_IS_SUSPENDED(state) ((state) & __SUSPEND)
144
145 /* more shared queuing code would be good; it should support
146 * smarter scheduling, handle transaction translators, etc;
147 * input size of periodic table to an interrupt scheduler.
148 * (ohci 32, uhci 1024, ehci 256/512/1024).
149 */
150
151 /* The HC driver's private data is stored at the end of
152 * this structure.
153 */
154 unsigned long hcd_priv[0]
155 __attribute__ ((aligned(sizeof(unsigned long))));
156};
157
158/* 2.4 does this a bit differently ... */
159static inline struct usb_bus *hcd_to_bus(struct usb_hcd *hcd)
160{
161 return &hcd->self;
162}
163
164static inline struct usb_hcd *bus_to_hcd(struct usb_bus *bus)
165{
166 return container_of(bus, struct usb_hcd, self);
167}
168
169struct hcd_timeout { /* timeouts we allocate */
170 struct list_head timeout_list;
171 struct timer_list timer;
172};
173
174/*-------------------------------------------------------------------------*/
175
176
177struct hc_driver {
178 const char *description; /* "ehci-hcd" etc */
179 const char *product_desc; /* product/vendor string */
180 size_t hcd_priv_size; /* size of private data */
181
182 /* irq handler */
183 irqreturn_t (*irq) (struct usb_hcd *hcd);
184
185 int flags;
186#define HCD_MEMORY 0x0001 /* HC regs use memory (else I/O) */
187#define HCD_LOCAL_MEM 0x0002 /* HC needs local memory */
188#define HCD_USB11 0x0010 /* USB 1.1 */
189#define HCD_USB2 0x0020 /* USB 2.0 */
190#define HCD_USB3 0x0040 /* USB 3.0 */
191#define HCD_MASK 0x0070
192
193 /* called to init HCD and root hub */
194 int (*reset) (struct usb_hcd *hcd);
195 int (*start) (struct usb_hcd *hcd);
196
197 /* NOTE: these suspend/resume calls relate to the HC as
198 * a whole, not just the root hub; they're for PCI bus glue.
199 */
200 /* called after suspending the hub, before entering D3 etc */
201 int (*pci_suspend)(struct usb_hcd *hcd);
202
203 /* called after entering D0 (etc), before resuming the hub */
204 int (*pci_resume)(struct usb_hcd *hcd, bool hibernated);
205
206 /* cleanly make HCD stop writing memory and doing I/O */
207 void (*stop) (struct usb_hcd *hcd);
208
209 /* shutdown HCD */
210 void (*shutdown) (struct usb_hcd *hcd);
211
212 /* return current frame number */
213 int (*get_frame_number) (struct usb_hcd *hcd);
214
215 /* manage i/o requests, device state */
216 int (*urb_enqueue)(struct usb_hcd *hcd,
217 struct urb *urb, gfp_t mem_flags);
218 int (*urb_dequeue)(struct usb_hcd *hcd,
219 struct urb *urb, int status);
220
221 /* hw synch, freeing endpoint resources that urb_dequeue can't */
222 void (*endpoint_disable)(struct usb_hcd *hcd,
223 struct usb_host_endpoint *ep);
224
225 /* (optional) reset any endpoint state such as sequence number
226 and current window */
227 void (*endpoint_reset)(struct usb_hcd *hcd,
228 struct usb_host_endpoint *ep);
229
230 /* root hub support */
231 int (*hub_status_data) (struct usb_hcd *hcd, char *buf);
232 int (*hub_control) (struct usb_hcd *hcd,
233 u16 typeReq, u16 wValue, u16 wIndex,
234 char *buf, u16 wLength);
235 int (*bus_suspend)(struct usb_hcd *);
236 int (*bus_resume)(struct usb_hcd *);
237 int (*start_port_reset)(struct usb_hcd *, unsigned port_num);
238
239 /* force handover of high-speed port to full-speed companion */
240 void (*relinquish_port)(struct usb_hcd *, int);
241 /* has a port been handed over to a companion? */
242 int (*port_handed_over)(struct usb_hcd *, int);
243
244 /* CLEAR_TT_BUFFER completion callback */
245 void (*clear_tt_buffer_complete)(struct usb_hcd *,
246 struct usb_host_endpoint *);
247
248 /* xHCI specific functions */
249 /* Called by usb_alloc_dev to alloc HC device structures */
250 int (*alloc_dev)(struct usb_hcd *, struct usb_device *);
251 /* Called by usb_disconnect to free HC device structures */
252 void (*free_dev)(struct usb_hcd *, struct usb_device *);
253 /* Change a group of bulk endpoints to support multiple stream IDs */
254 int (*alloc_streams)(struct usb_hcd *hcd, struct usb_device *udev,
255 struct usb_host_endpoint **eps, unsigned int num_eps,
256 unsigned int num_streams, gfp_t mem_flags);
257 /* Reverts a group of bulk endpoints back to not using stream IDs.
258 * Can fail if we run out of memory.
259 */
260 int (*free_streams)(struct usb_hcd *hcd, struct usb_device *udev,
261 struct usb_host_endpoint **eps, unsigned int num_eps,
262 gfp_t mem_flags);
263
264 /* Bandwidth computation functions */
265 /* Note that add_endpoint() can only be called once per endpoint before
266 * check_bandwidth() or reset_bandwidth() must be called.
267 * drop_endpoint() can only be called once per endpoint also.
268 * A call to xhci_drop_endpoint() followed by a call to
269 * xhci_add_endpoint() will add the endpoint to the schedule with
270 * possibly new parameters denoted by a different endpoint descriptor
271 * in usb_host_endpoint. A call to xhci_add_endpoint() followed by a
272 * call to xhci_drop_endpoint() is not allowed.
273 */
274 /* Allocate endpoint resources and add them to a new schedule */
275 int (*add_endpoint)(struct usb_hcd *, struct usb_device *,
276 struct usb_host_endpoint *);
277 /* Drop an endpoint from a new schedule */
278 int (*drop_endpoint)(struct usb_hcd *, struct usb_device *,
279 struct usb_host_endpoint *);
280 /* Check that a new hardware configuration, set using
281 * endpoint_enable and endpoint_disable, does not exceed bus
282 * bandwidth. This must be called before any set configuration
283 * or set interface requests are sent to the device.
284 */
285 int (*check_bandwidth)(struct usb_hcd *, struct usb_device *);
286 /* Reset the device schedule to the last known good schedule,
287 * which was set from a previous successful call to
288 * check_bandwidth(). This reverts any add_endpoint() and
289 * drop_endpoint() calls since that last successful call.
290 * Used for when a check_bandwidth() call fails due to resource
291 * or bandwidth constraints.
292 */
293 void (*reset_bandwidth)(struct usb_hcd *, struct usb_device *);
294 /* Returns the hardware-chosen device address */
295 int (*address_device)(struct usb_hcd *, struct usb_device *udev);
296 /* Notifies the HCD after a hub descriptor is fetched.
297 * Will block.
298 */
299 int (*update_hub_device)(struct usb_hcd *, struct usb_device *hdev,
300 struct usb_tt *tt, gfp_t mem_flags);
301 int (*reset_device)(struct usb_hcd *, struct usb_device *);
302};
303
304extern int usb_hcd_link_urb_to_ep(struct usb_hcd *hcd, struct urb *urb);
305extern int usb_hcd_check_unlink_urb(struct usb_hcd *hcd, struct urb *urb,
306 int status);
307extern void usb_hcd_unlink_urb_from_ep(struct usb_hcd *hcd, struct urb *urb);
308
309extern int usb_hcd_submit_urb(struct urb *urb, gfp_t mem_flags);
310extern int usb_hcd_unlink_urb(struct urb *urb, int status);
311extern void usb_hcd_giveback_urb(struct usb_hcd *hcd, struct urb *urb,
312 int status);
313extern void usb_hcd_flush_endpoint(struct usb_device *udev,
314 struct usb_host_endpoint *ep);
315extern void usb_hcd_disable_endpoint(struct usb_device *udev,
316 struct usb_host_endpoint *ep);
317extern void usb_hcd_reset_endpoint(struct usb_device *udev,
318 struct usb_host_endpoint *ep);
319extern void usb_hcd_synchronize_unlinks(struct usb_device *udev);
320extern int usb_hcd_alloc_bandwidth(struct usb_device *udev,
321 struct usb_host_config *new_config,
322 struct usb_host_interface *old_alt,
323 struct usb_host_interface *new_alt);
324extern int usb_hcd_get_frame_number(struct usb_device *udev);
325
326extern struct usb_hcd *usb_create_hcd(const struct hc_driver *driver,
327 struct device *dev, const char *bus_name);
328extern struct usb_hcd *usb_get_hcd(struct usb_hcd *hcd);
329extern void usb_put_hcd(struct usb_hcd *hcd);
330extern int usb_add_hcd(struct usb_hcd *hcd,
331 unsigned int irqnum, unsigned long irqflags);
332extern void usb_remove_hcd(struct usb_hcd *hcd);
333
334struct platform_device;
335extern void usb_hcd_platform_shutdown(struct platform_device *dev);
336
337#ifdef CONFIG_PCI
338struct pci_dev;
339struct pci_device_id;
340extern int usb_hcd_pci_probe(struct pci_dev *dev,
341 const struct pci_device_id *id);
342extern void usb_hcd_pci_remove(struct pci_dev *dev);
343extern void usb_hcd_pci_shutdown(struct pci_dev *dev);
344
345#ifdef CONFIG_PM_SLEEP
346extern const struct dev_pm_ops usb_hcd_pci_pm_ops;
347#endif
348#endif /* CONFIG_PCI */
349
350/* pci-ish (pdev null is ok) buffer alloc/mapping support */
351int hcd_buffer_create(struct usb_hcd *hcd);
352void hcd_buffer_destroy(struct usb_hcd *hcd);
353
354void *hcd_buffer_alloc(struct usb_bus *bus, size_t size,
355 gfp_t mem_flags, dma_addr_t *dma);
356void hcd_buffer_free(struct usb_bus *bus, size_t size,
357 void *addr, dma_addr_t dma);
358
359/* generic bus glue, needed for host controllers that don't use PCI */
360extern irqreturn_t usb_hcd_irq(int irq, void *__hcd);
361
362extern void usb_hc_died(struct usb_hcd *hcd);
363extern void usb_hcd_poll_rh_status(struct usb_hcd *hcd);
364
365/* The D0/D1 toggle bits ... USE WITH CAUTION (they're almost hcd-internal) */
366#define usb_gettoggle(dev, ep, out) (((dev)->toggle[out] >> (ep)) & 1)
367#define usb_dotoggle(dev, ep, out) ((dev)->toggle[out] ^= (1 << (ep)))
368#define usb_settoggle(dev, ep, out, bit) \
369 ((dev)->toggle[out] = ((dev)->toggle[out] & ~(1 << (ep))) | \
370 ((bit) << (ep)))
371
372/* -------------------------------------------------------------------------- */
373
374/* Enumeration is only for the hub driver, or HCD virtual root hubs */
375extern struct usb_device *usb_alloc_dev(struct usb_device *parent,
376 struct usb_bus *, unsigned port);
377extern int usb_new_device(struct usb_device *dev);
378extern void usb_disconnect(struct usb_device **);
379
380extern int usb_get_configuration(struct usb_device *dev);
381extern void usb_destroy_configuration(struct usb_device *dev);
382
383/*-------------------------------------------------------------------------*/
384
385/*
386 * HCD Root Hub support
387 */
388
389#include <linux/usb/ch11.h>
390
391/*
392 * As of USB 2.0, full/low speed devices are segregated into trees.
393 * One type grows from USB 1.1 host controllers (OHCI, UHCI etc).
394 * The other type grows from high speed hubs when they connect to
395 * full/low speed devices using "Transaction Translators" (TTs).
396 *
397 * TTs should only be known to the hub driver, and high speed bus
398 * drivers (only EHCI for now). They affect periodic scheduling and
399 * sometimes control/bulk error recovery.
400 */
401
402struct usb_device;
403
404struct usb_tt {
405 struct usb_device *hub; /* upstream highspeed hub */
406 int multi; /* true means one TT per port */
407 unsigned think_time; /* think time in ns */
408
409 /* for control/bulk error recovery (CLEAR_TT_BUFFER) */
410 spinlock_t lock;
411 struct list_head clear_list; /* of usb_tt_clear */
412 struct work_struct clear_work;
413};
414
415struct usb_tt_clear {
416 struct list_head clear_list;
417 unsigned tt;
418 u16 devinfo;
419 struct usb_hcd *hcd;
420 struct usb_host_endpoint *ep;
421};
422
423extern int usb_hub_clear_tt_buffer(struct urb *urb);
424extern void usb_ep0_reinit(struct usb_device *);
425
426/* (shifted) direction/type/recipient from the USB 2.0 spec, table 9.2 */
427#define DeviceRequest \
428 ((USB_DIR_IN|USB_TYPE_STANDARD|USB_RECIP_DEVICE)<<8)
429#define DeviceOutRequest \
430 ((USB_DIR_OUT|USB_TYPE_STANDARD|USB_RECIP_DEVICE)<<8)
431
432#define InterfaceRequest \
433 ((USB_DIR_IN|USB_TYPE_STANDARD|USB_RECIP_INTERFACE)<<8)
434
435#define EndpointRequest \
436 ((USB_DIR_IN|USB_TYPE_STANDARD|USB_RECIP_INTERFACE)<<8)
437#define EndpointOutRequest \
438 ((USB_DIR_OUT|USB_TYPE_STANDARD|USB_RECIP_INTERFACE)<<8)
439
440/* class requests from the USB 2.0 hub spec, table 11-15 */
441/* GetBusState and SetHubDescriptor are optional, omitted */
442#define ClearHubFeature (0x2000 | USB_REQ_CLEAR_FEATURE)
443#define ClearPortFeature (0x2300 | USB_REQ_CLEAR_FEATURE)
444#define GetHubDescriptor (0xa000 | USB_REQ_GET_DESCRIPTOR)
445#define GetHubStatus (0xa000 | USB_REQ_GET_STATUS)
446#define GetPortStatus (0xa300 | USB_REQ_GET_STATUS)
447#define SetHubFeature (0x2000 | USB_REQ_SET_FEATURE)
448#define SetPortFeature (0x2300 | USB_REQ_SET_FEATURE)
449
450
451/*-------------------------------------------------------------------------*/
452
453/*
454 * Generic bandwidth allocation constants/support
455 */
456#define FRAME_TIME_USECS 1000L
457#define BitTime(bytecount) (7 * 8 * bytecount / 6) /* with integer truncation */
458 /* Trying not to use worst-case bit-stuffing
459 * of (7/6 * 8 * bytecount) = 9.33 * bytecount */
460 /* bytecount = data payload byte count */
461
462#define NS_TO_US(ns) ((ns + 500L) / 1000L)
463 /* convert & round nanoseconds to microseconds */
464
465
466/*
467 * Full/low speed bandwidth allocation constants/support.
468 */
469#define BW_HOST_DELAY 1000L /* nanoseconds */
470#define BW_HUB_LS_SETUP 333L /* nanoseconds */
471 /* 4 full-speed bit times (est.) */
472
473#define FRAME_TIME_BITS 12000L /* frame = 1 millisecond */
474#define FRAME_TIME_MAX_BITS_ALLOC (90L * FRAME_TIME_BITS / 100L)
475#define FRAME_TIME_MAX_USECS_ALLOC (90L * FRAME_TIME_USECS / 100L)
476
477/*
478 * Ceiling [nano/micro]seconds (typical) for that many bytes at high speed
479 * ISO is a bit less, no ACK ... from USB 2.0 spec, 5.11.3 (and needed
480 * to preallocate bandwidth)
481 */
482#define USB2_HOST_DELAY 5 /* nsec, guess */
483#define HS_NSECS(bytes) (((55 * 8 * 2083) \
484 + (2083UL * (3 + BitTime(bytes))))/1000 \
485 + USB2_HOST_DELAY)
486#define HS_NSECS_ISO(bytes) (((38 * 8 * 2083) \
487 + (2083UL * (3 + BitTime(bytes))))/1000 \
488 + USB2_HOST_DELAY)
489#define HS_USECS(bytes) NS_TO_US(HS_NSECS(bytes))
490#define HS_USECS_ISO(bytes) NS_TO_US(HS_NSECS_ISO(bytes))
491
492extern long usb_calc_bus_time(int speed, int is_input,
493 int isoc, int bytecount);
494
495/*-------------------------------------------------------------------------*/
496
497extern void usb_set_device_state(struct usb_device *udev,
498 enum usb_device_state new_state);
499
500/*-------------------------------------------------------------------------*/
501
502/* exported only within usbcore */
503
504extern struct list_head usb_bus_list;
505extern struct mutex usb_bus_list_lock;
506extern wait_queue_head_t usb_kill_urb_queue;
507
508extern int usb_find_interface_driver(struct usb_device *dev,
509 struct usb_interface *interface);
510
511#define usb_endpoint_out(ep_dir) (!((ep_dir) & USB_DIR_IN))
512
513#ifdef CONFIG_PM
514extern void usb_root_hub_lost_power(struct usb_device *rhdev);
515extern int hcd_bus_suspend(struct usb_device *rhdev, pm_message_t msg);
516extern int hcd_bus_resume(struct usb_device *rhdev, pm_message_t msg);
517#endif /* CONFIG_PM */
518
519#ifdef CONFIG_USB_SUSPEND
520extern void usb_hcd_resume_root_hub(struct usb_hcd *hcd);
521#else
522static inline void usb_hcd_resume_root_hub(struct usb_hcd *hcd)
523{
524 return;
525}
526#endif /* CONFIG_USB_SUSPEND */
527
528
529/*
530 * USB device fs stuff
531 */
532
533#ifdef CONFIG_USB_DEVICEFS
534
535/*
536 * these are expected to be called from the USB core/hub thread
537 * with the kernel lock held
538 */
539extern void usbfs_update_special(void);
540extern int usbfs_init(void);
541extern void usbfs_cleanup(void);
542
543#else /* CONFIG_USB_DEVICEFS */
544
545static inline void usbfs_update_special(void) {}
546static inline int usbfs_init(void) { return 0; }
547static inline void usbfs_cleanup(void) { }
548
549#endif /* CONFIG_USB_DEVICEFS */
550
551/*-------------------------------------------------------------------------*/
552
553#if defined(CONFIG_USB_MON) || defined(CONFIG_USB_MON_MODULE)
554
555struct usb_mon_operations {
556 void (*urb_submit)(struct usb_bus *bus, struct urb *urb);
557 void (*urb_submit_error)(struct usb_bus *bus, struct urb *urb, int err);
558 void (*urb_complete)(struct usb_bus *bus, struct urb *urb, int status);
559 /* void (*urb_unlink)(struct usb_bus *bus, struct urb *urb); */
560};
561
562extern struct usb_mon_operations *mon_ops;
563
564static inline void usbmon_urb_submit(struct usb_bus *bus, struct urb *urb)
565{
566 if (bus->monitored)
567 (*mon_ops->urb_submit)(bus, urb);
568}
569
570static inline void usbmon_urb_submit_error(struct usb_bus *bus, struct urb *urb,
571 int error)
572{
573 if (bus->monitored)
574 (*mon_ops->urb_submit_error)(bus, urb, error);
575}
576
577static inline void usbmon_urb_complete(struct usb_bus *bus, struct urb *urb,
578 int status)
579{
580 if (bus->monitored)
581 (*mon_ops->urb_complete)(bus, urb, status);
582}
583
584int usb_mon_register(struct usb_mon_operations *ops);
585void usb_mon_deregister(void);
586
587#else
588
589static inline void usbmon_urb_submit(struct usb_bus *bus, struct urb *urb) {}
590static inline void usbmon_urb_submit_error(struct usb_bus *bus, struct urb *urb,
591 int error) {}
592static inline void usbmon_urb_complete(struct usb_bus *bus, struct urb *urb,
593 int status) {}
594
595#endif /* CONFIG_USB_MON || CONFIG_USB_MON_MODULE */
596
597/*-------------------------------------------------------------------------*/
598
599/* hub.h ... DeviceRemovable in 2.4.2-ac11, gone in 2.4.10 */
600/* bleech -- resurfaced in 2.4.11 or 2.4.12 */
601#define bitmap DeviceRemovable
602
603
604/*-------------------------------------------------------------------------*/
605
606/* random stuff */
607
608#define RUN_CONTEXT (in_irq() ? "in_irq" \
609 : (in_interrupt() ? "in_interrupt" : "can sleep"))
610
611
612/* This rwsem is for use only by the hub driver and ehci-hcd.
613 * Nobody else should touch it.
614 */
615extern struct rw_semaphore ehci_cf_port_reset_rwsem;
616
617/* Keep track of which host controller drivers are loaded */
618#define USB_UHCI_LOADED 0
619#define USB_OHCI_LOADED 1
620#define USB_EHCI_LOADED 2
621extern unsigned long usb_hcds_loaded;
622
623#endif /* __KERNEL__ */
624
625#endif /* __USB_CORE_HCD_H */
diff --git a/include/linux/usb/langwell_udc.h b/include/linux/usb/langwell_udc.h
index c949178a6530..2d2d1bbad9d2 100644
--- a/include/linux/usb/langwell_udc.h
+++ b/include/linux/usb/langwell_udc.h
@@ -181,7 +181,7 @@ struct langwell_op_regs {
181#define PORTS_PIC (BIT(15) | BIT(14)) /* port indicator control */ 181#define PORTS_PIC (BIT(15) | BIT(14)) /* port indicator control */
182#define PORTS_PO BIT(13) /* port owner */ 182#define PORTS_PO BIT(13) /* port owner */
183#define PORTS_PP BIT(12) /* port power */ 183#define PORTS_PP BIT(12) /* port power */
184#define PORTS_LS (BIT(11) | BIT(10)) /* line status */ 184#define PORTS_LS (BIT(11) | BIT(10)) /* line status */
185#define PORTS_SLP BIT(9) /* suspend using L1 */ 185#define PORTS_SLP BIT(9) /* suspend using L1 */
186#define PORTS_PR BIT(8) /* port reset */ 186#define PORTS_PR BIT(8) /* port reset */
187#define PORTS_SUSP BIT(7) /* suspend */ 187#define PORTS_SUSP BIT(7) /* suspend */
diff --git a/include/linux/usb/musb.h b/include/linux/usb/musb.h
index 7acef0234c0e..ee2dd1d506ed 100644
--- a/include/linux/usb/musb.h
+++ b/include/linux/usb/musb.h
@@ -22,12 +22,47 @@ enum musb_mode {
22 22
23struct clk; 23struct clk;
24 24
25enum musb_fifo_style {
26 FIFO_RXTX,
27 FIFO_TX,
28 FIFO_RX
29} __attribute__ ((packed));
30
31enum musb_buf_mode {
32 BUF_SINGLE,
33 BUF_DOUBLE
34} __attribute__ ((packed));
35
36struct musb_fifo_cfg {
37 u8 hw_ep_num;
38 enum musb_fifo_style style;
39 enum musb_buf_mode mode;
40 u16 maxpacket;
41};
42
43#define MUSB_EP_FIFO(ep, st, m, pkt) \
44{ \
45 .hw_ep_num = ep, \
46 .style = st, \
47 .mode = m, \
48 .maxpacket = pkt, \
49}
50
51#define MUSB_EP_FIFO_SINGLE(ep, st, pkt) \
52 MUSB_EP_FIFO(ep, st, BUF_SINGLE, pkt)
53
54#define MUSB_EP_FIFO_DOUBLE(ep, st, pkt) \
55 MUSB_EP_FIFO(ep, st, BUF_DOUBLE, pkt)
56
25struct musb_hdrc_eps_bits { 57struct musb_hdrc_eps_bits {
26 const char name[16]; 58 const char name[16];
27 u8 bits; 59 u8 bits;
28}; 60};
29 61
30struct musb_hdrc_config { 62struct musb_hdrc_config {
63 struct musb_fifo_cfg *fifo_cfg; /* board fifo configuration */
64 unsigned fifo_cfg_size; /* size of the fifo configuration */
65
31 /* MUSB configuration-specific details */ 66 /* MUSB configuration-specific details */
32 unsigned multipoint:1; /* multipoint device */ 67 unsigned multipoint:1; /* multipoint device */
33 unsigned dyn_fifo:1 __deprecated; /* supports dynamic fifo sizing */ 68 unsigned dyn_fifo:1 __deprecated; /* supports dynamic fifo sizing */
@@ -51,8 +86,9 @@ struct musb_hdrc_config {
51 86
52 struct musb_hdrc_eps_bits *eps_bits __deprecated; 87 struct musb_hdrc_eps_bits *eps_bits __deprecated;
53#ifdef CONFIG_BLACKFIN 88#ifdef CONFIG_BLACKFIN
54 /* A GPIO controlling VRSEL in Blackfin */ 89 /* A GPIO controlling VRSEL in Blackfin */
55 unsigned int gpio_vrsel; 90 unsigned int gpio_vrsel;
91 unsigned int gpio_vrsel_active;
56#endif 92#endif
57 93
58}; 94};
diff --git a/include/linux/usb/ncm.h b/include/linux/usb/ncm.h
new file mode 100644
index 000000000000..006d1064c8b2
--- /dev/null
+++ b/include/linux/usb/ncm.h
@@ -0,0 +1,114 @@
1/*
2 * USB CDC NCM auxiliary definitions
3 */
4
5#ifndef __LINUX_USB_NCM_H
6#define __LINUX_USB_NCM_H
7
8#include <linux/types.h>
9#include <linux/usb/cdc.h>
10#include <asm/unaligned.h>
11
12#define NCM_NTB_MIN_IN_SIZE 2048
13#define NCM_NTB_MIN_OUT_SIZE 2048
14
15#define NCM_CONTROL_TIMEOUT (5 * 1000)
16
17/* bmNetworkCapabilities */
18
19#define NCM_NCAP_ETH_FILTER (1 << 0)
20#define NCM_NCAP_NET_ADDRESS (1 << 1)
21#define NCM_NCAP_ENCAP_COMM (1 << 2)
22#define NCM_NCAP_MAX_DGRAM (1 << 3)
23#define NCM_NCAP_CRC_MODE (1 << 4)
24
25/*
26 * Here are options for NCM Datagram Pointer table (NDP) parser.
27 * There are 2 different formats: NDP16 and NDP32 in the spec (ch. 3),
28 * in NDP16 offsets and sizes fields are 1 16bit word wide,
29 * in NDP32 -- 2 16bit words wide. Also signatures are different.
30 * To make the parser code the same, put the differences in the structure,
31 * and switch pointers to the structures when the format is changed.
32 */
33
34struct ndp_parser_opts {
35 u32 nth_sign;
36 u32 ndp_sign;
37 unsigned nth_size;
38 unsigned ndp_size;
39 unsigned ndplen_align;
40 /* sizes in u16 units */
41 unsigned dgram_item_len; /* index or length */
42 unsigned block_length;
43 unsigned fp_index;
44 unsigned reserved1;
45 unsigned reserved2;
46 unsigned next_fp_index;
47};
48
49#define INIT_NDP16_OPTS { \
50 .nth_sign = NCM_NTH16_SIGN, \
51 .ndp_sign = NCM_NDP16_NOCRC_SIGN, \
52 .nth_size = sizeof(struct usb_cdc_ncm_nth16), \
53 .ndp_size = sizeof(struct usb_cdc_ncm_ndp16), \
54 .ndplen_align = 4, \
55 .dgram_item_len = 1, \
56 .block_length = 1, \
57 .fp_index = 1, \
58 .reserved1 = 0, \
59 .reserved2 = 0, \
60 .next_fp_index = 1, \
61 }
62
63
64#define INIT_NDP32_OPTS { \
65 .nth_sign = NCM_NTH32_SIGN, \
66 .ndp_sign = NCM_NDP32_NOCRC_SIGN, \
67 .nth_size = sizeof(struct usb_cdc_ncm_nth32), \
68 .ndp_size = sizeof(struct usb_cdc_ncm_ndp32), \
69 .ndplen_align = 8, \
70 .dgram_item_len = 2, \
71 .block_length = 2, \
72 .fp_index = 2, \
73 .reserved1 = 1, \
74 .reserved2 = 2, \
75 .next_fp_index = 2, \
76 }
77
78static inline void put_ncm(__le16 **p, unsigned size, unsigned val)
79{
80 switch (size) {
81 case 1:
82 put_unaligned_le16((u16)val, *p);
83 break;
84 case 2:
85 put_unaligned_le32((u32)val, *p);
86
87 break;
88 default:
89 BUG();
90 }
91
92 *p += size;
93}
94
95static inline unsigned get_ncm(__le16 **p, unsigned size)
96{
97 unsigned tmp;
98
99 switch (size) {
100 case 1:
101 tmp = get_unaligned_le16(*p);
102 break;
103 case 2:
104 tmp = get_unaligned_le32(*p);
105 break;
106 default:
107 BUG();
108 }
109
110 *p += size;
111 return tmp;
112}
113
114#endif /* __LINUX_USB_NCM_H */
diff --git a/include/linux/usb/net2280.h b/include/linux/usb/net2280.h
index 96ca549a778d..148b8fa5b1a2 100644
--- a/include/linux/usb/net2280.h
+++ b/include/linux/usb/net2280.h
@@ -353,7 +353,7 @@ struct net2280_dma_regs { /* [11.7] */
353#define DMA_TRANSACTION_DONE_INTERRUPT 24 353#define DMA_TRANSACTION_DONE_INTERRUPT 24
354#define DMA_ABORT 1 354#define DMA_ABORT 1
355#define DMA_START 0 355#define DMA_START 0
356 u32 _unused0 [2]; 356 u32 _unused0[2];
357 /* offset 0x0190, 0x01b0, 0x01d0, 0x01f0, */ 357 /* offset 0x0190, 0x01b0, 0x01d0, 0x01f0, */
358 u32 dmacount; 358 u32 dmacount;
359#define VALID_BIT 31 359#define VALID_BIT 31
@@ -374,7 +374,7 @@ struct net2280_dep_regs { /* [11.8] */
374 u32 dep_cfg; 374 u32 dep_cfg;
375 /* offset 0x0204, 0x0214, 0x224, 0x234, 0x244 */ 375 /* offset 0x0204, 0x0214, 0x224, 0x234, 0x244 */
376 u32 dep_rsp; 376 u32 dep_rsp;
377 u32 _unused [2]; 377 u32 _unused[2];
378} __attribute__ ((packed)); 378} __attribute__ ((packed));
379 379
380/* configurable endpoint registers, BAR0 + 0x0300 ... array of seven structs 380/* configurable endpoint registers, BAR0 + 0x0300 ... array of seven structs
@@ -437,7 +437,7 @@ struct net2280_ep_regs { /* [11.9] */
437 /* offset 0x0310, 0x0330, 0x0350, 0x0370, 0x0390, 0x03b0, 0x03d0 */ 437 /* offset 0x0310, 0x0330, 0x0350, 0x0370, 0x0390, 0x03b0, 0x03d0 */
438 u32 ep_avail; 438 u32 ep_avail;
439 u32 ep_data; 439 u32 ep_data;
440 u32 _unused0 [2]; 440 u32 _unused0[2];
441} __attribute__ ((packed)); 441} __attribute__ ((packed));
442 442
443#endif /* __LINUX_USB_NET2280_H */ 443#endif /* __LINUX_USB_NET2280_H */
diff --git a/include/linux/usb/quirks.h b/include/linux/usb/quirks.h
index 0a555dd131fc..16b7f3347545 100644
--- a/include/linux/usb/quirks.h
+++ b/include/linux/usb/quirks.h
@@ -22,4 +22,8 @@
22/*device will morph if reset, don't use reset for handling errors */ 22/*device will morph if reset, don't use reset for handling errors */
23#define USB_QUIRK_RESET_MORPHS 0x00000010 23#define USB_QUIRK_RESET_MORPHS 0x00000010
24 24
25/* device has more interface descriptions than the bNumInterfaces count,
26 and can't handle talking to these interfaces */
27#define USB_QUIRK_HONOR_BNUMINTERFACES 0x00000020
28
25#endif /* __LINUX_USB_QUIRKS_H */ 29#endif /* __LINUX_USB_QUIRKS_H */
diff --git a/include/linux/usb/rndis_host.h b/include/linux/usb/rndis_host.h
index 1ef1ebc2b04f..05ef52861988 100644
--- a/include/linux/usb/rndis_host.h
+++ b/include/linux/usb/rndis_host.h
@@ -34,10 +34,10 @@
34struct rndis_msg_hdr { 34struct rndis_msg_hdr {
35 __le32 msg_type; /* RNDIS_MSG_* */ 35 __le32 msg_type; /* RNDIS_MSG_* */
36 __le32 msg_len; 36 __le32 msg_len;
37 // followed by data that varies between messages 37 /* followed by data that varies between messages */
38 __le32 request_id; 38 __le32 request_id;
39 __le32 status; 39 __le32 status;
40 // ... and more 40 /* ... and more */
41} __attribute__ ((packed)); 41} __attribute__ ((packed));
42 42
43/* MS-Windows uses this strange size, but RNDIS spec says 1024 minimum */ 43/* MS-Windows uses this strange size, but RNDIS spec says 1024 minimum */
@@ -92,67 +92,67 @@ struct rndis_msg_hdr {
92 92
93struct rndis_data_hdr { 93struct rndis_data_hdr {
94 __le32 msg_type; /* RNDIS_MSG_PACKET */ 94 __le32 msg_type; /* RNDIS_MSG_PACKET */
95 __le32 msg_len; // rndis_data_hdr + data_len + pad 95 __le32 msg_len; /* rndis_data_hdr + data_len + pad */
96 __le32 data_offset; // 36 -- right after header 96 __le32 data_offset; /* 36 -- right after header */
97 __le32 data_len; // ... real packet size 97 __le32 data_len; /* ... real packet size */
98 98
99 __le32 oob_data_offset; // zero 99 __le32 oob_data_offset; /* zero */
100 __le32 oob_data_len; // zero 100 __le32 oob_data_len; /* zero */
101 __le32 num_oob; // zero 101 __le32 num_oob; /* zero */
102 __le32 packet_data_offset; // zero 102 __le32 packet_data_offset; /* zero */
103 103
104 __le32 packet_data_len; // zero 104 __le32 packet_data_len; /* zero */
105 __le32 vc_handle; // zero 105 __le32 vc_handle; /* zero */
106 __le32 reserved; // zero 106 __le32 reserved; /* zero */
107} __attribute__ ((packed)); 107} __attribute__ ((packed));
108 108
109struct rndis_init { /* OUT */ 109struct rndis_init { /* OUT */
110 // header and: 110 /* header and: */
111 __le32 msg_type; /* RNDIS_MSG_INIT */ 111 __le32 msg_type; /* RNDIS_MSG_INIT */
112 __le32 msg_len; // 24 112 __le32 msg_len; /* 24 */
113 __le32 request_id; 113 __le32 request_id;
114 __le32 major_version; // of rndis (1.0) 114 __le32 major_version; /* of rndis (1.0) */
115 __le32 minor_version; 115 __le32 minor_version;
116 __le32 max_transfer_size; 116 __le32 max_transfer_size;
117} __attribute__ ((packed)); 117} __attribute__ ((packed));
118 118
119struct rndis_init_c { /* IN */ 119struct rndis_init_c { /* IN */
120 // header and: 120 /* header and: */
121 __le32 msg_type; /* RNDIS_MSG_INIT_C */ 121 __le32 msg_type; /* RNDIS_MSG_INIT_C */
122 __le32 msg_len; 122 __le32 msg_len;
123 __le32 request_id; 123 __le32 request_id;
124 __le32 status; 124 __le32 status;
125 __le32 major_version; // of rndis (1.0) 125 __le32 major_version; /* of rndis (1.0) */
126 __le32 minor_version; 126 __le32 minor_version;
127 __le32 device_flags; 127 __le32 device_flags;
128 __le32 medium; // zero == 802.3 128 __le32 medium; /* zero == 802.3 */
129 __le32 max_packets_per_message; 129 __le32 max_packets_per_message;
130 __le32 max_transfer_size; 130 __le32 max_transfer_size;
131 __le32 packet_alignment; // max 7; (1<<n) bytes 131 __le32 packet_alignment; /* max 7; (1<<n) bytes */
132 __le32 af_list_offset; // zero 132 __le32 af_list_offset; /* zero */
133 __le32 af_list_size; // zero 133 __le32 af_list_size; /* zero */
134} __attribute__ ((packed)); 134} __attribute__ ((packed));
135 135
136struct rndis_halt { /* OUT (no reply) */ 136struct rndis_halt { /* OUT (no reply) */
137 // header and: 137 /* header and: */
138 __le32 msg_type; /* RNDIS_MSG_HALT */ 138 __le32 msg_type; /* RNDIS_MSG_HALT */
139 __le32 msg_len; 139 __le32 msg_len;
140 __le32 request_id; 140 __le32 request_id;
141} __attribute__ ((packed)); 141} __attribute__ ((packed));
142 142
143struct rndis_query { /* OUT */ 143struct rndis_query { /* OUT */
144 // header and: 144 /* header and: */
145 __le32 msg_type; /* RNDIS_MSG_QUERY */ 145 __le32 msg_type; /* RNDIS_MSG_QUERY */
146 __le32 msg_len; 146 __le32 msg_len;
147 __le32 request_id; 147 __le32 request_id;
148 __le32 oid; 148 __le32 oid;
149 __le32 len; 149 __le32 len;
150 __le32 offset; 150 __le32 offset;
151/*?*/ __le32 handle; // zero 151/*?*/ __le32 handle; /* zero */
152} __attribute__ ((packed)); 152} __attribute__ ((packed));
153 153
154struct rndis_query_c { /* IN */ 154struct rndis_query_c { /* IN */
155 // header and: 155 /* header and: */
156 __le32 msg_type; /* RNDIS_MSG_QUERY_C */ 156 __le32 msg_type; /* RNDIS_MSG_QUERY_C */
157 __le32 msg_len; 157 __le32 msg_len;
158 __le32 request_id; 158 __le32 request_id;
@@ -162,18 +162,18 @@ struct rndis_query_c { /* IN */
162} __attribute__ ((packed)); 162} __attribute__ ((packed));
163 163
164struct rndis_set { /* OUT */ 164struct rndis_set { /* OUT */
165 // header and: 165 /* header and: */
166 __le32 msg_type; /* RNDIS_MSG_SET */ 166 __le32 msg_type; /* RNDIS_MSG_SET */
167 __le32 msg_len; 167 __le32 msg_len;
168 __le32 request_id; 168 __le32 request_id;
169 __le32 oid; 169 __le32 oid;
170 __le32 len; 170 __le32 len;
171 __le32 offset; 171 __le32 offset;
172/*?*/ __le32 handle; // zero 172/*?*/ __le32 handle; /* zero */
173} __attribute__ ((packed)); 173} __attribute__ ((packed));
174 174
175struct rndis_set_c { /* IN */ 175struct rndis_set_c { /* IN */
176 // header and: 176 /* header and: */
177 __le32 msg_type; /* RNDIS_MSG_SET_C */ 177 __le32 msg_type; /* RNDIS_MSG_SET_C */
178 __le32 msg_len; 178 __le32 msg_len;
179 __le32 request_id; 179 __le32 request_id;
@@ -181,14 +181,14 @@ struct rndis_set_c { /* IN */
181} __attribute__ ((packed)); 181} __attribute__ ((packed));
182 182
183struct rndis_reset { /* IN */ 183struct rndis_reset { /* IN */
184 // header and: 184 /* header and: */
185 __le32 msg_type; /* RNDIS_MSG_RESET */ 185 __le32 msg_type; /* RNDIS_MSG_RESET */
186 __le32 msg_len; 186 __le32 msg_len;
187 __le32 reserved; 187 __le32 reserved;
188} __attribute__ ((packed)); 188} __attribute__ ((packed));
189 189
190struct rndis_reset_c { /* OUT */ 190struct rndis_reset_c { /* OUT */
191 // header and: 191 /* header and: */
192 __le32 msg_type; /* RNDIS_MSG_RESET_C */ 192 __le32 msg_type; /* RNDIS_MSG_RESET_C */
193 __le32 msg_len; 193 __le32 msg_len;
194 __le32 status; 194 __le32 status;
@@ -196,7 +196,7 @@ struct rndis_reset_c { /* OUT */
196} __attribute__ ((packed)); 196} __attribute__ ((packed));
197 197
198struct rndis_indicate { /* IN (unrequested) */ 198struct rndis_indicate { /* IN (unrequested) */
199 // header and: 199 /* header and: */
200 __le32 msg_type; /* RNDIS_MSG_INDICATE */ 200 __le32 msg_type; /* RNDIS_MSG_INDICATE */
201 __le32 msg_len; 201 __le32 msg_len;
202 __le32 status; 202 __le32 status;
@@ -208,14 +208,14 @@ struct rndis_indicate { /* IN (unrequested) */
208} __attribute__ ((packed)); 208} __attribute__ ((packed));
209 209
210struct rndis_keepalive { /* OUT (optionally IN) */ 210struct rndis_keepalive { /* OUT (optionally IN) */
211 // header and: 211 /* header and: */
212 __le32 msg_type; /* RNDIS_MSG_KEEPALIVE */ 212 __le32 msg_type; /* RNDIS_MSG_KEEPALIVE */
213 __le32 msg_len; 213 __le32 msg_len;
214 __le32 request_id; 214 __le32 request_id;
215} __attribute__ ((packed)); 215} __attribute__ ((packed));
216 216
217struct rndis_keepalive_c { /* IN (optionally OUT) */ 217struct rndis_keepalive_c { /* IN (optionally OUT) */
218 // header and: 218 /* header and: */
219 __le32 msg_type; /* RNDIS_MSG_KEEPALIVE_C */ 219 __le32 msg_type; /* RNDIS_MSG_KEEPALIVE_C */
220 __le32 msg_len; 220 __le32 msg_len;
221 __le32 request_id; 221 __le32 request_id;
diff --git a/include/linux/usb/serial.h b/include/linux/usb/serial.h
index 0a458b861933..84a4c44c208b 100644
--- a/include/linux/usb/serial.h
+++ b/include/linux/usb/serial.h
@@ -35,6 +35,9 @@ enum port_dev_state {
35 PORT_UNREGISTERING, 35 PORT_UNREGISTERING,
36}; 36};
37 37
38/* USB serial flags */
39#define USB_SERIAL_WRITE_BUSY 0
40
38/** 41/**
39 * usb_serial_port: structure for the specific ports of a device. 42 * usb_serial_port: structure for the specific ports of a device.
40 * @serial: pointer back to the struct usb_serial owner of this port. 43 * @serial: pointer back to the struct usb_serial owner of this port.
@@ -49,7 +52,7 @@ enum port_dev_state {
49 * @interrupt_out_size: the size of the interrupt_out_buffer, in bytes. 52 * @interrupt_out_size: the size of the interrupt_out_buffer, in bytes.
50 * @interrupt_out_urb: pointer to the interrupt out struct urb for this port. 53 * @interrupt_out_urb: pointer to the interrupt out struct urb for this port.
51 * @interrupt_out_endpointAddress: endpoint address for the interrupt out pipe 54 * @interrupt_out_endpointAddress: endpoint address for the interrupt out pipe
52 * for this port. 55 * for this port.
53 * @bulk_in_buffer: pointer to the bulk in buffer for this port. 56 * @bulk_in_buffer: pointer to the bulk in buffer for this port.
54 * @bulk_in_size: the size of the bulk_in_buffer, in bytes. 57 * @bulk_in_size: the size of the bulk_in_buffer, in bytes.
55 * @read_urb: pointer to the bulk in struct urb for this port. 58 * @read_urb: pointer to the bulk in struct urb for this port.
@@ -60,13 +63,17 @@ enum port_dev_state {
60 * @write_urb: pointer to the bulk out struct urb for this port. 63 * @write_urb: pointer to the bulk out struct urb for this port.
61 * @write_fifo: kfifo used to buffer outgoing data 64 * @write_fifo: kfifo used to buffer outgoing data
62 * @write_urb_busy: port`s writing status 65 * @write_urb_busy: port`s writing status
66 * @bulk_out_buffers: pointers to the bulk out buffers for this port
67 * @write_urbs: pointers to the bulk out urbs for this port
68 * @write_urbs_free: status bitmap the for bulk out urbs
69 * @tx_bytes: number of bytes currently in host stack queues
63 * @bulk_out_endpointAddress: endpoint address for the bulk out pipe for this 70 * @bulk_out_endpointAddress: endpoint address for the bulk out pipe for this
64 * port. 71 * port.
72 * @flags: usb serial port flags
65 * @write_wait: a wait_queue_head_t used by the port. 73 * @write_wait: a wait_queue_head_t used by the port.
66 * @work: work queue entry for the line discipline waking up. 74 * @work: work queue entry for the line discipline waking up.
67 * @throttled: nonzero if the read urb is inactive to throttle the device 75 * @throttled: nonzero if the read urb is inactive to throttle the device
68 * @throttle_req: nonzero if the tty wants to throttle us 76 * @throttle_req: nonzero if the tty wants to throttle us
69 * @console: attached usb serial console
70 * @dev: pointer to the serial device 77 * @dev: pointer to the serial device
71 * 78 *
72 * This structure is used by the usb-serial core and drivers for the specific 79 * This structure is used by the usb-serial core and drivers for the specific
@@ -97,16 +104,19 @@ struct usb_serial_port {
97 struct urb *write_urb; 104 struct urb *write_urb;
98 struct kfifo write_fifo; 105 struct kfifo write_fifo;
99 int write_urb_busy; 106 int write_urb_busy;
107
108 unsigned char *bulk_out_buffers[2];
109 struct urb *write_urbs[2];
110 unsigned long write_urbs_free;
100 __u8 bulk_out_endpointAddress; 111 __u8 bulk_out_endpointAddress;
101 112
102 int tx_bytes_flight; 113 int tx_bytes;
103 int urbs_in_flight;
104 114
115 unsigned long flags;
105 wait_queue_head_t write_wait; 116 wait_queue_head_t write_wait;
106 struct work_struct work; 117 struct work_struct work;
107 char throttled; 118 char throttled;
108 char throttle_req; 119 char throttle_req;
109 char console;
110 unsigned long sysrq; /* sysrq timeout */ 120 unsigned long sysrq; /* sysrq timeout */
111 struct device dev; 121 struct device dev;
112 enum port_dev_state dev_state; 122 enum port_dev_state dev_state;
@@ -181,6 +191,8 @@ static inline void usb_set_serial_data(struct usb_serial *serial, void *data)
181 * @id_table: pointer to a list of usb_device_id structures that define all 191 * @id_table: pointer to a list of usb_device_id structures that define all
182 * of the devices this structure can support. 192 * of the devices this structure can support.
183 * @num_ports: the number of different ports this device will have. 193 * @num_ports: the number of different ports this device will have.
194 * @bulk_in_size: bytes to allocate for bulk-in buffer (0 = end-point size)
195 * @bulk_out_size: bytes to allocate for bulk-out buffer (0 = end-point size)
184 * @calc_num_ports: pointer to a function to determine how many ports this 196 * @calc_num_ports: pointer to a function to determine how many ports this
185 * device has dynamically. It will be called after the probe() 197 * device has dynamically. It will be called after the probe()
186 * callback is called, but before attach() 198 * callback is called, but before attach()
@@ -223,7 +235,9 @@ struct usb_serial_driver {
223 struct device_driver driver; 235 struct device_driver driver;
224 struct usb_driver *usb_driver; 236 struct usb_driver *usb_driver;
225 struct usb_dynids dynids; 237 struct usb_dynids dynids;
226 int max_in_flight_urbs; 238
239 size_t bulk_in_size;
240 size_t bulk_out_size;
227 241
228 int (*probe)(struct usb_serial *serial, const struct usb_device_id *id); 242 int (*probe)(struct usb_serial *serial, const struct usb_device_id *id);
229 int (*attach)(struct usb_serial *serial); 243 int (*attach)(struct usb_serial *serial);
@@ -269,6 +283,11 @@ struct usb_serial_driver {
269 void (*write_int_callback)(struct urb *urb); 283 void (*write_int_callback)(struct urb *urb);
270 void (*read_bulk_callback)(struct urb *urb); 284 void (*read_bulk_callback)(struct urb *urb);
271 void (*write_bulk_callback)(struct urb *urb); 285 void (*write_bulk_callback)(struct urb *urb);
286 /* Called by the generic read bulk callback */
287 void (*process_read_urb)(struct urb *urb);
288 /* Called by the generic write implementation */
289 int (*prepare_write_buffer)(struct usb_serial_port *port,
290 void *dest, size_t size);
272}; 291};
273#define to_usb_serial_driver(d) \ 292#define to_usb_serial_driver(d) \
274 container_of(d, struct usb_serial_driver, driver) 293 container_of(d, struct usb_serial_driver, driver)
@@ -318,8 +337,11 @@ extern void usb_serial_generic_disconnect(struct usb_serial *serial);
318extern void usb_serial_generic_release(struct usb_serial *serial); 337extern void usb_serial_generic_release(struct usb_serial *serial);
319extern int usb_serial_generic_register(int debug); 338extern int usb_serial_generic_register(int debug);
320extern void usb_serial_generic_deregister(void); 339extern void usb_serial_generic_deregister(void);
321extern void usb_serial_generic_resubmit_read_urb(struct usb_serial_port *port, 340extern int usb_serial_generic_submit_read_urb(struct usb_serial_port *port,
322 gfp_t mem_flags); 341 gfp_t mem_flags);
342extern void usb_serial_generic_process_read_urb(struct urb *urb);
343extern int usb_serial_generic_prepare_write_buffer(struct usb_serial_port *port,
344 void *dest, size_t size);
323extern int usb_serial_handle_sysrq_char(struct tty_struct *tty, 345extern int usb_serial_handle_sysrq_char(struct tty_struct *tty,
324 struct usb_serial_port *port, 346 struct usb_serial_port *port,
325 unsigned int ch); 347 unsigned int ch);
diff --git a/include/linux/usb/ulpi.h b/include/linux/usb/ulpi.h
index 20675c6ebc4d..2369d07c3c87 100644
--- a/include/linux/usb/ulpi.h
+++ b/include/linux/usb/ulpi.h
@@ -1,6 +1,146 @@
1/*
2 * ulpi.h -- ULPI defines and function prorotypes
3 *
4 * Copyright (C) 2010 Nokia Corporation
5 *
6 * This software is distributed under the terms of the GNU General
7 * Public License ("GPL") as published by the Free Software Foundation,
8 * version 2 of that License.
9 */
10
1#ifndef __LINUX_USB_ULPI_H 11#ifndef __LINUX_USB_ULPI_H
2#define __LINUX_USB_ULPI_H 12#define __LINUX_USB_ULPI_H
3 13
14/*-------------------------------------------------------------------------*/
15
16/*
17 * Macros for Set and Clear
18 * See ULPI 1.1 specification to find the registers with Set and Clear offsets
19 */
20#define ULPI_SET(a) (a + 1)
21#define ULPI_CLR(a) (a + 2)
22
23/*-------------------------------------------------------------------------*/
24
25/*
26 * Register Map
27 */
28#define ULPI_VENDOR_ID_LOW 0x00
29#define ULPI_VENDOR_ID_HIGH 0x01
30#define ULPI_PRODUCT_ID_LOW 0x02
31#define ULPI_PRODUCT_ID_HIGH 0x03
32#define ULPI_FUNC_CTRL 0x04
33#define ULPI_IFC_CTRL 0x07
34#define ULPI_OTG_CTRL 0x0a
35#define ULPI_USB_INT_EN_RISE 0x0d
36#define ULPI_USB_INT_EN_FALL 0x10
37#define ULPI_USB_INT_STS 0x13
38#define ULPI_USB_INT_LATCH 0x14
39#define ULPI_DEBUG 0x15
40#define ULPI_SCRATCH 0x16
41/* Optional Carkit Registers */
42#define ULPI_CARCIT_CTRL 0x19
43#define ULPI_CARCIT_INT_DELAY 0x1c
44#define ULPI_CARCIT_INT_EN 0x1d
45#define ULPI_CARCIT_INT_STS 0x20
46#define ULPI_CARCIT_INT_LATCH 0x21
47#define ULPI_CARCIT_PLS_CTRL 0x22
48/* Other Optional Registers */
49#define ULPI_TX_POS_WIDTH 0x25
50#define ULPI_TX_NEG_WIDTH 0x26
51#define ULPI_POLARITY_RECOVERY 0x27
52/* Access Extended Register Set */
53#define ULPI_ACCESS_EXTENDED 0x2f
54/* Vendor Specific */
55#define ULPI_VENDOR_SPECIFIC 0x30
56/* Extended Registers */
57#define ULPI_EXT_VENDOR_SPECIFIC 0x80
58
59/*-------------------------------------------------------------------------*/
60
61/* Function Control */
62#define ULPI_FUNC_CTRL_XCVRSEL (1 << 0)
63#define ULPI_FUNC_CTRL_XCVRSEL_MASK (3 << 0)
64#define ULPI_FUNC_CTRL_HIGH_SPEED (0 << 0)
65#define ULPI_FUNC_CTRL_FULL_SPEED (1 << 0)
66#define ULPI_FUNC_CTRL_LOW_SPEED (2 << 0)
67#define ULPI_FUNC_CTRL_FS4LS (3 << 0)
68#define ULPI_FUNC_CTRL_TERMSELECT (1 << 2)
69#define ULPI_FUNC_CTRL_OPMODE (1 << 3)
70#define ULPI_FUNC_CTRL_OPMODE_MASK (3 << 3)
71#define ULPI_FUNC_CTRL_OPMODE_NORMAL (0 << 3)
72#define ULPI_FUNC_CTRL_OPMODE_NONDRIVING (1 << 3)
73#define ULPI_FUNC_CTRL_OPMODE_DISABLE_NRZI (2 << 3)
74#define ULPI_FUNC_CTRL_OPMODE_NOSYNC_NOEOP (3 << 3)
75#define ULPI_FUNC_CTRL_RESET (1 << 5)
76#define ULPI_FUNC_CTRL_SUSPENDM (1 << 6)
77
78/* Interface Control */
79#define ULPI_IFC_CTRL_6_PIN_SERIAL_MODE (1 << 0)
80#define ULPI_IFC_CTRL_3_PIN_SERIAL_MODE (1 << 1)
81#define ULPI_IFC_CTRL_CARKITMODE (1 << 2)
82#define ULPI_IFC_CTRL_CLOCKSUSPENDM (1 << 3)
83#define ULPI_IFC_CTRL_AUTORESUME (1 << 4)
84#define ULPI_IFC_CTRL_EXTERNAL_VBUS (1 << 5)
85#define ULPI_IFC_CTRL_PASSTHRU (1 << 6)
86#define ULPI_IFC_CTRL_PROTECT_IFC_DISABLE (1 << 7)
87
88/* OTG Control */
89#define ULPI_OTG_CTRL_ID_PULLUP (1 << 0)
90#define ULPI_OTG_CTRL_DP_PULLDOWN (1 << 1)
91#define ULPI_OTG_CTRL_DM_PULLDOWN (1 << 2)
92#define ULPI_OTG_CTRL_DISCHRGVBUS (1 << 3)
93#define ULPI_OTG_CTRL_CHRGVBUS (1 << 4)
94#define ULPI_OTG_CTRL_DRVVBUS (1 << 5)
95#define ULPI_OTG_CTRL_DRVVBUS_EXT (1 << 6)
96#define ULPI_OTG_CTRL_EXTVBUSIND (1 << 7)
97
98/* USB Interrupt Enable Rising,
99 * USB Interrupt Enable Falling,
100 * USB Interrupt Status and
101 * USB Interrupt Latch
102 */
103#define ULPI_INT_HOST_DISCONNECT (1 << 0)
104#define ULPI_INT_VBUS_VALID (1 << 1)
105#define ULPI_INT_SESS_VALID (1 << 2)
106#define ULPI_INT_SESS_END (1 << 3)
107#define ULPI_INT_IDGRD (1 << 4)
108
109/* Debug */
110#define ULPI_DEBUG_LINESTATE0 (1 << 0)
111#define ULPI_DEBUG_LINESTATE1 (1 << 1)
112
113/* Carkit Control */
114#define ULPI_CARKIT_CTRL_CARKITPWR (1 << 0)
115#define ULPI_CARKIT_CTRL_IDGNDDRV (1 << 1)
116#define ULPI_CARKIT_CTRL_TXDEN (1 << 2)
117#define ULPI_CARKIT_CTRL_RXDEN (1 << 3)
118#define ULPI_CARKIT_CTRL_SPKLEFTEN (1 << 4)
119#define ULPI_CARKIT_CTRL_SPKRIGHTEN (1 << 5)
120#define ULPI_CARKIT_CTRL_MICEN (1 << 6)
121
122/* Carkit Interrupt Enable */
123#define ULPI_CARKIT_INT_EN_IDFLOAT_RISE (1 << 0)
124#define ULPI_CARKIT_INT_EN_IDFLOAT_FALL (1 << 1)
125#define ULPI_CARKIT_INT_EN_CARINTDET (1 << 2)
126#define ULPI_CARKIT_INT_EN_DP_RISE (1 << 3)
127#define ULPI_CARKIT_INT_EN_DP_FALL (1 << 4)
128
129/* Carkit Interrupt Status and
130 * Carkit Interrupt Latch
131 */
132#define ULPI_CARKIT_INT_IDFLOAT (1 << 0)
133#define ULPI_CARKIT_INT_CARINTDET (1 << 1)
134#define ULPI_CARKIT_INT_DP (1 << 2)
135
136/* Carkit Pulse Control*/
137#define ULPI_CARKIT_PLS_CTRL_TXPLSEN (1 << 0)
138#define ULPI_CARKIT_PLS_CTRL_RXPLSEN (1 << 1)
139#define ULPI_CARKIT_PLS_CTRL_SPKRLEFT_BIASEN (1 << 2)
140#define ULPI_CARKIT_PLS_CTRL_SPKRRIGHT_BIASEN (1 << 3)
141
142/*-------------------------------------------------------------------------*/
143
4struct otg_transceiver *otg_ulpi_create(struct otg_io_access_ops *ops, 144struct otg_transceiver *otg_ulpi_create(struct otg_io_access_ops *ops,
5 unsigned int flags); 145 unsigned int flags);
6 146
diff --git a/include/linux/usb/usbnet.h b/include/linux/usb/usbnet.h
index df1e83dd9a54..7ae27a473818 100644
--- a/include/linux/usb/usbnet.h
+++ b/include/linux/usb/usbnet.h
@@ -43,7 +43,7 @@ struct usbnet {
43 /* protocol/interface state */ 43 /* protocol/interface state */
44 struct net_device *net; 44 struct net_device *net;
45 int msg_enable; 45 int msg_enable;
46 unsigned long data [5]; 46 unsigned long data[5];
47 u32 xid; 47 u32 xid;
48 u32 hard_mtu; /* count any extra framing */ 48 u32 hard_mtu; /* count any extra framing */
49 size_t rx_urb_size; /* size for rx urbs */ 49 size_t rx_urb_size; /* size for rx urbs */
@@ -148,8 +148,8 @@ struct driver_info {
148 * much everything except custom framing and chip-specific stuff. 148 * much everything except custom framing and chip-specific stuff.
149 */ 149 */
150extern int usbnet_probe(struct usb_interface *, const struct usb_device_id *); 150extern int usbnet_probe(struct usb_interface *, const struct usb_device_id *);
151extern int usbnet_suspend (struct usb_interface *, pm_message_t ); 151extern int usbnet_suspend(struct usb_interface *, pm_message_t);
152extern int usbnet_resume (struct usb_interface *); 152extern int usbnet_resume(struct usb_interface *);
153extern void usbnet_disconnect(struct usb_interface *); 153extern void usbnet_disconnect(struct usb_interface *);
154 154
155 155
@@ -165,8 +165,8 @@ struct cdc_state {
165 struct usb_interface *data; 165 struct usb_interface *data;
166}; 166};
167 167
168extern int usbnet_generic_cdc_bind (struct usbnet *, struct usb_interface *); 168extern int usbnet_generic_cdc_bind(struct usbnet *, struct usb_interface *);
169extern void usbnet_cdc_unbind (struct usbnet *, struct usb_interface *); 169extern void usbnet_cdc_unbind(struct usbnet *, struct usb_interface *);
170 170
171/* CDC and RNDIS support the same host-chosen packet filters for IN transfers */ 171/* CDC and RNDIS support the same host-chosen packet filters for IN transfers */
172#define DEFAULT_FILTER (USB_CDC_PACKET_TYPE_BROADCAST \ 172#define DEFAULT_FILTER (USB_CDC_PACKET_TYPE_BROADCAST \
@@ -189,29 +189,31 @@ struct skb_data { /* skb->cb is one of these */
189 size_t length; 189 size_t length;
190}; 190};
191 191
192extern int usbnet_open (struct net_device *net); 192extern int usbnet_open(struct net_device *net);
193extern int usbnet_stop (struct net_device *net); 193extern int usbnet_stop(struct net_device *net);
194extern netdev_tx_t usbnet_start_xmit (struct sk_buff *skb, 194extern netdev_tx_t usbnet_start_xmit(struct sk_buff *skb,
195 struct net_device *net); 195 struct net_device *net);
196extern void usbnet_tx_timeout (struct net_device *net); 196extern void usbnet_tx_timeout(struct net_device *net);
197extern int usbnet_change_mtu (struct net_device *net, int new_mtu); 197extern int usbnet_change_mtu(struct net_device *net, int new_mtu);
198 198
199extern int usbnet_get_endpoints(struct usbnet *, struct usb_interface *); 199extern int usbnet_get_endpoints(struct usbnet *, struct usb_interface *);
200extern int usbnet_get_ethernet_addr(struct usbnet *, int); 200extern int usbnet_get_ethernet_addr(struct usbnet *, int);
201extern void usbnet_defer_kevent (struct usbnet *, int); 201extern void usbnet_defer_kevent(struct usbnet *, int);
202extern void usbnet_skb_return (struct usbnet *, struct sk_buff *); 202extern void usbnet_skb_return(struct usbnet *, struct sk_buff *);
203extern void usbnet_unlink_rx_urbs(struct usbnet *); 203extern void usbnet_unlink_rx_urbs(struct usbnet *);
204 204
205extern void usbnet_pause_rx(struct usbnet *); 205extern void usbnet_pause_rx(struct usbnet *);
206extern void usbnet_resume_rx(struct usbnet *); 206extern void usbnet_resume_rx(struct usbnet *);
207extern void usbnet_purge_paused_rxq(struct usbnet *); 207extern void usbnet_purge_paused_rxq(struct usbnet *);
208 208
209extern int usbnet_get_settings (struct net_device *net, struct ethtool_cmd *cmd); 209extern int usbnet_get_settings(struct net_device *net,
210extern int usbnet_set_settings (struct net_device *net, struct ethtool_cmd *cmd); 210 struct ethtool_cmd *cmd);
211extern u32 usbnet_get_link (struct net_device *net); 211extern int usbnet_set_settings(struct net_device *net,
212extern u32 usbnet_get_msglevel (struct net_device *); 212 struct ethtool_cmd *cmd);
213extern void usbnet_set_msglevel (struct net_device *, u32); 213extern u32 usbnet_get_link(struct net_device *net);
214extern void usbnet_get_drvinfo (struct net_device *, struct ethtool_drvinfo *); 214extern u32 usbnet_get_msglevel(struct net_device *);
215extern void usbnet_set_msglevel(struct net_device *, u32);
216extern void usbnet_get_drvinfo(struct net_device *, struct ethtool_drvinfo *);
215extern int usbnet_nway_reset(struct net_device *net); 217extern int usbnet_nway_reset(struct net_device *net);
216 218
217#endif /* __LINUX_USB_USBNET_H */ 219#endif /* __LINUX_USB_USBNET_H */
diff --git a/include/linux/usb/wusb-wa.h b/include/linux/usb/wusb-wa.h
index fb7c359bdfba..f9dec37f617b 100644
--- a/include/linux/usb/wusb-wa.h
+++ b/include/linux/usb/wusb-wa.h
@@ -87,7 +87,7 @@ enum rpipe_crs {
87 * FIXME: explain rpipes 87 * FIXME: explain rpipes
88 */ 88 */
89struct usb_rpipe_descriptor { 89struct usb_rpipe_descriptor {
90 u8 bLength; 90 u8 bLength;
91 u8 bDescriptorType; 91 u8 bDescriptorType;
92 __le16 wRPipeIndex; 92 __le16 wRPipeIndex;
93 __le16 wRequests; 93 __le16 wRequests;
diff --git a/include/linux/uuid.h b/include/linux/uuid.h
new file mode 100644
index 000000000000..5b7efbfcee4e
--- /dev/null
+++ b/include/linux/uuid.h
@@ -0,0 +1,70 @@
1/*
2 * UUID/GUID definition
3 *
4 * Copyright (C) 2010, Intel Corp.
5 * Huang Ying <ying.huang@intel.com>
6 *
7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License version
9 * 2 as published by the Free Software Foundation;
10 *
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
19 */
20
21#ifndef _LINUX_UUID_H_
22#define _LINUX_UUID_H_
23
24#include <linux/types.h>
25#include <linux/string.h>
26
27typedef struct {
28 __u8 b[16];
29} uuid_le;
30
31typedef struct {
32 __u8 b[16];
33} uuid_be;
34
35#define UUID_LE(a, b, c, d0, d1, d2, d3, d4, d5, d6, d7) \
36((uuid_le) \
37{{ (a) & 0xff, ((a) >> 8) & 0xff, ((a) >> 16) & 0xff, ((a) >> 24) & 0xff, \
38 (b) & 0xff, ((b) >> 8) & 0xff, \
39 (c) & 0xff, ((c) >> 8) & 0xff, \
40 (d0), (d1), (d2), (d3), (d4), (d5), (d6), (d7) }})
41
42#define UUID_BE(a, b, c, d0, d1, d2, d3, d4, d5, d6, d7) \
43((uuid_be) \
44{{ ((a) >> 24) & 0xff, ((a) >> 16) & 0xff, ((a) >> 8) & 0xff, (a) & 0xff, \
45 ((b) >> 8) & 0xff, (b) & 0xff, \
46 ((c) >> 8) & 0xff, (c) & 0xff, \
47 (d0), (d1), (d2), (d3), (d4), (d5), (d6), (d7) }})
48
49#define NULL_UUID_LE \
50 UUID_LE(0x00000000, 0x0000, 0x0000, 0x00, 0x00, 0x00, 0x00, \
51 0x00, 0x00, 0x00, 0x00)
52
53#define NULL_UUID_BE \
54 UUID_BE(0x00000000, 0x0000, 0x0000, 0x00, 0x00, 0x00, 0x00, \
55 0x00, 0x00, 0x00, 0x00)
56
57static inline int uuid_le_cmp(const uuid_le u1, const uuid_le u2)
58{
59 return memcmp(&u1, &u2, sizeof(uuid_le));
60}
61
62static inline int uuid_be_cmp(const uuid_be u1, const uuid_be u2)
63{
64 return memcmp(&u1, &u2, sizeof(uuid_be));
65}
66
67extern void uuid_le_gen(uuid_le *u);
68extern void uuid_be_gen(uuid_be *u);
69
70#endif
diff --git a/include/linux/via-core.h b/include/linux/via-core.h
new file mode 100644
index 000000000000..7ffb521e1a7a
--- /dev/null
+++ b/include/linux/via-core.h
@@ -0,0 +1,219 @@
1/*
2 * Copyright 1998-2009 VIA Technologies, Inc. All Rights Reserved.
3 * Copyright 2001-2008 S3 Graphics, Inc. All Rights Reserved.
4 * Copyright 2009-2010 Jonathan Corbet <corbet@lwn.net>
5 * Copyright 2010 Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
6 *
7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public
9 * License as published by the Free Software Foundation;
10 * either version 2, or (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTIES OR REPRESENTATIONS; without even
14 * the implied warranty of MERCHANTABILITY or FITNESS FOR
15 * A PARTICULAR PURPOSE.See the GNU General Public License
16 * for more details.
17 *
18 * You should have received a copy of the GNU General Public License
19 * along with this program; if not, write to the Free Software
20 * Foundation, Inc.,
21 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
22 */
23
24#ifndef __VIA_CORE_H__
25#define __VIA_CORE_H__
26#include <linux/types.h>
27#include <linux/io.h>
28#include <linux/spinlock.h>
29#include <linux/pci.h>
30
31/*
32 * A description of each known serial I2C/GPIO port.
33 */
34enum via_port_type {
35 VIA_PORT_NONE = 0,
36 VIA_PORT_I2C,
37 VIA_PORT_GPIO,
38};
39
40enum via_port_mode {
41 VIA_MODE_OFF = 0,
42 VIA_MODE_I2C, /* Used as I2C port */
43 VIA_MODE_GPIO, /* Two GPIO ports */
44};
45
46enum viafb_i2c_adap {
47 VIA_PORT_26 = 0,
48 VIA_PORT_31,
49 VIA_PORT_25,
50 VIA_PORT_2C,
51 VIA_PORT_3D,
52};
53#define VIAFB_NUM_PORTS 5
54
55struct via_port_cfg {
56 enum via_port_type type;
57 enum via_port_mode mode;
58 u16 io_port;
59 u8 ioport_index;
60};
61
62/*
63 * This is the global viafb "device" containing stuff needed by
64 * all subdevs.
65 */
66struct viafb_dev {
67 struct pci_dev *pdev;
68 int chip_type;
69 struct via_port_cfg *port_cfg;
70 /*
71 * Spinlock for access to device registers. Not yet
72 * globally used.
73 */
74 spinlock_t reg_lock;
75 /*
76 * The framebuffer MMIO region. Little, if anything, touches
77 * this memory directly, and certainly nothing outside of the
78 * framebuffer device itself. We *do* have to be able to allocate
79 * chunks of this memory for other devices, though.
80 */
81 unsigned long fbmem_start;
82 long fbmem_len;
83 void __iomem *fbmem;
84#if defined(CONFIG_FB_VIA_CAMERA) || defined(CONFIG_FB_VIA_CAMERA_MODULE)
85 long camera_fbmem_offset;
86 long camera_fbmem_size;
87#endif
88 /*
89 * The MMIO region for device registers.
90 */
91 unsigned long engine_start;
92 unsigned long engine_len;
93 void __iomem *engine_mmio;
94
95};
96
97/*
98 * Interrupt management.
99 */
100
101void viafb_irq_enable(u32 mask);
102void viafb_irq_disable(u32 mask);
103
104/*
105 * The global interrupt control register and its bits.
106 */
107#define VDE_INTERRUPT 0x200 /* Video interrupt flags/masks */
108#define VDE_I_DVISENSE 0x00000001 /* DVI sense int status */
109#define VDE_I_VBLANK 0x00000002 /* Vertical blank status */
110#define VDE_I_MCCFI 0x00000004 /* MCE compl. frame int status */
111#define VDE_I_VSYNC 0x00000008 /* VGA VSYNC int status */
112#define VDE_I_DMA0DDONE 0x00000010 /* DMA 0 descr done */
113#define VDE_I_DMA0TDONE 0x00000020 /* DMA 0 transfer done */
114#define VDE_I_DMA1DDONE 0x00000040 /* DMA 1 descr done */
115#define VDE_I_DMA1TDONE 0x00000080 /* DMA 1 transfer done */
116#define VDE_I_C1AV 0x00000100 /* Cap Eng 1 act vid end */
117#define VDE_I_HQV0 0x00000200 /* First HQV engine */
118#define VDE_I_HQV1 0x00000400 /* Second HQV engine */
119#define VDE_I_HQV1EN 0x00000800 /* Second HQV engine enable */
120#define VDE_I_C0AV 0x00001000 /* Cap Eng 0 act vid end */
121#define VDE_I_C0VBI 0x00002000 /* Cap Eng 0 VBI end */
122#define VDE_I_C1VBI 0x00004000 /* Cap Eng 1 VBI end */
123#define VDE_I_VSYNC2 0x00008000 /* Sec. Disp. VSYNC */
124#define VDE_I_DVISNSEN 0x00010000 /* DVI sense enable */
125#define VDE_I_VSYNC2EN 0x00020000 /* Sec Disp VSYNC enable */
126#define VDE_I_MCCFIEN 0x00040000 /* MC comp frame int mask enable */
127#define VDE_I_VSYNCEN 0x00080000 /* VSYNC enable */
128#define VDE_I_DMA0DDEN 0x00100000 /* DMA 0 descr done enable */
129#define VDE_I_DMA0TDEN 0x00200000 /* DMA 0 trans done enable */
130#define VDE_I_DMA1DDEN 0x00400000 /* DMA 1 descr done enable */
131#define VDE_I_DMA1TDEN 0x00800000 /* DMA 1 trans done enable */
132#define VDE_I_C1AVEN 0x01000000 /* cap 1 act vid end enable */
133#define VDE_I_HQV0EN 0x02000000 /* First hqv engine enable */
134#define VDE_I_C1VBIEN 0x04000000 /* Cap 1 VBI end enable */
135#define VDE_I_LVDSSI 0x08000000 /* LVDS sense interrupt */
136#define VDE_I_C0AVEN 0x10000000 /* Cap 0 act vid end enable */
137#define VDE_I_C0VBIEN 0x20000000 /* Cap 0 VBI end enable */
138#define VDE_I_LVDSSIEN 0x40000000 /* LVDS Sense enable */
139#define VDE_I_ENABLE 0x80000000 /* Global interrupt enable */
140
141/*
142 * DMA management.
143 */
144int viafb_request_dma(void);
145void viafb_release_dma(void);
146/* void viafb_dma_copy_out(unsigned int offset, dma_addr_t paddr, int len); */
147int viafb_dma_copy_out_sg(unsigned int offset, struct scatterlist *sg, int nsg);
148
149/*
150 * DMA Controller registers.
151 */
152#define VDMA_MR0 0xe00 /* Mod reg 0 */
153#define VDMA_MR_CHAIN 0x01 /* Chaining mode */
154#define VDMA_MR_TDIE 0x02 /* Transfer done int enable */
155#define VDMA_CSR0 0xe04 /* Control/status */
156#define VDMA_C_ENABLE 0x01 /* DMA Enable */
157#define VDMA_C_START 0x02 /* Start a transfer */
158#define VDMA_C_ABORT 0x04 /* Abort a transfer */
159#define VDMA_C_DONE 0x08 /* Transfer is done */
160#define VDMA_MARL0 0xe20 /* Mem addr low */
161#define VDMA_MARH0 0xe24 /* Mem addr high */
162#define VDMA_DAR0 0xe28 /* Device address */
163#define VDMA_DQWCR0 0xe2c /* Count (16-byte) */
164#define VDMA_TMR0 0xe30 /* Tile mode reg */
165#define VDMA_DPRL0 0xe34 /* Not sure */
166#define VDMA_DPR_IN 0x08 /* Inbound transfer to FB */
167#define VDMA_DPRH0 0xe38
168#define VDMA_PMR0 (0xe00 + 0x134) /* Pitch mode */
169
170/*
171 * Useful stuff that probably belongs somewhere global.
172 */
173#define VGA_WIDTH 640
174#define VGA_HEIGHT 480
175
176/*
177 * Indexed port operations. Note that these are all multi-op
178 * functions; every invocation will be racy if you're not holding
179 * reg_lock.
180 */
181
182#define VIAStatus 0x3DA /* Non-indexed port */
183#define VIACR 0x3D4
184#define VIASR 0x3C4
185#define VIAGR 0x3CE
186#define VIAAR 0x3C0
187
188static inline u8 via_read_reg(u16 port, u8 index)
189{
190 outb(index, port);
191 return inb(port + 1);
192}
193
194static inline void via_write_reg(u16 port, u8 index, u8 data)
195{
196 outb(index, port);
197 outb(data, port + 1);
198}
199
200static inline void via_write_reg_mask(u16 port, u8 index, u8 data, u8 mask)
201{
202 u8 old;
203
204 outb(index, port);
205 old = inb(port + 1);
206 outb((data & mask) | (old & ~mask), port + 1);
207}
208
209#define VIA_MISC_REG_READ 0x03CC
210#define VIA_MISC_REG_WRITE 0x03C2
211
212static inline void via_write_misc_reg_mask(u8 data, u8 mask)
213{
214 u8 old = inb(VIA_MISC_REG_READ);
215 outb((data & mask) | (old & ~mask), VIA_MISC_REG_WRITE);
216}
217
218
219#endif /* __VIA_CORE_H__ */
diff --git a/include/linux/via-gpio.h b/include/linux/via-gpio.h
new file mode 100644
index 000000000000..8281aea3dd6d
--- /dev/null
+++ b/include/linux/via-gpio.h
@@ -0,0 +1,14 @@
1/*
2 * Support for viafb GPIO ports.
3 *
4 * Copyright 2009 Jonathan Corbet <corbet@lwn.net>
5 * Distributable under version 2 of the GNU General Public License.
6 */
7
8#ifndef __VIA_GPIO_H__
9#define __VIA_GPIO_H__
10
11extern int viafb_gpio_lookup(const char *name);
12extern int viafb_gpio_init(void);
13extern void viafb_gpio_exit(void);
14#endif
diff --git a/include/linux/via_i2c.h b/include/linux/via_i2c.h
new file mode 100644
index 000000000000..44532e468c05
--- /dev/null
+++ b/include/linux/via_i2c.h
@@ -0,0 +1,42 @@
1/*
2 * Copyright 1998-2009 VIA Technologies, Inc. All Rights Reserved.
3 * Copyright 2001-2008 S3 Graphics, Inc. All Rights Reserved.
4
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public
7 * License as published by the Free Software Foundation;
8 * either version 2, or (at your option) any later version.
9
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTIES OR REPRESENTATIONS; without even
12 * the implied warranty of MERCHANTABILITY or FITNESS FOR
13 * A PARTICULAR PURPOSE.See the GNU General Public License
14 * for more details.
15
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc.,
19 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
20 */
21#ifndef __VIA_I2C_H__
22#define __VIA_I2C_H__
23
24#include <linux/i2c.h>
25#include <linux/i2c-algo-bit.h>
26
27struct via_i2c_stuff {
28 u16 i2c_port; /* GPIO or I2C port */
29 u16 is_active; /* Being used as I2C? */
30 struct i2c_adapter adapter;
31 struct i2c_algo_bit_data algo;
32};
33
34
35int viafb_i2c_readbyte(u8 adap, u8 slave_addr, u8 index, u8 *pdata);
36int viafb_i2c_writebyte(u8 adap, u8 slave_addr, u8 index, u8 data);
37int viafb_i2c_readbytes(u8 adap, u8 slave_addr, u8 index, u8 *buff, int buff_len);
38struct i2c_adapter *viafb_find_i2c_adapter(enum viafb_i2c_adap which);
39
40extern int viafb_i2c_init(void);
41extern void viafb_i2c_exit(void);
42#endif /* __VIA_I2C_H__ */
diff --git a/include/linux/videodev2.h b/include/linux/videodev2.h
index 3793d168b44d..047f7e6edb86 100644
--- a/include/linux/videodev2.h
+++ b/include/linux/videodev2.h
@@ -160,16 +160,6 @@ enum v4l2_buf_type {
160 V4L2_BUF_TYPE_PRIVATE = 0x80, 160 V4L2_BUF_TYPE_PRIVATE = 0x80,
161}; 161};
162 162
163enum v4l2_ctrl_type {
164 V4L2_CTRL_TYPE_INTEGER = 1,
165 V4L2_CTRL_TYPE_BOOLEAN = 2,
166 V4L2_CTRL_TYPE_MENU = 3,
167 V4L2_CTRL_TYPE_BUTTON = 4,
168 V4L2_CTRL_TYPE_INTEGER64 = 5,
169 V4L2_CTRL_TYPE_CTRL_CLASS = 6,
170 V4L2_CTRL_TYPE_STRING = 7,
171};
172
173enum v4l2_tuner_type { 163enum v4l2_tuner_type {
174 V4L2_TUNER_RADIO = 1, 164 V4L2_TUNER_RADIO = 1,
175 V4L2_TUNER_ANALOG_TV = 2, 165 V4L2_TUNER_ANALOG_TV = 2,
@@ -294,6 +284,8 @@ struct v4l2_pix_format {
294 284
295/* Grey formats */ 285/* Grey formats */
296#define V4L2_PIX_FMT_GREY v4l2_fourcc('G', 'R', 'E', 'Y') /* 8 Greyscale */ 286#define V4L2_PIX_FMT_GREY v4l2_fourcc('G', 'R', 'E', 'Y') /* 8 Greyscale */
287#define V4L2_PIX_FMT_Y4 v4l2_fourcc('Y', '0', '4', ' ') /* 4 Greyscale */
288#define V4L2_PIX_FMT_Y6 v4l2_fourcc('Y', '0', '6', ' ') /* 6 Greyscale */
297#define V4L2_PIX_FMT_Y10 v4l2_fourcc('Y', '1', '0', ' ') /* 10 Greyscale */ 289#define V4L2_PIX_FMT_Y10 v4l2_fourcc('Y', '1', '0', ' ') /* 10 Greyscale */
298#define V4L2_PIX_FMT_Y16 v4l2_fourcc('Y', '1', '6', ' ') /* 16 Greyscale */ 290#define V4L2_PIX_FMT_Y16 v4l2_fourcc('Y', '1', '6', ' ') /* 16 Greyscale */
299 291
@@ -369,6 +361,7 @@ struct v4l2_pix_format {
369#define V4L2_PIX_FMT_OV511 v4l2_fourcc('O', '5', '1', '1') /* ov511 JPEG */ 361#define V4L2_PIX_FMT_OV511 v4l2_fourcc('O', '5', '1', '1') /* ov511 JPEG */
370#define V4L2_PIX_FMT_OV518 v4l2_fourcc('O', '5', '1', '8') /* ov518 JPEG */ 362#define V4L2_PIX_FMT_OV518 v4l2_fourcc('O', '5', '1', '8') /* ov518 JPEG */
371#define V4L2_PIX_FMT_STV0680 v4l2_fourcc('S', '6', '8', '0') /* stv0680 bayer */ 363#define V4L2_PIX_FMT_STV0680 v4l2_fourcc('S', '6', '8', '0') /* stv0680 bayer */
364#define V4L2_PIX_FMT_TM6000 v4l2_fourcc('T', 'M', '6', '0') /* tm5600/tm60x0 */
372 365
373/* 366/*
374 * F O R M A T E N U M E R A T I O N 367 * F O R M A T E N U M E R A T I O N
@@ -549,6 +542,8 @@ struct v4l2_buffer {
549#define V4L2_BUF_FLAG_KEYFRAME 0x0008 /* Image is a keyframe (I-frame) */ 542#define V4L2_BUF_FLAG_KEYFRAME 0x0008 /* Image is a keyframe (I-frame) */
550#define V4L2_BUF_FLAG_PFRAME 0x0010 /* Image is a P-frame */ 543#define V4L2_BUF_FLAG_PFRAME 0x0010 /* Image is a P-frame */
551#define V4L2_BUF_FLAG_BFRAME 0x0020 /* Image is a B-frame */ 544#define V4L2_BUF_FLAG_BFRAME 0x0020 /* Image is a B-frame */
545/* Buffer is ready, but the data contained within is corrupted. */
546#define V4L2_BUF_FLAG_ERROR 0x0040
552#define V4L2_BUF_FLAG_TIMECODE 0x0100 /* timecode field is valid */ 547#define V4L2_BUF_FLAG_TIMECODE 0x0100 /* timecode field is valid */
553#define V4L2_BUF_FLAG_INPUT 0x0200 /* input field is valid */ 548#define V4L2_BUF_FLAG_INPUT 0x0200 /* input field is valid */
554 549
@@ -939,6 +934,16 @@ struct v4l2_ext_controls {
939#define V4L2_CTRL_ID2CLASS(id) ((id) & 0x0fff0000UL) 934#define V4L2_CTRL_ID2CLASS(id) ((id) & 0x0fff0000UL)
940#define V4L2_CTRL_DRIVER_PRIV(id) (((id) & 0xffff) >= 0x1000) 935#define V4L2_CTRL_DRIVER_PRIV(id) (((id) & 0xffff) >= 0x1000)
941 936
937enum v4l2_ctrl_type {
938 V4L2_CTRL_TYPE_INTEGER = 1,
939 V4L2_CTRL_TYPE_BOOLEAN = 2,
940 V4L2_CTRL_TYPE_MENU = 3,
941 V4L2_CTRL_TYPE_BUTTON = 4,
942 V4L2_CTRL_TYPE_INTEGER64 = 5,
943 V4L2_CTRL_TYPE_CTRL_CLASS = 6,
944 V4L2_CTRL_TYPE_STRING = 7,
945};
946
942/* Used in the VIDIOC_QUERYCTRL ioctl for querying controls */ 947/* Used in the VIDIOC_QUERYCTRL ioctl for querying controls */
943struct v4l2_queryctrl { 948struct v4l2_queryctrl {
944 __u32 id; 949 __u32 id;
@@ -1023,14 +1028,24 @@ enum v4l2_colorfx {
1023 V4L2_COLORFX_NONE = 0, 1028 V4L2_COLORFX_NONE = 0,
1024 V4L2_COLORFX_BW = 1, 1029 V4L2_COLORFX_BW = 1,
1025 V4L2_COLORFX_SEPIA = 2, 1030 V4L2_COLORFX_SEPIA = 2,
1031 V4L2_COLORFX_NEGATIVE = 3,
1032 V4L2_COLORFX_EMBOSS = 4,
1033 V4L2_COLORFX_SKETCH = 5,
1034 V4L2_COLORFX_SKY_BLUE = 6,
1035 V4L2_COLORFX_GRASS_GREEN = 7,
1036 V4L2_COLORFX_SKIN_WHITEN = 8,
1037 V4L2_COLORFX_VIVID = 9,
1026}; 1038};
1027#define V4L2_CID_AUTOBRIGHTNESS (V4L2_CID_BASE+32) 1039#define V4L2_CID_AUTOBRIGHTNESS (V4L2_CID_BASE+32)
1028#define V4L2_CID_BAND_STOP_FILTER (V4L2_CID_BASE+33) 1040#define V4L2_CID_BAND_STOP_FILTER (V4L2_CID_BASE+33)
1029 1041
1030#define V4L2_CID_ROTATE (V4L2_CID_BASE+34) 1042#define V4L2_CID_ROTATE (V4L2_CID_BASE+34)
1031#define V4L2_CID_BG_COLOR (V4L2_CID_BASE+35) 1043#define V4L2_CID_BG_COLOR (V4L2_CID_BASE+35)
1044
1045#define V4L2_CID_CHROMA_GAIN (V4L2_CID_BASE+36)
1046
1032/* last CID + 1 */ 1047/* last CID + 1 */
1033#define V4L2_CID_LASTP1 (V4L2_CID_BASE+36) 1048#define V4L2_CID_LASTP1 (V4L2_CID_BASE+37)
1034 1049
1035/* MPEG-class control IDs defined by V4L2 */ 1050/* MPEG-class control IDs defined by V4L2 */
1036#define V4L2_CID_MPEG_BASE (V4L2_CTRL_CLASS_MPEG | 0x900) 1051#define V4L2_CID_MPEG_BASE (V4L2_CTRL_CLASS_MPEG | 0x900)
@@ -1276,6 +1291,9 @@ enum v4l2_exposure_auto_type {
1276 1291
1277#define V4L2_CID_PRIVACY (V4L2_CID_CAMERA_CLASS_BASE+16) 1292#define V4L2_CID_PRIVACY (V4L2_CID_CAMERA_CLASS_BASE+16)
1278 1293
1294#define V4L2_CID_IRIS_ABSOLUTE (V4L2_CID_CAMERA_CLASS_BASE+17)
1295#define V4L2_CID_IRIS_RELATIVE (V4L2_CID_CAMERA_CLASS_BASE+18)
1296
1279/* FM Modulator class control IDs */ 1297/* FM Modulator class control IDs */
1280#define V4L2_CID_FM_TX_CLASS_BASE (V4L2_CTRL_CLASS_FM_TX | 0x900) 1298#define V4L2_CID_FM_TX_CLASS_BASE (V4L2_CTRL_CLASS_FM_TX | 0x900)
1281#define V4L2_CID_FM_TX_CLASS (V4L2_CTRL_CLASS_FM_TX | 1) 1299#define V4L2_CID_FM_TX_CLASS (V4L2_CTRL_CLASS_FM_TX | 1)
@@ -1621,6 +1639,38 @@ struct v4l2_streamparm {
1621}; 1639};
1622 1640
1623/* 1641/*
1642 * E V E N T S
1643 */
1644
1645#define V4L2_EVENT_ALL 0
1646#define V4L2_EVENT_VSYNC 1
1647#define V4L2_EVENT_EOS 2
1648#define V4L2_EVENT_PRIVATE_START 0x08000000
1649
1650/* Payload for V4L2_EVENT_VSYNC */
1651struct v4l2_event_vsync {
1652 /* Can be V4L2_FIELD_ANY, _NONE, _TOP or _BOTTOM */
1653 __u8 field;
1654} __attribute__ ((packed));
1655
1656struct v4l2_event {
1657 __u32 type;
1658 union {
1659 struct v4l2_event_vsync vsync;
1660 __u8 data[64];
1661 } u;
1662 __u32 pending;
1663 __u32 sequence;
1664 struct timespec timestamp;
1665 __u32 reserved[9];
1666};
1667
1668struct v4l2_event_subscription {
1669 __u32 type;
1670 __u32 reserved[7];
1671};
1672
1673/*
1624 * A D V A N C E D D E B U G G I N G 1674 * A D V A N C E D D E B U G G I N G
1625 * 1675 *
1626 * NOTE: EXPERIMENTAL API, NEVER RELY ON THIS IN APPLICATIONS! 1676 * NOTE: EXPERIMENTAL API, NEVER RELY ON THIS IN APPLICATIONS!
@@ -1742,6 +1792,9 @@ struct v4l2_dbg_chip_ident {
1742#define VIDIOC_QUERY_DV_PRESET _IOR('V', 86, struct v4l2_dv_preset) 1792#define VIDIOC_QUERY_DV_PRESET _IOR('V', 86, struct v4l2_dv_preset)
1743#define VIDIOC_S_DV_TIMINGS _IOWR('V', 87, struct v4l2_dv_timings) 1793#define VIDIOC_S_DV_TIMINGS _IOWR('V', 87, struct v4l2_dv_timings)
1744#define VIDIOC_G_DV_TIMINGS _IOWR('V', 88, struct v4l2_dv_timings) 1794#define VIDIOC_G_DV_TIMINGS _IOWR('V', 88, struct v4l2_dv_timings)
1795#define VIDIOC_DQEVENT _IOR('V', 89, struct v4l2_event)
1796#define VIDIOC_SUBSCRIBE_EVENT _IOW('V', 90, struct v4l2_event_subscription)
1797#define VIDIOC_UNSUBSCRIBE_EVENT _IOW('V', 91, struct v4l2_event_subscription)
1745 1798
1746/* Reminder: when adding new ioctls please add support for them to 1799/* Reminder: when adding new ioctls please add support for them to
1747 drivers/media/video/v4l2-compat-ioctl32.c as well! */ 1800 drivers/media/video/v4l2-compat-ioctl32.c as well! */
diff --git a/include/linux/virtio.h b/include/linux/virtio.h
index 40d1709bdbf4..aff5b4f74041 100644
--- a/include/linux/virtio.h
+++ b/include/linux/virtio.h
@@ -7,6 +7,7 @@
7#include <linux/spinlock.h> 7#include <linux/spinlock.h>
8#include <linux/device.h> 8#include <linux/device.h>
9#include <linux/mod_devicetable.h> 9#include <linux/mod_devicetable.h>
10#include <linux/gfp.h>
10 11
11/** 12/**
12 * virtqueue - a queue to register buffers for sending or receiving. 13 * virtqueue - a queue to register buffers for sending or receiving.
@@ -14,7 +15,6 @@
14 * @callback: the function to call when buffers are consumed (can be NULL). 15 * @callback: the function to call when buffers are consumed (can be NULL).
15 * @name: the name of this virtqueue (mainly for debugging) 16 * @name: the name of this virtqueue (mainly for debugging)
16 * @vdev: the virtio device this queue was created for. 17 * @vdev: the virtio device this queue was created for.
17 * @vq_ops: the operations for this virtqueue (see below).
18 * @priv: a pointer for the virtqueue implementation to use. 18 * @priv: a pointer for the virtqueue implementation to use.
19 */ 19 */
20struct virtqueue { 20struct virtqueue {
@@ -22,60 +22,71 @@ struct virtqueue {
22 void (*callback)(struct virtqueue *vq); 22 void (*callback)(struct virtqueue *vq);
23 const char *name; 23 const char *name;
24 struct virtio_device *vdev; 24 struct virtio_device *vdev;
25 struct virtqueue_ops *vq_ops;
26 void *priv; 25 void *priv;
27}; 26};
28 27
29/** 28/**
30 * virtqueue_ops - operations for virtqueue abstraction layer 29 * operations for virtqueue
31 * @add_buf: expose buffer to other end 30 * virtqueue_add_buf: expose buffer to other end
32 * vq: the struct virtqueue we're talking about. 31 * vq: the struct virtqueue we're talking about.
33 * sg: the description of the buffer(s). 32 * sg: the description of the buffer(s).
34 * out_num: the number of sg readable by other side 33 * out_num: the number of sg readable by other side
35 * in_num: the number of sg which are writable (after readable ones) 34 * in_num: the number of sg which are writable (after readable ones)
36 * data: the token identifying the buffer. 35 * data: the token identifying the buffer.
36 * gfp: how to do memory allocations (if necessary).
37 * Returns remaining capacity of queue (sg segments) or a negative error. 37 * Returns remaining capacity of queue (sg segments) or a negative error.
38 * @kick: update after add_buf 38 * virtqueue_kick: update after add_buf
39 * vq: the struct virtqueue 39 * vq: the struct virtqueue
40 * After one or more add_buf calls, invoke this to kick the other side. 40 * After one or more add_buf calls, invoke this to kick the other side.
41 * @get_buf: get the next used buffer 41 * virtqueue_get_buf: get the next used buffer
42 * vq: the struct virtqueue we're talking about. 42 * vq: the struct virtqueue we're talking about.
43 * len: the length written into the buffer 43 * len: the length written into the buffer
44 * Returns NULL or the "data" token handed to add_buf. 44 * Returns NULL or the "data" token handed to add_buf.
45 * @disable_cb: disable callbacks 45 * virtqueue_disable_cb: disable callbacks
46 * vq: the struct virtqueue we're talking about. 46 * vq: the struct virtqueue we're talking about.
47 * Note that this is not necessarily synchronous, hence unreliable and only 47 * Note that this is not necessarily synchronous, hence unreliable and only
48 * useful as an optimization. 48 * useful as an optimization.
49 * @enable_cb: restart callbacks after disable_cb. 49 * virtqueue_enable_cb: restart callbacks after disable_cb.
50 * vq: the struct virtqueue we're talking about. 50 * vq: the struct virtqueue we're talking about.
51 * This re-enables callbacks; it returns "false" if there are pending 51 * This re-enables callbacks; it returns "false" if there are pending
52 * buffers in the queue, to detect a possible race between the driver 52 * buffers in the queue, to detect a possible race between the driver
53 * checking for more work, and enabling callbacks. 53 * checking for more work, and enabling callbacks.
54 * @detach_unused_buf: detach first unused buffer 54 * virtqueue_detach_unused_buf: detach first unused buffer
55 * vq: the struct virtqueue we're talking about. 55 * vq: the struct virtqueue we're talking about.
56 * Returns NULL or the "data" token handed to add_buf 56 * Returns NULL or the "data" token handed to add_buf
57 * 57 *
58 * Locking rules are straightforward: the driver is responsible for 58 * Locking rules are straightforward: the driver is responsible for
59 * locking. No two operations may be invoked simultaneously, with the exception 59 * locking. No two operations may be invoked simultaneously, with the exception
60 * of @disable_cb. 60 * of virtqueue_disable_cb.
61 * 61 *
62 * All operations can be called in any context. 62 * All operations can be called in any context.
63 */ 63 */
64struct virtqueue_ops {
65 int (*add_buf)(struct virtqueue *vq,
66 struct scatterlist sg[],
67 unsigned int out_num,
68 unsigned int in_num,
69 void *data);
70 64
71 void (*kick)(struct virtqueue *vq); 65int virtqueue_add_buf_gfp(struct virtqueue *vq,
66 struct scatterlist sg[],
67 unsigned int out_num,
68 unsigned int in_num,
69 void *data,
70 gfp_t gfp);
72 71
73 void *(*get_buf)(struct virtqueue *vq, unsigned int *len); 72static inline int virtqueue_add_buf(struct virtqueue *vq,
73 struct scatterlist sg[],
74 unsigned int out_num,
75 unsigned int in_num,
76 void *data)
77{
78 return virtqueue_add_buf_gfp(vq, sg, out_num, in_num, data, GFP_ATOMIC);
79}
74 80
75 void (*disable_cb)(struct virtqueue *vq); 81void virtqueue_kick(struct virtqueue *vq);
76 bool (*enable_cb)(struct virtqueue *vq); 82
77 void *(*detach_unused_buf)(struct virtqueue *vq); 83void *virtqueue_get_buf(struct virtqueue *vq, unsigned int *len);
78}; 84
85void virtqueue_disable_cb(struct virtqueue *vq);
86
87bool virtqueue_enable_cb(struct virtqueue *vq);
88
89void *virtqueue_detach_unused_buf(struct virtqueue *vq);
79 90
80/** 91/**
81 * virtio_device - representation of a device using virtio 92 * virtio_device - representation of a device using virtio
diff --git a/include/linux/virtio_blk.h b/include/linux/virtio_blk.h
index e52029e98919..167720d695ed 100644
--- a/include/linux/virtio_blk.h
+++ b/include/linux/virtio_blk.h
@@ -17,6 +17,8 @@
17#define VIRTIO_BLK_F_FLUSH 9 /* Cache flush command support */ 17#define VIRTIO_BLK_F_FLUSH 9 /* Cache flush command support */
18#define VIRTIO_BLK_F_TOPOLOGY 10 /* Topology information is available */ 18#define VIRTIO_BLK_F_TOPOLOGY 10 /* Topology information is available */
19 19
20#define VIRTIO_BLK_ID_BYTES 20 /* ID string length */
21
20struct virtio_blk_config { 22struct virtio_blk_config {
21 /* The capacity (in 512-byte sectors). */ 23 /* The capacity (in 512-byte sectors). */
22 __u64 capacity; 24 __u64 capacity;
@@ -67,6 +69,9 @@ struct virtio_blk_config {
67/* Cache flush command */ 69/* Cache flush command */
68#define VIRTIO_BLK_T_FLUSH 4 70#define VIRTIO_BLK_T_FLUSH 4
69 71
72/* Get device ID command */
73#define VIRTIO_BLK_T_GET_ID 8
74
70/* Barrier before this op. */ 75/* Barrier before this op. */
71#define VIRTIO_BLK_T_BARRIER 0x80000000 76#define VIRTIO_BLK_T_BARRIER 0x80000000
72 77
diff --git a/include/linux/virtio_console.h b/include/linux/virtio_console.h
index 92228a8fbcbc..a85064db8f94 100644
--- a/include/linux/virtio_console.h
+++ b/include/linux/virtio_console.h
@@ -12,14 +12,39 @@
12 12
13/* Feature bits */ 13/* Feature bits */
14#define VIRTIO_CONSOLE_F_SIZE 0 /* Does host provide console size? */ 14#define VIRTIO_CONSOLE_F_SIZE 0 /* Does host provide console size? */
15#define VIRTIO_CONSOLE_F_MULTIPORT 1 /* Does host provide multiple ports? */
16
17#define VIRTIO_CONSOLE_BAD_ID (~(u32)0)
15 18
16struct virtio_console_config { 19struct virtio_console_config {
17 /* colums of the screens */ 20 /* colums of the screens */
18 __u16 cols; 21 __u16 cols;
19 /* rows of the screens */ 22 /* rows of the screens */
20 __u16 rows; 23 __u16 rows;
24 /* max. number of ports this device can hold */
25 __u32 max_nr_ports;
21} __attribute__((packed)); 26} __attribute__((packed));
22 27
28/*
29 * A message that's passed between the Host and the Guest for a
30 * particular port.
31 */
32struct virtio_console_control {
33 __u32 id; /* Port number */
34 __u16 event; /* The kind of control event (see below) */
35 __u16 value; /* Extra information for the key */
36};
37
38/* Some events for control messages */
39#define VIRTIO_CONSOLE_DEVICE_READY 0
40#define VIRTIO_CONSOLE_PORT_ADD 1
41#define VIRTIO_CONSOLE_PORT_REMOVE 2
42#define VIRTIO_CONSOLE_PORT_READY 3
43#define VIRTIO_CONSOLE_CONSOLE_PORT 4
44#define VIRTIO_CONSOLE_RESIZE 5
45#define VIRTIO_CONSOLE_PORT_OPEN 6
46#define VIRTIO_CONSOLE_PORT_NAME 7
47
23#ifdef __KERNEL__ 48#ifdef __KERNEL__
24int __init virtio_cons_early_init(int (*put_chars)(u32, const char *, int)); 49int __init virtio_cons_early_init(int (*put_chars)(u32, const char *, int));
25#endif /* __KERNEL__ */ 50#endif /* __KERNEL__ */
diff --git a/include/linux/vmstat.h b/include/linux/vmstat.h
index 117f0dd8ad03..7f43ccdc1d38 100644
--- a/include/linux/vmstat.h
+++ b/include/linux/vmstat.h
@@ -43,6 +43,10 @@ enum vm_event_item { PGPGIN, PGPGOUT, PSWPIN, PSWPOUT,
43 KSWAPD_LOW_WMARK_HIT_QUICKLY, KSWAPD_HIGH_WMARK_HIT_QUICKLY, 43 KSWAPD_LOW_WMARK_HIT_QUICKLY, KSWAPD_HIGH_WMARK_HIT_QUICKLY,
44 KSWAPD_SKIP_CONGESTION_WAIT, 44 KSWAPD_SKIP_CONGESTION_WAIT,
45 PAGEOUTRUN, ALLOCSTALL, PGROTATED, 45 PAGEOUTRUN, ALLOCSTALL, PGROTATED,
46#ifdef CONFIG_COMPACTION
47 COMPACTBLOCKS, COMPACTPAGES, COMPACTPAGEFAILED,
48 COMPACTSTALL, COMPACTFAIL, COMPACTSUCCESS,
49#endif
46#ifdef CONFIG_HUGETLB_PAGE 50#ifdef CONFIG_HUGETLB_PAGE
47 HTLB_BUDDY_PGALLOC, HTLB_BUDDY_PGALLOC_FAIL, 51 HTLB_BUDDY_PGALLOC, HTLB_BUDDY_PGALLOC_FAIL,
48#endif 52#endif
diff --git a/include/linux/wait.h b/include/linux/wait.h
index a48e16b77d5e..0836ccc57121 100644
--- a/include/linux/wait.h
+++ b/include/linux/wait.h
@@ -127,12 +127,26 @@ static inline void __add_wait_queue(wait_queue_head_t *head, wait_queue_t *new)
127/* 127/*
128 * Used for wake-one threads: 128 * Used for wake-one threads:
129 */ 129 */
130static inline void __add_wait_queue_exclusive(wait_queue_head_t *q,
131 wait_queue_t *wait)
132{
133 wait->flags |= WQ_FLAG_EXCLUSIVE;
134 __add_wait_queue(q, wait);
135}
136
130static inline void __add_wait_queue_tail(wait_queue_head_t *head, 137static inline void __add_wait_queue_tail(wait_queue_head_t *head,
131 wait_queue_t *new) 138 wait_queue_t *new)
132{ 139{
133 list_add_tail(&new->task_list, &head->task_list); 140 list_add_tail(&new->task_list, &head->task_list);
134} 141}
135 142
143static inline void __add_wait_queue_tail_exclusive(wait_queue_head_t *q,
144 wait_queue_t *wait)
145{
146 wait->flags |= WQ_FLAG_EXCLUSIVE;
147 __add_wait_queue_tail(q, wait);
148}
149
136static inline void __remove_wait_queue(wait_queue_head_t *head, 150static inline void __remove_wait_queue(wait_queue_head_t *head,
137 wait_queue_t *old) 151 wait_queue_t *old)
138{ 152{
@@ -362,6 +376,155 @@ do { \
362 __ret; \ 376 __ret; \
363}) 377})
364 378
379
380#define __wait_event_interruptible_locked(wq, condition, exclusive, irq) \
381({ \
382 int __ret = 0; \
383 DEFINE_WAIT(__wait); \
384 if (exclusive) \
385 __wait.flags |= WQ_FLAG_EXCLUSIVE; \
386 do { \
387 if (likely(list_empty(&__wait.task_list))) \
388 __add_wait_queue_tail(&(wq), &__wait); \
389 set_current_state(TASK_INTERRUPTIBLE); \
390 if (signal_pending(current)) { \
391 __ret = -ERESTARTSYS; \
392 break; \
393 } \
394 if (irq) \
395 spin_unlock_irq(&(wq).lock); \
396 else \
397 spin_unlock(&(wq).lock); \
398 schedule(); \
399 if (irq) \
400 spin_lock_irq(&(wq).lock); \
401 else \
402 spin_lock(&(wq).lock); \
403 } while (!(condition)); \
404 __remove_wait_queue(&(wq), &__wait); \
405 __set_current_state(TASK_RUNNING); \
406 __ret; \
407})
408
409
410/**
411 * wait_event_interruptible_locked - sleep until a condition gets true
412 * @wq: the waitqueue to wait on
413 * @condition: a C expression for the event to wait for
414 *
415 * The process is put to sleep (TASK_INTERRUPTIBLE) until the
416 * @condition evaluates to true or a signal is received.
417 * The @condition is checked each time the waitqueue @wq is woken up.
418 *
419 * It must be called with wq.lock being held. This spinlock is
420 * unlocked while sleeping but @condition testing is done while lock
421 * is held and when this macro exits the lock is held.
422 *
423 * The lock is locked/unlocked using spin_lock()/spin_unlock()
424 * functions which must match the way they are locked/unlocked outside
425 * of this macro.
426 *
427 * wake_up_locked() has to be called after changing any variable that could
428 * change the result of the wait condition.
429 *
430 * The function will return -ERESTARTSYS if it was interrupted by a
431 * signal and 0 if @condition evaluated to true.
432 */
433#define wait_event_interruptible_locked(wq, condition) \
434 ((condition) \
435 ? 0 : __wait_event_interruptible_locked(wq, condition, 0, 0))
436
437/**
438 * wait_event_interruptible_locked_irq - sleep until a condition gets true
439 * @wq: the waitqueue to wait on
440 * @condition: a C expression for the event to wait for
441 *
442 * The process is put to sleep (TASK_INTERRUPTIBLE) until the
443 * @condition evaluates to true or a signal is received.
444 * The @condition is checked each time the waitqueue @wq is woken up.
445 *
446 * It must be called with wq.lock being held. This spinlock is
447 * unlocked while sleeping but @condition testing is done while lock
448 * is held and when this macro exits the lock is held.
449 *
450 * The lock is locked/unlocked using spin_lock_irq()/spin_unlock_irq()
451 * functions which must match the way they are locked/unlocked outside
452 * of this macro.
453 *
454 * wake_up_locked() has to be called after changing any variable that could
455 * change the result of the wait condition.
456 *
457 * The function will return -ERESTARTSYS if it was interrupted by a
458 * signal and 0 if @condition evaluated to true.
459 */
460#define wait_event_interruptible_locked_irq(wq, condition) \
461 ((condition) \
462 ? 0 : __wait_event_interruptible_locked(wq, condition, 0, 1))
463
464/**
465 * wait_event_interruptible_exclusive_locked - sleep exclusively until a condition gets true
466 * @wq: the waitqueue to wait on
467 * @condition: a C expression for the event to wait for
468 *
469 * The process is put to sleep (TASK_INTERRUPTIBLE) until the
470 * @condition evaluates to true or a signal is received.
471 * The @condition is checked each time the waitqueue @wq is woken up.
472 *
473 * It must be called with wq.lock being held. This spinlock is
474 * unlocked while sleeping but @condition testing is done while lock
475 * is held and when this macro exits the lock is held.
476 *
477 * The lock is locked/unlocked using spin_lock()/spin_unlock()
478 * functions which must match the way they are locked/unlocked outside
479 * of this macro.
480 *
481 * The process is put on the wait queue with an WQ_FLAG_EXCLUSIVE flag
482 * set thus when other process waits process on the list if this
483 * process is awaken further processes are not considered.
484 *
485 * wake_up_locked() has to be called after changing any variable that could
486 * change the result of the wait condition.
487 *
488 * The function will return -ERESTARTSYS if it was interrupted by a
489 * signal and 0 if @condition evaluated to true.
490 */
491#define wait_event_interruptible_exclusive_locked(wq, condition) \
492 ((condition) \
493 ? 0 : __wait_event_interruptible_locked(wq, condition, 1, 0))
494
495/**
496 * wait_event_interruptible_exclusive_locked_irq - sleep until a condition gets true
497 * @wq: the waitqueue to wait on
498 * @condition: a C expression for the event to wait for
499 *
500 * The process is put to sleep (TASK_INTERRUPTIBLE) until the
501 * @condition evaluates to true or a signal is received.
502 * The @condition is checked each time the waitqueue @wq is woken up.
503 *
504 * It must be called with wq.lock being held. This spinlock is
505 * unlocked while sleeping but @condition testing is done while lock
506 * is held and when this macro exits the lock is held.
507 *
508 * The lock is locked/unlocked using spin_lock_irq()/spin_unlock_irq()
509 * functions which must match the way they are locked/unlocked outside
510 * of this macro.
511 *
512 * The process is put on the wait queue with an WQ_FLAG_EXCLUSIVE flag
513 * set thus when other process waits process on the list if this
514 * process is awaken further processes are not considered.
515 *
516 * wake_up_locked() has to be called after changing any variable that could
517 * change the result of the wait condition.
518 *
519 * The function will return -ERESTARTSYS if it was interrupted by a
520 * signal and 0 if @condition evaluated to true.
521 */
522#define wait_event_interruptible_exclusive_locked_irq(wq, condition) \
523 ((condition) \
524 ? 0 : __wait_event_interruptible_locked(wq, condition, 1, 1))
525
526
527
365#define __wait_event_killable(wq, condition, ret) \ 528#define __wait_event_killable(wq, condition, ret) \
366do { \ 529do { \
367 DEFINE_WAIT(__wait); \ 530 DEFINE_WAIT(__wait); \
@@ -404,25 +567,6 @@ do { \
404}) 567})
405 568
406/* 569/*
407 * Must be called with the spinlock in the wait_queue_head_t held.
408 */
409static inline void add_wait_queue_exclusive_locked(wait_queue_head_t *q,
410 wait_queue_t * wait)
411{
412 wait->flags |= WQ_FLAG_EXCLUSIVE;
413 __add_wait_queue_tail(q, wait);
414}
415
416/*
417 * Must be called with the spinlock in the wait_queue_head_t held.
418 */
419static inline void remove_wait_queue_locked(wait_queue_head_t *q,
420 wait_queue_t * wait)
421{
422 __remove_wait_queue(q, wait);
423}
424
425/*
426 * These are the old interfaces to sleep waiting for an event. 570 * These are the old interfaces to sleep waiting for an event.
427 * They are racy. DO NOT use them, use the wait_event* interfaces above. 571 * They are racy. DO NOT use them, use the wait_event* interfaces above.
428 * We plan to remove these interfaces. 572 * We plan to remove these interfaces.
diff --git a/include/linux/writeback.h b/include/linux/writeback.h
index 36520ded3e06..cc97d6caf2b3 100644
--- a/include/linux/writeback.h
+++ b/include/linux/writeback.h
@@ -65,6 +65,15 @@ struct writeback_control {
65 * so we use a single control to update them 65 * so we use a single control to update them
66 */ 66 */
67 unsigned no_nrwrite_index_update:1; 67 unsigned no_nrwrite_index_update:1;
68
69 /*
70 * For WB_SYNC_ALL, the sb must always be pinned. For WB_SYNC_NONE,
71 * the writeback code will pin the sb for the caller. However,
72 * for eg umount, the caller does WB_SYNC_NONE but already has
73 * the sb pinned. If the below is set, caller already has the
74 * sb pinned.
75 */
76 unsigned sb_pinned:1;
68}; 77};
69 78
70/* 79/*
@@ -73,6 +82,7 @@ struct writeback_control {
73struct bdi_writeback; 82struct bdi_writeback;
74int inode_wait(void *); 83int inode_wait(void *);
75void writeback_inodes_sb(struct super_block *); 84void writeback_inodes_sb(struct super_block *);
85void writeback_inodes_sb_locked(struct super_block *);
76int writeback_inodes_sb_if_idle(struct super_block *); 86int writeback_inodes_sb_if_idle(struct super_block *);
77void sync_inodes_sb(struct super_block *); 87void sync_inodes_sb(struct super_block *);
78void writeback_inodes_wbc(struct writeback_control *wbc); 88void writeback_inodes_wbc(struct writeback_control *wbc);
@@ -96,8 +106,14 @@ static inline void inode_sync_wait(struct inode *inode)
96/* 106/*
97 * mm/page-writeback.c 107 * mm/page-writeback.c
98 */ 108 */
99void laptop_io_completion(void); 109#ifdef CONFIG_BLOCK
110void laptop_io_completion(struct backing_dev_info *info);
100void laptop_sync_completion(void); 111void laptop_sync_completion(void);
112void laptop_mode_sync(struct work_struct *work);
113void laptop_mode_timer_fn(unsigned long data);
114#else
115static inline void laptop_sync_completion(void) { }
116#endif
101void throttle_vm_writeout(gfp_t gfp_mask); 117void throttle_vm_writeout(gfp_t gfp_mask);
102 118
103/* These are exported to sysctl. */ 119/* These are exported to sysctl. */
diff --git a/include/linux/xattr.h b/include/linux/xattr.h
index fb9b7e6e1e2d..0cfa1e9c4cc1 100644
--- a/include/linux/xattr.h
+++ b/include/linux/xattr.h
@@ -37,7 +37,7 @@ struct inode;
37struct dentry; 37struct dentry;
38 38
39struct xattr_handler { 39struct xattr_handler {
40 char *prefix; 40 const char *prefix;
41 int flags; /* fs private flags passed back to the handlers */ 41 int flags; /* fs private flags passed back to the handlers */
42 size_t (*list)(struct dentry *dentry, char *list, size_t list_size, 42 size_t (*list)(struct dentry *dentry, char *list, size_t list_size,
43 const char *name, size_t name_len, int handler_flags); 43 const char *name, size_t name_len, int handler_flags);
diff --git a/include/linux/z2_battery.h b/include/linux/z2_battery.h
new file mode 100644
index 000000000000..7b9750404d22
--- /dev/null
+++ b/include/linux/z2_battery.h
@@ -0,0 +1,17 @@
1#ifndef _LINUX_Z2_BATTERY_H
2#define _LINUX_Z2_BATTERY_H
3
4struct z2_battery_info {
5 int batt_I2C_bus;
6 int batt_I2C_addr;
7 int batt_I2C_reg;
8 int charge_gpio;
9 int min_voltage;
10 int max_voltage;
11 int batt_div;
12 int batt_mult;
13 int batt_tech;
14 char *batt_name;
15};
16
17#endif
diff --git a/include/linux/zorro.h b/include/linux/zorro.h
index 913bfc226dda..7bf9db525e9e 100644
--- a/include/linux/zorro.h
+++ b/include/linux/zorro.h
@@ -38,8 +38,6 @@
38typedef __u32 zorro_id; 38typedef __u32 zorro_id;
39 39
40 40
41#define ZORRO_WILDCARD (0xffffffff) /* not official */
42
43/* Include the ID list */ 41/* Include the ID list */
44#include <linux/zorro_ids.h> 42#include <linux/zorro_ids.h>
45 43
@@ -116,6 +114,7 @@ struct ConfigDev {
116 114
117#include <linux/init.h> 115#include <linux/init.h>
118#include <linux/ioport.h> 116#include <linux/ioport.h>
117#include <linux/mod_devicetable.h>
119 118
120#include <asm/zorro.h> 119#include <asm/zorro.h>
121 120
@@ -142,29 +141,10 @@ struct zorro_dev {
142 * Zorro bus 141 * Zorro bus
143 */ 142 */
144 143
145struct zorro_bus {
146 struct list_head devices; /* list of devices on this bus */
147 unsigned int num_resources; /* number of resources */
148 struct resource resources[4]; /* address space routed to this bus */
149 struct device dev;
150 char name[10];
151};
152
153extern struct zorro_bus zorro_bus; /* single Zorro bus */
154extern struct bus_type zorro_bus_type; 144extern struct bus_type zorro_bus_type;
155 145
156 146
157 /* 147 /*
158 * Zorro device IDs
159 */
160
161struct zorro_device_id {
162 zorro_id id; /* Device ID or ZORRO_WILDCARD */
163 unsigned long driver_data; /* Data private to the driver */
164};
165
166
167 /*
168 * Zorro device drivers 148 * Zorro device drivers
169 */ 149 */
170 150