diff options
author | Kenneth R Westerback <krw@cvs.openbsd.org> | 2005-07-05 00:55:26 +0000 |
---|---|---|
committer | Kenneth R Westerback <krw@cvs.openbsd.org> | 2005-07-05 00:55:26 +0000 |
commit | 33885c5002e7415564ca6646b148dcae09c30134 (patch) | |
tree | 96aaac44529b55ce6fdc5f89f1fc44c339f1db5d /sys | |
parent | 63dd7fc9f04207bec4a2041047a1030e57db79f4 (diff) |
Since scsi_link now includes a copy of the INQUIRY data, don't keep a
copy of the vendor/product/revision fields in sd_softc. Just use the
INQUIRY data to build the disklabel 'label' when required. No
functional change.
Diffstat (limited to 'sys')
-rw-r--r-- | sys/scsi/sd.c | 15 | ||||
-rw-r--r-- | sys/scsi/sdvar.h | 8 |
2 files changed, 7 insertions, 16 deletions
diff --git a/sys/scsi/sd.c b/sys/scsi/sd.c index f959f1f94b0..6a94e9e28e7 100644 --- a/sys/scsi/sd.c +++ b/sys/scsi/sd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: sd.c,v 1.80 2005/07/02 15:39:55 krw Exp $ */ +/* $OpenBSD: sd.c,v 1.81 2005/07/05 00:55:25 krw Exp $ */ /* $NetBSD: sd.c,v 1.111 1997/04/02 02:29:41 mycroft Exp $ */ /*- @@ -221,11 +221,6 @@ sdattach(parent, self, aux) error = scsi_start(sc_link, SSS_START, SCSI_IGNORE_ILLEGAL_REQUEST | SCSI_IGNORE_MEDIA_CHANGE); - /* Fill in name struct for spoofed label */ - viscpy(sd->name.vendor, sa->sa_inqbuf->vendor, 8); - viscpy(sd->name.product, sa->sa_inqbuf->product, 16); - viscpy(sd->name.revision, sa->sa_inqbuf->revision, 4); - if (error) result = SDGP_RESULT_OFFLINE; else @@ -973,6 +968,7 @@ sdgetdisklabel(dev, sd, lp, clp, spoofonly) { size_t len; char *errstring, packname[sizeof(lp->d_packname) + 1]; + char product[17], vendor[9]; bzero(lp, sizeof(struct disklabel)); bzero(clp, sizeof(struct cpu_disklabel)); @@ -1000,10 +996,11 @@ sdgetdisklabel(dev, sd, lp, clp, spoofonly) * then leave out '<vendor> ' and use only as much of '<product>' as * does fit. */ - len = snprintf(packname, sizeof(packname), "%s %s", - sd->name.vendor, sd->name.product); + viscpy(vendor, sd->sc_link->inqdata.vendor, 8); + viscpy(product, sd->sc_link->inqdata.product, 16); + len = snprintf(packname, sizeof(packname), "%s %s", vendor, product); if (len > sizeof(lp->d_packname)) { - strlcpy(packname, sd->name.product, sizeof(packname)); + strlcpy(packname, product, sizeof(packname)); len = strlen(packname); } /* diff --git a/sys/scsi/sdvar.h b/sys/scsi/sdvar.h index 75983ac2e86..491801137cd 100644 --- a/sys/scsi/sdvar.h +++ b/sys/scsi/sdvar.h @@ -1,4 +1,4 @@ -/* $OpenBSD: sdvar.h,v 1.7 2005/07/02 15:39:55 krw Exp $ */ +/* $OpenBSD: sdvar.h,v 1.8 2005/07/05 00:55:25 krw Exp $ */ /* $NetBSD: sdvar.h,v 1.7 1998/08/17 00:49:03 mycroft Exp $ */ /*- @@ -78,11 +78,6 @@ struct sd_softc { u_long rot_rate; /* rotational rate, in RPM */ } params; struct buf buf_queue; - struct disk_name { - char vendor[9]; /* disk vendor/manufacturer */ - char product[17]; /* disk product model */ - char revision[5]; /* drive/firmware revision */ - } name; void *sc_sdhook; /* our shutdown hook */ #if NRND > 0 @@ -92,4 +87,3 @@ struct sd_softc { #define SDGP_RESULT_OK 0 /* parameters obtained */ #define SDGP_RESULT_OFFLINE 1 /* no media, or otherwise losing */ - |