Source-Changes-HG archive

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

[src/trunk]: src/sys/dev/ic Change print messages.



details:   https://anonhg.NetBSD.org/src/rev/7f43904ff18a
branches:  trunk
changeset: 749416:7f43904ff18a
user:      kiyohara <kiyohara%NetBSD.org@localhost>
date:      Sun Nov 29 10:06:19 2009 +0000

description:
Change print messages.
  1. Use aprint instead of DPRINTF in swap mode.
  2. Locates and vendor/LSI names 1-line print.
  3. Also print (and maybe support) LAN92xx.

diffstat:

 sys/dev/ic/lan9118.c |  22 +++++++++++++---------
 1 files changed, 13 insertions(+), 9 deletions(-)

diffs (54 lines):

diff -r ff8b67ac9c76 -r 7f43904ff18a sys/dev/ic/lan9118.c
--- a/sys/dev/ic/lan9118.c      Sun Nov 29 09:34:20 2009 +0000
+++ b/sys/dev/ic/lan9118.c      Sun Nov 29 10:06:19 2009 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: lan9118.c,v 1.7 2009/11/29 09:34:20 kiyohara Exp $     */
+/*     $NetBSD: lan9118.c,v 1.8 2009/11/29 10:06:19 kiyohara Exp $     */
 /*
  * Copyright (c) 2008 KIYOHARA Takashi
  * All rights reserved.
@@ -25,7 +25,7 @@
  * POSSIBILITY OF SUCH DAMAGE.
  */
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: lan9118.c,v 1.7 2009/11/29 09:34:20 kiyohara Exp $");
+__KERNEL_RCSID(0, "$NetBSD: lan9118.c,v 1.8 2009/11/29 10:06:19 kiyohara Exp $");
 
 /*
  * The LAN9118 Family
@@ -164,15 +164,13 @@
        uint32_t val;
        int timo, i;
 
-       if (sc->sc_flags & LAN9118_FLAGS_SWAP) {
-               /* need byte swap */
-               DPRINTFN(1, ("%s: need byte swap\n", __func__));
+       if (sc->sc_flags & LAN9118_FLAGS_SWAP)
+               /* byte swap mode */
                bus_space_write_4(sc->sc_iot, sc->sc_ioh, LAN9118_WORD_SWAP,
                    0xffffffff);
-       }
        val = bus_space_read_4(sc->sc_iot, sc->sc_ioh, LAN9118_BYTE_TEST);
        if (val != LAN9118_BYTE_TEST_VALUE) {
-               aprint_error_dev(sc->sc_dev, "failed to detect chip\n");
+               aprint_error(": failed to detect chip\n");
                return EINVAL;
        }
 
@@ -180,8 +178,14 @@
        sc->sc_id = LAN9118_ID_REV_ID(val);
        sc->sc_rev = LAN9118_ID_REV_REV(val);
 
-       aprint_normal_dev(sc->sc_dev, "SMSC LAN9%03x Rev %d\n",
-           sc->sc_id, sc->sc_rev);
+#define LAN9xxx_ID(id) ((id) >= 0x9000 ? (id) & 0xfff : \
+                           ((id) >= 0x1000 ? ((id) >> 4) | 0x100 : (id)))
+
+       aprint_normal(": SMSC LAN9%03x Rev %d\n",
+           LAN9xxx_ID(sc->sc_id), sc->sc_rev);
+
+       if (sc->sc_flags & LAN9118_FLAGS_SWAP)
+               aprint_normal_dev(sc->sc_dev, "byte swap mode\n");
 
        timo = 3 * 1000 * 1000; /* XXXX 3sec */
        do {



Home | Main Index | Thread Index | Old Index