Source-Changes-HG archive

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

[src/trunk]: src/sys/arch/x68k/stand Specify default SCSI inquiry size (36 by...



details:   https://anonhg.NetBSD.org/src/rev/72475773bb3d
branches:  trunk
changeset: 326662:72475773bb3d
user:      tsutsui <tsutsui%NetBSD.org@localhost>
date:      Tue Feb 11 08:06:07 2014 +0000

description:
Specify default SCSI inquiry size (36 bytes) on IOCS_S_INQUIRY() command.

X680x0 SCSI IOCS stalls if SCSI device doesn't return inquiry data
of specified allocation length size on the INQUIRY command,
and it causes hangup on the XM6 based emulators that return only
upto 36 byte inquiry data on SCSI disk emulation.

Many real SCSI-2 hard drives seem to support >100 byte inquiry data,
but at least there is a harddisk that returns only supported inquiry
data size and quits transfer.

The bootloader checks only the device type and there is no reason
to read 100 bytes that includes vender specific data.

Analyzed and reported by GIMONS, a developer of XM6 TypeG emulator,
which also can run NetBSD/x68k.

diffstat:

 sys/arch/x68k/stand/libiocs/iocs.h |  7 +++++--
 sys/arch/x68k/stand/libsa/sdcd.c   |  6 +++---
 2 files changed, 8 insertions(+), 5 deletions(-)

diffs (45 lines):

diff -r 3e9938b7912c -r 72475773bb3d sys/arch/x68k/stand/libiocs/iocs.h
--- a/sys/arch/x68k/stand/libiocs/iocs.h        Mon Feb 10 16:30:54 2014 +0000
+++ b/sys/arch/x68k/stand/libiocs/iocs.h        Tue Feb 11 08:06:07 2014 +0000
@@ -6,7 +6,7 @@
  *     (based on PD libc 1.1.32 by PROJECT C Library)
  *     public domain
  *
- *     $NetBSD: iocs.h,v 1.8 2011/02/21 02:31:59 itohy Exp $
+ *     $NetBSD: iocs.h,v 1.9 2014/02/11 08:06:07 tsutsui Exp $
  */
 /*
  * PROJECT C Library, X68000 PROGRAMMING INTERFACE DEFINITION
@@ -224,7 +224,10 @@
        unsigned char   ver;
        unsigned char   reserve;
        unsigned char   size;
-       unsigned char   buff[0];        /* actually longer */
+       unsigned char   class[3];
+       char            vendor[8];
+       char            product[16];
+       char            revision[4];
 };
 
 /*
diff -r 3e9938b7912c -r 72475773bb3d sys/arch/x68k/stand/libsa/sdcd.c
--- a/sys/arch/x68k/stand/libsa/sdcd.c  Mon Feb 10 16:30:54 2014 +0000
+++ b/sys/arch/x68k/stand/libsa/sdcd.c  Tue Feb 11 08:06:07 2014 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: sdcd.c,v 1.14 2012/11/22 20:15:49 tsutsui Exp $        */
+/*     $NetBSD: sdcd.c,v 1.15 2014/02/11 08:06:07 tsutsui Exp $        */
 
 /*
  * Copyright (c) 2001 MINOURA Makoto.
@@ -67,9 +67,9 @@
        }
 
        {
-               struct iocs_inquiry *inqdata= buffer;
+               struct iocs_inquiry *inqdata = buffer;
 
-               error = IOCS_S_INQUIRY(100, id, inqdata);
+               error = IOCS_S_INQUIRY(sizeof(*inqdata), id, inqdata);
                if (error < 0) {                /* WHY??? */
                        error = ENXIO;
                        goto out;



Home | Main Index | Thread Index | Old Index