From 5eab433266681d6216c8e05ad5786344f11779c3 Mon Sep 17 00:00:00 2001 From: Christian Weisgerber Date: Thu, 18 Sep 2008 15:16:31 +0000 Subject: 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@ --- sys/dev/pci/if_san_xilinx.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'sys/dev/pci/if_san_xilinx.c') 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 *)®, TxDMA_HI_DMA_GO_READY_BIT)) || (reg & TxDMA_HI_DMA_DATA_LENGTH_MASK) || -- cgit v1.2.3