PERFORCE change 195300 for review

John Baldwin jhb at FreeBSD.org
Sat Jun 25 12:26:43 UTC 2011


http://p4web.freebsd.org/@@195300?ac=10

Change 195300 by jhb at 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 should


More information about the p4-projects mailing list