From owner-svn-src-head@freebsd.org Wed Apr 27 17:49:44 2016 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 1FACAB1EE36; Wed, 27 Apr 2016 17:49:44 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EE4F41802; Wed, 27 Apr 2016 17:49:43 +0000 (UTC) (envelope-from jhb@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id u3RHnhMF051457; Wed, 27 Apr 2016 17:49:43 GMT (envelope-from jhb@FreeBSD.org) Received: (from jhb@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id u3RHngl6051451; Wed, 27 Apr 2016 17:49:42 GMT (envelope-from jhb@FreeBSD.org) Message-Id: <201604271749.u3RHngl6051451@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: jhb set sender to jhb@FreeBSD.org using -f From: John Baldwin Date: Wed, 27 Apr 2016 17:49:42 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r298712 - in head/sys: dev/cardbus kern mips/nlm powerpc/ofw sparc64/pci sys X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 27 Apr 2016 17:49:44 -0000 Author: jhb Date: Wed Apr 27 17:49:42 2016 New Revision: 298712 URL: https://svnweb.freebsd.org/changeset/base/298712 Log: Add a bus_null_rescan() method that always fails with an error. Use this in place of kobj_error_method to disable BUS_RESCAN() on PCI drivers that do not use the "standard" scanning algorithm. Modified: head/sys/dev/cardbus/cardbus.c head/sys/kern/subr_bus.c head/sys/mips/nlm/xlp_pci.c head/sys/powerpc/ofw/ofw_pcibus.c head/sys/sparc64/pci/ofw_pcibus.c head/sys/sys/bus.h Modified: head/sys/dev/cardbus/cardbus.c ============================================================================== --- head/sys/dev/cardbus/cardbus.c Wed Apr 27 16:39:05 2016 (r298711) +++ head/sys/dev/cardbus/cardbus.c Wed Apr 27 17:49:42 2016 (r298712) @@ -346,7 +346,7 @@ static device_method_t cardbus_methods[] DEVMETHOD(bus_get_dma_tag, bus_generic_get_dma_tag), DEVMETHOD(bus_read_ivar, cardbus_read_ivar), DEVMETHOD(bus_driver_added, cardbus_driver_added), - DEVMETHOD(bus_rescan, kobj_error_method), + DEVMETHOD(bus_rescan, bus_null_rescan), /* Card Interface */ DEVMETHOD(card_attach_card, cardbus_attach_card), Modified: head/sys/kern/subr_bus.c ============================================================================== --- head/sys/kern/subr_bus.c Wed Apr 27 16:39:05 2016 (r298711) +++ head/sys/kern/subr_bus.c Wed Apr 27 17:49:42 2016 (r298712) @@ -4289,6 +4289,19 @@ bus_generic_get_domain(device_t dev, dev return (ENOENT); } +/** + * @brief Helper function for implementing BUS_RESCAN(). + * + * This null implementation of BUS_RESCAN() always fails to indicate + * the bus does not support rescanning. + */ +int +bus_null_rescan(device_t dev) +{ + + return (ENXIO); +} + /* * Some convenience functions to make it easier for drivers to use the * resource-management functions. All these really do is hide the Modified: head/sys/mips/nlm/xlp_pci.c ============================================================================== --- head/sys/mips/nlm/xlp_pci.c Wed Apr 27 16:39:05 2016 (r298711) +++ head/sys/mips/nlm/xlp_pci.c Wed Apr 27 17:49:42 2016 (r298712) @@ -154,7 +154,7 @@ static device_method_t xlp_pci_methods[] /* Device interface */ DEVMETHOD(device_probe, xlp_pci_probe), DEVMETHOD(device_attach, xlp_pci_attach), - DEVMETHOD(bus_rescan, kobj_error_method), + DEVMETHOD(bus_rescan, bus_null_rescan), DEVMETHOD_END }; Modified: head/sys/powerpc/ofw/ofw_pcibus.c ============================================================================== --- head/sys/powerpc/ofw/ofw_pcibus.c Wed Apr 27 16:39:05 2016 (r298711) +++ head/sys/powerpc/ofw/ofw_pcibus.c Wed Apr 27 17:49:42 2016 (r298712) @@ -77,7 +77,7 @@ static device_method_t ofw_pcibus_method /* Bus interface */ DEVMETHOD(bus_child_deleted, ofw_pcibus_child_deleted), DEVMETHOD(bus_child_pnpinfo_str, ofw_pcibus_child_pnpinfo_str_method), - DEVMETHOD(bus_rescan, kobj_error_method), + DEVMETHOD(bus_rescan, bus_null_rescan), /* PCI interface */ DEVMETHOD(pci_alloc_devinfo, ofw_pcibus_alloc_devinfo), Modified: head/sys/sparc64/pci/ofw_pcibus.c ============================================================================== --- head/sys/sparc64/pci/ofw_pcibus.c Wed Apr 27 16:39:05 2016 (r298711) +++ head/sys/sparc64/pci/ofw_pcibus.c Wed Apr 27 17:49:42 2016 (r298712) @@ -81,7 +81,7 @@ static device_method_t ofw_pcibus_method /* Bus interface */ DEVMETHOD(bus_child_deleted, ofw_pcibus_child_deleted), DEVMETHOD(bus_child_pnpinfo_str, ofw_pcibus_pnpinfo_str), - DEVMETHOD(bus_rescan, kobj_error_method), + DEVMETHOD(bus_rescan, bus_null_rescan), /* PCI interface */ DEVMETHOD(pci_alloc_devinfo, ofw_pcibus_alloc_devinfo), Modified: head/sys/sys/bus.h ============================================================================== --- head/sys/sys/bus.h Wed Apr 27 16:39:05 2016 (r298711) +++ head/sys/sys/bus.h Wed Apr 27 17:49:42 2016 (r298712) @@ -430,6 +430,7 @@ int bus_generic_teardown_intr(device_t d struct resource *irq, void *cookie); int bus_generic_write_ivar(device_t dev, device_t child, int which, uintptr_t value); +int bus_null_rescan(device_t dev); /* * Wrapper functions for the BUS_*_RESOURCE methods to make client code