refactor(ext_hub): Device release (allows to run usb_host test with ext hub)

754d357f refactor(ext_hub): Fixed device release, optimized the order of closing usbh device
fc61875a refactor(ext_hub): Pospone the device release, if device is not IDLE
3fd17b8b refactor(hub): Applied new ext_hub api, refactor func names
3003362b refactor(usb_host): Cancel hub porpagation to the user, rename non-critical func
19ce9ed6 refactor(test_usb_host_async): Added host_lib_task finish notification
f238d75b refactor(ext_port): Remove the error verification, as error will be handled in ext hub driver

Co-authored-by: Roman Leonov <roman.leonov@espressif.com>
This commit is contained in:
Roman Leonov
2025-06-02 11:44:22 +02:00
parent 28980b62c9
commit 628d7ad77d
7 changed files with 113 additions and 146 deletions
+9 -7
View File
@@ -767,7 +767,7 @@ esp_err_t hub_port_disable(usb_device_handle_t parent_dev_hdl, uint8_t parent_po
return ret;
}
esp_err_t hub_notify_new_dev(uint8_t dev_addr)
esp_err_t hub_dev_new(uint8_t dev_addr)
{
HUB_DRIVER_ENTER_CRITICAL();
HUB_DRIVER_CHECK_FROM_CRIT(p_hub_driver_obj != NULL, ESP_ERR_INVALID_STATE);
@@ -790,15 +790,15 @@ esp_err_t hub_notify_new_dev(uint8_t dev_addr)
}
}
// Close device
usbh_dev_close(dev_hdl);
ESP_ERROR_CHECK(usbh_dev_close(dev_hdl));
}
// Logic should not stop the flow, so no error to return
ret = ESP_OK;
// Nothing to do, while Hubs support is not enabled
ret = ESP_ERR_NOT_SUPPORTED;
#endif // ENABLE_USB_HUBS
return ret;
}
esp_err_t hub_notify_dev_gone(uint8_t dev_addr)
esp_err_t hub_dev_gone(uint8_t dev_addr)
{
HUB_DRIVER_ENTER_CRITICAL();
HUB_DRIVER_CHECK_FROM_CRIT(p_hub_driver_obj != NULL, ESP_ERR_INVALID_STATE);
@@ -809,7 +809,7 @@ esp_err_t hub_notify_dev_gone(uint8_t dev_addr)
ret = ext_hub_dev_gone(dev_addr);
#else
// Nothing to do, while Hubs support is not enabled
ret = ESP_OK;
ret = ESP_ERR_NOT_SUPPORTED;
#endif // ENABLE_USB_HUBS
return ret;
}
@@ -821,7 +821,9 @@ esp_err_t hub_notify_all_free(void)
HUB_DRIVER_CHECK_FROM_CRIT(p_hub_driver_obj != NULL, ESP_ERR_INVALID_STATE);
HUB_DRIVER_EXIT_CRITICAL();
return ext_hub_all_free();
ext_hub_mark_all_free();
return ESP_OK;
}
#endif // ENABLE_USB_HUBS