Date: Sat, 25 Jun 2011 12:26:42 GMT From: John Baldwin <jhb@FreeBSD.org> To: Perforce Change Reviews <perforce@freebsd.org> Subject: PERFORCE change 195300 for review Message-ID: <201106251226.p5PCQgTC058880@skunkworks.freebsd.org>
index | next in thread | raw e-mail
http://p4web.freebsd.org/@@195300?ac=10 Change 195300 by jhb@jhb_kavik on 2011/06/25 12:25:54 Move pcib_child_name() to pci_subr.c. Affected files ... .. //depot/projects/pci/sys/dev/pci/pci_pci.c#25 edit .. //depot/projects/pci/sys/dev/pci/pci_subr.c#3 edit Differences ... ==== //depot/projects/pci/sys/dev/pci/pci_pci.c#25 (text+ko) ==== @@ -788,18 +788,6 @@ } #ifdef NEW_PCIB -const char * -pcib_child_name(device_t child) -{ - static char buf[64]; - - if (device_get_nameunit(child) != NULL) - return (device_get_nameunit(child)); - snprintf(buf, sizeof(buf), "pci%d:%d:%d:%d", pci_get_domain(child), - pci_get_bus(child), pci_get_slot(child), pci_get_function(child)); - return (buf); -} - /* * Attempt to allocate a resource from the existing resources assigned * to a window. ==== //depot/projects/pci/sys/dev/pci/pci_subr.c#3 (text+ko) ==== @@ -132,6 +132,23 @@ #ifdef NEW_PCIB /* + * Return a pointer to a pretty name for a PCI device. If the device + * has a driver attached, the device's name is used, otherwise a name + * is generated from the device's PCI address. + */ +const char * +pcib_child_name(device_t child) +{ + static char buf[64]; + + if (device_get_nameunit(child) != NULL) + return (device_get_nameunit(child)); + snprintf(buf, sizeof(buf), "pci%d:%d:%d:%d", pci_get_domain(child), + pci_get_bus(child), pci_get_slot(child), pci_get_function(child)); + return (buf); +} + +/* * Some Host-PCI bridge drivers know which resource ranges they can * decode and should only allocate subranges to child PCI devices. * This API provides a way to manage this. The bridge drive shouldhelp
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201106251226.p5PCQgTC058880>
