net/qede/base: print firmware MFW and MBI versions
authorRasesh Mody <rasesh.mody@cavium.com>
Wed, 29 Mar 2017 20:36:21 +0000 (13:36 -0700)
committerFerruh Yigit <ferruh.yigit@intel.com>
Tue, 4 Apr 2017 17:02:51 +0000 (19:02 +0200)
Add a printout of the FW, Management FW and MBI versions.

Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
drivers/net/qede/qede_if.h
drivers/net/qede/qede_main.c

index 18404fb..1e27428 100644 (file)
@@ -30,12 +30,19 @@ struct qed_dev_info {
 
        /* MFW version */
        uint32_t mfw_rev;
+#define QED_MFW_VERSION_0_MASK         0x000000FF
+#define QED_MFW_VERSION_0_OFFSET       0
+#define QED_MFW_VERSION_1_MASK         0x0000FF00
+#define QED_MFW_VERSION_1_OFFSET       8
+#define QED_MFW_VERSION_2_MASK         0x00FF0000
+#define QED_MFW_VERSION_2_OFFSET       16
+#define QED_MFW_VERSION_3_MASK         0xFF000000
+#define QED_MFW_VERSION_3_OFFSET       24
 
        uint32_t flash_size;
        uint8_t mf_mode;
        bool tx_switching;
        u16 mtu;
-       /* To be added... */
 };
 
 enum qed_sb_type {
index e76346e..1d4f336 100644 (file)
@@ -327,6 +327,8 @@ qed_fill_dev_info(struct ecore_dev *edev, struct qed_dev_info *dev_info)
        memset(dev_info, 0, sizeof(struct qed_dev_info));
        dev_info->num_hwfns = edev->num_hwfns;
        dev_info->is_mf_default = IS_MF_DEFAULT(&edev->hwfns[0]);
+       dev_info->mtu = ECORE_LEADING_HWFN(edev)->hw_info.mtu;
+
        rte_memcpy(&dev_info->hw_mac, &edev->hwfns[0].hw_info.hw_mac_addr,
               ETHER_ADDR_LEN);
 
@@ -337,13 +339,7 @@ qed_fill_dev_info(struct ecore_dev *edev, struct qed_dev_info *dev_info)
                dev_info->fw_eng = FW_ENGINEERING_VERSION;
                dev_info->mf_mode = edev->mf_mode;
                dev_info->tx_switching = false;
-       } else {
-               ecore_vf_get_fw_version(&edev->hwfns[0], &dev_info->fw_major,
-                                       &dev_info->fw_minor, &dev_info->fw_rev,
-                                       &dev_info->fw_eng);
-       }
 
-       if (IS_PF(edev)) {
                ptt = ecore_ptt_acquire(ECORE_LEADING_HWFN(edev));
                if (ptt) {
                        ecore_mcp_get_mfw_ver(ECORE_LEADING_HWFN(edev), ptt,
@@ -361,12 +357,14 @@ qed_fill_dev_info(struct ecore_dev *edev, struct qed_dev_info *dev_info)
                        ecore_ptt_release(ECORE_LEADING_HWFN(edev), ptt);
                }
        } else {
+               ecore_vf_get_fw_version(&edev->hwfns[0], &dev_info->fw_major,
+                                       &dev_info->fw_minor, &dev_info->fw_rev,
+                                       &dev_info->fw_eng);
+
                ecore_mcp_get_mfw_ver(ECORE_LEADING_HWFN(edev), ptt,
                                      &dev_info->mfw_rev, NULL);
        }
 
-       dev_info->mtu = ECORE_LEADING_HWFN(edev)->hw_info.mtu;
-
        return 0;
 }