summaryrefslogtreecommitdiffstats
path: root/sys/dev/ic/hme.c
diff options
context:
space:
mode:
authorjason <jason@openbsd.org>2001-09-23 20:03:01 +0000
committerjason <jason@openbsd.org>2001-09-23 20:03:01 +0000
commit8bea5f3a2eeb47333757d4073fa314edd8469bb4 (patch)
tree49a5d069ea08010dea0b314ee66a8fa8f89de57d /sys/dev/ic/hme.c
parentrelax permission check for private key files. (diff)
downloadwireguard-openbsd-8bea5f3a2eeb47333757d4073fa314edd8469bb4.tar.xz
wireguard-openbsd-8bea5f3a2eeb47333757d4073fa314edd8469bb4.zip
solve mtu problem a little more elegantly (ramdisk works on blade100 and
u5 now).
Diffstat (limited to 'sys/dev/ic/hme.c')
-rw-r--r--sys/dev/ic/hme.c29
1 files changed, 7 insertions, 22 deletions
diff --git a/sys/dev/ic/hme.c b/sys/dev/ic/hme.c
index 651a6e8c8ca..44c5a83061b 100644
--- a/sys/dev/ic/hme.c
+++ b/sys/dev/ic/hme.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: hme.c,v 1.5 2001/09/20 17:58:33 jason Exp $ */
+/* $OpenBSD: hme.c,v 1.6 2001/09/23 20:03:01 jason Exp $ */
/* $NetBSD: hme.c,v 1.21 2001/07/07 15:59:37 thorpej Exp $ */
/*-
@@ -84,13 +84,13 @@
#include <machine/bus.h>
-#include <dev/ic/hmereg.h>
-#include <dev/ic/hmevar.h>
-
#if NVLAN > 0
#include <net/if_vlan_var.h>
#endif
+#include <dev/ic/hmereg.h>
+#include <dev/ic/hmevar.h>
+
struct cfdriver hme_cd = {
NULL, "hme", DV_IFNET
};
@@ -495,12 +495,7 @@ hme_init(sc)
bus_space_write_4(t, mac, HME_MACI_FCCNT, 0);
bus_space_write_4(t, mac, HME_MACI_EXCNT, 0);
bus_space_write_4(t, mac, HME_MACI_LTCNT, 0);
- v = ETHERMTU + sizeof(struct ether_header) +
-#if NVLAN > 0
- EVL_ENCAPLEN +
-#endif
- 0;
- bus_space_write_4(t, mac, HME_MACI_TXSIZE, v);
+ bus_space_write_4(t, mac, HME_MACI_TXSIZE, HME_MTU);
/* Load station MAC address */
ea = sc->sc_enaddr;
@@ -527,12 +522,7 @@ hme_init(sc)
bus_space_write_4(t, etx, HME_ETXI_RSIZE, sc->sc_rb.rb_ntbuf);
bus_space_write_4(t, erx, HME_ERXI_RING, sc->sc_rb.rb_rxddma);
- v = ETHERMTU + sizeof(struct ether_header) +
-#if NVLAN > 0
- EVL_ENCAPLEN +
-#endif
- 0;
- bus_space_write_4(t, mac, HME_MACI_RXSIZE, v);
+ bus_space_write_4(t, mac, HME_MACI_RXSIZE, HME_MTU);
/* step 8. Global Configuration & Interrupt Mask */
bus_space_write_4(t, seb, HME_SEBI_IMASK,
@@ -737,12 +727,7 @@ hme_read(sc, ix, len)
struct mbuf *m;
if (len <= sizeof(struct ether_header) ||
- (len > ETHERMTU + sizeof(struct ether_header) +
-#if NVLAN > 1
- EVL_ENCAPLEN +
-#endif
- 0
- )) {
+ (len > HME_MTU)) {
#ifdef HMEDEBUG
printf("%s: invalid packet size %d; dropping\n",
sc->sc_dev.dv_xname, len);