2 .\" Copyright (c) 2006 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 SCSI_HBA_TRAN 9S "May 30, 2006"
8 scsi_hba_tran \- SCSI Host Bus Adapter (HBA) driver transport vector structure
12 #include <sys/scsi/scsi.h>
18 Solaris architecture specific (Solaris DDI).
22 A \fBscsi_hba_tran_t\fR structure defines vectors that an \fBHBA\fR driver
23 exports to \fBSCSA\fR interfaces so that \fBHBA\fR specific functions can be
29 dev_info_t *tran_hba_dip; /* HBAs dev_info
31 void *tran_hba_private; /* HBA softstate */
32 void *tran_tgt_private; /* HBA target private
34 struct scsi_device *tran_sd; /* scsi_device */
35 int (*tran_tgt_init)( ); /* Transport target */
37 int (*tran_tgt_probe)( ); /* Transport target
39 void (*tran_tgt_free)( ); /* Transport target
41 int (*tran_start)( ); /* Transport start */
42 int (*tran_reset)( ); /* Transport reset */
43 int (*tran_abort)( ); /* Transport abort */
44 int (*tran_getcap)( ); /* Capability
46 int (*tran_setcap)( ); /* Capability
48 struct scsi_pkt *(*tran_init_pkt)( ); /* Packet and DMA
50 void (*tran_destroy_pkt)( ); /* Packet and DMA */
52 void (*tran_dmafree)( ); /* DMA deallocation */
53 void (*tran_sync_pkt)( ); /* Sync DMA */
54 void (*tran_reset_notify)( );/* Bus reset
56 int (*tran_bus_reset)( ); /* Reset bus only */
57 int (*tran_quiesce)( ); /* Quiesce a bus */
58 int (*tran_unquiesce)( ); /* Unquiesce a bus */
59 int (*tran_setup_pkt)( ); /* Initialization
61 int (*tran_teardown_pkt)( );/* Deallocation */
62 int (*tran_pkt_constructor) ( );
64 int (*tran_pkt_destructor) ( );
66 int tran_hba_len; /* # bytes for
68 int tran_interconnect_type; /* transport
76 \fB\fBtran_hba_dip\fR\fR
79 \fBdev_info\fR pointer to the \fBHBA\fR that supplies the \fBscsi_hba_tran\fR
86 \fB\fBtran_hba_private\fR\fR
89 Private pointer that the \fBHBA\fR driver can use to refer to the device's soft
96 \fB\fBtran_tgt_private\fR\fR
99 Private pointer that the \fBHBA\fR can use to refer to per-target specific
100 data. This field can only be used when the \fBSCSI_HBA_TRAN_CLONE\fR flag is
101 specified in \fBscsi_hba_attach\fR(9F). In this case, the \fBHBA\fR driver must
102 initialize this field in its \fBtran_tgt_init\fR(9E) entry point.
111 Pointer to \fBscsi_device\fR(9S) structure if cloning; otherwise \fINULL\fR.
117 \fB\fBtran_tgt_init\fR\fR
120 Function entry that allows per-target \fBHBA\fR initialization, if necessary.
126 \fB\fBtran_tgt_probe\fR\fR
129 Function entry that allows per-target \fBscsi_probe\fR(9F) customization, if
136 \fB\fBtran_tgt_free\fR\fR
139 Function entry that allows per-target \fBHBA\fR deallocation, if necessary.
145 \fB\fBtran_start\fR\fR
148 Function entry that starts a \fBSCSI\fR command execution on the \fBHBA\fR
155 \fB\fBtran_reset\fR\fR
158 Function entry that resets a \fBSCSI\fR bus or target device.
164 \fB\fBtran_abort\fR\fR
167 Function entry that aborts one \fBSCSI\fR command, or all pending \fBSCSI\fR
174 \fB\fBtran_getcap\fR\fR
177 Function entry that retrieves a \fBSCSI\fR capability.
183 \fB\fBtran_setcap\fR\fR
186 Function entry that sets a \fBSCSI\fR capability.
192 \fB\fBtran_init_pkt\fR\fR
195 Function entry that allocates a \fBscsi_pkt\fR structure.
201 \fB\fBtran_destroy_pkt\fR\fR
204 Function entry that frees a \fBscsi_pkt\fR structure allocated by
211 \fB\fBtran_dmafree\fR\fR
214 Function entry that frees \fBDMA\fR resources that were previously allocated by
215 \fBtran_init_pkt\fR. Not called for \fBHBA\fR drivers that provide a
216 \fBtran_setup_pkt\fR entry point.
222 \fB\fBtran_sync_pkt\fR\fR
225 Synchronizes data in \fIpkt\fR after a data transfer has been completed. Not
226 called for \fBHBA\fR drivers that provide a \fBtran_setup_pkt\fR entry point.
232 \fB\fBtran_reset_notify\fR\fR
235 Function entry that allows a target to register a bus reset notification
236 request with the \fBHBA\fR driver.
242 \fB\fBtran_bus_reset\fR\fR
245 Function entry that resets the \fBSCSI\fR bus without resetting targets.
251 \fB\fBtran_quiesce\fR\fR
254 Function entry that waits for all outstanding commands to complete and blocks
255 (or queues) any \fBI/O\fR requests issued.
261 \fB\fBtran_unquiesce\fR\fR
264 Function entry that allows \fBI/O\fR activities to resume on the \fBSCSI\fR
271 \fB\fBtran_setup_pkt\fR\fR
274 Optional entry point that initializes a \fBscsi_pkt\fR structure. See
275 \fBtran_setup_pkt\fR(9E).
281 \fB\fBtran_teardown_pkt\fR\fR
284 Entry point that releases resources allocated by \fBtran_setup_pkt\fR.
290 \fB\fBtran_pkt_constructor\fR\fR
293 Additional optional entry point that performs the actions of a constructor. See
294 \fBtran_setup_pkt\fR(9E).
300 \fB\fBtran_pkt_destructor\fR\fR
303 Additional optional entry point that performs the actions of a destructor. See
304 \fBtran_setup_pkt\fR(9E).
310 \fB\fBtran_hba_len\fR\fR
313 Size of \fBpkt_ha_private\fR. See \fBtran_setup_pkt\fR(9E).
319 \fB\fBtran_interconnect_type\fR\fR
322 Integer value that denotes the interconnect type of the transport as defined in
323 the \fBservices.h\fR header file.
329 \fBtran_abort\fR(9E), \fBtran_bus_reset\fR(9E), \fBtran_destroy_pkt\fR(9E),
330 \fBtran_dmafree\fR(9E), \fBtran_getcap\fR(9E), \fBtran_init_pkt\fR(9E),
331 \fBtran_quiesce\fR(9E), \fBtran_reset\fR(9E), \fBtran_reset_notify\fR(9E),
332 \fBtran_setcap\fR(9E), \fBtran_setup_pkt\fR(9E), \fBtran_start\fR(9E),
333 \fBtran_sync_pkt\fR(9E), \fBtran_tgt_free\fR(9E), \fBtran_tgt_init\fR(9E),
334 \fBtran_tgt_probe\fR(9E), \fBtran_unquiesce\fR(9E), \fBddi_dma_sync\fR(9F),
335 \fBscsi_hba_attach\fR(9F), \fBscsi_hba_pkt_alloc\fR(9F),
336 \fBscsi_hba_pkt_free\fR(9F), \fBscsi_probe\fR(9F), \fBscsi_device\fR(9S),
340 \fIWriting Device Drivers\fR