From bd4e71e6bed07a52899e9b2eb7b4088e57f0a007 Mon Sep 17 00:00:00 2001 From: Christian Weisgerber Date: Thu, 16 Oct 2008 19:16:22 +0000 Subject: Convert RX tag stripping to storing the tag in the mbuf header and enable RX tag stripping for re(4). ok brad@ --- sys/dev/ic/re.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'sys/dev/ic/re.c') diff --git a/sys/dev/ic/re.c b/sys/dev/ic/re.c index c1b54c09189..35520604f42 100644 --- a/sys/dev/ic/re.c +++ b/sys/dev/ic/re.c @@ -1,4 +1,4 @@ -/* $OpenBSD: re.c,v 1.94 2008/10/11 23:49:05 brad Exp $ */ +/* $OpenBSD: re.c,v 1.95 2008/10/16 19:16:21 naddy Exp $ */ /* $FreeBSD: if_re.c,v 1.31 2004/09/04 07:54:05 ru Exp $ */ /* * Copyright (c) 1997, 1998-2003 @@ -1461,6 +1461,13 @@ re_rxeof(struct rl_softc *sc) m->m_pkthdr.csum_flags |= M_TCP_CSUM_IN_OK | M_UDP_CSUM_IN_OK; } +#if NVLAN > 0 + if (rxvlan & RL_RDESC_VLANCTL_TAG) { + m->m_pkthdr.ether_vtag = + ntohs((rxvlan & RL_RDESC_VLANCTL_DATA)); + m->m_flags |= M_VLANTAG; + } +#endif #if NBPFILTER > 0 if (ifp->if_bpf) @@ -1917,6 +1924,8 @@ re_init(struct ifnet *ifp) cfg = RL_CPLUSCMD_PCI_MRW; if (ifp->if_capabilities & IFCAP_CSUM_IPv4) cfg |= RL_CPLUSCMD_RXCSUM_ENB; + if (ifp->if_capabilities & IFCAP_VLAN_HWTAGGING) + cfg |= RL_CPLUSCMD_VLANSTRIP; if (sc->rl_flags & RL_FLAG_MACSTAT) { cfg |= RL_CPLUSCMD_MACSTAT_DIS; /* XXX magic. */ -- cgit v1.2.3