A small diff to make ale working correctly after suspend on my EEEPC
901.

This is the first time I touch kernel code.

Please test, comment, correct, commit.

Index: if_ale.c
===================================================================
RCS file: /cvs/src/sys/dev/pci/if_ale.c,v
retrieving revision 1.13
diff -u -r1.13 if_ale.c
--- if_ale.c    19 May 2010 14:39:07 -0000      1.13
+++ if_ale.c    27 Jul 2010 00:01:32 -0000
@@ -81,6 +81,7 @@
 int    ale_match(struct device *, void *, void *);
 void   ale_attach(struct device *, struct device *, void *);
 int    ale_detach(struct device *, int);
+int    ale_activate(struct device *, int);
 
 int    ale_miibus_readreg(struct device *, int, int);
 void   ale_miibus_writereg(struct device *, int, int, int);
@@ -123,7 +124,11 @@
 };
 
 struct cfattach ale_ca = {
-       sizeof (struct ale_softc), ale_match, ale_attach
+       sizeof (struct ale_softc),
+       ale_match,
+       ale_attach,
+       NULL, /* or ale_detach? */
+       ale_activate
 };
 
 struct cfdriver ale_cd = {
@@ -592,6 +597,25 @@
        if (sc->sc_irq_handle != NULL) {
                pci_intr_disestablish(sc->sc_pct, sc->sc_irq_handle);
                sc->sc_irq_handle = NULL;
+       }
+
+       return (0);
+}
+
+
+int
+ale_activate(struct device *self, int act)
+{
+       struct ale_softc *sc = (struct ale_softc *)self;
+       struct ifnet *ifp = &sc->sc_arpcom.ac_if;
+
+       switch(act) {
+       case DVACT_SUSPEND:
+               break;
+       case DVACT_RESUME:
+               if (ifp->if_flags & IFF_RUNNING)
+                       ale_init(ifp);
+               break;
        }
 
        return (0);

Reply via email to