Page MenuHomeFreeBSD

libusb: implement libusb_dev_mem_{alloc,free}
ClosedPublic

Authored by aokblast on Jul 9 2025, 8:14 AM.
Tags
None
Referenced Files
F137921216: D51222.id158851.diff
Thu, Nov 27, 6:39 AM
F137870392: D51222.id158531.diff
Wed, Nov 26, 4:27 PM
Unknown Object (File)
Tue, Nov 25, 11:25 AM
Unknown Object (File)
Sat, Nov 22, 1:45 AM
Unknown Object (File)
Sat, Nov 22, 1:39 AM
Unknown Object (File)
Sat, Nov 22, 1:39 AM
Unknown Object (File)
Sat, Nov 22, 1:39 AM
Unknown Object (File)
Sat, Nov 22, 1:37 AM

Details

Summary

libusb provides a API for create DMA buffer for USB packaet from kernel.
However, this feature is only available on Linux. For other unsupported
platform, we return NULL for alloc and return not supported for free.

Sponsored by: FreeBSD Foundation

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 65449
Build 62332: arc lint + arc unit

Event Timeline

  • All "* devh" should be "*devh"
  • The function prototypes are not aligned, they have varying numbers of space to the left of the function identifier.

Maybe a checkin with only white-space changes is in order.

lib/libusb/libusb.3
359

attempts to ... from the given

362

If successful, returns a ...

363

... returns NULL for the time being.

367

frees the DMA memory

markj added inline comments.
lib/libusb/libusb.3
359
362

Or "if successful"

Hmm, given that this function is unimplemented, it is better to just say that directly: "This function is provided for compatibility and is currently unimplemented. It always returns NULL."

367

Similarly, "this function is unimplemented and always returns LIBUSB_ERROR_NOT_SUPPORTED."

lib/libusb/libusb.h
522

Please follow the style used in the rest of the declarations, i.e., there should be a tab after int.

hi! please address the concerns and then I'll approve! thanks!

This revision is now accepted and ready to land.Jul 15 2025, 1:37 PM