NetBSD-Bugs archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: kern/38675 (mskc(4)/msk(4) dosen't support ACPI suspend)
The following reply was made to PR kern/38675; it has been noted by GNATS.
From: Joerg Sonnenberger <joerg%britannica.bec.de@localhost>
To: gnats-bugs%NetBSD.org@localhost
Cc: taca%back-street.net@localhost
Subject: Re: kern/38675 (mskc(4)/msk(4) dosen't support ACPI suspend)
Date: Sun, 25 May 2008 20:30:06 +0200
--NzB8fVQJ5HfG6fxh
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Please try the attached patch.
Joerg
--NzB8fVQJ5HfG6fxh
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="if_msk.c.diff"
Index: if_msk.c
===================================================================
RCS file: /data/repo/netbsd/src/sys/dev/pci/if_msk.c,v
retrieving revision 1.18
diff -u -p -r1.18 if_msk.c
--- if_msk.c 10 Apr 2008 19:13:37 -0000 1.18
+++ if_msk.c 25 May 2008 18:10:03 -0000
@@ -100,7 +100,7 @@ __KERNEL_RCSID(0, "$NetBSD: if_msk.c,v 1
int mskc_probe(struct device *, struct cfdata *, void *);
void mskc_attach(struct device *, struct device *self, void *aux);
-void mskc_shutdown(void *);
+static bool mskc_resume(device_t PMF_FN_PROTO);
int msk_probe(struct device *, struct cfdata *, void *);
void msk_attach(struct device *, struct device *self, void *aux);
int mskcprint(void *, const char *);
@@ -1096,7 +1096,10 @@ msk_attach(struct device *parent, struct
if_attach(ifp);
ether_ifattach(ifp, sc_if->sk_enaddr);
- shutdownhook_establish(mskc_shutdown, sc);
+ if (!pmf_device_register(self, NULL, NULL))
+ aprint_error_dev(self, "couldn't establish power handler\n");
+ else
+ pmf_class_network_register(self, ifp);
#if NRND > 0
rnd_attach_source(&sc->rnd_source, device_xname(&sc->sk_dev),
@@ -1424,6 +1427,9 @@ mskc_attach(struct device *parent, struc
goto fail_6;
}
+ if (!pmf_device_register(self, NULL, mskc_resume))
+ aprint_error_dev(self, "couldn't establish power handler\n");
+
return;
fail_6:
@@ -1621,17 +1627,19 @@ msk_watchdog(struct ifnet *ifp)
}
}
-void
-mskc_shutdown(void *v)
+static bool
+mskc_resume(device_t dv PMF_FN_ARGS)
{
- struct sk_softc *sc = v;
+ struct sk_softc *sc = device_private(dv);
- DPRINTFN(2, ("msk_shutdown\n"));
+ DPRINTFN(2, ("msk_resume\n"));
/* Turn off the 'driver is loaded' LED. */
CSR_WRITE_2(sc, SK_LED, SK_LED_GREEN_OFF);
msk_reset(sc);
+
+ return true;
}
__inline int
--NzB8fVQJ5HfG6fxh--
Home |
Main Index |
Thread Index |
Old Index