diff options
author | Grigoriy Orlov <gluk@cvs.openbsd.org> | 2002-03-27 17:42:38 +0000 |
---|---|---|
committer | Grigoriy Orlov <gluk@cvs.openbsd.org> | 2002-03-27 17:42:38 +0000 |
commit | 87bbeef386d9841d66a33f3656cceb83128598e6 (patch) | |
tree | d84266ad34936de88e8a8e36b5da9522a2223f9a | |
parent | d0d12731d1effad29d23f723d67ceb4f520e40ca (diff) |
Calculate the maximum queue depth correctly.
PR2490 from Alexander Yurchenko <grange@rt.mipt.ru>
-rw-r--r-- | sbin/atactl/atactl.c | 7 | ||||
-rw-r--r-- | sys/dev/ata/atareg.h | 4 |
2 files changed, 6 insertions, 5 deletions
diff --git a/sbin/atactl/atactl.c b/sbin/atactl/atactl.c index e4f3ef4beaf..876d2b9bf61 100644 --- a/sbin/atactl/atactl.c +++ b/sbin/atactl/atactl.c @@ -1,4 +1,4 @@ -/* $OpenBSD: atactl.c,v 1.11 2002/03/14 06:51:41 mpech Exp $ */ +/* $OpenBSD: atactl.c,v 1.12 2002/03/27 17:42:37 gluk Exp $ */ /* $NetBSD: atactl.c,v 1.4 1999/02/24 18:49:14 jwise Exp $ */ /*- @@ -438,9 +438,10 @@ device_identify(argc, argv) (inqbuf->atap_capacity[1] << 16) | inqbuf->atap_capacity[0]); - if (inqbuf->atap_queuedepth & WDC_QUEUE_DEPTH_MASK) + if ((inqbuf->atap_cmd_set2 & ATA_CMD2_RWQ) && + (inqbuf->atap_queuedepth & WDC_QUEUE_DEPTH_MASK)) printf("Device supports command queue depth of %d\n", - inqbuf->atap_queuedepth & 0xf); + (inqbuf->atap_queuedepth & WDC_QUEUE_DEPTH_MASK) + 1); printf("Device capabilities:\n"); print_bitinfo("\t%s\n", inqbuf->atap_capabilities1, ata_caps); diff --git a/sys/dev/ata/atareg.h b/sys/dev/ata/atareg.h index 16f7b82c152..23e75516a50 100644 --- a/sys/dev/ata/atareg.h +++ b/sys/dev/ata/atareg.h @@ -1,4 +1,4 @@ -/* $OpenBSD: atareg.h,v 1.4 2001/06/25 19:31:47 csapuntz Exp $ */ +/* $OpenBSD: atareg.h,v 1.5 2002/03/27 17:42:37 gluk Exp $ */ /* $NetBSD: atareg.h,v 1.5 1999/01/18 20:06:24 bouyer Exp $ */ #ifndef __DEV_ATA_ATAREG_H__ @@ -104,7 +104,7 @@ struct ataparams { u_int16_t atap_pkt_bsyclr; /* 72: tme to clear BSY after service */ u_int16_t __reserved4[2]; u_int16_t atap_queuedepth; /* 75: */ -#define WDC_QUEUE_DEPTH_MASK 0x0F +#define WDC_QUEUE_DEPTH_MASK 0x1f u_int16_t __reserved5[4]; u_int16_t atap_ata_major; /* 80: Major version number */ #define WDC_VER_ATA1 0x0002 |