summaryrefslogtreecommitdiff
path: root/sys/dev/pci
diff options
context:
space:
mode:
authorBrad Smith <brad@cvs.openbsd.org>2008-10-21 00:26:41 +0000
committerBrad Smith <brad@cvs.openbsd.org>2008-10-21 00:26:41 +0000
commit9644f460512bc93e9e703a23d993c21bba261cbc (patch)
treebc53e58ea753307bd11494cfb2e3f2d1552360f1 /sys/dev/pci
parent6069b7083974e87c1bf5b56e863c45a6002b7b1f (diff)
Re-add support for RX VLAN tag stripping.
Diffstat (limited to 'sys/dev/pci')
-rw-r--r--sys/dev/pci/if_xge.c20
1 files changed, 15 insertions, 5 deletions
diff --git a/sys/dev/pci/if_xge.c b/sys/dev/pci/if_xge.c
index 94a8656da9d..e074a7eaa4d 100644
--- a/sys/dev/pci/if_xge.c
+++ b/sys/dev/pci/if_xge.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_xge.c,v 1.46 2008/10/16 19:18:03 naddy Exp $ */
+/* $OpenBSD: if_xge.c,v 1.47 2008/10/21 00:26:40 brad Exp $ */
/* $NetBSD: if_xge.c,v 1.1 2005/09/09 10:30:27 ragge Exp $ */
/*
@@ -749,10 +749,12 @@ xge_init(struct ifnet *ifp)
return (1);
}
- /* disable VLAN tag stripping */
- val = PIF_RCSR(RX_PA_CFG);
- val &= ~STRIP_VLAN_TAG;
- PIF_WCSR(RX_PA_CFG, val);
+ if (!(ifp->if_capabilities & IFCAP_VLAN_HWTAGGING)) {
+ /* disable VLAN tag stripping */
+ val = PIF_RCSR(RX_PA_CFG);
+ val &= ~STRIP_VLAN_TAG;
+ PIF_WCSR(RX_PA_CFG, val);
+ }
/* set MRU */
#ifdef XGE_JUMBO
@@ -940,6 +942,14 @@ xge_intr(void *pv)
if (RXD_CTL1_PROTOS(val) & RXD_CTL1_P_UDP)
m->m_pkthdr.csum_flags |= M_UDP_CSUM_IN_OK;
+#if NVLAN > 0
+ if (RXD_CTL1_PROTOS(val) & RXD_CTL1_P_VLAN) {
+ m->m_pkthdr.ether_vtag =
+ RXD_CTL2_VLANTAG(rxd->rxd_control2);
+ m->m_flags |= M_VLANTAG;
+ }
+#endif
+
#if NBPFILTER > 0
if (ifp->if_bpf)
bpf_mtap(ifp->if_bpf, m, BPF_DIRECTION_IN);