Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/dev/ic Maybe supported LAN9218 Family.
details: https://anonhg.NetBSD.org/src/rev/5468bd2a1e36
branches: trunk
changeset: 749551:5468bd2a1e36
user: kiyohara <kiyohara%NetBSD.org@localhost>
date: Wed Dec 02 12:51:50 2009 +0000
description:
Maybe supported LAN9218 Family.
diffstat:
sys/dev/ic/lan9118.c | 15 +++++++++------
sys/dev/ic/lan9118reg.h | 16 +++++++++++-----
2 files changed, 20 insertions(+), 11 deletions(-)
diffs (83 lines):
diff -r 84b01b4c72a8 -r 5468bd2a1e36 sys/dev/ic/lan9118.c
--- a/sys/dev/ic/lan9118.c Wed Dec 02 12:50:27 2009 +0000
+++ b/sys/dev/ic/lan9118.c Wed Dec 02 12:51:50 2009 +0000
@@ -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) {
/*
diff -r 84b01b4c72a8 -r 5468bd2a1e36 sys/dev/ic/lan9118reg.h
--- a/sys/dev/ic/lan9118reg.h Wed Dec 02 12:50:27 2009 +0000
+++ b/sys/dev/ic/lan9118reg.h Wed Dec 02 12:51:50 2009 +0000
@@ -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 */
Home |
Main Index |
Thread Index |
Old Index