-/* $OpenBSD: if_vmx.c,v 1.79 2023/11/10 15:51:24 bluhm Exp $ */
+/* $OpenBSD: if_vmx.c,v 1.80 2024/02/09 15:22:41 jan Exp $ */
/*
* Copyright (c) 2013 Tsubai Masanari
if (sc->sc_ds->upt_features & UPT1_F_CSUM)
ifp->if_capabilities |= IFCAP_CSUM_TCPv4 | IFCAP_CSUM_UDPv4;
#endif
+#if NVLAN > 0
if (sc->sc_ds->upt_features & UPT1_F_VLAN)
ifp->if_capabilities |= IFCAP_VLAN_HWTAGGING;
+#endif
ifq_init_maxlen(&ifp->if_snd, NTXDESC);
#endif
ds->vmxnet3_revision = 1;
ds->upt_version = 1;
- ds->upt_features = UPT1_F_CSUM | UPT1_F_VLAN;
+ ds->upt_features = UPT1_F_CSUM;
+#if NVLAN > 0
+ ds->upt_features |= UPT1_F_VLAN;
+#endif
ds->driver_data = ~0ULL;
ds->driver_data_len = 0;
ds->queue_shared = qs_pa;
m->m_pkthdr.len = m->m_len = len;
vmxnet3_rx_csum(rxcd, m);
+#if NVLAN > 0
if (letoh32(rxcd->rxc_word2 & VMXNET3_RXC_VLAN)) {
m->m_flags |= M_VLANTAG;
m->m_pkthdr.ether_vtag = letoh32((rxcd->rxc_word2 >>
VMXNET3_RXC_VLANTAG_S) & VMXNET3_RXC_VLANTAG_M);
}
+#endif
if (((letoh32(rxcd->rxc_word0) >> VMXNET3_RXC_RSSTYPE_S) &
VMXNET3_RXC_RSSTYPE_M) != VMXNET3_RXC_RSSTYPE_NONE) {
m->m_pkthdr.ph_flowid = letoh32(rxcd->rxc_word1);
}
txd->tx_word3 = htole32(VMXNET3_TX_EOP | VMXNET3_TX_COMPREQ);
+#if NVLAN > 0
if (ISSET(m->m_flags, M_VLANTAG)) {
sop->tx_word3 |= htole32(VMXNET3_TX_VTAG_MODE);
sop->tx_word3 |= htole32((m->m_pkthdr.ether_vtag &
VMXNET3_TX_VLANTAG_M) << VMXNET3_TX_VLANTAG_S);
}
+#endif
ring->prod = prod;
/* Change the ownership by flipping the "generation" bit */