blob: ac549452cc9378b80e79762825f315032c3f7cb1 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
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 ioctl-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 .
|