summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHiFiPhile <[email protected]>2025-04-11 15:56:25 +0200
committerHiFiPhile <[email protected]>2025-04-12 19:07:20 +0200
commit1809548bb52979b30fa15231a1429b3621ddaeaa (patch)
tree6301e1aa0e4862d0b7b954f634763272a6b726d5
parent5333d042f9384ec1cc0663a2708c0ca7cb5cdc32 (diff)
host/dwc2: cleanup transfer on device close
Signed-off-by: HiFiPhile <[email protected]>
-rw-r--r--src/portable/synopsys/dwc2/hcd_dwc2.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/portable/synopsys/dwc2/hcd_dwc2.c b/src/portable/synopsys/dwc2/hcd_dwc2.c
index b13479b02..d76fdeea7 100644
--- a/src/portable/synopsys/dwc2/hcd_dwc2.c
+++ b/src/portable/synopsys/dwc2/hcd_dwc2.c
@@ -448,6 +448,12 @@ void hcd_device_close(uint8_t rhport, uint8_t dev_addr) {
hcd_endpoint_t* edpt = &_hcd_data.edpt[i];
if (edpt->hcchar_bm.enable && edpt->hcchar_bm.dev_addr == dev_addr) {
tu_memclr(edpt, sizeof(hcd_endpoint_t));
+ for (uint8_t j = 0; j < (uint8_t) DWC2_CHANNEL_COUNT_MAX; j++) {
+ hcd_xfer_t* xfer = &_hcd_data.xfer[j];
+ if (xfer->allocated && xfer->ep_id == i) {
+ tu_memclr(xfer, sizeof(hcd_xfer_t));
+ }
+ }
}
}
}