Properly use the sense key info

This commit is contained in:
sos 2006-03-18 13:14:38 +00:00
parent 17d5388342
commit c1d9ed7049
2 changed files with 5 additions and 3 deletions

View File

@ -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;
}

View File

@ -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 */