From e999ecae48d22c4037fe6367d5fe8f011f899172 Mon Sep 17 00:00:00 2001 From: bouyer Date: Fri, 20 Oct 2000 09:40:26 +0000 Subject: [PATCH] Support ETHERCAP_VLAN_MTU. Tested on a sparc 2 with: le0 at sbus0 slot 0 offset 0xc00000 level 5: address 00:00:3b:86:19:92 le0: 8 receive buffers, 2 transmit buffers --- sys/dev/ic/lance.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/sys/dev/ic/lance.c b/sys/dev/ic/lance.c index 27c93a08fc04..7db1dc9deee6 100644 --- a/sys/dev/ic/lance.c +++ b/sys/dev/ic/lance.c @@ -1,4 +1,4 @@ -/* $NetBSD: lance.c,v 1.13 2000/10/01 23:32:42 thorpej Exp $ */ +/* $NetBSD: lance.c,v 1.14 2000/10/20 09:40:26 bouyer Exp $ */ /*- * Copyright (c) 1997, 1998 The NetBSD Foundation, Inc. @@ -272,6 +272,8 @@ lance_config(sc) printf("%s: %d receive buffers, %d transmit buffers\n", sc->sc_dev.dv_xname, sc->sc_nrbuf, sc->sc_ntbuf); + /* claim 802.1q capability */ + sc->sc_ethercom.ec_capabilities |= ETHERCAP_VLAN_MTU; /* Attach the interface. */ if_attach(ifp); ether_ifattach(ifp, sc->sc_enaddr); @@ -467,7 +469,9 @@ lance_read(sc, boff, len) struct mbuf *m; if (len <= sizeof(struct ether_header) || - len > ETHERMTU + sizeof(struct ether_header)) { + len > ((sc->sc_ethercom.ec_capenable & ETHERCAP_VLAN_MTU) ? + ETHER_VLAN_ENCAP_LEN + ETHERMTU + sizeof(struct ether_header) : + ETHERMTU + sizeof(struct ether_header))) { #ifdef LEDEBUG printf("%s: invalid packet size %d; dropping\n", sc->sc_dev.dv_xname, len);