From nobody Wed May 22 21:11:00 2024 X-Original-To: dev-commits-src-branches@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 4Vl3r439sbz5L1Z7; Wed, 22 May 2024 21:11:00 +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 "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Vl3r42kw9z4JX8; Wed, 22 May 2024 21:11:00 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1716412260; 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=hgbWhybwHRMelHo0DOlxBVzHIHATGc8MJkZv+jR+QTM=; b=l8MYWJBNFObpuUS1+GCtsZTwThWWyxApTQ+sd6NA0UebjDxYiXkB0TBF6p23B0DmAAe4Ht tVfOhzRVH275y8gZVnuyUTGyOp0iWU3MmxBPjsTMPqOZ9oI9o6/GxgQR3n9dJTEQHA7ApA zPJRlI/5U7E0dfOkeyY/784/KZOxsrE8dP0VRLDKEDpckJ9KLhWTYWC7bd49jIjRuguTI/ uD84XtAsbtTA9B3Ot7deg8xgsO8+sP3eUrTIgjRLMqeFAmRQ6DpVcPYUJbppRiGT57oe/w JjsbwkerywFudR9QhHMdYvdIZAGG4uShiIrJ02cpvLanumUxjrDITFAly5xdiQ== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1716412260; a=rsa-sha256; cv=none; b=PPvIeHx4/nU9IQyRT4oWwkDQXByzLLc++8gDWtUEzMj1NrfnO8v2NSReRqvfiuWvyK+UIa DgkIeaG7utddVd3LYfWPKj7MLowPntM3TX3Q/wTiWY/HBuKQB2m+MbB08j7bUAnMZTcShw 5aO8Yxe50hgdcebRAkM9SQv2yuvHJObDS/CdR+5vjq2UzgyB6ar9IF6YE/BkDnPAoveZy0 O0wTwxKlHEgBx6zsIwqj8zN2AdORkIXwBa91VeYX7EvnUcuJnvq0QpZLiVb1VlT9W1g2N0 kc9uCiZ3QsTbAb5jCunD5bWnfotTnbLMsNrzm29332ZcsvD8XOegz4CQPhaw7Q== 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=1716412260; 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=hgbWhybwHRMelHo0DOlxBVzHIHATGc8MJkZv+jR+QTM=; b=LRLt3fM0QIK9iBR2DA+3bYltI/Hxrqq9huoszhpwjhuIPWXZsQ7by2uO6WAcsNOKLa9fq1 kGOkjBbvYlmjr+2x/m3l/vdIhDfX0oLRky273TNiS6VqA38UAVH4sP6ucJAKFVa1JFeQq+ QsKM93Lf5JcnaJX75bSvEtt7wC8xC7x/VW1QpfrD2o6/WR6RT9T/erUfD8R/bT17huf3AA foGF89gI0kFz73URgPgmTwiw95ZQzI11tqMB3t4orveChwHBW5L6eQXkeN2IwjlEnyBYNQ MpxZkNkf60pVG+xpRTF7S01I2po9bV/9S01omPrN+2etI5sBZ6cmlhl2oSMVaw== 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 4Vl3r423SxzLYy; Wed, 22 May 2024 21:11:00 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 44MLB0bg094221; Wed, 22 May 2024 21:11:00 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 44MLB0GY094218; Wed, 22 May 2024 21:11:00 GMT (envelope-from git) Date: Wed, 22 May 2024 21:11:00 GMT Message-Id: <202405222111.44MLB0GY094218@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Warner Losh Subject: git: 6a61917a4b64 - stable/14 - sg: Add sg(4) man page List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: X-BeenThere: dev-commits-src-branches@freebsd.org Sender: owner-dev-commits-src-branches@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/stable/14 X-Git-Reftype: branch X-Git-Commit: 6a61917a4b641c2e3ebba19bd13a0e5472b6885f Auto-Submitted: auto-generated The branch stable/14 has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=6a61917a4b641c2e3ebba19bd13a0e5472b6885f commit 6a61917a4b641c2e3ebba19bd13a0e5472b6885f Author: Warner Losh AuthorDate: 2024-05-06 22:28:09 +0000 Commit: Warner Losh CommitDate: 2024-05-22 21:10:51 +0000 sg: Add sg(4) man page Add minimal sg(4) manual page. This implements a subset of the Linux IOCTL interface for either native FreeBSD programs, or for Linux binaries in the linuxulator. Noticed by: Lexi Winter Sponsored by: Netflix (cherry picked from commit 08b4520338349bc065ec184b32a6e700cb8e34ec) --- share/man/man4/Makefile | 1 + share/man/man4/sg.4 | 63 +++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 64 insertions(+) diff --git a/share/man/man4/Makefile b/share/man/man4/Makefile index 222422526180..a97c92b960f5 100644 --- a/share/man/man4/Makefile +++ b/share/man/man4/Makefile @@ -492,6 +492,7 @@ MAN= aac.4 \ send.4 \ ses.4 \ ${_sfxge.4} \ + sg.4 \ sge.4 \ siba.4 \ siftr.4 \ diff --git a/share/man/man4/sg.4 b/share/man/man4/sg.4 new file mode 100644 index 000000000000..bf7cb93cfb09 --- /dev/null +++ b/share/man/man4/sg.4 @@ -0,0 +1,63 @@ +.\" +.\" Copyright (c) 2024 Netflix, Inc. +.\" +.\" SPDX-License-Expression: BSD-2-Clause +.\" +.Dd May 6, 2024 +.Dt SG 4 +.Os +.Sh NAME +.Nm sg +.Nd Linux ioclt-compatible SCSI passthru device +.Sh SYNOPSIS +.Cd device sg +.Cd device scbus +.Sh DESCRIPTION +The +.Nm +driver provides a Linux compatible scsi passthru device. +This driver attaches to all +.Xr cam 4 +peripheral devices. +It is similar to the +.Xr pass 4 +device, but uses the Linux interfaces, rather than the FreeBSD CAM interfaces. +.Sh IOCTL +The following subset of the Linux sg ioctl interfaces are implemented: +.Bl -tag -width 12 +.It Va SG_SET_TIMEOUT +.Fa u_int to +Set the timeout in milliseconds. +.It Va SG_GET_TIMEOUT +Get the timeout in milliseconds +.It Va SG_GET_RESERVED_SIZE +.Fa u_int +Returns the size of the I/O one can do this device. +.It Va SG_GET_SCSI_ID +.Fa struct sg_scsi_id +Returns the bus number, channel, scsi bus ID number, lun and other information +about the SCSI device. +.It Va SG_GET_SG_TABLESIZE +.Fa u_int +Returns the table size, though hard wired to 0. +.It Va SG_GET_VERSION_NUM +.Fa u_int +Return the version number that is implemented. +.It Va SG_IO +.Fa struct sg_io_hdr +.El +All other ioctl interfaces return +.Va ENODEV . +.Sh FILES +.Bl -tag -width ".Pa /dev/sg*" -compact +.It Pa /dev/sg* +Passthru devices. +.El +.Sh SEE ALSO +.Xr cam 4 , +.Xr pass 4 +.Sh HISTORY +The +.Nm +driver first appeared in +.Fx 7.0 .