Subject: Problem with /bin/chio status
To: None <tech-kern@NetBSD.ORG>
From: Dave Huang <khym@bga.com>
List: tech-kern
Date: 09/30/1997 23:47:49
Hiyas... I just got a shiny new DAT autoloader thing (well, new to me,
at least :) and was messing around with chio to see what it could
do... And I ran into a problem with "chio status"; it kept giving me:

Sep 30 23:13:30 dahan /netbsd: ch0(ncr1:6:1): extraneous data discarded.
Sep 30 23:13:30 dahan /netbsd: ch0(ncr1:6:1): COMMAND FAILED (9 0) @0xf87f5c00.
Sep 30 23:13:30 dahan /netbsd: ch0(ncr1:6:1): extraneous data discarded.
Sep 30 23:13:30 dahan /netbsd: ch0(ncr1:6:1): COMMAND FAILED (9 0) @0xf87f5c00.
Sep 30 23:13:30 dahan /netbsd: ch0(ncr1:6:1): extraneous data discarded.
Sep 30 23:13:30 dahan /netbsd: ch0(ncr1:6:1): COMMAND FAILED (9 0) @0xf87f5c00.

I know the ncr driver has a bad rep, but since the drive was otherwise
working fine, and the scsi command (from FreeBSD) was able to do a
"READ ELEMENT STATUS" just fine, I was thinking it might be something
in the NetBSD SCSI code.

Specifically, sys/dev/scsipi/ch.c, ch_getelemstatus():

	/*
	 * Send command to changer.
	 */
        return (sc->sc_link->scsipi_cmd(sc->sc_link, (struct scsipi_generic *)&cmd,
            sizeof(cmd), (u_char *)data, datalen, CHRETRIES, 100000, NULL, 0));
                                                                           ^
Is it just me, or should that last 0 --------------------------------------|
be changed to SCSI_DATA_IN? It made chio status work for me, at
least...

Here's some info on the relavant hardware:

ncr1 at pci0 dev 11 function 0: ncr 53c810 fast10 scsi
ncr1: interrupting at irq 10
ncr1: minsync=25, maxsync=206, maxoffs=8, 16 dwords burst, normal dma fifo
ncr1: single-ended, open drain IRQ driver
ncr1: restart (scsi reset).
scsibus1 at ncr1: 8 targets
st0 at scsibus1 targ 6 lun 0: <ARCHIVE, Python 28849-XXX, 4.CM> SCSI2 1/sequential removable
st0: st0(ncr1:6:0): 5.0 MB/s (200 ns, offset 8)
density code 0x13, 512-byte blocks, write-protected
ch0 at scsibus1 targ 6 lun 1: <ARCHIVE, Python 28849-XXX, 4.CM> SCSI2 8/changer removable
ch0: 4 slots, 1 drive, 1 picker, 0 portals

Name: Dave Huang     |   Mammal, mammal / their names are called /
INet: khym@bga.com   |   they raise a paw / the bat, the cat /
FurryMUCK: Dahan     |   dolphin and dog / koala bear and hog -- TMBG
Dahan: Hani G Y+C 21 Y++ L+++ W- C++ T++ A+ E+ S++ V++ F- Q+++ P+ B+ PA+ PL++