diff options
author | David Gwynne <dlg@cvs.openbsd.org> | 2009-12-08 08:07:52 +0000 |
---|---|---|
committer | David Gwynne <dlg@cvs.openbsd.org> | 2009-12-08 08:07:52 +0000 |
commit | da3e327d76817f3d36ea42bbef28c21a630f54e2 (patch) | |
tree | b34caff3c67aed495818b15b4b34eb20bd35cb2a /sys/dev/ata | |
parent | c8fdfcf6c8ddd694cc584d07abe3848d3414cee1 (diff) |
krw and marco found another problem with my atascsi chanages.
turns out you cant send atapi devices the ata IDENTIFY command, they dont
grok it. you have to send a PACKET IDENTIFY instead, which is exactly the
same but with a different command id.
this diff changes it so we send a PACKET IDENTIFY to atapi devices.
my diff "broke" this because it actually checks to see if the IDENTIFY
succeeded rather than just completed. the previous code was wrong with
regard to atapi devices. it is just lucky we dont use the IDENTIFY output
for atapi devs.
my apologies to marco@ and krw@
Diffstat (limited to 'sys/dev/ata')
-rw-r--r-- | sys/dev/ata/atascsi.c | 5 | ||||
-rw-r--r-- | sys/dev/ata/atascsi.h | 3 |
2 files changed, 5 insertions, 3 deletions
diff --git a/sys/dev/ata/atascsi.c b/sys/dev/ata/atascsi.c index 98d7c488950..ad786e47513 100644 --- a/sys/dev/ata/atascsi.c +++ b/sys/dev/ata/atascsi.c @@ -1,4 +1,4 @@ -/* $OpenBSD: atascsi.c,v 1.68 2009/12/07 12:36:23 dlg Exp $ */ +/* $OpenBSD: atascsi.c,v 1.69 2009/12/08 08:07:51 dlg Exp $ */ /* * Copyright (c) 2007 David Gwynne <dlg@openbsd.org> @@ -204,7 +204,8 @@ atascsi_probe(struct scsi_link *link) xa->data = &ap->ap_identify; xa->datalen = sizeof(ap->ap_identify); xa->fis->flags = ATA_H2D_FLAGS_CMD; - xa->fis->command = ATA_C_IDENTIFY; + xa->fis->command = (type == ATA_PORT_T_DISK) ? + ATA_C_IDENTIFY : ATA_C_IDENTIFY_PACKET; xa->fis->device = 0; xa->flags = ATA_F_READ | ATA_F_PIO | ATA_F_POLL; xa->timeout = 1000; diff --git a/sys/dev/ata/atascsi.h b/sys/dev/ata/atascsi.h index fc02b0df5cf..c1b4e543f67 100644 --- a/sys/dev/ata/atascsi.h +++ b/sys/dev/ata/atascsi.h @@ -1,4 +1,4 @@ -/* $OpenBSD: atascsi.h,v 1.34 2009/12/07 09:37:34 dlg Exp $ */ +/* $OpenBSD: atascsi.h,v 1.35 2009/12/08 08:07:51 dlg Exp $ */ /* * Copyright (c) 2007 David Gwynne <dlg@openbsd.org> @@ -29,6 +29,7 @@ struct scsi_link; #define ATA_C_READ_FPDMA 0x60 #define ATA_C_WRITE_FPDMA 0x61 #define ATA_C_PACKET 0xa0 +#define ATA_C_IDENTIFY_PACKET 0xa1 #define ATA_C_READDMA 0xc8 #define ATA_C_WRITEDMA 0xca #define ATA_C_FLUSH_CACHE 0xe7 |