Author: sbruno
Date: Thu Jan 12 14:47:44 2017
New Revision: 311982
URL: https://svnweb.freebsd.org/changeset/base/311982

Log:
  Restore fixup for newer em(4) devices WOL capabilities post iflib integration.
  
  PR:   208343

Modified:
  head/sys/dev/e1000/if_em.c

Modified: head/sys/dev/e1000/if_em.c
==============================================================================
--- head/sys/dev/e1000/if_em.c  Thu Jan 12 14:44:41 2017        (r311981)
+++ head/sys/dev/e1000/if_em.c  Thu Jan 12 14:47:44 2017        (r311982)
@@ -3308,6 +3308,8 @@ em_get_wakeup(if_ctx_t ctx)
        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);
@@ -3376,7 +3378,7 @@ em_enable_wakeup(if_ctx_t ctx)
        struct adapter  *adapter = iflib_get_softc(ctx);
        device_t dev = iflib_get_dev(ctx);
        if_t ifp = iflib_get_ifp(ctx);
-       u32             pmc, ctrl, ctrl_ext, rctl;
+       u32             pmc, ctrl, ctrl_ext, rctl, wuc;
        u16             status;
 
        if ((pci_find_cap(dev, PCIY_PMG, &pmc) != 0))
@@ -3386,7 +3388,9 @@ em_enable_wakeup(if_ctx_t ctx)
        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) ||
@@ -3418,7 +3422,9 @@ em_enable_wakeup(if_ctx_t ctx)
        }
 
        if ((adapter->hw.mac.type == e1000_pchlan) ||
-           (adapter->hw.mac.type == e1000_pch2lan)) {
+           (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 {
_______________________________________________
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to