aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
authorJeff Garzik <jgarzik@pobox.com>2005-10-09 11:16:14 -0400
committerJeff Garzik <jgarzik@pobox.com>2005-10-09 11:16:14 -0400
commitc4052da6f0c01a0b059d125d72bb934d0980b798 (patch)
treead50a17e4d14b8f6f1773158d956d424575d1712 /include/linux
parentcedc9a478d8c6265879dc3839ef3d4849a709184 (diff)
parent3d3467f0fdf61a421361c00cf84fcf0f1a6dc1e8 (diff)
Merge branch 'upstream'
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/ata.h20
-rw-r--r--include/linux/atmdev.h2
-rw-r--r--include/linux/bfs_fs.h42
-rw-r--r--include/linux/connector.h2
-rw-r--r--include/linux/libata.h34
-rw-r--r--include/linux/textsearch.h3
6 files changed, 65 insertions, 38 deletions
diff --git a/include/linux/ata.h b/include/linux/ata.h
index a5b74efab067..ecb7346d0c16 100644
--- a/include/linux/ata.h
+++ b/include/linux/ata.h
@@ -132,6 +132,7 @@ enum {
132 ATA_CMD_PACKET = 0xA0, 132 ATA_CMD_PACKET = 0xA0,
133 ATA_CMD_VERIFY = 0x40, 133 ATA_CMD_VERIFY = 0x40,
134 ATA_CMD_VERIFY_EXT = 0x42, 134 ATA_CMD_VERIFY_EXT = 0x42,
135 ATA_CMD_INIT_DEV_PARAMS = 0x91,
135 136
136 /* SETFEATURES stuff */ 137 /* SETFEATURES stuff */
137 SETFEATURES_XFER = 0x03, 138 SETFEATURES_XFER = 0x03,
@@ -146,14 +147,14 @@ enum {
146 XFER_MW_DMA_2 = 0x22, 147 XFER_MW_DMA_2 = 0x22,
147 XFER_MW_DMA_1 = 0x21, 148 XFER_MW_DMA_1 = 0x21,
148 XFER_MW_DMA_0 = 0x20, 149 XFER_MW_DMA_0 = 0x20,
150 XFER_SW_DMA_2 = 0x12,
151 XFER_SW_DMA_1 = 0x11,
152 XFER_SW_DMA_0 = 0x10,
149 XFER_PIO_4 = 0x0C, 153 XFER_PIO_4 = 0x0C,
150 XFER_PIO_3 = 0x0B, 154 XFER_PIO_3 = 0x0B,
151 XFER_PIO_2 = 0x0A, 155 XFER_PIO_2 = 0x0A,
152 XFER_PIO_1 = 0x09, 156 XFER_PIO_1 = 0x09,
153 XFER_PIO_0 = 0x08, 157 XFER_PIO_0 = 0x08,
154 XFER_SW_DMA_2 = 0x12,
155 XFER_SW_DMA_1 = 0x11,
156 XFER_SW_DMA_0 = 0x10,
157 XFER_PIO_SLOW = 0x00, 158 XFER_PIO_SLOW = 0x00,
158 159
159 /* ATAPI stuff */ 160 /* ATAPI stuff */
@@ -181,6 +182,7 @@ enum {
181 ATA_TFLAG_ISADDR = (1 << 1), /* enable r/w to nsect/lba regs */ 182 ATA_TFLAG_ISADDR = (1 << 1), /* enable r/w to nsect/lba regs */
182 ATA_TFLAG_DEVICE = (1 << 2), /* enable r/w to device reg */ 183 ATA_TFLAG_DEVICE = (1 << 2), /* enable r/w to device reg */
183 ATA_TFLAG_WRITE = (1 << 3), /* data dir: host->dev==1 (write) */ 184 ATA_TFLAG_WRITE = (1 << 3), /* data dir: host->dev==1 (write) */
185 ATA_TFLAG_LBA = (1 << 4), /* enable LBA */
184}; 186};
185 187
186enum ata_tf_protocols { 188enum ata_tf_protocols {
@@ -250,6 +252,18 @@ struct ata_taskfile {
250 ((u64) (id)[(n) + 1] << 16) | \ 252 ((u64) (id)[(n) + 1] << 16) | \
251 ((u64) (id)[(n) + 0]) ) 253 ((u64) (id)[(n) + 0]) )
252 254
255static inline int ata_id_current_chs_valid(u16 *id)
256{
257 /* For ATA-1 devices, if the INITIALIZE DEVICE PARAMETERS command
258 has not been issued to the device then the values of
259 id[54] to id[56] are vendor specific. */
260 return (id[53] & 0x01) && /* Current translation valid */
261 id[54] && /* cylinders in current translation */
262 id[55] && /* heads in current translation */
263 id[55] <= 16 &&
264 id[56]; /* sectors in current translation */
265}
266
253static inline int atapi_cdb_len(u16 *dev_id) 267static inline int atapi_cdb_len(u16 *dev_id)
254{ 268{
255 u16 tmp = dev_id[0] & 0x3; 269 u16 tmp = dev_id[0] & 0x3;
diff --git a/include/linux/atmdev.h b/include/linux/atmdev.h
index 9f374cfa1b05..f1fd849e5535 100644
--- a/include/linux/atmdev.h
+++ b/include/linux/atmdev.h
@@ -457,7 +457,7 @@ static inline void atm_dev_put(struct atm_dev *dev)
457 457
458int atm_charge(struct atm_vcc *vcc,int truesize); 458int atm_charge(struct atm_vcc *vcc,int truesize);
459struct sk_buff *atm_alloc_charge(struct atm_vcc *vcc,int pdu_size, 459struct sk_buff *atm_alloc_charge(struct atm_vcc *vcc,int pdu_size,
460 int gfp_flags); 460 unsigned int __nocast gfp_flags);
461int atm_pcr_goal(struct atm_trafprm *tp); 461int atm_pcr_goal(struct atm_trafprm *tp);
462 462
463void vcc_release_async(struct atm_vcc *vcc, int reply); 463void vcc_release_async(struct atm_vcc *vcc, int reply);
diff --git a/include/linux/bfs_fs.h b/include/linux/bfs_fs.h
index c1237aa92e38..8ed6dfdcd783 100644
--- a/include/linux/bfs_fs.h
+++ b/include/linux/bfs_fs.h
@@ -20,19 +20,19 @@
20 20
21/* BFS inode layout on disk */ 21/* BFS inode layout on disk */
22struct bfs_inode { 22struct bfs_inode {
23 __u16 i_ino; 23 __le16 i_ino;
24 __u16 i_unused; 24 __u16 i_unused;
25 __u32 i_sblock; 25 __le32 i_sblock;
26 __u32 i_eblock; 26 __le32 i_eblock;
27 __u32 i_eoffset; 27 __le32 i_eoffset;
28 __u32 i_vtype; 28 __le32 i_vtype;
29 __u32 i_mode; 29 __le32 i_mode;
30 __s32 i_uid; 30 __le32 i_uid;
31 __s32 i_gid; 31 __le32 i_gid;
32 __u32 i_nlink; 32 __le32 i_nlink;
33 __u32 i_atime; 33 __le32 i_atime;
34 __u32 i_mtime; 34 __le32 i_mtime;
35 __u32 i_ctime; 35 __le32 i_ctime;
36 __u32 i_padding[4]; 36 __u32 i_padding[4];
37}; 37};
38 38
@@ -41,17 +41,17 @@ struct bfs_inode {
41#define BFS_DIRS_PER_BLOCK 32 41#define BFS_DIRS_PER_BLOCK 32
42 42
43struct bfs_dirent { 43struct bfs_dirent {
44 __u16 ino; 44 __le16 ino;
45 char name[BFS_NAMELEN]; 45 char name[BFS_NAMELEN];
46}; 46};
47 47
48/* BFS superblock layout on disk */ 48/* BFS superblock layout on disk */
49struct bfs_super_block { 49struct bfs_super_block {
50 __u32 s_magic; 50 __le32 s_magic;
51 __u32 s_start; 51 __le32 s_start;
52 __u32 s_end; 52 __le32 s_end;
53 __s32 s_from; 53 __le32 s_from;
54 __s32 s_to; 54 __le32 s_to;
55 __s32 s_bfrom; 55 __s32 s_bfrom;
56 __s32 s_bto; 56 __s32 s_bto;
57 char s_fsname[6]; 57 char s_fsname[6];
@@ -66,15 +66,15 @@ struct bfs_super_block {
66#define BFS_INO2OFF(ino) \ 66#define BFS_INO2OFF(ino) \
67 ((__u32)(((ino) - BFS_ROOT_INO) * sizeof(struct bfs_inode)) + BFS_BSIZE) 67 ((__u32)(((ino) - BFS_ROOT_INO) * sizeof(struct bfs_inode)) + BFS_BSIZE)
68#define BFS_NZFILESIZE(ip) \ 68#define BFS_NZFILESIZE(ip) \
69 ((cpu_to_le32((ip)->i_eoffset) + 1) - cpu_to_le32((ip)->i_sblock) * BFS_BSIZE) 69 ((le32_to_cpu((ip)->i_eoffset) + 1) - le32_to_cpu((ip)->i_sblock) * BFS_BSIZE)
70 70
71#define BFS_FILESIZE(ip) \ 71#define BFS_FILESIZE(ip) \
72 ((ip)->i_sblock == 0 ? 0 : BFS_NZFILESIZE(ip)) 72 ((ip)->i_sblock == 0 ? 0 : BFS_NZFILESIZE(ip))
73 73
74#define BFS_FILEBLOCKS(ip) \ 74#define BFS_FILEBLOCKS(ip) \
75 ((ip)->i_sblock == 0 ? 0 : (cpu_to_le32((ip)->i_eblock) + 1) - cpu_to_le32((ip)->i_sblock)) 75 ((ip)->i_sblock == 0 ? 0 : (le32_to_cpu((ip)->i_eblock) + 1) - le32_to_cpu((ip)->i_sblock))
76#define BFS_UNCLEAN(bfs_sb, sb) \ 76#define BFS_UNCLEAN(bfs_sb, sb) \
77 ((cpu_to_le32(bfs_sb->s_from) != -1) && (cpu_to_le32(bfs_sb->s_to) != -1) && !(sb->s_flags & MS_RDONLY)) 77 ((le32_to_cpu(bfs_sb->s_from) != -1) && (le32_to_cpu(bfs_sb->s_to) != -1) && !(sb->s_flags & MS_RDONLY))
78 78
79 79
80#endif /* _LINUX_BFS_FS_H */ 80#endif /* _LINUX_BFS_FS_H */
diff --git a/include/linux/connector.h b/include/linux/connector.h
index 86d4b0a81713..96582c9911ac 100644
--- a/include/linux/connector.h
+++ b/include/linux/connector.h
@@ -149,7 +149,7 @@ struct cn_dev {
149 149
150int cn_add_callback(struct cb_id *, char *, void (*callback) (void *)); 150int cn_add_callback(struct cb_id *, char *, void (*callback) (void *));
151void cn_del_callback(struct cb_id *); 151void cn_del_callback(struct cb_id *);
152int cn_netlink_send(struct cn_msg *, u32, int); 152int cn_netlink_send(struct cn_msg *, u32, unsigned int __nocast);
153 153
154int cn_queue_add_callback(struct cn_queue_dev *dev, char *name, struct cb_id *id, void (*callback)(void *)); 154int cn_queue_add_callback(struct cn_queue_dev *dev, char *name, struct cb_id *id, void (*callback)(void *));
155void cn_queue_del_callback(struct cn_queue_dev *dev, struct cb_id *id); 155void cn_queue_del_callback(struct cn_queue_dev *dev, struct cb_id *id);
diff --git a/include/linux/libata.h b/include/linux/libata.h
index 3ab67622ef93..0f89f4121fa3 100644
--- a/include/linux/libata.h
+++ b/include/linux/libata.h
@@ -97,6 +97,7 @@ enum {
97 ATA_DFLAG_LBA48 = (1 << 0), /* device supports LBA48 */ 97 ATA_DFLAG_LBA48 = (1 << 0), /* device supports LBA48 */
98 ATA_DFLAG_PIO = (1 << 1), /* device currently in PIO mode */ 98 ATA_DFLAG_PIO = (1 << 1), /* device currently in PIO mode */
99 ATA_DFLAG_LOCK_SECTORS = (1 << 2), /* don't adjust max_sectors */ 99 ATA_DFLAG_LOCK_SECTORS = (1 << 2), /* don't adjust max_sectors */
100 ATA_DFLAG_LBA = (1 << 3), /* device supports LBA */
100 101
101 ATA_DEV_UNKNOWN = 0, /* unknown device */ 102 ATA_DEV_UNKNOWN = 0, /* unknown device */
102 ATA_DEV_ATA = 1, /* ATA device */ 103 ATA_DEV_ATA = 1, /* ATA device */
@@ -158,17 +159,21 @@ enum {
158 /* size of buffer to pad xfers ending on unaligned boundaries */ 159 /* size of buffer to pad xfers ending on unaligned boundaries */
159 ATA_DMA_PAD_SZ = 4, 160 ATA_DMA_PAD_SZ = 4,
160 ATA_DMA_PAD_BUF_SZ = ATA_DMA_PAD_SZ * ATA_MAX_QUEUE, 161 ATA_DMA_PAD_BUF_SZ = ATA_DMA_PAD_SZ * ATA_MAX_QUEUE,
162
163 /* Masks for port functions */
164 ATA_PORT_PRIMARY = (1 << 0),
165 ATA_PORT_SECONDARY = (1 << 1),
161}; 166};
162 167
163enum pio_task_states { 168enum hsm_task_states {
164 PIO_ST_UNKNOWN, 169 HSM_ST_UNKNOWN,
165 PIO_ST_IDLE, 170 HSM_ST_IDLE,
166 PIO_ST_POLL, 171 HSM_ST_POLL,
167 PIO_ST_TMOUT, 172 HSM_ST_TMOUT,
168 PIO_ST, 173 HSM_ST,
169 PIO_ST_LAST, 174 HSM_ST_LAST,
170 PIO_ST_LAST_POLL, 175 HSM_ST_LAST_POLL,
171 PIO_ST_ERR, 176 HSM_ST_ERR,
172}; 177};
173 178
174/* forward declarations */ 179/* forward declarations */
@@ -291,6 +296,11 @@ struct ata_device {
291 u8 xfer_protocol; /* taskfile xfer protocol */ 296 u8 xfer_protocol; /* taskfile xfer protocol */
292 u8 read_cmd; /* opcode to use on read */ 297 u8 read_cmd; /* opcode to use on read */
293 u8 write_cmd; /* opcode to use on write */ 298 u8 write_cmd; /* opcode to use on write */
299
300 /* for CHS addressing */
301 u16 cylinders; /* Number of cylinders */
302 u16 heads; /* Number of heads */
303 u16 sectors; /* Number of sectors per track */
294}; 304};
295 305
296struct ata_port { 306struct ata_port {
@@ -331,7 +341,7 @@ struct ata_port {
331 struct work_struct packet_task; 341 struct work_struct packet_task;
332 342
333 struct work_struct pio_task; 343 struct work_struct pio_task;
334 unsigned int pio_task_state; 344 unsigned int hsm_task_state;
335 unsigned long pio_task_timeout; 345 unsigned long pio_task_timeout;
336 346
337 void *private_data; 347 void *private_data;
@@ -412,6 +422,8 @@ extern int ata_scsi_queuecmd(struct scsi_cmnd *cmd, void (*done)(struct scsi_cmn
412extern int ata_scsi_error(struct Scsi_Host *host); 422extern int ata_scsi_error(struct Scsi_Host *host);
413extern int ata_scsi_release(struct Scsi_Host *host); 423extern int ata_scsi_release(struct Scsi_Host *host);
414extern unsigned int ata_host_intr(struct ata_port *ap, struct ata_queued_cmd *qc); 424extern unsigned int ata_host_intr(struct ata_port *ap, struct ata_queued_cmd *qc);
425extern int ata_ratelimit(void);
426
415/* 427/*
416 * Default driver ops implementations 428 * Default driver ops implementations
417 */ 429 */
@@ -464,7 +476,7 @@ struct pci_bits {
464 476
465extern void ata_pci_host_stop (struct ata_host_set *host_set); 477extern void ata_pci_host_stop (struct ata_host_set *host_set);
466extern struct ata_probe_ent * 478extern struct ata_probe_ent *
467ata_pci_init_native_mode(struct pci_dev *pdev, struct ata_port_info **port); 479ata_pci_init_native_mode(struct pci_dev *pdev, struct ata_port_info **port, int portmask);
468extern int pci_test_config_bits(struct pci_dev *pdev, struct pci_bits *bits); 480extern int pci_test_config_bits(struct pci_dev *pdev, struct pci_bits *bits);
469 481
470#endif /* CONFIG_PCI */ 482#endif /* CONFIG_PCI */
diff --git a/include/linux/textsearch.h b/include/linux/textsearch.h
index 941f45ac117a..1a4990e448e9 100644
--- a/include/linux/textsearch.h
+++ b/include/linux/textsearch.h
@@ -158,7 +158,8 @@ extern unsigned int textsearch_find_continuous(struct ts_config *,
158#define TS_PRIV_ALIGNTO 8 158#define TS_PRIV_ALIGNTO 8
159#define TS_PRIV_ALIGN(len) (((len) + TS_PRIV_ALIGNTO-1) & ~(TS_PRIV_ALIGNTO-1)) 159#define TS_PRIV_ALIGN(len) (((len) + TS_PRIV_ALIGNTO-1) & ~(TS_PRIV_ALIGNTO-1))
160 160
161static inline struct ts_config *alloc_ts_config(size_t payload, int gfp_mask) 161static inline struct ts_config *alloc_ts_config(size_t payload,
162 unsigned int __nocast gfp_mask)
162{ 163{
163 struct ts_config *conf; 164 struct ts_config *conf;
164 165