net/i40e/base: update FW AQ API version to 1.7
[dpdk.git] / drivers / net / i40e / base / i40e_common.c
index 7d59b59..9895a77 100644 (file)
@@ -1296,6 +1296,8 @@ STATIC enum i40e_media_type i40e_get_media_type(struct i40e_hw *hw)
        case I40E_PHY_TYPE_40GBASE_AOC:
        case I40E_PHY_TYPE_10GBASE_AOC:
        case I40E_PHY_TYPE_25GBASE_CR:
+       case I40E_PHY_TYPE_25GBASE_AOC:
+       case I40E_PHY_TYPE_25GBASE_ACC:
                media = I40E_MEDIA_TYPE_DA;
                break;
        case I40E_PHY_TYPE_1000BASE_KX:
@@ -1690,8 +1692,15 @@ enum i40e_status_code i40e_aq_get_phy_capabilities(struct i40e_hw *hw,
                status = I40E_ERR_UNKNOWN_PHY;
 
        if (report_init) {
-               hw->phy.phy_types = LE32_TO_CPU(abilities->phy_type);
-               hw->phy.phy_types |= ((u64)abilities->phy_type_ext << 32);
+               if (hw->mac.type ==  I40E_MAC_XL710 &&
+                   hw->aq.api_maj_ver == I40E_FW_API_VERSION_MAJOR &&
+                   hw->aq.api_min_ver >= I40E_MINOR_VER_GET_LINK_INFO_XL710) {
+                       status = i40e_aq_get_link_info(hw, true, NULL, NULL);
+               } else {
+                       hw->phy.phy_types = LE32_TO_CPU(abilities->phy_type);
+                       hw->phy.phy_types |=
+                                       ((u64)abilities->phy_type_ext << 32);
+               }
        }
 
        return status;
@@ -1953,7 +1962,7 @@ enum i40e_status_code i40e_aq_get_link_info(struct i40e_hw *hw,
        hw_link_info->fec_info = resp->config & (I40E_AQ_CONFIG_FEC_KR_ENA |
                                                 I40E_AQ_CONFIG_FEC_RS_ENA);
        hw_link_info->ext_info = resp->ext_info;
-       hw_link_info->loopback = resp->loopback;
+       hw_link_info->loopback = resp->loopback & I40E_AQ_LOOPBACK_MASK;
        hw_link_info->max_frame_size = LE16_TO_CPU(resp->max_frame_size);
        hw_link_info->pacing = resp->config & I40E_AQ_CONFIG_PACING_MASK;
 
@@ -1984,6 +1993,12 @@ enum i40e_status_code i40e_aq_get_link_info(struct i40e_hw *hw,
             hw->aq.fw_min_ver < 40)) && hw_link_info->phy_type == 0xE)
                hw_link_info->phy_type = I40E_PHY_TYPE_10GBASE_SFPP_CU;
 
+       if (hw->aq.api_maj_ver == I40E_FW_API_VERSION_MAJOR &&
+           hw->aq.api_min_ver >= 7) {
+               hw->phy.phy_types = LE32_TO_CPU(*(__le32 *)resp->link_type);
+               hw->phy.phy_types |= ((u64)resp->link_type_ext << 32);
+       }
+
        /* save link status information */
        if (link)
                i40e_memcpy(link, hw_link_info, sizeof(*hw_link_info),
@@ -7356,11 +7371,6 @@ i40e_write_profile(struct i40e_hw *hw, struct i40e_profile_segment *profile,
        u32 offset = 0, info = 0;
        u32 i;
 
-       if (!track_id) {
-               i40e_debug(hw, I40E_DEBUG_PACKAGE, "Track_id can't be 0.");
-               return I40E_NOT_SUPPORTED;
-       }
-
        dev_cnt = profile->device_table_count;
 
        for (i = 0; i < dev_cnt; i++) {
@@ -7435,6 +7445,6 @@ i40e_add_pinfo_to_list(struct i40e_hw *hw,
        memcpy(pinfo->name, profile->name, I40E_DDP_NAME_SIZE);
 
        status = i40e_aq_write_ddp(hw, (void *)sec, sec->data_end,
-                               track_id, &offset, &info, NULL);
+                                  track_id, &offset, &info, NULL);
        return status;
 }