Page MenuHomeFreeBSD

libusb: implement libusb_dev_mem_{alloc,free}
ClosedPublic

Authored by aokblast on Jul 9 2025, 8:14 AM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Oct 10, 9:53 PM
Unknown Object (File)
Fri, Oct 10, 4:02 PM
Unknown Object (File)
Fri, Oct 10, 4:02 PM
Unknown Object (File)
Fri, Oct 10, 4:02 PM
Unknown Object (File)
Fri, Oct 10, 10:03 AM
Unknown Object (File)
Mon, Oct 6, 6:14 AM
Unknown Object (File)
Tue, Sep 16, 9:41 PM
Unknown Object (File)
Sep 12 2025, 3:20 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