net/qede/base: set driver type before sending load request
authorRasesh Mody <rasesh.mody@cavium.com>
Wed, 29 Mar 2017 20:36:23 +0000 (13:36 -0700)
committerFerruh Yigit <ferruh.yigit@intel.com>
Tue, 4 Apr 2017 17:02:51 +0000 (19:02 +0200)
Set the drv_type before sending LOAD_REQ and remove the
ver_str which is not used by the MFW

Signed-off-by: Rasesh Mody <rasesh.mody@cavium.com>
drivers/net/qede/base/ecore.h
drivers/net/qede/base/ecore_mcp.c
drivers/net/qede/qede_ethdev.c
drivers/net/qede/qede_if.h
drivers/net/qede/qede_main.c

index 58c97a3..b8c8bfd 100644 (file)
@@ -30,7 +30,6 @@
 
 #define MAX_HWFNS_PER_DEVICE   2
 #define NAME_SIZE 128 /* @DPDK */
-#define VER_SIZE 16
 #define ECORE_WFQ_UNIT 100
 #include "../qede_logs.h" /* @DPDK */
 
@@ -706,7 +705,7 @@ struct ecore_dev {
 
        int                             pcie_width;
        int                             pcie_speed;
-       u8                              ver_str[NAME_SIZE]; /* @DPDK */
+
        /* Add MF related configuration */
        u8                              mcp_rev;
        u8                              boot_mode;
index 9f897b5..2b9c819 100644 (file)
@@ -524,7 +524,6 @@ enum _ecore_status_t ecore_mcp_load_req(struct ecore_hwfn *p_hwfn,
 {
        struct ecore_dev *p_dev = p_hwfn->p_dev;
        struct ecore_mcp_mb_params mb_params;
-       union drv_union_data union_data;
        enum _ecore_status_t rc;
 
 #ifndef ASIC_ONLY
@@ -538,8 +537,6 @@ enum _ecore_status_t ecore_mcp_load_req(struct ecore_hwfn *p_hwfn,
        mb_params.cmd = DRV_MSG_CODE_LOAD_REQ;
        mb_params.param = PDA_COMP | DRV_ID_MCP_HSI_VER_CURRENT |
                          p_dev->drv_type;
-       OSAL_MEMCPY(&union_data.ver_str, p_dev->ver_str, MCP_DRV_VER_STR_SIZE);
-       mb_params.p_data_src = &union_data;
        rc = ecore_mcp_cmd_and_union(p_hwfn, p_ptt, &mb_params);
 
        /* if mcp fails to respond we must abort */
index c372181..d52e1be 100644 (file)
@@ -2175,7 +2175,7 @@ static int qede_common_dev_init(struct rte_eth_dev *eth_dev, bool is_vf)
 
        qede_alloc_etherdev(adapter, &dev_info);
 
-       adapter->ops->common->set_id(edev, edev->name, QEDE_PMD_VERSION);
+       adapter->ops->common->set_name(edev, edev->name);
 
        if (!is_vf)
                adapter->dev_info.num_mac_filters =
index 1e27428..0a1f7db 100644 (file)
@@ -116,8 +116,7 @@ struct qed_common_ops {
                     struct rte_pci_device *pci_dev,
                     enum qed_protocol protocol,
                     uint32_t dp_module, uint8_t dp_level, bool is_vf);
-       void (*set_id)(struct ecore_dev *edev,
-               char name[], const char ver_str[]);
+       void (*set_name)(struct ecore_dev *edev, char name[]);
        enum _ecore_status_t
                (*chain_alloc)(struct ecore_dev *edev,
                               enum ecore_chain_use_mode
index 1d4f336..a932c5f 100644 (file)
@@ -50,7 +50,9 @@ qed_probe(struct ecore_dev *edev, struct rte_pci_device *pci_dev,
        int rc;
 
        ecore_init_struct(edev);
+       edev->drv_type = DRV_ID_DRV_TYPE_LINUX;
        qdev->protocol = protocol;
+
        if (is_vf)
                edev->b_is_vf = true;
 
@@ -420,9 +422,7 @@ qed_fill_eth_dev_info(struct ecore_dev *edev, struct qed_dev_eth_info *info)
        return 0;
 }
 
-static void
-qed_set_id(struct ecore_dev *edev, char name[NAME_SIZE],
-          const char ver_str[NAME_SIZE])
+static void qed_set_name(struct ecore_dev *edev, char name[NAME_SIZE])
 {
        int i;
 
@@ -430,8 +430,6 @@ qed_set_id(struct ecore_dev *edev, char name[NAME_SIZE],
        for_each_hwfn(edev, i) {
                snprintf(edev->hwfns[i].name, NAME_SIZE, "%s-%d", name, i);
        }
-       memcpy(edev->ver_str, ver_str, NAME_SIZE);
-       edev->drv_type = DRV_ID_DRV_TYPE_LINUX;
 }
 
 static uint32_t
@@ -714,7 +712,7 @@ const struct qed_common_ops qed_common_ops_pass = {
        INIT_STRUCT_FIELD(probe, &qed_probe),
        INIT_STRUCT_FIELD(update_pf_params, &qed_update_pf_params),
        INIT_STRUCT_FIELD(slowpath_start, &qed_slowpath_start),
-       INIT_STRUCT_FIELD(set_id, &qed_set_id),
+       INIT_STRUCT_FIELD(set_name, &qed_set_name),
        INIT_STRUCT_FIELD(chain_alloc, &ecore_chain_alloc),
        INIT_STRUCT_FIELD(chain_free, &ecore_chain_free),
        INIT_STRUCT_FIELD(sb_init, &qed_sb_init),