summaryrefslogtreecommitdiff
path: root/usr/src/man/man7i/sesio.7i
blob: 79e1329c473f706c1b6f403a4a9d1176c73738cb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
.\"  Copyright (c) 1997, Sun Microsystems, Inc.  All Rights Reserved
.\"  Copyright (c) 2017, Joyent, Inc.
.\" 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.
.\"
.\" 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.
.\"
.\" 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]
.Dd October 23, 2017
.Dt SESIO 7I
.Os
.Sh NAME
.Nm sesio
.Nd enclosure services device driver interface
.Sh SYNOPSIS
.In sys/scsi/targets/sesio.h
.Sh DESCRIPTION
The
.Nm ses
device driver provides the following ioctls as a means to access
SCSI enclosure services devices.
.Sh IOCTLS
The
.Nm ses
driver supports the following ioctls:
.Bl -tag -width SES_IOCTL_GETSTATE
.It Dv SES_IOCTL_GETSTATE
This ioctl obtains enclosure state in the
.Vt ses_ioctl
structure.
.It Dv SES_IOCTL_SETSTATE
This ioctl is used to set parameters on the enclosure services device.
The
.Vt ses_ioctl
structure is used to pass information into the driver.
.El
.Sh EXAMPLES
.Bl -tag -width "Example 1"
.It Sy "Example 1"
Using the
.Dv SES_IOCTL_GETSTATE
ioctl
.El
.Pp
The following example uses the
.Dv SES_IOCTL_GETSTATE
ioctl to recover 20 bytes of page 4 from a previously opened device.
.Bd -literal -offset 2n
char   abuf[30];
struct ses_ioctl *sesp;
int    status;

sesp = (ses_ioctl *)abuf;
sesp->size = 20;
sesp->page_code = 4;
status = ioctl(fd, SES_IOCTL_GETSTATE, abuf);
.Ed
.Sh ERRORS
.Bl -tag -width ENOTTY
.It Er EIO
The
.Nm ses
driver was unable to obtain data from the enclosure services
device or the  data transfer could not be completed.
.It Er ENOTTY
The
.Nm ses
driver does not support the requested ioctl function.
.It Er ENXIO
The enclosure services device does not exist.
.It Er EFAULT
The user specified a bad data length.
.El
.Sh STRUCTURES
The
.Vt ses_ioctl
structure has the following fields:
.Bd -literal -offset 2n
uint32_t page_size;      /* Size of buffer that follows */
uint8_t  page_code:      /* Page to be read/written */
uint8_t  reserved[3];    /* Reserved; Set to 0 */
.Ed
.Sh ARCHITECTURE
SPARC
.Sh SEE ALSO
.Xr ses 7D ,
.Xr ioctl 9E