Re: [RFC PATCH 1/9] rust: usb: add synchronous bulk transfer support

From: Danilo Krummrich

Date: Wed Jun 17 2026 - 12:10:31 EST


On Wed Jun 17, 2026 at 4:59 PM CEST, Mike Lothian wrote:
> @@ -426,7 +427,7 @@ unsafe impl Sync for Interface {}
> ///
> /// [`struct usb_device`]: https://www.kernel.org/doc/html/latest/driver-api/usb/usb.html#c.usb_device
> #[repr(transparent)]
> -struct Device<Ctx: device::DeviceContext = device::Normal>(
> +pub struct Device<Ctx: device::DeviceContext = device::Normal>(

Please see commit 22d693e45d4a ("rust: usb: keep usb::Device private for now"),
this shouldn't be needed for writing a usb::Interface driver; please also see
[1].

[1] https://lore.kernel.org/all/DD08HWM0M68R.2R74OSODBIWSZ@xxxxxxxxxx/

> + pub fn bulk_send(&self, endpoint: u8, data: &[u8], timeout: Delta) -> Result<usize> {

This should only be exposed for a usb::Interface<Bound>, i.e. note the Bound
device context.