summaryrefslogtreecommitdiffstats
path: root/sys/sys/bus.h
diff options
context:
space:
mode:
authorimp <imp@FreeBSD.org>2002-09-14 19:15:12 +0000
committerimp <imp@FreeBSD.org>2002-09-14 19:15:12 +0000
commit79ce8a243fa3651af69ae1551da894135499e83b (patch)
treefdc43c422253cb35ae8bbfd4281e64b3f404adf1 /sys/sys/bus.h
parent9f453489a615471851c648b9fa0bf3b8893dffc3 (diff)
downloadFreeBSD-src-79ce8a243fa3651af69ae1551da894135499e83b.zip
FreeBSD-src-79ce8a243fa3651af69ae1551da894135499e83b.tar.gz
Add additional information returned to userland by the device querying
functions. We add pnpinfo, locationinfo, devflags (the newbus flags on the device), flags (the flags that device_get_flags returns) and state to the list of things we return. pnpinfo and locationinfo are place holders at the moment that will be filled in by the device's parent (optionally). Userland programs will likely use this information from time to time and take appropriate actions. Improvements to devinfo to follow.
Diffstat (limited to 'sys/sys/bus.h')
-rw-r--r--sys/sys/bus.h28
1 files changed, 18 insertions, 10 deletions
diff --git a/sys/sys/bus.h b/sys/sys/bus.h
index 826126c..8c6b1bd 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.
OpenPOWER on IntegriCloud