-/* $OpenBSD: dc.c,v 1.115 2010/07/02 15:47:54 blambert Exp $ */
+/* $OpenBSD: dc.c,v 1.116 2010/08/05 07:57:04 deraadt Exp $ */
/*
* Copyright (c) 1997, 1998, 1999
void dc_tx_underrun(struct dc_softc *);
void dc_start(struct ifnet *);
int dc_ioctl(struct ifnet *, u_long, caddr_t);
-void dc_init(void *);
-void dc_stop(struct dc_softc *, int);
void dc_watchdog(struct ifnet *);
int dc_ifmedia_upd(struct ifnet *);
void dc_ifmedia_sts(struct ifnet *, struct ifmediareq *);
-/* $OpenBSD: dcreg.h,v 1.45 2009/08/10 20:29:54 deraadt Exp $ */
+/* $OpenBSD: dcreg.h,v 1.46 2010/08/05 07:57:04 deraadt Exp $ */
/*
* Copyright (c) 1997, 1998, 1999
extern void dc_attach(struct dc_softc *);
extern int dc_detach(struct dc_softc *);
extern int dc_intr(void *);
+
+void dc_init(void *);
+void dc_stop(struct dc_softc *, int);
+
extern void dc_reset(struct dc_softc *);
extern void dc_eeprom_width(struct dc_softc *);
extern void dc_read_srom(struct dc_softc *, int);
-/* $OpenBSD: if_dc_pci.c,v 1.65 2009/10/15 17:54:56 deraadt Exp $ */
+/* $OpenBSD: if_dc_pci.c,v 1.66 2010/08/05 07:57:05 deraadt Exp $ */
/*
* Copyright (c) 1997, 1998, 1999
int dc_pci_match(struct device *, void *, void *);
void dc_pci_attach(struct device *, struct device *, void *);
int dc_pci_detach(struct device *, int);
+int dc_pci_activate(struct device *, int);
void dc_pci_acpi(struct device *, void *);
struct dc_pci_softc {
return (0);
}
+int
+dc_pci_activate(struct device *self, int act)
+{
+ struct dc_pci_softc *psc = (void *)self;
+ struct dc_softc *sc = &psc->psc_softc;
+ struct ifnet *ifp = &sc->sc_arpcom.ac_if;
+
+ switch (act) {
+ case DVACT_SUSPEND:
+ if (ifp->if_flags & IFF_RUNNING)
+ dc_stop(sc, 0);
+ config_activate_children(self, act);
+ break;
+ case DVACT_RESUME:
+ config_activate_children(self, act);
+ if (ifp->if_flags & IFF_UP)
+ dc_init(sc);
+ break;
+ }
+ return (0);
+}
+
struct cfattach dc_pci_ca = {
- sizeof(struct dc_softc), dc_pci_match, dc_pci_attach, dc_pci_detach
+ sizeof(struct dc_softc), dc_pci_match, dc_pci_attach, dc_pci_detach,
+ dc_pci_activate
};