From 91669fdaa7a0e555f7342ec70500e8eed5d33ef8 Mon Sep 17 00:00:00 2001 From: jdolecek Date: Sat, 15 Oct 2005 19:32:36 +0000 Subject: [PATCH] use VLAN_OUTPUT_TAG() --- sys/dev/ic/i82557.c | 21 +++++++++------------ 1 file changed, 9 insertions(+), 12 deletions(-) diff --git a/sys/dev/ic/i82557.c b/sys/dev/ic/i82557.c index e945a1fc1417..573f5169c85f 100644 --- a/sys/dev/ic/i82557.c +++ b/sys/dev/ic/i82557.c @@ -1,4 +1,4 @@ -/* $NetBSD: i82557.c,v 1.93 2005/10/12 19:26:10 abs Exp $ */ +/* $NetBSD: i82557.c,v 1.94 2005/10/15 19:32:36 jdolecek Exp $ */ /*- * Copyright (c) 1997, 1998, 1999, 2001, 2002 The NetBSD Foundation, Inc. @@ -73,7 +73,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: i82557.c,v 1.93 2005/10/12 19:26:10 abs Exp $"); +__KERNEL_RCSID(0, "$NetBSD: i82557.c,v 1.94 2005/10/15 19:32:36 jdolecek Exp $"); #include "bpfilter.h" #include "rnd.h" @@ -1003,6 +1003,7 @@ fxp_start(struct ifnet *ifp) KASSERT((csum_flags & (M_CSUM_TCPv6 | M_CSUM_UDPv6)) == 0); if (sc->sc_flags & FXPF_IPCB) { + struct m_tag *vtag; struct fxp_ipcb *ipcb; /* * Deal with TCP/IP checksum offload. Note that @@ -1037,16 +1038,12 @@ fxp_start(struct ifnet *ifp) /* * request VLAN tag insertion if needed. */ - if (sc->sc_ethercom.ec_nvlans != 0) { - struct m_tag *vtag; - - vtag = m_tag_find(m0, PACKET_TAG_VLAN, NULL); - if (vtag) { - ipcb->ipcb_vlan_id = - htobe16(*(u_int *)(vtag + 1)); - ipcb->ipcb_ip_activation_high |= - FXP_IPCB_INSERTVLAN_ENABLE; - } + vtag = VLAN_OUTPUT_TAG(&sc->sc_ethercom, m0); + if (vtag) { + ipcb->ipcb_vlan_id = + htobe16(*(u_int *)(vtag + 1)); + ipcb->ipcb_ip_activation_high |= + FXP_IPCB_INSERTVLAN_ENABLE; } } else { KASSERT((csum_flags &