Module Name: src Committed By: kiyohara Date: Wed Dec 2 12:51:50 UTC 2009
Modified Files: src/sys/dev/ic: lan9118.c lan9118reg.h Log Message: Maybe supported LAN9218 Family. To generate a diff of this commit: cvs rdiff -u -r1.9 -r1.10 src/sys/dev/ic/lan9118.c cvs rdiff -u -r1.1 -r1.2 src/sys/dev/ic/lan9118reg.h 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.9 src/sys/dev/ic/lan9118.c:1.10 --- src/sys/dev/ic/lan9118.c:1.9 Sun Nov 29 10:17:01 2009 +++ src/sys/dev/ic/lan9118.c Wed Dec 2 12:51:50 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: lan9118.c,v 1.9 2009/11/29 10:17:01 kiyohara Exp $ */ +/* $NetBSD: lan9118.c,v 1.10 2009/12/02 12:51:50 kiyohara Exp $ */ /* * Copyright (c) 2008 KIYOHARA Takashi * All rights reserved. @@ -25,11 +25,10 @@ * POSSIBILITY OF SUCH DAMAGE. */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: lan9118.c,v 1.9 2009/11/29 10:17:01 kiyohara Exp $"); +__KERNEL_RCSID(0, "$NetBSD: lan9118.c,v 1.10 2009/12/02 12:51:50 kiyohara Exp $"); /* * The LAN9118 Family - * * * The LAN9118 is targeted for 32-bit applications requiring high * performance, and provides the highest level of performance possible for * a non-PCI 10/100 Ethernet controller. @@ -43,6 +42,9 @@ * is for 32-bit host processors, while the LAN9115 is for 16-bit * applications, which may also require an external PHY. Both devices * deliver superior levels of performance. + * + * The LAN9218 Family + * Also support HP Auto-MDIX. */ #include "bpfilter.h" @@ -178,8 +180,8 @@ sc->sc_id = LAN9118_ID_REV_ID(val); sc->sc_rev = LAN9118_ID_REV_REV(val); -#define LAN9xxx_ID(id) ((id) >= 0x9000 ? (id) & 0xfff : \ - ((id) >= 0x1000 ? ((id) >> 4) + 0x100 : (id))) +#define LAN9xxx_ID(id) \ + (IS_LAN9118(id) ? (id) : (IS_LAN9218(id) ? ((id) >> 4) + 0x100 : (id) & 0xfff)) aprint_normal(": SMSC LAN9%03x Rev %d\n", LAN9xxx_ID(sc->sc_id), sc->sc_rev); @@ -236,7 +238,8 @@ * number that above. */ sc->sc_mii.mii_instance++; - if (sc->sc_id == LAN9118_ID_9115 || sc->sc_id == LAN9118_ID_9117) { + if (sc->sc_id == LAN9118_ID_9115 || sc->sc_id == LAN9118_ID_9117 || + sc->sc_id == LAN9218_ID_9215 || sc->sc_id == LAN9218_ID_9217) { if (bus_space_read_4(sc->sc_iot, sc->sc_ioh, LAN9118_HW_CFG) & LAN9118_HW_CFG_EXT_PHY_DET) { /* Index: src/sys/dev/ic/lan9118reg.h diff -u src/sys/dev/ic/lan9118reg.h:1.1 src/sys/dev/ic/lan9118reg.h:1.2 --- src/sys/dev/ic/lan9118reg.h:1.1 Sun Aug 9 06:40:10 2009 +++ src/sys/dev/ic/lan9118reg.h Wed Dec 2 12:51:50 2009 @@ -1,4 +1,4 @@ -/* $NetBSD: lan9118reg.h,v 1.1 2009/08/09 06:40:10 kiyohara Exp $ */ +/* $NetBSD: lan9118reg.h,v 1.2 2009/12/02 12:51:50 kiyohara Exp $ */ /* * Copyright (c) 2008 KIYOHARA Takashi * All rights reserved. @@ -30,10 +30,16 @@ #define LAN9118_IOSIZE 0x100 -#define LAN9118_ID_9115 0x115 -#define LAN9118_ID_9116 0x116 -#define LAN9118_ID_9117 0x117 -#define LAN9118_ID_9118 0x118 +#define LAN9118_ID_9115 0x0115 +#define LAN9118_ID_9116 0x0116 +#define LAN9118_ID_9117 0x0117 +#define LAN9118_ID_9118 0x0118 +#define LAN9218_ID_9215 0x115a +#define LAN9218_ID_9217 0x117a +#define LAN9218_ID_9218 0x118a + +#define IS_LAN9118(id) ((id) >= LAN9118_ID_9115 && (id) <= LAN9118_ID_9118) +#define IS_LAN9218(id) ((id) >= LAN9218_ID_9215 && (id) <= LAN9218_ID_9218) #define LAN9118_IPHY_ADDR 0x01 /* Internal PHY Address */