Update WOL support for newer em(4) devices.

Do not overwrite the contents of the WUC register, add E1000_WUC_PME_EN
to the register contents, leaving the default contents intact.

PR:		208343
Submitted by:	Kaho Toshikazu <kaho@elam.kais.kyoto-u.ac.jp>
Reviewed by:	jeffrey piper <jeffrey.e.pieper@intel.com>
Approved by:	erj@
MFC after:	2 weeks
This commit is contained in:
Sean Bruno 2016-11-14 17:19:03 +00:00
parent ae44bb0146
commit 751e35548b

View File

@ -5274,6 +5274,8 @@ em_get_wakeup(device_t dev)
case e1000_ich10lan:
case e1000_pchlan:
case e1000_pch2lan:
case e1000_pch_lpt:
case e1000_pch_spt:
apme_mask = E1000_WUC_APME;
adapter->has_amt = TRUE;
eeprom_data = E1000_READ_REG(&adapter->hw, E1000_WUC);
@ -5322,7 +5324,7 @@ em_enable_wakeup(device_t dev)
{
struct adapter *adapter = device_get_softc(dev);
if_t ifp = adapter->ifp;
u32 pmc, ctrl, ctrl_ext, rctl;
u32 pmc, ctrl, ctrl_ext, rctl, wuc;
u16 status;
if ((pci_find_cap(dev, PCIY_PMG, &pmc) != 0))
@ -5332,7 +5334,9 @@ em_enable_wakeup(device_t dev)
ctrl = E1000_READ_REG(&adapter->hw, E1000_CTRL);
ctrl |= (E1000_CTRL_SWDPIN2 | E1000_CTRL_SWDPIN3);
E1000_WRITE_REG(&adapter->hw, E1000_CTRL, ctrl);
E1000_WRITE_REG(&adapter->hw, E1000_WUC, E1000_WUC_PME_EN);
wuc = E1000_READ_REG(&adapter->hw, E1000_WUC);
wuc |= E1000_WUC_PME_EN;
E1000_WRITE_REG(&adapter->hw, E1000_WUC, wuc);
if ((adapter->hw.mac.type == e1000_ich8lan) ||
(adapter->hw.mac.type == e1000_pchlan) ||
@ -5363,8 +5367,10 @@ em_enable_wakeup(device_t dev)
E1000_WRITE_REG(&adapter->hw, E1000_RCTL, rctl);
}
if ((adapter->hw.mac.type == e1000_pchlan) ||
(adapter->hw.mac.type == e1000_pch2lan)) {
if ((adapter->hw.mac.type == e1000_pchlan) ||
(adapter->hw.mac.type == e1000_pch2lan) ||
(adapter->hw.mac.type == e1000_pch_lpt) ||
(adapter->hw.mac.type == e1000_pch_spt)) {
if (em_enable_phy_wakeup(adapter))
return;
} else {