aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/dc
diff options
context:
space:
mode:
Diffstat (limited to 'sys/dev/dc')
-rw-r--r--sys/dev/dc/if_dc.c38
1 files changed, 26 insertions, 12 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;
+ }
}
}