freebsd-dev/sys
Bill Paul fc7c79b907 Make the SCSI probe messages more BSDish. This may raise a few eyebrows
("Hey! Who made _you_ the keeper of all things BSDish?!") but this has
bugged me for a long time, and now that I finally have the chance
to hack on it (and test the results), I'll take my chances. I can also
point to other BSD implementations for precedents if you put my back to
the wall.

The only thing that's changed is how the messages are formatted. Now,
instead of having this:

aha0 at 0x330-0x333 irq 11 drq 5 on isa
(aha0:3:0): "HP C1553A 9503" type 1 removable SCSI 2
st0(aha0:3:0): Sequential-Access density code 0x24, variable blocks, write-enabled
(aha0:3:1): "HP C1553A 9503" type 8 removable SCSI 2
ch0(aha0:3:1): Medium-Changer 6 slot(s) 1 drive(s) 0 arm(s) 0 i/e-slot(s)

We have this:

aha0 at 0x330-0x333 irq 11 drq 5 on isa
scbus0 at aha0 bus 0
st0 at scbus0 target 3 lun 0
st0: <HP C1553A 9503> type 1 removable SCSI 2
st0: Sequential-Access density code 0x24, variable blocks, write-enabled
ch0 at scbus0 target 3 lun 1
ch0: <HP C1553A 9503> type 8 removable SCSI 2
ch0: Medium-Changer 6 slot(s) 1 drive(s) 0 arm(s) 0 i/e-slot(s)

Which is (to me anyway) is a lot more pleasant to look at. (Call me
crazy -- g'head: you know you wanna -- but the previous messages remind
me of Linux. Ever see the output from the linux device probes? It's a mess
of copyright notices, version numbers/dates, author e-mail addresses and
other crap. Let's not go there, okay? Bleh.)

Notice that devices are now specified in terms of the scsi bus they
live on rather than the adapter. This better reflects the contents
of the kernel config file (if you use wired-down device specifications
anyway) and removes some ambiguity that may arise if you have a multi-
channel adapter with more than one bus.

Also, sc_print_addr() now generates messages like this:
st0 at scbus0 target 3 lun 0: NOT READY asc:3a,0 Medium not present

instead of this:
st0(aha0:3:0): NOT READY asc:3a,0 Medium not present

I also added a quirk entry for the HP Superstore 12000e 6 tape DAT
autoloader, which needs SC_MORE_LUS in order for the changer device
to be properly probed and attached. (I'm working on a chcontrol utility
to manipulate the changer on this drive which should hopefully be general
enough to work with other changers too. If you want the prototype I have
now, it's at ftp://skynet.ctr.columbia.edu/pub/freebsd/changer.c.)

Remaining bugs:

- The 'foodev0: yadda yadda yadda' bits should probably be printed entirely
  by the device-specific subdriver attach code instead of half by the
  scsi_device_attach() routine and half by the device specific attach
  routine like it is now.

- The wired-down device specifications in the kernel config file should
  be used to control bus/device probing to some extent rather than just
  for choosing names for devices we find. If the config says there's a
  device at scbus0 target 0 lun 0 called sd0, we should look there and
  check for a device that can be managed by the sd driver. If we don't
  find one, we should probably complain that there's no device there or
  that there is a device but of the wrong type. Once all the devices from
  the wired down list have been probed, the code can then autodetect and
  autoattach any devices that remain unassigned.

- Apparently some tape changers (hi Ulf!) return 'not ready/medium not
  present' when the magazine is loaded but a tape has not been put in the
  drive yet. This causes an open(/dev/ch0) to fail and prevents you from
  using the changer.c utility to load the first tape into the drive. My
  HP changer does not behave this way. The workaround is to manually load
  a tape into the drive before attempting to use the changer program, but
  you can get in trouble if you accidentally eject a tape without loading
  a new one and you're at a remote location: you won't be able to load
  any tapes anymore. I'm not sure what the correct software solution is
  for this but ideally there should be one.

- I should not be doing this: I'm the NIS guru, not the SCSI guru.
  (This is not my beautiful code. How did I get here? My god: what
  have I done?)
1997-01-25 20:27:13 +00:00
..
alpha Make the long-awaited change from $Id$ to $FreeBSD$ 1997-01-14 07:20:47 +00:00
amd64 Sync with <pci/pcibus.h>. pcibus.c unfortunately still compiled (with 1997-01-25 18:51:01 +00:00
compat/linux Make the long-awaited change from $Id$ to $FreeBSD$ 1997-01-14 07:20:47 +00:00
compile Stop cvs up -P from removing empty compile directories. 1994-08-25 16:20:16 +00:00
conf Synchronize with sys/i386/conf/files.i386 (revision 1.151). 1997-01-18 10:29:55 +00:00
ddb Fixed printing of small offsets. E.g., -4(%ebp) is now printed 1997-01-16 11:27:11 +00:00
dev Improve on previous fix: Clean up getirq() as well, and remove redundant 1997-01-25 01:57:30 +00:00
fs Change the map entry flags from bitfields to bitmasks. Allows 1997-01-16 04:16:22 +00:00
geom Make the long-awaited change from $Id$ to $FreeBSD$ 1997-01-14 07:20:47 +00:00
gnu Make the long-awaited change from $Id$ to $FreeBSD$ 1997-01-14 07:20:47 +00:00
i386 Sync with <pci/pcibus.h>. pcibus.c unfortunately still compiled (with 1997-01-25 18:51:01 +00:00
isa Add save/restore cursor as pr SCO screen(HW) manpage. 1997-01-23 20:00:45 +00:00
isofs/cd9660 Make the long-awaited change from $Id$ to $FreeBSD$ 1997-01-14 07:20:47 +00:00
kern Remove some dead code from trapwrite. 1997-01-23 01:30:59 +00:00
libkern Make the long-awaited change from $Id$ to $FreeBSD$ 1997-01-14 07:20:47 +00:00
miscfs Change the map entry flags from bitfields to bitmasks. Allows 1997-01-16 04:16:22 +00:00
modules Upgrade the kbdio rutines to provide queued kbd & mouse events. 1997-01-15 18:16:32 +00:00
msdosfs Make the long-awaited change from $Id$ to $FreeBSD$ 1997-01-14 07:20:47 +00:00
net Round #2. This basically brings back the changes from rev 1.12. 1997-01-17 23:56:20 +00:00
netatalk Convert the interface address and IP interface address structures 1996-12-13 21:29:07 +00:00
netinet Count multicast packets received for groups of which we are not 1997-01-21 21:08:09 +00:00
netipx Make the long-awaited change from $Id$ to $FreeBSD$ 1997-01-14 07:20:47 +00:00
netkey This is the `netkey' kernel key-management service (the PF_KEY analogue 1996-06-14 17:22:18 +00:00
netns Make the long-awaited change from $Id$ to $FreeBSD$ 1997-01-14 07:20:47 +00:00
nfs Make the long-awaited change from $Id$ to $FreeBSD$ 1997-01-14 07:20:47 +00:00
nfsclient Make the long-awaited change from $Id$ to $FreeBSD$ 1997-01-14 07:20:47 +00:00
nfsserver Make the long-awaited change from $Id$ to $FreeBSD$ 1997-01-14 07:20:47 +00:00
pc98 Change default I/O recovery time for Cyrix 5x86 to 0. The BIOS 1997-01-25 10:37:03 +00:00
pccard One other minor include file change. 1997-01-14 16:29:05 +00:00
pci Remove element pb_maxirq from struct pcibus. 1997-01-25 02:22:34 +00:00
powerpc/include Make the long-awaited change from $Id$ to $FreeBSD$ 1997-01-14 07:20:47 +00:00
rpc Make the long-awaited change from $Id$ to $FreeBSD$ 1997-01-14 07:20:47 +00:00
scsi Make the SCSI probe messages more BSDish. This may raise a few eyebrows 1997-01-25 20:27:13 +00:00
sys Changed dkunit() to use some previously unused bits in the 'type' field 1997-01-24 22:13:09 +00:00
tools Make the long-awaited change from $Id$ to $FreeBSD$ 1997-01-14 07:20:47 +00:00
ufs Make the long-awaited change from $Id$ to $FreeBSD$ 1997-01-14 07:20:47 +00:00
vm Added a check/panic for v_usecount being 0 (no vnode reference) in 1997-01-24 22:20:23 +00:00
Makefile Make the long-awaited change from $Id$ to $FreeBSD$ 1997-01-14 07:20:47 +00:00