Merge branch 'pci/bjorn-find-next-ext-cap' into next
authorBjorn Helgaas <bhelgaas@google.com>
Fri, 24 Aug 2012 00:32:36 +0000 (18:32 -0600)
committerBjorn Helgaas <bhelgaas@google.com>
Fri, 24 Aug 2012 00:32:36 +0000 (18:32 -0600)
* pci/bjorn-find-next-ext-cap:
  PCI: Add Vendor-Specific Extended Capability header info
  PCI: Add pci_find_next_ext_capability()

Conflicts:
drivers/pci/pci.c

1  2 
drivers/pci/pci.c
include/linux/pci.h
include/linux/pci_regs.h

index fac08f508d099fe3fc0179a1f93acf18fd120156,d34415ba0f64f56676061cb58d50f5759bc3a043..5ba60dd71faa0d79f596a22a590ec2e738916d51
@@@ -253,21 -253,50 +253,18 @@@ int pci_bus_find_capability(struct pci_
        return pos;
  }
  
 -/**
 - * pci_pcie_cap2 - query for devices' PCI_CAP_ID_EXP v2 capability structure
 - * @dev: PCI device to check
 - *
 - * Like pci_pcie_cap() but also checks that the PCIe capability version is
 - * >= 2.  Note that v1 capability structures could be sparse in that not
 - * all register fields were required.  v2 requires the entire structure to
 - * be present size wise, while still allowing for non-implemented registers
 - * to exist but they must be hardwired to 0.
 - *
 - * Due to the differences in the versions of capability structures, one
 - * must be careful not to try and access non-existant registers that may
 - * exist in early versions - v1 - of Express devices.
 - *
 - * Returns the offset of the PCIe capability structure as long as the
 - * capability version is >= 2; otherwise 0 is returned.
 - */
 -static int pci_pcie_cap2(struct pci_dev *dev)
 -{
 -      u16 flags;
 -      int pos;
 -
 -      pos = pci_pcie_cap(dev);
 -      if (pos) {
 -              pci_read_config_word(dev, pos + PCI_EXP_FLAGS, &flags);
 -              if ((flags & PCI_EXP_FLAGS_VERS) < 2)
 -                      pos = 0;
 -      }
 -
 -      return pos;
 -}
 -
  /**
-  * pci_find_ext_capability - Find an extended capability
+  * pci_find_next_ext_capability - Find an extended capability
   * @dev: PCI device to query
+  * @start: address at which to start looking (0 to start at beginning of list)
   * @cap: capability code
   *
-  * Returns the address of the requested extended capability structure
+  * Returns the address of the next matching extended capability structure
   * within the device's PCI configuration space or 0 if the device does
-  * not support it.  Possible values for @cap:
-  *
-  *  %PCI_EXT_CAP_ID_ERR               Advanced Error Reporting
-  *  %PCI_EXT_CAP_ID_VC                Virtual Channel
-  *  %PCI_EXT_CAP_ID_DSN               Device Serial Number
-  *  %PCI_EXT_CAP_ID_PWR               Power Budgeting
+  * not support it.  Some capabilities can occur several times, e.g., the
+  * vendor-specific capability, and this provides a way to find them all.
   */
- int pci_find_ext_capability(struct pci_dev *dev, int cap)
+ int pci_find_next_ext_capability(struct pci_dev *dev, int start, int cap)
  {
        u32 header;
        int ttl;
Simple merge
Simple merge