ukbd: fix SET_REPORT wValue always using report ID 0 for LED output#2210
Open
MegaManSec wants to merge 1 commit into
Open
ukbd: fix SET_REPORT wValue always using report ID 0 for LED output#2210MegaManSec wants to merge 1 commit into
MegaManSec wants to merge 1 commit into
Conversation
ukbd_set_leds_callback() built the SET_REPORT control request with USETW2(req.wValue, UHID_OUTPUT_REPORT, 0) before the loop that determines the actual HID report ID from sc_id_numlock, sc_id_scrolllock, or sc_id_capslock. The data payload was already correctly prefixed with the real report ID when id != 0, but the control request's wValue told the device to set report ID 0, which does not exist on devices that use non-zero report IDs for LED output. Apple Internal Keyboard / Trackpad (0x05ac:0x0274) uses report ID 1 for LED output. The mismatch caused the device to STALL every SET_REPORT request, so the capslock LED could never be updated. Move the USETW2 call to after the LED-detection loop so that wValue carries the correct report ID. Signed-off-by: Joshua Rogers <Joshua@Joshua.Hu>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
ukbd_set_leds_callback() built the SET_REPORT control request with USETW2(req.wValue, UHID_OUTPUT_REPORT, 0) before the loop that determines the actual HID report ID from sc_id_numlock, sc_id_scrolllock, or sc_id_capslock. The data payload was already correctly prefixed with the real report ID when id != 0, but the control request's wValue told the device to set report ID 0, which does not exist on devices that use non-zero report IDs for LED output.
Apple Internal Keyboard / Trackpad (0x05ac:0x0274) uses report ID 1 for LED output. The mismatch caused the device to STALL every SET_REPORT request, so the capslock LED could never be updated.
Move the USETW2 call to after the LED-detection loop so that wValue carries the correct report ID.
This fixes https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=279690.