diff options
| author | Doug Ambrisko <ambrisko@FreeBSD.org> | 2002-01-16 16:33:58 +0000 |
|---|---|---|
| committer | Doug Ambrisko <ambrisko@FreeBSD.org> | 2002-01-16 16:33:58 +0000 |
| commit | db40c1aef4eb34d7b0799285feb74211bb332217 (patch) | |
| tree | 3a8de1185c3f8aaadd2f4040ae64d08867ddd590 /sys | |
| parent | ab47d7991399f64e2e8236f3bb9596366849910d (diff) | |
Notes
Diffstat (limited to 'sys')
| -rw-r--r-- | sys/dev/dc/if_dc.c | 38 | ||||
| -rw-r--r-- | sys/pci/if_dc.c | 38 |
2 files changed, 52 insertions, 24 deletions
diff --git a/sys/dev/dc/if_dc.c b/sys/dev/dc/if_dc.c index 6ef8a989180d3..abafb7e5e3c2f 100644 --- a/sys/dev/dc/if_dc.c +++ b/sys/dev/dc/if_dc.c @@ -103,6 +103,8 @@ #include <net/ethernet.h> #include <net/if_dl.h> #include <net/if_media.h> +#include <net/if_types.h> +#include <net/if_vlan_var.h> #include <net/bpf.h> @@ -2130,6 +2132,12 @@ static int dc_attach(dev) * Call MI attach routine. */ ether_ifattach(ifp, ETHER_BPF_SUPPORTED); + + /* + * Tell the upper layer(s) we support long frames. + */ + ifp->if_data.ifi_hdrlen = sizeof(struct ether_vlan_header); + callout_init(&sc->dc_stat_ch, IS_MPSAFE); #ifdef SRM_MEDIA @@ -2505,19 +2513,25 @@ static void dc_rxeof(sc) * If an error occurs, update stats, clear the * status word and leave the mbuf cluster in place: * it should simply get re-used next time this descriptor - * comes up in the ring. + * comes up in the ring. However, don't report long + * frames as errors since they could be vlans */ - if (rxstat & DC_RXSTAT_RXERR) { - ifp->if_ierrors++; - if (rxstat & DC_RXSTAT_COLLSEEN) - ifp->if_collisions++; - dc_newbuf(sc, i, m); - if (rxstat & DC_RXSTAT_CRCERR) { - DC_INC(i, DC_RX_LIST_CNT); - continue; - } else { - dc_init(sc); - return; + if ((rxstat & DC_RXSTAT_RXERR)){ + if (!(rxstat & DC_RXSTAT_GIANT) || + (rxstat & (DC_RXSTAT_CRCERR | DC_RXSTAT_DRIBBLE | + DC_RXSTAT_MIIERE | DC_RXSTAT_COLLSEEN | + DC_RXSTAT_RUNT | DC_RXSTAT_DE))) { + ifp->if_ierrors++; + if (rxstat & DC_RXSTAT_COLLSEEN) + ifp->if_collisions++; + dc_newbuf(sc, i, m); + if (rxstat & DC_RXSTAT_CRCERR) { + DC_INC(i, DC_RX_LIST_CNT); + continue; + } else { + dc_init(sc); + return; + } } } diff --git a/sys/pci/if_dc.c b/sys/pci/if_dc.c index 6ef8a989180d3..abafb7e5e3c2f 100644 --- a/sys/pci/if_dc.c +++ b/sys/pci/if_dc.c @@ -103,6 +103,8 @@ #include <net/ethernet.h> #include <net/if_dl.h> #include <net/if_media.h> +#include <net/if_types.h> +#include <net/if_vlan_var.h> #include <net/bpf.h> @@ -2130,6 +2132,12 @@ static int dc_attach(dev) * Call MI attach routine. */ ether_ifattach(ifp, ETHER_BPF_SUPPORTED); + + /* + * Tell the upper layer(s) we support long frames. + */ + ifp->if_data.ifi_hdrlen = sizeof(struct ether_vlan_header); + callout_init(&sc->dc_stat_ch, IS_MPSAFE); #ifdef SRM_MEDIA @@ -2505,19 +2513,25 @@ static void dc_rxeof(sc) * If an error occurs, update stats, clear the * status word and leave the mbuf cluster in place: * it should simply get re-used next time this descriptor - * comes up in the ring. + * comes up in the ring. However, don't report long + * frames as errors since they could be vlans */ - if (rxstat & DC_RXSTAT_RXERR) { - ifp->if_ierrors++; - if (rxstat & DC_RXSTAT_COLLSEEN) - ifp->if_collisions++; - dc_newbuf(sc, i, m); - if (rxstat & DC_RXSTAT_CRCERR) { - DC_INC(i, DC_RX_LIST_CNT); - continue; - } else { - dc_init(sc); - return; + if ((rxstat & DC_RXSTAT_RXERR)){ + if (!(rxstat & DC_RXSTAT_GIANT) || + (rxstat & (DC_RXSTAT_CRCERR | DC_RXSTAT_DRIBBLE | + DC_RXSTAT_MIIERE | DC_RXSTAT_COLLSEEN | + DC_RXSTAT_RUNT | DC_RXSTAT_DE))) { + ifp->if_ierrors++; + if (rxstat & DC_RXSTAT_COLLSEEN) + ifp->if_collisions++; + dc_newbuf(sc, i, m); + if (rxstat & DC_RXSTAT_CRCERR) { + DC_INC(i, DC_RX_LIST_CNT); + continue; + } else { + dc_init(sc); + return; + } } } |
