From owner-p4-projects@FreeBSD.ORG Sat Jun 25 12:26:43 2011 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id D9B53106566C; Sat, 25 Jun 2011 12:26:42 +0000 (UTC) Delivered-To: perforce@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 9C4E0106564A for ; Sat, 25 Jun 2011 12:26:42 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from skunkworks.freebsd.org (skunkworks.freebsd.org [IPv6:2001:4f8:fff6::2d]) by mx1.freebsd.org (Postfix) with ESMTP id 8B2FC8FC0C for ; Sat, 25 Jun 2011 12:26:42 +0000 (UTC) Received: from skunkworks.freebsd.org (localhost [127.0.0.1]) by skunkworks.freebsd.org (8.14.4/8.14.4) with ESMTP id p5PCQgHk058883 for ; Sat, 25 Jun 2011 12:26:42 GMT (envelope-from jhb@freebsd.org) Received: (from perforce@localhost) by skunkworks.freebsd.org (8.14.4/8.14.4/Submit) id p5PCQgTC058880 for perforce@freebsd.org; Sat, 25 Jun 2011 12:26:42 GMT (envelope-from jhb@freebsd.org) Date: Sat, 25 Jun 2011 12:26:42 GMT Message-Id: <201106251226.p5PCQgTC058880@skunkworks.freebsd.org> X-Authentication-Warning: skunkworks.freebsd.org: perforce set sender to jhb@freebsd.org using -f From: John Baldwin To: Perforce Change Reviews Precedence: bulk Cc: Subject: PERFORCE change 195300 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 25 Jun 2011 12:26:43 -0000 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 should