aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/net/ixgbe
diff options
context:
space:
mode:
authorEmil Tantilov <emil.s.tantilov@intel.com>2011-02-12 05:52:07 -0500
committerJeff Kirsher <jeffrey.t.kirsher@intel.com>2011-03-03 05:57:25 -0500
commit21cc5b4f7eb7b6de90588331b7d0edb246502f46 (patch)
treed5c5b1ed2da3dc0fd6d9581bd677a88c184e9754 /drivers/net/ixgbe
parent894ff7cf0e0cf7596f9b0d3c30e32c87f8df2784 (diff)
ixgbe: set media type for 82599 T3 LOM
The media type was not being set for the 82599 T3 LAN on motherboard. This change corrects that. Signed-off-by: Emil Tantilov <emil.s.tantilov@intel.com> Tested-by: Stephen Ko <stephen.s.ko@intel.com> Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Diffstat (limited to 'drivers/net/ixgbe')
-rw-r--r--drivers/net/ixgbe/ixgbe_82599.c50
-rw-r--r--drivers/net/ixgbe/ixgbe_main.c2
-rw-r--r--drivers/net/ixgbe/ixgbe_type.h1
3 files changed, 42 insertions, 11 deletions
diff --git a/drivers/net/ixgbe/ixgbe_82599.c b/drivers/net/ixgbe/ixgbe_82599.c
index a21f5817685..b45a491ac2e 100644
--- a/drivers/net/ixgbe/ixgbe_82599.c
+++ b/drivers/net/ixgbe/ixgbe_82599.c
@@ -329,11 +329,14 @@ static enum ixgbe_media_type ixgbe_get_media_type_82599(struct ixgbe_hw *hw)
329 enum ixgbe_media_type media_type; 329 enum ixgbe_media_type media_type;
330 330
331 /* Detect if there is a copper PHY attached. */ 331 /* Detect if there is a copper PHY attached. */
332 if (hw->phy.type == ixgbe_phy_cu_unknown || 332 switch (hw->phy.type) {
333 hw->phy.type == ixgbe_phy_tn || 333 case ixgbe_phy_cu_unknown:
334 hw->phy.type == ixgbe_phy_aq) { 334 case ixgbe_phy_tn:
335 case ixgbe_phy_aq:
335 media_type = ixgbe_media_type_copper; 336 media_type = ixgbe_media_type_copper;
336 goto out; 337 goto out;
338 default:
339 break;
337 } 340 }
338 341
339 switch (hw->device_id) { 342 switch (hw->device_id) {
@@ -354,6 +357,9 @@ static enum ixgbe_media_type ixgbe_get_media_type_82599(struct ixgbe_hw *hw)
354 case IXGBE_DEV_ID_82599_CX4: 357 case IXGBE_DEV_ID_82599_CX4:
355 media_type = ixgbe_media_type_cx4; 358 media_type = ixgbe_media_type_cx4;
356 break; 359 break;
360 case IXGBE_DEV_ID_82599_T3_LOM:
361 media_type = ixgbe_media_type_copper;
362 break;
357 default: 363 default:
358 media_type = ixgbe_media_type_unknown; 364 media_type = ixgbe_media_type_unknown;
359 break; 365 break;
@@ -1733,13 +1739,34 @@ static s32 ixgbe_start_hw_82599(struct ixgbe_hw *hw)
1733 * @hw: pointer to hardware structure 1739 * @hw: pointer to hardware structure
1734 * 1740 *
1735 * Determines the physical layer module found on the current adapter. 1741 * Determines the physical layer module found on the current adapter.
1742 * If PHY already detected, maintains current PHY type in hw struct,
1743 * otherwise executes the PHY detection routine.
1736 **/ 1744 **/
1737static s32 ixgbe_identify_phy_82599(struct ixgbe_hw *hw) 1745s32 ixgbe_identify_phy_82599(struct ixgbe_hw *hw)
1738{ 1746{
1739 s32 status = IXGBE_ERR_PHY_ADDR_INVALID; 1747 s32 status = IXGBE_ERR_PHY_ADDR_INVALID;
1748
1749 /* Detect PHY if not unknown - returns success if already detected. */
1740 status = ixgbe_identify_phy_generic(hw); 1750 status = ixgbe_identify_phy_generic(hw);
1741 if (status != 0) 1751 if (status != 0) {
1742 status = ixgbe_identify_sfp_module_generic(hw); 1752 /* 82599 10GBASE-T requires an external PHY */
1753 if (hw->mac.ops.get_media_type(hw) == ixgbe_media_type_copper)
1754 goto out;
1755 else
1756 status = ixgbe_identify_sfp_module_generic(hw);
1757 }
1758
1759 /* Set PHY type none if no PHY detected */
1760 if (hw->phy.type == ixgbe_phy_unknown) {
1761 hw->phy.type = ixgbe_phy_none;
1762 status = 0;
1763 }
1764
1765 /* Return error if SFP module has been detected but is not supported */
1766 if (hw->phy.type == ixgbe_phy_sfp_unsupported)
1767 status = IXGBE_ERR_SFP_NOT_SUPPORTED;
1768
1769out:
1743 return status; 1770 return status;
1744} 1771}
1745 1772
@@ -1763,11 +1790,12 @@ static u32 ixgbe_get_supported_physical_layer_82599(struct ixgbe_hw *hw)
1763 1790
1764 hw->phy.ops.identify(hw); 1791 hw->phy.ops.identify(hw);
1765 1792
1766 if (hw->phy.type == ixgbe_phy_tn || 1793 switch (hw->phy.type) {
1767 hw->phy.type == ixgbe_phy_aq || 1794 case ixgbe_phy_tn:
1768 hw->phy.type == ixgbe_phy_cu_unknown) { 1795 case ixgbe_phy_aq:
1796 case ixgbe_phy_cu_unknown:
1769 hw->phy.ops.read_reg(hw, MDIO_PMA_EXTABLE, MDIO_MMD_PMAPMD, 1797 hw->phy.ops.read_reg(hw, MDIO_PMA_EXTABLE, MDIO_MMD_PMAPMD,
1770 &ext_ability); 1798 &ext_ability);
1771 if (ext_ability & MDIO_PMA_EXTABLE_10GBT) 1799 if (ext_ability & MDIO_PMA_EXTABLE_10GBT)
1772 physical_layer |= IXGBE_PHYSICAL_LAYER_10GBASE_T; 1800 physical_layer |= IXGBE_PHYSICAL_LAYER_10GBASE_T;
1773 if (ext_ability & MDIO_PMA_EXTABLE_1000BT) 1801 if (ext_ability & MDIO_PMA_EXTABLE_1000BT)
@@ -1775,6 +1803,8 @@ static u32 ixgbe_get_supported_physical_layer_82599(struct ixgbe_hw *hw)
1775 if (ext_ability & MDIO_PMA_EXTABLE_100BTX) 1803 if (ext_ability & MDIO_PMA_EXTABLE_100BTX)
1776 physical_layer |= IXGBE_PHYSICAL_LAYER_100BASE_TX; 1804 physical_layer |= IXGBE_PHYSICAL_LAYER_100BASE_TX;
1777 goto out; 1805 goto out;
1806 default:
1807 break;
1778 } 1808 }
1779 1809
1780 switch (autoc & IXGBE_AUTOC_LMS_MASK) { 1810 switch (autoc & IXGBE_AUTOC_LMS_MASK) {
diff --git a/drivers/net/ixgbe/ixgbe_main.c b/drivers/net/ixgbe/ixgbe_main.c
index 588661ba2b9..987771968cb 100644
--- a/drivers/net/ixgbe/ixgbe_main.c
+++ b/drivers/net/ixgbe/ixgbe_main.c
@@ -3889,7 +3889,7 @@ static int ixgbe_up_complete(struct ixgbe_adapter *adapter)
3889 * If we're not hot-pluggable SFP+, we just need to configure link 3889 * If we're not hot-pluggable SFP+, we just need to configure link
3890 * and bring it up. 3890 * and bring it up.
3891 */ 3891 */
3892 if (hw->phy.type == ixgbe_phy_unknown) 3892 if (hw->phy.type == ixgbe_phy_none)
3893 schedule_work(&adapter->sfp_config_module_task); 3893 schedule_work(&adapter->sfp_config_module_task);
3894 3894
3895 /* enable transmits */ 3895 /* enable transmits */
diff --git a/drivers/net/ixgbe/ixgbe_type.h b/drivers/net/ixgbe/ixgbe_type.h
index 18780d07014..af5ad406ef1 100644
--- a/drivers/net/ixgbe/ixgbe_type.h
+++ b/drivers/net/ixgbe/ixgbe_type.h
@@ -2242,6 +2242,7 @@ enum ixgbe_mac_type {
2242 2242
2243enum ixgbe_phy_type { 2243enum ixgbe_phy_type {
2244 ixgbe_phy_unknown = 0, 2244 ixgbe_phy_unknown = 0,
2245 ixgbe_phy_none,
2245 ixgbe_phy_tn, 2246 ixgbe_phy_tn,
2246 ixgbe_phy_aq, 2247 ixgbe_phy_aq,
2247 ixgbe_phy_cu_unknown, 2248 ixgbe_phy_cu_unknown,