PCI hotplug: add support for 5.0G link speed
authorKenji Kaneshige <kaneshige.kenji@jp.fujitsu.com>
Wed, 29 Jul 2009 05:39:58 +0000 (14:39 +0900)
committerJesse Barnes <jbarnes@virtuousgeek.org>
Wed, 9 Sep 2009 20:29:50 +0000 (13:29 -0700)
Add support for PCI-E 5.0 GT/s in max_bus_speed and cur_bus_speed.

Reviewed-by: Matthew Wilcox <matthew@wil.cx>
Signed-off-by: Kenji Kaneshige <kaneshige.kenji@jp.fujitsu.com>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
drivers/pci/hotplug/pci_hotplug_core.c
drivers/pci/hotplug/pciehp_hpc.c
include/linux/pci_hotplug.h

index 9d44669bf0989c8b653a54b636cd36790466d816..0325d989bb46f138d7ff1923e8e28bb03efa4d55 100644 (file)
@@ -87,6 +87,7 @@ static char *pci_bus_speed_strings[] = {
        "100 MHz PCIX 533",     /* 0x12 */
        "133 MHz PCIX 533",     /* 0x13 */
        "2.5 GT/s PCI-E",       /* 0x14 */
+       "5.0 GT/s PCI-E",       /* 0x15 */
 };
 
 #ifdef CONFIG_HOTPLUG_PCI_CPCI
index 52813257e5bf2fc8cc1b17470529e6b0a44cc970..271f917b6f2c4a72a8352fc6be686cf616eadc8f 100644 (file)
@@ -693,7 +693,10 @@ static int hpc_get_max_lnk_speed(struct slot *slot, enum pci_bus_speed *value)
 
        switch (lnk_cap & 0x000F) {
        case 1:
-               lnk_speed = PCIE_2PT5GB;
+               lnk_speed = PCIE_2_5GB;
+               break;
+       case 2:
+               lnk_speed = PCIE_5_0GB;
                break;
        default:
                lnk_speed = PCIE_LNK_SPEED_UNKNOWN;
@@ -772,7 +775,10 @@ static int hpc_get_cur_lnk_speed(struct slot *slot, enum pci_bus_speed *value)
 
        switch (lnk_status & PCI_EXP_LNKSTA_CLS) {
        case 1:
-               lnk_speed = PCIE_2PT5GB;
+               lnk_speed = PCIE_2_5GB;
+               break;
+       case 2:
+               lnk_speed = PCIE_5_0GB;
                break;
        default:
                lnk_speed = PCIE_LNK_SPEED_UNKNOWN;
index 4391741b99dc15a4083c2b0063efbe77aacc2e61..1b00cc3177fcc1e528382729ee49b35816834bd9 100644 (file)
@@ -62,7 +62,8 @@ enum pcie_link_width {
 };
 
 enum pcie_link_speed {
-       PCIE_2PT5GB             = 0x14,
+       PCIE_2_5GB              = 0x14,
+       PCIE_5_0GB              = 0x15,
        PCIE_LNK_SPEED_UNKNOWN  = 0xFF,
 };