diff options
author | Sasha Neftin <sasha.neftin@intel.com> | 2018-10-11 03:17:31 -0400 |
---|---|---|
committer | Jeff Kirsher <jeffrey.t.kirsher@intel.com> | 2018-10-17 16:55:18 -0400 |
commit | 5586838fe9ced0980e210b39d635ff3842297448 (patch) | |
tree | 1646f8cca19ced662aac1f065426d27344ec5fa9 /drivers/net/ethernet/intel/igc/igc_mac.c | |
parent | ab4056126813c889ee6c8fb24ca8f75b84c981ab (diff) |
igc: Add code for PHY support
Add PHY's ID support
Add support for initialization, acquire and release of PHY
Enable register access
Signed-off-by: Sasha Neftin <sasha.neftin@intel.com>
Signed-off-by: Alexander Duyck <alexander.h.duyck@intel.com>
Tested-by: Aaron Brown <aaron.f.brown@intel.com>
Signed-off-by: Jeff Kirsher <jeffrey.t.kirsher@intel.com>
Diffstat (limited to 'drivers/net/ethernet/intel/igc/igc_mac.c')
-rw-r--r-- | drivers/net/ethernet/intel/igc/igc_mac.c | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/drivers/net/ethernet/intel/igc/igc_mac.c b/drivers/net/ethernet/intel/igc/igc_mac.c index 249ac03b05d8..fce7f7f5aa46 100644 --- a/drivers/net/ethernet/intel/igc/igc_mac.c +++ b/drivers/net/ethernet/intel/igc/igc_mac.c | |||
@@ -338,6 +338,7 @@ s32 igc_check_for_copper_link(struct igc_hw *hw) | |||
338 | * link. If so, then we want to get the current speed/duplex | 338 | * link. If so, then we want to get the current speed/duplex |
339 | * of the PHY. | 339 | * of the PHY. |
340 | */ | 340 | */ |
341 | ret_val = igc_phy_has_link(hw, 1, 0, &link); | ||
341 | if (ret_val) | 342 | if (ret_val) |
342 | goto out; | 343 | goto out; |
343 | 344 | ||
@@ -349,6 +350,7 @@ s32 igc_check_for_copper_link(struct igc_hw *hw) | |||
349 | /* Check if there was DownShift, must be checked | 350 | /* Check if there was DownShift, must be checked |
350 | * immediately after link-up | 351 | * immediately after link-up |
351 | */ | 352 | */ |
353 | igc_check_downshift(hw); | ||
352 | 354 | ||
353 | /* If we are forcing speed/duplex, then we simply return since | 355 | /* If we are forcing speed/duplex, then we simply return since |
354 | * we have already determined whether we have link or not. | 356 | * we have already determined whether we have link or not. |
@@ -488,3 +490,46 @@ void igc_put_hw_semaphore(struct igc_hw *hw) | |||
488 | 490 | ||
489 | wr32(IGC_SWSM, swsm); | 491 | wr32(IGC_SWSM, swsm); |
490 | } | 492 | } |
493 | |||
494 | /** | ||
495 | * igc_enable_mng_pass_thru - Enable processing of ARP's | ||
496 | * @hw: pointer to the HW structure | ||
497 | * | ||
498 | * Verifies the hardware needs to leave interface enabled so that frames can | ||
499 | * be directed to and from the management interface. | ||
500 | */ | ||
501 | bool igc_enable_mng_pass_thru(struct igc_hw *hw) | ||
502 | { | ||
503 | bool ret_val = false; | ||
504 | u32 fwsm, factps; | ||
505 | u32 manc; | ||
506 | |||
507 | if (!hw->mac.asf_firmware_present) | ||
508 | goto out; | ||
509 | |||
510 | manc = rd32(IGC_MANC); | ||
511 | |||
512 | if (!(manc & IGC_MANC_RCV_TCO_EN)) | ||
513 | goto out; | ||
514 | |||
515 | if (hw->mac.arc_subsystem_valid) { | ||
516 | fwsm = rd32(IGC_FWSM); | ||
517 | factps = rd32(IGC_FACTPS); | ||
518 | |||
519 | if (!(factps & IGC_FACTPS_MNGCG) && | ||
520 | ((fwsm & IGC_FWSM_MODE_MASK) == | ||
521 | (igc_mng_mode_pt << IGC_FWSM_MODE_SHIFT))) { | ||
522 | ret_val = true; | ||
523 | goto out; | ||
524 | } | ||
525 | } else { | ||
526 | if ((manc & IGC_MANC_SMBUS_EN) && | ||
527 | !(manc & IGC_MANC_ASF_EN)) { | ||
528 | ret_val = true; | ||
529 | goto out; | ||
530 | } | ||
531 | } | ||
532 | |||
533 | out: | ||
534 | return ret_val; | ||
535 | } | ||