qede: Log probe of PCI device
authorMintz, Yuval <Yuval.Mintz@cavium.com>
Tue, 23 May 2017 06:41:27 +0000 (09:41 +0300)
committerDavid S. Miller <davem@davemloft.net>
Wed, 24 May 2017 19:17:19 +0000 (15:17 -0400)
Replace meaningless logged print ('Ending successfully qede probe')
with a single-liner containing interesting information about probed
device.

Signed-off-by: Yuval Mintz <Yuval.Mintz@cavium.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/qlogic/qede/qede_main.c

index f0871e179e99f49b2afea305c5291663c824a2f0..d496ba70ddb82452020f407d09df7eff6cf52cbd 100644 (file)
@@ -852,6 +852,43 @@ static void qede_update_pf_params(struct qed_dev *cdev)
        qed_ops->common->update_pf_params(cdev, &pf_params);
 }
 
+#define QEDE_FW_VER_STR_SIZE   80
+
+static void qede_log_probe(struct qede_dev *edev)
+{
+       struct qed_dev_info *p_dev_info = &edev->dev_info.common;
+       u8 buf[QEDE_FW_VER_STR_SIZE];
+       size_t left_size;
+
+       snprintf(buf, QEDE_FW_VER_STR_SIZE,
+                "Storm FW %d.%d.%d.%d, Management FW %d.%d.%d.%d",
+                p_dev_info->fw_major, p_dev_info->fw_minor, p_dev_info->fw_rev,
+                p_dev_info->fw_eng,
+                (p_dev_info->mfw_rev & QED_MFW_VERSION_3_MASK) >>
+                QED_MFW_VERSION_3_OFFSET,
+                (p_dev_info->mfw_rev & QED_MFW_VERSION_2_MASK) >>
+                QED_MFW_VERSION_2_OFFSET,
+                (p_dev_info->mfw_rev & QED_MFW_VERSION_1_MASK) >>
+                QED_MFW_VERSION_1_OFFSET,
+                (p_dev_info->mfw_rev & QED_MFW_VERSION_0_MASK) >>
+                QED_MFW_VERSION_0_OFFSET);
+
+       left_size = QEDE_FW_VER_STR_SIZE - strlen(buf);
+       if (p_dev_info->mbi_version && left_size)
+               snprintf(buf + strlen(buf), left_size,
+                        " [MBI %d.%d.%d]",
+                        (p_dev_info->mbi_version & QED_MBI_VERSION_2_MASK) >>
+                        QED_MBI_VERSION_2_OFFSET,
+                        (p_dev_info->mbi_version & QED_MBI_VERSION_1_MASK) >>
+                        QED_MBI_VERSION_1_OFFSET,
+                        (p_dev_info->mbi_version & QED_MBI_VERSION_0_MASK) >>
+                        QED_MBI_VERSION_0_OFFSET);
+
+       pr_info("qede %02x:%02x.%02x: %s [%s]\n", edev->pdev->bus->number,
+               PCI_SLOT(edev->pdev->devfn), PCI_FUNC(edev->pdev->devfn),
+               buf, edev->ndev->name);
+}
+
 enum qede_probe_mode {
        QEDE_PROBE_NORMAL,
 };
@@ -945,8 +982,7 @@ static int __qede_probe(struct pci_dev *pdev, u32 dp_module, u8 dp_level,
 
        edev->rx_copybreak = QEDE_RX_HDR_SIZE;
 
-       DP_INFO(edev, "Ending successfully qede probe\n");
-
+       qede_log_probe(edev);
        return 0;
 
 err4: