xref: /freebsd/sys/dev/isci/scil/scic_io_request.h (revision f11c7f63056671247335df83a3fe80b94c6616ac)
1*f11c7f63SJim Harris /*-
2*f11c7f63SJim Harris  * This file is provided under a dual BSD/GPLv2 license.  When using or
3*f11c7f63SJim Harris  * redistributing this file, you may do so under either license.
4*f11c7f63SJim Harris  *
5*f11c7f63SJim Harris  * GPL LICENSE SUMMARY
6*f11c7f63SJim Harris  *
7*f11c7f63SJim Harris  * Copyright(c) 2008 - 2011 Intel Corporation. All rights reserved.
8*f11c7f63SJim Harris  *
9*f11c7f63SJim Harris  * This program is free software; you can redistribute it and/or modify
10*f11c7f63SJim Harris  * it under the terms of version 2 of the GNU General Public License as
11*f11c7f63SJim Harris  * published by the Free Software Foundation.
12*f11c7f63SJim Harris  *
13*f11c7f63SJim Harris  * This program is distributed in the hope that it will be useful, but
14*f11c7f63SJim Harris  * WITHOUT ANY WARRANTY; without even the implied warranty of
15*f11c7f63SJim Harris  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
16*f11c7f63SJim Harris  * General Public License for more details.
17*f11c7f63SJim Harris  *
18*f11c7f63SJim Harris  * You should have received a copy of the GNU General Public License
19*f11c7f63SJim Harris  * along with this program; if not, write to the Free Software
20*f11c7f63SJim Harris  * Foundation, Inc., 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
21*f11c7f63SJim Harris  * The full GNU General Public License is included in this distribution
22*f11c7f63SJim Harris  * in the file called LICENSE.GPL.
23*f11c7f63SJim Harris  *
24*f11c7f63SJim Harris  * BSD LICENSE
25*f11c7f63SJim Harris  *
26*f11c7f63SJim Harris  * Copyright(c) 2008 - 2011 Intel Corporation. All rights reserved.
27*f11c7f63SJim Harris  * All rights reserved.
28*f11c7f63SJim Harris  *
29*f11c7f63SJim Harris  * Redistribution and use in source and binary forms, with or without
30*f11c7f63SJim Harris  * modification, are permitted provided that the following conditions
31*f11c7f63SJim Harris  * are met:
32*f11c7f63SJim Harris  *
33*f11c7f63SJim Harris  *   * Redistributions of source code must retain the above copyright
34*f11c7f63SJim Harris  *     notice, this list of conditions and the following disclaimer.
35*f11c7f63SJim Harris  *   * Redistributions in binary form must reproduce the above copyright
36*f11c7f63SJim Harris  *     notice, this list of conditions and the following disclaimer in
37*f11c7f63SJim Harris  *     the documentation and/or other materials provided with the
38*f11c7f63SJim Harris  *     distribution.
39*f11c7f63SJim Harris  *
40*f11c7f63SJim Harris  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
41*f11c7f63SJim Harris  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
42*f11c7f63SJim Harris  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
43*f11c7f63SJim Harris  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
44*f11c7f63SJim Harris  * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
45*f11c7f63SJim Harris  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
46*f11c7f63SJim Harris  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
47*f11c7f63SJim Harris  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
48*f11c7f63SJim Harris  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
49*f11c7f63SJim Harris  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
50*f11c7f63SJim Harris  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
51*f11c7f63SJim Harris  *
52*f11c7f63SJim Harris  * $FreeBSD$
53*f11c7f63SJim Harris  */
54*f11c7f63SJim Harris #ifndef _SCIC_IO_REQUEST_H_
55*f11c7f63SJim Harris #define _SCIC_IO_REQUEST_H_
56*f11c7f63SJim Harris 
57*f11c7f63SJim Harris /**
58*f11c7f63SJim Harris  * @file
59*f11c7f63SJim Harris  *
60*f11c7f63SJim Harris  * @brief This file contains the structures and interface methods that
61*f11c7f63SJim Harris  *        can be referenced and used by the SCI user for the SCI IO request
62*f11c7f63SJim Harris  *        object.
63*f11c7f63SJim Harris  *
64*f11c7f63SJim Harris  * @todo Determine the failure situations and return values.
65*f11c7f63SJim Harris  */
66*f11c7f63SJim Harris 
67*f11c7f63SJim Harris #ifdef __cplusplus
68*f11c7f63SJim Harris extern "C" {
69*f11c7f63SJim Harris #endif // __cplusplus
70*f11c7f63SJim Harris 
71*f11c7f63SJim Harris #include <dev/isci/scil/sci_types.h>
72*f11c7f63SJim Harris #include <dev/isci/scil/sci_status.h>
73*f11c7f63SJim Harris #include <dev/isci/scil/intel_sas.h>
74*f11c7f63SJim Harris 
75*f11c7f63SJim Harris /**
76*f11c7f63SJim Harris  * @struct SCIC_IO_SSP_PARAMETERS
77*f11c7f63SJim Harris  * @brief  This structure contains additional optional parameters for SSP
78*f11c7f63SJim Harris  *         IO requests.  These parameters are utilized with the
79*f11c7f63SJim Harris  *         scic_io_request_construct_advanced_ssp() method.
80*f11c7f63SJim Harris  *
81*f11c7f63SJim Harris  * @todo Add Block-guard/DIF, TLR
82*f11c7f63SJim Harris  */
83*f11c7f63SJim Harris typedef struct SCIC_IO_SSP_PARAMETERS
84*f11c7f63SJim Harris {
85*f11c7f63SJim Harris    /**
86*f11c7f63SJim Harris     * Data Integrity Format (DIF) is also known as protection information
87*f11c7f63SJim Harris     * or block-guard.  This sub-structure contains DIF specific feature
88*f11c7f63SJim Harris     * information for SSP IO requests.
89*f11c7f63SJim Harris     */
90*f11c7f63SJim Harris    struct
91*f11c7f63SJim Harris    {
92*f11c7f63SJim Harris       void * placeholder;
93*f11c7f63SJim Harris    } dif;
94*f11c7f63SJim Harris 
95*f11c7f63SJim Harris    /**
96*f11c7f63SJim Harris     * Transport Layer Retries (TLR) is an SSP protocol specific feature.
97*f11c7f63SJim Harris     * This sub-structure contains Transport Layer Retries (TLR) specific
98*f11c7f63SJim Harris     * feature information for SSP IO requests.
99*f11c7f63SJim Harris     */
100*f11c7f63SJim Harris    struct
101*f11c7f63SJim Harris    {
102*f11c7f63SJim Harris       void * placeholder;
103*f11c7f63SJim Harris    } tlr;
104*f11c7f63SJim Harris 
105*f11c7f63SJim Harris } SCIC_IO_SSP_PARAMETERS_T;
106*f11c7f63SJim Harris 
107*f11c7f63SJim Harris /**
108*f11c7f63SJim Harris  * @struct SCIC_IO_PARAMETERS
109*f11c7f63SJim Harris  * @brief  This structure contains additional optional parameters for
110*f11c7f63SJim Harris  *         STP/SATA IO requests.  These parameters are utilized with the
111*f11c7f63SJim Harris  *         scic_io_request_construct_advanced_sata() method.
112*f11c7f63SJim Harris  */
113*f11c7f63SJim Harris typedef struct SCIC_IO_SATA_PARAMETERS
114*f11c7f63SJim Harris {
115*f11c7f63SJim Harris    /**
116*f11c7f63SJim Harris     * This field indicates whether or not to construct the Scatter-Gather
117*f11c7f63SJim Harris     * List elements for the SATA request.  This is used in scenarios
118*f11c7f63SJim Harris     * where Scatter-gather-list processing/translation is done by the
119*f11c7f63SJim Harris     * user.
120*f11c7f63SJim Harris     */
121*f11c7f63SJim Harris    BOOL do_translate_sgl;
122*f11c7f63SJim Harris 
123*f11c7f63SJim Harris } SCIC_IO_SATA_PARAMETERS_T;
124*f11c7f63SJim Harris 
125*f11c7f63SJim Harris /**
126*f11c7f63SJim Harris  * @struct SCIC_PASSTHRU_REQUEST_CALLBACKS
127*f11c7f63SJim Harris  * @brief  This structure contains the pointer to the callback functions
128*f11c7f63SJim Harris  *         for constructing the passthrough request common to SSP, SMP and STP.
129*f11c7f63SJim Harris  *         This structure must be set by the win sci layer before the passthrough
130*f11c7f63SJim Harris  *         build is called
131*f11c7f63SJim Harris  *
132*f11c7f63SJim Harris  */
133*f11c7f63SJim Harris typedef struct SCIC_PASSTHRU_REQUEST_CALLBACKS
134*f11c7f63SJim Harris {
135*f11c7f63SJim Harris    /**
136*f11c7f63SJim Harris    * Function pointer to get the phy identifier for passthrough request.
137*f11c7f63SJim Harris    */
138*f11c7f63SJim Harris    U32 (*scic_cb_passthru_get_phy_identifier) ( void * , U8 *);
139*f11c7f63SJim Harris    /**
140*f11c7f63SJim Harris    * Function pointer to get the port identifier for passthrough request.
141*f11c7f63SJim Harris    */
142*f11c7f63SJim Harris    U32 (*scic_cb_passthru_get_port_identifier) ( void * , U8 *);
143*f11c7f63SJim Harris    /**
144*f11c7f63SJim Harris    * Function pointer to get the connection rate for passthrough request.
145*f11c7f63SJim Harris    */
146*f11c7f63SJim Harris    U32 (*scic_cb_passthru_get_connection_rate) ( void * , void *);
147*f11c7f63SJim Harris    /**
148*f11c7f63SJim Harris    * Function pointer to get the destination sas address for passthrough request.
149*f11c7f63SJim Harris    */
150*f11c7f63SJim Harris    void (*scic_cb_passthru_get_destination_sas_address) (void *, U8 **);
151*f11c7f63SJim Harris    /**
152*f11c7f63SJim Harris    * Function pointer to get the transfer length for passthrough request.
153*f11c7f63SJim Harris    */
154*f11c7f63SJim Harris    U32 (*scic_cb_passthru_get_transfer_length) (void *);
155*f11c7f63SJim Harris    /**
156*f11c7f63SJim Harris    * Function pointer to get the data direction for passthrough request.
157*f11c7f63SJim Harris    */
158*f11c7f63SJim Harris    U32 (*scic_cb_passthru_get_data_direction) (void *);
159*f11c7f63SJim Harris 
160*f11c7f63SJim Harris } SCIC_PASSTHRU_REQUEST_CALLBACKS_T;
161*f11c7f63SJim Harris 
162*f11c7f63SJim Harris /**
163*f11c7f63SJim Harris  * @struct SCIC_SSP_PASSTHRU_REQUEST_CALLBACKS
164*f11c7f63SJim Harris  * @brief  This structure contains the pointer to the callback functions
165*f11c7f63SJim Harris  *         for constructing the passthrough request specific to SSP.
166*f11c7f63SJim Harris  *         This structure must be set by the win sci layer before the passthrough
167*f11c7f63SJim Harris  *         build is called
168*f11c7f63SJim Harris  *
169*f11c7f63SJim Harris  */
170*f11c7f63SJim Harris typedef struct SCIC_SSP_PASSTHRU_REQUEST_CALLBACKS
171*f11c7f63SJim Harris {
172*f11c7f63SJim Harris    /**
173*f11c7f63SJim Harris    * Common callbacks for all Passthru requests
174*f11c7f63SJim Harris    */
175*f11c7f63SJim Harris    SCIC_PASSTHRU_REQUEST_CALLBACKS_T common_callbacks;
176*f11c7f63SJim Harris    /**
177*f11c7f63SJim Harris    * Function pointer to get the lun for passthrough request.
178*f11c7f63SJim Harris    */
179*f11c7f63SJim Harris    void (* scic_cb_ssp_passthru_get_lun) (void *, U8 **);
180*f11c7f63SJim Harris    /**
181*f11c7f63SJim Harris    * Function pointer to get the cdb
182*f11c7f63SJim Harris    */
183*f11c7f63SJim Harris    void (* scic_cb_ssp_passthru_get_cdb) ( void *, U32 *, U8 **, U32 *, U8 ** );
184*f11c7f63SJim Harris    /**
185*f11c7f63SJim Harris    * Function pointer to get the task attribute for passthrough request.
186*f11c7f63SJim Harris    */
187*f11c7f63SJim Harris    U32 (*scic_cb_ssp_passthru_get_task_attribute) (void *);
188*f11c7f63SJim Harris } SCIC_SSP_PASSTHRU_REQUEST_CALLBACKS_T;
189*f11c7f63SJim Harris 
190*f11c7f63SJim Harris /**
191*f11c7f63SJim Harris  * @struct SCIC_STP_PASSTHRU_REQUEST_CALLBACKS
192*f11c7f63SJim Harris  * @brief  This structure contains the pointer to the callback functions
193*f11c7f63SJim Harris  *         for constructing the passthrough request specific to STP.
194*f11c7f63SJim Harris  *         This structure must be set by the win sci layer before the passthrough
195*f11c7f63SJim Harris  *         build is called
196*f11c7f63SJim Harris  *
197*f11c7f63SJim Harris  */
198*f11c7f63SJim Harris typedef struct SCIC_STP_PASSTHRU_REQUEST_CALLBACKS
199*f11c7f63SJim Harris {
200*f11c7f63SJim Harris    /**
201*f11c7f63SJim Harris    * Common callbacks for all Passthru requests
202*f11c7f63SJim Harris    */
203*f11c7f63SJim Harris    SCIC_PASSTHRU_REQUEST_CALLBACKS_T common_callbacks;
204*f11c7f63SJim Harris    /**
205*f11c7f63SJim Harris    * Function pointer to get the protocol for passthrough request.
206*f11c7f63SJim Harris    */
207*f11c7f63SJim Harris    U8 (* scic_cb_stp_passthru_get_protocol) (void *);
208*f11c7f63SJim Harris    /**
209*f11c7f63SJim Harris    * Function pointer to get the resgister fis
210*f11c7f63SJim Harris    */
211*f11c7f63SJim Harris    void (* scic_cb_stp_passthru_get_register_fis) ( void *, U8 ** );
212*f11c7f63SJim Harris    /**
213*f11c7f63SJim Harris    * Function pointer to get the MULTIPLE_COUNT (bits 5,6,7 in Byte 1 in the SAT-specific SCSI extenstion in ATA Pass-through (0x85))
214*f11c7f63SJim Harris    */
215*f11c7f63SJim Harris    U8 (* scic_cb_stp_passthru_get_multiplecount) ( void *);
216*f11c7f63SJim Harris    /**
217*f11c7f63SJim Harris    * Function pointer to get the EXTEND (bit 0 in Byte 1 the SAT-specific SCSI extenstion in ATA Pass-through (0x85))
218*f11c7f63SJim Harris    */
219*f11c7f63SJim Harris    U8 (* scic_cb_stp_passthru_get_extend) ( void *);
220*f11c7f63SJim Harris    /**
221*f11c7f63SJim Harris    * Function pointer to get the CK_COND (bit 5 in Byte 2 the SAT-specific SCSI extenstion in ATA Pass-through (0x85))
222*f11c7f63SJim Harris    */
223*f11c7f63SJim Harris    U8 (* scic_cb_stp_passthru_get_ckcond) ( void *);
224*f11c7f63SJim Harris    /**
225*f11c7f63SJim Harris    * Function pointer to get the T_DIR (bit 3 in Byte 2 the SAT-specific SCSI extenstion in ATA Pass-through (0x85))
226*f11c7f63SJim Harris    */
227*f11c7f63SJim Harris    U8 (* scic_cb_stp_passthru_get_tdir) ( void *);
228*f11c7f63SJim Harris    /**
229*f11c7f63SJim Harris    * Function pointer to get the BYTE_BLOCK (bit 2 in Byte 2 the SAT-specific SCSI extenstion in ATA Pass-through (0x85))
230*f11c7f63SJim Harris    */
231*f11c7f63SJim Harris    U8 (* scic_cb_stp_passthru_get_byteblock) ( void *);
232*f11c7f63SJim Harris    /**
233*f11c7f63SJim Harris    * Function pointer to get the T_LENGTH (bits 0,1 in Byte 2 the SAT-specific SCSI extenstion in ATA Pass-through (0x85))
234*f11c7f63SJim Harris    */
235*f11c7f63SJim Harris    U8 (* scic_cb_stp_passthru_get_tlength) ( void *);
236*f11c7f63SJim Harris 
237*f11c7f63SJim Harris } SCIC_STP_PASSTHRU_REQUEST_CALLBACKS_T;
238*f11c7f63SJim Harris 
239*f11c7f63SJim Harris /**
240*f11c7f63SJim Harris  * @struct SCIC_SMP_PASSTHRU_REQUEST_CALLBACKS
241*f11c7f63SJim Harris  * @brief  This structure contains the pointer to the callback functions
242*f11c7f63SJim Harris  *         for constructing the passthrough request specific to SMP.
243*f11c7f63SJim Harris  *         This structure must be set by the win sci layer before the passthrough
244*f11c7f63SJim Harris  *         build is called
245*f11c7f63SJim Harris  *
246*f11c7f63SJim Harris  */
247*f11c7f63SJim Harris typedef struct SCIC_SMP_PASSTHRU_REQUEST_CALLBACKS
248*f11c7f63SJim Harris {
249*f11c7f63SJim Harris    /**
250*f11c7f63SJim Harris    * Common callbacks for all Passthru requests
251*f11c7f63SJim Harris    */
252*f11c7f63SJim Harris    SCIC_PASSTHRU_REQUEST_CALLBACKS_T common_callbacks;
253*f11c7f63SJim Harris 
254*f11c7f63SJim Harris    /**
255*f11c7f63SJim Harris    * Function pointer to get the length of the smp request and its length
256*f11c7f63SJim Harris    */
257*f11c7f63SJim Harris    U32 (* scic_cb_smp_passthru_get_request) ( void *, U8 ** );
258*f11c7f63SJim Harris    /**
259*f11c7f63SJim Harris    * Function pointer to get the frame type of the smp request
260*f11c7f63SJim Harris    */
261*f11c7f63SJim Harris    U8 (* scic_cb_smp_passthru_get_frame_type) ( void *);
262*f11c7f63SJim Harris    /**
263*f11c7f63SJim Harris    * Function pointer to get the function in the the smp request
264*f11c7f63SJim Harris    */
265*f11c7f63SJim Harris    U8 (* scic_cb_smp_passthru_get_function) ( void * );
266*f11c7f63SJim Harris 
267*f11c7f63SJim Harris    /**
268*f11c7f63SJim Harris    * Function pointer to get the "allocated response length" in the the smp request
269*f11c7f63SJim Harris    */
270*f11c7f63SJim Harris    U8 (* scic_cb_smp_passthru_get_allocated_response_length) ( void * );
271*f11c7f63SJim Harris 
272*f11c7f63SJim Harris } SCIC_SMP_PASSTHRU_REQUEST_CALLBACKS_T;
273*f11c7f63SJim Harris 
274*f11c7f63SJim Harris /**
275*f11c7f63SJim Harris  * @brief This enumeration specifies the transport protocol utilized
276*f11c7f63SJim Harris  *        for the request.
277*f11c7f63SJim Harris  */
278*f11c7f63SJim Harris typedef enum
279*f11c7f63SJim Harris {
280*f11c7f63SJim Harris    /**
281*f11c7f63SJim Harris     * This enumeration constant indicates that no protocol has yet been
282*f11c7f63SJim Harris     * set.
283*f11c7f63SJim Harris     */
284*f11c7f63SJim Harris    SCIC_NO_PROTOCOL,
285*f11c7f63SJim Harris 
286*f11c7f63SJim Harris    /**
287*f11c7f63SJim Harris     * This enumeration constant indicates that the protocol utilized
288*f11c7f63SJim Harris     * is the Serial Management Protocol.
289*f11c7f63SJim Harris     */
290*f11c7f63SJim Harris    SCIC_SMP_PROTOCOL,
291*f11c7f63SJim Harris 
292*f11c7f63SJim Harris    /**
293*f11c7f63SJim Harris     * This enumeration constant indicates that the protocol utilized
294*f11c7f63SJim Harris     * is the Serial SCSI Protocol.
295*f11c7f63SJim Harris     */
296*f11c7f63SJim Harris    SCIC_SSP_PROTOCOL,
297*f11c7f63SJim Harris 
298*f11c7f63SJim Harris    /**
299*f11c7f63SJim Harris     * This enumeration constant indicates that the protocol utilized
300*f11c7f63SJim Harris     * is the Serial-ATA Tunneling Protocol.
301*f11c7f63SJim Harris     */
302*f11c7f63SJim Harris    SCIC_STP_PROTOCOL
303*f11c7f63SJim Harris 
304*f11c7f63SJim Harris } SCIC_TRANSPORT_PROTOCOL;
305*f11c7f63SJim Harris 
306*f11c7f63SJim Harris 
307*f11c7f63SJim Harris /**
308*f11c7f63SJim Harris  * @brief This method simply returns the size required to build an SCI
309*f11c7f63SJim Harris  *        based IO request object.
310*f11c7f63SJim Harris  *
311*f11c7f63SJim Harris  * @return Return the size of the SCI IO request object.
312*f11c7f63SJim Harris  */
313*f11c7f63SJim Harris U32 scic_io_request_get_object_size(
314*f11c7f63SJim Harris    void
315*f11c7f63SJim Harris );
316*f11c7f63SJim Harris 
317*f11c7f63SJim Harris /**
318*f11c7f63SJim Harris  * @brief This method is called by the SCI user to construct all SCI Core
319*f11c7f63SJim Harris  *        IO requests.  Memory initialization and functionality common to
320*f11c7f63SJim Harris  *        all IO request types is performed in this method.
321*f11c7f63SJim Harris  *
322*f11c7f63SJim Harris  * @note  The SCI core implementation will create an association between
323*f11c7f63SJim Harris  *        the user IO request object and the core IO request object.
324*f11c7f63SJim Harris  *
325*f11c7f63SJim Harris  * @param[in]  scic_controller the handle to the core controller object
326*f11c7f63SJim Harris  *             for which to build an IO request.
327*f11c7f63SJim Harris  * @param[in]  scic_remote_device the handle to the core remote device
328*f11c7f63SJim Harris  *             object for which to build an IO request.
329*f11c7f63SJim Harris  * @param[in]  io_tag This parameter specifies the IO tag to be associated
330*f11c7f63SJim Harris  *             with this request.  If SCI_CONTROLLER_INVALID_IO_TAG is
331*f11c7f63SJim Harris  *             passed, then a copy of the request is built internally.  The
332*f11c7f63SJim Harris  *             request will be copied into the actual controller request
333*f11c7f63SJim Harris  *             memory when the IO tag is allocated internally during the
334*f11c7f63SJim Harris  *             scic_controller_start_io() method.
335*f11c7f63SJim Harris  * @param[in]  user_io_request_object This parameter specifies the user
336*f11c7f63SJim Harris  *             IO request to be utilized during IO construction.  This IO
337*f11c7f63SJim Harris  *             pointer will become the associated object for the core
338*f11c7f63SJim Harris  *             IO request object.
339*f11c7f63SJim Harris  * @param[in]  scic_io_request_memory This parameter specifies the memory
340*f11c7f63SJim Harris  *             location to be utilized when building the core request.
341*f11c7f63SJim Harris  * @param[out] new_scic_io_request_handle This parameter specifies a
342*f11c7f63SJim Harris  *             pointer to the handle the core will expect in further
343*f11c7f63SJim Harris  *             interactions with the core IO request object.
344*f11c7f63SJim Harris  *
345*f11c7f63SJim Harris  * @return Indicate if the controller successfully built the IO request.
346*f11c7f63SJim Harris  * @retval SCI_SUCCESS This value is returned if the IO request was
347*f11c7f63SJim Harris  *         successfully built.
348*f11c7f63SJim Harris  */
349*f11c7f63SJim Harris SCI_STATUS scic_io_request_construct(
350*f11c7f63SJim Harris    SCI_CONTROLLER_HANDLE_T      scic_controller,
351*f11c7f63SJim Harris    SCI_REMOTE_DEVICE_HANDLE_T   scic_remote_device,
352*f11c7f63SJim Harris    U16                          io_tag,
353*f11c7f63SJim Harris    void                       * user_io_request_object,
354*f11c7f63SJim Harris    void                       * scic_io_request_memory,
355*f11c7f63SJim Harris    SCI_IO_REQUEST_HANDLE_T    * new_scic_io_request_handle
356*f11c7f63SJim Harris );
357*f11c7f63SJim Harris 
358*f11c7f63SJim Harris /**
359*f11c7f63SJim Harris  * @brief This method is called by the SCI user to build an SSP
360*f11c7f63SJim Harris  *        IO request.
361*f11c7f63SJim Harris  *
362*f11c7f63SJim Harris  * @pre
363*f11c7f63SJim Harris  *        - The user must have previously called scic_io_request_construct()
364*f11c7f63SJim Harris  *          on the supplied IO request.
365*f11c7f63SJim Harris  *
366*f11c7f63SJim Harris  * @param[in]  scic_io_request This parameter specifies the handle to the
367*f11c7f63SJim Harris  *             io request object to be built.
368*f11c7f63SJim Harris  *
369*f11c7f63SJim Harris  * @return Indicate if the controller successfully built the IO request.
370*f11c7f63SJim Harris  * @retval SCI_SUCCESS This value is returned if the IO request was
371*f11c7f63SJim Harris  *         successfully built.
372*f11c7f63SJim Harris  * @retval SCI_FAILURE_UNSUPPORTED_PROTOCOL This value is returned if the
373*f11c7f63SJim Harris  *         remote_device does not support the SSP protocol.
374*f11c7f63SJim Harris  * @retval SCI_FAILURE_INVALID_ASSOCIATION This value is returned if the
375*f11c7f63SJim Harris  *         user did not properly set the association between the SCIC IO
376*f11c7f63SJim Harris  *         request and the user's IO request.  Please refer to the
377*f11c7f63SJim Harris  *         sci_object_set_association() routine for more
378*f11c7f63SJim Harris  *         information.
379*f11c7f63SJim Harris  */
380*f11c7f63SJim Harris SCI_STATUS scic_io_request_construct_basic_ssp(
381*f11c7f63SJim Harris    SCI_IO_REQUEST_HANDLE_T  scic_io_request
382*f11c7f63SJim Harris );
383*f11c7f63SJim Harris 
384*f11c7f63SJim Harris /**
385*f11c7f63SJim Harris  * @brief This method is called by the SCI user to build an SSP
386*f11c7f63SJim Harris  *        IO request with additional parameters that provide additional
387*f11c7f63SJim Harris  *        flexibility from the standard scic_io_request_construct_basic_ssp()
388*f11c7f63SJim Harris  *        method.
389*f11c7f63SJim Harris  *
390*f11c7f63SJim Harris  * @pre
391*f11c7f63SJim Harris  *        - The user must have previously called scic_io_request_construct()
392*f11c7f63SJim Harris  *          on the supplied IO request.
393*f11c7f63SJim Harris  *
394*f11c7f63SJim Harris  * @param[in]  scic_io_request This parameter specifies the handle to the
395*f11c7f63SJim Harris  *             io request object to be built.
396*f11c7f63SJim Harris  * @param[in]  io_parameters the additional parameter information to
397*f11c7f63SJim Harris  *             be added to the outgoing IO request.
398*f11c7f63SJim Harris  *
399*f11c7f63SJim Harris  * @return Indicate if the controller successfully built the IO request.
400*f11c7f63SJim Harris  * @retval SCI_SUCCESS This value is returned if the IO request was
401*f11c7f63SJim Harris  *         successfully built.
402*f11c7f63SJim Harris  * @retval SCI_FAILURE_UNSUPPORTED_PROTOCOL This value is returned if the
403*f11c7f63SJim Harris  *         remote_device does not support the SSP protocol.
404*f11c7f63SJim Harris  * @retval SCI_FAILURE_INVALID_ASSOCIATION This value is returned if the
405*f11c7f63SJim Harris  *         user did not properly set the association between the SCIC IO
406*f11c7f63SJim Harris  *         request and the user's IO request.  Please refer to the
407*f11c7f63SJim Harris  *         sci_object_set_association() routine for more
408*f11c7f63SJim Harris  *         information.
409*f11c7f63SJim Harris  *
410*f11c7f63SJim Harris  * @todo Determine the failure situations and return values.
411*f11c7f63SJim Harris  */
412*f11c7f63SJim Harris SCI_STATUS scic_io_request_construct_advanced_ssp(
413*f11c7f63SJim Harris    SCI_IO_REQUEST_HANDLE_T    scic_io_request,
414*f11c7f63SJim Harris    SCIC_IO_SSP_PARAMETERS_T * io_parameters
415*f11c7f63SJim Harris );
416*f11c7f63SJim Harris 
417*f11c7f63SJim Harris #if !defined(DISABLE_PASS_THROUGH)
418*f11c7f63SJim Harris 
419*f11c7f63SJim Harris /**
420*f11c7f63SJim Harris  * @brief This method will build an IO request based on the user information
421*f11c7f63SJim Harris  *        supplied in the pass-through IO request object.
422*f11c7f63SJim Harris  *
423*f11c7f63SJim Harris  * @param[in]  scic_io_request This parameter specifies the handle to the
424*f11c7f63SJim Harris  *             io request object to be built.
425*f11c7f63SJim Harris  *
426*f11c7f63SJim Harris  * @param[in]  ssp_passthru_cb This parameter specifies the pointer to
427*f11c7f63SJim Harris  *             the structure containing the callback to the function
428*f11c7f63SJim Harris  *             pointers to get the needed fields from the pass-through
429*f11c7f63SJim Harris  *             reqiest instead of SRB
430*f11c7f63SJim Harris  *
431*f11c7f63SJim Harris  * @return Indicate if the controller successfully built the IO request.
432*f11c7f63SJim Harris  * @retval SCI_SUCCESS This value is returned if the IO request was
433*f11c7f63SJim Harris  *         successfully built.
434*f11c7f63SJim Harris  * @retval SCI_FAILURE_INVALID_ASSOCIATION This value is returned if the
435*f11c7f63SJim Harris  *         user did not properly set the association between the SCIC IO
436*f11c7f63SJim Harris  *         request and the user's IO request.  Please refer to the
437*f11c7f63SJim Harris  *         sci_object_set_association() routine for more
438*f11c7f63SJim Harris  *         information.
439*f11c7f63SJim Harris  */
440*f11c7f63SJim Harris SCI_STATUS scic_io_request_construct_ssp_pass_through(
441*f11c7f63SJim Harris    void                       * scic_io_request_memory,
442*f11c7f63SJim Harris    SCIC_SSP_PASSTHRU_REQUEST_CALLBACKS_T *ssp_passthru_cb
443*f11c7f63SJim Harris );
444*f11c7f63SJim Harris 
445*f11c7f63SJim Harris #else // !defined(DISABLE_PASS_THROUGH)
446*f11c7f63SJim Harris 
447*f11c7f63SJim Harris #define scic_io_request_construct_ssp_pass_through(memory, cb) SCI_FAILURE
448*f11c7f63SJim Harris 
449*f11c7f63SJim Harris #endif // !defined(DISABLE_PASS_THROUGH)
450*f11c7f63SJim Harris 
451*f11c7f63SJim Harris /**
452*f11c7f63SJim Harris  * @brief This method is called by the SCI Core user to build an STP
453*f11c7f63SJim Harris  *        IO request.
454*f11c7f63SJim Harris  *
455*f11c7f63SJim Harris  * @pre
456*f11c7f63SJim Harris  *        - The user must have previously called scic_io_request_construct()
457*f11c7f63SJim Harris  *          on the supplied IO request.
458*f11c7f63SJim Harris  *
459*f11c7f63SJim Harris  * @param[in]  scic_io_request This parameter specifies the handle to the
460*f11c7f63SJim Harris  *             io request object to be built.
461*f11c7f63SJim Harris  *
462*f11c7f63SJim Harris  * @return Indicate if the controller successfully built the IO request.
463*f11c7f63SJim Harris  * @retval SCI_SUCCESS This value is returned if the IO request was
464*f11c7f63SJim Harris  *         successfully built.
465*f11c7f63SJim Harris  * @retval SCI_FAILURE_UNSUPPORTED_PROTOCOL This value is returned if the
466*f11c7f63SJim Harris  *         remote_device does not support the STP protocol.
467*f11c7f63SJim Harris  * @retval SCI_FAILURE_INVALID_ASSOCIATION This value is returned if the
468*f11c7f63SJim Harris  *         user did not properly set the association between the SCIC IO
469*f11c7f63SJim Harris  *         request and the user's IO request.  Please refer to the
470*f11c7f63SJim Harris  *         sci_object_set_association() routine for more
471*f11c7f63SJim Harris  *         information.
472*f11c7f63SJim Harris  */
473*f11c7f63SJim Harris SCI_STATUS scic_io_request_construct_basic_sata(
474*f11c7f63SJim Harris    SCI_IO_REQUEST_HANDLE_T  scic_io_request
475*f11c7f63SJim Harris );
476*f11c7f63SJim Harris 
477*f11c7f63SJim Harris /**
478*f11c7f63SJim Harris  * @brief This method is called by the SCI Core user to build an STP
479*f11c7f63SJim Harris  *        IO request.
480*f11c7f63SJim Harris  *
481*f11c7f63SJim Harris  * @pre
482*f11c7f63SJim Harris  *        - The user must have previously called scic_io_request_construct()
483*f11c7f63SJim Harris  *          on the supplied IO request.
484*f11c7f63SJim Harris  *
485*f11c7f63SJim Harris  * @param[in]  scic_io_request This parameter specifies the handle to the
486*f11c7f63SJim Harris  *             io request object to be built.
487*f11c7f63SJim Harris  *
488*f11c7f63SJim Harris  * @return Indicate if the controller successfully built the IO request.
489*f11c7f63SJim Harris  * @retval SCI_SUCCESS This value is returned if the IO request was
490*f11c7f63SJim Harris  *         successfully built.
491*f11c7f63SJim Harris  * @retval SCI_FAILURE_UNSUPPORTED_PROTOCOL This value is returned if the
492*f11c7f63SJim Harris  *         remote_device does not support the STP protocol.
493*f11c7f63SJim Harris  * @retval SCI_FAILURE_INVALID_ASSOCIATION This value is returned if the
494*f11c7f63SJim Harris  *         user did not properly set the association between the SCIC IO
495*f11c7f63SJim Harris  *         request and the user's IO request.  Please refer to the
496*f11c7f63SJim Harris  *         sci_object_set_association() routine for more
497*f11c7f63SJim Harris  *         information.
498*f11c7f63SJim Harris  */
499*f11c7f63SJim Harris SCI_STATUS scic_io_request_construct_advanced_sata(
500*f11c7f63SJim Harris    SCI_IO_REQUEST_HANDLE_T     scic_io_request,
501*f11c7f63SJim Harris    SCIC_IO_SATA_PARAMETERS_T * io_parameters
502*f11c7f63SJim Harris );
503*f11c7f63SJim Harris 
504*f11c7f63SJim Harris #if !defined(DISABLE_PASS_THROUGH)
505*f11c7f63SJim Harris 
506*f11c7f63SJim Harris /**
507*f11c7f63SJim Harris  * @brief This method is called by the SCI user to build an STP pass-through
508*f11c7f63SJim Harris  *        IO request.
509*f11c7f63SJim Harris  *
510*f11c7f63SJim Harris  * @pre
511*f11c7f63SJim Harris  *        - The user must have previously called scic_io_request_construct()
512*f11c7f63SJim Harris  *          on the supplied IO request.
513*f11c7f63SJim Harris  *
514*f11c7f63SJim Harris  * @param[in]  scic_io_request This parameter specifies the handle to the
515*f11c7f63SJim Harris  *             io request object to be built.
516*f11c7f63SJim Harris  *
517*f11c7f63SJim Harris  * @param[in]  passthru_cb This parameter specifies the pointer to the callback
518*f11c7f63SJim Harris  *             structure that contains the function pointers
519*f11c7f63SJim Harris  *
520*f11c7f63SJim Harris  * @return Indicate if the controller successfully built the IO request.
521*f11c7f63SJim Harris  */
522*f11c7f63SJim Harris SCI_STATUS scic_io_request_construct_sata_pass_through(
523*f11c7f63SJim Harris    SCI_IO_REQUEST_HANDLE_T  scic_io_request,
524*f11c7f63SJim Harris    SCIC_STP_PASSTHRU_REQUEST_CALLBACKS_T *passthru_cb
525*f11c7f63SJim Harris 
526*f11c7f63SJim Harris );
527*f11c7f63SJim Harris 
528*f11c7f63SJim Harris #else // !defined(DISABLE_PASS_THROUGH)
529*f11c7f63SJim Harris 
530*f11c7f63SJim Harris #define scic_io_request_construct_sata_pass_through(io, cb) SCI_FAILURE
531*f11c7f63SJim Harris 
532*f11c7f63SJim Harris #endif // !defined(DISABLE_PASS_THROUGH)
533*f11c7f63SJim Harris 
534*f11c7f63SJim Harris /**
535*f11c7f63SJim Harris  * @brief This method is called by the SCI user to build an SMP
536*f11c7f63SJim Harris  *        IO request.
537*f11c7f63SJim Harris  *
538*f11c7f63SJim Harris  * @pre
539*f11c7f63SJim Harris  *        - The user must have previously called scic_io_request_construct()
540*f11c7f63SJim Harris  *          on the supplied IO request.
541*f11c7f63SJim Harris  *
542*f11c7f63SJim Harris  * @param[in]  scic_io_request This parameter specifies the handle to the
543*f11c7f63SJim Harris  *             io request object to be built.
544*f11c7f63SJim Harris  *
545*f11c7f63SJim Harris  * @return Indicate if the controller successfully built the IO request.
546*f11c7f63SJim Harris  * @retval SCI_SUCCESS This value is returned if the IO request was
547*f11c7f63SJim Harris  *         successfully built.
548*f11c7f63SJim Harris  * @retval SCI_FAILURE_UNSUPPORTED_PROTOCOL This value is returned if the
549*f11c7f63SJim Harris  *         remote_device does not support the SMP protocol.
550*f11c7f63SJim Harris  * @retval SCI_FAILURE_INVALID_ASSOCIATION This value is returned if the
551*f11c7f63SJim Harris  *         user did not properly set the association between the SCIC IO
552*f11c7f63SJim Harris  *         request and the user's IO request.  Please refer to the
553*f11c7f63SJim Harris  *         sci_object_set_association() routine for more
554*f11c7f63SJim Harris  *         information.
555*f11c7f63SJim Harris  */
556*f11c7f63SJim Harris SCI_STATUS scic_io_request_construct_smp(
557*f11c7f63SJim Harris    SCI_IO_REQUEST_HANDLE_T  scic_io_request
558*f11c7f63SJim Harris );
559*f11c7f63SJim Harris 
560*f11c7f63SJim Harris 
561*f11c7f63SJim Harris /**
562*f11c7f63SJim Harris  * @brief This method is called by the SCI user to build an SMP pass-through
563*f11c7f63SJim Harris  *        IO request.
564*f11c7f63SJim Harris  *
565*f11c7f63SJim Harris  * @pre
566*f11c7f63SJim Harris  *        - The user must have previously called scic_io_request_construct()
567*f11c7f63SJim Harris  *          on the supplied IO request.
568*f11c7f63SJim Harris  *
569*f11c7f63SJim Harris  * @param[in]  scic_smp_request This parameter specifies the handle to the
570*f11c7f63SJim Harris  *             io request object to be built.
571*f11c7f63SJim Harris  *
572*f11c7f63SJim Harris  * @param[in]  passthru_cb This parameter specifies the pointer to the callback
573*f11c7f63SJim Harris  *             structure that contains the function pointers
574*f11c7f63SJim Harris  *
575*f11c7f63SJim Harris  * @return Indicate if the controller successfully built the IO request.
576*f11c7f63SJim Harris  */
577*f11c7f63SJim Harris SCI_STATUS scic_io_request_construct_smp_pass_through(
578*f11c7f63SJim Harris    SCI_IO_REQUEST_HANDLE_T  scic_smp_request,
579*f11c7f63SJim Harris    SCIC_SMP_PASSTHRU_REQUEST_CALLBACKS_T *passthru_cb
580*f11c7f63SJim Harris );
581*f11c7f63SJim Harris 
582*f11c7f63SJim Harris /**
583*f11c7f63SJim Harris  * @brief This method returns the controller specific IO/Task request status.
584*f11c7f63SJim Harris  *        These status values are unique to the specific controller being
585*f11c7f63SJim Harris  *        managed by the SCIC.
586*f11c7f63SJim Harris  *
587*f11c7f63SJim Harris  * @param[in]  io_request the handle to the IO or task management request
588*f11c7f63SJim Harris  *             object for which to retrieve the status.
589*f11c7f63SJim Harris  *
590*f11c7f63SJim Harris  * @return This method returns a value indicating the controller specific
591*f11c7f63SJim Harris  *         request status.
592*f11c7f63SJim Harris  */
593*f11c7f63SJim Harris U32 scic_request_get_controller_status(
594*f11c7f63SJim Harris    SCI_IO_REQUEST_HANDLE_T  io_request
595*f11c7f63SJim Harris );
596*f11c7f63SJim Harris 
597*f11c7f63SJim Harris /**
598*f11c7f63SJim Harris  * @brief This method returns the user specific IO/Task request status.
599*f11c7f63SJim Harris  *
600*f11c7f63SJim Harris  * @param[in]  io_request the handle to the IO or task management request
601*f11c7f63SJim Harris  *             object for which to retrieve the status.
602*f11c7f63SJim Harris  *
603*f11c7f63SJim Harris  * @return This method returns a value indicating the user specific
604*f11c7f63SJim Harris  *         request status.
605*f11c7f63SJim Harris  */
606*f11c7f63SJim Harris U32 scic_request_get_sci_status(
607*f11c7f63SJim Harris    SCI_IO_REQUEST_HANDLE_T  io_request
608*f11c7f63SJim Harris );
609*f11c7f63SJim Harris 
610*f11c7f63SJim Harris 
611*f11c7f63SJim Harris /**
612*f11c7f63SJim Harris  * @brief This method will return the address to the command information
613*f11c7f63SJim Harris  *        unit.
614*f11c7f63SJim Harris  *
615*f11c7f63SJim Harris  * @param[in]  scic_io_request This parameter specifies the handle to the
616*f11c7f63SJim Harris  *             io request object to be built.
617*f11c7f63SJim Harris  *
618*f11c7f63SJim Harris  * @return The address of the SSP/SMP command information unit.
619*f11c7f63SJim Harris  */
620*f11c7f63SJim Harris void * scic_io_request_get_command_iu_address(
621*f11c7f63SJim Harris    SCI_IO_REQUEST_HANDLE_T  scic_io_request
622*f11c7f63SJim Harris );
623*f11c7f63SJim Harris 
624*f11c7f63SJim Harris /**
625*f11c7f63SJim Harris  * @brief This method will return the address to the response information
626*f11c7f63SJim Harris  *        unit.  For an SSP request this buffer is only valid if the IO
627*f11c7f63SJim Harris  *        request is completed with the status SCI_FAILURE_IO_RESPONSE_VALID.
628*f11c7f63SJim Harris  *
629*f11c7f63SJim Harris  * @param[in]  scic_io_request This parameter specifies the handle to the
630*f11c7f63SJim Harris  *             io request object to be built.
631*f11c7f63SJim Harris  *
632*f11c7f63SJim Harris  * @return The address of the SSP/SMP response information unit.
633*f11c7f63SJim Harris  */
634*f11c7f63SJim Harris void * scic_io_request_get_response_iu_address(
635*f11c7f63SJim Harris    SCI_IO_REQUEST_HANDLE_T  scic_io_request
636*f11c7f63SJim Harris );
637*f11c7f63SJim Harris 
638*f11c7f63SJim Harris /**
639*f11c7f63SJim Harris  * @brief This method will return the IO tag utilized by the IO request.
640*f11c7f63SJim Harris  *
641*f11c7f63SJim Harris  * @param[in]  scic_io_request This parameter specifies the handle to the
642*f11c7f63SJim Harris  *             io request object for which to return the IO tag.
643*f11c7f63SJim Harris  *
644*f11c7f63SJim Harris  * @return An unsigned integer representing the IO tag being utilized.
645*f11c7f63SJim Harris  * @retval SCI_CONTROLLER_INVALID_IO_TAG This value is returned if the IO
646*f11c7f63SJim Harris  *         does not currently have an IO tag allocated to it.
647*f11c7f63SJim Harris  * @retval All return other values indicate a legitimate tag.
648*f11c7f63SJim Harris  */
649*f11c7f63SJim Harris U16 scic_io_request_get_io_tag(
650*f11c7f63SJim Harris    SCI_IO_REQUEST_HANDLE_T  scic_io_request
651*f11c7f63SJim Harris );
652*f11c7f63SJim Harris 
653*f11c7f63SJim Harris /**
654*f11c7f63SJim Harris  * @brief This method will inform the user of the protocol with which
655*f11c7f63SJim Harris  *        the supplied IO request was created.
656*f11c7f63SJim Harris  *
657*f11c7f63SJim Harris  * @param[in]  scic_io_request This parameter specifies the IO request
658*f11c7f63SJim Harris  *             for which to retrieve the protocol.
659*f11c7f63SJim Harris  *
660*f11c7f63SJim Harris  * @return This method returns the transport protocol utilized for the
661*f11c7f63SJim Harris  *         the supplied request.  Please refer to SCIC_TRANSPORT_PROTOCOL
662*f11c7f63SJim Harris  *         for more information.
663*f11c7f63SJim Harris  */
664*f11c7f63SJim Harris SCIC_TRANSPORT_PROTOCOL scic_io_request_get_protocol(
665*f11c7f63SJim Harris    SCI_IO_REQUEST_HANDLE_T  scic_io_request
666*f11c7f63SJim Harris );
667*f11c7f63SJim Harris 
668*f11c7f63SJim Harris /**
669*f11c7f63SJim Harris  * @brief This method will assign an NCQ tag to the io request object.  The
670*f11c7f63SJim Harris  *        caller of this function must make sure that only valid NCQ tags are
671*f11c7f63SJim Harris  *        assigned to the io request object.
672*f11c7f63SJim Harris  *
673*f11c7f63SJim Harris  * @param[in]  scic_io_request This parameter specifies the handle to the
674*f11c7f63SJim Harris  *             io request object to which to assign the ncq tag.
675*f11c7f63SJim Harris  * @param[in]  ncq_tag This parameter specifies the NCQ tag to be utilized
676*f11c7f63SJim Harris  *             for the supplied core IO request.  It is up to the user to make
677*f11c7f63SJim Harris  *             sure that this is a valid NCQ tag.
678*f11c7f63SJim Harris  *
679*f11c7f63SJim Harris  * @return none
680*f11c7f63SJim Harris  *
681*f11c7f63SJim Harris  * @note This function is only valid for SATA NCQ requests.
682*f11c7f63SJim Harris  */
683*f11c7f63SJim Harris void scic_stp_io_request_set_ncq_tag(
684*f11c7f63SJim Harris    SCI_IO_REQUEST_HANDLE_T  scic_io_request,
685*f11c7f63SJim Harris    U16                      ncq_tag
686*f11c7f63SJim Harris );
687*f11c7f63SJim Harris 
688*f11c7f63SJim Harris /**
689*f11c7f63SJim Harris  * @brief This method will return the address of the host to device register
690*f11c7f63SJim Harris  *        fis region for the io request object.
691*f11c7f63SJim Harris  *
692*f11c7f63SJim Harris  * @param[in] scic_io_request This parameter specifies the handle to the io
693*f11c7f63SJim Harris  *       request object from which to get the host to device register fis
694*f11c7f63SJim Harris  *       buffer.
695*f11c7f63SJim Harris  *
696*f11c7f63SJim Harris  * @return The address of the host to device register fis buffer in the io
697*f11c7f63SJim Harris  *         request object.
698*f11c7f63SJim Harris  *
699*f11c7f63SJim Harris  * @note This function is only valid for SATA requests.
700*f11c7f63SJim Harris  */
701*f11c7f63SJim Harris void * scic_stp_io_request_get_h2d_reg_address(
702*f11c7f63SJim Harris    SCI_IO_REQUEST_HANDLE_T  scic_io_request
703*f11c7f63SJim Harris );
704*f11c7f63SJim Harris 
705*f11c7f63SJim Harris /**
706*f11c7f63SJim Harris  * @brief This method will return the address of the device to host register
707*f11c7f63SJim Harris  *        fis region for the io request object.
708*f11c7f63SJim Harris  *
709*f11c7f63SJim Harris  * @param[in] scic_io_request This parameter specifies teh handle to the io
710*f11c7f63SJim Harris  *       request object from which to get the device to host register fis
711*f11c7f63SJim Harris  *       buffer.
712*f11c7f63SJim Harris  *
713*f11c7f63SJim Harris  * @return The address fo the device to host register fis ending the io
714*f11c7f63SJim Harris  *         request.
715*f11c7f63SJim Harris  *
716*f11c7f63SJim Harris  * @note This function is only valid for SATA requests.
717*f11c7f63SJim Harris  */
718*f11c7f63SJim Harris void * scic_stp_io_request_get_d2h_reg_address(
719*f11c7f63SJim Harris    SCI_IO_REQUEST_HANDLE_T  scic_io_request
720*f11c7f63SJim Harris );
721*f11c7f63SJim Harris 
722*f11c7f63SJim Harris /**
723*f11c7f63SJim Harris  * @brief This method will return the rx frame for the io request object that
724*f11c7f63SJim Harris  *        contains the given offset.
725*f11c7f63SJim Harris  *
726*f11c7f63SJim Harris  * @param[in] scic_io_request This parameter specifies the handle to the io
727*f11c7f63SJim Harris  *       request object which has received the frame data.
728*f11c7f63SJim Harris  * @param[in] offset This parameter specifies which frame is being requested.
729*f11c7f63SJim Harris  *
730*f11c7f63SJim Harris  * @return The return is a pointer to the frame buffer data.
731*f11c7f63SJim Harris  *
732*f11c7f63SJim Harris  * @note Frame buffers are only 1024 bytes in size.  Reading past the end of a
733*f11c7f63SJim Harris  *       frame will have unexpected results.
734*f11c7f63SJim Harris  */
735*f11c7f63SJim Harris void * scic_io_request_get_rx_frame(
736*f11c7f63SJim Harris    SCI_IO_REQUEST_HANDLE_T  scic_io_request,
737*f11c7f63SJim Harris    U32                      offset
738*f11c7f63SJim Harris );
739*f11c7f63SJim Harris 
740*f11c7f63SJim Harris /**
741*f11c7f63SJim Harris  * @brief This method will return the number of bytes transferred from the SCU
742*f11c7f63SJim Harris  *
743*f11c7f63SJim Harris  * @param[in] scic_io_request This parameter specifies the handle to the io request
744*f11c7f63SJim Harris  *            whose data length was not eqaul to the data length specified in the request.
745*f11c7f63SJim Harris  *            When the driver gets an early io completion status from the hardware,
746*f11c7f63SJim Harris  *            this routine should be called to get the actual number of bytes transferred
747*f11c7f63SJim Harris  *
748*f11c7f63SJim Harris  * @return The return is the number of bytes transferred when the data legth is not equal to
749*f11c7f63SJim Harris  *         the specified length in the io request
750*f11c7f63SJim Harris  *
751*f11c7f63SJim Harris  */
752*f11c7f63SJim Harris U32 scic_io_request_get_number_of_bytes_transferred (
753*f11c7f63SJim Harris    SCI_IO_REQUEST_HANDLE_T  scic_io_request
754*f11c7f63SJim Harris );
755*f11c7f63SJim Harris 
756*f11c7f63SJim Harris #ifdef __cplusplus
757*f11c7f63SJim Harris }
758*f11c7f63SJim Harris #endif // __cplusplus
759*f11c7f63SJim Harris 
760*f11c7f63SJim Harris #endif // _SCIC_IO_REQUEST_H_
761*f11c7f63SJim Harris 
762