diff options
author | Sasha Neftin <sasha.neftin@intel.com> | 2018-10-11 10:17:31 +0300 |
---|---|---|
committer | Jeff Kirsher <jeffrey.t.kirsher@intel.com> | 2018-10-17 13:55:18 -0700 |
commit | 5586838fe9ced0980e210b39d635ff3842297448 (patch) | |
tree | 1646f8cca19ced662aac1f065426d27344ec5fa9 /drivers/net/ethernet/intel/igc/igc_mac.c | |
parent | ab4056126813c889ee6c8fb24ca8f75b84c981ab (diff) | |
download | linux-5586838fe9ced0980e210b39d635ff3842297448.tar.bz2 |
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) * link. If so, then we want to get the current speed/duplex * of the PHY. */ + ret_val = igc_phy_has_link(hw, 1, 0, &link); if (ret_val) goto out; @@ -349,6 +350,7 @@ s32 igc_check_for_copper_link(struct igc_hw *hw) /* Check if there was DownShift, must be checked * immediately after link-up */ + igc_check_downshift(hw); /* If we are forcing speed/duplex, then we simply return since * we have already determined whether we have link or not. @@ -488,3 +490,46 @@ void igc_put_hw_semaphore(struct igc_hw *hw) wr32(IGC_SWSM, swsm); } + +/** + * igc_enable_mng_pass_thru - Enable processing of ARP's + * @hw: pointer to the HW structure + * + * Verifies the hardware needs to leave interface enabled so that frames can + * be directed to and from the management interface. + */ +bool igc_enable_mng_pass_thru(struct igc_hw *hw) +{ + bool ret_val = false; + u32 fwsm, factps; + u32 manc; + + if (!hw->mac.asf_firmware_present) + goto out; + + manc = rd32(IGC_MANC); + + if (!(manc & IGC_MANC_RCV_TCO_EN)) + goto out; + + if (hw->mac.arc_subsystem_valid) { + fwsm = rd32(IGC_FWSM); + factps = rd32(IGC_FACTPS); + + if (!(factps & IGC_FACTPS_MNGCG) && + ((fwsm & IGC_FWSM_MODE_MASK) == + (igc_mng_mode_pt << IGC_FWSM_MODE_SHIFT))) { + ret_val = true; + goto out; + } + } else { + if ((manc & IGC_MANC_SMBUS_EN) && + !(manc & IGC_MANC_ASF_EN)) { + ret_val = true; + goto out; + } + } + +out: + return ret_val; +} |