Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/scsipi Set up the blank fields in the INQUIRY buffer...



details:   https://anonhg.NetBSD.org/src/rev/1bd0091a47c1
branches:  trunk
changeset: 551666:1bd0091a47c1
user:      mycroft <mycroft%NetBSD.org@localhost>
date:      Wed Sep 10 05:35:50 2003 +0000

description:
Set up the blank fields in the INQUIRY buffer *before* executing the command --
because we can't really rely on the "additional length" being correct (any
more?).  Fixes some problems with devices showing up as "<, , >".

diffstat:

 sys/dev/scsipi/scsiconf.c |  12 ++++++------
 1 files changed, 6 insertions(+), 6 deletions(-)

diffs (42 lines):

diff -r e859a968d8fb -r 1bd0091a47c1 sys/dev/scsipi/scsiconf.c
--- a/sys/dev/scsipi/scsiconf.c Wed Sep 10 05:30:15 2003 +0000
+++ b/sys/dev/scsipi/scsiconf.c Wed Sep 10 05:35:50 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: scsiconf.c,v 1.214 2003/09/09 03:57:57 mycroft Exp $   */
+/*     $NetBSD: scsiconf.c,v 1.215 2003/09/10 05:35:50 mycroft Exp $   */
 
 /*-
  * Copyright (c) 1998, 1999 The NetBSD Foundation, Inc.
@@ -55,7 +55,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: scsiconf.c,v 1.214 2003/09/09 03:57:57 mycroft Exp $");
+__KERNEL_RCSID(0, "$NetBSD: scsiconf.c,v 1.215 2003/09/10 05:35:50 mycroft Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -755,12 +755,9 @@
 
        /* Now go ask the device all about itself. */
        memset(&inqbuf, 0, sizeof(inqbuf));
-       if (scsipi_inquire(periph, &inqbuf,
-           XS_CTL_DISCOVERY | XS_CTL_DATA_ONSTACK) != 0)
-               goto bad;
        {
                u_int8_t *extension = &inqbuf.flags1;
-               int len = inqbuf.additional_length;
+               int len = 0;
                while (len < 3)
                        extension[len++] = '\0';
                while (len < 3 + 28)
@@ -774,6 +771,9 @@
                while (len < 3 + 28 + 20 + 1 + 1 + (8*2))
                        extension[len++] = ' ';
        }
+       if (scsipi_inquire(periph, &inqbuf,
+           XS_CTL_DISCOVERY | XS_CTL_DATA_ONSTACK) != 0)
+               goto bad;
 
        periph->periph_type = inqbuf.device & SID_TYPE;
        if (inqbuf.dev_qual2 & SID_REMOVABLE)



Home | Main Index | Thread Index | Old Index