From nobody Mon Jul 21 06:17:16 2025 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 4blqth66Nkz62DJn; Mon, 21 Jul 2025 06:17:16 +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 "R10" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4blqth4RBHz3Sqx; Mon, 21 Jul 2025 06:17:16 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753078636; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=gdKB3jXMUcAhPRzgPvydRCZrO6h5SPxuvSo+SZnM6X0=; b=S8Y6ZFCvbVqhAQTJ2ki3sCaYDN4QmC4SBhQ1t1M5TKrkqQ2zq3krxu8/lH0fLl1XFZWIab Ifkkc/jBl1BakYjeos3G5hVv96eYqCVevjZySuSN4bcX6nbsRusoxYBW0sf4xK6Ah0tWww 6gn84d1GC4RYpdDtgkxCJ3VIY2FtnA+Lh6oWR5odepIHr++jsLZTBjmzK8D9wGtrLfB0+V 4ysW7hIzIrXMBv9Uel4luSydk3JoVXwkUZRuAzRddAjHt8ynMUPoPzTDNz76p1DZ5ndIns ywVLnruQe6egrI57CXvJMGdcJWYwoCf+yR/t3Gc8xFlzamLWEdn7PsGln45z/g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1753078636; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=gdKB3jXMUcAhPRzgPvydRCZrO6h5SPxuvSo+SZnM6X0=; b=jAeM1qHKrLkznnwi6wZOHyojHvKQiow5bBpyuorxAr7A32CPveYoZz4JUd7kXgafbFgvUT DtP+YIr/vGRaZiEBr7Y9OYDRX8kqi5+n9exfNQ5ek05979dOSkqBvAWylhN0UZqocV8jKh B2p0aSW4sSgTKRQRdCo+epWLhQ15D26M/ors7Pc0DkbpZjafZW1Zf2t3M7ngUTX5PLMOLt ZdDWPeL39CIF52KEo+pa5aox9S3NTZGKTJijOhO8IzhNz9leawNZyEjesqL1kgMoZ98WYy fHV93AwIKiDqQfdxQX7l0Cez1kuwja0guaVP0PHr6b4kRlbPc5+ytpkTLT48CA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1753078636; a=rsa-sha256; cv=none; b=ORLxUACP1gy86J1x1aB2y3B6cj3XaW1LFHtp40v63rc7A2ryakd+YFqRYYgLPaWMOPeT0F 4v4BAf+3Z5R6lpyxWal0d47r081CoOmr5jIHwmR5EHVMPQvsyF4y4fIb1DtvJVeJzWQjg9 tXB83pGesyp/Qyd3Zda5nQnXdDiitSdMvIo+j4vA6yzLVTn7U50mlZXV+G7k6qgopgXU4n 9/8OlPyfqEbT6skxHEhK4VWqaXUSZyF8obMGLqJuXbm+iJS0f320U1mmtrV1eX1JWP3Njb fPD2ovuaxSwovSGIMUSObzt/X8Y8mfWgxuj66+XAAJz/DGKx96UnDha61PC4ng== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (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 did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4blqth42h0zmnL; Mon, 21 Jul 2025 06:17:16 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.18.1/8.18.1) with ESMTP id 56L6HGD4071371; Mon, 21 Jul 2025 06:17:16 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.18.1/8.18.1/Submit) id 56L6HGMj071368; Mon, 21 Jul 2025 06:17:16 GMT (envelope-from git) Date: Mon, 21 Jul 2025 06:17:16 GMT Message-Id: <202507210617.56L6HGMj071368@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: ShengYi Hung Subject: git: 3eda34934097 - main - libusb: implement libusb_fill_bulk_stream_transfer 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 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: aokblast X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 3eda34934097f5cbf1e4a91d3b7acb58904be85e Auto-Submitted: auto-generated The branch main has been updated by aokblast: URL: https://cgit.FreeBSD.org/src/commit/?id=3eda34934097f5cbf1e4a91d3b7acb58904be85e commit 3eda34934097f5cbf1e4a91d3b7acb58904be85e Author: ShengYi Hung AuthorDate: 2025-07-09 11:27:26 +0000 Commit: ShengYi Hung CommitDate: 2025-07-21 06:16:41 +0000 libusb: implement libusb_fill_bulk_stream_transfer Bulk streams are essentially bulk transfers with a stream ID. All requirements from both libusb20 and the kernel are already handled; we just need to set the stream ID. Approved by: markj (mentor), lwhsu(mentor) Differential Revision: https://reviews.freebsd.org/D51226 --- lib/libusb/libusb.h | 1 + lib/libusb/libusb10.c | 1 + lib/libusb/libusb10_io.c | 13 +++++++++++++ 3 files changed, 15 insertions(+) diff --git a/lib/libusb/libusb.h b/lib/libusb/libusb.h index 57478c1787ee..1803ff637738 100644 --- a/lib/libusb/libusb.h +++ b/lib/libusb/libusb.h @@ -122,6 +122,7 @@ enum libusb_transfer_type { LIBUSB_TRANSFER_TYPE_ISOCHRONOUS = 1, LIBUSB_TRANSFER_TYPE_BULK = 2, LIBUSB_TRANSFER_TYPE_INTERRUPT = 3, + LIBUSB_TRANSFER_TYPE_BULK_STREAM = 4, }; enum libusb_standard_request { diff --git a/lib/libusb/libusb10.c b/lib/libusb/libusb10.c index 6bfc01eb8c4e..5c116b39ea17 100644 --- a/lib/libusb/libusb10.c +++ b/lib/libusb/libusb10.c @@ -1530,6 +1530,7 @@ found: libusb20_tr_set_callback(pxfer0, libusb10_isoc_proxy); break; case LIBUSB_TRANSFER_TYPE_BULK: + case LIBUSB_TRANSFER_TYPE_BULK_STREAM: case LIBUSB_TRANSFER_TYPE_INTERRUPT: libusb20_tr_set_callback(pxfer0, libusb10_bulk_intr_proxy); break; diff --git a/lib/libusb/libusb10_io.c b/lib/libusb/libusb10_io.c index ea365162df5a..c99586ff650d 100644 --- a/lib/libusb/libusb10_io.c +++ b/lib/libusb/libusb10_io.c @@ -780,6 +780,19 @@ libusb_fill_interrupt_transfer(struct libusb_transfer *transfer, transfer->callback = callback; } +void +libusb_fill_bulk_stream_transfer(struct libusb_transfer *transfer, + libusb_device_handle *dev_handle, unsigned char endpoint, + uint32_t stream_id, unsigned char *buffer, int length, + libusb_transfer_cb_fn callback, void *user_data, unsigned int timeout) +{ + libusb_fill_bulk_transfer(transfer, dev_handle, endpoint, buffer, + length, callback, user_data, timeout); + transfer->type = LIBUSB_TRANSFER_TYPE_BULK_STREAM; + + libusb_transfer_set_stream_id(transfer, stream_id); +} + void libusb_fill_iso_transfer(struct libusb_transfer *transfer, libusb_device_handle *devh, uint8_t endpoint, uint8_t *buf,