On Sun, Jun 19, 2011 at 08:14:11PM +0000, Thomas Gerlach wrote:
> hey guys,
> 
> i just had a look into the driver again, and i was able to get wol working 
> now.
> :)
> 
> basically, the missing point was to enable RX again. it is disabled in the
> "xl_stop" routine (<xl.c>).
> right now it's just a quick hack, and i will provide you with the patches, so
> you can test it on your box.
> 
> i will attach them asap.
> 
> 
> cheers,
> 
> thomas

Didn't you see this patch I mailed you yesterday for testing? :)

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