summaryrefslogtreecommitdiff
path: root/sys/dev/pci
diff options
context:
space:
mode:
authorStuart Henderson <sthen@cvs.openbsd.org>2013-02-09 19:17:53 +0000
committerStuart Henderson <sthen@cvs.openbsd.org>2013-02-09 19:17:53 +0000
commit0fc3e59227c0d960cbfc3acabd9192d72c3c952a (patch)
tree59ba9c99f928efacc3370e8c41b92839372ae69e /sys/dev/pci
parent0d46cf1d0d8e9ffbf81bb057a3667ffe672ea266 (diff)
Programme the VT6105M, VT6105 and RhineII-2 to permit frames of up to
1758 bytes (MTU 1740) and raise hardmtu to allow the user to set them. Tests by Mark Patruck, Michal Markowski, mikeb, beck, dtucker. ok mikeb@
Diffstat (limited to 'sys/dev/pci')
-rw-r--r--sys/dev/pci/if_vr.c18
-rw-r--r--sys/dev/pci/if_vrreg.h4
2 files changed, 16 insertions, 6 deletions
diff --git a/sys/dev/pci/if_vr.c b/sys/dev/pci/if_vr.c
index 35c484b7ce5..612fb373c1e 100644
--- a/sys/dev/pci/if_vr.c
+++ b/sys/dev/pci/if_vr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_vr.c,v 1.126 2013/01/28 02:57:02 dtucker Exp $ */
+/* $OpenBSD: if_vr.c,v 1.127 2013/02/09 19:17:52 sthen Exp $ */
/*
* Copyright (c) 1997, 1998
@@ -164,6 +164,7 @@ int vr_alloc_mbuf(struct vr_softc *, struct vr_chain_onefrag *);
#define VR_Q_CAM (1<<2)
#define VR_Q_HWTAG (1<<3)
#define VR_Q_INTDISABLE (1<<4)
+#define VR_Q_BABYJUMBO (1<<5) /* others may work too */
struct vr_type {
pci_vendor_id_t vr_vid;
@@ -175,11 +176,12 @@ struct vr_type {
{ PCI_VENDOR_VIATECH, PCI_PRODUCT_VIATECH_RHINEII,
VR_Q_NEEDALIGN },
{ PCI_VENDOR_VIATECH, PCI_PRODUCT_VIATECH_RHINEII_2,
- 0 },
+ VR_Q_BABYJUMBO },
{ PCI_VENDOR_VIATECH, PCI_PRODUCT_VIATECH_VT6105,
- 0 },
+ VR_Q_BABYJUMBO },
{ PCI_VENDOR_VIATECH, PCI_PRODUCT_VIATECH_VT6105M,
- VR_Q_CSUM | VR_Q_CAM | VR_Q_HWTAG | VR_Q_INTDISABLE },
+ VR_Q_CSUM | VR_Q_CAM | VR_Q_HWTAG | VR_Q_INTDISABLE |
+ VR_Q_BABYJUMBO },
{ PCI_VENDOR_DELTA, PCI_PRODUCT_DELTA_RHINEII,
VR_Q_NEEDALIGN },
{ PCI_VENDOR_ADDTRON, PCI_PRODUCT_ADDTRON_RHINEII,
@@ -630,6 +632,9 @@ vr_attach(struct device *parent, struct device *self, void *aux)
ifp->if_ioctl = vr_ioctl;
ifp->if_start = vr_start;
ifp->if_watchdog = vr_watchdog;
+ if (sc->vr_quirks & VR_Q_BABYJUMBO)
+ ifp->if_hardmtu = VR_RXLEN_BABYJUMBO -
+ ETHER_HDR_LEN - ETHER_CRC_LEN;
IFQ_SET_READY(&ifp->if_snd);
bcopy(sc->sc_dev.dv_xname, ifp->if_xname, IFNAMSIZ);
@@ -1745,7 +1750,10 @@ vr_alloc_mbuf(struct vr_softc *sc, struct vr_chain_onefrag *r)
r->vr_mbuf = m;
d = r->vr_ptr;
d->vr_data = htole32(r->vr_map->dm_segs[0].ds_addr);
- d->vr_ctl = htole32(VR_RXCTL | VR_RXLEN);
+ if (sc->vr_quirks & VR_Q_BABYJUMBO)
+ d->vr_ctl = htole32(VR_RXCTL | VR_RXLEN_BABYJUMBO);
+ else
+ d->vr_ctl = htole32(VR_RXCTL | VR_RXLEN);
bus_dmamap_sync(sc->sc_dmat, sc->sc_listmap.vrm_map, 0,
sc->sc_listmap.vrm_map->dm_mapsize, BUS_DMASYNC_PREWRITE);
diff --git a/sys/dev/pci/if_vrreg.h b/sys/dev/pci/if_vrreg.h
index 0b5afb366ee..d46638868cc 100644
--- a/sys/dev/pci/if_vrreg.h
+++ b/sys/dev/pci/if_vrreg.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_vrreg.h,v 1.34 2013/01/28 02:57:02 dtucker Exp $ */
+/* $OpenBSD: if_vrreg.h,v 1.35 2013/02/09 19:17:52 sthen Exp $ */
/*
* Copyright (c) 1997, 1998
@@ -437,6 +437,8 @@ struct vr_desc {
#define VR_TX_LIST_CNT 128
#define VR_MIN_FRAMELEN 60
#define VR_RXLEN 1524
+/* determined experimentally; seems intermittent with higher values */
+#define VR_RXLEN_BABYJUMBO 1758
#define VR_TX_INTR_THRESH 8
struct vr_list_data {