-/* $OpenBSD: mcd.c,v 1.18 1996/12/05 13:15:28 deraadt Exp $ */
+/* $OpenBSD: mcd.c,v 1.19 1997/01/04 08:50:25 deraadt Exp $ */
/* $NetBSD: mcd.c,v 1.49 1996/05/12 23:53:11 mycroft Exp $ */
/*
#define MCDUNIT(dev) DISKUNIT(dev)
#define MAKEMCDDEV(maj, unit, part) MAKEDISKDEV(maj, unit, part)
+#define MCDLABELDEV(dev) (MAKEMCDDEV(major(dev), MCDUNIT(dev), RAW_PART))
+
/* toc */
#define MCD_MAXTOCS 104 /* from the Linux driver */
NULL, "mcd", DV_DISK
};
-void mcdgetdisklabel __P((struct mcd_softc *));
+void mcdgetdisklabel __P((dev_t, struct mcd_softc *));
int mcd_get_parms __P((struct mcd_softc *));
void mcdstrategy __P((struct buf *));
void mcdstart __P((struct mcd_softc *));
goto bad2;
/* Fabricate a disk label. */
- mcdgetdisklabel(sc);
+ mcdgetdisklabel(dev, sc);
}
}
* whether the scsi cd driver is linked in.
*/
void
-mcdgetdisklabel(sc)
+mcdgetdisklabel(dev, sc)
+ dev_t dev;
struct mcd_softc *sc;
{
struct disklabel *lp = sc->sc_dk.dk_label;
/*
* Call the generic disklabel extraction routine
*/
- errstring = readdisklabel(MAKEMCDDEV(0, sc->sc_dev.dv_unit, RAW_PART),
- mcdstrategy, lp, sc->sc_dk.dk_cpulabel);
+ errstring = readdisklabel(MCDLABELDEV(dev), mcdstrategy, lp,
+ sc->sc_dk.dk_cpulabel);
if (errstring) {
printf("%s: %s\n", sc->sc_dev.dv_xname, errstring);
return;
-/* $OpenBSD: wd.c,v 1.23 1996/11/29 22:55:08 niklas Exp $ */
+/* $OpenBSD: wd.c,v 1.24 1997/01/04 08:50:24 deraadt Exp $ */
/* $NetBSD: wd.c,v 1.150 1996/05/12 23:54:03 mycroft Exp $ */
/*
NULL, "wd", DV_DISK
};
-void wdgetdisklabel __P((struct wd_softc *));
+void wdgetdisklabel __P((dev_t, struct wd_softc *));
int wd_get_parms __P((struct wd_softc *));
void wdstrategy __P((struct buf *));
}
/* Load the partition info if not already loaded. */
- wdgetdisklabel(wd);
+ wdgetdisklabel(dev, wd);
}
}
* Fabricate a default disk label, and try to read the correct one.
*/
void
-wdgetdisklabel(wd)
+wdgetdisklabel(dev, wd)
+ dev_t dev;
struct wd_softc *wd;
{
struct disklabel *lp = wd->sc_dk.dk_label;
if (d_link->sc_state > RECAL)
d_link->sc_state = RECAL;
- errstring = readdisklabel(MAKEWDDEV(0, wd->sc_dev.dv_unit, RAW_PART),
- wdstrategy, lp, wd->sc_dk.dk_cpulabel);
+ errstring = readdisklabel(WDLABELDEV(dev), wdstrategy, lp,
+ wd->sc_dk.dk_cpulabel);
if (errstring) {
/*
* This probably happened because the drive's default
*/
if (d_link->sc_state > GEOMETRY)
d_link->sc_state = GEOMETRY;
- errstring = readdisklabel(MAKEWDDEV(0, wd->sc_dev.dv_unit, RAW_PART),
- wdstrategy, lp, wd->sc_dk.dk_cpulabel);
+ errstring = readdisklabel(WDLABELDEV(dev), wdstrategy, lp,
+ wd->sc_dk.dk_cpulabel);
}
if (errstring) {
printf("%s: %s\n", wd->sc_dev.dv_xname, errstring);
-/* $OpenBSD: vnd.c,v 1.7 1996/12/21 05:21:13 deraadt Exp $ */
+/* $OpenBSD: vnd.c,v 1.8 1997/01/04 08:50:22 deraadt Exp $ */
/* $NetBSD: vnd.c,v 1.26 1996/03/30 23:06:11 christos Exp $ */
/*
#define b_cylin b_resid
#define vndunit(x) DISKUNIT(x)
+#define MAKEVNDDEV(maj, unit, part) MAKEDISKDEV(maj, unit, part)
+
+#define VNDLABELDEV(dev) (MAKEVNDDEV(major(dev), vndunit(dev), RAW_PART))
struct vndbuf {
struct buf vb_buf;
void vndthrottle __P((struct vnd_softc *, struct vnode *));
void vndiodone __P((struct buf *));
void vndshutdown __P((void));
-void vndgetdisklabel __P((struct vnd_softc *));
+void vndgetdisklabel __P((dev_t, struct vnd_softc *));
static int vndlock __P((struct vnd_softc *));
static void vndunlock __P((struct vnd_softc *));
if ((sc->sc_flags & VNF_INITED) && (sc->sc_flags & VNF_HAVELABEL) == 0) {
sc->sc_flags |= VNF_HAVELABEL;
- vndgetdisklabel(sc);
+ vndgetdisklabel(dev, sc);
}
part = DISKPART(dev);
* Load the label information on the named device
*/
void
-vndgetdisklabel(sc)
+vndgetdisklabel(dev, sc)
+ dev_t dev;
struct vnd_softc *sc;
{
struct disklabel *lp = sc->sc_dk.dk_label;
/*
* Call the generic disklabel extraction routine
*/
- errstring = readdisklabel(MAKEDISKDEV(0, sc->sc_dev.dv_unit, RAW_PART),
- vndstrategy, lp, sc->sc_dk.dk_cpulabel);
+ errstring = readdisklabel(VNDLABELDEV(dev), vndstrategy, lp,
+ sc->sc_dk.dk_cpulabel);
if (errstring) {
printf("%s: %s\n", sc->sc_dev.dv_xname, errstring);
return;
-/* $OpenBSD: cd.c,v 1.19 1996/12/24 01:33:33 deraadt Exp $ */
+/* $OpenBSD: cd.c,v 1.20 1997/01/04 08:50:20 deraadt Exp $ */
/* $NetBSD: cd.c,v 1.92 1996/05/05 19:52:50 christos Exp $ */
/*
#define CDPART(z) DISKPART(z)
#define MAKECDDEV(maj, unit, part) MAKEDISKDEV(maj, unit, part)
+#define CDLABELDEV(dev) (MAKECDDEV(major(dev), CDUNIT(dev), RAW_PART))
+
struct cd_softc {
struct device sc_dev;
struct disk sc_dk;
void cdunlock __P((struct cd_softc *));
void cdstart __P((void *));
void cdminphys __P((struct buf *));
-void cdgetdisklabel __P((struct cd_softc *));
+void cdgetdisklabel __P((dev_t, struct cd_softc *));
int cddone __P((struct scsi_xfer *, int));
u_long cd_size __P((struct cd_softc *, int));
int cd_get_mode __P((struct cd_softc *, struct cd_mode_data *, int));
SC_DEBUG(sc_link, SDEV_DB3, ("Params loaded "));
/* Fabricate a disk label. */
- cdgetdisklabel(cd);
+ cdgetdisklabel(dev, cd);
SC_DEBUG(sc_link, SDEV_DB3, ("Disklabel fabricated "));
}
}
* data tracks from the TOC and put it in the disklabel
*/
void
-cdgetdisklabel(cd)
+cdgetdisklabel(dev, cd)
+ dev_t dev;
struct cd_softc *cd;
{
struct disklabel *lp = cd->sc_dk.dk_label;
/*
* Call the generic disklabel extraction routine
*/
- errstring = readdisklabel(MAKECDDEV(0, cd->sc_dev.dv_unit, RAW_PART),
- cdstrategy, lp, cd->sc_dk.dk_cpulabel);
+ errstring = readdisklabel(CDLABELDEV(dev), cdstrategy, lp,
+ cd->sc_dk.dk_cpulabel);
if (errstring) {
printf("%s: %s\n", cd->sc_dev.dv_xname, errstring);
return;
-/* $OpenBSD: sd.c,v 1.21 1996/12/11 19:08:18 deraadt Exp $ */
+/* $OpenBSD: sd.c,v 1.22 1997/01/04 08:50:21 deraadt Exp $ */
/* $NetBSD: sd.c,v 1.100.4.1 1996/06/04 23:14:08 thorpej Exp $ */
/*
int sdlock __P((struct sd_softc *));
void sdunlock __P((struct sd_softc *));
void sdminphys __P((struct buf *));
-void sdgetdisklabel __P((struct sd_softc *));
+void sdgetdisklabel __P((dev_t, struct sd_softc *));
void sdstart __P((void *));
int sddone __P((struct scsi_xfer *, int));
int sd_reassign_blocks __P((struct sd_softc *, u_long));
SC_DEBUG(sc_link, SDEV_DB3, ("Params loaded "));
/* Load the partition info if not already loaded. */
- sdgetdisklabel(sd);
+ sdgetdisklabel(dev, sd);
SC_DEBUG(sc_link, SDEV_DB3, ("Disklabel loaded "));
}
}
* Load the label information on the named device
*/
void
-sdgetdisklabel(sd)
+sdgetdisklabel(dev, sd)
+ dev_t dev;
struct sd_softc *sd;
{
struct disklabel *lp = sd->sc_dk.dk_label;
/*
* Call the generic disklabel extraction routine
*/
- errstring = readdisklabel(MAKESDDEV(0, sd->sc_dev.dv_unit, RAW_PART),
- sdstrategy, lp, sd->sc_dk.dk_cpulabel);
+ errstring = readdisklabel(SDLABELDEV(dev), sdstrategy, lp,
+ sd->sc_dk.dk_cpulabel);
if (errstring) {
printf("%s: %s\n", sd->sc_dev.dv_xname, errstring);
return;