git: 35c9d8f04a19 - stable/14 - dwc: cleanup
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Wed, 21 Jan 2026 15:29:48 UTC
The branch stable/14 has been updated by tuexen:
URL: https://cgit.FreeBSD.org/src/commit/?id=35c9d8f04a192310d37aa13e5749f3a6933693e8
commit 35c9d8f04a192310d37aa13e5749f3a6933693e8
Author: Michael Tuexen <tuexen@FreeBSD.org>
AuthorDate: 2026-01-20 10:25:31 +0000
Commit: Michael Tuexen <tuexen@FreeBSD.org>
CommitDate: 2026-01-21 15:26:48 +0000
dwc: cleanup
Reviewed by: Timo Völker
Differential Revision: https://reviews.freebsd.org/D54788
(cherry picked from commit 3d771e0db66da77da5a7f323df1c0638e6b586ea)
---
sys/dev/dwc/if_dwc.c | 22 +++++++++-------------
1 file changed, 9 insertions(+), 13 deletions(-)
diff --git a/sys/dev/dwc/if_dwc.c b/sys/dev/dwc/if_dwc.c
index 898fc75d2653..147b6351a9f8 100644
--- a/sys/dev/dwc/if_dwc.c
+++ b/sys/dev/dwc/if_dwc.c
@@ -523,7 +523,7 @@ dwc_enable_csum_offload(struct dwc_softc *sc)
DWC_ASSERT_LOCKED(sc);
reg = READ4(sc, MAC_CONFIGURATION);
- if ((if_getcapenable(sc->ifp) & IFCAP_RXCSUM) != 0)
+ if ((if_getcapenable(sc->ifp) & (IFCAP_RXCSUM | IFCAP_RXCSUM_IPV6)) != 0)
reg |= CONF_IPC;
else
reg &= ~CONF_IPC;
@@ -713,7 +713,7 @@ dwc_setup_txbuf(struct dwc_softc *sc, int idx, struct mbuf **mp)
m = *mp;
- if ((m->m_pkthdr.csum_flags & CSUM_DELAY_DATA) != 0)
+ if ((m->m_pkthdr.csum_flags & (CSUM_DELAY_DATA | CSUM_DELAY_DATA_IPV6)) != 0)
flags = (sc->mactype != DWC_GMAC_EXT_DESC) ? NTDESC1_CIC_SEG : ETDESC0_CIC_SEG;
else if ((m->m_pkthdr.csum_flags & CSUM_IP) != 0)
flags = (sc->mactype != DWC_GMAC_EXT_DESC) ? NTDESC1_CIC_HDR : ETDESC0_CIC_HDR;
@@ -854,7 +854,7 @@ dwc_rxfinish_one(struct dwc_softc *sc, struct dwc_hwdesc *desc,
m->m_len = len;
if_inc_counter(ifp, IFCOUNTER_IPACKETS, 1);
- if ((if_getcapenable(ifp) & IFCAP_RXCSUM) != 0 &&
+ if ((if_getcapenable(ifp) & (IFCAP_RXCSUM | IFCAP_RXCSUM_IPV6)) != 0 &&
(rdesc0 & RDESC0_FT) != 0) {
m->m_pkthdr.csum_flags = CSUM_IP_CHECKED;
if ((rdesc0 & RDESC0_ICE) == 0)
@@ -1254,18 +1254,14 @@ dwc_ioctl(if_t ifp, u_long cmd, caddr_t data)
}
if (mask & (IFCAP_RXCSUM | IFCAP_RXCSUM_IPV6))
if_togglecapenable(ifp, IFCAP_RXCSUM | IFCAP_RXCSUM_IPV6);
- if (mask & IFCAP_TXCSUM)
+ if (mask & IFCAP_TXCSUM) {
if_togglecapenable(ifp, IFCAP_TXCSUM);
- if ((if_getcapenable(ifp) & IFCAP_TXCSUM) != 0)
- if_sethwassistbits(ifp, CSUM_IP | CSUM_DELAY_DATA, 0);
- else
- if_sethwassistbits(ifp, 0, CSUM_IP | CSUM_DELAY_DATA);
- if (mask & IFCAP_TXCSUM_IPV6)
+ if_togglehwassist(ifp, CSUM_IP | CSUM_DELAY_DATA);
+ }
+ if (mask & IFCAP_TXCSUM_IPV6) {
if_togglecapenable(ifp, IFCAP_TXCSUM_IPV6);
- if ((if_getcapenable(ifp) & IFCAP_TXCSUM_IPV6) != 0)
- if_sethwassistbits(ifp, CSUM_DELAY_DATA_IPV6, 0);
- else
- if_sethwassistbits(ifp, 0, CSUM_DELAY_DATA_IPV6);
+ if_togglehwassist(ifp, CSUM_DELAY_DATA_IPV6);
+ }
if (if_getdrvflags(ifp) & IFF_DRV_RUNNING) {
DWC_LOCK(sc);