From db12d5f3a3a7a2b90f135d714fcbc960e5994d4d Mon Sep 17 00:00:00 2001 From: niklas Date: Mon, 24 Apr 2000 21:13:33 +0000 Subject: [PATCH] Add simple mii detach routine while waiting for the post-2.7 merge of NetBSD mii work --- sys/dev/mii/mii.c | 14 +++++++++++++- sys/dev/mii/miivar.h | 3 ++- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/sys/dev/mii/mii.c b/sys/dev/mii/mii.c index 274bbcc357c..625d8980fe2 100644 --- a/sys/dev/mii/mii.c +++ b/sys/dev/mii/mii.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mii.c,v 1.6 1999/12/07 22:01:31 jason Exp $ */ +/* $OpenBSD: mii.c,v 1.7 2000/04/24 21:13:33 niklas Exp $ */ /* $NetBSD: mii.c,v 1.9 1998/11/05 04:08:02 thorpej Exp $ */ /*- @@ -117,6 +117,18 @@ mii_phy_probe(parent, mii, capmask) } } +int +mii_detach(msc, flags) + struct mii_softc *msc; + int flags; +{ + LIST_REMOVE(msc, mii_list); + /* XXX The following condition should always be true. */ + if (msc->mii_inst == msc->mii_pdata->mii_instance - 1) + msc->mii_pdata->mii_instance--; + return config_detach(&msc->mii_dev, flags); +} + int mii_print(aux, pnp) void *aux; diff --git a/sys/dev/mii/miivar.h b/sys/dev/mii/miivar.h index 717d13788a0..eeb5872286c 100644 --- a/sys/dev/mii/miivar.h +++ b/sys/dev/mii/miivar.h @@ -1,4 +1,4 @@ -/* $OpenBSD: miivar.h,v 1.4 1999/12/07 22:01:31 jason Exp $ */ +/* $OpenBSD: miivar.h,v 1.5 2000/04/24 21:13:33 niklas Exp $ */ /* $NetBSD: miivar.h,v 1.7.6.1 1999/04/23 15:40:35 perry Exp $ */ /*- @@ -179,6 +179,7 @@ void mii_tick __P((struct mii_data *)); void mii_pollstat __P((struct mii_data *)); void mii_down __P((struct mii_data *)); void mii_phy_probe __P((struct device *, struct mii_data *, int)); +int mii_detach __P((struct mii_softc *, int)); void mii_add_media __P((struct mii_softc *)); void mii_phy_setmedia __P((struct mii_softc *)); -- 2.20.1