aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pci/probe.c
diff options
context:
space:
mode:
authorMatthew Wilcox <matthew@wil.cx>2009-12-13 08:11:32 -0500
committerJesse Barnes <jbarnes@virtuousgeek.org>2010-02-22 19:15:17 -0500
commit3749c51ac6c1560aa1cb1520066bed84c6f8152a (patch)
tree3cbfb6a6d2df821e3e80ccce29ede8011b94246e /drivers/pci/probe.c
parent536c8cb49eccd4f753b4782e7e975ef87359cb44 (diff)
PCI: Make current and maximum bus speeds part of the PCI core
Move the max_bus_speed and cur_bus_speed into the pci_bus. Expose the values through the PCI slot driver instead of the hotplug slot driver. Update all the hotplug drivers to use the pci_bus instead of their own data structures. Signed-off-by: Matthew Wilcox <willy@linux.intel.com> Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Diffstat (limited to 'drivers/pci/probe.c')
-rw-r--r--drivers/pci/probe.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/drivers/pci/probe.c b/drivers/pci/probe.c
index dd64310a735e..51cf8982fec7 100644
--- a/drivers/pci/probe.c
+++ b/drivers/pci/probe.c
@@ -387,10 +387,37 @@ static struct pci_bus * pci_alloc_bus(void)
387 INIT_LIST_HEAD(&b->children); 387 INIT_LIST_HEAD(&b->children);
388 INIT_LIST_HEAD(&b->devices); 388 INIT_LIST_HEAD(&b->devices);
389 INIT_LIST_HEAD(&b->slots); 389 INIT_LIST_HEAD(&b->slots);
390 b->max_bus_speed = PCI_SPEED_UNKNOWN;
391 b->cur_bus_speed = PCI_SPEED_UNKNOWN;
390 } 392 }
391 return b; 393 return b;
392} 394}
393 395
396static unsigned char pcie_link_speed[] = {
397 PCI_SPEED_UNKNOWN, /* 0 */
398 PCIE_SPEED_2_5GT, /* 1 */
399 PCIE_SPEED_5_0GT, /* 2 */
400 PCI_SPEED_UNKNOWN, /* 3 */
401 PCI_SPEED_UNKNOWN, /* 4 */
402 PCI_SPEED_UNKNOWN, /* 5 */
403 PCI_SPEED_UNKNOWN, /* 6 */
404 PCI_SPEED_UNKNOWN, /* 7 */
405 PCI_SPEED_UNKNOWN, /* 8 */
406 PCI_SPEED_UNKNOWN, /* 9 */
407 PCI_SPEED_UNKNOWN, /* A */
408 PCI_SPEED_UNKNOWN, /* B */
409 PCI_SPEED_UNKNOWN, /* C */
410 PCI_SPEED_UNKNOWN, /* D */
411 PCI_SPEED_UNKNOWN, /* E */
412 PCI_SPEED_UNKNOWN /* F */
413};
414
415void pcie_update_link_speed(struct pci_bus *bus, u16 linksta)
416{
417 bus->cur_bus_speed = pcie_link_speed[linksta & 0xf];
418}
419EXPORT_SYMBOL_GPL(pcie_update_link_speed);
420
394static struct pci_bus *pci_alloc_child_bus(struct pci_bus *parent, 421static struct pci_bus *pci_alloc_child_bus(struct pci_bus *parent,
395 struct pci_dev *bridge, int busnr) 422 struct pci_dev *bridge, int busnr)
396{ 423{