summaryrefslogtreecommitdiff
path: root/src/host/hub.c
diff options
context:
space:
mode:
authorhathach <[email protected]>2023-05-11 14:26:12 +0700
committerhathach <[email protected]>2023-05-16 11:09:21 +0700
commit206d63e038744b228cfa6051d701cab50b520fe6 (patch)
tree602da2f1181946ced8114784d85510de02098efd /src/host/hub.c
parente2d3c0b2d3905a5194abb7bb8894e8b6b9c9b7e4 (diff)
correct EHCI reporting failed xfer (instead of stalled) when device is unplugged
Diffstat (limited to 'src/host/hub.c')
-rw-r--r--src/host/hub.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/host/hub.c b/src/host/hub.c
index 386ad6aae..85bf22b3e 100644
--- a/src/host/hub.c
+++ b/src/host/hub.c
@@ -33,6 +33,10 @@
#include "usbh_classdriver.h"
#include "hub.h"
+// Debug level, TUSB_CFG_DEBUG must be at least this level for debug message
+#define HUB_DEBUG 2
+#define TU_LOG_DRV(...) TU_LOG(HUB_DEBUG, __VA_ARGS__)
+
//--------------------------------------------------------------------+
// MACRO CONSTANT TYPEDEF
//--------------------------------------------------------------------+
@@ -218,7 +222,10 @@ void hub_close(uint8_t dev_addr)
TU_VERIFY(dev_addr > CFG_TUH_DEVICE_MAX, );
hub_interface_t* p_hub = get_itf(dev_addr);
- if (p_hub->ep_in) tu_memclr(p_hub, sizeof( hub_interface_t));
+ if (p_hub->ep_in) {
+ TU_LOG_DRV(" HUB close addr = %d\r\n", dev_addr);
+ tu_memclr(p_hub, sizeof( hub_interface_t));
+ }
}
bool hub_edpt_status_xfer(uint8_t dev_addr)