Use newly minted device_is_attached rather than device_is_alive to see

if attach succeeded.  device_is_alive just tells us that probe
succeeded.  Since we were using it to do things like detach net
interfaces, this caused problems when there were errors in the attach
routine.

Symptoms of problem reported by: martin blapp
This commit is contained in:
imp 2003-04-21 18:34:04 +00:00
parent 68d1cc4cc5
commit 55161dbc66
17 changed files with 17 additions and 17 deletions

View File

@ -2316,7 +2316,7 @@ dc_detach(dev)
ifp = &sc->arpcom.ac_if;
/* These should only be active if attach succeeded */
if (device_is_alive(dev)) {
if (device_is_attached(dev)) {
dc_stop(sc);
ether_ifdetach(ifp);
}

View File

@ -829,7 +829,7 @@ sf_detach(dev)
ifp = &sc->arpcom.ac_if;
/* These should only be active if attach succeeded */
if (device_is_alive(dev)) {
if (device_is_attached(dev)) {
sf_stop(sc);
ether_ifdetach(ifp);
}

View File

@ -1375,7 +1375,7 @@ sk_detach_xmac(dev)
ifp = &sc_if->arpcom.ac_if;
/* These should only be active if attach_xmac succeeded */
if (device_is_alive(dev)) {
if (device_is_attached(dev)) {
sk_stop(sc_if);
ether_ifdetach(ifp);
}

View File

@ -2377,7 +2377,7 @@ ti_detach(dev)
ifp = &sc->arpcom.ac_if;
/* These should only be active if attach succeeded */
if (device_is_alive(dev)) {
if (device_is_attached(dev)) {
ti_stop(sc);
ether_ifdetach(ifp);
bus_generic_detach(dev);

View File

@ -915,7 +915,7 @@ vr_detach(dev)
ifp = &sc->arpcom.ac_if;
/* These should only be active if attach succeeded */
if (device_is_alive(dev)) {
if (device_is_attached(dev)) {
vr_stop(sc);
ether_ifdetach(ifp);
}

View File

@ -2316,7 +2316,7 @@ dc_detach(dev)
ifp = &sc->arpcom.ac_if;
/* These should only be active if attach succeeded */
if (device_is_alive(dev)) {
if (device_is_attached(dev)) {
dc_stop(sc);
ether_ifdetach(ifp);
}

View File

@ -665,7 +665,7 @@ pcn_detach(dev)
PCN_LOCK(sc);
/* These should only be active if attach succeeded */
if (device_is_alive(dev)) {
if (device_is_attached(dev)) {
pcn_reset(sc);
pcn_stop(sc);
ether_ifdetach(ifp);

View File

@ -1101,7 +1101,7 @@ rl_detach(dev)
ifp = &sc->arpcom.ac_if;
/* These should only be active if attach succeeded */
if (device_is_alive(dev)) {
if (device_is_attached(dev)) {
rl_stop(sc);
ether_ifdetach(ifp);
}

View File

@ -829,7 +829,7 @@ sf_detach(dev)
ifp = &sc->arpcom.ac_if;
/* These should only be active if attach succeeded */
if (device_is_alive(dev)) {
if (device_is_attached(dev)) {
sf_stop(sc);
ether_ifdetach(ifp);
}

View File

@ -1424,7 +1424,7 @@ sis_detach(dev)
ifp = &sc->arpcom.ac_if;
/* These should only be active if attach succeeded */
if (device_is_alive(dev)) {
if (device_is_attached(dev)) {
sis_reset(sc);
sis_stop(sc);
ether_ifdetach(ifp);

View File

@ -1375,7 +1375,7 @@ sk_detach_xmac(dev)
ifp = &sc_if->arpcom.ac_if;
/* These should only be active if attach_xmac succeeded */
if (device_is_alive(dev)) {
if (device_is_attached(dev)) {
sk_stop(sc_if);
ether_ifdetach(ifp);
}

View File

@ -1089,7 +1089,7 @@ ste_detach(dev)
ifp = &sc->arpcom.ac_if;
/* These should only be active if attach succeeded */
if (device_is_alive(dev)) {
if (device_is_attached(dev)) {
ste_stop(sc);
ether_ifdetach(ifp);
}

View File

@ -2377,7 +2377,7 @@ ti_detach(dev)
ifp = &sc->arpcom.ac_if;
/* These should only be active if attach succeeded */
if (device_is_alive(dev)) {
if (device_is_attached(dev)) {
ti_stop(sc);
ether_ifdetach(ifp);
bus_generic_detach(dev);

View File

@ -1349,7 +1349,7 @@ tl_detach(dev)
ifp = &sc->arpcom.ac_if;
/* These should only be active if attach succeeded */
if (device_is_alive(dev)) {
if (device_is_attached(dev)) {
tl_stop(sc);
ether_ifdetach(ifp);
}

View File

@ -915,7 +915,7 @@ vr_detach(dev)
ifp = &sc->arpcom.ac_if;
/* These should only be active if attach succeeded */
if (device_is_alive(dev)) {
if (device_is_attached(dev)) {
vr_stop(sc);
ether_ifdetach(ifp);
}

View File

@ -981,7 +981,7 @@ wb_detach(dev)
* Delete any miibus and phy devices attached to this interface.
* This should only be done if attach succeeded.
*/
if (device_is_alive(dev)) {
if (device_is_attached(dev)) {
wb_stop(sc);
ether_ifdetach(ifp);
}

View File

@ -1769,7 +1769,7 @@ xl_detach(dev)
}
/* These should only be active if attach succeeded */
if (device_is_alive(dev)) {
if (device_is_attached(dev)) {
xl_reset(sc);
xl_stop(sc);
ether_ifdetach(ifp);