Add support for "RealTek 8102EL PCIe 10/100baseTX". Checksum support
authorMatthew Dillon <dillon@dragonflybsd.org>
Mon, 29 Sep 2008 20:27:38 +0000 (20:27 +0000)
committerMatthew Dillon <dillon@dragonflybsd.org>
Mon, 29 Sep 2008 20:27:38 +0000 (20:27 +0000)
doesn't work yet for this card so disable hardware checksumming.

Submitted-by: "Mitja Horvat" <pinkfluid@gmail.com>
sys/dev/netif/re/if_re.c
sys/dev/netif/re/if_rereg.h

index 597648c..c5d0cd8 100644 (file)
@@ -33,7 +33,7 @@
  * THE POSSIBILITY OF SUCH DAMAGE.
  *
  * $FreeBSD: src/sys/dev/re/if_re.c,v 1.25 2004/06/09 14:34:01 naddy Exp $
- * $DragonFly: src/sys/dev/netif/re/if_re.c,v 1.50 2008/09/17 08:51:29 sephe Exp $
+ * $DragonFly: src/sys/dev/netif/re/if_re.c,v 1.51 2008/09/29 20:27:38 dillon Exp $
  */
 
 /*
@@ -165,6 +165,8 @@ static const struct re_type re_devs[] = {
                "RealTek 8139C+ 10/100BaseTX" },
        { PCI_VENDOR_REALTEK, PCI_PRODUCT_REALTEK_RT8101E, RE_HWREV_8101E,
                "RealTek 8101E PCIe 10/100baseTX" },
+       { PCI_VENDOR_REALTEK, PCI_PRODUCT_REALTEK_RT8101E, RE_HWREV_8102EL,
+               "RealTek 8102EL PCIe 10/100baseTX" },
        { PCI_VENDOR_REALTEK, PCI_PRODUCT_REALTEK_RT8168, RE_HWREV_8168_SPIN1,
                "RealTek 8168/8111B PCIe Gigabit Ethernet" },
        { PCI_VENDOR_REALTEK, PCI_PRODUCT_REALTEK_RT8168, RE_HWREV_8168_SPIN2,
@@ -207,6 +209,7 @@ static const struct re_hwrev re_hwrevs[] = {
        { RE_HWREV_8169_8110SC, RE_8169,        0,              "8169SC" },
        { RE_HWREV_8100E,       RE_8169,        RE_F_HASMPC,    "8100E" },
        { RE_HWREV_8101E,       RE_8169,        RE_F_PCIE,      "8101E" },
+       { RE_HWREV_8102EL,      RE_8169,        RE_F_PCIE,      "8102EL" },
        { 0, 0, 0, NULL }
 };
 
@@ -1226,8 +1229,20 @@ re_attach(device_t dev)
        ifp->if_ioctl = re_ioctl;
        ifp->if_start = re_start;
        ifp->if_capabilities = IFCAP_VLAN_MTU | IFCAP_VLAN_HWTAGGING;
-       if (hwrev != RE_HWREV_8168C)    /* XXX does not work yet */
+
+       switch (hwrev) {
+       case RE_HWREV_8168C:
+       case RE_HWREV_8102EL:
+               /*
+                * XXX Hardware checksum does not work yet on 8168C
+                * and 8102EL. Disble it.
+                */
+               ifp->if_capabilities &= ~IFCAP_HWCSUM;
+               break;
+       default:
                ifp->if_capabilities |= IFCAP_HWCSUM;
+               break;
+       }
 #ifdef DEVICE_POLLING
        ifp->if_poll = re_poll;
 #endif
index 7c76e1a..5cc1abe 100644 (file)
@@ -33,7 +33,7 @@
  * THE POSSIBILITY OF SUCH DAMAGE.
  *
  * $FreeBSD: src/sys/pci/if_rlreg.h,v 1.42 2004/05/24 19:39:23 jhb Exp $
- * $DragonFly: src/sys/dev/netif/re/if_rereg.h,v 1.9 2008/04/27 15:10:37 sephe Exp $
+ * $DragonFly: src/sys/dev/netif/re/if_rereg.h,v 1.10 2008/09/29 20:27:38 dillon Exp $
  */
 
 /*
 #define RE_HWREV_8168_SPIN1    0x30000000
 #define RE_HWREV_8100E         0x30800000
 #define RE_HWREV_8101E         0x34000000
+#define RE_HWREV_8102EL                0x24800000
 #define RE_HWREV_8168_SPIN2    0x38000000
 #define RE_HWREV_8168_SPIN3    0x38400000
 #define RE_HWREV_8168C         0x3c000000