Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/dev/mii - Indicat master mode if the negotiated result s...
details: https://anonhg.NetBSD.org/src/rev/f5cce2220e8f
branches: trunk
changeset: 1004065:f5cce2220e8f
user: msaitoh <msaitoh%NetBSD.org@localhost>
date: Fri Oct 11 09:29:04 2019 +0000
description:
- Indicat master mode if the negotiated result say so.
- KNF
diffstat:
sys/dev/mii/ciphy.c | 17 +++++++++--------
sys/dev/mii/rgephy.c | 12 +++++++++---
2 files changed, 18 insertions(+), 11 deletions(-)
diffs (97 lines):
diff -r 72d9c31d4254 -r f5cce2220e8f sys/dev/mii/ciphy.c
--- a/sys/dev/mii/ciphy.c Fri Oct 11 08:05:19 2019 +0000
+++ b/sys/dev/mii/ciphy.c Fri Oct 11 09:29:04 2019 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: ciphy.c,v 1.34 2019/04/11 09:14:07 msaitoh Exp $ */
+/* $NetBSD: ciphy.c,v 1.35 2019/10/11 09:29:04 msaitoh Exp $ */
/*-
* Copyright (c) 2004
@@ -35,7 +35,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ciphy.c,v 1.34 2019/04/11 09:14:07 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ciphy.c,v 1.35 2019/10/11 09:29:04 msaitoh Exp $");
/*
* Driver for the Cicada CS8201 10/100/1000 copper PHY.
@@ -297,7 +297,7 @@
ciphy_status(struct mii_softc *sc)
{
struct mii_data *mii = sc->mii_pdata;
- uint16_t bmsr, bmcr;
+ uint16_t bmsr, bmcr, gtsr;
mii->mii_media_status = IFM_AVALID;
mii->mii_media_active = IFM_ETHER;
@@ -343,16 +343,19 @@
else
mii->mii_media_active |= IFM_HDX;
- return;
+ if (IFM_SUBTYPE(mii->mii_media_active) == IFM_1000_T) {
+ PHY_READ(sc, MII_GTSR, >sr);
+ if ((gtsr & GTSR_MS_RES) != 0)
+ mii->mii_media_active |= IFM_ETH_MASTER;
+ }
}
static void
ciphy_reset(struct mii_softc *sc)
{
+
mii_phy_reset(sc);
DELAY(1000);
-
- return;
}
static inline int
@@ -437,6 +440,4 @@
model);
break;
}
-
- return;
}
diff -r 72d9c31d4254 -r f5cce2220e8f sys/dev/mii/rgephy.c
--- a/sys/dev/mii/rgephy.c Fri Oct 11 08:05:19 2019 +0000
+++ b/sys/dev/mii/rgephy.c Fri Oct 11 09:29:04 2019 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: rgephy.c,v 1.56 2019/10/11 03:40:01 msaitoh Exp $ */
+/* $NetBSD: rgephy.c,v 1.57 2019/10/11 09:29:04 msaitoh Exp $ */
/*
* Copyright (c) 2003
@@ -33,7 +33,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: rgephy.c,v 1.56 2019/10/11 03:40:01 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rgephy.c,v 1.57 2019/10/11 09:29:04 msaitoh Exp $");
/*
@@ -356,7 +356,7 @@
rgephy_status(struct mii_softc *sc)
{
struct mii_data *mii = sc->mii_pdata;
- uint16_t gstat, bmsr, bmcr, physr, ssr;
+ uint16_t gstat, bmsr, bmcr, gtsr, physr, ssr;
mii->mii_media_status = IFM_AVALID;
mii->mii_media_active = IFM_ETHER;
@@ -442,6 +442,12 @@
else
mii->mii_media_active |= IFM_HDX;
}
+
+ if (IFM_SUBTYPE(mii->mii_media_active) == IFM_1000_T) {
+ PHY_READ(sc, MII_GTSR, >sr);
+ if ((gtsr & GTSR_MS_RES) != 0)
+ mii->mii_media_active |= IFM_ETH_MASTER;
+ }
}
static int
Home |
Main Index |
Thread Index |
Old Index