Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/mii No functional change:



details:   https://anonhg.NetBSD.org/src/rev/eefc69fd5d67
branches:  trunk
changeset: 964778:eefc69fd5d67
user:      msaitoh <msaitoh%NetBSD.org@localhost>
date:      Fri Aug 16 15:17:31 2019 +0000

description:
No functional change:
 - Use static.
 - KNF.

diffstat:

 sys/dev/mii/etphy.c |  33 ++++++++++++++++-----------------
 1 files changed, 16 insertions(+), 17 deletions(-)

diffs (109 lines):

diff -r da9165995d32 -r eefc69fd5d67 sys/dev/mii/etphy.c
--- a/sys/dev/mii/etphy.c       Fri Aug 16 10:41:35 2019 +0000
+++ b/sys/dev/mii/etphy.c       Fri Aug 16 15:17:31 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.5 2019/08/16 15:17:31 msaitoh 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.5 2019/08/16 15:17:31 msaitoh Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -77,13 +77,13 @@
 #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,
 };
 
@@ -133,7 +133,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 +144,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 +185,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 +229,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,7 +252,7 @@
        return 0;
 }
 
-void
+static void
 etphy_reset(struct mii_softc *sc)
 {
        uint16_t reg;
@@ -263,8 +263,7 @@
                PHY_READ(sc, MII_PHYIDR2, &reg);
 
                PHY_READ(sc, ETPHY_CTRL, &reg);
-               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, &reg);
@@ -294,13 +293,13 @@
 
        PHY_READ(sc, MII_BMCR, &reg);
        PHY_READ(sc, ETPHY_CTRL, &reg);
-       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;



Home | Main Index | Thread Index | Old Index