diff options
author | Todd C. Miller <millert@cvs.openbsd.org> | 1998-05-10 04:01:25 +0000 |
---|---|---|
committer | Todd C. Miller <millert@cvs.openbsd.org> | 1998-05-10 04:01:25 +0000 |
commit | f40fb2e993ac1f1a5239d44a55d15b94c9c978f5 (patch) | |
tree | 0c0e85ceeba0bf01c7c3de1df4ba09280dd64acf /sys/arch/pmax/dev | |
parent | 86ecdd3a4b9f4b388cb5ac424a12b06abf8e778b (diff) |
1) It's a 'lun' not a 'slave'
2) 16 partitions
Diffstat (limited to 'sys/arch/pmax/dev')
-rw-r--r-- | sys/arch/pmax/dev/device.h | 2 | ||||
-rw-r--r-- | sys/arch/pmax/dev/rz.c | 48 | ||||
-rw-r--r-- | sys/arch/pmax/dev/tz.c | 16 |
3 files changed, 36 insertions, 30 deletions
diff --git a/sys/arch/pmax/dev/device.h b/sys/arch/pmax/dev/device.h index 819ddd1e4df..76e632d4887 100644 --- a/sys/arch/pmax/dev/device.h +++ b/sys/arch/pmax/dev/device.h @@ -85,7 +85,7 @@ struct pmax_scsi_device { int sd_unit; /* device unit number */ int sd_ctlr; /* SCSI interface number */ int sd_drive; /* SCSI address number */ - int sd_slave; /* LUN if device has multiple units */ + int sd_lun; /* LUN if device has multiple units */ int sd_flags; /* flags */ int sd_alive; /* true if init routine succeeded */ diff --git a/sys/arch/pmax/dev/rz.c b/sys/arch/pmax/dev/rz.c index 7c5e5ea02db..87ec719ad54 100644 --- a/sys/arch/pmax/dev/rz.c +++ b/sys/arch/pmax/dev/rz.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rz.c,v 1.11 1998/05/09 20:15:36 millert Exp $ */ +/* $OpenBSD: rz.c,v 1.12 1998/05/10 04:01:16 millert Exp $ */ /* $NetBSD: rz.c,v 1.37 1998/03/02 23:17:19 thorpej Exp $ */ /* @@ -137,7 +137,15 @@ static struct size rzdefaultpart[MAXPARTITIONS] = { { 212992, 409600 }, /* E -- /usr */ { 622592, 409600 }, /* F -- /home, alternate /usr */ { 1032912, RZ_END }, /* G -- F to end of disk */ - { 196608, RZ_END } /* H -- B to end of disk */ + { 196608, RZ_END }, /* H -- B to end of disk */ + { 0, 0 }, /* I */ + { 0, 0 }, /* J */ + { 0, 0 }, /* K */ + { 0, 0 }, /* L */ + { 0, 0 }, /* M */ + { 0, 0 }, /* N */ + { 0, 0 }, /* O */ + { 0, 0 } /* P */ }; @@ -214,8 +222,6 @@ struct rz_softc { int rzdebug = RZB_ERROR; #endif -#define rzunit(x) (minor(x) >> 3) -#define rzpart(x) (minor(x) & 0x7) #define b_cylin b_resid struct scsi_mode_sense_data { @@ -564,7 +570,7 @@ rzlblkstrat(bp, bsize) register int count; if (boff || resid < bsize) { - rz_softc[rzunit(bp->b_dev)].sc_stats.rzpartials++; + rz_softc[DISKUNIT(bp->b_dev)].sc_stats.rzpartials++; count = min(resid, bsize - boff); cbp->b_flags = B_BUSY | B_PHYS | B_READ; cbp->b_blkno = bn - btodb(boff); @@ -629,8 +635,8 @@ void rzstrategy(bp) register struct buf *bp; { - register int unit = rzunit(bp->b_dev); - register int part = rzpart(bp->b_dev); + register int unit = DISKUNIT(bp->b_dev); + register int part = DISKPART(bp->b_dev); register struct rz_softc *sc = &rz_softc[unit]; register struct partition *pp = &sc->sc_label->d_partitions[part]; register daddr_t bn; @@ -856,14 +862,14 @@ void rzgetinfo(dev) dev_t dev; { - register int unit = rzunit(dev); + register int unit = DISKUNIT(dev); register struct rz_softc *sc = &rz_softc[unit]; register struct disklabel *lp = sc->sc_label; char *msg; int part; struct cpu_disklabel cd; - part = rzpart(dev); + part = DISKPART(dev); sc->sc_flags |= RZF_HAVELABEL; if (sc->sc_type == SCSI_ROM_TYPE) { @@ -934,7 +940,7 @@ rzopen(dev, flags, mode, p) int flags, mode; struct proc *p; { - register int unit = rzunit(dev); + register int unit = DISKUNIT(dev); register struct rz_softc *sc = &rz_softc[unit]; register int i; int part; @@ -950,7 +956,7 @@ rzopen(dev, flags, mode, p) } /* Try to read disk label and partition table information */ - part = rzpart(dev); + part = DISKPART(dev); mask = 1 << part; if (!(sc->sc_flags & RZF_HAVELABEL)) rzgetinfo(dev); @@ -981,8 +987,8 @@ rzclose(dev, flags, mode, p) int flags, mode; struct proc *p; { - register struct rz_softc *sc = &rz_softc[rzunit(dev)]; - int mask = (1 << rzpart(dev)); + register struct rz_softc *sc = &rz_softc[DISKUNIT(dev)]; + int mask = (1 << DISKPART(dev)); int s; switch (mode) { @@ -1014,7 +1020,7 @@ rzread(dev, uio, ioflag) struct uio *uio; int ioflag; { - register struct rz_softc *sc = &rz_softc[rzunit(dev)]; + register struct rz_softc *sc = &rz_softc[DISKUNIT(dev)]; if (sc->sc_type == SCSI_ROM_TYPE) return (EROFS); @@ -1032,7 +1038,7 @@ rzwrite(dev, uio, ioflag) struct uio *uio; int ioflag; { - register struct rz_softc *sc = &rz_softc[rzunit(dev)]; + register struct rz_softc *sc = &rz_softc[DISKUNIT(dev)]; if (sc->sc_format_pid && sc->sc_format_pid != curproc->p_pid) return (EPERM); @@ -1049,7 +1055,7 @@ rzioctl(dev, cmd, data, flag, p) int flag; struct proc *p; { - register struct rz_softc *sc = &rz_softc[rzunit(dev)]; + register struct rz_softc *sc = &rz_softc[DISKUNIT(dev)]; int error; int flags; struct cpu_disklabel cd; @@ -1115,7 +1121,7 @@ rzioctl(dev, cmd, data, flag, p) /* return the disk partition data */ ((struct partinfo *)data)->disklab = sc->sc_label; ((struct partinfo *)data)->part = - &sc->sc_label->d_partitions[rzpart(dev)]; + &sc->sc_label->d_partitions[DISKPART(dev)]; return (0); case DIOCWLABEL: @@ -1153,8 +1159,8 @@ int rzsize(dev) dev_t dev; { - register int unit = rzunit(dev); - register int part = rzpart(dev); + register int unit = DISKUNIT(dev); + register int part = DISKPART(dev); register struct rz_softc *sc = &rz_softc[unit]; int omask, size; @@ -1558,8 +1564,8 @@ rzdump(dev, blkno, va, size) rzdoingadump = 1; /* Decompose unit and partition. */ - unit = rzunit(dev); - part = rzpart(dev); + unit = DISKUNIT(dev); + part = DISKPART(dev); if (unit >= NRZ) return (ENXIO); diff --git a/sys/arch/pmax/dev/tz.c b/sys/arch/pmax/dev/tz.c index 028b028b646..9bd85814e31 100644 --- a/sys/arch/pmax/dev/tz.c +++ b/sys/arch/pmax/dev/tz.c @@ -140,7 +140,7 @@ tzprobe(xxxsd) sc->sc_cmd.sd = sd; sc->sc_cmd.unit = sd->sd_unit; sc->sc_cmd.flags = 0; - sc->sc_rwcmd.unitNumber = sd->sd_slave; + sc->sc_rwcmd.unitNumber = sd->sd_lun; /* XXX set up device info */ /* XXX */ bzero(&sc->sc_dev, sizeof(sc->sc_dev)); /* XXX */ @@ -151,7 +151,7 @@ tzprobe(xxxsd) /* try to find out what type of device this is */ sc->sc_flags = TZF_ALTCMD; /* force use of sc_cdb */ sc->sc_cdb.len = sizeof(ScsiGroup0Cmd); - scsiGroup0Cmd(SCSI_INQUIRY, sd->sd_slave, 0, sizeof(inqbuf), + scsiGroup0Cmd(SCSI_INQUIRY, sd->sd_lun, 0, sizeof(inqbuf), (ScsiGroup0Cmd *)sc->sc_cdb.cdb); sc->sc_buf.b_flags = B_BUSY | B_READ; sc->sc_buf.b_bcount = sizeof(inqbuf); @@ -169,7 +169,7 @@ tzprobe(xxxsd) /* check for device ready to clear UNIT_ATTN */ sc->sc_cdb.len = sizeof(ScsiGroup0Cmd); - scsiGroup0Cmd(SCSI_TEST_UNIT_READY, sd->sd_slave, 0, 0, + scsiGroup0Cmd(SCSI_TEST_UNIT_READY, sd->sd_lun, 0, 0, (ScsiGroup0Cmd *)sc->sc_cdb.cdb); sc->sc_buf.b_flags = B_BUSY | B_READ; sc->sc_buf.b_bcount = 0; @@ -184,9 +184,9 @@ tzprobe(xxxsd) sc->sc_flags = TZF_ALIVE; sc->sc_modelen = 12; sc->sc_buf.b_flags = 0; - printf("tz%d at %s%d drive %d slave %d", sd->sd_unit, + printf("tz%d at %s%d drive %d lun %d", sd->sd_unit, sd->sd_cdriver->d_name, sd->sd_ctlr, sd->sd_drive, - sd->sd_slave); + sd->sd_lun); if (i == 5 && inqbuf.version == 1 && inqbuf.qualifier == 0x50) { printf(" TK50\n"); sc->sc_tapeid = MT_ISTK50; @@ -229,7 +229,7 @@ tzprobe(xxxsd) } else if (bcmp("HP35450A", pid, 8) == 0) { #if 0 /* XXX "extra" stat makes the HP drive happy at boot time */ - stat = scsi_test_unit_rdy(ctlr, slave, unit); + stat = scsi_test_unit_rdy(ctlr, lun, unit); #endif sc->sc_tapeid = MT_ISHPDAT; } else if (bcmp("123107 SCSI", pid, 11) == 0) { @@ -278,7 +278,7 @@ tzcommand(dev, command, code, count, data) sc->sc_cdb.len = sizeof(ScsiGroup0Cmd); c = (ScsiGroup0Cmd *)sc->sc_cdb.cdb; c->command = command; - c->unitNumber = sc->sc_sd->sd_slave; + c->unitNumber = sc->sc_sd->sd_lun; c->highAddr = code; c->midAddr = count >> 16; c->lowAddr = count >> 8; @@ -499,7 +499,7 @@ tzdone(unit, error, resid, status) */ sc->sc_flags |= TZF_SENSEINPROGRESS; sc->sc_cdb.len = sizeof(ScsiGroup0Cmd); - scsiGroup0Cmd(SCSI_REQUEST_SENSE, sc->sc_sd->sd_slave, + scsiGroup0Cmd(SCSI_REQUEST_SENSE, sc->sc_sd->sd_lun, 0, sizeof(sc->sc_sense.sense), (ScsiGroup0Cmd *)sc->sc_cdb.cdb); sc->sc_errbuf.b_flags = B_BUSY | B_PHYS | B_READ; |