Detection of an ATAPI taskfile is possible using a simple test
on existing information, so there is no need to cache this value
in a separate flag (ATA_QCFLAG_ATAPI). Instead, create and use
a new helper function is_atapi_taskfile().
if (cmd) {
if (unlikely(drv_stat & (ATA_ERR | ATA_BUSY | ATA_DRQ))) {
- if (qc->flags & ATA_QCFLAG_ATAPI)
+ if (is_atapi_taskfile(&qc->tf))
cmd->result = SAM_STAT_CHECK_CONDITION;
else
ata_to_sense_error(qc);
{
struct scsi_cmnd *cmd = qc->scsicmd;
- qc->flags |= ATA_QCFLAG_ATAPI;
-
qc->tf.flags |= ATA_TFLAG_ISADDR | ATA_TFLAG_DEVICE;
if (cmd->sc_data_direction == SCSI_DATA_WRITE) {
qc->tf.flags |= ATA_TFLAG_WRITE;
((u64) dev->id[(n) + 1] << 16) | \
((u64) dev->id[(n) + 0]) )
+static inline int is_atapi_taskfile(struct ata_taskfile *tf)
+{
+ return (tf->protocol == ATA_PROT_ATAPI) ||
+ (tf->protocol == ATA_PROT_ATAPI_DMA);
+}
+
#endif /* __LINUX_ATA_H__ */
ATA_QCFLAG_ACTIVE = (1 << 1), /* cmd not yet ack'd to scsi lyer */
ATA_QCFLAG_DMA = (1 << 2), /* data delivered via DMA */
- ATA_QCFLAG_ATAPI = (1 << 3), /* is ATAPI packet command? */
ATA_QCFLAG_SG = (1 << 4), /* have s/g table? */
/* various lengths of time */