version 1.268, 2020/02/25 19:34:37 |
version 1.269, 2020/02/27 20:16:38 |
Line 549 no_devmon_insert(const char *name, prop_ |
|
Line 549 no_devmon_insert(const char *name, prop_ |
|
static void |
static void |
devmon_report_device(device_t dev, bool isattach) |
devmon_report_device(device_t dev, bool isattach) |
{ |
{ |
prop_dictionary_t ev; |
prop_dictionary_t ev, dict = device_properties(dev); |
const char *parent; |
const char *parent; |
const char *what; |
const char *what; |
|
const char *where; |
device_t pdev = device_parent(dev); |
device_t pdev = device_parent(dev); |
|
|
/* If currently no drvctl device, just return */ |
/* If currently no drvctl device, just return */ |
Line 564 devmon_report_device(device_t dev, bool |
|
Line 565 devmon_report_device(device_t dev, bool |
|
|
|
what = (isattach ? "device-attach" : "device-detach"); |
what = (isattach ? "device-attach" : "device-detach"); |
parent = (pdev == NULL ? "root" : device_xname(pdev)); |
parent = (pdev == NULL ? "root" : device_xname(pdev)); |
|
if (prop_dictionary_get_cstring_nocopy(dict, "location", &where)) { |
|
prop_dictionary_set_cstring(ev, "location", where); |
|
aprint_debug("ev: %s %s at %s in [%s]\n", |
|
what, device_xname(dev), parent, where); |
|
} |
if (!prop_dictionary_set_cstring(ev, "device", device_xname(dev)) || |
if (!prop_dictionary_set_cstring(ev, "device", device_xname(dev)) || |
!prop_dictionary_set_cstring(ev, "parent", parent)) { |
!prop_dictionary_set_cstring(ev, "parent", parent)) { |
prop_object_release(ev); |
prop_object_release(ev); |