aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPeter P Waskiewicz Jr <peter.p.waskiewicz.jr@intel.com>2009-05-19 05:18:51 -0400
committerDavid S. Miller <davem@davemloft.net>2009-05-19 18:36:14 -0400
commit537d58a00a8756189b10ffc1309c0131d57b6320 (patch)
treeaaba725780bd6c7fec34b23323dd66c9f6596ff1
parentaa5aec888585fedcda7cfffc20f75240ad1cb42d (diff)
ixgbe: Change Direct Attach Twinax cable detection for SFP+ NICs
The SFF specification for Direct Attach cable detection has now been ratified. Previously, DA cable detect was looking at the Twinaxial bit in byte 9 of the SFP+ EEPROM. The spec now defines active and passive DA cables in byte 8 of the SFP+ EEPROM. This patch changes the cable detection for both 82598 and 82599 SFP+ adapters to conform to the new spec. 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>
-rw-r--r--drivers/net/ixgbe/ixgbe_phy.c20
-rw-r--r--drivers/net/ixgbe/ixgbe_phy.h4
2 files changed, 11 insertions, 13 deletions
diff --git a/drivers/net/ixgbe/ixgbe_phy.c b/drivers/net/ixgbe/ixgbe_phy.c
index 6d385ea3c2a..8210b49aeff 100644
--- a/drivers/net/ixgbe/ixgbe_phy.c
+++ b/drivers/net/ixgbe/ixgbe_phy.c
@@ -527,7 +527,7 @@ s32 ixgbe_identify_sfp_module_generic(struct ixgbe_hw *hw)
527 u8 comp_codes_1g = 0; 527 u8 comp_codes_1g = 0;
528 u8 comp_codes_10g = 0; 528 u8 comp_codes_10g = 0;
529 u8 oui_bytes[3] = {0, 0, 0}; 529 u8 oui_bytes[3] = {0, 0, 0};
530 u8 transmission_media = 0; 530 u8 cable_tech = 0;
531 u16 enforce_sfp = 0; 531 u16 enforce_sfp = 0;
532 532
533 status = hw->phy.ops.read_i2c_eeprom(hw, IXGBE_SFF_IDENTIFIER, 533 status = hw->phy.ops.read_i2c_eeprom(hw, IXGBE_SFF_IDENTIFIER,
@@ -543,8 +543,8 @@ s32 ixgbe_identify_sfp_module_generic(struct ixgbe_hw *hw)
543 &comp_codes_1g); 543 &comp_codes_1g);
544 hw->phy.ops.read_i2c_eeprom(hw, IXGBE_SFF_10GBE_COMP_CODES, 544 hw->phy.ops.read_i2c_eeprom(hw, IXGBE_SFF_10GBE_COMP_CODES,
545 &comp_codes_10g); 545 &comp_codes_10g);
546 hw->phy.ops.read_i2c_eeprom(hw, IXGBE_SFF_TRANSMISSION_MEDIA, 546 hw->phy.ops.read_i2c_eeprom(hw, IXGBE_SFF_CABLE_TECHNOLOGY,
547 &transmission_media); 547 &cable_tech);
548 548
549 /* ID Module 549 /* ID Module
550 * ========= 550 * =========
@@ -557,7 +557,7 @@ s32 ixgbe_identify_sfp_module_generic(struct ixgbe_hw *hw)
557 * 6 SFP_SR/LR_CORE1 - 82599-specific 557 * 6 SFP_SR/LR_CORE1 - 82599-specific
558 */ 558 */
559 if (hw->mac.type == ixgbe_mac_82598EB) { 559 if (hw->mac.type == ixgbe_mac_82598EB) {
560 if (transmission_media & IXGBE_SFF_TWIN_AX_CAPABLE) 560 if (cable_tech & IXGBE_SFF_DA_PASSIVE_CABLE)
561 hw->phy.sfp_type = ixgbe_sfp_type_da_cu; 561 hw->phy.sfp_type = ixgbe_sfp_type_da_cu;
562 else if (comp_codes_10g & IXGBE_SFF_10GBASESR_CAPABLE) 562 else if (comp_codes_10g & IXGBE_SFF_10GBASESR_CAPABLE)
563 hw->phy.sfp_type = ixgbe_sfp_type_sr; 563 hw->phy.sfp_type = ixgbe_sfp_type_sr;
@@ -566,7 +566,7 @@ s32 ixgbe_identify_sfp_module_generic(struct ixgbe_hw *hw)
566 else 566 else
567 hw->phy.sfp_type = ixgbe_sfp_type_unknown; 567 hw->phy.sfp_type = ixgbe_sfp_type_unknown;
568 } else if (hw->mac.type == ixgbe_mac_82599EB) { 568 } else if (hw->mac.type == ixgbe_mac_82599EB) {
569 if (transmission_media & IXGBE_SFF_TWIN_AX_CAPABLE) 569 if (cable_tech & IXGBE_SFF_DA_PASSIVE_CABLE)
570 if (hw->bus.lan_id == 0) 570 if (hw->bus.lan_id == 0)
571 hw->phy.sfp_type = 571 hw->phy.sfp_type =
572 ixgbe_sfp_type_da_cu_core0; 572 ixgbe_sfp_type_da_cu_core0;
@@ -621,8 +621,7 @@ s32 ixgbe_identify_sfp_module_generic(struct ixgbe_hw *hw)
621 621
622 switch (vendor_oui) { 622 switch (vendor_oui) {
623 case IXGBE_SFF_VENDOR_OUI_TYCO: 623 case IXGBE_SFF_VENDOR_OUI_TYCO:
624 if (transmission_media & 624 if (cable_tech & IXGBE_SFF_DA_PASSIVE_CABLE)
625 IXGBE_SFF_TWIN_AX_CAPABLE)
626 hw->phy.type = ixgbe_phy_tw_tyco; 625 hw->phy.type = ixgbe_phy_tw_tyco;
627 break; 626 break;
628 case IXGBE_SFF_VENDOR_OUI_FTL: 627 case IXGBE_SFF_VENDOR_OUI_FTL:
@@ -635,8 +634,7 @@ s32 ixgbe_identify_sfp_module_generic(struct ixgbe_hw *hw)
635 hw->phy.type = ixgbe_phy_sfp_intel; 634 hw->phy.type = ixgbe_phy_sfp_intel;
636 break; 635 break;
637 default: 636 default:
638 if (transmission_media & 637 if (cable_tech & IXGBE_SFF_DA_PASSIVE_CABLE)
639 IXGBE_SFF_TWIN_AX_CAPABLE)
640 hw->phy.type = ixgbe_phy_tw_unknown; 638 hw->phy.type = ixgbe_phy_tw_unknown;
641 else 639 else
642 hw->phy.type = ixgbe_phy_sfp_unknown; 640 hw->phy.type = ixgbe_phy_sfp_unknown;
@@ -644,8 +642,8 @@ s32 ixgbe_identify_sfp_module_generic(struct ixgbe_hw *hw)
644 } 642 }
645 } 643 }
646 644
647 /* All DA cables are supported */ 645 /* All passive DA cables are supported */
648 if (transmission_media & IXGBE_SFF_TWIN_AX_CAPABLE) { 646 if (cable_tech & IXGBE_SFF_DA_PASSIVE_CABLE) {
649 status = 0; 647 status = 0;
650 goto out; 648 goto out;
651 } 649 }
diff --git a/drivers/net/ixgbe/ixgbe_phy.h b/drivers/net/ixgbe/ixgbe_phy.h
index c9964b7ce1b..9b700f5bf1e 100644
--- a/drivers/net/ixgbe/ixgbe_phy.h
+++ b/drivers/net/ixgbe/ixgbe_phy.h
@@ -39,10 +39,10 @@
39#define IXGBE_SFF_VENDOR_OUI_BYTE2 0x27 39#define IXGBE_SFF_VENDOR_OUI_BYTE2 0x27
40#define IXGBE_SFF_1GBE_COMP_CODES 0x6 40#define IXGBE_SFF_1GBE_COMP_CODES 0x6
41#define IXGBE_SFF_10GBE_COMP_CODES 0x3 41#define IXGBE_SFF_10GBE_COMP_CODES 0x3
42#define IXGBE_SFF_TRANSMISSION_MEDIA 0x9 42#define IXGBE_SFF_CABLE_TECHNOLOGY 0x8
43 43
44/* Bitmasks */ 44/* Bitmasks */
45#define IXGBE_SFF_TWIN_AX_CAPABLE 0x80 45#define IXGBE_SFF_DA_PASSIVE_CABLE 0x4
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_1GBASELX_CAPABLE 0x2
48#define IXGBE_SFF_10GBASESR_CAPABLE 0x10 48#define IXGBE_SFF_10GBASESR_CAPABLE 0x10