New upstream version 16.11.4
[deb_dpdk.git] / drivers / net / qede / base / ecore_dcbx.c
index 8175619..8aa3c0b 100644 (file)
@@ -437,7 +437,7 @@ ecore_dcbx_get_app_data(struct ecore_hwfn *p_hwfn,
        p_params->app_error = ECORE_MFW_GET_FIELD(p_app->flags, DCBX_APP_ERROR);
        p_params->num_app_entries = ECORE_MFW_GET_FIELD(p_app->flags,
                                                        DCBX_APP_NUM_ENTRIES);
-       for (i = 0; i < DCBX_MAX_APP_PROTOCOL; i++) {
+       for (i = 0; i < p_params->num_app_entries; i++) {
                entry = &p_params->app_entry[i];
                if (ieee) {
                        u8 sf_ieee;
@@ -619,7 +619,7 @@ ecore_dcbx_get_remote_params(struct ecore_hwfn *p_hwfn,
        return ECORE_SUCCESS;
 }
 
-static enum _ecore_status_t
+static void
 ecore_dcbx_get_operational_params(struct ecore_hwfn *p_hwfn,
                                  struct ecore_ptt *p_ptt,
                                  struct ecore_dcbx_get *params)
@@ -644,7 +644,7 @@ ecore_dcbx_get_operational_params(struct ecore_hwfn *p_hwfn,
        if (!enabled) {
                p_operational->enabled = enabled;
                p_operational->valid = false;
-               return ECORE_INVAL;
+               return;
        }
 
        p_data = &p_operational->params;
@@ -671,8 +671,6 @@ ecore_dcbx_get_operational_params(struct ecore_hwfn *p_hwfn,
        p_operational->err = err;
        p_operational->enabled = enabled;
        p_operational->valid = true;
-
-       return rc;
 }
 
 static enum _ecore_status_t
@@ -1145,7 +1143,7 @@ ecore_dcbx_set_app_data(struct ecore_hwfn *p_hwfn,
        p_app->flags |= (u32)p_params->num_app_entries <<
                                        DCBX_APP_NUM_ENTRIES_SHIFT;
 
-       for (i = 0; i < DCBX_MAX_APP_PROTOCOL; i++) {
+       for (i = 0; i < p_params->num_app_entries; i++) {
                entry = &p_app->app_pri_tbl[i].entry;
                if (ieee) {
                        *entry &= ~DCBX_APP_SF_IEEE_MASK;
@@ -1340,7 +1338,7 @@ enum _ecore_status_t ecore_dcbx_get_config_params(struct ecore_hwfn *p_hwfn,
        p_hwfn->p_dcbx_info->set.enabled = dcbx_info->operational.enabled;
        OSAL_MEMCPY(&p_hwfn->p_dcbx_info->set.config.params,
                    &dcbx_info->operational.params,
-                   sizeof(struct ecore_dcbx_admin_params));
+                   sizeof(p_hwfn->p_dcbx_info->set.config.params));
        p_hwfn->p_dcbx_info->set.config.valid = true;
 
        OSAL_MEMCPY(params, &p_hwfn->p_dcbx_info->set,