Index: head/tools/tools/ncpus/acpi.c =================================================================== --- head/tools/tools/ncpus/acpi.c (revision 199016) +++ head/tools/tools/ncpus/acpi.c (working copy) @@ -247,13 +247,13 @@ devstate(devinfo_state_t state) { switch (state) { - case DIS_NOTPRESENT: + case DS_NOTPRESENT: return "not-present"; - case DIS_ALIVE: + case DS_ALIVE: return "alive"; - case DIS_ATTACHED: + case DS_ATTACHED: return "attached"; - case DIS_BUSY: + case DS_BUSY: return "busy"; default: return "unknown-state"; @@ -266,8 +266,8 @@ printf("%s: %s %s\n", __func__, dd->dd_name, devstate(dd->dd_state)); /* NB: device must be present AND attached */ if (strcmp(dd->dd_name, "acpi0") == 0) - return (dd->dd_state == DIS_ATTACHED || - dd->dd_state == DIS_BUSY); + return (dd->dd_state == DS_ATTACHED || + dd->dd_state == DS_BUSY); return devinfo_foreach_device_child(dd, acpi0_check, arg); } Index: head/usr.sbin/sysinstall/acpi.c =================================================================== --- head/usr.sbin/sysinstall/acpi.c (revision 199016) +++ head/usr.sbin/sysinstall/acpi.c (working copy) @@ -261,13 +261,13 @@ devstate(devinfo_state_t state) { switch (state) { - case DIS_NOTPRESENT: + case DS_NOTPRESENT: return "not-present"; - case DIS_ALIVE: + case DS_ALIVE: return "alive"; - case DIS_ATTACHED: + case DS_ATTACHED: return "attached"; - case DIS_BUSY: + case DS_BUSY: return "busy"; default: return "unknown-state"; @@ -280,8 +280,8 @@ printf("%s: %s %s\n", __func__, dd->dd_name, devstate(dd->dd_state)); /* NB: device must be present AND attached */ if (strcmp(dd->dd_name, "acpi0") == 0) - return (dd->dd_state == DIS_ATTACHED || - dd->dd_state == DIS_BUSY); + return (dd->dd_state == DS_ATTACHED || + dd->dd_state == DS_BUSY); return devinfo_foreach_device_child(dd, acpi0_check, arg); } Index: head/usr.sbin/devinfo/devinfo.c =================================================================== --- head/usr.sbin/devinfo/devinfo.c (revision 199016) +++ head/usr.sbin/devinfo/devinfo.c (working copy) @@ -137,7 +137,7 @@ struct indent_arg ia; int i, indent; - if (vflag || (dev->dd_name[0] != 0 && dev->dd_state >= DIS_ATTACHED)) { + if (vflag || (dev->dd_name[0] != 0 && dev->dd_state >= DS_ATTACHED)) { indent = (int)(intptr_t)arg; for (i = 0; i < indent; i++) printf(" "); Index: head/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_device_tbl.c =================================================================== --- head/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_device_tbl.c (revision 199016) +++ head/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_device_tbl.c (working copy) @@ -352,11 +352,11 @@ assert(dev != NULL); switch (dev->dd_state) { - case DIS_ALIVE: /* probe succeeded */ - case DIS_NOTPRESENT: /* not probed or probe failed */ + case DS_ALIVE: /* probe succeeded */ + case DS_NOTPRESENT: /* not probed or probe failed */ return (DS_DOWN); - case DIS_ATTACHED: /* attach method called */ - case DIS_BUSY: /* device is open */ + case DS_ATTACHED: /* attach method called */ + case DS_BUSY: /* device is open */ return (DS_RUNNING); default: return (DS_UNKNOWN); Index: head/lib/libdevinfo/devinfo.h =================================================================== --- head/lib/libdevinfo/devinfo.h (revision 199016) +++ head/lib/libdevinfo/devinfo.h (working copy) @@ -32,20 +32,12 @@ #include #include +#include typedef __uintptr_t devinfo_handle_t; #define DEVINFO_ROOT_DEVICE ((devinfo_handle_t)0) -/* - * State of the device. - */ -/* XXX not sure if I want a copy here, or expose sys/bus.h */ -typedef enum devinfo_state { - DIS_NOTPRESENT = 10, /* not probed or probe failed */ - DIS_ALIVE = 20, /* probe succeeded */ - DIS_ATTACHED = 30, /* attach method called */ - DIS_BUSY = 40 /* device is open */ -} devinfo_state_t; +typedef enum device_state devinfo_state_t; struct devinfo_dev { devinfo_handle_t dd_handle; /* device handle */