+static inline int atapi_cdb_len(u16 *dev_id)
+{
+ u16 tmp = dev_id[0] & 0x3;
+ switch (tmp) {
+ case 0: return 12;
+ case 1: return 16;
+ default: return -1;
+ }
+}
+
+static inline int is_atapi_taskfile(struct ata_taskfile *tf)
+{
+ return (tf->protocol == ATA_PROT_ATAPI) ||
+ (tf->protocol == ATA_PROT_ATAPI_NODATA) ||
+ (tf->protocol == ATA_PROT_ATAPI_DMA);
+}
+
+static inline int ata_ok(u8 status)
+{
+ return ((status & (ATA_BUSY | ATA_DRDY | ATA_DF | ATA_DRQ | ATA_ERR))
+ == ATA_DRDY);
+}
+