Commit graph

346 commits

Author SHA1 Message Date
c1380673db feat(linux): allow multiple endpoints per address for concurrent URB pipelining
Replace EndpointBitSet with EndpointRefCount in the Linux backend to
allow multiple Endpoint/IsoEndpoint objects at the same USB endpoint
address. This enables concurrent pipelined URB submission from
independent threads, which is needed for USB/IP proxies that forward
multiple isochronous URBs simultaneously.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-22 14:11:33 +00:00
Frederic Laing
997a76cd3c implement isochronous transfers for linux 2026-03-19 21:11:36 +00:00
Kevin Mehall
d939d8bea1 v0.2.3 2026-03-10 12:22:08 -06:00
Samuel Åkesson
f31e6cc698
Implement From<&[u8]> and From<[u8; N]> for Buffer (#189) 2026-03-10 12:10:56 -06:00
Kevin Mehall
313cb0132e
windows: Fix panic when we can't determine the instance ID for a hotplug event (#185) 2026-03-10 12:03:29 -06:00
Kevin Mehall
71b4425ccc v0.2.2 2026-02-17 13:21:23 -07:00
Kevin Mehall
7cea448e5c Improve Endpoint docs 2026-02-17 13:11:30 -07:00
Kevin Mehall
cd593cd871 linux: Handle ENOENT from claim_interface 2026-02-17 10:38:54 -07:00
Abdullah Al-Banna
94dffc4311
default to configuration 0 if the bConfigurationValue file is empty (#181)
Co-authored-by: Kevin Mehall <km@kevinmehall.net>
2026-02-17 10:24:08 -07:00
Kevin Mehall
b8e8938975 macos: clean up IOCreatePlugInInterfaceForService retry loop 2026-01-24 21:51:02 -07:00
Kevin Mehall
d07caaf807 Update io-kit-sys to 0.5.0 2026-01-24 17:30:17 -08:00
Kevin Mehall
57aaa81d29 Fix tokio dependency for -Zminimal-versions 2026-01-24 18:06:39 -07:00
Kevin Mehall
ac1988f573
Merge pull request #180 from ColinFinck/update-windows-sys-and-linux-raw-sys
Update `windows-sys` to `>= 0.60, <= 0.61` and `linux-raw-sys` to 0.12.1
2026-01-24 17:27:38 -07:00
Kevin Mehall
85eafb30ae Allow linux-raw-sys 0.11, same as rustix 1.1.3 2026-01-24 17:13:02 -07:00
Colin Finck
cf80ca7a66
Update windows-sys to >= 0.60, <= 0.61 and linux-raw-sys to 0.12.1 2026-01-21 17:05:49 +01:00
Kevin Mehall
318244fa51 v0.2.1 2025-10-04 17:50:50 -06:00
Kevin Mehall
86f692e28f Add crates.io trusted publishing 2025-10-04 17:50:50 -06:00
Kevin Mehall
63ffb27ac3
Merge pull request #164 from kevinmehall/transfer-blocking
Add `Endpoint::transfer_blocking` convenience method.
2025-10-04 16:54:39 -06:00
Kevin Mehall
dd56a96648 Add Endpoint::transfer_blocking convenience method. 2025-10-04 16:31:53 -06:00
Kevin Mehall
abb3740446
Merge pull request #163 from kevinmehall/waker-fix
Take waker and drop EndpointInner reference before waking transfer
2025-10-04 16:13:24 -06:00
Kevin Mehall
61228aef1c Log on dropping endpoint with pending transfers 2025-10-04 15:40:15 -06:00
Kevin Mehall
bcfb2b8e89 Take waker and drop EndpointInner reference before waking transfer
This fixes a race condition for users that drop the Endpoint immediately after a transfer
completes, and then might immediately try and re-open the endpoint. The event thread
still held an Arc reference after marking the transfer complete, and so the endpoint
was still considered in use and re-opening occasionally failed.

It also means the `Notify` lock is not held when calling the waker function, which fixes
a deadlock if it were to call back into endpoint methods.
2025-10-04 14:52:35 -06:00
Kevin Mehall
573126df43 Fix "hiding a lifetime that's elided elsewhere is confusing" warnings from rustc 1.90 2025-10-03 18:00:24 -06:00
Kevin Mehall
2ef7969588 v0.2.0 2025-07-27 13:00:28 -06:00
Kevin Mehall
0035edd067 Add must_use to MaybeFuture 2025-07-27 13:00:28 -06:00
Kevin Mehall
64a278bd41 windows: Fix interface busy check 2025-07-27 12:19:42 -06:00
Kevin Mehall
4009138dc7 Documentation improvements 2025-07-26 17:21:28 -06:00
Kevin Mehall
426516549a
Merge pull request #158 from kevinmehall/android-compat
Future-proof v0.2 DeviceInfo and BusInfo for future Android and WebUSB backends
2025-07-26 16:21:00 -06:00
Kevin Mehall
5262bad233 Disable DeviceInfo fields and BusInfo for future compatibility with Android and WebUSB backends 2025-07-26 15:58:13 -06:00
Kevin Mehall
84616c749e Remove DeviceInfo::max_packet_size_0
This isn't exposed on WebUSB or Android, and isn't useful as a criteria for filtering devices.
Control endpoint packet size is fully abstracted by the OS, so the only use case is for
re-constructing the device descriptor, and now we offer the full device descriptor
for an opened device.
2025-07-26 15:58:13 -06:00
Kevin Mehall
1c92baa7fa
Merge pull request #157 from kevinmehall/tokio-panic
Avoid panic during Tokio runtime shutdown
2025-07-20 11:01:55 -06:00
Kevin Mehall
7f6f7948d8 Avoid panic during Tokio runtime shutdown
Fixes #156
2025-07-20 10:42:40 -06:00
Kevin Mehall
c1492ae441
Merge pull request #154 from kevinmehall/windows-interface-info
windows: Always use interface descriptors rather than child device nodes for InterfaceInfo
2025-07-16 23:36:29 -06:00
Kevin Mehall
6304e71987 windows: Always use interface descriptors rather than child device nodes for InterfaceInfo 2025-07-16 23:27:42 -06:00
Kevin Mehall
e0d1d6489d windows: Update windows-sys 2025-07-16 23:27:42 -06:00
Kevin Mehall
ccb40bd01d
Merge pull request #153 from kevinmehall/io-traits
Tweaks for EndpointRead / EndpointWrite
2025-07-16 22:11:53 -06:00
Kevin Mehall
371b91c85f EndpointRead / EndpointWrite examples with tokio and smol 2025-07-16 21:47:22 -06:00
Kevin Mehall
eb12376bc2 EndpointWrite: require num_transfers is nonzero 2025-07-15 23:16:37 -06:00
Kevin Mehall
a3c57e9336 EndpointRead: Error type for EndpointReadUntilShortPacket::consume_end 2025-07-15 23:06:40 -06:00
Kevin Mehall
89d55ab6a2 EndpointRead: improve semantics for num_transfers 2025-07-15 23:06:40 -06:00
Kevin Mehall
0fd3db6089 v0.2.0-beta.2 2025-06-15 15:02:26 -06:00
Kevin Mehall
915f79005d
Merge pull request #148 from kevinmehall/macos-update
macOS: Update core-foundation, switch to IOUSBInterfaceInterface700 and IOUSBDeviceInterface650
2025-06-15 14:35:17 -06:00
Kevin Mehall
0de3706d9f macos: Use IOUSBInterfaceInterface700 and IOUSBDeviceInterface650
IOUSBInterfaceInterface700 was added in macOS 10.10+ and
IOUSBDeviceInterface650 in macOS 10.9+, both older than Rust's
minimum of 10.12 so technically the breaking change was already
broken by Rust, but might as well get this in on the nusb v0.2
semver bump.

Co-authored-by: Charles Strahan <charles@cstrahan.com>
2025-06-15 14:20:23 -06:00
Kevin Mehall
3c21f7ea11 macos: Update core-foundation 2025-06-15 14:20:23 -06:00
Kevin Mehall
b34e320718 Enable all features for docs.rs 2025-06-15 14:20:22 -06:00
Kevin Mehall
38e85c88dc Update dev-dependencies 2025-06-15 13:36:20 -06:00
Kevin Mehall
8d55c38aa4 Fix warnings 2025-06-15 13:36:20 -06:00
Kevin Mehall
a693c9211c linux: Log submitted transfer sizes 2025-06-15 13:04:15 -06:00
Kevin Mehall
8b5dde13f4
Merge pull request #141 from kevinmehall/io-traits
Add EndpointRead and EndpointWrite
2025-06-15 12:57:32 -06:00
Kevin Mehall
b1cc46e918 Add EndpointRead and EndpointWrite 2025-06-15 12:52:41 -06:00