summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorderaadt <deraadt@openbsd.org>2010-07-28 15:50:19 +0000
committerderaadt <deraadt@openbsd.org>2010-07-28 15:50:19 +0000
commit3ccfe97c8349ff761910c97ab2367a44bde45b7c (patch)
treef6dca7de947d439adbb3125a83017af918da63ba
parentChange back to the pre rev 1.11 behaviour of not treating unexpected (diff)
downloadwireguard-openbsd-3ccfe97c8349ff761910c97ab2367a44bde45b7c.tar.xz
wireguard-openbsd-3ccfe97c8349ff761910c97ab2367a44bde45b7c.zip
suspend save/restore for SIS3112; tested by mlarkin
-rw-r--r--sys/dev/pci/pciide.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/sys/dev/pci/pciide.c b/sys/dev/pci/pciide.c
index 9d40cb24777..03935087713 100644
--- a/sys/dev/pci/pciide.c
+++ b/sys/dev/pci/pciide.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: pciide.c,v 1.311 2010/07/23 07:47:13 jsg Exp $ */
+/* $OpenBSD: pciide.c,v 1.312 2010/07/28 15:50:19 deraadt Exp $ */
/* $NetBSD: pciide.c,v 1.127 2001/08/03 01:31:08 tsutsui Exp $ */
/*
@@ -1426,6 +1426,11 @@ pciide_activate(struct device *self, int act)
sc->sc_tag, ICH5_SATA_PI);
sc->sc_save2[2] = pciide_pci_read(sc->sc_pc,
sc->sc_tag, ICH_SATA_PCS);
+ } else if (sc->sc_pp->chip_map == sii3112_chip_map) {
+ sc->sc_save[0] = pci_conf_read(sc->sc_pc,
+ sc->sc_tag, SII3112_SCS_CMD);
+ sc->sc_save[1] = pci_conf_read(sc->sc_pc,
+ sc->sc_tag, SII3112_PCI_CFGCTL);
}
break;
case DVACT_RESUME:
@@ -1452,6 +1457,13 @@ pciide_activate(struct device *self, int act)
/* nothing more to restore */
} else if (sc->sc_pp->chip_map == ixp_chip_map) {
/* nothing to restore (0x40 - 0x56) */
+ } else if (sc->sc_pp->chip_map == sii3112_chip_map) {
+ pci_conf_write(sc->sc_pc, sc->sc_tag,
+ SII3112_SCS_CMD, sc->sc_save[0]);
+ delay(50 * 1000);
+ pci_conf_write(sc->sc_pc, sc->sc_tag,
+ SII3112_PCI_CFGCTL, sc->sc_save[1]);
+ delay(50 * 1000);
} else {
printf("%s: restore for unknown chip map %x\n",
sc->sc_wdcdev.sc_dev.dv_xname,