aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/Kbuild4
-rw-r--r--include/linux/aer.h10
-rw-r--r--include/linux/async_tx.h156
-rw-r--r--include/linux/ata.h30
-rw-r--r--include/linux/attribute_container.h1
-rw-r--r--include/linux/audit.h11
-rw-r--r--include/linux/backing-dev.h1
-rw-r--r--include/linux/blkdev.h33
-rw-r--r--include/linux/bsg.h69
-rw-r--r--include/linux/bug.h7
-rw-r--r--include/linux/capability.h1
-rw-r--r--include/linux/cdrom.h4
-rw-r--r--include/linux/cobalt-nvram.h109
-rw-r--r--include/linux/configfs.h34
-rw-r--r--include/linux/console.h3
-rw-r--r--include/linux/consolemap.h5
-rw-r--r--include/linux/cpu.h1
-rw-r--r--include/linux/crc7.h14
-rw-r--r--include/linux/crypto.h20
-rw-r--r--include/linux/debugfs.h9
-rw-r--r--include/linux/device.h5
-rw-r--r--include/linux/dlm.h14
-rw-r--r--include/linux/dlm_device.h22
-rw-r--r--include/linux/dlm_netlink.h56
-rw-r--r--include/linux/dma-mapping.h4
-rw-r--r--include/linux/dmaengine.h293
-rw-r--r--include/linux/dmi.h8
-rw-r--r--include/linux/ds17287rtc.h1
-rw-r--r--include/linux/edd.h4
-rw-r--r--include/linux/eeprom_93cx6.h72
-rw-r--r--include/linux/efs_fs.h1
-rw-r--r--include/linux/elfnote.h22
-rw-r--r--include/linux/etherdevice.h9
-rw-r--r--include/linux/ethtool.h1
-rw-r--r--include/linux/eventfd.h3
-rw-r--r--include/linux/exportfs.h126
-rw-r--r--include/linux/ext2_fs_sb.h2
-rw-r--r--include/linux/ext3_fs_sb.h2
-rw-r--r--include/linux/ext4_fs.h104
-rw-r--r--include/linux/ext4_fs_extents.h43
-rw-r--r--include/linux/ext4_fs_i.h5
-rw-r--r--include/linux/ext4_fs_sb.h5
-rw-r--r--include/linux/falloc.h6
-rw-r--r--include/linux/fb.h3
-rw-r--r--include/linux/file.h1
-rw-r--r--include/linux/firewire-cdev.h297
-rw-r--r--include/linux/freezer.h14
-rw-r--r--include/linux/fs.h170
-rw-r--r--include/linux/fsl_devices.h7
-rw-r--r--include/linux/fuse.h2
-rw-r--r--include/linux/gfp.h19
-rw-r--r--include/linux/gfs2_ondisk.h142
-rw-r--r--include/linux/gpio_mouse.h61
-rw-r--r--include/linux/hardirq.h13
-rw-r--r--include/linux/hid.h56
-rw-r--r--include/linux/highmem.h51
-rw-r--r--include/linux/hrtimer.h5
-rw-r--r--include/linux/hugetlb.h2
-rw-r--r--include/linux/i2c.h19
-rw-r--r--include/linux/i2o.h5
-rw-r--r--include/linux/ide.h18
-rw-r--r--include/linux/idr.h32
-rw-r--r--include/linux/ieee80211.h11
-rw-r--r--include/linux/if_link.h47
-rw-r--r--include/linux/if_macvlan.h9
-rw-r--r--include/linux/if_ppp.h16
-rw-r--r--include/linux/if_pppol2tp.h69
-rw-r--r--include/linux/if_pppox.h16
-rw-r--r--include/linux/if_tun.h2
-rw-r--r--include/linux/if_vlan.h19
-rw-r--r--include/linux/inetdevice.h1
-rw-r--r--include/linux/init.h4
-rw-r--r--include/linux/init_task.h2
-rw-r--r--include/linux/input.h163
-rw-r--r--include/linux/io.h29
-rw-r--r--include/linux/ioprio.h6
-rw-r--r--include/linux/ip_mp_alg.h22
-rw-r--r--include/linux/ipc.h12
-rw-r--r--include/linux/ipv6.h10
-rw-r--r--include/linux/irda.h28
-rw-r--r--include/linux/irq.h1
-rw-r--r--include/linux/jbd2.h6
-rw-r--r--include/linux/kallsyms.h7
-rw-r--r--include/linux/kernel.h1
-rw-r--r--include/linux/kernelcapi.h2
-rw-r--r--include/linux/kmod.h52
-rw-r--r--include/linux/kobject.h9
-rw-r--r--include/linux/ktime.h10
-rw-r--r--include/linux/leds.h1
-rw-r--r--include/linux/libata.h51
-rw-r--r--include/linux/limits.h2
-rw-r--r--include/linux/linux_logo.h8
-rw-r--r--include/linux/lockd/bind.h9
-rw-r--r--include/linux/lockd/lockd.h1
-rw-r--r--include/linux/lzo.h44
-rw-r--r--include/linux/magic.h1
-rw-r--r--include/linux/major.h2
-rw-r--r--include/linux/mempolicy.h6
-rw-r--r--include/linux/mlx4/device.h2
-rw-r--r--include/linux/mlx4/qp.h3
-rw-r--r--include/linux/mm.h45
-rw-r--r--include/linux/mmzone.h33
-rw-r--r--include/linux/mnt_namespace.h2
-rw-r--r--include/linux/module.h1
-rw-r--r--include/linux/msdos_fs.h2
-rw-r--r--include/linux/mv643xx.h4
-rw-r--r--include/linux/ncp_fs.h2
-rw-r--r--include/linux/netdevice.h141
-rw-r--r--include/linux/netfilter.h3
-rw-r--r--include/linux/netfilter/nf_conntrack_pptp.h2
-rw-r--r--include/linux/netfilter/x_tables.h36
-rw-r--r--include/linux/netfilter/xt_connlimit.h17
-rw-r--r--include/linux/netfilter/xt_u32.h40
-rw-r--r--include/linux/netfilter_ipv4/ipt_CLUSTERIP.h4
-rw-r--r--include/linux/netfilter_ipv4/ipt_iprange.h2
-rw-r--r--include/linux/netfilter_ipv6/ip6_tables.h10
-rw-r--r--include/linux/nfs4.h1
-rw-r--r--include/linux/nfs4_mount.h3
-rw-r--r--include/linux/nfs_fs.h28
-rw-r--r--include/linux/nfs_fs_sb.h8
-rw-r--r--include/linux/nfs_mount.h3
-rw-r--r--include/linux/nfs_page.h25
-rw-r--r--include/linux/nfs_xdr.h5
-rw-r--r--include/linux/nfsd/export.h41
-rw-r--r--include/linux/nfsd/interface.h13
-rw-r--r--include/linux/nfsd/nfsd.h9
-rw-r--r--include/linux/nfsd/state.h3
-rw-r--r--include/linux/nfsd/xdr4.h7
-rw-r--r--include/linux/notifier.h3
-rw-r--r--include/linux/nsproxy.h3
-rw-r--r--include/linux/page-flags.h5
-rw-r--r--include/linux/pata_platform.h5
-rw-r--r--include/linux/pci.h31
-rw-r--r--include/linux/pci_ids.h80
-rw-r--r--include/linux/pda_power.h31
-rw-r--r--include/linux/percpu.h2
-rw-r--r--include/linux/percpu_counter.h18
-rw-r--r--include/linux/pid_namespace.h2
-rw-r--r--include/linux/pipe_fs_i.h117
-rw-r--r--include/linux/pkt_cls.h17
-rw-r--r--include/linux/pkt_sched.h9
-rw-r--r--include/linux/pm.h67
-rw-r--r--include/linux/power_supply.h180
-rw-r--r--include/linux/prctl.h4
-rw-r--r--include/linux/prefetch.h2
-rw-r--r--include/linux/proc_fs.h13
-rw-r--r--include/linux/ptrace.h2
-rw-r--r--include/linux/raid/bitmap.h6
-rw-r--r--include/linux/raid/md_k.h2
-rw-r--r--include/linux/raid/raid5.h97
-rw-r--r--include/linux/raid/xor.h5
-rw-r--r--include/linux/reboot.h5
-rw-r--r--include/linux/rtc/m48t59.h57
-rw-r--r--include/linux/rtnetlink.h20
-rw-r--r--include/linux/sched.h262
-rw-r--r--include/linux/screen_info.h9
-rw-r--r--include/linux/scx200_gpio.h2
-rw-r--r--include/linux/seccomp.h19
-rw-r--r--include/linux/security.h17
-rw-r--r--include/linux/seq_file.h11
-rw-r--r--include/linux/serial.h6
-rw-r--r--include/linux/serial_8250.h6
-rw-r--r--include/linux/serial_core.h8
-rw-r--r--include/linux/serio.h1
-rw-r--r--include/linux/signal.h1
-rw-r--r--include/linux/skbuff.h67
-rw-r--r--include/linux/slab.h154
-rw-r--r--include/linux/slab_def.h38
-rw-r--r--include/linux/slob_def.h36
-rw-r--r--include/linux/slub_def.h33
-rw-r--r--include/linux/sm501-regs.h8
-rw-r--r--include/linux/smp.h13
-rw-r--r--include/linux/smp_lock.h1
-rw-r--r--include/linux/socket.h4
-rw-r--r--include/linux/sonypi.h2
-rw-r--r--include/linux/spi/spi.h1
-rw-r--r--include/linux/spi/spi_bitbang.h1
-rw-r--r--include/linux/spi/tle62x0.h24
-rw-r--r--include/linux/spinlock.h7
-rw-r--r--include/linux/splice.h73
-rw-r--r--include/linux/string.h4
-rw-r--r--include/linux/sunrpc/auth.h48
-rw-r--r--include/linux/sunrpc/auth_gss.h6
-rw-r--r--include/linux/sunrpc/clnt.h33
-rw-r--r--include/linux/sunrpc/gss_api.h3
-rw-r--r--include/linux/sunrpc/rpc_pipe_fs.h2
-rw-r--r--include/linux/sunrpc/sched.h6
-rw-r--r--include/linux/sunrpc/svc.h4
-rw-r--r--include/linux/sunrpc/svcauth.h1
-rw-r--r--include/linux/sunrpc/svcauth_gss.h1
-rw-r--r--include/linux/sunrpc/svcsock.h1
-rw-r--r--include/linux/sunrpc/xprt.h16
-rw-r--r--include/linux/swap.h3
-rw-r--r--include/linux/syscalls.h3
-rw-r--r--include/linux/sysdev.h3
-rw-r--r--include/linux/sysfs.h43
-rw-r--r--include/linux/taskstats.h5
-rw-r--r--include/linux/time.h5
-rw-r--r--include/linux/timer.h16
-rw-r--r--include/linux/topology.h14
-rw-r--r--include/linux/tty.h39
-rw-r--r--include/linux/udp.h6
-rw-r--r--include/linux/uio.h9
-rw-r--r--include/linux/usb.h85
-rw-r--r--include/linux/usb/Kbuild1
-rw-r--r--include/linux/usb/gadgetfs.h (renamed from include/linux/usb_gadgetfs.h)24
-rw-r--r--include/linux/usb/quirks.h3
-rw-r--r--include/linux/usb/serial.h7
-rw-r--r--include/linux/usb_gadget.h48
-rw-r--r--include/linux/user_namespace.h61
-rw-r--r--include/linux/utsname.h16
-rw-r--r--include/linux/vmalloc.h7
-rw-r--r--include/linux/vmstat.h5
-rw-r--r--include/linux/vt_kern.h2
-rw-r--r--include/linux/wait.h16
-rw-r--r--include/linux/workqueue.h15
216 files changed, 4020 insertions, 1549 deletions
diff --git a/include/linux/Kbuild b/include/linux/Kbuild
index f317c270d4bf..bcf875e844fe 100644
--- a/include/linux/Kbuild
+++ b/include/linux/Kbuild
@@ -49,6 +49,7 @@ header-y += consolemap.h
49header-y += const.h 49header-y += const.h
50header-y += cycx_cfm.h 50header-y += cycx_cfm.h
51header-y += dlm_device.h 51header-y += dlm_device.h
52header-y += dlm_netlink.h
52header-y += dm-ioctl.h 53header-y += dm-ioctl.h
53header-y += dn.h 54header-y += dn.h
54header-y += dqblk_v1.h 55header-y += dqblk_v1.h
@@ -90,7 +91,6 @@ header-y += in6.h
90header-y += in_route.h 91header-y += in_route.h
91header-y += ioctl.h 92header-y += ioctl.h
92header-y += ipmi_msgdefs.h 93header-y += ipmi_msgdefs.h
93header-y += ip_mp_alg.h
94header-y += ipsec.h 94header-y += ipsec.h
95header-y += ipx.h 95header-y += ipx.h
96header-y += irda.h 96header-y += irda.h
@@ -225,6 +225,7 @@ unifdef-y += if_fddi.h
225unifdef-y += if_frad.h 225unifdef-y += if_frad.h
226unifdef-y += if_ltalk.h 226unifdef-y += if_ltalk.h
227unifdef-y += if_link.h 227unifdef-y += if_link.h
228unifdef-y += if_pppol2tp.h
228unifdef-y += if_pppox.h 229unifdef-y += if_pppox.h
229unifdef-y += if_shaper.h 230unifdef-y += if_shaper.h
230unifdef-y += if_tr.h 231unifdef-y += if_tr.h
@@ -246,7 +247,6 @@ unifdef-y += isdn.h
246unifdef-y += isdnif.h 247unifdef-y += isdnif.h
247unifdef-y += isdn_divertif.h 248unifdef-y += isdn_divertif.h
248unifdef-y += isdn_ppp.h 249unifdef-y += isdn_ppp.h
249unifdef-y += isicom.h
250unifdef-y += jbd.h 250unifdef-y += jbd.h
251unifdef-y += joystick.h 251unifdef-y += joystick.h
252unifdef-y += kdev_t.h 252unifdef-y += kdev_t.h
diff --git a/include/linux/aer.h b/include/linux/aer.h
index 402e178b38eb..509656286e53 100644
--- a/include/linux/aer.h
+++ b/include/linux/aer.h
@@ -13,11 +13,13 @@ extern int pci_enable_pcie_error_reporting(struct pci_dev *dev);
13extern int pci_find_aer_capability(struct pci_dev *dev); 13extern int pci_find_aer_capability(struct pci_dev *dev);
14extern int pci_disable_pcie_error_reporting(struct pci_dev *dev); 14extern int pci_disable_pcie_error_reporting(struct pci_dev *dev);
15extern int pci_cleanup_aer_uncorrect_error_status(struct pci_dev *dev); 15extern int pci_cleanup_aer_uncorrect_error_status(struct pci_dev *dev);
16extern int pci_cleanup_aer_correct_error_status(struct pci_dev *dev);
16#else 17#else
17#define pci_enable_pcie_error_reporting(dev) do { } while (0) 18#define pci_enable_pcie_error_reporting(dev) (-EINVAL)
18#define pci_find_aer_capability(dev) do { } while (0) 19#define pci_find_aer_capability(dev) (0)
19#define pci_disable_pcie_error_reporting(dev) do { } while (0) 20#define pci_disable_pcie_error_reporting(dev) (-EINVAL)
20#define pci_cleanup_aer_uncorrect_error_status(dev) do { } while (0) 21#define pci_cleanup_aer_uncorrect_error_status(dev) (-EINVAL)
22#define pci_cleanup_aer_correct_error_status(dev) (-EINVAL)
21#endif 23#endif
22 24
23#endif //_AER_H_ 25#endif //_AER_H_
diff --git a/include/linux/async_tx.h b/include/linux/async_tx.h
new file mode 100644
index 000000000000..ff1255079fa1
--- /dev/null
+++ b/include/linux/async_tx.h
@@ -0,0 +1,156 @@
1/*
2 * Copyright © 2006, Intel Corporation.
3 *
4 * This program is free software; you can redistribute it and/or modify it
5 * under the terms and conditions of the GNU General Public License,
6 * version 2, as published by the Free Software Foundation.
7 *
8 * This program is distributed in the hope it will be useful, but WITHOUT
9 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
10 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for
11 * more details.
12 *
13 * You should have received a copy of the GNU General Public License along with
14 * this program; if not, write to the Free Software Foundation, Inc.,
15 * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
16 *
17 */
18#ifndef _ASYNC_TX_H_
19#define _ASYNC_TX_H_
20#include <linux/dmaengine.h>
21#include <linux/spinlock.h>
22#include <linux/interrupt.h>
23
24/**
25 * dma_chan_ref - object used to manage dma channels received from the
26 * dmaengine core.
27 * @chan - the channel being tracked
28 * @node - node for the channel to be placed on async_tx_master_list
29 * @rcu - for list_del_rcu
30 * @count - number of times this channel is listed in the pool
31 * (for channels with multiple capabiities)
32 */
33struct dma_chan_ref {
34 struct dma_chan *chan;
35 struct list_head node;
36 struct rcu_head rcu;
37 atomic_t count;
38};
39
40/**
41 * async_tx_flags - modifiers for the async_* calls
42 * @ASYNC_TX_XOR_ZERO_DST: this flag must be used for xor operations where the
43 * the destination address is not a source. The asynchronous case handles this
44 * implicitly, the synchronous case needs to zero the destination block.
45 * @ASYNC_TX_XOR_DROP_DST: this flag must be used if the destination address is
46 * also one of the source addresses. In the synchronous case the destination
47 * address is an implied source, whereas the asynchronous case it must be listed
48 * as a source. The destination address must be the first address in the source
49 * array.
50 * @ASYNC_TX_ASSUME_COHERENT: skip cache maintenance operations
51 * @ASYNC_TX_ACK: immediately ack the descriptor, precludes setting up a
52 * dependency chain
53 * @ASYNC_TX_DEP_ACK: ack the dependency descriptor. Useful for chaining.
54 * @ASYNC_TX_KMAP_SRC: if the transaction is to be performed synchronously
55 * take an atomic mapping (KM_USER0) on the source page(s)
56 * @ASYNC_TX_KMAP_DST: if the transaction is to be performed synchronously
57 * take an atomic mapping (KM_USER0) on the dest page(s)
58 */
59enum async_tx_flags {
60 ASYNC_TX_XOR_ZERO_DST = (1 << 0),
61 ASYNC_TX_XOR_DROP_DST = (1 << 1),
62 ASYNC_TX_ASSUME_COHERENT = (1 << 2),
63 ASYNC_TX_ACK = (1 << 3),
64 ASYNC_TX_DEP_ACK = (1 << 4),
65 ASYNC_TX_KMAP_SRC = (1 << 5),
66 ASYNC_TX_KMAP_DST = (1 << 6),
67};
68
69#ifdef CONFIG_DMA_ENGINE
70void async_tx_issue_pending_all(void);
71enum dma_status dma_wait_for_async_tx(struct dma_async_tx_descriptor *tx);
72void async_tx_run_dependencies(struct dma_async_tx_descriptor *tx);
73struct dma_chan *
74async_tx_find_channel(struct dma_async_tx_descriptor *depend_tx,
75 enum dma_transaction_type tx_type);
76#else
77static inline void async_tx_issue_pending_all(void)
78{
79 do { } while (0);
80}
81
82static inline enum dma_status
83dma_wait_for_async_tx(struct dma_async_tx_descriptor *tx)
84{
85 return DMA_SUCCESS;
86}
87
88static inline void
89async_tx_run_dependencies(struct dma_async_tx_descriptor *tx,
90 struct dma_chan *host_chan)
91{
92 do { } while (0);
93}
94
95static inline struct dma_chan *
96async_tx_find_channel(struct dma_async_tx_descriptor *depend_tx,
97 enum dma_transaction_type tx_type)
98{
99 return NULL;
100}
101#endif
102
103/**
104 * async_tx_sync_epilog - actions to take if an operation is run synchronously
105 * @flags: async_tx flags
106 * @depend_tx: transaction depends on depend_tx
107 * @cb_fn: function to call when the transaction completes
108 * @cb_fn_param: parameter to pass to the callback routine
109 */
110static inline void
111async_tx_sync_epilog(unsigned long flags,
112 struct dma_async_tx_descriptor *depend_tx,
113 dma_async_tx_callback cb_fn, void *cb_fn_param)
114{
115 if (cb_fn)
116 cb_fn(cb_fn_param);
117
118 if (depend_tx && (flags & ASYNC_TX_DEP_ACK))
119 async_tx_ack(depend_tx);
120}
121
122void
123async_tx_submit(struct dma_chan *chan, struct dma_async_tx_descriptor *tx,
124 enum async_tx_flags flags, struct dma_async_tx_descriptor *depend_tx,
125 dma_async_tx_callback cb_fn, void *cb_fn_param);
126
127struct dma_async_tx_descriptor *
128async_xor(struct page *dest, struct page **src_list, unsigned int offset,
129 int src_cnt, size_t len, enum async_tx_flags flags,
130 struct dma_async_tx_descriptor *depend_tx,
131 dma_async_tx_callback cb_fn, void *cb_fn_param);
132
133struct dma_async_tx_descriptor *
134async_xor_zero_sum(struct page *dest, struct page **src_list,
135 unsigned int offset, int src_cnt, size_t len,
136 u32 *result, enum async_tx_flags flags,
137 struct dma_async_tx_descriptor *depend_tx,
138 dma_async_tx_callback cb_fn, void *cb_fn_param);
139
140struct dma_async_tx_descriptor *
141async_memcpy(struct page *dest, struct page *src, unsigned int dest_offset,
142 unsigned int src_offset, size_t len, enum async_tx_flags flags,
143 struct dma_async_tx_descriptor *depend_tx,
144 dma_async_tx_callback cb_fn, void *cb_fn_param);
145
146struct dma_async_tx_descriptor *
147async_memset(struct page *dest, int val, unsigned int offset,
148 size_t len, enum async_tx_flags flags,
149 struct dma_async_tx_descriptor *depend_tx,
150 dma_async_tx_callback cb_fn, void *cb_fn_param);
151
152struct dma_async_tx_descriptor *
153async_trigger_callback(enum async_tx_flags flags,
154 struct dma_async_tx_descriptor *depend_tx,
155 dma_async_tx_callback cb_fn, void *cb_fn_param);
156#endif /* _ASYNC_TX_H_ */
diff --git a/include/linux/ata.h b/include/linux/ata.h
index 703febb2df31..b5a20162af32 100644
--- a/include/linux/ata.h
+++ b/include/linux/ata.h
@@ -126,6 +126,7 @@ enum {
126 ATA_REG_IRQ = ATA_REG_NSECT, 126 ATA_REG_IRQ = ATA_REG_NSECT,
127 127
128 /* ATA device commands */ 128 /* ATA device commands */
129 ATA_CMD_DEV_RESET = 0x08, /* ATAPI device reset */
129 ATA_CMD_CHK_POWER = 0xE5, /* check power mode */ 130 ATA_CMD_CHK_POWER = 0xE5, /* check power mode */
130 ATA_CMD_STANDBY = 0xE2, /* place in standby power mode */ 131 ATA_CMD_STANDBY = 0xE2, /* place in standby power mode */
131 ATA_CMD_IDLE = 0xE3, /* place in idle power mode */ 132 ATA_CMD_IDLE = 0xE3, /* place in idle power mode */
@@ -163,6 +164,8 @@ enum {
163 ATA_CMD_SET_MAX = 0xF9, 164 ATA_CMD_SET_MAX = 0xF9,
164 ATA_CMD_SET_MAX_EXT = 0x37, 165 ATA_CMD_SET_MAX_EXT = 0x37,
165 ATA_CMD_READ_LOG_EXT = 0x2f, 166 ATA_CMD_READ_LOG_EXT = 0x2f,
167 ATA_CMD_PMP_READ = 0xE4,
168 ATA_CMD_PMP_WRITE = 0xE8,
166 169
167 /* READ_LOG_EXT pages */ 170 /* READ_LOG_EXT pages */
168 ATA_LOG_SATA_NCQ = 0x10, 171 ATA_LOG_SATA_NCQ = 0x10,
@@ -211,6 +214,28 @@ enum {
211 0=to device, 1=to host */ 214 0=to device, 1=to host */
212 ATAPI_CDB_LEN = 16, 215 ATAPI_CDB_LEN = 16,
213 216
217 /* PMP stuff */
218 SATA_PMP_MAX_PORTS = 15,
219 SATA_PMP_CTRL_PORT = 15,
220
221 SATA_PMP_GSCR_DWORDS = 128,
222 SATA_PMP_GSCR_PROD_ID = 0,
223 SATA_PMP_GSCR_REV = 1,
224 SATA_PMP_GSCR_PORT_INFO = 2,
225 SATA_PMP_GSCR_ERROR = 32,
226 SATA_PMP_GSCR_ERROR_EN = 33,
227 SATA_PMP_GSCR_FEAT = 64,
228 SATA_PMP_GSCR_FEAT_EN = 96,
229
230 SATA_PMP_PSCR_STATUS = 0,
231 SATA_PMP_PSCR_ERROR = 1,
232 SATA_PMP_PSCR_CONTROL = 2,
233
234 SATA_PMP_FEAT_BIST = (1 << 0),
235 SATA_PMP_FEAT_PMREQ = (1 << 1),
236 SATA_PMP_FEAT_DYNSSC = (1 << 2),
237 SATA_PMP_FEAT_NOTIFY = (1 << 3),
238
214 /* cable types */ 239 /* cable types */
215 ATA_CBL_NONE = 0, 240 ATA_CBL_NONE = 0,
216 ATA_CBL_PATA40 = 1, 241 ATA_CBL_PATA40 = 1,
@@ -417,4 +442,9 @@ static inline int lba_48_ok(u64 block, u32 n_block)
417 return ((block + n_block - 1) < ((u64)1 << 48)) && (n_block <= 65536); 442 return ((block + n_block - 1) < ((u64)1 << 48)) && (n_block <= 65536);
418} 443}
419 444
445#define sata_pmp_gscr_vendor(gscr) ((gscr)[SATA_PMP_GSCR_PROD_ID] & 0xffff)
446#define sata_pmp_gscr_devid(gscr) ((gscr)[SATA_PMP_GSCR_PROD_ID] >> 16)
447#define sata_pmp_gscr_rev(gscr) (((gscr)[SATA_PMP_GSCR_REV] >> 8) & 0xff)
448#define sata_pmp_gscr_ports(gscr) ((gscr)[SATA_PMP_GSCR_PORT_INFO] & 0xf)
449
420#endif /* __LINUX_ATA_H__ */ 450#endif /* __LINUX_ATA_H__ */
diff --git a/include/linux/attribute_container.h b/include/linux/attribute_container.h
index 93bfb0beb62a..8ff274933948 100644
--- a/include/linux/attribute_container.h
+++ b/include/linux/attribute_container.h
@@ -12,7 +12,6 @@
12#include <linux/device.h> 12#include <linux/device.h>
13#include <linux/list.h> 13#include <linux/list.h>
14#include <linux/klist.h> 14#include <linux/klist.h>
15#include <linux/spinlock.h>
16 15
17struct attribute_container { 16struct attribute_container {
18 struct list_head node; 17 struct list_head node;
diff --git a/include/linux/audit.h b/include/linux/audit.h
index fccc6e50298a..8ca7ca0b47f0 100644
--- a/include/linux/audit.h
+++ b/include/linux/audit.h
@@ -63,9 +63,12 @@
63#define AUDIT_ADD_RULE 1011 /* Add syscall filtering rule */ 63#define AUDIT_ADD_RULE 1011 /* Add syscall filtering rule */
64#define AUDIT_DEL_RULE 1012 /* Delete syscall filtering rule */ 64#define AUDIT_DEL_RULE 1012 /* Delete syscall filtering rule */
65#define AUDIT_LIST_RULES 1013 /* List syscall filtering rules */ 65#define AUDIT_LIST_RULES 1013 /* List syscall filtering rules */
66#define AUDIT_TTY_GET 1014 /* Get TTY auditing status */
67#define AUDIT_TTY_SET 1015 /* Set TTY auditing status */
66 68
67#define AUDIT_FIRST_USER_MSG 1100 /* Userspace messages mostly uninteresting to kernel */ 69#define AUDIT_FIRST_USER_MSG 1100 /* Userspace messages mostly uninteresting to kernel */
68#define AUDIT_USER_AVC 1107 /* We filter this differently */ 70#define AUDIT_USER_AVC 1107 /* We filter this differently */
71#define AUDIT_USER_TTY 1124 /* Non-ICANON TTY input meaning */
69#define AUDIT_LAST_USER_MSG 1199 72#define AUDIT_LAST_USER_MSG 1199
70#define AUDIT_FIRST_USER_MSG2 2100 /* More user space messages */ 73#define AUDIT_FIRST_USER_MSG2 2100 /* More user space messages */
71#define AUDIT_LAST_USER_MSG2 2999 74#define AUDIT_LAST_USER_MSG2 2999
@@ -92,6 +95,7 @@
92#define AUDIT_KERNEL_OTHER 1316 /* For use by 3rd party modules */ 95#define AUDIT_KERNEL_OTHER 1316 /* For use by 3rd party modules */
93#define AUDIT_FD_PAIR 1317 /* audit record for pipe/socketpair */ 96#define AUDIT_FD_PAIR 1317 /* audit record for pipe/socketpair */
94#define AUDIT_OBJ_PID 1318 /* ptrace target */ 97#define AUDIT_OBJ_PID 1318 /* ptrace target */
98#define AUDIT_TTY 1319 /* Input on an administrative TTY */
95 99
96#define AUDIT_AVC 1400 /* SE Linux avc denial or grant */ 100#define AUDIT_AVC 1400 /* SE Linux avc denial or grant */
97#define AUDIT_SELINUX_ERR 1401 /* Internal SE Linux Errors */ 101#define AUDIT_SELINUX_ERR 1401 /* Internal SE Linux Errors */
@@ -289,6 +293,10 @@ struct audit_status {
289 __u32 backlog; /* messages waiting in queue */ 293 __u32 backlog; /* messages waiting in queue */
290}; 294};
291 295
296struct audit_tty_status {
297 __u32 enabled; /* 1 = enabled, 0 = disabled */
298};
299
292/* audit_rule_data supports filter rules with both integer and string 300/* audit_rule_data supports filter rules with both integer and string
293 * fields. It corresponds with AUDIT_ADD_RULE, AUDIT_DEL_RULE and 301 * fields. It corresponds with AUDIT_ADD_RULE, AUDIT_DEL_RULE and
294 * AUDIT_LIST_RULES requests. 302 * AUDIT_LIST_RULES requests.
@@ -515,11 +523,13 @@ extern void audit_log_d_path(struct audit_buffer *ab,
515 const char *prefix, 523 const char *prefix,
516 struct dentry *dentry, 524 struct dentry *dentry,
517 struct vfsmount *vfsmnt); 525 struct vfsmount *vfsmnt);
526extern void audit_log_lost(const char *message);
518 /* Private API (for audit.c only) */ 527 /* Private API (for audit.c only) */
519extern int audit_filter_user(struct netlink_skb_parms *cb, int type); 528extern int audit_filter_user(struct netlink_skb_parms *cb, int type);
520extern int audit_filter_type(int type); 529extern int audit_filter_type(int type);
521extern int audit_receive_filter(int type, int pid, int uid, int seq, 530extern int audit_receive_filter(int type, int pid, int uid, int seq,
522 void *data, size_t datasz, uid_t loginuid, u32 sid); 531 void *data, size_t datasz, uid_t loginuid, u32 sid);
532extern int audit_enabled;
523#else 533#else
524#define audit_log(c,g,t,f,...) do { ; } while (0) 534#define audit_log(c,g,t,f,...) do { ; } while (0)
525#define audit_log_start(c,g,t) ({ NULL; }) 535#define audit_log_start(c,g,t) ({ NULL; })
@@ -530,6 +540,7 @@ extern int audit_receive_filter(int type, int pid, int uid, int seq,
530#define audit_log_untrustedstring(a,s) do { ; } while (0) 540#define audit_log_untrustedstring(a,s) do { ; } while (0)
531#define audit_log_n_untrustedstring(a,n,s) do { ; } while (0) 541#define audit_log_n_untrustedstring(a,n,s) do { ; } while (0)
532#define audit_log_d_path(b,p,d,v) do { ; } while (0) 542#define audit_log_d_path(b,p,d,v) do { ; } while (0)
543#define audit_enabled 0
533#endif 544#endif
534#endif 545#endif
535#endif 546#endif
diff --git a/include/linux/backing-dev.h b/include/linux/backing-dev.h
index f2542c24b328..7011d6255593 100644
--- a/include/linux/backing-dev.h
+++ b/include/linux/backing-dev.h
@@ -93,7 +93,6 @@ static inline int bdi_rw_congested(struct backing_dev_info *bdi)
93void clear_bdi_congested(struct backing_dev_info *bdi, int rw); 93void clear_bdi_congested(struct backing_dev_info *bdi, int rw);
94void set_bdi_congested(struct backing_dev_info *bdi, int rw); 94void set_bdi_congested(struct backing_dev_info *bdi, int rw);
95long congestion_wait(int rw, long timeout); 95long congestion_wait(int rw, long timeout);
96long congestion_wait_interruptible(int rw, long timeout);
97void congestion_end(int rw); 96void congestion_end(int rw);
98 97
99#define bdi_cap_writeback_dirty(bdi) \ 98#define bdi_cap_writeback_dirty(bdi) \
diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h
index db5b00a792f5..f78965fc6426 100644
--- a/include/linux/blkdev.h
+++ b/include/linux/blkdev.h
@@ -14,6 +14,7 @@
14#include <linux/bio.h> 14#include <linux/bio.h>
15#include <linux/module.h> 15#include <linux/module.h>
16#include <linux/stringify.h> 16#include <linux/stringify.h>
17#include <linux/bsg.h>
17 18
18#include <asm/scatterlist.h> 19#include <asm/scatterlist.h>
19 20
@@ -41,6 +42,8 @@ struct elevator_queue;
41typedef struct elevator_queue elevator_t; 42typedef struct elevator_queue elevator_t;
42struct request_pm_state; 43struct request_pm_state;
43struct blk_trace; 44struct blk_trace;
45struct request;
46struct sg_io_hdr;
44 47
45#define BLKDEV_MIN_RQ 4 48#define BLKDEV_MIN_RQ 4
46#define BLKDEV_MAX_RQ 128 /* Default maximum */ 49#define BLKDEV_MAX_RQ 128 /* Default maximum */
@@ -314,6 +317,9 @@ struct request {
314 */ 317 */
315 rq_end_io_fn *end_io; 318 rq_end_io_fn *end_io;
316 void *end_io_data; 319 void *end_io_data;
320
321 /* for bidi */
322 struct request *next_rq;
317}; 323};
318 324
319/* 325/*
@@ -468,6 +474,10 @@ struct request_queue
468 unsigned int bi_size; 474 unsigned int bi_size;
469 475
470 struct mutex sysfs_lock; 476 struct mutex sysfs_lock;
477
478#if defined(CONFIG_BLK_DEV_BSG)
479 struct bsg_class_device bsg_dev;
480#endif
471}; 481};
472 482
473#define QUEUE_FLAG_CLUSTER 0 /* cluster several segments into 1 */ 483#define QUEUE_FLAG_CLUSTER 0 /* cluster several segments into 1 */
@@ -479,6 +489,7 @@ struct request_queue
479#define QUEUE_FLAG_REENTER 6 /* Re-entrancy avoidance */ 489#define QUEUE_FLAG_REENTER 6 /* Re-entrancy avoidance */
480#define QUEUE_FLAG_PLUGGED 7 /* queue is plugged */ 490#define QUEUE_FLAG_PLUGGED 7 /* queue is plugged */
481#define QUEUE_FLAG_ELVSWITCH 8 /* don't use elevator, just do FIFO */ 491#define QUEUE_FLAG_ELVSWITCH 8 /* don't use elevator, just do FIFO */
492#define QUEUE_FLAG_BIDI 9 /* queue supports bidi requests */
482 493
483enum { 494enum {
484 /* 495 /*
@@ -543,6 +554,7 @@ enum {
543#define blk_sorted_rq(rq) ((rq)->cmd_flags & REQ_SORTED) 554#define blk_sorted_rq(rq) ((rq)->cmd_flags & REQ_SORTED)
544#define blk_barrier_rq(rq) ((rq)->cmd_flags & REQ_HARDBARRIER) 555#define blk_barrier_rq(rq) ((rq)->cmd_flags & REQ_HARDBARRIER)
545#define blk_fua_rq(rq) ((rq)->cmd_flags & REQ_FUA) 556#define blk_fua_rq(rq) ((rq)->cmd_flags & REQ_FUA)
557#define blk_bidi_rq(rq) ((rq)->next_rq != NULL)
546 558
547#define list_entry_rq(ptr) list_entry((ptr), struct request, queuelist) 559#define list_entry_rq(ptr) list_entry((ptr), struct request, queuelist)
548 560
@@ -607,7 +619,12 @@ extern unsigned long blk_max_low_pfn, blk_max_pfn;
607#define BLK_BOUNCE_ANY ((u64)blk_max_pfn << PAGE_SHIFT) 619#define BLK_BOUNCE_ANY ((u64)blk_max_pfn << PAGE_SHIFT)
608#define BLK_BOUNCE_ISA (ISA_DMA_THRESHOLD) 620#define BLK_BOUNCE_ISA (ISA_DMA_THRESHOLD)
609 621
610#ifdef CONFIG_MMU 622/*
623 * default timeout for SG_IO if none specified
624 */
625#define BLK_DEFAULT_SG_TIMEOUT (60 * HZ)
626
627#ifdef CONFIG_BOUNCE
611extern int init_emergency_isa_pool(void); 628extern int init_emergency_isa_pool(void);
612extern void blk_queue_bounce(request_queue_t *q, struct bio **bio); 629extern void blk_queue_bounce(request_queue_t *q, struct bio **bio);
613#else 630#else
@@ -637,7 +654,8 @@ extern void blk_requeue_request(request_queue_t *, struct request *);
637extern void blk_plug_device(request_queue_t *); 654extern void blk_plug_device(request_queue_t *);
638extern int blk_remove_plug(request_queue_t *); 655extern int blk_remove_plug(request_queue_t *);
639extern void blk_recount_segments(request_queue_t *, struct bio *); 656extern void blk_recount_segments(request_queue_t *, struct bio *);
640extern int scsi_cmd_ioctl(struct file *, struct gendisk *, unsigned int, void __user *); 657extern int scsi_cmd_ioctl(struct file *, struct request_queue *,
658 struct gendisk *, unsigned int, void __user *);
641extern int sg_scsi_ioctl(struct file *, struct request_queue *, 659extern int sg_scsi_ioctl(struct file *, struct request_queue *,
642 struct gendisk *, struct scsi_ioctl_command __user *); 660 struct gendisk *, struct scsi_ioctl_command __user *);
643 661
@@ -680,6 +698,12 @@ extern int blk_execute_rq(request_queue_t *, struct gendisk *,
680 struct request *, int); 698 struct request *, int);
681extern void blk_execute_rq_nowait(request_queue_t *, struct gendisk *, 699extern void blk_execute_rq_nowait(request_queue_t *, struct gendisk *,
682 struct request *, int, rq_end_io_fn *); 700 struct request *, int, rq_end_io_fn *);
701extern int blk_fill_sghdr_rq(request_queue_t *, struct request *,
702 struct sg_io_hdr *, int);
703extern int blk_unmap_sghdr_rq(struct request *, struct sg_io_hdr *);
704extern int blk_complete_sghdr_rq(struct request *, struct sg_io_hdr *,
705 struct bio *);
706extern int blk_verify_command(unsigned char *, int);
683 707
684static inline request_queue_t *bdev_get_queue(struct block_device *bdev) 708static inline request_queue_t *bdev_get_queue(struct block_device *bdev)
685{ 709{
@@ -868,11 +892,6 @@ void kblockd_flush_work(struct work_struct *work);
868 */ 892 */
869#define buffer_heads_over_limit 0 893#define buffer_heads_over_limit 0
870 894
871static inline long blk_congestion_wait(int rw, long timeout)
872{
873 return io_schedule_timeout(timeout);
874}
875
876static inline long nr_blockdev_pages(void) 895static inline long nr_blockdev_pages(void)
877{ 896{
878 return 0; 897 return 0;
diff --git a/include/linux/bsg.h b/include/linux/bsg.h
new file mode 100644
index 000000000000..8547b10c388b
--- /dev/null
+++ b/include/linux/bsg.h
@@ -0,0 +1,69 @@
1#ifndef BSG_H
2#define BSG_H
3
4#define BSG_PROTOCOL_SCSI 0
5
6#define BSG_SUB_PROTOCOL_SCSI_CMD 0
7#define BSG_SUB_PROTOCOL_SCSI_TMF 1
8#define BSG_SUB_PROTOCOL_SCSI_TRANSPORT 2
9
10struct sg_io_v4 {
11 __s32 guard; /* [i] 'Q' to differentiate from v3 */
12 __u32 protocol; /* [i] 0 -> SCSI , .... */
13 __u32 subprotocol; /* [i] 0 -> SCSI command, 1 -> SCSI task
14 management function, .... */
15
16 __u32 request_len; /* [i] in bytes */
17 __u64 request; /* [i], [*i] {SCSI: cdb} */
18 __u32 request_attr; /* [i] {SCSI: task attribute} */
19 __u32 request_tag; /* [i] {SCSI: task tag (only if flagged)} */
20 __u32 request_priority; /* [i] {SCSI: task priority} */
21 __u32 max_response_len; /* [i] in bytes */
22 __u64 response; /* [i], [*o] {SCSI: (auto)sense data} */
23
24 /* "din_" for data in (from device); "dout_" for data out (to device) */
25 __u32 dout_xfer_len; /* [i] bytes to be transferred to device */
26 __u32 din_xfer_len; /* [i] bytes to be transferred from device */
27 __u64 dout_xferp; /* [i], [*i] */
28 __u64 din_xferp; /* [i], [*o] */
29
30 __u32 timeout; /* [i] units: millisecond */
31 __u32 flags; /* [i] bit mask */
32 __u64 usr_ptr; /* [i->o] unused internally */
33 __u32 spare_in; /* [i] */
34
35 __u32 driver_status; /* [o] 0 -> ok */
36 __u32 transport_status; /* [o] 0 -> ok */
37 __u32 device_status; /* [o] {SCSI: command completion status} */
38 __u32 retry_delay; /* [o] {SCSI: status auxiliary information} */
39 __u32 info; /* [o] additional information */
40 __u32 duration; /* [o] time to complete, in milliseconds */
41 __u32 response_len; /* [o] bytes of response actually written */
42 __s32 din_resid; /* [o] actual_din_xfer_len - din_xfer_len */
43 __u32 generated_tag; /* [o] {SCSI: task tag that transport chose} */
44 __u32 spare_out; /* [o] */
45
46 __u32 padding;
47};
48
49#ifdef __KERNEL__
50
51#if defined(CONFIG_BLK_DEV_BSG)
52struct bsg_class_device {
53 struct class_device *class_dev;
54 struct device *dev;
55 int minor;
56 struct list_head list;
57 struct request_queue *queue;
58};
59
60extern int bsg_register_queue(struct request_queue *, const char *);
61extern void bsg_unregister_queue(struct request_queue *);
62#else
63#define bsg_register_queue(disk, name) (0)
64#define bsg_unregister_queue(disk) do { } while (0)
65#endif
66
67#endif /* __KERNEL__ */
68
69#endif
diff --git a/include/linux/bug.h b/include/linux/bug.h
index 42aa0a54b6f4..54398d2c6d8d 100644
--- a/include/linux/bug.h
+++ b/include/linux/bug.h
@@ -10,6 +10,8 @@ enum bug_trap_type {
10 BUG_TRAP_TYPE_BUG = 2, 10 BUG_TRAP_TYPE_BUG = 2,
11}; 11};
12 12
13struct pt_regs;
14
13#ifdef CONFIG_GENERIC_BUG 15#ifdef CONFIG_GENERIC_BUG
14#include <asm-generic/bug.h> 16#include <asm-generic/bug.h>
15 17
@@ -20,7 +22,7 @@ static inline int is_warning_bug(const struct bug_entry *bug)
20 22
21const struct bug_entry *find_bug(unsigned long bugaddr); 23const struct bug_entry *find_bug(unsigned long bugaddr);
22 24
23enum bug_trap_type report_bug(unsigned long bug_addr); 25enum bug_trap_type report_bug(unsigned long bug_addr, struct pt_regs *regs);
24 26
25int module_bug_finalize(const Elf_Ehdr *, const Elf_Shdr *, 27int module_bug_finalize(const Elf_Ehdr *, const Elf_Shdr *,
26 struct module *); 28 struct module *);
@@ -31,7 +33,8 @@ int is_valid_bugaddr(unsigned long addr);
31 33
32#else /* !CONFIG_GENERIC_BUG */ 34#else /* !CONFIG_GENERIC_BUG */
33 35
34static inline enum bug_trap_type report_bug(unsigned long bug_addr) 36static inline enum bug_trap_type report_bug(unsigned long bug_addr,
37 struct pt_regs *regs)
35{ 38{
36 return BUG_TRAP_TYPE_BUG; 39 return BUG_TRAP_TYPE_BUG;
37} 40}
diff --git a/include/linux/capability.h b/include/linux/capability.h
index bbf8df7de28f..2dfa58555934 100644
--- a/include/linux/capability.h
+++ b/include/linux/capability.h
@@ -44,7 +44,6 @@ typedef struct __user_cap_data_struct {
44 44
45#ifdef __KERNEL__ 45#ifdef __KERNEL__
46 46
47#include <linux/spinlock.h>
48#include <asm/current.h> 47#include <asm/current.h>
49 48
50/* #define STRICT_CAP_T_TYPECHECKS */ 49/* #define STRICT_CAP_T_TYPECHECKS */
diff --git a/include/linux/cdrom.h b/include/linux/cdrom.h
index f50f04bdbc16..2b641b176e7f 100644
--- a/include/linux/cdrom.h
+++ b/include/linux/cdrom.h
@@ -414,8 +414,8 @@ struct cdrom_generic_command
414#define CDO_CHECK_TYPE 0x10 /* check type on open for data */ 414#define CDO_CHECK_TYPE 0x10 /* check type on open for data */
415 415
416/* Special codes used when specifying changer slots. */ 416/* Special codes used when specifying changer slots. */
417#define CDSL_NONE ((int) (~0U>>1)-1) 417#define CDSL_NONE (INT_MAX-1)
418#define CDSL_CURRENT ((int) (~0U>>1)) 418#define CDSL_CURRENT INT_MAX
419 419
420/* For partition based multisession access. IDE can handle 64 partitions 420/* For partition based multisession access. IDE can handle 64 partitions
421 * per drive - SCSI CD-ROM's use minors to differentiate between the 421 * per drive - SCSI CD-ROM's use minors to differentiate between the
diff --git a/include/linux/cobalt-nvram.h b/include/linux/cobalt-nvram.h
deleted file mode 100644
index ea429562ff36..000000000000
--- a/include/linux/cobalt-nvram.h
+++ /dev/null
@@ -1,109 +0,0 @@
1/*
2 * $Id: cobalt-nvram.h,v 1.20 2001/10/17 23:16:55 thockin Exp $
3 * cobalt-nvram.h : defines for the various fields in the cobalt NVRAM
4 *
5 * Copyright 2001,2002 Sun Microsystems, Inc.
6 */
7
8#ifndef COBALT_NVRAM_H
9#define COBALT_NVRAM_H
10
11#include <linux/nvram.h>
12
13#define COBT_CMOS_INFO_MAX 0x7f /* top address allowed */
14#define COBT_CMOS_BIOS_DRIVE_INFO 0x12 /* drive info would go here */
15
16#define COBT_CMOS_CKS_START NVRAM_OFFSET(0x0e)
17#define COBT_CMOS_CKS_END NVRAM_OFFSET(0x7f)
18
19/* flag bytes - 16 flags for now, leave room for more */
20#define COBT_CMOS_FLAG_BYTE_0 NVRAM_OFFSET(0x10)
21#define COBT_CMOS_FLAG_BYTE_1 NVRAM_OFFSET(0x11)
22
23/* flags in flag bytes - up to 16 */
24#define COBT_CMOS_FLAG_MIN 0x0001
25#define COBT_CMOS_CONSOLE_FLAG 0x0001 /* console on/off */
26#define COBT_CMOS_DEBUG_FLAG 0x0002 /* ROM debug messages */
27#define COBT_CMOS_AUTO_PROMPT_FLAG 0x0004 /* boot to ROM prompt? */
28#define COBT_CMOS_CLEAN_BOOT_FLAG 0x0008 /* set by a clean shutdown */
29#define COBT_CMOS_HW_NOPROBE_FLAG 0x0010 /* go easy on the probing */
30#define COBT_CMOS_SYSFAULT_FLAG 0x0020 /* system fault detected */
31#define COBT_CMOS_OOPSPANIC_FLAG 0x0040 /* panic on oops */
32#define COBT_CMOS_DELAY_CACHE_FLAG 0x0080 /* delay cache initialization */
33#define COBT_CMOS_NOLOGO_FLAG 0x0100 /* hide "C" logo @ boot */
34#define COBT_CMOS_VERSION_FLAG 0x0200 /* the version field is valid */
35#define COBT_CMOS_FLAG_MAX 0x0200
36
37/* leave byte 0x12 blank - Linux looks for drive info here */
38
39/* CMOS structure version, valid if COBT_CMOS_VERSION_FLAG is true */
40#define COBT_CMOS_VERSION NVRAM_OFFSET(0x13)
41#define COBT_CMOS_VER_BTOCODE 1 /* min. version needed for btocode */
42
43/* index of default boot method */
44#define COBT_CMOS_BOOT_METHOD NVRAM_OFFSET(0x20)
45#define COBT_CMOS_BOOT_METHOD_DISK 0
46#define COBT_CMOS_BOOT_METHOD_ROM 1
47#define COBT_CMOS_BOOT_METHOD_NET 2
48
49#define COBT_CMOS_BOOT_DEV_MIN NVRAM_OFFSET(0x21)
50/* major #, minor # of first through fourth boot device */
51#define COBT_CMOS_BOOT_DEV0_MAJ NVRAM_OFFSET(0x21)
52#define COBT_CMOS_BOOT_DEV0_MIN NVRAM_OFFSET(0x22)
53#define COBT_CMOS_BOOT_DEV1_MAJ NVRAM_OFFSET(0x23)
54#define COBT_CMOS_BOOT_DEV1_MIN NVRAM_OFFSET(0x24)
55#define COBT_CMOS_BOOT_DEV2_MAJ NVRAM_OFFSET(0x25)
56#define COBT_CMOS_BOOT_DEV2_MIN NVRAM_OFFSET(0x26)
57#define COBT_CMOS_BOOT_DEV3_MAJ NVRAM_OFFSET(0x27)
58#define COBT_CMOS_BOOT_DEV3_MIN NVRAM_OFFSET(0x28)
59#define COBT_CMOS_BOOT_DEV_MAX NVRAM_OFFSET(0x28)
60
61/* checksum of bytes 0xe-0x7f */
62#define COBT_CMOS_CHECKSUM NVRAM_OFFSET(0x2e)
63
64/* running uptime counter, units of 5 minutes (32 bits =~ 41000 years) */
65#define COBT_CMOS_UPTIME_0 NVRAM_OFFSET(0x30)
66#define COBT_CMOS_UPTIME_1 NVRAM_OFFSET(0x31)
67#define COBT_CMOS_UPTIME_2 NVRAM_OFFSET(0x32)
68#define COBT_CMOS_UPTIME_3 NVRAM_OFFSET(0x33)
69
70/* count of successful boots (32 bits) */
71#define COBT_CMOS_BOOTCOUNT_0 NVRAM_OFFSET(0x38)
72#define COBT_CMOS_BOOTCOUNT_1 NVRAM_OFFSET(0x39)
73#define COBT_CMOS_BOOTCOUNT_2 NVRAM_OFFSET(0x3a)
74#define COBT_CMOS_BOOTCOUNT_3 NVRAM_OFFSET(0x3b)
75
76/* 13 bytes: system serial number, same as on the back of the system */
77#define COBT_CMOS_SYS_SERNUM_LEN 13
78#define COBT_CMOS_SYS_SERNUM_0 NVRAM_OFFSET(0x40)
79#define COBT_CMOS_SYS_SERNUM_1 NVRAM_OFFSET(0x41)
80#define COBT_CMOS_SYS_SERNUM_2 NVRAM_OFFSET(0x42)
81#define COBT_CMOS_SYS_SERNUM_3 NVRAM_OFFSET(0x43)
82#define COBT_CMOS_SYS_SERNUM_4 NVRAM_OFFSET(0x44)
83#define COBT_CMOS_SYS_SERNUM_5 NVRAM_OFFSET(0x45)
84#define COBT_CMOS_SYS_SERNUM_6 NVRAM_OFFSET(0x46)
85#define COBT_CMOS_SYS_SERNUM_7 NVRAM_OFFSET(0x47)
86#define COBT_CMOS_SYS_SERNUM_8 NVRAM_OFFSET(0x48)
87#define COBT_CMOS_SYS_SERNUM_9 NVRAM_OFFSET(0x49)
88#define COBT_CMOS_SYS_SERNUM_10 NVRAM_OFFSET(0x4a)
89#define COBT_CMOS_SYS_SERNUM_11 NVRAM_OFFSET(0x4b)
90#define COBT_CMOS_SYS_SERNUM_12 NVRAM_OFFSET(0x4c)
91/* checksum for serial num - 1 byte */
92#define COBT_CMOS_SYS_SERNUM_CSUM NVRAM_OFFSET(0x4f)
93
94#define COBT_CMOS_ROM_REV_MAJ NVRAM_OFFSET(0x50)
95#define COBT_CMOS_ROM_REV_MIN NVRAM_OFFSET(0x51)
96#define COBT_CMOS_ROM_REV_REV NVRAM_OFFSET(0x52)
97
98#define COBT_CMOS_BTO_CODE_0 NVRAM_OFFSET(0x53)
99#define COBT_CMOS_BTO_CODE_1 NVRAM_OFFSET(0x54)
100#define COBT_CMOS_BTO_CODE_2 NVRAM_OFFSET(0x55)
101#define COBT_CMOS_BTO_CODE_3 NVRAM_OFFSET(0x56)
102
103#define COBT_CMOS_BTO_IP_CSUM NVRAM_OFFSET(0x57)
104#define COBT_CMOS_BTO_IP_0 NVRAM_OFFSET(0x58)
105#define COBT_CMOS_BTO_IP_1 NVRAM_OFFSET(0x59)
106#define COBT_CMOS_BTO_IP_2 NVRAM_OFFSET(0x5a)
107#define COBT_CMOS_BTO_IP_3 NVRAM_OFFSET(0x5b)
108
109#endif /* COBALT_NVRAM_H */
diff --git a/include/linux/configfs.h b/include/linux/configfs.h
index fef6f3d0a4a7..8c6967f3fb11 100644
--- a/include/linux/configfs.h
+++ b/include/linux/configfs.h
@@ -40,9 +40,9 @@
40#include <linux/types.h> 40#include <linux/types.h>
41#include <linux/list.h> 41#include <linux/list.h>
42#include <linux/kref.h> 42#include <linux/kref.h>
43#include <linux/mutex.h>
43 44
44#include <asm/atomic.h> 45#include <asm/atomic.h>
45#include <asm/semaphore.h>
46 46
47#define CONFIGFS_ITEM_NAME_LEN 20 47#define CONFIGFS_ITEM_NAME_LEN 20
48 48
@@ -75,7 +75,6 @@ extern void config_item_init(struct config_item *);
75extern void config_item_init_type_name(struct config_item *item, 75extern void config_item_init_type_name(struct config_item *item,
76 const char *name, 76 const char *name,
77 struct config_item_type *type); 77 struct config_item_type *type);
78extern void config_item_cleanup(struct config_item *);
79 78
80extern struct config_item * config_item_get(struct config_item *); 79extern struct config_item * config_item_get(struct config_item *);
81extern void config_item_put(struct config_item *); 80extern void config_item_put(struct config_item *);
@@ -87,12 +86,10 @@ struct config_item_type {
87 struct configfs_attribute **ct_attrs; 86 struct configfs_attribute **ct_attrs;
88}; 87};
89 88
90
91/** 89/**
92 * group - a group of config_items of a specific type, belonging 90 * group - a group of config_items of a specific type, belonging
93 * to a specific subsystem. 91 * to a specific subsystem.
94 */ 92 */
95
96struct config_group { 93struct config_group {
97 struct config_item cg_item; 94 struct config_item cg_item;
98 struct list_head cg_children; 95 struct list_head cg_children;
@@ -100,13 +97,11 @@ struct config_group {
100 struct config_group **default_groups; 97 struct config_group **default_groups;
101}; 98};
102 99
103
104extern void config_group_init(struct config_group *group); 100extern void config_group_init(struct config_group *group);
105extern void config_group_init_type_name(struct config_group *group, 101extern void config_group_init_type_name(struct config_group *group,
106 const char *name, 102 const char *name,
107 struct config_item_type *type); 103 struct config_item_type *type);
108 104
109
110static inline struct config_group *to_config_group(struct config_item *item) 105static inline struct config_group *to_config_group(struct config_item *item)
111{ 106{
112 return item ? container_of(item,struct config_group,cg_item) : NULL; 107 return item ? container_of(item,struct config_group,cg_item) : NULL;
@@ -122,7 +117,8 @@ static inline void config_group_put(struct config_group *group)
122 config_item_put(&group->cg_item); 117 config_item_put(&group->cg_item);
123} 118}
124 119
125extern struct config_item *config_group_find_obj(struct config_group *, const char *); 120extern struct config_item *config_group_find_item(struct config_group *,
121 const char *);
126 122
127 123
128struct configfs_attribute { 124struct configfs_attribute {
@@ -131,6 +127,22 @@ struct configfs_attribute {
131 mode_t ca_mode; 127 mode_t ca_mode;
132}; 128};
133 129
130/*
131 * Users often need to create attribute structures for their configurable
132 * attributes, containing a configfs_attribute member and function pointers
133 * for the show() and store() operations on that attribute. They can use
134 * this macro (similar to sysfs' __ATTR) to make defining attributes easier.
135 */
136#define __CONFIGFS_ATTR(_name, _mode, _show, _store) \
137{ \
138 .attr = { \
139 .ca_name = __stringify(_name), \
140 .ca_mode = _mode, \
141 .ca_owner = THIS_MODULE, \
142 }, \
143 .show = _show, \
144 .store = _store, \
145}
134 146
135/* 147/*
136 * If allow_link() exists, the item can symlink(2) out to other 148 * If allow_link() exists, the item can symlink(2) out to other
@@ -157,12 +169,13 @@ struct configfs_group_operations {
157 struct config_item *(*make_item)(struct config_group *group, const char *name); 169 struct config_item *(*make_item)(struct config_group *group, const char *name);
158 struct config_group *(*make_group)(struct config_group *group, const char *name); 170 struct config_group *(*make_group)(struct config_group *group, const char *name);
159 int (*commit_item)(struct config_item *item); 171 int (*commit_item)(struct config_item *item);
172 void (*disconnect_notify)(struct config_group *group, struct config_item *item);
160 void (*drop_item)(struct config_group *group, struct config_item *item); 173 void (*drop_item)(struct config_group *group, struct config_item *item);
161}; 174};
162 175
163struct configfs_subsystem { 176struct configfs_subsystem {
164 struct config_group su_group; 177 struct config_group su_group;
165 struct semaphore su_sem; 178 struct mutex su_mutex;
166}; 179};
167 180
168static inline struct configfs_subsystem *to_configfs_subsystem(struct config_group *group) 181static inline struct configfs_subsystem *to_configfs_subsystem(struct config_group *group)
@@ -175,6 +188,11 @@ static inline struct configfs_subsystem *to_configfs_subsystem(struct config_gro
175int configfs_register_subsystem(struct configfs_subsystem *subsys); 188int configfs_register_subsystem(struct configfs_subsystem *subsys);
176void configfs_unregister_subsystem(struct configfs_subsystem *subsys); 189void configfs_unregister_subsystem(struct configfs_subsystem *subsys);
177 190
191/* These functions can sleep and can alloc with GFP_KERNEL */
192/* WARNING: These cannot be called underneath configfs callbacks!! */
193int configfs_depend_item(struct configfs_subsystem *subsys, struct config_item *target);
194void configfs_undepend_item(struct configfs_subsystem *subsys, struct config_item *target);
195
178#endif /* __KERNEL__ */ 196#endif /* __KERNEL__ */
179 197
180#endif /* _CONFIGFS_H_ */ 198#endif /* _CONFIGFS_H_ */
diff --git a/include/linux/console.h b/include/linux/console.h
index 62ef6e11d0d2..56a7bcda49cb 100644
--- a/include/linux/console.h
+++ b/include/linux/console.h
@@ -15,7 +15,6 @@
15#define _LINUX_CONSOLE_H_ 1 15#define _LINUX_CONSOLE_H_ 1
16 16
17#include <linux/types.h> 17#include <linux/types.h>
18#include <linux/spinlock.h>
19 18
20struct vc_data; 19struct vc_data;
21struct console_font_op; 20struct console_font_op;
@@ -99,6 +98,7 @@ struct console {
99 struct tty_driver *(*device)(struct console *, int *); 98 struct tty_driver *(*device)(struct console *, int *);
100 void (*unblank)(void); 99 void (*unblank)(void);
101 int (*setup)(struct console *, char *); 100 int (*setup)(struct console *, char *);
101 int (*early_setup)(void);
102 short flags; 102 short flags;
103 short index; 103 short index;
104 int cflag; 104 int cflag;
@@ -107,6 +107,7 @@ struct console {
107}; 107};
108 108
109extern int add_preferred_console(char *name, int idx, char *options); 109extern int add_preferred_console(char *name, int idx, char *options);
110extern int update_console_cmdline(char *name, int idx, char *name_new, int idx_new, char *options);
110extern void register_console(struct console *); 111extern void register_console(struct console *);
111extern int unregister_console(struct console *); 112extern int unregister_console(struct console *);
112extern struct console *console_drivers; 113extern struct console *console_drivers;
diff --git a/include/linux/consolemap.h b/include/linux/consolemap.h
index 82c9a1f11020..06b2768c603f 100644
--- a/include/linux/consolemap.h
+++ b/include/linux/consolemap.h
@@ -8,9 +8,12 @@
8#define IBMPC_MAP 2 8#define IBMPC_MAP 2
9#define USER_MAP 3 9#define USER_MAP 3
10 10
11#include <linux/types.h>
12
11struct vc_data; 13struct vc_data;
12 14
13extern unsigned char inverse_translate(struct vc_data *conp, int glyph); 15extern u16 inverse_translate(struct vc_data *conp, int glyph, int use_unicode);
14extern unsigned short *set_translate(int m, struct vc_data *vc); 16extern unsigned short *set_translate(int m, struct vc_data *vc);
15extern int conv_uni_to_pc(struct vc_data *conp, long ucs); 17extern int conv_uni_to_pc(struct vc_data *conp, long ucs);
18extern u32 conv_8bit_to_uni(unsigned char c);
16void console_map_init(void); 19void console_map_init(void);
diff --git a/include/linux/cpu.h b/include/linux/cpu.h
index 3b2df2523f1d..c2236bbff412 100644
--- a/include/linux/cpu.h
+++ b/include/linux/cpu.h
@@ -120,7 +120,6 @@ static inline void cpuhotplug_mutex_unlock(struct mutex *cpu_hp_mutex)
120 120
121#define lock_cpu_hotplug() do { } while (0) 121#define lock_cpu_hotplug() do { } while (0)
122#define unlock_cpu_hotplug() do { } while (0) 122#define unlock_cpu_hotplug() do { } while (0)
123#define lock_cpu_hotplug_interruptible() 0
124#define hotcpu_notifier(fn, pri) do { (void)(fn); } while (0) 123#define hotcpu_notifier(fn, pri) do { (void)(fn); } while (0)
125#define register_hotcpu_notifier(nb) do { (void)(nb); } while (0) 124#define register_hotcpu_notifier(nb) do { (void)(nb); } while (0)
126#define unregister_hotcpu_notifier(nb) do { (void)(nb); } while (0) 125#define unregister_hotcpu_notifier(nb) do { (void)(nb); } while (0)
diff --git a/include/linux/crc7.h b/include/linux/crc7.h
new file mode 100644
index 000000000000..1786e772d5c6
--- /dev/null
+++ b/include/linux/crc7.h
@@ -0,0 +1,14 @@
1#ifndef _LINUX_CRC7_H
2#define _LINUX_CRC7_H
3#include <linux/types.h>
4
5extern const u8 crc7_syndrome_table[256];
6
7static inline u8 crc7_byte(u8 crc, u8 data)
8{
9 return crc7_syndrome_table[(crc << 1) ^ data];
10}
11
12extern u8 crc7(u8 crc, const u8 *buffer, size_t len);
13
14#endif
diff --git a/include/linux/crypto.h b/include/linux/crypto.h
index 0de7e2ace822..357e8cfedc37 100644
--- a/include/linux/crypto.h
+++ b/include/linux/crypto.h
@@ -295,28 +295,8 @@ struct blkcipher_tfm {
295}; 295};
296 296
297struct cipher_tfm { 297struct cipher_tfm {
298 void *cit_iv;
299 unsigned int cit_ivsize;
300 u32 cit_mode;
301 int (*cit_setkey)(struct crypto_tfm *tfm, 298 int (*cit_setkey)(struct crypto_tfm *tfm,
302 const u8 *key, unsigned int keylen); 299 const u8 *key, unsigned int keylen);
303 int (*cit_encrypt)(struct crypto_tfm *tfm,
304 struct scatterlist *dst,
305 struct scatterlist *src,
306 unsigned int nbytes);
307 int (*cit_encrypt_iv)(struct crypto_tfm *tfm,
308 struct scatterlist *dst,
309 struct scatterlist *src,
310 unsigned int nbytes, u8 *iv);
311 int (*cit_decrypt)(struct crypto_tfm *tfm,
312 struct scatterlist *dst,
313 struct scatterlist *src,
314 unsigned int nbytes);
315 int (*cit_decrypt_iv)(struct crypto_tfm *tfm,
316 struct scatterlist *dst,
317 struct scatterlist *src,
318 unsigned int nbytes, u8 *iv);
319 void (*cit_xor_block)(u8 *dst, const u8 *src);
320 void (*cit_encrypt_one)(struct crypto_tfm *tfm, u8 *dst, const u8 *src); 300 void (*cit_encrypt_one)(struct crypto_tfm *tfm, u8 *dst, const u8 *src);
321 void (*cit_decrypt_one)(struct crypto_tfm *tfm, u8 *dst, const u8 *src); 301 void (*cit_decrypt_one)(struct crypto_tfm *tfm, u8 *dst, const u8 *src);
322}; 302};
diff --git a/include/linux/debugfs.h b/include/linux/debugfs.h
index 5a9c49534d08..104e51e20e14 100644
--- a/include/linux/debugfs.h
+++ b/include/linux/debugfs.h
@@ -38,6 +38,9 @@ struct dentry *debugfs_create_symlink(const char *name, struct dentry *parent,
38 38
39void debugfs_remove(struct dentry *dentry); 39void debugfs_remove(struct dentry *dentry);
40 40
41struct dentry *debugfs_rename(struct dentry *old_dir, struct dentry *old_dentry,
42 struct dentry *new_dir, const char *new_name);
43
41struct dentry *debugfs_create_u8(const char *name, mode_t mode, 44struct dentry *debugfs_create_u8(const char *name, mode_t mode,
42 struct dentry *parent, u8 *value); 45 struct dentry *parent, u8 *value);
43struct dentry *debugfs_create_u16(const char *name, mode_t mode, 46struct dentry *debugfs_create_u16(const char *name, mode_t mode,
@@ -85,6 +88,12 @@ static inline struct dentry *debugfs_create_symlink(const char *name,
85static inline void debugfs_remove(struct dentry *dentry) 88static inline void debugfs_remove(struct dentry *dentry)
86{ } 89{ }
87 90
91static inline struct dentry *debugfs_rename(struct dentry *old_dir, struct dentry *old_dentry,
92 struct dentry *new_dir, char *new_name)
93{
94 return ERR_PTR(-ENODEV);
95}
96
88static inline struct dentry *debugfs_create_u8(const char *name, mode_t mode, 97static inline struct dentry *debugfs_create_u8(const char *name, mode_t mode,
89 struct dentry *parent, 98 struct dentry *parent,
90 u8 *value) 99 u8 *value)
diff --git a/include/linux/device.h b/include/linux/device.h
index 2e1a2988b7e1..be2debed70d2 100644
--- a/include/linux/device.h
+++ b/include/linux/device.h
@@ -238,7 +238,6 @@ extern int __must_check class_device_create_file(struct class_device *,
238 * @devt: for internal use by the driver core only. 238 * @devt: for internal use by the driver core only.
239 * @node: for internal use by the driver core only. 239 * @node: for internal use by the driver core only.
240 * @kobj: for internal use by the driver core only. 240 * @kobj: for internal use by the driver core only.
241 * @devt_attr: for internal use by the driver core only.
242 * @groups: optional additional groups to be created 241 * @groups: optional additional groups to be created
243 * @dev: if set, a symlink to the struct device is created in the sysfs 242 * @dev: if set, a symlink to the struct device is created in the sysfs
244 * directory for this struct class device. 243 * directory for this struct class device.
@@ -263,8 +262,6 @@ struct class_device {
263 struct kobject kobj; 262 struct kobject kobj;
264 struct class * class; /* required */ 263 struct class * class; /* required */
265 dev_t devt; /* dev_t, creates the sysfs "dev" */ 264 dev_t devt; /* dev_t, creates the sysfs "dev" */
266 struct class_device_attribute *devt_attr;
267 struct class_device_attribute uevent_attr;
268 struct device * dev; /* not necessary, but nice to have */ 265 struct device * dev; /* not necessary, but nice to have */
269 void * class_data; /* class-specific data */ 266 void * class_data; /* class-specific data */
270 struct class_device *parent; /* parent of this child device, if there is one */ 267 struct class_device *parent; /* parent of this child device, if there is one */
@@ -419,8 +416,6 @@ struct device {
419 struct device_type *type; 416 struct device_type *type;
420 unsigned is_registered:1; 417 unsigned is_registered:1;
421 unsigned uevent_suppress:1; 418 unsigned uevent_suppress:1;
422 struct device_attribute uevent_attr;
423 struct device_attribute *devt_attr;
424 419
425 struct semaphore sem; /* semaphore to synchronize calls to 420 struct semaphore sem; /* semaphore to synchronize calls to
426 * its driver. 421 * its driver.
diff --git a/include/linux/dlm.h b/include/linux/dlm.h
index 1b1dcb9a40bb..be9d278761e0 100644
--- a/include/linux/dlm.h
+++ b/include/linux/dlm.h
@@ -2,7 +2,7 @@
2******************************************************************************* 2*******************************************************************************
3** 3**
4** Copyright (C) Sistina Software, Inc. 1997-2003 All rights reserved. 4** Copyright (C) Sistina Software, Inc. 1997-2003 All rights reserved.
5** Copyright (C) 2004-2005 Red Hat, Inc. All rights reserved. 5** Copyright (C) 2004-2007 Red Hat, Inc. All rights reserved.
6** 6**
7** This copyrighted material is made available to anyone wishing to use, 7** This copyrighted material is made available to anyone wishing to use,
8** modify, copy, or redistribute it subject to the terms and conditions 8** modify, copy, or redistribute it subject to the terms and conditions
@@ -85,7 +85,11 @@
85 * Only relevant to locks originating in userspace. A persistent lock will not 85 * Only relevant to locks originating in userspace. A persistent lock will not
86 * be removed if the process holding the lock exits. 86 * be removed if the process holding the lock exits.
87 * 87 *
88 * DLM_LKF_NODLKWT 88 * DLM_LKF_NODLCKWT
89 *
90 * Do not cancel the lock if it gets into conversion deadlock.
91 * Exclude this lock from being monitored due to DLM_LSFL_TIMEWARN.
92 *
89 * DLM_LKF_NODLCKBLK 93 * DLM_LKF_NODLCKBLK
90 * 94 *
91 * net yet implemented 95 * net yet implemented
@@ -149,6 +153,7 @@
149#define DLM_LKF_ALTPR 0x00008000 153#define DLM_LKF_ALTPR 0x00008000
150#define DLM_LKF_ALTCW 0x00010000 154#define DLM_LKF_ALTCW 0x00010000
151#define DLM_LKF_FORCEUNLOCK 0x00020000 155#define DLM_LKF_FORCEUNLOCK 0x00020000
156#define DLM_LKF_TIMEOUT 0x00040000
152 157
153/* 158/*
154 * Some return codes that are not in errno.h 159 * Some return codes that are not in errno.h
@@ -199,11 +204,12 @@ struct dlm_lksb {
199 char * sb_lvbptr; 204 char * sb_lvbptr;
200}; 205};
201 206
207#define DLM_LSFL_NODIR 0x00000001
208#define DLM_LSFL_TIMEWARN 0x00000002
209#define DLM_LSFL_FS 0x00000004
202 210
203#ifdef __KERNEL__ 211#ifdef __KERNEL__
204 212
205#define DLM_LSFL_NODIR 0x00000001
206
207/* 213/*
208 * dlm_new_lockspace 214 * dlm_new_lockspace
209 * 215 *
diff --git a/include/linux/dlm_device.h b/include/linux/dlm_device.h
index c2735cab2ebf..9642277a152a 100644
--- a/include/linux/dlm_device.h
+++ b/include/linux/dlm_device.h
@@ -2,7 +2,7 @@
2******************************************************************************* 2*******************************************************************************
3** 3**
4** Copyright (C) Sistina Software, Inc. 1997-2003 All rights reserved. 4** Copyright (C) Sistina Software, Inc. 1997-2003 All rights reserved.
5** Copyright (C) 2004-2005 Red Hat, Inc. All rights reserved. 5** Copyright (C) 2004-2007 Red Hat, Inc. All rights reserved.
6** 6**
7** This copyrighted material is made available to anyone wishing to use, 7** This copyrighted material is made available to anyone wishing to use,
8** modify, copy, or redistribute it subject to the terms and conditions 8** modify, copy, or redistribute it subject to the terms and conditions
@@ -18,21 +18,24 @@
18#define DLM_USER_LVB_LEN 32 18#define DLM_USER_LVB_LEN 32
19 19
20/* Version of the device interface */ 20/* Version of the device interface */
21#define DLM_DEVICE_VERSION_MAJOR 5 21#define DLM_DEVICE_VERSION_MAJOR 6
22#define DLM_DEVICE_VERSION_MINOR 1 22#define DLM_DEVICE_VERSION_MINOR 0
23#define DLM_DEVICE_VERSION_PATCH 0 23#define DLM_DEVICE_VERSION_PATCH 0
24 24
25/* struct passed to the lock write */ 25/* struct passed to the lock write */
26struct dlm_lock_params { 26struct dlm_lock_params {
27 __u8 mode; 27 __u8 mode;
28 __u8 namelen; 28 __u8 namelen;
29 __u16 flags; 29 __u16 unused;
30 __u32 flags;
30 __u32 lkid; 31 __u32 lkid;
31 __u32 parent; 32 __u32 parent;
32 void __user *castparam; 33 __u64 xid;
34 __u64 timeout;
35 void __user *castparam;
33 void __user *castaddr; 36 void __user *castaddr;
34 void __user *bastparam; 37 void __user *bastparam;
35 void __user *bastaddr; 38 void __user *bastaddr;
36 struct dlm_lksb __user *lksb; 39 struct dlm_lksb __user *lksb;
37 char lvb[DLM_USER_LVB_LEN]; 40 char lvb[DLM_USER_LVB_LEN];
38 char name[0]; 41 char name[0];
@@ -62,9 +65,15 @@ struct dlm_write_request {
62 } i; 65 } i;
63}; 66};
64 67
68struct dlm_device_version {
69 __u32 version[3];
70};
71
65/* struct read from the "device" fd, 72/* struct read from the "device" fd,
66 consists mainly of userspace pointers for the library to use */ 73 consists mainly of userspace pointers for the library to use */
74
67struct dlm_lock_result { 75struct dlm_lock_result {
76 __u32 version[3];
68 __u32 length; 77 __u32 length;
69 void __user * user_astaddr; 78 void __user * user_astaddr;
70 void __user * user_astparam; 79 void __user * user_astparam;
@@ -83,6 +92,7 @@ struct dlm_lock_result {
83#define DLM_USER_CREATE_LOCKSPACE 4 92#define DLM_USER_CREATE_LOCKSPACE 4
84#define DLM_USER_REMOVE_LOCKSPACE 5 93#define DLM_USER_REMOVE_LOCKSPACE 5
85#define DLM_USER_PURGE 6 94#define DLM_USER_PURGE 6
95#define DLM_USER_DEADLOCK 7
86 96
87/* Arbitrary length restriction */ 97/* Arbitrary length restriction */
88#define MAX_LS_NAME_LEN 64 98#define MAX_LS_NAME_LEN 64
diff --git a/include/linux/dlm_netlink.h b/include/linux/dlm_netlink.h
new file mode 100644
index 000000000000..19276332707a
--- /dev/null
+++ b/include/linux/dlm_netlink.h
@@ -0,0 +1,56 @@
1/*
2 * Copyright (C) 2007 Red Hat, Inc. All rights reserved.
3 *
4 * This copyrighted material is made available to anyone wishing to use,
5 * modify, copy, or redistribute it subject to the terms and conditions
6 * of the GNU General Public License v.2.
7 */
8
9#ifndef _DLM_NETLINK_H
10#define _DLM_NETLINK_H
11
12enum {
13 DLM_STATUS_WAITING = 1,
14 DLM_STATUS_GRANTED = 2,
15 DLM_STATUS_CONVERT = 3,
16};
17
18#define DLM_LOCK_DATA_VERSION 1
19
20struct dlm_lock_data {
21 uint16_t version;
22 uint32_t lockspace_id;
23 int nodeid;
24 int ownpid;
25 uint32_t id;
26 uint32_t remid;
27 uint64_t xid;
28 int8_t status;
29 int8_t grmode;
30 int8_t rqmode;
31 unsigned long timestamp;
32 int resource_namelen;
33 char resource_name[DLM_RESNAME_MAXLEN];
34};
35
36enum {
37 DLM_CMD_UNSPEC = 0,
38 DLM_CMD_HELLO, /* user->kernel */
39 DLM_CMD_TIMEOUT, /* kernel->user */
40 __DLM_CMD_MAX,
41};
42
43#define DLM_CMD_MAX (__DLM_CMD_MAX - 1)
44
45enum {
46 DLM_TYPE_UNSPEC = 0,
47 DLM_TYPE_LOCK,
48 __DLM_TYPE_MAX,
49};
50
51#define DLM_TYPE_MAX (__DLM_TYPE_MAX - 1)
52
53#define DLM_GENL_VERSION 0x1
54#define DLM_GENL_NAME "DLM"
55
56#endif /* _DLM_NETLINK_H */
diff --git a/include/linux/dma-mapping.h b/include/linux/dma-mapping.h
index 9a663c6db16a..2dc21cbeb304 100644
--- a/include/linux/dma-mapping.h
+++ b/include/linux/dma-mapping.h
@@ -31,7 +31,11 @@ static inline int valid_dma_direction(int dma_direction)
31 (dma_direction == DMA_FROM_DEVICE)); 31 (dma_direction == DMA_FROM_DEVICE));
32} 32}
33 33
34#ifdef CONFIG_HAS_DMA
34#include <asm/dma-mapping.h> 35#include <asm/dma-mapping.h>
36#else
37#include <asm-generic/dma-mapping-broken.h>
38#endif
35 39
36/* Backwards compat, remove in 2.7.x */ 40/* Backwards compat, remove in 2.7.x */
37#define dma_sync_single dma_sync_single_for_cpu 41#define dma_sync_single dma_sync_single_for_cpu
diff --git a/include/linux/dmaengine.h b/include/linux/dmaengine.h
index c94d8f1d62e5..a3b6035b6c86 100644
--- a/include/linux/dmaengine.h
+++ b/include/linux/dmaengine.h
@@ -21,29 +21,40 @@
21#ifndef DMAENGINE_H 21#ifndef DMAENGINE_H
22#define DMAENGINE_H 22#define DMAENGINE_H
23 23
24#ifdef CONFIG_DMA_ENGINE
25
26#include <linux/device.h> 24#include <linux/device.h>
27#include <linux/uio.h> 25#include <linux/uio.h>
28#include <linux/kref.h> 26#include <linux/kref.h>
29#include <linux/completion.h> 27#include <linux/completion.h>
30#include <linux/rcupdate.h> 28#include <linux/rcupdate.h>
29#include <linux/dma-mapping.h>
31 30
32/** 31/**
33 * enum dma_event - resource PNP/power managment events 32 * enum dma_state - resource PNP/power managment state
34 * @DMA_RESOURCE_SUSPEND: DMA device going into low power state 33 * @DMA_RESOURCE_SUSPEND: DMA device going into low power state
35 * @DMA_RESOURCE_RESUME: DMA device returning to full power 34 * @DMA_RESOURCE_RESUME: DMA device returning to full power
36 * @DMA_RESOURCE_ADDED: DMA device added to the system 35 * @DMA_RESOURCE_AVAILABLE: DMA device available to the system
37 * @DMA_RESOURCE_REMOVED: DMA device removed from the system 36 * @DMA_RESOURCE_REMOVED: DMA device removed from the system
38 */ 37 */
39enum dma_event { 38enum dma_state {
40 DMA_RESOURCE_SUSPEND, 39 DMA_RESOURCE_SUSPEND,
41 DMA_RESOURCE_RESUME, 40 DMA_RESOURCE_RESUME,
42 DMA_RESOURCE_ADDED, 41 DMA_RESOURCE_AVAILABLE,
43 DMA_RESOURCE_REMOVED, 42 DMA_RESOURCE_REMOVED,
44}; 43};
45 44
46/** 45/**
46 * enum dma_state_client - state of the channel in the client
47 * @DMA_ACK: client would like to use, or was using this channel
48 * @DMA_DUP: client has already seen this channel, or is not using this channel
49 * @DMA_NAK: client does not want to see any more channels
50 */
51enum dma_state_client {
52 DMA_ACK,
53 DMA_DUP,
54 DMA_NAK,
55};
56
57/**
47 * typedef dma_cookie_t - an opaque DMA cookie 58 * typedef dma_cookie_t - an opaque DMA cookie
48 * 59 *
49 * if dma_cookie_t is >0 it's a DMA request cookie, <0 it's an error code 60 * if dma_cookie_t is >0 it's a DMA request cookie, <0 it's an error code
@@ -65,6 +76,31 @@ enum dma_status {
65}; 76};
66 77
67/** 78/**
79 * enum dma_transaction_type - DMA transaction types/indexes
80 */
81enum dma_transaction_type {
82 DMA_MEMCPY,
83 DMA_XOR,
84 DMA_PQ_XOR,
85 DMA_DUAL_XOR,
86 DMA_PQ_UPDATE,
87 DMA_ZERO_SUM,
88 DMA_PQ_ZERO_SUM,
89 DMA_MEMSET,
90 DMA_MEMCPY_CRC32C,
91 DMA_INTERRUPT,
92};
93
94/* last transaction type for creation of the capabilities mask */
95#define DMA_TX_TYPE_END (DMA_INTERRUPT + 1)
96
97/**
98 * dma_cap_mask_t - capabilities bitmap modeled after cpumask_t.
99 * See linux/cpumask.h
100 */
101typedef struct { DECLARE_BITMAP(bits, DMA_TX_TYPE_END); } dma_cap_mask_t;
102
103/**
68 * struct dma_chan_percpu - the per-CPU part of struct dma_chan 104 * struct dma_chan_percpu - the per-CPU part of struct dma_chan
69 * @refcount: local_t used for open-coded "bigref" counting 105 * @refcount: local_t used for open-coded "bigref" counting
70 * @memcpy_count: transaction counter 106 * @memcpy_count: transaction counter
@@ -80,7 +116,6 @@ struct dma_chan_percpu {
80 116
81/** 117/**
82 * struct dma_chan - devices supply DMA channels, clients use them 118 * struct dma_chan - devices supply DMA channels, clients use them
83 * @client: ptr to the client user of this chan, will be %NULL when unused
84 * @device: ptr to the dma device who supplies this channel, always !%NULL 119 * @device: ptr to the dma device who supplies this channel, always !%NULL
85 * @cookie: last cookie value returned to client 120 * @cookie: last cookie value returned to client
86 * @chan_id: channel ID for sysfs 121 * @chan_id: channel ID for sysfs
@@ -88,12 +123,10 @@ struct dma_chan_percpu {
88 * @refcount: kref, used in "bigref" slow-mode 123 * @refcount: kref, used in "bigref" slow-mode
89 * @slow_ref: indicates that the DMA channel is free 124 * @slow_ref: indicates that the DMA channel is free
90 * @rcu: the DMA channel's RCU head 125 * @rcu: the DMA channel's RCU head
91 * @client_node: used to add this to the client chan list
92 * @device_node: used to add this to the device chan list 126 * @device_node: used to add this to the device chan list
93 * @local: per-cpu pointer to a struct dma_chan_percpu 127 * @local: per-cpu pointer to a struct dma_chan_percpu
94 */ 128 */
95struct dma_chan { 129struct dma_chan {
96 struct dma_client *client;
97 struct dma_device *device; 130 struct dma_device *device;
98 dma_cookie_t cookie; 131 dma_cookie_t cookie;
99 132
@@ -105,11 +138,11 @@ struct dma_chan {
105 int slow_ref; 138 int slow_ref;
106 struct rcu_head rcu; 139 struct rcu_head rcu;
107 140
108 struct list_head client_node;
109 struct list_head device_node; 141 struct list_head device_node;
110 struct dma_chan_percpu *local; 142 struct dma_chan_percpu *local;
111}; 143};
112 144
145
113void dma_chan_cleanup(struct kref *kref); 146void dma_chan_cleanup(struct kref *kref);
114 147
115static inline void dma_chan_get(struct dma_chan *chan) 148static inline void dma_chan_get(struct dma_chan *chan)
@@ -134,169 +167,206 @@ static inline void dma_chan_put(struct dma_chan *chan)
134 167
135/* 168/*
136 * typedef dma_event_callback - function pointer to a DMA event callback 169 * typedef dma_event_callback - function pointer to a DMA event callback
170 * For each channel added to the system this routine is called for each client.
171 * If the client would like to use the channel it returns '1' to signal (ack)
172 * the dmaengine core to take out a reference on the channel and its
173 * corresponding device. A client must not 'ack' an available channel more
174 * than once. When a channel is removed all clients are notified. If a client
175 * is using the channel it must 'ack' the removal. A client must not 'ack' a
176 * removed channel more than once.
177 * @client - 'this' pointer for the client context
178 * @chan - channel to be acted upon
179 * @state - available or removed
137 */ 180 */
138typedef void (*dma_event_callback) (struct dma_client *client, 181struct dma_client;
139 struct dma_chan *chan, enum dma_event event); 182typedef enum dma_state_client (*dma_event_callback) (struct dma_client *client,
183 struct dma_chan *chan, enum dma_state state);
140 184
141/** 185/**
142 * struct dma_client - info on the entity making use of DMA services 186 * struct dma_client - info on the entity making use of DMA services
143 * @event_callback: func ptr to call when something happens 187 * @event_callback: func ptr to call when something happens
144 * @chan_count: number of chans allocated 188 * @cap_mask: only return channels that satisfy the requested capabilities
145 * @chans_desired: number of chans requested. Can be +/- chan_count 189 * a value of zero corresponds to any capability
146 * @lock: protects access to the channels list
147 * @channels: the list of DMA channels allocated
148 * @global_node: list_head for global dma_client_list 190 * @global_node: list_head for global dma_client_list
149 */ 191 */
150struct dma_client { 192struct dma_client {
151 dma_event_callback event_callback; 193 dma_event_callback event_callback;
152 unsigned int chan_count; 194 dma_cap_mask_t cap_mask;
153 unsigned int chans_desired;
154
155 spinlock_t lock;
156 struct list_head channels;
157 struct list_head global_node; 195 struct list_head global_node;
158}; 196};
159 197
198typedef void (*dma_async_tx_callback)(void *dma_async_param);
199/**
200 * struct dma_async_tx_descriptor - async transaction descriptor
201 * ---dma generic offload fields---
202 * @cookie: tracking cookie for this transaction, set to -EBUSY if
203 * this tx is sitting on a dependency list
204 * @ack: the descriptor can not be reused until the client acknowledges
205 * receipt, i.e. has has a chance to establish any dependency chains
206 * @phys: physical address of the descriptor
207 * @tx_list: driver common field for operations that require multiple
208 * descriptors
209 * @chan: target channel for this operation
210 * @tx_submit: set the prepared descriptor(s) to be executed by the engine
211 * @tx_set_dest: set a destination address in a hardware descriptor
212 * @tx_set_src: set a source address in a hardware descriptor
213 * @callback: routine to call after this operation is complete
214 * @callback_param: general parameter to pass to the callback routine
215 * ---async_tx api specific fields---
216 * @depend_list: at completion this list of transactions are submitted
217 * @depend_node: allow this transaction to be executed after another
218 * transaction has completed, possibly on another channel
219 * @parent: pointer to the next level up in the dependency chain
220 * @lock: protect the dependency list
221 */
222struct dma_async_tx_descriptor {
223 dma_cookie_t cookie;
224 int ack;
225 dma_addr_t phys;
226 struct list_head tx_list;
227 struct dma_chan *chan;
228 dma_cookie_t (*tx_submit)(struct dma_async_tx_descriptor *tx);
229 void (*tx_set_dest)(dma_addr_t addr,
230 struct dma_async_tx_descriptor *tx, int index);
231 void (*tx_set_src)(dma_addr_t addr,
232 struct dma_async_tx_descriptor *tx, int index);
233 dma_async_tx_callback callback;
234 void *callback_param;
235 struct list_head depend_list;
236 struct list_head depend_node;
237 struct dma_async_tx_descriptor *parent;
238 spinlock_t lock;
239};
240
160/** 241/**
161 * struct dma_device - info on the entity supplying DMA services 242 * struct dma_device - info on the entity supplying DMA services
162 * @chancnt: how many DMA channels are supported 243 * @chancnt: how many DMA channels are supported
163 * @channels: the list of struct dma_chan 244 * @channels: the list of struct dma_chan
164 * @global_node: list_head for global dma_device_list 245 * @global_node: list_head for global dma_device_list
246 * @cap_mask: one or more dma_capability flags
247 * @max_xor: maximum number of xor sources, 0 if no capability
165 * @refcount: reference count 248 * @refcount: reference count
166 * @done: IO completion struct 249 * @done: IO completion struct
167 * @dev_id: unique device ID 250 * @dev_id: unique device ID
251 * @dev: struct device reference for dma mapping api
168 * @device_alloc_chan_resources: allocate resources and return the 252 * @device_alloc_chan_resources: allocate resources and return the
169 * number of allocated descriptors 253 * number of allocated descriptors
170 * @device_free_chan_resources: release DMA channel's resources 254 * @device_free_chan_resources: release DMA channel's resources
171 * @device_memcpy_buf_to_buf: memcpy buf pointer to buf pointer 255 * @device_prep_dma_memcpy: prepares a memcpy operation
172 * @device_memcpy_buf_to_pg: memcpy buf pointer to struct page 256 * @device_prep_dma_xor: prepares a xor operation
173 * @device_memcpy_pg_to_pg: memcpy struct page/offset to struct page/offset 257 * @device_prep_dma_zero_sum: prepares a zero_sum operation
174 * @device_memcpy_complete: poll the status of an IOAT DMA transaction 258 * @device_prep_dma_memset: prepares a memset operation
175 * @device_memcpy_issue_pending: push appended descriptors to hardware 259 * @device_prep_dma_interrupt: prepares an end of chain interrupt operation
260 * @device_dependency_added: async_tx notifies the channel about new deps
261 * @device_issue_pending: push pending transactions to hardware
176 */ 262 */
177struct dma_device { 263struct dma_device {
178 264
179 unsigned int chancnt; 265 unsigned int chancnt;
180 struct list_head channels; 266 struct list_head channels;
181 struct list_head global_node; 267 struct list_head global_node;
268 dma_cap_mask_t cap_mask;
269 int max_xor;
182 270
183 struct kref refcount; 271 struct kref refcount;
184 struct completion done; 272 struct completion done;
185 273
186 int dev_id; 274 int dev_id;
275 struct device *dev;
187 276
188 int (*device_alloc_chan_resources)(struct dma_chan *chan); 277 int (*device_alloc_chan_resources)(struct dma_chan *chan);
189 void (*device_free_chan_resources)(struct dma_chan *chan); 278 void (*device_free_chan_resources)(struct dma_chan *chan);
190 dma_cookie_t (*device_memcpy_buf_to_buf)(struct dma_chan *chan, 279
191 void *dest, void *src, size_t len); 280 struct dma_async_tx_descriptor *(*device_prep_dma_memcpy)(
192 dma_cookie_t (*device_memcpy_buf_to_pg)(struct dma_chan *chan, 281 struct dma_chan *chan, size_t len, int int_en);
193 struct page *page, unsigned int offset, void *kdata, 282 struct dma_async_tx_descriptor *(*device_prep_dma_xor)(
194 size_t len); 283 struct dma_chan *chan, unsigned int src_cnt, size_t len,
195 dma_cookie_t (*device_memcpy_pg_to_pg)(struct dma_chan *chan, 284 int int_en);
196 struct page *dest_pg, unsigned int dest_off, 285 struct dma_async_tx_descriptor *(*device_prep_dma_zero_sum)(
197 struct page *src_pg, unsigned int src_off, size_t len); 286 struct dma_chan *chan, unsigned int src_cnt, size_t len,
198 enum dma_status (*device_memcpy_complete)(struct dma_chan *chan, 287 u32 *result, int int_en);
288 struct dma_async_tx_descriptor *(*device_prep_dma_memset)(
289 struct dma_chan *chan, int value, size_t len, int int_en);
290 struct dma_async_tx_descriptor *(*device_prep_dma_interrupt)(
291 struct dma_chan *chan);
292
293 void (*device_dependency_added)(struct dma_chan *chan);
294 enum dma_status (*device_is_tx_complete)(struct dma_chan *chan,
199 dma_cookie_t cookie, dma_cookie_t *last, 295 dma_cookie_t cookie, dma_cookie_t *last,
200 dma_cookie_t *used); 296 dma_cookie_t *used);
201 void (*device_memcpy_issue_pending)(struct dma_chan *chan); 297 void (*device_issue_pending)(struct dma_chan *chan);
202}; 298};
203 299
204/* --- public DMA engine API --- */ 300/* --- public DMA engine API --- */
205 301
206struct dma_client *dma_async_client_register(dma_event_callback event_callback); 302void dma_async_client_register(struct dma_client *client);
207void dma_async_client_unregister(struct dma_client *client); 303void dma_async_client_unregister(struct dma_client *client);
208void dma_async_client_chan_request(struct dma_client *client, 304void dma_async_client_chan_request(struct dma_client *client);
209 unsigned int number); 305dma_cookie_t dma_async_memcpy_buf_to_buf(struct dma_chan *chan,
306 void *dest, void *src, size_t len);
307dma_cookie_t dma_async_memcpy_buf_to_pg(struct dma_chan *chan,
308 struct page *page, unsigned int offset, void *kdata, size_t len);
309dma_cookie_t dma_async_memcpy_pg_to_pg(struct dma_chan *chan,
310 struct page *dest_pg, unsigned int dest_off, struct page *src_pg,
311 unsigned int src_off, size_t len);
312void dma_async_tx_descriptor_init(struct dma_async_tx_descriptor *tx,
313 struct dma_chan *chan);
210 314
211/** 315static inline void
212 * dma_async_memcpy_buf_to_buf - offloaded copy between virtual addresses 316async_tx_ack(struct dma_async_tx_descriptor *tx)
213 * @chan: DMA channel to offload copy to
214 * @dest: destination address (virtual)
215 * @src: source address (virtual)
216 * @len: length
217 *
218 * Both @dest and @src must be mappable to a bus address according to the
219 * DMA mapping API rules for streaming mappings.
220 * Both @dest and @src must stay memory resident (kernel memory or locked
221 * user space pages).
222 */
223static inline dma_cookie_t dma_async_memcpy_buf_to_buf(struct dma_chan *chan,
224 void *dest, void *src, size_t len)
225{ 317{
226 int cpu = get_cpu(); 318 tx->ack = 1;
227 per_cpu_ptr(chan->local, cpu)->bytes_transferred += len;
228 per_cpu_ptr(chan->local, cpu)->memcpy_count++;
229 put_cpu();
230
231 return chan->device->device_memcpy_buf_to_buf(chan, dest, src, len);
232} 319}
233 320
234/** 321#define first_dma_cap(mask) __first_dma_cap(&(mask))
235 * dma_async_memcpy_buf_to_pg - offloaded copy from address to page 322static inline int __first_dma_cap(const dma_cap_mask_t *srcp)
236 * @chan: DMA channel to offload copy to
237 * @page: destination page
238 * @offset: offset in page to copy to
239 * @kdata: source address (virtual)
240 * @len: length
241 *
242 * Both @page/@offset and @kdata must be mappable to a bus address according
243 * to the DMA mapping API rules for streaming mappings.
244 * Both @page/@offset and @kdata must stay memory resident (kernel memory or
245 * locked user space pages)
246 */
247static inline dma_cookie_t dma_async_memcpy_buf_to_pg(struct dma_chan *chan,
248 struct page *page, unsigned int offset, void *kdata, size_t len)
249{ 323{
250 int cpu = get_cpu(); 324 return min_t(int, DMA_TX_TYPE_END,
251 per_cpu_ptr(chan->local, cpu)->bytes_transferred += len; 325 find_first_bit(srcp->bits, DMA_TX_TYPE_END));
252 per_cpu_ptr(chan->local, cpu)->memcpy_count++; 326}
253 put_cpu();
254 327
255 return chan->device->device_memcpy_buf_to_pg(chan, page, offset, 328#define next_dma_cap(n, mask) __next_dma_cap((n), &(mask))
256 kdata, len); 329static inline int __next_dma_cap(int n, const dma_cap_mask_t *srcp)
330{
331 return min_t(int, DMA_TX_TYPE_END,
332 find_next_bit(srcp->bits, DMA_TX_TYPE_END, n+1));
257} 333}
258 334
259/** 335#define dma_cap_set(tx, mask) __dma_cap_set((tx), &(mask))
260 * dma_async_memcpy_pg_to_pg - offloaded copy from page to page 336static inline void
261 * @chan: DMA channel to offload copy to 337__dma_cap_set(enum dma_transaction_type tx_type, dma_cap_mask_t *dstp)
262 * @dest_pg: destination page
263 * @dest_off: offset in page to copy to
264 * @src_pg: source page
265 * @src_off: offset in page to copy from
266 * @len: length
267 *
268 * Both @dest_page/@dest_off and @src_page/@src_off must be mappable to a bus
269 * address according to the DMA mapping API rules for streaming mappings.
270 * Both @dest_page/@dest_off and @src_page/@src_off must stay memory resident
271 * (kernel memory or locked user space pages).
272 */
273static inline dma_cookie_t dma_async_memcpy_pg_to_pg(struct dma_chan *chan,
274 struct page *dest_pg, unsigned int dest_off, struct page *src_pg,
275 unsigned int src_off, size_t len)
276{ 338{
277 int cpu = get_cpu(); 339 set_bit(tx_type, dstp->bits);
278 per_cpu_ptr(chan->local, cpu)->bytes_transferred += len; 340}
279 per_cpu_ptr(chan->local, cpu)->memcpy_count++;
280 put_cpu();
281 341
282 return chan->device->device_memcpy_pg_to_pg(chan, dest_pg, dest_off, 342#define dma_has_cap(tx, mask) __dma_has_cap((tx), &(mask))
283 src_pg, src_off, len); 343static inline int
344__dma_has_cap(enum dma_transaction_type tx_type, dma_cap_mask_t *srcp)
345{
346 return test_bit(tx_type, srcp->bits);
284} 347}
285 348
349#define for_each_dma_cap_mask(cap, mask) \
350 for ((cap) = first_dma_cap(mask); \
351 (cap) < DMA_TX_TYPE_END; \
352 (cap) = next_dma_cap((cap), (mask)))
353
286/** 354/**
287 * dma_async_memcpy_issue_pending - flush pending copies to HW 355 * dma_async_issue_pending - flush pending transactions to HW
288 * @chan: target DMA channel 356 * @chan: target DMA channel
289 * 357 *
290 * This allows drivers to push copies to HW in batches, 358 * This allows drivers to push copies to HW in batches,
291 * reducing MMIO writes where possible. 359 * reducing MMIO writes where possible.
292 */ 360 */
293static inline void dma_async_memcpy_issue_pending(struct dma_chan *chan) 361static inline void dma_async_issue_pending(struct dma_chan *chan)
294{ 362{
295 return chan->device->device_memcpy_issue_pending(chan); 363 return chan->device->device_issue_pending(chan);
296} 364}
297 365
366#define dma_async_memcpy_issue_pending(chan) dma_async_issue_pending(chan)
367
298/** 368/**
299 * dma_async_memcpy_complete - poll for transaction completion 369 * dma_async_is_tx_complete - poll for transaction completion
300 * @chan: DMA channel 370 * @chan: DMA channel
301 * @cookie: transaction identifier to check status of 371 * @cookie: transaction identifier to check status of
302 * @last: returns last completed cookie, can be NULL 372 * @last: returns last completed cookie, can be NULL
@@ -306,12 +376,15 @@ static inline void dma_async_memcpy_issue_pending(struct dma_chan *chan)
306 * internal state and can be used with dma_async_is_complete() to check 376 * internal state and can be used with dma_async_is_complete() to check
307 * the status of multiple cookies without re-checking hardware state. 377 * the status of multiple cookies without re-checking hardware state.
308 */ 378 */
309static inline enum dma_status dma_async_memcpy_complete(struct dma_chan *chan, 379static inline enum dma_status dma_async_is_tx_complete(struct dma_chan *chan,
310 dma_cookie_t cookie, dma_cookie_t *last, dma_cookie_t *used) 380 dma_cookie_t cookie, dma_cookie_t *last, dma_cookie_t *used)
311{ 381{
312 return chan->device->device_memcpy_complete(chan, cookie, last, used); 382 return chan->device->device_is_tx_complete(chan, cookie, last, used);
313} 383}
314 384
385#define dma_async_memcpy_complete(chan, cookie, last, used)\
386 dma_async_is_tx_complete(chan, cookie, last, used)
387
315/** 388/**
316 * dma_async_is_complete - test a cookie against chan state 389 * dma_async_is_complete - test a cookie against chan state
317 * @cookie: transaction identifier to test status of 390 * @cookie: transaction identifier to test status of
@@ -334,6 +407,7 @@ static inline enum dma_status dma_async_is_complete(dma_cookie_t cookie,
334 return DMA_IN_PROGRESS; 407 return DMA_IN_PROGRESS;
335} 408}
336 409
410enum dma_status dma_sync_wait(struct dma_chan *chan, dma_cookie_t cookie);
337 411
338/* --- DMA device --- */ 412/* --- DMA device --- */
339 413
@@ -362,5 +436,4 @@ dma_cookie_t dma_memcpy_pg_to_iovec(struct dma_chan *chan, struct iovec *iov,
362 struct dma_pinned_list *pinned_list, struct page *page, 436 struct dma_pinned_list *pinned_list, struct page *page,
363 unsigned int offset, size_t len); 437 unsigned int offset, size_t len);
364 438
365#endif /* CONFIG_DMA_ENGINE */
366#endif /* DMAENGINE_H */ 439#endif /* DMAENGINE_H */
diff --git a/include/linux/dmi.h b/include/linux/dmi.h
index 904bf3d2d90b..b8ac7b01c45e 100644
--- a/include/linux/dmi.h
+++ b/include/linux/dmi.h
@@ -12,9 +12,17 @@ enum dmi_field {
12 DMI_PRODUCT_NAME, 12 DMI_PRODUCT_NAME,
13 DMI_PRODUCT_VERSION, 13 DMI_PRODUCT_VERSION,
14 DMI_PRODUCT_SERIAL, 14 DMI_PRODUCT_SERIAL,
15 DMI_PRODUCT_UUID,
15 DMI_BOARD_VENDOR, 16 DMI_BOARD_VENDOR,
16 DMI_BOARD_NAME, 17 DMI_BOARD_NAME,
17 DMI_BOARD_VERSION, 18 DMI_BOARD_VERSION,
19 DMI_BOARD_SERIAL,
20 DMI_BOARD_ASSET_TAG,
21 DMI_CHASSIS_VENDOR,
22 DMI_CHASSIS_TYPE,
23 DMI_CHASSIS_VERSION,
24 DMI_CHASSIS_SERIAL,
25 DMI_CHASSIS_ASSET_TAG,
18 DMI_STRING_MAX, 26 DMI_STRING_MAX,
19}; 27};
20 28
diff --git a/include/linux/ds17287rtc.h b/include/linux/ds17287rtc.h
index c281ba42e28f..d85d3f497b96 100644
--- a/include/linux/ds17287rtc.h
+++ b/include/linux/ds17287rtc.h
@@ -11,7 +11,6 @@
11#define __LINUX_DS17287RTC_H 11#define __LINUX_DS17287RTC_H
12 12
13#include <linux/rtc.h> /* get the user-level API */ 13#include <linux/rtc.h> /* get the user-level API */
14#include <linux/spinlock.h> /* spinlock_t */
15#include <linux/mc146818rtc.h> 14#include <linux/mc146818rtc.h>
16 15
17/* Register A */ 16/* Register A */
diff --git a/include/linux/edd.h b/include/linux/edd.h
index b2b3e68aa512..7b647822d6dc 100644
--- a/include/linux/edd.h
+++ b/include/linux/edd.h
@@ -49,10 +49,6 @@
49#define EDD_MBR_SIG_MAX 16 /* max number of signatures to store */ 49#define EDD_MBR_SIG_MAX 16 /* max number of signatures to store */
50#define EDD_MBR_SIG_NR_BUF 0x1ea /* addr of number of MBR signtaures at EDD_MBR_SIG_BUF 50#define EDD_MBR_SIG_NR_BUF 0x1ea /* addr of number of MBR signtaures at EDD_MBR_SIG_BUF
51 in boot_params - treat this as 1 byte */ 51 in boot_params - treat this as 1 byte */
52#define EDD_CL_EQUALS 0x3d646465 /* "edd=" */
53#define EDD_CL_OFF 0x666f /* "of" for off */
54#define EDD_CL_SKIP 0x6b73 /* "sk" for skipmbr */
55#define EDD_CL_ON 0x6e6f /* "on" for on */
56 52
57#ifndef __ASSEMBLY__ 53#ifndef __ASSEMBLY__
58 54
diff --git a/include/linux/eeprom_93cx6.h b/include/linux/eeprom_93cx6.h
new file mode 100644
index 000000000000..d774b7778c91
--- /dev/null
+++ b/include/linux/eeprom_93cx6.h
@@ -0,0 +1,72 @@
1/*
2 Copyright (C) 2004 - 2006 rt2x00 SourceForge Project
3 <http://rt2x00.serialmonkey.com>
4
5 This program is free software; you can redistribute it and/or modify
6 it under the terms of the GNU General Public License as published by
7 the Free Software Foundation; either version 2 of the License, or
8 (at your option) any later version.
9
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
14
15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the
17 Free Software Foundation, Inc.,
18 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
19 */
20
21/*
22 Module: eeprom_93cx6
23 Abstract: EEPROM reader datastructures for 93cx6 chipsets.
24 Supported chipsets: 93c46 & 93c66.
25 */
26
27/*
28 * EEPROM operation defines.
29 */
30#define PCI_EEPROM_WIDTH_93C46 6
31#define PCI_EEPROM_WIDTH_93C66 8
32#define PCI_EEPROM_WIDTH_OPCODE 3
33#define PCI_EEPROM_WRITE_OPCODE 0x05
34#define PCI_EEPROM_READ_OPCODE 0x06
35#define PCI_EEPROM_EWDS_OPCODE 0x10
36#define PCI_EEPROM_EWEN_OPCODE 0x13
37
38/**
39 * struct eeprom_93cx6 - control structure for setting the commands
40 * for reading the eeprom data.
41 * @data: private pointer for the driver.
42 * @register_read(struct eeprom_93cx6 *eeprom): handler to
43 * read the eeprom register, this function should set all reg_* fields.
44 * @register_write(struct eeprom_93cx6 *eeprom): handler to
45 * write to the eeprom register by using all reg_* fields.
46 * @width: eeprom width, should be one of the PCI_EEPROM_WIDTH_* defines
47 * @reg_data_in: register field to indicate data input
48 * @reg_data_out: register field to indicate data output
49 * @reg_data_clock: register field to set the data clock
50 * @reg_chip_select: register field to set the chip select
51 *
52 * This structure is used for the communication between the driver
53 * and the eeprom_93cx6 handlers for reading the eeprom.
54 */
55struct eeprom_93cx6 {
56 void *data;
57
58 void (*register_read)(struct eeprom_93cx6 *eeprom);
59 void (*register_write)(struct eeprom_93cx6 *eeprom);
60
61 int width;
62
63 char reg_data_in;
64 char reg_data_out;
65 char reg_data_clock;
66 char reg_chip_select;
67};
68
69extern void eeprom_93cx6_read(struct eeprom_93cx6 *eeprom,
70 const u8 word, u16 *data);
71extern void eeprom_93cx6_multiread(struct eeprom_93cx6 *eeprom,
72 const u8 word, __le16 *data, const u16 words);
diff --git a/include/linux/efs_fs.h b/include/linux/efs_fs.h
index dfed8009ebff..16cb25cbf7c5 100644
--- a/include/linux/efs_fs.h
+++ b/include/linux/efs_fs.h
@@ -45,6 +45,7 @@ extern efs_block_t efs_map_block(struct inode *, efs_block_t);
45extern int efs_get_block(struct inode *, sector_t, struct buffer_head *, int); 45extern int efs_get_block(struct inode *, sector_t, struct buffer_head *, int);
46 46
47extern struct dentry *efs_lookup(struct inode *, struct dentry *, struct nameidata *); 47extern struct dentry *efs_lookup(struct inode *, struct dentry *, struct nameidata *);
48extern struct dentry *efs_get_dentry(struct super_block *sb, void *vobjp);
48extern struct dentry *efs_get_parent(struct dentry *); 49extern struct dentry *efs_get_parent(struct dentry *);
49extern int efs_bmap(struct inode *, int); 50extern int efs_bmap(struct inode *, int);
50 51
diff --git a/include/linux/elfnote.h b/include/linux/elfnote.h
index 9a1e0674e56c..e831759b2fb5 100644
--- a/include/linux/elfnote.h
+++ b/include/linux/elfnote.h
@@ -38,17 +38,25 @@
38 * e.g. ELFNOTE(XYZCo, 42, .asciz, "forty-two") 38 * e.g. ELFNOTE(XYZCo, 42, .asciz, "forty-two")
39 * ELFNOTE(XYZCo, 12, .long, 0xdeadbeef) 39 * ELFNOTE(XYZCo, 12, .long, 0xdeadbeef)
40 */ 40 */
41#define ELFNOTE(name, type, desctype, descdata) \ 41#define ELFNOTE_START(name, type, flags) \
42.pushsection .note.name, "",@note ; \ 42.pushsection .note.name, flags,@note ; \
43 .align 4 ; \ 43 .balign 4 ; \
44 .long 2f - 1f /* namesz */ ; \ 44 .long 2f - 1f /* namesz */ ; \
45 .long 4f - 3f /* descsz */ ; \ 45 .long 4484f - 3f /* descsz */ ; \
46 .long type ; \ 46 .long type ; \
471:.asciz #name ; \ 471:.asciz #name ; \
482:.align 4 ; \ 482:.balign 4 ; \
493:desctype descdata ; \ 493:
504:.align 4 ; \ 50
51#define ELFNOTE_END \
524484:.balign 4 ; \
51.popsection ; 53.popsection ;
54
55#define ELFNOTE(name, type, desc) \
56 ELFNOTE_START(name, type, "") \
57 desc ; \
58 ELFNOTE_END
59
52#else /* !__ASSEMBLER__ */ 60#else /* !__ASSEMBLER__ */
53#include <linux/elf.h> 61#include <linux/elf.h>
54/* 62/*
diff --git a/include/linux/etherdevice.h b/include/linux/etherdevice.h
index 071c67abed86..6cdb97365e47 100644
--- a/include/linux/etherdevice.h
+++ b/include/linux/etherdevice.h
@@ -39,13 +39,8 @@ extern void eth_header_cache_update(struct hh_cache *hh, struct net_device *dev
39extern int eth_header_cache(struct neighbour *neigh, 39extern int eth_header_cache(struct neighbour *neigh,
40 struct hh_cache *hh); 40 struct hh_cache *hh);
41 41
42extern struct net_device *alloc_etherdev(int sizeof_priv); 42extern struct net_device *alloc_etherdev_mq(int sizeof_priv, unsigned int queue_count);
43static inline void eth_copy_and_sum (struct sk_buff *dest, 43#define alloc_etherdev(sizeof_priv) alloc_etherdev_mq(sizeof_priv, 1)
44 const unsigned char *src,
45 int len, int base)
46{
47 memcpy (dest->data, src, len);
48}
49 44
50/** 45/**
51 * is_zero_ether_addr - Determine if give Ethernet address is all zeros. 46 * is_zero_ether_addr - Determine if give Ethernet address is all zeros.
diff --git a/include/linux/ethtool.h b/include/linux/ethtool.h
index f2d248f8cc92..3a632244f31b 100644
--- a/include/linux/ethtool.h
+++ b/include/linux/ethtool.h
@@ -265,6 +265,7 @@ u32 ethtool_op_get_link(struct net_device *dev);
265u32 ethtool_op_get_tx_csum(struct net_device *dev); 265u32 ethtool_op_get_tx_csum(struct net_device *dev);
266int ethtool_op_set_tx_csum(struct net_device *dev, u32 data); 266int ethtool_op_set_tx_csum(struct net_device *dev, u32 data);
267int ethtool_op_set_tx_hw_csum(struct net_device *dev, u32 data); 267int ethtool_op_set_tx_hw_csum(struct net_device *dev, u32 data);
268int ethtool_op_set_tx_ipv6_csum(struct net_device *dev, u32 data);
268u32 ethtool_op_get_sg(struct net_device *dev); 269u32 ethtool_op_get_sg(struct net_device *dev);
269int ethtool_op_set_sg(struct net_device *dev, u32 data); 270int ethtool_op_set_sg(struct net_device *dev, u32 data);
270u32 ethtool_op_get_tso(struct net_device *dev); 271u32 ethtool_op_get_tso(struct net_device *dev);
diff --git a/include/linux/eventfd.h b/include/linux/eventfd.h
index 0d6ecc60b94d..b489fc6d0b62 100644
--- a/include/linux/eventfd.h
+++ b/include/linux/eventfd.h
@@ -19,7 +19,8 @@ int eventfd_signal(struct file *file, int n);
19#else /* CONFIG_EVENTFD */ 19#else /* CONFIG_EVENTFD */
20 20
21#define eventfd_fget(fd) ERR_PTR(-ENOSYS) 21#define eventfd_fget(fd) ERR_PTR(-ENOSYS)
22#define eventfd_signal(f, n) 0 22static inline int eventfd_signal(struct file *file, int n)
23{ return 0; }
23 24
24#endif /* CONFIG_EVENTFD */ 25#endif /* CONFIG_EVENTFD */
25 26
diff --git a/include/linux/exportfs.h b/include/linux/exportfs.h
new file mode 100644
index 000000000000..8872fe8392d6
--- /dev/null
+++ b/include/linux/exportfs.h
@@ -0,0 +1,126 @@
1#ifndef LINUX_EXPORTFS_H
2#define LINUX_EXPORTFS_H 1
3
4#include <linux/types.h>
5
6struct dentry;
7struct super_block;
8struct vfsmount;
9
10
11/**
12 * struct export_operations - for nfsd to communicate with file systems
13 * @decode_fh: decode a file handle fragment and return a &struct dentry
14 * @encode_fh: encode a file handle fragment from a dentry
15 * @get_name: find the name for a given inode in a given directory
16 * @get_parent: find the parent of a given directory
17 * @get_dentry: find a dentry for the inode given a file handle sub-fragment
18 * @find_exported_dentry:
19 * set by the exporting module to a standard helper function.
20 *
21 * Description:
22 * The export_operations structure provides a means for nfsd to communicate
23 * with a particular exported file system - particularly enabling nfsd and
24 * the filesystem to co-operate when dealing with file handles.
25 *
26 * export_operations contains two basic operation for dealing with file
27 * handles, decode_fh() and encode_fh(), and allows for some other
28 * operations to be defined which standard helper routines use to get
29 * specific information from the filesystem.
30 *
31 * nfsd encodes information use to determine which filesystem a filehandle
32 * applies to in the initial part of the file handle. The remainder, termed
33 * a file handle fragment, is controlled completely by the filesystem. The
34 * standard helper routines assume that this fragment will contain one or
35 * two sub-fragments, one which identifies the file, and one which may be
36 * used to identify the (a) directory containing the file.
37 *
38 * In some situations, nfsd needs to get a dentry which is connected into a
39 * specific part of the file tree. To allow for this, it passes the
40 * function acceptable() together with a @context which can be used to see
41 * if the dentry is acceptable. As there can be multiple dentrys for a
42 * given file, the filesystem should check each one for acceptability before
43 * looking for the next. As soon as an acceptable one is found, it should
44 * be returned.
45 *
46 * decode_fh:
47 * @decode_fh is given a &struct super_block (@sb), a file handle fragment
48 * (@fh, @fh_len) and an acceptability testing function (@acceptable,
49 * @context). It should return a &struct dentry which refers to the same
50 * file that the file handle fragment refers to, and which passes the
51 * acceptability test. If it cannot, it should return a %NULL pointer if
52 * the file was found but no acceptable &dentries were available, or a
53 * %ERR_PTR error code indicating why it couldn't be found (e.g. %ENOENT or
54 * %ENOMEM).
55 *
56 * encode_fh:
57 * @encode_fh should store in the file handle fragment @fh (using at most
58 * @max_len bytes) information that can be used by @decode_fh to recover the
59 * file refered to by the &struct dentry @de. If the @connectable flag is
60 * set, the encode_fh() should store sufficient information so that a good
61 * attempt can be made to find not only the file but also it's place in the
62 * filesystem. This typically means storing a reference to de->d_parent in
63 * the filehandle fragment. encode_fh() should return the number of bytes
64 * stored or a negative error code such as %-ENOSPC
65 *
66 * get_name:
67 * @get_name should find a name for the given @child in the given @parent
68 * directory. The name should be stored in the @name (with the
69 * understanding that it is already pointing to a a %NAME_MAX+1 sized
70 * buffer. get_name() should return %0 on success, a negative error code
71 * or error. @get_name will be called without @parent->i_mutex held.
72 *
73 * get_parent:
74 * @get_parent should find the parent directory for the given @child which
75 * is also a directory. In the event that it cannot be found, or storage
76 * space cannot be allocated, a %ERR_PTR should be returned.
77 *
78 * get_dentry:
79 * Given a &super_block (@sb) and a pointer to a file-system specific inode
80 * identifier, possibly an inode number, (@inump) get_dentry() should find
81 * the identified inode and return a dentry for that inode. Any suitable
82 * dentry can be returned including, if necessary, a new dentry created with
83 * d_alloc_root. The caller can then find any other extant dentrys by
84 * following the d_alias links. If a new dentry was created using
85 * d_alloc_root, DCACHE_NFSD_DISCONNECTED should be set, and the dentry
86 * should be d_rehash()ed.
87 *
88 * If the inode cannot be found, either a %NULL pointer or an %ERR_PTR code
89 * can be returned. The @inump will be whatever was passed to
90 * nfsd_find_fh_dentry() in either the @obj or @parent parameters.
91 *
92 * Locking rules:
93 * get_parent is called with child->d_inode->i_mutex down
94 * get_name is not (which is possibly inconsistent)
95 */
96
97struct export_operations {
98 struct dentry *(*decode_fh)(struct super_block *sb, __u32 *fh,
99 int fh_len, int fh_type,
100 int (*acceptable)(void *context, struct dentry *de),
101 void *context);
102 int (*encode_fh)(struct dentry *de, __u32 *fh, int *max_len,
103 int connectable);
104 int (*get_name)(struct dentry *parent, char *name,
105 struct dentry *child);
106 struct dentry * (*get_parent)(struct dentry *child);
107 struct dentry * (*get_dentry)(struct super_block *sb, void *inump);
108
109 /* This is set by the exporting module to a standard helper */
110 struct dentry * (*find_exported_dentry)(
111 struct super_block *sb, void *obj, void *parent,
112 int (*acceptable)(void *context, struct dentry *de),
113 void *context);
114};
115
116extern struct dentry *find_exported_dentry(struct super_block *sb, void *obj,
117 void *parent, int (*acceptable)(void *context, struct dentry *de),
118 void *context);
119
120extern int exportfs_encode_fh(struct dentry *dentry, __u32 *fh, int *max_len,
121 int connectable);
122extern struct dentry *exportfs_decode_fh(struct vfsmount *mnt, __u32 *fh,
123 int fh_len, int fileid_type, int (*acceptable)(void *, struct dentry *),
124 void *context);
125
126#endif /* LINUX_EXPORTFS_H */
diff --git a/include/linux/ext2_fs_sb.h b/include/linux/ext2_fs_sb.h
index 4eda0ed76a48..d149f2959e67 100644
--- a/include/linux/ext2_fs_sb.h
+++ b/include/linux/ext2_fs_sb.h
@@ -33,6 +33,8 @@ struct ext2_sb_info {
33 unsigned long s_gdb_count; /* Number of group descriptor blocks */ 33 unsigned long s_gdb_count; /* Number of group descriptor blocks */
34 unsigned long s_desc_per_block; /* Number of group descriptors per block */ 34 unsigned long s_desc_per_block; /* Number of group descriptors per block */
35 unsigned long s_groups_count; /* Number of groups in the fs */ 35 unsigned long s_groups_count; /* Number of groups in the fs */
36 unsigned long s_overhead_last; /* Last calculated overhead */
37 unsigned long s_blocks_last; /* Last seen block count */
36 struct buffer_head * s_sbh; /* Buffer containing the super block */ 38 struct buffer_head * s_sbh; /* Buffer containing the super block */
37 struct ext2_super_block * s_es; /* Pointer to the super block in the buffer */ 39 struct ext2_super_block * s_es; /* Pointer to the super block in the buffer */
38 struct buffer_head ** s_group_desc; 40 struct buffer_head ** s_group_desc;
diff --git a/include/linux/ext3_fs_sb.h b/include/linux/ext3_fs_sb.h
index f61309c81cc4..d3c08353edf6 100644
--- a/include/linux/ext3_fs_sb.h
+++ b/include/linux/ext3_fs_sb.h
@@ -38,6 +38,8 @@ struct ext3_sb_info {
38 unsigned long s_gdb_count; /* Number of group descriptor blocks */ 38 unsigned long s_gdb_count; /* Number of group descriptor blocks */
39 unsigned long s_desc_per_block; /* Number of group descriptors per block */ 39 unsigned long s_desc_per_block; /* Number of group descriptors per block */
40 unsigned long s_groups_count; /* Number of groups in the fs */ 40 unsigned long s_groups_count; /* Number of groups in the fs */
41 unsigned long s_overhead_last; /* Last calculated overhead */
42 unsigned long s_blocks_last; /* Last seen block count */
41 struct buffer_head * s_sbh; /* Buffer containing the super block */ 43 struct buffer_head * s_sbh; /* Buffer containing the super block */
42 struct ext3_super_block * s_es; /* Pointer to the super block in the buffer */ 44 struct ext3_super_block * s_es; /* Pointer to the super block in the buffer */
43 struct buffer_head ** s_group_desc; 45 struct buffer_head ** s_group_desc;
diff --git a/include/linux/ext4_fs.h b/include/linux/ext4_fs.h
index de1f9f78625a..cdee7aaa57aa 100644
--- a/include/linux/ext4_fs.h
+++ b/include/linux/ext4_fs.h
@@ -71,7 +71,7 @@
71/* 71/*
72 * Maximal count of links to a file 72 * Maximal count of links to a file
73 */ 73 */
74#define EXT4_LINK_MAX 32000 74#define EXT4_LINK_MAX 65000
75 75
76/* 76/*
77 * Macro-instructions used to manage several block sizes 77 * Macro-instructions used to manage several block sizes
@@ -102,6 +102,7 @@
102 EXT4_GOOD_OLD_FIRST_INO : \ 102 EXT4_GOOD_OLD_FIRST_INO : \
103 (s)->s_first_ino) 103 (s)->s_first_ino)
104#endif 104#endif
105#define EXT4_BLOCK_ALIGN(size, blkbits) ALIGN((size), (1 << (blkbits)))
105 106
106/* 107/*
107 * Macro-instructions used to manage fragments 108 * Macro-instructions used to manage fragments
@@ -201,6 +202,7 @@ struct ext4_group_desc
201#define EXT4_STATE_JDATA 0x00000001 /* journaled data exists */ 202#define EXT4_STATE_JDATA 0x00000001 /* journaled data exists */
202#define EXT4_STATE_NEW 0x00000002 /* inode is newly created */ 203#define EXT4_STATE_NEW 0x00000002 /* inode is newly created */
203#define EXT4_STATE_XATTR 0x00000004 /* has in-inode xattrs */ 204#define EXT4_STATE_XATTR 0x00000004 /* has in-inode xattrs */
205#define EXT4_STATE_NO_EXPAND 0x00000008 /* No space for expansion */
204 206
205/* Used to pass group descriptor data when online resize is done */ 207/* Used to pass group descriptor data when online resize is done */
206struct ext4_new_group_input { 208struct ext4_new_group_input {
@@ -225,6 +227,11 @@ struct ext4_new_group_data {
225 __u32 free_blocks_count; 227 __u32 free_blocks_count;
226}; 228};
227 229
230/*
231 * Following is used by preallocation code to tell get_blocks() that we
232 * want uninitialzed extents.
233 */
234#define EXT4_CREATE_UNINITIALIZED_EXT 2
228 235
229/* 236/*
230 * ioctl commands 237 * ioctl commands
@@ -237,7 +244,7 @@ struct ext4_new_group_data {
237#define EXT4_IOC_GROUP_ADD _IOW('f', 8,struct ext4_new_group_input) 244#define EXT4_IOC_GROUP_ADD _IOW('f', 8,struct ext4_new_group_input)
238#define EXT4_IOC_GETVERSION_OLD FS_IOC_GETVERSION 245#define EXT4_IOC_GETVERSION_OLD FS_IOC_GETVERSION
239#define EXT4_IOC_SETVERSION_OLD FS_IOC_SETVERSION 246#define EXT4_IOC_SETVERSION_OLD FS_IOC_SETVERSION
240#ifdef CONFIG_JBD_DEBUG 247#ifdef CONFIG_JBD2_DEBUG
241#define EXT4_IOC_WAIT_FOR_READONLY _IOR('f', 99, long) 248#define EXT4_IOC_WAIT_FOR_READONLY _IOR('f', 99, long)
242#endif 249#endif
243#define EXT4_IOC_GETRSVSZ _IOR('f', 5, long) 250#define EXT4_IOC_GETRSVSZ _IOR('f', 5, long)
@@ -253,7 +260,7 @@ struct ext4_new_group_data {
253#define EXT4_IOC32_GETRSVSZ _IOR('f', 5, int) 260#define EXT4_IOC32_GETRSVSZ _IOR('f', 5, int)
254#define EXT4_IOC32_SETRSVSZ _IOW('f', 6, int) 261#define EXT4_IOC32_SETRSVSZ _IOW('f', 6, int)
255#define EXT4_IOC32_GROUP_EXTEND _IOW('f', 7, unsigned int) 262#define EXT4_IOC32_GROUP_EXTEND _IOW('f', 7, unsigned int)
256#ifdef CONFIG_JBD_DEBUG 263#ifdef CONFIG_JBD2_DEBUG
257#define EXT4_IOC32_WAIT_FOR_READONLY _IOR('f', 99, int) 264#define EXT4_IOC32_WAIT_FOR_READONLY _IOR('f', 99, int)
258#endif 265#endif
259#define EXT4_IOC32_GETVERSION_OLD FS_IOC32_GETVERSION 266#define EXT4_IOC32_GETVERSION_OLD FS_IOC32_GETVERSION
@@ -282,7 +289,7 @@ struct ext4_inode {
282 __le16 i_uid; /* Low 16 bits of Owner Uid */ 289 __le16 i_uid; /* Low 16 bits of Owner Uid */
283 __le32 i_size; /* Size in bytes */ 290 __le32 i_size; /* Size in bytes */
284 __le32 i_atime; /* Access time */ 291 __le32 i_atime; /* Access time */
285 __le32 i_ctime; /* Creation time */ 292 __le32 i_ctime; /* Inode Change time */
286 __le32 i_mtime; /* Modification time */ 293 __le32 i_mtime; /* Modification time */
287 __le32 i_dtime; /* Deletion Time */ 294 __le32 i_dtime; /* Deletion Time */
288 __le16 i_gid; /* Low 16 bits of Group Id */ 295 __le16 i_gid; /* Low 16 bits of Group Id */
@@ -331,10 +338,85 @@ struct ext4_inode {
331 } osd2; /* OS dependent 2 */ 338 } osd2; /* OS dependent 2 */
332 __le16 i_extra_isize; 339 __le16 i_extra_isize;
333 __le16 i_pad1; 340 __le16 i_pad1;
341 __le32 i_ctime_extra; /* extra Change time (nsec << 2 | epoch) */
342 __le32 i_mtime_extra; /* extra Modification time(nsec << 2 | epoch) */
343 __le32 i_atime_extra; /* extra Access time (nsec << 2 | epoch) */
344 __le32 i_crtime; /* File Creation time */
345 __le32 i_crtime_extra; /* extra FileCreationtime (nsec << 2 | epoch) */
334}; 346};
335 347
336#define i_size_high i_dir_acl 348#define i_size_high i_dir_acl
337 349
350#define EXT4_EPOCH_BITS 2
351#define EXT4_EPOCH_MASK ((1 << EXT4_EPOCH_BITS) - 1)
352#define EXT4_NSEC_MASK (~0UL << EXT4_EPOCH_BITS)
353
354/*
355 * Extended fields will fit into an inode if the filesystem was formatted
356 * with large inodes (-I 256 or larger) and there are not currently any EAs
357 * consuming all of the available space. For new inodes we always reserve
358 * enough space for the kernel's known extended fields, but for inodes
359 * created with an old kernel this might not have been the case. None of
360 * the extended inode fields is critical for correct filesystem operation.
361 * This macro checks if a certain field fits in the inode. Note that
362 * inode-size = GOOD_OLD_INODE_SIZE + i_extra_isize
363 */
364#define EXT4_FITS_IN_INODE(ext4_inode, einode, field) \
365 ((offsetof(typeof(*ext4_inode), field) + \
366 sizeof((ext4_inode)->field)) \
367 <= (EXT4_GOOD_OLD_INODE_SIZE + \
368 (einode)->i_extra_isize)) \
369
370static inline __le32 ext4_encode_extra_time(struct timespec *time)
371{
372 return cpu_to_le32((sizeof(time->tv_sec) > 4 ?
373 time->tv_sec >> 32 : 0) |
374 ((time->tv_nsec << 2) & EXT4_NSEC_MASK));
375}
376
377static inline void ext4_decode_extra_time(struct timespec *time, __le32 extra)
378{
379 if (sizeof(time->tv_sec) > 4)
380 time->tv_sec |= (__u64)(le32_to_cpu(extra) & EXT4_EPOCH_MASK)
381 << 32;
382 time->tv_nsec = (le32_to_cpu(extra) & EXT4_NSEC_MASK) >> 2;
383}
384
385#define EXT4_INODE_SET_XTIME(xtime, inode, raw_inode) \
386do { \
387 (raw_inode)->xtime = cpu_to_le32((inode)->xtime.tv_sec); \
388 if (EXT4_FITS_IN_INODE(raw_inode, EXT4_I(inode), xtime ## _extra)) \
389 (raw_inode)->xtime ## _extra = \
390 ext4_encode_extra_time(&(inode)->xtime); \
391} while (0)
392
393#define EXT4_EINODE_SET_XTIME(xtime, einode, raw_inode) \
394do { \
395 if (EXT4_FITS_IN_INODE(raw_inode, einode, xtime)) \
396 (raw_inode)->xtime = cpu_to_le32((einode)->xtime.tv_sec); \
397 if (EXT4_FITS_IN_INODE(raw_inode, einode, xtime ## _extra)) \
398 (raw_inode)->xtime ## _extra = \
399 ext4_encode_extra_time(&(einode)->xtime); \
400} while (0)
401
402#define EXT4_INODE_GET_XTIME(xtime, inode, raw_inode) \
403do { \
404 (inode)->xtime.tv_sec = (signed)le32_to_cpu((raw_inode)->xtime); \
405 if (EXT4_FITS_IN_INODE(raw_inode, EXT4_I(inode), xtime ## _extra)) \
406 ext4_decode_extra_time(&(inode)->xtime, \
407 raw_inode->xtime ## _extra); \
408} while (0)
409
410#define EXT4_EINODE_GET_XTIME(xtime, einode, raw_inode) \
411do { \
412 if (EXT4_FITS_IN_INODE(raw_inode, einode, xtime)) \
413 (einode)->xtime.tv_sec = \
414 (signed)le32_to_cpu((raw_inode)->xtime); \
415 if (EXT4_FITS_IN_INODE(raw_inode, einode, xtime ## _extra)) \
416 ext4_decode_extra_time(&(einode)->xtime, \
417 raw_inode->xtime ## _extra); \
418} while (0)
419
338#if defined(__KERNEL__) || defined(__linux__) 420#if defined(__KERNEL__) || defined(__linux__)
339#define i_reserved1 osd1.linux1.l_i_reserved1 421#define i_reserved1 osd1.linux1.l_i_reserved1
340#define i_frag osd2.linux2.l_i_frag 422#define i_frag osd2.linux2.l_i_frag
@@ -533,6 +615,13 @@ static inline struct ext4_inode_info *EXT4_I(struct inode *inode)
533 return container_of(inode, struct ext4_inode_info, vfs_inode); 615 return container_of(inode, struct ext4_inode_info, vfs_inode);
534} 616}
535 617
618static inline struct timespec ext4_current_time(struct inode *inode)
619{
620 return (inode->i_sb->s_time_gran < NSEC_PER_SEC) ?
621 current_fs_time(inode->i_sb) : CURRENT_TIME_SEC;
622}
623
624
536static inline int ext4_valid_inum(struct super_block *sb, unsigned long ino) 625static inline int ext4_valid_inum(struct super_block *sb, unsigned long ino)
537{ 626{
538 return ino == EXT4_ROOT_INO || 627 return ino == EXT4_ROOT_INO ||
@@ -603,6 +692,8 @@ static inline int ext4_valid_inum(struct super_block *sb, unsigned long ino)
603#define EXT4_FEATURE_RO_COMPAT_SPARSE_SUPER 0x0001 692#define EXT4_FEATURE_RO_COMPAT_SPARSE_SUPER 0x0001
604#define EXT4_FEATURE_RO_COMPAT_LARGE_FILE 0x0002 693#define EXT4_FEATURE_RO_COMPAT_LARGE_FILE 0x0002
605#define EXT4_FEATURE_RO_COMPAT_BTREE_DIR 0x0004 694#define EXT4_FEATURE_RO_COMPAT_BTREE_DIR 0x0004
695#define EXT4_FEATURE_RO_COMPAT_DIR_NLINK 0x0020
696#define EXT4_FEATURE_RO_COMPAT_EXTRA_ISIZE 0x0040
606 697
607#define EXT4_FEATURE_INCOMPAT_COMPRESSION 0x0001 698#define EXT4_FEATURE_INCOMPAT_COMPRESSION 0x0001
608#define EXT4_FEATURE_INCOMPAT_FILETYPE 0x0002 699#define EXT4_FEATURE_INCOMPAT_FILETYPE 0x0002
@@ -620,6 +711,8 @@ static inline int ext4_valid_inum(struct super_block *sb, unsigned long ino)
620 EXT4_FEATURE_INCOMPAT_64BIT) 711 EXT4_FEATURE_INCOMPAT_64BIT)
621#define EXT4_FEATURE_RO_COMPAT_SUPP (EXT4_FEATURE_RO_COMPAT_SPARSE_SUPER| \ 712#define EXT4_FEATURE_RO_COMPAT_SUPP (EXT4_FEATURE_RO_COMPAT_SPARSE_SUPER| \
622 EXT4_FEATURE_RO_COMPAT_LARGE_FILE| \ 713 EXT4_FEATURE_RO_COMPAT_LARGE_FILE| \
714 EXT4_FEATURE_RO_COMPAT_DIR_NLINK | \
715 EXT4_FEATURE_RO_COMPAT_EXTRA_ISIZE | \
623 EXT4_FEATURE_RO_COMPAT_BTREE_DIR) 716 EXT4_FEATURE_RO_COMPAT_BTREE_DIR)
624 717
625/* 718/*
@@ -862,6 +955,7 @@ extern int ext4_change_inode_journal_flag(struct inode *, int);
862extern int ext4_get_inode_loc(struct inode *, struct ext4_iloc *); 955extern int ext4_get_inode_loc(struct inode *, struct ext4_iloc *);
863extern void ext4_truncate (struct inode *); 956extern void ext4_truncate (struct inode *);
864extern void ext4_set_inode_flags(struct inode *); 957extern void ext4_set_inode_flags(struct inode *);
958extern void ext4_get_inode_flags(struct ext4_inode_info *);
865extern void ext4_set_aops(struct inode *inode); 959extern void ext4_set_aops(struct inode *inode);
866extern int ext4_writepage_trans_blocks(struct inode *); 960extern int ext4_writepage_trans_blocks(struct inode *);
867extern int ext4_block_truncate_page(handle_t *handle, struct page *page, 961extern int ext4_block_truncate_page(handle_t *handle, struct page *page,
@@ -983,6 +1077,8 @@ extern int ext4_ext_get_blocks(handle_t *handle, struct inode *inode,
983extern void ext4_ext_truncate(struct inode *, struct page *); 1077extern void ext4_ext_truncate(struct inode *, struct page *);
984extern void ext4_ext_init(struct super_block *); 1078extern void ext4_ext_init(struct super_block *);
985extern void ext4_ext_release(struct super_block *); 1079extern void ext4_ext_release(struct super_block *);
1080extern long ext4_fallocate(struct inode *inode, int mode, loff_t offset,
1081 loff_t len);
986static inline int 1082static inline int
987ext4_get_blocks_wrap(handle_t *handle, struct inode *inode, sector_t block, 1083ext4_get_blocks_wrap(handle_t *handle, struct inode *inode, sector_t block,
988 unsigned long max_blocks, struct buffer_head *bh, 1084 unsigned long max_blocks, struct buffer_head *bh,
diff --git a/include/linux/ext4_fs_extents.h b/include/linux/ext4_fs_extents.h
index acfe59740b03..81406f3655d4 100644
--- a/include/linux/ext4_fs_extents.h
+++ b/include/linux/ext4_fs_extents.h
@@ -141,7 +141,25 @@ typedef int (*ext_prepare_callback)(struct inode *, struct ext4_ext_path *,
141 141
142#define EXT_MAX_BLOCK 0xffffffff 142#define EXT_MAX_BLOCK 0xffffffff
143 143
144#define EXT_MAX_LEN ((1UL << 15) - 1) 144/*
145 * EXT_INIT_MAX_LEN is the maximum number of blocks we can have in an
146 * initialized extent. This is 2^15 and not (2^16 - 1), since we use the
147 * MSB of ee_len field in the extent datastructure to signify if this
148 * particular extent is an initialized extent or an uninitialized (i.e.
149 * preallocated).
150 * EXT_UNINIT_MAX_LEN is the maximum number of blocks we can have in an
151 * uninitialized extent.
152 * If ee_len is <= 0x8000, it is an initialized extent. Otherwise, it is an
153 * uninitialized one. In other words, if MSB of ee_len is set, it is an
154 * uninitialized extent with only one special scenario when ee_len = 0x8000.
155 * In this case we can not have an uninitialized extent of zero length and
156 * thus we make it as a special case of initialized extent with 0x8000 length.
157 * This way we get better extent-to-group alignment for initialized extents.
158 * Hence, the maximum number of blocks we can have in an *initialized*
159 * extent is 2^15 (32768) and in an *uninitialized* extent is 2^15-1 (32767).
160 */
161#define EXT_INIT_MAX_LEN (1UL << 15)
162#define EXT_UNINIT_MAX_LEN (EXT_INIT_MAX_LEN - 1)
145 163
146 164
147#define EXT_FIRST_EXTENT(__hdr__) \ 165#define EXT_FIRST_EXTENT(__hdr__) \
@@ -188,8 +206,31 @@ ext4_ext_invalidate_cache(struct inode *inode)
188 EXT4_I(inode)->i_cached_extent.ec_type = EXT4_EXT_CACHE_NO; 206 EXT4_I(inode)->i_cached_extent.ec_type = EXT4_EXT_CACHE_NO;
189} 207}
190 208
209static inline void ext4_ext_mark_uninitialized(struct ext4_extent *ext)
210{
211 /* We can not have an uninitialized extent of zero length! */
212 BUG_ON((le16_to_cpu(ext->ee_len) & ~EXT_INIT_MAX_LEN) == 0);
213 ext->ee_len |= cpu_to_le16(EXT_INIT_MAX_LEN);
214}
215
216static inline int ext4_ext_is_uninitialized(struct ext4_extent *ext)
217{
218 /* Extent with ee_len of 0x8000 is treated as an initialized extent */
219 return (le16_to_cpu(ext->ee_len) > EXT_INIT_MAX_LEN);
220}
221
222static inline int ext4_ext_get_actual_len(struct ext4_extent *ext)
223{
224 return (le16_to_cpu(ext->ee_len) <= EXT_INIT_MAX_LEN ?
225 le16_to_cpu(ext->ee_len) :
226 (le16_to_cpu(ext->ee_len) - EXT_INIT_MAX_LEN));
227}
228
191extern int ext4_extent_tree_init(handle_t *, struct inode *); 229extern int ext4_extent_tree_init(handle_t *, struct inode *);
192extern int ext4_ext_calc_credits_for_insert(struct inode *, struct ext4_ext_path *); 230extern int ext4_ext_calc_credits_for_insert(struct inode *, struct ext4_ext_path *);
231extern int ext4_ext_try_to_merge(struct inode *inode,
232 struct ext4_ext_path *path,
233 struct ext4_extent *);
193extern unsigned int ext4_ext_check_overlap(struct inode *, struct ext4_extent *, struct ext4_ext_path *); 234extern unsigned int ext4_ext_check_overlap(struct inode *, struct ext4_extent *, struct ext4_ext_path *);
194extern int ext4_ext_insert_extent(handle_t *, struct inode *, struct ext4_ext_path *, struct ext4_extent *); 235extern int ext4_ext_insert_extent(handle_t *, struct inode *, struct ext4_ext_path *, struct ext4_extent *);
195extern int ext4_ext_walk_space(struct inode *, unsigned long, unsigned long, ext_prepare_callback, void *); 236extern int ext4_ext_walk_space(struct inode *, unsigned long, unsigned long, ext_prepare_callback, void *);
diff --git a/include/linux/ext4_fs_i.h b/include/linux/ext4_fs_i.h
index 9de494406995..1a511e9905aa 100644
--- a/include/linux/ext4_fs_i.h
+++ b/include/linux/ext4_fs_i.h
@@ -153,6 +153,11 @@ struct ext4_inode_info {
153 153
154 unsigned long i_ext_generation; 154 unsigned long i_ext_generation;
155 struct ext4_ext_cache i_cached_extent; 155 struct ext4_ext_cache i_cached_extent;
156 /*
157 * File creation time. Its function is same as that of
158 * struct timespec i_{a,c,m}time in the generic inode.
159 */
160 struct timespec i_crtime;
156}; 161};
157 162
158#endif /* _LINUX_EXT4_FS_I */ 163#endif /* _LINUX_EXT4_FS_I */
diff --git a/include/linux/ext4_fs_sb.h b/include/linux/ext4_fs_sb.h
index 691a713139ce..1b2ffee12be9 100644
--- a/include/linux/ext4_fs_sb.h
+++ b/include/linux/ext4_fs_sb.h
@@ -39,6 +39,8 @@ struct ext4_sb_info {
39 unsigned long s_gdb_count; /* Number of group descriptor blocks */ 39 unsigned long s_gdb_count; /* Number of group descriptor blocks */
40 unsigned long s_desc_per_block; /* Number of group descriptors per block */ 40 unsigned long s_desc_per_block; /* Number of group descriptors per block */
41 unsigned long s_groups_count; /* Number of groups in the fs */ 41 unsigned long s_groups_count; /* Number of groups in the fs */
42 unsigned long s_overhead_last; /* Last calculated overhead */
43 unsigned long s_blocks_last; /* Last seen block count */
42 struct buffer_head * s_sbh; /* Buffer containing the super block */ 44 struct buffer_head * s_sbh; /* Buffer containing the super block */
43 struct ext4_super_block * s_es; /* Pointer to the super block in the buffer */ 45 struct ext4_super_block * s_es; /* Pointer to the super block in the buffer */
44 struct buffer_head ** s_group_desc; 46 struct buffer_head ** s_group_desc;
@@ -71,7 +73,7 @@ struct ext4_sb_info {
71 struct list_head s_orphan; 73 struct list_head s_orphan;
72 unsigned long s_commit_interval; 74 unsigned long s_commit_interval;
73 struct block_device *journal_bdev; 75 struct block_device *journal_bdev;
74#ifdef CONFIG_JBD_DEBUG 76#ifdef CONFIG_JBD2_DEBUG
75 struct timer_list turn_ro_timer; /* For turning read-only (crash simulation) */ 77 struct timer_list turn_ro_timer; /* For turning read-only (crash simulation) */
76 wait_queue_head_t ro_wait_queue; /* For people waiting for the fs to go read-only */ 78 wait_queue_head_t ro_wait_queue; /* For people waiting for the fs to go read-only */
77#endif 79#endif
@@ -79,6 +81,7 @@ struct ext4_sb_info {
79 char *s_qf_names[MAXQUOTAS]; /* Names of quota files with journalled quota */ 81 char *s_qf_names[MAXQUOTAS]; /* Names of quota files with journalled quota */
80 int s_jquota_fmt; /* Format of quota to use */ 82 int s_jquota_fmt; /* Format of quota to use */
81#endif 83#endif
84 unsigned int s_want_extra_isize; /* New inodes should reserve # bytes */
82 85
83#ifdef EXTENTS_STATS 86#ifdef EXTENTS_STATS
84 /* ext4 extents stats */ 87 /* ext4 extents stats */
diff --git a/include/linux/falloc.h b/include/linux/falloc.h
new file mode 100644
index 000000000000..8e912ab6a072
--- /dev/null
+++ b/include/linux/falloc.h
@@ -0,0 +1,6 @@
1#ifndef _FALLOC_H_
2#define _FALLOC_H_
3
4#define FALLOC_FL_KEEP_SIZE 0x01 /* default is extend size */
5
6#endif /* _FALLOC_H_ */
diff --git a/include/linux/fb.h b/include/linux/fb.h
index 66226824ab68..cec54106aa87 100644
--- a/include/linux/fb.h
+++ b/include/linux/fb.h
@@ -119,6 +119,7 @@ struct dentry;
119#define FB_ACCEL_NV_40 46 /* nVidia Arch 40 */ 119#define FB_ACCEL_NV_40 46 /* nVidia Arch 40 */
120#define FB_ACCEL_XGI_VOLARI_V 47 /* XGI Volari V3XT, V5, V8 */ 120#define FB_ACCEL_XGI_VOLARI_V 47 /* XGI Volari V3XT, V5, V8 */
121#define FB_ACCEL_XGI_VOLARI_Z 48 /* XGI Volari Z7 */ 121#define FB_ACCEL_XGI_VOLARI_Z 48 /* XGI Volari Z7 */
122#define FB_ACCEL_OMAP1610 49 /* TI OMAP16xx */
122#define FB_ACCEL_NEOMAGIC_NM2070 90 /* NeoMagic NM2070 */ 123#define FB_ACCEL_NEOMAGIC_NM2070 90 /* NeoMagic NM2070 */
123#define FB_ACCEL_NEOMAGIC_NM2090 91 /* NeoMagic NM2090 */ 124#define FB_ACCEL_NEOMAGIC_NM2090 91 /* NeoMagic NM2090 */
124#define FB_ACCEL_NEOMAGIC_NM2093 92 /* NeoMagic NM2093 */ 125#define FB_ACCEL_NEOMAGIC_NM2093 92 /* NeoMagic NM2093 */
@@ -529,6 +530,8 @@ struct fb_cursor_user {
529#define FB_EVENT_CONBLANK 0x0C 530#define FB_EVENT_CONBLANK 0x0C
530/* Get drawing requirements */ 531/* Get drawing requirements */
531#define FB_EVENT_GET_REQ 0x0D 532#define FB_EVENT_GET_REQ 0x0D
533/* Unbind from the console if possible */
534#define FB_EVENT_FB_UNBIND 0x0E
532 535
533struct fb_event { 536struct fb_event {
534 struct fb_info *info; 537 struct fb_info *info;
diff --git a/include/linux/file.h b/include/linux/file.h
index a59001e9ea58..0114fbc78061 100644
--- a/include/linux/file.h
+++ b/include/linux/file.h
@@ -73,6 +73,7 @@ extern struct file * FASTCALL(fget_light(unsigned int fd, int *fput_needed));
73extern void FASTCALL(set_close_on_exec(unsigned int fd, int flag)); 73extern void FASTCALL(set_close_on_exec(unsigned int fd, int flag));
74extern void put_filp(struct file *); 74extern void put_filp(struct file *);
75extern int get_unused_fd(void); 75extern int get_unused_fd(void);
76extern int get_unused_fd_flags(int flags);
76extern void FASTCALL(put_unused_fd(unsigned int fd)); 77extern void FASTCALL(put_unused_fd(unsigned int fd));
77struct kmem_cache; 78struct kmem_cache;
78 79
diff --git a/include/linux/firewire-cdev.h b/include/linux/firewire-cdev.h
index efbe1fda1a22..1a45d6f41b09 100644
--- a/include/linux/firewire-cdev.h
+++ b/include/linux/firewire-cdev.h
@@ -30,16 +30,38 @@
30#define FW_CDEV_EVENT_REQUEST 0x02 30#define FW_CDEV_EVENT_REQUEST 0x02
31#define FW_CDEV_EVENT_ISO_INTERRUPT 0x03 31#define FW_CDEV_EVENT_ISO_INTERRUPT 0x03
32 32
33/* The 'closure' fields are for user space to use. Data passed in the 33/**
34 * 'closure' field for a request will be returned in the corresponding 34 * struct fw_cdev_event_common - Common part of all fw_cdev_event_ types
35 * event. It's a 64-bit type so that it's a fixed size type big 35 * @closure: For arbitrary use by userspace
36 * enough to hold a pointer on all platforms. */ 36 * @type: Discriminates the fw_cdev_event_ types
37 37 *
38 * This struct may be used to access generic members of all fw_cdev_event_
39 * types regardless of the specific type.
40 *
41 * Data passed in the @closure field for a request will be returned in the
42 * corresponding event. It is big enough to hold a pointer on all platforms.
43 * The ioctl used to set @closure depends on the @type of event.
44 */
38struct fw_cdev_event_common { 45struct fw_cdev_event_common {
39 __u64 closure; 46 __u64 closure;
40 __u32 type; 47 __u32 type;
41}; 48};
42 49
50/**
51 * struct fw_cdev_event_bus_reset - Sent when a bus reset occurred
52 * @closure: See &fw_cdev_event_common; set by %FW_CDEV_IOC_GET_INFO ioctl
53 * @type: See &fw_cdev_event_common; always %FW_CDEV_EVENT_BUS_RESET
54 * @node_id: New node ID of this node
55 * @local_node_id: Node ID of the local node, i.e. of the controller
56 * @bm_node_id: Node ID of the bus manager
57 * @irm_node_id: Node ID of the iso resource manager
58 * @root_node_id: Node ID of the root node
59 * @generation: New bus generation
60 *
61 * This event is sent when the bus the device belongs to goes through a bus
62 * reset. It provides information about the new bus configuration, such as
63 * new node ID for this device, new root ID, and others.
64 */
43struct fw_cdev_event_bus_reset { 65struct fw_cdev_event_bus_reset {
44 __u64 closure; 66 __u64 closure;
45 __u32 type; 67 __u32 type;
@@ -51,6 +73,20 @@ struct fw_cdev_event_bus_reset {
51 __u32 generation; 73 __u32 generation;
52}; 74};
53 75
76/**
77 * struct fw_cdev_event_response - Sent when a response packet was received
78 * @closure: See &fw_cdev_event_common;
79 * set by %FW_CDEV_IOC_SEND_REQUEST ioctl
80 * @type: See &fw_cdev_event_common; always %FW_CDEV_EVENT_RESPONSE
81 * @rcode: Response code returned by the remote node
82 * @length: Data length, i.e. the response's payload size in bytes
83 * @data: Payload data, if any
84 *
85 * This event is sent when the stack receives a response to an outgoing request
86 * sent by %FW_CDEV_IOC_SEND_REQUEST ioctl. The payload data for responses
87 * carrying data (read and lock responses) follows immediately and can be
88 * accessed through the @data field.
89 */
54struct fw_cdev_event_response { 90struct fw_cdev_event_response {
55 __u64 closure; 91 __u64 closure;
56 __u32 type; 92 __u32 type;
@@ -59,6 +95,25 @@ struct fw_cdev_event_response {
59 __u32 data[0]; 95 __u32 data[0];
60}; 96};
61 97
98/**
99 * struct fw_cdev_event_request - Sent on incoming request to an address region
100 * @closure: See &fw_cdev_event_common; set by %FW_CDEV_IOC_ALLOCATE ioctl
101 * @type: See &fw_cdev_event_common; always %FW_CDEV_EVENT_REQUEST
102 * @tcode: Transaction code of the incoming request
103 * @offset: The offset into the 48-bit per-node address space
104 * @handle: Reference to the kernel-side pending request
105 * @length: Data length, i.e. the request's payload size in bytes
106 * @data: Incoming data, if any
107 *
108 * This event is sent when the stack receives an incoming request to an address
109 * region registered using the %FW_CDEV_IOC_ALLOCATE ioctl. The request is
110 * guaranteed to be completely contained in the specified region. Userspace is
111 * responsible for sending the response by %FW_CDEV_IOC_SEND_RESPONSE ioctl,
112 * using the same @handle.
113 *
114 * The payload data for requests carrying data (write and lock requests)
115 * follows immediately and can be accessed through the @data field.
116 */
62struct fw_cdev_event_request { 117struct fw_cdev_event_request {
63 __u64 closure; 118 __u64 closure;
64 __u32 type; 119 __u32 type;
@@ -69,14 +124,39 @@ struct fw_cdev_event_request {
69 __u32 data[0]; 124 __u32 data[0];
70}; 125};
71 126
127/**
128 * struct fw_cdev_event_iso_interrupt - Sent when an iso packet was completed
129 * @closure: See &fw_cdev_event_common;
130 * set by %FW_CDEV_CREATE_ISO_CONTEXT ioctl
131 * @type: See &fw_cdev_event_common; always %FW_CDEV_EVENT_ISO_INTERRUPT
132 * @cycle: Cycle counter of the interrupt packet
133 * @header_length: Total length of following headers, in bytes
134 * @header: Stripped headers, if any
135 *
136 * This event is sent when the controller has completed an &fw_cdev_iso_packet
137 * with the %FW_CDEV_ISO_INTERRUPT bit set. In the receive case, the headers
138 * stripped of all packets up until and including the interrupt packet are
139 * returned in the @header field.
140 */
72struct fw_cdev_event_iso_interrupt { 141struct fw_cdev_event_iso_interrupt {
73 __u64 closure; 142 __u64 closure;
74 __u32 type; 143 __u32 type;
75 __u32 cycle; 144 __u32 cycle;
76 __u32 header_length; /* Length in bytes of following headers. */ 145 __u32 header_length;
77 __u32 header[0]; 146 __u32 header[0];
78}; 147};
79 148
149/**
150 * union fw_cdev_event - Convenience union of fw_cdev_event_ types
151 * @common: Valid for all types
152 * @bus_reset: Valid if @common.type == %FW_CDEV_EVENT_BUS_RESET
153 * @response: Valid if @common.type == %FW_CDEV_EVENT_RESPONSE
154 * @request: Valid if @common.type == %FW_CDEV_EVENT_REQUEST
155 * @iso_interrupt: Valid if @common.type == %FW_CDEV_EVENT_ISO_INTERRUPT
156 *
157 * Convenience union for userspace use. Events could be read(2) into a char
158 * buffer and then cast to this union for further processing.
159 */
80union fw_cdev_event { 160union fw_cdev_event {
81 struct fw_cdev_event_common common; 161 struct fw_cdev_event_common common;
82 struct fw_cdev_event_bus_reset bus_reset; 162 struct fw_cdev_event_bus_reset bus_reset;
@@ -105,35 +185,47 @@ union fw_cdev_event {
105 */ 185 */
106#define FW_CDEV_VERSION 1 186#define FW_CDEV_VERSION 1
107 187
188/**
189 * struct fw_cdev_get_info - General purpose information ioctl
190 * @version: The version field is just a running serial number.
191 * We never break backwards compatibility, but may add more
192 * structs and ioctls in later revisions.
193 * @rom_length: If @rom is non-zero, at most rom_length bytes of configuration
194 * ROM will be copied into that user space address. In either
195 * case, @rom_length is updated with the actual length of the
196 * configuration ROM.
197 * @rom: If non-zero, address of a buffer to be filled by a copy of the
198 * local node's configuration ROM
199 * @bus_reset: If non-zero, address of a buffer to be filled by a
200 * &struct fw_cdev_event_bus_reset with the current state
201 * of the bus. This does not cause a bus reset to happen.
202 * @bus_reset_closure: Value of &closure in this and subsequent bus reset events
203 * @card: The index of the card this device belongs to
204 */
108struct fw_cdev_get_info { 205struct fw_cdev_get_info {
109 /* The version field is just a running serial number. We
110 * never break backwards compatibility. Userspace passes in
111 * the version it expects and the kernel passes back the
112 * highest version it can provide. Even if the structs in
113 * this interface are extended in a later version, the kernel
114 * will not copy back more data than what was present in the
115 * interface version userspace expects. */
116 __u32 version; 206 __u32 version;
117
118 /* If non-zero, at most rom_length bytes of config rom will be
119 * copied into that user space address. In either case,
120 * rom_length is updated with the actual length of the config
121 * rom. */
122 __u32 rom_length; 207 __u32 rom_length;
123 __u64 rom; 208 __u64 rom;
124
125 /* If non-zero, a fw_cdev_event_bus_reset struct will be
126 * copied here with the current state of the bus. This does
127 * not cause a bus reset to happen. The value of closure in
128 * this and sub-sequent bus reset events is set to
129 * bus_reset_closure. */
130 __u64 bus_reset; 209 __u64 bus_reset;
131 __u64 bus_reset_closure; 210 __u64 bus_reset_closure;
132
133 /* The index of the card this devices belongs to. */
134 __u32 card; 211 __u32 card;
135}; 212};
136 213
214/**
215 * struct fw_cdev_send_request - Send an asynchronous request packet
216 * @tcode: Transaction code of the request
217 * @length: Length of outgoing payload, in bytes
218 * @offset: 48-bit offset at destination node
219 * @closure: Passed back to userspace in the response event
220 * @data: Userspace pointer to payload
221 * @generation: The bus generation where packet is valid
222 *
223 * Send a request to the device. This ioctl implements all outgoing requests.
224 * Both quadlet and block request specify the payload as a pointer to the data
225 * in the @data field. Once the transaction completes, the kernel writes an
226 * &fw_cdev_event_request event back. The @closure field is passed back to
227 * user space in the response event.
228 */
137struct fw_cdev_send_request { 229struct fw_cdev_send_request {
138 __u32 tcode; 230 __u32 tcode;
139 __u32 length; 231 __u32 length;
@@ -143,6 +235,19 @@ struct fw_cdev_send_request {
143 __u32 generation; 235 __u32 generation;
144}; 236};
145 237
238/**
239 * struct fw_cdev_send_response - Send an asynchronous response packet
240 * @rcode: Response code as determined by the userspace handler
241 * @length: Length of outgoing payload, in bytes
242 * @data: Userspace pointer to payload
243 * @handle: The handle from the &fw_cdev_event_request
244 *
245 * Send a response to an incoming request. By setting up an address range using
246 * the %FW_CDEV_IOC_ALLOCATE ioctl, userspace can listen for incoming requests. An
247 * incoming request will generate an %FW_CDEV_EVENT_REQUEST, and userspace must
248 * send a reply using this ioctl. The event has a handle to the kernel-side
249 * pending transaction, which should be used with this ioctl.
250 */
146struct fw_cdev_send_response { 251struct fw_cdev_send_response {
147 __u32 rcode; 252 __u32 rcode;
148 __u32 length; 253 __u32 length;
@@ -150,6 +255,21 @@ struct fw_cdev_send_response {
150 __u32 handle; 255 __u32 handle;
151}; 256};
152 257
258/**
259 * struct fw_cdev_allocate - Allocate a CSR address range
260 * @offset: Start offset of the address range
261 * @closure: To be passed back to userspace in request events
262 * @length: Length of the address range, in bytes
263 * @handle: Handle to the allocation, written by the kernel
264 *
265 * Allocate an address range in the 48-bit address space on the local node
266 * (the controller). This allows userspace to listen for requests with an
267 * offset within that address range. When the kernel receives a request
268 * within the range, an &fw_cdev_event_request event will be written back.
269 * The @closure field is passed back to userspace in the response event.
270 * The @handle field is an out parameter, returning a handle to the allocated
271 * range to be used for later deallocation of the range.
272 */
153struct fw_cdev_allocate { 273struct fw_cdev_allocate {
154 __u64 offset; 274 __u64 offset;
155 __u64 closure; 275 __u64 closure;
@@ -157,6 +277,11 @@ struct fw_cdev_allocate {
157 __u32 handle; 277 __u32 handle;
158}; 278};
159 279
280/**
281 * struct fw_cdev_deallocate - Free an address range allocation
282 * @handle: Handle to the address range, as returned by the kernel when the
283 * range was allocated
284 */
160struct fw_cdev_deallocate { 285struct fw_cdev_deallocate {
161 __u32 handle; 286 __u32 handle;
162}; 287};
@@ -164,10 +289,41 @@ struct fw_cdev_deallocate {
164#define FW_CDEV_LONG_RESET 0 289#define FW_CDEV_LONG_RESET 0
165#define FW_CDEV_SHORT_RESET 1 290#define FW_CDEV_SHORT_RESET 1
166 291
292/**
293 * struct fw_cdev_initiate_bus_reset - Initiate a bus reset
294 * @type: %FW_CDEV_SHORT_RESET or %FW_CDEV_LONG_RESET
295 *
296 * Initiate a bus reset for the bus this device is on. The bus reset can be
297 * either the original (long) bus reset or the arbitrated (short) bus reset
298 * introduced in 1394a-2000.
299 */
167struct fw_cdev_initiate_bus_reset { 300struct fw_cdev_initiate_bus_reset {
168 __u32 type; 301 __u32 type; /* FW_CDEV_SHORT_RESET or FW_CDEV_LONG_RESET */
169}; 302};
170 303
304/**
305 * struct fw_cdev_add_descriptor - Add contents to the local node's config ROM
306 * @immediate: If non-zero, immediate key to insert before pointer
307 * @key: Upper 8 bits of root directory pointer
308 * @data: Userspace pointer to contents of descriptor block
309 * @length: Length of descriptor block data, in bytes
310 * @handle: Handle to the descriptor, written by the kernel
311 *
312 * Add a descriptor block and optionally a preceding immediate key to the local
313 * node's configuration ROM.
314 *
315 * The @key field specifies the upper 8 bits of the descriptor root directory
316 * pointer and the @data and @length fields specify the contents. The @key
317 * should be of the form 0xXX000000. The offset part of the root directory entry
318 * will be filled in by the kernel.
319 *
320 * If not 0, the @immediate field specifies an immediate key which will be
321 * inserted before the root directory pointer.
322 *
323 * If successful, the kernel adds the descriptor and writes back a handle to the
324 * kernel-side object to be used for later removal of the descriptor block and
325 * immediate key.
326 */
171struct fw_cdev_add_descriptor { 327struct fw_cdev_add_descriptor {
172 __u32 immediate; 328 __u32 immediate;
173 __u32 key; 329 __u32 key;
@@ -176,6 +332,14 @@ struct fw_cdev_add_descriptor {
176 __u32 handle; 332 __u32 handle;
177}; 333};
178 334
335/**
336 * struct fw_cdev_remove_descriptor - Remove contents from the configuration ROM
337 * @handle: Handle to the descriptor, as returned by the kernel when the
338 * descriptor was added
339 *
340 * Remove a descriptor block and accompanying immediate key from the local
341 * node's configuration ROM.
342 */
179struct fw_cdev_remove_descriptor { 343struct fw_cdev_remove_descriptor {
180 __u32 handle; 344 __u32 handle;
181}; 345};
@@ -183,12 +347,24 @@ struct fw_cdev_remove_descriptor {
183#define FW_CDEV_ISO_CONTEXT_TRANSMIT 0 347#define FW_CDEV_ISO_CONTEXT_TRANSMIT 0
184#define FW_CDEV_ISO_CONTEXT_RECEIVE 1 348#define FW_CDEV_ISO_CONTEXT_RECEIVE 1
185 349
186#define FW_CDEV_ISO_CONTEXT_MATCH_TAG0 1 350/**
187#define FW_CDEV_ISO_CONTEXT_MATCH_TAG1 2 351 * struct fw_cdev_create_iso_context - Create a context for isochronous IO
188#define FW_CDEV_ISO_CONTEXT_MATCH_TAG2 4 352 * @type: %FW_CDEV_ISO_CONTEXT_TRANSMIT or %FW_CDEV_ISO_CONTEXT_RECEIVE
189#define FW_CDEV_ISO_CONTEXT_MATCH_TAG3 8 353 * @header_size: Header size to strip for receive contexts
190#define FW_CDEV_ISO_CONTEXT_MATCH_ALL_TAGS 15 354 * @channel: Channel to bind to
191 355 * @speed: Speed to transmit at
356 * @closure: To be returned in &fw_cdev_event_iso_interrupt
357 * @handle: Handle to context, written back by kernel
358 *
359 * Prior to sending or receiving isochronous I/O, a context must be created.
360 * The context records information about the transmit or receive configuration
361 * and typically maps to an underlying hardware resource. A context is set up
362 * for either sending or receiving. It is bound to a specific isochronous
363 * channel.
364 *
365 * If a context was successfully created, the kernel writes back a handle to the
366 * context, which must be passed in for subsequent operations on that context.
367 */
192struct fw_cdev_create_iso_context { 368struct fw_cdev_create_iso_context {
193 __u32 type; 369 __u32 type;
194 __u32 header_size; 370 __u32 header_size;
@@ -201,15 +377,49 @@ struct fw_cdev_create_iso_context {
201#define FW_CDEV_ISO_PAYLOAD_LENGTH(v) (v) 377#define FW_CDEV_ISO_PAYLOAD_LENGTH(v) (v)
202#define FW_CDEV_ISO_INTERRUPT (1 << 16) 378#define FW_CDEV_ISO_INTERRUPT (1 << 16)
203#define FW_CDEV_ISO_SKIP (1 << 17) 379#define FW_CDEV_ISO_SKIP (1 << 17)
380#define FW_CDEV_ISO_SYNC (1 << 17)
204#define FW_CDEV_ISO_TAG(v) ((v) << 18) 381#define FW_CDEV_ISO_TAG(v) ((v) << 18)
205#define FW_CDEV_ISO_SY(v) ((v) << 20) 382#define FW_CDEV_ISO_SY(v) ((v) << 20)
206#define FW_CDEV_ISO_HEADER_LENGTH(v) ((v) << 24) 383#define FW_CDEV_ISO_HEADER_LENGTH(v) ((v) << 24)
207 384
385/**
386 * struct fw_cdev_iso_packet - Isochronous packet
387 * @control: Contains the header length (8 uppermost bits), the sy field
388 * (4 bits), the tag field (2 bits), a sync flag (1 bit),
389 * a skip flag (1 bit), an interrupt flag (1 bit), and the
390 * payload length (16 lowermost bits)
391 * @header: Header and payload
392 *
393 * &struct fw_cdev_iso_packet is used to describe isochronous packet queues.
394 *
395 * Use the FW_CDEV_ISO_ macros to fill in @control. The sy and tag fields are
396 * specified by IEEE 1394a and IEC 61883.
397 *
398 * FIXME - finish this documentation
399 */
208struct fw_cdev_iso_packet { 400struct fw_cdev_iso_packet {
209 __u32 control; 401 __u32 control;
210 __u32 header[0]; 402 __u32 header[0];
211}; 403};
212 404
405/**
406 * struct fw_cdev_queue_iso - Queue isochronous packets for I/O
407 * @packets: Userspace pointer to packet data
408 * @data: Pointer into mmap()'ed payload buffer
409 * @size: Size of packet data in bytes
410 * @handle: Isochronous context handle
411 *
412 * Queue a number of isochronous packets for reception or transmission.
413 * This ioctl takes a pointer to an array of &fw_cdev_iso_packet structs,
414 * which describe how to transmit from or receive into a contiguous region
415 * of a mmap()'ed payload buffer. As part of the packet descriptors,
416 * a series of headers can be supplied, which will be prepended to the
417 * payload during DMA.
418 *
419 * The kernel may or may not queue all packets, but will write back updated
420 * values of the @packets, @data and @size fields, so the ioctl can be
421 * resubmitted easily.
422 */
213struct fw_cdev_queue_iso { 423struct fw_cdev_queue_iso {
214 __u64 packets; 424 __u64 packets;
215 __u64 data; 425 __u64 data;
@@ -217,6 +427,23 @@ struct fw_cdev_queue_iso {
217 __u32 handle; 427 __u32 handle;
218}; 428};
219 429
430#define FW_CDEV_ISO_CONTEXT_MATCH_TAG0 1
431#define FW_CDEV_ISO_CONTEXT_MATCH_TAG1 2
432#define FW_CDEV_ISO_CONTEXT_MATCH_TAG2 4
433#define FW_CDEV_ISO_CONTEXT_MATCH_TAG3 8
434#define FW_CDEV_ISO_CONTEXT_MATCH_ALL_TAGS 15
435
436/**
437 * struct fw_cdev_start_iso - Start an isochronous transmission or reception
438 * @cycle: Cycle in which to start I/O. If @cycle is greater than or
439 * equal to 0, the I/O will start on that cycle.
440 * @sync: Determines the value to wait for for receive packets that have
441 * the %FW_CDEV_ISO_SYNC bit set
442 * @tags: Tag filter bit mask. Only valid for isochronous reception.
443 * Determines the tag values for which packets will be accepted.
444 * Use FW_CDEV_ISO_CONTEXT_MATCH_ macros to set @tags.
445 * @handle: Isochronous context handle within which to transmit or receive
446 */
220struct fw_cdev_start_iso { 447struct fw_cdev_start_iso {
221 __s32 cycle; 448 __s32 cycle;
222 __u32 sync; 449 __u32 sync;
@@ -224,6 +451,10 @@ struct fw_cdev_start_iso {
224 __u32 handle; 451 __u32 handle;
225}; 452};
226 453
454/**
455 * struct fw_cdev_stop_iso - Stop an isochronous transmission or reception
456 * @handle: Handle of isochronous context to stop
457 */
227struct fw_cdev_stop_iso { 458struct fw_cdev_stop_iso {
228 __u32 handle; 459 __u32 handle;
229}; 460};
diff --git a/include/linux/freezer.h b/include/linux/freezer.h
index 4631086f5060..2d38b1a74662 100644
--- a/include/linux/freezer.h
+++ b/include/linux/freezer.h
@@ -1,5 +1,8 @@
1/* Freezer declarations */ 1/* Freezer declarations */
2 2
3#ifndef FREEZER_H_INCLUDED
4#define FREEZER_H_INCLUDED
5
3#include <linux/sched.h> 6#include <linux/sched.h>
4 7
5#ifdef CONFIG_PM 8#ifdef CONFIG_PM
@@ -115,6 +118,14 @@ static inline int freezer_should_skip(struct task_struct *p)
115 return !!(p->flags & PF_FREEZER_SKIP); 118 return !!(p->flags & PF_FREEZER_SKIP);
116} 119}
117 120
121/*
122 * Tell the freezer that the current task should be frozen by it
123 */
124static inline void set_freezable(void)
125{
126 current->flags &= ~PF_NOFREEZE;
127}
128
118#else 129#else
119static inline int frozen(struct task_struct *p) { return 0; } 130static inline int frozen(struct task_struct *p) { return 0; }
120static inline int freezing(struct task_struct *p) { return 0; } 131static inline int freezing(struct task_struct *p) { return 0; }
@@ -130,4 +141,7 @@ static inline int try_to_freeze(void) { return 0; }
130static inline void freezer_do_not_count(void) {} 141static inline void freezer_do_not_count(void) {}
131static inline void freezer_count(void) {} 142static inline void freezer_count(void) {}
132static inline int freezer_should_skip(struct task_struct *p) { return 0; } 143static inline int freezer_should_skip(struct task_struct *p) { return 0; }
144static inline void set_freezable(void) {}
133#endif 145#endif
146
147#endif /* FREEZER_H_INCLUDED */
diff --git a/include/linux/fs.h b/include/linux/fs.h
index b3ae77cccbb6..0b806c5e32eb 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -44,7 +44,7 @@ extern int get_max_files(void);
44struct inodes_stat_t { 44struct inodes_stat_t {
45 int nr_inodes; 45 int nr_inodes;
46 int nr_unused; 46 int nr_unused;
47 int dummy[5]; 47 int dummy[5]; /* padding for sysctl ABI compatibility */
48}; 48};
49extern struct inodes_stat_t inodes_stat; 49extern struct inodes_stat_t inodes_stat;
50 50
@@ -283,11 +283,14 @@ extern int dir_notify_enable;
283#include <linux/init.h> 283#include <linux/init.h>
284#include <linux/pid.h> 284#include <linux/pid.h>
285#include <linux/mutex.h> 285#include <linux/mutex.h>
286#include <linux/sysctl.h>
287#include <linux/capability.h>
286 288
287#include <asm/atomic.h> 289#include <asm/atomic.h>
288#include <asm/semaphore.h> 290#include <asm/semaphore.h>
289#include <asm/byteorder.h> 291#include <asm/byteorder.h>
290 292
293struct export_operations;
291struct hd_geometry; 294struct hd_geometry;
292struct iovec; 295struct iovec;
293struct nameidata; 296struct nameidata;
@@ -820,6 +823,10 @@ struct file_lock {
820 union { 823 union {
821 struct nfs_lock_info nfs_fl; 824 struct nfs_lock_info nfs_fl;
822 struct nfs4_lock_info nfs4_fl; 825 struct nfs4_lock_info nfs4_fl;
826 struct {
827 struct list_head link; /* link in AFS vnode's pending_locks list */
828 int state; /* state of grant or error if -ve */
829 } afs;
823 } fl_u; 830 } fl_u;
824}; 831};
825 832
@@ -984,6 +991,9 @@ enum {
984#define put_fs_excl() atomic_dec(&current->fs_excl) 991#define put_fs_excl() atomic_dec(&current->fs_excl)
985#define has_fs_excl() atomic_read(&current->fs_excl) 992#define has_fs_excl() atomic_read(&current->fs_excl)
986 993
994#define is_owner_or_cap(inode) \
995 ((current->fsuid == (inode)->i_uid) || capable(CAP_FOWNER))
996
987/* not quite ready to be deprecated, but... */ 997/* not quite ready to be deprecated, but... */
988extern void lock_super(struct super_block *); 998extern void lock_super(struct super_block *);
989extern void unlock_super(struct super_block *); 999extern void unlock_super(struct super_block *);
@@ -1054,7 +1064,7 @@ struct block_device_operations {
1054}; 1064};
1055 1065
1056/* 1066/*
1057 * "descriptor" for what we're up to with a read for sendfile(). 1067 * "descriptor" for what we're up to with a read.
1058 * This allows us to use the same read code yet 1068 * This allows us to use the same read code yet
1059 * have multiple different users of the data that 1069 * have multiple different users of the data that
1060 * we read from a file. 1070 * we read from a file.
@@ -1105,7 +1115,6 @@ struct file_operations {
1105 int (*aio_fsync) (struct kiocb *, int datasync); 1115 int (*aio_fsync) (struct kiocb *, int datasync);
1106 int (*fasync) (int, struct file *, int); 1116 int (*fasync) (int, struct file *, int);
1107 int (*lock) (struct file *, int, struct file_lock *); 1117 int (*lock) (struct file *, int, struct file_lock *);
1108 ssize_t (*sendfile) (struct file *, loff_t *, size_t, read_actor_t, void *);
1109 ssize_t (*sendpage) (struct file *, struct page *, int, size_t, loff_t *, int); 1118 ssize_t (*sendpage) (struct file *, struct page *, int, size_t, loff_t *, int);
1110 unsigned long (*get_unmapped_area)(struct file *, unsigned long, unsigned long, unsigned long, unsigned long); 1119 unsigned long (*get_unmapped_area)(struct file *, unsigned long, unsigned long, unsigned long, unsigned long);
1111 int (*check_flags)(int); 1120 int (*check_flags)(int);
@@ -1138,6 +1147,8 @@ struct inode_operations {
1138 ssize_t (*listxattr) (struct dentry *, char *, size_t); 1147 ssize_t (*listxattr) (struct dentry *, char *, size_t);
1139 int (*removexattr) (struct dentry *, const char *); 1148 int (*removexattr) (struct dentry *, const char *);
1140 void (*truncate_range)(struct inode *, loff_t, loff_t); 1149 void (*truncate_range)(struct inode *, loff_t, loff_t);
1150 long (*fallocate)(struct inode *inode, int mode, loff_t offset,
1151 loff_t len);
1141}; 1152};
1142 1153
1143struct seq_file; 1154struct seq_file;
@@ -1211,6 +1222,14 @@ static inline void mark_inode_dirty_sync(struct inode *inode)
1211 __mark_inode_dirty(inode, I_DIRTY_SYNC); 1222 __mark_inode_dirty(inode, I_DIRTY_SYNC);
1212} 1223}
1213 1224
1225/**
1226 * inc_nlink - directly increment an inode's link count
1227 * @inode: inode
1228 *
1229 * This is a low-level filesystem helper to replace any
1230 * direct filesystem manipulation of i_nlink. Currently,
1231 * it is only here for parity with dec_nlink().
1232 */
1214static inline void inc_nlink(struct inode *inode) 1233static inline void inc_nlink(struct inode *inode)
1215{ 1234{
1216 inode->i_nlink++; 1235 inode->i_nlink++;
@@ -1222,11 +1241,30 @@ static inline void inode_inc_link_count(struct inode *inode)
1222 mark_inode_dirty(inode); 1241 mark_inode_dirty(inode);
1223} 1242}
1224 1243
1244/**
1245 * drop_nlink - directly drop an inode's link count
1246 * @inode: inode
1247 *
1248 * This is a low-level filesystem helper to replace any
1249 * direct filesystem manipulation of i_nlink. In cases
1250 * where we are attempting to track writes to the
1251 * filesystem, a decrement to zero means an imminent
1252 * write when the file is truncated and actually unlinked
1253 * on the filesystem.
1254 */
1225static inline void drop_nlink(struct inode *inode) 1255static inline void drop_nlink(struct inode *inode)
1226{ 1256{
1227 inode->i_nlink--; 1257 inode->i_nlink--;
1228} 1258}
1229 1259
1260/**
1261 * clear_nlink - directly zero an inode's link count
1262 * @inode: inode
1263 *
1264 * This is a low-level filesystem helper to replace any
1265 * direct filesystem manipulation of i_nlink. See
1266 * drop_nlink() for why we care about i_nlink hitting zero.
1267 */
1230static inline void clear_nlink(struct inode *inode) 1268static inline void clear_nlink(struct inode *inode)
1231{ 1269{
1232 inode->i_nlink = 0; 1270 inode->i_nlink = 0;
@@ -1247,119 +1285,6 @@ static inline void file_accessed(struct file *file)
1247 1285
1248int sync_inode(struct inode *inode, struct writeback_control *wbc); 1286int sync_inode(struct inode *inode, struct writeback_control *wbc);
1249 1287
1250/**
1251 * struct export_operations - for nfsd to communicate with file systems
1252 * @decode_fh: decode a file handle fragment and return a &struct dentry
1253 * @encode_fh: encode a file handle fragment from a dentry
1254 * @get_name: find the name for a given inode in a given directory
1255 * @get_parent: find the parent of a given directory
1256 * @get_dentry: find a dentry for the inode given a file handle sub-fragment
1257 * @find_exported_dentry:
1258 * set by the exporting module to a standard helper function.
1259 *
1260 * Description:
1261 * The export_operations structure provides a means for nfsd to communicate
1262 * with a particular exported file system - particularly enabling nfsd and
1263 * the filesystem to co-operate when dealing with file handles.
1264 *
1265 * export_operations contains two basic operation for dealing with file
1266 * handles, decode_fh() and encode_fh(), and allows for some other
1267 * operations to be defined which standard helper routines use to get
1268 * specific information from the filesystem.
1269 *
1270 * nfsd encodes information use to determine which filesystem a filehandle
1271 * applies to in the initial part of the file handle. The remainder, termed
1272 * a file handle fragment, is controlled completely by the filesystem. The
1273 * standard helper routines assume that this fragment will contain one or
1274 * two sub-fragments, one which identifies the file, and one which may be
1275 * used to identify the (a) directory containing the file.
1276 *
1277 * In some situations, nfsd needs to get a dentry which is connected into a
1278 * specific part of the file tree. To allow for this, it passes the
1279 * function acceptable() together with a @context which can be used to see
1280 * if the dentry is acceptable. As there can be multiple dentrys for a
1281 * given file, the filesystem should check each one for acceptability before
1282 * looking for the next. As soon as an acceptable one is found, it should
1283 * be returned.
1284 *
1285 * decode_fh:
1286 * @decode_fh is given a &struct super_block (@sb), a file handle fragment
1287 * (@fh, @fh_len) and an acceptability testing function (@acceptable,
1288 * @context). It should return a &struct dentry which refers to the same
1289 * file that the file handle fragment refers to, and which passes the
1290 * acceptability test. If it cannot, it should return a %NULL pointer if
1291 * the file was found but no acceptable &dentries were available, or a
1292 * %ERR_PTR error code indicating why it couldn't be found (e.g. %ENOENT or
1293 * %ENOMEM).
1294 *
1295 * encode_fh:
1296 * @encode_fh should store in the file handle fragment @fh (using at most
1297 * @max_len bytes) information that can be used by @decode_fh to recover the
1298 * file refered to by the &struct dentry @de. If the @connectable flag is
1299 * set, the encode_fh() should store sufficient information so that a good
1300 * attempt can be made to find not only the file but also it's place in the
1301 * filesystem. This typically means storing a reference to de->d_parent in
1302 * the filehandle fragment. encode_fh() should return the number of bytes
1303 * stored or a negative error code such as %-ENOSPC
1304 *
1305 * get_name:
1306 * @get_name should find a name for the given @child in the given @parent
1307 * directory. The name should be stored in the @name (with the
1308 * understanding that it is already pointing to a a %NAME_MAX+1 sized
1309 * buffer. get_name() should return %0 on success, a negative error code
1310 * or error. @get_name will be called without @parent->i_mutex held.
1311 *
1312 * get_parent:
1313 * @get_parent should find the parent directory for the given @child which
1314 * is also a directory. In the event that it cannot be found, or storage
1315 * space cannot be allocated, a %ERR_PTR should be returned.
1316 *
1317 * get_dentry:
1318 * Given a &super_block (@sb) and a pointer to a file-system specific inode
1319 * identifier, possibly an inode number, (@inump) get_dentry() should find
1320 * the identified inode and return a dentry for that inode. Any suitable
1321 * dentry can be returned including, if necessary, a new dentry created with
1322 * d_alloc_root. The caller can then find any other extant dentrys by
1323 * following the d_alias links. If a new dentry was created using
1324 * d_alloc_root, DCACHE_NFSD_DISCONNECTED should be set, and the dentry
1325 * should be d_rehash()ed.
1326 *
1327 * If the inode cannot be found, either a %NULL pointer or an %ERR_PTR code
1328 * can be returned. The @inump will be whatever was passed to
1329 * nfsd_find_fh_dentry() in either the @obj or @parent parameters.
1330 *
1331 * Locking rules:
1332 * get_parent is called with child->d_inode->i_mutex down
1333 * get_name is not (which is possibly inconsistent)
1334 */
1335
1336struct export_operations {
1337 struct dentry *(*decode_fh)(struct super_block *sb, __u32 *fh, int fh_len, int fh_type,
1338 int (*acceptable)(void *context, struct dentry *de),
1339 void *context);
1340 int (*encode_fh)(struct dentry *de, __u32 *fh, int *max_len,
1341 int connectable);
1342
1343 /* the following are only called from the filesystem itself */
1344 int (*get_name)(struct dentry *parent, char *name,
1345 struct dentry *child);
1346 struct dentry * (*get_parent)(struct dentry *child);
1347 struct dentry * (*get_dentry)(struct super_block *sb, void *inump);
1348
1349 /* This is set by the exporting module to a standard helper */
1350 struct dentry * (*find_exported_dentry)(
1351 struct super_block *sb, void *obj, void *parent,
1352 int (*acceptable)(void *context, struct dentry *de),
1353 void *context);
1354
1355
1356};
1357
1358extern struct dentry *
1359find_exported_dentry(struct super_block *sb, void *obj, void *parent,
1360 int (*acceptable)(void *context, struct dentry *de),
1361 void *context);
1362
1363struct file_system_type { 1288struct file_system_type {
1364 const char *name; 1289 const char *name;
1365 int fs_flags; 1290 int fs_flags;
@@ -1496,7 +1421,7 @@ extern void putname(const char *name);
1496 1421
1497#ifdef CONFIG_BLOCK 1422#ifdef CONFIG_BLOCK
1498extern int register_blkdev(unsigned int, const char *); 1423extern int register_blkdev(unsigned int, const char *);
1499extern int unregister_blkdev(unsigned int, const char *); 1424extern void unregister_blkdev(unsigned int, const char *);
1500extern struct block_device *bdget(dev_t); 1425extern struct block_device *bdget(dev_t);
1501extern void bd_set_size(struct block_device *, loff_t size); 1426extern void bd_set_size(struct block_device *, loff_t size);
1502extern void bd_forget(struct inode *inode); 1427extern void bd_forget(struct inode *inode);
@@ -1584,6 +1509,9 @@ extern int __invalidate_device(struct block_device *);
1584extern int invalidate_partition(struct gendisk *, int); 1509extern int invalidate_partition(struct gendisk *, int);
1585#endif 1510#endif
1586extern int invalidate_inodes(struct super_block *); 1511extern int invalidate_inodes(struct super_block *);
1512unsigned long __invalidate_mapping_pages(struct address_space *mapping,
1513 pgoff_t start, pgoff_t end,
1514 bool be_atomic);
1587unsigned long invalidate_mapping_pages(struct address_space *mapping, 1515unsigned long invalidate_mapping_pages(struct address_space *mapping,
1588 pgoff_t start, pgoff_t end); 1516 pgoff_t start, pgoff_t end);
1589 1517
@@ -1735,7 +1663,6 @@ extern ssize_t generic_file_buffered_write(struct kiocb *, const struct iovec *,
1735 unsigned long, loff_t, loff_t *, size_t, ssize_t); 1663 unsigned long, loff_t, loff_t *, size_t, ssize_t);
1736extern ssize_t do_sync_read(struct file *filp, char __user *buf, size_t len, loff_t *ppos); 1664extern ssize_t do_sync_read(struct file *filp, char __user *buf, size_t len, loff_t *ppos);
1737extern ssize_t do_sync_write(struct file *filp, const char __user *buf, size_t len, loff_t *ppos); 1665extern ssize_t do_sync_write(struct file *filp, const char __user *buf, size_t len, loff_t *ppos);
1738extern ssize_t generic_file_sendfile(struct file *, loff_t *, size_t, read_actor_t, void *);
1739extern void do_generic_mapping_read(struct address_space *mapping, 1666extern void do_generic_mapping_read(struct address_space *mapping,
1740 struct file_ra_state *, struct file *, 1667 struct file_ra_state *, struct file *,
1741 loff_t *, read_descriptor_t *, read_actor_t); 1668 loff_t *, read_descriptor_t *, read_actor_t);
@@ -1765,9 +1692,6 @@ extern int nonseekable_open(struct inode * inode, struct file * filp);
1765#ifdef CONFIG_FS_XIP 1692#ifdef CONFIG_FS_XIP
1766extern ssize_t xip_file_read(struct file *filp, char __user *buf, size_t len, 1693extern ssize_t xip_file_read(struct file *filp, char __user *buf, size_t len,
1767 loff_t *ppos); 1694 loff_t *ppos);
1768extern ssize_t xip_file_sendfile(struct file *in_file, loff_t *ppos,
1769 size_t count, read_actor_t actor,
1770 void *target);
1771extern int xip_file_mmap(struct file * file, struct vm_area_struct * vma); 1695extern int xip_file_mmap(struct file * file, struct vm_area_struct * vma);
1772extern ssize_t xip_file_write(struct file *filp, const char __user *buf, 1696extern ssize_t xip_file_write(struct file *filp, const char __user *buf,
1773 size_t len, loff_t *ppos); 1697 size_t len, loff_t *ppos);
@@ -2021,5 +1945,9 @@ static inline void free_secdata(void *secdata)
2021{ } 1945{ }
2022#endif /* CONFIG_SECURITY */ 1946#endif /* CONFIG_SECURITY */
2023 1947
1948int proc_nr_files(ctl_table *table, int write, struct file *filp,
1949 void __user *buffer, size_t *lenp, loff_t *ppos);
1950
1951
2024#endif /* __KERNEL__ */ 1952#endif /* __KERNEL__ */
2025#endif /* _LINUX_FS_H */ 1953#endif /* _LINUX_FS_H */
diff --git a/include/linux/fsl_devices.h b/include/linux/fsl_devices.h
index 73710d617775..695741b0e420 100644
--- a/include/linux/fsl_devices.h
+++ b/include/linux/fsl_devices.h
@@ -112,7 +112,7 @@ struct fsl_usb2_platform_data {
112struct fsl_spi_platform_data { 112struct fsl_spi_platform_data {
113 u32 initial_spmode; /* initial SPMODE value */ 113 u32 initial_spmode; /* initial SPMODE value */
114 u16 bus_num; 114 u16 bus_num;
115 115 bool qe_mode;
116 /* board specific information */ 116 /* board specific information */
117 u16 max_chipselect; 117 u16 max_chipselect;
118 void (*activate_cs)(u8 cs, u8 polarity); 118 void (*activate_cs)(u8 cs, u8 polarity);
@@ -120,5 +120,10 @@ struct fsl_spi_platform_data {
120 u32 sysclk; 120 u32 sysclk;
121}; 121};
122 122
123struct mpc8xx_pcmcia_ops {
124 void(*hw_ctrl)(int slot, int enable);
125 int(*voltage_set)(int slot, int vcc, int vpp);
126};
127
123#endif /* _FSL_DEVICE_H_ */ 128#endif /* _FSL_DEVICE_H_ */
124#endif /* __KERNEL__ */ 129#endif /* __KERNEL__ */
diff --git a/include/linux/fuse.h b/include/linux/fuse.h
index 534744efe30d..9fbe9d258e22 100644
--- a/include/linux/fuse.h
+++ b/include/linux/fuse.h
@@ -339,7 +339,7 @@ struct fuse_dirent {
339 char name[0]; 339 char name[0];
340}; 340};
341 341
342#define FUSE_NAME_OFFSET ((unsigned) ((struct fuse_dirent *) 0)->name) 342#define FUSE_NAME_OFFSET offsetof(struct fuse_dirent, name)
343#define FUSE_DIRENT_ALIGN(x) (((x) + sizeof(__u64) - 1) & ~(sizeof(__u64) - 1)) 343#define FUSE_DIRENT_ALIGN(x) (((x) + sizeof(__u64) - 1) & ~(sizeof(__u64) - 1))
344#define FUSE_DIRENT_SIZE(d) \ 344#define FUSE_DIRENT_SIZE(d) \
345 FUSE_DIRENT_ALIGN(FUSE_NAME_OFFSET + (d)->namelen) 345 FUSE_DIRENT_ALIGN(FUSE_NAME_OFFSET + (d)->namelen)
diff --git a/include/linux/gfp.h b/include/linux/gfp.h
index 0d2ef0b082a6..bc68dd9a6d41 100644
--- a/include/linux/gfp.h
+++ b/include/linux/gfp.h
@@ -30,6 +30,9 @@ struct vm_area_struct;
30 * cannot handle allocation failures. 30 * cannot handle allocation failures.
31 * 31 *
32 * __GFP_NORETRY: The VM implementation must not retry indefinitely. 32 * __GFP_NORETRY: The VM implementation must not retry indefinitely.
33 *
34 * __GFP_MOVABLE: Flag that this page will be movable by the page migration
35 * mechanism or reclaimed
33 */ 36 */
34#define __GFP_WAIT ((__force gfp_t)0x10u) /* Can wait and reschedule? */ 37#define __GFP_WAIT ((__force gfp_t)0x10u) /* Can wait and reschedule? */
35#define __GFP_HIGH ((__force gfp_t)0x20u) /* Should access emergency pools? */ 38#define __GFP_HIGH ((__force gfp_t)0x20u) /* Should access emergency pools? */
@@ -45,6 +48,7 @@ struct vm_area_struct;
45#define __GFP_NOMEMALLOC ((__force gfp_t)0x10000u) /* Don't use emergency reserves */ 48#define __GFP_NOMEMALLOC ((__force gfp_t)0x10000u) /* Don't use emergency reserves */
46#define __GFP_HARDWALL ((__force gfp_t)0x20000u) /* Enforce hardwall cpuset memory allocs */ 49#define __GFP_HARDWALL ((__force gfp_t)0x20000u) /* Enforce hardwall cpuset memory allocs */
47#define __GFP_THISNODE ((__force gfp_t)0x40000u)/* No fallback, no policies */ 50#define __GFP_THISNODE ((__force gfp_t)0x40000u)/* No fallback, no policies */
51#define __GFP_MOVABLE ((__force gfp_t)0x80000u) /* Page is movable */
48 52
49#define __GFP_BITS_SHIFT 20 /* Room for 20 __GFP_FOO bits */ 53#define __GFP_BITS_SHIFT 20 /* Room for 20 __GFP_FOO bits */
50#define __GFP_BITS_MASK ((__force gfp_t)((1 << __GFP_BITS_SHIFT) - 1)) 54#define __GFP_BITS_MASK ((__force gfp_t)((1 << __GFP_BITS_SHIFT) - 1))
@@ -53,7 +57,8 @@ struct vm_area_struct;
53#define GFP_LEVEL_MASK (__GFP_WAIT|__GFP_HIGH|__GFP_IO|__GFP_FS| \ 57#define GFP_LEVEL_MASK (__GFP_WAIT|__GFP_HIGH|__GFP_IO|__GFP_FS| \
54 __GFP_COLD|__GFP_NOWARN|__GFP_REPEAT| \ 58 __GFP_COLD|__GFP_NOWARN|__GFP_REPEAT| \
55 __GFP_NOFAIL|__GFP_NORETRY|__GFP_COMP| \ 59 __GFP_NOFAIL|__GFP_NORETRY|__GFP_COMP| \
56 __GFP_NOMEMALLOC|__GFP_HARDWALL|__GFP_THISNODE) 60 __GFP_NOMEMALLOC|__GFP_HARDWALL|__GFP_THISNODE| \
61 __GFP_MOVABLE)
57 62
58/* This equals 0, but use constants in case they ever change */ 63/* This equals 0, but use constants in case they ever change */
59#define GFP_NOWAIT (GFP_ATOMIC & ~__GFP_HIGH) 64#define GFP_NOWAIT (GFP_ATOMIC & ~__GFP_HIGH)
@@ -65,6 +70,15 @@ struct vm_area_struct;
65#define GFP_USER (__GFP_WAIT | __GFP_IO | __GFP_FS | __GFP_HARDWALL) 70#define GFP_USER (__GFP_WAIT | __GFP_IO | __GFP_FS | __GFP_HARDWALL)
66#define GFP_HIGHUSER (__GFP_WAIT | __GFP_IO | __GFP_FS | __GFP_HARDWALL | \ 71#define GFP_HIGHUSER (__GFP_WAIT | __GFP_IO | __GFP_FS | __GFP_HARDWALL | \
67 __GFP_HIGHMEM) 72 __GFP_HIGHMEM)
73#define GFP_HIGHUSER_MOVABLE (__GFP_WAIT | __GFP_IO | __GFP_FS | \
74 __GFP_HARDWALL | __GFP_HIGHMEM | \
75 __GFP_MOVABLE)
76#define GFP_NOFS_PAGECACHE (__GFP_WAIT | __GFP_IO | __GFP_MOVABLE)
77#define GFP_USER_PAGECACHE (__GFP_WAIT | __GFP_IO | __GFP_FS | \
78 __GFP_HARDWALL | __GFP_MOVABLE)
79#define GFP_HIGHUSER_PAGECACHE (__GFP_WAIT | __GFP_IO | __GFP_FS | \
80 __GFP_HARDWALL | __GFP_HIGHMEM | \
81 __GFP_MOVABLE)
68 82
69#ifdef CONFIG_NUMA 83#ifdef CONFIG_NUMA
70#define GFP_THISNODE (__GFP_THISNODE | __GFP_NOWARN | __GFP_NORETRY) 84#define GFP_THISNODE (__GFP_THISNODE | __GFP_NOWARN | __GFP_NORETRY)
@@ -92,6 +106,9 @@ static inline enum zone_type gfp_zone(gfp_t flags)
92 if (flags & __GFP_DMA32) 106 if (flags & __GFP_DMA32)
93 return ZONE_DMA32; 107 return ZONE_DMA32;
94#endif 108#endif
109 if ((flags & (__GFP_HIGHMEM | __GFP_MOVABLE)) ==
110 (__GFP_HIGHMEM | __GFP_MOVABLE))
111 return ZONE_MOVABLE;
95#ifdef CONFIG_HIGHMEM 112#ifdef CONFIG_HIGHMEM
96 if (flags & __GFP_HIGHMEM) 113 if (flags & __GFP_HIGHMEM)
97 return ZONE_HIGHMEM; 114 return ZONE_HIGHMEM;
diff --git a/include/linux/gfs2_ondisk.h b/include/linux/gfs2_ondisk.h
index 8b7e4c1e32ae..a44a6a078f0a 100644
--- a/include/linux/gfs2_ondisk.h
+++ b/include/linux/gfs2_ondisk.h
@@ -54,18 +54,6 @@ struct gfs2_inum {
54 __be64 no_addr; 54 __be64 no_addr;
55}; 55};
56 56
57struct gfs2_inum_host {
58 __u64 no_formal_ino;
59 __u64 no_addr;
60};
61
62static inline int gfs2_inum_equal(const struct gfs2_inum_host *ino1,
63 const struct gfs2_inum_host *ino2)
64{
65 return ino1->no_formal_ino == ino2->no_formal_ino &&
66 ino1->no_addr == ino2->no_addr;
67}
68
69/* 57/*
70 * Generic metadata head structure 58 * Generic metadata head structure
71 * Every inplace buffer logged in the journal must start with this. 59 * Every inplace buffer logged in the journal must start with this.
@@ -94,12 +82,6 @@ struct gfs2_meta_header {
94 __be32 __pad1; /* Was incarnation number in gfs1 */ 82 __be32 __pad1; /* Was incarnation number in gfs1 */
95}; 83};
96 84
97struct gfs2_meta_header_host {
98 __u32 mh_magic;
99 __u32 mh_type;
100 __u32 mh_format;
101};
102
103/* 85/*
104 * super-block structure 86 * super-block structure
105 * 87 *
@@ -139,23 +121,6 @@ struct gfs2_sb {
139 /* In gfs1, quota and license dinodes followed */ 121 /* In gfs1, quota and license dinodes followed */
140}; 122};
141 123
142struct gfs2_sb_host {
143 struct gfs2_meta_header_host sb_header;
144
145 __u32 sb_fs_format;
146 __u32 sb_multihost_format;
147
148 __u32 sb_bsize;
149 __u32 sb_bsize_shift;
150
151 struct gfs2_inum_host sb_master_dir; /* Was jindex dinode in gfs1 */
152 struct gfs2_inum_host sb_root_dir;
153
154 char sb_lockproto[GFS2_LOCKNAME_LEN];
155 char sb_locktable[GFS2_LOCKNAME_LEN];
156 /* In gfs1, quota and license dinodes followed */
157};
158
159/* 124/*
160 * resource index structure 125 * resource index structure
161 */ 126 */
@@ -173,14 +138,6 @@ struct gfs2_rindex {
173 __u8 ri_reserved[64]; 138 __u8 ri_reserved[64];
174}; 139};
175 140
176struct gfs2_rindex_host {
177 __u64 ri_addr; /* grp block disk address */
178 __u64 ri_data0; /* first data location */
179 __u32 ri_length; /* length of rgrp header in fs blocks */
180 __u32 ri_data; /* num of data blocks in rgrp */
181 __u32 ri_bitbytes; /* number of bytes in data bitmaps */
182};
183
184/* 141/*
185 * resource group header structure 142 * resource group header structure
186 */ 143 */
@@ -212,13 +169,6 @@ struct gfs2_rgrp {
212 __u8 rg_reserved[80]; /* Several fields from gfs1 now reserved */ 169 __u8 rg_reserved[80]; /* Several fields from gfs1 now reserved */
213}; 170};
214 171
215struct gfs2_rgrp_host {
216 __u32 rg_flags;
217 __u32 rg_free;
218 __u32 rg_dinodes;
219 __u64 rg_igeneration;
220};
221
222/* 172/*
223 * quota structure 173 * quota structure
224 */ 174 */
@@ -230,12 +180,6 @@ struct gfs2_quota {
230 __u8 qu_reserved[64]; 180 __u8 qu_reserved[64];
231}; 181};
232 182
233struct gfs2_quota_host {
234 __u64 qu_limit;
235 __u64 qu_warn;
236 __u64 qu_value;
237};
238
239/* 183/*
240 * dinode structure 184 * dinode structure
241 */ 185 */
@@ -315,29 +259,11 @@ struct gfs2_dinode {
315 struct gfs2_inum __pad4; /* Unused even in current gfs1 */ 259 struct gfs2_inum __pad4; /* Unused even in current gfs1 */
316 260
317 __be64 di_eattr; /* extended attribute block number */ 261 __be64 di_eattr; /* extended attribute block number */
262 __be32 di_atime_nsec; /* nsec portion of atime */
263 __be32 di_mtime_nsec; /* nsec portion of mtime */
264 __be32 di_ctime_nsec; /* nsec portion of ctime */
318 265
319 __u8 di_reserved[56]; 266 __u8 di_reserved[44];
320};
321
322struct gfs2_dinode_host {
323 __u64 di_size; /* number of bytes in file */
324 __u64 di_blocks; /* number of blocks in file */
325
326 /* This section varies from gfs1. Padding added to align with
327 * remainder of dinode
328 */
329 __u64 di_goal_meta; /* rgrp to alloc from next */
330 __u64 di_goal_data; /* data block goal */
331 __u64 di_generation; /* generation number for NFS */
332
333 __u32 di_flags; /* GFS2_DIF_... */
334 __u16 di_height; /* height of metadata */
335
336 /* These only apply to directories */
337 __u16 di_depth; /* Number of bits in the table */
338 __u32 di_entries; /* The number of entries in the directory */
339
340 __u64 di_eattr; /* extended attribute block number */
341}; 267};
342 268
343/* 269/*
@@ -414,16 +340,6 @@ struct gfs2_log_header {
414 __be32 lh_hash; 340 __be32 lh_hash;
415}; 341};
416 342
417struct gfs2_log_header_host {
418 struct gfs2_meta_header_host lh_header;
419
420 __u64 lh_sequence; /* Sequence number of this transaction */
421 __u32 lh_flags; /* GFS2_LOG_HEAD_... */
422 __u32 lh_tail; /* Block number of log tail */
423 __u32 lh_blkno;
424 __u32 lh_hash;
425};
426
427/* 343/*
428 * Log type descriptor 344 * Log type descriptor
429 */ 345 */
@@ -464,11 +380,6 @@ struct gfs2_inum_range {
464 __be64 ir_length; 380 __be64 ir_length;
465}; 381};
466 382
467struct gfs2_inum_range_host {
468 __u64 ir_start;
469 __u64 ir_length;
470};
471
472/* 383/*
473 * Statfs change 384 * Statfs change
474 * Describes an change to the pool of free and allocated 385 * Describes an change to the pool of free and allocated
@@ -481,12 +392,6 @@ struct gfs2_statfs_change {
481 __be64 sc_dinodes; 392 __be64 sc_dinodes;
482}; 393};
483 394
484struct gfs2_statfs_change_host {
485 __u64 sc_total;
486 __u64 sc_free;
487 __u64 sc_dinodes;
488};
489
490/* 395/*
491 * Quota change 396 * Quota change
492 * Describes an allocation change for a particular 397 * Describes an allocation change for a particular
@@ -501,39 +406,12 @@ struct gfs2_quota_change {
501 __be32 qc_id; 406 __be32 qc_id;
502}; 407};
503 408
504struct gfs2_quota_change_host { 409struct gfs2_quota_lvb {
505 __u64 qc_change; 410 __be32 qb_magic;
506 __u32 qc_flags; /* GFS2_QCF_... */ 411 __u32 __pad;
507 __u32 qc_id; 412 __be64 qb_limit; /* Hard limit of # blocks to alloc */
413 __be64 qb_warn; /* Warn user when alloc is above this # */
414 __be64 qb_value; /* Current # blocks allocated */
508}; 415};
509 416
510#ifdef __KERNEL__
511/* Translation functions */
512
513extern void gfs2_inum_in(struct gfs2_inum_host *no, const void *buf);
514extern void gfs2_inum_out(const struct gfs2_inum_host *no, void *buf);
515extern void gfs2_sb_in(struct gfs2_sb_host *sb, const void *buf);
516extern void gfs2_rindex_in(struct gfs2_rindex_host *ri, const void *buf);
517extern void gfs2_rindex_out(const struct gfs2_rindex_host *ri, void *buf);
518extern void gfs2_rgrp_in(struct gfs2_rgrp_host *rg, const void *buf);
519extern void gfs2_rgrp_out(const struct gfs2_rgrp_host *rg, void *buf);
520extern void gfs2_quota_in(struct gfs2_quota_host *qu, const void *buf);
521struct gfs2_inode;
522extern void gfs2_dinode_out(const struct gfs2_inode *ip, void *buf);
523extern void gfs2_ea_header_in(struct gfs2_ea_header *ea, const void *buf);
524extern void gfs2_ea_header_out(const struct gfs2_ea_header *ea, void *buf);
525extern void gfs2_log_header_in(struct gfs2_log_header_host *lh, const void *buf);
526extern void gfs2_inum_range_in(struct gfs2_inum_range_host *ir, const void *buf);
527extern void gfs2_inum_range_out(const struct gfs2_inum_range_host *ir, void *buf);
528extern void gfs2_statfs_change_in(struct gfs2_statfs_change_host *sc, const void *buf);
529extern void gfs2_statfs_change_out(const struct gfs2_statfs_change_host *sc, void *buf);
530extern void gfs2_quota_change_in(struct gfs2_quota_change_host *qc, const void *buf);
531
532/* Printing functions */
533
534extern void gfs2_rindex_print(const struct gfs2_rindex_host *ri);
535extern void gfs2_dinode_print(const struct gfs2_inode *ip);
536
537#endif /* __KERNEL__ */
538
539#endif /* __GFS2_ONDISK_DOT_H__ */ 417#endif /* __GFS2_ONDISK_DOT_H__ */
diff --git a/include/linux/gpio_mouse.h b/include/linux/gpio_mouse.h
new file mode 100644
index 000000000000..44ed7aa14d85
--- /dev/null
+++ b/include/linux/gpio_mouse.h
@@ -0,0 +1,61 @@
1/*
2 * Driver for simulating a mouse on GPIO lines.
3 *
4 * Copyright (C) 2007 Atmel Corporation
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License version 2 as
8 * published by the Free Software Foundation.
9 */
10
11#ifndef _GPIO_MOUSE_H
12#define _GPIO_MOUSE_H
13
14#define GPIO_MOUSE_POLARITY_ACT_HIGH 0x00
15#define GPIO_MOUSE_POLARITY_ACT_LOW 0x01
16
17#define GPIO_MOUSE_PIN_UP 0
18#define GPIO_MOUSE_PIN_DOWN 1
19#define GPIO_MOUSE_PIN_LEFT 2
20#define GPIO_MOUSE_PIN_RIGHT 3
21#define GPIO_MOUSE_PIN_BLEFT 4
22#define GPIO_MOUSE_PIN_BMIDDLE 5
23#define GPIO_MOUSE_PIN_BRIGHT 6
24#define GPIO_MOUSE_PIN_MAX 7
25
26/**
27 * struct gpio_mouse_platform_data
28 * @scan_ms: integer in ms specifying the scan periode.
29 * @polarity: Pin polarity, active high or low.
30 * @up: GPIO line for up value.
31 * @down: GPIO line for down value.
32 * @left: GPIO line for left value.
33 * @right: GPIO line for right value.
34 * @bleft: GPIO line for left button.
35 * @bmiddle: GPIO line for middle button.
36 * @bright: GPIO line for right button.
37 *
38 * This struct must be added to the platform_device in the board code.
39 * It is used by the gpio_mouse driver to setup GPIO lines and to
40 * calculate mouse movement.
41 */
42struct gpio_mouse_platform_data {
43 int scan_ms;
44 int polarity;
45
46 union {
47 struct {
48 int up;
49 int down;
50 int left;
51 int right;
52
53 int bleft;
54 int bmiddle;
55 int bright;
56 };
57 int pins[GPIO_MOUSE_PIN_MAX];
58 };
59};
60
61#endif /* _GPIO_MOUSE_H */
diff --git a/include/linux/hardirq.h b/include/linux/hardirq.h
index 7803014f3a11..8d302298a161 100644
--- a/include/linux/hardirq.h
+++ b/include/linux/hardirq.h
@@ -79,6 +79,19 @@
79#endif 79#endif
80 80
81#ifdef CONFIG_PREEMPT 81#ifdef CONFIG_PREEMPT
82# define PREEMPT_CHECK_OFFSET 1
83#else
84# define PREEMPT_CHECK_OFFSET 0
85#endif
86
87/*
88 * Check whether we were atomic before we did preempt_disable():
89 * (used by the scheduler)
90 */
91#define in_atomic_preempt_off() \
92 ((preempt_count() & ~PREEMPT_ACTIVE) != PREEMPT_CHECK_OFFSET)
93
94#ifdef CONFIG_PREEMPT
82# define preemptible() (preempt_count() == 0 && !irqs_disabled()) 95# define preemptible() (preempt_count() == 0 && !irqs_disabled())
83# define IRQ_EXIT_OFFSET (HARDIRQ_OFFSET-1) 96# define IRQ_EXIT_OFFSET (HARDIRQ_OFFSET-1)
84#else 97#else
diff --git a/include/linux/hid.h b/include/linux/hid.h
index 827ee748fd4c..898103b401f1 100644
--- a/include/linux/hid.h
+++ b/include/linux/hid.h
@@ -263,19 +263,28 @@ struct hid_item {
263#define HID_QUIRK_2WHEEL_MOUSE_HACK_5 0x00000100 263#define HID_QUIRK_2WHEEL_MOUSE_HACK_5 0x00000100
264#define HID_QUIRK_2WHEEL_MOUSE_HACK_ON 0x00000200 264#define HID_QUIRK_2WHEEL_MOUSE_HACK_ON 0x00000200
265#define HID_QUIRK_MIGHTYMOUSE 0x00000400 265#define HID_QUIRK_MIGHTYMOUSE 0x00000400
266#define HID_QUIRK_CYMOTION 0x00000800 266#define HID_QUIRK_POWERBOOK_HAS_FN 0x00000800
267#define HID_QUIRK_POWERBOOK_HAS_FN 0x00001000 267#define HID_QUIRK_POWERBOOK_FN_ON 0x00001000
268#define HID_QUIRK_POWERBOOK_FN_ON 0x00002000 268#define HID_QUIRK_INVERT_HWHEEL 0x00002000
269#define HID_QUIRK_INVERT_HWHEEL 0x00004000 269#define HID_QUIRK_POWERBOOK_ISO_KEYBOARD 0x00004000
270#define HID_QUIRK_POWERBOOK_ISO_KEYBOARD 0x00008000 270#define HID_QUIRK_BAD_RELATIVE_KEYS 0x00008000
271#define HID_QUIRK_BAD_RELATIVE_KEYS 0x00010000 271#define HID_QUIRK_SKIP_OUTPUT_REPORTS 0x00010000
272#define HID_QUIRK_SKIP_OUTPUT_REPORTS 0x00020000 272#define HID_QUIRK_IGNORE_MOUSE 0x00020000
273#define HID_QUIRK_IGNORE_MOUSE 0x00040000 273#define HID_QUIRK_SONY_PS3_CONTROLLER 0x00040000
274#define HID_QUIRK_SONY_PS3_CONTROLLER 0x00080000 274#define HID_QUIRK_DUPLICATE_USAGES 0x00080000
275#define HID_QUIRK_LOGITECH_DESCRIPTOR 0x00100000 275#define HID_QUIRK_RESET_LEDS 0x00100000
276#define HID_QUIRK_DUPLICATE_USAGES 0x00200000 276#define HID_QUIRK_HIDINPUT 0x00200000
277#define HID_QUIRK_RESET_LEDS 0x00400000 277#define HID_QUIRK_LOGITECH_IGNORE_DOUBLED_WHEEL 0x00400000
278#define HID_QUIRK_SWAPPED_MIN_MAX 0x00800000 278#define HID_QUIRK_LOGITECH_EXPANDED_KEYMAP 0x00800000
279
280/*
281 * Separate quirks for runtime report descriptor fixup
282 */
283
284#define HID_QUIRK_RDESC_CYMOTION 0x00000001
285#define HID_QUIRK_RDESC_LOGITECH 0x00000002
286#define HID_QUIRK_RDESC_SWAPPED_MIN_MAX 0x00000004
287#define HID_QUIRK_RDESC_PETALYNX 0x00000008
279 288
280/* 289/*
281 * This is the global environment of the parser. This information is 290 * This is the global environment of the parser. This information is
@@ -488,6 +497,11 @@ struct hid_descriptor {
488#define IS_INPUT_APPLICATION(a) (((a >= 0x00010000) && (a <= 0x00010008)) || (a == 0x00010080) || (a == 0x000c0001)) 497#define IS_INPUT_APPLICATION(a) (((a >= 0x00010000) && (a <= 0x00010008)) || (a == 0x00010080) || (a == 0x000c0001))
489 498
490/* HID core API */ 499/* HID core API */
500
501#ifdef CONFIG_HID_DEBUG
502extern int hid_debug;
503#endif
504
491extern void hidinput_hid_event(struct hid_device *, struct hid_field *, struct hid_usage *, __s32); 505extern void hidinput_hid_event(struct hid_device *, struct hid_field *, struct hid_usage *, __s32);
492extern void hidinput_report_event(struct hid_device *hid, struct hid_report *report); 506extern void hidinput_report_event(struct hid_device *hid, struct hid_report *report);
493extern int hidinput_connect(struct hid_device *); 507extern int hidinput_connect(struct hid_device *);
@@ -506,6 +520,7 @@ u32 usbhid_lookup_quirk(const u16 idVendor, const u16 idProduct);
506int usbhid_modify_dquirk(const u16 idVendor, const u16 idProduct, const u32 quirks); 520int usbhid_modify_dquirk(const u16 idVendor, const u16 idProduct, const u32 quirks);
507int usbhid_quirks_init(char **quirks_param); 521int usbhid_quirks_init(char **quirks_param);
508void usbhid_quirks_exit(void); 522void usbhid_quirks_exit(void);
523void usbhid_fixup_report_descriptor(const u16, const u16, char *, unsigned, char **);
509 524
510#ifdef CONFIG_HID_FF 525#ifdef CONFIG_HID_FF
511int hid_ff_init(struct hid_device *hid); 526int hid_ff_init(struct hid_device *hid);
@@ -523,14 +538,19 @@ static inline int hid_pidff_init(struct hid_device *hid) { return -ENODEV; }
523#else 538#else
524static inline int hid_ff_init(struct hid_device *hid) { return -1; } 539static inline int hid_ff_init(struct hid_device *hid) { return -1; }
525#endif 540#endif
526#ifdef DEBUG 541
527#define dbg(format, arg...) printk(KERN_DEBUG "%s: " format "\n" , \ 542#ifdef CONFIG_HID_DEBUG
528 __FILE__ , ## arg) 543#define dbg_hid(format, arg...) if (hid_debug) \
544 printk(KERN_DEBUG "%s: " format ,\
545 __FILE__ , ## arg)
546#define dbg_hid_line(format, arg...) if (hid_debug) \
547 printk(format, ## arg)
529#else 548#else
530#define dbg(format, arg...) do {} while (0) 549#define dbg_hid(format, arg...) do {} while (0)
550#define dbg_hid_line dbg_hid
531#endif 551#endif
532 552
533#define err(format, arg...) printk(KERN_ERR "%s: " format "\n" , \ 553#define err_hid(format, arg...) printk(KERN_ERR "%s: " format "\n" , \
534 __FILE__ , ## arg) 554 __FILE__ , ## arg)
535#endif 555#endif
536 556
diff --git a/include/linux/highmem.h b/include/linux/highmem.h
index 98e2cce996a4..12c5e4e3135a 100644
--- a/include/linux/highmem.h
+++ b/include/linux/highmem.h
@@ -73,10 +73,27 @@ static inline void clear_user_highpage(struct page *page, unsigned long vaddr)
73} 73}
74 74
75#ifndef __HAVE_ARCH_ALLOC_ZEROED_USER_HIGHPAGE 75#ifndef __HAVE_ARCH_ALLOC_ZEROED_USER_HIGHPAGE
76/**
77 * __alloc_zeroed_user_highpage - Allocate a zeroed HIGHMEM page for a VMA with caller-specified movable GFP flags
78 * @movableflags: The GFP flags related to the pages future ability to move like __GFP_MOVABLE
79 * @vma: The VMA the page is to be allocated for
80 * @vaddr: The virtual address the page will be inserted into
81 *
82 * This function will allocate a page for a VMA but the caller is expected
83 * to specify via movableflags whether the page will be movable in the
84 * future or not
85 *
86 * An architecture may override this function by defining
87 * __HAVE_ARCH_ALLOC_ZEROED_USER_HIGHPAGE and providing their own
88 * implementation.
89 */
76static inline struct page * 90static inline struct page *
77alloc_zeroed_user_highpage(struct vm_area_struct *vma, unsigned long vaddr) 91__alloc_zeroed_user_highpage(gfp_t movableflags,
92 struct vm_area_struct *vma,
93 unsigned long vaddr)
78{ 94{
79 struct page *page = alloc_page_vma(GFP_HIGHUSER, vma, vaddr); 95 struct page *page = alloc_page_vma(GFP_HIGHUSER | movableflags,
96 vma, vaddr);
80 97
81 if (page) 98 if (page)
82 clear_user_highpage(page, vaddr); 99 clear_user_highpage(page, vaddr);
@@ -85,6 +102,36 @@ alloc_zeroed_user_highpage(struct vm_area_struct *vma, unsigned long vaddr)
85} 102}
86#endif 103#endif
87 104
105/**
106 * alloc_zeroed_user_highpage - Allocate a zeroed HIGHMEM page for a VMA
107 * @vma: The VMA the page is to be allocated for
108 * @vaddr: The virtual address the page will be inserted into
109 *
110 * This function will allocate a page for a VMA that the caller knows will
111 * not be able to move in the future using move_pages() or reclaim. If it
112 * is known that the page can move, use alloc_zeroed_user_highpage_movable
113 */
114static inline struct page *
115alloc_zeroed_user_highpage(struct vm_area_struct *vma, unsigned long vaddr)
116{
117 return __alloc_zeroed_user_highpage(0, vma, vaddr);
118}
119
120/**
121 * alloc_zeroed_user_highpage_movable - Allocate a zeroed HIGHMEM page for a VMA that the caller knows can move
122 * @vma: The VMA the page is to be allocated for
123 * @vaddr: The virtual address the page will be inserted into
124 *
125 * This function will allocate a page for a VMA that the caller knows will
126 * be able to migrate in the future using move_pages() or reclaimed
127 */
128static inline struct page *
129alloc_zeroed_user_highpage_movable(struct vm_area_struct *vma,
130 unsigned long vaddr)
131{
132 return __alloc_zeroed_user_highpage(__GFP_MOVABLE, vma, vaddr);
133}
134
88static inline void clear_highpage(struct page *page) 135static inline void clear_highpage(struct page *page)
89{ 136{
90 void *kaddr = kmap_atomic(page, KM_USER0); 137 void *kaddr = kmap_atomic(page, KM_USER0);
diff --git a/include/linux/hrtimer.h b/include/linux/hrtimer.h
index 17c29dca8354..540799bc85f8 100644
--- a/include/linux/hrtimer.h
+++ b/include/linux/hrtimer.h
@@ -329,12 +329,13 @@ extern void sysrq_timer_list_show(void);
329#ifdef CONFIG_TIMER_STATS 329#ifdef CONFIG_TIMER_STATS
330 330
331extern void timer_stats_update_stats(void *timer, pid_t pid, void *startf, 331extern void timer_stats_update_stats(void *timer, pid_t pid, void *startf,
332 void *timerf, char * comm); 332 void *timerf, char *comm,
333 unsigned int timer_flag);
333 334
334static inline void timer_stats_account_hrtimer(struct hrtimer *timer) 335static inline void timer_stats_account_hrtimer(struct hrtimer *timer)
335{ 336{
336 timer_stats_update_stats(timer, timer->start_pid, timer->start_site, 337 timer_stats_update_stats(timer, timer->start_pid, timer->start_site,
337 timer->function, timer->start_comm); 338 timer->function, timer->start_comm, 0);
338} 339}
339 340
340extern void __timer_stats_hrtimer_set_start_info(struct hrtimer *timer, 341extern void __timer_stats_hrtimer_set_start_info(struct hrtimer *timer,
diff --git a/include/linux/hugetlb.h b/include/linux/hugetlb.h
index 2c13715e9dde..49b7053043ad 100644
--- a/include/linux/hugetlb.h
+++ b/include/linux/hugetlb.h
@@ -15,6 +15,7 @@ static inline int is_vm_hugetlb_page(struct vm_area_struct *vma)
15} 15}
16 16
17int hugetlb_sysctl_handler(struct ctl_table *, int, struct file *, void __user *, size_t *, loff_t *); 17int hugetlb_sysctl_handler(struct ctl_table *, int, struct file *, void __user *, size_t *, loff_t *);
18int hugetlb_treat_movable_handler(struct ctl_table *, int, struct file *, void __user *, size_t *, loff_t *);
18int copy_hugetlb_page_range(struct mm_struct *, struct mm_struct *, struct vm_area_struct *); 19int copy_hugetlb_page_range(struct mm_struct *, struct mm_struct *, struct vm_area_struct *);
19int follow_hugetlb_page(struct mm_struct *, struct vm_area_struct *, struct page **, struct vm_area_struct **, unsigned long *, int *, int); 20int follow_hugetlb_page(struct mm_struct *, struct vm_area_struct *, struct page **, struct vm_area_struct **, unsigned long *, int *, int);
20void unmap_hugepage_range(struct vm_area_struct *, unsigned long, unsigned long); 21void unmap_hugepage_range(struct vm_area_struct *, unsigned long, unsigned long);
@@ -29,6 +30,7 @@ int hugetlb_reserve_pages(struct inode *inode, long from, long to);
29void hugetlb_unreserve_pages(struct inode *inode, long offset, long freed); 30void hugetlb_unreserve_pages(struct inode *inode, long offset, long freed);
30 31
31extern unsigned long max_huge_pages; 32extern unsigned long max_huge_pages;
33extern unsigned long hugepages_treat_as_movable;
32extern const unsigned long hugetlb_zero, hugetlb_infinity; 34extern const unsigned long hugetlb_zero, hugetlb_infinity;
33extern int sysctl_hugetlb_shm_group; 35extern int sysctl_hugetlb_shm_group;
34 36
diff --git a/include/linux/i2c.h b/include/linux/i2c.h
index cae7d618030c..2eaba21b9b1a 100644
--- a/include/linux/i2c.h
+++ b/include/linux/i2c.h
@@ -90,7 +90,7 @@ extern s32 i2c_smbus_write_block_data(struct i2c_client * client,
90 const u8 *values); 90 const u8 *values);
91/* Returns the number of read bytes */ 91/* Returns the number of read bytes */
92extern s32 i2c_smbus_read_i2c_block_data(struct i2c_client * client, 92extern s32 i2c_smbus_read_i2c_block_data(struct i2c_client * client,
93 u8 command, u8 *values); 93 u8 command, u8 length, u8 *values);
94extern s32 i2c_smbus_write_i2c_block_data(struct i2c_client * client, 94extern s32 i2c_smbus_write_i2c_block_data(struct i2c_client * client,
95 u8 command, u8 length, 95 u8 command, u8 length,
96 const u8 *values); 96 const u8 *values);
@@ -150,15 +150,20 @@ struct i2c_driver {
150 150
151/** 151/**
152 * struct i2c_client - represent an I2C slave device 152 * struct i2c_client - represent an I2C slave device
153 * @flags: I2C_CLIENT_TEN indicates the device uses a ten bit chip address;
154 * I2C_CLIENT_PEC indicates it uses SMBus Packet Error Checking
153 * @addr: Address used on the I2C bus connected to the parent adapter. 155 * @addr: Address used on the I2C bus connected to the parent adapter.
154 * @name: Indicates the type of the device, usually a chip name that's 156 * @name: Indicates the type of the device, usually a chip name that's
155 * generic enough to hide second-sourcing and compatible revisions. 157 * generic enough to hide second-sourcing and compatible revisions.
158 * @adapter: manages the bus segment hosting this I2C device
156 * @dev: Driver model device node for the slave. 159 * @dev: Driver model device node for the slave.
160 * @irq: indicates the IRQ generated by this device (if any)
157 * @driver_name: Identifies new-style driver used with this device; also 161 * @driver_name: Identifies new-style driver used with this device; also
158 * used as the module name for hotplug/coldplug modprobe support. 162 * used as the module name for hotplug/coldplug modprobe support.
159 * 163 *
160 * An i2c_client identifies a single device (i.e. chip) connected to an 164 * An i2c_client identifies a single device (i.e. chip) connected to an
161 * i2c bus. The behaviour is defined by the routines of the driver. 165 * i2c bus. The behaviour exposed to Linux is defined by the driver
166 * managing the device.
162 */ 167 */
163struct i2c_client { 168struct i2c_client {
164 unsigned short flags; /* div., see below */ 169 unsigned short flags; /* div., see below */
@@ -180,7 +185,8 @@ struct i2c_client {
180 185
181static inline struct i2c_client *kobj_to_i2c_client(struct kobject *kobj) 186static inline struct i2c_client *kobj_to_i2c_client(struct kobject *kobj)
182{ 187{
183 return to_i2c_client(container_of(kobj, struct device, kobj)); 188 struct device * const dev = container_of(kobj, struct device, kobj);
189 return to_i2c_client(dev);
184} 190}
185 191
186static inline void *i2c_get_clientdata (struct i2c_client *dev) 192static inline void *i2c_get_clientdata (struct i2c_client *dev)
@@ -201,7 +207,7 @@ static inline void i2c_set_clientdata (struct i2c_client *dev, void *data)
201 * @addr: stored in i2c_client.addr 207 * @addr: stored in i2c_client.addr
202 * @platform_data: stored in i2c_client.dev.platform_data 208 * @platform_data: stored in i2c_client.dev.platform_data
203 * @irq: stored in i2c_client.irq 209 * @irq: stored in i2c_client.irq
204 210 *
205 * I2C doesn't actually support hardware probing, although controllers and 211 * I2C doesn't actually support hardware probing, although controllers and
206 * devices may be able to use I2C_SMBUS_QUICK to tell whether or not there's 212 * devices may be able to use I2C_SMBUS_QUICK to tell whether or not there's
207 * a device at a given address. Drivers commonly need more information than 213 * a device at a given address. Drivers commonly need more information than
@@ -210,7 +216,7 @@ static inline void i2c_set_clientdata (struct i2c_client *dev, void *data)
210 * i2c_board_info is used to build tables of information listing I2C devices 216 * i2c_board_info is used to build tables of information listing I2C devices
211 * that are present. This information is used to grow the driver model tree 217 * that are present. This information is used to grow the driver model tree
212 * for "new style" I2C drivers. For mainboards this is done statically using 218 * for "new style" I2C drivers. For mainboards this is done statically using
213 * i2c_register_board_info(), where @bus_num represents an adapter that isn't 219 * i2c_register_board_info(); bus numbers identify adapters that aren't
214 * yet available. For add-on boards, i2c_new_device() does this dynamically 220 * yet available. For add-on boards, i2c_new_device() does this dynamically
215 * with the adapter already known. 221 * with the adapter already known.
216 */ 222 */
@@ -518,8 +524,9 @@ union i2c_smbus_data {
518#define I2C_SMBUS_WORD_DATA 3 524#define I2C_SMBUS_WORD_DATA 3
519#define I2C_SMBUS_PROC_CALL 4 525#define I2C_SMBUS_PROC_CALL 4
520#define I2C_SMBUS_BLOCK_DATA 5 526#define I2C_SMBUS_BLOCK_DATA 5
521#define I2C_SMBUS_I2C_BLOCK_DATA 6 527#define I2C_SMBUS_I2C_BLOCK_BROKEN 6
522#define I2C_SMBUS_BLOCK_PROC_CALL 7 /* SMBus 2.0 */ 528#define I2C_SMBUS_BLOCK_PROC_CALL 7 /* SMBus 2.0 */
529#define I2C_SMBUS_I2C_BLOCK_DATA 8
523 530
524 531
525/* ----- commands for the ioctl like i2c_command call: 532/* ----- commands for the ioctl like i2c_command call:
diff --git a/include/linux/i2o.h b/include/linux/i2o.h
index 52f53e2e70c3..333a370a3bdc 100644
--- a/include/linux/i2o.h
+++ b/include/linux/i2o.h
@@ -31,6 +31,7 @@
31#include <linux/slab.h> 31#include <linux/slab.h>
32#include <linux/workqueue.h> /* work_struct */ 32#include <linux/workqueue.h> /* work_struct */
33#include <linux/mempool.h> 33#include <linux/mempool.h>
34#include <linux/mutex.h>
34 35
35#include <asm/io.h> 36#include <asm/io.h>
36#include <asm/semaphore.h> /* Needed for MUTEX init macros */ 37#include <asm/semaphore.h> /* Needed for MUTEX init macros */
@@ -425,7 +426,7 @@ struct i2o_device {
425 426
426 struct device device; 427 struct device device;
427 428
428 struct semaphore lock; /* device lock */ 429 struct mutex lock; /* device lock */
429}; 430};
430 431
431/* 432/*
@@ -544,7 +545,7 @@ struct i2o_controller {
544 struct i2o_dma hrt; /* HW Resource Table */ 545 struct i2o_dma hrt; /* HW Resource Table */
545 i2o_lct *lct; /* Logical Config Table */ 546 i2o_lct *lct; /* Logical Config Table */
546 struct i2o_dma dlct; /* Temp LCT */ 547 struct i2o_dma dlct; /* Temp LCT */
547 struct semaphore lct_lock; /* Lock for LCT updates */ 548 struct mutex lct_lock; /* Lock for LCT updates */
548 struct i2o_dma status_block; /* IOP status block */ 549 struct i2o_dma status_block; /* IOP status block */
549 550
550 struct i2o_io base; /* controller messaging unit */ 551 struct i2o_io base; /* controller messaging unit */
diff --git a/include/linux/ide.h b/include/linux/ide.h
index 1e365acdd369..19ab25804056 100644
--- a/include/linux/ide.h
+++ b/include/linux/ide.h
@@ -25,6 +25,7 @@
25#include <asm/system.h> 25#include <asm/system.h>
26#include <asm/io.h> 26#include <asm/io.h>
27#include <asm/semaphore.h> 27#include <asm/semaphore.h>
28#include <asm/mutex.h>
28 29
29/****************************************************************************** 30/******************************************************************************
30 * IDE driver configuration options (play with these as desired): 31 * IDE driver configuration options (play with these as desired):
@@ -685,6 +686,8 @@ typedef struct hwif_s {
685 u8 mwdma_mask; 686 u8 mwdma_mask;
686 u8 swdma_mask; 687 u8 swdma_mask;
687 688
689 u8 cbl; /* cable type */
690
688 hwif_chipset_t chipset; /* sub-module for tuning.. */ 691 hwif_chipset_t chipset; /* sub-module for tuning.. */
689 692
690 struct pci_dev *pci_dev; /* for pci chipsets */ 693 struct pci_dev *pci_dev; /* for pci chipsets */
@@ -735,8 +738,8 @@ typedef struct hwif_s {
735 void (*ide_dma_clear_irq)(ide_drive_t *drive); 738 void (*ide_dma_clear_irq)(ide_drive_t *drive);
736 void (*dma_host_on)(ide_drive_t *drive); 739 void (*dma_host_on)(ide_drive_t *drive);
737 void (*dma_host_off)(ide_drive_t *drive); 740 void (*dma_host_off)(ide_drive_t *drive);
738 int (*ide_dma_lostirq)(ide_drive_t *drive); 741 void (*dma_lost_irq)(ide_drive_t *drive);
739 int (*ide_dma_timeout)(ide_drive_t *drive); 742 void (*dma_timeout)(ide_drive_t *drive);
740 743
741 void (*OUTB)(u8 addr, unsigned long port); 744 void (*OUTB)(u8 addr, unsigned long port);
742 void (*OUTBSYNC)(ide_drive_t *drive, u8 addr, unsigned long port); 745 void (*OUTBSYNC)(ide_drive_t *drive, u8 addr, unsigned long port);
@@ -791,7 +794,6 @@ typedef struct hwif_s {
791 unsigned sharing_irq: 1; /* 1 = sharing irq with another hwif */ 794 unsigned sharing_irq: 1; /* 1 = sharing irq with another hwif */
792 unsigned reset : 1; /* reset after probe */ 795 unsigned reset : 1; /* reset after probe */
793 unsigned autodma : 1; /* auto-attempt using DMA at boot */ 796 unsigned autodma : 1; /* auto-attempt using DMA at boot */
794 unsigned udma_four : 1; /* 1=ATA-66 capable, 0=default */
795 unsigned no_lba48 : 1; /* 1 = cannot do LBA48 */ 797 unsigned no_lba48 : 1; /* 1 = cannot do LBA48 */
796 unsigned no_lba48_dma : 1; /* 1 = cannot do LBA48 DMA */ 798 unsigned no_lba48_dma : 1; /* 1 = cannot do LBA48 DMA */
797 unsigned auto_poll : 1; /* supports nop auto-poll */ 799 unsigned auto_poll : 1; /* supports nop auto-poll */
@@ -863,7 +865,7 @@ typedef struct hwgroup_s {
863 865
864typedef struct ide_driver_s ide_driver_t; 866typedef struct ide_driver_s ide_driver_t;
865 867
866extern struct semaphore ide_setting_sem; 868extern struct mutex ide_setting_mtx;
867 869
868int set_io_32bit(ide_drive_t *, int); 870int set_io_32bit(ide_drive_t *, int);
869int set_pio_mode(ide_drive_t *, int); 871int set_pio_mode(ide_drive_t *, int);
@@ -1304,8 +1306,8 @@ extern int __ide_dma_check(ide_drive_t *);
1304extern int ide_dma_setup(ide_drive_t *); 1306extern int ide_dma_setup(ide_drive_t *);
1305extern void ide_dma_start(ide_drive_t *); 1307extern void ide_dma_start(ide_drive_t *);
1306extern int __ide_dma_end(ide_drive_t *); 1308extern int __ide_dma_end(ide_drive_t *);
1307extern int __ide_dma_lostirq(ide_drive_t *); 1309extern void ide_dma_lost_irq(ide_drive_t *);
1308extern int __ide_dma_timeout(ide_drive_t *); 1310extern void ide_dma_timeout(ide_drive_t *);
1309#endif /* CONFIG_BLK_DEV_IDEDMA_PCI */ 1311#endif /* CONFIG_BLK_DEV_IDEDMA_PCI */
1310 1312
1311#else 1313#else
@@ -1382,11 +1384,11 @@ extern const ide_pio_timings_t ide_pio_timings[6];
1382 1384
1383 1385
1384extern spinlock_t ide_lock; 1386extern spinlock_t ide_lock;
1385extern struct semaphore ide_cfg_sem; 1387extern struct mutex ide_cfg_mtx;
1386/* 1388/*
1387 * Structure locking: 1389 * Structure locking:
1388 * 1390 *
1389 * ide_cfg_sem and ide_lock together protect changes to 1391 * ide_cfg_mtx and ide_lock together protect changes to
1390 * ide_hwif_t->{next,hwgroup} 1392 * ide_hwif_t->{next,hwgroup}
1391 * ide_drive_t->next 1393 * ide_drive_t->next
1392 * 1394 *
diff --git a/include/linux/idr.h b/include/linux/idr.h
index 826803449db7..0edda411959c 100644
--- a/include/linux/idr.h
+++ b/include/linux/idr.h
@@ -78,9 +78,41 @@ void *idr_find(struct idr *idp, int id);
78int idr_pre_get(struct idr *idp, gfp_t gfp_mask); 78int idr_pre_get(struct idr *idp, gfp_t gfp_mask);
79int idr_get_new(struct idr *idp, void *ptr, int *id); 79int idr_get_new(struct idr *idp, void *ptr, int *id);
80int idr_get_new_above(struct idr *idp, void *ptr, int starting_id, int *id); 80int idr_get_new_above(struct idr *idp, void *ptr, int starting_id, int *id);
81int idr_for_each(struct idr *idp,
82 int (*fn)(int id, void *p, void *data), void *data);
81void *idr_replace(struct idr *idp, void *ptr, int id); 83void *idr_replace(struct idr *idp, void *ptr, int id);
82void idr_remove(struct idr *idp, int id); 84void idr_remove(struct idr *idp, int id);
85void idr_remove_all(struct idr *idp);
83void idr_destroy(struct idr *idp); 86void idr_destroy(struct idr *idp);
84void idr_init(struct idr *idp); 87void idr_init(struct idr *idp);
85 88
89
90/*
91 * IDA - IDR based id allocator, use when translation from id to
92 * pointer isn't necessary.
93 */
94#define IDA_CHUNK_SIZE 128 /* 128 bytes per chunk */
95#define IDA_BITMAP_LONGS (128 / sizeof(long) - 1)
96#define IDA_BITMAP_BITS (IDA_BITMAP_LONGS * sizeof(long) * 8)
97
98struct ida_bitmap {
99 long nr_busy;
100 unsigned long bitmap[IDA_BITMAP_LONGS];
101};
102
103struct ida {
104 struct idr idr;
105 struct ida_bitmap *free_bitmap;
106};
107
108#define IDA_INIT(name) { .idr = IDR_INIT(name), .free_bitmap = NULL, }
109#define DEFINE_IDA(name) struct ida name = IDA_INIT(name)
110
111int ida_pre_get(struct ida *ida, gfp_t gfp_mask);
112int ida_get_new_above(struct ida *ida, int starting_id, int *p_id);
113int ida_get_new(struct ida *ida, int *p_id);
114void ida_remove(struct ida *ida, int id);
115void ida_destroy(struct ida *ida);
116void ida_init(struct ida *ida);
117
86#endif /* __IDR_H__ */ 118#endif /* __IDR_H__ */
diff --git a/include/linux/ieee80211.h b/include/linux/ieee80211.h
index ecd61e8438a5..272f8c8c90da 100644
--- a/include/linux/ieee80211.h
+++ b/include/linux/ieee80211.h
@@ -227,6 +227,17 @@ struct ieee80211_cts {
227#define WLAN_CAPABILITY_SHORT_SLOT_TIME (1<<10) 227#define WLAN_CAPABILITY_SHORT_SLOT_TIME (1<<10)
228#define WLAN_CAPABILITY_DSSS_OFDM (1<<13) 228#define WLAN_CAPABILITY_DSSS_OFDM (1<<13)
229 229
230/* 802.11g ERP information element */
231#define WLAN_ERP_NON_ERP_PRESENT (1<<0)
232#define WLAN_ERP_USE_PROTECTION (1<<1)
233#define WLAN_ERP_BARKER_PREAMBLE (1<<2)
234
235/* WLAN_ERP_BARKER_PREAMBLE values */
236enum {
237 WLAN_ERP_PREAMBLE_SHORT = 0,
238 WLAN_ERP_PREAMBLE_LONG = 1,
239};
240
230/* Status codes */ 241/* Status codes */
231enum ieee80211_statuscode { 242enum ieee80211_statuscode {
232 WLAN_STATUS_SUCCESS = 0, 243 WLAN_STATUS_SUCCESS = 0,
diff --git a/include/linux/if_link.h b/include/linux/if_link.h
index 604c2434f71c..422084d18ce1 100644
--- a/include/linux/if_link.h
+++ b/include/linux/if_link.h
@@ -76,6 +76,8 @@ enum
76#define IFLA_WEIGHT IFLA_WEIGHT 76#define IFLA_WEIGHT IFLA_WEIGHT
77 IFLA_OPERSTATE, 77 IFLA_OPERSTATE,
78 IFLA_LINKMODE, 78 IFLA_LINKMODE,
79 IFLA_LINKINFO,
80#define IFLA_LINKINFO IFLA_LINKINFO
79 __IFLA_MAX 81 __IFLA_MAX
80}; 82};
81 83
@@ -140,4 +142,49 @@ struct ifla_cacheinfo
140 __u32 retrans_time; 142 __u32 retrans_time;
141}; 143};
142 144
145enum
146{
147 IFLA_INFO_UNSPEC,
148 IFLA_INFO_KIND,
149 IFLA_INFO_DATA,
150 IFLA_INFO_XSTATS,
151 __IFLA_INFO_MAX,
152};
153
154#define IFLA_INFO_MAX (__IFLA_INFO_MAX - 1)
155
156/* VLAN section */
157
158enum
159{
160 IFLA_VLAN_UNSPEC,
161 IFLA_VLAN_ID,
162 IFLA_VLAN_FLAGS,
163 IFLA_VLAN_EGRESS_QOS,
164 IFLA_VLAN_INGRESS_QOS,
165 __IFLA_VLAN_MAX,
166};
167
168#define IFLA_VLAN_MAX (__IFLA_VLAN_MAX - 1)
169
170struct ifla_vlan_flags {
171 __u32 flags;
172 __u32 mask;
173};
174
175enum
176{
177 IFLA_VLAN_QOS_UNSPEC,
178 IFLA_VLAN_QOS_MAPPING,
179 __IFLA_VLAN_QOS_MAX
180};
181
182#define IFLA_VLAN_QOS_MAX (__IFLA_VLAN_QOS_MAX - 1)
183
184struct ifla_vlan_qos_mapping
185{
186 __u32 from;
187 __u32 to;
188};
189
143#endif /* _LINUX_IF_LINK_H */ 190#endif /* _LINUX_IF_LINK_H */
diff --git a/include/linux/if_macvlan.h b/include/linux/if_macvlan.h
new file mode 100644
index 000000000000..0d9d7ea2c1cc
--- /dev/null
+++ b/include/linux/if_macvlan.h
@@ -0,0 +1,9 @@
1#ifndef _LINUX_IF_MACVLAN_H
2#define _LINUX_IF_MACVLAN_H
3
4#ifdef __KERNEL__
5
6extern struct sk_buff *(*macvlan_handle_frame_hook)(struct sk_buff *);
7
8#endif /* __KERNEL__ */
9#endif /* _LINUX_IF_MACVLAN_H */
diff --git a/include/linux/if_ppp.h b/include/linux/if_ppp.h
index 768372f07caa..0f2f70d4e48c 100644
--- a/include/linux/if_ppp.h
+++ b/include/linux/if_ppp.h
@@ -110,6 +110,21 @@ struct ifpppcstatsreq {
110 struct ppp_comp_stats stats; 110 struct ppp_comp_stats stats;
111}; 111};
112 112
113/* For PPPIOCGL2TPSTATS */
114struct pppol2tp_ioc_stats {
115 __u16 tunnel_id; /* redundant */
116 __u16 session_id; /* if zero, get tunnel stats */
117 __u32 using_ipsec:1; /* valid only for session_id == 0 */
118 aligned_u64 tx_packets;
119 aligned_u64 tx_bytes;
120 aligned_u64 tx_errors;
121 aligned_u64 rx_packets;
122 aligned_u64 rx_bytes;
123 aligned_u64 rx_seq_discards;
124 aligned_u64 rx_oos_packets;
125 aligned_u64 rx_errors;
126};
127
113#define ifr__name b.ifr_ifrn.ifrn_name 128#define ifr__name b.ifr_ifrn.ifrn_name
114#define stats_ptr b.ifr_ifru.ifru_data 129#define stats_ptr b.ifr_ifru.ifru_data
115 130
@@ -146,6 +161,7 @@ struct ifpppcstatsreq {
146#define PPPIOCDISCONN _IO('t', 57) /* disconnect channel */ 161#define PPPIOCDISCONN _IO('t', 57) /* disconnect channel */
147#define PPPIOCATTCHAN _IOW('t', 56, int) /* attach to ppp channel */ 162#define PPPIOCATTCHAN _IOW('t', 56, int) /* attach to ppp channel */
148#define PPPIOCGCHAN _IOR('t', 55, int) /* get ppp channel number */ 163#define PPPIOCGCHAN _IOR('t', 55, int) /* get ppp channel number */
164#define PPPIOCGL2TPSTATS _IOR('t', 54, struct pppol2tp_ioc_stats)
149 165
150#define SIOCGPPPSTATS (SIOCDEVPRIVATE + 0) 166#define SIOCGPPPSTATS (SIOCDEVPRIVATE + 0)
151#define SIOCGPPPVER (SIOCDEVPRIVATE + 1) /* NEVER change this!! */ 167#define SIOCGPPPVER (SIOCDEVPRIVATE + 1) /* NEVER change this!! */
diff --git a/include/linux/if_pppol2tp.h b/include/linux/if_pppol2tp.h
new file mode 100644
index 000000000000..516203b6fdeb
--- /dev/null
+++ b/include/linux/if_pppol2tp.h
@@ -0,0 +1,69 @@
1/***************************************************************************
2 * Linux PPP over L2TP (PPPoL2TP) Socket Implementation (RFC 2661)
3 *
4 * This file supplies definitions required by the PPP over L2TP driver
5 * (pppol2tp.c). All version information wrt this file is located in pppol2tp.c
6 *
7 * License:
8 * This program is free software; you can redistribute it and/or
9 * modify it under the terms of the GNU General Public License
10 * as published by the Free Software Foundation; either version
11 * 2 of the License, or (at your option) any later version.
12 *
13 */
14
15#ifndef __LINUX_IF_PPPOL2TP_H
16#define __LINUX_IF_PPPOL2TP_H
17
18#include <asm/types.h>
19
20#ifdef __KERNEL__
21#include <linux/in.h>
22#endif
23
24/* Structure used to connect() the socket to a particular tunnel UDP
25 * socket.
26 */
27struct pppol2tp_addr
28{
29 pid_t pid; /* pid that owns the fd.
30 * 0 => current */
31 int fd; /* FD of UDP socket to use */
32
33 struct sockaddr_in addr; /* IP address and port to send to */
34
35 __be16 s_tunnel, s_session; /* For matching incoming packets */
36 __be16 d_tunnel, d_session; /* For sending outgoing packets */
37};
38
39/* Socket options:
40 * DEBUG - bitmask of debug message categories
41 * SENDSEQ - 0 => don't send packets with sequence numbers
42 * 1 => send packets with sequence numbers
43 * RECVSEQ - 0 => receive packet sequence numbers are optional
44 * 1 => drop receive packets without sequence numbers
45 * LNSMODE - 0 => act as LAC.
46 * 1 => act as LNS.
47 * REORDERTO - reorder timeout (in millisecs). If 0, don't try to reorder.
48 */
49enum {
50 PPPOL2TP_SO_DEBUG = 1,
51 PPPOL2TP_SO_RECVSEQ = 2,
52 PPPOL2TP_SO_SENDSEQ = 3,
53 PPPOL2TP_SO_LNSMODE = 4,
54 PPPOL2TP_SO_REORDERTO = 5,
55};
56
57/* Debug message categories for the DEBUG socket option */
58enum {
59 PPPOL2TP_MSG_DEBUG = (1 << 0), /* verbose debug (if
60 * compiled in) */
61 PPPOL2TP_MSG_CONTROL = (1 << 1), /* userspace - kernel
62 * interface */
63 PPPOL2TP_MSG_SEQ = (1 << 2), /* sequence numbers */
64 PPPOL2TP_MSG_DATA = (1 << 3), /* data packets */
65};
66
67
68
69#endif
diff --git a/include/linux/if_pppox.h b/include/linux/if_pppox.h
index 6f987be60fe2..25652545ba6e 100644
--- a/include/linux/if_pppox.h
+++ b/include/linux/if_pppox.h
@@ -27,6 +27,7 @@
27#include <asm/semaphore.h> 27#include <asm/semaphore.h>
28#include <linux/ppp_channel.h> 28#include <linux/ppp_channel.h>
29#endif /* __KERNEL__ */ 29#endif /* __KERNEL__ */
30#include <linux/if_pppol2tp.h>
30 31
31/* For user-space programs to pick up these definitions 32/* For user-space programs to pick up these definitions
32 * which they wouldn't get otherwise without defining __KERNEL__ 33 * which they wouldn't get otherwise without defining __KERNEL__
@@ -50,8 +51,9 @@ struct pppoe_addr{
50 * Protocols supported by AF_PPPOX 51 * Protocols supported by AF_PPPOX
51 */ 52 */
52#define PX_PROTO_OE 0 /* Currently just PPPoE */ 53#define PX_PROTO_OE 0 /* Currently just PPPoE */
53#define PX_MAX_PROTO 1 54#define PX_PROTO_OL2TP 1 /* Now L2TP also */
54 55#define PX_MAX_PROTO 2
56
55struct sockaddr_pppox { 57struct sockaddr_pppox {
56 sa_family_t sa_family; /* address family, AF_PPPOX */ 58 sa_family_t sa_family; /* address family, AF_PPPOX */
57 unsigned int sa_protocol; /* protocol identifier */ 59 unsigned int sa_protocol; /* protocol identifier */
@@ -60,6 +62,16 @@ struct sockaddr_pppox {
60 }sa_addr; 62 }sa_addr;
61}__attribute__ ((packed)); 63}__attribute__ ((packed));
62 64
65/* The use of the above union isn't viable because the size of this
66 * struct must stay fixed over time -- applications use sizeof(struct
67 * sockaddr_pppox) to fill it. We use a protocol specific sockaddr
68 * type instead.
69 */
70struct sockaddr_pppol2tp {
71 sa_family_t sa_family; /* address family, AF_PPPOX */
72 unsigned int sa_protocol; /* protocol identifier */
73 struct pppol2tp_addr pppol2tp;
74}__attribute__ ((packed));
63 75
64/********************************************************************* 76/*********************************************************************
65 * 77 *
diff --git a/include/linux/if_tun.h b/include/linux/if_tun.h
index 88aef7b86ef4..42eb6945b93e 100644
--- a/include/linux/if_tun.h
+++ b/include/linux/if_tun.h
@@ -36,6 +36,7 @@ struct tun_struct {
36 unsigned long flags; 36 unsigned long flags;
37 int attached; 37 int attached;
38 uid_t owner; 38 uid_t owner;
39 gid_t group;
39 40
40 wait_queue_head_t read_wait; 41 wait_queue_head_t read_wait;
41 struct sk_buff_head readq; 42 struct sk_buff_head readq;
@@ -78,6 +79,7 @@ struct tun_struct {
78#define TUNSETPERSIST _IOW('T', 203, int) 79#define TUNSETPERSIST _IOW('T', 203, int)
79#define TUNSETOWNER _IOW('T', 204, int) 80#define TUNSETOWNER _IOW('T', 204, int)
80#define TUNSETLINK _IOW('T', 205, int) 81#define TUNSETLINK _IOW('T', 205, int)
82#define TUNSETGROUP _IOW('T', 206, int)
81 83
82/* TUNSETIFF ifr flags */ 84/* TUNSETIFF ifr flags */
83#define IFF_TUN 0x0001 85#define IFF_TUN 0x0001
diff --git a/include/linux/if_vlan.h b/include/linux/if_vlan.h
index 81e9bc93569b..f8443fdb124a 100644
--- a/include/linux/if_vlan.h
+++ b/include/linux/if_vlan.h
@@ -99,7 +99,7 @@ static inline void vlan_group_set_device(struct vlan_group *vg, int vlan_id,
99} 99}
100 100
101struct vlan_priority_tci_mapping { 101struct vlan_priority_tci_mapping {
102 unsigned long priority; 102 u32 priority;
103 unsigned short vlan_qos; /* This should be shifted when first set, so we only do it 103 unsigned short vlan_qos; /* This should be shifted when first set, so we only do it
104 * at provisioning time. 104 * at provisioning time.
105 * ((skb->priority << 13) & 0xE000) 105 * ((skb->priority << 13) & 0xE000)
@@ -112,7 +112,10 @@ struct vlan_dev_info {
112 /** This will be the mapping that correlates skb->priority to 112 /** This will be the mapping that correlates skb->priority to
113 * 3 bits of VLAN QOS tags... 113 * 3 bits of VLAN QOS tags...
114 */ 114 */
115 unsigned long ingress_priority_map[8]; 115 unsigned int nr_ingress_mappings;
116 u32 ingress_priority_map[8];
117
118 unsigned int nr_egress_mappings;
116 struct vlan_priority_tci_mapping *egress_priority_map[16]; /* hash table */ 119 struct vlan_priority_tci_mapping *egress_priority_map[16]; /* hash table */
117 120
118 unsigned short vlan_id; /* The VLAN Identifier for this interface. */ 121 unsigned short vlan_id; /* The VLAN Identifier for this interface. */
@@ -124,14 +127,8 @@ struct vlan_dev_info {
124 * like DHCP that use packet-filtering and don't understand 127 * like DHCP that use packet-filtering and don't understand
125 * 802.1Q 128 * 802.1Q
126 */ 129 */
127 struct dev_mc_list *old_mc_list; /* old multi-cast list for the VLAN interface..
128 * we save this so we can tell what changes were
129 * made, in order to feed the right changes down
130 * to the real hardware...
131 */
132 int old_allmulti; /* similar to above. */
133 int old_promiscuity; /* similar to above. */
134 struct net_device *real_dev; /* the underlying device/interface */ 130 struct net_device *real_dev; /* the underlying device/interface */
131 unsigned char real_dev_addr[ETH_ALEN];
135 struct proc_dir_entry *dent; /* Holds the proc data */ 132 struct proc_dir_entry *dent; /* Holds the proc data */
136 unsigned long cnt_inc_headroom_on_tx; /* How many times did we have to grow the skb on TX. */ 133 unsigned long cnt_inc_headroom_on_tx; /* How many times did we have to grow the skb on TX. */
137 unsigned long cnt_encap_on_xmit; /* How many times did we have to encapsulate the skb on TX. */ 134 unsigned long cnt_encap_on_xmit; /* How many times did we have to encapsulate the skb on TX. */
@@ -395,6 +392,10 @@ enum vlan_ioctl_cmds {
395 GET_VLAN_VID_CMD /* Get the VID of this VLAN (specified by name) */ 392 GET_VLAN_VID_CMD /* Get the VID of this VLAN (specified by name) */
396}; 393};
397 394
395enum vlan_flags {
396 VLAN_FLAG_REORDER_HDR = 0x1,
397};
398
398enum vlan_name_types { 399enum vlan_name_types {
399 VLAN_NAME_TYPE_PLUS_VID, /* Name will look like: vlan0005 */ 400 VLAN_NAME_TYPE_PLUS_VID, /* Name will look like: vlan0005 */
400 VLAN_NAME_TYPE_RAW_PLUS_VID, /* name will look like: eth1.0005 */ 401 VLAN_NAME_TYPE_RAW_PLUS_VID, /* name will look like: eth1.0005 */
diff --git a/include/linux/inetdevice.h b/include/linux/inetdevice.h
index ae04901aa09a..d83fee2dc643 100644
--- a/include/linux/inetdevice.h
+++ b/include/linux/inetdevice.h
@@ -8,6 +8,7 @@
8#include <linux/netdevice.h> 8#include <linux/netdevice.h>
9#include <linux/rcupdate.h> 9#include <linux/rcupdate.h>
10#include <linux/timer.h> 10#include <linux/timer.h>
11#include <linux/sysctl.h>
11 12
12struct ipv4_devconf 13struct ipv4_devconf
13{ 14{
diff --git a/include/linux/init.h b/include/linux/init.h
index 56ec4c62eee0..5b5285316339 100644
--- a/include/linux/init.h
+++ b/include/linux/init.h
@@ -171,9 +171,6 @@ struct obs_kernel_param {
171#define __setup(str, fn) \ 171#define __setup(str, fn) \
172 __setup_param(str, fn, fn, 0) 172 __setup_param(str, fn, fn, 0)
173 173
174#define __obsolete_setup(str) \
175 __setup_null_param(str, __LINE__)
176
177/* NOTE: fn is as per module_param, not __setup! Emits warning if fn 174/* NOTE: fn is as per module_param, not __setup! Emits warning if fn
178 * returns non-zero. */ 175 * returns non-zero. */
179#define early_param(str, fn) \ 176#define early_param(str, fn) \
@@ -239,7 +236,6 @@ void __init parse_early_param(void);
239#define __setup_param(str, unique_id, fn) /* nothing */ 236#define __setup_param(str, unique_id, fn) /* nothing */
240#define __setup_null_param(str, unique_id) /* nothing */ 237#define __setup_null_param(str, unique_id) /* nothing */
241#define __setup(str, func) /* nothing */ 238#define __setup(str, func) /* nothing */
242#define __obsolete_setup(str) /* nothing */
243#endif 239#endif
244 240
245/* Data marked not to be saved by software suspend */ 241/* Data marked not to be saved by software suspend */
diff --git a/include/linux/init_task.h b/include/linux/init_task.h
index 276ccaa2670c..cab741c2d603 100644
--- a/include/linux/init_task.h
+++ b/include/linux/init_task.h
@@ -8,6 +8,7 @@
8#include <linux/lockdep.h> 8#include <linux/lockdep.h>
9#include <linux/ipc.h> 9#include <linux/ipc.h>
10#include <linux/pid_namespace.h> 10#include <linux/pid_namespace.h>
11#include <linux/user_namespace.h>
11 12
12#define INIT_FDTABLE \ 13#define INIT_FDTABLE \
13{ \ 14{ \
@@ -78,6 +79,7 @@ extern struct nsproxy init_nsproxy;
78 .uts_ns = &init_uts_ns, \ 79 .uts_ns = &init_uts_ns, \
79 .mnt_ns = NULL, \ 80 .mnt_ns = NULL, \
80 INIT_IPC_NS(ipc_ns) \ 81 INIT_IPC_NS(ipc_ns) \
82 .user_ns = &init_user_ns, \
81} 83}
82 84
83#define INIT_SIGHAND(sighand) { \ 85#define INIT_SIGHAND(sighand) { \
diff --git a/include/linux/input.h b/include/linux/input.h
index be2bf3a2b031..18c98b543030 100644
--- a/include/linux/input.h
+++ b/include/linux/input.h
@@ -108,6 +108,13 @@ struct input_absinfo {
108 108
109/* 109/*
110 * Keys and buttons 110 * Keys and buttons
111 *
112 * Most of the keys/buttons are modeled after USB HUT 1.12
113 * (see http://www.usb.org/developers/hidpage).
114 * Abbreviations in the comments:
115 * AC - Application Control
116 * AL - Application Launch Button
117 * SC - System Control
111 */ 118 */
112 119
113#define KEY_RESERVED 0 120#define KEY_RESERVED 0
@@ -226,7 +233,7 @@ struct input_absinfo {
226#define KEY_MUTE 113 233#define KEY_MUTE 113
227#define KEY_VOLUMEDOWN 114 234#define KEY_VOLUMEDOWN 114
228#define KEY_VOLUMEUP 115 235#define KEY_VOLUMEUP 115
229#define KEY_POWER 116 236#define KEY_POWER 116 /* SC System Power Down */
230#define KEY_KPEQUAL 117 237#define KEY_KPEQUAL 117
231#define KEY_KPPLUSMINUS 118 238#define KEY_KPPLUSMINUS 118
232#define KEY_PAUSE 119 239#define KEY_PAUSE 119
@@ -240,38 +247,39 @@ struct input_absinfo {
240#define KEY_RIGHTMETA 126 247#define KEY_RIGHTMETA 126
241#define KEY_COMPOSE 127 248#define KEY_COMPOSE 127
242 249
243#define KEY_STOP 128 250#define KEY_STOP 128 /* AC Stop */
244#define KEY_AGAIN 129 251#define KEY_AGAIN 129
245#define KEY_PROPS 130 252#define KEY_PROPS 130 /* AC Properties */
246#define KEY_UNDO 131 253#define KEY_UNDO 131 /* AC Undo */
247#define KEY_FRONT 132 254#define KEY_FRONT 132
248#define KEY_COPY 133 255#define KEY_COPY 133 /* AC Copy */
249#define KEY_OPEN 134 256#define KEY_OPEN 134 /* AC Open */
250#define KEY_PASTE 135 257#define KEY_PASTE 135 /* AC Paste */
251#define KEY_FIND 136 258#define KEY_FIND 136 /* AC Search */
252#define KEY_CUT 137 259#define KEY_CUT 137 /* AC Cut */
253#define KEY_HELP 138 260#define KEY_HELP 138 /* AL Integrated Help Center */
254#define KEY_MENU 139 261#define KEY_MENU 139 /* Menu (show menu) */
255#define KEY_CALC 140 262#define KEY_CALC 140 /* AL Calculator */
256#define KEY_SETUP 141 263#define KEY_SETUP 141
257#define KEY_SLEEP 142 264#define KEY_SLEEP 142 /* SC System Sleep */
258#define KEY_WAKEUP 143 265#define KEY_WAKEUP 143 /* System Wake Up */
259#define KEY_FILE 144 266#define KEY_FILE 144 /* AL Local Machine Browser */
260#define KEY_SENDFILE 145 267#define KEY_SENDFILE 145
261#define KEY_DELETEFILE 146 268#define KEY_DELETEFILE 146
262#define KEY_XFER 147 269#define KEY_XFER 147
263#define KEY_PROG1 148 270#define KEY_PROG1 148
264#define KEY_PROG2 149 271#define KEY_PROG2 149
265#define KEY_WWW 150 272#define KEY_WWW 150 /* AL Internet Browser */
266#define KEY_MSDOS 151 273#define KEY_MSDOS 151
267#define KEY_COFFEE 152 274#define KEY_COFFEE 152 /* AL Terminal Lock/Screensaver */
275#define KEY_SCREENLOCK KEY_COFFEE
268#define KEY_DIRECTION 153 276#define KEY_DIRECTION 153
269#define KEY_CYCLEWINDOWS 154 277#define KEY_CYCLEWINDOWS 154
270#define KEY_MAIL 155 278#define KEY_MAIL 155
271#define KEY_BOOKMARKS 156 279#define KEY_BOOKMARKS 156 /* AC Bookmarks */
272#define KEY_COMPUTER 157 280#define KEY_COMPUTER 157
273#define KEY_BACK 158 281#define KEY_BACK 158 /* AC Back */
274#define KEY_FORWARD 159 282#define KEY_FORWARD 159 /* AC Forward */
275#define KEY_CLOSECD 160 283#define KEY_CLOSECD 160
276#define KEY_EJECTCD 161 284#define KEY_EJECTCD 161
277#define KEY_EJECTCLOSECD 162 285#define KEY_EJECTCLOSECD 162
@@ -281,20 +289,20 @@ struct input_absinfo {
281#define KEY_STOPCD 166 289#define KEY_STOPCD 166
282#define KEY_RECORD 167 290#define KEY_RECORD 167
283#define KEY_REWIND 168 291#define KEY_REWIND 168
284#define KEY_PHONE 169 292#define KEY_PHONE 169 /* Media Select Telephone */
285#define KEY_ISO 170 293#define KEY_ISO 170
286#define KEY_CONFIG 171 294#define KEY_CONFIG 171 /* AL Consumer Control Configuration */
287#define KEY_HOMEPAGE 172 295#define KEY_HOMEPAGE 172 /* AC Home */
288#define KEY_REFRESH 173 296#define KEY_REFRESH 173 /* AC Refresh */
289#define KEY_EXIT 174 297#define KEY_EXIT 174 /* AC Exit */
290#define KEY_MOVE 175 298#define KEY_MOVE 175
291#define KEY_EDIT 176 299#define KEY_EDIT 176
292#define KEY_SCROLLUP 177 300#define KEY_SCROLLUP 177
293#define KEY_SCROLLDOWN 178 301#define KEY_SCROLLDOWN 178
294#define KEY_KPLEFTPAREN 179 302#define KEY_KPLEFTPAREN 179
295#define KEY_KPRIGHTPAREN 180 303#define KEY_KPRIGHTPAREN 180
296#define KEY_NEW 181 304#define KEY_NEW 181 /* AC New */
297#define KEY_REDO 182 305#define KEY_REDO 182 /* AC Redo/Repeat */
298 306
299#define KEY_F13 183 307#define KEY_F13 183
300#define KEY_F14 184 308#define KEY_F14 184
@@ -314,11 +322,11 @@ struct input_absinfo {
314#define KEY_PROG3 202 322#define KEY_PROG3 202
315#define KEY_PROG4 203 323#define KEY_PROG4 203
316#define KEY_SUSPEND 205 324#define KEY_SUSPEND 205
317#define KEY_CLOSE 206 325#define KEY_CLOSE 206 /* AC Close */
318#define KEY_PLAY 207 326#define KEY_PLAY 207
319#define KEY_FASTFORWARD 208 327#define KEY_FASTFORWARD 208
320#define KEY_BASSBOOST 209 328#define KEY_BASSBOOST 209
321#define KEY_PRINT 210 329#define KEY_PRINT 210 /* AC Print */
322#define KEY_HP 211 330#define KEY_HP 211
323#define KEY_CAMERA 212 331#define KEY_CAMERA 212
324#define KEY_SOUND 213 332#define KEY_SOUND 213
@@ -327,11 +335,11 @@ struct input_absinfo {
327#define KEY_CHAT 216 335#define KEY_CHAT 216
328#define KEY_SEARCH 217 336#define KEY_SEARCH 217
329#define KEY_CONNECT 218 337#define KEY_CONNECT 218
330#define KEY_FINANCE 219 338#define KEY_FINANCE 219 /* AL Checkbook/Finance */
331#define KEY_SPORT 220 339#define KEY_SPORT 220
332#define KEY_SHOP 221 340#define KEY_SHOP 221
333#define KEY_ALTERASE 222 341#define KEY_ALTERASE 222
334#define KEY_CANCEL 223 342#define KEY_CANCEL 223 /* AC Cancel */
335#define KEY_BRIGHTNESSDOWN 224 343#define KEY_BRIGHTNESSDOWN 224
336#define KEY_BRIGHTNESSUP 225 344#define KEY_BRIGHTNESSUP 225
337#define KEY_MEDIA 226 345#define KEY_MEDIA 226
@@ -341,10 +349,10 @@ struct input_absinfo {
341#define KEY_KBDILLUMDOWN 229 349#define KEY_KBDILLUMDOWN 229
342#define KEY_KBDILLUMUP 230 350#define KEY_KBDILLUMUP 230
343 351
344#define KEY_SEND 231 352#define KEY_SEND 231 /* AC Send */
345#define KEY_REPLY 232 353#define KEY_REPLY 232 /* AC Reply */
346#define KEY_FORWARDMAIL 233 354#define KEY_FORWARDMAIL 233 /* AC Forward Msg */
347#define KEY_SAVE 234 355#define KEY_SAVE 234 /* AC Save */
348#define KEY_DOCUMENTS 235 356#define KEY_DOCUMENTS 235
349 357
350#define KEY_BATTERY 236 358#define KEY_BATTERY 236
@@ -433,15 +441,15 @@ struct input_absinfo {
433#define KEY_CLEAR 0x163 441#define KEY_CLEAR 0x163
434#define KEY_POWER2 0x164 442#define KEY_POWER2 0x164
435#define KEY_OPTION 0x165 443#define KEY_OPTION 0x165
436#define KEY_INFO 0x166 444#define KEY_INFO 0x166 /* AL OEM Features/Tips/Tutorial */
437#define KEY_TIME 0x167 445#define KEY_TIME 0x167
438#define KEY_VENDOR 0x168 446#define KEY_VENDOR 0x168
439#define KEY_ARCHIVE 0x169 447#define KEY_ARCHIVE 0x169
440#define KEY_PROGRAM 0x16a 448#define KEY_PROGRAM 0x16a /* Media Select Program Guide */
441#define KEY_CHANNEL 0x16b 449#define KEY_CHANNEL 0x16b
442#define KEY_FAVORITES 0x16c 450#define KEY_FAVORITES 0x16c
443#define KEY_EPG 0x16d 451#define KEY_EPG 0x16d
444#define KEY_PVR 0x16e 452#define KEY_PVR 0x16e /* Media Select Home */
445#define KEY_MHP 0x16f 453#define KEY_MHP 0x16f
446#define KEY_LANGUAGE 0x170 454#define KEY_LANGUAGE 0x170
447#define KEY_TITLE 0x171 455#define KEY_TITLE 0x171
@@ -451,36 +459,36 @@ struct input_absinfo {
451#define KEY_MODE 0x175 459#define KEY_MODE 0x175
452#define KEY_KEYBOARD 0x176 460#define KEY_KEYBOARD 0x176
453#define KEY_SCREEN 0x177 461#define KEY_SCREEN 0x177
454#define KEY_PC 0x178 462#define KEY_PC 0x178 /* Media Select Computer */
455#define KEY_TV 0x179 463#define KEY_TV 0x179 /* Media Select TV */
456#define KEY_TV2 0x17a 464#define KEY_TV2 0x17a /* Media Select Cable */
457#define KEY_VCR 0x17b 465#define KEY_VCR 0x17b /* Media Select VCR */
458#define KEY_VCR2 0x17c 466#define KEY_VCR2 0x17c /* VCR Plus */
459#define KEY_SAT 0x17d 467#define KEY_SAT 0x17d /* Media Select Satellite */
460#define KEY_SAT2 0x17e 468#define KEY_SAT2 0x17e
461#define KEY_CD 0x17f 469#define KEY_CD 0x17f /* Media Select CD */
462#define KEY_TAPE 0x180 470#define KEY_TAPE 0x180 /* Media Select Tape */
463#define KEY_RADIO 0x181 471#define KEY_RADIO 0x181
464#define KEY_TUNER 0x182 472#define KEY_TUNER 0x182 /* Media Select Tuner */
465#define KEY_PLAYER 0x183 473#define KEY_PLAYER 0x183
466#define KEY_TEXT 0x184 474#define KEY_TEXT 0x184
467#define KEY_DVD 0x185 475#define KEY_DVD 0x185 /* Media Select DVD */
468#define KEY_AUX 0x186 476#define KEY_AUX 0x186
469#define KEY_MP3 0x187 477#define KEY_MP3 0x187
470#define KEY_AUDIO 0x188 478#define KEY_AUDIO 0x188
471#define KEY_VIDEO 0x189 479#define KEY_VIDEO 0x189
472#define KEY_DIRECTORY 0x18a 480#define KEY_DIRECTORY 0x18a
473#define KEY_LIST 0x18b 481#define KEY_LIST 0x18b
474#define KEY_MEMO 0x18c 482#define KEY_MEMO 0x18c /* Media Select Messages */
475#define KEY_CALENDAR 0x18d 483#define KEY_CALENDAR 0x18d
476#define KEY_RED 0x18e 484#define KEY_RED 0x18e
477#define KEY_GREEN 0x18f 485#define KEY_GREEN 0x18f
478#define KEY_YELLOW 0x190 486#define KEY_YELLOW 0x190
479#define KEY_BLUE 0x191 487#define KEY_BLUE 0x191
480#define KEY_CHANNELUP 0x192 488#define KEY_CHANNELUP 0x192 /* Channel Increment */
481#define KEY_CHANNELDOWN 0x193 489#define KEY_CHANNELDOWN 0x193 /* Channel Decrement */
482#define KEY_FIRST 0x194 490#define KEY_FIRST 0x194
483#define KEY_LAST 0x195 491#define KEY_LAST 0x195 /* Recall Last */
484#define KEY_AB 0x196 492#define KEY_AB 0x196
485#define KEY_NEXT 0x197 493#define KEY_NEXT 0x197
486#define KEY_RESTART 0x198 494#define KEY_RESTART 0x198
@@ -491,21 +499,21 @@ struct input_absinfo {
491#define KEY_DIGITS 0x19d 499#define KEY_DIGITS 0x19d
492#define KEY_TEEN 0x19e 500#define KEY_TEEN 0x19e
493#define KEY_TWEN 0x19f 501#define KEY_TWEN 0x19f
494#define KEY_VIDEOPHONE 0x1a0 502#define KEY_VIDEOPHONE 0x1a0 /* Media Select Video Phone */
495#define KEY_GAMES 0x1a1 503#define KEY_GAMES 0x1a1 /* Media Select Games */
496#define KEY_ZOOMIN 0x1a2 504#define KEY_ZOOMIN 0x1a2 /* AC Zoom In */
497#define KEY_ZOOMOUT 0x1a3 505#define KEY_ZOOMOUT 0x1a3 /* AC Zoom Out */
498#define KEY_ZOOMRESET 0x1a4 506#define KEY_ZOOMRESET 0x1a4 /* AC Zoom */
499#define KEY_WORDPROCESSOR 0x1a5 507#define KEY_WORDPROCESSOR 0x1a5 /* AL Word Processor */
500#define KEY_EDITOR 0x1a6 508#define KEY_EDITOR 0x1a6 /* AL Text Editor */
501#define KEY_SPREADSHEET 0x1a7 509#define KEY_SPREADSHEET 0x1a7 /* AL Spreadsheet */
502#define KEY_GRAPHICSEDITOR 0x1a8 510#define KEY_GRAPHICSEDITOR 0x1a8 /* AL Graphics Editor */
503#define KEY_PRESENTATION 0x1a9 511#define KEY_PRESENTATION 0x1a9 /* AL Presentation App */
504#define KEY_DATABASE 0x1aa 512#define KEY_DATABASE 0x1aa /* AL Database App */
505#define KEY_NEWS 0x1ab 513#define KEY_NEWS 0x1ab /* AL Newsreader */
506#define KEY_VOICEMAIL 0x1ac 514#define KEY_VOICEMAIL 0x1ac /* AL Voicemail */
507#define KEY_ADDRESSBOOK 0x1ad 515#define KEY_ADDRESSBOOK 0x1ad /* AL Contacts/Address Book */
508#define KEY_MESSENGER 0x1ae 516#define KEY_MESSENGER 0x1ae /* AL Instant Messaging */
509#define KEY_DISPLAYTOGGLE 0x1af /* Turn display (LCD) on and off */ 517#define KEY_DISPLAYTOGGLE 0x1af /* Turn display (LCD) on and off */
510 518
511#define KEY_DEL_EOL 0x1c0 519#define KEY_DEL_EOL 0x1c0
@@ -603,6 +611,7 @@ struct input_absinfo {
603#define SW_LID 0x00 /* set = lid shut */ 611#define SW_LID 0x00 /* set = lid shut */
604#define SW_TABLET_MODE 0x01 /* set = tablet mode */ 612#define SW_TABLET_MODE 0x01 /* set = tablet mode */
605#define SW_HEADPHONE_INSERT 0x02 /* set = inserted */ 613#define SW_HEADPHONE_INSERT 0x02 /* set = inserted */
614#define SW_RADIO 0x03 /* set = radio enabled */
606#define SW_MAX 0x0f 615#define SW_MAX 0x0f
607 616
608/* 617/*
@@ -972,15 +981,15 @@ struct input_dev {
972 struct mutex mutex; /* serializes open and close operations */ 981 struct mutex mutex; /* serializes open and close operations */
973 unsigned int users; 982 unsigned int users;
974 983
975 struct class_device cdev; 984 struct device dev;
976 union { /* temporarily so while we switching to struct device */ 985 union { /* temporarily so while we switching to struct device */
977 struct device *parent; 986 struct device *dev;
978 } dev; 987 } cdev;
979 988
980 struct list_head h_list; 989 struct list_head h_list;
981 struct list_head node; 990 struct list_head node;
982}; 991};
983#define to_input_dev(d) container_of(d, struct input_dev, cdev) 992#define to_input_dev(d) container_of(d, struct input_dev, dev)
984 993
985/* 994/*
986 * Verify that we are in sync with input_device_id mod_devicetable.h #defines 995 * Verify that we are in sync with input_device_id mod_devicetable.h #defines
@@ -1087,22 +1096,22 @@ struct input_handle {
1087 struct list_head h_node; 1096 struct list_head h_node;
1088}; 1097};
1089 1098
1090#define to_dev(n) container_of(n,struct input_dev,node) 1099#define to_dev(n) container_of(n, struct input_dev, node)
1091#define to_handler(n) container_of(n,struct input_handler,node) 1100#define to_handler(n) container_of(n, struct input_handler, node)
1092#define to_handle(n) container_of(n,struct input_handle,d_node) 1101#define to_handle(n) container_of(n, struct input_handle, d_node)
1093#define to_handle_h(n) container_of(n,struct input_handle,h_node) 1102#define to_handle_h(n) container_of(n, struct input_handle, h_node)
1094 1103
1095struct input_dev *input_allocate_device(void); 1104struct input_dev *input_allocate_device(void);
1096void input_free_device(struct input_dev *dev); 1105void input_free_device(struct input_dev *dev);
1097 1106
1098static inline struct input_dev *input_get_device(struct input_dev *dev) 1107static inline struct input_dev *input_get_device(struct input_dev *dev)
1099{ 1108{
1100 return to_input_dev(class_device_get(&dev->cdev)); 1109 return to_input_dev(get_device(&dev->dev));
1101} 1110}
1102 1111
1103static inline void input_put_device(struct input_dev *dev) 1112static inline void input_put_device(struct input_dev *dev)
1104{ 1113{
1105 class_device_put(&dev->cdev); 1114 put_device(&dev->dev);
1106} 1115}
1107 1116
1108static inline void *input_get_drvdata(struct input_dev *dev) 1117static inline void *input_get_drvdata(struct input_dev *dev)
diff --git a/include/linux/io.h b/include/linux/io.h
index 8423dd376514..e3b2dda6c8eb 100644
--- a/include/linux/io.h
+++ b/include/linux/io.h
@@ -63,32 +63,7 @@ void __iomem * devm_ioremap(struct device *dev, unsigned long offset,
63void __iomem * devm_ioremap_nocache(struct device *dev, unsigned long offset, 63void __iomem * devm_ioremap_nocache(struct device *dev, unsigned long offset,
64 unsigned long size); 64 unsigned long size);
65void devm_iounmap(struct device *dev, void __iomem *addr); 65void devm_iounmap(struct device *dev, void __iomem *addr);
66 66int check_signature(const volatile void __iomem *io_addr,
67/** 67 const unsigned char *signature, int length);
68 * check_signature - find BIOS signatures
69 * @io_addr: mmio address to check
70 * @signature: signature block
71 * @length: length of signature
72 *
73 * Perform a signature comparison with the mmio address io_addr. This
74 * address should have been obtained by ioremap.
75 * Returns 1 on a match.
76 */
77
78static inline int check_signature(const volatile void __iomem *io_addr,
79 const unsigned char *signature, int length)
80{
81 int retval = 0;
82 do {
83 if (readb(io_addr) != *signature)
84 goto out;
85 io_addr++;
86 signature++;
87 length--;
88 } while (length);
89 retval = 1;
90out:
91 return retval;
92}
93 68
94#endif /* _LINUX_IO_H */ 69#endif /* _LINUX_IO_H */
diff --git a/include/linux/ioprio.h b/include/linux/ioprio.h
index 8e2042b9d471..2eaa142cd061 100644
--- a/include/linux/ioprio.h
+++ b/include/linux/ioprio.h
@@ -47,8 +47,10 @@ enum {
47#define IOPRIO_NORM (4) 47#define IOPRIO_NORM (4)
48static inline int task_ioprio(struct task_struct *task) 48static inline int task_ioprio(struct task_struct *task)
49{ 49{
50 WARN_ON(!ioprio_valid(task->ioprio)); 50 if (ioprio_valid(task->ioprio))
51 return IOPRIO_PRIO_DATA(task->ioprio); 51 return IOPRIO_PRIO_DATA(task->ioprio);
52
53 return IOPRIO_NORM;
52} 54}
53 55
54static inline int task_nice_ioprio(struct task_struct *task) 56static inline int task_nice_ioprio(struct task_struct *task)
diff --git a/include/linux/ip_mp_alg.h b/include/linux/ip_mp_alg.h
deleted file mode 100644
index e234e2008f5d..000000000000
--- a/include/linux/ip_mp_alg.h
+++ /dev/null
@@ -1,22 +0,0 @@
1/* ip_mp_alg.h: IPV4 multipath algorithm support, user-visible values.
2 *
3 * Copyright (C) 2004, 2005 Einar Lueck <elueck@de.ibm.com>
4 * Copyright (C) 2005 David S. Miller <davem@davemloft.net>
5 */
6
7#ifndef _LINUX_IP_MP_ALG_H
8#define _LINUX_IP_MP_ALG_H
9
10enum ip_mp_alg {
11 IP_MP_ALG_NONE,
12 IP_MP_ALG_RR,
13 IP_MP_ALG_DRR,
14 IP_MP_ALG_RANDOM,
15 IP_MP_ALG_WRANDOM,
16 __IP_MP_ALG_MAX
17};
18
19#define IP_MP_ALG_MAX (__IP_MP_ALG_MAX - 1)
20
21#endif /* _LINUX_IP_MP_ALG_H */
22
diff --git a/include/linux/ipc.h b/include/linux/ipc.h
index 1980867a64a4..3fd3ddd5f0d9 100644
--- a/include/linux/ipc.h
+++ b/include/linux/ipc.h
@@ -52,6 +52,7 @@ struct ipc_perm
52#ifdef __KERNEL__ 52#ifdef __KERNEL__
53 53
54#include <linux/kref.h> 54#include <linux/kref.h>
55#include <linux/spinlock.h>
55 56
56#define IPCMNI 32768 /* <= MAX_INT limit for ipc arrays (including sysctl changes) */ 57#define IPCMNI 32768 /* <= MAX_INT limit for ipc arrays (including sysctl changes) */
57 58
@@ -92,6 +93,7 @@ extern struct ipc_namespace init_ipc_ns;
92 93
93#ifdef CONFIG_SYSVIPC 94#ifdef CONFIG_SYSVIPC
94#define INIT_IPC_NS(ns) .ns = &init_ipc_ns, 95#define INIT_IPC_NS(ns) .ns = &init_ipc_ns,
96extern void free_ipc_ns(struct kref *kref);
95extern struct ipc_namespace *copy_ipcs(unsigned long flags, 97extern struct ipc_namespace *copy_ipcs(unsigned long flags,
96 struct ipc_namespace *ns); 98 struct ipc_namespace *ns);
97#else 99#else
@@ -103,13 +105,9 @@ static inline struct ipc_namespace *copy_ipcs(unsigned long flags,
103} 105}
104#endif 106#endif
105 107
106#ifdef CONFIG_IPC_NS
107extern void free_ipc_ns(struct kref *kref);
108#endif
109
110static inline struct ipc_namespace *get_ipc_ns(struct ipc_namespace *ns) 108static inline struct ipc_namespace *get_ipc_ns(struct ipc_namespace *ns)
111{ 109{
112#ifdef CONFIG_IPC_NS 110#ifdef CONFIG_SYSVIPC
113 if (ns) 111 if (ns)
114 kref_get(&ns->kref); 112 kref_get(&ns->kref);
115#endif 113#endif
@@ -118,7 +116,7 @@ static inline struct ipc_namespace *get_ipc_ns(struct ipc_namespace *ns)
118 116
119static inline void put_ipc_ns(struct ipc_namespace *ns) 117static inline void put_ipc_ns(struct ipc_namespace *ns)
120{ 118{
121#ifdef CONFIG_IPC_NS 119#ifdef CONFIG_SYSVIPC
122 kref_put(&ns->kref, free_ipc_ns); 120 kref_put(&ns->kref, free_ipc_ns);
123#endif 121#endif
124} 122}
@@ -126,5 +124,3 @@ static inline void put_ipc_ns(struct ipc_namespace *ns)
126#endif /* __KERNEL__ */ 124#endif /* __KERNEL__ */
127 125
128#endif /* _LINUX_IPC_H */ 126#endif /* _LINUX_IPC_H */
129
130
diff --git a/include/linux/ipv6.h b/include/linux/ipv6.h
index 648bd1f0912d..97983dc9df13 100644
--- a/include/linux/ipv6.h
+++ b/include/linux/ipv6.h
@@ -27,8 +27,8 @@ struct in6_ifreq {
27 int ifr6_ifindex; 27 int ifr6_ifindex;
28}; 28};
29 29
30#define IPV6_SRCRT_STRICT 0x01 /* this hop must be a neighbor */ 30#define IPV6_SRCRT_STRICT 0x01 /* Deprecated; will be removed */
31#define IPV6_SRCRT_TYPE_0 0 /* IPv6 type 0 Routing Header */ 31#define IPV6_SRCRT_TYPE_0 0 /* Deprecated; will be removed */
32#define IPV6_SRCRT_TYPE_2 2 /* IPv6 type 2 Routing Header */ 32#define IPV6_SRCRT_TYPE_2 2 /* IPv6 type 2 Routing Header */
33 33
34/* 34/*
@@ -247,7 +247,7 @@ struct inet6_skb_parm {
247 __u16 lastopt; 247 __u16 lastopt;
248 __u32 nhoff; 248 __u32 nhoff;
249 __u16 flags; 249 __u16 flags;
250#ifdef CONFIG_IPV6_MIP6 250#if defined(CONFIG_IPV6_MIP6) || defined(CONFIG_IPV6_MIP6_MODULE)
251 __u16 dsthao; 251 __u16 dsthao;
252#endif 252#endif
253 253
@@ -299,8 +299,8 @@ struct ipv6_pinfo {
299 /* pktoption flags */ 299 /* pktoption flags */
300 union { 300 union {
301 struct { 301 struct {
302 __u16 srcrt:2, 302 __u16 srcrt:1,
303 osrcrt:2, 303 osrcrt:1,
304 rxinfo:1, 304 rxinfo:1,
305 rxoinfo:1, 305 rxoinfo:1,
306 rxhlim:1, 306 rxhlim:1,
diff --git a/include/linux/irda.h b/include/linux/irda.h
index 945ba3110874..8e3735714c1c 100644
--- a/include/linux/irda.h
+++ b/include/linux/irda.h
@@ -216,6 +216,34 @@ struct if_irda_req {
216#define ifr_dtr ifr_ifru.ifru_line.dtr 216#define ifr_dtr ifr_ifru.ifru_line.dtr
217#define ifr_rts ifr_ifru.ifru_line.rts 217#define ifr_rts ifr_ifru.ifru_line.rts
218 218
219
220/* IrDA netlink definitions */
221#define IRDA_NL_NAME "irda"
222#define IRDA_NL_VERSION 1
223
224enum irda_nl_commands {
225 IRDA_NL_CMD_UNSPEC,
226 IRDA_NL_CMD_SET_MODE,
227 IRDA_NL_CMD_GET_MODE,
228
229 __IRDA_NL_CMD_AFTER_LAST
230};
231#define IRDA_NL_CMD_MAX (__IRDA_NL_CMD_AFTER_LAST - 1)
232
233enum nl80211_attrs {
234 IRDA_NL_ATTR_UNSPEC,
235 IRDA_NL_ATTR_IFNAME,
236 IRDA_NL_ATTR_MODE,
237
238 __IRDA_NL_ATTR_AFTER_LAST
239};
240#define IRDA_NL_ATTR_MAX (__IRDA_NL_ATTR_AFTER_LAST - 1)
241
242/* IrDA modes */
243#define IRDA_MODE_PRIMARY 0x1
244#define IRDA_MODE_SECONDARY 0x2
245#define IRDA_MODE_MONITOR 0x4
246
219#endif /* KERNEL_IRDA_H */ 247#endif /* KERNEL_IRDA_H */
220 248
221 249
diff --git a/include/linux/irq.h b/include/linux/irq.h
index 1695054e8c63..44657197fcb0 100644
--- a/include/linux/irq.h
+++ b/include/linux/irq.h
@@ -161,6 +161,7 @@ struct irq_desc {
161 unsigned int wake_depth; /* nested wake enables */ 161 unsigned int wake_depth; /* nested wake enables */
162 unsigned int irq_count; /* For detecting broken IRQs */ 162 unsigned int irq_count; /* For detecting broken IRQs */
163 unsigned int irqs_unhandled; 163 unsigned int irqs_unhandled;
164 unsigned long last_unhandled; /* Aging timer for unhandled count */
164 spinlock_t lock; 165 spinlock_t lock;
165#ifdef CONFIG_SMP 166#ifdef CONFIG_SMP
166 cpumask_t affinity; 167 cpumask_t affinity;
diff --git a/include/linux/jbd2.h b/include/linux/jbd2.h
index 0e0fedd2039a..260d6d76c5f3 100644
--- a/include/linux/jbd2.h
+++ b/include/linux/jbd2.h
@@ -50,14 +50,14 @@
50 */ 50 */
51#define JBD_DEFAULT_MAX_COMMIT_AGE 5 51#define JBD_DEFAULT_MAX_COMMIT_AGE 5
52 52
53#ifdef CONFIG_JBD_DEBUG 53#ifdef CONFIG_JBD2_DEBUG
54/* 54/*
55 * Define JBD_EXPENSIVE_CHECKING to enable more expensive internal 55 * Define JBD_EXPENSIVE_CHECKING to enable more expensive internal
56 * consistency checks. By default we don't do this unless 56 * consistency checks. By default we don't do this unless
57 * CONFIG_JBD_DEBUG is on. 57 * CONFIG_JBD2_DEBUG is on.
58 */ 58 */
59#define JBD_EXPENSIVE_CHECKING 59#define JBD_EXPENSIVE_CHECKING
60extern int jbd2_journal_enable_debug; 60extern u8 jbd2_journal_enable_debug;
61 61
62#define jbd_debug(n, f, a...) \ 62#define jbd_debug(n, f, a...) \
63 do { \ 63 do { \
diff --git a/include/linux/kallsyms.h b/include/linux/kallsyms.h
index 12178d2c882b..f73de6fb5c68 100644
--- a/include/linux/kallsyms.h
+++ b/include/linux/kallsyms.h
@@ -5,10 +5,11 @@
5#ifndef _LINUX_KALLSYMS_H 5#ifndef _LINUX_KALLSYMS_H
6#define _LINUX_KALLSYMS_H 6#define _LINUX_KALLSYMS_H
7 7
8#include <linux/errno.h>
8 9
9#define KSYM_NAME_LEN 127 10#define KSYM_NAME_LEN 128
10#define KSYM_SYMBOL_LEN (sizeof("%s+%#lx/%#lx [%s]") + KSYM_NAME_LEN + \ 11#define KSYM_SYMBOL_LEN (sizeof("%s+%#lx/%#lx [%s]") + (KSYM_NAME_LEN - 1) + \
11 2*(BITS_PER_LONG*3/10) + MODULE_NAME_LEN + 1) 12 2*(BITS_PER_LONG*3/10) + (MODULE_NAME_LEN - 1) + 1)
12 13
13#ifdef CONFIG_KALLSYMS 14#ifdef CONFIG_KALLSYMS
14/* Lookup the address for a symbol. Returns 0 if not found. */ 15/* Lookup the address for a symbol. Returns 0 if not found. */
diff --git a/include/linux/kernel.h b/include/linux/kernel.h
index 7a4852505914..1eb9cde550c4 100644
--- a/include/linux/kernel.h
+++ b/include/linux/kernel.h
@@ -210,6 +210,7 @@ extern enum system_states {
210#define TAINT_MACHINE_CHECK (1<<4) 210#define TAINT_MACHINE_CHECK (1<<4)
211#define TAINT_BAD_PAGE (1<<5) 211#define TAINT_BAD_PAGE (1<<5)
212#define TAINT_USER (1<<6) 212#define TAINT_USER (1<<6)
213#define TAINT_DIE (1<<7)
213 214
214extern void dump_stack(void); 215extern void dump_stack(void);
215 216
diff --git a/include/linux/kernelcapi.h b/include/linux/kernelcapi.h
index aea34e74c496..8c4350a9ed87 100644
--- a/include/linux/kernelcapi.h
+++ b/include/linux/kernelcapi.h
@@ -64,7 +64,7 @@ struct capi20_appl {
64 unsigned long nrecvdatapkt; 64 unsigned long nrecvdatapkt;
65 unsigned long nsentctlpkt; 65 unsigned long nsentctlpkt;
66 unsigned long nsentdatapkt; 66 unsigned long nsentdatapkt;
67 struct semaphore recv_sem; 67 struct mutex recv_mtx;
68 struct sk_buff_head recv_queue; 68 struct sk_buff_head recv_queue;
69 struct work_struct recv_work; 69 struct work_struct recv_work;
70 int release_in_progress; 70 int release_in_progress;
diff --git a/include/linux/kmod.h b/include/linux/kmod.h
index 10f505c8431d..5dc13848891b 100644
--- a/include/linux/kmod.h
+++ b/include/linux/kmod.h
@@ -36,13 +36,57 @@ static inline int request_module(const char * name, ...) { return -ENOSYS; }
36#define try_then_request_module(x, mod...) ((x) ?: (request_module(mod), (x))) 36#define try_then_request_module(x, mod...) ((x) ?: (request_module(mod), (x)))
37 37
38struct key; 38struct key;
39extern int call_usermodehelper_keys(char *path, char *argv[], char *envp[], 39struct file;
40 struct key *session_keyring, int wait); 40struct subprocess_info;
41
42/* Allocate a subprocess_info structure */
43struct subprocess_info *call_usermodehelper_setup(char *path,
44 char **argv, char **envp);
45
46/* Set various pieces of state into the subprocess_info structure */
47void call_usermodehelper_setkeys(struct subprocess_info *info,
48 struct key *session_keyring);
49int call_usermodehelper_stdinpipe(struct subprocess_info *sub_info,
50 struct file **filp);
51void call_usermodehelper_setcleanup(struct subprocess_info *info,
52 void (*cleanup)(char **argv, char **envp));
53
54enum umh_wait {
55 UMH_NO_WAIT = -1, /* don't wait at all */
56 UMH_WAIT_EXEC = 0, /* wait for the exec, but not the process */
57 UMH_WAIT_PROC = 1, /* wait for the process to complete */
58};
59
60/* Actually execute the sub-process */
61int call_usermodehelper_exec(struct subprocess_info *info, enum umh_wait wait);
62
63/* Free the subprocess_info. This is only needed if you're not going
64 to call call_usermodehelper_exec */
65void call_usermodehelper_freeinfo(struct subprocess_info *info);
41 66
42static inline int 67static inline int
43call_usermodehelper(char *path, char **argv, char **envp, int wait) 68call_usermodehelper(char *path, char **argv, char **envp, enum umh_wait wait)
44{ 69{
45 return call_usermodehelper_keys(path, argv, envp, NULL, wait); 70 struct subprocess_info *info;
71
72 info = call_usermodehelper_setup(path, argv, envp);
73 if (info == NULL)
74 return -ENOMEM;
75 return call_usermodehelper_exec(info, wait);
76}
77
78static inline int
79call_usermodehelper_keys(char *path, char **argv, char **envp,
80 struct key *session_keyring, enum umh_wait wait)
81{
82 struct subprocess_info *info;
83
84 info = call_usermodehelper_setup(path, argv, envp);
85 if (info == NULL)
86 return -ENOMEM;
87
88 call_usermodehelper_setkeys(info, session_keyring);
89 return call_usermodehelper_exec(info, wait);
46} 90}
47 91
48extern void usermodehelper_init(void); 92extern void usermodehelper_init(void);
diff --git a/include/linux/kobject.h b/include/linux/kobject.h
index c288e41ba331..06cbf41d32d2 100644
--- a/include/linux/kobject.h
+++ b/include/linux/kobject.h
@@ -55,7 +55,7 @@ struct kobject {
55 struct kobject * parent; 55 struct kobject * parent;
56 struct kset * kset; 56 struct kset * kset;
57 struct kobj_type * ktype; 57 struct kobj_type * ktype;
58 struct dentry * dentry; 58 struct sysfs_dirent * sd;
59 wait_queue_head_t poll; 59 wait_queue_head_t poll;
60}; 60};
61 61
@@ -71,13 +71,14 @@ extern void kobject_init(struct kobject *);
71extern void kobject_cleanup(struct kobject *); 71extern void kobject_cleanup(struct kobject *);
72 72
73extern int __must_check kobject_add(struct kobject *); 73extern int __must_check kobject_add(struct kobject *);
74extern int __must_check kobject_shadow_add(struct kobject *, struct dentry *); 74extern int __must_check kobject_shadow_add(struct kobject *kobj,
75 struct sysfs_dirent *shadow_parent);
75extern void kobject_del(struct kobject *); 76extern void kobject_del(struct kobject *);
76 77
77extern int __must_check kobject_rename(struct kobject *, const char *new_name); 78extern int __must_check kobject_rename(struct kobject *, const char *new_name);
78extern int __must_check kobject_shadow_rename(struct kobject *kobj, 79extern int __must_check kobject_shadow_rename(struct kobject *kobj,
79 struct dentry *new_parent, 80 struct sysfs_dirent *new_parent,
80 const char *new_name); 81 const char *new_name);
81extern int __must_check kobject_move(struct kobject *, struct kobject *); 82extern int __must_check kobject_move(struct kobject *, struct kobject *);
82 83
83extern int __must_check kobject_register(struct kobject *); 84extern int __must_check kobject_register(struct kobject *);
diff --git a/include/linux/ktime.h b/include/linux/ktime.h
index 2b139f66027f..dae7143644fe 100644
--- a/include/linux/ktime.h
+++ b/include/linux/ktime.h
@@ -279,6 +279,16 @@ static inline s64 ktime_to_us(const ktime_t kt)
279 return (s64) tv.tv_sec * USEC_PER_SEC + tv.tv_usec; 279 return (s64) tv.tv_sec * USEC_PER_SEC + tv.tv_usec;
280} 280}
281 281
282static inline s64 ktime_us_delta(const ktime_t later, const ktime_t earlier)
283{
284 return ktime_to_us(ktime_sub(later, earlier));
285}
286
287static inline ktime_t ktime_add_us(const ktime_t kt, const u64 usec)
288{
289 return ktime_add_ns(kt, usec * 1000);
290}
291
282/* 292/*
283 * The resolution of the clocks. The resolution value is returned in 293 * The resolution of the clocks. The resolution value is returned in
284 * the clock_getres() system call to give application programmers an 294 * the clock_getres() system call to give application programmers an
diff --git a/include/linux/leds.h b/include/linux/leds.h
index 88afceffb7cb..494bed7c2fc1 100644
--- a/include/linux/leds.h
+++ b/include/linux/leds.h
@@ -13,7 +13,6 @@
13#define __LINUX_LEDS_H_INCLUDED 13#define __LINUX_LEDS_H_INCLUDED
14 14
15#include <linux/list.h> 15#include <linux/list.h>
16#include <linux/spinlock.h>
17 16
18struct device; 17struct device;
19struct class_device; 18struct class_device;
diff --git a/include/linux/libata.h b/include/linux/libata.h
index 745c4f9b4caa..47cd2a1c5544 100644
--- a/include/linux/libata.h
+++ b/include/linux/libata.h
@@ -116,6 +116,7 @@ static inline struct device *pci_dev_to_dev(struct pci_dev *pdev)
116enum { 116enum {
117 /* various global constants */ 117 /* various global constants */
118 LIBATA_MAX_PRD = ATA_MAX_PRD / 2, 118 LIBATA_MAX_PRD = ATA_MAX_PRD / 2,
119 LIBATA_DUMB_MAX_PRD = ATA_MAX_PRD / 4, /* Worst case */
119 ATA_MAX_PORTS = 8, 120 ATA_MAX_PORTS = 8,
120 ATA_DEF_QUEUE = 1, 121 ATA_DEF_QUEUE = 1,
121 /* tag ATA_MAX_QUEUE - 1 is reserved for internal commands */ 122 /* tag ATA_MAX_QUEUE - 1 is reserved for internal commands */
@@ -136,6 +137,8 @@ enum {
136 ATA_DFLAG_CDB_INTR = (1 << 2), /* device asserts INTRQ when ready for CDB */ 137 ATA_DFLAG_CDB_INTR = (1 << 2), /* device asserts INTRQ when ready for CDB */
137 ATA_DFLAG_NCQ = (1 << 3), /* device supports NCQ */ 138 ATA_DFLAG_NCQ = (1 << 3), /* device supports NCQ */
138 ATA_DFLAG_FLUSH_EXT = (1 << 4), /* do FLUSH_EXT instead of FLUSH */ 139 ATA_DFLAG_FLUSH_EXT = (1 << 4), /* do FLUSH_EXT instead of FLUSH */
140 ATA_DFLAG_ACPI_PENDING = (1 << 5), /* ACPI resume action pending */
141 ATA_DFLAG_ACPI_FAILED = (1 << 6), /* ACPI on devcfg has failed */
139 ATA_DFLAG_CFG_MASK = (1 << 8) - 1, 142 ATA_DFLAG_CFG_MASK = (1 << 8) - 1,
140 143
141 ATA_DFLAG_PIO = (1 << 8), /* device limited to PIO mode */ 144 ATA_DFLAG_PIO = (1 << 8), /* device limited to PIO mode */
@@ -193,9 +196,9 @@ enum {
193 ATA_PFLAG_SCSI_HOTPLUG = (1 << 6), /* SCSI hotplug scheduled */ 196 ATA_PFLAG_SCSI_HOTPLUG = (1 << 6), /* SCSI hotplug scheduled */
194 ATA_PFLAG_INITIALIZING = (1 << 7), /* being initialized, don't touch */ 197 ATA_PFLAG_INITIALIZING = (1 << 7), /* being initialized, don't touch */
195 198
196 ATA_PFLAG_FLUSH_PORT_TASK = (1 << 16), /* flush port task */
197 ATA_PFLAG_SUSPENDED = (1 << 17), /* port is suspended (power) */ 199 ATA_PFLAG_SUSPENDED = (1 << 17), /* port is suspended (power) */
198 ATA_PFLAG_PM_PENDING = (1 << 18), /* PM operation pending */ 200 ATA_PFLAG_PM_PENDING = (1 << 18), /* PM operation pending */
201 ATA_PFLAG_GTM_VALID = (1 << 19), /* acpi_gtm data valid */
199 202
200 /* struct ata_queued_cmd flags */ 203 /* struct ata_queued_cmd flags */
201 ATA_QCFLAG_ACTIVE = (1 << 0), /* cmd not yet ack'd to scsi lyer */ 204 ATA_QCFLAG_ACTIVE = (1 << 0), /* cmd not yet ack'd to scsi lyer */
@@ -298,7 +301,6 @@ enum {
298 ATA_HORKAGE_NODMA = (1 << 1), /* DMA problems */ 301 ATA_HORKAGE_NODMA = (1 << 1), /* DMA problems */
299 ATA_HORKAGE_NONCQ = (1 << 2), /* Don't use NCQ */ 302 ATA_HORKAGE_NONCQ = (1 << 2), /* Don't use NCQ */
300 ATA_HORKAGE_MAX_SEC_128 = (1 << 3), /* Limit max sects to 128 */ 303 ATA_HORKAGE_MAX_SEC_128 = (1 << 3), /* Limit max sects to 128 */
301 ATA_HORKAGE_DMA_RW_ONLY = (1 << 4), /* ATAPI DMA for RW only */
302}; 304};
303 305
304enum hsm_task_states { 306enum hsm_task_states {
@@ -364,6 +366,9 @@ struct ata_host {
364 void *private_data; 366 void *private_data;
365 const struct ata_port_operations *ops; 367 const struct ata_port_operations *ops;
366 unsigned long flags; 368 unsigned long flags;
369#ifdef CONFIG_ATA_ACPI
370 acpi_handle acpi_handle;
371#endif
367 struct ata_port *simplex_claimed; /* channel owning the DMA */ 372 struct ata_port *simplex_claimed; /* channel owning the DMA */
368 struct ata_port *ports[0]; 373 struct ata_port *ports[0];
369}; 374};
@@ -429,7 +434,11 @@ struct ata_device {
429 struct ata_port *ap; 434 struct ata_port *ap;
430 unsigned int devno; /* 0 or 1 */ 435 unsigned int devno; /* 0 or 1 */
431 unsigned long flags; /* ATA_DFLAG_xxx */ 436 unsigned long flags; /* ATA_DFLAG_xxx */
437 unsigned int horkage; /* List of broken features */
432 struct scsi_device *sdev; /* attached SCSI device */ 438 struct scsi_device *sdev; /* attached SCSI device */
439#ifdef CONFIG_ATA_ACPI
440 acpi_handle acpi_handle;
441#endif
433 /* n_sector is used as CLEAR_OFFSET, read comment above CLEAR_OFFSET */ 442 /* n_sector is used as CLEAR_OFFSET, read comment above CLEAR_OFFSET */
434 u64 n_sectors; /* size of device, if ATA */ 443 u64 n_sectors; /* size of device, if ATA */
435 unsigned int class; /* ATA_DEV_xxx */ 444 unsigned int class; /* ATA_DEV_xxx */
@@ -457,11 +466,6 @@ struct ata_device {
457 /* error history */ 466 /* error history */
458 struct ata_ering ering; 467 struct ata_ering ering;
459 int spdn_cnt; 468 int spdn_cnt;
460 unsigned int horkage; /* List of broken features */
461#ifdef CONFIG_ATA_ACPI
462 /* ACPI objects info */
463 acpi_handle obj_handle;
464#endif
465}; 469};
466 470
467/* Offset into struct ata_device. Fields above it are maintained 471/* Offset into struct ata_device. Fields above it are maintained
@@ -490,6 +494,17 @@ struct ata_eh_context {
490 unsigned int did_probe_mask; 494 unsigned int did_probe_mask;
491}; 495};
492 496
497struct ata_acpi_drive
498{
499 u32 pio;
500 u32 dma;
501} __packed;
502
503struct ata_acpi_gtm {
504 struct ata_acpi_drive drive[2];
505 u32 flags;
506} __packed;
507
493struct ata_port { 508struct ata_port {
494 struct Scsi_Host *scsi_host; /* our co-allocated scsi host */ 509 struct Scsi_Host *scsi_host; /* our co-allocated scsi host */
495 const struct ata_port_operations *ops; 510 const struct ata_port_operations *ops;
@@ -550,6 +565,10 @@ struct ata_port {
550 565
551 void *private_data; 566 void *private_data;
552 567
568#ifdef CONFIG_ATA_ACPI
569 acpi_handle acpi_handle;
570 struct ata_acpi_gtm acpi_gtm;
571#endif
553 u8 sector_buf[ATA_SECT_SIZE]; /* owned by EH */ 572 u8 sector_buf[ATA_SECT_SIZE]; /* owned by EH */
554}; 573};
555 574
@@ -759,6 +778,7 @@ extern void ata_data_xfer(struct ata_device *adev, unsigned char *buf,
759 unsigned int buflen, int write_data); 778 unsigned int buflen, int write_data);
760extern void ata_data_xfer_noirq(struct ata_device *adev, unsigned char *buf, 779extern void ata_data_xfer_noirq(struct ata_device *adev, unsigned char *buf,
761 unsigned int buflen, int write_data); 780 unsigned int buflen, int write_data);
781extern void ata_dumb_qc_prep(struct ata_queued_cmd *qc);
762extern void ata_qc_prep(struct ata_queued_cmd *qc); 782extern void ata_qc_prep(struct ata_queued_cmd *qc);
763extern void ata_noop_qc_prep(struct ata_queued_cmd *qc); 783extern void ata_noop_qc_prep(struct ata_queued_cmd *qc);
764extern unsigned int ata_qc_issue_prot(struct ata_queued_cmd *qc); 784extern unsigned int ata_qc_issue_prot(struct ata_queued_cmd *qc);
@@ -773,7 +793,6 @@ extern void ata_id_string(const u16 *id, unsigned char *s,
773extern void ata_id_c_string(const u16 *id, unsigned char *s, 793extern void ata_id_c_string(const u16 *id, unsigned char *s,
774 unsigned int ofs, unsigned int len); 794 unsigned int ofs, unsigned int len);
775extern void ata_id_to_dma_mode(struct ata_device *dev, u8 unknown); 795extern void ata_id_to_dma_mode(struct ata_device *dev, u8 unknown);
776extern unsigned long ata_device_blacklisted(const struct ata_device *dev);
777extern void ata_bmdma_setup (struct ata_queued_cmd *qc); 796extern void ata_bmdma_setup (struct ata_queued_cmd *qc);
778extern void ata_bmdma_start (struct ata_queued_cmd *qc); 797extern void ata_bmdma_start (struct ata_queued_cmd *qc);
779extern void ata_bmdma_stop(struct ata_queued_cmd *qc); 798extern void ata_bmdma_stop(struct ata_queued_cmd *qc);
@@ -850,11 +869,11 @@ struct pci_bits {
850 unsigned long val; 869 unsigned long val;
851}; 870};
852 871
853extern int ata_pci_init_native_host(struct ata_host *host); 872extern int ata_pci_init_sff_host(struct ata_host *host);
854extern int ata_pci_init_bmdma(struct ata_host *host); 873extern int ata_pci_init_bmdma(struct ata_host *host);
855extern int ata_pci_prepare_native_host(struct pci_dev *pdev, 874extern int ata_pci_prepare_sff_host(struct pci_dev *pdev,
856 const struct ata_port_info * const * ppi, 875 const struct ata_port_info * const * ppi,
857 struct ata_host **r_host); 876 struct ata_host **r_host);
858extern int pci_test_config_bits(struct pci_dev *pdev, const struct pci_bits *bits); 877extern int pci_test_config_bits(struct pci_dev *pdev, const struct pci_bits *bits);
859extern unsigned long ata_pci_default_filter(struct ata_device *, unsigned long); 878extern unsigned long ata_pci_default_filter(struct ata_device *, unsigned long);
860#endif /* CONFIG_PCI */ 879#endif /* CONFIG_PCI */
@@ -1088,11 +1107,9 @@ static inline u8 ata_wait_idle(struct ata_port *ap)
1088{ 1107{
1089 u8 status = ata_busy_wait(ap, ATA_BUSY | ATA_DRQ, 1000); 1108 u8 status = ata_busy_wait(ap, ATA_BUSY | ATA_DRQ, 1000);
1090 1109
1091 if (status != 0xff && (status & (ATA_BUSY | ATA_DRQ))) { 1110 if (status != 0xff && (status & (ATA_BUSY | ATA_DRQ)))
1092 if (ata_msg_warn(ap)) 1111 DPRINTK("ATA: abnormal status 0x%X on port 0x%p\n",
1093 printk(KERN_WARNING "ATA: abnormal status 0x%X on port 0x%p\n", 1112 status, ap->ioaddr.status_addr);
1094 status, ap->ioaddr.status_addr);
1095 }
1096 1113
1097 return status; 1114 return status;
1098} 1115}
diff --git a/include/linux/limits.h b/include/linux/limits.h
index eaf2e099f125..2d0f94162fb3 100644
--- a/include/linux/limits.h
+++ b/include/linux/limits.h
@@ -5,8 +5,6 @@
5 5
6#define NGROUPS_MAX 65536 /* supplemental group IDs are available */ 6#define NGROUPS_MAX 65536 /* supplemental group IDs are available */
7#define ARG_MAX 131072 /* # bytes of args + environ for exec() */ 7#define ARG_MAX 131072 /* # bytes of args + environ for exec() */
8#define CHILD_MAX 999 /* no limit :-) */
9#define OPEN_MAX 256 /* # open files a process may have */
10#define LINK_MAX 127 /* # links a file may have */ 8#define LINK_MAX 127 /* # links a file may have */
11#define MAX_CANON 255 /* size of the canonical input queue */ 9#define MAX_CANON 255 /* size of the canonical input queue */
12#define MAX_INPUT 255 /* size of the type-ahead buffer */ 10#define MAX_INPUT 255 /* size of the type-ahead buffer */
diff --git a/include/linux/linux_logo.h b/include/linux/linux_logo.h
index 9c01bde5bf1b..08a92969c76e 100644
--- a/include/linux/linux_logo.h
+++ b/include/linux/linux_logo.h
@@ -33,5 +33,13 @@ struct linux_logo {
33}; 33};
34 34
35extern const struct linux_logo *fb_find_logo(int depth); 35extern const struct linux_logo *fb_find_logo(int depth);
36#ifdef CONFIG_FB_LOGO_EXTRA
37extern void fb_append_extra_logo(const struct linux_logo *logo,
38 unsigned int n);
39#else
40static inline void fb_append_extra_logo(const struct linux_logo *logo,
41 unsigned int n)
42{}
43#endif
36 44
37#endif /* _LINUX_LINUX_LOGO_H */ 45#endif /* _LINUX_LINUX_LOGO_H */
diff --git a/include/linux/lockd/bind.h b/include/linux/lockd/bind.h
index 246de1d84a26..6f1637c61e10 100644
--- a/include/linux/lockd/bind.h
+++ b/include/linux/lockd/bind.h
@@ -27,6 +27,7 @@ struct nlmsvc_binding {
27 struct nfs_fh *, 27 struct nfs_fh *,
28 struct file **); 28 struct file **);
29 void (*fclose)(struct file *); 29 void (*fclose)(struct file *);
30 unsigned long (*get_grace_period)(void);
30}; 31};
31 32
32extern struct nlmsvc_binding * nlmsvc_ops; 33extern struct nlmsvc_binding * nlmsvc_ops;
@@ -38,4 +39,12 @@ extern int nlmclnt_proc(struct inode *, int, struct file_lock *);
38extern int lockd_up(int proto); 39extern int lockd_up(int proto);
39extern void lockd_down(void); 40extern void lockd_down(void);
40 41
42unsigned long get_nfs_grace_period(void);
43
44#ifdef CONFIG_NFSD_V4
45unsigned long get_nfs4_grace_period(void);
46#else
47static inline unsigned long get_nfs4_grace_period(void) {return 0;}
48#endif
49
41#endif /* LINUX_LOCKD_BIND_H */ 50#endif /* LINUX_LOCKD_BIND_H */
diff --git a/include/linux/lockd/lockd.h b/include/linux/lockd/lockd.h
index 05707e2fccae..e2d1ce36b367 100644
--- a/include/linux/lockd/lockd.h
+++ b/include/linux/lockd/lockd.h
@@ -39,6 +39,7 @@
39struct nlm_host { 39struct nlm_host {
40 struct hlist_node h_hash; /* doubly linked list */ 40 struct hlist_node h_hash; /* doubly linked list */
41 struct sockaddr_in h_addr; /* peer address */ 41 struct sockaddr_in h_addr; /* peer address */
42 struct sockaddr_in h_saddr; /* our address (optional) */
42 struct rpc_clnt * h_rpcclnt; /* RPC client to talk to peer */ 43 struct rpc_clnt * h_rpcclnt; /* RPC client to talk to peer */
43 char * h_name; /* remote hostname */ 44 char * h_name; /* remote hostname */
44 u32 h_version; /* interface version */ 45 u32 h_version; /* interface version */
diff --git a/include/linux/lzo.h b/include/linux/lzo.h
new file mode 100644
index 000000000000..d793497ec1ca
--- /dev/null
+++ b/include/linux/lzo.h
@@ -0,0 +1,44 @@
1#ifndef __LZO_H__
2#define __LZO_H__
3/*
4 * LZO Public Kernel Interface
5 * A mini subset of the LZO real-time data compression library
6 *
7 * Copyright (C) 1996-2005 Markus F.X.J. Oberhumer <markus@oberhumer.com>
8 *
9 * The full LZO package can be found at:
10 * http://www.oberhumer.com/opensource/lzo/
11 *
12 * Changed for kernel use by:
13 * Nitin Gupta <nitingupta910@gmail.com>
14 * Richard Purdie <rpurdie@openedhand.com>
15 */
16
17#define LZO1X_MEM_COMPRESS (16384 * sizeof(unsigned char *))
18#define LZO1X_1_MEM_COMPRESS LZO1X_MEM_COMPRESS
19
20#define lzo1x_worst_compress(x) ((x) + ((x) / 16) + 64 + 3)
21
22/* This requires 'workmem' of size LZO1X_1_MEM_COMPRESS */
23int lzo1x_1_compress(const unsigned char *src, size_t src_len,
24 unsigned char *dst, size_t *dst_len, void *wrkmem);
25
26/* safe decompression with overrun testing */
27int lzo1x_decompress_safe(const unsigned char *src, size_t src_len,
28 unsigned char *dst, size_t *dst_len);
29
30/*
31 * Return values (< 0 = Error)
32 */
33#define LZO_E_OK 0
34#define LZO_E_ERROR (-1)
35#define LZO_E_OUT_OF_MEMORY (-2)
36#define LZO_E_NOT_COMPRESSIBLE (-3)
37#define LZO_E_INPUT_OVERRUN (-4)
38#define LZO_E_OUTPUT_OVERRUN (-5)
39#define LZO_E_LOOKBEHIND_OVERRUN (-6)
40#define LZO_E_EOF_NOT_FOUND (-7)
41#define LZO_E_INPUT_NOT_CONSUMED (-8)
42#define LZO_E_NOT_YET_IMPLEMENTED (-9)
43
44#endif
diff --git a/include/linux/magic.h b/include/linux/magic.h
index 9d713c03e3da..36cc20dfd142 100644
--- a/include/linux/magic.h
+++ b/include/linux/magic.h
@@ -13,7 +13,6 @@
13#define HPFS_SUPER_MAGIC 0xf995e849 13#define HPFS_SUPER_MAGIC 0xf995e849
14#define ISOFS_SUPER_MAGIC 0x9660 14#define ISOFS_SUPER_MAGIC 0x9660
15#define JFFS2_SUPER_MAGIC 0x72b6 15#define JFFS2_SUPER_MAGIC 0x72b6
16#define KVMFS_SUPER_MAGIC 0x19700426
17#define ANON_INODE_FS_MAGIC 0x09041934 16#define ANON_INODE_FS_MAGIC 0x09041934
18 17
19#define MINIX_SUPER_MAGIC 0x137F /* original minix fs */ 18#define MINIX_SUPER_MAGIC 0x137F /* original minix fs */
diff --git a/include/linux/major.h b/include/linux/major.h
index 7e7c9093919a..0cb98053537a 100644
--- a/include/linux/major.h
+++ b/include/linux/major.h
@@ -158,6 +158,8 @@
158#define VXSPEC_MAJOR 200 /* VERITAS volume config driver */ 158#define VXSPEC_MAJOR 200 /* VERITAS volume config driver */
159#define VXDMP_MAJOR 201 /* VERITAS volume multipath driver */ 159#define VXDMP_MAJOR 201 /* VERITAS volume multipath driver */
160 160
161#define XENVBD_MAJOR 202 /* Xen virtual block device */
162
161#define MSR_MAJOR 202 163#define MSR_MAJOR 202
162#define CPUID_MAJOR 203 164#define CPUID_MAJOR 203
163 165
diff --git a/include/linux/mempolicy.h b/include/linux/mempolicy.h
index daabb3aa1ec6..e147cf50529f 100644
--- a/include/linux/mempolicy.h
+++ b/include/linux/mempolicy.h
@@ -159,7 +159,7 @@ extern void mpol_fix_fork_child_flag(struct task_struct *p);
159 159
160extern struct mempolicy default_policy; 160extern struct mempolicy default_policy;
161extern struct zonelist *huge_zonelist(struct vm_area_struct *vma, 161extern struct zonelist *huge_zonelist(struct vm_area_struct *vma,
162 unsigned long addr); 162 unsigned long addr, gfp_t gfp_flags);
163extern unsigned slab_node(struct mempolicy *policy); 163extern unsigned slab_node(struct mempolicy *policy);
164 164
165extern enum zone_type policy_zone; 165extern enum zone_type policy_zone;
@@ -256,9 +256,9 @@ static inline void mpol_fix_fork_child_flag(struct task_struct *p)
256#define set_cpuset_being_rebound(x) do {} while (0) 256#define set_cpuset_being_rebound(x) do {} while (0)
257 257
258static inline struct zonelist *huge_zonelist(struct vm_area_struct *vma, 258static inline struct zonelist *huge_zonelist(struct vm_area_struct *vma,
259 unsigned long addr) 259 unsigned long addr, gfp_t gfp_flags)
260{ 260{
261 return NODE_DATA(0)->node_zonelists + gfp_zone(GFP_HIGHUSER); 261 return NODE_DATA(0)->node_zonelists + gfp_zone(gfp_flags);
262} 262}
263 263
264static inline int do_migrate_pages(struct mm_struct *mm, 264static inline int do_migrate_pages(struct mm_struct *mm,
diff --git a/include/linux/mlx4/device.h b/include/linux/mlx4/device.h
index b372f5910fc1..cfb78fb2c046 100644
--- a/include/linux/mlx4/device.h
+++ b/include/linux/mlx4/device.h
@@ -172,6 +172,7 @@ struct mlx4_caps {
172 int num_pds; 172 int num_pds;
173 int reserved_pds; 173 int reserved_pds;
174 int mtt_entry_sz; 174 int mtt_entry_sz;
175 u32 max_msg_sz;
175 u32 page_size_cap; 176 u32 page_size_cap;
176 u32 flags; 177 u32 flags;
177 u16 stat_rate_support; 178 u16 stat_rate_support;
@@ -322,6 +323,7 @@ int mlx4_srq_alloc(struct mlx4_dev *dev, u32 pdn, struct mlx4_mtt *mtt,
322 u64 db_rec, struct mlx4_srq *srq); 323 u64 db_rec, struct mlx4_srq *srq);
323void mlx4_srq_free(struct mlx4_dev *dev, struct mlx4_srq *srq); 324void mlx4_srq_free(struct mlx4_dev *dev, struct mlx4_srq *srq);
324int mlx4_srq_arm(struct mlx4_dev *dev, struct mlx4_srq *srq, int limit_watermark); 325int mlx4_srq_arm(struct mlx4_dev *dev, struct mlx4_srq *srq, int limit_watermark);
326int mlx4_srq_query(struct mlx4_dev *dev, struct mlx4_srq *srq, int *limit_watermark);
325 327
326int mlx4_INIT_PORT(struct mlx4_dev *dev, int port); 328int mlx4_INIT_PORT(struct mlx4_dev *dev, int port);
327int mlx4_CLOSE_PORT(struct mlx4_dev *dev, int port); 329int mlx4_CLOSE_PORT(struct mlx4_dev *dev, int port);
diff --git a/include/linux/mlx4/qp.h b/include/linux/mlx4/qp.h
index 10c57d279144..3968b943259a 100644
--- a/include/linux/mlx4/qp.h
+++ b/include/linux/mlx4/qp.h
@@ -282,6 +282,9 @@ int mlx4_qp_modify(struct mlx4_dev *dev, struct mlx4_mtt *mtt,
282 struct mlx4_qp_context *context, enum mlx4_qp_optpar optpar, 282 struct mlx4_qp_context *context, enum mlx4_qp_optpar optpar,
283 int sqd_event, struct mlx4_qp *qp); 283 int sqd_event, struct mlx4_qp *qp);
284 284
285int mlx4_qp_query(struct mlx4_dev *dev, struct mlx4_qp *qp,
286 struct mlx4_qp_context *context);
287
285static inline struct mlx4_qp *__mlx4_qp_lookup(struct mlx4_dev *dev, u32 qpn) 288static inline struct mlx4_qp *__mlx4_qp_lookup(struct mlx4_dev *dev, u32 qpn)
286{ 289{
287 return radix_tree_lookup(&dev->qp_table_tree, qpn & (dev->caps.num_qps - 1)); 290 return radix_tree_lookup(&dev->qp_table_tree, qpn & (dev->caps.num_qps - 1));
diff --git a/include/linux/mm.h b/include/linux/mm.h
index 1c1207472bb4..a5c451816fdc 100644
--- a/include/linux/mm.h
+++ b/include/linux/mm.h
@@ -2,7 +2,6 @@
2#define _LINUX_MM_H 2#define _LINUX_MM_H
3 3
4#include <linux/errno.h> 4#include <linux/errno.h>
5#include <linux/capability.h>
6 5
7#ifdef __KERNEL__ 6#ifdef __KERNEL__
8 7
@@ -27,7 +26,6 @@ extern unsigned long max_mapnr;
27 26
28extern unsigned long num_physpages; 27extern unsigned long num_physpages;
29extern void * high_memory; 28extern void * high_memory;
30extern unsigned long vmalloc_earlyreserve;
31extern int page_cluster; 29extern int page_cluster;
32 30
33#ifdef CONFIG_SYSCTL 31#ifdef CONFIG_SYSCTL
@@ -601,6 +599,7 @@ static inline struct address_space *page_mapping(struct page *page)
601{ 599{
602 struct address_space *mapping = page->mapping; 600 struct address_space *mapping = page->mapping;
603 601
602 VM_BUG_ON(PageSlab(page));
604 if (unlikely(PageSwapCache(page))) 603 if (unlikely(PageSwapCache(page)))
605 mapping = &swapper_space; 604 mapping = &swapper_space;
606#ifdef CONFIG_SLUB 605#ifdef CONFIG_SLUB
@@ -812,27 +811,31 @@ extern unsigned long do_mremap(unsigned long addr,
812 unsigned long flags, unsigned long new_addr); 811 unsigned long flags, unsigned long new_addr);
813 812
814/* 813/*
815 * Prototype to add a shrinker callback for ageable caches. 814 * A callback you can register to apply pressure to ageable caches.
816 *
817 * These functions are passed a count `nr_to_scan' and a gfpmask. They should
818 * scan `nr_to_scan' objects, attempting to free them.
819 * 815 *
820 * The callback must return the number of objects which remain in the cache. 816 * 'shrink' is passed a count 'nr_to_scan' and a 'gfpmask'. It should
817 * look through the least-recently-used 'nr_to_scan' entries and
818 * attempt to free them up. It should return the number of objects
819 * which remain in the cache. If it returns -1, it means it cannot do
820 * any scanning at this time (eg. there is a risk of deadlock).
821 * 821 *
822 * The callback will be passed nr_to_scan == 0 when the VM is querying the 822 * The 'gfpmask' refers to the allocation we are currently trying to
823 * cache size, so a fastpath for that case is appropriate. 823 * fulfil.
824 */ 824 *
825typedef int (*shrinker_t)(int nr_to_scan, gfp_t gfp_mask); 825 * Note that 'shrink' will be passed nr_to_scan == 0 when the VM is
826 826 * querying the cache size, so a fastpath for that case is appropriate.
827/*
828 * Add an aging callback. The int is the number of 'seeks' it takes
829 * to recreate one of the objects that these functions age.
830 */ 827 */
828struct shrinker {
829 int (*shrink)(int nr_to_scan, gfp_t gfp_mask);
830 int seeks; /* seeks to recreate an obj */
831 831
832#define DEFAULT_SEEKS 2 832 /* These are for internal use */
833struct shrinker; 833 struct list_head list;
834extern struct shrinker *set_shrinker(int, shrinker_t); 834 long nr; /* objs pending delete */
835extern void remove_shrinker(struct shrinker *shrinker); 835};
836#define DEFAULT_SEEKS 2 /* A good number if you don't know better. */
837extern void register_shrinker(struct shrinker *);
838extern void unregister_shrinker(struct shrinker *);
836 839
837/* 840/*
838 * Some shared mappigns will want the pages marked read-only 841 * Some shared mappigns will want the pages marked read-only
@@ -1072,6 +1075,10 @@ extern unsigned long get_unmapped_area(struct file *, unsigned long, unsigned lo
1072extern unsigned long do_mmap_pgoff(struct file *file, unsigned long addr, 1075extern unsigned long do_mmap_pgoff(struct file *file, unsigned long addr,
1073 unsigned long len, unsigned long prot, 1076 unsigned long len, unsigned long prot,
1074 unsigned long flag, unsigned long pgoff); 1077 unsigned long flag, unsigned long pgoff);
1078extern unsigned long mmap_region(struct file *file, unsigned long addr,
1079 unsigned long len, unsigned long flags,
1080 unsigned int vm_flags, unsigned long pgoff,
1081 int accountable);
1075 1082
1076static inline unsigned long do_mmap(struct file *file, unsigned long addr, 1083static inline unsigned long do_mmap(struct file *file, unsigned long addr,
1077 unsigned long len, unsigned long prot, 1084 unsigned long len, unsigned long prot,
diff --git a/include/linux/mmzone.h b/include/linux/mmzone.h
index d09b1345a3a1..da8eb8ad9e9b 100644
--- a/include/linux/mmzone.h
+++ b/include/linux/mmzone.h
@@ -24,6 +24,14 @@
24#endif 24#endif
25#define MAX_ORDER_NR_PAGES (1 << (MAX_ORDER - 1)) 25#define MAX_ORDER_NR_PAGES (1 << (MAX_ORDER - 1))
26 26
27/*
28 * PAGE_ALLOC_COSTLY_ORDER is the order at which allocations are deemed
29 * costly to service. That is between allocation orders which should
30 * coelesce naturally under reasonable reclaim pressure and those which
31 * will not.
32 */
33#define PAGE_ALLOC_COSTLY_ORDER 3
34
27struct free_area { 35struct free_area {
28 struct list_head free_list; 36 struct list_head free_list;
29 unsigned long nr_free; 37 unsigned long nr_free;
@@ -146,6 +154,7 @@ enum zone_type {
146 */ 154 */
147 ZONE_HIGHMEM, 155 ZONE_HIGHMEM,
148#endif 156#endif
157 ZONE_MOVABLE,
149 MAX_NR_ZONES 158 MAX_NR_ZONES
150}; 159};
151 160
@@ -167,6 +176,7 @@ enum zone_type {
167 + defined(CONFIG_ZONE_DMA32) \ 176 + defined(CONFIG_ZONE_DMA32) \
168 + 1 \ 177 + 1 \
169 + defined(CONFIG_HIGHMEM) \ 178 + defined(CONFIG_HIGHMEM) \
179 + 1 \
170) 180)
171#if __ZONE_COUNT < 2 181#if __ZONE_COUNT < 2
172#define ZONES_SHIFT 0 182#define ZONES_SHIFT 0
@@ -499,10 +509,22 @@ static inline int populated_zone(struct zone *zone)
499 return (!!zone->present_pages); 509 return (!!zone->present_pages);
500} 510}
501 511
512extern int movable_zone;
513
514static inline int zone_movable_is_highmem(void)
515{
516#if defined(CONFIG_HIGHMEM) && defined(CONFIG_ARCH_POPULATES_NODE_MAP)
517 return movable_zone == ZONE_HIGHMEM;
518#else
519 return 0;
520#endif
521}
522
502static inline int is_highmem_idx(enum zone_type idx) 523static inline int is_highmem_idx(enum zone_type idx)
503{ 524{
504#ifdef CONFIG_HIGHMEM 525#ifdef CONFIG_HIGHMEM
505 return (idx == ZONE_HIGHMEM); 526 return (idx == ZONE_HIGHMEM ||
527 (idx == ZONE_MOVABLE && zone_movable_is_highmem()));
506#else 528#else
507 return 0; 529 return 0;
508#endif 530#endif
@@ -522,7 +544,9 @@ static inline int is_normal_idx(enum zone_type idx)
522static inline int is_highmem(struct zone *zone) 544static inline int is_highmem(struct zone *zone)
523{ 545{
524#ifdef CONFIG_HIGHMEM 546#ifdef CONFIG_HIGHMEM
525 return zone == zone->zone_pgdat->node_zones + ZONE_HIGHMEM; 547 int zone_idx = zone - zone->zone_pgdat->node_zones;
548 return zone_idx == ZONE_HIGHMEM ||
549 (zone_idx == ZONE_MOVABLE && zone_movable_is_highmem());
526#else 550#else
527 return 0; 551 return 0;
528#endif 552#endif
@@ -566,6 +590,11 @@ int sysctl_min_unmapped_ratio_sysctl_handler(struct ctl_table *, int,
566int sysctl_min_slab_ratio_sysctl_handler(struct ctl_table *, int, 590int sysctl_min_slab_ratio_sysctl_handler(struct ctl_table *, int,
567 struct file *, void __user *, size_t *, loff_t *); 591 struct file *, void __user *, size_t *, loff_t *);
568 592
593extern int numa_zonelist_order_handler(struct ctl_table *, int,
594 struct file *, void __user *, size_t *, loff_t *);
595extern char numa_zonelist_order[];
596#define NUMA_ZONELIST_ORDER_LEN 16 /* string buffer size */
597
569#include <linux/topology.h> 598#include <linux/topology.h>
570/* Returns the number of the current Node. */ 599/* Returns the number of the current Node. */
571#ifndef numa_node_id 600#ifndef numa_node_id
diff --git a/include/linux/mnt_namespace.h b/include/linux/mnt_namespace.h
index 1fa4d9813b31..8eed44f8ca73 100644
--- a/include/linux/mnt_namespace.h
+++ b/include/linux/mnt_namespace.h
@@ -14,7 +14,7 @@ struct mnt_namespace {
14 int event; 14 int event;
15}; 15};
16 16
17extern struct mnt_namespace *copy_mnt_ns(int, struct mnt_namespace *, 17extern struct mnt_namespace *copy_mnt_ns(unsigned long, struct mnt_namespace *,
18 struct fs_struct *); 18 struct fs_struct *);
19extern void __put_mnt_ns(struct mnt_namespace *ns); 19extern void __put_mnt_ns(struct mnt_namespace *ns);
20 20
diff --git a/include/linux/module.h b/include/linux/module.h
index e6e0f86ef5fc..b6a646cea1cb 100644
--- a/include/linux/module.h
+++ b/include/linux/module.h
@@ -6,7 +6,6 @@
6 * Rewritten by Richard Henderson <rth@tamu.edu> Dec 1996 6 * Rewritten by Richard Henderson <rth@tamu.edu> Dec 1996
7 * Rewritten again by Rusty Russell, 2002 7 * Rewritten again by Rusty Russell, 2002
8 */ 8 */
9#include <linux/spinlock.h>
10#include <linux/list.h> 9#include <linux/list.h>
11#include <linux/stat.h> 10#include <linux/stat.h>
12#include <linux/compiler.h> 11#include <linux/compiler.h>
diff --git a/include/linux/msdos_fs.h b/include/linux/msdos_fs.h
index 0e09c005dda8..f950921523f5 100644
--- a/include/linux/msdos_fs.h
+++ b/include/linux/msdos_fs.h
@@ -146,7 +146,7 @@ struct fat_boot_fsinfo {
146}; 146};
147 147
148struct msdos_dir_entry { 148struct msdos_dir_entry {
149 __u8 name[8],ext[3]; /* name and extension */ 149 __u8 name[MSDOS_NAME];/* name and extension */
150 __u8 attr; /* attribute bits */ 150 __u8 attr; /* attribute bits */
151 __u8 lcase; /* Case for base and extension */ 151 __u8 lcase; /* Case for base and extension */
152 __u8 ctime_cs; /* Creation time, centiseconds (0-199) */ 152 __u8 ctime_cs; /* Creation time, centiseconds (0-199) */
diff --git a/include/linux/mv643xx.h b/include/linux/mv643xx.h
index c6d4ab86b83c..b021b3a2b65a 100644
--- a/include/linux/mv643xx.h
+++ b/include/linux/mv643xx.h
@@ -13,10 +13,6 @@
13#ifndef __ASM_MV643XX_H 13#ifndef __ASM_MV643XX_H
14#define __ASM_MV643XX_H 14#define __ASM_MV643XX_H
15 15
16#ifdef __mips__
17#include <asm/addrspace.h>
18#include <asm/marvell.h>
19#endif
20#include <asm/types.h> 16#include <asm/types.h>
21 17
22/****************************************/ 18/****************************************/
diff --git a/include/linux/ncp_fs.h b/include/linux/ncp_fs.h
index 83e39eb054d3..88766e43e121 100644
--- a/include/linux/ncp_fs.h
+++ b/include/linux/ncp_fs.h
@@ -148,8 +148,6 @@ struct ncp_nls_ioctl
148#include <linux/ncp_fs_i.h> 148#include <linux/ncp_fs_i.h>
149#include <linux/ncp_fs_sb.h> 149#include <linux/ncp_fs_sb.h>
150 150
151/* undef because public define in umsdos_fs.h (ncp_fs.h isn't public) */
152#undef PRINTK
153/* define because it is easy to change PRINTK to {*}PRINTK */ 151/* define because it is easy to change PRINTK to {*}PRINTK */
154#define PRINTK(format, args...) printk(KERN_DEBUG format , ## args) 152#define PRINTK(format, args...) printk(KERN_DEBUG format , ## args)
155 153
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index 3a70f553b28f..9820ca1e45e2 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -108,6 +108,14 @@ struct wireless_dev;
108#define MAX_HEADER (LL_MAX_HEADER + 48) 108#define MAX_HEADER (LL_MAX_HEADER + 48)
109#endif 109#endif
110 110
111struct net_device_subqueue
112{
113 /* Give a control state for each queue. This struct may contain
114 * per-queue locks in the future.
115 */
116 unsigned long state;
117};
118
111/* 119/*
112 * Network device statistics. Akin to the 2.0 ether stats but 120 * Network device statistics. Akin to the 2.0 ether stats but
113 * with byte counters. 121 * with byte counters.
@@ -177,19 +185,25 @@ struct netif_rx_stats
177 185
178DECLARE_PER_CPU(struct netif_rx_stats, netdev_rx_stat); 186DECLARE_PER_CPU(struct netif_rx_stats, netdev_rx_stat);
179 187
188struct dev_addr_list
189{
190 struct dev_addr_list *next;
191 u8 da_addr[MAX_ADDR_LEN];
192 u8 da_addrlen;
193 u8 da_synced;
194 int da_users;
195 int da_gusers;
196};
180 197
181/* 198/*
182 * We tag multicasts with these structures. 199 * We tag multicasts with these structures.
183 */ 200 */
184 201
185struct dev_mc_list 202#define dev_mc_list dev_addr_list
186{ 203#define dmi_addr da_addr
187 struct dev_mc_list *next; 204#define dmi_addrlen da_addrlen
188 __u8 dmi_addr[MAX_ADDR_LEN]; 205#define dmi_users da_users
189 unsigned char dmi_addrlen; 206#define dmi_gusers da_gusers
190 int dmi_users;
191 int dmi_gusers;
192};
193 207
194struct hh_cache 208struct hh_cache
195{ 209{
@@ -314,9 +328,10 @@ struct net_device
314 /* Net device features */ 328 /* Net device features */
315 unsigned long features; 329 unsigned long features;
316#define NETIF_F_SG 1 /* Scatter/gather IO. */ 330#define NETIF_F_SG 1 /* Scatter/gather IO. */
317#define NETIF_F_IP_CSUM 2 /* Can checksum only TCP/UDP over IPv4. */ 331#define NETIF_F_IP_CSUM 2 /* Can checksum TCP/UDP over IPv4. */
318#define NETIF_F_NO_CSUM 4 /* Does not require checksum. F.e. loopack. */ 332#define NETIF_F_NO_CSUM 4 /* Does not require checksum. F.e. loopack. */
319#define NETIF_F_HW_CSUM 8 /* Can checksum all the packets. */ 333#define NETIF_F_HW_CSUM 8 /* Can checksum all the packets. */
334#define NETIF_F_IPV6_CSUM 16 /* Can checksum TCP/UDP over IPV6 */
320#define NETIF_F_HIGHDMA 32 /* Can DMA to high memory. */ 335#define NETIF_F_HIGHDMA 32 /* Can DMA to high memory. */
321#define NETIF_F_FRAGLIST 64 /* Scatter/gather IO. */ 336#define NETIF_F_FRAGLIST 64 /* Scatter/gather IO. */
322#define NETIF_F_HW_VLAN_TX 128 /* Transmit VLAN hw acceleration */ 337#define NETIF_F_HW_VLAN_TX 128 /* Transmit VLAN hw acceleration */
@@ -325,6 +340,7 @@ struct net_device
325#define NETIF_F_VLAN_CHALLENGED 1024 /* Device cannot handle VLAN packets */ 340#define NETIF_F_VLAN_CHALLENGED 1024 /* Device cannot handle VLAN packets */
326#define NETIF_F_GSO 2048 /* Enable software GSO. */ 341#define NETIF_F_GSO 2048 /* Enable software GSO. */
327#define NETIF_F_LLTX 4096 /* LockLess TX */ 342#define NETIF_F_LLTX 4096 /* LockLess TX */
343#define NETIF_F_MULTI_QUEUE 16384 /* Has multiple TX/RX queues */
328 344
329 /* Segmentation offload features */ 345 /* Segmentation offload features */
330#define NETIF_F_GSO_SHIFT 16 346#define NETIF_F_GSO_SHIFT 16
@@ -338,8 +354,11 @@ struct net_device
338 /* List of features with software fallbacks. */ 354 /* List of features with software fallbacks. */
339#define NETIF_F_GSO_SOFTWARE (NETIF_F_TSO | NETIF_F_TSO_ECN | NETIF_F_TSO6) 355#define NETIF_F_GSO_SOFTWARE (NETIF_F_TSO | NETIF_F_TSO_ECN | NETIF_F_TSO6)
340 356
357
341#define NETIF_F_GEN_CSUM (NETIF_F_NO_CSUM | NETIF_F_HW_CSUM) 358#define NETIF_F_GEN_CSUM (NETIF_F_NO_CSUM | NETIF_F_HW_CSUM)
342#define NETIF_F_ALL_CSUM (NETIF_F_IP_CSUM | NETIF_F_GEN_CSUM) 359#define NETIF_F_V4_CSUM (NETIF_F_GEN_CSUM | NETIF_F_IP_CSUM)
360#define NETIF_F_V6_CSUM (NETIF_F_GEN_CSUM | NETIF_F_IPV6_CSUM)
361#define NETIF_F_ALL_CSUM (NETIF_F_V4_CSUM | NETIF_F_V6_CSUM)
343 362
344 struct net_device *next_sched; 363 struct net_device *next_sched;
345 364
@@ -388,7 +407,10 @@ struct net_device
388 unsigned char addr_len; /* hardware address length */ 407 unsigned char addr_len; /* hardware address length */
389 unsigned short dev_id; /* for shared network cards */ 408 unsigned short dev_id; /* for shared network cards */
390 409
391 struct dev_mc_list *mc_list; /* Multicast mac addresses */ 410 struct dev_addr_list *uc_list; /* Secondary unicast mac addresses */
411 int uc_count; /* Number of installed ucasts */
412 int uc_promisc;
413 struct dev_addr_list *mc_list; /* Multicast mac addresses */
392 int mc_count; /* Number of installed mcasts */ 414 int mc_count; /* Number of installed mcasts */
393 int promiscuity; 415 int promiscuity;
394 int allmulti; 416 int allmulti;
@@ -493,6 +515,11 @@ struct net_device
493 void *saddr, 515 void *saddr,
494 unsigned len); 516 unsigned len);
495 int (*rebuild_header)(struct sk_buff *skb); 517 int (*rebuild_header)(struct sk_buff *skb);
518#define HAVE_CHANGE_RX_FLAGS
519 void (*change_rx_flags)(struct net_device *dev,
520 int flags);
521#define HAVE_SET_RX_MODE
522 void (*set_rx_mode)(struct net_device *dev);
496#define HAVE_MULTICAST 523#define HAVE_MULTICAST
497 void (*set_multicast_list)(struct net_device *dev); 524 void (*set_multicast_list)(struct net_device *dev);
498#define HAVE_SET_MAC_ADDR 525#define HAVE_SET_MAC_ADDR
@@ -535,22 +562,29 @@ struct net_device
535 562
536 /* bridge stuff */ 563 /* bridge stuff */
537 struct net_bridge_port *br_port; 564 struct net_bridge_port *br_port;
565 /* macvlan */
566 struct macvlan_port *macvlan_port;
538 567
539 /* class/net/name entry */ 568 /* class/net/name entry */
540 struct device dev; 569 struct device dev;
541 /* space for optional statistics and wireless sysfs groups */ 570 /* space for optional statistics and wireless sysfs groups */
542 struct attribute_group *sysfs_groups[3]; 571 struct attribute_group *sysfs_groups[3];
572
573 /* rtnetlink link ops */
574 const struct rtnl_link_ops *rtnl_link_ops;
575
576 /* The TX queue control structures */
577 unsigned int egress_subqueue_count;
578 struct net_device_subqueue egress_subqueue[0];
543}; 579};
544#define to_net_dev(d) container_of(d, struct net_device, dev) 580#define to_net_dev(d) container_of(d, struct net_device, dev)
545 581
546#define NETDEV_ALIGN 32 582#define NETDEV_ALIGN 32
547#define NETDEV_ALIGN_CONST (NETDEV_ALIGN - 1) 583#define NETDEV_ALIGN_CONST (NETDEV_ALIGN - 1)
548 584
549static inline void *netdev_priv(struct net_device *dev) 585static inline void *netdev_priv(const struct net_device *dev)
550{ 586{
551 return (char *)dev + ((sizeof(struct net_device) 587 return dev->priv;
552 + NETDEV_ALIGN_CONST)
553 & ~NETDEV_ALIGN_CONST);
554} 588}
555 589
556#define SET_MODULE_OWNER(dev) do { } while (0) 590#define SET_MODULE_OWNER(dev) do { } while (0)
@@ -702,6 +736,62 @@ static inline int netif_running(const struct net_device *dev)
702 return test_bit(__LINK_STATE_START, &dev->state); 736 return test_bit(__LINK_STATE_START, &dev->state);
703} 737}
704 738
739/*
740 * Routines to manage the subqueues on a device. We only need start
741 * stop, and a check if it's stopped. All other device management is
742 * done at the overall netdevice level.
743 * Also test the device if we're multiqueue.
744 */
745static inline void netif_start_subqueue(struct net_device *dev, u16 queue_index)
746{
747#ifdef CONFIG_NETDEVICES_MULTIQUEUE
748 clear_bit(__LINK_STATE_XOFF, &dev->egress_subqueue[queue_index].state);
749#endif
750}
751
752static inline void netif_stop_subqueue(struct net_device *dev, u16 queue_index)
753{
754#ifdef CONFIG_NETDEVICES_MULTIQUEUE
755#ifdef CONFIG_NETPOLL_TRAP
756 if (netpoll_trap())
757 return;
758#endif
759 set_bit(__LINK_STATE_XOFF, &dev->egress_subqueue[queue_index].state);
760#endif
761}
762
763static inline int netif_subqueue_stopped(const struct net_device *dev,
764 u16 queue_index)
765{
766#ifdef CONFIG_NETDEVICES_MULTIQUEUE
767 return test_bit(__LINK_STATE_XOFF,
768 &dev->egress_subqueue[queue_index].state);
769#else
770 return 0;
771#endif
772}
773
774static inline void netif_wake_subqueue(struct net_device *dev, u16 queue_index)
775{
776#ifdef CONFIG_NETDEVICES_MULTIQUEUE
777#ifdef CONFIG_NETPOLL_TRAP
778 if (netpoll_trap())
779 return;
780#endif
781 if (test_and_clear_bit(__LINK_STATE_XOFF,
782 &dev->egress_subqueue[queue_index].state))
783 __netif_schedule(dev);
784#endif
785}
786
787static inline int netif_is_multiqueue(const struct net_device *dev)
788{
789#ifdef CONFIG_NETDEVICES_MULTIQUEUE
790 return (!!(NETIF_F_MULTI_QUEUE & dev->features));
791#else
792 return 0;
793#endif
794}
705 795
706/* Use this variant when it is known for sure that it 796/* Use this variant when it is known for sure that it
707 * is executing from interrupt context. 797 * is executing from interrupt context.
@@ -992,15 +1082,24 @@ static inline void netif_tx_disable(struct net_device *dev)
992extern void ether_setup(struct net_device *dev); 1082extern void ether_setup(struct net_device *dev);
993 1083
994/* Support for loadable net-drivers */ 1084/* Support for loadable net-drivers */
995extern struct net_device *alloc_netdev(int sizeof_priv, const char *name, 1085extern struct net_device *alloc_netdev_mq(int sizeof_priv, const char *name,
996 void (*setup)(struct net_device *)); 1086 void (*setup)(struct net_device *),
1087 unsigned int queue_count);
1088#define alloc_netdev(sizeof_priv, name, setup) \
1089 alloc_netdev_mq(sizeof_priv, name, setup, 1)
997extern int register_netdev(struct net_device *dev); 1090extern int register_netdev(struct net_device *dev);
998extern void unregister_netdev(struct net_device *dev); 1091extern void unregister_netdev(struct net_device *dev);
999/* Functions used for multicast support */ 1092/* Functions used for secondary unicast and multicast support */
1000extern void dev_mc_upload(struct net_device *dev); 1093extern void dev_set_rx_mode(struct net_device *dev);
1094extern void __dev_set_rx_mode(struct net_device *dev);
1095extern int dev_unicast_delete(struct net_device *dev, void *addr, int alen);
1096extern int dev_unicast_add(struct net_device *dev, void *addr, int alen);
1001extern int dev_mc_delete(struct net_device *dev, void *addr, int alen, int all); 1097extern int dev_mc_delete(struct net_device *dev, void *addr, int alen, int all);
1002extern int dev_mc_add(struct net_device *dev, void *addr, int alen, int newonly); 1098extern int dev_mc_add(struct net_device *dev, void *addr, int alen, int newonly);
1003extern void dev_mc_discard(struct net_device *dev); 1099extern int dev_mc_sync(struct net_device *to, struct net_device *from);
1100extern void dev_mc_unsync(struct net_device *to, struct net_device *from);
1101extern int __dev_addr_delete(struct dev_addr_list **list, int *count, void *addr, int alen, int all);
1102extern int __dev_addr_add(struct dev_addr_list **list, int *count, void *addr, int alen, int newonly);
1004extern void dev_set_promiscuity(struct net_device *dev, int inc); 1103extern void dev_set_promiscuity(struct net_device *dev, int inc);
1005extern void dev_set_allmulti(struct net_device *dev, int inc); 1104extern void dev_set_allmulti(struct net_device *dev, int inc);
1006extern void netdev_state_change(struct net_device *dev); 1105extern void netdev_state_change(struct net_device *dev);
diff --git a/include/linux/netfilter.h b/include/linux/netfilter.h
index 10b5c6275706..0eed0b7ab2df 100644
--- a/include/linux/netfilter.h
+++ b/include/linux/netfilter.h
@@ -275,7 +275,8 @@ struct nf_queue_handler {
275}; 275};
276extern int nf_register_queue_handler(int pf, 276extern int nf_register_queue_handler(int pf,
277 struct nf_queue_handler *qh); 277 struct nf_queue_handler *qh);
278extern int nf_unregister_queue_handler(int pf); 278extern int nf_unregister_queue_handler(int pf,
279 struct nf_queue_handler *qh);
279extern void nf_unregister_queue_handlers(struct nf_queue_handler *qh); 280extern void nf_unregister_queue_handlers(struct nf_queue_handler *qh);
280extern void nf_reinject(struct sk_buff *skb, 281extern void nf_reinject(struct sk_buff *skb,
281 struct nf_info *info, 282 struct nf_info *info,
diff --git a/include/linux/netfilter/nf_conntrack_pptp.h b/include/linux/netfilter/nf_conntrack_pptp.h
index 9d8144a488cd..c93061f33144 100644
--- a/include/linux/netfilter/nf_conntrack_pptp.h
+++ b/include/linux/netfilter/nf_conntrack_pptp.h
@@ -4,6 +4,8 @@
4 4
5#include <linux/netfilter/nf_conntrack_common.h> 5#include <linux/netfilter/nf_conntrack_common.h>
6 6
7extern const char *pptp_msg_name[];
8
7/* state of the control session */ 9/* state of the control session */
8enum pptp_ctrlsess_state { 10enum pptp_ctrlsess_state {
9 PPTP_SESSION_NONE, /* no session present */ 11 PPTP_SESSION_NONE, /* no session present */
diff --git a/include/linux/netfilter/x_tables.h b/include/linux/netfilter/x_tables.h
index 7e733a6ba4f6..64f425a855bb 100644
--- a/include/linux/netfilter/x_tables.h
+++ b/include/linux/netfilter/x_tables.h
@@ -141,22 +141,22 @@ struct xt_match
141 /* Arguments changed since 2.6.9, as this must now handle 141 /* Arguments changed since 2.6.9, as this must now handle
142 non-linear skb, using skb_header_pointer and 142 non-linear skb, using skb_header_pointer and
143 skb_ip_make_writable. */ 143 skb_ip_make_writable. */
144 int (*match)(const struct sk_buff *skb, 144 bool (*match)(const struct sk_buff *skb,
145 const struct net_device *in, 145 const struct net_device *in,
146 const struct net_device *out, 146 const struct net_device *out,
147 const struct xt_match *match, 147 const struct xt_match *match,
148 const void *matchinfo, 148 const void *matchinfo,
149 int offset, 149 int offset,
150 unsigned int protoff, 150 unsigned int protoff,
151 int *hotdrop); 151 bool *hotdrop);
152 152
153 /* Called when user tries to insert an entry of this type. */ 153 /* Called when user tries to insert an entry of this type. */
154 /* Should return true or false. */ 154 /* Should return true or false. */
155 int (*checkentry)(const char *tablename, 155 bool (*checkentry)(const char *tablename,
156 const void *ip, 156 const void *ip,
157 const struct xt_match *match, 157 const struct xt_match *match,
158 void *matchinfo, 158 void *matchinfo,
159 unsigned int hook_mask); 159 unsigned int hook_mask);
160 160
161 /* Called when entry of this type deleted. */ 161 /* Called when entry of this type deleted. */
162 void (*destroy)(const struct xt_match *match, void *matchinfo); 162 void (*destroy)(const struct xt_match *match, void *matchinfo);
@@ -202,11 +202,11 @@ struct xt_target
202 hook_mask is a bitmask of hooks from which it can be 202 hook_mask is a bitmask of hooks from which it can be
203 called. */ 203 called. */
204 /* Should return true or false. */ 204 /* Should return true or false. */
205 int (*checkentry)(const char *tablename, 205 bool (*checkentry)(const char *tablename,
206 const void *entry, 206 const void *entry,
207 const struct xt_target *target, 207 const struct xt_target *target,
208 void *targinfo, 208 void *targinfo,
209 unsigned int hook_mask); 209 unsigned int hook_mask);
210 210
211 /* Called when entry of this type deleted. */ 211 /* Called when entry of this type deleted. */
212 void (*destroy)(const struct xt_target *target, void *targinfo); 212 void (*destroy)(const struct xt_target *target, void *targinfo);
diff --git a/include/linux/netfilter/xt_connlimit.h b/include/linux/netfilter/xt_connlimit.h
new file mode 100644
index 000000000000..90ae8b474cb8
--- /dev/null
+++ b/include/linux/netfilter/xt_connlimit.h
@@ -0,0 +1,17 @@
1#ifndef _XT_CONNLIMIT_H
2#define _XT_CONNLIMIT_H
3
4struct xt_connlimit_data;
5
6struct xt_connlimit_info {
7 union {
8 u_int32_t v4_mask;
9 u_int32_t v6_mask[4];
10 };
11 unsigned int limit, inverse;
12
13 /* this needs to be at the end */
14 struct xt_connlimit_data *data __attribute__((aligned(8)));
15};
16
17#endif /* _XT_CONNLIMIT_H */
diff --git a/include/linux/netfilter/xt_u32.h b/include/linux/netfilter/xt_u32.h
new file mode 100644
index 000000000000..9947f56cdbdd
--- /dev/null
+++ b/include/linux/netfilter/xt_u32.h
@@ -0,0 +1,40 @@
1#ifndef _XT_U32_H
2#define _XT_U32_H 1
3
4enum xt_u32_ops {
5 XT_U32_AND,
6 XT_U32_LEFTSH,
7 XT_U32_RIGHTSH,
8 XT_U32_AT,
9};
10
11struct xt_u32_location_element {
12 u_int32_t number;
13 u_int8_t nextop;
14};
15
16struct xt_u32_value_element {
17 u_int32_t min;
18 u_int32_t max;
19};
20
21/*
22 * Any way to allow for an arbitrary number of elements?
23 * For now, I settle with a limit of 10 each.
24 */
25#define XT_U32_MAXSIZE 10
26
27struct xt_u32_test {
28 struct xt_u32_location_element location[XT_U32_MAXSIZE+1];
29 struct xt_u32_value_element value[XT_U32_MAXSIZE+1];
30 u_int8_t nnums;
31 u_int8_t nvalues;
32};
33
34struct xt_u32 {
35 struct xt_u32_test tests[XT_U32_MAXSIZE+1];
36 u_int8_t ntests;
37 u_int8_t invert;
38};
39
40#endif /* _XT_U32_H */
diff --git a/include/linux/netfilter_ipv4/ipt_CLUSTERIP.h b/include/linux/netfilter_ipv4/ipt_CLUSTERIP.h
index d9bceedfb3dc..daf50be22c9d 100644
--- a/include/linux/netfilter_ipv4/ipt_CLUSTERIP.h
+++ b/include/linux/netfilter_ipv4/ipt_CLUSTERIP.h
@@ -18,13 +18,13 @@ struct clusterip_config;
18struct ipt_clusterip_tgt_info { 18struct ipt_clusterip_tgt_info {
19 19
20 u_int32_t flags; 20 u_int32_t flags;
21 21
22 /* only relevant for new ones */ 22 /* only relevant for new ones */
23 u_int8_t clustermac[6]; 23 u_int8_t clustermac[6];
24 u_int16_t num_total_nodes; 24 u_int16_t num_total_nodes;
25 u_int16_t num_local_nodes; 25 u_int16_t num_local_nodes;
26 u_int16_t local_nodes[CLUSTERIP_MAX_NODES]; 26 u_int16_t local_nodes[CLUSTERIP_MAX_NODES];
27 enum clusterip_hashmode hash_mode; 27 u_int32_t hash_mode;
28 u_int32_t hash_initval; 28 u_int32_t hash_initval;
29 29
30 struct clusterip_config *config; 30 struct clusterip_config *config;
diff --git a/include/linux/netfilter_ipv4/ipt_iprange.h b/include/linux/netfilter_ipv4/ipt_iprange.h
index 34ab0fb736e2..a92fefc3c7ec 100644
--- a/include/linux/netfilter_ipv4/ipt_iprange.h
+++ b/include/linux/netfilter_ipv4/ipt_iprange.h
@@ -1,6 +1,8 @@
1#ifndef _IPT_IPRANGE_H 1#ifndef _IPT_IPRANGE_H
2#define _IPT_IPRANGE_H 2#define _IPT_IPRANGE_H
3 3
4#include <linux/types.h>
5
4#define IPRANGE_SRC 0x01 /* Match source IP address */ 6#define IPRANGE_SRC 0x01 /* Match source IP address */
5#define IPRANGE_DST 0x02 /* Match destination IP address */ 7#define IPRANGE_DST 0x02 /* Match destination IP address */
6#define IPRANGE_SRC_INV 0x10 /* Negate the condition */ 8#define IPRANGE_SRC_INV 0x10 /* Negate the condition */
diff --git a/include/linux/netfilter_ipv6/ip6_tables.h b/include/linux/netfilter_ipv6/ip6_tables.h
index 4686f8342cbd..9a720f05888f 100644
--- a/include/linux/netfilter_ipv6/ip6_tables.h
+++ b/include/linux/netfilter_ipv6/ip6_tables.h
@@ -44,8 +44,14 @@ struct ip6t_ip6 {
44 char iniface[IFNAMSIZ], outiface[IFNAMSIZ]; 44 char iniface[IFNAMSIZ], outiface[IFNAMSIZ];
45 unsigned char iniface_mask[IFNAMSIZ], outiface_mask[IFNAMSIZ]; 45 unsigned char iniface_mask[IFNAMSIZ], outiface_mask[IFNAMSIZ];
46 46
47 /* ARGH, HopByHop uses 0, so can't do 0 = ANY, 47 /* Upper protocol number
48 instead IP6T_F_NOPROTO must be set */ 48 * - The allowed value is 0 (any) or protocol number of last parsable
49 * header, which is 50 (ESP), 59 (No Next Header), 135 (MH), or
50 * the non IPv6 extension headers.
51 * - The protocol numbers of IPv6 extension headers except of ESP and
52 * MH do not match any packets.
53 * - You also need to set IP6T_FLAGS_PROTO to "flags" to check protocol.
54 */
49 u_int16_t proto; 55 u_int16_t proto;
50 /* TOS to match iff flags & IP6T_F_TOS */ 56 /* TOS to match iff flags & IP6T_F_TOS */
51 u_int8_t tos; 57 u_int8_t tos;
diff --git a/include/linux/nfs4.h b/include/linux/nfs4.h
index 7e7f33a38fc0..8726491de154 100644
--- a/include/linux/nfs4.h
+++ b/include/linux/nfs4.h
@@ -15,6 +15,7 @@
15 15
16#include <linux/types.h> 16#include <linux/types.h>
17 17
18#define NFS4_BITMAP_SIZE 2
18#define NFS4_VERIFIER_SIZE 8 19#define NFS4_VERIFIER_SIZE 8
19#define NFS4_STATEID_SIZE 16 20#define NFS4_STATEID_SIZE 16
20#define NFS4_FHSIZE 128 21#define NFS4_FHSIZE 128
diff --git a/include/linux/nfs4_mount.h b/include/linux/nfs4_mount.h
index 26b4c83f831d..a0dcf6655657 100644
--- a/include/linux/nfs4_mount.h
+++ b/include/linux/nfs4_mount.h
@@ -65,6 +65,7 @@ struct nfs4_mount_data {
65#define NFS4_MOUNT_NOCTO 0x0010 /* 1 */ 65#define NFS4_MOUNT_NOCTO 0x0010 /* 1 */
66#define NFS4_MOUNT_NOAC 0x0020 /* 1 */ 66#define NFS4_MOUNT_NOAC 0x0020 /* 1 */
67#define NFS4_MOUNT_STRICTLOCK 0x1000 /* 1 */ 67#define NFS4_MOUNT_STRICTLOCK 0x1000 /* 1 */
68#define NFS4_MOUNT_FLAGMASK 0xFFFF 68#define NFS4_MOUNT_UNSHARED 0x8000 /* 1 */
69#define NFS4_MOUNT_FLAGMASK 0x9033
69 70
70#endif 71#endif
diff --git a/include/linux/nfs_fs.h b/include/linux/nfs_fs.h
index 0543439a97af..c098ae194f79 100644
--- a/include/linux/nfs_fs.h
+++ b/include/linux/nfs_fs.h
@@ -30,7 +30,9 @@
30#ifdef __KERNEL__ 30#ifdef __KERNEL__
31 31
32#include <linux/in.h> 32#include <linux/in.h>
33#include <linux/kref.h>
33#include <linux/mm.h> 34#include <linux/mm.h>
35#include <linux/namei.h>
34#include <linux/pagemap.h> 36#include <linux/pagemap.h>
35#include <linux/rbtree.h> 37#include <linux/rbtree.h>
36#include <linux/rwsem.h> 38#include <linux/rwsem.h>
@@ -69,9 +71,8 @@ struct nfs_access_entry {
69 71
70struct nfs4_state; 72struct nfs4_state;
71struct nfs_open_context { 73struct nfs_open_context {
72 atomic_t count; 74 struct kref kref;
73 struct vfsmount *vfsmnt; 75 struct path path;
74 struct dentry *dentry;
75 struct rpc_cred *cred; 76 struct rpc_cred *cred;
76 struct nfs4_state *state; 77 struct nfs4_state *state;
77 fl_owner_t lockowner; 78 fl_owner_t lockowner;
@@ -155,13 +156,9 @@ struct nfs_inode {
155 /* 156 /*
156 * This is the list of dirty unwritten pages. 157 * This is the list of dirty unwritten pages.
157 */ 158 */
158 spinlock_t req_lock;
159 struct list_head dirty;
160 struct list_head commit;
161 struct radix_tree_root nfs_page_tree; 159 struct radix_tree_root nfs_page_tree;
162 160
163 unsigned int ndirty, 161 unsigned long ncommit,
164 ncommit,
165 npages; 162 npages;
166 163
167 /* Open contexts for shared mmap writes */ 164 /* Open contexts for shared mmap writes */
@@ -187,6 +184,7 @@ struct nfs_inode {
187#define NFS_INO_INVALID_ACCESS 0x0008 /* cached access cred invalid */ 184#define NFS_INO_INVALID_ACCESS 0x0008 /* cached access cred invalid */
188#define NFS_INO_INVALID_ACL 0x0010 /* cached acls are invalid */ 185#define NFS_INO_INVALID_ACL 0x0010 /* cached acls are invalid */
189#define NFS_INO_REVAL_PAGECACHE 0x0020 /* must revalidate pagecache */ 186#define NFS_INO_REVAL_PAGECACHE 0x0020 /* must revalidate pagecache */
187#define NFS_INO_REVAL_FORCED 0x0040 /* force revalidation ignoring a delegation */
190 188
191/* 189/*
192 * Bit offsets in flags field 190 * Bit offsets in flags field
@@ -496,21 +494,18 @@ static inline void nfs3_forget_cached_acls(struct inode *inode)
496 494
497/* 495/*
498 * linux/fs/mount_clnt.c 496 * linux/fs/mount_clnt.c
499 * (Used only by nfsroot module)
500 */ 497 */
501extern int nfsroot_mount(struct sockaddr_in *, char *, struct nfs_fh *, 498extern int nfs_mount(struct sockaddr *, size_t, char *, char *,
502 int, int); 499 int, int, struct nfs_fh *);
503 500
504/* 501/*
505 * inline functions 502 * inline functions
506 */ 503 */
507 504
508static inline loff_t 505static inline loff_t nfs_size_to_loff_t(__u64 size)
509nfs_size_to_loff_t(__u64 size)
510{ 506{
511 loff_t maxsz = (((loff_t) ULONG_MAX) << PAGE_CACHE_SHIFT) + PAGE_CACHE_SIZE - 1; 507 if (size > (__u64) OFFSET_MAX - 1)
512 if (size > maxsz) 508 return OFFSET_MAX - 1;
513 return maxsz;
514 return (loff_t) size; 509 return (loff_t) size;
515} 510}
516 511
@@ -557,6 +552,7 @@ extern void * nfs_root_data(void);
557#define NFSDBG_ROOT 0x0080 552#define NFSDBG_ROOT 0x0080
558#define NFSDBG_CALLBACK 0x0100 553#define NFSDBG_CALLBACK 0x0100
559#define NFSDBG_CLIENT 0x0200 554#define NFSDBG_CLIENT 0x0200
555#define NFSDBG_MOUNT 0x0400
560#define NFSDBG_ALL 0xFFFF 556#define NFSDBG_ALL 0xFFFF
561 557
562#ifdef __KERNEL__ 558#ifdef __KERNEL__
diff --git a/include/linux/nfs_fs_sb.h b/include/linux/nfs_fs_sb.h
index 52b4378311c8..0cac49bc0955 100644
--- a/include/linux/nfs_fs_sb.h
+++ b/include/linux/nfs_fs_sb.h
@@ -16,7 +16,6 @@ struct nfs_client {
16#define NFS_CS_INITING 1 /* busy initialising */ 16#define NFS_CS_INITING 1 /* busy initialising */
17 int cl_nfsversion; /* NFS protocol version */ 17 int cl_nfsversion; /* NFS protocol version */
18 unsigned long cl_res_state; /* NFS resources state */ 18 unsigned long cl_res_state; /* NFS resources state */
19#define NFS_CS_RPCIOD 0 /* - rpciod started */
20#define NFS_CS_CALLBACK 1 /* - callback started */ 19#define NFS_CS_CALLBACK 1 /* - callback started */
21#define NFS_CS_IDMAP 2 /* - idmap started */ 20#define NFS_CS_IDMAP 2 /* - idmap started */
22#define NFS_CS_RENEWD 3 /* - renewd started */ 21#define NFS_CS_RENEWD 3 /* - renewd started */
@@ -35,7 +34,8 @@ struct nfs_client {
35 nfs4_verifier cl_confirm; 34 nfs4_verifier cl_confirm;
36 unsigned long cl_state; 35 unsigned long cl_state;
37 36
38 u32 cl_lockowner_id; 37 struct rb_root cl_openowner_id;
38 struct rb_root cl_lockowner_id;
39 39
40 /* 40 /*
41 * The following rwsem ensures exclusive access to the server 41 * The following rwsem ensures exclusive access to the server
@@ -44,9 +44,7 @@ struct nfs_client {
44 struct rw_semaphore cl_sem; 44 struct rw_semaphore cl_sem;
45 45
46 struct list_head cl_delegations; 46 struct list_head cl_delegations;
47 struct list_head cl_state_owners; 47 struct rb_root cl_state_owners;
48 struct list_head cl_unused;
49 int cl_nunused;
50 spinlock_t cl_lock; 48 spinlock_t cl_lock;
51 49
52 unsigned long cl_lease_time; 50 unsigned long cl_lease_time;
diff --git a/include/linux/nfs_mount.h b/include/linux/nfs_mount.h
index cc8b9c59acb8..a3ade89a64d2 100644
--- a/include/linux/nfs_mount.h
+++ b/include/linux/nfs_mount.h
@@ -37,7 +37,7 @@ struct nfs_mount_data {
37 int acdirmin; /* 1 */ 37 int acdirmin; /* 1 */
38 int acdirmax; /* 1 */ 38 int acdirmax; /* 1 */
39 struct sockaddr_in addr; /* 1 */ 39 struct sockaddr_in addr; /* 1 */
40 char hostname[256]; /* 1 */ 40 char hostname[NFS_MAXNAMLEN + 1]; /* 1 */
41 int namlen; /* 2 */ 41 int namlen; /* 2 */
42 unsigned int bsize; /* 3 */ 42 unsigned int bsize; /* 3 */
43 struct nfs3_fh root; /* 4 */ 43 struct nfs3_fh root; /* 4 */
@@ -62,6 +62,7 @@ struct nfs_mount_data {
62#define NFS_MOUNT_STRICTLOCK 0x1000 /* reserved for NFSv4 */ 62#define NFS_MOUNT_STRICTLOCK 0x1000 /* reserved for NFSv4 */
63#define NFS_MOUNT_SECFLAVOUR 0x2000 /* 5 */ 63#define NFS_MOUNT_SECFLAVOUR 0x2000 /* 5 */
64#define NFS_MOUNT_NORDIRPLUS 0x4000 /* 5 */ 64#define NFS_MOUNT_NORDIRPLUS 0x4000 /* 5 */
65#define NFS_MOUNT_UNSHARED 0x8000 /* 5 */
65#define NFS_MOUNT_FLAGMASK 0xFFFF 66#define NFS_MOUNT_FLAGMASK 0xFFFF
66 67
67#endif 68#endif
diff --git a/include/linux/nfs_page.h b/include/linux/nfs_page.h
index bd193af80162..78e60798d10e 100644
--- a/include/linux/nfs_page.h
+++ b/include/linux/nfs_page.h
@@ -16,12 +16,13 @@
16#include <linux/sunrpc/auth.h> 16#include <linux/sunrpc/auth.h>
17#include <linux/nfs_xdr.h> 17#include <linux/nfs_xdr.h>
18 18
19#include <asm/atomic.h> 19#include <linux/kref.h>
20 20
21/* 21/*
22 * Valid flags for the radix tree 22 * Valid flags for the radix tree
23 */ 23 */
24#define NFS_PAGE_TAG_WRITEBACK 0 24#define NFS_PAGE_TAG_LOCKED 0
25#define NFS_PAGE_TAG_COMMIT 1
25 26
26/* 27/*
27 * Valid flags for a dirty buffer 28 * Valid flags for a dirty buffer
@@ -33,8 +34,7 @@
33 34
34struct nfs_inode; 35struct nfs_inode;
35struct nfs_page { 36struct nfs_page {
36 struct list_head wb_list, /* Defines state of page: */ 37 struct list_head wb_list; /* Defines state of page: */
37 *wb_list_head; /* read/write/commit */
38 struct page *wb_page; /* page to read in/write out */ 38 struct page *wb_page; /* page to read in/write out */
39 struct nfs_open_context *wb_context; /* File state context info */ 39 struct nfs_open_context *wb_context; /* File state context info */
40 atomic_t wb_complete; /* i/os we're waiting for */ 40 atomic_t wb_complete; /* i/os we're waiting for */
@@ -42,7 +42,7 @@ struct nfs_page {
42 unsigned int wb_offset, /* Offset & ~PAGE_CACHE_MASK */ 42 unsigned int wb_offset, /* Offset & ~PAGE_CACHE_MASK */
43 wb_pgbase, /* Start of page data */ 43 wb_pgbase, /* Start of page data */
44 wb_bytes; /* Length of request */ 44 wb_bytes; /* Length of request */
45 atomic_t wb_count; /* reference count */ 45 struct kref wb_kref; /* reference count */
46 unsigned long wb_flags; 46 unsigned long wb_flags;
47 struct nfs_writeverf wb_verf; /* Commit cookie */ 47 struct nfs_writeverf wb_verf; /* Commit cookie */
48}; 48};
@@ -71,8 +71,8 @@ extern void nfs_clear_request(struct nfs_page *req);
71extern void nfs_release_request(struct nfs_page *req); 71extern void nfs_release_request(struct nfs_page *req);
72 72
73 73
74extern int nfs_scan_list(struct nfs_inode *nfsi, struct list_head *head, struct list_head *dst, 74extern int nfs_scan_list(struct nfs_inode *nfsi, struct list_head *dst,
75 pgoff_t idx_start, unsigned int npages); 75 pgoff_t idx_start, unsigned int npages, int tag);
76extern void nfs_pageio_init(struct nfs_pageio_descriptor *desc, 76extern void nfs_pageio_init(struct nfs_pageio_descriptor *desc,
77 struct inode *inode, 77 struct inode *inode,
78 int (*doio)(struct inode *, struct list_head *, unsigned int, size_t, int), 78 int (*doio)(struct inode *, struct list_head *, unsigned int, size_t, int),
@@ -84,12 +84,11 @@ extern void nfs_pageio_complete(struct nfs_pageio_descriptor *desc);
84extern void nfs_pageio_cond_complete(struct nfs_pageio_descriptor *, pgoff_t); 84extern void nfs_pageio_cond_complete(struct nfs_pageio_descriptor *, pgoff_t);
85extern int nfs_wait_on_request(struct nfs_page *); 85extern int nfs_wait_on_request(struct nfs_page *);
86extern void nfs_unlock_request(struct nfs_page *req); 86extern void nfs_unlock_request(struct nfs_page *req);
87extern int nfs_set_page_writeback_locked(struct nfs_page *req); 87extern void nfs_clear_page_tag_locked(struct nfs_page *req);
88extern void nfs_clear_page_writeback(struct nfs_page *req);
89 88
90 89
91/* 90/*
92 * Lock the page of an asynchronous request without incrementing the wb_count 91 * Lock the page of an asynchronous request without getting a new reference
93 */ 92 */
94static inline int 93static inline int
95nfs_lock_request_dontget(struct nfs_page *req) 94nfs_lock_request_dontget(struct nfs_page *req)
@@ -98,14 +97,14 @@ nfs_lock_request_dontget(struct nfs_page *req)
98} 97}
99 98
100/* 99/*
101 * Lock the page of an asynchronous request 100 * Lock the page of an asynchronous request and take a reference
102 */ 101 */
103static inline int 102static inline int
104nfs_lock_request(struct nfs_page *req) 103nfs_lock_request(struct nfs_page *req)
105{ 104{
106 if (test_and_set_bit(PG_BUSY, &req->wb_flags)) 105 if (test_and_set_bit(PG_BUSY, &req->wb_flags))
107 return 0; 106 return 0;
108 atomic_inc(&req->wb_count); 107 kref_get(&req->wb_kref);
109 return 1; 108 return 1;
110} 109}
111 110
@@ -118,7 +117,6 @@ static inline void
118nfs_list_add_request(struct nfs_page *req, struct list_head *head) 117nfs_list_add_request(struct nfs_page *req, struct list_head *head)
119{ 118{
120 list_add_tail(&req->wb_list, head); 119 list_add_tail(&req->wb_list, head);
121 req->wb_list_head = head;
122} 120}
123 121
124 122
@@ -132,7 +130,6 @@ nfs_list_remove_request(struct nfs_page *req)
132 if (list_empty(&req->wb_list)) 130 if (list_empty(&req->wb_list))
133 return; 131 return;
134 list_del_init(&req->wb_list); 132 list_del_init(&req->wb_list);
135 req->wb_list_head = NULL;
136} 133}
137 134
138static inline struct nfs_page * 135static inline struct nfs_page *
diff --git a/include/linux/nfs_xdr.h b/include/linux/nfs_xdr.h
index 10c26ed0db71..38d77681cf27 100644
--- a/include/linux/nfs_xdr.h
+++ b/include/linux/nfs_xdr.h
@@ -119,7 +119,7 @@ struct nfs_openargs {
119 struct nfs_seqid * seqid; 119 struct nfs_seqid * seqid;
120 int open_flags; 120 int open_flags;
121 __u64 clientid; 121 __u64 clientid;
122 __u32 id; 122 __u64 id;
123 union { 123 union {
124 struct iattr * attrs; /* UNCHECKED, GUARDED */ 124 struct iattr * attrs; /* UNCHECKED, GUARDED */
125 nfs4_verifier verifier; /* EXCLUSIVE */ 125 nfs4_verifier verifier; /* EXCLUSIVE */
@@ -144,6 +144,7 @@ struct nfs_openres {
144 nfs4_stateid delegation; 144 nfs4_stateid delegation;
145 __u32 do_recall; 145 __u32 do_recall;
146 __u64 maxsize; 146 __u64 maxsize;
147 __u32 attrset[NFS4_BITMAP_SIZE];
147}; 148};
148 149
149/* 150/*
@@ -180,7 +181,7 @@ struct nfs_closeres {
180 * */ 181 * */
181struct nfs_lowner { 182struct nfs_lowner {
182 __u64 clientid; 183 __u64 clientid;
183 u32 id; 184 __u64 id;
184}; 185};
185 186
186struct nfs_lock_args { 187struct nfs_lock_args {
diff --git a/include/linux/nfsd/export.h b/include/linux/nfsd/export.h
index 9f62d6182d32..78feb7beff75 100644
--- a/include/linux/nfsd/export.h
+++ b/include/linux/nfsd/export.h
@@ -42,6 +42,9 @@
42#define NFSEXP_NOACL 0x8000 /* reserved for possible ACL related use */ 42#define NFSEXP_NOACL 0x8000 /* reserved for possible ACL related use */
43#define NFSEXP_ALLFLAGS 0xFE3F 43#define NFSEXP_ALLFLAGS 0xFE3F
44 44
45/* The flags that may vary depending on security flavor: */
46#define NFSEXP_SECINFO_FLAGS (NFSEXP_READONLY | NFSEXP_ROOTSQUASH \
47 | NFSEXP_ALLSQUASH)
45 48
46#ifdef __KERNEL__ 49#ifdef __KERNEL__
47 50
@@ -64,6 +67,19 @@ struct nfsd4_fs_locations {
64 int migrated; 67 int migrated;
65}; 68};
66 69
70/*
71 * We keep an array of pseudoflavors with the export, in order from most
72 * to least preferred. For the forseeable future, we don't expect more
73 * than the eight pseudoflavors null, unix, krb5, krb5i, krb5p, skpm3,
74 * spkm3i, and spkm3p (and using all 8 at once should be rare).
75 */
76#define MAX_SECINFO_LIST 8
77
78struct exp_flavor_info {
79 u32 pseudoflavor;
80 u32 flags;
81};
82
67struct svc_export { 83struct svc_export {
68 struct cache_head h; 84 struct cache_head h;
69 struct auth_domain * ex_client; 85 struct auth_domain * ex_client;
@@ -76,6 +92,8 @@ struct svc_export {
76 int ex_fsid; 92 int ex_fsid;
77 unsigned char * ex_uuid; /* 16 byte fsid */ 93 unsigned char * ex_uuid; /* 16 byte fsid */
78 struct nfsd4_fs_locations ex_fslocs; 94 struct nfsd4_fs_locations ex_fslocs;
95 int ex_nflavors;
96 struct exp_flavor_info ex_flavors[MAX_SECINFO_LIST];
79}; 97};
80 98
81/* an "export key" (expkey) maps a filehandlefragement to an 99/* an "export key" (expkey) maps a filehandlefragement to an
@@ -95,10 +113,22 @@ struct svc_expkey {
95 113
96#define EX_SECURE(exp) (!((exp)->ex_flags & NFSEXP_INSECURE_PORT)) 114#define EX_SECURE(exp) (!((exp)->ex_flags & NFSEXP_INSECURE_PORT))
97#define EX_ISSYNC(exp) (!((exp)->ex_flags & NFSEXP_ASYNC)) 115#define EX_ISSYNC(exp) (!((exp)->ex_flags & NFSEXP_ASYNC))
98#define EX_RDONLY(exp) ((exp)->ex_flags & NFSEXP_READONLY)
99#define EX_NOHIDE(exp) ((exp)->ex_flags & NFSEXP_NOHIDE) 116#define EX_NOHIDE(exp) ((exp)->ex_flags & NFSEXP_NOHIDE)
100#define EX_WGATHER(exp) ((exp)->ex_flags & NFSEXP_GATHERED_WRITES) 117#define EX_WGATHER(exp) ((exp)->ex_flags & NFSEXP_GATHERED_WRITES)
101 118
119static inline int EX_RDONLY(struct svc_export *exp, struct svc_rqst *rqstp)
120{
121 struct exp_flavor_info *f;
122 struct exp_flavor_info *end = exp->ex_flavors + exp->ex_nflavors;
123
124 for (f = exp->ex_flavors; f < end; f++) {
125 if (f->pseudoflavor == rqstp->rq_flavor)
126 return f->flags & NFSEXP_READONLY;
127 }
128 return exp->ex_flags & NFSEXP_READONLY;
129}
130
131__be32 check_nfsd_access(struct svc_export *exp, struct svc_rqst *rqstp);
102 132
103/* 133/*
104 * Function declarations 134 * Function declarations
@@ -112,13 +142,19 @@ struct svc_export * exp_get_by_name(struct auth_domain *clp,
112 struct vfsmount *mnt, 142 struct vfsmount *mnt,
113 struct dentry *dentry, 143 struct dentry *dentry,
114 struct cache_req *reqp); 144 struct cache_req *reqp);
145struct svc_export * rqst_exp_get_by_name(struct svc_rqst *,
146 struct vfsmount *,
147 struct dentry *);
115struct svc_export * exp_parent(struct auth_domain *clp, 148struct svc_export * exp_parent(struct auth_domain *clp,
116 struct vfsmount *mnt, 149 struct vfsmount *mnt,
117 struct dentry *dentry, 150 struct dentry *dentry,
118 struct cache_req *reqp); 151 struct cache_req *reqp);
152struct svc_export * rqst_exp_parent(struct svc_rqst *,
153 struct vfsmount *mnt,
154 struct dentry *dentry);
119int exp_rootfh(struct auth_domain *, 155int exp_rootfh(struct auth_domain *,
120 char *path, struct knfsd_fh *, int maxsize); 156 char *path, struct knfsd_fh *, int maxsize);
121__be32 exp_pseudoroot(struct auth_domain *, struct svc_fh *fhp, struct cache_req *creq); 157__be32 exp_pseudoroot(struct svc_rqst *, struct svc_fh *);
122__be32 nfserrno(int errno); 158__be32 nfserrno(int errno);
123 159
124extern struct cache_detail svc_export_cache; 160extern struct cache_detail svc_export_cache;
@@ -135,6 +171,7 @@ static inline void exp_get(struct svc_export *exp)
135extern struct svc_export * 171extern struct svc_export *
136exp_find(struct auth_domain *clp, int fsid_type, u32 *fsidv, 172exp_find(struct auth_domain *clp, int fsid_type, u32 *fsidv,
137 struct cache_req *reqp); 173 struct cache_req *reqp);
174struct svc_export * rqst_exp_find(struct svc_rqst *, int, u32 *);
138 175
139#endif /* __KERNEL__ */ 176#endif /* __KERNEL__ */
140 177
diff --git a/include/linux/nfsd/interface.h b/include/linux/nfsd/interface.h
deleted file mode 100644
index af0979704afb..000000000000
--- a/include/linux/nfsd/interface.h
+++ /dev/null
@@ -1,13 +0,0 @@
1/*
2 * include/linux/nfsd/interface.h
3 *
4 * defines interface between nfsd and other bits of
5 * the kernel. Particularly filesystems (eventually).
6 *
7 * Copyright (C) 2000 Neil Brown <neilb@cse.unsw.edu.au>
8 */
9
10#ifndef LINUX_NFSD_INTERFACE_H
11#define LINUX_NFSD_INTERFACE_H
12
13#endif /* LINUX_NFSD_INTERFACE_H */
diff --git a/include/linux/nfsd/nfsd.h b/include/linux/nfsd/nfsd.h
index 72feac581aa3..e452256d3f72 100644
--- a/include/linux/nfsd/nfsd.h
+++ b/include/linux/nfsd/nfsd.h
@@ -22,7 +22,6 @@
22#include <linux/nfsd/export.h> 22#include <linux/nfsd/export.h>
23#include <linux/nfsd/auth.h> 23#include <linux/nfsd/auth.h>
24#include <linux/nfsd/stats.h> 24#include <linux/nfsd/stats.h>
25#include <linux/nfsd/interface.h>
26/* 25/*
27 * nfsd version 26 * nfsd version
28 */ 27 */
@@ -72,6 +71,9 @@ int nfsd_cross_mnt(struct svc_rqst *rqstp, struct dentry **dpp,
72 struct svc_export **expp); 71 struct svc_export **expp);
73__be32 nfsd_lookup(struct svc_rqst *, struct svc_fh *, 72__be32 nfsd_lookup(struct svc_rqst *, struct svc_fh *,
74 const char *, int, struct svc_fh *); 73 const char *, int, struct svc_fh *);
74__be32 nfsd_lookup_dentry(struct svc_rqst *, struct svc_fh *,
75 const char *, int,
76 struct svc_export **, struct dentry **);
75__be32 nfsd_setattr(struct svc_rqst *, struct svc_fh *, 77__be32 nfsd_setattr(struct svc_rqst *, struct svc_fh *,
76 struct iattr *, int, time_t); 78 struct iattr *, int, time_t);
77#ifdef CONFIG_NFSD_V4 79#ifdef CONFIG_NFSD_V4
@@ -120,7 +122,8 @@ __be32 nfsd_statfs(struct svc_rqst *, struct svc_fh *,
120 struct kstatfs *); 122 struct kstatfs *);
121 123
122int nfsd_notify_change(struct inode *, struct iattr *); 124int nfsd_notify_change(struct inode *, struct iattr *);
123__be32 nfsd_permission(struct svc_export *, struct dentry *, int); 125__be32 nfsd_permission(struct svc_rqst *, struct svc_export *,
126 struct dentry *, int);
124int nfsd_sync_dir(struct dentry *dp); 127int nfsd_sync_dir(struct dentry *dp);
125 128
126#if defined(CONFIG_NFSD_V2_ACL) || defined(CONFIG_NFSD_V3_ACL) 129#if defined(CONFIG_NFSD_V2_ACL) || defined(CONFIG_NFSD_V3_ACL)
@@ -149,6 +152,7 @@ extern int nfsd_max_blksize;
149 * NFSv4 State 152 * NFSv4 State
150 */ 153 */
151#ifdef CONFIG_NFSD_V4 154#ifdef CONFIG_NFSD_V4
155extern unsigned int max_delegations;
152void nfs4_state_init(void); 156void nfs4_state_init(void);
153int nfs4_state_start(void); 157int nfs4_state_start(void);
154void nfs4_state_shutdown(void); 158void nfs4_state_shutdown(void);
@@ -236,6 +240,7 @@ void nfsd_lockd_shutdown(void);
236#define nfserr_badname __constant_htonl(NFSERR_BADNAME) 240#define nfserr_badname __constant_htonl(NFSERR_BADNAME)
237#define nfserr_cb_path_down __constant_htonl(NFSERR_CB_PATH_DOWN) 241#define nfserr_cb_path_down __constant_htonl(NFSERR_CB_PATH_DOWN)
238#define nfserr_locked __constant_htonl(NFSERR_LOCKED) 242#define nfserr_locked __constant_htonl(NFSERR_LOCKED)
243#define nfserr_wrongsec __constant_htonl(NFSERR_WRONGSEC)
239#define nfserr_replay_me __constant_htonl(NFSERR_REPLAY_ME) 244#define nfserr_replay_me __constant_htonl(NFSERR_REPLAY_ME)
240 245
241/* error codes for internal use */ 246/* error codes for internal use */
diff --git a/include/linux/nfsd/state.h b/include/linux/nfsd/state.h
index ab5c236bd9a7..db348f749376 100644
--- a/include/linux/nfsd/state.h
+++ b/include/linux/nfsd/state.h
@@ -67,7 +67,7 @@ struct nfs4_cb_recall {
67 int cbr_trunc; 67 int cbr_trunc;
68 stateid_t cbr_stateid; 68 stateid_t cbr_stateid;
69 u32 cbr_fhlen; 69 u32 cbr_fhlen;
70 u32 cbr_fhval[NFS4_FHSIZE]; 70 char cbr_fhval[NFS4_FHSIZE];
71 struct nfs4_delegation *cbr_dp; 71 struct nfs4_delegation *cbr_dp;
72}; 72};
73 73
@@ -224,6 +224,7 @@ struct nfs4_file {
224 struct inode *fi_inode; 224 struct inode *fi_inode;
225 u32 fi_id; /* used with stateowner->so_id 225 u32 fi_id; /* used with stateowner->so_id
226 * for stateid_hashtbl hash */ 226 * for stateid_hashtbl hash */
227 bool fi_had_conflict;
227}; 228};
228 229
229/* 230/*
diff --git a/include/linux/nfsd/xdr4.h b/include/linux/nfsd/xdr4.h
index 09799bcee0ac..1b653267133a 100644
--- a/include/linux/nfsd/xdr4.h
+++ b/include/linux/nfsd/xdr4.h
@@ -293,6 +293,12 @@ struct nfsd4_rename {
293 struct nfsd4_change_info rn_tinfo; /* response */ 293 struct nfsd4_change_info rn_tinfo; /* response */
294}; 294};
295 295
296struct nfsd4_secinfo {
297 u32 si_namelen; /* request */
298 char *si_name; /* request */
299 struct svc_export *si_exp; /* response */
300};
301
296struct nfsd4_setattr { 302struct nfsd4_setattr {
297 stateid_t sa_stateid; /* request */ 303 stateid_t sa_stateid; /* request */
298 u32 sa_bmval[2]; /* request */ 304 u32 sa_bmval[2]; /* request */
@@ -365,6 +371,7 @@ struct nfsd4_op {
365 struct nfsd4_remove remove; 371 struct nfsd4_remove remove;
366 struct nfsd4_rename rename; 372 struct nfsd4_rename rename;
367 clientid_t renew; 373 clientid_t renew;
374 struct nfsd4_secinfo secinfo;
368 struct nfsd4_setattr setattr; 375 struct nfsd4_setattr setattr;
369 struct nfsd4_setclientid setclientid; 376 struct nfsd4_setclientid setclientid;
370 struct nfsd4_setclientid_confirm setclientid_confirm; 377 struct nfsd4_setclientid_confirm setclientid_confirm;
diff --git a/include/linux/notifier.h b/include/linux/notifier.h
index 9431101bf876..576f2bb34cc8 100644
--- a/include/linux/notifier.h
+++ b/include/linux/notifier.h
@@ -196,6 +196,8 @@ extern int __srcu_notifier_call_chain(struct srcu_notifier_head *nh,
196#define CPU_DEAD 0x0007 /* CPU (unsigned)v dead */ 196#define CPU_DEAD 0x0007 /* CPU (unsigned)v dead */
197#define CPU_LOCK_ACQUIRE 0x0008 /* Acquire all hotcpu locks */ 197#define CPU_LOCK_ACQUIRE 0x0008 /* Acquire all hotcpu locks */
198#define CPU_LOCK_RELEASE 0x0009 /* Release all hotcpu locks */ 198#define CPU_LOCK_RELEASE 0x0009 /* Release all hotcpu locks */
199#define CPU_DYING 0x000A /* CPU (unsigned)v not running any task,
200 * not handling interrupts, soon dead */
199 201
200/* Used for CPU hotplug events occuring while tasks are frozen due to a suspend 202/* Used for CPU hotplug events occuring while tasks are frozen due to a suspend
201 * operation in progress 203 * operation in progress
@@ -208,6 +210,7 @@ extern int __srcu_notifier_call_chain(struct srcu_notifier_head *nh,
208#define CPU_DOWN_PREPARE_FROZEN (CPU_DOWN_PREPARE | CPU_TASKS_FROZEN) 210#define CPU_DOWN_PREPARE_FROZEN (CPU_DOWN_PREPARE | CPU_TASKS_FROZEN)
209#define CPU_DOWN_FAILED_FROZEN (CPU_DOWN_FAILED | CPU_TASKS_FROZEN) 211#define CPU_DOWN_FAILED_FROZEN (CPU_DOWN_FAILED | CPU_TASKS_FROZEN)
210#define CPU_DEAD_FROZEN (CPU_DEAD | CPU_TASKS_FROZEN) 212#define CPU_DEAD_FROZEN (CPU_DEAD | CPU_TASKS_FROZEN)
213#define CPU_DYING_FROZEN (CPU_DYING | CPU_TASKS_FROZEN)
211 214
212#endif /* __KERNEL__ */ 215#endif /* __KERNEL__ */
213#endif /* _LINUX_NOTIFIER_H */ 216#endif /* _LINUX_NOTIFIER_H */
diff --git a/include/linux/nsproxy.h b/include/linux/nsproxy.h
index 189e0dc993ab..ce06188b7a56 100644
--- a/include/linux/nsproxy.h
+++ b/include/linux/nsproxy.h
@@ -28,10 +28,11 @@ struct nsproxy {
28 struct ipc_namespace *ipc_ns; 28 struct ipc_namespace *ipc_ns;
29 struct mnt_namespace *mnt_ns; 29 struct mnt_namespace *mnt_ns;
30 struct pid_namespace *pid_ns; 30 struct pid_namespace *pid_ns;
31 struct user_namespace *user_ns;
31}; 32};
32extern struct nsproxy init_nsproxy; 33extern struct nsproxy init_nsproxy;
33 34
34int copy_namespaces(int flags, struct task_struct *tsk); 35int copy_namespaces(unsigned long flags, struct task_struct *tsk);
35void get_task_namespaces(struct task_struct *tsk); 36void get_task_namespaces(struct task_struct *tsk);
36void free_nsproxy(struct nsproxy *ns); 37void free_nsproxy(struct nsproxy *ns);
37int unshare_nsproxy_namespaces(unsigned long, struct nsproxy **, 38int unshare_nsproxy_namespaces(unsigned long, struct nsproxy **,
diff --git a/include/linux/page-flags.h b/include/linux/page-flags.h
index ae2d79f2107e..731cd2ac3227 100644
--- a/include/linux/page-flags.h
+++ b/include/linux/page-flags.h
@@ -92,6 +92,7 @@
92 92
93/* PG_owner_priv_1 users should have descriptive aliases */ 93/* PG_owner_priv_1 users should have descriptive aliases */
94#define PG_checked PG_owner_priv_1 /* Used by some filesystems */ 94#define PG_checked PG_owner_priv_1 /* Used by some filesystems */
95#define PG_pinned PG_owner_priv_1 /* Xen pinned pagetable */
95 96
96#if (BITS_PER_LONG > 32) 97#if (BITS_PER_LONG > 32)
97/* 98/*
@@ -170,6 +171,10 @@ static inline void SetPageUptodate(struct page *page)
170#define SetPageChecked(page) set_bit(PG_checked, &(page)->flags) 171#define SetPageChecked(page) set_bit(PG_checked, &(page)->flags)
171#define ClearPageChecked(page) clear_bit(PG_checked, &(page)->flags) 172#define ClearPageChecked(page) clear_bit(PG_checked, &(page)->flags)
172 173
174#define PagePinned(page) test_bit(PG_pinned, &(page)->flags)
175#define SetPagePinned(page) set_bit(PG_pinned, &(page)->flags)
176#define ClearPagePinned(page) clear_bit(PG_pinned, &(page)->flags)
177
173#define PageReserved(page) test_bit(PG_reserved, &(page)->flags) 178#define PageReserved(page) test_bit(PG_reserved, &(page)->flags)
174#define SetPageReserved(page) set_bit(PG_reserved, &(page)->flags) 179#define SetPageReserved(page) set_bit(PG_reserved, &(page)->flags)
175#define ClearPageReserved(page) clear_bit(PG_reserved, &(page)->flags) 180#define ClearPageReserved(page) clear_bit(PG_reserved, &(page)->flags)
diff --git a/include/linux/pata_platform.h b/include/linux/pata_platform.h
index 2d5fd647e0e9..5799e8d50623 100644
--- a/include/linux/pata_platform.h
+++ b/include/linux/pata_platform.h
@@ -8,6 +8,11 @@ struct pata_platform_info {
8 * spacing used by ata_std_ports(). 8 * spacing used by ata_std_ports().
9 */ 9 */
10 unsigned int ioport_shift; 10 unsigned int ioport_shift;
11 /*
12 * Indicate platform specific irq types and initial
13 * IRQ flags when call request_irq()
14 */
15 unsigned int irq_flags;
11}; 16};
12 17
13#endif /* __LINUX_PATA_PLATFORM_H */ 18#endif /* __LINUX_PATA_PLATFORM_H */
diff --git a/include/linux/pci.h b/include/linux/pci.h
index fbf3766dac1e..5e84f2e8d54c 100644
--- a/include/linux/pci.h
+++ b/include/linux/pci.h
@@ -111,7 +111,8 @@ enum pcie_reset_state {
111 111
112typedef unsigned short __bitwise pci_bus_flags_t; 112typedef unsigned short __bitwise pci_bus_flags_t;
113enum pci_bus_flags { 113enum pci_bus_flags {
114 PCI_BUS_FLAGS_NO_MSI = (__force pci_bus_flags_t) 1, 114 PCI_BUS_FLAGS_NO_MSI = (__force pci_bus_flags_t) 1,
115 PCI_BUS_FLAGS_NO_MMRBC = (__force pci_bus_flags_t) 2,
115}; 116};
116 117
117struct pci_cap_saved_state { 118struct pci_cap_saved_state {
@@ -138,6 +139,7 @@ struct pci_dev {
138 unsigned short subsystem_vendor; 139 unsigned short subsystem_vendor;
139 unsigned short subsystem_device; 140 unsigned short subsystem_device;
140 unsigned int class; /* 3 bytes: (base,sub,prog-if) */ 141 unsigned int class; /* 3 bytes: (base,sub,prog-if) */
142 u8 revision; /* PCI revision, low byte of class word */
141 u8 hdr_type; /* PCI header type (`multi' flag masked out) */ 143 u8 hdr_type; /* PCI header type (`multi' flag masked out) */
142 u8 rom_base_reg; /* which config register controls the ROM */ 144 u8 rom_base_reg; /* which config register controls the ROM */
143 u8 pin; /* which interrupt pin this device uses */ 145 u8 pin; /* which interrupt pin this device uses */
@@ -313,7 +315,7 @@ struct pci_dynids {
313 315
314/* ---------------------------------------------------------------- */ 316/* ---------------------------------------------------------------- */
315/** PCI Error Recovery System (PCI-ERS). If a PCI device driver provides 317/** PCI Error Recovery System (PCI-ERS). If a PCI device driver provides
316 * a set fof callbacks in struct pci_error_handlers, then that device driver 318 * a set of callbacks in struct pci_error_handlers, then that device driver
317 * will be notified of PCI bus errors, and will be driven to recovery 319 * will be notified of PCI bus errors, and will be driven to recovery
318 * when an error occurs. 320 * when an error occurs.
319 */ 321 */
@@ -370,7 +372,6 @@ struct pci_driver {
370 int (*suspend_late) (struct pci_dev *dev, pm_message_t state); 372 int (*suspend_late) (struct pci_dev *dev, pm_message_t state);
371 int (*resume_early) (struct pci_dev *dev); 373 int (*resume_early) (struct pci_dev *dev);
372 int (*resume) (struct pci_dev *dev); /* Device woken up */ 374 int (*resume) (struct pci_dev *dev); /* Device woken up */
373 int (*enable_wake) (struct pci_dev *dev, pci_power_t state, int enable); /* Enable wake event */
374 void (*shutdown) (struct pci_dev *dev); 375 void (*shutdown) (struct pci_dev *dev);
375 376
376 struct pci_error_handlers *err_handler; 377 struct pci_error_handlers *err_handler;
@@ -431,6 +432,8 @@ extern struct bus_type pci_bus_type;
431 * code, or pci core code. */ 432 * code, or pci core code. */
432extern struct list_head pci_root_buses; /* list of all known PCI buses */ 433extern struct list_head pci_root_buses; /* list of all known PCI buses */
433extern struct list_head pci_devices; /* list of all devices */ 434extern struct list_head pci_devices; /* list of all devices */
435/* Some device drivers need know if pci is initiated */
436extern int no_pci_devices(void);
434 437
435void pcibios_fixup_bus(struct pci_bus *); 438void pcibios_fixup_bus(struct pci_bus *);
436int __must_check pcibios_enable_device(struct pci_dev *, int mask); 439int __must_check pcibios_enable_device(struct pci_dev *, int mask);
@@ -475,7 +478,7 @@ extern void pci_sort_breadthfirst(void);
475/* Generic PCI functions exported to card drivers */ 478/* Generic PCI functions exported to card drivers */
476 479
477struct pci_dev __deprecated *pci_find_device (unsigned int vendor, unsigned int device, const struct pci_dev *from); 480struct pci_dev __deprecated *pci_find_device (unsigned int vendor, unsigned int device, const struct pci_dev *from);
478struct pci_dev *pci_find_slot (unsigned int bus, unsigned int devfn); 481struct pci_dev __deprecated *pci_find_slot (unsigned int bus, unsigned int devfn);
479int pci_find_capability (struct pci_dev *dev, int cap); 482int pci_find_capability (struct pci_dev *dev, int cap);
480int pci_find_next_capability (struct pci_dev *dev, u8 pos, int cap); 483int pci_find_next_capability (struct pci_dev *dev, u8 pos, int cap);
481int pci_find_ext_capability (struct pci_dev *dev, int cap); 484int pci_find_ext_capability (struct pci_dev *dev, int cap);
@@ -544,11 +547,16 @@ void pci_set_master(struct pci_dev *dev);
544int pci_set_pcie_reset_state(struct pci_dev *dev, enum pcie_reset_state state); 547int pci_set_pcie_reset_state(struct pci_dev *dev, enum pcie_reset_state state);
545#define HAVE_PCI_SET_MWI 548#define HAVE_PCI_SET_MWI
546int __must_check pci_set_mwi(struct pci_dev *dev); 549int __must_check pci_set_mwi(struct pci_dev *dev);
550int pci_try_set_mwi(struct pci_dev *dev);
547void pci_clear_mwi(struct pci_dev *dev); 551void pci_clear_mwi(struct pci_dev *dev);
548void pci_intx(struct pci_dev *dev, int enable); 552void pci_intx(struct pci_dev *dev, int enable);
549void pci_msi_off(struct pci_dev *dev); 553void pci_msi_off(struct pci_dev *dev);
550int pci_set_dma_mask(struct pci_dev *dev, u64 mask); 554int pci_set_dma_mask(struct pci_dev *dev, u64 mask);
551int pci_set_consistent_dma_mask(struct pci_dev *dev, u64 mask); 555int pci_set_consistent_dma_mask(struct pci_dev *dev, u64 mask);
556int pcix_get_max_mmrbc(struct pci_dev *dev);
557int pcix_get_mmrbc(struct pci_dev *dev);
558int pcix_set_mmrbc(struct pci_dev *dev, int mmrbc);
559int pcie_set_readrq(struct pci_dev *dev, int rq);
552void pci_update_resource(struct pci_dev *dev, struct resource *res, int resno); 560void pci_update_resource(struct pci_dev *dev, struct resource *res, int resno);
553int __must_check pci_assign_resource(struct pci_dev *dev, int i); 561int __must_check pci_assign_resource(struct pci_dev *dev, int i);
554int __must_check pci_assign_resource_fixed(struct pci_dev *dev, int i); 562int __must_check pci_assign_resource_fixed(struct pci_dev *dev, int i);
@@ -560,6 +568,7 @@ void __iomem __must_check *pci_map_rom(struct pci_dev *pdev, size_t *size);
560void __iomem __must_check *pci_map_rom_copy(struct pci_dev *pdev, size_t *size); 568void __iomem __must_check *pci_map_rom_copy(struct pci_dev *pdev, size_t *size);
561void pci_unmap_rom(struct pci_dev *pdev, void __iomem *rom); 569void pci_unmap_rom(struct pci_dev *pdev, void __iomem *rom);
562void pci_remove_rom(struct pci_dev *pdev); 570void pci_remove_rom(struct pci_dev *pdev);
571size_t pci_get_rom_size(void __iomem *rom, size_t size);
563 572
564/* Power management related routines */ 573/* Power management related routines */
565int pci_save_state(struct pci_dev *dev); 574int pci_save_state(struct pci_dev *dev);
@@ -717,6 +726,7 @@ static inline struct pci_dev *pci_get_class(unsigned int class, struct pci_dev *
717{ return NULL; } 726{ return NULL; }
718 727
719#define pci_dev_present(ids) (0) 728#define pci_dev_present(ids) (0)
729#define no_pci_devices() (1)
720#define pci_find_present(ids) (NULL) 730#define pci_find_present(ids) (NULL)
721#define pci_dev_put(dev) do { } while (0) 731#define pci_dev_put(dev) do { } while (0)
722 732
@@ -748,6 +758,17 @@ static inline void pci_release_regions(struct pci_dev *dev) { }
748static inline void pci_block_user_cfg_access(struct pci_dev *dev) { } 758static inline void pci_block_user_cfg_access(struct pci_dev *dev) { }
749static inline void pci_unblock_user_cfg_access(struct pci_dev *dev) { } 759static inline void pci_unblock_user_cfg_access(struct pci_dev *dev) { }
750 760
761static inline struct pci_bus *pci_find_next_bus(const struct pci_bus *from)
762{ return NULL; }
763
764static inline struct pci_dev *pci_get_slot(struct pci_bus *bus,
765 unsigned int devfn)
766{ return NULL; }
767
768static inline struct pci_dev *pci_get_bus_and_slot(unsigned int bus,
769 unsigned int devfn)
770{ return NULL; }
771
751#endif /* CONFIG_PCI */ 772#endif /* CONFIG_PCI */
752 773
753/* Include architecture-dependent settings and functions */ 774/* Include architecture-dependent settings and functions */
@@ -865,5 +886,7 @@ extern int pci_pci_problems;
865extern unsigned long pci_cardbus_io_size; 886extern unsigned long pci_cardbus_io_size;
866extern unsigned long pci_cardbus_mem_size; 887extern unsigned long pci_cardbus_mem_size;
867 888
889extern int pcibios_add_platform_entries(struct pci_dev *dev);
890
868#endif /* __KERNEL__ */ 891#endif /* __KERNEL__ */
869#endif /* LINUX_PCI_H */ 892#endif /* LINUX_PCI_H */
diff --git a/include/linux/pci_ids.h b/include/linux/pci_ids.h
index 9a03b47da603..2c7add169539 100644
--- a/include/linux/pci_ids.h
+++ b/include/linux/pci_ids.h
@@ -133,6 +133,9 @@
133 133
134/* Vendors and devices. Sort key: vendor first, device next. */ 134/* Vendors and devices. Sort key: vendor first, device next. */
135 135
136#define PCI_VENDOR_ID_TTTECH 0x0357
137#define PCI_DEVICE_ID_TTTECH_MC322 0x000a
138
136#define PCI_VENDOR_ID_DYNALINK 0x0675 139#define PCI_VENDOR_ID_DYNALINK 0x0675
137#define PCI_DEVICE_ID_DYNALINK_IS64PH 0x1702 140#define PCI_DEVICE_ID_DYNALINK_IS64PH 0x1702
138 141
@@ -371,6 +374,7 @@
371#define PCI_DEVICE_ID_ATI_IXP600_SMBUS 0x4385 374#define PCI_DEVICE_ID_ATI_IXP600_SMBUS 0x4385
372#define PCI_DEVICE_ID_ATI_IXP600_IDE 0x438c 375#define PCI_DEVICE_ID_ATI_IXP600_IDE 0x438c
373#define PCI_DEVICE_ID_ATI_IXP700_SATA 0x4390 376#define PCI_DEVICE_ID_ATI_IXP700_SATA 0x4390
377#define PCI_DEVICE_ID_ATI_IXP700_SMBUS 0x4395
374#define PCI_DEVICE_ID_ATI_IXP700_IDE 0x439c 378#define PCI_DEVICE_ID_ATI_IXP700_IDE 0x439c
375 379
376#define PCI_VENDOR_ID_VLSI 0x1004 380#define PCI_VENDOR_ID_VLSI 0x1004
@@ -475,6 +479,9 @@
475#define PCI_DEVICE_ID_IBM_ICOM_V2_ONE_PORT_RVX_ONE_PORT_MDM_PCIE 0x0361 479#define PCI_DEVICE_ID_IBM_ICOM_V2_ONE_PORT_RVX_ONE_PORT_MDM_PCIE 0x0361
476#define PCI_DEVICE_ID_IBM_ICOM_FOUR_PORT_MODEL 0x252 480#define PCI_DEVICE_ID_IBM_ICOM_FOUR_PORT_MODEL 0x252
477 481
482#define PCI_VENDOR_ID_UNISYS 0x1018
483#define PCI_DEVICE_ID_UNISYS_DMA_DIRECTOR 0x001C
484
478#define PCI_VENDOR_ID_COMPEX2 0x101a /* pci.ids says "AT&T GIS (NCR)" */ 485#define PCI_VENDOR_ID_COMPEX2 0x101a /* pci.ids says "AT&T GIS (NCR)" */
479#define PCI_DEVICE_ID_COMPEX2_100VG 0x0005 486#define PCI_DEVICE_ID_COMPEX2_100VG 0x0005
480 487
@@ -661,6 +668,7 @@
661#define PCI_DEVICE_ID_SI_965 0x0965 668#define PCI_DEVICE_ID_SI_965 0x0965
662#define PCI_DEVICE_ID_SI_966 0x0966 669#define PCI_DEVICE_ID_SI_966 0x0966
663#define PCI_DEVICE_ID_SI_968 0x0968 670#define PCI_DEVICE_ID_SI_968 0x0968
671#define PCI_DEVICE_ID_SI_1180 0x1180
664#define PCI_DEVICE_ID_SI_5511 0x5511 672#define PCI_DEVICE_ID_SI_5511 0x5511
665#define PCI_DEVICE_ID_SI_5513 0x5513 673#define PCI_DEVICE_ID_SI_5513 0x5513
666#define PCI_DEVICE_ID_SI_5517 0x5517 674#define PCI_DEVICE_ID_SI_5517 0x5517
@@ -731,7 +739,6 @@
731#define PCI_DEVICE_ID_ELSA_MICROLINK 0x1000 739#define PCI_DEVICE_ID_ELSA_MICROLINK 0x1000
732#define PCI_DEVICE_ID_ELSA_QS3000 0x3000 740#define PCI_DEVICE_ID_ELSA_QS3000 0x3000
733 741
734
735#define PCI_VENDOR_ID_BUSLOGIC 0x104B 742#define PCI_VENDOR_ID_BUSLOGIC 0x104B
736#define PCI_DEVICE_ID_BUSLOGIC_MULTIMASTER_NC 0x0140 743#define PCI_DEVICE_ID_BUSLOGIC_MULTIMASTER_NC 0x0140
737#define PCI_DEVICE_ID_BUSLOGIC_MULTIMASTER 0x1040 744#define PCI_DEVICE_ID_BUSLOGIC_MULTIMASTER 0x1040
@@ -777,7 +784,6 @@
777 784
778#define PCI_VENDOR_ID_SONY 0x104d 785#define PCI_VENDOR_ID_SONY 0x104d
779 786
780
781/* Winbond have two vendor IDs! See 0x10ad as well */ 787/* Winbond have two vendor IDs! See 0x10ad as well */
782#define PCI_VENDOR_ID_WINBOND2 0x1050 788#define PCI_VENDOR_ID_WINBOND2 0x1050
783#define PCI_DEVICE_ID_WINBOND2_89C940F 0x5a5a 789#define PCI_DEVICE_ID_WINBOND2_89C940F 0x5a5a
@@ -815,7 +821,6 @@
815#define PCI_DEVICE_ID_PROMISE_20276 0x5275 821#define PCI_DEVICE_ID_PROMISE_20276 0x5275
816#define PCI_DEVICE_ID_PROMISE_20277 0x7275 822#define PCI_DEVICE_ID_PROMISE_20277 0x7275
817 823
818
819#define PCI_VENDOR_ID_UMC 0x1060 824#define PCI_VENDOR_ID_UMC 0x1060
820#define PCI_DEVICE_ID_UMC_UM8673F 0x0101 825#define PCI_DEVICE_ID_UMC_UM8673F 0x0101
821#define PCI_DEVICE_ID_UMC_UM8886BF 0x673a 826#define PCI_DEVICE_ID_UMC_UM8886BF 0x673a
@@ -831,7 +836,6 @@
831#define PCI_DEVICE_ID_MYLEX_DAC960_BA 0xBA56 836#define PCI_DEVICE_ID_MYLEX_DAC960_BA 0xBA56
832#define PCI_DEVICE_ID_MYLEX_DAC960_GEM 0xB166 837#define PCI_DEVICE_ID_MYLEX_DAC960_GEM 0xB166
833 838
834
835#define PCI_VENDOR_ID_APPLE 0x106b 839#define PCI_VENDOR_ID_APPLE 0x106b
836#define PCI_DEVICE_ID_APPLE_BANDIT 0x0001 840#define PCI_DEVICE_ID_APPLE_BANDIT 0x0001
837#define PCI_DEVICE_ID_APPLE_HYDRA 0x000e 841#define PCI_DEVICE_ID_APPLE_HYDRA 0x000e
@@ -867,7 +871,6 @@
867#define PCI_DEVICE_ID_YAMAHA_744 0x0010 871#define PCI_DEVICE_ID_YAMAHA_744 0x0010
868#define PCI_DEVICE_ID_YAMAHA_754 0x0012 872#define PCI_DEVICE_ID_YAMAHA_754 0x0012
869 873
870
871#define PCI_VENDOR_ID_QLOGIC 0x1077 874#define PCI_VENDOR_ID_QLOGIC 0x1077
872#define PCI_DEVICE_ID_QLOGIC_ISP10160 0x1016 875#define PCI_DEVICE_ID_QLOGIC_ISP10160 0x1016
873#define PCI_DEVICE_ID_QLOGIC_ISP1020 0x1020 876#define PCI_DEVICE_ID_QLOGIC_ISP1020 0x1020
@@ -898,12 +901,9 @@
898#define PCI_DEVICE_ID_CYRIX_5530_AUDIO 0x0103 901#define PCI_DEVICE_ID_CYRIX_5530_AUDIO 0x0103
899#define PCI_DEVICE_ID_CYRIX_5530_VIDEO 0x0104 902#define PCI_DEVICE_ID_CYRIX_5530_VIDEO 0x0104
900 903
901
902
903#define PCI_VENDOR_ID_CONTAQ 0x1080 904#define PCI_VENDOR_ID_CONTAQ 0x1080
904#define PCI_DEVICE_ID_CONTAQ_82C693 0xc693 905#define PCI_DEVICE_ID_CONTAQ_82C693 0xc693
905 906
906
907#define PCI_VENDOR_ID_OLICOM 0x108d 907#define PCI_VENDOR_ID_OLICOM 0x108d
908#define PCI_DEVICE_ID_OLICOM_OC2325 0x0012 908#define PCI_DEVICE_ID_OLICOM_OC2325 0x0012
909#define PCI_DEVICE_ID_OLICOM_OC2183 0x0013 909#define PCI_DEVICE_ID_OLICOM_OC2183 0x0013
@@ -935,23 +935,19 @@
935#define PCI_DEVICE_ID_SII_3112 0x3112 935#define PCI_DEVICE_ID_SII_3112 0x3112
936#define PCI_DEVICE_ID_SII_1210SA 0x0240 936#define PCI_DEVICE_ID_SII_1210SA 0x0240
937 937
938
939#define PCI_VENDOR_ID_BROOKTREE 0x109e 938#define PCI_VENDOR_ID_BROOKTREE 0x109e
940#define PCI_DEVICE_ID_BROOKTREE_878 0x0878 939#define PCI_DEVICE_ID_BROOKTREE_878 0x0878
941#define PCI_DEVICE_ID_BROOKTREE_879 0x0879 940#define PCI_DEVICE_ID_BROOKTREE_879 0x0879
942 941
943
944#define PCI_VENDOR_ID_SGI 0x10a9 942#define PCI_VENDOR_ID_SGI 0x10a9
945#define PCI_DEVICE_ID_SGI_IOC3 0x0003 943#define PCI_DEVICE_ID_SGI_IOC3 0x0003
944#define PCI_DEVICE_ID_SGI_LITHIUM 0x1002
946#define PCI_DEVICE_ID_SGI_IOC4 0x100a 945#define PCI_DEVICE_ID_SGI_IOC4 0x100a
947#define PCI_VENDOR_ID_SGI_LITHIUM 0x1002
948
949 946
950#define PCI_VENDOR_ID_WINBOND 0x10ad 947#define PCI_VENDOR_ID_WINBOND 0x10ad
951#define PCI_DEVICE_ID_WINBOND_82C105 0x0105 948#define PCI_DEVICE_ID_WINBOND_82C105 0x0105
952#define PCI_DEVICE_ID_WINBOND_83C553 0x0565 949#define PCI_DEVICE_ID_WINBOND_83C553 0x0565
953 950
954
955#define PCI_VENDOR_ID_PLX 0x10b5 951#define PCI_VENDOR_ID_PLX 0x10b5
956#define PCI_DEVICE_ID_PLX_R685 0x1030 952#define PCI_DEVICE_ID_PLX_R685 0x1030
957#define PCI_DEVICE_ID_PLX_ROMULUS 0x106a 953#define PCI_DEVICE_ID_PLX_ROMULUS 0x106a
@@ -985,7 +981,6 @@
985#define PCI_DEVICE_ID_3COM_3CR990SVR97 0x9909 981#define PCI_DEVICE_ID_3COM_3CR990SVR97 0x9909
986#define PCI_DEVICE_ID_3COM_3CR990SVR 0x990a 982#define PCI_DEVICE_ID_3COM_3CR990SVR 0x990a
987 983
988
989#define PCI_VENDOR_ID_AL 0x10b9 984#define PCI_VENDOR_ID_AL 0x10b9
990#define PCI_DEVICE_ID_AL_M1533 0x1533 985#define PCI_DEVICE_ID_AL_M1533 0x1533
991#define PCI_DEVICE_ID_AL_M1535 0x1535 986#define PCI_DEVICE_ID_AL_M1535 0x1535
@@ -1008,18 +1003,14 @@
1008#define PCI_DEVICE_ID_AL_M5451 0x5451 1003#define PCI_DEVICE_ID_AL_M5451 0x5451
1009#define PCI_DEVICE_ID_AL_M7101 0x7101 1004#define PCI_DEVICE_ID_AL_M7101 0x7101
1010 1005
1011
1012
1013#define PCI_VENDOR_ID_NEOMAGIC 0x10c8 1006#define PCI_VENDOR_ID_NEOMAGIC 0x10c8
1014#define PCI_DEVICE_ID_NEOMAGIC_NM256AV_AUDIO 0x8005 1007#define PCI_DEVICE_ID_NEOMAGIC_NM256AV_AUDIO 0x8005
1015#define PCI_DEVICE_ID_NEOMAGIC_NM256ZX_AUDIO 0x8006 1008#define PCI_DEVICE_ID_NEOMAGIC_NM256ZX_AUDIO 0x8006
1016#define PCI_DEVICE_ID_NEOMAGIC_NM256XL_PLUS_AUDIO 0x8016 1009#define PCI_DEVICE_ID_NEOMAGIC_NM256XL_PLUS_AUDIO 0x8016
1017 1010
1018
1019#define PCI_VENDOR_ID_TCONRAD 0x10da 1011#define PCI_VENDOR_ID_TCONRAD 0x10da
1020#define PCI_DEVICE_ID_TCONRAD_TOKENRING 0x0508 1012#define PCI_DEVICE_ID_TCONRAD_TOKENRING 0x0508
1021 1013
1022
1023#define PCI_VENDOR_ID_NVIDIA 0x10de 1014#define PCI_VENDOR_ID_NVIDIA 0x10de
1024#define PCI_DEVICE_ID_NVIDIA_TNT 0x0020 1015#define PCI_DEVICE_ID_NVIDIA_TNT 0x0020
1025#define PCI_DEVICE_ID_NVIDIA_TNT2 0x0028 1016#define PCI_DEVICE_ID_NVIDIA_TNT2 0x0028
@@ -1240,9 +1231,6 @@
1240#define PCI_DEVICE_ID_IMS_TT128 0x9128 1231#define PCI_DEVICE_ID_IMS_TT128 0x9128
1241#define PCI_DEVICE_ID_IMS_TT3D 0x9135 1232#define PCI_DEVICE_ID_IMS_TT3D 0x9135
1242 1233
1243
1244
1245
1246#define PCI_VENDOR_ID_INTERG 0x10ea 1234#define PCI_VENDOR_ID_INTERG 0x10ea
1247#define PCI_DEVICE_ID_INTERG_1682 0x1682 1235#define PCI_DEVICE_ID_INTERG_1682 0x1682
1248#define PCI_DEVICE_ID_INTERG_2000 0x2000 1236#define PCI_DEVICE_ID_INTERG_2000 0x2000
@@ -1261,7 +1249,6 @@
1261#define PCI_DEVICE_ID_XILINX_HAMMERFALL_DSP 0x3fc5 1249#define PCI_DEVICE_ID_XILINX_HAMMERFALL_DSP 0x3fc5
1262#define PCI_DEVICE_ID_XILINX_HAMMERFALL_DSP_MADI 0x3fc6 1250#define PCI_DEVICE_ID_XILINX_HAMMERFALL_DSP_MADI 0x3fc6
1263 1251
1264
1265#define PCI_VENDOR_ID_INIT 0x1101 1252#define PCI_VENDOR_ID_INIT 0x1101
1266 1253
1267#define PCI_VENDOR_ID_CREATIVE 0x1102 /* duplicate: ECTIVA */ 1254#define PCI_VENDOR_ID_CREATIVE 0x1102 /* duplicate: ECTIVA */
@@ -1356,7 +1343,6 @@
1356#define PCI_VENDOR_ID_SIEMENS 0x110A 1343#define PCI_VENDOR_ID_SIEMENS 0x110A
1357#define PCI_DEVICE_ID_SIEMENS_DSCC4 0x2102 1344#define PCI_DEVICE_ID_SIEMENS_DSCC4 0x2102
1358 1345
1359
1360#define PCI_VENDOR_ID_VORTEX 0x1119 1346#define PCI_VENDOR_ID_VORTEX 0x1119
1361#define PCI_DEVICE_ID_VORTEX_GDT60x0 0x0000 1347#define PCI_DEVICE_ID_VORTEX_GDT60x0 0x0000
1362#define PCI_DEVICE_ID_VORTEX_GDT6000B 0x0001 1348#define PCI_DEVICE_ID_VORTEX_GDT6000B 0x0001
@@ -1382,8 +1368,8 @@
1382#define PCI_VENDOR_ID_EF 0x111a 1368#define PCI_VENDOR_ID_EF 0x111a
1383#define PCI_DEVICE_ID_EF_ATM_FPGA 0x0000 1369#define PCI_DEVICE_ID_EF_ATM_FPGA 0x0000
1384#define PCI_DEVICE_ID_EF_ATM_ASIC 0x0002 1370#define PCI_DEVICE_ID_EF_ATM_ASIC 0x0002
1385#define PCI_VENDOR_ID_EF_ATM_LANAI2 0x0003 1371#define PCI_DEVICE_ID_EF_ATM_LANAI2 0x0003
1386#define PCI_VENDOR_ID_EF_ATM_LANAIHB 0x0005 1372#define PCI_DEVICE_ID_EF_ATM_LANAIHB 0x0005
1387 1373
1388#define PCI_VENDOR_ID_IDT 0x111d 1374#define PCI_VENDOR_ID_IDT 0x111d
1389#define PCI_DEVICE_ID_IDT_IDT77201 0x0001 1375#define PCI_DEVICE_ID_IDT_IDT77201 0x0001
@@ -1391,7 +1377,6 @@
1391#define PCI_VENDOR_ID_FORE 0x1127 1377#define PCI_VENDOR_ID_FORE 0x1127
1392#define PCI_DEVICE_ID_FORE_PCA200E 0x0300 1378#define PCI_DEVICE_ID_FORE_PCA200E 0x0300
1393 1379
1394
1395#define PCI_VENDOR_ID_PHILIPS 0x1131 1380#define PCI_VENDOR_ID_PHILIPS 0x1131
1396#define PCI_DEVICE_ID_PHILIPS_SAA7146 0x7146 1381#define PCI_DEVICE_ID_PHILIPS_SAA7146 0x7146
1397#define PCI_DEVICE_ID_PHILIPS_SAA9730 0x9730 1382#define PCI_DEVICE_ID_PHILIPS_SAA9730 0x9730
@@ -1410,7 +1395,6 @@
1410#define PCI_DEVICE_ID_ZIATECH_5550_HC 0x5550 1395#define PCI_DEVICE_ID_ZIATECH_5550_HC 0x5550
1411 1396
1412 1397
1413
1414#define PCI_VENDOR_ID_SYSKONNECT 0x1148 1398#define PCI_VENDOR_ID_SYSKONNECT 0x1148
1415#define PCI_DEVICE_ID_SYSKONNECT_TR 0x4200 1399#define PCI_DEVICE_ID_SYSKONNECT_TR 0x4200
1416#define PCI_DEVICE_ID_SYSKONNECT_GE 0x4300 1400#define PCI_DEVICE_ID_SYSKONNECT_GE 0x4300
@@ -1418,7 +1402,6 @@
1418#define PCI_DEVICE_ID_SYSKONNECT_9DXX 0x4400 1402#define PCI_DEVICE_ID_SYSKONNECT_9DXX 0x4400
1419#define PCI_DEVICE_ID_SYSKONNECT_9MXX 0x4500 1403#define PCI_DEVICE_ID_SYSKONNECT_9MXX 0x4500
1420 1404
1421
1422#define PCI_VENDOR_ID_DIGI 0x114f 1405#define PCI_VENDOR_ID_DIGI 0x114f
1423#define PCI_DEVICE_ID_DIGI_DF_M_IOM2_E 0x0070 1406#define PCI_DEVICE_ID_DIGI_DF_M_IOM2_E 0x0070
1424#define PCI_DEVICE_ID_DIGI_DF_M_E 0x0071 1407#define PCI_DEVICE_ID_DIGI_DF_M_E 0x0071
@@ -1429,12 +1412,10 @@
1429#define PCI_DEVICE_ID_NEO_2RJ45 0x00CA 1412#define PCI_DEVICE_ID_NEO_2RJ45 0x00CA
1430#define PCI_DEVICE_ID_NEO_2RJ45PRI 0x00CB 1413#define PCI_DEVICE_ID_NEO_2RJ45PRI 0x00CB
1431 1414
1432
1433#define PCI_VENDOR_ID_XIRCOM 0x115d 1415#define PCI_VENDOR_ID_XIRCOM 0x115d
1434#define PCI_DEVICE_ID_XIRCOM_RBM56G 0x0101 1416#define PCI_DEVICE_ID_XIRCOM_RBM56G 0x0101
1435#define PCI_DEVICE_ID_XIRCOM_X3201_MDM 0x0103 1417#define PCI_DEVICE_ID_XIRCOM_X3201_MDM 0x0103
1436 1418
1437
1438#define PCI_VENDOR_ID_SERVERWORKS 0x1166 1419#define PCI_VENDOR_ID_SERVERWORKS 0x1166
1439#define PCI_DEVICE_ID_SERVERWORKS_HE 0x0008 1420#define PCI_DEVICE_ID_SERVERWORKS_HE 0x0008
1440#define PCI_DEVICE_ID_SERVERWORKS_LE 0x0009 1421#define PCI_DEVICE_ID_SERVERWORKS_LE 0x0009
@@ -1503,7 +1484,6 @@
1503#define PCI_DEVICE_ID_ZEITNET_1221 0x0001 1484#define PCI_DEVICE_ID_ZEITNET_1221 0x0001
1504#define PCI_DEVICE_ID_ZEITNET_1225 0x0002 1485#define PCI_DEVICE_ID_ZEITNET_1225 0x0002
1505 1486
1506
1507#define PCI_VENDOR_ID_FUJITSU_ME 0x119e 1487#define PCI_VENDOR_ID_FUJITSU_ME 0x119e
1508#define PCI_DEVICE_ID_FUJITSU_FS155 0x0001 1488#define PCI_DEVICE_ID_FUJITSU_FS155 0x0001
1509#define PCI_DEVICE_ID_FUJITSU_FS50 0x0003 1489#define PCI_DEVICE_ID_FUJITSU_FS50 0x0003
@@ -1521,28 +1501,23 @@
1521#define PCI_DEVICE_ID_V3_V960 0x0001 1501#define PCI_DEVICE_ID_V3_V960 0x0001
1522#define PCI_DEVICE_ID_V3_V351 0x0002 1502#define PCI_DEVICE_ID_V3_V351 0x0002
1523 1503
1524
1525#define PCI_VENDOR_ID_ATT 0x11c1 1504#define PCI_VENDOR_ID_ATT 0x11c1
1526#define PCI_DEVICE_ID_ATT_VENUS_MODEM 0x480 1505#define PCI_DEVICE_ID_ATT_VENUS_MODEM 0x480
1527 1506
1528
1529#define PCI_VENDOR_ID_SPECIALIX 0x11cb 1507#define PCI_VENDOR_ID_SPECIALIX 0x11cb
1530#define PCI_DEVICE_ID_SPECIALIX_IO8 0x2000 1508#define PCI_DEVICE_ID_SPECIALIX_IO8 0x2000
1531#define PCI_DEVICE_ID_SPECIALIX_RIO 0x8000 1509#define PCI_DEVICE_ID_SPECIALIX_RIO 0x8000
1532#define PCI_SUBDEVICE_ID_SPECIALIX_SPEED4 0xa004 1510#define PCI_SUBDEVICE_ID_SPECIALIX_SPEED4 0xa004
1533 1511
1534
1535#define PCI_VENDOR_ID_ANALOG_DEVICES 0x11d4 1512#define PCI_VENDOR_ID_ANALOG_DEVICES 0x11d4
1536#define PCI_DEVICE_ID_AD1889JS 0x1889 1513#define PCI_DEVICE_ID_AD1889JS 0x1889
1537 1514
1538
1539#define PCI_DEVICE_ID_SEGA_BBA 0x1234 1515#define PCI_DEVICE_ID_SEGA_BBA 0x1234
1540 1516
1541#define PCI_VENDOR_ID_ZORAN 0x11de 1517#define PCI_VENDOR_ID_ZORAN 0x11de
1542#define PCI_DEVICE_ID_ZORAN_36057 0x6057 1518#define PCI_DEVICE_ID_ZORAN_36057 0x6057
1543#define PCI_DEVICE_ID_ZORAN_36120 0x6120 1519#define PCI_DEVICE_ID_ZORAN_36120 0x6120
1544 1520
1545
1546#define PCI_VENDOR_ID_COMPEX 0x11f6 1521#define PCI_VENDOR_ID_COMPEX 0x11f6
1547#define PCI_DEVICE_ID_COMPEX_ENET100VG4 0x0112 1522#define PCI_DEVICE_ID_COMPEX_ENET100VG4 0x0112
1548 1523
@@ -1601,8 +1576,6 @@
1601#define PCI_DEVICE_ID_3DFX_VOODOO3 0x0005 1576#define PCI_DEVICE_ID_3DFX_VOODOO3 0x0005
1602#define PCI_DEVICE_ID_3DFX_VOODOO5 0x0009 1577#define PCI_DEVICE_ID_3DFX_VOODOO5 0x0009
1603 1578
1604
1605
1606#define PCI_VENDOR_ID_AVM 0x1244 1579#define PCI_VENDOR_ID_AVM 0x1244
1607#define PCI_DEVICE_ID_AVM_B1 0x0700 1580#define PCI_DEVICE_ID_AVM_B1 0x0700
1608#define PCI_DEVICE_ID_AVM_C4 0x0800 1581#define PCI_DEVICE_ID_AVM_C4 0x0800
@@ -1611,7 +1584,6 @@
1611#define PCI_DEVICE_ID_AVM_C2 0x1100 1584#define PCI_DEVICE_ID_AVM_C2 0x1100
1612#define PCI_DEVICE_ID_AVM_T1 0x1200 1585#define PCI_DEVICE_ID_AVM_T1 0x1200
1613 1586
1614
1615#define PCI_VENDOR_ID_STALLION 0x124d 1587#define PCI_VENDOR_ID_STALLION 0x124d
1616 1588
1617/* Allied Telesyn */ 1589/* Allied Telesyn */
@@ -1634,7 +1606,6 @@
1634#define PCI_VENDOR_ID_SATSAGEM 0x1267 1606#define PCI_VENDOR_ID_SATSAGEM 0x1267
1635#define PCI_DEVICE_ID_SATSAGEM_NICCY 0x1016 1607#define PCI_DEVICE_ID_SATSAGEM_NICCY 0x1016
1636 1608
1637
1638#define PCI_VENDOR_ID_ENSONIQ 0x1274 1609#define PCI_VENDOR_ID_ENSONIQ 0x1274
1639#define PCI_DEVICE_ID_ENSONIQ_CT5880 0x5880 1610#define PCI_DEVICE_ID_ENSONIQ_CT5880 0x5880
1640#define PCI_DEVICE_ID_ENSONIQ_ES1370 0x5000 1611#define PCI_DEVICE_ID_ENSONIQ_ES1370 0x5000
@@ -1657,7 +1628,6 @@
1657 1628
1658#define PCI_VENDOR_ID_ALTEON 0x12ae 1629#define PCI_VENDOR_ID_ALTEON 0x12ae
1659 1630
1660
1661#define PCI_SUBVENDOR_ID_CONNECT_TECH 0x12c4 1631#define PCI_SUBVENDOR_ID_CONNECT_TECH 0x12c4
1662#define PCI_SUBDEVICE_ID_CONNECT_TECH_BH8_232 0x0001 1632#define PCI_SUBDEVICE_ID_CONNECT_TECH_BH8_232 0x0001
1663#define PCI_SUBDEVICE_ID_CONNECT_TECH_BH4_232 0x0002 1633#define PCI_SUBDEVICE_ID_CONNECT_TECH_BH4_232 0x0002
@@ -1688,7 +1658,6 @@
1688#define PCI_SUBDEVICE_ID_CONNECT_TECH_PCI_UART_4_485 0x0331 1658#define PCI_SUBDEVICE_ID_CONNECT_TECH_PCI_UART_4_485 0x0331
1689#define PCI_SUBDEVICE_ID_CONNECT_TECH_PCI_UART_8_485 0x0332 1659#define PCI_SUBDEVICE_ID_CONNECT_TECH_PCI_UART_8_485 0x0332
1690 1660
1691
1692#define PCI_VENDOR_ID_NVIDIA_SGS 0x12d2 1661#define PCI_VENDOR_ID_NVIDIA_SGS 0x12d2
1693#define PCI_DEVICE_ID_NVIDIA_SGS_RIVA128 0x0018 1662#define PCI_DEVICE_ID_NVIDIA_SGS_RIVA128 0x0018
1694 1663
@@ -1798,7 +1767,6 @@
1798#define PCI_DEVICE_ID_LMC_SSI 0x0005 1767#define PCI_DEVICE_ID_LMC_SSI 0x0005
1799#define PCI_DEVICE_ID_LMC_T1 0x0006 1768#define PCI_DEVICE_ID_LMC_T1 0x0006
1800 1769
1801
1802#define PCI_VENDOR_ID_NETGEAR 0x1385 1770#define PCI_VENDOR_ID_NETGEAR 0x1385
1803#define PCI_DEVICE_ID_NETGEAR_GA620 0x620a 1771#define PCI_DEVICE_ID_NETGEAR_GA620 0x620a
1804 1772
@@ -1901,6 +1869,8 @@
1901#define PCI_DEVICE_ID_OXSEMI_16PCI952 0x9521 1869#define PCI_DEVICE_ID_OXSEMI_16PCI952 0x9521
1902#define PCI_DEVICE_ID_OXSEMI_16PCI952PP 0x9523 1870#define PCI_DEVICE_ID_OXSEMI_16PCI952PP 0x9523
1903 1871
1872#define PCI_VENDOR_ID_CHELSIO 0x1425
1873
1904#define PCI_VENDOR_ID_SAMSUNG 0x144d 1874#define PCI_VENDOR_ID_SAMSUNG 0x144d
1905 1875
1906#define PCI_VENDOR_ID_MYRICOM 0x14c1 1876#define PCI_VENDOR_ID_MYRICOM 0x14c1
@@ -1999,6 +1969,7 @@
1999 1969
2000#define PCI_VENDOR_ID_ENE 0x1524 1970#define PCI_VENDOR_ID_ENE 0x1524
2001#define PCI_DEVICE_ID_ENE_CB712_SD 0x0550 1971#define PCI_DEVICE_ID_ENE_CB712_SD 0x0550
1972#define PCI_DEVICE_ID_ENE_CB712_SD_2 0x0551
2002#define PCI_DEVICE_ID_ENE_1211 0x1211 1973#define PCI_DEVICE_ID_ENE_1211 0x1211
2003#define PCI_DEVICE_ID_ENE_1225 0x1225 1974#define PCI_DEVICE_ID_ENE_1225 0x1225
2004#define PCI_DEVICE_ID_ENE_1410 0x1410 1975#define PCI_DEVICE_ID_ENE_1410 0x1410
@@ -2008,13 +1979,10 @@
2008#define PCI_DEVICE_ID_ENE_720 0x1421 1979#define PCI_DEVICE_ID_ENE_720 0x1421
2009#define PCI_DEVICE_ID_ENE_722 0x1422 1980#define PCI_DEVICE_ID_ENE_722 0x1422
2010 1981
2011#define PCI_VENDOR_ID_CHELSIO 0x1425
2012
2013#define PCI_SUBVENDOR_ID_PERLE 0x155f 1982#define PCI_SUBVENDOR_ID_PERLE 0x155f
2014#define PCI_SUBDEVICE_ID_PCI_RAS4 0xf001 1983#define PCI_SUBDEVICE_ID_PCI_RAS4 0xf001
2015#define PCI_SUBDEVICE_ID_PCI_RAS8 0xf010 1984#define PCI_SUBDEVICE_ID_PCI_RAS8 0xf010
2016 1985
2017
2018#define PCI_VENDOR_ID_SYBA 0x1592 1986#define PCI_VENDOR_ID_SYBA 0x1592
2019#define PCI_DEVICE_ID_SYBA_2P_EPP 0x0782 1987#define PCI_DEVICE_ID_SYBA_2P_EPP 0x0782
2020#define PCI_DEVICE_ID_SYBA_1P_ECP 0x0783 1988#define PCI_DEVICE_ID_SYBA_1P_ECP 0x0783
@@ -2033,8 +2001,10 @@
2033#define PCI_DEVICE_ID_MELLANOX_SINAI_OLD 0x5e8c 2001#define PCI_DEVICE_ID_MELLANOX_SINAI_OLD 0x5e8c
2034#define PCI_DEVICE_ID_MELLANOX_SINAI 0x6274 2002#define PCI_DEVICE_ID_MELLANOX_SINAI 0x6274
2035 2003
2036#define PCI_VENDOR_ID_PDC 0x15e9 2004#define PCI_VENDOR_ID_QUICKNET 0x15e2
2005#define PCI_DEVICE_ID_QUICKNET_XJ 0x0500
2037 2006
2007#define PCI_VENDOR_ID_PDC 0x15e9
2038 2008
2039#define PCI_VENDOR_ID_FARSITE 0x1619 2009#define PCI_VENDOR_ID_FARSITE 0x1619
2040#define PCI_DEVICE_ID_FARSITE_T2P 0x0400 2010#define PCI_DEVICE_ID_FARSITE_T2P 0x0400
@@ -2051,6 +2021,8 @@
2051#define PCI_DEVICE_ID_BCM1250_PCI 0x0001 2021#define PCI_DEVICE_ID_BCM1250_PCI 0x0001
2052#define PCI_DEVICE_ID_BCM1250_HT 0x0002 2022#define PCI_DEVICE_ID_BCM1250_HT 0x0002
2053 2023
2024#define PCI_VENDOR_ID_ATHEROS 0x168c
2025
2054#define PCI_VENDOR_ID_NETCELL 0x169c 2026#define PCI_VENDOR_ID_NETCELL 0x169c
2055#define PCI_DEVICE_ID_REVOLUTION 0x0044 2027#define PCI_DEVICE_ID_REVOLUTION 0x0044
2056 2028
@@ -2089,7 +2061,6 @@
2089#define PCI_DEVICE_ID_HERC_WIN 0x5732 2061#define PCI_DEVICE_ID_HERC_WIN 0x5732
2090#define PCI_DEVICE_ID_HERC_UNI 0x5832 2062#define PCI_DEVICE_ID_HERC_UNI 0x5832
2091 2063
2092
2093#define PCI_VENDOR_ID_SITECOM 0x182d 2064#define PCI_VENDOR_ID_SITECOM 0x182d
2094#define PCI_DEVICE_ID_SITECOM_DC105V2 0x3069 2065#define PCI_DEVICE_ID_SITECOM_DC105V2 0x3069
2095 2066
@@ -2125,12 +2096,9 @@
2125#define PCI_DEVICE_ID_3DLABS_PERMEDIA2 0x0007 2096#define PCI_DEVICE_ID_3DLABS_PERMEDIA2 0x0007
2126#define PCI_DEVICE_ID_3DLABS_PERMEDIA2V 0x0009 2097#define PCI_DEVICE_ID_3DLABS_PERMEDIA2V 0x0009
2127 2098
2128
2129#define PCI_VENDOR_ID_AKS 0x416c 2099#define PCI_VENDOR_ID_AKS 0x416c
2130#define PCI_DEVICE_ID_AKS_ALADDINCARD 0x0100 2100#define PCI_DEVICE_ID_AKS_ALADDINCARD 0x0100
2131 2101
2132
2133
2134#define PCI_VENDOR_ID_S3 0x5333 2102#define PCI_VENDOR_ID_S3 0x5333
2135#define PCI_DEVICE_ID_S3_TRIO 0x8811 2103#define PCI_DEVICE_ID_S3_TRIO 0x8811
2136#define PCI_DEVICE_ID_S3_868 0x8880 2104#define PCI_DEVICE_ID_S3_868 0x8880
@@ -2142,7 +2110,6 @@
2142#define PCI_VENDOR_ID_DUNORD 0x5544 2110#define PCI_VENDOR_ID_DUNORD 0x5544
2143#define PCI_DEVICE_ID_DUNORD_I3000 0x0001 2111#define PCI_DEVICE_ID_DUNORD_I3000 0x0001
2144 2112
2145
2146#define PCI_VENDOR_ID_DCI 0x6666 2113#define PCI_VENDOR_ID_DCI 0x6666
2147#define PCI_DEVICE_ID_DCI_PCCOM4 0x0001 2114#define PCI_DEVICE_ID_DCI_PCCOM4 0x0001
2148#define PCI_DEVICE_ID_DCI_PCCOM8 0x0002 2115#define PCI_DEVICE_ID_DCI_PCCOM8 0x0002
@@ -2386,7 +2353,6 @@
2386#define PCI_DEVICE_ID_ADAPTEC2_OBSIDIAN 0x0500 2353#define PCI_DEVICE_ID_ADAPTEC2_OBSIDIAN 0x0500
2387#define PCI_DEVICE_ID_ADAPTEC2_SCAMP 0x0503 2354#define PCI_DEVICE_ID_ADAPTEC2_SCAMP 0x0503
2388 2355
2389
2390#define PCI_VENDOR_ID_HOLTEK 0x9412 2356#define PCI_VENDOR_ID_HOLTEK 0x9412
2391#define PCI_DEVICE_ID_HOLTEK_6565 0x6565 2357#define PCI_DEVICE_ID_HOLTEK_6565 0x6565
2392 2358
@@ -2402,6 +2368,8 @@
2402#define PCI_DEVICE_ID_NETMOS_9845 0x9845 2368#define PCI_DEVICE_ID_NETMOS_9845 0x9845
2403#define PCI_DEVICE_ID_NETMOS_9855 0x9855 2369#define PCI_DEVICE_ID_NETMOS_9855 0x9855
2404 2370
2371#define PCI_VENDOR_ID_3COM_2 0xa727
2372
2405#define PCI_SUBVENDOR_ID_EXSYS 0xd84d 2373#define PCI_SUBVENDOR_ID_EXSYS 0xd84d
2406#define PCI_SUBDEVICE_ID_EXSYS_4014 0x4014 2374#define PCI_SUBDEVICE_ID_EXSYS_4014 0x4014
2407#define PCI_SUBDEVICE_ID_EXSYS_4055 0x4055 2375#define PCI_SUBDEVICE_ID_EXSYS_4055 0x4055
@@ -2410,13 +2378,7 @@
2410#define PCI_DEVICE_ID_TIGERJET_300 0x0001 2378#define PCI_DEVICE_ID_TIGERJET_300 0x0001
2411#define PCI_DEVICE_ID_TIGERJET_100 0x0002 2379#define PCI_DEVICE_ID_TIGERJET_100 0x0002
2412 2380
2413#define PCI_VENDOR_ID_TTTECH 0x0357
2414#define PCI_DEVICE_ID_TTTECH_MC322 0x000A
2415
2416#define PCI_VENDOR_ID_XILINX_RME 0xea60 2381#define PCI_VENDOR_ID_XILINX_RME 0xea60
2417#define PCI_DEVICE_ID_RME_DIGI32 0x9896 2382#define PCI_DEVICE_ID_RME_DIGI32 0x9896
2418#define PCI_DEVICE_ID_RME_DIGI32_PRO 0x9897 2383#define PCI_DEVICE_ID_RME_DIGI32_PRO 0x9897
2419#define PCI_DEVICE_ID_RME_DIGI32_8 0x9898 2384#define PCI_DEVICE_ID_RME_DIGI32_8 0x9898
2420
2421#define PCI_VENDOR_ID_QUICKNET 0x15E2
2422#define PCI_DEVICE_ID_QUICKNET_XJ 0x0500
diff --git a/include/linux/pda_power.h b/include/linux/pda_power.h
new file mode 100644
index 000000000000..1375f15797e7
--- /dev/null
+++ b/include/linux/pda_power.h
@@ -0,0 +1,31 @@
1/*
2 * Common power driver for PDAs and phones with one or two external
3 * power supplies (AC/USB) connected to main and backup batteries,
4 * and optional builtin charger.
5 *
6 * Copyright © 2007 Anton Vorontsov <cbou@mail.ru>
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 __PDA_POWER_H__
14#define __PDA_POWER_H__
15
16#define PDA_POWER_CHARGE_AC (1 << 0)
17#define PDA_POWER_CHARGE_USB (1 << 1)
18
19struct pda_power_pdata {
20 int (*is_ac_online)(void);
21 int (*is_usb_online)(void);
22 void (*set_charge)(int flags);
23
24 char **supplied_to;
25 size_t num_supplicants;
26
27 unsigned int wait_for_status; /* msecs, default is 500 */
28 unsigned int wait_for_charger; /* msecs, default is 500 */
29};
30
31#endif /* __PDA_POWER_H__ */
diff --git a/include/linux/percpu.h b/include/linux/percpu.h
index b72be2f79e6a..926adaae0f96 100644
--- a/include/linux/percpu.h
+++ b/include/linux/percpu.h
@@ -1,7 +1,7 @@
1#ifndef __LINUX_PERCPU_H 1#ifndef __LINUX_PERCPU_H
2#define __LINUX_PERCPU_H 2#define __LINUX_PERCPU_H
3 3
4#include <linux/spinlock.h> /* For preempt_disable() */ 4#include <linux/preempt.h>
5#include <linux/slab.h> /* For kmalloc() */ 5#include <linux/slab.h> /* For kmalloc() */
6#include <linux/smp.h> 6#include <linux/smp.h>
7#include <linux/string.h> /* For memset() */ 7#include <linux/string.h> /* For memset() */
diff --git a/include/linux/percpu_counter.h b/include/linux/percpu_counter.h
index f5aa593ccf32..3d9f70972cdf 100644
--- a/include/linux/percpu_counter.h
+++ b/include/linux/percpu_counter.h
@@ -8,6 +8,7 @@
8 8
9#include <linux/spinlock.h> 9#include <linux/spinlock.h>
10#include <linux/smp.h> 10#include <linux/smp.h>
11#include <linux/list.h>
11#include <linux/threads.h> 12#include <linux/threads.h>
12#include <linux/percpu.h> 13#include <linux/percpu.h>
13#include <linux/types.h> 14#include <linux/types.h>
@@ -17,6 +18,9 @@
17struct percpu_counter { 18struct percpu_counter {
18 spinlock_t lock; 19 spinlock_t lock;
19 s64 count; 20 s64 count;
21#ifdef CONFIG_HOTPLUG_CPU
22 struct list_head list; /* All percpu_counters are on a list */
23#endif
20 s32 *counters; 24 s32 *counters;
21}; 25};
22 26
@@ -26,18 +30,8 @@ struct percpu_counter {
26#define FBC_BATCH (NR_CPUS*4) 30#define FBC_BATCH (NR_CPUS*4)
27#endif 31#endif
28 32
29static inline void percpu_counter_init(struct percpu_counter *fbc, s64 amount) 33void percpu_counter_init(struct percpu_counter *fbc, s64 amount);
30{ 34void percpu_counter_destroy(struct percpu_counter *fbc);
31 spin_lock_init(&fbc->lock);
32 fbc->count = amount;
33 fbc->counters = alloc_percpu(s32);
34}
35
36static inline void percpu_counter_destroy(struct percpu_counter *fbc)
37{
38 free_percpu(fbc->counters);
39}
40
41void percpu_counter_mod(struct percpu_counter *fbc, s32 amount); 35void percpu_counter_mod(struct percpu_counter *fbc, s32 amount);
42s64 percpu_counter_sum(struct percpu_counter *fbc); 36s64 percpu_counter_sum(struct percpu_counter *fbc);
43 37
diff --git a/include/linux/pid_namespace.h b/include/linux/pid_namespace.h
index 169c6c24209b..b9a17e08ff0f 100644
--- a/include/linux/pid_namespace.h
+++ b/include/linux/pid_namespace.h
@@ -29,7 +29,7 @@ static inline void get_pid_ns(struct pid_namespace *ns)
29 kref_get(&ns->kref); 29 kref_get(&ns->kref);
30} 30}
31 31
32extern struct pid_namespace *copy_pid_ns(int flags, struct pid_namespace *ns); 32extern struct pid_namespace *copy_pid_ns(unsigned long flags, struct pid_namespace *ns);
33extern void free_pid_ns(struct kref *kref); 33extern void free_pid_ns(struct kref *kref);
34 34
35static inline void put_pid_ns(struct pid_namespace *ns) 35static inline void put_pid_ns(struct pid_namespace *ns)
diff --git a/include/linux/pipe_fs_i.h b/include/linux/pipe_fs_i.h
index c8884f971228..8e4120285f72 100644
--- a/include/linux/pipe_fs_i.h
+++ b/include/linux/pipe_fs_i.h
@@ -9,13 +9,39 @@
9#define PIPE_BUF_FLAG_ATOMIC 0x02 /* was atomically mapped */ 9#define PIPE_BUF_FLAG_ATOMIC 0x02 /* was atomically mapped */
10#define PIPE_BUF_FLAG_GIFT 0x04 /* page is a gift */ 10#define PIPE_BUF_FLAG_GIFT 0x04 /* page is a gift */
11 11
12/**
13 * struct pipe_buffer - a linux kernel pipe buffer
14 * @page: the page containing the data for the pipe buffer
15 * @offset: offset of data inside the @page
16 * @len: length of data inside the @page
17 * @ops: operations associated with this buffer. See @pipe_buf_operations.
18 * @flags: pipe buffer flags. See above.
19 * @private: private data owned by the ops.
20 **/
12struct pipe_buffer { 21struct pipe_buffer {
13 struct page *page; 22 struct page *page;
14 unsigned int offset, len; 23 unsigned int offset, len;
15 const struct pipe_buf_operations *ops; 24 const struct pipe_buf_operations *ops;
16 unsigned int flags; 25 unsigned int flags;
26 unsigned long private;
17}; 27};
18 28
29/**
30 * struct pipe_inode_info - a linux kernel pipe
31 * @wait: reader/writer wait point in case of empty/full pipe
32 * @nrbufs: the number of non-empty pipe buffers in this pipe
33 * @curbuf: the current pipe buffer entry
34 * @tmp_page: cached released page
35 * @readers: number of current readers of this pipe
36 * @writers: number of current writers of this pipe
37 * @waiting_writers: number of writers blocked waiting for room
38 * @r_counter: reader counter
39 * @w_counter: writer counter
40 * @fasync_readers: reader side fasync
41 * @fasync_writers: writer side fasync
42 * @inode: inode this pipe is attached to
43 * @bufs: the circular array of pipe buffers
44 **/
19struct pipe_inode_info { 45struct pipe_inode_info {
20 wait_queue_head_t wait; 46 wait_queue_head_t wait;
21 unsigned int nrbufs, curbuf; 47 unsigned int nrbufs, curbuf;
@@ -34,22 +60,73 @@ struct pipe_inode_info {
34/* 60/*
35 * Note on the nesting of these functions: 61 * Note on the nesting of these functions:
36 * 62 *
37 * ->pin() 63 * ->confirm()
38 * ->steal() 64 * ->steal()
39 * ... 65 * ...
40 * ->map() 66 * ->map()
41 * ... 67 * ...
42 * ->unmap() 68 * ->unmap()
43 * 69 *
44 * That is, ->map() must be called on a pinned buffer, same goes for ->steal(). 70 * That is, ->map() must be called on a confirmed buffer,
71 * same goes for ->steal(). See below for the meaning of each
72 * operation. Also see kerneldoc in fs/pipe.c for the pipe
73 * and generic variants of these hooks.
45 */ 74 */
46struct pipe_buf_operations { 75struct pipe_buf_operations {
76 /*
77 * This is set to 1, if the generic pipe read/write may coalesce
78 * data into an existing buffer. If this is set to 0, a new pipe
79 * page segment is always used for new data.
80 */
47 int can_merge; 81 int can_merge;
82
83 /*
84 * ->map() returns a virtual address mapping of the pipe buffer.
85 * The last integer flag reflects whether this should be an atomic
86 * mapping or not. The atomic map is faster, however you can't take
87 * page faults before calling ->unmap() again. So if you need to eg
88 * access user data through copy_to/from_user(), then you must get
89 * a non-atomic map. ->map() uses the KM_USER0 atomic slot for
90 * atomic maps, so you can't map more than one pipe_buffer at once
91 * and you have to be careful if mapping another page as source
92 * or destination for a copy (IOW, it has to use something else
93 * than KM_USER0).
94 */
48 void * (*map)(struct pipe_inode_info *, struct pipe_buffer *, int); 95 void * (*map)(struct pipe_inode_info *, struct pipe_buffer *, int);
96
97 /*
98 * Undoes ->map(), finishes the virtual mapping of the pipe buffer.
99 */
49 void (*unmap)(struct pipe_inode_info *, struct pipe_buffer *, void *); 100 void (*unmap)(struct pipe_inode_info *, struct pipe_buffer *, void *);
50 int (*pin)(struct pipe_inode_info *, struct pipe_buffer *); 101
102 /*
103 * ->confirm() verifies that the data in the pipe buffer is there
104 * and that the contents are good. If the pages in the pipe belong
105 * to a file system, we may need to wait for IO completion in this
106 * hook. Returns 0 for good, or a negative error value in case of
107 * error.
108 */
109 int (*confirm)(struct pipe_inode_info *, struct pipe_buffer *);
110
111 /*
112 * When the contents of this pipe buffer has been completely
113 * consumed by a reader, ->release() is called.
114 */
51 void (*release)(struct pipe_inode_info *, struct pipe_buffer *); 115 void (*release)(struct pipe_inode_info *, struct pipe_buffer *);
116
117 /*
118 * Attempt to take ownership of the pipe buffer and its contents.
119 * ->steal() returns 0 for success, in which case the contents
120 * of the pipe (the buf->page) is locked and now completely owned
121 * by the caller. The page may then be transferred to a different
122 * mapping, the most often used case is insertion into different
123 * file address space cache.
124 */
52 int (*steal)(struct pipe_inode_info *, struct pipe_buffer *); 125 int (*steal)(struct pipe_inode_info *, struct pipe_buffer *);
126
127 /*
128 * Get a reference to the pipe buffer.
129 */
53 void (*get)(struct pipe_inode_info *, struct pipe_buffer *); 130 void (*get)(struct pipe_inode_info *, struct pipe_buffer *);
54}; 131};
55 132
@@ -68,39 +145,7 @@ void __free_pipe_info(struct pipe_inode_info *);
68void *generic_pipe_buf_map(struct pipe_inode_info *, struct pipe_buffer *, int); 145void *generic_pipe_buf_map(struct pipe_inode_info *, struct pipe_buffer *, int);
69void generic_pipe_buf_unmap(struct pipe_inode_info *, struct pipe_buffer *, void *); 146void generic_pipe_buf_unmap(struct pipe_inode_info *, struct pipe_buffer *, void *);
70void generic_pipe_buf_get(struct pipe_inode_info *, struct pipe_buffer *); 147void generic_pipe_buf_get(struct pipe_inode_info *, struct pipe_buffer *);
71int generic_pipe_buf_pin(struct pipe_inode_info *, struct pipe_buffer *); 148int generic_pipe_buf_confirm(struct pipe_inode_info *, struct pipe_buffer *);
72int generic_pipe_buf_steal(struct pipe_inode_info *, struct pipe_buffer *); 149int generic_pipe_buf_steal(struct pipe_inode_info *, struct pipe_buffer *);
73 150
74/*
75 * splice is tied to pipes as a transport (at least for now), so we'll just
76 * add the splice flags here.
77 */
78#define SPLICE_F_MOVE (0x01) /* move pages instead of copying */
79#define SPLICE_F_NONBLOCK (0x02) /* don't block on the pipe splicing (but */
80 /* we may still block on the fd we splice */
81 /* from/to, of course */
82#define SPLICE_F_MORE (0x04) /* expect more data */
83#define SPLICE_F_GIFT (0x08) /* pages passed in are a gift */
84
85/*
86 * Passed to the actors
87 */
88struct splice_desc {
89 unsigned int len, total_len; /* current and remaining length */
90 unsigned int flags; /* splice flags */
91 struct file *file; /* file to read/write */
92 loff_t pos; /* file position */
93};
94
95typedef int (splice_actor)(struct pipe_inode_info *, struct pipe_buffer *,
96 struct splice_desc *);
97
98extern ssize_t splice_from_pipe(struct pipe_inode_info *, struct file *,
99 loff_t *, size_t, unsigned int,
100 splice_actor *);
101
102extern ssize_t __splice_from_pipe(struct pipe_inode_info *, struct file *,
103 loff_t *, size_t, unsigned int,
104 splice_actor *);
105
106#endif 151#endif
diff --git a/include/linux/pkt_cls.h b/include/linux/pkt_cls.h
index c3f01b3085a4..30b8571e6b34 100644
--- a/include/linux/pkt_cls.h
+++ b/include/linux/pkt_cls.h
@@ -403,16 +403,13 @@ enum
403 * 1..32767 Reserved for ematches inside kernel tree 403 * 1..32767 Reserved for ematches inside kernel tree
404 * 32768..65535 Free to use, not reliable 404 * 32768..65535 Free to use, not reliable
405 */ 405 */
406enum 406#define TCF_EM_CONTAINER 0
407{ 407#define TCF_EM_CMP 1
408 TCF_EM_CONTAINER, 408#define TCF_EM_NBYTE 2
409 TCF_EM_CMP, 409#define TCF_EM_U32 3
410 TCF_EM_NBYTE, 410#define TCF_EM_META 4
411 TCF_EM_U32, 411#define TCF_EM_TEXT 5
412 TCF_EM_META, 412#define TCF_EM_MAX 5
413 TCF_EM_TEXT,
414 __TCF_EM_MAX
415};
416 413
417enum 414enum
418{ 415{
diff --git a/include/linux/pkt_sched.h b/include/linux/pkt_sched.h
index d10f35338507..268c51599eb8 100644
--- a/include/linux/pkt_sched.h
+++ b/include/linux/pkt_sched.h
@@ -101,6 +101,15 @@ struct tc_prio_qopt
101 __u8 priomap[TC_PRIO_MAX+1]; /* Map: logical priority -> PRIO band */ 101 __u8 priomap[TC_PRIO_MAX+1]; /* Map: logical priority -> PRIO band */
102}; 102};
103 103
104enum
105{
106 TCA_PRIO_UNSPEC,
107 TCA_PRIO_MQ,
108 __TCA_PRIO_MAX
109};
110
111#define TCA_PRIO_MAX (__TCA_PRIO_MAX - 1)
112
104/* TBF section */ 113/* TBF section */
105 114
106struct tc_tbf_qopt 115struct tc_tbf_qopt
diff --git a/include/linux/pm.h b/include/linux/pm.h
index 87545e0f0b58..273781c82e4d 100644
--- a/include/linux/pm.h
+++ b/include/linux/pm.h
@@ -110,37 +110,67 @@ typedef int __bitwise suspend_state_t;
110#define PM_SUSPEND_MAX ((__force suspend_state_t) 4) 110#define PM_SUSPEND_MAX ((__force suspend_state_t) 4)
111 111
112/** 112/**
113 * struct pm_ops - Callbacks for managing platform dependent suspend states. 113 * struct pm_ops - Callbacks for managing platform dependent system sleep
114 * @valid: Callback to determine whether the given state can be entered. 114 * states.
115 * Valid states are advertised in /sys/power/state but can still
116 * be rejected by prepare or enter if the conditions aren't right.
117 * There is a %pm_valid_only_mem function available that can be assigned
118 * to this if you only implement mem sleep.
119 * 115 *
120 * @prepare: Prepare the platform for the given suspend state. Can return a 116 * @valid: Callback to determine if given system sleep state is supported by
121 * negative error code if necessary. 117 * the platform.
118 * Valid (ie. supported) states are advertised in /sys/power/state. Note
119 * that it still may be impossible to enter given system sleep state if the
120 * conditions aren't right.
121 * There is the %pm_valid_only_mem function available that can be assigned
122 * to this if the platform only supports mem sleep.
122 * 123 *
123 * @enter: Enter the given suspend state, must be assigned. Can return a 124 * @set_target: Tell the platform which system sleep state is going to be
124 * negative error code if necessary. 125 * entered.
126 * @set_target() is executed right prior to suspending devices. The
127 * information conveyed to the platform code by @set_target() should be
128 * disregarded by the platform as soon as @finish() is executed and if
129 * @prepare() fails. If @set_target() fails (ie. returns nonzero),
130 * @prepare(), @enter() and @finish() will not be called by the PM core.
131 * This callback is optional. However, if it is implemented, the argument
132 * passed to @prepare(), @enter() and @finish() is meaningless and should
133 * be ignored.
125 * 134 *
126 * @finish: Called when the system has left the given state and all devices 135 * @prepare: Prepare the platform for entering the system sleep state indicated
127 * are resumed. The return value is ignored. 136 * by @set_target() or represented by the argument if @set_target() is not
137 * implemented.
138 * @prepare() is called right after devices have been suspended (ie. the
139 * appropriate .suspend() method has been executed for each device) and
140 * before the nonboot CPUs are disabled (it is executed with IRQs enabled).
141 * This callback is optional. It returns 0 on success or a negative
142 * error code otherwise, in which case the system cannot enter the desired
143 * sleep state (@enter() and @finish() will not be called in that case).
144 *
145 * @enter: Enter the system sleep state indicated by @set_target() or
146 * represented by the argument if @set_target() is not implemented.
147 * This callback is mandatory. It returns 0 on success or a negative
148 * error code otherwise, in which case the system cannot enter the desired
149 * sleep state.
150 *
151 * @finish: Called when the system has just left a sleep state, right after
152 * the nonboot CPUs have been enabled and before devices are resumed (it is
153 * executed with IRQs enabled). If @set_target() is not implemented, the
154 * argument represents the sleep state being left.
155 * This callback is optional, but should be implemented by the platforms
156 * that implement @prepare(). If implemented, it is always called after
157 * @enter() (even if @enter() fails).
128 */ 158 */
129struct pm_ops { 159struct pm_ops {
130 int (*valid)(suspend_state_t state); 160 int (*valid)(suspend_state_t state);
161 int (*set_target)(suspend_state_t state);
131 int (*prepare)(suspend_state_t state); 162 int (*prepare)(suspend_state_t state);
132 int (*enter)(suspend_state_t state); 163 int (*enter)(suspend_state_t state);
133 int (*finish)(suspend_state_t state); 164 int (*finish)(suspend_state_t state);
134}; 165};
135 166
167extern struct pm_ops *pm_ops;
168
136/** 169/**
137 * pm_set_ops - set platform dependent power management ops 170 * pm_set_ops - set platform dependent power management ops
138 * @pm_ops: The new power management operations to set. 171 * @pm_ops: The new power management operations to set.
139 */ 172 */
140extern void pm_set_ops(struct pm_ops *pm_ops); 173extern void pm_set_ops(struct pm_ops *pm_ops);
141extern struct pm_ops *pm_ops;
142extern int pm_suspend(suspend_state_t state);
143
144extern int pm_valid_only_mem(suspend_state_t state); 174extern int pm_valid_only_mem(suspend_state_t state);
145 175
146/** 176/**
@@ -161,6 +191,8 @@ extern void arch_suspend_disable_irqs(void);
161 */ 191 */
162extern void arch_suspend_enable_irqs(void); 192extern void arch_suspend_enable_irqs(void);
163 193
194extern int pm_suspend(suspend_state_t state);
195
164/* 196/*
165 * Device power management 197 * Device power management
166 */ 198 */
@@ -235,15 +267,10 @@ struct dev_pm_info {
235 unsigned can_wakeup:1; 267 unsigned can_wakeup:1;
236#ifdef CONFIG_PM 268#ifdef CONFIG_PM
237 unsigned should_wakeup:1; 269 unsigned should_wakeup:1;
238 pm_message_t prev_state;
239 void * saved_state;
240 struct device * pm_parent;
241 struct list_head entry; 270 struct list_head entry;
242#endif 271#endif
243}; 272};
244 273
245extern void device_pm_set_parent(struct device * dev, struct device * parent);
246
247extern int device_power_down(pm_message_t state); 274extern int device_power_down(pm_message_t state);
248extern void device_power_up(void); 275extern void device_power_up(void);
249extern void device_resume(void); 276extern void device_resume(void);
diff --git a/include/linux/power_supply.h b/include/linux/power_supply.h
new file mode 100644
index 000000000000..606c0957997f
--- /dev/null
+++ b/include/linux/power_supply.h
@@ -0,0 +1,180 @@
1/*
2 * Universal power supply monitor class
3 *
4 * Copyright © 2007 Anton Vorontsov <cbou@mail.ru>
5 * Copyright © 2004 Szabolcs Gyurko
6 * Copyright © 2003 Ian Molton <spyro@f2s.com>
7 *
8 * Modified: 2004, Oct Szabolcs Gyurko
9 *
10 * You may use this code as per GPL version 2
11 */
12
13#ifndef __LINUX_POWER_SUPPLY_H__
14#define __LINUX_POWER_SUPPLY_H__
15
16#include <linux/device.h>
17#include <linux/workqueue.h>
18#include <linux/leds.h>
19
20/*
21 * All voltages, currents, charges, energies, time and temperatures in uV,
22 * µA, µAh, µWh, seconds and tenths of degree Celsius unless otherwise
23 * stated. It's driver's job to convert its raw values to units in which
24 * this class operates.
25 */
26
27/*
28 * For systems where the charger determines the maximum battery capacity
29 * the min and max fields should be used to present these values to user
30 * space. Unused/unknown fields will not appear in sysfs.
31 */
32
33enum {
34 POWER_SUPPLY_STATUS_UNKNOWN = 0,
35 POWER_SUPPLY_STATUS_CHARGING,
36 POWER_SUPPLY_STATUS_DISCHARGING,
37 POWER_SUPPLY_STATUS_NOT_CHARGING,
38 POWER_SUPPLY_STATUS_FULL,
39};
40
41enum {
42 POWER_SUPPLY_HEALTH_UNKNOWN = 0,
43 POWER_SUPPLY_HEALTH_GOOD,
44 POWER_SUPPLY_HEALTH_OVERHEAT,
45 POWER_SUPPLY_HEALTH_DEAD,
46 POWER_SUPPLY_HEALTH_OVERVOLTAGE,
47 POWER_SUPPLY_HEALTH_UNSPEC_FAILURE,
48};
49
50enum {
51 POWER_SUPPLY_TECHNOLOGY_UNKNOWN = 0,
52 POWER_SUPPLY_TECHNOLOGY_NiMH,
53 POWER_SUPPLY_TECHNOLOGY_LION,
54 POWER_SUPPLY_TECHNOLOGY_LIPO,
55 POWER_SUPPLY_TECHNOLOGY_LiFe,
56 POWER_SUPPLY_TECHNOLOGY_NiCd,
57};
58
59enum {
60 POWER_SUPPLY_CAPACITY_LEVEL_UNKNOWN = 0,
61 POWER_SUPPLY_CAPACITY_LEVEL_CRITICAL,
62 POWER_SUPPLY_CAPACITY_LEVEL_LOW,
63 POWER_SUPPLY_CAPACITY_LEVEL_NORMAL,
64 POWER_SUPPLY_CAPACITY_LEVEL_HIGH,
65 POWER_SUPPLY_CAPACITY_LEVEL_FULL,
66};
67
68enum power_supply_property {
69 /* Properties of type `int' */
70 POWER_SUPPLY_PROP_STATUS = 0,
71 POWER_SUPPLY_PROP_HEALTH,
72 POWER_SUPPLY_PROP_PRESENT,
73 POWER_SUPPLY_PROP_ONLINE,
74 POWER_SUPPLY_PROP_TECHNOLOGY,
75 POWER_SUPPLY_PROP_VOLTAGE_MAX_DESIGN,
76 POWER_SUPPLY_PROP_VOLTAGE_MIN_DESIGN,
77 POWER_SUPPLY_PROP_VOLTAGE_NOW,
78 POWER_SUPPLY_PROP_VOLTAGE_AVG,
79 POWER_SUPPLY_PROP_CURRENT_NOW,
80 POWER_SUPPLY_PROP_CURRENT_AVG,
81 POWER_SUPPLY_PROP_CHARGE_FULL_DESIGN,
82 POWER_SUPPLY_PROP_CHARGE_EMPTY_DESIGN,
83 POWER_SUPPLY_PROP_CHARGE_FULL,
84 POWER_SUPPLY_PROP_CHARGE_EMPTY,
85 POWER_SUPPLY_PROP_CHARGE_NOW,
86 POWER_SUPPLY_PROP_CHARGE_AVG,
87 POWER_SUPPLY_PROP_ENERGY_FULL_DESIGN,
88 POWER_SUPPLY_PROP_ENERGY_EMPTY_DESIGN,
89 POWER_SUPPLY_PROP_ENERGY_FULL,
90 POWER_SUPPLY_PROP_ENERGY_EMPTY,
91 POWER_SUPPLY_PROP_ENERGY_NOW,
92 POWER_SUPPLY_PROP_ENERGY_AVG,
93 POWER_SUPPLY_PROP_CAPACITY, /* in percents! */
94 POWER_SUPPLY_PROP_CAPACITY_LEVEL,
95 POWER_SUPPLY_PROP_TEMP,
96 POWER_SUPPLY_PROP_TEMP_AMBIENT,
97 POWER_SUPPLY_PROP_TIME_TO_EMPTY_NOW,
98 POWER_SUPPLY_PROP_TIME_TO_EMPTY_AVG,
99 POWER_SUPPLY_PROP_TIME_TO_FULL_NOW,
100 POWER_SUPPLY_PROP_TIME_TO_FULL_AVG,
101 /* Properties of type `const char *' */
102 POWER_SUPPLY_PROP_MODEL_NAME,
103 POWER_SUPPLY_PROP_MANUFACTURER,
104};
105
106enum power_supply_type {
107 POWER_SUPPLY_TYPE_BATTERY = 0,
108 POWER_SUPPLY_TYPE_UPS,
109 POWER_SUPPLY_TYPE_MAINS,
110 POWER_SUPPLY_TYPE_USB,
111};
112
113union power_supply_propval {
114 int intval;
115 const char *strval;
116};
117
118struct power_supply {
119 const char *name;
120 enum power_supply_type type;
121 enum power_supply_property *properties;
122 size_t num_properties;
123
124 char **supplied_to;
125 size_t num_supplicants;
126
127 int (*get_property)(struct power_supply *psy,
128 enum power_supply_property psp,
129 union power_supply_propval *val);
130 void (*external_power_changed)(struct power_supply *psy);
131
132 /* For APM emulation, think legacy userspace. */
133 int use_for_apm;
134
135 /* private */
136 struct device *dev;
137 struct work_struct changed_work;
138
139#ifdef CONFIG_LEDS_TRIGGERS
140 struct led_trigger *charging_full_trig;
141 char *charging_full_trig_name;
142 struct led_trigger *charging_trig;
143 char *charging_trig_name;
144 struct led_trigger *full_trig;
145 char *full_trig_name;
146 struct led_trigger *online_trig;
147 char *online_trig_name;
148#endif
149};
150
151/*
152 * This is recommended structure to specify static power supply parameters.
153 * Generic one, parametrizable for different power supplies. Power supply
154 * class itself does not use it, but that's what implementing most platform
155 * drivers, should try reuse for consistency.
156 */
157
158struct power_supply_info {
159 const char *name;
160 int technology;
161 int voltage_max_design;
162 int voltage_min_design;
163 int charge_full_design;
164 int charge_empty_design;
165 int energy_full_design;
166 int energy_empty_design;
167 int use_for_apm;
168};
169
170extern void power_supply_changed(struct power_supply *psy);
171extern int power_supply_am_i_supplied(struct power_supply *psy);
172
173extern int power_supply_register(struct device *parent,
174 struct power_supply *psy);
175extern void power_supply_unregister(struct power_supply *psy);
176
177/* For APM emulation, think legacy userspace. */
178extern struct class *power_supply_class;
179
180#endif /* __LINUX_POWER_SUPPLY_H__ */
diff --git a/include/linux/prctl.h b/include/linux/prctl.h
index 52a9be41250d..e2eff9079fe9 100644
--- a/include/linux/prctl.h
+++ b/include/linux/prctl.h
@@ -59,4 +59,8 @@
59# define PR_ENDIAN_LITTLE 1 /* True little endian mode */ 59# define PR_ENDIAN_LITTLE 1 /* True little endian mode */
60# define PR_ENDIAN_PPC_LITTLE 2 /* "PowerPC" pseudo little endian */ 60# define PR_ENDIAN_PPC_LITTLE 2 /* "PowerPC" pseudo little endian */
61 61
62/* Get/set process seccomp mode */
63#define PR_GET_SECCOMP 21
64#define PR_SET_SECCOMP 22
65
62#endif /* _LINUX_PRCTL_H */ 66#endif /* _LINUX_PRCTL_H */
diff --git a/include/linux/prefetch.h b/include/linux/prefetch.h
index fc86f274147f..1adfe668d031 100644
--- a/include/linux/prefetch.h
+++ b/include/linux/prefetch.h
@@ -27,7 +27,7 @@
27 27
28 prefetch(x) - prefetches the cacheline at "x" for read 28 prefetch(x) - prefetches the cacheline at "x" for read
29 prefetchw(x) - prefetches the cacheline at "x" for write 29 prefetchw(x) - prefetches the cacheline at "x" for write
30 spin_lock_prefetch(x) - prefectches the spinlock *x for taking 30 spin_lock_prefetch(x) - prefetches the spinlock *x for taking
31 31
32 there is also PREFETCH_STRIDE which is the architecure-prefered 32 there is also PREFETCH_STRIDE which is the architecure-prefered
33 "lookahead" size for prefetching streamed operations. 33 "lookahead" size for prefetching streamed operations.
diff --git a/include/linux/proc_fs.h b/include/linux/proc_fs.h
index 3469f96bc8b2..28e3664fdf1b 100644
--- a/include/linux/proc_fs.h
+++ b/include/linux/proc_fs.h
@@ -7,6 +7,8 @@
7#include <linux/magic.h> 7#include <linux/magic.h>
8#include <asm/atomic.h> 8#include <asm/atomic.h>
9 9
10struct completion;
11
10/* 12/*
11 * The proc filesystem constants/structures 13 * The proc filesystem constants/structures
12 */ 14 */
@@ -56,6 +58,14 @@ struct proc_dir_entry {
56 gid_t gid; 58 gid_t gid;
57 loff_t size; 59 loff_t size;
58 const struct inode_operations *proc_iops; 60 const struct inode_operations *proc_iops;
61 /*
62 * NULL ->proc_fops means "PDE is going away RSN" or
63 * "PDE is just created". In either case, e.g. ->read_proc won't be
64 * called because it's too late or too early, respectively.
65 *
66 * If you're allocating ->proc_fops dynamically, save a pointer
67 * somewhere.
68 */
59 const struct file_operations *proc_fops; 69 const struct file_operations *proc_fops;
60 get_info_t *get_info; 70 get_info_t *get_info;
61 struct module *owner; 71 struct module *owner;
@@ -66,6 +76,9 @@ struct proc_dir_entry {
66 atomic_t count; /* use count */ 76 atomic_t count; /* use count */
67 int deleted; /* delete flag */ 77 int deleted; /* delete flag */
68 void *set; 78 void *set;
79 int pde_users; /* number of callers into module in progress */
80 spinlock_t pde_unload_lock; /* proc_fops checks and pde_users bumps */
81 struct completion *pde_unload_completion;
69}; 82};
70 83
71struct kcore_list { 84struct kcore_list {
diff --git a/include/linux/ptrace.h b/include/linux/ptrace.h
index eeb1976ef7bf..ae8146abd746 100644
--- a/include/linux/ptrace.h
+++ b/include/linux/ptrace.h
@@ -110,6 +110,8 @@ static inline void ptrace_unlink(struct task_struct *child)
110 __ptrace_unlink(child); 110 __ptrace_unlink(child);
111} 111}
112 112
113int generic_ptrace_peekdata(struct task_struct *tsk, long addr, long data);
114int generic_ptrace_pokedata(struct task_struct *tsk, long addr, long data);
113 115
114#ifndef force_successful_syscall_return 116#ifndef force_successful_syscall_return
115/* 117/*
diff --git a/include/linux/raid/bitmap.h b/include/linux/raid/bitmap.h
index dd5a05d03d4f..75e17a05540e 100644
--- a/include/linux/raid/bitmap.h
+++ b/include/linux/raid/bitmap.h
@@ -262,7 +262,7 @@ int bitmap_active(struct bitmap *bitmap);
262 262
263char *file_path(struct file *file, char *buf, int count); 263char *file_path(struct file *file, char *buf, int count);
264void bitmap_print_sb(struct bitmap *bitmap); 264void bitmap_print_sb(struct bitmap *bitmap);
265int bitmap_update_sb(struct bitmap *bitmap); 265void bitmap_update_sb(struct bitmap *bitmap);
266 266
267int bitmap_setallbits(struct bitmap *bitmap); 267int bitmap_setallbits(struct bitmap *bitmap);
268void bitmap_write_all(struct bitmap *bitmap); 268void bitmap_write_all(struct bitmap *bitmap);
@@ -278,8 +278,8 @@ int bitmap_start_sync(struct bitmap *bitmap, sector_t offset, int *blocks, int d
278void bitmap_end_sync(struct bitmap *bitmap, sector_t offset, int *blocks, int aborted); 278void bitmap_end_sync(struct bitmap *bitmap, sector_t offset, int *blocks, int aborted);
279void bitmap_close_sync(struct bitmap *bitmap); 279void bitmap_close_sync(struct bitmap *bitmap);
280 280
281int bitmap_unplug(struct bitmap *bitmap); 281void bitmap_unplug(struct bitmap *bitmap);
282int bitmap_daemon_work(struct bitmap *bitmap); 282void bitmap_daemon_work(struct bitmap *bitmap);
283#endif 283#endif
284 284
285#endif 285#endif
diff --git a/include/linux/raid/md_k.h b/include/linux/raid/md_k.h
index de72c49747c8..28ac632b42dd 100644
--- a/include/linux/raid/md_k.h
+++ b/include/linux/raid/md_k.h
@@ -51,7 +51,7 @@ struct mdk_rdev_s
51 51
52 sector_t size; /* Device size (in blocks) */ 52 sector_t size; /* Device size (in blocks) */
53 mddev_t *mddev; /* RAID array if running */ 53 mddev_t *mddev; /* RAID array if running */
54 unsigned long last_events; /* IO event timestamp */ 54 long last_events; /* IO event timestamp */
55 55
56 struct block_device *bdev; /* block device handle */ 56 struct block_device *bdev; /* block device handle */
57 57
diff --git a/include/linux/raid/raid5.h b/include/linux/raid/raid5.h
index d8286db60b96..93678f57ccbe 100644
--- a/include/linux/raid/raid5.h
+++ b/include/linux/raid/raid5.h
@@ -116,13 +116,46 @@
116 * attach a request to an active stripe (add_stripe_bh()) 116 * attach a request to an active stripe (add_stripe_bh())
117 * lockdev attach-buffer unlockdev 117 * lockdev attach-buffer unlockdev
118 * handle a stripe (handle_stripe()) 118 * handle a stripe (handle_stripe())
119 * lockstripe clrSTRIPE_HANDLE ... (lockdev check-buffers unlockdev) .. change-state .. record io needed unlockstripe schedule io 119 * lockstripe clrSTRIPE_HANDLE ...
120 * (lockdev check-buffers unlockdev) ..
121 * change-state ..
122 * record io/ops needed unlockstripe schedule io/ops
120 * release an active stripe (release_stripe()) 123 * release an active stripe (release_stripe())
121 * lockdev if (!--cnt) { if STRIPE_HANDLE, add to handle_list else add to inactive-list } unlockdev 124 * lockdev if (!--cnt) { if STRIPE_HANDLE, add to handle_list else add to inactive-list } unlockdev
122 * 125 *
123 * The refcount counts each thread that have activated the stripe, 126 * The refcount counts each thread that have activated the stripe,
124 * plus raid5d if it is handling it, plus one for each active request 127 * plus raid5d if it is handling it, plus one for each active request
125 * on a cached buffer. 128 * on a cached buffer, and plus one if the stripe is undergoing stripe
129 * operations.
130 *
131 * Stripe operations are performed outside the stripe lock,
132 * the stripe operations are:
133 * -copying data between the stripe cache and user application buffers
134 * -computing blocks to save a disk access, or to recover a missing block
135 * -updating the parity on a write operation (reconstruct write and
136 * read-modify-write)
137 * -checking parity correctness
138 * -running i/o to disk
139 * These operations are carried out by raid5_run_ops which uses the async_tx
140 * api to (optionally) offload operations to dedicated hardware engines.
141 * When requesting an operation handle_stripe sets the pending bit for the
142 * operation and increments the count. raid5_run_ops is then run whenever
143 * the count is non-zero.
144 * There are some critical dependencies between the operations that prevent some
145 * from being requested while another is in flight.
146 * 1/ Parity check operations destroy the in cache version of the parity block,
147 * so we prevent parity dependent operations like writes and compute_blocks
148 * from starting while a check is in progress. Some dma engines can perform
149 * the check without damaging the parity block, in these cases the parity
150 * block is re-marked up to date (assuming the check was successful) and is
151 * not re-read from disk.
152 * 2/ When a write operation is requested we immediately lock the affected
153 * blocks, and mark them as not up to date. This causes new read requests
154 * to be held off, as well as parity checks and compute block operations.
155 * 3/ Once a compute block operation has been requested handle_stripe treats
156 * that block as if it is up to date. raid5_run_ops guaruntees that any
157 * operation that is dependent on the compute block result is initiated after
158 * the compute block completes.
126 */ 159 */
127 160
128struct stripe_head { 161struct stripe_head {
@@ -136,15 +169,46 @@ struct stripe_head {
136 spinlock_t lock; 169 spinlock_t lock;
137 int bm_seq; /* sequence number for bitmap flushes */ 170 int bm_seq; /* sequence number for bitmap flushes */
138 int disks; /* disks in stripe */ 171 int disks; /* disks in stripe */
172 /* stripe_operations
173 * @pending - pending ops flags (set for request->issue->complete)
174 * @ack - submitted ops flags (set for issue->complete)
175 * @complete - completed ops flags (set for complete)
176 * @target - STRIPE_OP_COMPUTE_BLK target
177 * @count - raid5_runs_ops is set to run when this is non-zero
178 */
179 struct stripe_operations {
180 unsigned long pending;
181 unsigned long ack;
182 unsigned long complete;
183 int target;
184 int count;
185 u32 zero_sum_result;
186 } ops;
139 struct r5dev { 187 struct r5dev {
140 struct bio req; 188 struct bio req;
141 struct bio_vec vec; 189 struct bio_vec vec;
142 struct page *page; 190 struct page *page;
143 struct bio *toread, *towrite, *written; 191 struct bio *toread, *read, *towrite, *written;
144 sector_t sector; /* sector of this page */ 192 sector_t sector; /* sector of this page */
145 unsigned long flags; 193 unsigned long flags;
146 } dev[1]; /* allocated with extra space depending of RAID geometry */ 194 } dev[1]; /* allocated with extra space depending of RAID geometry */
147}; 195};
196
197/* stripe_head_state - collects and tracks the dynamic state of a stripe_head
198 * for handle_stripe. It is only valid under spin_lock(sh->lock);
199 */
200struct stripe_head_state {
201 int syncing, expanding, expanded;
202 int locked, uptodate, to_read, to_write, failed, written;
203 int to_fill, compute, req_compute, non_overwrite;
204 int failed_num;
205};
206
207/* r6_state - extra state data only relevant to r6 */
208struct r6_state {
209 int p_failed, q_failed, qd_idx, failed_num[2];
210};
211
148/* Flags */ 212/* Flags */
149#define R5_UPTODATE 0 /* page contains current data */ 213#define R5_UPTODATE 0 /* page contains current data */
150#define R5_LOCKED 1 /* IO has been submitted on "req" */ 214#define R5_LOCKED 1 /* IO has been submitted on "req" */
@@ -158,6 +222,15 @@ struct stripe_head {
158#define R5_ReWrite 9 /* have tried to over-write the readerror */ 222#define R5_ReWrite 9 /* have tried to over-write the readerror */
159 223
160#define R5_Expanded 10 /* This block now has post-expand data */ 224#define R5_Expanded 10 /* This block now has post-expand data */
225#define R5_Wantcompute 11 /* compute_block in progress treat as
226 * uptodate
227 */
228#define R5_Wantfill 12 /* dev->toread contains a bio that needs
229 * filling
230 */
231#define R5_Wantprexor 13 /* distinguish blocks ready for rmw from
232 * other "towrites"
233 */
161/* 234/*
162 * Write method 235 * Write method
163 */ 236 */
@@ -180,6 +253,24 @@ struct stripe_head {
180#define STRIPE_EXPAND_SOURCE 10 253#define STRIPE_EXPAND_SOURCE 10
181#define STRIPE_EXPAND_READY 11 254#define STRIPE_EXPAND_READY 11
182/* 255/*
256 * Operations flags (in issue order)
257 */
258#define STRIPE_OP_BIOFILL 0
259#define STRIPE_OP_COMPUTE_BLK 1
260#define STRIPE_OP_PREXOR 2
261#define STRIPE_OP_BIODRAIN 3
262#define STRIPE_OP_POSTXOR 4
263#define STRIPE_OP_CHECK 5
264#define STRIPE_OP_IO 6
265
266/* modifiers to the base operations
267 * STRIPE_OP_MOD_REPAIR_PD - compute the parity block and write it back
268 * STRIPE_OP_MOD_DMA_CHECK - parity is not corrupted by the check
269 */
270#define STRIPE_OP_MOD_REPAIR_PD 7
271#define STRIPE_OP_MOD_DMA_CHECK 8
272
273/*
183 * Plugging: 274 * Plugging:
184 * 275 *
185 * To improve write throughput, we need to delay the handling of some 276 * To improve write throughput, we need to delay the handling of some
diff --git a/include/linux/raid/xor.h b/include/linux/raid/xor.h
index f0d67cbdea40..3e120587eada 100644
--- a/include/linux/raid/xor.h
+++ b/include/linux/raid/xor.h
@@ -3,9 +3,10 @@
3 3
4#include <linux/raid/md.h> 4#include <linux/raid/md.h>
5 5
6#define MAX_XOR_BLOCKS 5 6#define MAX_XOR_BLOCKS 4
7 7
8extern void xor_block(unsigned int count, unsigned int bytes, void **ptr); 8extern void xor_blocks(unsigned int count, unsigned int bytes,
9 void *dest, void **srcs);
9 10
10struct xor_block_template { 11struct xor_block_template {
11 struct xor_block_template *next; 12 struct xor_block_template *next;
diff --git a/include/linux/reboot.h b/include/linux/reboot.h
index 1dd1c707311f..85ea63f462af 100644
--- a/include/linux/reboot.h
+++ b/include/linux/reboot.h
@@ -67,6 +67,11 @@ extern void kernel_power_off(void);
67 67
68void ctrl_alt_del(void); 68void ctrl_alt_del(void);
69 69
70#define POWEROFF_CMD_PATH_LEN 256
71extern char poweroff_cmd[POWEROFF_CMD_PATH_LEN];
72
73extern int orderly_poweroff(bool force);
74
70/* 75/*
71 * Emergency restart, callable from an interrupt handler. 76 * Emergency restart, callable from an interrupt handler.
72 */ 77 */
diff --git a/include/linux/rtc/m48t59.h b/include/linux/rtc/m48t59.h
new file mode 100644
index 000000000000..e8c7c21ceb1f
--- /dev/null
+++ b/include/linux/rtc/m48t59.h
@@ -0,0 +1,57 @@
1/*
2 * include/linux/rtc/m48t59.h
3 *
4 * Definitions for the platform data of m48t59 RTC chip driver.
5 *
6 * Copyright (c) 2007 Wind River Systems, Inc.
7 *
8 * Mark Zhan <rongkai.zhan@windriver.com>
9 *
10 * This program is free software; you can redistribute it and/or modify
11 * it under the terms of the GNU General Public License version 2 as
12 * published by the Free Software Foundation.
13 */
14
15#ifndef _LINUX_RTC_M48T59_H_
16#define _LINUX_RTC_M48T59_H_
17
18/*
19 * M48T59 Register Offset
20 */
21#define M48T59_YEAR 0x1fff
22#define M48T59_MONTH 0x1ffe
23#define M48T59_MDAY 0x1ffd /* Day of Month */
24#define M48T59_WDAY 0x1ffc /* Day of Week */
25#define M48T59_WDAY_CB 0x20 /* Century Bit */
26#define M48T59_WDAY_CEB 0x10 /* Century Enable Bit */
27#define M48T59_HOUR 0x1ffb
28#define M48T59_MIN 0x1ffa
29#define M48T59_SEC 0x1ff9
30#define M48T59_CNTL 0x1ff8
31#define M48T59_CNTL_READ 0x40
32#define M48T59_CNTL_WRITE 0x80
33#define M48T59_WATCHDOG 0x1ff7
34#define M48T59_INTR 0x1ff6
35#define M48T59_INTR_AFE 0x80 /* Alarm Interrupt Enable */
36#define M48T59_INTR_ABE 0x20
37#define M48T59_ALARM_DATE 0x1ff5
38#define M48T59_ALARM_HOUR 0x1ff4
39#define M48T59_ALARM_MIN 0x1ff3
40#define M48T59_ALARM_SEC 0x1ff2
41#define M48T59_UNUSED 0x1ff1
42#define M48T59_FLAGS 0x1ff0
43#define M48T59_FLAGS_WDT 0x80 /* watchdog timer expired */
44#define M48T59_FLAGS_AF 0x40 /* alarm */
45#define M48T59_FLAGS_BF 0x10 /* low battery */
46
47#define M48T59_NVRAM_SIZE 0x1ff0
48
49struct m48t59_plat_data {
50 /* The method to access M48T59 registers,
51 * NOTE: The 'ofs' should be 0x00~0x1fff
52 */
53 void (*write_byte)(struct device *dev, u32 ofs, u8 val);
54 unsigned char (*read_byte)(struct device *dev, u32 ofs);
55};
56
57#endif /* _LINUX_RTC_M48T59_H_ */
diff --git a/include/linux/rtnetlink.h b/include/linux/rtnetlink.h
index 1fae30af91f3..c91476ce314a 100644
--- a/include/linux/rtnetlink.h
+++ b/include/linux/rtnetlink.h
@@ -261,7 +261,7 @@ enum rtattr_type_t
261 RTA_FLOW, 261 RTA_FLOW,
262 RTA_CACHEINFO, 262 RTA_CACHEINFO,
263 RTA_SESSION, 263 RTA_SESSION,
264 RTA_MP_ALGO, 264 RTA_MP_ALGO, /* no longer used */
265 RTA_TABLE, 265 RTA_TABLE,
266 __RTA_MAX 266 __RTA_MAX
267}; 267};
@@ -570,10 +570,16 @@ static __inline__ int rtattr_strcmp(const struct rtattr *rta, const char *str)
570} 570}
571 571
572extern int rtattr_parse(struct rtattr *tb[], int maxattr, struct rtattr *rta, int len); 572extern int rtattr_parse(struct rtattr *tb[], int maxattr, struct rtattr *rta, int len);
573extern int __rtattr_parse_nested_compat(struct rtattr *tb[], int maxattr,
574 struct rtattr *rta, int len);
573 575
574#define rtattr_parse_nested(tb, max, rta) \ 576#define rtattr_parse_nested(tb, max, rta) \
575 rtattr_parse((tb), (max), RTA_DATA((rta)), RTA_PAYLOAD((rta))) 577 rtattr_parse((tb), (max), RTA_DATA((rta)), RTA_PAYLOAD((rta)))
576 578
579#define rtattr_parse_nested_compat(tb, max, rta, data, len) \
580({ data = RTA_PAYLOAD(rta) >= len ? RTA_DATA(rta) : NULL; \
581 __rtattr_parse_nested_compat(tb, max, rta, len); })
582
577extern int rtnetlink_send(struct sk_buff *skb, u32 pid, u32 group, int echo); 583extern int rtnetlink_send(struct sk_buff *skb, u32 pid, u32 group, int echo);
578extern int rtnl_unicast(struct sk_buff *skb, u32 pid); 584extern int rtnl_unicast(struct sk_buff *skb, u32 pid);
579extern int rtnl_notify(struct sk_buff *skb, u32 pid, u32 group, 585extern int rtnl_notify(struct sk_buff *skb, u32 pid, u32 group,
@@ -638,6 +644,18 @@ extern void __rta_fill(struct sk_buff *skb, int attrtype, int attrlen, const voi
638({ (start)->rta_len = skb_tail_pointer(skb) - (unsigned char *)(start); \ 644({ (start)->rta_len = skb_tail_pointer(skb) - (unsigned char *)(start); \
639 (skb)->len; }) 645 (skb)->len; })
640 646
647#define RTA_NEST_COMPAT(skb, type, attrlen, data) \
648({ struct rtattr *__start = (struct rtattr *)skb_tail_pointer(skb); \
649 RTA_PUT(skb, type, attrlen, data); \
650 RTA_NEST(skb, type); \
651 __start; })
652
653#define RTA_NEST_COMPAT_END(skb, start) \
654({ struct rtattr *__nest = (void *)(start) + NLMSG_ALIGN((start)->rta_len); \
655 (start)->rta_len = skb_tail_pointer(skb) - (unsigned char *)(start); \
656 RTA_NEST_END(skb, __nest); \
657 (skb)->len; })
658
641#define RTA_NEST_CANCEL(skb, start) \ 659#define RTA_NEST_CANCEL(skb, start) \
642({ if (start) \ 660({ if (start) \
643 skb_trim(skb, (unsigned char *) (start) - (skb)->data); \ 661 skb_trim(skb, (unsigned char *) (start) - (skb)->data); \
diff --git a/include/linux/sched.h b/include/linux/sched.h
index 693f0e6c54d4..731edaca8ffd 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -26,6 +26,7 @@
26#define CLONE_STOPPED 0x02000000 /* Start in stopped state */ 26#define CLONE_STOPPED 0x02000000 /* Start in stopped state */
27#define CLONE_NEWUTS 0x04000000 /* New utsname group? */ 27#define CLONE_NEWUTS 0x04000000 /* New utsname group? */
28#define CLONE_NEWIPC 0x08000000 /* New ipcs */ 28#define CLONE_NEWIPC 0x08000000 /* New ipcs */
29#define CLONE_NEWUSER 0x10000000 /* New user namespace */
29 30
30/* 31/*
31 * Scheduling policies 32 * Scheduling policies
@@ -34,6 +35,8 @@
34#define SCHED_FIFO 1 35#define SCHED_FIFO 1
35#define SCHED_RR 2 36#define SCHED_RR 2
36#define SCHED_BATCH 3 37#define SCHED_BATCH 3
38/* SCHED_ISO: reserved but not implemented yet */
39#define SCHED_IDLE 5
37 40
38#ifdef __KERNEL__ 41#ifdef __KERNEL__
39 42
@@ -130,6 +133,26 @@ extern unsigned long nr_active(void);
130extern unsigned long nr_iowait(void); 133extern unsigned long nr_iowait(void);
131extern unsigned long weighted_cpuload(const int cpu); 134extern unsigned long weighted_cpuload(const int cpu);
132 135
136struct seq_file;
137struct cfs_rq;
138#ifdef CONFIG_SCHED_DEBUG
139extern void proc_sched_show_task(struct task_struct *p, struct seq_file *m);
140extern void proc_sched_set_task(struct task_struct *p);
141extern void
142print_cfs_rq(struct seq_file *m, int cpu, struct cfs_rq *cfs_rq, u64 now);
143#else
144static inline void
145proc_sched_show_task(struct task_struct *p, struct seq_file *m)
146{
147}
148static inline void proc_sched_set_task(struct task_struct *p)
149{
150}
151static inline void
152print_cfs_rq(struct seq_file *m, int cpu, struct cfs_rq *cfs_rq, u64 now)
153{
154}
155#endif
133 156
134/* 157/*
135 * Task state bitmask. NOTE! These bits are also 158 * Task state bitmask. NOTE! These bits are also
@@ -193,6 +216,7 @@ struct task_struct;
193extern void sched_init(void); 216extern void sched_init(void);
194extern void sched_init_smp(void); 217extern void sched_init_smp(void);
195extern void init_idle(struct task_struct *idle, int cpu); 218extern void init_idle(struct task_struct *idle, int cpu);
219extern void init_idle_bootup_task(struct task_struct *idle);
196 220
197extern cpumask_t nohz_cpu_mask; 221extern cpumask_t nohz_cpu_mask;
198#if defined(CONFIG_SMP) && defined(CONFIG_NO_HZ) 222#if defined(CONFIG_SMP) && defined(CONFIG_NO_HZ)
@@ -264,6 +288,7 @@ extern signed long schedule_timeout_uninterruptible(signed long timeout);
264asmlinkage void schedule(void); 288asmlinkage void schedule(void);
265 289
266struct nsproxy; 290struct nsproxy;
291struct user_namespace;
267 292
268/* Maximum number of active map areas.. This is a random (large) number */ 293/* Maximum number of active map areas.. This is a random (large) number */
269#define DEFAULT_MAX_MAP_COUNT 65536 294#define DEFAULT_MAX_MAP_COUNT 65536
@@ -479,7 +504,7 @@ struct signal_struct {
479 * from jiffies_to_ns(utime + stime) if sched_clock uses something 504 * from jiffies_to_ns(utime + stime) if sched_clock uses something
480 * other than jiffies.) 505 * other than jiffies.)
481 */ 506 */
482 unsigned long long sched_time; 507 unsigned long long sum_sched_runtime;
483 508
484 /* 509 /*
485 * We don't bother to synchronize most readers of this at all, 510 * We don't bother to synchronize most readers of this at all,
@@ -506,6 +531,10 @@ struct signal_struct {
506#ifdef CONFIG_TASKSTATS 531#ifdef CONFIG_TASKSTATS
507 struct taskstats *stats; 532 struct taskstats *stats;
508#endif 533#endif
534#ifdef CONFIG_AUDIT
535 unsigned audit_tty;
536 struct tty_audit_buf *tty_audit_buf;
537#endif
509}; 538};
510 539
511/* Context switch must be unlocked if interrupts are to be enabled */ 540/* Context switch must be unlocked if interrupts are to be enabled */
@@ -521,31 +550,6 @@ struct signal_struct {
521#define SIGNAL_STOP_CONTINUED 0x00000004 /* SIGCONT since WCONTINUED reap */ 550#define SIGNAL_STOP_CONTINUED 0x00000004 /* SIGCONT since WCONTINUED reap */
522#define SIGNAL_GROUP_EXIT 0x00000008 /* group exit in progress */ 551#define SIGNAL_GROUP_EXIT 0x00000008 /* group exit in progress */
523 552
524
525/*
526 * Priority of a process goes from 0..MAX_PRIO-1, valid RT
527 * priority is 0..MAX_RT_PRIO-1, and SCHED_NORMAL/SCHED_BATCH
528 * tasks are in the range MAX_RT_PRIO..MAX_PRIO-1. Priority
529 * values are inverted: lower p->prio value means higher priority.
530 *
531 * The MAX_USER_RT_PRIO value allows the actual maximum
532 * RT priority to be separate from the value exported to
533 * user-space. This allows kernel threads to set their
534 * priority to a value higher than any user task. Note:
535 * MAX_RT_PRIO must not be smaller than MAX_USER_RT_PRIO.
536 */
537
538#define MAX_USER_RT_PRIO 100
539#define MAX_RT_PRIO MAX_USER_RT_PRIO
540
541#define MAX_PRIO (MAX_RT_PRIO + 40)
542
543#define rt_prio(prio) unlikely((prio) < MAX_RT_PRIO)
544#define rt_task(p) rt_prio((p)->prio)
545#define batch_task(p) (unlikely((p)->policy == SCHED_BATCH))
546#define is_rt_policy(p) ((p) != SCHED_NORMAL && (p) != SCHED_BATCH)
547#define has_rt_policy(p) unlikely(is_rt_policy((p)->policy))
548
549/* 553/*
550 * Some day this will be a full-fledged user tracking system.. 554 * Some day this will be a full-fledged user tracking system..
551 */ 555 */
@@ -583,13 +587,13 @@ struct reclaim_state;
583#if defined(CONFIG_SCHEDSTATS) || defined(CONFIG_TASK_DELAY_ACCT) 587#if defined(CONFIG_SCHEDSTATS) || defined(CONFIG_TASK_DELAY_ACCT)
584struct sched_info { 588struct sched_info {
585 /* cumulative counters */ 589 /* cumulative counters */
586 unsigned long cpu_time, /* time spent on the cpu */ 590 unsigned long pcnt; /* # of times run on this cpu */
587 run_delay, /* time spent waiting on a runqueue */ 591 unsigned long long cpu_time, /* time spent on the cpu */
588 pcnt; /* # of timeslices run on this cpu */ 592 run_delay; /* time spent waiting on a runqueue */
589 593
590 /* timestamps */ 594 /* timestamps */
591 unsigned long last_arrival, /* when we last ran on a cpu */ 595 unsigned long long last_arrival,/* when we last ran on a cpu */
592 last_queued; /* when we were last queued to run */ 596 last_queued; /* when we were last queued to run */
593}; 597};
594#endif /* defined(CONFIG_SCHEDSTATS) || defined(CONFIG_TASK_DELAY_ACCT) */ 598#endif /* defined(CONFIG_SCHEDSTATS) || defined(CONFIG_TASK_DELAY_ACCT) */
595 599
@@ -639,18 +643,24 @@ static inline int sched_info_on(void)
639#endif 643#endif
640} 644}
641 645
642enum idle_type 646enum cpu_idle_type {
643{ 647 CPU_IDLE,
644 SCHED_IDLE, 648 CPU_NOT_IDLE,
645 NOT_IDLE, 649 CPU_NEWLY_IDLE,
646 NEWLY_IDLE, 650 CPU_MAX_IDLE_TYPES
647 MAX_IDLE_TYPES
648}; 651};
649 652
650/* 653/*
651 * sched-domains (multiprocessor balancing) declarations: 654 * sched-domains (multiprocessor balancing) declarations:
652 */ 655 */
653#define SCHED_LOAD_SCALE 128UL /* increase resolution of load */ 656
657/*
658 * Increase resolution of nice-level calculations:
659 */
660#define SCHED_LOAD_SHIFT 10
661#define SCHED_LOAD_SCALE (1L << SCHED_LOAD_SHIFT)
662
663#define SCHED_LOAD_SCALE_FUZZ (SCHED_LOAD_SCALE >> 5)
654 664
655#ifdef CONFIG_SMP 665#ifdef CONFIG_SMP
656#define SD_LOAD_BALANCE 1 /* Do load balancing on this domain. */ 666#define SD_LOAD_BALANCE 1 /* Do load balancing on this domain. */
@@ -719,14 +729,14 @@ struct sched_domain {
719 729
720#ifdef CONFIG_SCHEDSTATS 730#ifdef CONFIG_SCHEDSTATS
721 /* load_balance() stats */ 731 /* load_balance() stats */
722 unsigned long lb_cnt[MAX_IDLE_TYPES]; 732 unsigned long lb_cnt[CPU_MAX_IDLE_TYPES];
723 unsigned long lb_failed[MAX_IDLE_TYPES]; 733 unsigned long lb_failed[CPU_MAX_IDLE_TYPES];
724 unsigned long lb_balanced[MAX_IDLE_TYPES]; 734 unsigned long lb_balanced[CPU_MAX_IDLE_TYPES];
725 unsigned long lb_imbalance[MAX_IDLE_TYPES]; 735 unsigned long lb_imbalance[CPU_MAX_IDLE_TYPES];
726 unsigned long lb_gained[MAX_IDLE_TYPES]; 736 unsigned long lb_gained[CPU_MAX_IDLE_TYPES];
727 unsigned long lb_hot_gained[MAX_IDLE_TYPES]; 737 unsigned long lb_hot_gained[CPU_MAX_IDLE_TYPES];
728 unsigned long lb_nobusyg[MAX_IDLE_TYPES]; 738 unsigned long lb_nobusyg[CPU_MAX_IDLE_TYPES];
729 unsigned long lb_nobusyq[MAX_IDLE_TYPES]; 739 unsigned long lb_nobusyq[CPU_MAX_IDLE_TYPES];
730 740
731 /* Active load balancing */ 741 /* Active load balancing */
732 unsigned long alb_cnt; 742 unsigned long alb_cnt;
@@ -753,12 +763,6 @@ struct sched_domain {
753extern int partition_sched_domains(cpumask_t *partition1, 763extern int partition_sched_domains(cpumask_t *partition1,
754 cpumask_t *partition2); 764 cpumask_t *partition2);
755 765
756/*
757 * Maximum cache size the migration-costs auto-tuning code will
758 * search from:
759 */
760extern unsigned int max_cache_size;
761
762#endif /* CONFIG_SMP */ 766#endif /* CONFIG_SMP */
763 767
764 768
@@ -809,14 +813,86 @@ struct mempolicy;
809struct pipe_inode_info; 813struct pipe_inode_info;
810struct uts_namespace; 814struct uts_namespace;
811 815
812enum sleep_type { 816struct rq;
813 SLEEP_NORMAL, 817struct sched_domain;
814 SLEEP_NONINTERACTIVE, 818
815 SLEEP_INTERACTIVE, 819struct sched_class {
816 SLEEP_INTERRUPTED, 820 struct sched_class *next;
821
822 void (*enqueue_task) (struct rq *rq, struct task_struct *p,
823 int wakeup, u64 now);
824 void (*dequeue_task) (struct rq *rq, struct task_struct *p,
825 int sleep, u64 now);
826 void (*yield_task) (struct rq *rq, struct task_struct *p);
827
828 void (*check_preempt_curr) (struct rq *rq, struct task_struct *p);
829
830 struct task_struct * (*pick_next_task) (struct rq *rq, u64 now);
831 void (*put_prev_task) (struct rq *rq, struct task_struct *p, u64 now);
832
833 int (*load_balance) (struct rq *this_rq, int this_cpu,
834 struct rq *busiest,
835 unsigned long max_nr_move, unsigned long max_load_move,
836 struct sched_domain *sd, enum cpu_idle_type idle,
837 int *all_pinned, unsigned long *total_load_moved);
838
839 void (*set_curr_task) (struct rq *rq);
840 void (*task_tick) (struct rq *rq, struct task_struct *p);
841 void (*task_new) (struct rq *rq, struct task_struct *p);
817}; 842};
818 843
819struct prio_array; 844struct load_weight {
845 unsigned long weight, inv_weight;
846};
847
848/*
849 * CFS stats for a schedulable entity (task, task-group etc)
850 *
851 * Current field usage histogram:
852 *
853 * 4 se->block_start
854 * 4 se->run_node
855 * 4 se->sleep_start
856 * 4 se->sleep_start_fair
857 * 6 se->load.weight
858 * 7 se->delta_fair
859 * 15 se->wait_runtime
860 */
861struct sched_entity {
862 long wait_runtime;
863 unsigned long delta_fair_run;
864 unsigned long delta_fair_sleep;
865 unsigned long delta_exec;
866 s64 fair_key;
867 struct load_weight load; /* for load-balancing */
868 struct rb_node run_node;
869 unsigned int on_rq;
870
871 u64 wait_start_fair;
872 u64 wait_start;
873 u64 exec_start;
874 u64 sleep_start;
875 u64 sleep_start_fair;
876 u64 block_start;
877 u64 sleep_max;
878 u64 block_max;
879 u64 exec_max;
880 u64 wait_max;
881 u64 last_ran;
882
883 u64 sum_exec_runtime;
884 s64 sum_wait_runtime;
885 s64 sum_sleep_runtime;
886 unsigned long wait_runtime_overruns;
887 unsigned long wait_runtime_underruns;
888#ifdef CONFIG_FAIR_GROUP_SCHED
889 struct sched_entity *parent;
890 /* rq on which this entity is (to be) queued: */
891 struct cfs_rq *cfs_rq;
892 /* rq "owned" by this entity/group: */
893 struct cfs_rq *my_q;
894#endif
895};
820 896
821struct task_struct { 897struct task_struct {
822 volatile long state; /* -1 unrunnable, 0 runnable, >0 stopped */ 898 volatile long state; /* -1 unrunnable, 0 runnable, >0 stopped */
@@ -832,23 +908,20 @@ struct task_struct {
832 int oncpu; 908 int oncpu;
833#endif 909#endif
834#endif 910#endif
835 int load_weight; /* for niceness load balancing purposes */ 911
836 int prio, static_prio, normal_prio; 912 int prio, static_prio, normal_prio;
837 struct list_head run_list; 913 struct list_head run_list;
838 struct prio_array *array; 914 struct sched_class *sched_class;
915 struct sched_entity se;
839 916
840 unsigned short ioprio; 917 unsigned short ioprio;
841#ifdef CONFIG_BLK_DEV_IO_TRACE 918#ifdef CONFIG_BLK_DEV_IO_TRACE
842 unsigned int btrace_seq; 919 unsigned int btrace_seq;
843#endif 920#endif
844 unsigned long sleep_avg;
845 unsigned long long timestamp, last_ran;
846 unsigned long long sched_time; /* sched_clock time spent running */
847 enum sleep_type sleep_type;
848 921
849 unsigned int policy; 922 unsigned int policy;
850 cpumask_t cpus_allowed; 923 cpumask_t cpus_allowed;
851 unsigned int time_slice, first_time_slice; 924 unsigned int time_slice;
852 925
853#if defined(CONFIG_SCHEDSTATS) || defined(CONFIG_TASK_DELAY_ACCT) 926#if defined(CONFIG_SCHEDSTATS) || defined(CONFIG_TASK_DELAY_ACCT)
854 struct sched_info sched_info; 927 struct sched_info sched_info;
@@ -905,7 +978,8 @@ struct task_struct {
905 unsigned int rt_priority; 978 unsigned int rt_priority;
906 cputime_t utime, stime; 979 cputime_t utime, stime;
907 unsigned long nvcsw, nivcsw; /* context switch counts */ 980 unsigned long nvcsw, nivcsw; /* context switch counts */
908 struct timespec start_time; 981 struct timespec start_time; /* monotonic time */
982 struct timespec real_start_time; /* boot based time */
909/* mm fault and swap info: this can arguably be seen as either mm-specific or thread-specific */ 983/* mm fault and swap info: this can arguably be seen as either mm-specific or thread-specific */
910 unsigned long min_flt, maj_flt; 984 unsigned long min_flt, maj_flt;
911 985
@@ -1078,6 +1152,37 @@ struct task_struct {
1078#endif 1152#endif
1079}; 1153};
1080 1154
1155/*
1156 * Priority of a process goes from 0..MAX_PRIO-1, valid RT
1157 * priority is 0..MAX_RT_PRIO-1, and SCHED_NORMAL/SCHED_BATCH
1158 * tasks are in the range MAX_RT_PRIO..MAX_PRIO-1. Priority
1159 * values are inverted: lower p->prio value means higher priority.
1160 *
1161 * The MAX_USER_RT_PRIO value allows the actual maximum
1162 * RT priority to be separate from the value exported to
1163 * user-space. This allows kernel threads to set their
1164 * priority to a value higher than any user task. Note:
1165 * MAX_RT_PRIO must not be smaller than MAX_USER_RT_PRIO.
1166 */
1167
1168#define MAX_USER_RT_PRIO 100
1169#define MAX_RT_PRIO MAX_USER_RT_PRIO
1170
1171#define MAX_PRIO (MAX_RT_PRIO + 40)
1172#define DEFAULT_PRIO (MAX_RT_PRIO + 20)
1173
1174static inline int rt_prio(int prio)
1175{
1176 if (unlikely(prio < MAX_RT_PRIO))
1177 return 1;
1178 return 0;
1179}
1180
1181static inline int rt_task(struct task_struct *p)
1182{
1183 return rt_prio(p->prio);
1184}
1185
1081static inline pid_t process_group(struct task_struct *tsk) 1186static inline pid_t process_group(struct task_struct *tsk)
1082{ 1187{
1083 return tsk->signal->pgrp; 1188 return tsk->signal->pgrp;
@@ -1223,7 +1328,7 @@ static inline int set_cpus_allowed(struct task_struct *p, cpumask_t new_mask)
1223 1328
1224extern unsigned long long sched_clock(void); 1329extern unsigned long long sched_clock(void);
1225extern unsigned long long 1330extern unsigned long long
1226current_sched_time(const struct task_struct *current_task); 1331task_sched_runtime(struct task_struct *task);
1227 1332
1228/* sched_exec is called by processes performing an exec */ 1333/* sched_exec is called by processes performing an exec */
1229#ifdef CONFIG_SMP 1334#ifdef CONFIG_SMP
@@ -1232,6 +1337,8 @@ extern void sched_exec(void);
1232#define sched_exec() {} 1337#define sched_exec() {}
1233#endif 1338#endif
1234 1339
1340extern void sched_clock_unstable_event(void);
1341
1235#ifdef CONFIG_HOTPLUG_CPU 1342#ifdef CONFIG_HOTPLUG_CPU
1236extern void idle_task_exit(void); 1343extern void idle_task_exit(void);
1237#else 1344#else
@@ -1240,6 +1347,14 @@ static inline void idle_task_exit(void) {}
1240 1347
1241extern void sched_idle_next(void); 1348extern void sched_idle_next(void);
1242 1349
1350extern unsigned int sysctl_sched_granularity;
1351extern unsigned int sysctl_sched_wakeup_granularity;
1352extern unsigned int sysctl_sched_batch_wakeup_granularity;
1353extern unsigned int sysctl_sched_stat_granularity;
1354extern unsigned int sysctl_sched_runtime_limit;
1355extern unsigned int sysctl_sched_child_runs_first;
1356extern unsigned int sysctl_sched_features;
1357
1243#ifdef CONFIG_RT_MUTEXES 1358#ifdef CONFIG_RT_MUTEXES
1244extern int rt_mutex_getprio(struct task_struct *p); 1359extern int rt_mutex_getprio(struct task_struct *p);
1245extern void rt_mutex_setprio(struct task_struct *p, int prio); 1360extern void rt_mutex_setprio(struct task_struct *p, int prio);
@@ -1295,7 +1410,7 @@ extern struct task_struct *find_task_by_pid_type(int type, int pid);
1295extern void __set_special_pids(pid_t session, pid_t pgrp); 1410extern void __set_special_pids(pid_t session, pid_t pgrp);
1296 1411
1297/* per-UID process charging. */ 1412/* per-UID process charging. */
1298extern struct user_struct * alloc_uid(uid_t); 1413extern struct user_struct * alloc_uid(struct user_namespace *, uid_t);
1299static inline struct user_struct *get_uid(struct user_struct *u) 1414static inline struct user_struct *get_uid(struct user_struct *u)
1300{ 1415{
1301 atomic_inc(&u->__count); 1416 atomic_inc(&u->__count);
@@ -1317,8 +1432,8 @@ extern void FASTCALL(wake_up_new_task(struct task_struct * tsk,
1317#else 1432#else
1318 static inline void kick_process(struct task_struct *tsk) { } 1433 static inline void kick_process(struct task_struct *tsk) { }
1319#endif 1434#endif
1320extern void FASTCALL(sched_fork(struct task_struct * p, int clone_flags)); 1435extern void sched_fork(struct task_struct *p, int clone_flags);
1321extern void FASTCALL(sched_exit(struct task_struct * p)); 1436extern void sched_dead(struct task_struct *p);
1322 1437
1323extern int in_group_p(gid_t); 1438extern int in_group_p(gid_t);
1324extern int in_egroup_p(gid_t); 1439extern int in_egroup_p(gid_t);
@@ -1406,7 +1521,7 @@ extern struct mm_struct * mm_alloc(void);
1406extern void FASTCALL(__mmdrop(struct mm_struct *)); 1521extern void FASTCALL(__mmdrop(struct mm_struct *));
1407static inline void mmdrop(struct mm_struct * mm) 1522static inline void mmdrop(struct mm_struct * mm)
1408{ 1523{
1409 if (atomic_dec_and_test(&mm->mm_count)) 1524 if (unlikely(atomic_dec_and_test(&mm->mm_count)))
1410 __mmdrop(mm); 1525 __mmdrop(mm);
1411} 1526}
1412 1527
@@ -1638,10 +1753,7 @@ static inline unsigned int task_cpu(const struct task_struct *p)
1638 return task_thread_info(p)->cpu; 1753 return task_thread_info(p)->cpu;
1639} 1754}
1640 1755
1641static inline void set_task_cpu(struct task_struct *p, unsigned int cpu) 1756extern void set_task_cpu(struct task_struct *p, unsigned int cpu);
1642{
1643 task_thread_info(p)->cpu = cpu;
1644}
1645 1757
1646#else 1758#else
1647 1759
diff --git a/include/linux/screen_info.h b/include/linux/screen_info.h
index b02308ee7667..3ee412bc00ec 100644
--- a/include/linux/screen_info.h
+++ b/include/linux/screen_info.h
@@ -10,7 +10,7 @@
10struct screen_info { 10struct screen_info {
11 u8 orig_x; /* 0x00 */ 11 u8 orig_x; /* 0x00 */
12 u8 orig_y; /* 0x01 */ 12 u8 orig_y; /* 0x01 */
13 u16 dontuse1; /* 0x02 -- EXT_MEM_K sits here */ 13 u16 ext_mem_k; /* 0x02 */
14 u16 orig_video_page; /* 0x04 */ 14 u16 orig_video_page; /* 0x04 */
15 u8 orig_video_mode; /* 0x06 */ 15 u8 orig_video_mode; /* 0x06 */
16 u8 orig_video_cols; /* 0x07 */ 16 u8 orig_video_cols; /* 0x07 */
@@ -27,7 +27,7 @@ struct screen_info {
27 u16 lfb_depth; /* 0x16 */ 27 u16 lfb_depth; /* 0x16 */
28 u32 lfb_base; /* 0x18 */ 28 u32 lfb_base; /* 0x18 */
29 u32 lfb_size; /* 0x1c */ 29 u32 lfb_size; /* 0x1c */
30 u16 dontuse2, dontuse3; /* 0x20 -- CL_MAGIC and CL_OFFSET here */ 30 u16 cl_magic, cl_offset; /* 0x20 */
31 u16 lfb_linelength; /* 0x24 */ 31 u16 lfb_linelength; /* 0x24 */
32 u8 red_size; /* 0x26 */ 32 u8 red_size; /* 0x26 */
33 u8 red_pos; /* 0x27 */ 33 u8 red_pos; /* 0x27 */
@@ -42,9 +42,8 @@ struct screen_info {
42 u16 pages; /* 0x32 */ 42 u16 pages; /* 0x32 */
43 u16 vesa_attributes; /* 0x34 */ 43 u16 vesa_attributes; /* 0x34 */
44 u32 capabilities; /* 0x36 */ 44 u32 capabilities; /* 0x36 */
45 /* 0x3a -- 0x3b reserved for future expansion */ 45 u8 _reserved[6]; /* 0x3a */
46 /* 0x3c -- 0x3f micro stack for relocatable kernels */ 46} __attribute__((packed));
47};
48 47
49extern struct screen_info screen_info; 48extern struct screen_info screen_info;
50 49
diff --git a/include/linux/scx200_gpio.h b/include/linux/scx200_gpio.h
index 1a82d30c4b17..d2b058130eb1 100644
--- a/include/linux/scx200_gpio.h
+++ b/include/linux/scx200_gpio.h
@@ -1,5 +1,3 @@
1#include <linux/spinlock.h>
2
3u32 scx200_gpio_configure(unsigned index, u32 set, u32 clear); 1u32 scx200_gpio_configure(unsigned index, u32 set, u32 clear);
4 2
5extern unsigned scx200_gpio_base; 3extern unsigned scx200_gpio_base;
diff --git a/include/linux/seccomp.h b/include/linux/seccomp.h
index 3e8b1cf54303..262a8dccfa81 100644
--- a/include/linux/seccomp.h
+++ b/include/linux/seccomp.h
@@ -4,8 +4,6 @@
4 4
5#ifdef CONFIG_SECCOMP 5#ifdef CONFIG_SECCOMP
6 6
7#define NR_SECCOMP_MODES 1
8
9#include <linux/thread_info.h> 7#include <linux/thread_info.h>
10#include <asm/seccomp.h> 8#include <asm/seccomp.h>
11 9
@@ -18,20 +16,23 @@ static inline void secure_computing(int this_syscall)
18 __secure_computing(this_syscall); 16 __secure_computing(this_syscall);
19} 17}
20 18
21static inline int has_secure_computing(struct thread_info *ti) 19extern long prctl_get_seccomp(void);
22{ 20extern long prctl_set_seccomp(unsigned long);
23 return unlikely(test_ti_thread_flag(ti, TIF_SECCOMP));
24}
25 21
26#else /* CONFIG_SECCOMP */ 22#else /* CONFIG_SECCOMP */
27 23
28typedef struct { } seccomp_t; 24typedef struct { } seccomp_t;
29 25
30#define secure_computing(x) do { } while (0) 26#define secure_computing(x) do { } while (0)
31/* static inline to preserve typechecking */ 27
32static inline int has_secure_computing(struct thread_info *ti) 28static inline long prctl_get_seccomp(void)
29{
30 return -EINVAL;
31}
32
33static inline long prctl_set_seccomp(unsigned long arg2)
33{ 34{
34 return 0; 35 return -EINVAL;
35} 36}
36 37
37#endif /* CONFIG_SECCOMP */ 38#endif /* CONFIG_SECCOMP */
diff --git a/include/linux/security.h b/include/linux/security.h
index 9eb9e0fe0331..c11dc8aa0351 100644
--- a/include/linux/security.h
+++ b/include/linux/security.h
@@ -71,6 +71,7 @@ struct xfrm_user_sec_ctx;
71extern int cap_netlink_send(struct sock *sk, struct sk_buff *skb); 71extern int cap_netlink_send(struct sock *sk, struct sk_buff *skb);
72extern int cap_netlink_recv(struct sk_buff *skb, int cap); 72extern int cap_netlink_recv(struct sk_buff *skb, int cap);
73 73
74extern unsigned long mmap_min_addr;
74/* 75/*
75 * Values used in the task_security_ops calls 76 * Values used in the task_security_ops calls
76 */ 77 */
@@ -1241,8 +1242,9 @@ struct security_operations {
1241 int (*file_ioctl) (struct file * file, unsigned int cmd, 1242 int (*file_ioctl) (struct file * file, unsigned int cmd,
1242 unsigned long arg); 1243 unsigned long arg);
1243 int (*file_mmap) (struct file * file, 1244 int (*file_mmap) (struct file * file,
1244 unsigned long reqprot, 1245 unsigned long reqprot, unsigned long prot,
1245 unsigned long prot, unsigned long flags); 1246 unsigned long flags, unsigned long addr,
1247 unsigned long addr_only);
1246 int (*file_mprotect) (struct vm_area_struct * vma, 1248 int (*file_mprotect) (struct vm_area_struct * vma,
1247 unsigned long reqprot, 1249 unsigned long reqprot,
1248 unsigned long prot); 1250 unsigned long prot);
@@ -1814,9 +1816,12 @@ static inline int security_file_ioctl (struct file *file, unsigned int cmd,
1814 1816
1815static inline int security_file_mmap (struct file *file, unsigned long reqprot, 1817static inline int security_file_mmap (struct file *file, unsigned long reqprot,
1816 unsigned long prot, 1818 unsigned long prot,
1817 unsigned long flags) 1819 unsigned long flags,
1820 unsigned long addr,
1821 unsigned long addr_only)
1818{ 1822{
1819 return security_ops->file_mmap (file, reqprot, prot, flags); 1823 return security_ops->file_mmap (file, reqprot, prot, flags, addr,
1824 addr_only);
1820} 1825}
1821 1826
1822static inline int security_file_mprotect (struct vm_area_struct *vma, 1827static inline int security_file_mprotect (struct vm_area_struct *vma,
@@ -2489,7 +2494,9 @@ static inline int security_file_ioctl (struct file *file, unsigned int cmd,
2489 2494
2490static inline int security_file_mmap (struct file *file, unsigned long reqprot, 2495static inline int security_file_mmap (struct file *file, unsigned long reqprot,
2491 unsigned long prot, 2496 unsigned long prot,
2492 unsigned long flags) 2497 unsigned long flags,
2498 unsigned long addr,
2499 unsigned long addr_only)
2493{ 2500{
2494 return 0; 2501 return 0;
2495} 2502}
diff --git a/include/linux/seq_file.h b/include/linux/seq_file.h
index 3e3cccbb1cac..83783ab0f552 100644
--- a/include/linux/seq_file.h
+++ b/include/linux/seq_file.h
@@ -50,5 +50,16 @@ int seq_release_private(struct inode *, struct file *);
50 50
51#define SEQ_START_TOKEN ((void *)1) 51#define SEQ_START_TOKEN ((void *)1)
52 52
53/*
54 * Helpers for iteration over list_head-s in seq_files
55 */
56
57extern struct list_head *seq_list_start(struct list_head *head,
58 loff_t pos);
59extern struct list_head *seq_list_start_head(struct list_head *head,
60 loff_t pos);
61extern struct list_head *seq_list_next(void *v, struct list_head *head,
62 loff_t *ppos);
63
53#endif 64#endif
54#endif 65#endif
diff --git a/include/linux/serial.h b/include/linux/serial.h
index 33fc8cb8ddfb..deb714314fb1 100644
--- a/include/linux/serial.h
+++ b/include/linux/serial.h
@@ -177,11 +177,5 @@ struct serial_icounter_struct {
177#ifdef __KERNEL__ 177#ifdef __KERNEL__
178#include <linux/compiler.h> 178#include <linux/compiler.h>
179 179
180/* Allow architectures to override entries in serial8250_ports[] at run time: */
181struct uart_port; /* forward declaration */
182extern int early_serial_setup(struct uart_port *port);
183extern int early_serial_console_init(char *options);
184extern int serial8250_start_console(struct uart_port *port, char *options);
185
186#endif /* __KERNEL__ */ 180#endif /* __KERNEL__ */
187#endif /* _LINUX_SERIAL_H */ 181#endif /* _LINUX_SERIAL_H */
diff --git a/include/linux/serial_8250.h b/include/linux/serial_8250.h
index 71310d80c09a..8518fa2a6f89 100644
--- a/include/linux/serial_8250.h
+++ b/include/linux/serial_8250.h
@@ -60,4 +60,10 @@ void serial8250_unregister_port(int line);
60void serial8250_suspend_port(int line); 60void serial8250_suspend_port(int line);
61void serial8250_resume_port(int line); 61void serial8250_resume_port(int line);
62 62
63extern int early_serial_setup(struct uart_port *port);
64
65extern int serial8250_find_port(struct uart_port *p);
66extern int serial8250_find_port_for_earlycon(void);
67extern int setup_early_serial8250_console(char *cmdline);
68
63#endif 69#endif
diff --git a/include/linux/serial_core.h b/include/linux/serial_core.h
index 7f2c99d66e9d..773d8d8828ad 100644
--- a/include/linux/serial_core.h
+++ b/include/linux/serial_core.h
@@ -62,8 +62,9 @@
62/* NEC v850. */ 62/* NEC v850. */
63#define PORT_V850E_UART 40 63#define PORT_V850E_UART 40
64 64
65/* DZ */ 65/* DEC */
66#define PORT_DZ 47 66#define PORT_DZ 46
67#define PORT_ZS 47
67 68
68/* Parisc type numbers. */ 69/* Parisc type numbers. */
69#define PORT_MUX 48 70#define PORT_MUX 48
@@ -142,6 +143,9 @@
142/* Micrel KS8695 */ 143/* Micrel KS8695 */
143#define PORT_KS8695 76 144#define PORT_KS8695 76
144 145
146/* Broadcom SB1250, etc. SOC */
147#define PORT_SB1250_DUART 77
148
145 149
146#ifdef __KERNEL__ 150#ifdef __KERNEL__
147 151
diff --git a/include/linux/serio.h b/include/linux/serio.h
index 1ebf0455e224..d9377ce9ffd1 100644
--- a/include/linux/serio.h
+++ b/include/linux/serio.h
@@ -209,5 +209,6 @@ static inline void serio_unpin_driver(struct serio *serio)
209#define SERIO_PENMOUNT 0x31 209#define SERIO_PENMOUNT 0x31
210#define SERIO_TOUCHRIGHT 0x32 210#define SERIO_TOUCHRIGHT 0x32
211#define SERIO_TOUCHWIN 0x33 211#define SERIO_TOUCHWIN 0x33
212#define SERIO_TAOSEVM 0x34
212 213
213#endif 214#endif
diff --git a/include/linux/signal.h b/include/linux/signal.h
index 9a5eac508e5e..ea91abe740da 100644
--- a/include/linux/signal.h
+++ b/include/linux/signal.h
@@ -6,7 +6,6 @@
6 6
7#ifdef __KERNEL__ 7#ifdef __KERNEL__
8#include <linux/list.h> 8#include <linux/list.h>
9#include <linux/spinlock.h>
10 9
11/* 10/*
12 * Real Time signals may be queued. 11 * Real Time signals may be queued.
diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h
index 6f0b2f7d0010..ce256438e619 100644
--- a/include/linux/skbuff.h
+++ b/include/linux/skbuff.h
@@ -65,13 +65,20 @@
65 * is able to produce some skb->csum, it MUST use COMPLETE, 65 * is able to produce some skb->csum, it MUST use COMPLETE,
66 * not UNNECESSARY. 66 * not UNNECESSARY.
67 * 67 *
68 * PARTIAL: identical to the case for output below. This may occur
69 * on a packet received directly from another Linux OS, e.g.,
70 * a virtualised Linux kernel on the same host. The packet can
71 * be treated in the same way as UNNECESSARY except that on
72 * output (i.e., forwarding) the checksum must be filled in
73 * by the OS or the hardware.
74 *
68 * B. Checksumming on output. 75 * B. Checksumming on output.
69 * 76 *
70 * NONE: skb is checksummed by protocol or csum is not required. 77 * NONE: skb is checksummed by protocol or csum is not required.
71 * 78 *
72 * PARTIAL: device is required to csum packet as seen by hard_start_xmit 79 * PARTIAL: device is required to csum packet as seen by hard_start_xmit
73 * from skb->transport_header to the end and to record the checksum 80 * from skb->csum_start to the end and to record the checksum
74 * at skb->transport_header + skb->csum. 81 * at skb->csum_start + skb->csum_offset.
75 * 82 *
76 * Device must show its capabilities in dev->features, set 83 * Device must show its capabilities in dev->features, set
77 * at device setup time. 84 * at device setup time.
@@ -82,6 +89,7 @@
82 * TCP/UDP over IPv4. Sigh. Vendors like this 89 * TCP/UDP over IPv4. Sigh. Vendors like this
83 * way by an unknown reason. Though, see comment above 90 * way by an unknown reason. Though, see comment above
84 * about CHECKSUM_UNNECESSARY. 8) 91 * about CHECKSUM_UNNECESSARY. 8)
92 * NETIF_F_IPV6_CSUM about as dumb as the last one but does IPv6 instead.
85 * 93 *
86 * Any questions? No questions, good. --ANK 94 * Any questions? No questions, good. --ANK
87 */ 95 */
@@ -147,8 +155,8 @@ struct skb_shared_info {
147 155
148/* We divide dataref into two halves. The higher 16 bits hold references 156/* We divide dataref into two halves. The higher 16 bits hold references
149 * to the payload part of skb->data. The lower 16 bits hold references to 157 * to the payload part of skb->data. The lower 16 bits hold references to
150 * the entire skb->data. It is up to the users of the skb to agree on 158 * the entire skb->data. A clone of a headerless skb holds the length of
151 * where the payload starts. 159 * the header in skb->hdr_len.
152 * 160 *
153 * All users must obey the rule that the skb->data reference count must be 161 * All users must obey the rule that the skb->data reference count must be
154 * greater than or equal to the payload reference count. 162 * greater than or equal to the payload reference count.
@@ -196,7 +204,6 @@ typedef unsigned char *sk_buff_data_t;
196 * @sk: Socket we are owned by 204 * @sk: Socket we are owned by
197 * @tstamp: Time we arrived 205 * @tstamp: Time we arrived
198 * @dev: Device we arrived on/are leaving by 206 * @dev: Device we arrived on/are leaving by
199 * @iif: ifindex of device we arrived on
200 * @transport_header: Transport layer header 207 * @transport_header: Transport layer header
201 * @network_header: Network layer header 208 * @network_header: Network layer header
202 * @mac_header: Link layer header 209 * @mac_header: Link layer header
@@ -206,6 +213,7 @@ typedef unsigned char *sk_buff_data_t;
206 * @len: Length of actual data 213 * @len: Length of actual data
207 * @data_len: Data length 214 * @data_len: Data length
208 * @mac_len: Length of link layer header 215 * @mac_len: Length of link layer header
216 * @hdr_len: writable header length of cloned skb
209 * @csum: Checksum (must include start/offset pair) 217 * @csum: Checksum (must include start/offset pair)
210 * @csum_start: Offset from skb->head where checksumming should start 218 * @csum_start: Offset from skb->head where checksumming should start
211 * @csum_offset: Offset from csum_start where checksum should be stored 219 * @csum_offset: Offset from csum_start where checksum should be stored
@@ -227,9 +235,12 @@ typedef unsigned char *sk_buff_data_t;
227 * @mark: Generic packet mark 235 * @mark: Generic packet mark
228 * @nfct: Associated connection, if any 236 * @nfct: Associated connection, if any
229 * @ipvs_property: skbuff is owned by ipvs 237 * @ipvs_property: skbuff is owned by ipvs
238 * @nf_trace: netfilter packet trace flag
230 * @nfctinfo: Relationship of this skb to the connection 239 * @nfctinfo: Relationship of this skb to the connection
231 * @nfct_reasm: netfilter conntrack re-assembly pointer 240 * @nfct_reasm: netfilter conntrack re-assembly pointer
232 * @nf_bridge: Saved data about a bridged frame - see br_netfilter.c 241 * @nf_bridge: Saved data about a bridged frame - see br_netfilter.c
242 * @iif: ifindex of device we arrived on
243 * @queue_mapping: Queue mapping for multiqueue devices
233 * @tc_index: Traffic control index 244 * @tc_index: Traffic control index
234 * @tc_verd: traffic control verdict 245 * @tc_verd: traffic control verdict
235 * @dma_cookie: a cookie to one of several possible DMA operations 246 * @dma_cookie: a cookie to one of several possible DMA operations
@@ -245,8 +256,6 @@ struct sk_buff {
245 struct sock *sk; 256 struct sock *sk;
246 ktime_t tstamp; 257 ktime_t tstamp;
247 struct net_device *dev; 258 struct net_device *dev;
248 int iif;
249 /* 4 byte hole on 64 bit*/
250 259
251 struct dst_entry *dst; 260 struct dst_entry *dst;
252 struct sec_path *sp; 261 struct sec_path *sp;
@@ -260,8 +269,9 @@ struct sk_buff {
260 char cb[48]; 269 char cb[48];
261 270
262 unsigned int len, 271 unsigned int len,
263 data_len, 272 data_len;
264 mac_len; 273 __u16 mac_len,
274 hdr_len;
265 union { 275 union {
266 __wsum csum; 276 __wsum csum;
267 struct { 277 struct {
@@ -277,7 +287,8 @@ struct sk_buff {
277 nfctinfo:3; 287 nfctinfo:3;
278 __u8 pkt_type:3, 288 __u8 pkt_type:3,
279 fclone:2, 289 fclone:2,
280 ipvs_property:1; 290 ipvs_property:1,
291 nf_trace:1;
281 __be16 protocol; 292 __be16 protocol;
282 293
283 void (*destructor)(struct sk_buff *skb); 294 void (*destructor)(struct sk_buff *skb);
@@ -288,12 +299,18 @@ struct sk_buff {
288#ifdef CONFIG_BRIDGE_NETFILTER 299#ifdef CONFIG_BRIDGE_NETFILTER
289 struct nf_bridge_info *nf_bridge; 300 struct nf_bridge_info *nf_bridge;
290#endif 301#endif
302
303 int iif;
304 __u16 queue_mapping;
305
291#ifdef CONFIG_NET_SCHED 306#ifdef CONFIG_NET_SCHED
292 __u16 tc_index; /* traffic control index */ 307 __u16 tc_index; /* traffic control index */
293#ifdef CONFIG_NET_CLS_ACT 308#ifdef CONFIG_NET_CLS_ACT
294 __u16 tc_verd; /* traffic control verdict */ 309 __u16 tc_verd; /* traffic control verdict */
295#endif 310#endif
296#endif 311#endif
312 /* 2 byte hole */
313
297#ifdef CONFIG_NET_DMA 314#ifdef CONFIG_NET_DMA
298 dma_cookie_t dma_cookie; 315 dma_cookie_t dma_cookie;
299#endif 316#endif
@@ -1322,6 +1339,20 @@ static inline struct sk_buff *netdev_alloc_skb(struct net_device *dev,
1322} 1339}
1323 1340
1324/** 1341/**
1342 * skb_clone_writable - is the header of a clone writable
1343 * @skb: buffer to check
1344 * @len: length up to which to write
1345 *
1346 * Returns true if modifying the header part of the cloned buffer
1347 * does not requires the data to be copied.
1348 */
1349static inline int skb_clone_writable(struct sk_buff *skb, int len)
1350{
1351 return !skb_header_cloned(skb) &&
1352 skb_headroom(skb) + len <= skb->hdr_len;
1353}
1354
1355/**
1325 * skb_cow - copy header of skb when it is required 1356 * skb_cow - copy header of skb when it is required
1326 * @skb: buffer to cow 1357 * @skb: buffer to cow
1327 * @headroom: needed headroom 1358 * @headroom: needed headroom
@@ -1608,7 +1639,7 @@ static inline int skb_csum_unnecessary(const struct sk_buff *skb)
1608 * if skb->ip_summed is CHECKSUM_UNNECESSARY which indicates that the 1639 * if skb->ip_summed is CHECKSUM_UNNECESSARY which indicates that the
1609 * hardware has already verified the correctness of the checksum. 1640 * hardware has already verified the correctness of the checksum.
1610 */ 1641 */
1611static inline unsigned int skb_checksum_complete(struct sk_buff *skb) 1642static inline __sum16 skb_checksum_complete(struct sk_buff *skb)
1612{ 1643{
1613 return skb_csum_unnecessary(skb) ? 1644 return skb_csum_unnecessary(skb) ?
1614 0 : __skb_checksum_complete(skb); 1645 0 : __skb_checksum_complete(skb);
@@ -1709,6 +1740,20 @@ static inline void skb_init_secmark(struct sk_buff *skb)
1709{ } 1740{ }
1710#endif 1741#endif
1711 1742
1743static inline void skb_set_queue_mapping(struct sk_buff *skb, u16 queue_mapping)
1744{
1745#ifdef CONFIG_NETDEVICES_MULTIQUEUE
1746 skb->queue_mapping = queue_mapping;
1747#endif
1748}
1749
1750static inline void skb_copy_queue_mapping(struct sk_buff *to, const struct sk_buff *from)
1751{
1752#ifdef CONFIG_NETDEVICES_MULTIQUEUE
1753 to->queue_mapping = from->queue_mapping;
1754#endif
1755}
1756
1712static inline int skb_is_gso(const struct sk_buff *skb) 1757static inline int skb_is_gso(const struct sk_buff *skb)
1713{ 1758{
1714 return skb_shinfo(skb)->gso_size; 1759 return skb_shinfo(skb)->gso_size;
diff --git a/include/linux/slab.h b/include/linux/slab.h
index a015236cc572..0e1d0daef6a2 100644
--- a/include/linux/slab.h
+++ b/include/linux/slab.h
@@ -14,8 +14,6 @@
14#include <linux/gfp.h> 14#include <linux/gfp.h>
15#include <linux/types.h> 15#include <linux/types.h>
16 16
17typedef struct kmem_cache kmem_cache_t __deprecated;
18
19/* 17/*
20 * Flags to pass to kmem_cache_create(). 18 * Flags to pass to kmem_cache_create().
21 * The ones marked DEBUG are only valid if CONFIG_SLAB_DEBUG is set. 19 * The ones marked DEBUG are only valid if CONFIG_SLAB_DEBUG is set.
@@ -33,6 +31,19 @@ typedef struct kmem_cache kmem_cache_t __deprecated;
33#define SLAB_TRACE 0x00200000UL /* Trace allocations and frees */ 31#define SLAB_TRACE 0x00200000UL /* Trace allocations and frees */
34 32
35/* 33/*
34 * ZERO_SIZE_PTR will be returned for zero sized kmalloc requests.
35 *
36 * Dereferencing ZERO_SIZE_PTR will lead to a distinct access fault.
37 *
38 * ZERO_SIZE_PTR can be passed to kfree though in the same way that NULL can.
39 * Both make kfree a no-op.
40 */
41#define ZERO_SIZE_PTR ((void *)16)
42
43#define ZERO_OR_NULL_PTR(x) ((unsigned long)(x) < \
44 (unsigned long)ZERO_SIZE_PTR)
45
46/*
36 * struct kmem_cache related prototypes 47 * struct kmem_cache related prototypes
37 */ 48 */
38void __init kmem_cache_init(void); 49void __init kmem_cache_init(void);
@@ -44,8 +55,6 @@ struct kmem_cache *kmem_cache_create(const char *, size_t, size_t,
44 void (*)(void *, struct kmem_cache *, unsigned long)); 55 void (*)(void *, struct kmem_cache *, unsigned long));
45void kmem_cache_destroy(struct kmem_cache *); 56void kmem_cache_destroy(struct kmem_cache *);
46int kmem_cache_shrink(struct kmem_cache *); 57int kmem_cache_shrink(struct kmem_cache *);
47void *kmem_cache_alloc(struct kmem_cache *, gfp_t);
48void *kmem_cache_zalloc(struct kmem_cache *, gfp_t);
49void kmem_cache_free(struct kmem_cache *, void *); 58void kmem_cache_free(struct kmem_cache *, void *);
50unsigned int kmem_cache_size(struct kmem_cache *); 59unsigned int kmem_cache_size(struct kmem_cache *);
51const char *kmem_cache_name(struct kmem_cache *); 60const char *kmem_cache_name(struct kmem_cache *);
@@ -63,16 +72,6 @@ int kmem_ptr_validate(struct kmem_cache *cachep, const void *ptr);
63 sizeof(struct __struct), __alignof__(struct __struct),\ 72 sizeof(struct __struct), __alignof__(struct __struct),\
64 (__flags), NULL, NULL) 73 (__flags), NULL, NULL)
65 74
66#ifdef CONFIG_NUMA
67extern void *kmem_cache_alloc_node(struct kmem_cache *, gfp_t flags, int node);
68#else
69static inline void *kmem_cache_alloc_node(struct kmem_cache *cachep,
70 gfp_t flags, int node)
71{
72 return kmem_cache_alloc(cachep, flags);
73}
74#endif
75
76/* 75/*
77 * The largest kmalloc size supported by the slab allocators is 76 * The largest kmalloc size supported by the slab allocators is
78 * 32 megabyte (2^25) or the maximum allocatable page order if that is 77 * 32 megabyte (2^25) or the maximum allocatable page order if that is
@@ -82,8 +81,8 @@ static inline void *kmem_cache_alloc_node(struct kmem_cache *cachep,
82 * to do various tricks to work around compiler limitations in order to 81 * to do various tricks to work around compiler limitations in order to
83 * ensure proper constant folding. 82 * ensure proper constant folding.
84 */ 83 */
85#define KMALLOC_SHIFT_HIGH ((MAX_ORDER + PAGE_SHIFT) <= 25 ? \ 84#define KMALLOC_SHIFT_HIGH ((MAX_ORDER + PAGE_SHIFT - 1) <= 25 ? \
86 (MAX_ORDER + PAGE_SHIFT) : 25) 85 (MAX_ORDER + PAGE_SHIFT - 1) : 25)
87 86
88#define KMALLOC_MAX_SIZE (1UL << KMALLOC_SHIFT_HIGH) 87#define KMALLOC_MAX_SIZE (1UL << KMALLOC_SHIFT_HIGH)
89#define KMALLOC_MAX_ORDER (KMALLOC_SHIFT_HIGH - PAGE_SHIFT) 88#define KMALLOC_MAX_ORDER (KMALLOC_SHIFT_HIGH - PAGE_SHIFT)
@@ -91,59 +90,50 @@ static inline void *kmem_cache_alloc_node(struct kmem_cache *cachep,
91/* 90/*
92 * Common kmalloc functions provided by all allocators 91 * Common kmalloc functions provided by all allocators
93 */ 92 */
94void *__kmalloc(size_t, gfp_t);
95void *__kzalloc(size_t, gfp_t);
96void * __must_check krealloc(const void *, size_t, gfp_t); 93void * __must_check krealloc(const void *, size_t, gfp_t);
97void kfree(const void *); 94void kfree(const void *);
98size_t ksize(const void *); 95size_t ksize(const void *);
99 96
100/**
101 * kcalloc - allocate memory for an array. The memory is set to zero.
102 * @n: number of elements.
103 * @size: element size.
104 * @flags: the type of memory to allocate.
105 */
106static inline void *kcalloc(size_t n, size_t size, gfp_t flags)
107{
108 if (n != 0 && size > ULONG_MAX / n)
109 return NULL;
110 return __kzalloc(n * size, flags);
111}
112
113/* 97/*
114 * Allocator specific definitions. These are mainly used to establish optimized 98 * Allocator specific definitions. These are mainly used to establish optimized
115 * ways to convert kmalloc() calls to kmem_cache_alloc() invocations by selecting 99 * ways to convert kmalloc() calls to kmem_cache_alloc() invocations by
116 * the appropriate general cache at compile time. 100 * selecting the appropriate general cache at compile time.
101 *
102 * Allocators must define at least:
103 *
104 * kmem_cache_alloc()
105 * __kmalloc()
106 * kmalloc()
107 *
108 * Those wishing to support NUMA must also define:
109 *
110 * kmem_cache_alloc_node()
111 * kmalloc_node()
112 *
113 * See each allocator definition file for additional comments and
114 * implementation notes.
117 */ 115 */
118
119#if defined(CONFIG_SLAB) || defined(CONFIG_SLUB)
120#ifdef CONFIG_SLUB 116#ifdef CONFIG_SLUB
121#include <linux/slub_def.h> 117#include <linux/slub_def.h>
118#elif defined(CONFIG_SLOB)
119#include <linux/slob_def.h>
122#else 120#else
123#include <linux/slab_def.h> 121#include <linux/slab_def.h>
124#endif /* !CONFIG_SLUB */ 122#endif
125#else
126
127/*
128 * Fallback definitions for an allocator not wanting to provide
129 * its own optimized kmalloc definitions (like SLOB).
130 */
131 123
132/** 124/**
133 * kmalloc - allocate memory 125 * kcalloc - allocate memory for an array. The memory is set to zero.
134 * @size: how many bytes of memory are required. 126 * @n: number of elements.
127 * @size: element size.
135 * @flags: the type of memory to allocate. 128 * @flags: the type of memory to allocate.
136 * 129 *
137 * kmalloc is the normal method of allocating memory
138 * in the kernel.
139 *
140 * The @flags argument may be one of: 130 * The @flags argument may be one of:
141 * 131 *
142 * %GFP_USER - Allocate memory on behalf of user. May sleep. 132 * %GFP_USER - Allocate memory on behalf of user. May sleep.
143 * 133 *
144 * %GFP_KERNEL - Allocate normal kernel ram. May sleep. 134 * %GFP_KERNEL - Allocate normal kernel ram. May sleep.
145 * 135 *
146 * %GFP_ATOMIC - Allocation will not sleep. 136 * %GFP_ATOMIC - Allocation will not sleep. May use emergency pools.
147 * For example, use this inside interrupt handlers. 137 * For example, use this inside interrupt handlers.
148 * 138 *
149 * %GFP_HIGHUSER - Allocate pages from high memory. 139 * %GFP_HIGHUSER - Allocate pages from high memory.
@@ -152,18 +142,22 @@ static inline void *kcalloc(size_t n, size_t size, gfp_t flags)
152 * 142 *
153 * %GFP_NOFS - Do not make any fs calls while trying to get memory. 143 * %GFP_NOFS - Do not make any fs calls while trying to get memory.
154 * 144 *
145 * %GFP_NOWAIT - Allocation will not sleep.
146 *
147 * %GFP_THISNODE - Allocate node-local memory only.
148 *
149 * %GFP_DMA - Allocation suitable for DMA.
150 * Should only be used for kmalloc() caches. Otherwise, use a
151 * slab created with SLAB_DMA.
152 *
155 * Also it is possible to set different flags by OR'ing 153 * Also it is possible to set different flags by OR'ing
156 * in one or more of the following additional @flags: 154 * in one or more of the following additional @flags:
157 * 155 *
158 * %__GFP_COLD - Request cache-cold pages instead of 156 * %__GFP_COLD - Request cache-cold pages instead of
159 * trying to return cache-warm pages. 157 * trying to return cache-warm pages.
160 * 158 *
161 * %__GFP_DMA - Request memory from the DMA-capable zone.
162 *
163 * %__GFP_HIGH - This allocation has high priority and may use emergency pools. 159 * %__GFP_HIGH - This allocation has high priority and may use emergency pools.
164 * 160 *
165 * %__GFP_HIGHMEM - Allocated memory may be from highmem.
166 *
167 * %__GFP_NOFAIL - Indicate that this allocation is in no way allowed to fail 161 * %__GFP_NOFAIL - Indicate that this allocation is in no way allowed to fail
168 * (think twice before using). 162 * (think twice before using).
169 * 163 *
@@ -173,24 +167,29 @@ static inline void *kcalloc(size_t n, size_t size, gfp_t flags)
173 * %__GFP_NOWARN - If allocation fails, don't issue any warnings. 167 * %__GFP_NOWARN - If allocation fails, don't issue any warnings.
174 * 168 *
175 * %__GFP_REPEAT - If allocation fails initially, try once more before failing. 169 * %__GFP_REPEAT - If allocation fails initially, try once more before failing.
170 *
171 * There are other flags available as well, but these are not intended
172 * for general use, and so are not documented here. For a full list of
173 * potential flags, always refer to linux/gfp.h.
176 */ 174 */
177static inline void *kmalloc(size_t size, gfp_t flags) 175static inline void *kcalloc(size_t n, size_t size, gfp_t flags)
178{ 176{
179 return __kmalloc(size, flags); 177 if (n != 0 && size > ULONG_MAX / n)
178 return NULL;
179 return __kmalloc(n * size, flags | __GFP_ZERO);
180} 180}
181 181
182#if !defined(CONFIG_NUMA) && !defined(CONFIG_SLOB)
182/** 183/**
183 * kzalloc - allocate memory. The memory is set to zero. 184 * kmalloc_node - allocate memory from a specific node
184 * @size: how many bytes of memory are required. 185 * @size: how many bytes of memory are required.
185 * @flags: the type of memory to allocate (see kmalloc). 186 * @flags: the type of memory to allocate (see kcalloc).
187 * @node: node to allocate from.
188 *
189 * kmalloc() for non-local nodes, used to allocate from a specific node
190 * if available. Equivalent to kmalloc() in the non-NUMA single-node
191 * case.
186 */ 192 */
187static inline void *kzalloc(size_t size, gfp_t flags)
188{
189 return __kzalloc(size, flags);
190}
191#endif
192
193#ifndef CONFIG_NUMA
194static inline void *kmalloc_node(size_t size, gfp_t flags, int node) 193static inline void *kmalloc_node(size_t size, gfp_t flags, int node)
195{ 194{
196 return kmalloc(size, flags); 195 return kmalloc(size, flags);
@@ -200,7 +199,15 @@ static inline void *__kmalloc_node(size_t size, gfp_t flags, int node)
200{ 199{
201 return __kmalloc(size, flags); 200 return __kmalloc(size, flags);
202} 201}
203#endif /* !CONFIG_NUMA */ 202
203void *kmem_cache_alloc(struct kmem_cache *, gfp_t);
204
205static inline void *kmem_cache_alloc_node(struct kmem_cache *cachep,
206 gfp_t flags, int node)
207{
208 return kmem_cache_alloc(cachep, flags);
209}
210#endif /* !CONFIG_NUMA && !CONFIG_SLOB */
204 211
205/* 212/*
206 * kmalloc_track_caller is a special version of kmalloc that records the 213 * kmalloc_track_caller is a special version of kmalloc that records the
@@ -245,6 +252,23 @@ extern void *__kmalloc_node_track_caller(size_t, gfp_t, int, void *);
245 252
246#endif /* DEBUG_SLAB */ 253#endif /* DEBUG_SLAB */
247 254
255/*
256 * Shortcuts
257 */
258static inline void *kmem_cache_zalloc(struct kmem_cache *k, gfp_t flags)
259{
260 return kmem_cache_alloc(k, flags | __GFP_ZERO);
261}
262
263/**
264 * kzalloc - allocate memory. The memory is set to zero.
265 * @size: how many bytes of memory are required.
266 * @flags: the type of memory to allocate (see kmalloc).
267 */
268static inline void *kzalloc(size_t size, gfp_t flags)
269{
270 return kmalloc(size, flags | __GFP_ZERO);
271}
272
248#endif /* __KERNEL__ */ 273#endif /* __KERNEL__ */
249#endif /* _LINUX_SLAB_H */ 274#endif /* _LINUX_SLAB_H */
250
diff --git a/include/linux/slab_def.h b/include/linux/slab_def.h
index 8d81a60518e4..32bdc2ffd715 100644
--- a/include/linux/slab_def.h
+++ b/include/linux/slab_def.h
@@ -25,10 +25,17 @@ struct cache_sizes {
25}; 25};
26extern struct cache_sizes malloc_sizes[]; 26extern struct cache_sizes malloc_sizes[];
27 27
28void *kmem_cache_alloc(struct kmem_cache *, gfp_t);
29void *__kmalloc(size_t size, gfp_t flags);
30
28static inline void *kmalloc(size_t size, gfp_t flags) 31static inline void *kmalloc(size_t size, gfp_t flags)
29{ 32{
30 if (__builtin_constant_p(size)) { 33 if (__builtin_constant_p(size)) {
31 int i = 0; 34 int i = 0;
35
36 if (!size)
37 return ZERO_SIZE_PTR;
38
32#define CACHE(x) \ 39#define CACHE(x) \
33 if (size <= x) \ 40 if (size <= x) \
34 goto found; \ 41 goto found; \
@@ -51,39 +58,18 @@ found:
51 return __kmalloc(size, flags); 58 return __kmalloc(size, flags);
52} 59}
53 60
54static inline void *kzalloc(size_t size, gfp_t flags)
55{
56 if (__builtin_constant_p(size)) {
57 int i = 0;
58#define CACHE(x) \
59 if (size <= x) \
60 goto found; \
61 else \
62 i++;
63#include "kmalloc_sizes.h"
64#undef CACHE
65 {
66 extern void __you_cannot_kzalloc_that_much(void);
67 __you_cannot_kzalloc_that_much();
68 }
69found:
70#ifdef CONFIG_ZONE_DMA
71 if (flags & GFP_DMA)
72 return kmem_cache_zalloc(malloc_sizes[i].cs_dmacachep,
73 flags);
74#endif
75 return kmem_cache_zalloc(malloc_sizes[i].cs_cachep, flags);
76 }
77 return __kzalloc(size, flags);
78}
79
80#ifdef CONFIG_NUMA 61#ifdef CONFIG_NUMA
81extern void *__kmalloc_node(size_t size, gfp_t flags, int node); 62extern void *__kmalloc_node(size_t size, gfp_t flags, int node);
63extern void *kmem_cache_alloc_node(struct kmem_cache *, gfp_t flags, int node);
82 64
83static inline void *kmalloc_node(size_t size, gfp_t flags, int node) 65static inline void *kmalloc_node(size_t size, gfp_t flags, int node)
84{ 66{
85 if (__builtin_constant_p(size)) { 67 if (__builtin_constant_p(size)) {
86 int i = 0; 68 int i = 0;
69
70 if (!size)
71 return ZERO_SIZE_PTR;
72
87#define CACHE(x) \ 73#define CACHE(x) \
88 if (size <= x) \ 74 if (size <= x) \
89 goto found; \ 75 goto found; \
diff --git a/include/linux/slob_def.h b/include/linux/slob_def.h
new file mode 100644
index 000000000000..59a3fa476ab9
--- /dev/null
+++ b/include/linux/slob_def.h
@@ -0,0 +1,36 @@
1#ifndef __LINUX_SLOB_DEF_H
2#define __LINUX_SLOB_DEF_H
3
4void *kmem_cache_alloc_node(struct kmem_cache *, gfp_t flags, int node);
5
6static inline void *kmem_cache_alloc(struct kmem_cache *cachep, gfp_t flags)
7{
8 return kmem_cache_alloc_node(cachep, flags, -1);
9}
10
11void *__kmalloc_node(size_t size, gfp_t flags, int node);
12
13static inline void *kmalloc_node(size_t size, gfp_t flags, int node)
14{
15 return __kmalloc_node(size, flags, node);
16}
17
18/**
19 * kmalloc - allocate memory
20 * @size: how many bytes of memory are required.
21 * @flags: the type of memory to allocate (see kcalloc).
22 *
23 * kmalloc is the normal method of allocating memory
24 * in the kernel.
25 */
26static inline void *kmalloc(size_t size, gfp_t flags)
27{
28 return __kmalloc_node(size, flags, -1);
29}
30
31static inline void *__kmalloc(size_t size, gfp_t flags)
32{
33 return kmalloc(size, flags);
34}
35
36#endif /* __LINUX_SLOB_DEF_H */
diff --git a/include/linux/slub_def.h b/include/linux/slub_def.h
index 6207a3d8da71..07f7e4cbcee3 100644
--- a/include/linux/slub_def.h
+++ b/include/linux/slub_def.h
@@ -16,7 +16,9 @@ struct kmem_cache_node {
16 unsigned long nr_partial; 16 unsigned long nr_partial;
17 atomic_long_t nr_slabs; 17 atomic_long_t nr_slabs;
18 struct list_head partial; 18 struct list_head partial;
19#ifdef CONFIG_SLUB_DEBUG
19 struct list_head full; 20 struct list_head full;
21#endif
20}; 22};
21 23
22/* 24/*
@@ -44,7 +46,9 @@ struct kmem_cache {
44 int align; /* Alignment */ 46 int align; /* Alignment */
45 const char *name; /* Name (only for display!) */ 47 const char *name; /* Name (only for display!) */
46 struct list_head list; /* List of slab caches */ 48 struct list_head list; /* List of slab caches */
49#ifdef CONFIG_SLUB_DEBUG
47 struct kobject kobj; /* For sysfs */ 50 struct kobject kobj; /* For sysfs */
51#endif
48 52
49#ifdef CONFIG_NUMA 53#ifdef CONFIG_NUMA
50 int defrag_ratio; 54 int defrag_ratio;
@@ -159,17 +163,8 @@ static inline struct kmem_cache *kmalloc_slab(size_t size)
159#define SLUB_DMA 0 163#define SLUB_DMA 0
160#endif 164#endif
161 165
162 166void *kmem_cache_alloc(struct kmem_cache *, gfp_t);
163/* 167void *__kmalloc(size_t size, gfp_t flags);
164 * ZERO_SIZE_PTR will be returned for zero sized kmalloc requests.
165 *
166 * Dereferencing ZERO_SIZE_PTR will lead to a distinct access fault.
167 *
168 * ZERO_SIZE_PTR can be passed to kfree though in the same way that NULL can.
169 * Both make kfree a no-op.
170 */
171#define ZERO_SIZE_PTR ((void *)16)
172
173 168
174static inline void *kmalloc(size_t size, gfp_t flags) 169static inline void *kmalloc(size_t size, gfp_t flags)
175{ 170{
@@ -184,21 +179,9 @@ static inline void *kmalloc(size_t size, gfp_t flags)
184 return __kmalloc(size, flags); 179 return __kmalloc(size, flags);
185} 180}
186 181
187static inline void *kzalloc(size_t size, gfp_t flags)
188{
189 if (__builtin_constant_p(size) && !(flags & SLUB_DMA)) {
190 struct kmem_cache *s = kmalloc_slab(size);
191
192 if (!s)
193 return ZERO_SIZE_PTR;
194
195 return kmem_cache_zalloc(s, flags);
196 } else
197 return __kzalloc(size, flags);
198}
199
200#ifdef CONFIG_NUMA 182#ifdef CONFIG_NUMA
201extern void *__kmalloc_node(size_t size, gfp_t flags, int node); 183void *__kmalloc_node(size_t size, gfp_t flags, int node);
184void *kmem_cache_alloc_node(struct kmem_cache *, gfp_t flags, int node);
202 185
203static inline void *kmalloc_node(size_t size, gfp_t flags, int node) 186static inline void *kmalloc_node(size_t size, gfp_t flags, int node)
204{ 187{
diff --git a/include/linux/sm501-regs.h b/include/linux/sm501-regs.h
index cc9be4a11861..014e73b31fc0 100644
--- a/include/linux/sm501-regs.h
+++ b/include/linux/sm501-regs.h
@@ -64,6 +64,11 @@
64#define SM501_DEBUG_CONTROL (0x000034) 64#define SM501_DEBUG_CONTROL (0x000034)
65 65
66/* power management */ 66/* power management */
67#define SM501_POWERMODE_P2X_SRC (1<<29)
68#define SM501_POWERMODE_V2X_SRC (1<<20)
69#define SM501_POWERMODE_M_SRC (1<<12)
70#define SM501_POWERMODE_M1_SRC (1<<4)
71
67#define SM501_CURRENT_GATE (0x000038) 72#define SM501_CURRENT_GATE (0x000038)
68#define SM501_CURRENT_CLOCK (0x00003C) 73#define SM501_CURRENT_CLOCK (0x00003C)
69#define SM501_POWER_MODE_0_GATE (0x000040) 74#define SM501_POWER_MODE_0_GATE (0x000040)
@@ -104,6 +109,9 @@
104#define SM501_DEVICEID (0x000060) 109#define SM501_DEVICEID (0x000060)
105/* 0x050100A0 */ 110/* 0x050100A0 */
106 111
112#define SM501_DEVICEID_SM501 (0x05010000)
113#define SM501_DEVICEID_IDMASK (0xffff0000)
114
107#define SM501_PLLCLOCK_COUNT (0x000064) 115#define SM501_PLLCLOCK_COUNT (0x000064)
108#define SM501_MISC_TIMING (0x000068) 116#define SM501_MISC_TIMING (0x000068)
109#define SM501_CURRENT_SDRAM_CLOCK (0x00006C) 117#define SM501_CURRENT_SDRAM_CLOCK (0x00006C)
diff --git a/include/linux/smp.h b/include/linux/smp.h
index 96ac21f8dd73..259a13c3bd98 100644
--- a/include/linux/smp.h
+++ b/include/linux/smp.h
@@ -99,11 +99,14 @@ static inline int up_smp_call_function(void)
99static inline void smp_send_reschedule(int cpu) { } 99static inline void smp_send_reschedule(int cpu) { }
100#define num_booting_cpus() 1 100#define num_booting_cpus() 1
101#define smp_prepare_boot_cpu() do {} while (0) 101#define smp_prepare_boot_cpu() do {} while (0)
102static inline int smp_call_function_single(int cpuid, void (*func) (void *info), 102#define smp_call_function_single(cpuid, func, info, retry, wait) \
103 void *info, int retry, int wait) 103({ \
104{ 104 WARN_ON(cpuid != 0); \
105 return -EBUSY; 105 local_irq_disable(); \
106} 106 (func)(info); \
107 local_irq_enable(); \
108 0; \
109})
107 110
108#endif /* !SMP */ 111#endif /* !SMP */
109 112
diff --git a/include/linux/smp_lock.h b/include/linux/smp_lock.h
index cf715a40d833..58962c51dee1 100644
--- a/include/linux/smp_lock.h
+++ b/include/linux/smp_lock.h
@@ -3,7 +3,6 @@
3 3
4#ifdef CONFIG_LOCK_KERNEL 4#ifdef CONFIG_LOCK_KERNEL
5#include <linux/sched.h> 5#include <linux/sched.h>
6#include <linux/spinlock.h>
7 6
8#define kernel_locked() (current->lock_depth >= 0) 7#define kernel_locked() (current->lock_depth >= 0)
9 8
diff --git a/include/linux/socket.h b/include/linux/socket.h
index 6e7c9483a6a6..f852e1afd65a 100644
--- a/include/linux/socket.h
+++ b/include/linux/socket.h
@@ -253,6 +253,9 @@ struct ucred {
253 253
254#define MSG_EOF MSG_FIN 254#define MSG_EOF MSG_FIN
255 255
256#define MSG_CMSG_CLOEXEC 0x40000000 /* Set close_on_exit for file
257 descriptor received through
258 SCM_RIGHTS */
256#if defined(CONFIG_COMPAT) 259#if defined(CONFIG_COMPAT)
257#define MSG_CMSG_COMPAT 0x80000000 /* This message needs 32 bit fixups */ 260#define MSG_CMSG_COMPAT 0x80000000 /* This message needs 32 bit fixups */
258#else 261#else
@@ -287,6 +290,7 @@ struct ucred {
287#define SOL_NETLINK 270 290#define SOL_NETLINK 270
288#define SOL_TIPC 271 291#define SOL_TIPC 271
289#define SOL_RXRPC 272 292#define SOL_RXRPC 272
293#define SOL_PPPOL2TP 273
290 294
291/* IPX options */ 295/* IPX options */
292#define IPX_TYPE 1 296#define IPX_TYPE 1
diff --git a/include/linux/sonypi.h b/include/linux/sonypi.h
index 34d4b075f7b8..40c7b5d993b9 100644
--- a/include/linux/sonypi.h
+++ b/include/linux/sonypi.h
@@ -153,8 +153,6 @@
153#define SONYPI_COMMAND_GETCAMERAROMVERSION 18 /* obsolete */ 153#define SONYPI_COMMAND_GETCAMERAROMVERSION 18 /* obsolete */
154#define SONYPI_COMMAND_GETCAMERAREVISION 19 /* obsolete */ 154#define SONYPI_COMMAND_GETCAMERAREVISION 19 /* obsolete */
155 155
156int sonypi_camera_command(int command, u8 value);
157
158#endif /* __KERNEL__ */ 156#endif /* __KERNEL__ */
159 157
160#endif /* _SONYPI_H_ */ 158#endif /* _SONYPI_H_ */
diff --git a/include/linux/spi/spi.h b/include/linux/spi/spi.h
index 1be5ea059477..302b81d1d117 100644
--- a/include/linux/spi/spi.h
+++ b/include/linux/spi/spi.h
@@ -76,6 +76,7 @@ struct spi_device {
76#define SPI_MODE_3 (SPI_CPOL|SPI_CPHA) 76#define SPI_MODE_3 (SPI_CPOL|SPI_CPHA)
77#define SPI_CS_HIGH 0x04 /* chipselect active high? */ 77#define SPI_CS_HIGH 0x04 /* chipselect active high? */
78#define SPI_LSB_FIRST 0x08 /* per-word bits-on-wire */ 78#define SPI_LSB_FIRST 0x08 /* per-word bits-on-wire */
79#define SPI_3WIRE 0x10 /* SI/SO signals shared */
79 u8 bits_per_word; 80 u8 bits_per_word;
80 int irq; 81 int irq;
81 void *controller_state; 82 void *controller_state;
diff --git a/include/linux/spi/spi_bitbang.h b/include/linux/spi/spi_bitbang.h
index 9dbca629dcfb..b8db32cea1de 100644
--- a/include/linux/spi/spi_bitbang.h
+++ b/include/linux/spi/spi_bitbang.h
@@ -26,6 +26,7 @@ struct spi_bitbang {
26 struct list_head queue; 26 struct list_head queue;
27 u8 busy; 27 u8 busy;
28 u8 use_dma; 28 u8 use_dma;
29 u8 flags; /* extra spi->mode support */
29 30
30 struct spi_master *master; 31 struct spi_master *master;
31 32
diff --git a/include/linux/spi/tle62x0.h b/include/linux/spi/tle62x0.h
new file mode 100644
index 000000000000..60b59187e590
--- /dev/null
+++ b/include/linux/spi/tle62x0.h
@@ -0,0 +1,24 @@
1/*
2 * tle62x0.h - platform glue to Infineon TLE62x0 driver chips
3 *
4 * Copyright 2007 Simtec Electronics
5 * Ben Dooks <ben@simtec.co.uk>
6 *
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
10 *
11 * This program is distributed in the hope that it will be useful,
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
21struct tle62x0_pdata {
22 unsigned int init_state;
23 unsigned int gpio_count;
24};
diff --git a/include/linux/spinlock.h b/include/linux/spinlock.h
index a946176db638..c376f3b36c89 100644
--- a/include/linux/spinlock.h
+++ b/include/linux/spinlock.h
@@ -282,6 +282,13 @@ do { \
282 1 : ({ local_irq_restore(flags); 0; }); \ 282 1 : ({ local_irq_restore(flags); 0; }); \
283}) 283})
284 284
285#define write_trylock_irqsave(lock, flags) \
286({ \
287 local_irq_save(flags); \
288 write_trylock(lock) ? \
289 1 : ({ local_irq_restore(flags); 0; }); \
290})
291
285/* 292/*
286 * Locks two spinlocks l1 and l2. 293 * Locks two spinlocks l1 and l2.
287 * l1_first indicates if spinlock l1 should be taken first. 294 * l1_first indicates if spinlock l1 should be taken first.
diff --git a/include/linux/splice.h b/include/linux/splice.h
new file mode 100644
index 000000000000..33e447f98a54
--- /dev/null
+++ b/include/linux/splice.h
@@ -0,0 +1,73 @@
1/*
2 * Function declerations and data structures related to the splice
3 * implementation.
4 *
5 * Copyright (C) 2007 Jens Axboe <jens.axboe@oracle.com>
6 *
7 */
8#ifndef SPLICE_H
9#define SPLICE_H
10
11#include <linux/pipe_fs_i.h>
12
13/*
14 * splice is tied to pipes as a transport (at least for now), so we'll just
15 * add the splice flags here.
16 */
17#define SPLICE_F_MOVE (0x01) /* move pages instead of copying */
18#define SPLICE_F_NONBLOCK (0x02) /* don't block on the pipe splicing (but */
19 /* we may still block on the fd we splice */
20 /* from/to, of course */
21#define SPLICE_F_MORE (0x04) /* expect more data */
22#define SPLICE_F_GIFT (0x08) /* pages passed in are a gift */
23
24/*
25 * Passed to the actors
26 */
27struct splice_desc {
28 unsigned int len, total_len; /* current and remaining length */
29 unsigned int flags; /* splice flags */
30 /*
31 * actor() private data
32 */
33 union {
34 void __user *userptr; /* memory to write to */
35 struct file *file; /* file to read/write */
36 void *data; /* cookie */
37 } u;
38 loff_t pos; /* file position */
39};
40
41struct partial_page {
42 unsigned int offset;
43 unsigned int len;
44 unsigned long private;
45};
46
47/*
48 * Passed to splice_to_pipe
49 */
50struct splice_pipe_desc {
51 struct page **pages; /* page map */
52 struct partial_page *partial; /* pages[] may not be contig */
53 int nr_pages; /* number of pages in map */
54 unsigned int flags; /* splice flags */
55 const struct pipe_buf_operations *ops;/* ops associated with output pipe */
56};
57
58typedef int (splice_actor)(struct pipe_inode_info *, struct pipe_buffer *,
59 struct splice_desc *);
60typedef int (splice_direct_actor)(struct pipe_inode_info *,
61 struct splice_desc *);
62
63extern ssize_t splice_from_pipe(struct pipe_inode_info *, struct file *,
64 loff_t *, size_t, unsigned int,
65 splice_actor *);
66extern ssize_t __splice_from_pipe(struct pipe_inode_info *,
67 struct splice_desc *, splice_actor *);
68extern ssize_t splice_to_pipe(struct pipe_inode_info *,
69 struct splice_pipe_desc *);
70extern ssize_t splice_direct_to_actor(struct file *, struct splice_desc *,
71 splice_direct_actor *);
72
73#endif
diff --git a/include/linux/string.h b/include/linux/string.h
index 7f2eb6a477f9..836062b7582a 100644
--- a/include/linux/string.h
+++ b/include/linux/string.h
@@ -105,8 +105,12 @@ extern void * memchr(const void *,int,__kernel_size_t);
105#endif 105#endif
106 106
107extern char *kstrdup(const char *s, gfp_t gfp); 107extern char *kstrdup(const char *s, gfp_t gfp);
108extern char *kstrndup(const char *s, size_t len, gfp_t gfp);
108extern void *kmemdup(const void *src, size_t len, gfp_t gfp); 109extern void *kmemdup(const void *src, size_t len, gfp_t gfp);
109 110
111extern char **argv_split(gfp_t gfp, const char *str, int *argcp);
112extern void argv_free(char **argv);
113
110#ifdef __cplusplus 114#ifdef __cplusplus
111} 115}
112#endif 116#endif
diff --git a/include/linux/sunrpc/auth.h b/include/linux/sunrpc/auth.h
index 534cdc7be58d..7a69ca3bebaf 100644
--- a/include/linux/sunrpc/auth.h
+++ b/include/linux/sunrpc/auth.h
@@ -16,6 +16,7 @@
16#include <linux/sunrpc/xdr.h> 16#include <linux/sunrpc/xdr.h>
17 17
18#include <asm/atomic.h> 18#include <asm/atomic.h>
19#include <linux/rcupdate.h>
19 20
20/* size of the nodename buffer */ 21/* size of the nodename buffer */
21#define UNX_MAXNODENAME 32 22#define UNX_MAXNODENAME 32
@@ -30,22 +31,28 @@ struct auth_cred {
30/* 31/*
31 * Client user credentials 32 * Client user credentials
32 */ 33 */
34struct rpc_auth;
35struct rpc_credops;
33struct rpc_cred { 36struct rpc_cred {
34 struct hlist_node cr_hash; /* hash chain */ 37 struct hlist_node cr_hash; /* hash chain */
35 struct rpc_credops * cr_ops; 38 struct list_head cr_lru; /* lru garbage collection */
36 unsigned long cr_expire; /* when to gc */ 39 struct rcu_head cr_rcu;
37 atomic_t cr_count; /* ref count */ 40 struct rpc_auth * cr_auth;
38 unsigned short cr_flags; /* various flags */ 41 const struct rpc_credops *cr_ops;
39#ifdef RPC_DEBUG 42#ifdef RPC_DEBUG
40 unsigned long cr_magic; /* 0x0f4aa4f0 */ 43 unsigned long cr_magic; /* 0x0f4aa4f0 */
41#endif 44#endif
45 unsigned long cr_expire; /* when to gc */
46 unsigned long cr_flags; /* various flags */
47 atomic_t cr_count; /* ref count */
42 48
43 uid_t cr_uid; 49 uid_t cr_uid;
44 50
45 /* per-flavor data */ 51 /* per-flavor data */
46}; 52};
47#define RPCAUTH_CRED_NEW 0x0001 53#define RPCAUTH_CRED_NEW 0
48#define RPCAUTH_CRED_UPTODATE 0x0002 54#define RPCAUTH_CRED_UPTODATE 1
55#define RPCAUTH_CRED_HASHED 2
49 56
50#define RPCAUTH_CRED_MAGIC 0x0f4aa4f0 57#define RPCAUTH_CRED_MAGIC 0x0f4aa4f0
51 58
@@ -56,10 +63,10 @@ struct rpc_cred {
56#define RPC_CREDCACHE_MASK (RPC_CREDCACHE_NR - 1) 63#define RPC_CREDCACHE_MASK (RPC_CREDCACHE_NR - 1)
57struct rpc_cred_cache { 64struct rpc_cred_cache {
58 struct hlist_head hashtable[RPC_CREDCACHE_NR]; 65 struct hlist_head hashtable[RPC_CREDCACHE_NR];
59 unsigned long nextgc; /* next garbage collection */ 66 spinlock_t lock;
60 unsigned long expire; /* cache expiry interval */
61}; 67};
62 68
69struct rpc_authops;
63struct rpc_auth { 70struct rpc_auth {
64 unsigned int au_cslack; /* call cred size estimate */ 71 unsigned int au_cslack; /* call cred size estimate */
65 /* guess at number of u32's auth adds before 72 /* guess at number of u32's auth adds before
@@ -69,7 +76,7 @@ struct rpc_auth {
69 unsigned int au_verfsize; 76 unsigned int au_verfsize;
70 77
71 unsigned int au_flags; /* various flags */ 78 unsigned int au_flags; /* various flags */
72 struct rpc_authops * au_ops; /* operations */ 79 const struct rpc_authops *au_ops; /* operations */
73 rpc_authflavor_t au_flavor; /* pseudoflavor (note may 80 rpc_authflavor_t au_flavor; /* pseudoflavor (note may
74 * differ from the flavor in 81 * differ from the flavor in
75 * au_ops->au_flavor in gss 82 * au_ops->au_flavor in gss
@@ -115,17 +122,19 @@ struct rpc_credops {
115 void *, __be32 *, void *); 122 void *, __be32 *, void *);
116}; 123};
117 124
118extern struct rpc_authops authunix_ops; 125extern const struct rpc_authops authunix_ops;
119extern struct rpc_authops authnull_ops; 126extern const struct rpc_authops authnull_ops;
120#ifdef CONFIG_SUNRPC_SECURE 127
121extern struct rpc_authops authdes_ops; 128void __init rpc_init_authunix(void);
122#endif 129void __init rpcauth_init_module(void);
130void __exit rpcauth_remove_module(void);
123 131
124int rpcauth_register(struct rpc_authops *); 132int rpcauth_register(const struct rpc_authops *);
125int rpcauth_unregister(struct rpc_authops *); 133int rpcauth_unregister(const struct rpc_authops *);
126struct rpc_auth * rpcauth_create(rpc_authflavor_t, struct rpc_clnt *); 134struct rpc_auth * rpcauth_create(rpc_authflavor_t, struct rpc_clnt *);
127void rpcauth_destroy(struct rpc_auth *); 135void rpcauth_release(struct rpc_auth *);
128struct rpc_cred * rpcauth_lookup_credcache(struct rpc_auth *, struct auth_cred *, int); 136struct rpc_cred * rpcauth_lookup_credcache(struct rpc_auth *, struct auth_cred *, int);
137void rpcauth_init_cred(struct rpc_cred *, const struct auth_cred *, struct rpc_auth *, const struct rpc_credops *);
129struct rpc_cred * rpcauth_lookupcred(struct rpc_auth *, int); 138struct rpc_cred * rpcauth_lookupcred(struct rpc_auth *, int);
130struct rpc_cred * rpcauth_bindcred(struct rpc_task *); 139struct rpc_cred * rpcauth_bindcred(struct rpc_task *);
131void rpcauth_holdcred(struct rpc_task *); 140void rpcauth_holdcred(struct rpc_task *);
@@ -138,8 +147,9 @@ int rpcauth_unwrap_resp(struct rpc_task *task, kxdrproc_t decode, void *rqstp,
138int rpcauth_refreshcred(struct rpc_task *); 147int rpcauth_refreshcred(struct rpc_task *);
139void rpcauth_invalcred(struct rpc_task *); 148void rpcauth_invalcred(struct rpc_task *);
140int rpcauth_uptodatecred(struct rpc_task *); 149int rpcauth_uptodatecred(struct rpc_task *);
141int rpcauth_init_credcache(struct rpc_auth *, unsigned long); 150int rpcauth_init_credcache(struct rpc_auth *);
142void rpcauth_free_credcache(struct rpc_auth *); 151void rpcauth_destroy_credcache(struct rpc_auth *);
152void rpcauth_clear_credcache(struct rpc_cred_cache *);
143 153
144static inline 154static inline
145struct rpc_cred * get_rpccred(struct rpc_cred *cred) 155struct rpc_cred * get_rpccred(struct rpc_cred *cred)
diff --git a/include/linux/sunrpc/auth_gss.h b/include/linux/sunrpc/auth_gss.h
index 2db2fbf34947..67658e17a375 100644
--- a/include/linux/sunrpc/auth_gss.h
+++ b/include/linux/sunrpc/auth_gss.h
@@ -75,6 +75,7 @@ struct gss_cl_ctx {
75 struct xdr_netobj gc_wire_ctx; 75 struct xdr_netobj gc_wire_ctx;
76 u32 gc_win; 76 u32 gc_win;
77 unsigned long gc_expiry; 77 unsigned long gc_expiry;
78 struct rcu_head gc_rcu;
78}; 79};
79 80
80struct gss_upcall_msg; 81struct gss_upcall_msg;
@@ -85,11 +86,6 @@ struct gss_cred {
85 struct gss_upcall_msg *gc_upcall; 86 struct gss_upcall_msg *gc_upcall;
86}; 87};
87 88
88#define gc_uid gc_base.cr_uid
89#define gc_count gc_base.cr_count
90#define gc_flags gc_base.cr_flags
91#define gc_expire gc_base.cr_expire
92
93#endif /* __KERNEL__ */ 89#endif /* __KERNEL__ */
94#endif /* _LINUX_SUNRPC_AUTH_GSS_H */ 90#endif /* _LINUX_SUNRPC_AUTH_GSS_H */
95 91
diff --git a/include/linux/sunrpc/clnt.h b/include/linux/sunrpc/clnt.h
index 66611423c8ee..c0d9d14983b3 100644
--- a/include/linux/sunrpc/clnt.h
+++ b/include/linux/sunrpc/clnt.h
@@ -24,8 +24,10 @@ struct rpc_inode;
24 * The high-level client handle 24 * The high-level client handle
25 */ 25 */
26struct rpc_clnt { 26struct rpc_clnt {
27 atomic_t cl_count; /* Number of clones */ 27 struct kref cl_kref; /* Number of references */
28 atomic_t cl_users; /* number of references */ 28 struct list_head cl_clients; /* Global list of clients */
29 struct list_head cl_tasks; /* List of tasks */
30 spinlock_t cl_lock; /* spinlock */
29 struct rpc_xprt * cl_xprt; /* transport */ 31 struct rpc_xprt * cl_xprt; /* transport */
30 struct rpc_procinfo * cl_procinfo; /* procedure info */ 32 struct rpc_procinfo * cl_procinfo; /* procedure info */
31 u32 cl_prog, /* RPC program number */ 33 u32 cl_prog, /* RPC program number */
@@ -41,9 +43,7 @@ struct rpc_clnt {
41 unsigned int cl_softrtry : 1,/* soft timeouts */ 43 unsigned int cl_softrtry : 1,/* soft timeouts */
42 cl_intr : 1,/* interruptible */ 44 cl_intr : 1,/* interruptible */
43 cl_discrtry : 1,/* disconnect before retry */ 45 cl_discrtry : 1,/* disconnect before retry */
44 cl_autobind : 1,/* use getport() */ 46 cl_autobind : 1;/* use getport() */
45 cl_oneshot : 1,/* dispose after use */
46 cl_dead : 1;/* abandoned */
47 47
48 struct rpc_rtt * cl_rtt; /* RTO estimator data */ 48 struct rpc_rtt * cl_rtt; /* RTO estimator data */
49 49
@@ -98,6 +98,7 @@ struct rpc_create_args {
98 int protocol; 98 int protocol;
99 struct sockaddr *address; 99 struct sockaddr *address;
100 size_t addrsize; 100 size_t addrsize;
101 struct sockaddr *saddress;
101 struct rpc_timeout *timeout; 102 struct rpc_timeout *timeout;
102 char *servername; 103 char *servername;
103 struct rpc_program *program; 104 struct rpc_program *program;
@@ -110,20 +111,20 @@ struct rpc_create_args {
110#define RPC_CLNT_CREATE_HARDRTRY (1UL << 0) 111#define RPC_CLNT_CREATE_HARDRTRY (1UL << 0)
111#define RPC_CLNT_CREATE_INTR (1UL << 1) 112#define RPC_CLNT_CREATE_INTR (1UL << 1)
112#define RPC_CLNT_CREATE_AUTOBIND (1UL << 2) 113#define RPC_CLNT_CREATE_AUTOBIND (1UL << 2)
113#define RPC_CLNT_CREATE_ONESHOT (1UL << 3) 114#define RPC_CLNT_CREATE_NONPRIVPORT (1UL << 3)
114#define RPC_CLNT_CREATE_NONPRIVPORT (1UL << 4) 115#define RPC_CLNT_CREATE_NOPING (1UL << 4)
115#define RPC_CLNT_CREATE_NOPING (1UL << 5) 116#define RPC_CLNT_CREATE_DISCRTRY (1UL << 5)
116#define RPC_CLNT_CREATE_DISCRTRY (1UL << 6)
117 117
118struct rpc_clnt *rpc_create(struct rpc_create_args *args); 118struct rpc_clnt *rpc_create(struct rpc_create_args *args);
119struct rpc_clnt *rpc_bind_new_program(struct rpc_clnt *, 119struct rpc_clnt *rpc_bind_new_program(struct rpc_clnt *,
120 struct rpc_program *, int); 120 struct rpc_program *, int);
121struct rpc_clnt *rpc_clone_client(struct rpc_clnt *); 121struct rpc_clnt *rpc_clone_client(struct rpc_clnt *);
122int rpc_shutdown_client(struct rpc_clnt *); 122void rpc_shutdown_client(struct rpc_clnt *);
123int rpc_destroy_client(struct rpc_clnt *);
124void rpc_release_client(struct rpc_clnt *); 123void rpc_release_client(struct rpc_clnt *);
124
125int rpcb_register(u32, u32, int, unsigned short, int *); 125int rpcb_register(u32, u32, int, unsigned short, int *);
126void rpcb_getport(struct rpc_task *); 126int rpcb_getport_sync(struct sockaddr_in *, __u32, __u32, int);
127void rpcb_getport_async(struct rpc_task *);
127 128
128void rpc_call_setup(struct rpc_task *, struct rpc_message *, int); 129void rpc_call_setup(struct rpc_task *, struct rpc_message *, int);
129 130
@@ -132,20 +133,16 @@ int rpc_call_async(struct rpc_clnt *clnt, struct rpc_message *msg,
132 void *calldata); 133 void *calldata);
133int rpc_call_sync(struct rpc_clnt *clnt, struct rpc_message *msg, 134int rpc_call_sync(struct rpc_clnt *clnt, struct rpc_message *msg,
134 int flags); 135 int flags);
136struct rpc_task *rpc_call_null(struct rpc_clnt *clnt, struct rpc_cred *cred,
137 int flags);
135void rpc_restart_call(struct rpc_task *); 138void rpc_restart_call(struct rpc_task *);
136void rpc_clnt_sigmask(struct rpc_clnt *clnt, sigset_t *oldset); 139void rpc_clnt_sigmask(struct rpc_clnt *clnt, sigset_t *oldset);
137void rpc_clnt_sigunmask(struct rpc_clnt *clnt, sigset_t *oldset); 140void rpc_clnt_sigunmask(struct rpc_clnt *clnt, sigset_t *oldset);
138void rpc_setbufsize(struct rpc_clnt *, unsigned int, unsigned int); 141void rpc_setbufsize(struct rpc_clnt *, unsigned int, unsigned int);
139size_t rpc_max_payload(struct rpc_clnt *); 142size_t rpc_max_payload(struct rpc_clnt *);
140void rpc_force_rebind(struct rpc_clnt *); 143void rpc_force_rebind(struct rpc_clnt *);
141int rpc_ping(struct rpc_clnt *clnt, int flags);
142size_t rpc_peeraddr(struct rpc_clnt *, struct sockaddr *, size_t); 144size_t rpc_peeraddr(struct rpc_clnt *, struct sockaddr *, size_t);
143char * rpc_peeraddr2str(struct rpc_clnt *, enum rpc_display_format_t); 145char * rpc_peeraddr2str(struct rpc_clnt *, enum rpc_display_format_t);
144 146
145/*
146 * Helper function for NFSroot support
147 */
148int rpcb_getport_external(struct sockaddr_in *, __u32, __u32, int);
149
150#endif /* __KERNEL__ */ 147#endif /* __KERNEL__ */
151#endif /* _LINUX_SUNRPC_CLNT_H */ 148#endif /* _LINUX_SUNRPC_CLNT_H */
diff --git a/include/linux/sunrpc/gss_api.h b/include/linux/sunrpc/gss_api.h
index 5eca9e442051..459c5fc11d51 100644
--- a/include/linux/sunrpc/gss_api.h
+++ b/include/linux/sunrpc/gss_api.h
@@ -58,6 +58,7 @@ u32 gss_unwrap(
58u32 gss_delete_sec_context( 58u32 gss_delete_sec_context(
59 struct gss_ctx **ctx_id); 59 struct gss_ctx **ctx_id);
60 60
61u32 gss_svc_to_pseudoflavor(struct gss_api_mech *, u32 service);
61u32 gss_pseudoflavor_to_service(struct gss_api_mech *, u32 pseudoflavor); 62u32 gss_pseudoflavor_to_service(struct gss_api_mech *, u32 pseudoflavor);
62char *gss_service_to_auth_domain_name(struct gss_api_mech *, u32 service); 63char *gss_service_to_auth_domain_name(struct gss_api_mech *, u32 service);
63 64
@@ -77,7 +78,7 @@ struct gss_api_mech {
77 struct module *gm_owner; 78 struct module *gm_owner;
78 struct xdr_netobj gm_oid; 79 struct xdr_netobj gm_oid;
79 char *gm_name; 80 char *gm_name;
80 struct gss_api_ops *gm_ops; 81 const struct gss_api_ops *gm_ops;
81 /* pseudoflavors supported by this mechanism: */ 82 /* pseudoflavors supported by this mechanism: */
82 int gm_pf_num; 83 int gm_pf_num;
83 struct pf_desc * gm_pfs; 84 struct pf_desc * gm_pfs;
diff --git a/include/linux/sunrpc/rpc_pipe_fs.h b/include/linux/sunrpc/rpc_pipe_fs.h
index ad293760f6eb..51b977a4ca20 100644
--- a/include/linux/sunrpc/rpc_pipe_fs.h
+++ b/include/linux/sunrpc/rpc_pipe_fs.h
@@ -23,9 +23,11 @@ struct rpc_inode {
23 void *private; 23 void *private;
24 struct list_head pipe; 24 struct list_head pipe;
25 struct list_head in_upcall; 25 struct list_head in_upcall;
26 struct list_head in_downcall;
26 int pipelen; 27 int pipelen;
27 int nreaders; 28 int nreaders;
28 int nwriters; 29 int nwriters;
30 int nkern_readwriters;
29 wait_queue_head_t waitq; 31 wait_queue_head_t waitq;
30#define RPC_PIPE_WAIT_FOR_OPEN 1 32#define RPC_PIPE_WAIT_FOR_OPEN 1
31 int flags; 33 int flags;
diff --git a/include/linux/sunrpc/sched.h b/include/linux/sunrpc/sched.h
index 2047fb202a13..8ea077db0099 100644
--- a/include/linux/sunrpc/sched.h
+++ b/include/linux/sunrpc/sched.h
@@ -98,7 +98,6 @@ struct rpc_task {
98 unsigned short tk_pid; /* debugging aid */ 98 unsigned short tk_pid; /* debugging aid */
99#endif 99#endif
100}; 100};
101#define tk_auth tk_client->cl_auth
102#define tk_xprt tk_client->cl_xprt 101#define tk_xprt tk_client->cl_xprt
103 102
104/* support walking a list of tasks on a wait queue */ 103/* support walking a list of tasks on a wait queue */
@@ -110,11 +109,6 @@ struct rpc_task {
110 if (!list_empty(head) && \ 109 if (!list_empty(head) && \
111 ((task=list_entry((head)->next, struct rpc_task, u.tk_wait.list)),1)) 110 ((task=list_entry((head)->next, struct rpc_task, u.tk_wait.list)),1))
112 111
113/* .. and walking list of all tasks */
114#define alltask_for_each(task, pos, head) \
115 list_for_each(pos, head) \
116 if ((task=list_entry(pos, struct rpc_task, tk_task)),1)
117
118typedef void (*rpc_action)(struct rpc_task *); 112typedef void (*rpc_action)(struct rpc_task *);
119 113
120struct rpc_call_ops { 114struct rpc_call_ops {
diff --git a/include/linux/sunrpc/svc.h b/include/linux/sunrpc/svc.h
index 4a7ae8ab6eb8..8531a70da73d 100644
--- a/include/linux/sunrpc/svc.h
+++ b/include/linux/sunrpc/svc.h
@@ -212,6 +212,7 @@ struct svc_rqst {
212 struct svc_pool * rq_pool; /* thread pool */ 212 struct svc_pool * rq_pool; /* thread pool */
213 struct svc_procedure * rq_procinfo; /* procedure info */ 213 struct svc_procedure * rq_procinfo; /* procedure info */
214 struct auth_ops * rq_authop; /* authentication flavour */ 214 struct auth_ops * rq_authop; /* authentication flavour */
215 u32 rq_flavor; /* pseudoflavor */
215 struct svc_cred rq_cred; /* auth info */ 216 struct svc_cred rq_cred; /* auth info */
216 struct sk_buff * rq_skbuff; /* fast recv inet buffer */ 217 struct sk_buff * rq_skbuff; /* fast recv inet buffer */
217 struct svc_deferred_req*rq_deferred; /* deferred request we are replaying */ 218 struct svc_deferred_req*rq_deferred; /* deferred request we are replaying */
@@ -248,12 +249,13 @@ struct svc_rqst {
248 */ 249 */
249 /* Catering to nfsd */ 250 /* Catering to nfsd */
250 struct auth_domain * rq_client; /* RPC peer info */ 251 struct auth_domain * rq_client; /* RPC peer info */
252 struct auth_domain * rq_gssclient; /* "gss/"-style peer info */
251 struct svc_cacherep * rq_cacherep; /* cache info */ 253 struct svc_cacherep * rq_cacherep; /* cache info */
252 struct knfsd_fh * rq_reffh; /* Referrence filehandle, used to 254 struct knfsd_fh * rq_reffh; /* Referrence filehandle, used to
253 * determine what device number 255 * determine what device number
254 * to report (real or virtual) 256 * to report (real or virtual)
255 */ 257 */
256 int rq_sendfile_ok; /* turned off in gss privacy 258 int rq_splice_ok; /* turned off in gss privacy
257 * to prevent encrypting page 259 * to prevent encrypting page
258 * cache pages */ 260 * cache pages */
259 wait_queue_head_t rq_wait; /* synchronization */ 261 wait_queue_head_t rq_wait; /* synchronization */
diff --git a/include/linux/sunrpc/svcauth.h b/include/linux/sunrpc/svcauth.h
index de92619b0826..22e1ef8e200e 100644
--- a/include/linux/sunrpc/svcauth.h
+++ b/include/linux/sunrpc/svcauth.h
@@ -127,6 +127,7 @@ extern struct auth_domain *auth_unix_lookup(struct in_addr addr);
127extern int auth_unix_forget_old(struct auth_domain *dom); 127extern int auth_unix_forget_old(struct auth_domain *dom);
128extern void svcauth_unix_purge(void); 128extern void svcauth_unix_purge(void);
129extern void svcauth_unix_info_release(void *); 129extern void svcauth_unix_info_release(void *);
130extern int svcauth_unix_set_client(struct svc_rqst *rqstp);
130 131
131static inline unsigned long hash_str(char *name, int bits) 132static inline unsigned long hash_str(char *name, int bits)
132{ 133{
diff --git a/include/linux/sunrpc/svcauth_gss.h b/include/linux/sunrpc/svcauth_gss.h
index 5a5db16ab660..417a1def56db 100644
--- a/include/linux/sunrpc/svcauth_gss.h
+++ b/include/linux/sunrpc/svcauth_gss.h
@@ -22,6 +22,7 @@
22int gss_svc_init(void); 22int gss_svc_init(void);
23void gss_svc_shutdown(void); 23void gss_svc_shutdown(void);
24int svcauth_gss_register_pseudoflavor(u32 pseudoflavor, char * name); 24int svcauth_gss_register_pseudoflavor(u32 pseudoflavor, char * name);
25u32 svcauth_gss_flavor(struct auth_domain *dom);
25 26
26#endif /* __KERNEL__ */ 27#endif /* __KERNEL__ */
27#endif /* _LINUX_SUNRPC_SVCAUTH_GSS_H */ 28#endif /* _LINUX_SUNRPC_SVCAUTH_GSS_H */
diff --git a/include/linux/sunrpc/svcsock.h b/include/linux/sunrpc/svcsock.h
index e21dd93ac4b7..a53e0fa855d2 100644
--- a/include/linux/sunrpc/svcsock.h
+++ b/include/linux/sunrpc/svcsock.h
@@ -59,6 +59,7 @@ struct svc_sock {
59 /* cache of various info for TCP sockets */ 59 /* cache of various info for TCP sockets */
60 void *sk_info_authunix; 60 void *sk_info_authunix;
61 61
62 struct sockaddr_storage sk_local; /* local address */
62 struct sockaddr_storage sk_remote; /* remote peer's address */ 63 struct sockaddr_storage sk_remote; /* remote peer's address */
63 int sk_remotelen; /* length of address */ 64 int sk_remotelen; /* length of address */
64}; 65};
diff --git a/include/linux/sunrpc/xprt.h b/include/linux/sunrpc/xprt.h
index 34f7590506fa..d11cedd14f0f 100644
--- a/include/linux/sunrpc/xprt.h
+++ b/include/linux/sunrpc/xprt.h
@@ -17,6 +17,8 @@
17#include <linux/sunrpc/xdr.h> 17#include <linux/sunrpc/xdr.h>
18#include <linux/sunrpc/msg_prot.h> 18#include <linux/sunrpc/msg_prot.h>
19 19
20#ifdef __KERNEL__
21
20extern unsigned int xprt_udp_slot_table_entries; 22extern unsigned int xprt_udp_slot_table_entries;
21extern unsigned int xprt_tcp_slot_table_entries; 23extern unsigned int xprt_tcp_slot_table_entries;
22 24
@@ -194,7 +196,13 @@ struct rpc_xprt {
194 char * address_strings[RPC_DISPLAY_MAX]; 196 char * address_strings[RPC_DISPLAY_MAX];
195}; 197};
196 198
197#ifdef __KERNEL__ 199struct rpc_xprtsock_create {
200 int proto; /* IPPROTO_UDP or IPPROTO_TCP */
201 struct sockaddr * srcaddr; /* optional local address */
202 struct sockaddr * dstaddr; /* remote peer address */
203 size_t addrlen;
204 struct rpc_timeout * timeout; /* optional timeout parameters */
205};
198 206
199/* 207/*
200 * Transport operations used by ULPs 208 * Transport operations used by ULPs
@@ -204,7 +212,7 @@ void xprt_set_timeout(struct rpc_timeout *to, unsigned int retr, unsigned long
204/* 212/*
205 * Generic internal transport functions 213 * Generic internal transport functions
206 */ 214 */
207struct rpc_xprt * xprt_create_transport(int proto, struct sockaddr *addr, size_t size, struct rpc_timeout *toparms); 215struct rpc_xprt * xprt_create_transport(struct rpc_xprtsock_create *args);
208void xprt_connect(struct rpc_task *task); 216void xprt_connect(struct rpc_task *task);
209void xprt_reserve(struct rpc_task *task); 217void xprt_reserve(struct rpc_task *task);
210int xprt_reserve_xprt(struct rpc_task *task); 218int xprt_reserve_xprt(struct rpc_task *task);
@@ -242,8 +250,8 @@ void xprt_disconnect(struct rpc_xprt *xprt);
242/* 250/*
243 * Socket transport setup operations 251 * Socket transport setup operations
244 */ 252 */
245struct rpc_xprt * xs_setup_udp(struct sockaddr *addr, size_t addrlen, struct rpc_timeout *to); 253struct rpc_xprt * xs_setup_udp(struct rpc_xprtsock_create *args);
246struct rpc_xprt * xs_setup_tcp(struct sockaddr *addr, size_t addrlen, struct rpc_timeout *to); 254struct rpc_xprt * xs_setup_tcp(struct rpc_xprtsock_create *args);
247int init_socket_xprt(void); 255int init_socket_xprt(void);
248void cleanup_socket_xprt(void); 256void cleanup_socket_xprt(void);
249 257
diff --git a/include/linux/swap.h b/include/linux/swap.h
index 006868881346..665f85f2a3af 100644
--- a/include/linux/swap.h
+++ b/include/linux/swap.h
@@ -188,7 +188,8 @@ extern int rotate_reclaimable_page(struct page *page);
188extern void swap_setup(void); 188extern void swap_setup(void);
189 189
190/* linux/mm/vmscan.c */ 190/* linux/mm/vmscan.c */
191extern unsigned long try_to_free_pages(struct zone **, gfp_t); 191extern unsigned long try_to_free_pages(struct zone **zones, int order,
192 gfp_t gfp_mask);
192extern unsigned long shrink_all_memory(unsigned long nr_pages); 193extern unsigned long shrink_all_memory(unsigned long nr_pages);
193extern int vm_swappiness; 194extern int vm_swappiness;
194extern int remove_mapping(struct address_space *mapping, struct page *page); 195extern int remove_mapping(struct address_space *mapping, struct page *page);
diff --git a/include/linux/syscalls.h b/include/linux/syscalls.h
index b02070eac422..7a8b1e3322e0 100644
--- a/include/linux/syscalls.h
+++ b/include/linux/syscalls.h
@@ -598,6 +598,8 @@ asmlinkage long sys_tee(int fdin, int fdout, size_t len, unsigned int flags);
598 598
599asmlinkage long sys_sync_file_range(int fd, loff_t offset, loff_t nbytes, 599asmlinkage long sys_sync_file_range(int fd, loff_t offset, loff_t nbytes,
600 unsigned int flags); 600 unsigned int flags);
601asmlinkage long sys_sync_file_range2(int fd, unsigned int flags,
602 loff_t offset, loff_t nbytes);
601asmlinkage long sys_get_robust_list(int pid, 603asmlinkage long sys_get_robust_list(int pid,
602 struct robust_list_head __user * __user *head_ptr, 604 struct robust_list_head __user * __user *head_ptr,
603 size_t __user *len_ptr); 605 size_t __user *len_ptr);
@@ -608,6 +610,7 @@ asmlinkage long sys_signalfd(int ufd, sigset_t __user *user_mask, size_t sizemas
608asmlinkage long sys_timerfd(int ufd, int clockid, int flags, 610asmlinkage long sys_timerfd(int ufd, int clockid, int flags,
609 const struct itimerspec __user *utmr); 611 const struct itimerspec __user *utmr);
610asmlinkage long sys_eventfd(unsigned int count); 612asmlinkage long sys_eventfd(unsigned int count);
613asmlinkage long sys_fallocate(int fd, int mode, loff_t offset, loff_t len);
611 614
612int kernel_execve(const char *filename, char *const argv[], char *const envp[]); 615int kernel_execve(const char *filename, char *const argv[], char *const envp[]);
613 616
diff --git a/include/linux/sysdev.h b/include/linux/sysdev.h
index e699ab279c2c..e285746588d6 100644
--- a/include/linux/sysdev.h
+++ b/include/linux/sysdev.h
@@ -101,8 +101,7 @@ struct sysdev_attribute {
101 101
102#define _SYSDEV_ATTR(_name,_mode,_show,_store) \ 102#define _SYSDEV_ATTR(_name,_mode,_show,_store) \
103{ \ 103{ \
104 .attr = { .name = __stringify(_name), .mode = _mode, \ 104 .attr = { .name = __stringify(_name), .mode = _mode }, \
105 .owner = THIS_MODULE }, \
106 .show = _show, \ 105 .show = _show, \
107 .store = _store, \ 106 .store = _store, \
108} 107}
diff --git a/include/linux/sysfs.h b/include/linux/sysfs.h
index 7d5d1ec95c2e..be8228e50a27 100644
--- a/include/linux/sysfs.h
+++ b/include/linux/sysfs.h
@@ -19,10 +19,15 @@ struct kobject;
19struct module; 19struct module;
20struct nameidata; 20struct nameidata;
21struct dentry; 21struct dentry;
22struct sysfs_dirent;
22 23
24/* FIXME
25 * The *owner field is no longer used, but leave around
26 * until the tree gets cleaned up fully.
27 */
23struct attribute { 28struct attribute {
24 const char * name; 29 const char * name;
25 struct module * owner; 30 struct module * owner;
26 mode_t mode; 31 mode_t mode;
27}; 32};
28 33
@@ -39,14 +44,14 @@ struct attribute_group {
39 */ 44 */
40 45
41#define __ATTR(_name,_mode,_show,_store) { \ 46#define __ATTR(_name,_mode,_show,_store) { \
42 .attr = {.name = __stringify(_name), .mode = _mode, .owner = THIS_MODULE }, \ 47 .attr = {.name = __stringify(_name), .mode = _mode }, \
43 .show = _show, \ 48 .show = _show, \
44 .store = _store, \ 49 .store = _store, \
45} 50}
46 51
47#define __ATTR_RO(_name) { \ 52#define __ATTR_RO(_name) { \
48 .attr = { .name = __stringify(_name), .mode = 0444, .owner = THIS_MODULE }, \ 53 .attr = { .name = __stringify(_name), .mode = 0444 }, \
49 .show = _name##_show, \ 54 .show = _name##_show, \
50} 55}
51 56
52#define __ATTR_NULL { .attr = { .name = NULL } } 57#define __ATTR_NULL { .attr = { .name = NULL } }
@@ -59,8 +64,10 @@ struct bin_attribute {
59 struct attribute attr; 64 struct attribute attr;
60 size_t size; 65 size_t size;
61 void *private; 66 void *private;
62 ssize_t (*read)(struct kobject *, char *, loff_t, size_t); 67 ssize_t (*read)(struct kobject *, struct bin_attribute *,
63 ssize_t (*write)(struct kobject *, char *, loff_t, size_t); 68 char *, loff_t, size_t);
69 ssize_t (*write)(struct kobject *, struct bin_attribute *,
70 char *, loff_t, size_t);
64 int (*mmap)(struct kobject *, struct bin_attribute *attr, 71 int (*mmap)(struct kobject *, struct bin_attribute *attr,
65 struct vm_area_struct *vma); 72 struct vm_area_struct *vma);
66}; 73};
@@ -70,12 +77,16 @@ struct sysfs_ops {
70 ssize_t (*store)(struct kobject *,struct attribute *,const char *, size_t); 77 ssize_t (*store)(struct kobject *,struct attribute *,const char *, size_t);
71}; 78};
72 79
80#define SYSFS_TYPE_MASK 0x00ff
73#define SYSFS_ROOT 0x0001 81#define SYSFS_ROOT 0x0001
74#define SYSFS_DIR 0x0002 82#define SYSFS_DIR 0x0002
75#define SYSFS_KOBJ_ATTR 0x0004 83#define SYSFS_KOBJ_ATTR 0x0004
76#define SYSFS_KOBJ_BIN_ATTR 0x0008 84#define SYSFS_KOBJ_BIN_ATTR 0x0008
77#define SYSFS_KOBJ_LINK 0x0020 85#define SYSFS_KOBJ_LINK 0x0020
78#define SYSFS_NOT_PINNED (SYSFS_KOBJ_ATTR | SYSFS_KOBJ_BIN_ATTR | SYSFS_KOBJ_LINK) 86#define SYSFS_COPY_NAME (SYSFS_DIR | SYSFS_KOBJ_LINK)
87
88#define SYSFS_FLAG_MASK ~SYSFS_TYPE_MASK
89#define SYSFS_FLAG_REMOVED 0x0100
79 90
80#ifdef CONFIG_SYSFS 91#ifdef CONFIG_SYSFS
81 92
@@ -83,13 +94,14 @@ extern int sysfs_schedule_callback(struct kobject *kobj,
83 void (*func)(void *), void *data, struct module *owner); 94 void (*func)(void *), void *data, struct module *owner);
84 95
85extern int __must_check 96extern int __must_check
86sysfs_create_dir(struct kobject *, struct dentry *); 97sysfs_create_dir(struct kobject *kobj, struct sysfs_dirent *shadow_parent_sd);
87 98
88extern void 99extern void
89sysfs_remove_dir(struct kobject *); 100sysfs_remove_dir(struct kobject *);
90 101
91extern int __must_check 102extern int __must_check
92sysfs_rename_dir(struct kobject *, struct dentry *, const char *new_name); 103sysfs_rename_dir(struct kobject *kobj, struct sysfs_dirent *new_parent_sd,
104 const char *new_name);
93 105
94extern int __must_check 106extern int __must_check
95sysfs_move_dir(struct kobject *, struct kobject *); 107sysfs_move_dir(struct kobject *, struct kobject *);
@@ -129,8 +141,8 @@ void sysfs_notify(struct kobject * k, char *dir, char *attr);
129 141
130extern int sysfs_make_shadowed_dir(struct kobject *kobj, 142extern int sysfs_make_shadowed_dir(struct kobject *kobj,
131 void * (*follow_link)(struct dentry *, struct nameidata *)); 143 void * (*follow_link)(struct dentry *, struct nameidata *));
132extern struct dentry *sysfs_create_shadow_dir(struct kobject *kobj); 144extern struct sysfs_dirent *sysfs_create_shadow_dir(struct kobject *kobj);
133extern void sysfs_remove_shadow_dir(struct dentry *dir); 145extern void sysfs_remove_shadow_dir(struct sysfs_dirent *shadow_sd);
134 146
135extern int __must_check sysfs_init(void); 147extern int __must_check sysfs_init(void);
136 148
@@ -142,7 +154,8 @@ static inline int sysfs_schedule_callback(struct kobject *kobj,
142 return -ENOSYS; 154 return -ENOSYS;
143} 155}
144 156
145static inline int sysfs_create_dir(struct kobject * k, struct dentry *shadow) 157static inline int sysfs_create_dir(struct kobject *kobj,
158 struct sysfs_dirent *shadow_parent_sd)
146{ 159{
147 return 0; 160 return 0;
148} 161}
@@ -152,9 +165,9 @@ static inline void sysfs_remove_dir(struct kobject * k)
152 ; 165 ;
153} 166}
154 167
155static inline int sysfs_rename_dir(struct kobject * k, 168static inline int sysfs_rename_dir(struct kobject *kobj,
156 struct dentry *new_parent, 169 struct sysfs_dirent *new_parent_sd,
157 const char *new_name) 170 const char *new_name)
158{ 171{
159 return 0; 172 return 0;
160} 173}
diff --git a/include/linux/taskstats.h b/include/linux/taskstats.h
index a46104a28f66..dce1ed204972 100644
--- a/include/linux/taskstats.h
+++ b/include/linux/taskstats.h
@@ -31,7 +31,7 @@
31 */ 31 */
32 32
33 33
34#define TASKSTATS_VERSION 4 34#define TASKSTATS_VERSION 5
35#define TS_COMM_LEN 32 /* should be >= TASK_COMM_LEN 35#define TS_COMM_LEN 32 /* should be >= TASK_COMM_LEN
36 * in linux/sched.h */ 36 * in linux/sched.h */
37 37
@@ -149,6 +149,9 @@ struct taskstats {
149 __u64 read_bytes; /* bytes of read I/O */ 149 __u64 read_bytes; /* bytes of read I/O */
150 __u64 write_bytes; /* bytes of write I/O */ 150 __u64 write_bytes; /* bytes of write I/O */
151 __u64 cancelled_write_bytes; /* bytes of cancelled write I/O */ 151 __u64 cancelled_write_bytes; /* bytes of cancelled write I/O */
152
153 __u64 nvcsw; /* voluntary_ctxt_switches */
154 __u64 nivcsw; /* nonvoluntary_ctxt_switches */
152}; 155};
153 156
154 157
diff --git a/include/linux/time.h b/include/linux/time.h
index dda9be685ab6..ec3b0ced0afe 100644
--- a/include/linux/time.h
+++ b/include/linux/time.h
@@ -36,7 +36,8 @@ struct timezone {
36#define NSEC_PER_SEC 1000000000L 36#define NSEC_PER_SEC 1000000000L
37#define FSEC_PER_SEC 1000000000000000L 37#define FSEC_PER_SEC 1000000000000000L
38 38
39static inline int timespec_equal(struct timespec *a, struct timespec *b) 39static inline int timespec_equal(const struct timespec *a,
40 const struct timespec *b)
40{ 41{
41 return (a->tv_sec == b->tv_sec) && (a->tv_nsec == b->tv_nsec); 42 return (a->tv_sec == b->tv_sec) && (a->tv_nsec == b->tv_nsec);
42} 43}
@@ -116,6 +117,8 @@ extern int do_setitimer(int which, struct itimerval *value,
116extern unsigned int alarm_setitimer(unsigned int seconds); 117extern unsigned int alarm_setitimer(unsigned int seconds);
117extern int do_getitimer(int which, struct itimerval *value); 118extern int do_getitimer(int which, struct itimerval *value);
118extern void getnstimeofday(struct timespec *tv); 119extern void getnstimeofday(struct timespec *tv);
120extern void getboottime(struct timespec *ts);
121extern void monotonic_to_bootbased(struct timespec *ts);
119 122
120extern struct timespec timespec_trunc(struct timespec t, unsigned gran); 123extern struct timespec timespec_trunc(struct timespec t, unsigned gran);
121extern int timekeeping_is_continuous(void); 124extern int timekeeping_is_continuous(void);
diff --git a/include/linux/timer.h b/include/linux/timer.h
index c661710d3627..78cf899b4409 100644
--- a/include/linux/timer.h
+++ b/include/linux/timer.h
@@ -3,7 +3,6 @@
3 3
4#include <linux/list.h> 4#include <linux/list.h>
5#include <linux/ktime.h> 5#include <linux/ktime.h>
6#include <linux/spinlock.h>
7#include <linux/stddef.h> 6#include <linux/stddef.h>
8 7
9struct tvec_t_base_s; 8struct tvec_t_base_s;
@@ -91,16 +90,13 @@ extern unsigned long get_next_timer_interrupt(unsigned long now);
91 */ 90 */
92#ifdef CONFIG_TIMER_STATS 91#ifdef CONFIG_TIMER_STATS
93 92
93#define TIMER_STATS_FLAG_DEFERRABLE 0x1
94
94extern void init_timer_stats(void); 95extern void init_timer_stats(void);
95 96
96extern void timer_stats_update_stats(void *timer, pid_t pid, void *startf, 97extern void timer_stats_update_stats(void *timer, pid_t pid, void *startf,
97 void *timerf, char * comm); 98 void *timerf, char *comm,
98 99 unsigned int timer_flag);
99static inline void timer_stats_account_timer(struct timer_list *timer)
100{
101 timer_stats_update_stats(timer, timer->start_pid, timer->start_site,
102 timer->function, timer->start_comm);
103}
104 100
105extern void __timer_stats_timer_set_start_info(struct timer_list *timer, 101extern void __timer_stats_timer_set_start_info(struct timer_list *timer,
106 void *addr); 102 void *addr);
@@ -119,10 +115,6 @@ static inline void init_timer_stats(void)
119{ 115{
120} 116}
121 117
122static inline void timer_stats_account_timer(struct timer_list *timer)
123{
124}
125
126static inline void timer_stats_timer_set_start_info(struct timer_list *timer) 118static inline void timer_stats_timer_set_start_info(struct timer_list *timer)
127{ 119{
128} 120}
diff --git a/include/linux/topology.h b/include/linux/topology.h
index a9d1f049cc15..d0890a7e5bab 100644
--- a/include/linux/topology.h
+++ b/include/linux/topology.h
@@ -50,10 +50,10 @@
50 for_each_online_node(node) \ 50 for_each_online_node(node) \
51 if (nr_cpus_node(node)) 51 if (nr_cpus_node(node))
52 52
53#ifndef node_distance
54/* Conform to ACPI 2.0 SLIT distance definitions */ 53/* Conform to ACPI 2.0 SLIT distance definitions */
55#define LOCAL_DISTANCE 10 54#define LOCAL_DISTANCE 10
56#define REMOTE_DISTANCE 20 55#define REMOTE_DISTANCE 20
56#ifndef node_distance
57#define node_distance(from,to) ((from) == (to) ? LOCAL_DISTANCE : REMOTE_DISTANCE) 57#define node_distance(from,to) ((from) == (to) ? LOCAL_DISTANCE : REMOTE_DISTANCE)
58#endif 58#endif
59#ifndef RECLAIM_DISTANCE 59#ifndef RECLAIM_DISTANCE
@@ -98,7 +98,7 @@
98 .cache_nice_tries = 0, \ 98 .cache_nice_tries = 0, \
99 .busy_idx = 0, \ 99 .busy_idx = 0, \
100 .idle_idx = 0, \ 100 .idle_idx = 0, \
101 .newidle_idx = 1, \ 101 .newidle_idx = 0, \
102 .wake_idx = 0, \ 102 .wake_idx = 0, \
103 .forkexec_idx = 0, \ 103 .forkexec_idx = 0, \
104 .flags = SD_LOAD_BALANCE \ 104 .flags = SD_LOAD_BALANCE \
@@ -128,14 +128,15 @@
128 .imbalance_pct = 125, \ 128 .imbalance_pct = 125, \
129 .cache_nice_tries = 1, \ 129 .cache_nice_tries = 1, \
130 .busy_idx = 2, \ 130 .busy_idx = 2, \
131 .idle_idx = 1, \ 131 .idle_idx = 0, \
132 .newidle_idx = 2, \ 132 .newidle_idx = 0, \
133 .wake_idx = 1, \ 133 .wake_idx = 1, \
134 .forkexec_idx = 1, \ 134 .forkexec_idx = 1, \
135 .flags = SD_LOAD_BALANCE \ 135 .flags = SD_LOAD_BALANCE \
136 | SD_BALANCE_NEWIDLE \ 136 | SD_BALANCE_NEWIDLE \
137 | SD_BALANCE_EXEC \ 137 | SD_BALANCE_EXEC \
138 | SD_WAKE_AFFINE \ 138 | SD_WAKE_AFFINE \
139 | SD_WAKE_IDLE \
139 | SD_SHARE_PKG_RESOURCES\ 140 | SD_SHARE_PKG_RESOURCES\
140 | BALANCE_FOR_MC_POWER, \ 141 | BALANCE_FOR_MC_POWER, \
141 .last_balance = jiffies, \ 142 .last_balance = jiffies, \
@@ -158,14 +159,15 @@
158 .imbalance_pct = 125, \ 159 .imbalance_pct = 125, \
159 .cache_nice_tries = 1, \ 160 .cache_nice_tries = 1, \
160 .busy_idx = 2, \ 161 .busy_idx = 2, \
161 .idle_idx = 1, \ 162 .idle_idx = 0, \
162 .newidle_idx = 2, \ 163 .newidle_idx = 0, \
163 .wake_idx = 1, \ 164 .wake_idx = 1, \
164 .forkexec_idx = 1, \ 165 .forkexec_idx = 1, \
165 .flags = SD_LOAD_BALANCE \ 166 .flags = SD_LOAD_BALANCE \
166 | SD_BALANCE_NEWIDLE \ 167 | SD_BALANCE_NEWIDLE \
167 | SD_BALANCE_EXEC \ 168 | SD_BALANCE_EXEC \
168 | SD_WAKE_AFFINE \ 169 | SD_WAKE_AFFINE \
170 | SD_WAKE_IDLE \
169 | BALANCE_FOR_PKG_POWER,\ 171 | BALANCE_FOR_PKG_POWER,\
170 .last_balance = jiffies, \ 172 .last_balance = jiffies, \
171 .balance_interval = 1, \ 173 .balance_interval = 1, \
diff --git a/include/linux/tty.h b/include/linux/tty.h
index bb4576085203..691a1748d9d2 100644
--- a/include/linux/tty.h
+++ b/include/linux/tty.h
@@ -178,6 +178,7 @@ struct tty_bufhead {
178#define L_IEXTEN(tty) _L_FLAG((tty),IEXTEN) 178#define L_IEXTEN(tty) _L_FLAG((tty),IEXTEN)
179 179
180struct device; 180struct device;
181struct signal_struct;
181/* 182/*
182 * Where all of the state associated with a tty is kept while the tty 183 * Where all of the state associated with a tty is kept while the tty
183 * is open. Since the termios state should be kept even if the tty 184 * is open. Since the termios state should be kept even if the tty
@@ -310,6 +311,7 @@ extern void tty_hangup(struct tty_struct * tty);
310extern void tty_vhangup(struct tty_struct * tty); 311extern void tty_vhangup(struct tty_struct * tty);
311extern void tty_unhangup(struct file *filp); 312extern void tty_unhangup(struct file *filp);
312extern int tty_hung_up_p(struct file * filp); 313extern int tty_hung_up_p(struct file * filp);
314extern int is_tty(struct file *filp);
313extern void do_SAK(struct tty_struct *tty); 315extern void do_SAK(struct tty_struct *tty);
314extern void __do_SAK(struct tty_struct *tty); 316extern void __do_SAK(struct tty_struct *tty);
315extern void disassociate_ctty(int priv); 317extern void disassociate_ctty(int priv);
@@ -338,9 +340,46 @@ extern struct tty_struct *get_current_tty(void);
338 340
339extern struct mutex tty_mutex; 341extern struct mutex tty_mutex;
340 342
343extern void tty_write_unlock(struct tty_struct *tty);
344extern int tty_write_lock(struct tty_struct *tty, int ndelay);
345#define tty_is_writelocked(tty) (mutex_is_locked(&tty->atomic_write_lock))
346
347
348
341/* n_tty.c */ 349/* n_tty.c */
342extern struct tty_ldisc tty_ldisc_N_TTY; 350extern struct tty_ldisc tty_ldisc_N_TTY;
343 351
352/* tty_audit.c */
353#ifdef CONFIG_AUDIT
354extern void tty_audit_add_data(struct tty_struct *tty, unsigned char *data,
355 size_t size);
356extern void tty_audit_exit(void);
357extern void tty_audit_fork(struct signal_struct *sig);
358extern void tty_audit_push(struct tty_struct *tty);
359extern void tty_audit_push_task(struct task_struct *tsk, uid_t loginuid);
360extern void tty_audit_opening(void);
361#else
362static inline void tty_audit_add_data(struct tty_struct *tty,
363 unsigned char *data, size_t size)
364{
365}
366static inline void tty_audit_exit(void)
367{
368}
369static inline void tty_audit_fork(struct signal_struct *sig)
370{
371}
372static inline void tty_audit_push(struct tty_struct *tty)
373{
374}
375static inline void tty_audit_push_task(struct task_struct *tsk, uid_t loginuid)
376{
377}
378static inline void tty_audit_opening(void)
379{
380}
381#endif
382
344/* tty_ioctl.c */ 383/* tty_ioctl.c */
345extern int n_tty_ioctl(struct tty_struct * tty, struct file * file, 384extern int n_tty_ioctl(struct tty_struct * tty, struct file * file,
346 unsigned int cmd, unsigned long arg); 385 unsigned int cmd, unsigned long arg);
diff --git a/include/linux/udp.h b/include/linux/udp.h
index 6de445c31a64..8ec703f462da 100644
--- a/include/linux/udp.h
+++ b/include/linux/udp.h
@@ -42,6 +42,7 @@ static inline struct udphdr *udp_hdr(const struct sk_buff *skb)
42/* UDP encapsulation types */ 42/* UDP encapsulation types */
43#define UDP_ENCAP_ESPINUDP_NON_IKE 1 /* draft-ietf-ipsec-nat-t-ike-00/01 */ 43#define UDP_ENCAP_ESPINUDP_NON_IKE 1 /* draft-ietf-ipsec-nat-t-ike-00/01 */
44#define UDP_ENCAP_ESPINUDP 2 /* draft-ietf-ipsec-udp-encaps-06 */ 44#define UDP_ENCAP_ESPINUDP 2 /* draft-ietf-ipsec-udp-encaps-06 */
45#define UDP_ENCAP_L2TPINUDP 3 /* rfc2661 */
45 46
46#ifdef __KERNEL__ 47#ifdef __KERNEL__
47#include <linux/types.h> 48#include <linux/types.h>
@@ -70,6 +71,11 @@ struct udp_sock {
70#define UDPLITE_SEND_CC 0x2 /* set via udplite setsockopt */ 71#define UDPLITE_SEND_CC 0x2 /* set via udplite setsockopt */
71#define UDPLITE_RECV_CC 0x4 /* set via udplite setsocktopt */ 72#define UDPLITE_RECV_CC 0x4 /* set via udplite setsocktopt */
72 __u8 pcflag; /* marks socket as UDP-Lite if > 0 */ 73 __u8 pcflag; /* marks socket as UDP-Lite if > 0 */
74 __u8 unused[3];
75 /*
76 * For encapsulation sockets.
77 */
78 int (*encap_rcv)(struct sock *sk, struct sk_buff *skb);
73}; 79};
74 80
75static inline struct udp_sock *udp_sk(const struct sock *sk) 81static inline struct udp_sock *udp_sk(const struct sock *sk)
diff --git a/include/linux/uio.h b/include/linux/uio.h
index 9af8bbcd8963..b7fe13883bdb 100644
--- a/include/linux/uio.h
+++ b/include/linux/uio.h
@@ -13,10 +13,6 @@
13 * 2 of the License, or (at your option) any later version. 13 * 2 of the License, or (at your option) any later version.
14 */ 14 */
15 15
16
17/* A word of warning: Our uio structure will clash with the C library one (which is now obsolete). Remove the C
18 library one from sys/uio.h if you have a very old library set */
19
20struct iovec 16struct iovec
21{ 17{
22 void __user *iov_base; /* BSD uses caddr_t (1003.1g requires void *) */ 18 void __user *iov_base; /* BSD uses caddr_t (1003.1g requires void *) */
@@ -38,11 +34,6 @@ struct kvec {
38 34
39#define UIO_FASTIOV 8 35#define UIO_FASTIOV 8
40#define UIO_MAXIOV 1024 36#define UIO_MAXIOV 1024
41#if 0
42#define UIO_MAXIOV 16 /* Maximum iovec's in one operation
43 16 matches BSD */
44 /* Beg pardon: BSD has 1024 --ANK */
45#endif
46 37
47/* 38/*
48 * Total number of bytes covered by an iovec. 39 * Total number of bytes covered by an iovec.
diff --git a/include/linux/usb.h b/include/linux/usb.h
index 94bd38a6d947..7a60946df3b6 100644
--- a/include/linux/usb.h
+++ b/include/linux/usb.h
@@ -146,6 +146,10 @@ struct usb_interface {
146 * active alternate setting */ 146 * active alternate setting */
147 unsigned num_altsetting; /* number of alternate settings */ 147 unsigned num_altsetting; /* number of alternate settings */
148 148
149 /* If there is an interface association descriptor then it will list
150 * the associated interfaces */
151 struct usb_interface_assoc_descriptor *intf_assoc;
152
149 int minor; /* minor number this interface is 153 int minor; /* minor number this interface is
150 * bound to */ 154 * bound to */
151 enum usb_interface_condition condition; /* state of binding */ 155 enum usb_interface_condition condition; /* state of binding */
@@ -175,6 +179,7 @@ void usb_put_intf(struct usb_interface *intf);
175 179
176/* this maximum is arbitrary */ 180/* this maximum is arbitrary */
177#define USB_MAXINTERFACES 32 181#define USB_MAXINTERFACES 32
182#define USB_MAXIADS USB_MAXINTERFACES/2
178 183
179/** 184/**
180 * struct usb_interface_cache - long-term representation of a device interface 185 * struct usb_interface_cache - long-term representation of a device interface
@@ -245,6 +250,11 @@ struct usb_host_config {
245 struct usb_config_descriptor desc; 250 struct usb_config_descriptor desc;
246 251
247 char *string; /* iConfiguration string, if present */ 252 char *string; /* iConfiguration string, if present */
253
254 /* List of any Interface Association Descriptors in this
255 * configuration. */
256 struct usb_interface_assoc_descriptor *intf_assoc[USB_MAXIADS];
257
248 /* the interfaces associated with this configuration, 258 /* the interfaces associated with this configuration,
249 * stored in no particular order */ 259 * stored in no particular order */
250 struct usb_interface *interface[USB_MAXINTERFACES]; 260 struct usb_interface *interface[USB_MAXINTERFACES];
@@ -403,6 +413,8 @@ struct usb_device {
403 413
404 unsigned auto_pm:1; /* autosuspend/resume in progress */ 414 unsigned auto_pm:1; /* autosuspend/resume in progress */
405 unsigned do_remote_wakeup:1; /* remote wakeup should be enabled */ 415 unsigned do_remote_wakeup:1; /* remote wakeup should be enabled */
416 unsigned reset_resume:1; /* needs reset instead of resume */
417 unsigned persist_enabled:1; /* USB_PERSIST enabled for this dev */
406 unsigned autosuspend_disabled:1; /* autosuspend and autoresume */ 418 unsigned autosuspend_disabled:1; /* autosuspend and autoresume */
407 unsigned autoresume_disabled:1; /* disabled by the user */ 419 unsigned autoresume_disabled:1; /* disabled by the user */
408#endif 420#endif
@@ -729,6 +741,22 @@ static inline int usb_endpoint_is_isoc_out(const struct usb_endpoint_descriptor
729 .bcdDevice_lo = (lo), .bcdDevice_hi = (hi) 741 .bcdDevice_lo = (lo), .bcdDevice_hi = (hi)
730 742
731/** 743/**
744 * USB_DEVICE_INTERFACE_PROTOCOL - macro used to describe a usb
745 * device with a specific interface protocol
746 * @vend: the 16 bit USB Vendor ID
747 * @prod: the 16 bit USB Product ID
748 * @pr: bInterfaceProtocol value
749 *
750 * This macro is used to create a struct usb_device_id that matches a
751 * specific interface protocol of devices.
752 */
753#define USB_DEVICE_INTERFACE_PROTOCOL(vend,prod,pr) \
754 .match_flags = USB_DEVICE_ID_MATCH_DEVICE | USB_DEVICE_ID_MATCH_INT_PROTOCOL, \
755 .idVendor = (vend), \
756 .idProduct = (prod), \
757 .bInterfaceProtocol = (pr)
758
759/**
732 * USB_DEVICE_INFO - macro used to describe a class of usb devices 760 * USB_DEVICE_INFO - macro used to describe a class of usb devices
733 * @cl: bDeviceClass value 761 * @cl: bDeviceClass value
734 * @sc: bDeviceSubClass value 762 * @sc: bDeviceSubClass value
@@ -754,6 +782,28 @@ static inline int usb_endpoint_is_isoc_out(const struct usb_endpoint_descriptor
754 .match_flags = USB_DEVICE_ID_MATCH_INT_INFO, .bInterfaceClass = (cl), \ 782 .match_flags = USB_DEVICE_ID_MATCH_INT_INFO, .bInterfaceClass = (cl), \
755 .bInterfaceSubClass = (sc), .bInterfaceProtocol = (pr) 783 .bInterfaceSubClass = (sc), .bInterfaceProtocol = (pr)
756 784
785/**
786 * USB_DEVICE_AND_INTERFACE_INFO - macro used to describe a specific usb device
787 * with a class of usb interfaces
788 * @vend: the 16 bit USB Vendor ID
789 * @prod: the 16 bit USB Product ID
790 * @cl: bInterfaceClass value
791 * @sc: bInterfaceSubClass value
792 * @pr: bInterfaceProtocol value
793 *
794 * This macro is used to create a struct usb_device_id that matches a
795 * specific device with a specific class of interfaces.
796 *
797 * This is especially useful when explicitly matching devices that have
798 * vendor specific bDeviceClass values, but standards-compliant interfaces.
799 */
800#define USB_DEVICE_AND_INTERFACE_INFO(vend,prod,cl,sc,pr) \
801 .match_flags = USB_DEVICE_ID_MATCH_INT_INFO \
802 | USB_DEVICE_ID_MATCH_DEVICE, \
803 .idVendor = (vend), .idProduct = (prod), \
804 .bInterfaceClass = (cl), \
805 .bInterfaceSubClass = (sc), .bInterfaceProtocol = (pr)
806
757/* ----------------------------------------------------------------------- */ 807/* ----------------------------------------------------------------------- */
758 808
759/* Stuff for dynamic usb ids */ 809/* Stuff for dynamic usb ids */
@@ -800,10 +850,15 @@ struct usbdrv_wrap {
800 * do (or don't) show up otherwise in the filesystem. 850 * do (or don't) show up otherwise in the filesystem.
801 * @suspend: Called when the device is going to be suspended by the system. 851 * @suspend: Called when the device is going to be suspended by the system.
802 * @resume: Called when the device is being resumed by the system. 852 * @resume: Called when the device is being resumed by the system.
853 * @reset_resume: Called when the suspended device has been reset instead
854 * of being resumed.
803 * @pre_reset: Called by usb_reset_composite_device() when the device 855 * @pre_reset: Called by usb_reset_composite_device() when the device
804 * is about to be reset. 856 * is about to be reset.
805 * @post_reset: Called by usb_reset_composite_device() after the device 857 * @post_reset: Called by usb_reset_composite_device() after the device
806 * has been reset. 858 * has been reset, or in lieu of @resume following a reset-resume
859 * (i.e., the device is reset instead of being resumed, as might
860 * happen if power was lost). The second argument tells which is
861 * the reason.
807 * @id_table: USB drivers use ID table to support hotplugging. 862 * @id_table: USB drivers use ID table to support hotplugging.
808 * Export this with MODULE_DEVICE_TABLE(usb,...). This must be set 863 * Export this with MODULE_DEVICE_TABLE(usb,...). This must be set
809 * or your driver's probe function will never get called. 864 * or your driver's probe function will never get called.
@@ -843,9 +898,10 @@ struct usb_driver {
843 898
844 int (*suspend) (struct usb_interface *intf, pm_message_t message); 899 int (*suspend) (struct usb_interface *intf, pm_message_t message);
845 int (*resume) (struct usb_interface *intf); 900 int (*resume) (struct usb_interface *intf);
901 int (*reset_resume)(struct usb_interface *intf);
846 902
847 void (*pre_reset) (struct usb_interface *intf); 903 int (*pre_reset)(struct usb_interface *intf);
848 void (*post_reset) (struct usb_interface *intf); 904 int (*post_reset)(struct usb_interface *intf);
849 905
850 const struct usb_device_id *id_table; 906 const struct usb_device_id *id_table;
851 907
@@ -948,6 +1004,7 @@ extern int usb_disabled(void);
948#define URB_ZERO_PACKET 0x0040 /* Finish bulk OUT with short packet */ 1004#define URB_ZERO_PACKET 0x0040 /* Finish bulk OUT with short packet */
949#define URB_NO_INTERRUPT 0x0080 /* HINT: no non-error interrupt 1005#define URB_NO_INTERRUPT 0x0080 /* HINT: no non-error interrupt
950 * needed */ 1006 * needed */
1007#define URB_FREE_BUFFER 0x0100 /* Free transfer buffer with the URB */
951 1008
952struct usb_iso_packet_descriptor { 1009struct usb_iso_packet_descriptor {
953 unsigned int offset; 1010 unsigned int offset;
@@ -958,11 +1015,26 @@ struct usb_iso_packet_descriptor {
958 1015
959struct urb; 1016struct urb;
960 1017
1018struct usb_anchor {
1019 struct list_head urb_list;
1020 wait_queue_head_t wait;
1021 spinlock_t lock;
1022};
1023
1024static inline void init_usb_anchor(struct usb_anchor *anchor)
1025{
1026 INIT_LIST_HEAD(&anchor->urb_list);
1027 init_waitqueue_head(&anchor->wait);
1028 spin_lock_init(&anchor->lock);
1029}
1030
961typedef void (*usb_complete_t)(struct urb *); 1031typedef void (*usb_complete_t)(struct urb *);
962 1032
963/** 1033/**
964 * struct urb - USB Request Block 1034 * struct urb - USB Request Block
965 * @urb_list: For use by current owner of the URB. 1035 * @urb_list: For use by current owner of the URB.
1036 * @anchor_list: membership in the list of an anchor
1037 * @anchor: to anchor URBs to a common mooring
966 * @pipe: Holds endpoint number, direction, type, and more. 1038 * @pipe: Holds endpoint number, direction, type, and more.
967 * Create these values with the eight macros available; 1039 * Create these values with the eight macros available;
968 * usb_{snd,rcv}TYPEpipe(dev,endpoint), where the TYPE is "ctrl" 1040 * usb_{snd,rcv}TYPEpipe(dev,endpoint), where the TYPE is "ctrl"
@@ -1135,6 +1207,8 @@ struct urb
1135 /* public: documented fields in the urb that can be used by drivers */ 1207 /* public: documented fields in the urb that can be used by drivers */
1136 struct list_head urb_list; /* list head for use by the urb's 1208 struct list_head urb_list; /* list head for use by the urb's
1137 * current owner */ 1209 * current owner */
1210 struct list_head anchor_list; /* the URB may be anchored by the driver */
1211 struct usb_anchor *anchor;
1138 struct usb_device *dev; /* (in) pointer to associated device */ 1212 struct usb_device *dev; /* (in) pointer to associated device */
1139 unsigned int pipe; /* (in) pipe information */ 1213 unsigned int pipe; /* (in) pipe information */
1140 int status; /* (return) non-ISO status */ 1214 int status; /* (return) non-ISO status */
@@ -1270,6 +1344,11 @@ extern struct urb *usb_get_urb(struct urb *urb);
1270extern int usb_submit_urb(struct urb *urb, gfp_t mem_flags); 1344extern int usb_submit_urb(struct urb *urb, gfp_t mem_flags);
1271extern int usb_unlink_urb(struct urb *urb); 1345extern int usb_unlink_urb(struct urb *urb);
1272extern void usb_kill_urb(struct urb *urb); 1346extern void usb_kill_urb(struct urb *urb);
1347extern void usb_kill_anchored_urbs(struct usb_anchor *anchor);
1348extern void usb_anchor_urb(struct urb *urb, struct usb_anchor *anchor);
1349extern void usb_unanchor_urb(struct urb *urb);
1350extern int usb_wait_anchor_empty_timeout(struct usb_anchor *anchor,
1351 unsigned int timeout);
1273 1352
1274void *usb_buffer_alloc (struct usb_device *dev, size_t size, 1353void *usb_buffer_alloc (struct usb_device *dev, size_t size,
1275 gfp_t mem_flags, dma_addr_t *dma); 1354 gfp_t mem_flags, dma_addr_t *dma);
diff --git a/include/linux/usb/Kbuild b/include/linux/usb/Kbuild
index 43f160cfe003..6ce42bf9f743 100644
--- a/include/linux/usb/Kbuild
+++ b/include/linux/usb/Kbuild
@@ -1,5 +1,6 @@
1unifdef-y += audio.h 1unifdef-y += audio.h
2unifdef-y += cdc.h 2unifdef-y += cdc.h
3unifdef-y += ch9.h 3unifdef-y += ch9.h
4unifdef-y += gadgetfs.h
4unifdef-y += midi.h 5unifdef-y += midi.h
5 6
diff --git a/include/linux/usb_gadgetfs.h b/include/linux/usb/gadgetfs.h
index 8086d5a9b94e..e8654c338729 100644
--- a/include/linux/usb_gadgetfs.h
+++ b/include/linux/usb/gadgetfs.h
@@ -1,3 +1,5 @@
1#ifndef __LINUX_USB_GADGETFS_H
2#define __LINUX_USB_GADGETFS_H
1 3
2#include <asm/types.h> 4#include <asm/types.h>
3#include <asm/ioctl.h> 5#include <asm/ioctl.h>
@@ -7,11 +9,12 @@
7/* 9/*
8 * Filesystem based user-mode API to USB Gadget controller hardware 10 * Filesystem based user-mode API to USB Gadget controller hardware
9 * 11 *
10 * Almost everything can be done with only read and write operations, 12 * Other than ep0 operations, most things are done by read() and write()
11 * on endpoint files found in one directory. They are configured by 13 * on endpoint files found in one directory. They are configured by
12 * writing descriptors, and then may be used for normal stream style 14 * writing descriptors, and then may be used for normal stream style
13 * i/o requests. When ep0 is configured, the device can enumerate; 15 * i/o requests. When ep0 is configured, the device can enumerate;
14 * when it's closed, the device disconnects from usb. 16 * when it's closed, the device disconnects from usb. Operations on
17 * ep0 require ioctl() operations.
15 * 18 *
16 * Configuration and device descriptors get written to /dev/gadget/$CHIP, 19 * Configuration and device descriptors get written to /dev/gadget/$CHIP,
17 * which may then be used to read usb_gadgetfs_event structs. The driver 20 * which may then be used to read usb_gadgetfs_event structs. The driver
@@ -21,9 +24,9 @@
21 */ 24 */
22 25
23/* 26/*
24 * Events are delivered on the ep0 file descriptor, if the user mode driver 27 * Events are delivered on the ep0 file descriptor, when the user mode driver
25 * reads from this file descriptor after writing the descriptors. Don't 28 * reads from this file descriptor after writing the descriptors. Don't
26 * stop polling this descriptor, if you write that kind of driver. 29 * stop polling this descriptor.
27 */ 30 */
28 31
29enum usb_gadgetfs_event_type { 32enum usb_gadgetfs_event_type {
@@ -36,8 +39,10 @@ enum usb_gadgetfs_event_type {
36 // and likely more ! 39 // and likely more !
37}; 40};
38 41
42/* NOTE: this structure must stay the same size and layout on
43 * both 32-bit and 64-bit kernels.
44 */
39struct usb_gadgetfs_event { 45struct usb_gadgetfs_event {
40 enum usb_gadgetfs_event_type type;
41 union { 46 union {
42 // NOP, DISCONNECT, SUSPEND: nothing 47 // NOP, DISCONNECT, SUSPEND: nothing
43 // ... some hardware can't report disconnection 48 // ... some hardware can't report disconnection
@@ -46,19 +51,20 @@ struct usb_gadgetfs_event {
46 enum usb_device_speed speed; 51 enum usb_device_speed speed;
47 52
48 // SETUP: packet; DATA phase i/o precedes next event 53 // SETUP: packet; DATA phase i/o precedes next event
49 // (setup.bmRequestType & USB_DIR_IN) flags direction 54 // (setup.bmRequestType & USB_DIR_IN) flags direction
50 // ... includes SET_CONFIGURATION, SET_INTERFACE 55 // ... includes SET_CONFIGURATION, SET_INTERFACE
51 struct usb_ctrlrequest setup; 56 struct usb_ctrlrequest setup;
52 } u; 57 } u;
58 enum usb_gadgetfs_event_type type;
53}; 59};
54 60
55 61
56/* endpoint ioctls */ 62/* endpoint ioctls */
57 63
58/* IN transfers may be reported to the gadget driver as complete 64/* IN transfers may be reported to the gadget driver as complete
59 * when the fifo is loaded, before the host reads the data; 65 * when the fifo is loaded, before the host reads the data;
60 * OUT transfers may be reported to the host's "client" driver as 66 * OUT transfers may be reported to the host's "client" driver as
61 * complete when they're sitting in the FIFO unread. 67 * complete when they're sitting in the FIFO unread.
62 * THIS returns how many bytes are "unclaimed" in the endpoint fifo 68 * THIS returns how many bytes are "unclaimed" in the endpoint fifo
63 * (needed for precise fault handling, when the hardware allows it) 69 * (needed for precise fault handling, when the hardware allows it)
64 */ 70 */
@@ -72,4 +78,4 @@ struct usb_gadgetfs_event {
72 */ 78 */
73#define GADGETFS_CLEAR_HALT _IO('g',3) 79#define GADGETFS_CLEAR_HALT _IO('g',3)
74 80
75 81#endif /* __LINUX_USB_GADGETFS_H */
diff --git a/include/linux/usb/quirks.h b/include/linux/usb/quirks.h
index 6bac8faacbc6..8da374caf582 100644
--- a/include/linux/usb/quirks.h
+++ b/include/linux/usb/quirks.h
@@ -9,3 +9,6 @@
9 9
10/* string descriptors must not be fetched using a 255-byte read */ 10/* string descriptors must not be fetched using a 255-byte read */
11#define USB_QUIRK_STRING_FETCH_255 0x00000002 11#define USB_QUIRK_STRING_FETCH_255 0x00000002
12
13/* device can't resume correctly so reset it instead */
14#define USB_QUIRK_RESET_RESUME 0x00000004
diff --git a/include/linux/usb/serial.h b/include/linux/usb/serial.h
index 32acbae28d24..e8b8928232c8 100644
--- a/include/linux/usb/serial.h
+++ b/include/linux/usb/serial.h
@@ -221,6 +221,9 @@ struct usb_serial_driver {
221 int (*port_probe) (struct usb_serial_port *port); 221 int (*port_probe) (struct usb_serial_port *port);
222 int (*port_remove) (struct usb_serial_port *port); 222 int (*port_remove) (struct usb_serial_port *port);
223 223
224 int (*suspend) (struct usb_serial *serial, pm_message_t message);
225 int (*resume) (struct usb_serial *serial);
226
224 /* serial function calls */ 227 /* serial function calls */
225 int (*open) (struct usb_serial_port *port, struct file * filp); 228 int (*open) (struct usb_serial_port *port, struct file * filp);
226 void (*close) (struct usb_serial_port *port, struct file * filp); 229 void (*close) (struct usb_serial_port *port, struct file * filp);
@@ -249,6 +252,9 @@ extern void usb_serial_port_softint(struct usb_serial_port *port);
249extern int usb_serial_probe(struct usb_interface *iface, const struct usb_device_id *id); 252extern int usb_serial_probe(struct usb_interface *iface, const struct usb_device_id *id);
250extern void usb_serial_disconnect(struct usb_interface *iface); 253extern void usb_serial_disconnect(struct usb_interface *iface);
251 254
255extern int usb_serial_suspend(struct usb_interface *intf, pm_message_t message);
256extern int usb_serial_resume(struct usb_interface *intf);
257
252extern int ezusb_writememory (struct usb_serial *serial, int address, unsigned char *data, int length, __u8 bRequest); 258extern int ezusb_writememory (struct usb_serial *serial, int address, unsigned char *data, int length, __u8 bRequest);
253extern int ezusb_set_reset (struct usb_serial *serial, unsigned char reset_bit); 259extern int ezusb_set_reset (struct usb_serial *serial, unsigned char reset_bit);
254 260
@@ -269,6 +275,7 @@ extern void usb_serial_put(struct usb_serial *serial);
269extern int usb_serial_generic_open (struct usb_serial_port *port, struct file *filp); 275extern int usb_serial_generic_open (struct usb_serial_port *port, struct file *filp);
270extern int usb_serial_generic_write (struct usb_serial_port *port, const unsigned char *buf, int count); 276extern int usb_serial_generic_write (struct usb_serial_port *port, const unsigned char *buf, int count);
271extern void usb_serial_generic_close (struct usb_serial_port *port, struct file *filp); 277extern void usb_serial_generic_close (struct usb_serial_port *port, struct file *filp);
278extern int usb_serial_generic_resume (struct usb_serial *serial);
272extern int usb_serial_generic_write_room (struct usb_serial_port *port); 279extern int usb_serial_generic_write_room (struct usb_serial_port *port);
273extern int usb_serial_generic_chars_in_buffer (struct usb_serial_port *port); 280extern int usb_serial_generic_chars_in_buffer (struct usb_serial_port *port);
274extern void usb_serial_generic_read_bulk_callback (struct urb *urb); 281extern void usb_serial_generic_read_bulk_callback (struct urb *urb);
diff --git a/include/linux/usb_gadget.h b/include/linux/usb_gadget.h
index e17186dbcdca..4f59b2aa8a9e 100644
--- a/include/linux/usb_gadget.h
+++ b/include/linux/usb_gadget.h
@@ -110,13 +110,6 @@ struct usb_ep_ops {
110 gfp_t gfp_flags); 110 gfp_t gfp_flags);
111 void (*free_request) (struct usb_ep *ep, struct usb_request *req); 111 void (*free_request) (struct usb_ep *ep, struct usb_request *req);
112 112
113 void *(*alloc_buffer) (struct usb_ep *ep, unsigned bytes,
114 dma_addr_t *dma, gfp_t gfp_flags);
115 void (*free_buffer) (struct usb_ep *ep, void *buf, dma_addr_t dma,
116 unsigned bytes);
117 // NOTE: on 2.6, drivers may also use dma_map() and
118 // dma_sync_single_*() to directly manage dma overhead.
119
120 int (*queue) (struct usb_ep *ep, struct usb_request *req, 113 int (*queue) (struct usb_ep *ep, struct usb_request *req,
121 gfp_t gfp_flags); 114 gfp_t gfp_flags);
122 int (*dequeue) (struct usb_ep *ep, struct usb_request *req); 115 int (*dequeue) (struct usb_ep *ep, struct usb_request *req);
@@ -235,47 +228,6 @@ usb_ep_free_request (struct usb_ep *ep, struct usb_request *req)
235} 228}
236 229
237/** 230/**
238 * usb_ep_alloc_buffer - allocate an I/O buffer
239 * @ep:the endpoint associated with the buffer
240 * @len:length of the desired buffer
241 * @dma:pointer to the buffer's DMA address; must be valid
242 * @gfp_flags:GFP_* flags to use
243 *
244 * Returns a new buffer, or null if one could not be allocated.
245 * The buffer is suitably aligned for dma, if that endpoint uses DMA,
246 * and the caller won't have to care about dma-inconsistency
247 * or any hidden "bounce buffer" mechanism. No additional per-request
248 * DMA mapping will be required for such buffers.
249 * Free it later with usb_ep_free_buffer().
250 *
251 * You don't need to use this call to allocate I/O buffers unless you
252 * want to make sure drivers don't incur costs for such "bounce buffer"
253 * copies or per-request DMA mappings.
254 */
255static inline void *
256usb_ep_alloc_buffer (struct usb_ep *ep, unsigned len, dma_addr_t *dma,
257 gfp_t gfp_flags)
258{
259 return ep->ops->alloc_buffer (ep, len, dma, gfp_flags);
260}
261
262/**
263 * usb_ep_free_buffer - frees an i/o buffer
264 * @ep:the endpoint associated with the buffer
265 * @buf:CPU view address of the buffer
266 * @dma:the buffer's DMA address
267 * @len:length of the buffer
268 *
269 * reverses the effect of usb_ep_alloc_buffer().
270 * caller guarantees the buffer will no longer be accessed
271 */
272static inline void
273usb_ep_free_buffer (struct usb_ep *ep, void *buf, dma_addr_t dma, unsigned len)
274{
275 ep->ops->free_buffer (ep, buf, dma, len);
276}
277
278/**
279 * usb_ep_queue - queues (submits) an I/O request to an endpoint. 231 * usb_ep_queue - queues (submits) an I/O request to an endpoint.
280 * @ep:the endpoint associated with the request 232 * @ep:the endpoint associated with the request
281 * @req:the request being submitted 233 * @req:the request being submitted
diff --git a/include/linux/user_namespace.h b/include/linux/user_namespace.h
new file mode 100644
index 000000000000..bb320573bb9e
--- /dev/null
+++ b/include/linux/user_namespace.h
@@ -0,0 +1,61 @@
1#ifndef _LINUX_USER_NAMESPACE_H
2#define _LINUX_USER_NAMESPACE_H
3
4#include <linux/kref.h>
5#include <linux/nsproxy.h>
6#include <linux/sched.h>
7#include <linux/err.h>
8
9#define UIDHASH_BITS (CONFIG_BASE_SMALL ? 3 : 8)
10#define UIDHASH_SZ (1 << UIDHASH_BITS)
11
12struct user_namespace {
13 struct kref kref;
14 struct list_head uidhash_table[UIDHASH_SZ];
15 struct user_struct *root_user;
16};
17
18extern struct user_namespace init_user_ns;
19
20#ifdef CONFIG_USER_NS
21
22static inline struct user_namespace *get_user_ns(struct user_namespace *ns)
23{
24 if (ns)
25 kref_get(&ns->kref);
26 return ns;
27}
28
29extern struct user_namespace *copy_user_ns(int flags,
30 struct user_namespace *old_ns);
31extern void free_user_ns(struct kref *kref);
32
33static inline void put_user_ns(struct user_namespace *ns)
34{
35 if (ns)
36 kref_put(&ns->kref, free_user_ns);
37}
38
39#else
40
41static inline struct user_namespace *get_user_ns(struct user_namespace *ns)
42{
43 return &init_user_ns;
44}
45
46static inline struct user_namespace *copy_user_ns(int flags,
47 struct user_namespace *old_ns)
48{
49 if (flags & CLONE_NEWUSER)
50 return ERR_PTR(-EINVAL);
51
52 return NULL;
53}
54
55static inline void put_user_ns(struct user_namespace *ns)
56{
57}
58
59#endif
60
61#endif /* _LINUX_USER_H */
diff --git a/include/linux/utsname.h b/include/linux/utsname.h
index f8d3b326e93a..923db99175f2 100644
--- a/include/linux/utsname.h
+++ b/include/linux/utsname.h
@@ -48,26 +48,14 @@ static inline void get_uts_ns(struct uts_namespace *ns)
48 kref_get(&ns->kref); 48 kref_get(&ns->kref);
49} 49}
50 50
51#ifdef CONFIG_UTS_NS 51extern struct uts_namespace *copy_utsname(unsigned long flags,
52extern struct uts_namespace *copy_utsname(int flags, struct uts_namespace *ns); 52 struct uts_namespace *ns);
53extern void free_uts_ns(struct kref *kref); 53extern void free_uts_ns(struct kref *kref);
54 54
55static inline void put_uts_ns(struct uts_namespace *ns) 55static inline void put_uts_ns(struct uts_namespace *ns)
56{ 56{
57 kref_put(&ns->kref, free_uts_ns); 57 kref_put(&ns->kref, free_uts_ns);
58} 58}
59#else
60static inline struct uts_namespace *copy_utsname(int flags,
61 struct uts_namespace *ns)
62{
63 return ns;
64}
65
66static inline void put_uts_ns(struct uts_namespace *ns)
67{
68}
69#endif
70
71static inline struct new_utsname *utsname(void) 59static inline struct new_utsname *utsname(void)
72{ 60{
73 return &current->nsproxy->uts_ns->name; 61 return &current->nsproxy->uts_ns->name;
diff --git a/include/linux/vmalloc.h b/include/linux/vmalloc.h
index 4b7ee83787c1..c2b10cae5da5 100644
--- a/include/linux/vmalloc.h
+++ b/include/linux/vmalloc.h
@@ -65,9 +65,14 @@ extern struct vm_struct *get_vm_area_node(unsigned long size,
65 unsigned long flags, int node, 65 unsigned long flags, int node,
66 gfp_t gfp_mask); 66 gfp_t gfp_mask);
67extern struct vm_struct *remove_vm_area(void *addr); 67extern struct vm_struct *remove_vm_area(void *addr);
68
68extern int map_vm_area(struct vm_struct *area, pgprot_t prot, 69extern int map_vm_area(struct vm_struct *area, pgprot_t prot,
69 struct page ***pages); 70 struct page ***pages);
70extern void unmap_vm_area(struct vm_struct *area); 71extern void unmap_kernel_range(unsigned long addr, unsigned long size);
72
73/* Allocate/destroy a 'vmalloc' VM area. */
74extern struct vm_struct *alloc_vm_area(size_t size);
75extern void free_vm_area(struct vm_struct *area);
71 76
72/* 77/*
73 * Internals. Dont't use.. 78 * Internals. Dont't use..
diff --git a/include/linux/vmstat.h b/include/linux/vmstat.h
index d9325cf8a134..75370ec0923e 100644
--- a/include/linux/vmstat.h
+++ b/include/linux/vmstat.h
@@ -25,7 +25,7 @@
25#define HIGHMEM_ZONE(xx) 25#define HIGHMEM_ZONE(xx)
26#endif 26#endif
27 27
28#define FOR_ALL_ZONES(xx) DMA_ZONE(xx) DMA32_ZONE(xx) xx##_NORMAL HIGHMEM_ZONE(xx) 28#define FOR_ALL_ZONES(xx) DMA_ZONE(xx) DMA32_ZONE(xx) xx##_NORMAL HIGHMEM_ZONE(xx) , xx##_MOVABLE
29 29
30enum vm_event_item { PGPGIN, PGPGOUT, PSWPIN, PSWPOUT, 30enum vm_event_item { PGPGIN, PGPGOUT, PSWPIN, PSWPOUT,
31 FOR_ALL_ZONES(PGALLOC), 31 FOR_ALL_ZONES(PGALLOC),
@@ -170,7 +170,8 @@ static inline unsigned long node_page_state(int node,
170#ifdef CONFIG_HIGHMEM 170#ifdef CONFIG_HIGHMEM
171 zone_page_state(&zones[ZONE_HIGHMEM], item) + 171 zone_page_state(&zones[ZONE_HIGHMEM], item) +
172#endif 172#endif
173 zone_page_state(&zones[ZONE_NORMAL], item); 173 zone_page_state(&zones[ZONE_NORMAL], item) +
174 zone_page_state(&zones[ZONE_MOVABLE], item);
174} 175}
175 176
176extern void zone_statistics(struct zonelist *, struct zone *); 177extern void zone_statistics(struct zonelist *, struct zone *);
diff --git a/include/linux/vt_kern.h b/include/linux/vt_kern.h
index d961635d0e61..699b7e9864fa 100644
--- a/include/linux/vt_kern.h
+++ b/include/linux/vt_kern.h
@@ -75,6 +75,8 @@ int con_copy_unimap(struct vc_data *dst_vc, struct vc_data *src_vc);
75int vt_waitactive(int vt); 75int vt_waitactive(int vt);
76void change_console(struct vc_data *new_vc); 76void change_console(struct vc_data *new_vc);
77void reset_vc(struct vc_data *vc); 77void reset_vc(struct vc_data *vc);
78extern int unbind_con_driver(const struct consw *csw, int first, int last,
79 int deflt);
78 80
79/* 81/*
80 * vc_screen.c shares this temporary buffer with the console write code so that 82 * vc_screen.c shares this temporary buffer with the console write code so that
diff --git a/include/linux/wait.h b/include/linux/wait.h
index e820d00e1383..0e686280450b 100644
--- a/include/linux/wait.h
+++ b/include/linux/wait.h
@@ -366,15 +366,15 @@ static inline void remove_wait_queue_locked(wait_queue_head_t *q,
366 366
367/* 367/*
368 * These are the old interfaces to sleep waiting for an event. 368 * These are the old interfaces to sleep waiting for an event.
369 * They are racy. DO NOT use them, use the wait_event* interfaces above. 369 * They are racy. DO NOT use them, use the wait_event* interfaces above.
370 * We plan to remove these interfaces during 2.7. 370 * We plan to remove these interfaces.
371 */ 371 */
372extern void FASTCALL(sleep_on(wait_queue_head_t *q)); 372extern void sleep_on(wait_queue_head_t *q);
373extern long FASTCALL(sleep_on_timeout(wait_queue_head_t *q, 373extern long sleep_on_timeout(wait_queue_head_t *q,
374 signed long timeout)); 374 signed long timeout);
375extern void FASTCALL(interruptible_sleep_on(wait_queue_head_t *q)); 375extern void interruptible_sleep_on(wait_queue_head_t *q);
376extern long FASTCALL(interruptible_sleep_on_timeout(wait_queue_head_t *q, 376extern long interruptible_sleep_on_timeout(wait_queue_head_t *q,
377 signed long timeout)); 377 signed long timeout);
378 378
379/* 379/*
380 * Waitqueues which are removed from the waitqueue_head at wakeup time 380 * Waitqueues which are removed from the waitqueue_head at wakeup time
diff --git a/include/linux/workqueue.h b/include/linux/workqueue.h
index ce0719a2cfeb..ce6badc98f6d 100644
--- a/include/linux/workqueue.h
+++ b/include/linux/workqueue.h
@@ -148,7 +148,7 @@ extern int keventd_up(void);
148extern void init_workqueues(void); 148extern void init_workqueues(void);
149int execute_in_process_context(work_func_t fn, struct execute_work *); 149int execute_in_process_context(work_func_t fn, struct execute_work *);
150 150
151extern void cancel_work_sync(struct work_struct *work); 151extern int cancel_work_sync(struct work_struct *work);
152 152
153/* 153/*
154 * Kill off a pending schedule_delayed_work(). Note that the work callback 154 * Kill off a pending schedule_delayed_work(). Note that the work callback
@@ -166,14 +166,21 @@ static inline int cancel_delayed_work(struct delayed_work *work)
166 return ret; 166 return ret;
167} 167}
168 168
169extern void cancel_rearming_delayed_work(struct delayed_work *work); 169extern int cancel_delayed_work_sync(struct delayed_work *work);
170 170
171/* Obsolete. use cancel_rearming_delayed_work() */ 171/* Obsolete. use cancel_delayed_work_sync() */
172static inline 172static inline
173void cancel_rearming_delayed_workqueue(struct workqueue_struct *wq, 173void cancel_rearming_delayed_workqueue(struct workqueue_struct *wq,
174 struct delayed_work *work) 174 struct delayed_work *work)
175{ 175{
176 cancel_rearming_delayed_work(work); 176 cancel_delayed_work_sync(work);
177}
178
179/* Obsolete. use cancel_delayed_work_sync() */
180static inline
181void cancel_rearming_delayed_work(struct delayed_work *work)
182{
183 cancel_delayed_work_sync(work);
177} 184}
178 185
179#endif 186#endif