pci.c (264006) | pci.c (264007) |
---|---|
1/*- 2 * Copyright (c) 1997, Stefan Esser <se@freebsd.org> 3 * Copyright (c) 2000, Michael Smith <msmith@freebsd.org> 4 * Copyright (c) 2000, BSDi 5 * All rights reserved. 6 * 7 * Redistribution and use in source and binary forms, with or without 8 * modification, are permitted provided that the following conditions --- 13 unchanged lines hidden (view full) --- 22 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 23 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 24 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 */ 28 29#include <sys/cdefs.h> | 1/*- 2 * Copyright (c) 1997, Stefan Esser <se@freebsd.org> 3 * Copyright (c) 2000, Michael Smith <msmith@freebsd.org> 4 * Copyright (c) 2000, BSDi 5 * All rights reserved. 6 * 7 * Redistribution and use in source and binary forms, with or without 8 * modification, are permitted provided that the following conditions --- 13 unchanged lines hidden (view full) --- 22 * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 23 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 24 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 25 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 26 * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 27 */ 28 29#include <sys/cdefs.h> |
30__FBSDID("$FreeBSD: head/sys/dev/pci/pci.c 264006 2014-04-01 15:06:03Z rstone $"); | 30__FBSDID("$FreeBSD: head/sys/dev/pci/pci.c 264007 2014-04-01 15:47:24Z rstone $"); |
31 32#include "opt_bus.h" 33 34#include <sys/param.h> 35#include <sys/systm.h> 36#include <sys/malloc.h> 37#include <sys/module.h> 38#include <sys/linker.h> --- 80 unchanged lines hidden (view full) --- 119static void pci_unmask_msix(device_t dev, u_int index); 120static int pci_msi_blacklisted(void); 121static int pci_msix_blacklisted(void); 122static void pci_resume_msi(device_t dev); 123static void pci_resume_msix(device_t dev); 124static int pci_remap_intr_method(device_t bus, device_t dev, 125 u_int irq); 126 | 31 32#include "opt_bus.h" 33 34#include <sys/param.h> 35#include <sys/systm.h> 36#include <sys/malloc.h> 37#include <sys/module.h> 38#include <sys/linker.h> --- 80 unchanged lines hidden (view full) --- 119static void pci_unmask_msix(device_t dev, u_int index); 120static int pci_msi_blacklisted(void); 121static int pci_msix_blacklisted(void); 122static void pci_resume_msi(device_t dev); 123static void pci_resume_msix(device_t dev); 124static int pci_remap_intr_method(device_t bus, device_t dev, 125 u_int irq); 126 |
127static uint16_t pci_get_rid_method(device_t dev, device_t child); 128 |
|
127static device_method_t pci_methods[] = { 128 /* Device interface */ 129 DEVMETHOD(device_probe, pci_probe), 130 DEVMETHOD(device_attach, pci_attach), 131#ifdef PCI_RES_BUS 132 DEVMETHOD(device_detach, pci_detach), 133#else 134 DEVMETHOD(device_detach, bus_generic_detach), --- 42 unchanged lines hidden (view full) --- 177 DEVMETHOD(pci_find_extcap, pci_find_extcap_method), 178 DEVMETHOD(pci_find_htcap, pci_find_htcap_method), 179 DEVMETHOD(pci_alloc_msi, pci_alloc_msi_method), 180 DEVMETHOD(pci_alloc_msix, pci_alloc_msix_method), 181 DEVMETHOD(pci_remap_msix, pci_remap_msix_method), 182 DEVMETHOD(pci_release_msi, pci_release_msi_method), 183 DEVMETHOD(pci_msi_count, pci_msi_count_method), 184 DEVMETHOD(pci_msix_count, pci_msix_count_method), | 129static device_method_t pci_methods[] = { 130 /* Device interface */ 131 DEVMETHOD(device_probe, pci_probe), 132 DEVMETHOD(device_attach, pci_attach), 133#ifdef PCI_RES_BUS 134 DEVMETHOD(device_detach, pci_detach), 135#else 136 DEVMETHOD(device_detach, bus_generic_detach), --- 42 unchanged lines hidden (view full) --- 179 DEVMETHOD(pci_find_extcap, pci_find_extcap_method), 180 DEVMETHOD(pci_find_htcap, pci_find_htcap_method), 181 DEVMETHOD(pci_alloc_msi, pci_alloc_msi_method), 182 DEVMETHOD(pci_alloc_msix, pci_alloc_msix_method), 183 DEVMETHOD(pci_remap_msix, pci_remap_msix_method), 184 DEVMETHOD(pci_release_msi, pci_release_msi_method), 185 DEVMETHOD(pci_msi_count, pci_msi_count_method), 186 DEVMETHOD(pci_msix_count, pci_msix_count_method), |
187 DEVMETHOD(pci_get_rid, pci_get_rid_method), |
|
185 186 DEVMETHOD_END 187}; 188 189DEFINE_CLASS_0(pci, pci_driver, pci_methods, sizeof(struct pci_softc)); 190 191static devclass_t pci_devclass; 192DRIVER_MODULE(pci, pcib, pci_driver, pci_devclass, pci_modevent, NULL); --- 4857 unchanged lines hidden (view full) --- 5050void 5051pci_restore_state(device_t dev) 5052{ 5053 struct pci_devinfo *dinfo; 5054 5055 dinfo = device_get_ivars(dev); 5056 pci_cfg_restore(dev, dinfo); 5057} | 188 189 DEVMETHOD_END 190}; 191 192DEFINE_CLASS_0(pci, pci_driver, pci_methods, sizeof(struct pci_softc)); 193 194static devclass_t pci_devclass; 195DRIVER_MODULE(pci, pcib, pci_driver, pci_devclass, pci_modevent, NULL); --- 4857 unchanged lines hidden (view full) --- 5053void 5054pci_restore_state(device_t dev) 5055{ 5056 struct pci_devinfo *dinfo; 5057 5058 dinfo = device_get_ivars(dev); 5059 pci_cfg_restore(dev, dinfo); 5060} |
5061 5062static uint16_t 5063pci_get_rid_method(device_t dev, device_t child) 5064{ 5065 5066 return (PCIB_GET_RID(device_get_parent(dev), child)); 5067} |
|