Subject: Re: ex0 driver trouble in -current
To: None <feico@pasta.cs.uit.no>
From: Masanori Kanaoka <kanaoka@ann.hi-ho.ne.jp>
List: current-users
Date: 04/26/2001 23:08:30
Hi,

   Subject: Re: Re: ex0 driver trouble in -current
Message-ID: <20010426152554.B990@pasta.cs.uit.no>

$ Still question remains whether
$ on a desktop machine the network interface should go into power-save
$ mode in the first place (and loose connectivity). Presonally, I'd
$ prefer to see connectivity intact (at least for standby mode). 

I don't know whether network interface loose connectivity 
for standby mode.The latest fxp, tlp, rtk driver also stop 
for standby mode.

Would you please try next patch?
Only SUSPEND mode, network interface stop.

PS.
 I have committed previous patch.
---
 Masanori Kanaoka	kanaoka@ann.hi-ho.ne.jp


Index: elinkxl.c
===================================================================
RCS file: /ftp/cvs/syssrc/sys/dev/ic/elinkxl.c,v
retrieving revision 1.47
diff -u -r1.47 elinkxl.c
--- elinkxl.c   2001/01/30 19:27:39     1.47
+++ elinkxl.c   2001/04/26 13:53:38
@@ -467,7 +467,7 @@
                printf("%s: WARNING: unable to establish shutdown hook\n",
                        sc->sc_dev.dv_xname);
 
-       /* Add a suspend hook to make sure we com back up after a resume. */
+       /* Add a suspend hook to make sure we come back up after a resume. */
        sc->sc_powerhook = powerhook_establish(ex_power, sc);
        if (sc->sc_powerhook == NULL)
                printf("%s: WARNING: unable to establish power hook\n",
@@ -1574,6 +1574,7 @@
        bus_dmamem_free(sc->sc_dmat, &sc->sc_useg, sc->sc_urseg);
 
        shutdownhook_disestablish(sc->sc_sdhook);
+       powerhook_disestablish(sc->sc_powerhook);
 
        return (0);
 }
@@ -1832,14 +1833,24 @@
        int s;
 
        s = splnet();
-       if (why != PWR_RESUME) {
+       switch (why) {
+       case PWR_SUSPEND:
                ex_stop(ifp, 0);
                if (sc->power != NULL)
                        (*sc->power)(sc, why);
-       } else if (ifp->if_flags & IFF_UP) {
-               if (sc->power != NULL)
-                       (*sc->power)(sc, why);
-               ex_init(ifp);
+               break;
+       case PWR_RESUME:
+               if (ifp->if_flags & IFF_UP) {
+                       if (sc->power != NULL)
+                               (*sc->power)(sc, why);
+                       ex_init(ifp);
+               }
+               break;
+       case PWR_STANDBY:
+       case PWR_SOFTSUSPEND:           
+       case PWR_SOFTSTANDBY:           
+       case PWR_SOFTRESUME:
+               break;
        }
        splx(s);
 }