aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/ata.h34
-rw-r--r--include/linux/audit.h22
-rw-r--r--include/linux/debugfs.h5
-rw-r--r--include/linux/device.h2
-rw-r--r--include/linux/dma-mapping.h1
-rw-r--r--include/linux/fs_uart_pd.h60
-rw-r--r--include/linux/input.h109
-rw-r--r--include/linux/kobject.h3
-rw-r--r--include/linux/libata.h273
-rw-r--r--include/linux/list.h2
-rw-r--r--include/linux/mmc/card.h1
-rw-r--r--include/linux/mod_devicetable.h48
-rw-r--r--include/linux/netdevice.h23
-rw-r--r--include/linux/netfilter/x_tables.h8
-rw-r--r--include/linux/netfilter_ipv4/ip_conntrack_helper_h323_asn1.h2
-rw-r--r--include/linux/netlink.h1
-rw-r--r--include/linux/pagemap.h2
-rw-r--r--include/linux/pipe_fs_i.h30
-rw-r--r--include/linux/security.h16
-rw-r--r--include/linux/selinux.h177
-rw-r--r--include/linux/serial_core.h1
-rw-r--r--include/linux/signal.h4
-rw-r--r--include/linux/spi/ads7846.h7
23 files changed, 650 insertions, 181 deletions
diff --git a/include/linux/ata.h b/include/linux/ata.h
index 312a2c0c64e6..c494e1c0531e 100644
--- a/include/linux/ata.h
+++ b/include/linux/ata.h
@@ -97,6 +97,9 @@ enum {
97 ATA_DRQ = (1 << 3), /* data request i/o */ 97 ATA_DRQ = (1 << 3), /* data request i/o */
98 ATA_ERR = (1 << 0), /* have an error */ 98 ATA_ERR = (1 << 0), /* have an error */
99 ATA_SRST = (1 << 2), /* software reset */ 99 ATA_SRST = (1 << 2), /* software reset */
100 ATA_ICRC = (1 << 7), /* interface CRC error */
101 ATA_UNC = (1 << 6), /* uncorrectable media error */
102 ATA_IDNF = (1 << 4), /* ID not found */
100 ATA_ABORTED = (1 << 2), /* command aborted */ 103 ATA_ABORTED = (1 << 2), /* command aborted */
101 104
102 /* ATA command block registers */ 105 /* ATA command block registers */
@@ -130,6 +133,8 @@ enum {
130 ATA_CMD_WRITE = 0xCA, 133 ATA_CMD_WRITE = 0xCA,
131 ATA_CMD_WRITE_EXT = 0x35, 134 ATA_CMD_WRITE_EXT = 0x35,
132 ATA_CMD_WRITE_FUA_EXT = 0x3D, 135 ATA_CMD_WRITE_FUA_EXT = 0x3D,
136 ATA_CMD_FPDMA_READ = 0x60,
137 ATA_CMD_FPDMA_WRITE = 0x61,
133 ATA_CMD_PIO_READ = 0x20, 138 ATA_CMD_PIO_READ = 0x20,
134 ATA_CMD_PIO_READ_EXT = 0x24, 139 ATA_CMD_PIO_READ_EXT = 0x24,
135 ATA_CMD_PIO_WRITE = 0x30, 140 ATA_CMD_PIO_WRITE = 0x30,
@@ -148,6 +153,10 @@ enum {
148 ATA_CMD_INIT_DEV_PARAMS = 0x91, 153 ATA_CMD_INIT_DEV_PARAMS = 0x91,
149 ATA_CMD_READ_NATIVE_MAX = 0xF8, 154 ATA_CMD_READ_NATIVE_MAX = 0xF8,
150 ATA_CMD_READ_NATIVE_MAX_EXT = 0x27, 155 ATA_CMD_READ_NATIVE_MAX_EXT = 0x27,
156 ATA_CMD_READ_LOG_EXT = 0x2f,
157
158 /* READ_LOG_EXT pages */
159 ATA_LOG_SATA_NCQ = 0x10,
151 160
152 /* SETFEATURES stuff */ 161 /* SETFEATURES stuff */
153 SETFEATURES_XFER = 0x03, 162 SETFEATURES_XFER = 0x03,
@@ -192,6 +201,16 @@ enum {
192 SCR_ACTIVE = 3, 201 SCR_ACTIVE = 3,
193 SCR_NOTIFICATION = 4, 202 SCR_NOTIFICATION = 4,
194 203
204 /* SError bits */
205 SERR_DATA_RECOVERED = (1 << 0), /* recovered data error */
206 SERR_COMM_RECOVERED = (1 << 1), /* recovered comm failure */
207 SERR_DATA = (1 << 8), /* unrecovered data error */
208 SERR_PERSISTENT = (1 << 9), /* persistent data/comm error */
209 SERR_PROTOCOL = (1 << 10), /* protocol violation */
210 SERR_INTERNAL = (1 << 11), /* host internal error */
211 SERR_PHYRDY_CHG = (1 << 16), /* PHY RDY changed */
212 SERR_DEV_XCHG = (1 << 26), /* device exchanged */
213
195 /* struct ata_taskfile flags */ 214 /* struct ata_taskfile flags */
196 ATA_TFLAG_LBA48 = (1 << 0), /* enable 48-bit LBA and "HOB" */ 215 ATA_TFLAG_LBA48 = (1 << 0), /* enable 48-bit LBA and "HOB" */
197 ATA_TFLAG_ISADDR = (1 << 1), /* enable r/w to nsect/lba regs */ 216 ATA_TFLAG_ISADDR = (1 << 1), /* enable r/w to nsect/lba regs */
@@ -199,6 +218,7 @@ enum {
199 ATA_TFLAG_WRITE = (1 << 3), /* data dir: host->dev==1 (write) */ 218 ATA_TFLAG_WRITE = (1 << 3), /* data dir: host->dev==1 (write) */
200 ATA_TFLAG_LBA = (1 << 4), /* enable LBA */ 219 ATA_TFLAG_LBA = (1 << 4), /* enable LBA */
201 ATA_TFLAG_FUA = (1 << 5), /* enable FUA */ 220 ATA_TFLAG_FUA = (1 << 5), /* enable FUA */
221 ATA_TFLAG_POLLING = (1 << 6), /* set nIEN to 1 and use polling */
202}; 222};
203 223
204enum ata_tf_protocols { 224enum ata_tf_protocols {
@@ -207,6 +227,7 @@ enum ata_tf_protocols {
207 ATA_PROT_NODATA, /* no data */ 227 ATA_PROT_NODATA, /* no data */
208 ATA_PROT_PIO, /* PIO single sector */ 228 ATA_PROT_PIO, /* PIO single sector */
209 ATA_PROT_DMA, /* DMA */ 229 ATA_PROT_DMA, /* DMA */
230 ATA_PROT_NCQ, /* NCQ */
210 ATA_PROT_ATAPI, /* packet command, PIO data xfer*/ 231 ATA_PROT_ATAPI, /* packet command, PIO data xfer*/
211 ATA_PROT_ATAPI_NODATA, /* packet command, no data */ 232 ATA_PROT_ATAPI_NODATA, /* packet command, no data */
212 ATA_PROT_ATAPI_DMA, /* packet command with special DMA sauce */ 233 ATA_PROT_ATAPI_DMA, /* packet command with special DMA sauce */
@@ -262,6 +283,8 @@ struct ata_taskfile {
262#define ata_id_has_pm(id) ((id)[82] & (1 << 3)) 283#define ata_id_has_pm(id) ((id)[82] & (1 << 3))
263#define ata_id_has_lba(id) ((id)[49] & (1 << 9)) 284#define ata_id_has_lba(id) ((id)[49] & (1 << 9))
264#define ata_id_has_dma(id) ((id)[49] & (1 << 8)) 285#define ata_id_has_dma(id) ((id)[49] & (1 << 8))
286#define ata_id_has_ncq(id) ((id)[76] & (1 << 8))
287#define ata_id_queue_depth(id) (((id)[75] & 0x1f) + 1)
265#define ata_id_removeable(id) ((id)[0] & (1 << 7)) 288#define ata_id_removeable(id) ((id)[0] & (1 << 7))
266#define ata_id_has_dword_io(id) ((id)[50] & (1 << 0)) 289#define ata_id_has_dword_io(id) ((id)[50] & (1 << 0))
267#define ata_id_u32(id,n) \ 290#define ata_id_u32(id,n) \
@@ -272,6 +295,8 @@ struct ata_taskfile {
272 ((u64) (id)[(n) + 1] << 16) | \ 295 ((u64) (id)[(n) + 1] << 16) | \
273 ((u64) (id)[(n) + 0]) ) 296 ((u64) (id)[(n) + 0]) )
274 297
298#define ata_id_cdb_intr(id) (((id)[0] & 0x60) == 0x20)
299
275static inline unsigned int ata_id_major_version(const u16 *id) 300static inline unsigned int ata_id_major_version(const u16 *id)
276{ 301{
277 unsigned int mver; 302 unsigned int mver;
@@ -311,6 +336,15 @@ static inline int is_atapi_taskfile(const struct ata_taskfile *tf)
311 (tf->protocol == ATA_PROT_ATAPI_DMA); 336 (tf->protocol == ATA_PROT_ATAPI_DMA);
312} 337}
313 338
339static inline int is_multi_taskfile(struct ata_taskfile *tf)
340{
341 return (tf->command == ATA_CMD_READ_MULTI) ||
342 (tf->command == ATA_CMD_WRITE_MULTI) ||
343 (tf->command == ATA_CMD_READ_MULTI_EXT) ||
344 (tf->command == ATA_CMD_WRITE_MULTI_EXT) ||
345 (tf->command == ATA_CMD_WRITE_MULTI_FUA_EXT);
346}
347
314static inline int ata_ok(u8 status) 348static inline int ata_ok(u8 status)
315{ 349{
316 return ((status & (ATA_BUSY | ATA_DRDY | ATA_DF | ATA_DRQ | ATA_ERR)) 350 return ((status & (ATA_BUSY | ATA_DRDY | ATA_DF | ATA_DRQ | ATA_ERR))
diff --git a/include/linux/audit.h b/include/linux/audit.h
index 1c47c59058c1..b74c148f14e3 100644
--- a/include/linux/audit.h
+++ b/include/linux/audit.h
@@ -83,6 +83,7 @@
83#define AUDIT_CONFIG_CHANGE 1305 /* Audit system configuration change */ 83#define AUDIT_CONFIG_CHANGE 1305 /* Audit system configuration change */
84#define AUDIT_SOCKADDR 1306 /* sockaddr copied as syscall arg */ 84#define AUDIT_SOCKADDR 1306 /* sockaddr copied as syscall arg */
85#define AUDIT_CWD 1307 /* Current working directory */ 85#define AUDIT_CWD 1307 /* Current working directory */
86#define AUDIT_IPC_SET_PERM 1311 /* IPC new permissions record type */
86 87
87#define AUDIT_AVC 1400 /* SE Linux avc denial or grant */ 88#define AUDIT_AVC 1400 /* SE Linux avc denial or grant */
88#define AUDIT_SELINUX_ERR 1401 /* Internal SE Linux Errors */ 89#define AUDIT_SELINUX_ERR 1401 /* Internal SE Linux Errors */
@@ -145,6 +146,11 @@
145#define AUDIT_PERS 10 146#define AUDIT_PERS 10
146#define AUDIT_ARCH 11 147#define AUDIT_ARCH 11
147#define AUDIT_MSGTYPE 12 148#define AUDIT_MSGTYPE 12
149#define AUDIT_SE_USER 13 /* security label user */
150#define AUDIT_SE_ROLE 14 /* security label role */
151#define AUDIT_SE_TYPE 15 /* security label type */
152#define AUDIT_SE_SEN 16 /* security label sensitivity label */
153#define AUDIT_SE_CLR 17 /* security label clearance label */
148 154
149 /* These are ONLY useful when checking 155 /* These are ONLY useful when checking
150 * at syscall exit time (AUDIT_AT_EXIT). */ 156 * at syscall exit time (AUDIT_AT_EXIT). */
@@ -287,10 +293,10 @@ struct netlink_skb_parms;
287 /* Public API */ 293 /* Public API */
288extern int audit_alloc(struct task_struct *task); 294extern int audit_alloc(struct task_struct *task);
289extern void audit_free(struct task_struct *task); 295extern void audit_free(struct task_struct *task);
290extern void audit_syscall_entry(struct task_struct *task, int arch, 296extern void audit_syscall_entry(int arch,
291 int major, unsigned long a0, unsigned long a1, 297 int major, unsigned long a0, unsigned long a1,
292 unsigned long a2, unsigned long a3); 298 unsigned long a2, unsigned long a3);
293extern void audit_syscall_exit(struct task_struct *task, int failed, long return_code); 299extern void audit_syscall_exit(int failed, long return_code);
294extern void audit_getname(const char *name); 300extern void audit_getname(const char *name);
295extern void audit_putname(const char *name); 301extern void audit_putname(const char *name);
296extern void __audit_inode(const char *name, const struct inode *inode, unsigned flags); 302extern void __audit_inode(const char *name, const struct inode *inode, unsigned flags);
@@ -314,7 +320,8 @@ extern void auditsc_get_stamp(struct audit_context *ctx,
314 struct timespec *t, unsigned int *serial); 320 struct timespec *t, unsigned int *serial);
315extern int audit_set_loginuid(struct task_struct *task, uid_t loginuid); 321extern int audit_set_loginuid(struct task_struct *task, uid_t loginuid);
316extern uid_t audit_get_loginuid(struct audit_context *ctx); 322extern uid_t audit_get_loginuid(struct audit_context *ctx);
317extern int audit_ipc_perms(unsigned long qbytes, uid_t uid, gid_t gid, mode_t mode, struct kern_ipc_perm *ipcp); 323extern int audit_ipc_obj(struct kern_ipc_perm *ipcp);
324extern int audit_ipc_set_perm(unsigned long qbytes, uid_t uid, gid_t gid, mode_t mode, struct kern_ipc_perm *ipcp);
318extern int audit_socketcall(int nargs, unsigned long *args); 325extern int audit_socketcall(int nargs, unsigned long *args);
319extern int audit_sockaddr(int len, void *addr); 326extern int audit_sockaddr(int len, void *addr);
320extern int audit_avc_path(struct dentry *dentry, struct vfsmount *mnt); 327extern int audit_avc_path(struct dentry *dentry, struct vfsmount *mnt);
@@ -323,8 +330,8 @@ extern int audit_set_macxattr(const char *name);
323#else 330#else
324#define audit_alloc(t) ({ 0; }) 331#define audit_alloc(t) ({ 0; })
325#define audit_free(t) do { ; } while (0) 332#define audit_free(t) do { ; } while (0)
326#define audit_syscall_entry(t,ta,a,b,c,d,e) do { ; } while (0) 333#define audit_syscall_entry(ta,a,b,c,d,e) do { ; } while (0)
327#define audit_syscall_exit(t,f,r) do { ; } while (0) 334#define audit_syscall_exit(f,r) do { ; } while (0)
328#define audit_getname(n) do { ; } while (0) 335#define audit_getname(n) do { ; } while (0)
329#define audit_putname(n) do { ; } while (0) 336#define audit_putname(n) do { ; } while (0)
330#define __audit_inode(n,i,f) do { ; } while (0) 337#define __audit_inode(n,i,f) do { ; } while (0)
@@ -333,7 +340,8 @@ extern int audit_set_macxattr(const char *name);
333#define audit_inode_child(d,i,p) do { ; } while (0) 340#define audit_inode_child(d,i,p) do { ; } while (0)
334#define auditsc_get_stamp(c,t,s) do { BUG(); } while (0) 341#define auditsc_get_stamp(c,t,s) do { BUG(); } while (0)
335#define audit_get_loginuid(c) ({ -1; }) 342#define audit_get_loginuid(c) ({ -1; })
336#define audit_ipc_perms(q,u,g,m,i) ({ 0; }) 343#define audit_ipc_obj(i) ({ 0; })
344#define audit_ipc_set_perm(q,u,g,m,i) ({ 0; })
337#define audit_socketcall(n,a) ({ 0; }) 345#define audit_socketcall(n,a) ({ 0; })
338#define audit_sockaddr(len, addr) ({ 0; }) 346#define audit_sockaddr(len, addr) ({ 0; })
339#define audit_avc_path(dentry, mnt) ({ 0; }) 347#define audit_avc_path(dentry, mnt) ({ 0; })
@@ -366,7 +374,7 @@ extern void audit_log_d_path(struct audit_buffer *ab,
366extern int audit_filter_user(struct netlink_skb_parms *cb, int type); 374extern int audit_filter_user(struct netlink_skb_parms *cb, int type);
367extern int audit_filter_type(int type); 375extern int audit_filter_type(int type);
368extern int audit_receive_filter(int type, int pid, int uid, int seq, 376extern int audit_receive_filter(int type, int pid, int uid, int seq,
369 void *data, size_t datasz, uid_t loginuid); 377 void *data, size_t datasz, uid_t loginuid, u32 sid);
370#else 378#else
371#define audit_log(c,g,t,f,...) do { ; } while (0) 379#define audit_log(c,g,t,f,...) do { ; } while (0)
372#define audit_log_start(c,g,t) ({ NULL; }) 380#define audit_log_start(c,g,t) ({ NULL; })
diff --git a/include/linux/debugfs.h b/include/linux/debugfs.h
index 176e2d371577..047567d34ca7 100644
--- a/include/linux/debugfs.h
+++ b/include/linux/debugfs.h
@@ -58,9 +58,8 @@ struct dentry *debugfs_create_blob(const char *name, mode_t mode,
58 */ 58 */
59 59
60static inline struct dentry *debugfs_create_file(const char *name, mode_t mode, 60static inline struct dentry *debugfs_create_file(const char *name, mode_t mode,
61 struct dentry *parent, 61 struct dentry *parent, void *data,
62 void *data, 62 const struct file_operations *fops)
63 struct file_operations *fops)
64{ 63{
65 return ERR_PTR(-ENODEV); 64 return ERR_PTR(-ENODEV);
66} 65}
diff --git a/include/linux/device.h b/include/linux/device.h
index f6e72a65a3f2..e8e53b9accc6 100644
--- a/include/linux/device.h
+++ b/include/linux/device.h
@@ -200,6 +200,7 @@ extern int class_device_create_file(struct class_device *,
200 * @node: for internal use by the driver core only. 200 * @node: for internal use by the driver core only.
201 * @kobj: for internal use by the driver core only. 201 * @kobj: for internal use by the driver core only.
202 * @devt_attr: for internal use by the driver core only. 202 * @devt_attr: for internal use by the driver core only.
203 * @groups: optional additional groups to be created
203 * @dev: if set, a symlink to the struct device is created in the sysfs 204 * @dev: if set, a symlink to the struct device is created in the sysfs
204 * directory for this struct class device. 205 * directory for this struct class device.
205 * @class_data: pointer to whatever you want to store here for this struct 206 * @class_data: pointer to whatever you want to store here for this struct
@@ -228,6 +229,7 @@ struct class_device {
228 struct device * dev; /* not necessary, but nice to have */ 229 struct device * dev; /* not necessary, but nice to have */
229 void * class_data; /* class-specific data */ 230 void * class_data; /* class-specific data */
230 struct class_device *parent; /* parent of this child device, if there is one */ 231 struct class_device *parent; /* parent of this child device, if there is one */
232 struct attribute_group ** groups; /* optional groups */
231 233
232 void (*release)(struct class_device *dev); 234 void (*release)(struct class_device *dev);
233 int (*uevent)(struct class_device *dev, char **envp, 235 int (*uevent)(struct class_device *dev, char **envp,
diff --git a/include/linux/dma-mapping.h b/include/linux/dma-mapping.h
index ff61817082fa..635690cf3e3d 100644
--- a/include/linux/dma-mapping.h
+++ b/include/linux/dma-mapping.h
@@ -14,6 +14,7 @@ enum dma_data_direction {
14}; 14};
15 15
16#define DMA_64BIT_MASK 0xffffffffffffffffULL 16#define DMA_64BIT_MASK 0xffffffffffffffffULL
17#define DMA_48BIT_MASK 0x0000ffffffffffffULL
17#define DMA_40BIT_MASK 0x000000ffffffffffULL 18#define DMA_40BIT_MASK 0x000000ffffffffffULL
18#define DMA_39BIT_MASK 0x0000007fffffffffULL 19#define DMA_39BIT_MASK 0x0000007fffffffffULL
19#define DMA_32BIT_MASK 0x00000000ffffffffULL 20#define DMA_32BIT_MASK 0x00000000ffffffffULL
diff --git a/include/linux/fs_uart_pd.h b/include/linux/fs_uart_pd.h
new file mode 100644
index 000000000000..f5975126b712
--- /dev/null
+++ b/include/linux/fs_uart_pd.h
@@ -0,0 +1,60 @@
1/*
2 * Platform information definitions for the CPM Uart driver.
3 *
4 * 2006 (c) MontaVista Software, Inc.
5 * Vitaly Bordug <vbordug@ru.mvista.com>
6 *
7 * This file is licensed under the terms of the GNU General Public License
8 * version 2. This program is licensed "as is" without any warranty of any
9 * kind, whether express or implied.
10 */
11
12#ifndef FS_UART_PD_H
13#define FS_UART_PD_H
14
15#include <linux/version.h>
16#include <asm/types.h>
17
18enum fs_uart_id {
19 fsid_smc1_uart,
20 fsid_smc2_uart,
21 fsid_scc1_uart,
22 fsid_scc2_uart,
23 fsid_scc3_uart,
24 fsid_scc4_uart,
25 fs_uart_nr,
26};
27
28static inline int fs_uart_id_scc2fsid(int id)
29{
30 return fsid_scc1_uart + id - 1;
31}
32
33static inline int fs_uart_id_fsid2scc(int id)
34{
35 return id - fsid_scc1_uart + 1;
36}
37
38static inline int fs_uart_id_smc2fsid(int id)
39{
40 return fsid_smc1_uart + id - 1;
41}
42
43static inline int fs_uart_id_fsid2smc(int id)
44{
45 return id - fsid_smc1_uart + 1;
46}
47
48struct fs_uart_platform_info {
49 void(*init_ioports)(void);
50 /* device specific information */
51 int fs_no; /* controller index */
52 u32 uart_clk;
53 u8 tx_num_fifo;
54 u8 tx_buf_size;
55 u8 rx_num_fifo;
56 u8 rx_buf_size;
57 u8 brg;
58};
59
60#endif
diff --git a/include/linux/input.h b/include/linux/input.h
index b0e612dda0cf..50e338d2ffda 100644
--- a/include/linux/input.h
+++ b/include/linux/input.h
@@ -12,8 +12,6 @@
12#ifdef __KERNEL__ 12#ifdef __KERNEL__
13#include <linux/time.h> 13#include <linux/time.h>
14#include <linux/list.h> 14#include <linux/list.h>
15#include <linux/device.h>
16#include <linux/mod_devicetable.h>
17#else 15#else
18#include <sys/time.h> 16#include <sys/time.h>
19#include <sys/ioctl.h> 17#include <sys/ioctl.h>
@@ -58,6 +56,8 @@ struct input_absinfo {
58 56
59#define EVIOCGVERSION _IOR('E', 0x01, int) /* get driver version */ 57#define EVIOCGVERSION _IOR('E', 0x01, int) /* get driver version */
60#define EVIOCGID _IOR('E', 0x02, struct input_id) /* get device ID */ 58#define EVIOCGID _IOR('E', 0x02, struct input_id) /* get device ID */
59#define EVIOCGREP _IOR('E', 0x03, int[2]) /* get repeat settings */
60#define EVIOCSREP _IOW('E', 0x03, int[2]) /* set repeat settings */
61#define EVIOCGKEYCODE _IOR('E', 0x04, int[2]) /* get keycode */ 61#define EVIOCGKEYCODE _IOR('E', 0x04, int[2]) /* get keycode */
62#define EVIOCSKEYCODE _IOW('E', 0x04, int[2]) /* set keycode */ 62#define EVIOCSKEYCODE _IOW('E', 0x04, int[2]) /* set keycode */
63 63
@@ -577,15 +577,15 @@ struct input_absinfo {
577 * Switch events 577 * Switch events
578 */ 578 */
579 579
580#define SW_0 0x00 580#define SW_0 0x00
581#define SW_1 0x01 581#define SW_1 0x01
582#define SW_2 0x02 582#define SW_2 0x02
583#define SW_3 0x03 583#define SW_3 0x03
584#define SW_4 0x04 584#define SW_4 0x04
585#define SW_5 0x05 585#define SW_5 0x05
586#define SW_6 0x06 586#define SW_6 0x06
587#define SW_7 0x07 587#define SW_7 0x07
588#define SW_MAX 0x0f 588#define SW_MAX 0x0f
589 589
590/* 590/*
591 * Misc events 591 * Misc events
@@ -805,52 +805,16 @@ struct ff_effect {
805 805
806#define FF_MAX 0x7f 806#define FF_MAX 0x7f
807 807
808struct input_device_id {
809
810 kernel_ulong_t flags;
811
812 struct input_id id;
813
814 kernel_ulong_t evbit[EV_MAX/BITS_PER_LONG+1];
815 kernel_ulong_t keybit[KEY_MAX/BITS_PER_LONG+1];
816 kernel_ulong_t relbit[REL_MAX/BITS_PER_LONG+1];
817 kernel_ulong_t absbit[ABS_MAX/BITS_PER_LONG+1];
818 kernel_ulong_t mscbit[MSC_MAX/BITS_PER_LONG+1];
819 kernel_ulong_t ledbit[LED_MAX/BITS_PER_LONG+1];
820 kernel_ulong_t sndbit[SND_MAX/BITS_PER_LONG+1];
821 kernel_ulong_t ffbit[FF_MAX/BITS_PER_LONG+1];
822 kernel_ulong_t swbit[SW_MAX/BITS_PER_LONG+1];
823
824 kernel_ulong_t driver_info;
825};
826
827/*
828 * Structure for hotplug & device<->driver matching.
829 */
830
831#define INPUT_DEVICE_ID_MATCH_BUS 1
832#define INPUT_DEVICE_ID_MATCH_VENDOR 2
833#define INPUT_DEVICE_ID_MATCH_PRODUCT 4
834#define INPUT_DEVICE_ID_MATCH_VERSION 8
835
836#define INPUT_DEVICE_ID_MATCH_EVBIT 0x010
837#define INPUT_DEVICE_ID_MATCH_KEYBIT 0x020
838#define INPUT_DEVICE_ID_MATCH_RELBIT 0x040
839#define INPUT_DEVICE_ID_MATCH_ABSBIT 0x080
840#define INPUT_DEVICE_ID_MATCH_MSCIT 0x100
841#define INPUT_DEVICE_ID_MATCH_LEDBIT 0x200
842#define INPUT_DEVICE_ID_MATCH_SNDBIT 0x400
843#define INPUT_DEVICE_ID_MATCH_FFBIT 0x800
844#define INPUT_DEVICE_ID_MATCH_SWBIT 0x1000
845
846#ifdef __KERNEL__ 808#ifdef __KERNEL__
847 809
848/* 810/*
849 * In-kernel definitions. 811 * In-kernel definitions.
850 */ 812 */
851 813
814#include <linux/device.h>
852#include <linux/fs.h> 815#include <linux/fs.h>
853#include <linux/timer.h> 816#include <linux/timer.h>
817#include <linux/mod_devicetable.h>
854 818
855#define NBITS(x) (((x)/BITS_PER_LONG)+1) 819#define NBITS(x) (((x)/BITS_PER_LONG)+1)
856#define BIT(x) (1UL<<((x)%BITS_PER_LONG)) 820#define BIT(x) (1UL<<((x)%BITS_PER_LONG))
@@ -951,9 +915,49 @@ struct input_dev {
951}; 915};
952#define to_input_dev(d) container_of(d, struct input_dev, cdev) 916#define to_input_dev(d) container_of(d, struct input_dev, cdev)
953 917
954#define INPUT_DEVICE_ID_MATCH_DEVICE\ 918/*
919 * Verify that we are in sync with input_device_id mod_devicetable.h #defines
920 */
921
922#if EV_MAX != INPUT_DEVICE_ID_EV_MAX
923#error "EV_MAX and INPUT_DEVICE_ID_EV_MAX do not match"
924#endif
925
926#if KEY_MAX != INPUT_DEVICE_ID_KEY_MAX
927#error "KEY_MAX and INPUT_DEVICE_ID_KEY_MAX do not match"
928#endif
929
930#if REL_MAX != INPUT_DEVICE_ID_REL_MAX
931#error "REL_MAX and INPUT_DEVICE_ID_REL_MAX do not match"
932#endif
933
934#if ABS_MAX != INPUT_DEVICE_ID_ABS_MAX
935#error "ABS_MAX and INPUT_DEVICE_ID_ABS_MAX do not match"
936#endif
937
938#if MSC_MAX != INPUT_DEVICE_ID_MSC_MAX
939#error "MSC_MAX and INPUT_DEVICE_ID_MSC_MAX do not match"
940#endif
941
942#if LED_MAX != INPUT_DEVICE_ID_LED_MAX
943#error "LED_MAX and INPUT_DEVICE_ID_LED_MAX do not match"
944#endif
945
946#if SND_MAX != INPUT_DEVICE_ID_SND_MAX
947#error "SND_MAX and INPUT_DEVICE_ID_SND_MAX do not match"
948#endif
949
950#if FF_MAX != INPUT_DEVICE_ID_FF_MAX
951#error "FF_MAX and INPUT_DEVICE_ID_FF_MAX do not match"
952#endif
953
954#if SW_MAX != INPUT_DEVICE_ID_SW_MAX
955#error "SW_MAX and INPUT_DEVICE_ID_SW_MAX do not match"
956#endif
957
958#define INPUT_DEVICE_ID_MATCH_DEVICE \
955 (INPUT_DEVICE_ID_MATCH_BUS | INPUT_DEVICE_ID_MATCH_VENDOR | INPUT_DEVICE_ID_MATCH_PRODUCT) 959 (INPUT_DEVICE_ID_MATCH_BUS | INPUT_DEVICE_ID_MATCH_VENDOR | INPUT_DEVICE_ID_MATCH_PRODUCT)
956#define INPUT_DEVICE_ID_MATCH_DEVICE_AND_VERSION\ 960#define INPUT_DEVICE_ID_MATCH_DEVICE_AND_VERSION \
957 (INPUT_DEVICE_ID_MATCH_DEVICE | INPUT_DEVICE_ID_MATCH_VERSION) 961 (INPUT_DEVICE_ID_MATCH_DEVICE | INPUT_DEVICE_ID_MATCH_VERSION)
958 962
959struct input_handle; 963struct input_handle;
@@ -1016,7 +1020,8 @@ static inline void input_put_device(struct input_dev *dev)
1016 1020
1017static inline void input_free_device(struct input_dev *dev) 1021static inline void input_free_device(struct input_dev *dev)
1018{ 1022{
1019 input_put_device(dev); 1023 if (dev)
1024 input_put_device(dev);
1020} 1025}
1021 1026
1022int input_register_device(struct input_dev *); 1027int input_register_device(struct input_dev *);
diff --git a/include/linux/kobject.h b/include/linux/kobject.h
index dcd0623be892..c187c53cecd0 100644
--- a/include/linux/kobject.h
+++ b/include/linux/kobject.h
@@ -257,9 +257,8 @@ struct subsys_attribute {
257}; 257};
258 258
259extern int subsys_create_file(struct subsystem * , struct subsys_attribute *); 259extern int subsys_create_file(struct subsystem * , struct subsys_attribute *);
260extern void subsys_remove_file(struct subsystem * , struct subsys_attribute *);
261 260
262#if defined(CONFIG_HOTPLUG) && defined(CONFIG_NET) 261#if defined(CONFIG_HOTPLUG)
263void kobject_uevent(struct kobject *kobj, enum kobject_action action); 262void kobject_uevent(struct kobject *kobj, enum kobject_action action);
264 263
265int add_uevent_var(char **envp, int num_envp, int *cur_index, 264int add_uevent_var(char **envp, int num_envp, int *cur_index,
diff --git a/include/linux/libata.h b/include/linux/libata.h
index 11d9febc0078..2803ab8e9243 100644
--- a/include/linux/libata.h
+++ b/include/linux/libata.h
@@ -108,7 +108,9 @@ enum {
108 LIBATA_MAX_PRD = ATA_MAX_PRD / 2, 108 LIBATA_MAX_PRD = ATA_MAX_PRD / 2,
109 ATA_MAX_PORTS = 8, 109 ATA_MAX_PORTS = 8,
110 ATA_DEF_QUEUE = 1, 110 ATA_DEF_QUEUE = 1,
111 ATA_MAX_QUEUE = 1, 111 /* tag ATA_MAX_QUEUE - 1 is reserved for internal commands */
112 ATA_MAX_QUEUE = 32,
113 ATA_TAG_INTERNAL = ATA_MAX_QUEUE - 1,
112 ATA_MAX_SECTORS = 200, /* FIXME */ 114 ATA_MAX_SECTORS = 200, /* FIXME */
113 ATA_MAX_SECTORS_LBA48 = 65535, 115 ATA_MAX_SECTORS_LBA48 = 65535,
114 ATA_MAX_BUS = 2, 116 ATA_MAX_BUS = 2,
@@ -123,6 +125,8 @@ enum {
123 /* struct ata_device stuff */ 125 /* struct ata_device stuff */
124 ATA_DFLAG_LBA = (1 << 0), /* device supports LBA */ 126 ATA_DFLAG_LBA = (1 << 0), /* device supports LBA */
125 ATA_DFLAG_LBA48 = (1 << 1), /* device supports LBA48 */ 127 ATA_DFLAG_LBA48 = (1 << 1), /* device supports LBA48 */
128 ATA_DFLAG_CDB_INTR = (1 << 2), /* device asserts INTRQ when ready for CDB */
129 ATA_DFLAG_NCQ = (1 << 3), /* device supports NCQ */
126 ATA_DFLAG_CFG_MASK = (1 << 8) - 1, 130 ATA_DFLAG_CFG_MASK = (1 << 8) - 1,
127 131
128 ATA_DFLAG_PIO = (1 << 8), /* device currently in PIO mode */ 132 ATA_DFLAG_PIO = (1 << 8), /* device currently in PIO mode */
@@ -146,14 +150,19 @@ enum {
146 ATA_FLAG_PIO_DMA = (1 << 7), /* PIO cmds via DMA */ 150 ATA_FLAG_PIO_DMA = (1 << 7), /* PIO cmds via DMA */
147 ATA_FLAG_PIO_LBA48 = (1 << 8), /* Host DMA engine is LBA28 only */ 151 ATA_FLAG_PIO_LBA48 = (1 << 8), /* Host DMA engine is LBA28 only */
148 ATA_FLAG_IRQ_MASK = (1 << 9), /* Mask IRQ in PIO xfers */ 152 ATA_FLAG_IRQ_MASK = (1 << 9), /* Mask IRQ in PIO xfers */
153 ATA_FLAG_PIO_POLLING = (1 << 10), /* use polling PIO if LLD
154 * doesn't handle PIO interrupts */
155 ATA_FLAG_NCQ = (1 << 11), /* host supports NCQ */
149 156
150 ATA_FLAG_NOINTR = (1 << 16), /* FIXME: Remove this once 157 ATA_FLAG_DEBUGMSG = (1 << 14),
151 * proper HSM is in place. */ 158 ATA_FLAG_FLUSH_PORT_TASK = (1 << 15), /* flush port task */
152 ATA_FLAG_DEBUGMSG = (1 << 17),
153 ATA_FLAG_FLUSH_PORT_TASK = (1 << 18), /* flush port task */
154 159
155 ATA_FLAG_DISABLED = (1 << 19), /* port is disabled, ignore it */ 160 ATA_FLAG_EH_PENDING = (1 << 16), /* EH pending */
156 ATA_FLAG_SUSPENDED = (1 << 20), /* port is suspended */ 161 ATA_FLAG_FROZEN = (1 << 17), /* port is frozen */
162 ATA_FLAG_RECOVERED = (1 << 18), /* recovery action performed */
163
164 ATA_FLAG_DISABLED = (1 << 22), /* port is disabled, ignore it */
165 ATA_FLAG_SUSPENDED = (1 << 23), /* port is suspended (power) */
157 166
158 /* bits 24:31 of ap->flags are reserved for LLDD specific flags */ 167 /* bits 24:31 of ap->flags are reserved for LLDD specific flags */
159 168
@@ -163,17 +172,18 @@ enum {
163 ATA_QCFLAG_SINGLE = (1 << 2), /* no s/g, just a single buffer */ 172 ATA_QCFLAG_SINGLE = (1 << 2), /* no s/g, just a single buffer */
164 ATA_QCFLAG_DMAMAP = ATA_QCFLAG_SG | ATA_QCFLAG_SINGLE, 173 ATA_QCFLAG_DMAMAP = ATA_QCFLAG_SG | ATA_QCFLAG_SINGLE,
165 ATA_QCFLAG_IO = (1 << 3), /* standard IO command */ 174 ATA_QCFLAG_IO = (1 << 3), /* standard IO command */
166 ATA_QCFLAG_EH_SCHEDULED = (1 << 4), /* EH scheduled */ 175 ATA_QCFLAG_RESULT_TF = (1 << 4), /* result TF requested */
176
177 ATA_QCFLAG_FAILED = (1 << 16), /* cmd failed and is owned by EH */
178 ATA_QCFLAG_SENSE_VALID = (1 << 17), /* sense data valid */
179 ATA_QCFLAG_EH_SCHEDULED = (1 << 18), /* EH scheduled (obsolete) */
167 180
168 /* host set flags */ 181 /* host set flags */
169 ATA_HOST_SIMPLEX = (1 << 0), /* Host is simplex, one DMA channel per host_set only */ 182 ATA_HOST_SIMPLEX = (1 << 0), /* Host is simplex, one DMA channel per host_set only */
170 183
171 /* various lengths of time */ 184 /* various lengths of time */
172 ATA_TMOUT_PIO = 30 * HZ,
173 ATA_TMOUT_BOOT = 30 * HZ, /* heuristic */ 185 ATA_TMOUT_BOOT = 30 * HZ, /* heuristic */
174 ATA_TMOUT_BOOT_QUICK = 7 * HZ, /* heuristic */ 186 ATA_TMOUT_BOOT_QUICK = 7 * HZ, /* heuristic */
175 ATA_TMOUT_CDB = 30 * HZ,
176 ATA_TMOUT_CDB_QUICK = 5 * HZ,
177 ATA_TMOUT_INTERNAL = 30 * HZ, 187 ATA_TMOUT_INTERNAL = 30 * HZ,
178 ATA_TMOUT_INTERNAL_QUICK = 5 * HZ, 188 ATA_TMOUT_INTERNAL_QUICK = 5 * HZ,
179 189
@@ -217,19 +227,39 @@ enum {
217 ATA_PORT_PRIMARY = (1 << 0), 227 ATA_PORT_PRIMARY = (1 << 0),
218 ATA_PORT_SECONDARY = (1 << 1), 228 ATA_PORT_SECONDARY = (1 << 1),
219 229
230 /* ering size */
231 ATA_ERING_SIZE = 32,
232
233 /* desc_len for ata_eh_info and context */
234 ATA_EH_DESC_LEN = 80,
235
236 /* reset / recovery action types */
237 ATA_EH_REVALIDATE = (1 << 0),
238 ATA_EH_SOFTRESET = (1 << 1),
239 ATA_EH_HARDRESET = (1 << 2),
240
241 ATA_EH_RESET_MASK = ATA_EH_SOFTRESET | ATA_EH_HARDRESET,
242
243 /* ata_eh_info->flags */
244 ATA_EHI_DID_RESET = (1 << 0), /* already reset this port */
245
246 /* max repeat if error condition is still set after ->error_handler */
247 ATA_EH_MAX_REPEAT = 5,
248
220 /* how hard are we gonna try to probe/recover devices */ 249 /* how hard are we gonna try to probe/recover devices */
221 ATA_PROBE_MAX_TRIES = 3, 250 ATA_PROBE_MAX_TRIES = 3,
251 ATA_EH_RESET_TRIES = 3,
252 ATA_EH_DEV_TRIES = 3,
222}; 253};
223 254
224enum hsm_task_states { 255enum hsm_task_states {
225 HSM_ST_UNKNOWN, 256 HSM_ST_UNKNOWN, /* state unknown */
226 HSM_ST_IDLE, 257 HSM_ST_IDLE, /* no command on going */
227 HSM_ST_POLL, 258 HSM_ST, /* (waiting the device to) transfer data */
228 HSM_ST_TMOUT, 259 HSM_ST_LAST, /* (waiting the device to) complete command */
229 HSM_ST, 260 HSM_ST_ERR, /* error */
230 HSM_ST_LAST, 261 HSM_ST_FIRST, /* (waiting the device to)
231 HSM_ST_LAST_POLL, 262 write CDB or first data block */
232 HSM_ST_ERR,
233}; 263};
234 264
235enum ata_completion_errors { 265enum ata_completion_errors {
@@ -344,7 +374,7 @@ struct ata_queued_cmd {
344 struct scatterlist *__sg; 374 struct scatterlist *__sg;
345 375
346 unsigned int err_mask; 376 unsigned int err_mask;
347 377 struct ata_taskfile result_tf;
348 ata_qc_cb_t complete_fn; 378 ata_qc_cb_t complete_fn;
349 379
350 void *private_data; 380 void *private_data;
@@ -356,12 +386,24 @@ struct ata_host_stats {
356 unsigned long rw_reqbuf; 386 unsigned long rw_reqbuf;
357}; 387};
358 388
389struct ata_ering_entry {
390 int is_io;
391 unsigned int err_mask;
392 u64 timestamp;
393};
394
395struct ata_ering {
396 int cursor;
397 struct ata_ering_entry ring[ATA_ERING_SIZE];
398};
399
359struct ata_device { 400struct ata_device {
401 struct ata_port *ap;
360 u64 n_sectors; /* size of device, if ATA */ 402 u64 n_sectors; /* size of device, if ATA */
361 unsigned long flags; /* ATA_DFLAG_xxx */ 403 unsigned long flags; /* ATA_DFLAG_xxx */
362 unsigned int class; /* ATA_DEV_xxx */ 404 unsigned int class; /* ATA_DEV_xxx */
363 unsigned int devno; /* 0 or 1 */ 405 unsigned int devno; /* 0 or 1 */
364 u16 *id; /* IDENTIFY xxx DEVICE data */ 406 u16 id[ATA_ID_WORDS]; /* IDENTIFY xxx DEVICE data */
365 u8 pio_mode; 407 u8 pio_mode;
366 u8 dma_mode; 408 u8 dma_mode;
367 u8 xfer_mode; 409 u8 xfer_mode;
@@ -381,6 +423,24 @@ struct ata_device {
381 u16 cylinders; /* Number of cylinders */ 423 u16 cylinders; /* Number of cylinders */
382 u16 heads; /* Number of heads */ 424 u16 heads; /* Number of heads */
383 u16 sectors; /* Number of sectors per track */ 425 u16 sectors; /* Number of sectors per track */
426
427 /* error history */
428 struct ata_ering ering;
429};
430
431struct ata_eh_info {
432 struct ata_device *dev; /* offending device */
433 u32 serror; /* SError from LLDD */
434 unsigned int err_mask; /* port-wide err_mask */
435 unsigned int action; /* ATA_EH_* action mask */
436 unsigned int flags; /* ATA_EHI_* flags */
437 char desc[ATA_EH_DESC_LEN];
438 int desc_len;
439};
440
441struct ata_eh_context {
442 struct ata_eh_info i;
443 int tries[ATA_MAX_DEVICES];
384}; 444};
385 445
386struct ata_port { 446struct ata_port {
@@ -407,11 +467,19 @@ struct ata_port {
407 unsigned int cbl; /* cable type; ATA_CBL_xxx */ 467 unsigned int cbl; /* cable type; ATA_CBL_xxx */
408 unsigned int sata_spd_limit; /* SATA PHY speed limit */ 468 unsigned int sata_spd_limit; /* SATA PHY speed limit */
409 469
470 /* record runtime error info, protected by host_set lock */
471 struct ata_eh_info eh_info;
472 /* EH context owned by EH */
473 struct ata_eh_context eh_context;
474
410 struct ata_device device[ATA_MAX_DEVICES]; 475 struct ata_device device[ATA_MAX_DEVICES];
411 476
412 struct ata_queued_cmd qcmd[ATA_MAX_QUEUE]; 477 struct ata_queued_cmd qcmd[ATA_MAX_QUEUE];
413 unsigned long qactive; 478 unsigned long qc_allocated;
479 unsigned int qc_active;
480
414 unsigned int active_tag; 481 unsigned int active_tag;
482 u32 sactive;
415 483
416 struct ata_host_stats stats; 484 struct ata_host_stats stats;
417 struct ata_host_set *host_set; 485 struct ata_host_set *host_set;
@@ -420,12 +488,13 @@ struct ata_port {
420 struct work_struct port_task; 488 struct work_struct port_task;
421 489
422 unsigned int hsm_task_state; 490 unsigned int hsm_task_state;
423 unsigned long pio_task_timeout;
424 491
425 u32 msg_enable; 492 u32 msg_enable;
426 struct list_head eh_done_q; 493 struct list_head eh_done_q;
427 494
428 void *private_data; 495 void *private_data;
496
497 u8 sector_buf[ATA_SECT_SIZE]; /* owned by EH */
429}; 498};
430 499
431struct ata_port_operations { 500struct ata_port_operations {
@@ -459,7 +528,15 @@ struct ata_port_operations {
459 void (*qc_prep) (struct ata_queued_cmd *qc); 528 void (*qc_prep) (struct ata_queued_cmd *qc);
460 unsigned int (*qc_issue) (struct ata_queued_cmd *qc); 529 unsigned int (*qc_issue) (struct ata_queued_cmd *qc);
461 530
462 void (*eng_timeout) (struct ata_port *ap); 531 /* Error handlers. ->error_handler overrides ->eng_timeout and
532 * indicates that new-style EH is in place.
533 */
534 void (*eng_timeout) (struct ata_port *ap); /* obsolete */
535
536 void (*freeze) (struct ata_port *ap);
537 void (*thaw) (struct ata_port *ap);
538 void (*error_handler) (struct ata_port *ap);
539 void (*post_internal_cmd) (struct ata_queued_cmd *qc);
463 540
464 irqreturn_t (*irq_handler)(int, void *, struct pt_regs *); 541 irqreturn_t (*irq_handler)(int, void *, struct pt_regs *);
465 void (*irq_clear) (struct ata_port *); 542 void (*irq_clear) (struct ata_port *);
@@ -505,7 +582,7 @@ extern void ata_port_probe(struct ata_port *);
505extern void __sata_phy_reset(struct ata_port *ap); 582extern void __sata_phy_reset(struct ata_port *ap);
506extern void sata_phy_reset(struct ata_port *ap); 583extern void sata_phy_reset(struct ata_port *ap);
507extern void ata_bus_reset(struct ata_port *ap); 584extern void ata_bus_reset(struct ata_port *ap);
508extern int ata_set_sata_spd(struct ata_port *ap); 585extern int sata_set_spd(struct ata_port *ap);
509extern int ata_drive_probe_reset(struct ata_port *ap, 586extern int ata_drive_probe_reset(struct ata_port *ap,
510 ata_probeinit_fn_t probeinit, 587 ata_probeinit_fn_t probeinit,
511 ata_reset_fn_t softreset, ata_reset_fn_t hardreset, 588 ata_reset_fn_t softreset, ata_reset_fn_t hardreset,
@@ -514,8 +591,7 @@ extern void ata_std_probeinit(struct ata_port *ap);
514extern int ata_std_softreset(struct ata_port *ap, unsigned int *classes); 591extern int ata_std_softreset(struct ata_port *ap, unsigned int *classes);
515extern int sata_std_hardreset(struct ata_port *ap, unsigned int *class); 592extern int sata_std_hardreset(struct ata_port *ap, unsigned int *class);
516extern void ata_std_postreset(struct ata_port *ap, unsigned int *classes); 593extern void ata_std_postreset(struct ata_port *ap, unsigned int *classes);
517extern int ata_dev_revalidate(struct ata_port *ap, struct ata_device *dev, 594extern int ata_dev_revalidate(struct ata_device *dev, int post_reset);
518 int post_reset);
519extern void ata_port_disable(struct ata_port *); 595extern void ata_port_disable(struct ata_port *);
520extern void ata_std_ports(struct ata_ioports *ioaddr); 596extern void ata_std_ports(struct ata_ioports *ioaddr);
521#ifdef CONFIG_PCI 597#ifdef CONFIG_PCI
@@ -531,14 +607,18 @@ extern void ata_host_set_remove(struct ata_host_set *host_set);
531extern int ata_scsi_detect(struct scsi_host_template *sht); 607extern int ata_scsi_detect(struct scsi_host_template *sht);
532extern int ata_scsi_ioctl(struct scsi_device *dev, int cmd, void __user *arg); 608extern int ata_scsi_ioctl(struct scsi_device *dev, int cmd, void __user *arg);
533extern int ata_scsi_queuecmd(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *)); 609extern int ata_scsi_queuecmd(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmnd *));
534extern void ata_eh_qc_complete(struct ata_queued_cmd *qc);
535extern void ata_eh_qc_retry(struct ata_queued_cmd *qc);
536extern int ata_scsi_release(struct Scsi_Host *host); 610extern int ata_scsi_release(struct Scsi_Host *host);
537extern unsigned int ata_host_intr(struct ata_port *ap, struct ata_queued_cmd *qc); 611extern unsigned int ata_host_intr(struct ata_port *ap, struct ata_queued_cmd *qc);
612extern int sata_scr_valid(struct ata_port *ap);
613extern int sata_scr_read(struct ata_port *ap, int reg, u32 *val);
614extern int sata_scr_write(struct ata_port *ap, int reg, u32 val);
615extern int sata_scr_write_flush(struct ata_port *ap, int reg, u32 val);
616extern int ata_port_online(struct ata_port *ap);
617extern int ata_port_offline(struct ata_port *ap);
538extern int ata_scsi_device_resume(struct scsi_device *); 618extern int ata_scsi_device_resume(struct scsi_device *);
539extern int ata_scsi_device_suspend(struct scsi_device *, pm_message_t state); 619extern int ata_scsi_device_suspend(struct scsi_device *, pm_message_t state);
540extern int ata_device_resume(struct ata_port *, struct ata_device *); 620extern int ata_device_resume(struct ata_device *);
541extern int ata_device_suspend(struct ata_port *, struct ata_device *, pm_message_t state); 621extern int ata_device_suspend(struct ata_device *, pm_message_t state);
542extern int ata_ratelimit(void); 622extern int ata_ratelimit(void);
543extern unsigned int ata_busy_sleep(struct ata_port *ap, 623extern unsigned int ata_busy_sleep(struct ata_port *ap,
544 unsigned long timeout_pat, 624 unsigned long timeout_pat,
@@ -583,16 +663,26 @@ extern void ata_bmdma_start (struct ata_queued_cmd *qc);
583extern void ata_bmdma_stop(struct ata_queued_cmd *qc); 663extern void ata_bmdma_stop(struct ata_queued_cmd *qc);
584extern u8 ata_bmdma_status(struct ata_port *ap); 664extern u8 ata_bmdma_status(struct ata_port *ap);
585extern void ata_bmdma_irq_clear(struct ata_port *ap); 665extern void ata_bmdma_irq_clear(struct ata_port *ap);
586extern void __ata_qc_complete(struct ata_queued_cmd *qc); 666extern void ata_bmdma_freeze(struct ata_port *ap);
587extern void ata_scsi_simulate(struct ata_port *ap, struct ata_device *dev, 667extern void ata_bmdma_thaw(struct ata_port *ap);
588 struct scsi_cmnd *cmd, 668extern void ata_bmdma_drive_eh(struct ata_port *ap,
669 ata_reset_fn_t softreset,
670 ata_reset_fn_t hardreset,
671 ata_postreset_fn_t postreset);
672extern void ata_bmdma_error_handler(struct ata_port *ap);
673extern void ata_bmdma_post_internal_cmd(struct ata_queued_cmd *qc);
674extern void ata_qc_complete(struct ata_queued_cmd *qc);
675extern int ata_qc_complete_multiple(struct ata_port *ap, u32 qc_active,
676 void (*finish_qc)(struct ata_queued_cmd *));
677extern void ata_scsi_simulate(struct ata_device *dev, struct scsi_cmnd *cmd,
589 void (*done)(struct scsi_cmnd *)); 678 void (*done)(struct scsi_cmnd *));
590extern int ata_std_bios_param(struct scsi_device *sdev, 679extern int ata_std_bios_param(struct scsi_device *sdev,
591 struct block_device *bdev, 680 struct block_device *bdev,
592 sector_t capacity, int geom[]); 681 sector_t capacity, int geom[]);
593extern int ata_scsi_slave_config(struct scsi_device *sdev); 682extern int ata_scsi_slave_config(struct scsi_device *sdev);
594extern struct ata_device *ata_dev_pair(struct ata_port *ap, 683extern int ata_scsi_change_queue_depth(struct scsi_device *sdev,
595 struct ata_device *adev); 684 int queue_depth);
685extern struct ata_device *ata_dev_pair(struct ata_device *adev);
596 686
597/* 687/*
598 * Timing helpers 688 * Timing helpers
@@ -642,10 +732,46 @@ extern unsigned long ata_pci_default_filter(const struct ata_port *, struct ata_
642 * EH 732 * EH
643 */ 733 */
644extern void ata_eng_timeout(struct ata_port *ap); 734extern void ata_eng_timeout(struct ata_port *ap);
735
736extern void ata_port_schedule_eh(struct ata_port *ap);
737extern int ata_port_abort(struct ata_port *ap);
738extern int ata_port_freeze(struct ata_port *ap);
739
740extern void ata_eh_freeze_port(struct ata_port *ap);
741extern void ata_eh_thaw_port(struct ata_port *ap);
742
645extern void ata_eh_qc_complete(struct ata_queued_cmd *qc); 743extern void ata_eh_qc_complete(struct ata_queued_cmd *qc);
646extern void ata_eh_qc_retry(struct ata_queued_cmd *qc); 744extern void ata_eh_qc_retry(struct ata_queued_cmd *qc);
647 745
746extern void ata_do_eh(struct ata_port *ap, ata_reset_fn_t softreset,
747 ata_reset_fn_t hardreset, ata_postreset_fn_t postreset);
748
749/*
750 * printk helpers
751 */
752#define ata_port_printk(ap, lv, fmt, args...) \
753 printk(lv"ata%u: "fmt, (ap)->id , ##args)
754
755#define ata_dev_printk(dev, lv, fmt, args...) \
756 printk(lv"ata%u.%02u: "fmt, (dev)->ap->id, (dev)->devno , ##args)
757
758/*
759 * ata_eh_info helpers
760 */
761#define ata_ehi_push_desc(ehi, fmt, args...) do { \
762 (ehi)->desc_len += scnprintf((ehi)->desc + (ehi)->desc_len, \
763 ATA_EH_DESC_LEN - (ehi)->desc_len, \
764 fmt , ##args); \
765} while (0)
766
767#define ata_ehi_clear_desc(ehi) do { \
768 (ehi)->desc[0] = '\0'; \
769 (ehi)->desc_len = 0; \
770} while (0)
648 771
772/*
773 * qc helpers
774 */
649static inline int 775static inline int
650ata_sg_is_last(struct scatterlist *sg, struct ata_queued_cmd *qc) 776ata_sg_is_last(struct scatterlist *sg, struct ata_queued_cmd *qc)
651{ 777{
@@ -688,6 +814,11 @@ static inline unsigned int ata_tag_valid(unsigned int tag)
688 return (tag < ATA_MAX_QUEUE) ? 1 : 0; 814 return (tag < ATA_MAX_QUEUE) ? 1 : 0;
689} 815}
690 816
817static inline unsigned int ata_tag_internal(unsigned int tag)
818{
819 return tag == ATA_MAX_QUEUE - 1;
820}
821
691static inline unsigned int ata_class_enabled(unsigned int class) 822static inline unsigned int ata_class_enabled(unsigned int class)
692{ 823{
693 return class == ATA_DEV_ATA || class == ATA_DEV_ATAPI; 824 return class == ATA_DEV_ATA || class == ATA_DEV_ATAPI;
@@ -796,20 +927,35 @@ static inline void ata_qc_set_polling(struct ata_queued_cmd *qc)
796 qc->tf.ctl |= ATA_NIEN; 927 qc->tf.ctl |= ATA_NIEN;
797} 928}
798 929
799static inline struct ata_queued_cmd *ata_qc_from_tag (struct ata_port *ap, 930static inline struct ata_queued_cmd *__ata_qc_from_tag(struct ata_port *ap,
800 unsigned int tag) 931 unsigned int tag)
801{ 932{
802 if (likely(ata_tag_valid(tag))) 933 if (likely(ata_tag_valid(tag)))
803 return &ap->qcmd[tag]; 934 return &ap->qcmd[tag];
804 return NULL; 935 return NULL;
805} 936}
806 937
807static inline void ata_tf_init(struct ata_port *ap, struct ata_taskfile *tf, unsigned int device) 938static inline struct ata_queued_cmd *ata_qc_from_tag(struct ata_port *ap,
939 unsigned int tag)
940{
941 struct ata_queued_cmd *qc = __ata_qc_from_tag(ap, tag);
942
943 if (unlikely(!qc) || !ap->ops->error_handler)
944 return qc;
945
946 if ((qc->flags & (ATA_QCFLAG_ACTIVE |
947 ATA_QCFLAG_FAILED)) == ATA_QCFLAG_ACTIVE)
948 return qc;
949
950 return NULL;
951}
952
953static inline void ata_tf_init(struct ata_device *dev, struct ata_taskfile *tf)
808{ 954{
809 memset(tf, 0, sizeof(*tf)); 955 memset(tf, 0, sizeof(*tf));
810 956
811 tf->ctl = ap->ctl; 957 tf->ctl = dev->ap->ctl;
812 if (device == 0) 958 if (dev->devno == 0)
813 tf->device = ATA_DEVICE_OBS; 959 tf->device = ATA_DEVICE_OBS;
814 else 960 else
815 tf->device = ATA_DEVICE_OBS | ATA_DEV1; 961 tf->device = ATA_DEVICE_OBS | ATA_DEV1;
@@ -824,26 +970,11 @@ static inline void ata_qc_reinit(struct ata_queued_cmd *qc)
824 qc->nbytes = qc->curbytes = 0; 970 qc->nbytes = qc->curbytes = 0;
825 qc->err_mask = 0; 971 qc->err_mask = 0;
826 972
827 ata_tf_init(qc->ap, &qc->tf, qc->dev->devno); 973 ata_tf_init(qc->dev, &qc->tf);
828}
829 974
830/** 975 /* init result_tf such that it indicates normal completion */
831 * ata_qc_complete - Complete an active ATA command 976 qc->result_tf.command = ATA_DRDY;
832 * @qc: Command to complete 977 qc->result_tf.feature = 0;
833 * @err_mask: ATA Status register contents
834 *
835 * Indicate to the mid and upper layers that an ATA
836 * command has completed, with either an ok or not-ok status.
837 *
838 * LOCKING:
839 * spin_lock_irqsave(host_set lock)
840 */
841static inline void ata_qc_complete(struct ata_queued_cmd *qc)
842{
843 if (unlikely(qc->flags & ATA_QCFLAG_EH_SCHEDULED))
844 return;
845
846 __ata_qc_complete(qc);
847} 978}
848 979
849/** 980/**
@@ -922,28 +1053,6 @@ static inline u8 ata_irq_ack(struct ata_port *ap, unsigned int chk_drq)
922 return status; 1053 return status;
923} 1054}
924 1055
925static inline u32 scr_read(struct ata_port *ap, unsigned int reg)
926{
927 return ap->ops->scr_read(ap, reg);
928}
929
930static inline void scr_write(struct ata_port *ap, unsigned int reg, u32 val)
931{
932 ap->ops->scr_write(ap, reg, val);
933}
934
935static inline void scr_write_flush(struct ata_port *ap, unsigned int reg,
936 u32 val)
937{
938 ap->ops->scr_write(ap, reg, val);
939 (void) ap->ops->scr_read(ap, reg);
940}
941
942static inline unsigned int sata_dev_present(struct ata_port *ap)
943{
944 return ((scr_read(ap, SCR_STATUS) & 0xf) == 0x3) ? 1 : 0;
945}
946
947static inline int ata_try_flush_cache(const struct ata_device *dev) 1056static inline int ata_try_flush_cache(const struct ata_device *dev)
948{ 1057{
949 return ata_id_wcache_enabled(dev->id) || 1058 return ata_id_wcache_enabled(dev->id) ||
diff --git a/include/linux/list.h b/include/linux/list.h
index 67258b47e9ca..76f05718342c 100644
--- a/include/linux/list.h
+++ b/include/linux/list.h
@@ -619,7 +619,7 @@ static inline void hlist_del_rcu(struct hlist_node *n)
619 619
620static inline void hlist_del_init(struct hlist_node *n) 620static inline void hlist_del_init(struct hlist_node *n)
621{ 621{
622 if (n->pprev) { 622 if (!hlist_unhashed(n)) {
623 __hlist_del(n); 623 __hlist_del(n);
624 INIT_HLIST_NODE(n); 624 INIT_HLIST_NODE(n);
625 } 625 }
diff --git a/include/linux/mmc/card.h b/include/linux/mmc/card.h
index 30dd978c1ec8..991a37382a22 100644
--- a/include/linux/mmc/card.h
+++ b/include/linux/mmc/card.h
@@ -28,6 +28,7 @@ struct mmc_csd {
28 unsigned short cmdclass; 28 unsigned short cmdclass;
29 unsigned short tacc_clks; 29 unsigned short tacc_clks;
30 unsigned int tacc_ns; 30 unsigned int tacc_ns;
31 unsigned int r2w_factor;
31 unsigned int max_dtr; 32 unsigned int max_dtr;
32 unsigned int read_blkbits; 33 unsigned int read_blkbits;
33 unsigned int write_blkbits; 34 unsigned int write_blkbits;
diff --git a/include/linux/mod_devicetable.h b/include/linux/mod_devicetable.h
index 7b08c11ec4cc..f6977708585c 100644
--- a/include/linux/mod_devicetable.h
+++ b/include/linux/mod_devicetable.h
@@ -249,4 +249,52 @@ struct i2c_device_id {
249 __u16 id; 249 __u16 id;
250}; 250};
251 251
252/* Input */
253#define INPUT_DEVICE_ID_EV_MAX 0x1f
254#define INPUT_DEVICE_ID_KEY_MAX 0x1ff
255#define INPUT_DEVICE_ID_REL_MAX 0x0f
256#define INPUT_DEVICE_ID_ABS_MAX 0x3f
257#define INPUT_DEVICE_ID_MSC_MAX 0x07
258#define INPUT_DEVICE_ID_LED_MAX 0x0f
259#define INPUT_DEVICE_ID_SND_MAX 0x07
260#define INPUT_DEVICE_ID_FF_MAX 0x7f
261#define INPUT_DEVICE_ID_SW_MAX 0x0f
262
263#define INPUT_DEVICE_ID_MATCH_BUS 1
264#define INPUT_DEVICE_ID_MATCH_VENDOR 2
265#define INPUT_DEVICE_ID_MATCH_PRODUCT 4
266#define INPUT_DEVICE_ID_MATCH_VERSION 8
267
268#define INPUT_DEVICE_ID_MATCH_EVBIT 0x0010
269#define INPUT_DEVICE_ID_MATCH_KEYBIT 0x0020
270#define INPUT_DEVICE_ID_MATCH_RELBIT 0x0040
271#define INPUT_DEVICE_ID_MATCH_ABSBIT 0x0080
272#define INPUT_DEVICE_ID_MATCH_MSCIT 0x0100
273#define INPUT_DEVICE_ID_MATCH_LEDBIT 0x0200
274#define INPUT_DEVICE_ID_MATCH_SNDBIT 0x0400
275#define INPUT_DEVICE_ID_MATCH_FFBIT 0x0800
276#define INPUT_DEVICE_ID_MATCH_SWBIT 0x1000
277
278struct input_device_id {
279
280 kernel_ulong_t flags;
281
282 __u16 bustype;
283 __u16 vendor;
284 __u16 product;
285 __u16 version;
286
287 kernel_ulong_t evbit[INPUT_DEVICE_ID_EV_MAX / BITS_PER_LONG + 1];
288 kernel_ulong_t keybit[INPUT_DEVICE_ID_KEY_MAX / BITS_PER_LONG + 1];
289 kernel_ulong_t relbit[INPUT_DEVICE_ID_REL_MAX / BITS_PER_LONG + 1];
290 kernel_ulong_t absbit[INPUT_DEVICE_ID_ABS_MAX / BITS_PER_LONG + 1];
291 kernel_ulong_t mscbit[INPUT_DEVICE_ID_MSC_MAX / BITS_PER_LONG + 1];
292 kernel_ulong_t ledbit[INPUT_DEVICE_ID_LED_MAX / BITS_PER_LONG + 1];
293 kernel_ulong_t sndbit[INPUT_DEVICE_ID_SND_MAX / BITS_PER_LONG + 1];
294 kernel_ulong_t ffbit[INPUT_DEVICE_ID_FF_MAX / BITS_PER_LONG + 1];
295 kernel_ulong_t swbit[INPUT_DEVICE_ID_SW_MAX / BITS_PER_LONG + 1];
296
297 kernel_ulong_t driver_info;
298};
299
252#endif /* LINUX_MOD_DEVICETABLE_H */ 300#endif /* LINUX_MOD_DEVICETABLE_H */
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index 01db7b88a2b1..f4169bbb60eb 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -433,8 +433,7 @@ struct net_device
433 433
434 /* register/unregister state machine */ 434 /* register/unregister state machine */
435 enum { NETREG_UNINITIALIZED=0, 435 enum { NETREG_UNINITIALIZED=0,
436 NETREG_REGISTERING, /* called register_netdevice */ 436 NETREG_REGISTERED, /* completed register_netdevice */
437 NETREG_REGISTERED, /* completed register todo */
438 NETREG_UNREGISTERING, /* called unregister_netdevice */ 437 NETREG_UNREGISTERING, /* called unregister_netdevice */
439 NETREG_UNREGISTERED, /* completed unregister todo */ 438 NETREG_UNREGISTERED, /* completed unregister todo */
440 NETREG_RELEASED, /* called free_netdev */ 439 NETREG_RELEASED, /* called free_netdev */
@@ -506,6 +505,8 @@ struct net_device
506 505
507 /* class/net/name entry */ 506 /* class/net/name entry */
508 struct class_device class_dev; 507 struct class_device class_dev;
508 /* space for optional statistics and wireless sysfs groups */
509 struct attribute_group *sysfs_groups[3];
509}; 510};
510 511
511#define NETDEV_ALIGN 32 512#define NETDEV_ALIGN 32
@@ -829,21 +830,19 @@ static inline void netif_rx_schedule(struct net_device *dev)
829 __netif_rx_schedule(dev); 830 __netif_rx_schedule(dev);
830} 831}
831 832
832 833/* Try to reschedule poll. Called by dev->poll() after netif_rx_complete().
833static inline void __netif_rx_reschedule(struct net_device *dev, int undo) 834 * Do not inline this?
834{ 835 */
835 dev->quota += undo;
836 list_add_tail(&dev->poll_list, &__get_cpu_var(softnet_data).poll_list);
837 __raise_softirq_irqoff(NET_RX_SOFTIRQ);
838}
839
840/* Try to reschedule poll. Called by dev->poll() after netif_rx_complete(). */
841static inline int netif_rx_reschedule(struct net_device *dev, int undo) 836static inline int netif_rx_reschedule(struct net_device *dev, int undo)
842{ 837{
843 if (netif_rx_schedule_prep(dev)) { 838 if (netif_rx_schedule_prep(dev)) {
844 unsigned long flags; 839 unsigned long flags;
840
841 dev->quota += undo;
842
845 local_irq_save(flags); 843 local_irq_save(flags);
846 __netif_rx_reschedule(dev, undo); 844 list_add_tail(&dev->poll_list, &__get_cpu_var(softnet_data).poll_list);
845 __raise_softirq_irqoff(NET_RX_SOFTIRQ);
847 local_irq_restore(flags); 846 local_irq_restore(flags);
848 return 1; 847 return 1;
849 } 848 }
diff --git a/include/linux/netfilter/x_tables.h b/include/linux/netfilter/x_tables.h
index 38701454e197..48cc32d83f77 100644
--- a/include/linux/netfilter/x_tables.h
+++ b/include/linux/netfilter/x_tables.h
@@ -337,6 +337,10 @@ struct compat_xt_entry_match
337 char name[XT_FUNCTION_MAXNAMELEN - 1]; 337 char name[XT_FUNCTION_MAXNAMELEN - 1];
338 u_int8_t revision; 338 u_int8_t revision;
339 } user; 339 } user;
340 struct {
341 u_int16_t match_size;
342 compat_uptr_t match;
343 } kernel;
340 u_int16_t match_size; 344 u_int16_t match_size;
341 } u; 345 } u;
342 unsigned char data[0]; 346 unsigned char data[0];
@@ -350,6 +354,10 @@ struct compat_xt_entry_target
350 char name[XT_FUNCTION_MAXNAMELEN - 1]; 354 char name[XT_FUNCTION_MAXNAMELEN - 1];
351 u_int8_t revision; 355 u_int8_t revision;
352 } user; 356 } user;
357 struct {
358 u_int16_t target_size;
359 compat_uptr_t target;
360 } kernel;
353 u_int16_t target_size; 361 u_int16_t target_size;
354 } u; 362 } u;
355 unsigned char data[0]; 363 unsigned char data[0];
diff --git a/include/linux/netfilter_ipv4/ip_conntrack_helper_h323_asn1.h b/include/linux/netfilter_ipv4/ip_conntrack_helper_h323_asn1.h
index 0bd828081c0c..c6e9a0b6d30b 100644
--- a/include/linux/netfilter_ipv4/ip_conntrack_helper_h323_asn1.h
+++ b/include/linux/netfilter_ipv4/ip_conntrack_helper_h323_asn1.h
@@ -2,7 +2,7 @@
2 * ip_conntrack_helper_h323_asn1.h - BER and PER decoding library for H.323 2 * ip_conntrack_helper_h323_asn1.h - BER and PER decoding library for H.323
3 * conntrack/NAT module. 3 * conntrack/NAT module.
4 * 4 *
5 * Copyright (c) 2006 by Jing Min Zhao <zhaojingmin@hotmail.com> 5 * Copyright (c) 2006 by Jing Min Zhao <zhaojingmin@users.sourceforge.net>
6 * 6 *
7 * This source code is licensed under General Public License version 2. 7 * This source code is licensed under General Public License version 2.
8 * 8 *
diff --git a/include/linux/netlink.h b/include/linux/netlink.h
index f8f3d1c927f8..87b8a5703ebc 100644
--- a/include/linux/netlink.h
+++ b/include/linux/netlink.h
@@ -143,6 +143,7 @@ struct netlink_skb_parms
143 __u32 dst_group; 143 __u32 dst_group;
144 kernel_cap_t eff_cap; 144 kernel_cap_t eff_cap;
145 __u32 loginuid; /* Login (audit) uid */ 145 __u32 loginuid; /* Login (audit) uid */
146 __u32 sid; /* SELinux security id */
146}; 147};
147 148
148#define NETLINK_CB(skb) (*(struct netlink_skb_parms*)&((skb)->cb)) 149#define NETLINK_CB(skb) (*(struct netlink_skb_parms*)&((skb)->cb))
diff --git a/include/linux/pagemap.h b/include/linux/pagemap.h
index 9539efd4f7e6..7a1af574dedf 100644
--- a/include/linux/pagemap.h
+++ b/include/linux/pagemap.h
@@ -78,6 +78,8 @@ extern struct page * find_or_create_page(struct address_space *mapping,
78 unsigned long index, gfp_t gfp_mask); 78 unsigned long index, gfp_t gfp_mask);
79unsigned find_get_pages(struct address_space *mapping, pgoff_t start, 79unsigned find_get_pages(struct address_space *mapping, pgoff_t start,
80 unsigned int nr_pages, struct page **pages); 80 unsigned int nr_pages, struct page **pages);
81unsigned find_get_pages_contig(struct address_space *mapping, pgoff_t start,
82 unsigned int nr_pages, struct page **pages);
81unsigned find_get_pages_tag(struct address_space *mapping, pgoff_t *index, 83unsigned find_get_pages_tag(struct address_space *mapping, pgoff_t *index,
82 int tag, unsigned int nr_pages, struct page **pages); 84 int tag, unsigned int nr_pages, struct page **pages);
83 85
diff --git a/include/linux/pipe_fs_i.h b/include/linux/pipe_fs_i.h
index 0008d4bd4059..ea4f7cd7bfd8 100644
--- a/include/linux/pipe_fs_i.h
+++ b/include/linux/pipe_fs_i.h
@@ -5,8 +5,9 @@
5 5
6#define PIPE_BUFFERS (16) 6#define PIPE_BUFFERS (16)
7 7
8#define PIPE_BUF_FLAG_STOLEN 0x01 8#define PIPE_BUF_FLAG_LRU 0x01 /* page is on the LRU */
9#define PIPE_BUF_FLAG_LRU 0x02 9#define PIPE_BUF_FLAG_ATOMIC 0x02 /* was atomically mapped */
10#define PIPE_BUF_FLAG_GIFT 0x04 /* page is a gift */
10 11
11struct pipe_buffer { 12struct pipe_buffer {
12 struct page *page; 13 struct page *page;
@@ -15,10 +16,23 @@ struct pipe_buffer {
15 unsigned int flags; 16 unsigned int flags;
16}; 17};
17 18
19/*
20 * Note on the nesting of these functions:
21 *
22 * ->pin()
23 * ->steal()
24 * ...
25 * ->map()
26 * ...
27 * ->unmap()
28 *
29 * That is, ->map() must be called on a pinned buffer, same goes for ->steal().
30 */
18struct pipe_buf_operations { 31struct pipe_buf_operations {
19 int can_merge; 32 int can_merge;
20 void * (*map)(struct file *, struct pipe_inode_info *, struct pipe_buffer *); 33 void * (*map)(struct pipe_inode_info *, struct pipe_buffer *, int);
21 void (*unmap)(struct pipe_inode_info *, struct pipe_buffer *); 34 void (*unmap)(struct pipe_inode_info *, struct pipe_buffer *, void *);
35 int (*pin)(struct pipe_inode_info *, struct pipe_buffer *);
22 void (*release)(struct pipe_inode_info *, struct pipe_buffer *); 36 void (*release)(struct pipe_inode_info *, struct pipe_buffer *);
23 int (*steal)(struct pipe_inode_info *, struct pipe_buffer *); 37 int (*steal)(struct pipe_inode_info *, struct pipe_buffer *);
24 void (*get)(struct pipe_inode_info *, struct pipe_buffer *); 38 void (*get)(struct pipe_inode_info *, struct pipe_buffer *);
@@ -51,6 +65,13 @@ struct pipe_inode_info * alloc_pipe_info(struct inode * inode);
51void free_pipe_info(struct inode * inode); 65void free_pipe_info(struct inode * inode);
52void __free_pipe_info(struct pipe_inode_info *); 66void __free_pipe_info(struct pipe_inode_info *);
53 67
68/* Generic pipe buffer ops functions */
69void *generic_pipe_buf_map(struct pipe_inode_info *, struct pipe_buffer *, int);
70void generic_pipe_buf_unmap(struct pipe_inode_info *, struct pipe_buffer *, void *);
71void generic_pipe_buf_get(struct pipe_inode_info *, struct pipe_buffer *);
72int generic_pipe_buf_pin(struct pipe_inode_info *, struct pipe_buffer *);
73int generic_pipe_buf_steal(struct pipe_inode_info *, struct pipe_buffer *);
74
54/* 75/*
55 * splice is tied to pipes as a transport (at least for now), so we'll just 76 * splice is tied to pipes as a transport (at least for now), so we'll just
56 * add the splice flags here. 77 * add the splice flags here.
@@ -60,6 +81,7 @@ void __free_pipe_info(struct pipe_inode_info *);
60 /* we may still block on the fd we splice */ 81 /* we may still block on the fd we splice */
61 /* from/to, of course */ 82 /* from/to, of course */
62#define SPLICE_F_MORE (0x04) /* expect more data */ 83#define SPLICE_F_MORE (0x04) /* expect more data */
84#define SPLICE_F_GIFT (0x08) /* pages passed in are a gift */
63 85
64/* 86/*
65 * Passed to the actors 87 * Passed to the actors
diff --git a/include/linux/security.h b/include/linux/security.h
index aaa0a5cdbf75..1bab48f6aeac 100644
--- a/include/linux/security.h
+++ b/include/linux/security.h
@@ -869,11 +869,6 @@ struct swap_info_struct;
869 * @ipcp contains the kernel IPC permission structure 869 * @ipcp contains the kernel IPC permission structure
870 * @flag contains the desired (requested) permission set 870 * @flag contains the desired (requested) permission set
871 * Return 0 if permission is granted. 871 * Return 0 if permission is granted.
872 * @ipc_getsecurity:
873 * Copy the security label associated with the ipc object into
874 * @buffer. @buffer may be NULL to request the size of the buffer
875 * required. @size indicates the size of @buffer in bytes. Return
876 * number of bytes used/required on success.
877 * 872 *
878 * Security hooks for individual messages held in System V IPC message queues 873 * Security hooks for individual messages held in System V IPC message queues
879 * @msg_msg_alloc_security: 874 * @msg_msg_alloc_security:
@@ -1223,7 +1218,6 @@ struct security_operations {
1223 void (*task_to_inode)(struct task_struct *p, struct inode *inode); 1218 void (*task_to_inode)(struct task_struct *p, struct inode *inode);
1224 1219
1225 int (*ipc_permission) (struct kern_ipc_perm * ipcp, short flag); 1220 int (*ipc_permission) (struct kern_ipc_perm * ipcp, short flag);
1226 int (*ipc_getsecurity)(struct kern_ipc_perm *ipcp, void *buffer, size_t size);
1227 1221
1228 int (*msg_msg_alloc_security) (struct msg_msg * msg); 1222 int (*msg_msg_alloc_security) (struct msg_msg * msg);
1229 void (*msg_msg_free_security) (struct msg_msg * msg); 1223 void (*msg_msg_free_security) (struct msg_msg * msg);
@@ -1887,11 +1881,6 @@ static inline int security_ipc_permission (struct kern_ipc_perm *ipcp,
1887 return security_ops->ipc_permission (ipcp, flag); 1881 return security_ops->ipc_permission (ipcp, flag);
1888} 1882}
1889 1883
1890static inline int security_ipc_getsecurity(struct kern_ipc_perm *ipcp, void *buffer, size_t size)
1891{
1892 return security_ops->ipc_getsecurity(ipcp, buffer, size);
1893}
1894
1895static inline int security_msg_msg_alloc (struct msg_msg * msg) 1884static inline int security_msg_msg_alloc (struct msg_msg * msg)
1896{ 1885{
1897 return security_ops->msg_msg_alloc_security (msg); 1886 return security_ops->msg_msg_alloc_security (msg);
@@ -2532,11 +2521,6 @@ static inline int security_ipc_permission (struct kern_ipc_perm *ipcp,
2532 return 0; 2521 return 0;
2533} 2522}
2534 2523
2535static inline int security_ipc_getsecurity(struct kern_ipc_perm *ipcp, void *buffer, size_t size)
2536{
2537 return -EOPNOTSUPP;
2538}
2539
2540static inline int security_msg_msg_alloc (struct msg_msg * msg) 2524static inline int security_msg_msg_alloc (struct msg_msg * msg)
2541{ 2525{
2542 return 0; 2526 return 0;
diff --git a/include/linux/selinux.h b/include/linux/selinux.h
new file mode 100644
index 000000000000..4047bcde4484
--- /dev/null
+++ b/include/linux/selinux.h
@@ -0,0 +1,177 @@
1/*
2 * SELinux services exported to the rest of the kernel.
3 *
4 * Author: James Morris <jmorris@redhat.com>
5 *
6 * Copyright (C) 2005 Red Hat, Inc., James Morris <jmorris@redhat.com>
7 * Copyright (C) 2006 Trusted Computer Solutions, Inc. <dgoeddel@trustedcs.com>
8 * Copyright (C) 2006 IBM Corporation, Timothy R. Chavez <tinytim@us.ibm.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,
12 * as published by the Free Software Foundation.
13 */
14#ifndef _LINUX_SELINUX_H
15#define _LINUX_SELINUX_H
16
17struct selinux_audit_rule;
18struct audit_context;
19struct inode;
20struct kern_ipc_perm;
21
22#ifdef CONFIG_SECURITY_SELINUX
23
24/**
25 * selinux_audit_rule_init - alloc/init an selinux audit rule structure.
26 * @field: the field this rule refers to
27 * @op: the operater the rule uses
28 * @rulestr: the text "target" of the rule
29 * @rule: pointer to the new rule structure returned via this
30 *
31 * Returns 0 if successful, -errno if not. On success, the rule structure
32 * will be allocated internally. The caller must free this structure with
33 * selinux_audit_rule_free() after use.
34 */
35int selinux_audit_rule_init(u32 field, u32 op, char *rulestr,
36 struct selinux_audit_rule **rule);
37
38/**
39 * selinux_audit_rule_free - free an selinux audit rule structure.
40 * @rule: pointer to the audit rule to be freed
41 *
42 * This will free all memory associated with the given rule.
43 * If @rule is NULL, no operation is performed.
44 */
45void selinux_audit_rule_free(struct selinux_audit_rule *rule);
46
47/**
48 * selinux_audit_rule_match - determine if a context ID matches a rule.
49 * @ctxid: the context ID to check
50 * @field: the field this rule refers to
51 * @op: the operater the rule uses
52 * @rule: pointer to the audit rule to check against
53 * @actx: the audit context (can be NULL) associated with the check
54 *
55 * Returns 1 if the context id matches the rule, 0 if it does not, and
56 * -errno on failure.
57 */
58int selinux_audit_rule_match(u32 ctxid, u32 field, u32 op,
59 struct selinux_audit_rule *rule,
60 struct audit_context *actx);
61
62/**
63 * selinux_audit_set_callback - set the callback for policy reloads.
64 * @callback: the function to call when the policy is reloaded
65 *
66 * This sets the function callback function that will update the rules
67 * upon policy reloads. This callback should rebuild all existing rules
68 * using selinux_audit_rule_init().
69 */
70void selinux_audit_set_callback(int (*callback)(void));
71
72/**
73 * selinux_task_ctxid - determine a context ID for a process.
74 * @tsk: the task object
75 * @ctxid: ID value returned via this
76 *
77 * On return, ctxid will contain an ID for the context. This value
78 * should only be used opaquely.
79 */
80void selinux_task_ctxid(struct task_struct *tsk, u32 *ctxid);
81
82/**
83 * selinux_ctxid_to_string - map a security context ID to a string
84 * @ctxid: security context ID to be converted.
85 * @ctx: address of context string to be returned
86 * @ctxlen: length of returned context string.
87 *
88 * Returns 0 if successful, -errno if not. On success, the context
89 * string will be allocated internally, and the caller must call
90 * kfree() on it after use.
91 */
92int selinux_ctxid_to_string(u32 ctxid, char **ctx, u32 *ctxlen);
93
94/**
95 * selinux_get_inode_sid - get the inode's security context ID
96 * @inode: inode structure to get the sid from.
97 * @sid: pointer to security context ID to be filled in.
98 *
99 * Returns nothing
100 */
101void selinux_get_inode_sid(const struct inode *inode, u32 *sid);
102
103/**
104 * selinux_get_ipc_sid - get the ipc security context ID
105 * @ipcp: ipc structure to get the sid from.
106 * @sid: pointer to security context ID to be filled in.
107 *
108 * Returns nothing
109 */
110void selinux_get_ipc_sid(const struct kern_ipc_perm *ipcp, u32 *sid);
111
112/**
113 * selinux_get_task_sid - return the SID of task
114 * @tsk: the task whose SID will be returned
115 * @sid: pointer to security context ID to be filled in.
116 *
117 * Returns nothing
118 */
119void selinux_get_task_sid(struct task_struct *tsk, u32 *sid);
120
121
122#else
123
124static inline int selinux_audit_rule_init(u32 field, u32 op,
125 char *rulestr,
126 struct selinux_audit_rule **rule)
127{
128 return -ENOTSUPP;
129}
130
131static inline void selinux_audit_rule_free(struct selinux_audit_rule *rule)
132{
133 return;
134}
135
136static inline int selinux_audit_rule_match(u32 ctxid, u32 field, u32 op,
137 struct selinux_audit_rule *rule,
138 struct audit_context *actx)
139{
140 return 0;
141}
142
143static inline void selinux_audit_set_callback(int (*callback)(void))
144{
145 return;
146}
147
148static inline void selinux_task_ctxid(struct task_struct *tsk, u32 *ctxid)
149{
150 *ctxid = 0;
151}
152
153static inline int selinux_ctxid_to_string(u32 ctxid, char **ctx, u32 *ctxlen)
154{
155 *ctx = NULL;
156 *ctxlen = 0;
157 return 0;
158}
159
160static inline void selinux_get_inode_sid(const struct inode *inode, u32 *sid)
161{
162 *sid = 0;
163}
164
165static inline void selinux_get_ipc_sid(const struct kern_ipc_perm *ipcp, u32 *sid)
166{
167 *sid = 0;
168}
169
170static inline void selinux_get_task_sid(struct task_struct *tsk, u32 *sid)
171{
172 *sid = 0;
173}
174
175#endif /* CONFIG_SECURITY_SELINUX */
176
177#endif /* _LINUX_SELINUX_H */
diff --git a/include/linux/serial_core.h b/include/linux/serial_core.h
index c32e60e79dea..bd14858121ea 100644
--- a/include/linux/serial_core.h
+++ b/include/linux/serial_core.h
@@ -254,6 +254,7 @@ struct uart_port {
254#define UPF_CONS_FLOW ((__force upf_t) (1 << 23)) 254#define UPF_CONS_FLOW ((__force upf_t) (1 << 23))
255#define UPF_SHARE_IRQ ((__force upf_t) (1 << 24)) 255#define UPF_SHARE_IRQ ((__force upf_t) (1 << 24))
256#define UPF_BOOT_AUTOCONF ((__force upf_t) (1 << 28)) 256#define UPF_BOOT_AUTOCONF ((__force upf_t) (1 << 28))
257#define UPF_DEAD ((__force upf_t) (1 << 30))
257#define UPF_IOREMAP ((__force upf_t) (1 << 31)) 258#define UPF_IOREMAP ((__force upf_t) (1 << 31))
258 259
259#define UPF_CHANGE_MASK ((__force upf_t) (0x17fff)) 260#define UPF_CHANGE_MASK ((__force upf_t) (0x17fff))
diff --git a/include/linux/signal.h b/include/linux/signal.h
index 162a8fd10b29..70739f51a09f 100644
--- a/include/linux/signal.h
+++ b/include/linux/signal.h
@@ -14,10 +14,12 @@
14 * 14 *
15 * SA_INTERRUPT is also used by the irq handling routines. 15 * SA_INTERRUPT is also used by the irq handling routines.
16 * SA_SHIRQ is for shared interrupt support on PCI and EISA. 16 * SA_SHIRQ is for shared interrupt support on PCI and EISA.
17 * SA_PROBEIRQ is set by callers when they expect sharing mismatches to occur
17 */ 18 */
18#define SA_PROBE SA_ONESHOT
19#define SA_SAMPLE_RANDOM SA_RESTART 19#define SA_SAMPLE_RANDOM SA_RESTART
20#define SA_SHIRQ 0x04000000 20#define SA_SHIRQ 0x04000000
21#define SA_PROBEIRQ 0x08000000
22
21/* 23/*
22 * As above, these correspond to the IORESOURCE_IRQ_* defines in 24 * As above, these correspond to the IORESOURCE_IRQ_* defines in
23 * linux/ioport.h to select the interrupt line behaviour. When 25 * linux/ioport.h to select the interrupt line behaviour. When
diff --git a/include/linux/spi/ads7846.h b/include/linux/spi/ads7846.h
index 72261e0f2ac1..adb3dafd33e9 100644
--- a/include/linux/spi/ads7846.h
+++ b/include/linux/spi/ads7846.h
@@ -14,5 +14,12 @@ struct ads7846_platform_data {
14 u16 x_min, x_max; 14 u16 x_min, x_max;
15 u16 y_min, y_max; 15 u16 y_min, y_max;
16 u16 pressure_min, pressure_max; 16 u16 pressure_min, pressure_max;
17
18 u16 debounce_max; /* max number of additional readings
19 * per sample */
20 u16 debounce_tol; /* tolerance used for filtering */
21 u16 debounce_rep; /* additional consecutive good readings
22 * required after the first two */
23 int (*get_pendown_state)(void);
17}; 24};
18 25