summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbrad <brad@openbsd.org>2014-10-08 22:52:08 +0000
committerbrad <brad@openbsd.org>2014-10-08 22:52:08 +0000
commit1bb2278d868c39bf03ede80660df411ceca0c110 (patch)
tree422eb74714beafd529ef974126c164f0f06ae05b
parentonly call Debugger() #ifdef DDB (diff)
downloadwireguard-openbsd-1bb2278d868c39bf03ede80660df411ceca0c110.tar.xz
wireguard-openbsd-1bb2278d868c39bf03ede80660df411ceca0c110.zip
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);