1 '\" te
   2 .\"  Copyright (c) 1997, Sun Microsystems, Inc.  All Rights Reserved
   3 .\" The contents of this file are subject to the terms of the Common Development and Distribution License (the "License").  You may not use this file except in compliance with the License.
   4 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE or http://www.opensolaris.org/os/licensing.  See the License for the specific language governing permissions and limitations under the License.
   5 .\" When distributing Covered Code, include this CDDL HEADER in each file and include the License file at usr/src/OPENSOLARIS.LICENSE.  If applicable, add the following below this CDDL HEADER, with the fields enclosed by brackets "[]" replaced with your own identifying information: Portions Copyright [yyyy] [name of copyright owner]
   6 .TH SESIO 7I "Mar 27, 1997"
   7 .SH NAME
   8 sesio \- enclosure services device driver interface
   9 .SH SYNOPSIS
  10 .LP
  11 .nf
  12 \fB#include <sys/sesio.h>\fR
  13 .fi
  14 
  15 .SH DESCRIPTION
  16 .sp
  17 .LP
  18 The  \fBses\fR device driver provides the following ioctls as a means to access
  19 SCSI enclosure services devices.
  20 .SH IOCTLS
  21 .sp
  22 .LP
  23 The  \fBses\fR driver supports the following ioctls:
  24 .sp
  25 .ne 2
  26 .na
  27 \fB\fBSES_IOCTL_GETSTATE\fR\fR
  28 .ad
  29 .RS 22n
  30 This ioctl obtains enclosure state in the  \fBses_ioctl\fR structure.
  31 .RE
  32 
  33 .sp
  34 .ne 2
  35 .na
  36 \fB\fBSES_IOCTL_SETSTATE\fR\fR
  37 .ad
  38 .RS 22n
  39 This ioctl is used to set parameters on the enclosure services device. The
  40 \fBses_ioctl\fR structure is used to pass information into the driver.
  41 .RE
  42 
  43 .SH ERRORS
  44 .sp
  45 .ne 2
  46 .na
  47 \fB\fBEIO\fR\fR
  48 .ad
  49 .RS 10n
  50 The \fBses\fR driver was unable to obtain data from the enclosure services
  51 device or the  data transfer could not be completed.
  52 .RE
  53 
  54 .sp
  55 .ne 2
  56 .na
  57 \fB\fBENOTTY\fR\fR
  58 .ad
  59 .RS 10n
  60 The  \fBses\fR driver does not support the requested ioctl function.
  61 .RE
  62 
  63 .sp
  64 .ne 2
  65 .na
  66 \fB\fBENXIO\fR\fR
  67 .ad
  68 .RS 10n
  69 The enclosure services device does not exist.
  70 .RE
  71 
  72 .sp
  73 .ne 2
  74 .na
  75 \fB\fBEFAULT\fR\fR
  76 .ad
  77 .RS 10n
  78 The user specified a bad data length.
  79 .RE
  80 
  81 .SH STRUCTURES
  82 .sp
  83 .LP
  84 The  \fBses_ioctl\fR structure has the following fields:
  85 .sp
  86 .in +2
  87 .nf
  88 uint32_t;               /* Size of buffer that follows */
  89 uint8_t page_code:      /* Page to be read/written */
  90 uint8_t reserved[3];    /* Reserved; Set to 0 */
  91 unit8t  buffer[1];      /* Size arbitrary, user specifies */
  92 .fi
  93 .in -2
  94 
  95 .SH EXAMPLES
  96 .LP
  97 \fBExample 1 \fRUsing the  \fBSES_IOCTL_GETSTATE\fR ioctl
  98 .sp
  99 .LP
 100 The following example uses the  \fBSES_IOCTL_GETSTATE\fR ioctl to recover 20
 101 bytes of page 4 from a previously opened device.
 102 
 103 .sp
 104 .in +2
 105 .nf
 106 char   abuf[30];
 107 struct ses_ioctl *sesp;
 108 int    status;
 109 sesp = (ses_ioctl *)abuf;
 110 sesp->size = 20;
 111 sesp->page_code = 4;
 112 status = ioctl(fd, SES_IOCTL_GETSTATE, abuf);
 113 .fi
 114 .in -2
 115 
 116 .SH ATTRIBUTES
 117 .sp
 118 .LP
 119 See  \fBattributes\fR(5) for descriptions of the following attributes:
 120 .sp
 121 
 122 .sp
 123 .TS
 124 box;
 125 c | c
 126 l | l .
 127 ATTRIBUTE TYPE  ATTRIBUTE VALUE
 128 _
 129 Architecture    SPARC
 130 .TE
 131 
 132 .SH SEE ALSO
 133 .sp
 134 .LP
 135 \fBses\fR(7D), \fBioctl\fR(9E)