diff --git a/sys/dev/cardbus/if_fxp_cardbus.c b/sys/dev/cardbus/if_fxp_cardbus.c index 6c3ce4ebab86..3b281ee9d623 100644 --- a/sys/dev/cardbus/if_fxp_cardbus.c +++ b/sys/dev/cardbus/if_fxp_cardbus.c @@ -1,4 +1,4 @@ -/* $NetBSD: if_fxp_cardbus.c,v 1.6 2000/02/09 22:15:59 joda Exp $ */ +/* $NetBSD: if_fxp_cardbus.c,v 1.7 2000/02/12 04:05:50 enami Exp $ */ /* * Copyright (c) 1999 The NetBSD Foundation, Inc. @@ -108,7 +108,7 @@ struct fxp_cardbus_softc { struct cfattach fxp_cardbus_ca = { sizeof(struct fxp_cardbus_softc), fxp_cardbus_match, fxp_cardbus_attach, - fxp_cardbus_detach + fxp_cardbus_detach, fxp_activate }; #ifdef CBB_DEBUG diff --git a/sys/dev/ic/i82557.c b/sys/dev/ic/i82557.c index 082353775ee8..f5a64ec56bda 100644 --- a/sys/dev/ic/i82557.c +++ b/sys/dev/ic/i82557.c @@ -1,4 +1,4 @@ -/* $NetBSD: i82557.c,v 1.19 2000/02/12 03:55:49 enami Exp $ */ +/* $NetBSD: i82557.c,v 1.20 2000/02/12 04:05:49 enami Exp $ */ /*- * Copyright (c) 1997, 1998, 1999 The NetBSD Foundation, Inc. @@ -871,7 +871,7 @@ fxp_intr(arg) u_int8_t statack; if ((sc->sc_dev.dv_flags & DVF_ACTIVE) == 0) - return 0; + return (0); /* * If the interface isn't running, don't try to * service the interrupt.. just ack it and bail. @@ -882,7 +882,7 @@ fxp_intr(arg) claimed = 1; CSR_WRITE_1(sc, FXP_CSR_SCB_STATACK, statack); } - return claimed; + return (claimed); } while ((statack = CSR_READ_1(sc, FXP_CSR_SCB_STATACK)) != 0) { @@ -1076,6 +1076,9 @@ fxp_tick(arg) struct fxp_stats *sp = &sc->sc_control_data->fcd_stats; int s; + if ((sc->sc_dev.dv_flags & DVF_ACTIVE) == 0) + return; + s = splnet(); ifp->if_opackets += le32toh(sp->tx_good); @@ -1868,6 +1871,42 @@ fxp_disable(sc) } } +/* + * fxp_activate: + * + * Handle device activation/deactivation requests. + */ +int +fxp_activate(self, act) + struct device *self; + enum devact act; +{ + struct fxp_softc *sc = (void *) self; + int s, error = 0; + + s = splnet(); + switch (act) { + case DVACT_ACTIVATE: + error = EOPNOTSUPP; + break; + + case DVACT_DEACTIVATE: + if (sc->sc_flags & FXPF_MII) + mii_activate(&sc->sc_mii, act, MII_PHY_ANY, + MII_OFFSET_ANY); + if_deactivate(&sc->sc_ethercom.ec_if); + break; + } + splx(s); + + return (error); +} + +/* + * fxp_detach: + * + * Detach an i82557 interface. + */ int fxp_detach(sc) struct fxp_softc *sc; diff --git a/sys/dev/ic/i82557var.h b/sys/dev/ic/i82557var.h index f65d2f472e61..75c1c129039e 100644 --- a/sys/dev/ic/i82557var.h +++ b/sys/dev/ic/i82557var.h @@ -1,4 +1,4 @@ -/* $NetBSD: i82557var.h,v 1.10 2000/02/09 22:15:58 joda Exp $ */ +/* $NetBSD: i82557var.h,v 1.11 2000/02/12 04:05:49 enami Exp $ */ /*- * Copyright (c) 1997, 1998, 1999 The NetBSD Foundation, Inc. @@ -320,9 +320,9 @@ do { \ bus_space_write_4((sc)->sc_st, (sc)->sc_sh, (reg), (val)) void fxp_attach __P((struct fxp_softc *)); +int fxp_activate __P((struct device *, enum devact)); int fxp_detach __P((struct fxp_softc *)); int fxp_intr __P((void *)); int fxp_enable __P((struct fxp_softc*)); void fxp_disable __P((struct fxp_softc*)); -