From nobody Sun May 31 11:30:45 2026 X-Original-To: dev-commits-src-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4gSvzZ6yf6z6gXkj for ; Sun, 31 May 2026 11:30:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R13" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 4gSvzZ4DFQz3sP4 for ; Sun, 31 May 2026 11:30:50 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1780227050; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=W2JQawv4tIlBU3pHLGHGwD0foWvtKVhhCPbgOk7rVko=; b=RCA/tAAsjimjTUw0hY16bfe2THr1FbNefmNJ9A3i39tF+0ZBt+CarEhHGWUzm9GD4kWzTW x922BvKLC+pb4HENrPJ9omL8P1OD8TmsnGKP08VTNh3sJsx667tuWoDohTO0uXXDPoBDMo UP3fQ+nvTcKipRaicGCTJgpwIVNnR8WDYfp7QkO3u/Fd9EKdr7akcly9BYbdTBBRsBJ8pC eOaPzWhYQsn1poaBXWV4l4VD0lnnNvgyRo3+anbXijjRDv/Iosuh/gW8Bn27+bUFIqAGDR 3fEHt0B4yG61Qn9yZKY9MD9QH9GMQ+3HNco8PGjJwWlGNiZKjhbhNWpQtQkZyg== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1780227050; a=rsa-sha256; cv=none; b=IJLQy/qMEY3IfO66hqPOBy6Mij6vJZKUmK6sbXCZqb9Kqdq6iRV3qPMCGUg79FmsiVXllz CVwGu2YpNlTQgO0eTXuOmzfgvLbbi1bxQ2SXYDnoqv95vakPCudwZLIIgtcgo9ur1RCEfH flp0rk0xtAw8Ia0+iWZcsGYddDgLB0u/9edhGIqbkJ0kHKLJWKydKtSjw7WpNxaBHX3fxw YnP/+lDr9TWNsmOeq1r/3PS2TsQoy0GeObnXhxlcBfaDu+U1iRPj8yp0dmykPuBH0oOTLB qsyNOD6k4/7ym5otmRJPujgnk4ZlX+4df2u70UsGCYLXLV7okRsPfY436+iluw== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1780227050; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=W2JQawv4tIlBU3pHLGHGwD0foWvtKVhhCPbgOk7rVko=; b=kXTs6JH0o3cDSih2x8mmyFf89lNtJvSVdOLfGB+EFDywyG6ZTG9J1qmxoG6ijwgnpoPPqN vePAjHDEZCiKRu4G63WmmYTYCktCnxvmWHXf2d/h3Yktj2fzwxl3LHdYjvFDwbPvcZXv6w O39w6YN6/YVXZoD/8dFAPfcev4Srwd/I0Y6j/Cze2Vo59HpnP6Tumf5C+vJNU1Nbh9Ngeb HJHXK2XgjlPqbl6yWKa8gRBpUmrCqwJ3di7a1fT72wNtYu465XHcLW/4cxxrsPXszZ86x+ jrnvnRsab46WJ6gx5tOZXsGDpeb9mbZmJynwFY+rMSoEwZNQMZ12qyWVe75Dvg== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) by mxrelay.nyi.freebsd.org (Postfix) with ESMTP id 4gSvzZ3CnWzqCM for ; Sun, 31 May 2026 11:30:50 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from git (uid 1279) (envelope-from git@FreeBSD.org) id 43061 by gitrepo.freebsd.org (DragonFly Mail Agent v0.13+ on gitrepo.freebsd.org); Sun, 31 May 2026 11:30:45 +0000 To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Cc: Joshua Rogers From: Vladimir Kondratyev Subject: git: 8809ea46f105 - main - ukbd: fix SET_REPORT wValue always using report ID 0 for LED output List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-main@freebsd.org Sender: owner-dev-commits-src-main@FreeBSD.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: wulf X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 8809ea46f105b71e87e17c46bce133860f2bf643 Auto-Submitted: auto-generated Date: Sun, 31 May 2026 11:30:45 +0000 Message-Id: <6a1c1be5.43061.2dada001@gitrepo.freebsd.org> The branch main has been updated by wulf: URL: https://cgit.FreeBSD.org/src/commit/?id=8809ea46f105b71e87e17c46bce133860f2bf643 commit 8809ea46f105b71e87e17c46bce133860f2bf643 Author: Joshua Rogers AuthorDate: 2026-05-31 11:29:15 +0000 Commit: Vladimir Kondratyev CommitDate: 2026-05-31 11:29:15 +0000 ukbd: fix SET_REPORT wValue always using report ID 0 for LED output 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 Reviewed by: wulf MFC after: 1 week Pull Request: https://github.com/freebsd/freebsd-src/pull/2210 --- sys/dev/usb/input/ukbd.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/sys/dev/usb/input/ukbd.c b/sys/dev/usb/input/ukbd.c index 104e51c082c3..d012af99fee4 100644 --- a/sys/dev/usb/input/ukbd.c +++ b/sys/dev/usb/input/ukbd.c @@ -957,13 +957,6 @@ ukbd_set_leds_callback(struct usb_xfer *xfer, usb_error_t error) break; sc->sc_flags &= ~UKBD_FLAG_SET_LEDS; - req.bmRequestType = UT_WRITE_CLASS_INTERFACE; - req.bRequest = UR_SET_REPORT; - USETW2(req.wValue, UHID_OUTPUT_REPORT, 0); - req.wIndex[0] = sc->sc_iface_no; - req.wIndex[1] = 0; - req.wLength[1] = 0; - memset(sc->sc_buffer, 0, UKBD_BUFFER_SIZE); id = 0; @@ -1017,11 +1010,18 @@ ukbd_set_leds_callback(struct usb_xfer *xfer, usb_error_t error) } else { usbd_copy_in(pc, 0, sc->sc_buffer + 1, len); } - req.wLength[0] = len; usbd_xfer_set_frame_len(xfer, 1, len); DPRINTF("len=%d, id=%d\n", len, id); + req.bmRequestType = UT_WRITE_CLASS_INTERFACE; + req.bRequest = UR_SET_REPORT; + USETW2(req.wValue, UHID_OUTPUT_REPORT, id); + req.wIndex[0] = sc->sc_iface_no; + req.wIndex[1] = 0; + req.wLength[0] = len; + req.wLength[1] = 0; + /* setup control request last */ pc = usbd_xfer_get_frame(xfer, 0); usbd_copy_in(pc, 0, &req, sizeof(req));