xref: /freebsd/share/man/man4/sg.4 (revision 58e44aa01101d420c9d7021a788b6074b7183286)
108b45203SWarner Losh.\"
208b45203SWarner Losh.\" Copyright (c) 2024 Netflix, Inc.
308b45203SWarner Losh.\"
408b45203SWarner Losh.\" SPDX-License-Expression: BSD-2-Clause
508b45203SWarner Losh.\"
608b45203SWarner Losh.Dd May 6, 2024
708b45203SWarner Losh.Dt SG 4
808b45203SWarner Losh.Os
908b45203SWarner Losh.Sh NAME
1008b45203SWarner Losh.Nm sg
11*58e44aa0SWarner Losh.Nd Linux ioctl-compatible SCSI passthru device
1208b45203SWarner Losh.Sh SYNOPSIS
1308b45203SWarner Losh.Cd device sg
1408b45203SWarner Losh.Cd device scbus
1508b45203SWarner Losh.Sh DESCRIPTION
1608b45203SWarner LoshThe
1708b45203SWarner Losh.Nm
1808b45203SWarner Loshdriver provides a Linux compatible scsi passthru device.
1908b45203SWarner LoshThis driver attaches to all
2008b45203SWarner Losh.Xr cam 4
2108b45203SWarner Loshperipheral devices.
2208b45203SWarner LoshIt is similar to the
2308b45203SWarner Losh.Xr pass 4
2408b45203SWarner Loshdevice, but uses the Linux interfaces, rather than the FreeBSD CAM interfaces.
2508b45203SWarner Losh.Sh IOCTL
2608b45203SWarner LoshThe following subset of the Linux sg ioctl interfaces are implemented:
2708b45203SWarner Losh.Bl -tag -width 12
2808b45203SWarner Losh.It Va SG_SET_TIMEOUT
2908b45203SWarner Losh.Fa u_int to
3008b45203SWarner LoshSet the timeout in milliseconds.
3108b45203SWarner Losh.It Va SG_GET_TIMEOUT
3208b45203SWarner LoshGet the timeout in milliseconds
3308b45203SWarner Losh.It Va SG_GET_RESERVED_SIZE
3408b45203SWarner Losh.Fa u_int
3508b45203SWarner LoshReturns the size of the I/O one can do this device.
3608b45203SWarner Losh.It Va SG_GET_SCSI_ID
3708b45203SWarner Losh.Fa struct sg_scsi_id
3808b45203SWarner LoshReturns the bus number, channel, scsi bus ID number, lun and other information
3908b45203SWarner Loshabout the SCSI device.
4008b45203SWarner Losh.It Va SG_GET_SG_TABLESIZE
4108b45203SWarner Losh.Fa u_int
4208b45203SWarner LoshReturns the table size, though hard wired to 0.
4308b45203SWarner Losh.It Va SG_GET_VERSION_NUM
4408b45203SWarner Losh.Fa u_int
4508b45203SWarner LoshReturn the version number that is implemented.
4608b45203SWarner Losh.It Va SG_IO
4708b45203SWarner Losh.Fa struct sg_io_hdr
4808b45203SWarner Losh.El
4908b45203SWarner LoshAll other ioctl interfaces return
5008b45203SWarner Losh.Va ENODEV .
5108b45203SWarner Losh.Sh FILES
5208b45203SWarner Losh.Bl -tag -width ".Pa /dev/sg*" -compact
5308b45203SWarner Losh.It Pa /dev/sg*
5408b45203SWarner LoshPassthru devices.
5508b45203SWarner Losh.El
5608b45203SWarner Losh.Sh SEE ALSO
5708b45203SWarner Losh.Xr cam 4 ,
5808b45203SWarner Losh.Xr pass 4
5908b45203SWarner Losh.Sh HISTORY
6008b45203SWarner LoshThe
6108b45203SWarner Losh.Nm
6208b45203SWarner Loshdriver first appeared in
6308b45203SWarner Losh.Fx 7.0 .
64