Merge tag 'firewire-update2' of git://git.kernel.org/pub/scm/linux/kernel/git/ieee139...
[deliverable/linux.git] / drivers / net / ethernet / qlogic / qed / qed_main.c
index 9d76ce249277a3cef7bdfc45faf06d93582c577f..26d40db07ddd12a13ae07f7494e3244e03f70af4 100644 (file)
 #include "qed_mcp.h"
 #include "qed_hw.h"
 
-static const char version[] =
-       "QLogic QL4xxx 40G/100G Ethernet Driver qed " DRV_MODULE_VERSION "\n";
+static char version[] =
+       "QLogic FastLinQ 4xxxx Core Module qed " DRV_MODULE_VERSION "\n";
 
-MODULE_DESCRIPTION("QLogic 25G/40G/50G/100G Core Module");
+MODULE_DESCRIPTION("QLogic FastLinQ 4xxxx Core Module");
 MODULE_LICENSE("GPL");
 MODULE_VERSION(DRV_MODULE_VERSION);
 
@@ -45,6 +45,8 @@ MODULE_VERSION(DRV_MODULE_VERSION);
 #define QED_FW_FILE_NAME       \
        "qed/qed_init_values_zipped-" FW_FILE_VERSION ".bin"
 
+MODULE_FIRMWARE(QED_FW_FILE_NAME);
+
 static int __init qed_init(void)
 {
        pr_notice("qed_init called\n");
@@ -97,12 +99,15 @@ static void qed_free_pci(struct qed_dev *cdev)
        pci_disable_device(pdev);
 }
 
+#define PCI_REVISION_ID_ERROR_VAL      0xff
+
 /* Performs PCI initializations as well as initializing PCI-related parameters
  * in the device structrue. Returns 0 in case of success.
  */
 static int qed_init_pci(struct qed_dev *cdev,
                        struct pci_dev *pdev)
 {
+       u8 rev_id;
        int rc;
 
        cdev->pdev = pdev;
@@ -136,6 +141,14 @@ static int qed_init_pci(struct qed_dev *cdev,
                pci_save_state(pdev);
        }
 
+       pci_read_config_byte(pdev, PCI_REVISION_ID, &rev_id);
+       if (rev_id == PCI_REVISION_ID_ERROR_VAL) {
+               DP_NOTICE(cdev,
+                         "Detected PCI device error [rev_id 0x%x]. Probably due to prior indication. Aborting.\n",
+                         rev_id);
+               rc = -ENODEV;
+               goto err2;
+       }
        if (!pci_is_pcie(pdev)) {
                DP_NOTICE(cdev, "The bus is not PCI Express\n");
                rc = -EIO;
@@ -190,7 +203,7 @@ int qed_fill_dev_info(struct qed_dev *cdev,
        dev_info->pci_mem_start = cdev->pci_params.mem_start;
        dev_info->pci_mem_end = cdev->pci_params.mem_end;
        dev_info->pci_irq = cdev->pci_params.irq;
-       dev_info->is_mf = IS_MF(&cdev->hwfns[0]);
+       dev_info->is_mf_default = IS_MF_DEFAULT(&cdev->hwfns[0]);
        ether_addr_copy(dev_info->hw_mac, cdev->hwfns[0].hw_info.hw_mac_addr);
 
        dev_info->fw_major = FW_MAJOR_VERSION;
@@ -621,15 +634,18 @@ static int qed_get_int_fp(struct qed_dev *cdev, struct qed_int_info *info)
 static int qed_slowpath_setup_int(struct qed_dev *cdev,
                                  enum qed_int_mode int_mode)
 {
-       int rc, i;
-       u8 num_vectors = 0;
-
+       struct qed_sb_cnt_info sb_cnt_info;
+       int rc;
+       int i;
        memset(&cdev->int_params, 0, sizeof(struct qed_int_params));
 
        cdev->int_params.in.int_mode = int_mode;
-       for_each_hwfn(cdev, i)
-               num_vectors +=  qed_int_get_num_sbs(&cdev->hwfns[i], NULL) + 1;
-       cdev->int_params.in.num_vectors = num_vectors;
+       for_each_hwfn(cdev, i) {
+               memset(&sb_cnt_info, 0, sizeof(sb_cnt_info));
+               qed_int_get_num_sbs(&cdev->hwfns[i], &sb_cnt_info);
+               cdev->int_params.in.num_vectors += sb_cnt_info.sb_cnt;
+               cdev->int_params.in.num_vectors++; /* slowpath */
+       }
 
        /* We want a minimum of one slowpath and one fastpath vector per hwfn */
        cdev->int_params.in.min_msix_cnt = cdev->num_hwfns * 2;
@@ -763,7 +779,7 @@ static int qed_slowpath_start(struct qed_dev *cdev,
        rc = qed_hw_init(cdev, true, cdev->int_params.out.int_mode,
                         true, data);
        if (rc)
-               goto err3;
+               goto err2;
 
        DP_INFO(cdev,
                "HW initialization and function start completed successfully\n");
@@ -782,12 +798,14 @@ static int qed_slowpath_start(struct qed_dev *cdev,
                return rc;
        }
 
+       qed_reset_vport_stats(cdev);
+
        return 0;
 
-err3:
-       qed_free_stream_mem(cdev);
-       qed_slowpath_irq_free(cdev);
 err2:
+       qed_hw_timers_stop_all(cdev);
+       qed_slowpath_irq_free(cdev);
+       qed_free_stream_mem(cdev);
        qed_disable_msix(cdev);
 err1:
        qed_resc_free(cdev);
This page took 0.038317 seconds and 5 git commands to generate.