xref: /freebsd/share/man/man4/ses.4 (revision af4b7924f17d95e6698305ce27f59b783dd66b4b)
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.\"
2661de7bccSMatt Jacob.\" $FreeBSD$
2761de7bccSMatt Jacob.\"
28*af4b7924SAlan Somers.Dd November 12, 2019
2961de7bccSMatt Jacob.Dt SES 4
303d45e180SRuslan Ermilov.Os
3161de7bccSMatt Jacob.Sh NAME
3261de7bccSMatt Jacob.Nm ses
33eb083802SRuslan Ermilov.Nd SCSI Environmental Services driver
3461de7bccSMatt Jacob.Sh SYNOPSIS
3561de7bccSMatt Jacob.Cd device ses
3661de7bccSMatt Jacob.Sh DESCRIPTION
3761de7bccSMatt JacobThe
384b66483fSRuslan Ermilov.Nm
3961de7bccSMatt Jacobdriver provides support for all
4061de7bccSMatt Jacob.Tn SCSI
4161de7bccSMatt Jacobdevices of the environmental services class that are attached to the system
4261de7bccSMatt Jacobthrough a supported
4361de7bccSMatt Jacob.Tn SCSI
4461de7bccSMatt JacobHost Adapter, as well as emulated support for SAF-TE (SCSI Accessible
4561de7bccSMatt JacobFault Tolerant Enclosures).
4661de7bccSMatt JacobThe environmental services class generally are enclosure devices that
4761de7bccSMatt Jacobprovide environmental information such as number of power supplies (and
4861de7bccSMatt Jacobstate), temperature, device slots, and so on.
4961de7bccSMatt Jacob.Pp
5061de7bccSMatt JacobA
5161de7bccSMatt Jacob.Tn SCSI
5261de7bccSMatt JacobHost
5361de7bccSMatt Jacobadapter must also be separately configured into the system
5461de7bccSMatt Jacobbefore a
5561de7bccSMatt Jacob.Tn SCSI
56d1ed27b6SJens SchweikhardtEnvironmental Services device can be configured.
5761de7bccSMatt Jacob.Sh KERNEL CONFIGURATION
5861de7bccSMatt JacobIt is only necessary to explicitly configure one
594b66483fSRuslan Ermilov.Nm
6061de7bccSMatt Jacobdevice; data structures are dynamically allocated as devices are found
6161de7bccSMatt Jacobon the
6261de7bccSMatt Jacob.Tn SCSI
6361de7bccSMatt Jacobbus.
6461de7bccSMatt Jacob.Pp
6561de7bccSMatt JacobA separate option,
663136363fSRuslan Ermilov.Va SES_ENABLE_PASSTHROUGH ,
6761de7bccSMatt Jacobmay be specified to allow the
6861de7bccSMatt Jacob.Nm
6961de7bccSMatt Jacobdriver to perform functions on devices of other classes that claim to
7061de7bccSMatt Jacobalso support
713136363fSRuslan Ermilov.Nm
7261de7bccSMatt Jacobfunctionality.
7361de7bccSMatt Jacob.Sh IOCTLS
7461de7bccSMatt JacobThe following
7561de7bccSMatt Jacob.Xr ioctl 2
7661de7bccSMatt Jacobcalls apply to
773136363fSRuslan Ermilov.Nm
7861de7bccSMatt Jacobdevices.
7961de7bccSMatt JacobThey are defined in the header file
80*af4b7924SAlan Somers.In cam/scsi/scsi_enc.h
8161de7bccSMatt Jacob(\fIq.v.\fR).
82*af4b7924SAlan Somers.Bl -tag -width ENCIOC_GETENCSTAT
83*af4b7924SAlan Somers.It Dv ENCIOC_GETNELM
8461de7bccSMatt JacobUsed to find out how many
853136363fSRuslan Ermilov.Nm
86*af4b7924SAlan Somerselements are driven by this particular device instance.
87*af4b7924SAlan Somers.It Dv ENCIOC_GETELMMAP
88*af4b7924SAlan SomersRead, from the kernel, an array of SES elements which contains
89*af4b7924SAlan Somersthe element identifier, which subenclosure it is in, and the
903136363fSRuslan Ermilov.Nm
91*af4b7924SAlan Somerstype of the element.
92*af4b7924SAlan Somers.It Dv ENCIOC_GETENCSTAT
9361de7bccSMatt JacobGet the overall enclosure status.
94*af4b7924SAlan Somers.It Dv ENCIOC_SETENCSTAT
9561de7bccSMatt JacobSet the overall enclosure status.
96*af4b7924SAlan Somers.It Dv ENCIOC_GETELMSTAT
97*af4b7924SAlan SomersGet the status of a particular element.
98*af4b7924SAlan Somers.It Dv ENCIOC_SETELMSTAT
99*af4b7924SAlan SomersSet the status of a particular element.
100*af4b7924SAlan Somers.It Dv ENCIOC_GETTEXT
101*af4b7924SAlan SomersGet the associated help text for an element (not yet implemented).
1023136363fSRuslan Ermilov.Nm
103*af4b7924SAlan Somersdevices often have descriptive text for an element which can tell
10450d922a0SGlen Barberyou things like location (e.g., "left power supply").
105*af4b7924SAlan Somers.It Dv ENCIOC_INIT
10661de7bccSMatt JacobInitialize the enclosure.
107*af4b7924SAlan Somers.It Dv ENCIOC_GETELMDESC
108*af4b7924SAlan SomersGet the element's descriptor string.
109*af4b7924SAlan Somers.It Dv ENCIOC_GETELMDEVNAMES
110*af4b7924SAlan SomersGet the device names, if any, associated with this element.
111*af4b7924SAlan Somers.It Dv ENCIOC_GETSTRING
112*af4b7924SAlan SomersUsed to read the SES String In Diagnostic Page.
113*af4b7924SAlan SomersThe contents of this page are device-specific.
114*af4b7924SAlan Somers.It Dv ENCIOC_SETSTRING
115*af4b7924SAlan SomersUsed to set the SES String Out Diagnostic Page.
116*af4b7924SAlan SomersThe contents of this page are device-specific.
117*af4b7924SAlan Somers.It Dv ENCIOC_GETENCNAME
118*af4b7924SAlan SomersUsed to get the name of the enclosure.
119*af4b7924SAlan Somers.It Dv ENCIOC_GETENCID
120*af4b7924SAlan SomersUsed to get the Enclosure Logical Identifier.
1213136363fSRuslan Ermilov.El
1221e8b4cd2SMike Pritchard.Sh EXAMPLE USAGE
12361de7bccSMatt JacobThe files contained in
1240060ae18SCy Schubert.In /usr/share/examples/ses
12561de7bccSMatt Jacobshow simple mechanisms for how to use these interfaces, as well as a
12661de7bccSMatt Jacobvery stupid simple monitoring daemon.
12761de7bccSMatt Jacob.Sh FILES
12861de7bccSMatt Jacob.Bl -tag -width /dev/rsdXXXXX -compact
12961de7bccSMatt Jacob.It Pa /dev/ses Ns Ar N
1301e8b4cd2SMike PritchardThe
1311e8b4cd2SMike Pritchard.Em Nth
1321e8b4cd2SMike Pritchard.Nm SES
1331e8b4cd2SMike Pritcharddevice.
1343136363fSRuslan Ermilov.El
13561de7bccSMatt Jacob.Sh DIAGNOSTICS
13661de7bccSMatt JacobWhen the kernel is configured with
13761de7bccSMatt Jacob.Tn DEBUG
13861de7bccSMatt Jacobenabled, the first open to an SES device will spit out overall enclosure
13961de7bccSMatt Jacobparameters to the console.
1406fa997e2SBaptiste Daroussin.Sh SEE ALSO
1416fa997e2SBaptiste Daroussin.Xr sesutil 8
14261de7bccSMatt Jacob.Sh HISTORY
14361de7bccSMatt JacobThe
14461de7bccSMatt Jacob.Nm
145*af4b7924SAlan Somersdriver was originally written for the
14661de7bccSMatt Jacob.Tn CAM
14761de7bccSMatt Jacob.Tn SCSI
148*af4b7924SAlan Somerssubsystem by Matthew Jacob and first released in
149*af4b7924SAlan Somers.Fx 4.3 .
150*af4b7924SAlan SomersIt was a functional equivalent of a similar
1511e8b4cd2SMike Pritcharddriver available in Solaris, Release 7.
152*af4b7924SAlan SomersIt was largely rewritten by Alexander Motin, Justin Gibbs, and Will Andrews for
153*af4b7924SAlan Somers.Fx 9.2 .
154