Commit d2466013 authored by Shannon Nelson's avatar Shannon Nelson Committed by Jeff Kirsher

i40e/i40evf: add driver version string to driver version command

The driver version string was added to this struct to be passed
down through the firmware to low-level NC-SI functions. We tell
the firmware about the length of the ASCII string not counting
any terminating null.

Change-ID: I09ac98ff9b869e8661c55fc6a5c98808fc280c91
Signed-off-by: default avatarShannon Nelson <shannon.nelson@intel.com>
Acked-by: default avatarAnjali Singhai <anjali.singhai@intel.com>
Tested-by: default avatarKavindya Deegala <kavindya.s.deegala@intel.com>
Signed-off-by: default avatarJeff Kirsher <jeffrey.t.kirsher@intel.com>
parent 37cc0d2f
...@@ -1300,6 +1300,7 @@ i40e_status i40e_aq_send_driver_version(struct i40e_hw *hw, ...@@ -1300,6 +1300,7 @@ i40e_status i40e_aq_send_driver_version(struct i40e_hw *hw,
struct i40e_aqc_driver_version *cmd = struct i40e_aqc_driver_version *cmd =
(struct i40e_aqc_driver_version *)&desc.params.raw; (struct i40e_aqc_driver_version *)&desc.params.raw;
i40e_status status; i40e_status status;
int len;
if (dv == NULL) if (dv == NULL)
return I40E_ERR_PARAM; return I40E_ERR_PARAM;
...@@ -1311,7 +1312,14 @@ i40e_status i40e_aq_send_driver_version(struct i40e_hw *hw, ...@@ -1311,7 +1312,14 @@ i40e_status i40e_aq_send_driver_version(struct i40e_hw *hw,
cmd->driver_minor_ver = dv->minor_version; cmd->driver_minor_ver = dv->minor_version;
cmd->driver_build_ver = dv->build_version; cmd->driver_build_ver = dv->build_version;
cmd->driver_subbuild_ver = dv->subbuild_version; cmd->driver_subbuild_ver = dv->subbuild_version;
status = i40e_asq_send_command(hw, &desc, NULL, 0, cmd_details);
len = 0;
while (len < sizeof(dv->driver_string) &&
(dv->driver_string[len] < 0x80) &&
dv->driver_string[len])
len++;
status = i40e_asq_send_command(hw, &desc, dv->driver_string,
len, cmd_details);
return status; return status;
} }
......
...@@ -8394,6 +8394,7 @@ static int i40e_probe(struct pci_dev *pdev, const struct pci_device_id *ent) ...@@ -8394,6 +8394,7 @@ static int i40e_probe(struct pci_dev *pdev, const struct pci_device_id *ent)
dv.minor_version = DRV_VERSION_MINOR; dv.minor_version = DRV_VERSION_MINOR;
dv.build_version = DRV_VERSION_BUILD; dv.build_version = DRV_VERSION_BUILD;
dv.subbuild_version = 0; dv.subbuild_version = 0;
strncpy(dv.driver_string, DRV_VERSION, sizeof(dv.driver_string));
i40e_aq_send_driver_version(&pf->hw, &dv, NULL); i40e_aq_send_driver_version(&pf->hw, &dv, NULL);
/* since everything's happy, start the service_task timer */ /* since everything's happy, start the service_task timer */
......
...@@ -409,6 +409,7 @@ struct i40e_driver_version { ...@@ -409,6 +409,7 @@ struct i40e_driver_version {
u8 minor_version; u8 minor_version;
u8 build_version; u8 build_version;
u8 subbuild_version; u8 subbuild_version;
u8 driver_string[32];
}; };
/* RX Descriptors */ /* RX Descriptors */
......
...@@ -415,6 +415,7 @@ struct i40e_driver_version { ...@@ -415,6 +415,7 @@ struct i40e_driver_version {
u8 minor_version; u8 minor_version;
u8 build_version; u8 build_version;
u8 subbuild_version; u8 subbuild_version;
u8 driver_string[32];
}; };
/* RX Descriptors */ /* RX Descriptors */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment