summaryrefslogtreecommitdiff
path: root/sys/dev/ic
diff options
context:
space:
mode:
authortnn <tnn@NetBSD.org>2008-08-23 14:27:45 +0000
committertnn <tnn@NetBSD.org>2008-08-23 14:27:45 +0000
commit7ebba3a956bd6fd7fac6d6c4e5abf3f50833f58b (patch)
tree55594bffae88681961bce3a06b76763b9b0cf3ff /sys/dev/ic
parent3f702666e5217123987cfd53fd34321c5a080cac (diff)
Add support for the Realtek 8102E/8102EL PCIe 10/100 Ethernet devices.
From FreeBSD.
Diffstat (limited to 'sys/dev/ic')
-rw-r--r--sys/dev/ic/rtl8169.c19
-rw-r--r--sys/dev/ic/rtl81x9reg.h4
2 files changed, 19 insertions, 4 deletions
diff --git a/sys/dev/ic/rtl8169.c b/sys/dev/ic/rtl8169.c
index 22ee8748499..3590997a6f8 100644
--- a/sys/dev/ic/rtl8169.c
+++ b/sys/dev/ic/rtl8169.c
@@ -1,4 +1,4 @@
-/* $NetBSD: rtl8169.c,v 1.104 2008/05/06 11:45:00 tsutsui Exp $ */
+/* $NetBSD: rtl8169.c,v 1.105 2008/08/23 14:27:45 tnn Exp $ */
/*
* Copyright (c) 1997, 1998-2003
@@ -33,7 +33,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: rtl8169.c,v 1.104 2008/05/06 11:45:00 tsutsui Exp $");
+__KERNEL_RCSID(0, "$NetBSD: rtl8169.c,v 1.105 2008/08/23 14:27:45 tnn Exp $");
/* $FreeBSD: /repoman/r/ncvs/src/sys/dev/re/if_re.c,v 1.20 2004/04/11 20:34:08 ru Exp $ */
/*
@@ -607,6 +607,10 @@ re_attach(struct rtk_softc *sc)
case RTK_HWREV_8168C:
sc->sc_rev = 24;
break;
+ case RTK_HWREV_8102E:
+ case RTK_HWREV_8102EL:
+ sc->sc_rev = 25;
+ break;
case RTK_HWREV_8100E:
case RTK_HWREV_8100E_SPIN2:
/* XXX not in the Realtek driver */
@@ -627,7 +631,7 @@ re_attach(struct rtk_softc *sc)
sc->re_ldata.re_tx_desc_cnt = RE_TX_DESC_CNT_8139;
}
- if (sc->sc_rev == 24) {
+ if (sc->sc_rev == 24 || sc->sc_rev == 25) {
/*
* Get station address from ID registers.
*/
@@ -1855,6 +1859,15 @@ re_ioctl(struct ifnet *ifp, u_long command, void *data)
switch (command) {
case SIOCSIFMTU:
+ /*
+ * According to FreeBSD, 8102E/8102EL use a different DMA
+ * descriptor format. Disable jumbo frames for those parts.
+ */
+ if (sc->sc_rev == 25 && ifr->ifr_mtu > ETHERMTU) {
+ error = EINVAL;
+ break;
+ }
+
if (ifr->ifr_mtu < ETHERMIN || ifr->ifr_mtu > ETHERMTU_JUMBO)
error = EINVAL;
else if ((error = ifioctl_common(ifp, command, data)) ==
diff --git a/sys/dev/ic/rtl81x9reg.h b/sys/dev/ic/rtl81x9reg.h
index fe24f8799af..1cc014720f0 100644
--- a/sys/dev/ic/rtl81x9reg.h
+++ b/sys/dev/ic/rtl81x9reg.h
@@ -1,4 +1,4 @@
-/* $NetBSD: rtl81x9reg.h,v 1.31 2008/05/06 11:45:00 tsutsui Exp $ */
+/* $NetBSD: rtl81x9reg.h,v 1.32 2008/08/23 14:27:45 tnn Exp $ */
/*
* Copyright (c) 1997, 1998
@@ -157,9 +157,11 @@
#define RTK_HWREV_8169S 0x04000000
#define RTK_HWREV_8169_8110SB 0x10000000
#define RTK_HWREV_8169_8110SC 0x18000000
+#define RTK_HWREV_8102EL 0x24800000
#define RTK_HWREV_8168_SPIN1 0x30000000
#define RTK_HWREV_8100E 0x30800000
#define RTK_HWREV_8101E 0x34000000
+#define RTK_HWREV_8102E 0x34800000
#define RTK_HWREV_8168_SPIN2 0x38000000
#define RTK_HWREV_8168_SPIN3 0x38400000
#define RTK_HWREV_8100E_SPIN2 0x38800000