getting stuck. Based on an initial diff from deraadt@.
-/* $OpenBSD: sili.c,v 1.45 2010/05/19 15:27:35 oga Exp $ */
+/* $OpenBSD: sili.c,v 1.46 2010/08/05 20:21:36 kettenis Exp $ */
/*
* Copyright (c) 2007 David Gwynne <dlg@openbsd.org>
return (0);
}
+void
+sili_resume(struct sili_softc *sc)
+{
+ int i;
+
+ /* bounce the controller */
+ sili_write(sc, SILI_REG_GC, SILI_REG_GC_GR);
+ sili_write(sc, SILI_REG_GC, 0x0);
+
+ for (i = 0; i < sc->sc_nports; i++)
+ sili_ata_probe(sc, i);
+}
+
u_int32_t
sili_port_intr(struct sili_port *sp, int timeout_slot)
{
-/* $OpenBSD: silivar.h,v 1.6 2008/11/23 12:46:51 dlg Exp $ */
+/* $OpenBSD: silivar.h,v 1.7 2010/08/05 20:21:36 kettenis Exp $ */
/*
* Copyright (c) 2007 David Gwynne <dlg@openbsd.org>
int sili_attach(struct sili_softc *);
int sili_detach(struct sili_softc *, int);
+void sili_resume(struct sili_softc *);
+
int sili_intr(void *);
-/* $OpenBSD: sili_pci.c,v 1.10 2009/05/13 08:35:29 jsg Exp $ */
+/* $OpenBSD: sili_pci.c,v 1.11 2010/08/05 20:21:36 kettenis Exp $ */
/*
* Copyright (c) 2007 David Gwynne <dlg@openbsd.org>
int sili_pci_match(struct device *, void *, void *);
void sili_pci_attach(struct device *, struct device *, void *);
int sili_pci_detach(struct device *, int);
+int sili_pci_activate(struct device *, int);
struct sili_pci_softc {
struct sili_softc psc_sili;
sizeof(struct sili_pci_softc),
sili_pci_match,
sili_pci_attach,
- sili_pci_detach
+ sili_pci_detach,
+ sili_pci_activate
};
struct sili_device {
return (0);
}
+
+int
+sili_pci_activate(struct device *self, int act)
+{
+ struct sili_softc *sc = (struct sili_softc *)self;
+ int rv = 0;
+
+ switch (act) {
+ case DVACT_SUSPEND:
+ rv = config_activate_children(self, act);
+ break;
+ case DVACT_RESUME:
+ sili_resume(sc);
+ rv = config_activate_children(self, act);
+ break;
+ }
+
+ return (rv);
+}