Don't actually do the raw prom open here.
This commit is contained in:
parent
8447dd624c
commit
b0367fb980
|
@ -1,4 +1,4 @@
|
||||||
/* $NetBSD: disk.c,v 1.7 1997/09/06 14:08:28 drochner Exp $ */
|
/* $NetBSD: disk.c,v 1.8 1998/10/15 00:48:55 ross Exp $ */
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 1992, 1993
|
* Copyright (c) 1992, 1993
|
||||||
|
@ -98,34 +98,20 @@ diskopen(f, ctlr, unit, part)
|
||||||
struct open_file *f;
|
struct open_file *f;
|
||||||
int ctlr, unit, part;
|
int ctlr, unit, part;
|
||||||
{
|
{
|
||||||
struct disklabel *lp;
|
int i;
|
||||||
prom_return_t ret;
|
|
||||||
size_t cnt;
|
size_t cnt;
|
||||||
int devlen, i;
|
struct disklabel *lp;
|
||||||
char *msg, buf[DEV_BSIZE], devname[32];
|
char *msg, buf[DEV_BSIZE];
|
||||||
struct disk_softc *sc;
|
struct disk_softc *sc;
|
||||||
|
|
||||||
if (unit >= 8 || part >= MAXPARTITIONS)
|
if (unit >= 8 || part >= MAXPARTITIONS)
|
||||||
return (ENXIO);
|
return (ENXIO);
|
||||||
/*
|
|
||||||
* XXX
|
|
||||||
* We don't know what device names look like yet,
|
|
||||||
* so we can't change them.
|
|
||||||
*/
|
|
||||||
ret.bits = prom_getenv(PROM_E_BOOTED_DEV, devname, sizeof(devname));
|
|
||||||
devlen = ret.u.retval;
|
|
||||||
|
|
||||||
ret.bits = prom_open(devname, devlen);
|
|
||||||
if (ret.u.status == 2)
|
|
||||||
return (ENXIO);
|
|
||||||
if (ret.u.status == 3)
|
|
||||||
return (EIO);
|
|
||||||
|
|
||||||
sc = alloc(sizeof(struct disk_softc));
|
sc = alloc(sizeof(struct disk_softc));
|
||||||
bzero(sc, sizeof(struct disk_softc));
|
bzero(sc, sizeof(struct disk_softc));
|
||||||
f->f_devdata = (void *)sc;
|
f->f_devdata = (void *)sc;
|
||||||
|
|
||||||
sc->sc_fd = ret.u.retval;
|
sc->sc_fd = booted_dev_fd;
|
||||||
sc->sc_ctlr = ctlr;
|
sc->sc_ctlr = ctlr;
|
||||||
sc->sc_unit = unit;
|
sc->sc_unit = unit;
|
||||||
sc->sc_part = part;
|
sc->sc_part = part;
|
||||||
|
|
Loading…
Reference in New Issue