diff --git a/sys/dev/ata/ata-usb.c b/sys/dev/ata/ata-usb.c index f995b7c385b2..9f181ef63fa9 100644 --- a/sys/dev/ata/ata-usb.c +++ b/sys/dev/ata/ata-usb.c @@ -802,7 +802,8 @@ ata_usbchannel_end_transaction(struct ata_request *request) /* XXX SOS convert the request from the format used, only BBB for now*/ /* ATA/ATAPI IDENTIFY needs special treatment */ - if (request->u.atapi.ccb[0] == ATAPI_INQUIRY) { + if ((request->flags & ATA_R_ATAPI) && + (request->u.atapi.ccb[0] == ATAPI_INQUIRY)) { struct ata_device *atadev = device_get_softc(request->dev); struct atapi_inquiry *inquiry = (struct atapi_inquiry *)request->data; u_int16_t *ptr; @@ -823,7 +824,8 @@ ata_usbchannel_end_transaction(struct ata_request *request) *ptr = ntohs(*ptr); request->result = 0; } - if (request->u.atapi.ccb[0] == ATAPI_REQUEST_SENSE) + if ((request->flags & ATA_R_ATAPI) && + (request->u.atapi.ccb[0] == ATAPI_REQUEST_SENSE)) request->u.atapi.sense_key = request->u.atapi.sense_data.sense_key << 4; return ATA_OP_FINISHED; } diff --git a/sys/dev/ata/atapi-fd.c b/sys/dev/ata/atapi-fd.c index 78887c6cf68f..11b20e6ca12a 100644 --- a/sys/dev/ata/atapi-fd.c +++ b/sys/dev/ata/atapi-fd.c @@ -317,7 +317,7 @@ afd_sense(device_t dev) while ((error = afd_test_ready(dev)) && timeout--) { DELAY(100000); } - if (error == ENODEV) + if (error == EBUSY) return 1; /* The IOMEGA Clik! doesn't support reading the cap page, fake it */