net/qede/base: use default MTU from shared memory
[dpdk.git] / drivers / net / qede / base / ecore_mcp.c
index cb3e0bd..8720ae7 100644 (file)
@@ -1431,6 +1431,16 @@ enum _ecore_status_t ecore_mcp_fill_shmem_func_info(struct ecore_hwfn *p_hwfn,
 
        info->ovlan = (u16)(shmem_info.ovlan_stag & FUNC_MF_CFG_OV_STAG_MASK);
 
+       info->mtu = (u16)shmem_info.mtu_size;
+
+       if (info->mtu == 0)
+               info->mtu = 1500;
+
+       info->mtu = (u16)shmem_info.mtu_size;
+
+       if (info->mtu == 0)
+               info->mtu = 1500;
+
        DP_VERBOSE(p_hwfn, (ECORE_MSG_SP | ECORE_MSG_IFUP),
                   "Read configuration from shmem: pause_on_host %02x"
                    " protocol %02x BW [%02x - %02x]"
@@ -1662,6 +1672,7 @@ ecore_mcp_send_drv_version(struct ecore_hwfn *p_hwfn, struct ecore_ptt *p_ptt,
        p_drv_version->version = p_ver->version;
        num_words = (MCP_DRV_VER_STR_SIZE - 4) / 4;
        for (i = 0; i < num_words; i++) {
+               /* The driver name is expected to be in a big-endian format */
                p_name = &p_ver->name[i * sizeof(u32)];
                val = OSAL_CPU_TO_BE32(*(u32 *)p_name);
                *(u32 *)&p_drv_version->name[i * sizeof(u32)] = val;
@@ -1709,22 +1720,24 @@ enum _ecore_status_t ecore_mcp_resume(struct ecore_hwfn *p_hwfn,
 enum _ecore_status_t
 ecore_mcp_ov_update_current_config(struct ecore_hwfn *p_hwfn,
                                   struct ecore_ptt *p_ptt,
-                                  enum ecore_ov_config_method config,
                                   enum ecore_ov_client client)
 {
        enum _ecore_status_t rc;
        u32 resp = 0, param = 0;
        u32 drv_mb_param;
 
-       switch (config) {
+       switch (client) {
        case ECORE_OV_CLIENT_DRV:
                drv_mb_param = DRV_MB_PARAM_OV_CURR_CFG_OS;
                break;
        case ECORE_OV_CLIENT_USER:
                drv_mb_param = DRV_MB_PARAM_OV_CURR_CFG_OTHER;
                break;
+       case ECORE_OV_CLIENT_VENDOR_SPEC:
+               drv_mb_param = DRV_MB_PARAM_OV_CURR_CFG_VENDOR_SPEC;
+               break;
        default:
-               DP_NOTICE(p_hwfn, true, "Invalid client type %d\n", config);
+               DP_NOTICE(p_hwfn, true, "Invalid client type %d\n", client);
                return ECORE_INVAL;
        }
 
@@ -1761,9 +1774,9 @@ ecore_mcp_ov_update_driver_state(struct ecore_hwfn *p_hwfn,
        }
 
        rc = ecore_mcp_cmd(p_hwfn, p_ptt, DRV_MSG_CODE_OV_UPDATE_DRIVER_STATE,
-                          drv_state, &resp, &param);
+                          drv_mb_param, &resp, &param);
        if (rc != ECORE_SUCCESS)
-               DP_ERR(p_hwfn, "MCP response failure, aborting\n");
+               DP_ERR(p_hwfn, "Failed to send driver state\n");
 
        return rc;
 }