summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrad Smith <brad@cvs.openbsd.org>2014-10-08 22:52:09 +0000
committerBrad Smith <brad@cvs.openbsd.org>2014-10-08 22:52:09 +0000
commitc1b6d733667fe9a712e5dcdc7d87c24126935842 (patch)
treec7b1a0f54f30863a5a8fd9fc8e62012b70c36d15
parent8368fb8fc20bdebc307c27bec43c458639319b82 (diff)
Restrict what RL_MAXRXPKTLEN is being set to for any of the PCIe chipsets.
The driver currently doesn't implement jumbo frames for the newer chipsets and it doesn't make sense allowing for a jumbo frame with a Fast Ethernet chipset either. In theory its possible to do bad things with the driver as is according to the FreeBSD/Linux drivers under the right conditions. ok sthen@
-rw-r--r--sys/dev/ic/re.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/sys/dev/ic/re.c b/sys/dev/ic/re.c
index e2cac4c1a7e..c0d41497873 100644
--- a/sys/dev/ic/re.c
+++ b/sys/dev/ic/re.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: re.c,v 1.157 2014/09/21 16:52:11 jsg Exp $ */
+/* $OpenBSD: re.c,v 1.158 2014/10/08 22:52:08 brad Exp $ */
/* $FreeBSD: if_re.c,v 1.31 2004/09/04 07:54:05 ru Exp $ */
/*
* Copyright (c) 1997, 1998-2003
@@ -1930,8 +1930,12 @@ re_init(struct ifnet *ifp)
* For 8169 gigE NICs, set the max allowed RX packet
* size so we can receive jumbo frames.
*/
- if (sc->sc_hwrev != RL_HWREV_8139CPLUS)
- CSR_WRITE_2(sc, RL_MAXRXPKTLEN, 16383);
+ if (sc->sc_hwrev != RL_HWREV_8139CPLUS) {
+ if (sc->rl_flags & RL_FLAG_PCIE)
+ CSR_WRITE_2(sc, RL_MAXRXPKTLEN, RE_RX_DESC_BUFLEN);
+ else
+ CSR_WRITE_2(sc, RL_MAXRXPKTLEN, 16383);
+ }
mii_mediachg(&sc->sc_mii);