Lines 2448-2458
Link Here
|
2448 |
sfp = ixgbe_is_sfp(hw); |
2448 |
sfp = ixgbe_is_sfp(hw); |
2449 |
|
2449 |
|
2450 |
if (sfp) { |
2450 |
if (sfp) { |
2451 |
if (hw->phy.multispeed_fiber) { |
2451 |
taskqueue_enqueue(adapter->tq, &adapter->mod_task); |
2452 |
hw->mac.ops.setup_sfp(hw); |
|
|
2453 |
taskqueue_enqueue(adapter->tq, &adapter->msf_task); |
2454 |
} else |
2455 |
taskqueue_enqueue(adapter->tq, &adapter->mod_task); |
2456 |
} else { |
2452 |
} else { |
2457 |
if (hw->mac.ops.check_link) |
2453 |
if (hw->mac.ops.check_link) |
2458 |
err = ixgbe_check_link(hw, &autoneg, |
2454 |
err = ixgbe_check_link(hw, &autoneg, |
Lines 4654-4675
Link Here
|
4654 |
{ |
4650 |
{ |
4655 |
struct adapter *adapter = context; |
4651 |
struct adapter *adapter = context; |
4656 |
struct ixgbe_hw *hw = &adapter->hw; |
4652 |
struct ixgbe_hw *hw = &adapter->hw; |
|
|
4653 |
enum ixgbe_phy_type orig_type = hw->phy.type; |
4657 |
device_t dev = adapter->dev; |
4654 |
device_t dev = adapter->dev; |
4658 |
u32 err; |
4655 |
u32 err; |
4659 |
|
4656 |
|
|
|
4657 |
IXGBE_CORE_LOCK(adapter); |
4658 |
|
4659 |
/* Check to see if the PHY type changed */ |
4660 |
if (hw->phy.ops.identify) { |
4661 |
hw->phy.type = ixgbe_phy_unknown; |
4662 |
hw->phy.ops.identify(hw); |
4663 |
} |
4664 |
|
4665 |
if (hw->phy.type != orig_type) { |
4666 |
device_printf(dev, "Detected phy_type %d\n", hw->phy.type); |
4667 |
|
4668 |
if (hw->phy.type == ixgbe_phy_none) { |
4669 |
hw->phy.sfp_type = ixgbe_sfp_type_unknown; |
4670 |
goto out; |
4671 |
} |
4672 |
|
4673 |
/* Try to do the initialization that was skipped before */ |
4674 |
if (hw->phy.ops.init) |
4675 |
hw->phy.ops.init(hw); |
4676 |
if (hw->phy.ops.reset) |
4677 |
hw->phy.ops.reset(hw); |
4678 |
} |
4679 |
|
4660 |
err = hw->phy.ops.identify_sfp(hw); |
4680 |
err = hw->phy.ops.identify_sfp(hw); |
4661 |
if (err == IXGBE_ERR_SFP_NOT_SUPPORTED) { |
4681 |
if (err == IXGBE_ERR_SFP_NOT_SUPPORTED) { |
4662 |
device_printf(dev, |
4682 |
device_printf(dev, |
4663 |
"Unsupported SFP+ module type was detected.\n"); |
4683 |
"Unsupported SFP+ module type was detected.\n"); |
4664 |
return; |
4684 |
goto out; |
4665 |
} |
4685 |
} |
4666 |
err = hw->mac.ops.setup_sfp(hw); |
4686 |
err = hw->mac.ops.setup_sfp(hw); |
4667 |
if (err == IXGBE_ERR_SFP_NOT_SUPPORTED) { |
4687 |
if (err == IXGBE_ERR_SFP_NOT_SUPPORTED) { |
4668 |
device_printf(dev, |
4688 |
device_printf(dev, |
4669 |
"Setup failure - unsupported SFP+ module type.\n"); |
4689 |
"Setup failure - unsupported SFP+ module type.\n"); |
4670 |
return; |
4690 |
goto out; |
4671 |
} |
4691 |
} |
4672 |
taskqueue_enqueue(adapter->tq, &adapter->msf_task); |
4692 |
|
|
|
4693 |
if (hw->phy.multispeed_fiber) |
4694 |
taskqueue_enqueue(adapter->tq, &adapter->msf_task); |
4695 |
|
4696 |
out: |
4697 |
/* Update media type */ |
4698 |
switch (hw->mac.ops.get_media_type(hw)) { |
4699 |
case ixgbe_media_type_fiber: |
4700 |
adapter->optics = IFM_10G_SR; |
4701 |
break; |
4702 |
case ixgbe_media_type_copper: |
4703 |
adapter->optics = IFM_10G_TWINAX; |
4704 |
break; |
4705 |
case ixgbe_media_type_cx4: |
4706 |
adapter->optics = IFM_10G_CX4; |
4707 |
break; |
4708 |
default: |
4709 |
adapter->optics = 0; |
4710 |
break; |
4711 |
} |
4712 |
|
4713 |
IXGBE_CORE_UNLOCK(adapter); |
4673 |
return; |
4714 |
return; |
4674 |
} |
4715 |
} |
4675 |
|
4716 |
|
Lines 4685-4690
Link Here
|
4685 |
u32 autoneg; |
4726 |
u32 autoneg; |
4686 |
bool negotiate; |
4727 |
bool negotiate; |
4687 |
|
4728 |
|
|
|
4729 |
IXGBE_CORE_LOCK(adapter); |
4730 |
|
4688 |
autoneg = hw->phy.autoneg_advertised; |
4731 |
autoneg = hw->phy.autoneg_advertised; |
4689 |
if ((!autoneg) && (hw->mac.ops.get_link_capabilities)) |
4732 |
if ((!autoneg) && (hw->mac.ops.get_link_capabilities)) |
4690 |
hw->mac.ops.get_link_capabilities(hw, &autoneg, &negotiate); |
4733 |
hw->mac.ops.get_link_capabilities(hw, &autoneg, &negotiate); |
Lines 4694-4699
Link Here
|
4694 |
ixgbe_check_link(&adapter->hw, &speed, &adapter->link_up, 0); |
4737 |
ixgbe_check_link(&adapter->hw, &speed, &adapter->link_up, 0); |
4695 |
ixgbe_update_link_status(adapter); |
4738 |
ixgbe_update_link_status(adapter); |
4696 |
#endif |
4739 |
#endif |
|
|
4740 |
|
4741 |
IXGBE_CORE_UNLOCK(adapter); |
4697 |
return; |
4742 |
return; |
4698 |
} |
4743 |
} |