Let mii_phy_setmedia() handle the IFM_AUTO case, too.

This commit is contained in:
thorpej 2000-02-02 23:34:56 +00:00
parent c1185c1020
commit 22fe15d7b4
13 changed files with 28 additions and 157 deletions

View File

@ -1,4 +1,4 @@
/* $NetBSD: dmphy.c,v 1.4 2000/02/02 17:50:43 thorpej Exp $ */
/* $NetBSD: dmphy.c,v 1.5 2000/02/02 23:34:56 thorpej Exp $ */
/*-
* Copyright (c) 1998, 1999, 2000 The NetBSD Foundation, Inc.
@ -183,18 +183,7 @@ dmphy_service(sc, mii, cmd)
if ((mii->mii_ifp->if_flags & IFF_UP) == 0)
break;
switch (IFM_SUBTYPE(ife->ifm_media)) {
case IFM_AUTO:
/*
* If we're already in auto mode, just return.
*/
if (PHY_READ(sc, MII_BMCR) & BMCR_AUTOEN)
return (0);
(void) mii_phy_auto(sc, 1);
break;
default:
mii_phy_setmedia(sc);
}
mii_phy_setmedia(sc);
break;
case MII_TICK:

View File

@ -1,4 +1,4 @@
/* $NetBSD: exphy.c,v 1.22 2000/02/02 17:50:43 thorpej Exp $ */
/* $NetBSD: exphy.c,v 1.23 2000/02/02 23:34:56 thorpej Exp $ */
/*-
* Copyright (c) 1998, 1999 The NetBSD Foundation, Inc.
@ -188,18 +188,7 @@ exphy_service(sc, mii, cmd)
if ((mii->mii_ifp->if_flags & IFF_UP) == 0)
break;
switch (IFM_SUBTYPE(ife->ifm_media)) {
case IFM_AUTO:
/*
* If we're already in auto mode, just return.
*/
if (PHY_READ(sc, MII_BMCR) & BMCR_AUTOEN)
return (0);
(void) mii_phy_auto(sc, 1);
break;
default:
mii_phy_setmedia(sc);
}
mii_phy_setmedia(sc);
break;
case MII_TICK:

View File

@ -1,4 +1,4 @@
/* $NetBSD: icsphy.c,v 1.16 2000/02/02 17:50:43 thorpej Exp $ */
/* $NetBSD: icsphy.c,v 1.17 2000/02/02 23:34:56 thorpej Exp $ */
/*-
* Copyright (c) 1998, 1999 The NetBSD Foundation, Inc.
@ -183,18 +183,7 @@ icsphy_service(sc, mii, cmd)
if ((mii->mii_ifp->if_flags & IFF_UP) == 0)
break;
switch (IFM_SUBTYPE(ife->ifm_media)) {
case IFM_AUTO:
/*
* If we're already in auto mode, just return.
*/
if (PHY_READ(sc, MII_BMCR) & BMCR_AUTOEN)
return (0);
(void) mii_phy_auto(sc, 1);
break;
default:
mii_phy_setmedia(sc);
}
mii_phy_setmedia(sc);
break;
case MII_TICK:

View File

@ -1,4 +1,4 @@
/* $NetBSD: inphy.c,v 1.17 2000/02/02 17:50:44 thorpej Exp $ */
/* $NetBSD: inphy.c,v 1.18 2000/02/02 23:34:56 thorpej Exp $ */
/*-
* Copyright (c) 1998, 1999 The NetBSD Foundation, Inc.
@ -183,18 +183,7 @@ inphy_service(sc, mii, cmd)
if ((mii->mii_ifp->if_flags & IFF_UP) == 0)
break;
switch (IFM_SUBTYPE(ife->ifm_media)) {
case IFM_AUTO:
/*
* If we're already in auto mode, just return.
*/
if (PHY_READ(sc, MII_BMCR) & BMCR_AUTOEN)
return (0);
(void) mii_phy_auto(sc, 1);
break;
default:
mii_phy_setmedia(sc);
}
mii_phy_setmedia(sc);
break;
case MII_TICK:

View File

@ -1,4 +1,4 @@
/* $NetBSD: iophy.c,v 1.7 2000/02/02 17:50:44 thorpej Exp $ */
/* $NetBSD: iophy.c,v 1.8 2000/02/02 23:34:56 thorpej Exp $ */
/*
* Copyright (c) 1998, 1999 The NetBSD Foundation, Inc.
@ -185,18 +185,7 @@ iophy_service(sc, mii, cmd)
if ((mii->mii_ifp->if_flags & IFF_UP) == 0)
break;
switch (IFM_SUBTYPE(ife->ifm_media)) {
case IFM_AUTO:
/*
* If we're already in auto mode, just return.
*/
if (PHY_READ(sc, MII_BMCR) & BMCR_AUTOEN)
return (0);
(void) mii_phy_auto(sc, 1);
break;
default:
mii_phy_setmedia(sc);
}
mii_phy_setmedia(sc);
break;
case MII_TICK:

View File

@ -1,4 +1,4 @@
/* $NetBSD: lxtphy.c,v 1.18 2000/02/02 17:50:44 thorpej Exp $ */
/* $NetBSD: lxtphy.c,v 1.19 2000/02/02 23:34:57 thorpej Exp $ */
/*-
* Copyright (c) 1998, 1999 The NetBSD Foundation, Inc.
@ -183,18 +183,7 @@ lxtphy_service(sc, mii, cmd)
if ((mii->mii_ifp->if_flags & IFF_UP) == 0)
break;
switch (IFM_SUBTYPE(ife->ifm_media)) {
case IFM_AUTO:
/*
* If we're already in auto mode, just return.
*/
if (PHY_READ(sc, MII_BMCR) & BMCR_AUTOEN)
return (0);
(void) mii_phy_auto(sc, 1);
break;
default:
mii_phy_setmedia(sc);
}
mii_phy_setmedia(sc);
break;
case MII_TICK:

View File

@ -1,4 +1,4 @@
/* $NetBSD: mii_physubr.c,v 1.11 2000/02/02 17:50:45 thorpej Exp $ */
/* $NetBSD: mii_physubr.c,v 1.12 2000/02/02 23:34:57 thorpej Exp $ */
/*-
* Copyright (c) 1998, 1999 The NetBSD Foundation, Inc.
@ -76,6 +76,9 @@ mii_phy_setmedia(sc)
struct ifmedia_entry *ife = mii->mii_media.ifm_cur;
int bmcr, anar;
if (IFM_SUBTYPE(ife->ifm_media) == IFM_AUTO)
(void) mii_phy_auto(sc, 1);
/*
* Table index is stored in the media entry.
*/

View File

@ -1,4 +1,4 @@
/* $NetBSD: nsphy.c,v 1.24 2000/02/02 17:50:45 thorpej Exp $ */
/* $NetBSD: nsphy.c,v 1.25 2000/02/02 23:34:57 thorpej Exp $ */
/*-
* Copyright (c) 1998, 1999 The NetBSD Foundation, Inc.
@ -215,18 +215,7 @@ nsphy_service(sc, mii, cmd)
PHY_WRITE(sc, MII_NSPHY_PCR, reg);
switch (IFM_SUBTYPE(ife->ifm_media)) {
case IFM_AUTO:
/*
* If we're already in auto mode, just return.
*/
if (PHY_READ(sc, MII_BMCR) & BMCR_AUTOEN)
return (0);
(void) mii_phy_auto(sc, 1);
break;
default:
mii_phy_setmedia(sc);
}
mii_phy_setmedia(sc);
break;
case MII_TICK:

View File

@ -1,4 +1,4 @@
/* $NetBSD: nsphyter.c,v 1.4 2000/02/02 17:50:46 thorpej Exp $ */
/* $NetBSD: nsphyter.c,v 1.5 2000/02/02 23:34:57 thorpej Exp $ */
/*-
* Copyright (c) 1998, 1999 The NetBSD Foundation, Inc.
@ -180,18 +180,7 @@ nsphyter_service(sc, mii, cmd)
if ((mii->mii_ifp->if_flags & IFF_UP) == 0)
break;
switch (IFM_SUBTYPE(ife->ifm_media)) {
case IFM_AUTO:
/*
* If we're already in auto mode, just return.
*/
if (PHY_READ(sc, MII_BMCR) & BMCR_AUTOEN)
return (0);
(void) mii_phy_auto(sc, 1);
break;
default:
mii_phy_setmedia(sc);
}
mii_phy_setmedia(sc);
break;
case MII_TICK:

View File

@ -1,4 +1,4 @@
/* $NetBSD: qsphy.c,v 1.18 2000/02/02 17:50:46 thorpej Exp $ */
/* $NetBSD: qsphy.c,v 1.19 2000/02/02 23:34:57 thorpej Exp $ */
/*-
* Copyright (c) 1998, 1999 The NetBSD Foundation, Inc.
@ -183,18 +183,7 @@ qsphy_service(sc, mii, cmd)
if ((mii->mii_ifp->if_flags & IFF_UP) == 0)
break;
switch (IFM_SUBTYPE(ife->ifm_media)) {
case IFM_AUTO:
/*
* If we're already in auto mode, just return.
*/
if (PHY_READ(sc, MII_BMCR) & BMCR_AUTOEN)
return (0);
(void) mii_phy_auto(sc, 1);
break;
default:
mii_phy_setmedia(sc);
}
mii_phy_setmedia(sc);
break;
case MII_TICK:

View File

@ -1,4 +1,4 @@
/* $NetBSD: sqphy.c,v 1.16 2000/02/02 17:50:46 thorpej Exp $ */
/* $NetBSD: sqphy.c,v 1.17 2000/02/02 23:34:57 thorpej Exp $ */
/*-
* Copyright (c) 1998, 1999 The NetBSD Foundation, Inc.
@ -183,18 +183,7 @@ sqphy_service(sc, mii, cmd)
if ((mii->mii_ifp->if_flags & IFF_UP) == 0)
break;
switch (IFM_SUBTYPE(ife->ifm_media)) {
case IFM_AUTO:
/*
* If we're already in auto mode, just return.
*/
if (PHY_READ(sc, MII_BMCR) & BMCR_AUTOEN)
return (0);
(void) mii_phy_auto(sc, 1);
break;
default:
mii_phy_setmedia(sc);
}
mii_phy_setmedia(sc);
break;
case MII_TICK:

View File

@ -1,4 +1,4 @@
/* $NetBSD: tqphy.c,v 1.8 2000/02/02 17:50:47 thorpej Exp $ */
/* $NetBSD: tqphy.c,v 1.9 2000/02/02 23:34:57 thorpej Exp $ */
/*
* Copyright (c) 1998, 1999 The NetBSD Foundation, Inc.
@ -191,18 +191,7 @@ tqphy_service(sc, mii, cmd)
if ((mii->mii_ifp->if_flags & IFF_UP) == 0)
break;
switch (IFM_SUBTYPE(ife->ifm_media)) {
case IFM_AUTO:
/*
* If we're already in auto mode, just return.
*/
if (PHY_READ(sc, MII_BMCR) & BMCR_AUTOEN)
return (0);
(void) mii_phy_auto(sc, 1);
break;
default:
mii_phy_setmedia(sc);
}
mii_phy_setmedia(sc);
break;
case MII_TICK:

View File

@ -1,4 +1,4 @@
/* $NetBSD: ukphy.c,v 1.8 2000/02/02 17:50:47 thorpej Exp $ */
/* $NetBSD: ukphy.c,v 1.9 2000/02/02 23:34:57 thorpej Exp $ */
/*-
* Copyright (c) 1998, 1999 The NetBSD Foundation, Inc.
@ -183,18 +183,7 @@ ukphy_service(sc, mii, cmd)
if ((mii->mii_ifp->if_flags & IFF_UP) == 0)
break;
switch (IFM_SUBTYPE(ife->ifm_media)) {
case IFM_AUTO:
/*
* If we're already in auto mode, just return.
*/
if (PHY_READ(sc, MII_BMCR) & BMCR_AUTOEN)
return (0);
(void) mii_phy_auto(sc, 1);
break;
default:
mii_phy_setmedia(sc);
}
mii_phy_setmedia(sc);
break;
case MII_TICK: