FreeBSD Bugzilla – Attachment 178797 Details for
Bug 208343
[em] wake on lan not working with Intel I219 V2
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
IFLIB update for WOL issues on igb(4) devices
igb_wol_1.diff (text/plain), 3.82 KB, created by
Sean Bruno
on 2017-01-12 16:37:59 UTC
(
hide
)
Description:
IFLIB update for WOL issues on igb(4) devices
Filename:
MIME Type:
Creator:
Sean Bruno
Created:
2017-01-12 16:37:59 UTC
Size:
3.82 KB
patch
obsolete
>Index: sys/dev/e1000/if_em.c >=================================================================== >--- sys/dev/e1000/if_em.c (revision 311987) >+++ sys/dev/e1000/if_em.c (working copy) >@@ -269,6 +269,7 @@ > static void em_release_hw_control(struct adapter *); > static void em_get_wakeup(if_ctx_t ctx); > static void em_enable_wakeup(if_ctx_t ctx); >+static void igb_enable_wakeup(if_ctx_t ctx); > static int em_enable_phy_wakeup(struct adapter *); > static void em_disable_aspm(struct adapter *); > >@@ -1089,7 +1090,10 @@ > > em_release_manageability(adapter); > em_release_hw_control(adapter); >- em_enable_wakeup(ctx); >+ if (adapter->hw.mac.type >= igb_mac_min) >+ igb_enable_wakeup(ctx); >+ else >+ em_enable_wakeup(ctx); > return (0); > } > >@@ -1733,7 +1737,9 @@ > INIT_DEBUGOUT("em_stop: begin"); > > e1000_reset_hw(&adapter->hw); >- if (adapter->hw.mac.type >= e1000_82544) >+ if (adapter->hw.mac.type >= igb_mac_min) >+ E1000_WRITE_REG(&adapter->hw, E1000_WUFC, 0); >+ else if (adapter->hw.mac.type >= e1000_82544) > E1000_WRITE_REG(&adapter->hw, E1000_WUC, 0); > > e1000_led_off(&adapter->hw); >@@ -2309,7 +2315,11 @@ > > /* Issue a global reset */ > e1000_reset_hw(hw); >- E1000_WRITE_REG(hw, E1000_WUC, 0); >+ if (adapter->hw.mac.type >= igb_mac_min) >+ E1000_WRITE_REG(&adapter->hw, E1000_WUFC, 0); >+ else >+ E1000_WRITE_REG(hw, E1000_WUC, 0); >+ > em_disable_aspm(adapter); > /* and a re-init */ > if (e1000_init_hw(hw) < 0) { >@@ -3314,6 +3324,17 @@ > adapter->has_amt = TRUE; > eeprom_data = E1000_READ_REG(&adapter->hw, E1000_WUC); > break; >+ /* igb devices */ >+ case e1000_82575: >+ case e1000_82576: >+ case e1000_82580: >+ case e1000_i350: >+ case e1000_i354: >+ case e1000_i210: >+ case e1000_i211: >+ apme_mask = E1000_WUC_APME; >+ eeprom_data = E1000_READ_REG(&adapter->hw, E1000_WUC); >+ break; > default: > e1000_read_nvm(&adapter->hw, > NVM_INIT_CONTROL3_PORT_A, 1, &eeprom_data); >@@ -3421,7 +3442,7 @@ > E1000_WRITE_REG(&adapter->hw, E1000_RCTL, rctl); > } > >- if ((adapter->hw.mac.type == e1000_pchlan) || >+ 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)) { >@@ -3446,6 +3467,58 @@ > } > > /* >+ * Enable PCI Wake On Lan capability >+ */ >+static void >+igb_enable_wakeup(if_ctx_t ctx) >+{ >+ struct adapter *adapter = iflib_get_softc(ctx); >+ device_t dev = iflib_get_dev(ctx); >+ struct ifnet *ifp = adapter->ifp; >+ u32 wuc; >+ u16 cap, status; >+ u8 id; >+ >+ adapter->wol = E1000_READ_REG(&adapter->hw, E1000_WUFC); >+ if (ifp->if_capenable & IFCAP_WOL_MAGIC) { >+ adapter->wol |= E1000_WUFC_MAG; >+ } else { >+ adapter->wol &= ~E1000_WUFC_MAG; >+ } >+ if (ifp->if_capenable & IFCAP_WOL_MCAST) { >+ adapter->wol |= E1000_WUFC_MC; >+ } else { >+ adapter->wol &= ~E1000_WUFC_MC; >+ } >+ if (ifp->if_capenable & IFCAP_WOL_UCAST) { >+ adapter->wol |= E1000_WUFC_EX; >+ } else { >+ adapter->wol &= ~E1000_WUFC_EX; >+ } >+ if(adapter->wol & ( E1000_WUFC_EX | E1000_WUFC_MC | E1000_WUFC_MAG) ) { >+ wuc = E1000_READ_REG(&adapter->hw, E1000_WUC); >+ wuc |= (E1000_WUC_PME_EN | E1000_WUC_APME) ; >+ E1000_WRITE_REG(&adapter->hw, E1000_WUC, wuc); >+ E1000_WRITE_REG(&adapter->hw, E1000_WUFC, adapter->wol); >+ /* First find the capabilities pointer*/ >+ cap = pci_read_config(dev, PCIR_CAP_PTR, 2); >+ /* Read the PM Capabilities */ >+ id = pci_read_config(dev, cap, 1); >+ if (id != PCIY_PMG) /* Something wrong */ >+ return; >+ /* >+ * We have the power capabilities, >+ * get the status register >+ */ >+ cap += PCIR_POWER_STATUS; >+ status = pci_read_config(dev, cap, 2); >+ status |= PCIM_PSTAT_PME | PCIM_PSTAT_PMEENABLE; >+ pci_write_config(dev, cap, status, 2); >+ } >+ return; >+} >+ >+/* > ** WOL in the newer chipset interfaces (pchlan) > ** require thing to be copied into the phy > */
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 208343
:
168707
|
177062
|
177103
| 178797 |
178851
|
181517
|
185903