Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/mii Avoid using proplib in rgephy_reset to make LOCK...



details:   https://anonhg.NetBSD.org/src/rev/87937d021fee
branches:  trunk
changeset: 829481:87937d021fee
user:      jmcneill <jmcneill%NetBSD.org@localhost>
date:      Sat Feb 03 19:34:01 2018 +0000

description:
Avoid using proplib in rgephy_reset to make LOCKDEBUG happy.

diffstat:

 sys/dev/mii/rgephy.c |  14 ++++++++------
 1 files changed, 8 insertions(+), 6 deletions(-)

diffs (63 lines):

diff -r 7b4eee8e0074 -r 87937d021fee sys/dev/mii/rgephy.c
--- a/sys/dev/mii/rgephy.c      Sat Feb 03 19:27:15 2018 +0000
+++ b/sys/dev/mii/rgephy.c      Sat Feb 03 19:34:01 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: rgephy.c,v 1.41 2017/12/23 12:49:54 jmcneill Exp $     */
+/*     $NetBSD: rgephy.c,v 1.42 2018/02/03 19:34:01 jmcneill Exp $     */
 
 /*
  * Copyright (c) 2003
@@ -33,7 +33,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: rgephy.c,v 1.41 2017/12/23 12:49:54 jmcneill Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rgephy.c,v 1.42 2018/02/03 19:34:01 jmcneill Exp $");
 
 
 /*
@@ -63,6 +63,7 @@
 
 struct rgephy_softc {
        struct mii_softc mii_sc;
+       bool mii_no_rx_delay;
 };
 
 CFATTACH_DECL_NEW(rgephy, sizeof(struct rgephy_softc),
@@ -109,6 +110,7 @@
 rgephy_attach(device_t parent, device_t self, void *aux)
 {
        struct rgephy_softc *rsc = device_private(self);
+       prop_dictionary_t prop = device_properties(self);
        struct mii_softc *sc = &rsc->mii_sc;
        struct mii_attach_args *ma = aux;
        struct mii_data *mii = ma->mii_data;
@@ -136,6 +138,8 @@
 
        sc->mii_funcs = &rgephy_funcs;
 
+       prop_dictionary_get_bool(prop, "no-rx-delay", &rsc->mii_no_rx_delay);
+
 #define        ADD(m, c)       ifmedia_add(&mii->mii_media, (m), (c), NULL)
 #define        PRINT(n)        aprint_normal("%s%s", sep, (n)); sep = ", "
 
@@ -619,6 +623,7 @@
 static void
 rgephy_reset(struct mii_softc *sc)
 {
+       struct rgephy_softc *rsc = (struct rgephy_softc *)sc;
        uint16_t ssr, phycr1;
 
        mii_phy_reset(sc);
@@ -636,10 +641,7 @@
                }
        } else if (sc->mii_mpd_rev == 5) {
                /* RTL8211E */
-               prop_dictionary_t prop = device_properties(sc->mii_dev);
-               bool no_rx_delay = false;
-               prop_dictionary_get_bool(prop, "no-rx-delay", &no_rx_delay);
-               if (no_rx_delay) {
+               if (rsc->mii_no_rx_delay) {
                        /* Disable RX internal delay (undocumented) */
                        PHY_WRITE(sc, 0x1f, 0x0007);
                        PHY_WRITE(sc, 0x1e, 0x00a4);



Home | Main Index | Thread Index | Old Index