aboutsummaryrefslogtreecommitdiff
path: root/sys/dev/vge
diff options
context:
space:
mode:
authorRuslan Ermilov <ru@FreeBSD.org>2006-11-30 21:01:59 +0000
committerRuslan Ermilov <ru@FreeBSD.org>2006-11-30 21:01:59 +0000
commit03eab9f7a6db28bbd8523281a5541408240d19d7 (patch)
tree4c61db5041c90727324edbce2677adcb9754feaf /sys/dev/vge
parente3ae39ac245836e582c9f0712f44195aaeaf8678 (diff)
Notes
Diffstat (limited to 'sys/dev/vge')
-rw-r--r--sys/dev/vge/if_vge.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/sys/dev/vge/if_vge.c b/sys/dev/vge/if_vge.c
index e73ceb71aed32..234f7f7435714 100644
--- a/sys/dev/vge/if_vge.c
+++ b/sys/dev/vge/if_vge.c
@@ -1453,8 +1453,13 @@ vge_rxeof(sc)
}
if (rxstat & VGE_RDSTS_VTAG) {
+ /*
+ * The 32-bit rxctl register is stored in little-endian.
+ * However, the 16-bit vlan tag is stored in big-endian,
+ * so we have to byte swap it.
+ */
m->m_pkthdr.ether_vtag =
- ntohs((rxctl & VGE_RDCTL_VLANID));
+ bswap16(rxctl & VGE_RDCTL_VLANID);
m->m_flags |= M_VLANTAG;
}
@@ -1767,7 +1772,7 @@ vge_encap(sc, m_head, idx)
if (m_head->m_flags & M_VLANTAG)
sc->vge_ldata.vge_tx_list[idx].vge_ctl |=
- htole32(htons(m_head->m_pkthdr.ether_vtag) | VGE_TDCTL_VTAG);
+ htole32(m_head->m_pkthdr.ether_vtag | VGE_TDCTL_VTAG);
sc->vge_ldata.vge_tx_list[idx].vge_sts |= htole32(VGE_TDSTS_OWN);