diff options
| author | dyoung <dyoung@NetBSD.org> | 2008-03-12 18:02:21 +0000 |
|---|---|---|
| committer | dyoung <dyoung@NetBSD.org> | 2008-03-12 18:02:21 +0000 |
| commit | 3df2b2feb5ec81dbf34ffb230078ff45e416489a (patch) | |
| tree | 95e014f7e88d3c18f858be14e80133e9435df658 /sys/dev/apm | |
| parent | 15bb494e456ec9a47b21cc5a3e96f57807f590f0 (diff) | |
Use device_t and its accessors throughout. Use aprint_*_dev().
Improve PMF-ability.
Add a 'flags' argument to suspend/resume handlers and
callers such as pmf_system_suspend().
Define a flag, PMF_F_SELF, which indicates to PMF that a
device is suspending/resuming itself. Add helper routines,
pmf_device_suspend_self(dev) and pmf_device_resume_self(dev),
that call pmf_device_suspend(dev, PMF_F_SELF) and
pmf_device_resume(dev, PMF_F_SELF), respectively. Use
PMF_F_SELF to suspend/resume self in ath(4), audio(4),
rtw(4), and sip(4).
In ath(4) and in rtw(4), replace the icky sc_enable/sc_disable
callbacks, provided by the bus front-end, with
self-suspension/resumption. Also, clean up the bus
front-ends. Make sure that the interrupt handler is
disestablished during suspension. Get rid of driver-private
flags (e.g., RTW_F_ENABLED, ath_softc->sc_invalid); use
device_is_active()/device_has_power() calls, instead.
In the network-class suspend handler, call if_stop(, 0)
instead of if_stop(, 1), because the latter is superfluous
(bus- and driver-suspension hooks will 'disable' the NIC),
and it may cause recursion.
In the network-class resume handler, prevent infinite
recursion through if_init() by getting out early if we are
self-suspending (PMF_F_SELF).
rtw(4) improvements:
Destroy rtw(4) callouts when we detach it. Make rtw at
pci detachable. Print some more information with the "rx
frame too long" warning.
Remove activate() methods:
Get rid of rtw_activate() and ath_activate(). The device
activate() methods are not good for much these days.
Make ath at cardbus resume with crypto functions intact:
Introduce a boolean device property, "pmf-powerdown". If
pmf-powerdown is present and false, it indicates that a
bus back-end should not remove power from a device.
Honor this property in cardbus_child_suspend().
Set this property to 'false' in ath_attach(), since removing
power from an ath at cardbus seems to lobotomize the WPA
crypto engine. XXX Should the pmf-powerdown property
propagate toward the root of the device tree?
Miscellaneous ath(4) changes:
Warn if ath(4) tries to write crypto keys to suspended
hardware.
Reduce differences between FreeBSD and NetBSD in ath(4)
multicast filter setup.
Make ath_printrxbuf() print an rx descriptor's status &
key index, to help debug crypto errors.
Shorten a staircase in ath_ioctl(). Don't check for
ieee80211_ioctl() return code ERESTART, it never happens.
Diffstat (limited to 'sys/dev/apm')
| -rw-r--r-- | sys/dev/apm/apm.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/sys/dev/apm/apm.c b/sys/dev/apm/apm.c index be6ee1de858..f3981ba2fa3 100644 --- a/sys/dev/apm/apm.c +++ b/sys/dev/apm/apm.c @@ -1,4 +1,4 @@ -/* $NetBSD: apm.c,v 1.19 2008/03/07 21:45:08 cube Exp $ */ +/* $NetBSD: apm.c,v 1.20 2008/03/12 18:02:21 dyoung Exp $ */ /*- * Copyright (c) 1996, 1997 The NetBSD Foundation, Inc. @@ -40,7 +40,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: apm.c,v 1.19 2008/03/07 21:45:08 cube Exp $"); +__KERNEL_RCSID(0, "$NetBSD: apm.c,v 1.20 2008/03/12 18:02:21 dyoung Exp $"); #include "opt_apm.h" @@ -316,7 +316,7 @@ apm_suspend(struct apm_softc *sc) sc->sc_power_state = PWR_SUSPEND; if (!(sc->sc_hwflags & APM_F_DONT_RUN_HOOKS)) { - pmf_system_suspend(); + pmf_system_suspend(PMF_F_NONE); apm_spl = splhigh(); } @@ -342,7 +342,7 @@ apm_standby(struct apm_softc *sc) sc->sc_power_state = PWR_STANDBY; if (!(sc->sc_hwflags & APM_F_DONT_RUN_HOOKS)) { - pmf_system_suspend(); + pmf_system_suspend(PMF_F_NONE); apm_spl = splhigh(); } error = (*sc->sc_ops->aa_set_powstate)(sc->sc_cookie, APM_DEV_ALLDEVS, @@ -373,7 +373,7 @@ apm_resume(struct apm_softc *sc, u_int event_type, u_int event_info) inittodr(time_second); if (!(sc->sc_hwflags & APM_F_DONT_RUN_HOOKS)) { splx(apm_spl); - pmf_system_resume(); + pmf_system_resume(PMF_F_NONE); } apm_record_event(sc, event_type); |
