aboutsummaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorBill Paul <wpaul@FreeBSD.org>1997-01-25 20:27:13 +0000
committerBill Paul <wpaul@FreeBSD.org>1997-01-25 20:27:13 +0000
commitfc7c79b9072e66ea517c5a6076f93037bb2cf210 (patch)
treeda9004ea224f70d3b7bc407d1cec1b4a7f75b761 /sys
parent4123678332977cade485fdee4f628e1915dc8169 (diff)
Notes
Diffstat (limited to 'sys')
-rw-r--r--sys/scsi/scsi_base.c17
-rw-r--r--sys/scsi/scsi_driver.c12
-rw-r--r--sys/scsi/scsiconf.c86
-rw-r--r--sys/scsi/scsiconf.h4
4 files changed, 104 insertions, 15 deletions
diff --git a/sys/scsi/scsi_base.c b/sys/scsi/scsi_base.c
index d65f0fb6cc15..895c99661710 100644
--- a/sys/scsi/scsi_base.c
+++ b/sys/scsi/scsi_base.c
@@ -1249,19 +1249,16 @@ sc_print_addr(sc_link)
}
else if (strcmp(sc_link->device->name, "probe") != 0) {
printf("%s", sc_link->device->name);
- id_put(sc_link->dev_unit, "");
+ id_put(sc_link->dev_unit, " at ");
}
- if (sc_link->adapter == 0) {
- printf("(noadapter:");
- }
- else {
- printf("(%s", sc_link->adapter->name);
- id_put(sc_link->adapter_unit, ":");
- }
+ printf("scbus");
+ id_put(sc_link->scsibus, " ");
- id_put(sc_link->target, ":");
- id_put(sc_link->lun, "): ");
+ printf("target ");
+ id_put(sc_link->target, " ");
+ printf("lun ");
+ id_put(sc_link->lun, ": ");
}
#ifdef SCSIDEBUG
diff --git a/sys/scsi/scsi_driver.c b/sys/scsi/scsi_driver.c
index 02e6ce5839b2..07018f9d0b0a 100644
--- a/sys/scsi/scsi_driver.c
+++ b/sys/scsi/scsi_driver.c
@@ -81,8 +81,15 @@ int scsi_device_attach(struct scsi_link *sc_link)
SC_DEBUG(sc_link, SDEV_DB2,
("%s%dattach: ", device->name, sc_link->dev_unit));
- sc_print_start(sc_link);
- printf("%s ", device->desc);
+ /* Print _sane_ probe info! */
+ printf("%s%d at scbus%d target %d lun %d\n",
+ sc_link->device->name, sc_link->dev_unit,
+ sc_link->scsibus, sc_link->target, sc_link->lun);
+#ifndef SCSIDEBUG
+ scsi_print_info(sc_link);
+#endif
+
+ printf("%s%d: %s ", device->name, sc_link->dev_unit, device->desc);
dev = scsi_dev_lookup(device->open);
@@ -92,7 +99,6 @@ int scsi_device_attach(struct scsi_link *sc_link)
errcode = (device->attach) ? (*(device->attach))(sc_link) : 0;
- sc_print_finish();
printf("\n");
if (errcode == 0)
diff --git a/sys/scsi/scsiconf.c b/sys/scsi/scsiconf.c
index af3008c28ae4..b8f883492398 100644
--- a/sys/scsi/scsiconf.c
+++ b/sys/scsi/scsiconf.c
@@ -305,6 +305,10 @@ static struct scsidevs knowndevs[] =
T_SEQUENTIAL, T_SEQUENTIAL, T_REMOV, "Quantum", "DLT*", "*",
"st", SC_MORE_LUS, 0
},
+ {
+ T_SEQUENTIAL, T_SEQUENTIAL, T_REMOV, "HP", "C1553A", "*",
+ "st", SC_MORE_LUS, 0
+ },
#endif /* NST */
#if NCD > 0
#ifndef UKTEST /* make cdroms unrecognised to test the uk driver */
@@ -1023,6 +1027,10 @@ scsi_probe_bus(int bus, int targ, int lun)
maxlun = minlun = lun;
}
+ printf("scbus%d at %s%d bus %d\n",
+ sc_link_proto->scsibus, sc_link_proto->adapter->name,
+ sc_link_proto->adapter_unit, sc_link_proto->adapter_bus);
+
for ( targ = mintarg;targ <= maxtarg; targ++) {
maybe_more = 0; /* by default only check 1 lun */
if (targ == scsi_addr) {
@@ -1123,6 +1131,79 @@ make_readable(to, from, n)
to[i] = 0;
}
+#ifndef SCSIDEBUG
+void scsi_print_info(sc_link)
+ struct scsi_link *sc_link;
+{
+ int dtype = 0;
+ char *desc;
+ char *qtype;
+ struct scsi_inquiry_data *inqbuf;
+ u_int32_t len, qualifier, type;
+ boolean remov;
+ char manu[8 + 1];
+ char model[16 + 1];
+ char version[4 + 1];
+
+ inqbuf = &sc_link->inqbuf;
+
+ type = inqbuf->device & SID_TYPE;
+ qualifier = inqbuf->device & SID_QUAL;
+ remov = inqbuf->dev_qual2 & SID_REMOVABLE;
+
+ switch ((int)qualifier) {
+ case SID_QUAL_LU_OK:
+ qtype = "";
+ break;
+
+ case SID_QUAL_LU_OFFLINE:
+ qtype = "Supported device currently not connected";
+ break;
+
+ default:
+ dtype = 1;
+ qtype = "Vendor specific peripheral qualifier";
+ break;
+ }
+
+ if ((inqbuf->version & SID_ANSII) > 0) {
+ if ((len = inqbuf->additional_length
+ + ((char *) inqbuf->unused
+ - (char *) inqbuf))
+ > (sizeof(struct scsi_inquiry_data) - 1))
+ len = sizeof(struct scsi_inquiry_data) - 1;
+ desc = inqbuf->vendor;
+ desc[len - (desc - (char *) inqbuf)] = 0;
+ make_readable(manu, inqbuf->vendor, sizeof(manu));
+ make_readable(model, inqbuf->product, sizeof(model));
+ make_readable(version, inqbuf->revision, sizeof(version));
+ } else {
+ /*
+ * If not advanced enough, use default values
+ */
+ desc = "early protocol device";
+ make_readable(manu, "unknown", sizeof(manu));
+ make_readable(model, "unknown", sizeof(model));
+ make_readable(version, "????", sizeof(version));
+ }
+
+ printf("%s%d: ", sc_link->device->name,
+ sc_link->dev_unit);
+ printf("<%s %s %s> ", manu, model, version );
+ printf("type %ld %sSCSI %d"
+ ,type
+ ,remov ? "removable " : "fixed "
+ ,inqbuf->version & SID_ANSII
+ );
+ if (qtype[0]) {
+ sc_print_addr(sc_link);
+ printf(" qualifier %ld: %s" ,qualifier ,qtype);
+ }
+
+ printf("\n");
+}
+#endif
+
/*
* given a target and lu, ask the device what
* it is, and find the correct driver table
@@ -1258,9 +1339,10 @@ scsi_probedev(sc_link, maybe_more, type_p)
make_readable(version, "????", sizeof(version));
}
+#ifdef SCSIDEBUG
sc_print_start(sc_link);
- printf("\"%s %s %s\" ", manu, model, version );
+ printf("<%s %s %s> ", manu, model, version );
printf("type %ld %sSCSI %d"
,type
,remov ? "removable " : "fixed "
@@ -1273,7 +1355,7 @@ scsi_probedev(sc_link, maybe_more, type_p)
printf("\n");
sc_print_finish();
-
+#endif
/*
* Try make as good a match as possible with
* available sub drivers
diff --git a/sys/scsi/scsiconf.h b/sys/scsi/scsiconf.h
index fdcbca03e89d..144165c74344 100644
--- a/sys/scsi/scsiconf.h
+++ b/sys/scsi/scsiconf.h
@@ -474,6 +474,10 @@ void sc_print_addr __P((struct scsi_link *));
void sc_print_start __P((struct scsi_link *));
void sc_print_finish __P((void));
+#ifndef SCSIDEBUG
+void scsi_print_info __P((struct scsi_link *));
+#endif
+
void scsi_device_register __P((struct scsi_device *sd));
void scsi_configure_start __P((void));