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.h25
2 files changed, 27 insertions, 10 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 7a54244d30aa..b3d4c906e242 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
@@ -165,6 +166,8 @@ enum {
165 ATA_TMOUT_PIO = 30 * HZ, 166 ATA_TMOUT_PIO = 30 * HZ,
166 ATA_TMOUT_BOOT = 30 * HZ, /* heuristic */ 167 ATA_TMOUT_BOOT = 30 * HZ, /* heuristic */
167 ATA_TMOUT_BOOT_QUICK = 7 * HZ, /* heuristic */ 168 ATA_TMOUT_BOOT_QUICK = 7 * HZ, /* heuristic */
169 ATA_TMOUT_DATAOUT = 30 * HZ,
170 ATA_TMOUT_DATAOUT_QUICK = 5 * HZ,
168 ATA_TMOUT_CDB = 30 * HZ, 171 ATA_TMOUT_CDB = 30 * HZ,
169 ATA_TMOUT_CDB_QUICK = 5 * HZ, 172 ATA_TMOUT_CDB_QUICK = 5 * HZ,
170 ATA_TMOUT_INTERNAL = 30 * HZ, 173 ATA_TMOUT_INTERNAL = 30 * HZ,
@@ -212,14 +215,16 @@ enum {
212}; 215};
213 216
214enum hsm_task_states { 217enum hsm_task_states {
215 HSM_ST_UNKNOWN, 218 HSM_ST_UNKNOWN, /* state unknown */
216 HSM_ST_IDLE, 219 HSM_ST_IDLE, /* no command on going */
217 HSM_ST_POLL, 220 HSM_ST_POLL, /* same as HSM_ST, waits longer */
218 HSM_ST_TMOUT, 221 HSM_ST_TMOUT, /* timeout */
219 HSM_ST, 222 HSM_ST, /* (waiting the device to) transfer data */
220 HSM_ST_LAST, 223 HSM_ST_LAST, /* (waiting the device to) complete command */
221 HSM_ST_LAST_POLL, 224 HSM_ST_LAST_POLL, /* same as HSM_ST_LAST, waits longer */
222 HSM_ST_ERR, 225 HSM_ST_ERR, /* error */
226 HSM_ST_FIRST, /* (waiting the device to)
227 write CDB or first data block */
223}; 228};
224 229
225enum ata_completion_errors { 230enum ata_completion_errors {