From c83c43b66e64ff1b769efd5f9009acd4481f73f9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=B8ren=20Schmidt?= Date: Tue, 1 Jun 2004 12:26:08 +0000 Subject: [PATCH] Use the right cmd+errorcode if we are in autosense/not. --- sys/dev/ata/ata-queue.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/sys/dev/ata/ata-queue.c b/sys/dev/ata/ata-queue.c index 4f642a07d79e..8b2b318cfaf6 100644 --- a/sys/dev/ata/ata-queue.c +++ b/sys/dev/ata/ata-queue.c @@ -393,7 +393,8 @@ ata_completed(void *context, int dummy) "\2NO_MEDIA\1ILLEGAL_LENGTH"); } - if (request->error & ATA_E_MASK) + if ((request->u.atapi.sense_key ? + request->u.atapi.sense_key : request->error) & ATA_E_MASK) request->result = EIO; } @@ -499,7 +500,7 @@ ata_cmd2str(struct ata_request *request) static char buffer[20]; if (request->flags & ATA_R_ATAPI) { - switch (request->u.atapi.sense_cmd ? + switch (request->u.atapi.sense_key ? request->u.atapi.sense_cmd : request->u.atapi.ccb[0]) { case 0x00: return ("TEST_UNIT_READY"); case 0x01: return ("REZERO");