summaryrefslogtreecommitdiff
path: root/sys/dev/pci/if_san_xilinx.c
diff options
context:
space:
mode:
authorChristian Weisgerber <naddy@cvs.openbsd.org>2008-09-18 15:16:31 +0000
committerChristian Weisgerber <naddy@cvs.openbsd.org>2008-09-18 15:16:31 +0000
commit5eab433266681d6216c8e05ad5786344f11779c3 (patch)
tree9dfd93a6804acadebfb92a46d8dcdd141d2b3dd4 /sys/dev/pci/if_san_xilinx.c
parent80e73464cddea0a649b4991ab2b43d25504d8f4f (diff)
Introduce the infrastructure required to support hardware VLAN tag
stripping: Add a field to the mbuf pkthdr to hold the tag and an mbuf flag that tells if the tag is valid. Inspired by FreeBSD. Struct packing suggested by kettenis@. csum_flags is now 16 bits. Adapt to this in the drivers. ok reyk@, henning@
Diffstat (limited to 'sys/dev/pci/if_san_xilinx.c')
-rw-r--r--sys/dev/pci/if_san_xilinx.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/sys/dev/pci/if_san_xilinx.c b/sys/dev/pci/if_san_xilinx.c
index 4a4f7e87665..bc0df31f743 100644
--- a/sys/dev/pci/if_san_xilinx.c
+++ b/sys/dev/pci/if_san_xilinx.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_san_xilinx.c,v 1.22 2008/09/10 14:01:22 blambert Exp $ */
+/* $OpenBSD: if_san_xilinx.c,v 1.23 2008/09/18 15:16:30 naddy Exp $ */
/*-
* Copyright (c) 2001-2004 Sangoma Technologies (SAN)
@@ -1977,7 +1977,8 @@ xilinx_dma_tx_complete(sdla_t *card, xilinx_softc_t *sc)
}
sc->pci_retry = 0;
- sc->tx_dma_mbuf->m_pkthdr.csum_flags = reg;
+ sc->tx_dma_mbuf->m_pkthdr.csum_flags = reg & 0xFFFF;
+ sc->tx_dma_mbuf->m_pkthdr.ether_vtag = (reg >> 16) & 0xFFFF;
IF_ENQUEUE(&sc->wp_tx_complete_list, sc->tx_dma_mbuf);
sc->tx_dma_mbuf = NULL;
@@ -1990,9 +1991,10 @@ static void
xilinx_tx_post_complete(sdla_t *card, xilinx_softc_t *sc, struct mbuf *m)
{
struct ifnet *ifp;
- unsigned long reg = m->m_pkthdr.csum_flags;
+ u_int32_t reg;
WAN_ASSERT1(sc == NULL);
+ reg = (m->m_pkthdr.ether_vtag << 16) + m->m_pkthdr.csum_flags;
ifp = (struct ifnet *)&sc->common.ifp;
if ((bit_test((u_int8_t *)&reg, TxDMA_HI_DMA_GO_READY_BIT)) ||
(reg & TxDMA_HI_DMA_DATA_LENGTH_MASK) ||