Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/netbsd-9]: src/sys/dev/mii Pull up following revision(s) (requested by m...
details: https://anonhg.NetBSD.org/src/rev/8c07092e44bd
branches: netbsd-9
changeset: 843160:8c07092e44bd
user: martin <martin%NetBSD.org@localhost>
date: Sun Sep 01 13:56:01 2019 +0000
description:
Pull up following revision(s) (requested by msaitoh in ticket #144):
sys/dev/mii/miidevs: revision 1.154
sys/dev/mii/etphy.c: revision 1.5
sys/dev/mii/etphy.c: revision 1.6
No functional change:
- Use static.
- KNF.
>From FreeBSD:
- Rename ET1011 to ET1011C
- Add ET1011
>From FreeBSD:
- Support ET1011.
- Use mii_phy_flowstatus() to reflect flow status from negotiated result.
diffstat:
sys/dev/mii/etphy.c | 41 +++++++++++++++++++++++------------------
sys/dev/mii/miidevs | 5 +++--
2 files changed, 26 insertions(+), 20 deletions(-)
diffs (151 lines):
diff -r 698348025b5f -r 8c07092e44bd sys/dev/mii/etphy.c
--- a/sys/dev/mii/etphy.c Sun Sep 01 13:52:53 2019 +0000
+++ b/sys/dev/mii/etphy.c Sun Sep 01 13:56:01 2019 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: etphy.c,v 1.4 2019/03/25 09:29:08 msaitoh Exp $ */
+/* $NetBSD: etphy.c,v 1.4.4.1 2019/09/01 13:56:01 martin Exp $ */
/* $OpenBSD: etphy.c,v 1.4 2008/04/02 20:12:58 brad Exp $ */
/*
@@ -38,7 +38,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: etphy.c,v 1.4 2019/03/25 09:29:08 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: etphy.c,v 1.4.4.1 2019/09/01 13:56:01 martin Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -77,18 +77,19 @@
#define ETPHY_SR_FDX 0x0080
-int etphy_service(struct mii_softc *, struct mii_data *, int);
-void etphy_attach(device_t, device_t, void *);
-int etphy_match(device_t, cfdata_t, void *);
-void etphy_reset(struct mii_softc *);
-void etphy_status(struct mii_softc *);
+static int etphy_service(struct mii_softc *, struct mii_data *, int);
+static void etphy_attach(device_t, device_t, void *);
+static int etphy_match(device_t, cfdata_t, void *);
+static void etphy_reset(struct mii_softc *);
+static void etphy_status(struct mii_softc *);
-const struct mii_phy_funcs etphy_funcs = {
+static const struct mii_phy_funcs etphy_funcs = {
etphy_service, etphy_status, etphy_reset,
};
static const struct mii_phydesc etphys[] = {
MII_PHY_DESC(AGERE, ET1011),
+ MII_PHY_DESC(AGERE, ET1011C),
MII_PHY_END,
};
@@ -133,7 +134,7 @@
{ 0x8010, 46 } /* IdlguardTime */
};
-int
+static int
etphy_match(device_t parent, cfdata_t match, void *aux)
{
struct mii_attach_args *ma = aux;
@@ -144,7 +145,7 @@
return 0;
}
-void
+static void
etphy_attach(device_t parent, device_t self, void *aux)
{
struct mii_softc *sc = device_private(self);
@@ -185,7 +186,7 @@
aprint_error_dev(self, "couldn't establish power handler\n");
}
-int
+static int
etphy_service(struct mii_softc *sc, struct mii_data *mii, int cmd)
{
struct ifmedia_entry *ife = mii->mii_media.ifm_cur;
@@ -229,7 +230,7 @@
if (IFM_SUBTYPE(ife->ifm_media) == IFM_1000_T) {
PHY_WRITE(sc, MII_BMCR,
- bmcr | BMCR_AUTOEN | BMCR_STARTNEG);
+ bmcr | BMCR_AUTOEN | BMCR_STARTNEG);
}
}
break;
@@ -252,19 +253,23 @@
return 0;
}
-void
+static void
etphy_reset(struct mii_softc *sc)
{
uint16_t reg;
int i;
+ if (sc->mii_mpd_model == MII_MODEL_AGERE_ET1011) {
+ mii_phy_reset(sc);
+ return;
+ }
+
for (i = 0; i < 2; ++i) {
PHY_READ(sc, MII_PHYIDR1, ®);
PHY_READ(sc, MII_PHYIDR2, ®);
PHY_READ(sc, ETPHY_CTRL, ®);
- PHY_WRITE(sc, ETPHY_CTRL,
- ETPHY_CTRL_DIAG | ETPHY_CTRL_RSV1);
+ PHY_WRITE(sc, ETPHY_CTRL, ETPHY_CTRL_DIAG | ETPHY_CTRL_RSV1);
PHY_WRITE(sc, ETPHY_INDEX, ETPHY_INDEX_MAGIC);
PHY_READ(sc, ETPHY_DATA, ®);
@@ -294,13 +299,13 @@
PHY_READ(sc, MII_BMCR, ®);
PHY_READ(sc, ETPHY_CTRL, ®);
- PHY_WRITE(sc, MII_BMCR, BMCR_AUTOEN | BMCR_S1000);
+ PHY_WRITE(sc, MII_BMCR, BMCR_AUTOEN | BMCR_S1000);
PHY_WRITE(sc, ETPHY_CTRL, ETPHY_CTRL_RSV1);
mii_phy_reset(sc);
}
-void
+static void
etphy_status(struct mii_softc *sc)
{
struct mii_data *mii = sc->mii_pdata;
@@ -340,7 +345,7 @@
}
if (sr & ETPHY_SR_FDX)
- mii->mii_media_active |= IFM_FDX;
+ mii->mii_media_active |= IFM_FDX | mii_phy_flowstatus(sc);
else
mii->mii_media_active |= IFM_HDX;
}
diff -r 698348025b5f -r 8c07092e44bd sys/dev/mii/miidevs
--- a/sys/dev/mii/miidevs Sun Sep 01 13:52:53 2019 +0000
+++ b/sys/dev/mii/miidevs Sun Sep 01 13:56:01 2019 +0000
@@ -1,4 +1,4 @@
-$NetBSD: miidevs,v 1.153 2019/06/06 16:04:13 thorpej Exp $
+$NetBSD: miidevs,v 1.153.2.1 2019/09/01 13:56:01 martin Exp $
/*-
* Copyright (c) 1998, 1999 The NetBSD Foundation, Inc.
@@ -124,7 +124,8 @@
/*
* Agere PHYs
*/
-model AGERE ET1011 0x0004 Agere ET1011 10/100/1000baseT PHY
+model AGERE ET1011 0x0001 ET1011 10/100/1000baseT PHY
+model AGERE ET1011C 0x0004 ET1011C 10/100/1000baseT PHY
/* Asix semiconductor PHYs */
model xxASIX AX88X9X 0x0031 Ax88x9x internal PHY
Home |
Main Index |
Thread Index |
Old Index