diff options
-rw-r--r-- | drivers/pci/pci.c | 43 | ||||
-rw-r--r-- | include/linux/pci.h | 2 |
2 files changed, 0 insertions, 45 deletions
diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c index 447e83472c01..de9386da2eb2 100644 --- a/drivers/pci/pci.c +++ b/drivers/pci/pci.c | |||
@@ -329,49 +329,6 @@ int pci_find_ext_capability(struct pci_dev *dev, int cap) | |||
329 | } | 329 | } |
330 | EXPORT_SYMBOL_GPL(pci_find_ext_capability); | 330 | EXPORT_SYMBOL_GPL(pci_find_ext_capability); |
331 | 331 | ||
332 | /** | ||
333 | * pci_bus_find_ext_capability - find an extended capability | ||
334 | * @bus: the PCI bus to query | ||
335 | * @devfn: PCI device to query | ||
336 | * @cap: capability code | ||
337 | * | ||
338 | * Like pci_find_ext_capability() but works for pci devices that do not have a | ||
339 | * pci_dev structure set up yet. | ||
340 | * | ||
341 | * Returns the address of the requested capability structure within the | ||
342 | * device's PCI configuration space or 0 in case the device does not | ||
343 | * support it. | ||
344 | */ | ||
345 | int pci_bus_find_ext_capability(struct pci_bus *bus, unsigned int devfn, | ||
346 | int cap) | ||
347 | { | ||
348 | u32 header; | ||
349 | int ttl; | ||
350 | int pos = PCI_CFG_SPACE_SIZE; | ||
351 | |||
352 | /* minimum 8 bytes per capability */ | ||
353 | ttl = (PCI_CFG_SPACE_EXP_SIZE - PCI_CFG_SPACE_SIZE) / 8; | ||
354 | |||
355 | if (!pci_bus_read_config_dword(bus, devfn, pos, &header)) | ||
356 | return 0; | ||
357 | if (header == 0xffffffff || header == 0) | ||
358 | return 0; | ||
359 | |||
360 | while (ttl-- > 0) { | ||
361 | if (PCI_EXT_CAP_ID(header) == cap) | ||
362 | return pos; | ||
363 | |||
364 | pos = PCI_EXT_CAP_NEXT(header); | ||
365 | if (pos < PCI_CFG_SPACE_SIZE) | ||
366 | break; | ||
367 | |||
368 | if (!pci_bus_read_config_dword(bus, devfn, pos, &header)) | ||
369 | break; | ||
370 | } | ||
371 | |||
372 | return 0; | ||
373 | } | ||
374 | |||
375 | static int __pci_find_next_ht_cap(struct pci_dev *dev, int pos, int ht_cap) | 332 | static int __pci_find_next_ht_cap(struct pci_dev *dev, int pos, int ht_cap) |
376 | { | 333 | { |
377 | int rc, ttl = PCI_FIND_CAP_TTL; | 334 | int rc, ttl = PCI_FIND_CAP_TTL; |
diff --git a/include/linux/pci.h b/include/linux/pci.h index d8c379dba6ad..2618ad996535 100644 --- a/include/linux/pci.h +++ b/include/linux/pci.h | |||
@@ -714,8 +714,6 @@ enum pci_lost_interrupt_reason pci_lost_interrupt(struct pci_dev *dev); | |||
714 | int pci_find_capability(struct pci_dev *dev, int cap); | 714 | int pci_find_capability(struct pci_dev *dev, int cap); |
715 | int pci_find_next_capability(struct pci_dev *dev, u8 pos, int cap); | 715 | int pci_find_next_capability(struct pci_dev *dev, u8 pos, int cap); |
716 | int pci_find_ext_capability(struct pci_dev *dev, int cap); | 716 | int pci_find_ext_capability(struct pci_dev *dev, int cap); |
717 | int pci_bus_find_ext_capability(struct pci_bus *bus, unsigned int devfn, | ||
718 | int cap); | ||
719 | int pci_find_ht_capability(struct pci_dev *dev, int ht_cap); | 717 | int pci_find_ht_capability(struct pci_dev *dev, int ht_cap); |
720 | int pci_find_next_ht_capability(struct pci_dev *dev, int pos, int ht_cap); | 718 | int pci_find_next_ht_capability(struct pci_dev *dev, int pos, int ht_cap); |
721 | struct pci_bus *pci_find_next_bus(const struct pci_bus *from); | 719 | struct pci_bus *pci_find_next_bus(const struct pci_bus *from); |