Page MenuHomeFreeBSD

hid: Import functions and constants required by new subsystem
ClosedPublic

Authored by wulf on Jan 2 2021, 11:12 AM.

Details

Summary

This does an import of quirk stubs, debugging macros from USB code and numerous usage constants used by dependent drivers.

Besides that, this change renames some function to get a better match with userland library and NetBSD/OpenBSD HID code.
Namely:

  • Old hid_report_size() renamed to hid_report_size_max()
  • New hid_report_size() calculates size of given report rather than maximum size of all reports.
  • hid_get_data_unsigned() renamed tp hid_get_udata()
  • hid_put_data_unsigned() renamed to hid_put_udata()

Compatibility shims hidden under COMPAT_USBHID12 #define are provided in usbhid.h to make possible compiling of old code unmodified after this change.

The revision is subset of https://reviews.freebsd.org/D27777

Diff Detail

Repository
R10 FreeBSD src repository
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

wulf requested review of this revision.Jan 2 2021, 11:12 AM
This revision is now accepted and ready to land.Jan 2 2021, 12:50 PM
sys/amd64/conf/GENERIC
384

Is the intent that we'll leave these enabled indefinitely, or only during initial work?

sys/amd64/conf/GENERIC
384

It's like USB_DEBUG so it will be present in GENERIC but can be turned off via nooptions.