diff options
author | PJ Waskiewicz <peter.p.waskiewicz.jr@intel.com> | 2009-04-09 18:28:15 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2009-04-11 05:48:01 -0400 |
commit | 553b449784e27bb7244c41aa27397d29f213e5a3 (patch) | |
tree | 041c34e3d1524ffd530c3a196e7846370a8b5d5a /drivers/net/ixgbe | |
parent | 04f165ef4f18444854865d44a3359618480060af (diff) |
ixgbe: Remove unnecessary PHY reset, properly identify multispeed fiber modules
This patch does two things:
1) On 82599, the PHY is emedded in the MAC. On 82598, the SFP+ NIC has an external PHY. The reset in the SFP+ setup patch for 82598 is unnecessary on 82599, and adds extra dead time to device initialization. This removes that PHY reset for 82599 only.
2) On 82599, the SFP+ modules are multispeed fiber modules (10G/1G). We need to make sure to identify them properly for the remaining init sections to properly set them up.
Signed-off-by: Peter P Waskiewicz Jr <peter.p.waskiewicz.jr@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ixgbe')
-rw-r--r-- | drivers/net/ixgbe/ixgbe_82599.c | 24 | ||||
-rw-r--r-- | drivers/net/ixgbe/ixgbe_phy.c | 11 | ||||
-rw-r--r-- | drivers/net/ixgbe/ixgbe_phy.h | 1 | ||||
-rw-r--r-- | drivers/net/ixgbe/ixgbe_type.h | 1 |
4 files changed, 29 insertions, 8 deletions
diff --git a/drivers/net/ixgbe/ixgbe_82599.c b/drivers/net/ixgbe/ixgbe_82599.c index 9a9998985004..72a0d27a19af 100644 --- a/drivers/net/ixgbe/ixgbe_82599.c +++ b/drivers/net/ixgbe/ixgbe_82599.c | |||
@@ -102,6 +102,9 @@ s32 ixgbe_setup_sfp_modules_82599(struct ixgbe_hw *hw) | |||
102 | 102 | ||
103 | if (hw->phy.sfp_type != ixgbe_sfp_type_unknown) { | 103 | if (hw->phy.sfp_type != ixgbe_sfp_type_unknown) { |
104 | ixgbe_init_mac_link_ops_82599(hw); | 104 | ixgbe_init_mac_link_ops_82599(hw); |
105 | |||
106 | hw->phy.ops.reset = NULL; | ||
107 | |||
105 | ret_val = ixgbe_get_sfp_init_sequence_offsets(hw, &list_offset, | 108 | ret_val = ixgbe_get_sfp_init_sequence_offsets(hw, &list_offset, |
106 | &data_offset); | 109 | &data_offset); |
107 | 110 | ||
@@ -716,19 +719,24 @@ s32 ixgbe_reset_hw_82599(struct ixgbe_hw *hw) | |||
716 | /* Call adapter stop to disable tx/rx and clear interrupts */ | 719 | /* Call adapter stop to disable tx/rx and clear interrupts */ |
717 | hw->mac.ops.stop_adapter(hw); | 720 | hw->mac.ops.stop_adapter(hw); |
718 | 721 | ||
719 | /* Reset PHY */ | 722 | /* PHY ops must be identified and initialized prior to reset */ |
720 | if (hw->phy.reset_disable == false) { | ||
721 | /* PHY ops must be identified and initialized prior to reset */ | ||
722 | 723 | ||
723 | /* Init PHY and function pointers, perform SFP setup */ | 724 | /* Init PHY and function pointers, perform SFP setup */ |
724 | status = hw->phy.ops.init(hw); | 725 | status = hw->phy.ops.init(hw); |
725 | 726 | ||
726 | if (status == IXGBE_ERR_SFP_NOT_SUPPORTED) | 727 | if (status == IXGBE_ERR_SFP_NOT_SUPPORTED) |
727 | goto reset_hw_out; | 728 | goto reset_hw_out; |
728 | 729 | ||
729 | hw->phy.ops.reset(hw); | 730 | /* Setup SFP module if there is one present. */ |
731 | if (hw->phy.sfp_setup_needed) { | ||
732 | status = hw->mac.ops.setup_sfp(hw); | ||
733 | hw->phy.sfp_setup_needed = false; | ||
730 | } | 734 | } |
731 | 735 | ||
736 | /* Reset PHY */ | ||
737 | if (hw->phy.reset_disable == false && hw->phy.ops.reset != NULL) | ||
738 | hw->phy.ops.reset(hw); | ||
739 | |||
732 | /* | 740 | /* |
733 | * Prevent the PCI-E bus from from hanging by disabling PCI-E master | 741 | * Prevent the PCI-E bus from from hanging by disabling PCI-E master |
734 | * access and verify no pending requests before reset | 742 | * access and verify no pending requests before reset |
diff --git a/drivers/net/ixgbe/ixgbe_phy.c b/drivers/net/ixgbe/ixgbe_phy.c index 14e9606aa3b3..6f11df756daa 100644 --- a/drivers/net/ixgbe/ixgbe_phy.c +++ b/drivers/net/ixgbe/ixgbe_phy.c | |||
@@ -552,6 +552,7 @@ s32 ixgbe_identify_sfp_module_generic(struct ixgbe_hw *hw) | |||
552 | { | 552 | { |
553 | s32 status = IXGBE_ERR_PHY_ADDR_INVALID; | 553 | s32 status = IXGBE_ERR_PHY_ADDR_INVALID; |
554 | u32 vendor_oui = 0; | 554 | u32 vendor_oui = 0; |
555 | enum ixgbe_sfp_type stored_sfp_type = hw->phy.sfp_type; | ||
555 | u8 identifier = 0; | 556 | u8 identifier = 0; |
556 | u8 comp_codes_1g = 0; | 557 | u8 comp_codes_1g = 0; |
557 | u8 comp_codes_10g = 0; | 558 | u8 comp_codes_10g = 0; |
@@ -620,6 +621,16 @@ s32 ixgbe_identify_sfp_module_generic(struct ixgbe_hw *hw) | |||
620 | hw->phy.sfp_type = ixgbe_sfp_type_unknown; | 621 | hw->phy.sfp_type = ixgbe_sfp_type_unknown; |
621 | } | 622 | } |
622 | 623 | ||
624 | if (hw->phy.sfp_type != stored_sfp_type) | ||
625 | hw->phy.sfp_setup_needed = true; | ||
626 | |||
627 | /* Determine if the SFP+ PHY is dual speed or not. */ | ||
628 | if (((comp_codes_1g & IXGBE_SFF_1GBASESX_CAPABLE) && | ||
629 | (comp_codes_10g & IXGBE_SFF_10GBASESR_CAPABLE)) || | ||
630 | ((comp_codes_1g & IXGBE_SFF_1GBASELX_CAPABLE) && | ||
631 | (comp_codes_10g & IXGBE_SFF_10GBASELR_CAPABLE))) | ||
632 | hw->phy.multispeed_fiber = true; | ||
633 | |||
623 | /* Determine PHY vendor */ | 634 | /* Determine PHY vendor */ |
624 | if (hw->phy.type == ixgbe_phy_unknown) { | 635 | if (hw->phy.type == ixgbe_phy_unknown) { |
625 | hw->phy.id = identifier; | 636 | hw->phy.id = identifier; |
diff --git a/drivers/net/ixgbe/ixgbe_phy.h b/drivers/net/ixgbe/ixgbe_phy.h index cc5f1b3287e1..c9964b7ce1b9 100644 --- a/drivers/net/ixgbe/ixgbe_phy.h +++ b/drivers/net/ixgbe/ixgbe_phy.h | |||
@@ -44,6 +44,7 @@ | |||
44 | /* Bitmasks */ | 44 | /* Bitmasks */ |
45 | #define IXGBE_SFF_TWIN_AX_CAPABLE 0x80 | 45 | #define IXGBE_SFF_TWIN_AX_CAPABLE 0x80 |
46 | #define IXGBE_SFF_1GBASESX_CAPABLE 0x1 | 46 | #define IXGBE_SFF_1GBASESX_CAPABLE 0x1 |
47 | #define IXGBE_SFF_1GBASELX_CAPABLE 0x2 | ||
47 | #define IXGBE_SFF_10GBASESR_CAPABLE 0x10 | 48 | #define IXGBE_SFF_10GBASESR_CAPABLE 0x10 |
48 | #define IXGBE_SFF_10GBASELR_CAPABLE 0x20 | 49 | #define IXGBE_SFF_10GBASELR_CAPABLE 0x20 |
49 | #define IXGBE_I2C_EEPROM_READ_MASK 0x100 | 50 | #define IXGBE_I2C_EEPROM_READ_MASK 0x100 |
diff --git a/drivers/net/ixgbe/ixgbe_type.h b/drivers/net/ixgbe/ixgbe_type.h index 06d7e8ae6225..db65c05773ad 100644 --- a/drivers/net/ixgbe/ixgbe_type.h +++ b/drivers/net/ixgbe/ixgbe_type.h | |||
@@ -2198,6 +2198,7 @@ struct ixgbe_phy_info { | |||
2198 | u32 addr; | 2198 | u32 addr; |
2199 | u32 id; | 2199 | u32 id; |
2200 | enum ixgbe_sfp_type sfp_type; | 2200 | enum ixgbe_sfp_type sfp_type; |
2201 | bool sfp_setup_needed; | ||
2201 | u32 revision; | 2202 | u32 revision; |
2202 | enum ixgbe_media_type media_type; | 2203 | enum ixgbe_media_type media_type; |
2203 | bool reset_disable; | 2204 | bool reset_disable; |