Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 27 Apr 2011 21:13:41 +0000 (UTC)
From:      John Baldwin <jhb@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-7@freebsd.org
Subject:   svn commit: r221141 - in stable/7/sys/dev: acpica pci
Message-ID:  <201104272113.p3RLDfPe090517@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: jhb
Date: Wed Apr 27 21:13:40 2011
New Revision: 221141
URL: http://svn.freebsd.org/changeset/base/221141

Log:
  MFC 210864:
  - Retire acpi_pcib_resume().  It is has just been an alias for
    bus_generic_resume() since the pci_link(4) driver was added.
  - Change the ACPI PCI-PCI bridge driver to inherit most of its methods
    from the generic PCI-PCI bridge driver.
  - This also exposes the generic PCI-PCI bridge driver as pcib_driver so
    other drivers can inherit from it.

Modified:
  stable/7/sys/dev/acpica/acpi_pcib.c
  stable/7/sys/dev/acpica/acpi_pcib_acpi.c
  stable/7/sys/dev/acpica/acpi_pcib_pci.c
  stable/7/sys/dev/acpica/acpi_pcibvar.h
  stable/7/sys/dev/pci/pcib_private.h
Directory Properties:
  stable/7/sys/   (props changed)
  stable/7/sys/cddl/contrib/opensolaris/   (props changed)
  stable/7/sys/contrib/dev/acpica/   (props changed)
  stable/7/sys/contrib/pf/   (props changed)

Modified: stable/7/sys/dev/acpica/acpi_pcib.c
==============================================================================
--- stable/7/sys/dev/acpica/acpi_pcib.c	Wed Apr 27 21:13:20 2011	(r221140)
+++ stable/7/sys/dev/acpica/acpi_pcib.c	Wed Apr 27 21:13:40 2011	(r221141)
@@ -170,13 +170,6 @@ acpi_pcib_attach(device_t dev, ACPI_BUFF
     return_VALUE (bus_generic_attach(dev));
 }
 
-int
-acpi_pcib_resume(device_t dev)
-{
-
-    return (bus_generic_resume(dev));
-}
-
 static void
 prt_lookup_device(ACPI_PCI_ROUTING_TABLE *entry, void *arg)
 {

Modified: stable/7/sys/dev/acpica/acpi_pcib_acpi.c
==============================================================================
--- stable/7/sys/dev/acpica/acpi_pcib_acpi.c	Wed Apr 27 21:13:20 2011	(r221140)
+++ stable/7/sys/dev/acpica/acpi_pcib_acpi.c	Wed Apr 27 21:13:40 2011	(r221141)
@@ -63,7 +63,6 @@ struct acpi_hpcib_softc {
 
 static int		acpi_pcib_acpi_probe(device_t bus);
 static int		acpi_pcib_acpi_attach(device_t bus);
-static int		acpi_pcib_acpi_resume(device_t bus);
 static int		acpi_pcib_read_ivar(device_t dev, device_t child,
 			    int which, uintptr_t *result);
 static int		acpi_pcib_write_ivar(device_t dev, device_t child,
@@ -91,7 +90,7 @@ static device_method_t acpi_pcib_acpi_me
     DEVMETHOD(device_attach,		acpi_pcib_acpi_attach),
     DEVMETHOD(device_shutdown,		bus_generic_shutdown),
     DEVMETHOD(device_suspend,		bus_generic_suspend),
-    DEVMETHOD(device_resume,		acpi_pcib_acpi_resume),
+    DEVMETHOD(device_resume,		bus_generic_resume),
 
     /* Bus interface */
     DEVMETHOD(bus_print_child,		bus_generic_print_child),
@@ -250,13 +249,6 @@ acpi_pcib_acpi_attach(device_t dev)
     return (acpi_pcib_attach(dev, &sc->ap_prt, sc->ap_bus));
 }
 
-static int
-acpi_pcib_acpi_resume(device_t dev)
-{
-
-    return (acpi_pcib_resume(dev));
-}
-
 /*
  * Support for standard PCI bridge ivars.
  */

Modified: stable/7/sys/dev/acpica/acpi_pcib_pci.c
==============================================================================
--- stable/7/sys/dev/acpica/acpi_pcib_pci.c	Wed Apr 27 21:13:20 2011	(r221140)
+++ stable/7/sys/dev/acpica/acpi_pcib_pci.c	Wed Apr 27 21:13:40 2011	(r221141)
@@ -63,7 +63,6 @@ struct acpi_pcib_lookup_info {
 
 static int		acpi_pcib_pci_probe(device_t bus);
 static int		acpi_pcib_pci_attach(device_t bus);
-static int		acpi_pcib_pci_resume(device_t bus);
 static int		acpi_pcib_read_ivar(device_t dev, device_t child,
 			    int which, uintptr_t *result);
 static int		acpi_pcib_pci_route_interrupt(device_t pcib,
@@ -73,39 +72,20 @@ static device_method_t acpi_pcib_pci_met
     /* Device interface */
     DEVMETHOD(device_probe,		acpi_pcib_pci_probe),
     DEVMETHOD(device_attach,		acpi_pcib_pci_attach),
-    DEVMETHOD(device_shutdown,		bus_generic_shutdown),
-    DEVMETHOD(device_suspend,		bus_generic_suspend),
-    DEVMETHOD(device_resume,		acpi_pcib_pci_resume),
 
     /* Bus interface */
-    DEVMETHOD(bus_print_child,		bus_generic_print_child),
     DEVMETHOD(bus_read_ivar,		acpi_pcib_read_ivar),
-    DEVMETHOD(bus_write_ivar,		pcib_write_ivar),
-    DEVMETHOD(bus_alloc_resource,	pcib_alloc_resource),
-    DEVMETHOD(bus_release_resource,	bus_generic_release_resource),
-    DEVMETHOD(bus_activate_resource,	bus_generic_activate_resource),
-    DEVMETHOD(bus_deactivate_resource, 	bus_generic_deactivate_resource),
-    DEVMETHOD(bus_setup_intr,		bus_generic_setup_intr),
-    DEVMETHOD(bus_teardown_intr,	bus_generic_teardown_intr),
 
     /* pcib interface */
-    DEVMETHOD(pcib_maxslots,		pcib_maxslots),
-    DEVMETHOD(pcib_read_config,		pcib_read_config),
-    DEVMETHOD(pcib_write_config,	pcib_write_config),
     DEVMETHOD(pcib_route_interrupt,	acpi_pcib_pci_route_interrupt),
-    DEVMETHOD(pcib_alloc_msi,		pcib_alloc_msi),
-    DEVMETHOD(pcib_release_msi,		pcib_release_msi),
-    DEVMETHOD(pcib_alloc_msix,		pcib_alloc_msix),
-    DEVMETHOD(pcib_release_msix,	pcib_release_msix),
-    DEVMETHOD(pcib_map_msi,		pcib_map_msi),
 
     {0, 0}
 };
 
 static devclass_t pcib_devclass;
 
-DEFINE_CLASS_0(pcib, acpi_pcib_pci_driver, acpi_pcib_pci_methods,
-    sizeof(struct acpi_pcib_softc));
+DEFINE_CLASS_1(pcib, acpi_pcib_pci_driver, acpi_pcib_pci_methods,
+    sizeof(struct acpi_pcib_softc), pcib_driver);
 DRIVER_MODULE(acpi_pcib, pci, acpi_pcib_pci_driver, pcib_devclass, 0, 0);
 MODULE_DEPEND(acpi_pcib, acpi, 1, 1, 1);
 
@@ -140,13 +120,6 @@ acpi_pcib_pci_attach(device_t dev)
 }
 
 static int
-acpi_pcib_pci_resume(device_t dev)
-{
-
-    return (acpi_pcib_resume(dev));
-}
-
-static int
 acpi_pcib_read_ivar(device_t dev, device_t child, int which, uintptr_t *result)
 {
     struct acpi_pcib_softc *sc = device_get_softc(dev);

Modified: stable/7/sys/dev/acpica/acpi_pcibvar.h
==============================================================================
--- stable/7/sys/dev/acpica/acpi_pcibvar.h	Wed Apr 27 21:13:20 2011	(r221140)
+++ stable/7/sys/dev/acpica/acpi_pcibvar.h	Wed Apr 27 21:13:40 2011	(r221141)
@@ -31,13 +31,14 @@
 #define	_ACPI_PCIBVAR_H_
 
 #ifdef _KERNEL
+
 void	acpi_pci_link_add_reference(device_t dev, int index, device_t pcib,
     int slot, int pin);
 int	acpi_pci_link_route_interrupt(device_t dev, int index);
 int	acpi_pcib_attach(device_t bus, ACPI_BUFFER *prt, int busno);
 int	acpi_pcib_route_interrupt(device_t pcib, device_t dev, int pin,
     ACPI_BUFFER *prtbuf);
-int	acpi_pcib_resume(device_t dev);
+
 #endif /* _KERNEL */
 
 #endif /* !_ACPI_PCIBVAR_H_ */

Modified: stable/7/sys/dev/pci/pcib_private.h
==============================================================================
--- stable/7/sys/dev/pci/pcib_private.h	Wed Apr 27 21:13:20 2011	(r221140)
+++ stable/7/sys/dev/pci/pcib_private.h	Wed Apr 27 21:13:40 2011	(r221141)
@@ -37,6 +37,7 @@
  * Export portions of generic PCI:PCI bridge support so that it can be
  * used by subclasses.
  */
+DECLARE_CLASS(pcib_driver);
 
 /*
  * Bridge-specific data.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201104272113.p3RLDfPe090517>