Module Name: src
Committed By: kiyohara
Date: Sun Nov 29 10:06:19 UTC 2009
Modified Files:
src/sys/dev/ic: lan9118.c
Log Message:
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.
To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/sys/dev/ic/lan9118.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/sys/dev/ic/lan9118.c
diff -u src/sys/dev/ic/lan9118.c:1.7 src/sys/dev/ic/lan9118.c:1.8
--- src/sys/dev/ic/lan9118.c:1.7 Sun Nov 29 09:34:20 2009
+++ src/sys/dev/ic/lan9118.c Sun Nov 29 10:06:19 2009
@@ -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 {