diff options
author | Søren Schmidt <sos@FreeBSD.org> | 2004-03-02 14:05:12 +0000 |
---|---|---|
committer | Søren Schmidt <sos@FreeBSD.org> | 2004-03-02 14:05:12 +0000 |
commit | 37baea5bd5db9adffe0316ba9c261142cc0e6dfc (patch) | |
tree | 2671877e16ace5ae2f973d0c211bbe366e513f69 /sys/dev/ata/ata-queue.c | |
parent | c4c0e4fc3b626edcdb15c7d13f2373de729c37e9 (diff) | |
download | src-37baea5bd5db9adffe0316ba9c261142cc0e6dfc.tar.gz src-37baea5bd5db9adffe0316ba9c261142cc0e6dfc.zip |
Report the original command on failures that causes auto sense.
Keep the ATA_R_QUIET flag if set during autosense.
Notes
Notes:
svn path=/head/; revision=126483
Diffstat (limited to 'sys/dev/ata/ata-queue.c')
-rw-r--r-- | sys/dev/ata/ata-queue.c | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/sys/dev/ata/ata-queue.c b/sys/dev/ata/ata-queue.c index a243efc53e81..e881a1e35048 100644 --- a/sys/dev/ata/ata-queue.c +++ b/sys/dev/ata/ata-queue.c @@ -338,14 +338,15 @@ ata_completed(void *context, int dummy) sizeof(struct atapi_sense), 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 }; - bcopy(ccb, request->u.atapi.ccb, 16); request->u.atapi.sense_key = request->error; + request->u.atapi.sense_cmd = request->u.atapi.ccb[0]; + bcopy(ccb, request->u.atapi.ccb, 16); request->data = (caddr_t)&request->u.atapi.sense_data; request->bytecount = sizeof(struct atapi_sense); request->transfersize = sizeof(struct atapi_sense); request->timeout = 5; - request->flags = - ATA_R_ATAPI | ATA_R_READ | ATA_R_IMMEDIATE | ATA_R_REQUEUE; + request->flags &= (ATA_R_ATAPI | ATA_R_QUIET); + request->flags |= (ATA_R_READ | ATA_R_IMMEDIATE | ATA_R_REQUEUE); ata_queue_request(request); return; } @@ -466,7 +467,8 @@ ata_cmd2str(struct ata_request *request) static char buffer[20]; if (request->flags & ATA_R_ATAPI) { - switch (request->u.atapi.ccb[0]) { + switch (request->u.atapi.sense_cmd ? + request->u.atapi.sense_cmd : request->u.atapi.ccb[0]) { case 0x00: return ("TEST_UNIT_READY"); case 0x01: return ("REZERO"); case 0x03: return ("REQUEST_SENSE"); |