Check wheter an MII PHY is really connected or not.
This change privents panic if MII PHY port is not used.
This commit is contained in:
parent
312d89f0de
commit
a23ec4c8a4
|
@ -1,4 +1,4 @@
|
||||||
/* $NetBSD: if_mvgbe.c,v 1.32 2012/11/09 09:04:19 msaitoh Exp $ */
|
/* $NetBSD: if_mvgbe.c,v 1.33 2012/12/20 10:01:28 msaitoh Exp $ */
|
||||||
/*
|
/*
|
||||||
* Copyright (c) 2007, 2008 KIYOHARA Takashi
|
* Copyright (c) 2007, 2008 KIYOHARA Takashi
|
||||||
* All rights reserved.
|
* All rights reserved.
|
||||||
|
@ -25,7 +25,7 @@
|
||||||
* POSSIBILITY OF SUCH DAMAGE.
|
* POSSIBILITY OF SUCH DAMAGE.
|
||||||
*/
|
*/
|
||||||
#include <sys/cdefs.h>
|
#include <sys/cdefs.h>
|
||||||
__KERNEL_RCSID(0, "$NetBSD: if_mvgbe.c,v 1.32 2012/11/09 09:04:19 msaitoh Exp $");
|
__KERNEL_RCSID(0, "$NetBSD: if_mvgbe.c,v 1.33 2012/12/20 10:01:28 msaitoh Exp $");
|
||||||
|
|
||||||
#include <sys/param.h>
|
#include <sys/param.h>
|
||||||
#include <sys/bus.h>
|
#include <sys/bus.h>
|
||||||
|
@ -429,7 +429,9 @@ mvgbec_attach(device_t parent, device_t self, void *aux)
|
||||||
if (child) {
|
if (child) {
|
||||||
port = device_private(child);
|
port = device_private(child);
|
||||||
mii = LIST_FIRST(&port->sc_mii.mii_phys);
|
mii = LIST_FIRST(&port->sc_mii.mii_phys);
|
||||||
phyaddr |= MVGBE_PHYADDR_PHYAD(j, mii->mii_phy);
|
if (mii != NULL)
|
||||||
|
phyaddr |= MVGBE_PHYADDR_PHYAD(j,
|
||||||
|
mii->mii_phy);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Reference in New Issue