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.
This commit is contained in:
kiyohara 2009-11-29 10:06:19 +00:00
parent 171390a416
commit 5a4eb24b7c
1 changed files with 13 additions and 9 deletions

View File

@ -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 @@ lan9118_attach(struct lan9118_softc *sc)
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 @@ lan9118_attach(struct lan9118_softc *sc)
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 {