diff options
author | Mark Kettenis <kettenis@cvs.openbsd.org> | 2010-07-21 14:01:59 +0000 |
---|---|---|
committer | Mark Kettenis <kettenis@cvs.openbsd.org> | 2010-07-21 14:01:59 +0000 |
commit | 1e391320a89a368a6bd23e358164aedbe4b983ce (patch) | |
tree | 3008136bebb78005732cd42c14bc955c51c923f2 /sys/dev/pci/if_athn_pci.c | |
parent | ddd8e82d50abf476806c11a81a4406afe7cc6f93 (diff) |
Add suspend/unsuspend logic.
ok damien@, deraadt@
Diffstat (limited to 'sys/dev/pci/if_athn_pci.c')
-rw-r--r-- | sys/dev/pci/if_athn_pci.c | 23 |
1 files changed, 21 insertions, 2 deletions
diff --git a/sys/dev/pci/if_athn_pci.c b/sys/dev/pci/if_athn_pci.c index fad7aa668ee..d8aad078748 100644 --- a/sys/dev/pci/if_athn_pci.c +++ b/sys/dev/pci/if_athn_pci.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_athn_pci.c,v 1.6 2010/05/16 15:06:22 damien Exp $ */ +/* $OpenBSD: if_athn_pci.c,v 1.7 2010/07/21 14:01:58 kettenis Exp $ */ /*- * Copyright (c) 2009 Damien Bergamini <damien.bergamini@free.fr> @@ -71,13 +71,15 @@ struct athn_pci_softc { int athn_pci_match(struct device *, void *, void *); void athn_pci_attach(struct device *, struct device *, void *); int athn_pci_detach(struct device *, int); +int athn_pci_activate(struct device *, int); void athn_pci_disable_aspm(struct athn_softc *); struct cfattach athn_pci_ca = { sizeof (struct athn_pci_softc), athn_pci_match, athn_pci_attach, - athn_pci_detach + athn_pci_detach, + athn_pci_activate }; static const struct pci_matchid athn_pci_devices[] = { @@ -194,6 +196,23 @@ athn_pci_detach(struct device *self, int flags) return (0); } +int +athn_pci_activate(struct device *self, int act) +{ + struct athn_softc *sc = (struct athn_softc *)self; + + switch (act) { + case DVACT_SUSPEND: + athn_suspend(sc); + break; + case DVACT_RESUME: + athn_resume(sc); + break; + } + + return (0); +} + void athn_pci_disable_aspm(struct athn_softc *sc) { |