public inbox for io-uring@vger.kernel.org
 help / color / mirror / Atom feed
From: Yang Xiuwei <yangxiuwei@kylinos.cn>
To: linux-scsi@vger.kernel.org, linux-block@vger.kernel.org,
	io-uring@vger.kernel.org
Cc: fujita.tomonori@lab.ntt.co.jp, axboe@kernel.dk,
	James.Bottomley@HansenPartnership.com,
	martin.petersen@oracle.com, bvanassche@acm.org,
	Yang Xiuwei <yangxiuwei@kylinos.cn>
Subject: [RFC PATCH v3 1/3] bsg: add bsg_uring_cmd uapi structure
Date: Fri, 16 Jan 2026 12:25:14 +0800	[thread overview]
Message-ID: <d169069cabe953ea7515b08cfe27aaf25678105b.1768536312.git.yangxiuwei@kylinos.cn> (raw)
In-Reply-To: <cover.1768536312.git.yangxiuwei@kylinos.cn>

Add the bsg_uring_cmd structure to the BSG UAPI header to support
io_uring-based SCSI passthrough operations via IORING_OP_URING_CMD.

Signed-off-by: Yang Xiuwei <yangxiuwei@kylinos.cn>
---
 include/uapi/linux/bsg.h | 24 ++++++++++++++++++++++++
 1 file changed, 24 insertions(+)

diff --git a/include/uapi/linux/bsg.h b/include/uapi/linux/bsg.h
index cd6302def5ed..d9514b99b7a9 100644
--- a/include/uapi/linux/bsg.h
+++ b/include/uapi/linux/bsg.h
@@ -63,5 +63,29 @@ struct sg_io_v4 {
 	__u32 padding;
 };
 
+struct bsg_uring_cmd {
+	/* Command request related */
+	__u64 request;		/* [i], [*i] command descriptor address */
+	__u32 request_len;	/* [i] command descriptor length in bytes */
+	__u32 protocol;		/* [i] protocol type (BSG_PROTOCOL_*) */
+	__u32 subprotocol;	/* [i] subprotocol type (BSG_SUB_PROTOCOL_*) */
+	__u32 max_response_len;	/* [i] response buffer size in bytes */
+	/* Response data related */
+	__u64 response;		/* [i], [*o] response data address */
+	/* Data transfer related - dout */
+	__u64 dout_xferp;	/* [i], [*i] */
+	__u32 dout_xfer_len;	/* [i] bytes to be transferred to device */
+	__u32 dout_iovec_count;	/* [i] 0 -> "flat" dout transfer else
+				 * dout_xferp points to array of iovec
+				 */
+	/* Data transfer related - din */
+	__u64 din_xferp;	/* [i], [*o] */
+	__u32 din_xfer_len;	/* [i] bytes to be transferred from device */
+	__u32 din_iovec_count;	/* [i] 0 -> "flat" din transfer */
+	/* Control related */
+	__u32 timeout_ms;	/* [i] timeout in milliseconds */
+	__u32 flags;		/* [i] bit mask */
+	__u8  reserved[8];	/* reserved for future extension */
+};
 
 #endif /* _UAPIBSG_H */
-- 
2.25.1


  reply	other threads:[~2026-01-16  4:26 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-01-15  1:24 [RFC PATCH v2 0/3] bsg: add io_uring command support for SCSI passthrough Yang Xiuwei
2026-01-15  1:24 ` [RFC PATCH v2 1/3] bsg: add bsg_uring_cmd uapi structure Yang Xiuwei
2026-01-15  1:24 ` [RFC PATCH v2 2/3] bsg: add uring_cmd support to BSG generic layer Yang Xiuwei
2026-01-15  1:24 ` [RFC PATCH v2 3/3] bsg: implement SCSI BSG uring_cmd handler Yang Xiuwei
2026-01-16  4:25 ` [RFC PATCH v3 0/3] bsg: add io_uring command support for SCSI passthrough Yang Xiuwei
2026-01-16  4:25   ` Yang Xiuwei [this message]
2026-01-16  4:25   ` [RFC PATCH v3 2/3] bsg: add uring_cmd support to BSG generic layer Yang Xiuwei
2026-01-16  4:25   ` [RFC PATCH v3 3/3] bsg: implement SCSI BSG uring_cmd handler Yang Xiuwei
2026-01-16  4:52   ` [RFC PATCH v3 0/3] bsg: add io_uring command support for SCSI passthrough Yang Xiuwei

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=d169069cabe953ea7515b08cfe27aaf25678105b.1768536312.git.yangxiuwei@kylinos.cn \
    --to=yangxiuwei@kylinos.cn \
    --cc=James.Bottomley@HansenPartnership.com \
    --cc=axboe@kernel.dk \
    --cc=bvanassche@acm.org \
    --cc=fujita.tomonori@lab.ntt.co.jp \
    --cc=io-uring@vger.kernel.org \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-scsi@vger.kernel.org \
    --cc=martin.petersen@oracle.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox