summaryrefslogtreecommitdiff
path: root/sys/dev/mii
diff options
context:
space:
mode:
authormsaitoh <msaitoh@NetBSD.org>2014-06-12 12:09:47 +0000
committermsaitoh <msaitoh@NetBSD.org>2014-06-12 12:09:47 +0000
commitcb7341ae45aed53fcda9d7e5cfa75c0f70ef774b (patch)
tree5a460de1c464e33a9bee1c281808f7e039274601 /sys/dev/mii
parent32d0ef9bc9f4c34817d0281750fe16977e9471f0 (diff)
No functional change:
- Remove BRGPHY_SERDES_ANAR_* and BRGPHY_SERDES_ANLPAR_*. Those registers are the same as MII_ANAR_* and MII_ANLPAR_*. - Fix typo. - Remove trailing white spaces. - KNF.
Diffstat (limited to 'sys/dev/mii')
-rw-r--r--sys/dev/mii/brgphy.c12
-rw-r--r--sys/dev/mii/brgphyreg.h21
2 files changed, 6 insertions, 27 deletions
diff --git a/sys/dev/mii/brgphy.c b/sys/dev/mii/brgphy.c
index 53ed5a2a30d..7867e73e19a 100644
--- a/sys/dev/mii/brgphy.c
+++ b/sys/dev/mii/brgphy.c
@@ -1,4 +1,4 @@
-/* $NetBSD: brgphy.c,v 1.68 2013/10/31 04:26:40 msaitoh Exp $ */
+/* $NetBSD: brgphy.c,v 1.69 2014/06/12 12:09:47 msaitoh Exp $ */
/*-
* Copyright (c) 1998, 1999, 2000, 2001 The NetBSD Foundation, Inc.
@@ -62,7 +62,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: brgphy.c,v 1.68 2013/10/31 04:26:40 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: brgphy.c,v 1.69 2014/06/12 12:09:47 msaitoh Exp $");
#include <sys/param.h>
#include <sys/systm.h>
@@ -376,9 +376,8 @@ setit:
if ((ife->ifm_media & IFM_GMASK) == IFM_FDX) {
speed |= BMCR_FDX;
gig = GTCR_ADV_1000TFDX;
- } else {
+ } else
gig = GTCR_ADV_1000THDX;
- }
PHY_WRITE(sc, MII_100T2CR, 0);
PHY_WRITE(sc, MII_ANAR, ANAR_CSMA);
@@ -635,7 +634,7 @@ brgphy_mii_phy_auto(struct mii_softc *sc)
if (sc->mii_flags & MIIF_HAVEFIBER) {
anar = ANAR_X_FD | ANAR_X_HD;
if (sc->mii_flags & MIIF_DOPAUSE)
- anar |= BRGPHY_SERDES_ANAR_BOTH_PAUSE;
+ anar |= ANAR_X_PAUSE_TOWARDS;
} else {
anar = BMSR_MEDIA_TO_ANAR(sc->mii_capabilities) | ANAR_CSMA;
if (sc->mii_flags & MIIF_DOPAUSE)
@@ -645,8 +644,7 @@ brgphy_mii_phy_auto(struct mii_softc *sc)
DELAY(1000);
/* Start autonegotiation */
- PHY_WRITE(sc, MII_BMCR,
- BMCR_AUTOEN | BMCR_STARTNEG);
+ PHY_WRITE(sc, MII_BMCR, BMCR_AUTOEN | BMCR_STARTNEG);
PHY_WRITE(sc, BRGPHY_MII_IMR, 0xFF00);
return (EJUSTRETURN);
diff --git a/sys/dev/mii/brgphyreg.h b/sys/dev/mii/brgphyreg.h
index 78427600052..0f0b7611127 100644
--- a/sys/dev/mii/brgphyreg.h
+++ b/sys/dev/mii/brgphyreg.h
@@ -1,4 +1,4 @@
-/* $NetBSD: brgphyreg.h,v 1.6 2013/04/01 13:44:02 msaitoh Exp $ */
+/* $NetBSD: brgphyreg.h,v 1.7 2014/06/12 12:09:47 msaitoh Exp $ */
/*
* Copyright (c) 2000
@@ -197,25 +197,6 @@
#define BRGPHY_IMR_CRCERR 0x0001 /* CEC error */
/*******************************************************/
-/* Begin: Shared SerDes PHY register definitions */
-/*******************************************************/
-
-/* SerDes autoneg is different from copper */
-#define BRGPHY_SERDES_ANAR_NO_PAUSE (0x0 << 7)
-#define BRGPHY_SERDES_ANAR_SYM_PAUSE (0x1 << 7)
-#define BRGPHY_SERDES_ANAR_ASYM_PAUSE (0x2 << 7)
-#define BRGPHY_SERDES_ANAR_BOTH_PAUSE (0x3 << 7)
-
-#define BRGPHY_SERDES_ANLPAR_NO_PAUSE (0x0 << 7)
-#define BRGPHY_SERDES_ANLPAR_SYM_PAUSE (0x1 << 7)
-#define BRGPHY_SERDES_ANLPAR_ASYM_PAUSE (0x2 << 7)
-#define BRGPHY_SERDES_ANLPAR_BOTH_PAUSE (0x3 << 7)
-
-/*******************************************************/
-/* End: Shared SerDes PHY register definitions */
-/*******************************************************/
-
-/*******************************************************/
/* Begin: PHY register values for the 5706 PHY */
/*******************************************************/