i40e/i40evf: add driver version string to driver version command
authorShannon Nelson <shannon.nelson@intel.com>
Tue, 1 Apr 2014 07:11:45 +0000 (07:11 +0000)
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>
Mon, 28 Apr 2014 11:21:49 +0000 (04:21 -0700)
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: Shannon Nelson <shannon.nelson@intel.com>
Acked-by: Anjali Singhai <anjali.singhai@intel.com>
Tested-by: Kavindya Deegala <kavindya.s.deegala@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
drivers/net/ethernet/intel/i40e/i40e_common.c
drivers/net/ethernet/intel/i40e/i40e_main.c
drivers/net/ethernet/intel/i40e/i40e_type.h
drivers/net/ethernet/intel/i40evf/i40e_type.h

index f8dfb4b7e99cd6b05caa72a6da868dd887a97a64..fde5aef75eab0f5ed1bbfcb2469ed41bc0169e17 100644 (file)
@@ -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 *)&desc.params.raw;
        i40e_status status;
+       int len;
 
        if (dv == NULL)
                return I40E_ERR_PARAM;
@@ -1311,7 +1312,14 @@ i40e_status i40e_aq_send_driver_version(struct i40e_hw *hw,
        cmd->driver_minor_ver = dv->minor_version;
        cmd->driver_build_ver = dv->build_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;
 }
index 4fe15d58adfa3aa1bc5ec80253c980531579bced..6f00de44213cf6182d52670bba65062cc669a29b 100644 (file)
@@ -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.build_version = DRV_VERSION_BUILD;
        dv.subbuild_version = 0;
+       strncpy(dv.driver_string, DRV_VERSION, sizeof(dv.driver_string));
        i40e_aq_send_driver_version(&pf->hw, &dv, NULL);
 
        /* since everything's happy, start the service_task timer */
index 71a968fe557f33e12f6feb81d416f4f5a55946fb..668acc78d34e4347d5a2816c9f988ab55c99e333 100644 (file)
@@ -409,6 +409,7 @@ struct i40e_driver_version {
        u8 minor_version;
        u8 build_version;
        u8 subbuild_version;
+       u8 driver_string[32];
 };
 
 /* RX Descriptors */
index 4673b3381eddaa1672edca1f60b85e89d33ab247..449a3be24210568920a3e98227d422fefbaa91fb 100644 (file)
@@ -415,6 +415,7 @@ struct i40e_driver_version {
        u8 minor_version;
        u8 build_version;
        u8 subbuild_version;
+       u8 driver_string[32];
 };
 
 /* RX Descriptors */