summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lib/libdevinfo/devinfo.h2
-rw-r--r--sys/kern/subr_bus.c9
-rw-r--r--sys/sys/bus.h13
-rw-r--r--usr.sbin/devinfo/devinfo.c4
4 files changed, 17 insertions, 11 deletions
diff --git a/lib/libdevinfo/devinfo.h b/lib/libdevinfo/devinfo.h
index c8990a6..b0b8cec 100644
--- a/lib/libdevinfo/devinfo.h
+++ b/lib/libdevinfo/devinfo.h
@@ -50,7 +50,7 @@ struct devinfo_dev {
char *dd_location; /* Where bus thinks dev at */
uint32_t dd_devflags; /* API flags */
uint16_t dd_flags; /* internal dev flags */
- devinfo_state_t dd_state; /* attacement state of dev */
+ devinfo_state_t dd_state; /* attachment state of dev */
};
struct devinfo_rman {
diff --git a/sys/kern/subr_bus.c b/sys/kern/subr_bus.c
index a875e4b..269be94 100644
--- a/sys/kern/subr_bus.c
+++ b/sys/kern/subr_bus.c
@@ -128,15 +128,6 @@ struct device {
device_state_t state; /**< current device state */
uint32_t devflags; /**< api level flags for device_get_flags() */
u_int flags; /**< internal device flags */
-#define DF_ENABLED 0x01 /* device should be probed/attached */
-#define DF_FIXEDCLASS 0x02 /* devclass specified at create time */
-#define DF_WILDCARD 0x04 /* unit was originally wildcard */
-#define DF_DESCMALLOCED 0x08 /* description was malloced */
-#define DF_QUIET 0x10 /* don't print verbose attach message */
-#define DF_DONENOMATCH 0x20 /* don't execute DEVICE_NOMATCH again */
-#define DF_EXTERNALSOFTC 0x40 /* softc not allocated by us */
-#define DF_REBID 0x80 /* Can rebid after attach */
-#define DF_SUSPENDED 0x100 /* Device is suspended. */
u_int order; /**< order from device_add_child_ordered() */
void *ivars; /**< instance variables */
void *softc; /**< current driver's variables */
diff --git a/sys/sys/bus.h b/sys/sys/bus.h
index b15a556..f15dd34 100644
--- a/sys/sys/bus.h
+++ b/sys/sys/bus.h
@@ -70,11 +70,22 @@ struct u_device {
char dv_pnpinfo[128]; /**< @brief Plug and play info */
char dv_location[128]; /**< @brief Where is the device? */
uint32_t dv_devflags; /**< @brief API Flags for device */
- uint16_t dv_flags; /**< @brief flags for dev date */
+ uint16_t dv_flags; /**< @brief flags for dev state */
device_state_t dv_state; /**< @brief State of attachment */
/* XXX more driver info? */
};
+/* Flags exported via dv_flags. */
+#define DF_ENABLED 0x01 /* device should be probed/attached */
+#define DF_FIXEDCLASS 0x02 /* devclass specified at create time */
+#define DF_WILDCARD 0x04 /* unit was originally wildcard */
+#define DF_DESCMALLOCED 0x08 /* description was malloced */
+#define DF_QUIET 0x10 /* don't print verbose attach message */
+#define DF_DONENOMATCH 0x20 /* don't execute DEVICE_NOMATCH again */
+#define DF_EXTERNALSOFTC 0x40 /* softc not allocated by us */
+#define DF_REBID 0x80 /* Can rebid after attach */
+#define DF_SUSPENDED 0x100 /* Device is suspended. */
+
#ifdef _KERNEL
#include <sys/queue.h>
diff --git a/usr.sbin/devinfo/devinfo.c b/usr.sbin/devinfo/devinfo.c
index 32d2932..40f2b0b 100644
--- a/usr.sbin/devinfo/devinfo.c
+++ b/usr.sbin/devinfo/devinfo.c
@@ -146,6 +146,10 @@ print_device(struct devinfo_dev *dev, void *arg)
printf(" pnpinfo %s", dev->dd_pnpinfo);
if (vflag && *dev->dd_location)
printf(" at %s", dev->dd_location);
+ if (!(dev->dd_flags & DF_ENABLED))
+ printf(" (disabled)");
+ else if (dev->dd_flags & DF_SUSPENDED)
+ printf(" (suspended)");
printf("\n");
if (rflag) {
ia.indent = indent + 4;
OpenPOWER on IntegriCloud