Page MenuHomeFreeBSD

libusb: implement libusb_dev_mem_{alloc,free}
ClosedPublic

Authored by aokblast on Jul 9 2025, 8:14 AM.
Tags
None
Referenced Files
F140310230: D51222.id158531.diff
Mon, Dec 22, 2:17 PM
Unknown Object (File)
Wed, Dec 17, 11:26 AM
Unknown Object (File)
Sun, Dec 14, 6:38 PM
Unknown Object (File)
Wed, Dec 3, 5:34 PM
Unknown Object (File)
Sun, Nov 30, 5:15 PM
Unknown Object (File)
Sat, Nov 29, 10:14 AM
Unknown Object (File)
Fri, Nov 28, 9:34 AM
Unknown Object (File)
Thu, Nov 27, 6:39 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 Not Applicable
Unit
Tests Not Applicable

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
372

attempts to ... from the given

375

If successful, returns a ...

376

... returns NULL for the time being.

380

frees the DMA memory

markj added inline comments.
lib/libusb/libusb.3
372
375

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."

380

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

lib/libusb/libusb.h
517

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