From fe07c29872c3a67d8f4ecff6dfae36dab4b4996f Mon Sep 17 00:00:00 2001 From: sthen Date: Sat, 2 Apr 2022 15:35:06 +0000 Subject: [PATCH] Don't byte swap URE_TXPKT_VLAN_TAG when setting up the packet to transmit. Fixes vlan transmission with hw tagging (problem seen on RTL8153B but there's no reason this wouldn't apply to others) and matches what the Linux driver is doing. looks correct kettenis@ ok kevlo@ --- sys/dev/usb/if_ure.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/dev/usb/if_ure.c b/sys/dev/usb/if_ure.c index 4946163ba89..186b2a6fb0e 100644 --- a/sys/dev/usb/if_ure.c +++ b/sys/dev/usb/if_ure.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if_ure.c,v 1.29 2022/04/02 12:22:56 kevlo Exp $ */ +/* $OpenBSD: if_ure.c,v 1.30 2022/04/02 15:35:06 sthen Exp $ */ /*- * Copyright (c) 2015, 2016, 2019 Kevin Lo * Copyright (c) 2020 Jonathon Fletcher @@ -2142,7 +2142,7 @@ ure_encap_txpkt(struct mbuf *m, char *buf, uint32_t maxlen) #if NVLAN > 0 if (m->m_flags & M_VLANTAG) - cflags |= swap16(m->m_pkthdr.ether_vtag | URE_TXPKT_VLAN_TAG); + cflags |= URE_TXPKT_VLAN_TAG | swap16(m->m_pkthdr.ether_vtag); #endif txhdr.ure_pktlen = htole32(m->m_pkthdr.len | URE_TXPKT_TX_FS | -- 2.20.1