svn commit: r232470 - in head/sys/dev: oce virtio/pci
John Baldwin
jhb at FreeBSD.org
Sat Mar 3 18:03:51 UTC 2012
Author: jhb
Date: Sat Mar 3 18:03:50 2012
New Revision: 232470
URL: http://svn.freebsd.org/changeset/base/232470
Log:
Use pci_find_cap() instead of pci_find_extcap() to locate PCI
find capabilities as the latter API is deprecated for this purpose.
MFC after: 2 weeks
Modified:
head/sys/dev/oce/oce_hw.c
head/sys/dev/virtio/pci/virtio_pci.c
Modified: head/sys/dev/oce/oce_hw.c
==============================================================================
--- head/sys/dev/oce/oce_hw.c Sat Mar 3 17:52:19 2012 (r232469)
+++ head/sys/dev/oce/oce_hw.c Sat Mar 3 18:03:50 2012 (r232470)
@@ -203,12 +203,12 @@ void oce_get_pci_capabilities(POCE_SOFTC
{
uint32_t val;
- if (pci_find_extcap(sc->dev, PCIY_PCIX, &val) == 0) {
+ if (pci_find_cap(sc->dev, PCIY_PCIX, &val) == 0) {
if (val != 0)
sc->flags |= OCE_FLAGS_PCIX;
}
- if (pci_find_extcap(sc->dev, PCIY_EXPRESS, &val) == 0) {
+ if (pci_find_cap(sc->dev, PCIY_EXPRESS, &val) == 0) {
if (val != 0) {
uint16_t link_status =
pci_read_config(sc->dev, val + 0x12, 2);
@@ -219,12 +219,12 @@ void oce_get_pci_capabilities(POCE_SOFTC
}
}
- if (pci_find_extcap(sc->dev, PCIY_MSI, &val) == 0) {
+ if (pci_find_cap(sc->dev, PCIY_MSI, &val) == 0) {
if (val != 0)
sc->flags |= OCE_FLAGS_MSI_CAPABLE;
}
- if (pci_find_extcap(sc->dev, PCIY_MSIX, &val) == 0) {
+ if (pci_find_cap(sc->dev, PCIY_MSIX, &val) == 0) {
if (val != 0) {
val = pci_msix_count(sc->dev);
sc->flags |= OCE_FLAGS_MSIX_CAPABLE;
Modified: head/sys/dev/virtio/pci/virtio_pci.c
==============================================================================
--- head/sys/dev/virtio/pci/virtio_pci.c Sat Mar 3 17:52:19 2012 (r232469)
+++ head/sys/dev/virtio/pci/virtio_pci.c Sat Mar 3 18:03:50 2012 (r232470)
@@ -251,10 +251,10 @@ vtpci_attach(device_t dev)
return (ENXIO);
}
- if (pci_find_extcap(dev, PCIY_MSI, NULL) != 0)
+ if (pci_find_cap(dev, PCIY_MSI, NULL) != 0)
sc->vtpci_flags |= VIRTIO_PCI_FLAG_NO_MSI;
- if (pci_find_extcap(dev, PCIY_MSIX, NULL) == 0) {
+ if (pci_find_cap(dev, PCIY_MSIX, NULL) == 0) {
rid = PCIR_BAR(1);
sc->vtpci_msix_res = bus_alloc_resource_any(dev,
SYS_RES_MEMORY, &rid, RF_ACTIVE);
More information about the svn-src-head
mailing list