Capture PCI configuration state on suspend and restore it on resume, from

Kentaro A. Kurahone.
This commit is contained in:
jmcneill 2005-01-27 02:44:59 +00:00
parent 73f985e393
commit 27d1abf7f8
2 changed files with 8 additions and 3 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: pccbb.c,v 1.112 2005/01/16 08:56:29 mycroft Exp $ */
/* $NetBSD: pccbb.c,v 1.113 2005/01/27 02:44:59 jmcneill Exp $ */
/*
* Copyright (c) 1998, 1999 and 2000
@ -31,7 +31,7 @@
*/
#include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: pccbb.c,v 1.112 2005/01/16 08:56:29 mycroft Exp $");
__KERNEL_RCSID(0, "$NetBSD: pccbb.c,v 1.113 2005/01/27 02:44:59 jmcneill Exp $");
/*
#define CBB_DEBUG
@ -3400,6 +3400,8 @@ pccbb_powerhook(why, arg)
}
sc->sc_pil_intr_enable = 0;
pci_conf_capture(sc->sc_pc, sc->sc_tag, &sc->sc_pciconf);
/* ToDo: deactivate or suspend child devices */
}
@ -3431,6 +3433,8 @@ pccbb_powerhook(why, arg)
}
}
pci_conf_restore(sc->sc_pc, sc->sc_tag, &sc->sc_pciconf);
if (pci_conf_read (sc->sc_pc, sc->sc_tag, PCI_SOCKBASE) == 0)
/* BIOS did not recover this register */
pci_conf_write (sc->sc_pc, sc->sc_tag,

View File

@ -1,4 +1,4 @@
/* $NetBSD: pccbbvar.h,v 1.22 2005/01/16 08:51:55 mycroft Exp $ */
/* $NetBSD: pccbbvar.h,v 1.23 2005/01/27 02:44:59 jmcneill Exp $ */
/*
* Copyright (c) 1999 HAYAKAWA Koichi. All rights reserved.
*
@ -164,6 +164,7 @@ struct pccbb_softc {
int sc_pil_intr_enable; /* can i call intr handler for child device? */
int sc_pwrmgt_offs; /* Offset for power management capability */
struct pci_conf_state sc_pciconf;
};
/*