diff options
Diffstat (limited to 'drivers/pci/probe.c')
-rw-r--r-- | drivers/pci/probe.c | 27 |
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 | ||
396 | static 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 | |||
415 | void pcie_update_link_speed(struct pci_bus *bus, u16 linksta) | ||
416 | { | ||
417 | bus->cur_bus_speed = pcie_link_speed[linksta & 0xf]; | ||
418 | } | ||
419 | EXPORT_SYMBOL_GPL(pcie_update_link_speed); | ||
420 | |||
394 | static struct pci_bus *pci_alloc_child_bus(struct pci_bus *parent, | 421 | static 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 | { |