Merge branch 'for-4.8/upstream-fixes' into for-next
[deliverable/linux.git] / drivers / net / ethernet / qlogic / qed / qed_init_ops.c
index 3269b3610e03993aab05ef197834775fbbb558a9..9866a20d212812edc36155135a0b43db03acc951 100644 (file)
@@ -18,6 +18,7 @@
 #include "qed_hw.h"
 #include "qed_init_ops.h"
 #include "qed_reg_addr.h"
+#include "qed_sriov.h"
 
 #define QED_INIT_MAX_POLL_COUNT 100
 #define QED_INIT_POLL_PERIOD_US 500
@@ -128,6 +129,9 @@ int qed_init_alloc(struct qed_hwfn *p_hwfn)
 {
        struct qed_rt_data *rt_data = &p_hwfn->rt_data;
 
+       if (IS_VF(p_hwfn->cdev))
+               return 0;
+
        rt_data->b_valid = kzalloc(sizeof(bool) * RUNTIME_ARRAY_SIZE,
                                   GFP_KERNEL);
        if (!rt_data->b_valid)
@@ -539,8 +543,7 @@ void qed_gtt_init(struct qed_hwfn *p_hwfn)
                               pxp_global_win[i]);
 }
 
-int qed_init_fw_data(struct qed_dev *cdev,
-                    const u8 *data)
+int qed_init_fw_data(struct qed_dev *cdev, const u8 *data)
 {
        struct qed_fw_data *fw = cdev->fw_data;
        struct bin_buffer_hdr *buf_hdr;
@@ -551,7 +554,11 @@ int qed_init_fw_data(struct qed_dev *cdev,
                return -EINVAL;
        }
 
-       buf_hdr = (struct bin_buffer_hdr *)data;
+       /* First Dword contains metadata and should be skipped */
+       buf_hdr = (struct bin_buffer_hdr *)(data + sizeof(u32));
+
+       offset = buf_hdr[BIN_BUF_FW_VER_INFO].offset;
+       fw->fw_ver_info = (struct fw_ver_info *)(data + offset);
 
        offset = buf_hdr[BIN_BUF_INIT_CMD].offset;
        fw->init_ops = (union init_op *)(data + offset);
This page took 0.025304 seconds and 5 git commands to generate.