Skip to content

Conversation

roma-jam
Copy link
Collaborator

@roma-jam roma-jam commented Oct 10, 2025

Description

As the parent information holds now in the device tree node in the Hub Driver, we need to get the parent information via Hub Driver API and node_id when the usb_host_device_info() is requested.

This does't violate the main requirement for device object handles in the USB Host Library: a device must be opened, for device handle to be valid.

From now on, the owner of the external hub device handle is the External Hub Driver, which holds the device opened and closes it during the device detachment or upon usb_host_device_free_all() public request.

Related

Testing

USB Host target tests with SanDisk flash drive, attached to the root port via external hub.


Checklist

Before submitting a Pull Request, please ensure the following:

  • 🚨 This PR does not introduce breaking changes.
  • All CI checks (GH Actions) pass.
  • Documentation is updated as needed.
  • Tests are updated or added as necessary.
  • Code is well-commented, especially in complex areas.
  • Git history is clean — commits are squashed to the minimum necessary.

@roma-jam roma-jam self-assigned this Oct 10, 2025
@roma-jam roma-jam changed the title refactor(usb_host): Changed the parent information source for usb_host_device_info() refactor(usb_host): Changed the parent information source for usb_host_device_info() (part4/4) Oct 10, 2025
}
#endif // ENABLE_USB_HUBS

memset(parent_info, 0, sizeof(usb_parent_dev_info_t));

Check warning

Code scanning / clang-tidy

Call to function 'memset' is insecure as it does not provide security checks introduced in the C11 standard. Replace with analogous functions that support length arguments or provides boundary checks such as 'memset_s' in case of C11 [clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling] Warning

Call to function 'memset' is insecure as it does not provide security checks introduced in the C11 standard. Replace with analogous functions that support length arguments or provides boundary checks such as 'memset_s' in case of C11 [clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Component: usb_host Issue affects usb_host component

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant