aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/libata.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/libata.h')
-rw-r--r--include/linux/libata.h25
1 files changed, 3 insertions, 22 deletions
diff --git a/include/linux/libata.h b/include/linux/libata.h
index b064bfeb69ee..37ee881c42ac 100644
--- a/include/linux/libata.h
+++ b/include/linux/libata.h
@@ -350,7 +350,8 @@ enum {
350 ATAPI_READ = 0, /* READs */ 350 ATAPI_READ = 0, /* READs */
351 ATAPI_WRITE = 1, /* WRITEs */ 351 ATAPI_WRITE = 1, /* WRITEs */
352 ATAPI_READ_CD = 2, /* READ CD [MSF] */ 352 ATAPI_READ_CD = 2, /* READ CD [MSF] */
353 ATAPI_MISC = 3, /* the rest */ 353 ATAPI_PASS_THRU = 3, /* SAT pass-thru */
354 ATAPI_MISC = 4, /* the rest */
354}; 355};
355 356
356enum ata_xfer_mask { 357enum ata_xfer_mask {
@@ -849,6 +850,7 @@ extern unsigned int ata_dev_try_classify(struct ata_device *dev, int present,
849 */ 850 */
850extern void ata_tf_load(struct ata_port *ap, const struct ata_taskfile *tf); 851extern void ata_tf_load(struct ata_port *ap, const struct ata_taskfile *tf);
851extern void ata_tf_read(struct ata_port *ap, struct ata_taskfile *tf); 852extern void ata_tf_read(struct ata_port *ap, struct ata_taskfile *tf);
853extern int atapi_cmd_type(u8 opcode);
852extern void ata_tf_to_fis(const struct ata_taskfile *tf, 854extern void ata_tf_to_fis(const struct ata_taskfile *tf,
853 u8 pmp, int is_cmd, u8 *fis); 855 u8 pmp, int is_cmd, u8 *fis);
854extern void ata_tf_from_fis(const u8 *fis, struct ata_taskfile *tf); 856extern void ata_tf_from_fis(const u8 *fis, struct ata_taskfile *tf);
@@ -1379,27 +1381,6 @@ static inline int ata_try_flush_cache(const struct ata_device *dev)
1379 ata_id_has_flush_ext(dev->id); 1381 ata_id_has_flush_ext(dev->id);
1380} 1382}
1381 1383
1382static inline int atapi_cmd_type(u8 opcode)
1383{
1384 switch (opcode) {
1385 case GPCMD_READ_10:
1386 case GPCMD_READ_12:
1387 return ATAPI_READ;
1388
1389 case GPCMD_WRITE_10:
1390 case GPCMD_WRITE_12:
1391 case GPCMD_WRITE_AND_VERIFY_10:
1392 return ATAPI_WRITE;
1393
1394 case GPCMD_READ_CD:
1395 case GPCMD_READ_CD_MSF:
1396 return ATAPI_READ_CD;
1397
1398 default:
1399 return ATAPI_MISC;
1400 }
1401}
1402
1403static inline unsigned int ac_err_mask(u8 status) 1384static inline unsigned int ac_err_mask(u8 status)
1404{ 1385{
1405 if (status & (ATA_BUSY | ATA_DRQ)) 1386 if (status & (ATA_BUSY | ATA_DRQ))