summaryrefslogtreecommitdiffstats
path: root/usr.sbin/devinfo
diff options
context:
space:
mode:
authorjhb <jhb@FreeBSD.org>2015-02-05 22:42:44 +0000
committerjhb <jhb@FreeBSD.org>2015-02-05 22:42:44 +0000
commit5114ec1b5901da1209afc0a7ac35616908bdf0e0 (patch)
tree79bbff0e909cce20413c5d44e7af2fda06e5bfa1 /usr.sbin/devinfo
parent49ba8ceb19505a0e0d49b2b436526bf135193ef9 (diff)
downloadFreeBSD-src-5114ec1b5901da1209afc0a7ac35616908bdf0e0.zip
FreeBSD-src-5114ec1b5901da1209afc0a7ac35616908bdf0e0.tar.gz
Expose the constants for internal new-bus device flags to userland. The
flag value is already exposed via dv_flags, just not the meaning of the flags themselves. Use these constants to annotate devices that are disabled or suspended in devinfo output.
Diffstat (limited to 'usr.sbin/devinfo')
-rw-r--r--usr.sbin/devinfo/devinfo.c4
1 files changed, 4 insertions, 0 deletions
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