Tobias Ulmer <tobiasu <at> tmux.org> writes:

> 
> I've lost track which patches need to be applied or not, but once a
> complete patch appears, I'm willing to test it on a machine that has
> three different xl's.
> 
> 


hi tobias,

sorry for any confusion. i think, the recent patches that should work are the
following:

Index: ic/xl.c
===================================================================
RCS file: /cvs/src/sys/dev/ic/xl.c,v
retrieving revision 1.101
diff -u -p -r1.101 xl.c
--- ic/xl.c 17 Apr 2011 20:52:43 -0000 1.101
+++ ic/xl.c 17 Jun 2011 21:38:21 -0000
@@ -2373,9 +2373,13 @@ xl_stop(struct xl_softc *sc)
  xl_freetxrx(sc);
 
 #ifndef SMALL_KERNEL
- /* Call upper layer WOL power routine if WOL is enabled. */
- if ((sc->xl_flags & XL_FLAG_WOL) && sc->wol_power)
+ /* Re-enable RX and call upper layer WOL power routine
+ * if WOL is enabled. */
+ if ((sc->xl_flags & XL_FLAG_WOL) && sc->wol_power) {
+ CSR_WRITE_2(sc, XL_COMMAND, XL_CMD_RX_ENABLE);
+ xl_wait(sc);
  sc->wol_power(sc->wol_power_arg);
+ }
 #endif
 }
 
@@ -2694,6 +2698,10 @@ xl_wol(struct ifnet *ifp, int enable)
  struct xl_softc *sc = ifp->if_softc;
 
  XL_SEL_WIN(7);
+
+ /* Clear any pending PME events. */
+ CSR_READ_2(sc, XL_W7_BM_PME);
+
  if (enable) {
  CSR_WRITE_2(sc, XL_W7_BM_PME, XL_BM_PME_MAGIC);
  sc->xl_flags |= XL_FLAG_WOL;

Index: pci/if_xl_pci.c
===================================================================
RCS file: /cvs/src/sys/dev/pci/if_xl_pci.c,v
retrieving revision 1.36
diff -u -p -r1.36 if_xl_pci.c
--- pci/if_xl_pci.c 17 Apr 2011 20:52:43 -0000 1.36
+++ pci/if_xl_pci.c 17 Jun 2011 21:33:35 -0000
@@ -266,18 +266,6 @@ xl_pci_attach(struct device *parent, str
  pci_conf_write(pc, pa->pa_tag, XL_PCI_LOMEM, mem);
  pci_conf_write(pc, pa->pa_tag, XL_PCI_INTLINE, irq);
  }
-
-#ifndef SMALL_KERNEL
- /* The card is WOL-capable if it supports PME# assertion
- * from D3hot power state. Install a callback to configure
- * PCI power state for WOL. It will be invoked when the
- * interface stops and WOL was enabled. */
- command = pci_conf_read(pc, pa->pa_tag, XL_PCI_PWRMGMTCAP);
- if (command & XL_PME_CAP_D3_HOT) {
- sc->wol_power = xl_pci_wol_power;
- sc->wol_power_arg = psc;
- }
-#endif
  }
 
  /*
@@ -335,6 +323,16 @@ xl_pci_attach(struct device *parent, str
  printf(": %s", intrstr);
 
  xl_attach(sc);
+
+#ifndef SMALL_KERNEL
+ /* If the card is WOL-capable install a callback to configure
+ * PCI power state for WOL. It will be invoked when the
+ * interface stops and WOL was enabled. */
+ if (sc->xl_caps & XL_CAPS_PWRMGMT) {
+ sc->wol_power = xl_pci_wol_power;
+ sc->wol_power_arg = psc;
+ }
+#endif
 }
 
 int 

Reply via email to