diff options
Diffstat (limited to 'drivers/net/ixgbe/ixgbe_82599.c')
-rw-r--r-- | drivers/net/ixgbe/ixgbe_82599.c | 78 |
1 files changed, 42 insertions, 36 deletions
diff --git a/drivers/net/ixgbe/ixgbe_82599.c b/drivers/net/ixgbe/ixgbe_82599.c index 1f30e163bd9c..b405a00817c6 100644 --- a/drivers/net/ixgbe/ixgbe_82599.c +++ b/drivers/net/ixgbe/ixgbe_82599.c | |||
@@ -39,6 +39,7 @@ | |||
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_flap_tx_laser_multispeed_fiber(struct ixgbe_hw *hw); | ||
42 | s32 ixgbe_setup_mac_link_multispeed_fiber(struct ixgbe_hw *hw, | 43 | s32 ixgbe_setup_mac_link_multispeed_fiber(struct ixgbe_hw *hw, |
43 | ixgbe_link_speed speed, | 44 | ixgbe_link_speed speed, |
44 | bool autoneg, | 45 | bool autoneg, |
@@ -68,7 +69,9 @@ static void ixgbe_init_mac_link_ops_82599(struct ixgbe_hw *hw) | |||
68 | if (hw->phy.multispeed_fiber) { | 69 | if (hw->phy.multispeed_fiber) { |
69 | /* Set up dual speed SFP+ support */ | 70 | /* Set up dual speed SFP+ support */ |
70 | mac->ops.setup_link = &ixgbe_setup_mac_link_multispeed_fiber; | 71 | mac->ops.setup_link = &ixgbe_setup_mac_link_multispeed_fiber; |
72 | mac->ops.flap_tx_laser = &ixgbe_flap_tx_laser_multispeed_fiber; | ||
71 | } else { | 73 | } else { |
74 | mac->ops.flap_tx_laser = NULL; | ||
72 | if ((mac->ops.get_media_type(hw) == | 75 | if ((mac->ops.get_media_type(hw) == |
73 | ixgbe_media_type_backplane) && | 76 | ixgbe_media_type_backplane) && |
74 | (hw->phy.smart_speed == ixgbe_smart_speed_auto || | 77 | (hw->phy.smart_speed == ixgbe_smart_speed_auto || |
@@ -413,6 +416,41 @@ s32 ixgbe_start_mac_link_82599(struct ixgbe_hw *hw, | |||
413 | } | 416 | } |
414 | 417 | ||
415 | /** | 418 | /** |
419 | * ixgbe_flap_tx_laser_multispeed_fiber - Flap Tx laser | ||
420 | * @hw: pointer to hardware structure | ||
421 | * | ||
422 | * When the driver changes the link speeds that it can support, | ||
423 | * it sets autotry_restart to true to indicate that we need to | ||
424 | * initiate a new autotry session with the link partner. To do | ||
425 | * so, we set the speed then disable and re-enable the tx laser, to | ||
426 | * alert the link partner that it also needs to restart autotry on its | ||
427 | * end. This is consistent with true clause 37 autoneg, which also | ||
428 | * involves a loss of signal. | ||
429 | **/ | ||
430 | void ixgbe_flap_tx_laser_multispeed_fiber(struct ixgbe_hw *hw) | ||
431 | { | ||
432 | u32 esdp_reg = IXGBE_READ_REG(hw, IXGBE_ESDP); | ||
433 | |||
434 | hw_dbg(hw, "ixgbe_flap_tx_laser_multispeed_fiber\n"); | ||
435 | |||
436 | if (hw->mac.autotry_restart) { | ||
437 | /* Disable tx laser; allow 100us to go dark per spec */ | ||
438 | esdp_reg |= IXGBE_ESDP_SDP3; | ||
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; | ||
450 | } | ||
451 | } | ||
452 | |||
453 | /** | ||
416 | * ixgbe_setup_mac_link_multispeed_fiber - Set MAC link speed | 454 | * ixgbe_setup_mac_link_multispeed_fiber - Set MAC link speed |
417 | * @hw: pointer to hardware structure | 455 | * @hw: pointer to hardware structure |
418 | * @speed: new link speed | 456 | * @speed: new link speed |
@@ -440,16 +478,6 @@ s32 ixgbe_setup_mac_link_multispeed_fiber(struct ixgbe_hw *hw, | |||
440 | speed &= phy_link_speed; | 478 | speed &= phy_link_speed; |
441 | 479 | ||
442 | /* | 480 | /* |
443 | * When the driver changes the link speeds that it can support, | ||
444 | * it sets autotry_restart to true to indicate that we need to | ||
445 | * initiate a new autotry session with the link partner. To do | ||
446 | * so, we set the speed then disable and re-enable the tx laser, to | ||
447 | * alert the link partner that it also needs to restart autotry on its | ||
448 | * end. This is consistent with true clause 37 autoneg, which also | ||
449 | * involves a loss of signal. | ||
450 | */ | ||
451 | |||
452 | /* | ||
453 | * Try each speed one by one, highest priority first. We do this in | 481 | * Try each speed one by one, highest priority first. We do this in |
454 | * software because 10gb fiber doesn't support speed autonegotiation. | 482 | * software because 10gb fiber doesn't support speed autonegotiation. |
455 | */ | 483 | */ |
@@ -466,6 +494,7 @@ s32 ixgbe_setup_mac_link_multispeed_fiber(struct ixgbe_hw *hw, | |||
466 | /* Set the module link speed */ | 494 | /* Set the module link speed */ |
467 | esdp_reg |= (IXGBE_ESDP_SDP5_DIR | IXGBE_ESDP_SDP5); | 495 | esdp_reg |= (IXGBE_ESDP_SDP5_DIR | IXGBE_ESDP_SDP5); |
468 | IXGBE_WRITE_REG(hw, IXGBE_ESDP, esdp_reg); | 496 | IXGBE_WRITE_REG(hw, IXGBE_ESDP, esdp_reg); |
497 | IXGBE_WRITE_FLUSH(hw); | ||
469 | 498 | ||
470 | /* Allow module to change analog characteristics (1G->10G) */ | 499 | /* Allow module to change analog characteristics (1G->10G) */ |
471 | msleep(40); | 500 | msleep(40); |
@@ -478,19 +507,7 @@ s32 ixgbe_setup_mac_link_multispeed_fiber(struct ixgbe_hw *hw, | |||
478 | return status; | 507 | return status; |
479 | 508 | ||
480 | /* Flap the tx laser if it has not already been done */ | 509 | /* Flap the tx laser if it has not already been done */ |
481 | if (hw->mac.autotry_restart) { | 510 | hw->mac.ops.flap_tx_laser(hw); |
482 | /* Disable tx laser; allow 100us to go dark per spec */ | ||
483 | esdp_reg |= IXGBE_ESDP_SDP3; | ||
484 | IXGBE_WRITE_REG(hw, IXGBE_ESDP, esdp_reg); | ||
485 | udelay(100); | ||
486 | |||
487 | /* Enable tx laser; allow 2ms to light up per spec */ | ||
488 | esdp_reg &= ~IXGBE_ESDP_SDP3; | ||
489 | IXGBE_WRITE_REG(hw, IXGBE_ESDP, esdp_reg); | ||
490 | msleep(2); | ||
491 | |||
492 | hw->mac.autotry_restart = false; | ||
493 | } | ||
494 | 511 | ||
495 | /* | 512 | /* |
496 | * Wait for the controller to acquire link. Per IEEE 802.3ap, | 513 | * Wait for the controller to acquire link. Per IEEE 802.3ap, |
@@ -525,6 +542,7 @@ s32 ixgbe_setup_mac_link_multispeed_fiber(struct ixgbe_hw *hw, | |||
525 | esdp_reg &= ~IXGBE_ESDP_SDP5; | 542 | esdp_reg &= ~IXGBE_ESDP_SDP5; |
526 | esdp_reg |= IXGBE_ESDP_SDP5_DIR; | 543 | esdp_reg |= IXGBE_ESDP_SDP5_DIR; |
527 | IXGBE_WRITE_REG(hw, IXGBE_ESDP, esdp_reg); | 544 | IXGBE_WRITE_REG(hw, IXGBE_ESDP, esdp_reg); |
545 | IXGBE_WRITE_FLUSH(hw); | ||
528 | 546 | ||
529 | /* Allow module to change analog characteristics (10G->1G) */ | 547 | /* Allow module to change analog characteristics (10G->1G) */ |
530 | msleep(40); | 548 | msleep(40); |
@@ -537,19 +555,7 @@ s32 ixgbe_setup_mac_link_multispeed_fiber(struct ixgbe_hw *hw, | |||
537 | return status; | 555 | return status; |
538 | 556 | ||
539 | /* Flap the tx laser if it has not already been done */ | 557 | /* Flap the tx laser if it has not already been done */ |
540 | if (hw->mac.autotry_restart) { | 558 | hw->mac.ops.flap_tx_laser(hw); |
541 | /* Disable tx laser; allow 100us to go dark per spec */ | ||
542 | esdp_reg |= IXGBE_ESDP_SDP3; | ||
543 | IXGBE_WRITE_REG(hw, IXGBE_ESDP, esdp_reg); | ||
544 | udelay(100); | ||
545 | |||
546 | /* Enable tx laser; allow 2ms to light up per spec */ | ||
547 | esdp_reg &= ~IXGBE_ESDP_SDP3; | ||
548 | IXGBE_WRITE_REG(hw, IXGBE_ESDP, esdp_reg); | ||
549 | msleep(2); | ||
550 | |||
551 | hw->mac.autotry_restart = false; | ||
552 | } | ||
553 | 559 | ||
554 | /* Wait for the link partner to also set speed */ | 560 | /* Wait for the link partner to also set speed */ |
555 | msleep(100); | 561 | msleep(100); |