MCPcopy Create free account
hub / github.com/F-Stack/f-stack / devaddq

Function devaddq

freebsd/kern/subr_bus.c:721–756  ·  view source on GitHub ↗

* Common routine that tries to make sending messages as easy as possible. * We allocate memory for the data, copy strings into that, but do not * free it unless there's an error. The dequeue part of the driver should * free the data. We don't send data when the device is disabled. We do * send data, even when we have no listeners, because we wish to avoid * races relating to startup and re

Source from the content-addressed store, hash-verified

719 * ${type}${what} at $(location dev) $(pnp-info dev) on $(parent dev)
720 */
721static void
722devaddq(const char *type, const char *what, device_t dev)
723{
724 struct dev_event_info *dei;
725 const char *parstr;
726 struct sbuf sb;
727
728 dei = devctl_alloc_dei_sb(&sb);
729 if (dei == NULL)
730 return;
731 sbuf_cpy(&sb, type);
732 sbuf_cat(&sb, what);
733 sbuf_cat(&sb, " at ");
734
735 /* Add in the location */
736 bus_child_location_sb(dev, &sb);
737 sbuf_putc(&sb, ' ');
738
739 /* Add in pnpinfo */
740 bus_child_pnpinfo_sb(dev, &sb);
741
742 /* Get the parent of this device, or / if high enough in the tree. */
743 if (device_get_parent(dev) == NULL)
744 parstr = "."; /* Or '/' ? */
745 else
746 parstr = device_get_nameunit(device_get_parent(dev));
747 sbuf_cat(&sb, " on ");
748 sbuf_cat(&sb, parstr);
749 sbuf_putc(&sb, '\n');
750 if (sbuf_finish(&sb) != 0)
751 goto bad;
752 devctl_queue(dei);
753 return;
754bad:
755 devctl_free_dei(dei);
756}
757
758/*
759 * A device was added to the tree. We are called just after it successfully

Callers 3

devaddedFunction · 0.85
devremovedFunction · 0.85
devnomatchFunction · 0.85

Calls 11

devctl_alloc_dei_sbFunction · 0.85
sbuf_cpyFunction · 0.85
sbuf_catFunction · 0.85
bus_child_location_sbFunction · 0.85
sbuf_putcFunction · 0.85
bus_child_pnpinfo_sbFunction · 0.85
device_get_parentFunction · 0.85
device_get_nameunitFunction · 0.85
sbuf_finishFunction · 0.85
devctl_queueFunction · 0.85
devctl_free_deiFunction · 0.85

Tested by

no test coverage detected