diff options
Diffstat (limited to 'drivers/pci/quirks.c')
-rw-r--r-- | drivers/pci/quirks.c | 39 |
1 files changed, 23 insertions, 16 deletions
diff --git a/drivers/pci/quirks.c b/drivers/pci/quirks.c index fc734014206f..8b14bd326d4a 100644 --- a/drivers/pci/quirks.c +++ b/drivers/pci/quirks.c | |||
@@ -3419,22 +3419,29 @@ DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_PORT_RIDGE, | |||
3419 | 3419 | ||
3420 | static void quirk_chelsio_extend_vpd(struct pci_dev *dev) | 3420 | static void quirk_chelsio_extend_vpd(struct pci_dev *dev) |
3421 | { | 3421 | { |
3422 | pci_set_vpd_size(dev, 8192); | 3422 | int chip = (dev->device & 0xf000) >> 12; |
3423 | } | 3423 | int func = (dev->device & 0x0f00) >> 8; |
3424 | 3424 | int prod = (dev->device & 0x00ff) >> 0; | |
3425 | DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_CHELSIO, 0x20, quirk_chelsio_extend_vpd); | 3425 | |
3426 | DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_CHELSIO, 0x21, quirk_chelsio_extend_vpd); | 3426 | /* |
3427 | DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_CHELSIO, 0x22, quirk_chelsio_extend_vpd); | 3427 | * If this is a T3-based adapter, there's a 1KB VPD area at offset |
3428 | DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_CHELSIO, 0x23, quirk_chelsio_extend_vpd); | 3428 | * 0xc00 which contains the preferred VPD values. If this is a T4 or |
3429 | DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_CHELSIO, 0x24, quirk_chelsio_extend_vpd); | 3429 | * later based adapter, the special VPD is at offset 0x400 for the |
3430 | DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_CHELSIO, 0x25, quirk_chelsio_extend_vpd); | 3430 | * Physical Functions (the SR-IOV Virtual Functions have no VPD |
3431 | DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_CHELSIO, 0x26, quirk_chelsio_extend_vpd); | 3431 | * Capabilities). The PCI VPD Access core routines will normally |
3432 | DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_CHELSIO, 0x30, quirk_chelsio_extend_vpd); | 3432 | * compute the size of the VPD by parsing the VPD Data Structure at |
3433 | DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_CHELSIO, 0x31, quirk_chelsio_extend_vpd); | 3433 | * offset 0x000. This will result in silent failures when attempting |
3434 | DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_CHELSIO, 0x32, quirk_chelsio_extend_vpd); | 3434 | * to accesses these other VPD areas which are beyond those computed |
3435 | DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_CHELSIO, 0x35, quirk_chelsio_extend_vpd); | 3435 | * limits. |
3436 | DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_CHELSIO, 0x36, quirk_chelsio_extend_vpd); | 3436 | */ |
3437 | DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_CHELSIO, 0x37, quirk_chelsio_extend_vpd); | 3437 | if (chip == 0x0 && prod >= 0x20) |
3438 | pci_set_vpd_size(dev, 8192); | ||
3439 | else if (chip >= 0x4 && func < 0x8) | ||
3440 | pci_set_vpd_size(dev, 2048); | ||
3441 | } | ||
3442 | |||
3443 | DECLARE_PCI_FIXUP_FINAL(PCI_VENDOR_ID_CHELSIO, PCI_ANY_ID, | ||
3444 | quirk_chelsio_extend_vpd); | ||
3438 | 3445 | ||
3439 | #ifdef CONFIG_ACPI | 3446 | #ifdef CONFIG_ACPI |
3440 | /* | 3447 | /* |