aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/ofw
diff options
context:
space:
mode:
authorPeter Grehan <grehan@FreeBSD.org>2003-12-15 09:53:53 +0000
committerPeter Grehan <grehan@FreeBSD.org>2003-12-15 09:53:53 +0000
commitad1c13f493a41c09d9a6f9f6bb9310933be590e1 (patch)
tree80c2f35e265238884da7d6ed29b74deb2964a9af /sys/dev/ofw
parentc8304739991388aa3570e38ac2f6ec996257b0bf (diff)
Notes
Diffstat (limited to 'sys/dev/ofw')
-rw-r--r--sys/dev/ofw/ofw_disk.c12
1 files changed, 9 insertions, 3 deletions
diff --git a/sys/dev/ofw/ofw_disk.c b/sys/dev/ofw/ofw_disk.c
index c37af75fe178..aa0213a4739a 100644
--- a/sys/dev/ofw/ofw_disk.c
+++ b/sys/dev/ofw/ofw_disk.c
@@ -55,7 +55,6 @@ struct ofwd_softc
/*
* Disk device bus interface.
*/
-static void ofwd_identify(driver_t *, device_t);
static int ofwd_probe(device_t);
static int ofwd_attach(device_t);
@@ -141,13 +140,19 @@ static int
ofwd_probe(device_t dev)
{
char *type;
+ char fname[32];
+ phandle_t node;
type = nexus_get_device_type(dev);
+ node = nexus_get_node(dev);
if (type == NULL ||
(strcmp(type, "disk") != 0 && strcmp(type, "block") != 0))
return (ENXIO);
+ if (OF_getprop(node, "file", fname, sizeof(fname)) == -1)
+ return (ENXIO);
+
device_set_desc(dev, "OpenFirmware disk");
return (0);
}
@@ -157,14 +162,15 @@ ofwd_attach(device_t dev)
{
struct ofwd_softc *sc;
char path[128];
- dev_t dsk;
+ char fname[32];
sc = device_get_softc(dev);
sc->ofwd_dev = dev;
bzero(path, 128);
OF_package_to_path(nexus_get_node(dev), path, 128);
- device_printf(dev, "located at %s\n", path);
+ OF_getprop(nexus_get_node(dev), "file", fname, sizeof(fname));
+ device_printf(dev, "located at %s, file %s\n", path, fname);
sc->ofwd_instance = OF_open(path);
if (sc->ofwd_instance == -1) {
device_printf(dev, "could not create instance\n");