diff options
author | Brad Smith <brad@cvs.openbsd.org> | 2008-10-28 05:43:12 +0000 |
---|---|---|
committer | Brad Smith <brad@cvs.openbsd.org> | 2008-10-28 05:43:12 +0000 |
commit | fad38dc928a92585a153a12582e4343aa8a89621 (patch) | |
tree | 40930550fa32bd12833addd13a8b4fd94248ae6c /sys/dev/pci | |
parent | c2196d6aafd9c64bd7e25ee65972c52b0df9f4e3 (diff) |
Some tweaks for the usage of NVLAN > 0 checks in the code.
Diffstat (limited to 'sys/dev/pci')
-rw-r--r-- | sys/dev/pci/if_em.c | 11 | ||||
-rw-r--r-- | sys/dev/pci/if_ixgb.c | 5 |
2 files changed, 12 insertions, 4 deletions
diff --git a/sys/dev/pci/if_em.c b/sys/dev/pci/if_em.c index 7d68e157a4a..51f6daf789c 100644 --- a/sys/dev/pci/if_em.c +++ b/sys/dev/pci/if_em.c @@ -31,7 +31,7 @@ POSSIBILITY OF SUCH DAMAGE. ***************************************************************************/ -/* $OpenBSD: if_em.c,v 1.193 2008/10/19 19:53:09 brad Exp $ */ +/* $OpenBSD: if_em.c,v 1.194 2008/10/28 05:43:11 brad Exp $ */ /* $FreeBSD: if_em.c,v 1.46 2004/09/29 18:28:28 mlaier Exp $ */ #include <dev/pci/if_em.h> @@ -1108,6 +1108,7 @@ em_encap(struct em_softc *sc, struct mbuf *m_head) else sc->num_tx_desc_avail -= map->dm_nsegs; +#if NVLAN > 0 /* Find out if we are in VLAN mode */ if (m_head->m_flags & M_VLANTAG) { /* Set the VLAN id */ @@ -1117,6 +1118,7 @@ em_encap(struct em_softc *sc, struct mbuf *m_head) /* Tell hardware to add tag */ current_tx_desc->lower.data |= htole32(E1000_TXD_CMD_VLE); } +#endif tx_buffer->m_head = m_head; tx_buffer_mapped->map = tx_buffer->map; @@ -2716,14 +2718,17 @@ em_rxeof(struct em_softc *sc, int count) if (eop) { sc->fmp->m_pkthdr.rcvif = ifp; ifp->if_ipackets++; - em_receive_checksum(sc, current_desc, - sc->fmp); + em_receive_checksum(sc, current_desc, sc->fmp); + +#if NVLAN > 0 if (current_desc->status & E1000_RXD_STAT_VP) { sc->fmp->m_pkthdr.ether_vtag = (current_desc->special & E1000_RXD_SPC_VLAN_MASK); sc->fmp->m_flags |= M_VLANTAG; } +#endif + m = sc->fmp; sc->fmp = NULL; sc->lmp = NULL; diff --git a/sys/dev/pci/if_ixgb.c b/sys/dev/pci/if_ixgb.c index 42f054e288c..7fb01a52399 100644 --- a/sys/dev/pci/if_ixgb.c +++ b/sys/dev/pci/if_ixgb.c @@ -31,7 +31,7 @@ POSSIBILITY OF SUCH DAMAGE. ***************************************************************************/ -/* $OpenBSD: if_ixgb.c,v 1.49 2008/10/21 00:26:04 brad Exp $ */ +/* $OpenBSD: if_ixgb.c,v 1.50 2008/10/28 05:43:11 brad Exp $ */ #include <dev/pci/if_ixgb.h> @@ -1815,11 +1815,14 @@ ixgb_rxeof(struct ixgb_softc *sc, int count) sc->fmp->m_pkthdr.rcvif = ifp; ifp->if_ipackets++; ixgb_receive_checksum(sc, current_desc, sc->fmp); + +#if NVLAN > 0 if (current_desc->status & IXGB_RX_DESC_STATUS_VP) { sc->fmp->m_pkthdr.ether_vtag = current_desc->special; sc->fmp->m_flags |= M_VLANTAG; } +#endif #if NBPFILTER > 0 /* |