summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorchris <chris@openbsd.org>2001-08-03 23:28:49 +0000
committerchris <chris@openbsd.org>2001-08-03 23:28:49 +0000
commit33dc67926a6350776ae3ed11c6e467ad1f72d166 (patch)
tree23f5acaab612911e39fcc2c21f6edc58e724bd4d
parentSet IFCAP_VLAN_MTU, the Realtek chip does not discard/truncate large frames. (diff)
downloadwireguard-openbsd-33dc67926a6350776ae3ed11c6e467ad1f72d166.tar.xz
wireguard-openbsd-33dc67926a6350776ae3ed11c6e467ad1f72d166.zip
Fix logic for detecting 82558 and newer chips in pci;
This driver allows large frames for those chips so set IFCAP_VLAN_MTU for 82558+
-rw-r--r--sys/dev/ic/fxp.c11
-rw-r--r--sys/dev/pci/if_fxp_pci.c10
2 files changed, 18 insertions, 3 deletions
diff --git a/sys/dev/ic/fxp.c b/sys/dev/ic/fxp.c
index 39a250acd4b..7b022c0e36f 100644
--- a/sys/dev/ic/fxp.c
+++ b/sys/dev/ic/fxp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: fxp.c,v 1.21 2001/07/18 19:32:01 mickey Exp $ */
+/* $OpenBSD: fxp.c,v 1.22 2001/08/03 23:28:49 chris Exp $ */
/* $NetBSD: if_fxp.c,v 1.2 1997/06/05 02:01:55 thorpej Exp $ */
/*
@@ -38,6 +38,7 @@
*/
#include "bpfilter.h"
+#include "vlan.h"
#include <sys/param.h>
#include <sys/systm.h>
@@ -365,6 +366,14 @@ fxp_attach_common(sc, enaddr, intrstr)
ifp->if_watchdog = fxp_watchdog;
IFQ_SET_READY(&ifp->if_snd);
+#if NVLAN > 0
+ if (sc->not_82557)
+ ifp->if_capabilities |= IFCAP_VLAN_MTU;
+ /*
+ * Only 82558 and newer cards have a bit to ignore oversized frames.
+ */
+#endif
+
printf(": %s, address %s\n", intrstr,
ether_sprintf(sc->arpcom.ac_enaddr));
diff --git a/sys/dev/pci/if_fxp_pci.c b/sys/dev/pci/if_fxp_pci.c
index 68ad759e4c1..f363ea7de19 100644
--- a/sys/dev/pci/if_fxp_pci.c
+++ b/sys/dev/pci/if_fxp_pci.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_fxp_pci.c,v 1.6 2001/06/13 23:19:16 jason Exp $ */
+/* $OpenBSD: if_fxp_pci.c,v 1.7 2001/08/03 23:28:49 chris Exp $ */
/*
* Copyright (c) 1995, David Greenman
@@ -161,9 +161,12 @@ fxp_pci_attach(parent, self, aux)
switch (PCI_PRODUCT(pa->pa_id)) {
case PCI_PRODUCT_INTEL_82562:
sc->sc_flags |= FXPF_HAS_RESUME_BUG;
+ /* FALLTHROUGH */
+ case PCI_PRODUCT_INTEL_82559:
+ case PCI_PRODUCT_INTEL_82559ER:
sc->not_82557 = 1;
break;
- default:
+ case PCI_PRODUCT_INTEL_82557:
/*
* revisions
* 2 = 82557
@@ -172,6 +175,9 @@ fxp_pci_attach(parent, self, aux)
*/
sc->not_82557 = (rev >= 4) ? 1 : 0;
break;
+ default:
+ sc->not_82557 = 0;
+ break;
}
/* Do generic parts of attach. */