-/* $OpenBSD: fxp.c,v 1.101 2010/05/19 15:27:35 oga Exp $ */
+/* $OpenBSD: fxp.c,v 1.102 2010/08/06 14:11:42 deraadt Exp $ */
/* $NetBSD: if_fxp.c,v 1.2 1997/06/05 02:01:55 thorpej Exp $ */
/*
void fxp_scb_wait(struct fxp_softc *);
void fxp_start(struct ifnet *);
int fxp_ioctl(struct ifnet *, u_long, caddr_t);
-void fxp_init(void *);
void fxp_load_ucode(struct fxp_softc *);
-void fxp_stop(struct fxp_softc *, int, int);
void fxp_watchdog(struct ifnet *);
int fxp_add_rfabuf(struct fxp_softc *, struct mbuf *);
int fxp_mdi_read(struct device *, int, int);
-/* $OpenBSD: fxpvar.h,v 1.31 2009/10/15 17:54:54 deraadt Exp $ */
+/* $OpenBSD: fxpvar.h,v 1.32 2010/08/06 14:11:43 deraadt Exp $ */
/* $NetBSD: if_fxpvar.h,v 1.1 1997/06/05 02:01:58 thorpej Exp $ */
/*
extern int fxp_intr(void *);
extern int fxp_attach(struct fxp_softc *, const char *);
void fxp_detach(struct fxp_softc *);
+void fxp_init(void *);
+void fxp_stop(struct fxp_softc *, int, int);
#define FXP_RXMAP_GET(sc) ((sc)->sc_rxmaps[(sc)->sc_rxfree++])
#define FXP_RXMAP_PUT(sc,map) ((sc)->sc_rxmaps[--(sc)->sc_rxfree] = (map))
-/* $OpenBSD: if_fxp_pci.c,v 1.52 2009/10/15 17:54:56 deraadt Exp $ */
+/* $OpenBSD: if_fxp_pci.c,v 1.53 2010/08/06 14:11:48 deraadt Exp $ */
/*
* Copyright (c) 1995, David Greenman
int fxp_pci_match(struct device *, void *, void *);
void fxp_pci_attach(struct device *, struct device *, void *);
int fxp_pci_detach(struct device *, int);
+int fxp_pci_activate(struct device *, int);
struct fxp_pci_softc {
struct fxp_softc psc_softc;
struct cfattach fxp_pci_ca = {
sizeof(struct fxp_pci_softc), fxp_pci_match, fxp_pci_attach,
- fxp_pci_detach
+ fxp_pci_detach, fxp_pci_activate
};
const struct pci_matchid fxp_pci_devices[] = {
return (0);
}
+
+int
+fxp_pci_activate(struct device *self, int act)
+{
+ struct fxp_softc *sc = (struct fxp_softc *)self;
+ struct ifnet *ifp = &sc->sc_arpcom.ac_if;
+
+ switch (act) {
+ case DVACT_SUSPEND:
+ if (ifp->if_flags & IFF_RUNNING)
+ fxp_stop(sc, 1, 1);
+ config_activate_children(self, act);
+ break;
+ case DVACT_RESUME:
+ config_activate_children(self, act);
+ if (ifp->if_flags & IFF_UP)
+ fxp_init(ifp);
+ break;
+ }
+ return (0);
+}