aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux')
-rw-r--r--include/linux/ata.h11
-rw-r--r--include/linux/libata.h27
2 files changed, 26 insertions, 12 deletions
diff --git a/include/linux/ata.h b/include/linux/ata.h
index a8155ca4947f..8e88efc565be 100644
--- a/include/linux/ata.h
+++ b/include/linux/ata.h
@@ -197,6 +197,7 @@ enum {
197 ATA_TFLAG_WRITE = (1 << 3), /* data dir: host->dev==1 (write) */ 197 ATA_TFLAG_WRITE = (1 << 3), /* data dir: host->dev==1 (write) */
198 ATA_TFLAG_LBA = (1 << 4), /* enable LBA */ 198 ATA_TFLAG_LBA = (1 << 4), /* enable LBA */
199 ATA_TFLAG_FUA = (1 << 5), /* enable FUA */ 199 ATA_TFLAG_FUA = (1 << 5), /* enable FUA */
200 ATA_TFLAG_POLLING = (1 << 6), /* set nIEN to 1 and use polling */
200}; 201};
201 202
202enum ata_tf_protocols { 203enum ata_tf_protocols {
@@ -267,6 +268,8 @@ struct ata_taskfile {
267 ((u64) (id)[(n) + 1] << 16) | \ 268 ((u64) (id)[(n) + 1] << 16) | \
268 ((u64) (id)[(n) + 0]) ) 269 ((u64) (id)[(n) + 0]) )
269 270
271#define ata_id_cdb_intr(id) (((id)[0] & 0x60) == 0x20)
272
270static inline int ata_id_current_chs_valid(const u16 *id) 273static inline int ata_id_current_chs_valid(const u16 *id)
271{ 274{
272 /* For ATA-1 devices, if the INITIALIZE DEVICE PARAMETERS command 275 /* For ATA-1 devices, if the INITIALIZE DEVICE PARAMETERS command
@@ -296,6 +299,14 @@ static inline int is_atapi_taskfile(const struct ata_taskfile *tf)
296 (tf->protocol == ATA_PROT_ATAPI_DMA); 299 (tf->protocol == ATA_PROT_ATAPI_DMA);
297} 300}
298 301
302static inline int is_multi_taskfile(struct ata_taskfile *tf)
303{
304 return (tf->command == ATA_CMD_READ_MULTI) ||
305 (tf->command == ATA_CMD_WRITE_MULTI) ||
306 (tf->command == ATA_CMD_READ_MULTI_EXT) ||
307 (tf->command == ATA_CMD_WRITE_MULTI_EXT);
308}
309
299static inline int ata_ok(u8 status) 310static inline int ata_ok(u8 status)
300{ 311{
301 return ((status & (ATA_BUSY | ATA_DRDY | ATA_DF | ATA_DRQ | ATA_ERR)) 312 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 83a1f2ead861..9873f4c54f1e 100644
--- a/include/linux/libata.h
+++ b/include/linux/libata.h
@@ -124,6 +124,7 @@ enum {
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_LOCK_SECTORS = (1 << 2), /* don't adjust max_sectors */ 125 ATA_DFLAG_LOCK_SECTORS = (1 << 2), /* don't adjust max_sectors */
126 ATA_DFLAG_LBA = (1 << 3), /* device supports LBA */ 126 ATA_DFLAG_LBA = (1 << 3), /* device supports LBA */
127 ATA_DFLAG_CDB_INTR = (1 << 4), /* device asserts INTRQ when ready for CDB */
127 128
128 ATA_DEV_UNKNOWN = 0, /* unknown device */ 129 ATA_DEV_UNKNOWN = 0, /* unknown device */
129 ATA_DEV_ATA = 1, /* ATA device */ 130 ATA_DEV_ATA = 1, /* ATA device */
@@ -142,8 +143,8 @@ enum {
142 ATA_FLAG_MMIO = (1 << 6), /* use MMIO, not PIO */ 143 ATA_FLAG_MMIO = (1 << 6), /* use MMIO, not PIO */
143 ATA_FLAG_SATA_RESET = (1 << 7), /* (obsolete) use COMRESET */ 144 ATA_FLAG_SATA_RESET = (1 << 7), /* (obsolete) use COMRESET */
144 ATA_FLAG_PIO_DMA = (1 << 8), /* PIO cmds via DMA */ 145 ATA_FLAG_PIO_DMA = (1 << 8), /* PIO cmds via DMA */
145 ATA_FLAG_NOINTR = (1 << 9), /* FIXME: Remove this once 146 ATA_FLAG_PIO_POLLING = (1 << 9), /* use polling PIO if LLD
146 * proper HSM is in place. */ 147 * doesn't handle PIO interrupts */
147 ATA_FLAG_DEBUGMSG = (1 << 10), 148 ATA_FLAG_DEBUGMSG = (1 << 10),
148 ATA_FLAG_NO_ATAPI = (1 << 11), /* No ATAPI support */ 149 ATA_FLAG_NO_ATAPI = (1 << 11), /* No ATAPI support */
149 150
@@ -166,6 +167,8 @@ enum {
166 ATA_TMOUT_PIO = 30 * HZ, 167 ATA_TMOUT_PIO = 30 * HZ,
167 ATA_TMOUT_BOOT = 30 * HZ, /* heuristic */ 168 ATA_TMOUT_BOOT = 30 * HZ, /* heuristic */
168 ATA_TMOUT_BOOT_QUICK = 7 * HZ, /* heuristic */ 169 ATA_TMOUT_BOOT_QUICK = 7 * HZ, /* heuristic */
170 ATA_TMOUT_DATAOUT = 30 * HZ,
171 ATA_TMOUT_DATAOUT_QUICK = 5 * HZ,
169 ATA_TMOUT_CDB = 30 * HZ, 172 ATA_TMOUT_CDB = 30 * HZ,
170 ATA_TMOUT_CDB_QUICK = 5 * HZ, 173 ATA_TMOUT_CDB_QUICK = 5 * HZ,
171 ATA_TMOUT_INTERNAL = 30 * HZ, 174 ATA_TMOUT_INTERNAL = 30 * HZ,
@@ -205,14 +208,16 @@ enum {
205}; 208};
206 209
207enum hsm_task_states { 210enum hsm_task_states {
208 HSM_ST_UNKNOWN, 211 HSM_ST_UNKNOWN, /* state unknown */
209 HSM_ST_IDLE, 212 HSM_ST_IDLE, /* no command on going */
210 HSM_ST_POLL, 213 HSM_ST_POLL, /* same as HSM_ST, waits longer */
211 HSM_ST_TMOUT, 214 HSM_ST_TMOUT, /* timeout */
212 HSM_ST, 215 HSM_ST, /* (waiting the device to) transfer data */
213 HSM_ST_LAST, 216 HSM_ST_LAST, /* (waiting the device to) complete command */
214 HSM_ST_LAST_POLL, 217 HSM_ST_LAST_POLL, /* same as HSM_ST_LAST, waits longer */
215 HSM_ST_ERR, 218 HSM_ST_ERR, /* error */
219 HSM_ST_FIRST, /* (waiting the device to)
220 write CDB or first data block */
216}; 221};
217 222
218enum ata_completion_errors { 223enum ata_completion_errors {
@@ -388,8 +393,6 @@ struct ata_port {
388 struct ata_host_stats stats; 393 struct ata_host_stats stats;
389 struct ata_host_set *host_set; 394 struct ata_host_set *host_set;
390 395
391 struct work_struct packet_task;
392
393 struct work_struct pio_task; 396 struct work_struct pio_task;
394 unsigned int hsm_task_state; 397 unsigned int hsm_task_state;
395 unsigned long pio_task_timeout; 398 unsigned long pio_task_timeout;