ixgbe: Disallow SFP 1G modules in the SFP+ cages for 82598 and 82599
authorWaskiewicz Jr, Peter P <peter.p.waskiewicz.jr@intel.com>
Thu, 23 Apr 2009 11:31:37 +0000 (11:31 +0000)
committerDavid S. Miller <davem@davemloft.net>
Mon, 27 Apr 2009 10:15:42 +0000 (03:15 -0700)
82598 and 82599 do not support SFP 1G modules.  Instead of allowing the
driver to load, but never get link, rejecting the module and displaying
a useful message is more preferrable.  The framework for displaying the
failure message already exists, now we just need to detect and reject the
SFP modules.

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>
drivers/net/ixgbe/ixgbe_phy.c
drivers/net/ixgbe/ixgbe_type.h

index f3258ec901fe9b51bbe865f8dbf19cd590bc5e0b..2543c32ca84a7e27dab1837c7095f0c591c48d38 100644 (file)
@@ -673,11 +673,22 @@ s32 ixgbe_identify_sfp_module_generic(struct ixgbe_hw *hw)
                                break;
                        }
                }
-               if (hw->mac.type == ixgbe_mac_82598EB ||
-                   (hw->phy.sfp_type != ixgbe_sfp_type_sr &&
-                    hw->phy.sfp_type != ixgbe_sfp_type_lr &&
-                    hw->phy.sfp_type != ixgbe_sfp_type_srlr_core0 &&
-                    hw->phy.sfp_type != ixgbe_sfp_type_srlr_core1)) {
+
+               /* All DA cables are supported */
+               if (transmission_media & IXGBE_SFF_TWIN_AX_CAPABLE) {
+                       status = 0;
+                       goto out;
+               }
+
+               /* 1G SFP modules are not supported */
+               if (comp_codes_10g == 0) {
+                       hw->phy.type = ixgbe_phy_sfp_unsupported;
+                       status = IXGBE_ERR_SFP_NOT_SUPPORTED;
+                       goto out;
+               }
+
+               /* Anything else 82598-based is supported */
+               if (hw->mac.type == ixgbe_mac_82598EB) {
                        status = 0;
                        goto out;
                }
@@ -690,6 +701,7 @@ s32 ixgbe_identify_sfp_module_generic(struct ixgbe_hw *hw)
                                status = 0;
                        } else {
                                hw_dbg(hw, "SFP+ module not supported\n");
+                               hw->phy.type = ixgbe_phy_sfp_unsupported;
                                status = IXGBE_ERR_SFP_NOT_SUPPORTED;
                        }
                } else {
index a3317d8fbf6aa7b9b4e610e365ec893fc8037e37..375f0d4ad965af25cdde255984b3a1a912e0050e 100644 (file)
@@ -1904,6 +1904,7 @@ enum ixgbe_phy_type {
        ixgbe_phy_sfp_ftl,
        ixgbe_phy_sfp_unknown,
        ixgbe_phy_sfp_intel,
+       ixgbe_phy_sfp_unsupported,
        ixgbe_phy_generic
 };