xref: /freebsd/share/man/man4/ses.4 (revision fa9896e082a1046ff4fbc75fcba4d18d1f2efc19)
161de7bccSMatt Jacob.\" Copyright (c) 2000
2eddc45e7SJeroen Ruigrok van der Werven.\"	Matthew Jacob <mjacob@FreeBSD.org>.  All rights reserved.
361de7bccSMatt Jacob.\"
461de7bccSMatt Jacob.\" Redistribution and use in source and binary forms, with or without
561de7bccSMatt Jacob.\" modification, are permitted provided that the following conditions
661de7bccSMatt Jacob.\" are met:
761de7bccSMatt Jacob.\" 1. Redistributions of source code must retain the above copyright
861de7bccSMatt Jacob.\"    notice, this list of conditions and the following disclaimer.
961de7bccSMatt Jacob.\"
1061de7bccSMatt Jacob.\" 2. Redistributions in binary form must reproduce the above copyright
1161de7bccSMatt Jacob.\"    notice, this list of conditions and the following disclaimer in the
1261de7bccSMatt Jacob.\"    documentation and/or other materials provided with the distribution.
1361de7bccSMatt Jacob.\"
1461de7bccSMatt Jacob.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
1561de7bccSMatt Jacob.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
1661de7bccSMatt Jacob.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
1761de7bccSMatt Jacob.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
1861de7bccSMatt Jacob.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
1961de7bccSMatt Jacob.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
2061de7bccSMatt Jacob.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
2161de7bccSMatt Jacob.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
2261de7bccSMatt Jacob.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
2361de7bccSMatt Jacob.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
2461de7bccSMatt Jacob.\" SUCH DAMAGE.
2561de7bccSMatt Jacob.\"
26*af4b7924SAlan Somers.Dd November 12, 2019
2761de7bccSMatt Jacob.Dt SES 4
283d45e180SRuslan Ermilov.Os
2961de7bccSMatt Jacob.Sh NAME
3061de7bccSMatt Jacob.Nm ses
31eb083802SRuslan Ermilov.Nd SCSI Environmental Services driver
3261de7bccSMatt Jacob.Sh SYNOPSIS
3361de7bccSMatt Jacob.Cd device ses
3461de7bccSMatt Jacob.Sh DESCRIPTION
3561de7bccSMatt JacobThe
364b66483fSRuslan Ermilov.Nm
3761de7bccSMatt Jacobdriver provides support for all
3861de7bccSMatt Jacob.Tn SCSI
3961de7bccSMatt Jacobdevices of the environmental services class that are attached to the system
4061de7bccSMatt Jacobthrough a supported
4161de7bccSMatt Jacob.Tn SCSI
4261de7bccSMatt JacobHost Adapter, as well as emulated support for SAF-TE (SCSI Accessible
4361de7bccSMatt JacobFault Tolerant Enclosures).
4461de7bccSMatt JacobThe environmental services class generally are enclosure devices that
4561de7bccSMatt Jacobprovide environmental information such as number of power supplies (and
4661de7bccSMatt Jacobstate), temperature, device slots, and so on.
4761de7bccSMatt Jacob.Pp
4861de7bccSMatt JacobA
4961de7bccSMatt Jacob.Tn SCSI
5061de7bccSMatt JacobHost
5161de7bccSMatt Jacobadapter must also be separately configured into the system
5261de7bccSMatt Jacobbefore a
5361de7bccSMatt Jacob.Tn SCSI
54d1ed27b6SJens SchweikhardtEnvironmental Services device can be configured.
5561de7bccSMatt Jacob.Sh KERNEL CONFIGURATION
5661de7bccSMatt JacobIt is only necessary to explicitly configure one
574b66483fSRuslan Ermilov.Nm
5861de7bccSMatt Jacobdevice; data structures are dynamically allocated as devices are found
5961de7bccSMatt Jacobon the
6061de7bccSMatt Jacob.Tn SCSI
6161de7bccSMatt Jacobbus.
6261de7bccSMatt Jacob.Pp
6361de7bccSMatt JacobA separate option,
643136363fSRuslan Ermilov.Va SES_ENABLE_PASSTHROUGH ,
6561de7bccSMatt Jacobmay be specified to allow the
6661de7bccSMatt Jacob.Nm
6761de7bccSMatt Jacobdriver to perform functions on devices of other classes that claim to
6861de7bccSMatt Jacobalso support
693136363fSRuslan Ermilov.Nm
7061de7bccSMatt Jacobfunctionality.
7161de7bccSMatt Jacob.Sh IOCTLS
7261de7bccSMatt JacobThe following
7361de7bccSMatt Jacob.Xr ioctl 2
7461de7bccSMatt Jacobcalls apply to
753136363fSRuslan Ermilov.Nm
7661de7bccSMatt Jacobdevices.
7761de7bccSMatt JacobThey are defined in the header file
78*af4b7924SAlan Somers.In cam/scsi/scsi_enc.h
7961de7bccSMatt Jacob(\fIq.v.\fR).
80*af4b7924SAlan Somers.Bl -tag -width ENCIOC_GETENCSTAT
81*af4b7924SAlan Somers.It Dv ENCIOC_GETNELM
8261de7bccSMatt JacobUsed to find out how many
833136363fSRuslan Ermilov.Nm
84*af4b7924SAlan Somerselements are driven by this particular device instance.
85*af4b7924SAlan Somers.It Dv ENCIOC_GETELMMAP
86*af4b7924SAlan SomersRead, from the kernel, an array of SES elements which contains
87*af4b7924SAlan Somersthe element identifier, which subenclosure it is in, and the
883136363fSRuslan Ermilov.Nm
89*af4b7924SAlan Somerstype of the element.
90*af4b7924SAlan Somers.It Dv ENCIOC_GETENCSTAT
9161de7bccSMatt JacobGet the overall enclosure status.
92*af4b7924SAlan Somers.It Dv ENCIOC_SETENCSTAT
9361de7bccSMatt JacobSet the overall enclosure status.
94*af4b7924SAlan Somers.It Dv ENCIOC_GETELMSTAT
95*af4b7924SAlan SomersGet the status of a particular element.
96*af4b7924SAlan Somers.It Dv ENCIOC_SETELMSTAT
97*af4b7924SAlan SomersSet the status of a particular element.
98*af4b7924SAlan Somers.It Dv ENCIOC_GETTEXT
99*af4b7924SAlan SomersGet the associated help text for an element (not yet implemented).
1003136363fSRuslan Ermilov.Nm
101*af4b7924SAlan Somersdevices often have descriptive text for an element which can tell
10250d922a0SGlen Barberyou things like location (e.g., "left power supply").
103*af4b7924SAlan Somers.It Dv ENCIOC_INIT
10461de7bccSMatt JacobInitialize the enclosure.
105*af4b7924SAlan Somers.It Dv ENCIOC_GETELMDESC
106*af4b7924SAlan SomersGet the element's descriptor string.
107*af4b7924SAlan Somers.It Dv ENCIOC_GETELMDEVNAMES
108*af4b7924SAlan SomersGet the device names, if any, associated with this element.
109*af4b7924SAlan Somers.It Dv ENCIOC_GETSTRING
110*af4b7924SAlan SomersUsed to read the SES String In Diagnostic Page.
111*af4b7924SAlan SomersThe contents of this page are device-specific.
112*af4b7924SAlan Somers.It Dv ENCIOC_SETSTRING
113*af4b7924SAlan SomersUsed to set the SES String Out Diagnostic Page.
114*af4b7924SAlan SomersThe contents of this page are device-specific.
115*af4b7924SAlan Somers.It Dv ENCIOC_GETENCNAME
116*af4b7924SAlan SomersUsed to get the name of the enclosure.
117*af4b7924SAlan Somers.It Dv ENCIOC_GETENCID
118*af4b7924SAlan SomersUsed to get the Enclosure Logical Identifier.
1193136363fSRuslan Ermilov.El
1201e8b4cd2SMike Pritchard.Sh EXAMPLE USAGE
12161de7bccSMatt JacobThe files contained in
1220060ae18SCy Schubert.In /usr/share/examples/ses
12361de7bccSMatt Jacobshow simple mechanisms for how to use these interfaces, as well as a
12461de7bccSMatt Jacobvery stupid simple monitoring daemon.
12561de7bccSMatt Jacob.Sh FILES
12661de7bccSMatt Jacob.Bl -tag -width /dev/rsdXXXXX -compact
12761de7bccSMatt Jacob.It Pa /dev/ses Ns Ar N
1281e8b4cd2SMike PritchardThe
1291e8b4cd2SMike Pritchard.Em Nth
1301e8b4cd2SMike Pritchard.Nm SES
1311e8b4cd2SMike Pritcharddevice.
1323136363fSRuslan Ermilov.El
13361de7bccSMatt Jacob.Sh DIAGNOSTICS
13461de7bccSMatt JacobWhen the kernel is configured with
13561de7bccSMatt Jacob.Tn DEBUG
13661de7bccSMatt Jacobenabled, the first open to an SES device will spit out overall enclosure
13761de7bccSMatt Jacobparameters to the console.
1386fa997e2SBaptiste Daroussin.Sh SEE ALSO
1396fa997e2SBaptiste Daroussin.Xr sesutil 8
14061de7bccSMatt Jacob.Sh HISTORY
14161de7bccSMatt JacobThe
14261de7bccSMatt Jacob.Nm
143*af4b7924SAlan Somersdriver was originally written for the
14461de7bccSMatt Jacob.Tn CAM
14561de7bccSMatt Jacob.Tn SCSI
146*af4b7924SAlan Somerssubsystem by Matthew Jacob and first released in
147*af4b7924SAlan Somers.Fx 4.3 .
148*af4b7924SAlan SomersIt was a functional equivalent of a similar
1491e8b4cd2SMike Pritcharddriver available in Solaris, Release 7.
150*af4b7924SAlan SomersIt was largely rewritten by Alexander Motin, Justin Gibbs, and Will Andrews for
151*af4b7924SAlan Somers.Fx 9.2 .
152