diff options
Diffstat (limited to 'drivers/net/ixgbe/ixgbe_82599.c')
-rw-r--r-- | drivers/net/ixgbe/ixgbe_82599.c | 62 |
1 files changed, 48 insertions, 14 deletions
diff --git a/drivers/net/ixgbe/ixgbe_82599.c b/drivers/net/ixgbe/ixgbe_82599.c index b405a00817c6..12fc0e7ba2ca 100644 --- a/drivers/net/ixgbe/ixgbe_82599.c +++ b/drivers/net/ixgbe/ixgbe_82599.c | |||
@@ -39,6 +39,8 @@ | |||
39 | #define IXGBE_82599_MC_TBL_SIZE 128 | 39 | #define IXGBE_82599_MC_TBL_SIZE 128 |
40 | #define IXGBE_82599_VFT_TBL_SIZE 128 | 40 | #define IXGBE_82599_VFT_TBL_SIZE 128 |
41 | 41 | ||
42 | void ixgbe_disable_tx_laser_multispeed_fiber(struct ixgbe_hw *hw); | ||
43 | void ixgbe_enable_tx_laser_multispeed_fiber(struct ixgbe_hw *hw); | ||
42 | void ixgbe_flap_tx_laser_multispeed_fiber(struct ixgbe_hw *hw); | 44 | void ixgbe_flap_tx_laser_multispeed_fiber(struct ixgbe_hw *hw); |
43 | s32 ixgbe_setup_mac_link_multispeed_fiber(struct ixgbe_hw *hw, | 45 | s32 ixgbe_setup_mac_link_multispeed_fiber(struct ixgbe_hw *hw, |
44 | ixgbe_link_speed speed, | 46 | ixgbe_link_speed speed, |
@@ -69,8 +71,14 @@ static void ixgbe_init_mac_link_ops_82599(struct ixgbe_hw *hw) | |||
69 | if (hw->phy.multispeed_fiber) { | 71 | if (hw->phy.multispeed_fiber) { |
70 | /* Set up dual speed SFP+ support */ | 72 | /* Set up dual speed SFP+ support */ |
71 | mac->ops.setup_link = &ixgbe_setup_mac_link_multispeed_fiber; | 73 | mac->ops.setup_link = &ixgbe_setup_mac_link_multispeed_fiber; |
74 | mac->ops.disable_tx_laser = | ||
75 | &ixgbe_disable_tx_laser_multispeed_fiber; | ||
76 | mac->ops.enable_tx_laser = | ||
77 | &ixgbe_enable_tx_laser_multispeed_fiber; | ||
72 | mac->ops.flap_tx_laser = &ixgbe_flap_tx_laser_multispeed_fiber; | 78 | mac->ops.flap_tx_laser = &ixgbe_flap_tx_laser_multispeed_fiber; |
73 | } else { | 79 | } else { |
80 | mac->ops.disable_tx_laser = NULL; | ||
81 | mac->ops.enable_tx_laser = NULL; | ||
74 | mac->ops.flap_tx_laser = NULL; | 82 | mac->ops.flap_tx_laser = NULL; |
75 | if ((mac->ops.get_media_type(hw) == | 83 | if ((mac->ops.get_media_type(hw) == |
76 | ixgbe_media_type_backplane) && | 84 | ixgbe_media_type_backplane) && |
@@ -415,6 +423,44 @@ s32 ixgbe_start_mac_link_82599(struct ixgbe_hw *hw, | |||
415 | return status; | 423 | return status; |
416 | } | 424 | } |
417 | 425 | ||
426 | /** | ||
427 | * ixgbe_disable_tx_laser_multispeed_fiber - Disable Tx laser | ||
428 | * @hw: pointer to hardware structure | ||
429 | * | ||
430 | * The base drivers may require better control over SFP+ module | ||
431 | * PHY states. This includes selectively shutting down the Tx | ||
432 | * laser on the PHY, effectively halting physical link. | ||
433 | **/ | ||
434 | void ixgbe_disable_tx_laser_multispeed_fiber(struct ixgbe_hw *hw) | ||
435 | { | ||
436 | u32 esdp_reg = IXGBE_READ_REG(hw, IXGBE_ESDP); | ||
437 | |||
438 | /* Disable tx laser; allow 100us to go dark per spec */ | ||
439 | esdp_reg |= IXGBE_ESDP_SDP3; | ||
440 | IXGBE_WRITE_REG(hw, IXGBE_ESDP, esdp_reg); | ||
441 | IXGBE_WRITE_FLUSH(hw); | ||
442 | udelay(100); | ||
443 | } | ||
444 | |||
445 | /** | ||
446 | * ixgbe_enable_tx_laser_multispeed_fiber - Enable Tx laser | ||
447 | * @hw: pointer to hardware structure | ||
448 | * | ||
449 | * The base drivers may require better control over SFP+ module | ||
450 | * PHY states. This includes selectively turning on the Tx | ||
451 | * laser on the PHY, effectively starting physical link. | ||
452 | **/ | ||
453 | void ixgbe_enable_tx_laser_multispeed_fiber(struct ixgbe_hw *hw) | ||
454 | { | ||
455 | u32 esdp_reg = IXGBE_READ_REG(hw, IXGBE_ESDP); | ||
456 | |||
457 | /* Enable tx laser; allow 100ms to light up */ | ||
458 | esdp_reg &= ~IXGBE_ESDP_SDP3; | ||
459 | IXGBE_WRITE_REG(hw, IXGBE_ESDP, esdp_reg); | ||
460 | IXGBE_WRITE_FLUSH(hw); | ||
461 | msleep(100); | ||
462 | } | ||
463 | |||
418 | /** | 464 | /** |
419 | * ixgbe_flap_tx_laser_multispeed_fiber - Flap Tx laser | 465 | * ixgbe_flap_tx_laser_multispeed_fiber - Flap Tx laser |
420 | * @hw: pointer to hardware structure | 466 | * @hw: pointer to hardware structure |
@@ -429,23 +475,11 @@ s32 ixgbe_start_mac_link_82599(struct ixgbe_hw *hw, | |||
429 | **/ | 475 | **/ |
430 | void ixgbe_flap_tx_laser_multispeed_fiber(struct ixgbe_hw *hw) | 476 | void ixgbe_flap_tx_laser_multispeed_fiber(struct ixgbe_hw *hw) |
431 | { | 477 | { |
432 | u32 esdp_reg = IXGBE_READ_REG(hw, IXGBE_ESDP); | ||
433 | |||
434 | hw_dbg(hw, "ixgbe_flap_tx_laser_multispeed_fiber\n"); | 478 | hw_dbg(hw, "ixgbe_flap_tx_laser_multispeed_fiber\n"); |
435 | 479 | ||
436 | if (hw->mac.autotry_restart) { | 480 | if (hw->mac.autotry_restart) { |
437 | /* Disable tx laser; allow 100us to go dark per spec */ | 481 | ixgbe_disable_tx_laser_multispeed_fiber(hw); |
438 | esdp_reg |= IXGBE_ESDP_SDP3; | 482 | ixgbe_enable_tx_laser_multispeed_fiber(hw); |
439 | IXGBE_WRITE_REG(hw, IXGBE_ESDP, esdp_reg); | ||
440 | IXGBE_WRITE_FLUSH(hw); | ||
441 | udelay(100); | ||
442 | |||
443 | /* Enable tx laser; allow 100ms to light up */ | ||
444 | esdp_reg &= ~IXGBE_ESDP_SDP3; | ||
445 | IXGBE_WRITE_REG(hw, IXGBE_ESDP, esdp_reg); | ||
446 | IXGBE_WRITE_FLUSH(hw); | ||
447 | msleep(100); | ||
448 | |||
449 | hw->mac.autotry_restart = false; | 483 | hw->mac.autotry_restart = false; |
450 | } | 484 | } |
451 | } | 485 | } |