aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/linux/ata.h12
-rw-r--r--include/linux/libata.h24
2 files changed, 22 insertions, 14 deletions
diff --git a/include/linux/ata.h b/include/linux/ata.h
index 312a2c0c64e6..206d859083ea 100644
--- a/include/linux/ata.h
+++ b/include/linux/ata.h
@@ -199,6 +199,7 @@ enum {
199 ATA_TFLAG_WRITE = (1 << 3), /* data dir: host->dev==1 (write) */ 199 ATA_TFLAG_WRITE = (1 << 3), /* data dir: host->dev==1 (write) */
200 ATA_TFLAG_LBA = (1 << 4), /* enable LBA */ 200 ATA_TFLAG_LBA = (1 << 4), /* enable LBA */
201 ATA_TFLAG_FUA = (1 << 5), /* enable FUA */ 201 ATA_TFLAG_FUA = (1 << 5), /* enable FUA */
202 ATA_TFLAG_POLLING = (1 << 6), /* set nIEN to 1 and use polling */
202}; 203};
203 204
204enum ata_tf_protocols { 205enum ata_tf_protocols {
@@ -272,6 +273,8 @@ struct ata_taskfile {
272 ((u64) (id)[(n) + 1] << 16) | \ 273 ((u64) (id)[(n) + 1] << 16) | \
273 ((u64) (id)[(n) + 0]) ) 274 ((u64) (id)[(n) + 0]) )
274 275
276#define ata_id_cdb_intr(id) (((id)[0] & 0x60) == 0x20)
277
275static inline unsigned int ata_id_major_version(const u16 *id) 278static inline unsigned int ata_id_major_version(const u16 *id)
276{ 279{
277 unsigned int mver; 280 unsigned int mver;
@@ -311,6 +314,15 @@ static inline int is_atapi_taskfile(const struct ata_taskfile *tf)
311 (tf->protocol == ATA_PROT_ATAPI_DMA); 314 (tf->protocol == ATA_PROT_ATAPI_DMA);
312} 315}
313 316
317static inline int is_multi_taskfile(struct ata_taskfile *tf)
318{
319 return (tf->command == ATA_CMD_READ_MULTI) ||
320 (tf->command == ATA_CMD_WRITE_MULTI) ||
321 (tf->command == ATA_CMD_READ_MULTI_EXT) ||
322 (tf->command == ATA_CMD_WRITE_MULTI_EXT) ||
323 (tf->command == ATA_CMD_WRITE_MULTI_FUA_EXT);
324}
325
314static inline int ata_ok(u8 status) 326static inline int ata_ok(u8 status)
315{ 327{
316 return ((status & (ATA_BUSY | ATA_DRDY | ATA_DF | ATA_DRQ | ATA_ERR)) 328 return ((status & (ATA_BUSY | ATA_DRDY | ATA_DF | ATA_DRQ | ATA_ERR))
diff --git a/include/linux/libata.h b/include/linux/libata.h
index 9fcc061e3adf..0eb71c1773a1 100644
--- a/include/linux/libata.h
+++ b/include/linux/libata.h
@@ -123,6 +123,7 @@ enum {
123 ATA_DFLAG_LBA48 = (1 << 0), /* device supports LBA48 */ 123 ATA_DFLAG_LBA48 = (1 << 0), /* device supports LBA48 */
124 ATA_DFLAG_PIO = (1 << 1), /* device currently in PIO mode */ 124 ATA_DFLAG_PIO = (1 << 1), /* device currently in PIO mode */
125 ATA_DFLAG_LBA = (1 << 2), /* device supports LBA */ 125 ATA_DFLAG_LBA = (1 << 2), /* device supports LBA */
126 ATA_DFLAG_CDB_INTR = (1 << 3), /* device asserts INTRQ when ready for CDB */
126 127
127 ATA_DEV_UNKNOWN = 0, /* unknown device */ 128 ATA_DEV_UNKNOWN = 0, /* unknown device */
128 ATA_DEV_ATA = 1, /* ATA device */ 129 ATA_DEV_ATA = 1, /* ATA device */
@@ -141,8 +142,8 @@ enum {
141 ATA_FLAG_MMIO = (1 << 6), /* use MMIO, not PIO */ 142 ATA_FLAG_MMIO = (1 << 6), /* use MMIO, not PIO */
142 ATA_FLAG_SATA_RESET = (1 << 7), /* (obsolete) use COMRESET */ 143 ATA_FLAG_SATA_RESET = (1 << 7), /* (obsolete) use COMRESET */
143 ATA_FLAG_PIO_DMA = (1 << 8), /* PIO cmds via DMA */ 144 ATA_FLAG_PIO_DMA = (1 << 8), /* PIO cmds via DMA */
144 ATA_FLAG_NOINTR = (1 << 9), /* FIXME: Remove this once 145 ATA_FLAG_PIO_POLLING = (1 << 9), /* use polling PIO if LLD
145 * proper HSM is in place. */ 146 * doesn't handle PIO interrupts */
146 ATA_FLAG_DEBUGMSG = (1 << 10), 147 ATA_FLAG_DEBUGMSG = (1 << 10),
147 ATA_FLAG_NO_ATAPI = (1 << 11), /* No ATAPI support */ 148 ATA_FLAG_NO_ATAPI = (1 << 11), /* No ATAPI support */
148 149
@@ -161,11 +162,8 @@ enum {
161 ATA_QCFLAG_EH_SCHEDULED = (1 << 5), /* EH scheduled */ 162 ATA_QCFLAG_EH_SCHEDULED = (1 << 5), /* EH scheduled */
162 163
163 /* various lengths of time */ 164 /* various lengths of time */
164 ATA_TMOUT_PIO = 30 * HZ,
165 ATA_TMOUT_BOOT = 30 * HZ, /* heuristic */ 165 ATA_TMOUT_BOOT = 30 * HZ, /* heuristic */
166 ATA_TMOUT_BOOT_QUICK = 7 * HZ, /* heuristic */ 166 ATA_TMOUT_BOOT_QUICK = 7 * HZ, /* heuristic */
167 ATA_TMOUT_CDB = 30 * HZ,
168 ATA_TMOUT_CDB_QUICK = 5 * HZ,
169 ATA_TMOUT_INTERNAL = 30 * HZ, 167 ATA_TMOUT_INTERNAL = 30 * HZ,
170 ATA_TMOUT_INTERNAL_QUICK = 5 * HZ, 168 ATA_TMOUT_INTERNAL_QUICK = 5 * HZ,
171 169
@@ -211,14 +209,13 @@ enum {
211}; 209};
212 210
213enum hsm_task_states { 211enum hsm_task_states {
214 HSM_ST_UNKNOWN, 212 HSM_ST_UNKNOWN, /* state unknown */
215 HSM_ST_IDLE, 213 HSM_ST_IDLE, /* no command on going */
216 HSM_ST_POLL, 214 HSM_ST, /* (waiting the device to) transfer data */
217 HSM_ST_TMOUT, 215 HSM_ST_LAST, /* (waiting the device to) complete command */
218 HSM_ST, 216 HSM_ST_ERR, /* error */
219 HSM_ST_LAST, 217 HSM_ST_FIRST, /* (waiting the device to)
220 HSM_ST_LAST_POLL, 218 write CDB or first data block */
221 HSM_ST_ERR,
222}; 219};
223 220
224enum ata_completion_errors { 221enum ata_completion_errors {
@@ -404,7 +401,6 @@ struct ata_port {
404 struct work_struct port_task; 401 struct work_struct port_task;
405 402
406 unsigned int hsm_task_state; 403 unsigned int hsm_task_state;
407 unsigned long pio_task_timeout;
408 404
409 u32 msg_enable; 405 u32 msg_enable;
410 struct list_head eh_done_q; 406 struct list_head eh_done_q;