Get rid of dk_establish and extra "struct device."

This commit is contained in:
briggs 1994-02-03 05:34:44 +00:00
parent 275267397f
commit 0c7e77e4b2
2 changed files with 10 additions and 14 deletions

View File

@ -14,7 +14,7 @@
*
* Ported to run under 386BSD by Julian Elischer (julian@tfs.com) Sept 1992
*
* $Id: cd.c,v 1.3 1994/01/30 01:21:12 briggs Exp $
* $Id: cd.c,v 1.4 1994/02/03 05:34:47 briggs Exp $
*/
#include <sys/types.h>
@ -54,7 +54,6 @@ int Debugger();
#define RAW_PART 3
struct cd_data {
struct device sc_dev;
struct dkdevice sc_dk;
u_int32 flags;
@ -118,10 +117,9 @@ cdattach(parent, self, aux)
*/
cd->sc_link = sc_link;
sc_link->device = &cd_switch;
sc_link->dev_unit = cd->sc_dev.dv_unit;
sc_link->dev_unit = cd->sc_dk.dk_dev.dv_unit;
cd->sc_dk.dk_driver = &cddkdriver;
dk_establish(&cd->sc_dk, &cd->sc_dev);
sc_link->opennings = cd->cmdscount = CDOUTSTANDING;
@ -466,7 +464,7 @@ cdstart(unit)
SCSI_DATA_IN : SCSI_DATA_OUT))
!= SUCCESSFULLY_QUEUED) {
bad:
printf("%s: not queued", cd->sc_dev.dv_xname);
printf("%s: not queued", cd->sc_dk.dk_dev.dv_xname);
bp->b_error = EIO;
bp->b_flags |= B_ERROR;
biodone(bp);
@ -813,7 +811,7 @@ cd_size(cd, flags)
CDRETRIES, 20000, NULL, SCSI_DATA_IN | flags) != 0) {
if (!(flags & SCSI_SILENT))
printf("%s: could not get size\n",
cd->sc_dev.dv_xname);
cd->sc_dk.dk_dev.dv_xname);
return 0;
} else {
size = rdcap.addr_0 + 1;

View File

@ -14,7 +14,7 @@
*
* Ported to run under 386BSD by Julian Elischer (julian@dialix.oz.au) Sept 1992
*
* $Id: sd.c,v 1.3 1994/01/30 01:21:44 briggs Exp $
* $Id: sd.c,v 1.4 1994/02/03 05:34:44 briggs Exp $
*/
#include <sys/types.h>
@ -52,7 +52,6 @@ int Debugger();
#define RAW_PART 3
struct sd_data {
struct device sc_dev;
struct dkdevice sc_dk;
u_int32 flags;
@ -123,7 +122,6 @@ sdattach(parent, self, aux)
sc_link->dev_unit = self->dv_unit;
sd->sc_dk.dk_driver = &sddkdriver;
dk_establish(&sd->sc_dk, &sd->sc_dev);
if (sd->sc_link->adapter->adapter_info) {
sd->ad_info = ((*(sd->sc_link->adapter->adapter_info)) (sc_link->adapter_softc));
@ -489,7 +487,7 @@ sdstart(unit)
SCSI_DATA_IN : SCSI_DATA_OUT))
!= SUCCESSFULLY_QUEUED) {
bad:
printf("%s: not queued", sd->sc_dev.dv_xname);
printf("%s: not queued", sd->sc_dk.dk_dev.dv_xname);
bp->b_error = EIO;
bp->b_flags |= B_ERROR;
biodone(bp);
@ -639,11 +637,11 @@ sdgetdisklabel(sd)
/*
* Call the generic disklabel extraction routine
*/
if (errstring = readdisklabel(MAKESDDEV(0, sd->sc_dev.dv_unit,
if (errstring = readdisklabel(MAKESDDEV(0, sd->sc_dk.dk_dev.dv_unit,
RAW_PART), sdstrategy,
&sd->sc_dk.dk_label,
&sd->sc_dk.dk_cpulabel)) {
printf("%s: %s\n", sd->sc_dev.dv_xname, errstring);
printf("%s: %s\n", sd->sc_dk.dk_dev.dv_xname, errstring);
return ENXIO;
}
sd->flags |= SDHAVELABEL; /* WE HAVE IT ALL NOW */
@ -676,7 +674,7 @@ sd_size(sd, flags)
if (scsi_scsi_cmd(sd->sc_link, (struct scsi_generic *) &scsi_cmd,
sizeof(scsi_cmd), (u_char *) &rdcap, sizeof(rdcap),
SDRETRIES, 2000, NULL, flags | SCSI_DATA_IN) != 0) {
printf("%s: could not get size\n", sd->sc_dev.dv_xname);
printf("%s: could not get size\n", sd->sc_dk.dk_dev.dv_xname);
return 0;
} else {
size = rdcap.addr_0 + 1;
@ -757,7 +755,7 @@ sd_get_parms(sd, flags)
sizeof(scsi_sense), SDRETRIES, 2000, NULL,
flags | SCSI_DATA_IN) != 0) {
printf("%s: could not mode sense", sd->sc_dev.dv_xname);
printf("%s: could not mode sense", sd->sc_dk.dk_dev.dv_xname);
printf(" (4); using ficticious geometry\n");
/*
* use adaptec standard ficticious geometry