From c1848416f24da8b2257295879320ed78d84dd3a5 Mon Sep 17 00:00:00 2001 From: wpaul Date: Sat, 8 Feb 1997 03:42:22 +0000 Subject: Make some small tweaks to the messages to clean up some stuff from last time. Some people have pointed out that there were some odd side-effects in the changes I made. Two things are different: - sc_print_addr() will print 'foodev0:' (i.e. sd0:, st0:, cd0:, etc...) if the device name is known. If it's not known, it'll use a longer notation. This shortens error messages back to a sane length. - Added a small function called sc_print_init() to set the sc_printing flag so that sc_print_addr() will know that we want it to print a linefeed. Used this in scsi_device_attach() to restore proper carriage return printing behavior which I broke. Remaining bogons: the NCR SCSI driver prints out information while the device-specific attach routine is running with its own linefeeds. This breaks up the individual messages emitted by the subdriver modules and causes at least one message to appear on a line by itself without a device spec prefix. I'm not sure of the correct way to fix this, and I don't have any NCR SCSI hardware to test with anyway. There's probably more, but I gather that a rewrite of the SCSI subsystem is pending anyway, so I'll leave the rest to Those Who Know More About This Than I (tm). --- sys/scsi/scsi_driver.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'sys/scsi/scsi_driver.c') diff --git a/sys/scsi/scsi_driver.c b/sys/scsi/scsi_driver.c index 07018f9..f03e2c1 100644 --- a/sys/scsi/scsi_driver.c +++ b/sys/scsi/scsi_driver.c @@ -90,6 +90,13 @@ int scsi_device_attach(struct scsi_link *sc_link) #endif printf("%s%d: %s ", device->name, sc_link->dev_unit, device->desc); + /* + * XXX some SCSI adapter drivers print out things while the + * device-specific attach routine is running. The result is + * something of a mess. This hack at least keeps it so each + * line will begin with foodev0:. + */ + sc_print_init(); dev = scsi_dev_lookup(device->open); @@ -100,6 +107,7 @@ int scsi_device_attach(struct scsi_link *sc_link) errcode = (device->attach) ? (*(device->attach))(sc_link) : 0; printf("\n"); + sc_print_finish(); if (errcode == 0) sc_link->flags |= device->link_flags; -- cgit v1.1