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
This commit is contained in:
bouyer 2000-10-20 09:40:26 +00:00
parent 4ab9235edb
commit e999ecae48
1 changed files with 6 additions and 2 deletions

View File

@ -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);