i40e/base: store firmware version
authorHelin Zhang <helin.zhang@intel.com>
Thu, 30 Apr 2015 15:03:22 +0000 (23:03 +0800)
committerThomas Monjalon <thomas.monjalon@6wind.com>
Fri, 15 May 2015 14:33:16 +0000 (16:33 +0200)
Since the FW build number is available in the AQ response, save it
off for future use.

Test report: http://www.dpdk.org/ml/archives/dev/2015-May/017384.html

Signed-off-by: Helin Zhang <helin.zhang@intel.com>
Acked-by: Jijiang Liu <jijiang.liu@intel.com>
Tested-by: Min Cao <min.cao@intel.com>
lib/librte_pmd_i40e/i40e/i40e_adminq.c
lib/librte_pmd_i40e/i40e/i40e_adminq.h
lib/librte_pmd_i40e/i40e/i40e_common.c
lib/librte_pmd_i40e/i40e/i40e_prototype.h

index e76e0af..c91f3ff 100644 (file)
@@ -607,6 +607,7 @@ enum i40e_status_code i40e_init_adminq(struct i40e_hw *hw)
                ret_code = i40e_aq_get_firmware_version(hw,
                                                        &hw->aq.fw_maj_ver,
                                                        &hw->aq.fw_min_ver,
+                                                       &hw->aq.fw_build,
                                                        &hw->aq.api_maj_ver,
                                                        &hw->aq.api_min_ver,
                                                        NULL);
index d8c1fb6..3c88bb4 100644 (file)
@@ -100,6 +100,7 @@ struct i40e_adminq_info {
        u16 asq_buf_size;               /* send queue buffer size */
        u16 fw_maj_ver;                 /* firmware major version */
        u16 fw_min_ver;                 /* firmware minor version */
+       u32 fw_build;                   /* firmware build number */
        u16 api_maj_ver;                /* api major version */
        u16 api_min_ver;                /* api minor version */
        bool nvm_busy;
index 4722614..09440db 100644 (file)
@@ -1909,6 +1909,7 @@ enum i40e_status_code i40e_aq_get_switch_config(struct i40e_hw *hw,
  * @hw: pointer to the hw struct
  * @fw_major_version: firmware major version
  * @fw_minor_version: firmware minor version
+ * @fw_build: firmware build number
  * @api_major_version: major queue version
  * @api_minor_version: minor queue version
  * @cmd_details: pointer to command details structure or NULL
@@ -1917,6 +1918,7 @@ enum i40e_status_code i40e_aq_get_switch_config(struct i40e_hw *hw,
  **/
 enum i40e_status_code i40e_aq_get_firmware_version(struct i40e_hw *hw,
                                u16 *fw_major_version, u16 *fw_minor_version,
+                               u32 *fw_build,
                                u16 *api_major_version, u16 *api_minor_version,
                                struct i40e_asq_cmd_details *cmd_details)
 {
@@ -1934,6 +1936,8 @@ enum i40e_status_code i40e_aq_get_firmware_version(struct i40e_hw *hw,
                        *fw_major_version = LE16_TO_CPU(resp->fw_major);
                if (fw_minor_version != NULL)
                        *fw_minor_version = LE16_TO_CPU(resp->fw_minor);
+               if (fw_build != NULL)
+                       *fw_build = LE32_TO_CPU(resp->fw_build);
                if (api_major_version != NULL)
                        *api_major_version = LE16_TO_CPU(resp->api_major);
                if (api_minor_version != NULL)
index 2165ac8..9cf17ac 100644 (file)
@@ -86,6 +86,7 @@ void i40e_led_set(struct i40e_hw *hw, u32 mode, bool blink);
 
 enum i40e_status_code i40e_aq_get_firmware_version(struct i40e_hw *hw,
                                u16 *fw_major_version, u16 *fw_minor_version,
+                               u32 *fw_build,
                                u16 *api_major_version, u16 *api_minor_version,
                                struct i40e_asq_cmd_details *cmd_details);
 enum i40e_status_code i40e_aq_debug_write_register(struct i40e_hw *hw,