diff options
| -rw-r--r-- | sys/kern/subr_bus.c | 5 | ||||
| -rw-r--r-- | sys/sys/bus.h | 28 |
2 files changed, 23 insertions, 10 deletions
diff --git a/sys/kern/subr_bus.c b/sys/kern/subr_bus.c index d0b187a449de..fbadf0b76487 100644 --- a/sys/kern/subr_bus.c +++ b/sys/kern/subr_bus.c @@ -2097,6 +2097,11 @@ sysctl_devices(SYSCTL_HANDLER_ARGS) } else { snprintf(udev.dv_drivername, 32, "%s", dev->driver->name); } + udev.dv_pnpinfo[0] = 0; + udev.dv_location[0] = 0; + udev.dv_devflags = dev->devflags; + udev.dv_flags = dev->flags; + udev.dv_state = dev->state; error = SYSCTL_OUT(req, &udev, sizeof(udev)); return (error); } diff --git a/sys/sys/bus.h b/sys/sys/bus.h index 826126c1fe9b..8c6b1bde5f64 100644 --- a/sys/sys/bus.h +++ b/sys/sys/bus.h @@ -39,15 +39,30 @@ struct u_businfo { }; /* + * State of the device. + */ +typedef enum device_state { + DS_NOTPRESENT, /* not probed or probe failed */ + DS_ALIVE, /* probe succeeded */ + DS_ATTACHED, /* attach method called */ + DS_BUSY /* device is open */ +} device_state_t; + +/* * Device information exported to userspace. */ struct u_device { uintptr_t dv_handle; uintptr_t dv_parent; - char dv_name[32]; - char dv_desc[32]; - char dv_drivername[32]; + char dv_name[32]; /* Name of device in tree. */ + char dv_desc[32]; /* Driver description */ + char dv_drivername[32]; /* Driver name */ + char dv_pnpinfo[64]; /* Plug and play info */ + char dv_location[64]; /* Where is the device? */ + uint32_t dv_devflags; /* API Flags for device */ + uint16_t dv_flags; /* flags for dev date */ + device_state_t dv_state; /* State of attachment */ /* XXX more driver info? */ }; @@ -102,13 +117,6 @@ struct driver { void *priv; /* driver private data */ }; -typedef enum device_state { - DS_NOTPRESENT, /* not probed or probe failed */ - DS_ALIVE, /* probe succeeded */ - DS_ATTACHED, /* attach method called */ - DS_BUSY /* device is open */ -} device_state_t; - /* * Definitions for drivers which need to keep simple lists of resources * for their child devices. |
