net/i40e/base: fix AOC media type
[dpdk.git] / drivers / net / i40e / base / i40e_common.c
index ceedec6..2ca6a13 100644 (file)
@@ -1276,6 +1276,9 @@ STATIC enum i40e_media_type i40e_get_media_type(struct i40e_hw *hw)
        case I40E_PHY_TYPE_40GBASE_LR4:
        case I40E_PHY_TYPE_25GBASE_LR:
        case I40E_PHY_TYPE_25GBASE_SR:
+       case I40E_PHY_TYPE_10GBASE_AOC:
+       case I40E_PHY_TYPE_25GBASE_AOC:
+       case I40E_PHY_TYPE_40GBASE_AOC:
                media = I40E_MEDIA_TYPE_FIBER;
                break;
        case I40E_PHY_TYPE_100BASE_TX:
@@ -1290,10 +1293,7 @@ STATIC enum i40e_media_type i40e_get_media_type(struct i40e_hw *hw)
        case I40E_PHY_TYPE_10GBASE_CR1:
        case I40E_PHY_TYPE_40GBASE_CR4:
        case I40E_PHY_TYPE_10GBASE_SFPP_CU:
-       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;
@@ -1341,7 +1341,7 @@ STATIC enum i40e_status_code i40e_poll_globr(struct i40e_hw *hw,
        return I40E_ERR_RESET_FAILED;
 }
 
-#define I40E_PF_RESET_WAIT_COUNT       200
+#define I40E_PF_RESET_WAIT_COUNT       1000
 /**
  * i40e_pf_reset - Reset the PF
  * @hw: pointer to the hardware structure
@@ -2078,6 +2078,9 @@ 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;
 
+       /* 'Get Link Status' response data structure from X722 FW has
+        * different format and does not contain this information
+        */
        if (hw->flags & I40E_HW_FLAG_AQ_PHY_ACCESS_CAPABLE &&
            hw->mac.type != I40E_MAC_X722) {
                __le32 tmp;
@@ -2948,10 +2951,13 @@ enum i40e_status_code i40e_update_link_info(struct i40e_hw *hw)
                return status;
 
        /* extra checking needed to ensure link info to user is timely */
-       if ((hw->phy.link_info.link_info & I40E_AQ_MEDIA_AVAILABLE) &&
-           ((hw->phy.link_info.link_info & I40E_AQ_LINK_UP) ||
-            !(hw->phy.link_info_old.link_info & I40E_AQ_LINK_UP))) {
-               status = i40e_aq_get_phy_capabilities(hw, false, false,
+       if (((hw->phy.link_info.link_info & I40E_AQ_MEDIA_AVAILABLE) &&
+            ((hw->phy.link_info.link_info & I40E_AQ_LINK_UP) ||
+             !(hw->phy.link_info_old.link_info & I40E_AQ_LINK_UP))) ||
+               hw->mac.type == I40E_MAC_X722) {
+               status = i40e_aq_get_phy_capabilities(hw, false,
+                                                     hw->mac.type ==
+                                                     I40E_MAC_X722,
                                                      &abilities, NULL);
                if (status)
                        return status;