diff options
Diffstat (limited to 'drivers/pci/pci.c')
-rw-r--r-- | drivers/pci/pci.c | 67 |
1 files changed, 0 insertions, 67 deletions
diff --git a/drivers/pci/pci.c b/drivers/pci/pci.c index aeda6e9c245c..a23b071798f6 100644 --- a/drivers/pci/pci.c +++ b/drivers/pci/pci.c | |||
@@ -136,30 +136,6 @@ void __iomem *pci_ioremap_bar(struct pci_dev *pdev, int bar) | |||
136 | EXPORT_SYMBOL_GPL(pci_ioremap_bar); | 136 | EXPORT_SYMBOL_GPL(pci_ioremap_bar); |
137 | #endif | 137 | #endif |
138 | 138 | ||
139 | #if 0 | ||
140 | /** | ||
141 | * pci_max_busnr - returns maximum PCI bus number | ||
142 | * | ||
143 | * Returns the highest PCI bus number present in the system global list of | ||
144 | * PCI buses. | ||
145 | */ | ||
146 | unsigned char __devinit | ||
147 | pci_max_busnr(void) | ||
148 | { | ||
149 | struct pci_bus *bus = NULL; | ||
150 | unsigned char max, n; | ||
151 | |||
152 | max = 0; | ||
153 | while ((bus = pci_find_next_bus(bus)) != NULL) { | ||
154 | n = pci_bus_max_busnr(bus); | ||
155 | if(n > max) | ||
156 | max = n; | ||
157 | } | ||
158 | return max; | ||
159 | } | ||
160 | |||
161 | #endif /* 0 */ | ||
162 | |||
163 | #define PCI_FIND_CAP_TTL 48 | 139 | #define PCI_FIND_CAP_TTL 48 |
164 | 140 | ||
165 | static int __pci_find_next_cap_ttl(struct pci_bus *bus, unsigned int devfn, | 141 | static int __pci_find_next_cap_ttl(struct pci_bus *bus, unsigned int devfn, |
@@ -329,49 +305,6 @@ int pci_find_ext_capability(struct pci_dev *dev, int cap) | |||
329 | } | 305 | } |
330 | EXPORT_SYMBOL_GPL(pci_find_ext_capability); | 306 | EXPORT_SYMBOL_GPL(pci_find_ext_capability); |
331 | 307 | ||
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) | 308 | static int __pci_find_next_ht_cap(struct pci_dev *dev, int pos, int ht_cap) |
376 | { | 309 | { |
377 | int rc, ttl = PCI_FIND_CAP_TTL; | 310 | int rc, ttl = PCI_FIND_CAP_TTL; |