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)
|
1 .\" Copyright (c) 1997, Sun Microsystems, Inc. All Rights Reserved
2 .\" Copyright (c) 2017, Joyent, Inc.
3 .\" The contents of this file are subject to the terms of the
4 .\" Common Development and Distribution License (the "License").
5 .\" You may not use this file except in compliance with the License.
6 .\"
7 .\" You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
8 .\" or http://www.opensolaris.org/os/licensing.
9 .\" See the License for the specific language governing permissions
10 .\" and limitations under the License.
11 .\"
12 .\" When distributing Covered Code, include this CDDL HEADER in each
13 .\" file and include the License file at usr/src/OPENSOLARIS.LICENSE.
14 .\" If applicable, add the following below this CDDL HEADER, with the
15 .\" fields enclosed by brackets "[]" replaced with your own identifying
16 .\" information: Portions Copyright [yyyy] [name of copyright owner]
17 .Dd October 23, 2017
18 .Dt SESIO 7I
19 .Os
20 .Sh NAME
21 .Nm sesio
22 .Nd enclosure services device driver interface
23 .Sh SYNOPSIS
24 .In sys/scsi/targets/sesio.h
25 .Sh DESCRIPTION
26 The
27 .Nm ses
28 device driver provides the following ioctls as a means to access
29 SCSI enclosure services devices.
30 .Sh IOCTLS
31 The
32 .Nm ses
33 driver supports the following ioctls:
34 .Bl -tag -width SES_IOCTL_GETSTATE
35 .It Dv SES_IOCTL_GETSTATE
36 This ioctl obtains enclosure state in the
37 .Vt ses_ioctl
38 structure.
39 .It Dv SES_IOCTL_SETSTATE
40 This ioctl is used to set parameters on the enclosure services device.
41 The
42 .Vt ses_ioctl
43 structure is used to pass information into the driver.
44 .El
45 .Sh EXAMPLES
46 .Bl -tag -width "Example 1"
47 .It Sy "Example 1"
48 Using the
49 .Dv SES_IOCTL_GETSTATE
50 ioctl
51 .El
52 .Pp
53 The following example uses the
54 .Dv SES_IOCTL_GETSTATE
55 ioctl to recover 20 bytes of page 4 from a previously opened device.
56 .Bd -literal -offset 2n
57 char abuf[30];
58 struct ses_ioctl *sesp;
59 int status;
60
61 sesp = (ses_ioctl *)abuf;
62 sesp->size = 20;
63 sesp->page_code = 4;
64 status = ioctl(fd, SES_IOCTL_GETSTATE, abuf);
65 .Ed
66 .Sh ERRORS
67 .Bl -tag -width ENOTTY
68 .It Er EIO
69 The
70 .Nm ses
71 driver was unable to obtain data from the enclosure services
72 device or the data transfer could not be completed.
73 .It Er ENOTTY
74 The
75 .Nm ses
76 driver does not support the requested ioctl function.
77 .It Er ENXIO
78 The enclosure services device does not exist.
79 .It Er EFAULT
80 The user specified a bad data length.
81 .El
82 .Sh STRUCTURES
83 The
84 .Vt ses_ioctl
85 structure has the following fields:
86 .Bd -literal -offset 2n
87 uint32_t page_size; /* Size of buffer that follows */
88 uint8_t page_code: /* Page to be read/written */
89 uint8_t reserved[3]; /* Reserved; Set to 0 */
90 .Ed
91 .Sh ARCHITECTURE
92 SPARC
93 .Sh SEE ALSO
94 .Xr ses 7D ,
95 .Xr ioctl 9E
|