xref: /freebsd/share/man/man4/sg.4 (revision a90b9d0159070121c221b966469c3e36d912bf82)
1.\"
2.\" Copyright (c) 2024 Netflix, Inc.
3.\"
4.\" SPDX-License-Expression: BSD-2-Clause
5.\"
6.Dd May 6, 2024
7.Dt SG 4
8.Os
9.Sh NAME
10.Nm sg
11.Nd Linux ioctl-compatible SCSI passthru device
12.Sh SYNOPSIS
13.Cd device sg
14.Cd device scbus
15.Sh DESCRIPTION
16The
17.Nm
18driver provides a Linux compatible scsi passthru device.
19This driver attaches to all
20.Xr cam 4
21peripheral devices.
22It is similar to the
23.Xr pass 4
24device, but uses the Linux interfaces, rather than the FreeBSD CAM interfaces.
25.Sh IOCTL
26The following subset of the Linux sg ioctl interfaces are implemented:
27.Bl -tag -width 12
28.It Va SG_SET_TIMEOUT
29.Fa u_int to
30Set the timeout in milliseconds.
31.It Va SG_GET_TIMEOUT
32Get the timeout in milliseconds
33.It Va SG_GET_RESERVED_SIZE
34.Fa u_int
35Returns the size of the I/O one can do this device.
36.It Va SG_GET_SCSI_ID
37.Fa struct sg_scsi_id
38Returns the bus number, channel, scsi bus ID number, lun and other information
39about the SCSI device.
40.It Va SG_GET_SG_TABLESIZE
41.Fa u_int
42Returns the table size, though hard wired to 0.
43.It Va SG_GET_VERSION_NUM
44.Fa u_int
45Return the version number that is implemented.
46.It Va SG_IO
47.Fa struct sg_io_hdr
48.El
49All other ioctl interfaces return
50.Va ENODEV .
51.Sh FILES
52.Bl -tag -width ".Pa /dev/sg*" -compact
53.It Pa /dev/sg*
54Passthru devices.
55.El
56.Sh SEE ALSO
57.Xr cam 4 ,
58.Xr pass 4
59.Sh HISTORY
60The
61.Nm
62driver first appeared in
63.Fx 7.0 .
64