xref: /freebsd/share/man/man4/ses.4 (revision a90b9d0159070121c221b966469c3e36d912bf82)
1.\" Copyright (c) 2000
2.\"	Matthew Jacob <mjacob@FreeBSD.org>.  All rights reserved.
3.\"
4.\" Redistribution and use in source and binary forms, with or without
5.\" modification, are permitted provided that the following conditions
6.\" are met:
7.\" 1. Redistributions of source code must retain the above copyright
8.\"    notice, this list of conditions and the following disclaimer.
9.\"
10.\" 2. Redistributions in binary form must reproduce the above copyright
11.\"    notice, this list of conditions and the following disclaimer in the
12.\"    documentation and/or other materials provided with the distribution.
13.\"
14.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
15.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
16.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
17.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
18.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
19.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
20.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
21.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
22.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
23.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
24.\" SUCH DAMAGE.
25.\"
26.Dd November 12, 2019
27.Dt SES 4
28.Os
29.Sh NAME
30.Nm ses
31.Nd SCSI Environmental Services driver
32.Sh SYNOPSIS
33.Cd device ses
34.Sh DESCRIPTION
35The
36.Nm
37driver provides support for all
38.Tn SCSI
39devices of the environmental services class that are attached to the system
40through a supported
41.Tn SCSI
42Host Adapter, as well as emulated support for SAF-TE (SCSI Accessible
43Fault Tolerant Enclosures).
44The environmental services class generally are enclosure devices that
45provide environmental information such as number of power supplies (and
46state), temperature, device slots, and so on.
47.Pp
48A
49.Tn SCSI
50Host
51adapter must also be separately configured into the system
52before a
53.Tn SCSI
54Environmental Services device can be configured.
55.Sh KERNEL CONFIGURATION
56It is only necessary to explicitly configure one
57.Nm
58device; data structures are dynamically allocated as devices are found
59on the
60.Tn SCSI
61bus.
62.Pp
63A separate option,
64.Va SES_ENABLE_PASSTHROUGH ,
65may be specified to allow the
66.Nm
67driver to perform functions on devices of other classes that claim to
68also support
69.Nm
70functionality.
71.Sh IOCTLS
72The following
73.Xr ioctl 2
74calls apply to
75.Nm
76devices.
77They are defined in the header file
78.In cam/scsi/scsi_enc.h
79(\fIq.v.\fR).
80.Bl -tag -width ENCIOC_GETENCSTAT
81.It Dv ENCIOC_GETNELM
82Used to find out how many
83.Nm
84elements are driven by this particular device instance.
85.It Dv ENCIOC_GETELMMAP
86Read, from the kernel, an array of SES elements which contains
87the element identifier, which subenclosure it is in, and the
88.Nm
89type of the element.
90.It Dv ENCIOC_GETENCSTAT
91Get the overall enclosure status.
92.It Dv ENCIOC_SETENCSTAT
93Set the overall enclosure status.
94.It Dv ENCIOC_GETELMSTAT
95Get the status of a particular element.
96.It Dv ENCIOC_SETELMSTAT
97Set the status of a particular element.
98.It Dv ENCIOC_GETTEXT
99Get the associated help text for an element (not yet implemented).
100.Nm
101devices often have descriptive text for an element which can tell
102you things like location (e.g., "left power supply").
103.It Dv ENCIOC_INIT
104Initialize the enclosure.
105.It Dv ENCIOC_GETELMDESC
106Get the element's descriptor string.
107.It Dv ENCIOC_GETELMDEVNAMES
108Get the device names, if any, associated with this element.
109.It Dv ENCIOC_GETSTRING
110Used to read the SES String In Diagnostic Page.
111The contents of this page are device-specific.
112.It Dv ENCIOC_SETSTRING
113Used to set the SES String Out Diagnostic Page.
114The contents of this page are device-specific.
115.It Dv ENCIOC_GETENCNAME
116Used to get the name of the enclosure.
117.It Dv ENCIOC_GETENCID
118Used to get the Enclosure Logical Identifier.
119.El
120.Sh EXAMPLE USAGE
121The files contained in
122.In /usr/share/examples/ses
123show simple mechanisms for how to use these interfaces, as well as a
124very stupid simple monitoring daemon.
125.Sh FILES
126.Bl -tag -width /dev/rsdXXXXX -compact
127.It Pa /dev/ses Ns Ar N
128The
129.Em Nth
130.Nm SES
131device.
132.El
133.Sh DIAGNOSTICS
134When the kernel is configured with
135.Tn DEBUG
136enabled, the first open to an SES device will spit out overall enclosure
137parameters to the console.
138.Sh SEE ALSO
139.Xr sesutil 8
140.Sh HISTORY
141The
142.Nm
143driver was originally written for the
144.Tn CAM
145.Tn SCSI
146subsystem by Matthew Jacob and first released in
147.Fx 4.3 .
148It was a functional equivalent of a similar
149driver available in Solaris, Release 7.
150It was largely rewritten by Alexander Motin, Justin Gibbs, and Will Andrews for
151.Fx 9.2 .
152