From: Rasesh Mody Date: Wed, 29 Mar 2017 20:36:21 +0000 (-0700) Subject: net/qede/base: print firmware MFW and MBI versions X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=4fc58baef780ec3ec436a2e511bc6360c0528243;p=dpdk.git net/qede/base: print firmware MFW and MBI versions Add a printout of the FW, Management FW and MBI versions. Signed-off-by: Rasesh Mody --- diff --git a/drivers/net/qede/qede_if.h b/drivers/net/qede/qede_if.h index 18404fbdc9..1e27428b3a 100644 --- a/drivers/net/qede/qede_if.h +++ b/drivers/net/qede/qede_if.h @@ -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 { diff --git a/drivers/net/qede/qede_main.c b/drivers/net/qede/qede_main.c index e76346ecbe..1d4f336602 100644 --- a/drivers/net/qede/qede_main.c +++ b/drivers/net/qede/qede_main.c @@ -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; }