version 1.250, 2020/08/31 06:23:19 |
version 1.251, 2020/08/31 11:19:54 |
|
|
#endif |
#endif |
|
|
#include "ixgbe.h" |
#include "ixgbe.h" |
|
#include "ixgbe_phy.h" |
#include "ixgbe_sriov.h" |
#include "ixgbe_sriov.h" |
#include "vlan.h" |
#include "vlan.h" |
|
|
Line 257 static int ixgbe_sysctl_debug(SYSCTLFN_P |
|
Line 258 static int ixgbe_sysctl_debug(SYSCTLFN_P |
|
static int ixgbe_sysctl_wol_enable(SYSCTLFN_PROTO); |
static int ixgbe_sysctl_wol_enable(SYSCTLFN_PROTO); |
static int ixgbe_sysctl_wufc(SYSCTLFN_PROTO); |
static int ixgbe_sysctl_wufc(SYSCTLFN_PROTO); |
|
|
/* Support for pluggable optic modules */ |
|
static bool ixgbe_sfp_cage_full(struct adapter *); |
|
|
|
/* Legacy (single vector) interrupt handler */ |
/* Legacy (single vector) interrupt handler */ |
static int ixgbe_legacy_irq(void *); |
static int ixgbe_legacy_irq(void *); |
|
|
Line 786 ixgbe_quirks(struct adapter *adapter) |
|
Line 784 ixgbe_quirks(struct adapter *adapter) |
|
(strcmp(product, "MA10-ST0") == 0)) { |
(strcmp(product, "MA10-ST0") == 0)) { |
aprint_verbose_dev(dev, |
aprint_verbose_dev(dev, |
"Enable SFP+ MOD_ABS inverse quirk\n"); |
"Enable SFP+ MOD_ABS inverse quirk\n"); |
adapter->quirks |= IXGBE_QUIRK_MOD_ABS_INVERT; |
adapter->hw.quirks |= IXGBE_QUIRK_MOD_ABS_INVERT; |
} |
} |
} |
} |
} |
} |
Line 4519 ixgbe_handle_timer(struct work *wk, void |
|
Line 4517 ixgbe_handle_timer(struct work *wk, void |
|
|
|
was_full = |
was_full = |
hw->phy.sfp_type != ixgbe_sfp_type_not_present; |
hw->phy.sfp_type != ixgbe_sfp_type_not_present; |
is_full = ixgbe_sfp_cage_full(adapter); |
is_full = ixgbe_sfp_cage_full(hw); |
|
|
/* Do probe if cage state changed */ |
/* Do probe if cage state changed */ |
if (was_full ^ is_full) |
if (was_full ^ is_full) |
Line 4661 ixgbe_handle_recovery_mode_timer(struct |
|
Line 4659 ixgbe_handle_recovery_mode_timer(struct |
|
} /* ixgbe_handle_recovery_mode_timer */ |
} /* ixgbe_handle_recovery_mode_timer */ |
|
|
/************************************************************************ |
/************************************************************************ |
* ixgbe_sfp_cage_full |
|
* |
|
* Determine if a port had optics inserted. |
|
************************************************************************/ |
|
static bool |
|
ixgbe_sfp_cage_full(struct adapter *adapter) |
|
{ |
|
struct ixgbe_hw *hw = &adapter->hw; |
|
uint32_t mask; |
|
int rv; |
|
|
|
if (hw->mac.type >= ixgbe_mac_X540) |
|
mask = IXGBE_ESDP_SDP0; |
|
else |
|
mask = IXGBE_ESDP_SDP2; |
|
|
|
rv = IXGBE_READ_REG(hw, IXGBE_ESDP) & mask; |
|
if ((adapter->quirks & IXGBE_QUIRK_MOD_ABS_INVERT) != 0) |
|
rv = !rv; |
|
|
|
if (hw->mac.type == ixgbe_mac_X550EM_a) { |
|
/* X550EM_a's SDP0 is inverted than others. */ |
|
return !rv; |
|
} |
|
|
|
return rv; |
|
} /* ixgbe_sfp_cage_full */ |
|
|
|
/************************************************************************ |
|
* ixgbe_handle_mod - Tasklet for SFP module interrupts |
* ixgbe_handle_mod - Tasklet for SFP module interrupts |
************************************************************************/ |
************************************************************************/ |
static void |
static void |
Line 4699 ixgbe_handle_mod(void *context) |
|
Line 4668 ixgbe_handle_mod(void *context) |
|
struct ixgbe_hw *hw = &adapter->hw; |
struct ixgbe_hw *hw = &adapter->hw; |
device_t dev = adapter->dev; |
device_t dev = adapter->dev; |
enum ixgbe_sfp_type last_sfp_type; |
enum ixgbe_sfp_type last_sfp_type; |
u32 err, cage_full = 0; |
u32 err; |
bool last_unsupported_sfp_recovery; |
bool last_unsupported_sfp_recovery; |
|
|
last_sfp_type = hw->phy.sfp_type; |
last_sfp_type = hw->phy.sfp_type; |
last_unsupported_sfp_recovery = hw->need_unsupported_sfp_recovery; |
last_unsupported_sfp_recovery = hw->need_unsupported_sfp_recovery; |
++adapter->mod_workev.ev_count; |
++adapter->mod_workev.ev_count; |
if (adapter->hw.need_crosstalk_fix) { |
if (adapter->hw.need_crosstalk_fix) { |
switch (hw->mac.type) { |
if ((hw->mac.type != ixgbe_mac_82598EB) && |
case ixgbe_mac_82599EB: |
!ixgbe_sfp_cage_full(hw)) |
cage_full = IXGBE_READ_REG(hw, IXGBE_ESDP) & |
|
IXGBE_ESDP_SDP2; |
|
break; |
|
case ixgbe_mac_X550EM_x: |
|
case ixgbe_mac_X550EM_a: |
|
/* |
|
* XXX See ixgbe_sfp_cage_full(). It seems the bit is |
|
* inverted on X550EM_a, so I think this is incorrect. |
|
*/ |
|
cage_full = IXGBE_READ_REG(hw, IXGBE_ESDP) & |
|
IXGBE_ESDP_SDP0; |
|
break; |
|
default: |
|
break; |
|
} |
|
|
|
if (!cage_full) |
|
goto out; |
goto out; |
} |
} |
|
|