]> git.karo-electronics.de Git - mv-sheeva.git/commitdiff
PCI: add Intel 82599 Virtual Function specific reset method
authorDexuan Cui <dexuan.cui@intel.com>
Mon, 7 Dec 2009 05:03:23 +0000 (13:03 +0800)
committerJesse Barnes <jbarnes@virtuousgeek.org>
Wed, 16 Dec 2009 21:37:52 +0000 (13:37 -0800)
Handle device specific timeout and use FLR.

Signed-off-by: Yu Zhao <yu.zhao@intel.com>
Signed-off-by: Dexuan Cui <dexuan.cui@intel.com>
Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
drivers/pci/quirks.c

index cf96776d4bbfb9d3caae0f17776f1c3c06d6ac08..8726698866b170d5f28ca17f612bbe6d78cd282e 100644 (file)
@@ -2664,7 +2664,29 @@ static int reset_intel_generic_dev(struct pci_dev *dev, int probe)
        }
 }
 
+static int reset_intel_82599_sfp_virtfn(struct pci_dev *dev, int probe)
+{
+       int pos;
+
+       pos = pci_find_capability(dev, PCI_CAP_ID_EXP);
+       if (!pos)
+               return -ENOTTY;
+
+       if (probe)
+               return 0;
+
+       pci_write_config_word(dev, pos + PCI_EXP_DEVCTL,
+                               PCI_EXP_DEVCTL_BCR_FLR);
+       msleep(100);
+
+       return 0;
+}
+
+#define PCI_DEVICE_ID_INTEL_82599_SFP_VF   0x10ed
+
 struct pci_dev_reset_methods pci_dev_reset_methods[] = {
+       { PCI_VENDOR_ID_INTEL, PCI_DEVICE_ID_INTEL_82599_SFP_VF,
+                reset_intel_82599_sfp_virtfn },
        { PCI_VENDOR_ID_INTEL, PCI_ANY_ID,
                reset_intel_generic_dev },
        { 0 }