xref: /netbsd-src/share/man/man4/iop.4 (revision 8b0f9554ff8762542c4defc4f70e1eb76fb508fa)
1.\"	$NetBSD: iop.4,v 1.18 2007/12/01 18:19:04 ad Exp $
2.\"
3.\" Copyright (c) 2000, 2001, 2007 The NetBSD Foundation, Inc.
4.\" All rights reserved.
5.\"
6.\" This code is derived from software contributed to The NetBSD Foundation
7.\" by Andrew Doran.
8.\"
9.\" Redistribution and use in source and binary forms, with or without
10.\" modification, are permitted provided that the following conditions
11.\" are met:
12.\" 1. Redistributions of source code must retain the above copyright
13.\"    notice, this list of conditions and the following disclaimer.
14.\" 2. Redistributions in binary form must reproduce the above copyright
15.\"    notice, this list of conditions and the following disclaimer in the
16.\"    documentation and/or other materials provided with the distribution.
17.\" 3. All advertising materials mentioning features or use of this software
18.\"    must display the following acknowledgement:
19.\"        This product includes software developed by the NetBSD
20.\"        Foundation, Inc. and its contributors.
21.\" 4. Neither the name of The NetBSD Foundation nor the names of its
22.\"    contributors may be used to endorse or promote products derived
23.\"    from this software without specific prior written permission.
24.\"
25.\" THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
26.\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
27.\" TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
28.\" PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
29.\" BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
30.\" CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
31.\" SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
32.\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
33.\" CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
34.\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
35.\" POSSIBILITY OF SUCH DAMAGE.
36.\"
37.Dd December 2, 2007
38.Dt IOP 4
39.Os
40.Sh NAME
41.Nm iop
42.Nd
43.Tn I2O adapter driver
44.Sh SYNOPSIS
45.Cd "iop* at pci? dev ? function ?"
46.Cd "iopsp* at iop? tid ?"
47.Cd "ld* at iop? tid ?"
48.Cd "dpti* at iop? tid 0"
49.Sh DESCRIPTION
50The
51.Nm
52driver provides support for
53.Tn PCI
54I/O processors conforming to the
55.Tn I2O
56specification, revision 1.5 and above.
57.Pp
58I2O is a specification that defines a software interface for communicating
59with a number of device types.  In its basic form, I2O provides the
60following:
61.Pp
62.Bl -bullet
63.It
64A vendor-neutral interface for communicating with an I/O processor (IOP)
65and a number of types of peripherals.  In order to achieve this,
66hardware-specific device drivers run on the IOP, and hardware-neutral device
67drivers run on the host.
68.It
69Reduced I/O overhead for the host.  All communication between the host and
70the IOP is performed using a high level protocol.  The specification also
71provides for batching of requests and replies between the host and IOP.
72.It
73An optional vendor-neutral configuration interface.  Data from HTTP GET and
74POST operations can be channeled to individual devices, and HTML pages
75returned.
76.El
77.Pp
78Five types of devices are well defined by the specification.  These are:
79.Pp
80.Bl -bullet -compact
81.It
82Random block storage devices (disks).
83.It
84Sequential storage devices (tapes).
85.It
86LAN interfaces, including Ethernet, FDDI, and Token Ring.
87.It
88Bus ports (SCSI).
89.It
90SCSI peripherals.
91.El
92.Pp
93The
94.Nm
95driver's role is to initialize and monitor the IOP, provide a conduit for
96messages and replies to and from devices, and provide other common services
97for peripheral drivers, such as DMA mapping.
98.Sh IOCTL INTERFACE
99The following structures and constants are defined in
100.Pa dev/i2o/iopio.h .
101Note that the headers
102.Pa sys/types.h ,
103.Pa sys/device.h
104and
105.Pa dev/i2o/i2o.h
106are prerequisites and must therefore be included beforehand.
107.Bl -tag -width OTTF
108.It Dv IOPIOCPT (struct ioppt)
109Submit a message to the IOP and return the reply.  Note that the return
110value of this ioctl is not affected by completion status as indicated by the
111reply.
112.Bd -literal
113struct ioppt {
114	void	*pt_msg;	/* pointer to message buffer */
115	size_t	pt_msglen;	/* message buffer size in bytes */
116	void	*pt_reply;	/* pointer to reply buffer */
117	size_t	pt_replylen;	/* reply buffer size in bytes */
118	int	pt_timo;	/* completion timeout in ms */
119	int	pt_nbufs;	/* number of transfers */
120	struct	ioppt_buf pt_bufs[IOP_MAX_MSG_XFERS]; /* transfers */
121};
122
123struct ioppt_buf {
124	void	*ptb_data;	/* pointer to buffer */
125	size_t	ptb_datalen;	/* buffer size in bytes */
126	int	ptb_out;	/* non-zero if transfer is to IOP */
127};
128.Ed
129.Pp
130The minimum timeout value that may be specified is 1000ms.  All other values
131must not exceed the
132.Nm
133driver's operational limits.
134.Pp
135The initiator context and transaction context fields in the message frame
136will be filled by the
137.Nm
138driver.  As such, this ioctl may not be used to send messages without a
139transaction context payload.
140.It Dv IOPIOCGSTATUS (struct iovec)
141Request the latest available status record from the IOP.  This special-case
142ioctl is provided as the I2O_EXEC_STATUS_GET message does not post replies,
143and can therefore not be safely issued using the IOPIOCPT ioctl.
144.El
145.Pp
146The following ioctls may block while attempting to acquire the
147.Nm
148driver's configuration lock, and may fail if the acquisition times out.
149.Bl -tag -width OTTF
150.It Dv IOPIOCGLCT (struct iovec)
151Retrieve the
152.Nm
153driver's copy of the logical configuration table.  This copy of the LCT
154matches the current device configuration, but is not necessarily the latest
155available version of the LCT.
156.It Dv IOPIOCRECONFIG
157Request that the
158.Nm
159driver scan all bus ports, retrieve the latest version of the LCT, and
160attach or detach devices as necessary.  Note that higher-level
161reconfiguration tasks (such as logically re-scanning SCSI busses) will not
162be performed by this ioctl.
163.It Dv IOPIOCGTIDMAP (struct iovec)
164Retrieve the TID to device map.  This map indicates which targets are
165configured, and what the corresponding device name for each is.  Although at
166any given point it contains the same number of entries as the LCT, the number
167of entries should be determined using the iov_len field from the returned
168iovec.
169.Bd -literal
170struct iop_tidmap {
171	u_short	it_tid;
172	u_short	it_flags;
173	char	it_dvname[sizeof(((struct device *)NULL)-\*[Gt]dv_xname)];
174};
175#define	IT_CONFIGURED	0x02	/* target configured */
176.Ed
177.El
178.Sh FILES
179.Bl -tag -width /dev/iopn -compact
180.It Pa /dev/iop Ns Ar u
181control device for IOP unit
182.Ar u
183.El
184.Sh SEE ALSO
185.Xr dpti 4 ,
186.Xr intro 4 ,
187.Xr iopsp 4 ,
188.Xr ld 4 ,
189.Xr iopctl 8
190.Pp
191.Pa http://www.intelligent-io.com/
192.Sh HISTORY
193The
194.Nm
195driver first appeared in
196.Nx 1.5.3 .
197