Fix PR 25788 by Arto Huusko using a cleaned up version of the provided patch.
Not reading the mii media status if the interface isn't up doesn't hurt, as the real media status isn't reported if the interface isn't up anyway (checked on i386). On my alpha500, I tracked down the machine check to the GO_WINDOW(4) at line 1858 of elinkxl.c. It's possible that the problem which was fixed in rev 1.72 was also the GO_WINDOW(4) used in the non-mii case. tr from ddb and a single-step show different results, and I trust the single-step one :)
This commit is contained in:
parent
0dd4809fb6
commit
a784628775
|
@ -1,4 +1,4 @@
|
|||
/* $NetBSD: elinkxl.c,v 1.72 2003/11/10 12:30:27 drochner Exp $ */
|
||||
/* $NetBSD: elinkxl.c,v 1.73 2004/07/02 16:58:36 bouyer Exp $ */
|
||||
|
||||
/*-
|
||||
* Copyright (c) 1998 The NetBSD Foundation, Inc.
|
||||
|
@ -37,7 +37,7 @@
|
|||
*/
|
||||
|
||||
#include <sys/cdefs.h>
|
||||
__KERNEL_RCSID(0, "$NetBSD: elinkxl.c,v 1.72 2003/11/10 12:30:27 drochner Exp $");
|
||||
__KERNEL_RCSID(0, "$NetBSD: elinkxl.c,v 1.73 2004/07/02 16:58:36 bouyer Exp $");
|
||||
|
||||
#include "bpfilter.h"
|
||||
#include "rnd.h"
|
||||
|
@ -947,20 +947,22 @@ ex_media_stat(ifp, req)
|
|||
struct ex_softc *sc = ifp->if_softc;
|
||||
u_int16_t help;
|
||||
|
||||
if (sc->ex_conf & EX_CONF_MII) {
|
||||
mii_pollstat(&sc->ex_mii);
|
||||
req->ifm_status = sc->ex_mii.mii_media_status;
|
||||
req->ifm_active = sc->ex_mii.mii_media_active;
|
||||
} else if ((ifp->if_flags & (IFF_UP|IFF_RUNNING))
|
||||
== (IFF_UP|IFF_RUNNING)) {
|
||||
GO_WINDOW(4);
|
||||
req->ifm_status = IFM_AVALID;
|
||||
req->ifm_active = sc->ex_mii.mii_media.ifm_cur->ifm_media;
|
||||
help = bus_space_read_2(sc->sc_iot, sc->sc_ioh,
|
||||
ELINK_W4_MEDIA_TYPE);
|
||||
if (help & LINKBEAT_DETECT)
|
||||
req->ifm_status |= IFM_ACTIVE;
|
||||
GO_WINDOW(1);
|
||||
if ((ifp->if_flags & (IFF_UP|IFF_RUNNING)) == (IFF_UP|IFF_RUNNING)) {
|
||||
if (sc->ex_conf & EX_CONF_MII) {
|
||||
mii_pollstat(&sc->ex_mii);
|
||||
req->ifm_status = sc->ex_mii.mii_media_status;
|
||||
req->ifm_active = sc->ex_mii.mii_media_active;
|
||||
} else {
|
||||
GO_WINDOW(4);
|
||||
req->ifm_status = IFM_AVALID;
|
||||
req->ifm_active =
|
||||
sc->ex_mii.mii_media.ifm_cur->ifm_media;
|
||||
help = bus_space_read_2(sc->sc_iot, sc->sc_ioh,
|
||||
ELINK_W4_MEDIA_TYPE);
|
||||
if (help & LINKBEAT_DETECT)
|
||||
req->ifm_status |= IFM_ACTIVE;
|
||||
GO_WINDOW(1);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue