xref: /freebsd/sys/dev/pms/RefTisa/tisa/sassata/sata/host/satproto.h (revision a64729f5077d77e13b9497cb33ecb3c82e606ee8)
1 /*******************************************************************************
2 *Copyright (c) 2014 PMC-Sierra, Inc.  All rights reserved.
3 *
4 *Redistribution and use in source and binary forms, with or without modification, are permitted provided
5 *that the following conditions are met:
6 *1. Redistributions of source code must retain the above copyright notice, this list of conditions and the
7 *following disclaimer.
8 *2. Redistributions in binary form must reproduce the above copyright notice,
9 *this list of conditions and the following disclaimer in the documentation and/or other materials provided
10 *with the distribution.
11 *
12 *THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED
13 *WARRANTIES,INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
14 *FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
15 *FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
16 *NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
17 *BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
18 *LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
19 *SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE
20 *
21 *
22 ********************************************************************************/
23 /*******************************************************************************/
24 /** \file
25  *
26  *
27  * The file contaning function protoptype used by SAT layer.
28  *
29  */
30 
31 #ifndef  __SATPROTO_H__
32 #define __SATPROTO_H__
33 
34 
35 /*****************************************************************************
36 *! \brief  itdsatProcessAbnormalCompletion
37 *
38 *   This routine is called to complete error case for SATA request previously
39 *   issued to the LL Layer in saSATAStart()
40 *
41 *  \param  agRoot:       Handles for this instance of SAS/SATA hardware
42 *  \param  agIORequest:  Pointer to the LL I/O request context for this I/O.
43 *  \param  agIOStatus:   Status of completed I/O.
44 *  \param  agSATAParm1:  Additional info based on status.
45 *  \param  agIOInfoLen:  Length in bytes of overrun/underrun residual or FIS
46 *                        length.
47 *  \param  satIOContext: Pointer to satIOContext_t.
48 *
49 *  \return: none
50 *
51 *****************************************************************************/
52 void  itdsatProcessAbnormalCompletion(
53                            agsaRoot_t        *agRoot,
54                            agsaIORequest_t   *agIORequest,
55                            bit32             agIOStatus,
56                            agsaFisHeader_t   *agFirstDword,
57                            bit32             agIOInfoLen,
58                            agsaFrameHandle_t agFrameHandle,
59                            satIOContext_t    *satIOContext
60                            );
61 void  itdsatDelayedProcessAbnormalCompletion(
62                                              agsaRoot_t        *agRoot,
63                                              agsaIORequest_t   *agIORequest,
64                                              bit32             agIOStatus,
65                                              agsaFisHeader_t   *agFirstDword,
66                                              bit32             agIOInfoLen,
67                                              agsaFrameHandle_t agFrameHandle,
68                                              satIOContext_t    *satIOContext
69                                              );
70 
71 void  itdsatErrorSATAEventHandle(
72                                              agsaRoot_t        *agRoot,
73                                              agsaIORequest_t   *agIORequest,
74                                              agsaPortContext_t *agPortContext,
75                                              agsaDevHandle_t   *agDevHandle,
76                                              bit32             event,
77                                              satIOContext_t    *ioContext
78                                              );
79 
80 void itdsatEncryptionHandler (
81                        agsaRoot_t              *agRoot,
82                        agsaIORequest_t         *agIORequest,
83                        bit32                   agIOStatus,
84                        bit32                   agIOInfoLen,
85                        void                    *agParam,
86                        bit32                   agOtherInfo
87                        );
88 
89 osGLOBAL void
90 itdsatDifHandler(
91                  agsaRoot_t              *agRoot,
92                  agsaIORequest_t         *agIORequest,
93                  bit32                   agIOStatus,
94                  bit32                   agIOInfoLen,
95                  void                    *agParam,
96                  bit32                   agOtherInfo
97                 );
98 
99 void  satProcessAbort(
100                       tiRoot_t          *tiRoot,
101                       tiIORequest_t     *tiIORequest,
102                       satIOContext_t    *satIOContext
103                       );
104 /*****************************************************************************/
105 /*! \brief Setup up the SCSI Sense response.
106  *
107  *  This function is used to setup up the Sense Data payload for
108  *     CHECK CONDITION status.
109  *
110  *  \param pSense:      Pointer to the scsiRspSense_t sense data structure.
111  *  \param SnsKey:      SCSI Sense Key.
112  *  \param SnsInfo:     SCSI Sense Info.
113  *  \param SnsCode:     SCSI Sense Code.
114  *
115  *  \return None
116  */
117 /*****************************************************************************/
118 
119 void satSetSensePayload( scsiRspSense_t   *pSense,
120                          bit8             SnsKey,
121                          bit32            SnsInfo,
122                          bit16            SnsCode,
123                          satIOContext_t   *satIOContext);
124 
125 
126 /*****************************************************************************/
127 /*! \brief Setup up the SCSI Sense response.
128  *
129  *  This function is used to setup up the Sense Data payload for
130  *     CHECK CONDITION status.
131  *
132  *  \param pSense:      Pointer to the scsiRspSense_t sense data structure.
133  *  \param SnsKey:      SCSI Sense Key.
134  *  \param SnsInfo:     SCSI Sense Info.
135  *  \param SnsCode:     SCSI Sense Code.
136  *
137  *  \return None
138  */
139 /*****************************************************************************/
140 
141 void satSetDeferredSensePayload( scsiRspSense_t   *pSense,
142                                  bit8             SnsKey,
143                                  bit32            SnsInfo,
144                                  bit16            SnsCode,
145                                  satIOContext_t   *satIOContext
146                                  );
147 
148 /*****************************************************************************/
149 /*! \brief SAT implementation for ATAPI Packet Command.
150  *
151  *  SAT implementation for ATAPI Packet and send FIS request to LL layer.
152  *
153  *  \param   tiRoot:           Pointer to TISA initiator driver/port instance.
154  *  \param   tiIORequest:      Pointer to TISA I/O request context for this I/O.
155  *  \param   tiDeviceHandle:   Pointer to TISA device handle for this I/O.
156  *  \param   tiScsiRequest:    Pointer to TISA SCSI I/O request and SGL list.
157  *  \param   satIOContext_t:   Pointer to the SAT IO Context
158  *
159  *  \return If command is started successfully
160  *    - \e tiSuccess:     I/O request successfully initiated.
161  *    - \e tiBusy:        No resources available, try again later.
162  *    - \e tiIONoDevice:  Invalid device handle.
163  *    - \e tiError:       Other errors.
164  */
165 /*****************************************************************************/
166 GLOBAL bit32  satPacket(
167                    tiRoot_t                  *tiRoot,
168                    tiIORequest_t             *tiIORequest,
169                    tiDeviceHandle_t          *tiDeviceHandle,
170                    tiScsiInitiatorRequest_t *tiScsiRequest,
171                    satIOContext_t            *satIOContext);
172 
173 void satPacketCB(
174                  agsaRoot_t        *agRoot,
175                  agsaIORequest_t   *agIORequest,
176                  bit32             agIOStatus,
177                  agsaFisHeader_t   *agFirstDword,
178                  bit32             agIOInfoLen,
179                  void              *agParam,
180                  void              *ioContext
181                  );
182 /*****************************************************************************/
183 /*! \brief SAT implementation for satDeviceReset.
184  *
185  *  This function creates DEVICE RESET fis and sends the request to LL layer
186  *
187  *  \param   tiRoot:           Pointer to TISA initiator driver/port instance.
188  *  \param   tiIORequest:      Pointer to TISA I/O request context for this I/O.
189  *  \param   tiDeviceHandle:   Pointer to TISA device handle for this I/O.
190  *  \param   tiScsiRequest:    Pointer to TISA SCSI I/O request and SGL list.
191  *  \param   satIOContext_t:   Pointer to the SAT IO Context
192  *
193  *  \return If command is started successfully
194  *    - \e tiSuccess:     I/O request successfully initiated.
195  *    - \e tiBusy:        No resources available, try again later.
196  *    - \e tiIONoDevice:  Invalid device handle.
197  *    - \e tiError:       Other errors.
198  */
199 /*****************************************************************************/
200 GLOBAL bit32  satDeviceReset(
201                             tiRoot_t                  *tiRoot,
202                             tiIORequest_t             *tiIORequest,
203                             tiDeviceHandle_t          *tiDeviceHandle,
204                             tiScsiInitiatorRequest_t  *tiScsiRequest,
205                             satIOContext_t            *satIOContext
206                             );
207 
208 void satDeviceResetCB(
209                  agsaRoot_t        *agRoot,
210                  agsaIORequest_t   *agIORequest,
211                  bit32             agIOStatus,
212                  agsaFisHeader_t   *agFirstDword,
213                  bit32             agIOInfoLen,
214                  void              *agParam,
215                  void              *ioContext
216                  );
217 
218 /*****************************************************************************/
219 /*! \brief SAT implementation for satExecuteDeviceDiagnostic.
220  *
221  *  This function creates Execute Device Diagnostic fis and sends the request to LL layer
222  *
223  *  \param   tiRoot:           Pointer to TISA initiator driver/port instance.
224  *  \param   tiIORequest:      Pointer to TISA I/O request context for this I/O.
225  *  \param   tiDeviceHandle:   Pointer to TISA device handle for this I/O.
226  *  \param   tiScsiRequest:    Pointer to TISA SCSI I/O request and SGL list.
227  *  \param   satIOContext_t:   Pointer to the SAT IO Context
228  *
229  *  \return If command is started successfully
230  *    - \e tiSuccess:     I/O request successfully initiated.
231  *    - \e tiBusy:        No resources available, try again later.
232  *    - \e tiIONoDevice:  Invalid device handle.
233  *    - \e tiError:       Other errors.
234  */
235 /*****************************************************************************/
236 GLOBAL bit32  satExecuteDeviceDiagnostic(
237                             tiRoot_t                  *tiRoot,
238                             tiIORequest_t             *tiIORequest,
239                             tiDeviceHandle_t          *tiDeviceHandle,
240                             tiScsiInitiatorRequest_t  *tiScsiRequest,
241                             satIOContext_t            *satIOContext
242                             );
243 
244 void satExecuteDeviceDiagnosticCB(
245                  agsaRoot_t        *agRoot,
246                  agsaIORequest_t   *agIORequest,
247                  bit32             agIOStatus,
248                  agsaFisHeader_t   *agFirstDword,
249                  bit32             agIOInfoLen,
250                  void              *agParam,
251                  void              *ioContext
252                  );
253 
254 /*****************************************************************************/
255 /*! \brief SAT implementation for satSetFeatures.
256  *
257  *  This function creates SetFeatures fis and sends the request to LL layer
258  *
259  *  \param   tiRoot:           Pointer to TISA initiator driver/port instance.
260  *  \param   tiIORequest:      Pointer to TISA I/O request context for this I/O.
261  *  \param   tiDeviceHandle:   Pointer to TISA device handle for this I/O.
262  *  \param   tiScsiRequest:    Pointer to TISA SCSI I/O request and SGL list.
263  *  \param   satIOContext_t:   Pointer to the SAT IO Context
264  *
265  *  \return If command is started successfully
266  *    - \e tiSuccess:     I/O request successfully initiated.
267  *    - \e tiBusy:        No resources available, try again later.
268  *    - \e tiIONoDevice:  Invalid device handle.
269  *    - \e tiError:       Other errors.
270  */
271 /*****************************************************************************/
272 GLOBAL bit32  satSetFeatures(
273                             tiRoot_t                  *tiRoot,
274                             tiIORequest_t             *tiIORequest,
275                             tiDeviceHandle_t          *tiDeviceHandle,
276                             tiScsiInitiatorRequest_t  *tiScsiRequest,
277                             satIOContext_t            *satIOContext,
278                             bit8                      bTransferMode
279                             );
280  void satSetFeaturesPIOCB(
281                   agsaRoot_t        *agRoot,
282                   agsaIORequest_t   *agIORequest,
283                   bit32             agIOStatus,
284                   agsaFisHeader_t   *agFirstDword,
285                   bit32             agIOInfoLen,
286                   void              *agParam,
287                   void              *ioContext
288                   );
289 
290  void satSetFeaturesCB(
291                   agsaRoot_t        *agRoot,
292                   agsaIORequest_t   *agIORequest,
293                   bit32             agIOStatus,
294                   agsaFisHeader_t   *agFirstDword,
295                   bit32             agIOInfoLen,
296                   void              *agParam,
297                   void              *ioContext
298                   );
299 /*****************************************************************************/
300 /*! \brief SAT implementation for SCSI REQUEST SENSE to ATAPI device.
301  *
302  *  SAT implementation for SCSI REQUEST SENSE.
303  *
304  *  \param   tiRoot:           Pointer to TISA initiator driver/port instance.
305  *  \param   tiIORequest:      Pointer to TISA I/O request context for this I/O.
306  *  \param   tiDeviceHandle:   Pointer to TISA device handle for this I/O.
307  *  \param   tiScsiRequest:    Pointer to TISA SCSI I/O request and SGL list.
308  *  \param   satIOContext_t:   Pointer to the SAT IO Context
309  *
310  *  \return If command is started successfully
311  *    - \e tiSuccess:     I/O request successfully initiated.
312  *    - \e tiBusy:        No resources available, try again later.
313  *    - \e tiIONoDevice:  Invalid device handle.
314  *    - \e tiError:       Other errors.
315  */
316 /*****************************************************************************/
317 GLOBAL bit32  satRequestSenseForATAPI(
318                    tiRoot_t                  *tiRoot,
319                    tiIORequest_t             *tiIORequest,
320                    tiDeviceHandle_t          *tiDeviceHandle,
321                    tiScsiInitiatorRequest_t  *tiScsiRequest,
322                    satIOContext_t            *satIOContext);
323 
324  void satRequestSenseForATAPICB(
325                   agsaRoot_t        *agRoot,
326                   agsaIORequest_t   *agIORequest,
327                   bit32             agIOStatus,
328                   agsaFisHeader_t   *agFirstDword,
329                   bit32             agIOInfoLen,
330                   void              *agParam,
331                   void              *ioContext
332                   );
333 
334 /*****************************************************************************/
335 /*! \brief SAT implementation for SCSI READ12.
336  *
337  *  SAT implementation for SCSI READ12 and send FIS request to LL layer.
338  *
339  *  \param   tiRoot:           Pointer to TISA initiator driver/port instance.
340  *  \param   tiIORequest:      Pointer to TISA I/O request context for this I/O.
341  *  \param   tiDeviceHandle:   Pointer to TISA device handle for this I/O.
342  *  \param   tiScsiRequest:    Pointer to TISA SCSI I/O request and SGL list.
343  *  \param   satIOContext_t:   Pointer to the SAT IO Context
344  *
345  *  \return If command is started successfully
346  *    - \e tiSuccess:     I/O request successfully initiated.
347  *    - \e tiBusy:        No resources available, try again later.
348  *    - \e tiIONoDevice:  Invalid device handle.
349  *    - \e tiError:       Other errors.
350  */
351 /*****************************************************************************/
352 GLOBAL bit32  satRead12(
353                    tiRoot_t                  *tiRoot,
354                    tiIORequest_t             *tiIORequest,
355                    tiDeviceHandle_t          *tiDeviceHandle,
356                    tiScsiInitiatorRequest_t *tiScsiRequest,
357                    satIOContext_t            *satIOContext);
358 
359 /*****************************************************************************/
360 /*! \brief SAT implementation for SCSI READ10.
361  *
362  *  SAT implementation for SCSI READ10 and send FIS request to LL layer.
363  *
364  *  \param   tiRoot:           Pointer to TISA initiator driver/port instance.
365  *  \param   tiIORequest:      Pointer to TISA I/O request context for this I/O.
366  *  \param   tiDeviceHandle:   Pointer to TISA device handle for this I/O.
367  *  \param   tiScsiRequest:    Pointer to TISA SCSI I/O request and SGL list.
368  *  \param   satIOContext_t:   Pointer to the SAT IO Context
369  *
370  *  \return If command is started successfully
371  *    - \e tiSuccess:     I/O request successfully initiated.
372  *    - \e tiBusy:        No resources available, try again later.
373  *    - \e tiIONoDevice:  Invalid device handle.
374  *    - \e tiError:       Other errors.
375  */
376 /*****************************************************************************/
377 GLOBAL bit32  satRead10(
378                    tiRoot_t                  *tiRoot,
379                    tiIORequest_t             *tiIORequest,
380                    tiDeviceHandle_t          *tiDeviceHandle,
381                    tiScsiInitiatorRequest_t *tiScsiRequest,
382                    satIOContext_t            *satIOContext);
383 
384 
385 /*****************************************************************************/
386 /*! \brief SAT implementation for SCSI READ16.
387  *
388  *  SAT implementation for SCSI READ16 and send FIS request to LL layer.
389  *
390  *  \param   tiRoot:           Pointer to TISA initiator driver/port instance.
391  *  \param   tiIORequest:      Pointer to TISA I/O request context for this I/O.
392  *  \param   tiDeviceHandle:   Pointer to TISA device handle for this I/O.
393  *  \param   tiScsiRequest:    Pointer to TISA SCSI I/O request and SGL list.
394  *  \param   satIOContext_t:   Pointer to the SAT IO Context
395  *
396  *  \return If command is started successfully
397  *    - \e tiSuccess:     I/O request successfully initiated.
398  *    - \e tiBusy:        No resources available, try again later.
399  *    - \e tiIONoDevice:  Invalid device handle.
400  *    - \e tiError:       Other errors.
401  */
402 /*****************************************************************************/
403 GLOBAL bit32  satRead16(
404                    tiRoot_t                  *tiRoot,
405                    tiIORequest_t             *tiIORequest,
406                    tiDeviceHandle_t          *tiDeviceHandle,
407                    tiScsiInitiatorRequest_t *tiScsiRequest,
408                    satIOContext_t            *satIOContext);
409 /*****************************************************************************/
410 /*! \brief SAT implementation for SCSI READ6.
411  *
412  *  SAT implementation for SCSI READ6 and send FIS request to LL layer.
413  *
414  *  \param   tiRoot:           Pointer to TISA initiator driver/port instance.
415  *  \param   tiIORequest:      Pointer to TISA I/O request context for this I/O.
416  *  \param   tiDeviceHandle:   Pointer to TISA device handle for this I/O.
417  *  \param   tiScsiRequest:    Pointer to TISA SCSI I/O request and SGL list.
418  *  \param   satIOContext_t:   Pointer to the SAT IO Context
419  *
420  *  \return If command is started successfully
421  *    - \e tiSuccess:     I/O request successfully initiated.
422  *    - \e tiBusy:        No resources available, try again later.
423  *    - \e tiIONoDevice:  Invalid device handle.
424  *    - \e tiError:       Other errors.
425  */
426 /*****************************************************************************/
427 GLOBAL bit32  satRead6(
428                    tiRoot_t                  *tiRoot,
429                    tiIORequest_t             *tiIORequest,
430                    tiDeviceHandle_t          *tiDeviceHandle,
431                    tiScsiInitiatorRequest_t *tiScsiRequest,
432                    satIOContext_t            *satIOContext);
433 
434 /*****************************************************************************/
435 /*! \brief SAT implementation for SCSI WRITE16.
436  *
437  *  SAT implementation for SCSI WRITE16 and send FIS request to LL layer.
438  *
439  *  \param   tiRoot:           Pointer to TISA initiator driver/port instance.
440  *  \param   tiIORequest:      Pointer to TISA I/O request context for this I/O.
441  *  \param   tiDeviceHandle:   Pointer to TISA device handle for this I/O.
442  *  \param   tiScsiRequest:    Pointer to TISA SCSI I/O request and SGL list.
443  *  \param   satIOContext_t:   Pointer to the SAT IO Context
444  *
445  *  \return If command is started successfully
446  *    - \e tiSuccess:     I/O request successfully initiated.
447  *    - \e tiBusy:        No resources available, try again later.
448  *    - \e tiIONoDevice:  Invalid device handle.
449  *    - \e tiError:       Other errors.
450  */
451 /*****************************************************************************/
452 GLOBAL bit32  satWrite16(
453                    tiRoot_t                  *tiRoot,
454                    tiIORequest_t             *tiIORequest,
455                    tiDeviceHandle_t          *tiDeviceHandle,
456                    tiScsiInitiatorRequest_t *tiScsiRequest,
457                    satIOContext_t            *satIOContext);
458 
459 /*****************************************************************************/
460 /*! \brief SAT implementation for SCSI WRITE12.
461  *
462  *  SAT implementation for SCSI WRITE12 and send FIS request to LL layer.
463  *
464  *  \param   tiRoot:           Pointer to TISA initiator driver/port instance.
465  *  \param   tiIORequest:      Pointer to TISA I/O request context for this I/O.
466  *  \param   tiDeviceHandle:   Pointer to TISA device handle for this I/O.
467  *  \param   tiScsiRequest:    Pointer to TISA SCSI I/O request and SGL list.
468  *  \param   satIOContext_t:   Pointer to the SAT IO Context
469  *
470  *  \return If command is started successfully
471  *    - \e tiSuccess:     I/O request successfully initiated.
472  *    - \e tiBusy:        No resources available, try again later.
473  *    - \e tiIONoDevice:  Invalid device handle.
474  *    - \e tiError:       Other errors.
475  */
476 /*****************************************************************************/
477 GLOBAL bit32  satWrite12(
478                    tiRoot_t                  *tiRoot,
479                    tiIORequest_t             *tiIORequest,
480                    tiDeviceHandle_t          *tiDeviceHandle,
481                    tiScsiInitiatorRequest_t *tiScsiRequest,
482                    satIOContext_t            *satIOContext);
483 
484 /*****************************************************************************/
485 /*! \brief SAT implementation for SCSI WRITE10.
486  *
487  *  SAT implementation for SCSI WRITE10 and send FIS request to LL layer.
488  *
489  *  \param   tiRoot:           Pointer to TISA initiator driver/port instance.
490  *  \param   tiIORequest:      Pointer to TISA I/O request context for this I/O.
491  *  \param   tiDeviceHandle:   Pointer to TISA device handle for this I/O.
492  *  \param   tiScsiRequest:    Pointer to TISA SCSI I/O request and SGL list.
493  *  \param   satIOContext_t:   Pointer to the SAT IO Context
494  *
495  *  \return If command is started successfully
496  *    - \e tiSuccess:     I/O request successfully initiated.
497  *    - \e tiBusy:        No resources available, try again later.
498  *    - \e tiIONoDevice:  Invalid device handle.
499  *    - \e tiError:       Other errors.
500  */
501 /*****************************************************************************/
502 GLOBAL bit32  satWrite10(
503                    tiRoot_t                  *tiRoot,
504                    tiIORequest_t             *tiIORequest,
505                    tiDeviceHandle_t          *tiDeviceHandle,
506                    tiScsiInitiatorRequest_t *tiScsiRequest,
507                    satIOContext_t            *satIOContext);
508 GLOBAL bit32  satWrite_1(
509                    tiRoot_t                  *tiRoot,
510                    tiIORequest_t             *tiIORequest,
511                    tiDeviceHandle_t          *tiDeviceHandle,
512                    tiScsiInitiatorRequest_t *tiScsiRequest,
513                    satIOContext_t            *satIOContext);
514 
515 
516 /*****************************************************************************/
517 /*! \brief SAT implementation for SCSI WRITE6.
518  *
519  *  SAT implementation for SCSI WRITE6 and send FIS request to LL layer.
520  *
521  *  \param   tiRoot:           Pointer to TISA initiator driver/port instance.
522  *  \param   tiIORequest:      Pointer to TISA I/O request context for this I/O.
523  *  \param   tiDeviceHandle:   Pointer to TISA device handle for this I/O.
524  *  \param   tiScsiRequest:    Pointer to TISA SCSI I/O request and SGL list.
525  *  \param   satIOContext_t:   Pointer to the SAT IO Context
526  *
527  *  \return If command is started successfully
528  *    - \e tiSuccess:     I/O request successfully initiated.
529  *    - \e tiBusy:        No resources available, try again later.
530  *    - \e tiIONoDevice:  Invalid device handle.
531  *    - \e tiError:       Other errors.
532  */
533 /*****************************************************************************/
534 GLOBAL bit32  satWrite6(
535                    tiRoot_t                  *tiRoot,
536                    tiIORequest_t             *tiIORequest,
537                    tiDeviceHandle_t          *tiDeviceHandle,
538                    tiScsiInitiatorRequest_t *tiScsiRequest,
539                    satIOContext_t            *satIOContext);
540 
541 
542 /*****************************************************************************/
543 /*! \brief SAT implementation for SCSI satReportLun.
544  *
545  *  SAT implementation for SCSI satReportLun. Only LUN0 is reported.
546  *
547  *  \param   tiRoot:           Pointer to TISA initiator driver/port instance.
548  *  \param   tiIORequest:      Pointer to TISA I/O request context for this I/O.
549  *  \param   tiDeviceHandle:   Pointer to TISA device handle for this I/O.
550  *  \param   tiScsiRequest:    Pointer to TISA SCSI I/O request and SGL list.
551  *  \param   satIOContext_t:   Pointer to the SAT IO Context
552  *
553  *  \return If command is started successfully
554  *    - \e tiSuccess:     I/O request successfully initiated.
555  *    - \e tiBusy:        No resources available, try again later.
556  *    - \e tiIONoDevice:  Invalid device handle.
557  *    - \e tiError:       Other errors.
558  */
559 /*****************************************************************************/
560 GLOBAL bit32  satReportLun(
561                    tiRoot_t                  *tiRoot,
562                    tiIORequest_t             *tiIORequest,
563                    tiDeviceHandle_t          *tiDeviceHandle,
564                    tiScsiInitiatorRequest_t *tiScsiRequest,
565                    satIOContext_t            *satIOContext);
566 
567 
568 /*****************************************************************************/
569 /*! \brief SAT implementation for SCSI satReadCapacity10.
570  *
571  *  SAT implementation for SCSI satReadCapacity10.
572  *
573  *  \param   tiRoot:           Pointer to TISA initiator driver/port instance.
574  *  \param   tiIORequest:      Pointer to TISA I/O request context for this I/O.
575  *  \param   tiDeviceHandle:   Pointer to TISA device handle for this I/O.
576  *  \param   tiScsiRequest:    Pointer to TISA SCSI I/O request and SGL list.
577  *  \param   satIOContext_t:   Pointer to the SAT IO Context
578  *
579  *  \return If command is started successfully
580  *    - \e tiSuccess:     I/O request successfully initiated.
581  *    - \e tiBusy:        No resources available, try again later.
582  *    - \e tiIONoDevice:  Invalid device handle.
583  *    - \e tiError:       Other errors.
584  */
585 /*****************************************************************************/
586 GLOBAL bit32  satReadCapacity10(
587                    tiRoot_t                  *tiRoot,
588                    tiIORequest_t             *tiIORequest,
589                    tiDeviceHandle_t          *tiDeviceHandle,
590                    tiScsiInitiatorRequest_t *tiScsiRequest,
591                    satIOContext_t            *satIOContext);
592 
593 /*****************************************************************************/
594 /*! \brief SAT implementation for SCSI satReadCapacity16.
595  *
596  *  SAT implementation for SCSI satReadCapacity16.
597  *
598  *  \param   tiRoot:           Pointer to TISA initiator driver/port instance.
599  *  \param   tiIORequest:      Pointer to TISA I/O request context for this I/O.
600  *  \param   tiDeviceHandle:   Pointer to TISA device handle for this I/O.
601  *  \param   tiScsiRequest:    Pointer to TISA SCSI I/O request and SGL list.
602  *  \param   satIOContext_t:   Pointer to the SAT IO Context
603  *
604  *  \return If command is started successfully
605  *    - \e tiSuccess:     I/O request successfully initiated.
606  *    - \e tiBusy:        No resources available, try again later.
607  *    - \e tiIONoDevice:  Invalid device handle.
608  *    - \e tiError:       Other errors.
609  */
610 /*****************************************************************************/
611 GLOBAL bit32  satReadCapacity16(
612                    tiRoot_t                  *tiRoot,
613                    tiIORequest_t             *tiIORequest,
614                    tiDeviceHandle_t          *tiDeviceHandle,
615                    tiScsiInitiatorRequest_t *tiScsiRequest,
616                    satIOContext_t            *satIOContext);
617 
618 
619 GLOBAL bit32  satInquiry(
620                    tiRoot_t                  *tiRoot,
621                    tiIORequest_t             *tiIORequest,
622                    tiDeviceHandle_t          *tiDeviceHandle,
623                    tiScsiInitiatorRequest_t *tiScsiRequest,
624                    satIOContext_t            *satIOContext);
625 
626 /*****************************************************************************/
627 /*! \brief SAT implementation for SCSI REQUEST SENSE.
628  *
629  *  SAT implementation for SCSI REQUEST SENSE.
630  *
631  *  \param   tiRoot:           Pointer to TISA initiator driver/port instance.
632  *  \param   tiIORequest:      Pointer to TISA I/O request context for this I/O.
633  *  \param   tiDeviceHandle:   Pointer to TISA device handle for this I/O.
634  *  \param   tiScsiRequest:    Pointer to TISA SCSI I/O request and SGL list.
635  *  \param   satIOContext_t:   Pointer to the SAT IO Context
636  *
637  *  \return If command is started successfully
638  *    - \e tiSuccess:     I/O request successfully initiated.
639  *    - \e tiBusy:        No resources available, try again later.
640  *    - \e tiIONoDevice:  Invalid device handle.
641  *    - \e tiError:       Other errors.
642  */
643 /*****************************************************************************/
644 GLOBAL bit32  satRequestSense(
645                    tiRoot_t                  *tiRoot,
646                    tiIORequest_t             *tiIORequest,
647                    tiDeviceHandle_t          *tiDeviceHandle,
648                    tiScsiInitiatorRequest_t *tiScsiRequest,
649                    satIOContext_t            *satIOContext);
650 /*****************************************************************************/
651 /*! \brief SAT implementation for SCSI REQUEST SENSE.
652  *
653  *  SAT implementation for SCSI REQUEST SENSE.
654  *  Sub function of satRequestSense
655  *
656  *  \param   tiRoot:           Pointer to TISA initiator driver/port instance.
657  *  \param   tiIORequest:      Pointer to TISA I/O request context for this I/O.
658  *  \param   tiDeviceHandle:   Pointer to TISA device handle for this I/O.
659  *  \param   tiScsiRequest:    Pointer to TISA SCSI I/O request and SGL list.
660  *  \param   satIOContext_t:   Pointer to the SAT IO Context
661  *
662  *  \return If command is started successfully
663  *    - \e tiSuccess:     I/O request successfully initiated.
664  *    - \e tiBusy:        No resources available, try again later.
665  *    - \e tiIONoDevice:  Invalid device handle.
666  *    - \e tiError:       Other errors.
667  */
668 /*****************************************************************************/
669 GLOBAL bit32  satRequestSense_1(
670                    tiRoot_t                  *tiRoot,
671                    tiIORequest_t             *tiIORequest,
672                    tiDeviceHandle_t          *tiDeviceHandle,
673                    tiScsiInitiatorRequest_t *tiScsiRequest,
674                    satIOContext_t            *satIOContext);
675 
676 /*****************************************************************************/
677 /*! \brief SAT implementation for SCSI satFormatUnit.
678  *
679  *  SAT implementation for SCSI satFormatUnit.
680  *
681  *  \param   tiRoot:           Pointer to TISA initiator driver/port instance.
682  *  \param   tiIORequest:      Pointer to TISA I/O request context for this I/O.
683  *  \param   tiDeviceHandle:   Pointer to TISA device handle for this I/O.
684  *  \param   tiScsiRequest:    Pointer to TISA SCSI I/O request and SGL list.
685  *  \param   satIOContext_t:   Pointer to the SAT IO Context
686  *
687  *  \return If command is started successfully
688  *    - \e tiSuccess:     I/O request successfully initiated.
689  *    - \e tiBusy:        No resources available, try again later.
690  *    - \e tiIONoDevice:  Invalid device handle.
691  *    - \e tiError:       Other errors.
692  */
693 /*****************************************************************************/
694 GLOBAL bit32  satFormatUnit(
695                    tiRoot_t                  *tiRoot,
696                    tiIORequest_t             *tiIORequest,
697                    tiDeviceHandle_t          *tiDeviceHandle,
698                    tiScsiInitiatorRequest_t *tiScsiRequest,
699                    satIOContext_t            *satIOContext);
700 
701 /*****************************************************************************/
702 /*! \brief SAT implementation for SCSI satSendDiagnostic.
703  *
704  *  SAT implementation for SCSI satSendDiagnostic.
705  *
706  *  \param   tiRoot:           Pointer to TISA initiator driver/port instance.
707  *  \param   tiIORequest:      Pointer to TISA I/O request context for this I/O.
708  *  \param   tiDeviceHandle:   Pointer to TISA device handle for this I/O.
709  *  \param   tiScsiRequest:    Pointer to TISA SCSI I/O request and SGL list.
710  *  \param   satIOContext_t:   Pointer to the SAT IO Context
711  *
712  *  \return If command is started successfully
713  *    - \e tiSuccess:     I/O request successfully initiated.
714  *    - \e tiBusy:        No resources available, try again later.
715  *    - \e tiIONoDevice:  Invalid device handle.
716  *    - \e tiError:       Other errors.
717  */
718 /*****************************************************************************/
719 GLOBAL bit32  satSendDiagnostic(
720                    tiRoot_t                  *tiRoot,
721                    tiIORequest_t             *tiIORequest,
722                    tiDeviceHandle_t          *tiDeviceHandle,
723                    tiScsiInitiatorRequest_t *tiScsiRequest,
724                    satIOContext_t            *satIOContext);
725 
726 /*****************************************************************************/
727 /*! \brief SAT implementation for SCSI satSendDiagnostic_1.
728  *
729  *  SAT implementation for SCSI satSendDiagnostic_1.
730  *  Sub function of satSendDiagnostic.
731  *
732  *  \param   tiRoot:           Pointer to TISA initiator driver/port instance.
733  *  \param   tiIORequest:      Pointer to TISA I/O request context for this I/O.
734  *  \param   tiDeviceHandle:   Pointer to TISA device handle for this I/O.
735  *  \param   tiScsiRequest:    Pointer to TISA SCSI I/O request and SGL list.
736  *  \param   satIOContext_t:   Pointer to the SAT IO Context
737  *
738  *  \return If command is started successfully
739  *    - \e tiSuccess:     I/O request successfully initiated.
740  *    - \e tiBusy:        No resources available, try again later.
741  *    - \e tiIONoDevice:  Invalid device handle.
742  *    - \e tiError:       Other errors.
743  */
744 /*****************************************************************************/
745 GLOBAL bit32  satSendDiagnostic_1(
746                    tiRoot_t                  *tiRoot,
747                    tiIORequest_t             *tiIORequest,
748                    tiDeviceHandle_t          *tiDeviceHandle,
749                    tiScsiInitiatorRequest_t *tiScsiRequest,
750                    satIOContext_t            *satIOContext);
751 /*****************************************************************************/
752 /*! \brief SAT implementation for SCSI satSendDiagnostic_2.
753  *
754  *  SAT implementation for SCSI satSendDiagnostic_2.
755  *  Sub function of satSendDiagnostic.
756  *
757  *  \param   tiRoot:           Pointer to TISA initiator driver/port instance.
758  *  \param   tiIORequest:      Pointer to TISA I/O request context for this I/O.
759  *  \param   tiDeviceHandle:   Pointer to TISA device handle for this I/O.
760  *  \param   tiScsiRequest:    Pointer to TISA SCSI I/O request and SGL list.
761  *  \param   satIOContext_t:   Pointer to the SAT IO Context
762  *
763  *  \return If command is started successfully
764  *    - \e tiSuccess:     I/O request successfully initiated.
765  *    - \e tiBusy:        No resources available, try again later.
766  *    - \e tiIONoDevice:  Invalid device handle.
767  *    - \e tiError:       Other errors.
768  */
769 /*****************************************************************************/
770 GLOBAL bit32  satSendDiagnostic_2(
771                    tiRoot_t                  *tiRoot,
772                    tiIORequest_t             *tiIORequest,
773                    tiDeviceHandle_t          *tiDeviceHandle,
774                    tiScsiInitiatorRequest_t *tiScsiRequest,
775                    satIOContext_t            *satIOContext);
776 
777 /*****************************************************************************/
778 /*! \brief SAT implementation for SCSI satStartStopUnit.
779  *
780  *  SAT implementation for SCSI satStartStopUnit.
781  *
782  *  \param   tiRoot:           Pointer to TISA initiator driver/port instance.
783  *  \param   tiIORequest:      Pointer to TISA I/O request context for this I/O.
784  *  \param   tiDeviceHandle:   Pointer to TISA device handle for this I/O.
785  *  \param   tiScsiRequest:    Pointer to TISA SCSI I/O request and SGL list.
786  *  \param   satIOContext_t:   Pointer to the SAT IO Context
787  *
788  *  \return If command is started successfully
789  *    - \e tiSuccess:     I/O request successfully initiated.
790  *    - \e tiBusy:        No resources available, try again later.
791  *    - \e tiIONoDevice:  Invalid device handle.
792  *    - \e tiError:       Other errors.
793  */
794 /*****************************************************************************/
795 GLOBAL bit32  satStartStopUnit(
796                    tiRoot_t                  *tiRoot,
797                    tiIORequest_t             *tiIORequest,
798                    tiDeviceHandle_t          *tiDeviceHandle,
799                    tiScsiInitiatorRequest_t *tiScsiRequest,
800                    satIOContext_t            *satIOContext);
801 /*****************************************************************************/
802 /*! \brief SAT implementation for SCSI satStartStopUnit_1.
803  *
804  *  SAT implementation for SCSI satStartStopUnit_1.
805  *  Sub function of satStartStopUnit
806  *
807  *  \param   tiRoot:           Pointer to TISA initiator driver/port instance.
808  *  \param   tiIORequest:      Pointer to TISA I/O request context for this I/O.
809  *  \param   tiDeviceHandle:   Pointer to TISA device handle for this I/O.
810  *  \param   tiScsiRequest:    Pointer to TISA SCSI I/O request and SGL list.
811  *  \param   satIOContext_t:   Pointer to the SAT IO Context
812  *
813  *  \return If command is started successfully
814  *    - \e tiSuccess:     I/O request successfully initiated.
815  *    - \e tiBusy:        No resources available, try again later.
816  *    - \e tiIONoDevice:  Invalid device handle.
817  *    - \e tiError:       Other errors.
818  */
819 /*****************************************************************************/
820 GLOBAL bit32  satStartStopUnit_1(
821                    tiRoot_t                  *tiRoot,
822                    tiIORequest_t             *tiIORequest,
823                    tiDeviceHandle_t          *tiDeviceHandle,
824                    tiScsiInitiatorRequest_t *tiScsiRequest,
825                    satIOContext_t            *satIOContext);
826 
827 /*****************************************************************************/
828 /*! \brief SAT implementation for SCSI satRead10_1.
829  *
830  *  SAT implementation for SCSI satRead10_1
831  *  Sub function of satRead10
832  *
833  *  \param   tiRoot:           Pointer to TISA initiator driver/port instance.
834  *  \param   tiIORequest:      Pointer to TISA I/O request context for this I/O.
835  *  \param   tiDeviceHandle:   Pointer to TISA device handle for this I/O.
836  *  \param   tiScsiRequest:    Pointer to TISA SCSI I/O request and SGL list.
837  *  \param   satIOContext_t:   Pointer to the SAT IO Context
838  *
839  *  \return If command is started successfully
840  *    - \e tiSuccess:     I/O request successfully initiated.
841  *    - \e tiBusy:        No resources available, try again later.
842  *    - \e tiIONoDevice:  Invalid device handle.
843  *    - \e tiError:       Other errors.
844  */
845 /*****************************************************************************/
846 GLOBAL bit32  satRead_1(
847                          tiRoot_t                  *tiRoot,
848                          tiIORequest_t             *tiIORequest,
849                          tiDeviceHandle_t          *tiDeviceHandle,
850                          tiScsiInitiatorRequest_t *tiScsiRequest,
851                          satIOContext_t            *satIOContext);
852 GLOBAL bit32  satRead10_2(
853                          tiRoot_t                  *tiRoot,
854                          tiIORequest_t             *tiIORequest,
855                          tiDeviceHandle_t          *tiDeviceHandle,
856                          tiScsiInitiatorRequest_t *tiScsiRequest,
857                          satIOContext_t            *satIOContext);
858 
859 /*****************************************************************************/
860 /*! \brief SAT implementation for SCSI satWriteSame10.
861  *
862  *  SAT implementation for SCSI satWriteSame10.
863  *
864  *  \param   tiRoot:           Pointer to TISA initiator driver/port instance.
865  *  \param   tiIORequest:      Pointer to TISA I/O request context for this I/O.
866  *  \param   tiDeviceHandle:   Pointer to TISA device handle for this I/O.
867  *  \param   tiScsiRequest:    Pointer to TISA SCSI I/O request and SGL list.
868  *  \param   satIOContext_t:   Pointer to the SAT IO Context
869  *
870  *  \return If command is started successfully
871  *    - \e tiSuccess:     I/O request successfully initiated.
872  *    - \e tiBusy:        No resources available, try again later.
873  *    - \e tiIONoDevice:  Invalid device handle.
874  *    - \e tiError:       Other errors.
875  */
876 /*****************************************************************************/
877 GLOBAL bit32  satWriteSame10(
878                    tiRoot_t                  *tiRoot,
879                    tiIORequest_t             *tiIORequest,
880                    tiDeviceHandle_t          *tiDeviceHandle,
881                    tiScsiInitiatorRequest_t *tiScsiRequest,
882                    satIOContext_t            *satIOContext);
883 
884 GLOBAL bit32  satWriteSame10_1(
885                    tiRoot_t                  *tiRoot,
886                    tiIORequest_t             *tiIORequest,
887                    tiDeviceHandle_t          *tiDeviceHandle,
888                    tiScsiInitiatorRequest_t *tiScsiRequest,
889                    satIOContext_t            *satIOContext,
890                    bit32                     lba
891                    );
892 GLOBAL bit32  satWriteSame10_2(
893                    tiRoot_t                  *tiRoot,
894                    tiIORequest_t             *tiIORequest,
895                    tiDeviceHandle_t          *tiDeviceHandle,
896                    tiScsiInitiatorRequest_t *tiScsiRequest,
897                    satIOContext_t            *satIOContext,
898                    bit32                     lba
899                    );
900 GLOBAL bit32  satWriteSame10_3(
901                    tiRoot_t                  *tiRoot,
902                    tiIORequest_t             *tiIORequest,
903                    tiDeviceHandle_t          *tiDeviceHandle,
904                    tiScsiInitiatorRequest_t *tiScsiRequest,
905                    satIOContext_t            *satIOContext,
906                    bit32                     lba
907                    );
908 /*****************************************************************************/
909 /*! \brief SAT implementation for SCSI satWriteSame16.
910  *
911  *  SAT implementation for SCSI satWriteSame16.
912  *
913  *  \param   tiRoot:           Pointer to TISA initiator driver/port instance.
914  *  \param   tiIORequest:      Pointer to TISA I/O request context for this I/O.
915  *  \param   tiDeviceHandle:   Pointer to TISA device handle for this I/O.
916  *  \param   tiScsiRequest:    Pointer to TISA SCSI I/O request and SGL list.
917  *  \param   satIOContext_t:   Pointer to the SAT IO Context
918  *
919  *  \return If command is started successfully
920  *    - \e tiSuccess:     I/O request successfully initiated.
921  *    - \e tiBusy:        No resources available, try again later.
922  *    - \e tiIONoDevice:  Invalid device handle.
923  *    - \e tiError:       Other errors.
924  */
925 /*****************************************************************************/
926 GLOBAL bit32  satWriteSame16(
927                    tiRoot_t                  *tiRoot,
928                    tiIORequest_t             *tiIORequest,
929                    tiDeviceHandle_t          *tiDeviceHandle,
930                    tiScsiInitiatorRequest_t *tiScsiRequest,
931                    satIOContext_t            *satIOContext);
932 
933 /*****************************************************************************/
934 /*! \brief SAT implementation for SCSI satLogSenseAllocate.
935  *
936  *  Part of SAT implementation for SCSI satLogSense.
937  *
938  *  \param   tiRoot:           Pointer to TISA initiator driver/port instance.
939  *  \param   tiIORequest:      Pointer to TISA I/O request context for this I/O.
940  *  \param   tiDeviceHandle:   Pointer to TISA device handle for this I/O.
941  *  \param   tiScsiRequest:    Pointer to TISA SCSI I/O request and SGL list.
942  *  \param   satIOContext_t:   Pointer to the SAT IO Context
943  *  \param   payloadSize:      size of payload to be allocated.
944  *  \param   flag:             flag value
945  *
946  *  \return If command is started successfully
947  *    - \e tiSuccess:     I/O request successfully initiated.
948  *    - \e tiBusy:        No resources available, try again later.
949  *    - \e tiIONoDevice:  Invalid device handle.
950  *    - \e tiError:       Other errors.
951  *  \note
952  *    - flag values: LOG_SENSE_0, LOG_SENSE_1, LOG_SENSE_2
953  */
954 /*****************************************************************************/
955 GLOBAL bit32  satLogSenseAllocate(
956                    tiRoot_t                  *tiRoot,
957                    tiIORequest_t             *tiIORequest,
958                    tiDeviceHandle_t          *tiDeviceHandle,
959                    tiScsiInitiatorRequest_t *tiScsiRequest,
960                    satIOContext_t            *satIOContext,
961                    bit32                      payloadSize,
962                    bit32                      flag
963                    );
964 
965 /*****************************************************************************/
966 /*! \brief SAT implementation for SCSI satSMARTEnable.
967  *
968  *  Part of SAT implementation for SCSI satLogSense.
969  *
970  *  \param   tiRoot:           Pointer to TISA initiator driver/port instance.
971  *  \param   tiIORequest:      Pointer to TISA I/O request context for this I/O.
972  *  \param   tiDeviceHandle:   Pointer to TISA device handle for this I/O.
973  *  \param   tiScsiRequest:    Pointer to TISA SCSI I/O request and SGL list.
974  *  \param   satIOContext_t:   Pointer to the SAT IO Context
975  *
976  *  \return If command is started successfully
977  *    - \e tiSuccess:     I/O request successfully initiated.
978  *    - \e tiBusy:        No resources available, try again later.
979  *    - \e tiIONoDevice:  Invalid device handle.
980  *    - \e tiError:       Other errors.
981  */
982 /*****************************************************************************/
983 GLOBAL bit32  satSMARTEnable(
984                    tiRoot_t                  *tiRoot,
985                    tiIORequest_t             *tiIORequest,
986                    tiDeviceHandle_t          *tiDeviceHandle,
987                    tiScsiInitiatorRequest_t *tiScsiRequest,
988                    satIOContext_t            *satIOContext);
989 
990 /*****************************************************************************/
991 /*! \brief SAT implementation for SCSI satLogSense_1.
992  *
993  *  Part of SAT implementation for SCSI satLogSense.
994  *
995  *  \param   tiRoot:           Pointer to TISA initiator driver/port instance.
996  *  \param   tiIORequest:      Pointer to TISA I/O request context for this I/O.
997  *  \param   tiDeviceHandle:   Pointer to TISA device handle for this I/O.
998  *  \param   tiScsiRequest:    Pointer to TISA SCSI I/O request and SGL list.
999  *  \param   satIOContext_t:   Pointer to the SAT IO Context
1000  *
1001  *  \return If command is started successfully
1002  *    - \e tiSuccess:     I/O request successfully initiated.
1003  *    - \e tiBusy:        No resources available, try again later.
1004  *    - \e tiIONoDevice:  Invalid device handle.
1005  *    - \e tiError:       Other errors.
1006  */
1007 /*****************************************************************************/
1008 GLOBAL bit32  satLogSense_1(
1009                    tiRoot_t                  *tiRoot,
1010                    tiIORequest_t             *tiIORequest,
1011                    tiDeviceHandle_t          *tiDeviceHandle,
1012                    tiScsiInitiatorRequest_t *tiScsiRequest,
1013                    satIOContext_t            *satIOContext);
1014 
1015 /*****************************************************************************/
1016 /*! \brief SAT implementation for SCSI satLogSense_2.
1017  *
1018  *  Part of SAT implementation for SCSI satLogSense.
1019  *
1020  *  \param   tiRoot:           Pointer to TISA initiator driver/port instance.
1021  *  \param   tiIORequest:      Pointer to TISA I/O request context for this I/O.
1022  *  \param   tiDeviceHandle:   Pointer to TISA device handle for this I/O.
1023  *  \param   tiScsiRequest:    Pointer to TISA SCSI I/O request and SGL list.
1024  *  \param   satIOContext_t:   Pointer to the SAT IO Context
1025  *
1026  *  \return If command is started successfully
1027  *    - \e tiSuccess:     I/O request successfully initiated.
1028  *    - \e tiBusy:        No resources available, try again later.
1029  *    - \e tiIONoDevice:  Invalid device handle.
1030  *    - \e tiError:       Other errors.
1031  */
1032 /*****************************************************************************/
1033 GLOBAL bit32  satLogSense_2(
1034                    tiRoot_t                  *tiRoot,
1035                    tiIORequest_t             *tiIORequest,
1036                    tiDeviceHandle_t          *tiDeviceHandle,
1037                    tiScsiInitiatorRequest_t *tiScsiRequest,
1038                    satIOContext_t            *satIOContext);
1039 
1040 /*****************************************************************************/
1041 /*! \brief SAT implementation for SCSI satLogSense_3.
1042  *
1043  *  Part of SAT implementation for SCSI satLogSense.
1044  *
1045  *  \param   tiRoot:           Pointer to TISA initiator driver/port instance.
1046  *  \param   tiIORequest:      Pointer to TISA I/O request context for this I/O.
1047  *  \param   tiDeviceHandle:   Pointer to TISA device handle for this I/O.
1048  *  \param   tiScsiRequest:    Pointer to TISA SCSI I/O request and SGL list.
1049  *  \param   satIOContext_t:   Pointer to the SAT IO Context
1050  *
1051  *  \return If command is started successfully
1052  *    - \e tiSuccess:     I/O request successfully initiated.
1053  *    - \e tiBusy:        No resources available, try again later.
1054  *    - \e tiIONoDevice:  Invalid device handle.
1055  *    - \e tiError:       Other errors.
1056  */
1057 /*****************************************************************************/
1058 GLOBAL bit32  satLogSense_3(
1059                    tiRoot_t                  *tiRoot,
1060                    tiIORequest_t             *tiIORequest,
1061                    tiDeviceHandle_t          *tiDeviceHandle,
1062                    tiScsiInitiatorRequest_t *tiScsiRequest,
1063                    satIOContext_t            *satIOContext);
1064 
1065 
1066 /*****************************************************************************/
1067 /*! \brief SAT implementation for SCSI satLogSense.
1068  *
1069  *  SAT implementation for SCSI satLogSense.
1070  *
1071  *  \param   tiRoot:           Pointer to TISA initiator driver/port instance.
1072  *  \param   tiIORequest:      Pointer to TISA I/O request context for this I/O.
1073  *  \param   tiDeviceHandle:   Pointer to TISA device handle for this I/O.
1074  *  \param   tiScsiRequest:    Pointer to TISA SCSI I/O request and SGL list.
1075  *  \param   satIOContext_t:   Pointer to the SAT IO Context
1076  *
1077  *  \return If command is started successfully
1078  *    - \e tiSuccess:     I/O request successfully initiated.
1079  *    - \e tiBusy:        No resources available, try again later.
1080  *    - \e tiIONoDevice:  Invalid device handle.
1081  *    - \e tiError:       Other errors.
1082  */
1083 /*****************************************************************************/
1084 GLOBAL bit32  satLogSense(
1085                    tiRoot_t                  *tiRoot,
1086                    tiIORequest_t             *tiIORequest,
1087                    tiDeviceHandle_t          *tiDeviceHandle,
1088                    tiScsiInitiatorRequest_t *tiScsiRequest,
1089                    satIOContext_t            *satIOContext);
1090 
1091 /*****************************************************************************/
1092 /*! \brief SAT implementation for SCSI satModeSelect6.
1093  *
1094  *  SAT implementation for SCSI satModeSelect6.
1095  *
1096  *  \param   tiRoot:           Pointer to TISA initiator driver/port instance.
1097  *  \param   tiIORequest:      Pointer to TISA I/O request context for this I/O.
1098  *  \param   tiDeviceHandle:   Pointer to TISA device handle for this I/O.
1099  *  \param   tiScsiRequest:    Pointer to TISA SCSI I/O request and SGL list.
1100  *  \param   satIOContext_t:   Pointer to the SAT IO Context
1101  *
1102  *  \return If command is started successfully
1103  *    - \e tiSuccess:     I/O request successfully initiated.
1104  *    - \e tiBusy:        No resources available, try again later.
1105  *    - \e tiIONoDevice:  Invalid device handle.
1106  *    - \e tiError:       Other errors.
1107  */
1108 /*****************************************************************************/
1109 GLOBAL bit32  satModeSelect6(
1110                    tiRoot_t                  *tiRoot,
1111                    tiIORequest_t             *tiIORequest,
1112                    tiDeviceHandle_t          *tiDeviceHandle,
1113                    tiScsiInitiatorRequest_t *tiScsiRequest,
1114                    satIOContext_t            *satIOContext);
1115 GLOBAL bit32  satModeSelect6n10_1(
1116                    tiRoot_t                  *tiRoot,
1117                    tiIORequest_t             *tiIORequest,
1118                    tiDeviceHandle_t          *tiDeviceHandle,
1119                    tiScsiInitiatorRequest_t *tiScsiRequest,
1120                    satIOContext_t            *satIOContext);
1121 
1122 /*****************************************************************************/
1123 /*! \brief SAT implementation for SCSI satModeSelect10.
1124  *
1125  *  SAT implementation for SCSI satModeSelect10.
1126  *
1127  *  \param   tiRoot:           Pointer to TISA initiator driver/port instance.
1128  *  \param   tiIORequest:      Pointer to TISA I/O request context for this I/O.
1129  *  \param   tiDeviceHandle:   Pointer to TISA device handle for this I/O.
1130  *  \param   tiScsiRequest:    Pointer to TISA SCSI I/O request and SGL list.
1131  *  \param   satIOContext_t:   Pointer to the SAT IO Context
1132  *
1133  *  \return If command is started successfully
1134  *    - \e tiSuccess:     I/O request successfully initiated.
1135  *    - \e tiBusy:        No resources available, try again later.
1136  *    - \e tiIONoDevice:  Invalid device handle.
1137  *    - \e tiError:       Other errors.
1138  */
1139 /*****************************************************************************/
1140 GLOBAL bit32  satModeSelect10(
1141                    tiRoot_t                  *tiRoot,
1142                    tiIORequest_t             *tiIORequest,
1143                    tiDeviceHandle_t          *tiDeviceHandle,
1144                    tiScsiInitiatorRequest_t *tiScsiRequest,
1145                    satIOContext_t            *satIOContext);
1146 
1147 /*****************************************************************************/
1148 /*! \brief SAT implementation for SCSI satSynchronizeCache10.
1149  *
1150  *  SAT implementation for SCSI satSynchronizeCache10.
1151  *
1152  *  \param   tiRoot:           Pointer to TISA initiator driver/port instance.
1153  *  \param   tiIORequest:      Pointer to TISA I/O request context for this I/O.
1154  *  \param   tiDeviceHandle:   Pointer to TISA device handle for this I/O.
1155  *  \param   tiScsiRequest:    Pointer to TISA SCSI I/O request and SGL list.
1156  *  \param   satIOContext_t:   Pointer to the SAT IO Context
1157  *
1158  *  \return If command is started successfully
1159  *    - \e tiSuccess:     I/O request successfully initiated.
1160  *    - \e tiBusy:        No resources available, try again later.
1161  *    - \e tiIONoDevice:  Invalid device handle.
1162  *    - \e tiError:       Other errors.
1163  */
1164 /*****************************************************************************/
1165 GLOBAL bit32  satSynchronizeCache10(
1166                    tiRoot_t                  *tiRoot,
1167                    tiIORequest_t             *tiIORequest,
1168                    tiDeviceHandle_t          *tiDeviceHandle,
1169                    tiScsiInitiatorRequest_t *tiScsiRequest,
1170                    satIOContext_t            *satIOContext);
1171 
1172 /*****************************************************************************/
1173 /*! \brief SAT implementation for SCSI satSynchronizeCache16.
1174  *
1175  *  SAT implementation for SCSI satSynchronizeCache16.
1176  *
1177  *  \param   tiRoot:           Pointer to TISA initiator driver/port instance.
1178  *  \param   tiIORequest:      Pointer to TISA I/O request context for this I/O.
1179  *  \param   tiDeviceHandle:   Pointer to TISA device handle for this I/O.
1180  *  \param   tiScsiRequest:    Pointer to TISA SCSI I/O request and SGL list.
1181  *  \param   satIOContext_t:   Pointer to the SAT IO Context
1182  *
1183  *  \return If command is started successfully
1184  *    - \e tiSuccess:     I/O request successfully initiated.
1185  *    - \e tiBusy:        No resources available, try again later.
1186  *    - \e tiIONoDevice:  Invalid device handle.
1187  *    - \e tiError:       Other errors.
1188  */
1189 /*****************************************************************************/
1190 GLOBAL bit32  satSynchronizeCache16(
1191                    tiRoot_t                  *tiRoot,
1192                    tiIORequest_t             *tiIORequest,
1193                    tiDeviceHandle_t          *tiDeviceHandle,
1194                    tiScsiInitiatorRequest_t *tiScsiRequest,
1195                    satIOContext_t            *satIOContext);
1196 
1197 /*****************************************************************************/
1198 /*! \brief SAT implementation for SCSI satWriteAndVerify10.
1199  *
1200  *  SAT implementation for SCSI satWriteAndVerify10.
1201  *
1202  *  \param   tiRoot:           Pointer to TISA initiator driver/port instance.
1203  *  \param   tiIORequest:      Pointer to TISA I/O request context for this I/O.
1204  *  \param   tiDeviceHandle:   Pointer to TISA device handle for this I/O.
1205  *  \param   tiScsiRequest:    Pointer to TISA SCSI I/O request and SGL list.
1206  *  \param   satIOContext_t:   Pointer to the SAT IO Context
1207  *
1208  *  \return If command is started successfully
1209  *    - \e tiSuccess:     I/O request successfully initiated.
1210  *    - \e tiBusy:        No resources available, try again later.
1211  *    - \e tiIONoDevice:  Invalid device handle.
1212  *    - \e tiError:       Other errors.
1213  */
1214 /*****************************************************************************/
1215 GLOBAL bit32  satWriteAndVerify10(
1216                    tiRoot_t                  *tiRoot,
1217                    tiIORequest_t             *tiIORequest,
1218                    tiDeviceHandle_t          *tiDeviceHandle,
1219                    tiScsiInitiatorRequest_t *tiScsiRequest,
1220                    satIOContext_t            *satIOContext);
1221 
1222 #ifdef REMOVED
1223 /*****************************************************************************/
1224 /*! \brief SAT implementation for SCSI satWriteAndVerify10_1.
1225  *
1226  *  SAT implementation for SCSI satWriteAndVerify10_1.
1227  *  Sub function of satWriteAndVerify10
1228  *
1229  *  \param   tiRoot:           Pointer to TISA initiator driver/port instance.
1230  *  \param   tiIORequest:      Pointer to TISA I/O request context for this I/O.
1231  *  \param   tiDeviceHandle:   Pointer to TISA device handle for this I/O.
1232  *  \param   tiScsiRequest:    Pointer to TISA SCSI I/O request and SGL list.
1233  *  \param   satIOContext_t:   Pointer to the SAT IO Context
1234  *
1235  *  \return If command is started successfully
1236  *    - \e tiSuccess:     I/O request successfully initiated.
1237  *    - \e tiBusy:        No resources available, try again later.
1238  *    - \e tiIONoDevice:  Invalid device handle.
1239  *    - \e tiError:       Other errors.
1240  */
1241 /*****************************************************************************/
1242 GLOBAL bit32  satWriteAndVerify10_1(
1243                    tiRoot_t                  *tiRoot,
1244                    tiIORequest_t             *tiIORequest,
1245                    tiDeviceHandle_t          *tiDeviceHandle,
1246                    tiScsiInitiatorRequest_t *tiScsiRequest,
1247                    satIOContext_t            *satIOContext);
1248 #endif
1249 
1250 /*****************************************************************************/
1251 /*! \brief SAT implementation for SCSI satWriteAndVerify12.
1252  *
1253  *  SAT implementation for SCSI satWriteAndVerify12.
1254  *
1255  *  \param   tiRoot:           Pointer to TISA initiator driver/port instance.
1256  *  \param   tiIORequest:      Pointer to TISA I/O request context for this I/O.
1257  *  \param   tiDeviceHandle:   Pointer to TISA device handle for this I/O.
1258  *  \param   tiScsiRequest:    Pointer to TISA SCSI I/O request and SGL list.
1259  *  \param   satIOContext_t:   Pointer to the SAT IO Context
1260  *
1261  *  \return If command is started successfully
1262  *    - \e tiSuccess:     I/O request successfully initiated.
1263  *    - \e tiBusy:        No resources available, try again later.
1264  *    - \e tiIONoDevice:  Invalid device handle.
1265  *    - \e tiError:       Other errors.
1266  */
1267 /*****************************************************************************/
1268 GLOBAL bit32  satWriteAndVerify12(
1269                    tiRoot_t                  *tiRoot,
1270                    tiIORequest_t             *tiIORequest,
1271                    tiDeviceHandle_t          *tiDeviceHandle,
1272                    tiScsiInitiatorRequest_t *tiScsiRequest,
1273                    satIOContext_t            *satIOContext);
1274 
1275 GLOBAL bit32  satNonChainedWriteNVerify_Verify(
1276                    tiRoot_t                  *tiRoot,
1277                    tiIORequest_t             *tiIORequest,
1278                    tiDeviceHandle_t          *tiDeviceHandle,
1279                    tiScsiInitiatorRequest_t *tiScsiRequest,
1280                    satIOContext_t            *satIOContext);
1281 
1282 GLOBAL bit32  satChainedWriteNVerify_Write(
1283                    tiRoot_t                  *tiRoot,
1284                    tiIORequest_t             *tiIORequest,
1285                    tiDeviceHandle_t          *tiDeviceHandle,
1286                    tiScsiInitiatorRequest_t *tiScsiRequest,
1287                    satIOContext_t            *satIOContext);
1288 
1289 GLOBAL bit32  satChainedWriteNVerify_Verify(
1290                    tiRoot_t                  *tiRoot,
1291                    tiIORequest_t             *tiIORequest,
1292                    tiDeviceHandle_t          *tiDeviceHandle,
1293                    tiScsiInitiatorRequest_t *tiScsiRequest,
1294                    satIOContext_t            *satIOContext);
1295 
1296 GLOBAL bit32  satChainedWriteNVerify_Start_Verify(
1297                    tiRoot_t                  *tiRoot,
1298                    tiIORequest_t             *tiIORequest,
1299                    tiDeviceHandle_t          *tiDeviceHandle,
1300                    tiScsiInitiatorRequest_t *tiScsiRequest,
1301                    satIOContext_t            *satIOContext);
1302 
1303 
1304 /*****************************************************************************/
1305 /*! \brief SAT implementation for SCSI satWriteAndVerify16.
1306  *
1307  *  SAT implementation for SCSI satWriteAndVerify16.
1308  *
1309  *  \param   tiRoot:           Pointer to TISA initiator driver/port instance.
1310  *  \param   tiIORequest:      Pointer to TISA I/O request context for this I/O.
1311  *  \param   tiDeviceHandle:   Pointer to TISA device handle for this I/O.
1312  *  \param   tiScsiRequest:    Pointer to TISA SCSI I/O request and SGL list.
1313  *  \param   satIOContext_t:   Pointer to the SAT IO Context
1314  *
1315  *  \return If command is started successfully
1316  *    - \e tiSuccess:     I/O request successfully initiated.
1317  *    - \e tiBusy:        No resources available, try again later.
1318  *    - \e tiIONoDevice:  Invalid device handle.
1319  *    - \e tiError:       Other errors.
1320  */
1321 /*****************************************************************************/
1322 GLOBAL bit32  satWriteAndVerify16(
1323                    tiRoot_t                  *tiRoot,
1324                    tiIORequest_t             *tiIORequest,
1325                    tiDeviceHandle_t          *tiDeviceHandle,
1326                    tiScsiInitiatorRequest_t *tiScsiRequest,
1327                    satIOContext_t            *satIOContext);
1328 
1329 GLOBAL bit32  satChainedVerify16(
1330                    tiRoot_t                  *tiRoot,
1331                    tiIORequest_t             *tiIORequest,
1332                    tiDeviceHandle_t          *tiDeviceHandle,
1333                    tiScsiInitiatorRequest_t *tiScsiRequest,
1334                    satIOContext_t            *satIOContext);
1335 
1336 /*****************************************************************************/
1337 /*! \brief SAT implementation for SCSI TEST UNIT READY.
1338  *
1339  *  SAT implementation for SCSI TUR and send FIS request to LL layer.
1340  *
1341  *  \param   tiRoot:           Pointer to TISA initiator driver/port instance.
1342  *  \param   tiIORequest:      Pointer to TISA I/O request context for this I/O.
1343  *  \param   tiDeviceHandle:   Pointer to TISA device handle for this I/O.
1344  *  \param   tiScsiRequest:    Pointer to TISA SCSI I/O request and SGL list.
1345  *  \param   satIOContext_t:   Pointer to the SAT IO Context
1346  *
1347  *  \return If command is started successfully
1348  *    - \e tiSuccess:     I/O request successfully initiated.
1349  *    - \e tiBusy:        No resources available, try again later.
1350  *    - \e tiIONoDevice:  Invalid device handle.
1351  *    - \e tiError:       Other errors.
1352  */
1353 /*****************************************************************************/
1354 GLOBAL bit32  satTestUnitReady(
1355                    tiRoot_t                  *tiRoot,
1356                    tiIORequest_t             *tiIORequest,
1357                    tiDeviceHandle_t          *tiDeviceHandle,
1358                    tiScsiInitiatorRequest_t *tiScsiRequest,
1359                    satIOContext_t            *satIOContext);
1360 
1361 /*****************************************************************************/
1362 /*! \brief SAT implementation for SCSI MODE SENSE (6).
1363  *
1364  *  SAT implementation for SCSI MODE SENSE (6).
1365  *
1366  *  \param   tiRoot:           Pointer to TISA initiator driver/port instance.
1367  *  \param   tiIORequest:      Pointer to TISA I/O request context for this I/O.
1368  *  \param   tiDeviceHandle:   Pointer to TISA device handle for this I/O.
1369  *  \param   tiScsiRequest:    Pointer to TISA SCSI I/O request and SGL list.
1370  *  \param   satIOContext_t:   Pointer to the SAT IO Context
1371  *
1372  *  \return If command is started successfully
1373  *    - \e tiSuccess:     I/O request successfully initiated.
1374  *    - \e tiBusy:        No resources available, try again later.
1375  *    - \e tiIONoDevice:  Invalid device handle.
1376  *    - \e tiError:       Other errors.
1377  */
1378 /*****************************************************************************/
1379 GLOBAL bit32  satModeSense6(
1380                    tiRoot_t                  *tiRoot,
1381                    tiIORequest_t             *tiIORequest,
1382                    tiDeviceHandle_t          *tiDeviceHandle,
1383                    tiScsiInitiatorRequest_t *tiScsiRequest,
1384                    satIOContext_t            *satIOContext);
1385 
1386 
1387 /*****************************************************************************/
1388 /*! \brief SAT implementation for SCSI MODE SENSE (10).
1389  *
1390  *  SAT implementation for SCSI MODE SENSE (10).
1391  *
1392  *  \param   tiRoot:           Pointer to TISA initiator driver/port instance.
1393  *  \param   tiIORequest:      Pointer to TISA I/O request context for this I/O.
1394  *  \param   tiDeviceHandle:   Pointer to TISA device handle for this I/O.
1395  *  \param   tiScsiRequest:    Pointer to TISA SCSI I/O request and SGL list.
1396  *  \param   satIOContext_t:   Pointer to the SAT IO Context
1397  *
1398  *  \return If command is started successfully
1399  *    - \e tiSuccess:     I/O request successfully initiated.
1400  *    - \e tiBusy:        No resources available, try again later.
1401  *    - \e tiIONoDevice:  Invalid device handle.
1402  *    - \e tiError:       Other errors.
1403  */
1404 /*****************************************************************************/
1405 GLOBAL bit32  satModeSense10(
1406                    tiRoot_t                  *tiRoot,
1407                    tiIORequest_t             *tiIORequest,
1408                    tiDeviceHandle_t          *tiDeviceHandle,
1409                    tiScsiInitiatorRequest_t *tiScsiRequest,
1410                    satIOContext_t            *satIOContext);
1411 
1412 
1413 /*****************************************************************************/
1414 /*! \brief SAT implementation for SCSI VERIFY (10).
1415  *
1416  *  SAT implementation for SCSI VERIFY (10).
1417  *
1418  *  \param   tiRoot:           Pointer to TISA initiator driver/port instance.
1419  *  \param   tiIORequest:      Pointer to TISA I/O request context for this I/O.
1420  *  \param   tiDeviceHandle:   Pointer to TISA device handle for this I/O.
1421  *  \param   tiScsiRequest:    Pointer to TISA SCSI I/O request and SGL list.
1422  *  \param   satIOContext_t:   Pointer to the SAT IO Context
1423  *
1424  *  \return If command is started successfully
1425  *    - \e tiSuccess:     I/O request successfully initiated.
1426  *    - \e tiBusy:        No resources available, try again later.
1427  *    - \e tiIONoDevice:  Invalid device handle.
1428  *    - \e tiError:       Other errors.
1429  */
1430 /*****************************************************************************/
1431 GLOBAL bit32  satVerify10(
1432                    tiRoot_t                  *tiRoot,
1433                    tiIORequest_t             *tiIORequest,
1434                    tiDeviceHandle_t          *tiDeviceHandle,
1435                    tiScsiInitiatorRequest_t *tiScsiRequest,
1436                    satIOContext_t            *satIOContext);
1437 
1438 GLOBAL bit32  satChainedVerify(
1439                    tiRoot_t                  *tiRoot,
1440                    tiIORequest_t             *tiIORequest,
1441                    tiDeviceHandle_t          *tiDeviceHandle,
1442                    tiScsiInitiatorRequest_t *tiScsiRequest,
1443                    satIOContext_t            *satIOContext);
1444 
1445 /*****************************************************************************/
1446 /*! \brief SAT implementation for SCSI VERIFY (12).
1447  *
1448  *  SAT implementation for SCSI VERIFY (12).
1449  *
1450  *  \param   tiRoot:           Pointer to TISA initiator driver/port instance.
1451  *  \param   tiIORequest:      Pointer to TISA I/O request context for this I/O.
1452  *  \param   tiDeviceHandle:   Pointer to TISA device handle for this I/O.
1453  *  \param   tiScsiRequest:    Pointer to TISA SCSI I/O request and SGL list.
1454  *  \param   satIOContext_t:   Pointer to the SAT IO Context
1455  *
1456  *  \return If command is started successfully
1457  *    - \e tiSuccess:     I/O request successfully initiated.
1458  *    - \e tiBusy:        No resources available, try again later.
1459  *    - \e tiIONoDevice:  Invalid device handle.
1460  *    - \e tiError:       Other errors.
1461  */
1462 /*****************************************************************************/
1463 GLOBAL bit32  satVerify12(
1464                    tiRoot_t                  *tiRoot,
1465                    tiIORequest_t             *tiIORequest,
1466                    tiDeviceHandle_t          *tiDeviceHandle,
1467                    tiScsiInitiatorRequest_t *tiScsiRequest,
1468                    satIOContext_t            *satIOContext);
1469 /*****************************************************************************/
1470 /*! \brief SAT implementation for SCSI VERIFY (16).
1471  *
1472  *  SAT implementation for SCSI VERIFY (16).
1473  *
1474  *  \param   tiRoot:           Pointer to TISA initiator driver/port instance.
1475  *  \param   tiIORequest:      Pointer to TISA I/O request context for this I/O.
1476  *  \param   tiDeviceHandle:   Pointer to TISA device handle for this I/O.
1477  *  \param   tiScsiRequest:    Pointer to TISA SCSI I/O request and SGL list.
1478  *  \param   satIOContext_t:   Pointer to the SAT IO Context
1479  *
1480  *  \return If command is started successfully
1481  *    - \e tiSuccess:     I/O request successfully initiated.
1482  *    - \e tiBusy:        No resources available, try again later.
1483  *    - \e tiIONoDevice:  Invalid device handle.
1484  *    - \e tiError:       Other errors.
1485  */
1486 /*****************************************************************************/
1487 GLOBAL bit32  satVerify16(
1488                    tiRoot_t                  *tiRoot,
1489                    tiIORequest_t             *tiIORequest,
1490                    tiDeviceHandle_t          *tiDeviceHandle,
1491                    tiScsiInitiatorRequest_t *tiScsiRequest,
1492                    satIOContext_t            *satIOContext);
1493 /*****************************************************************************/
1494 /*! \brief SAT implementation for SCSI satTestUnitReady_1.
1495  *
1496  *  SAT implementation for SCSI satTestUnitReady_1
1497  *  Sub function of satTestUnitReady
1498  *
1499  *  \param   tiRoot:           Pointer to TISA initiator driver/port instance.
1500  *  \param   tiIORequest:      Pointer to TISA I/O request context for this I/O.
1501  *  \param   tiDeviceHandle:   Pointer to TISA device handle for this I/O.
1502  *  \param   tiScsiRequest:    Pointer to TISA SCSI I/O request and SGL list.
1503  *  \param   satIOContext_t:   Pointer to the SAT IO Context
1504  *
1505  *  \return If command is started successfully
1506  *    - \e tiSuccess:     I/O request successfully initiated.
1507  *    - \e tiBusy:        No resources available, try again later.
1508  *    - \e tiIONoDevice:  Invalid device handle.
1509  *    - \e tiError:       Other errors.
1510  */
1511 /*****************************************************************************/
1512 GLOBAL bit32  satTestUnitReady_1(
1513                          tiRoot_t                  *tiRoot,
1514                          tiIORequest_t             *tiIORequest,
1515                          tiDeviceHandle_t          *tiDeviceHandle,
1516                          tiScsiInitiatorRequest_t *tiScsiRequest,
1517                          satIOContext_t            *satIOContext);
1518 
1519 /*****************************************************************************/
1520 /*! \brief SAT implementation for SCSI STANDARD INQUIRY.
1521  *
1522  *  SAT implementation for SCSI STANDARD INQUIRY.
1523  *
1524  *  \param   pInquiry:         Pointer to Inquiry Data buffer.
1525  *  \param   pSATAIdData:      Pointer to ATA IDENTIFY DEVICE data.
1526  *
1527  *  \return None.
1528  */
1529 /*****************************************************************************/
1530 GLOBAL void  satInquiryStandard(
1531                     bit8                    *pInquiry,
1532                     agsaSATAIdentifyData_t  *pSATAIdData,
1533                     tiIniScsiCmnd_t         *scsiCmnd
1534                     );
1535 
1536 
1537 /*****************************************************************************/
1538 /*! \brief SAT implementation for SCSI INQUIRY page 0.
1539  *
1540  *  SAT implementation for SCSI INQUIRY page 0.
1541  *
1542  *  \param   pInquiry:         Pointer to Inquiry Data buffer.
1543  *  \param   pSATAIdData:      Pointer to ATA IDENTIFY DEVICE data.
1544  *
1545  *  \return None.
1546  */
1547 /*****************************************************************************/
1548 GLOBAL void  satInquiryPage0(
1549                     bit8                    *pInquiry,
1550                     agsaSATAIdentifyData_t  *pSATAIdData);
1551 
1552 
1553 /*****************************************************************************/
1554 /*! \brief SAT implementation for SCSI INQUIRY page 83.
1555  *
1556  *  SAT implementation for SCSI INQUIRY page 83.
1557  *
1558  *  \param   pInquiry:         Pointer to Inquiry Data buffer.
1559  *  \param   pSATAIdData:      Pointer to ATA IDENTIFY DEVICE data.
1560  *  \param   pSatDevData       Pointer to internal device data structure
1561  *
1562  *  \return None.
1563  */
1564 /*****************************************************************************/
1565 GLOBAL void  satInquiryPage83(
1566                     bit8                    *pInquiry,
1567                     agsaSATAIdentifyData_t  *pSATAIdData,
1568                     satDeviceData_t         *pSatDevData);
1569 
1570 /*****************************************************************************/
1571 /*! \brief SAT implementation for SCSI INQUIRY page 89.
1572  *
1573  *  SAT implementation for SCSI INQUIRY page 89.
1574  *
1575  *  \param   pInquiry:         Pointer to Inquiry Data buffer.
1576  *  \param   pSATAIdData:      Pointer to ATA IDENTIFY DEVICE data.
1577  *  \param   pSatDevData       Pointer to internal device data structure
1578  *
1579  *  \return None.
1580  */
1581 /*****************************************************************************/
1582 GLOBAL void  satInquiryPage89(
1583                     bit8                    *pInquiry,
1584                     agsaSATAIdentifyData_t  *pSATAIdData,
1585                     satDeviceData_t         *pSatDevData);
1586 
1587 /*****************************************************************************/
1588 /*! \brief SAT implementation for SCSI INQUIRY page 80.
1589  *
1590  *  SAT implementation for SCSI INQUIRY page 80.
1591  *
1592  *  \param   pInquiry:         Pointer to Inquiry Data buffer.
1593  *  \param   pSATAIdData:      Pointer to ATA IDENTIFY DEVICE data.
1594  *
1595  *  \return None.
1596  */
1597 /*****************************************************************************/
1598 GLOBAL void  satInquiryPage80(
1599                     bit8                    *pInquiry,
1600                     agsaSATAIdentifyData_t  *pSATAIdData);
1601 
1602 
1603 /*****************************************************************************
1604  *! \brief  sataLLIOStart
1605  *
1606  *   This routine is called to initiate a new SATA request to LL layer.
1607  *   This function implements/encapsulates HW and LL API dependency.
1608  *
1609  *  \param   tiRoot:           Pointer to TISA initiator driver/port instance.
1610  *  \param   tiIORequest:      Pointer to TISA I/O request context for this I/O.
1611  *  \param   tiDeviceHandle:   Pointer to TISA device handle for this I/O.
1612  *  \param   tiScsiRequest:    Pointer to TISA SCSI I/O request and SGL list.
1613  *  \param   satIOContext_t:   Pointer to the SAT IO Context
1614  *
1615  *  \return:
1616  *
1617  *  tiSuccess:     I/O request successfully initiated.
1618  *  tiBusy:        No resources available, try again later.
1619  *  tiIONoDevice:  Invalid device handle.
1620  *  tiError:       Other errors that prevent the I/O request to be started.
1621  *
1622  *
1623  *****************************************************************************/
1624 
1625 GLOBAL bit32  sataLLIOStart (
1626                    tiRoot_t                  *tiRoot,
1627                    tiIORequest_t             *tiIORequest,
1628                    tiDeviceHandle_t          *tiDeviceHandle,
1629                    tiScsiInitiatorRequest_t *tiScsiRequest,
1630                    satIOContext_t            *satIOContext
1631                   );
1632 
1633 /*****************************************************************************
1634 *! \brief itdsataIOPrepareSGL
1635 *
1636 *  This function is called to prepare and translate the TISA SGL information
1637 *  to the SAS/SATA LL layer specific SGL.
1638 *
1639 *  \param    tiRoot:         Pointer to initiator driver/port instance.
1640 *  \param    IORequestBody:  TD layer request body for the I/O.
1641 *  \param    tiSgl1:         First TISA SGL info.
1642 *  \param    sglVirtualAddr: The virtual address of the first element in
1643 *                            tiSgl1 when tiSgl1 is used with the type tiSglList.
1644 *
1645 *  \return:
1646 *
1647 *  tiSuccess:     SGL initialized successfully.
1648 *  tiError:       Failed to initialize SGL.
1649 *
1650 *
1651 *****************************************************************************/
1652 osGLOBAL bit32 itdsataIOPrepareSGL(
1653                   tiRoot_t                 *tiRoot,
1654                   tdIORequestBody_t        *tdIORequestBody,
1655                   tiSgl_t                  *tiSgl1,
1656                   void                     *sglVirtualAddr
1657                   );
1658 
1659 /*****************************************************************************
1660 *! \brief  satNonChainedDataIOCB
1661 *
1662 *   This routine is a callback function called from ossaSATACompleted().
1663 *   This CB routine deals with normal non-chained data I/O SATA request.
1664 *
1665 *  \param   agRoot:       Handles for this instance of SAS/SATA hardware
1666 *  \param   agIORequest:  Pointer to the LL I/O request context for this I/O.
1667 *  \param   agIOStatus:   Status of completed I/O.
1668 *  \param   agSATAParm1:  Additional info based on status.
1669 *  \param   agIOInfoLen:  Length in bytes of overrun/underrun residual or FIS
1670 *                         length.
1671 *  \param   ioContext:    Pointer to satIOContext_t.
1672 *
1673 *  \return: none
1674 *
1675 *****************************************************************************/
1676 
1677 void satNonChainedDataIOCB(
1678                            agsaRoot_t        *agRoot,
1679                            agsaIORequest_t   *agIORequest,
1680                            bit32             agIOStatus,
1681                            agsaFisHeader_t   *agFirstDword,
1682                            bit32             agIOInfoLen,
1683                            agsaFrameHandle_t agFrameHandle,
1684                            void              *ioContext
1685                            );
1686 void satChainedDataIOCB(
1687                         agsaRoot_t        *agRoot,
1688                         agsaIORequest_t   *agIORequest,
1689                         bit32             agIOStatus,
1690                         agsaFisHeader_t   *agFirstDword,
1691                         bit32             agIOInfoLen,
1692                         agsaFrameHandle_t agFrameHandle,
1693                         void              *ioContext
1694                         );
1695 
1696 void satNonChainedWriteNVerifyCB(
1697                         agsaRoot_t        *agRoot,
1698                         agsaIORequest_t   *agIORequest,
1699                         bit32             agIOStatus,
1700                         agsaFisHeader_t   *agFirstDword,
1701                         bit32             agIOInfoLen,
1702                         agsaFrameHandle_t agFrameHandle,
1703                         void              *ioContext
1704                         );
1705 
1706 void satChainedWriteNVerifyCB(
1707                         agsaRoot_t        *agRoot,
1708                         agsaIORequest_t   *agIORequest,
1709                         bit32             agIOStatus,
1710                         agsaFisHeader_t   *agFirstDword,
1711                         bit32             agIOInfoLen,
1712                         agsaFrameHandle_t agFrameHandle,
1713                         void              *ioContext
1714                         );
1715 
1716 /*****************************************************************************
1717 *! \brief  satNonDataIOCB
1718 *
1719 *   This routine is a callback function called from ossaSATACompleted().
1720 *   This CB routine deals with non-data I/O SATA request.
1721 *
1722 *  \param   agRoot:       Handles for this instance of SAS/SATA hardware
1723 *  \param   agIORequest:  Pointer to the LL I/O request context for this I/O.
1724 *  \param   agIOStatus:   Status of completed I/O.
1725 *  \param   agSATAParm1:  Additional info based on status.
1726 *  \param   agIOInfoLen:  Length in bytes of overrun/underrun residual or FIS
1727 *                         length.
1728 *  \param   ioContext:    Pointer to satIOContext_t.
1729 *
1730 *  \return: none
1731 *
1732 *****************************************************************************/
1733 void satNonDataIOCB(
1734                     agsaRoot_t        *agRoot,
1735                     agsaIORequest_t   *agIORequest,
1736                     bit32             agIOStatus,
1737                     agsaFisHeader_t   *agFirstDword,
1738                     bit32             agIOInfoLen,
1739                     agsaFrameHandle_t agFrameHandle,
1740                     void              *ioContext
1741                     );
1742 
1743 /*****************************************************************************
1744 *! \brief  satSMARTEnableCB
1745 *
1746 *   This routine is a callback function for satSMARTEnable()
1747 *
1748 *  \param   agRoot:       Handles for this instance of SAS/SATA hardware
1749 *  \param   agIORequest:  Pointer to the LL I/O request context for this I/O.
1750 *  \param   agIOStatus:   Status of completed I/O.
1751 *  \param   agSATAParm1:  Additional info based on status.
1752 *  \param   agIOInfoLen:  Length in bytes of overrun/underrun residual or FIS
1753 *                         length.
1754 *  \param   ioContext:    Pointer to satIOContext_t.
1755 *
1756 *  \return: none
1757 *
1758 *****************************************************************************/
1759 void satSMARTEnableCB(
1760                       agsaRoot_t        *agRoot,
1761                       agsaIORequest_t   *agIORequest,
1762                       bit32             agIOStatus,
1763                       agsaFisHeader_t   *agFirstDword,
1764                       bit32             agIOInfoLen,
1765                       agsaFrameHandle_t agFrameHandle,
1766                       void              *ioContext
1767                       ) ;
1768 
1769 /*****************************************************************************
1770 *! \brief  satLogSenseCB
1771 *
1772 *   This routine is a callback function for satLogSense()
1773 *
1774 *  \param   agRoot:       Handles for this instance of SAS/SATA hardware
1775 *  \param   agIORequest:  Pointer to the LL I/O request context for this I/O.
1776 *  \param   agIOStatus:   Status of completed I/O.
1777 *  \param   agSATAParm1:  Additional info based on status.
1778 *  \param   agIOInfoLen:  Length in bytes of overrun/underrun residual or FIS
1779 *                         length.
1780 *  \param   ioContext:    Pointer to satIOContext_t.
1781 *
1782 *  \return: none
1783 *
1784 *****************************************************************************/
1785 void satLogSenseCB(
1786                    agsaRoot_t        *agRoot,
1787                    agsaIORequest_t   *agIORequest,
1788                    bit32             agIOStatus,
1789                    agsaFisHeader_t   *agFirstDword,
1790                    bit32             agIOInfoLen,
1791                    agsaFrameHandle_t agFrameHandle,
1792                    void              *ioCotext
1793                    );
1794 void satModeSelect6n10CB(
1795                          agsaRoot_t        *agRoot,
1796                          agsaIORequest_t   *agIORequest,
1797                          bit32             agIOStatus,
1798                          agsaFisHeader_t   *agFirstDword,
1799                          bit32             agIOInfoLen,
1800                          agsaFrameHandle_t agFrameHandle,
1801                          void              *ioContext
1802                          );
1803 void satSynchronizeCache10n16CB(
1804                                 agsaRoot_t        *agRoot,
1805                                 agsaIORequest_t   *agIORequest,
1806                                 bit32             agIOStatus,
1807                                 agsaFisHeader_t   *agFirstDword,
1808                                 bit32             agIOInfoLen,
1809                                 agsaFrameHandle_t agFrameHandle,
1810                                 void              *ioContext
1811                                 );
1812 #ifdef REMOVED
1813 void satWriteAndVerify10CB(
1814                            agsaRoot_t        *agRoot,
1815                            agsaIORequest_t   *agIORequest,
1816                            bit32             agIOStatus,
1817                            agsaFisHeader_t   *agFirstDword,
1818                            bit32             agIOInfoLen,
1819                            agsaFrameHandle_t agFrameHandle,
1820                            void              *ioContext
1821                            );
1822 #endif
1823 
1824 /*****************************************************************************
1825 *! \brief  satReadLogExtCB
1826 *
1827 *   This routine is a callback function called from ossaSATACompleted().
1828 *   This CB routine deals READ LOG EXT completion.
1829 *
1830 *  \param   agRoot:       Handles for this instance of SAS/SATA hardware
1831 *  \param   agIORequest:  Pointer to the LL I/O request context for this I/O.
1832 *  \param   agIOStatus:   Status of completed I/O.
1833 *  \param   agSATAParm1:  Additional info based on status.
1834 *  \param   agIOInfoLen:  Length in bytes of overrun/underrun residual or FIS
1835 *                         length.
1836 *  \param   ioContext:    Pointer to satIOContext_t.
1837 *
1838 *  \return: none
1839 *
1840 *****************************************************************************/
1841 void satReadLogExtCB(
1842                      agsaRoot_t        *agRoot,
1843                      agsaIORequest_t   *agIORequest,
1844                      bit32             agIOStatus,
1845                      agsaFisHeader_t   *agFirstDword,
1846                      bit32             agIOInfoLen,
1847                      agsaFrameHandle_t agFrameHandle,
1848                      void              *ioContext
1849                      );
1850 void satTestUnitReadyCB(
1851                         agsaRoot_t        *agRoot,
1852                         agsaIORequest_t   *agIORequest,
1853                         bit32             agIOStatus,
1854                         agsaFisHeader_t   *agFirstDword,
1855                         bit32             agIOInfoLen,
1856                         agsaFrameHandle_t agFrameHandle,
1857                         void              *ioContext
1858                         );
1859 void satWriteSame10CB(
1860                       agsaRoot_t        *agRoot,
1861                       agsaIORequest_t   *agIORequest,
1862                       bit32             agIOStatus,
1863                       agsaFisHeader_t   *agFirstDword,
1864                       bit32             agIOInfoLen,
1865                       agsaFrameHandle_t agFrameHandle,
1866                       void              *ioContext
1867                       );
1868 /*****************************************************************************
1869 *! \brief  satSendDiagnosticCB
1870 *
1871 *   This routine is a callback function called from ossaSATACompleted().
1872 *   This CB routine deals with Send Diagnostic completion.
1873 *
1874 *  \param   agRoot:       Handles for this instance of SAS/SATA hardware
1875 *  \param   agIORequest:  Pointer to the LL I/O request context for this I/O.
1876 *  \param   agIOStatus:   Status of completed I/O.
1877 *  \param   agSATAParm1:  Additional info based on status.
1878 *  \param   agIOInfoLen:  Length in bytes of overrun/underrun residual or FIS
1879 *                         length.
1880 *  \param   ioContext:    Pointer to satIOContext_t.
1881 *
1882 *  \return: none
1883 *
1884 *****************************************************************************/
1885 void satSendDiagnosticCB(
1886                          agsaRoot_t        *agRoot,
1887                          agsaIORequest_t   *agIORequest,
1888                          bit32             agIOStatus,
1889                          agsaFisHeader_t   *agFirstDword,
1890                          bit32             agIOInfoLen,
1891                          agsaFrameHandle_t agFrameHandle,
1892                          void              *ioContext
1893                          );
1894 /*****************************************************************************
1895 *! \brief  satRequestSenseCB
1896 *
1897 *   This routine is a callback function called from ossaSATACompleted().
1898 *   This CB routine deals with Request Sense completion.
1899 *
1900 *  \param   agRoot:       Handles for this instance of SAS/SATA hardware
1901 *  \param   agIORequest:  Pointer to the LL I/O request context for this I/O.
1902 *  \param   agIOStatus:   Status of completed I/O.
1903 *  \param   agSATAParm1:  Additional info based on status.
1904 *  \param   agIOInfoLen:  Length in bytes of overrun/underrun residual or FIS
1905 *                         length.
1906 *  \param   ioContext:    Pointer to satIOContext_t.
1907 *
1908 *  \return: none
1909 *
1910 *****************************************************************************/
1911 void satRequestSenseCB(
1912                         agsaRoot_t        *agRoot,
1913                         agsaIORequest_t   *agIORequest,
1914                         bit32             agIOStatus,
1915                         agsaFisHeader_t   *agFirstDword,
1916                         bit32             agIOInfoLen,
1917                         agsaFrameHandle_t agFrameHandle,
1918                         void              *ioContext
1919                         );
1920 /*****************************************************************************
1921 *! \brief  satStartStopUnitCB
1922 *
1923 *   This routine is a callback function called from ossaSATACompleted().
1924 *   This CB routine deals with Send Diagnostic completion.
1925 *
1926 *  \param   agRoot:       Handles for this instance of SAS/SATA hardware
1927 *  \param   agIORequest:  Pointer to the LL I/O request context for this I/O.
1928 *  \param   agIOStatus:   Status of completed I/O.
1929 *  \param   agSATAParm1:  Additional info based on status.
1930 *  \param   agIOInfoLen:  Length in bytes of overrun/underrun residual or FIS
1931 *                         length.
1932 *  \param   ioContext:    Pointer to satIOContext_t.
1933 *
1934 *  \return: none
1935 *
1936 *****************************************************************************/
1937 void satStartStopUnitCB(
1938                         agsaRoot_t        *agRoot,
1939                         agsaIORequest_t   *agIORequest,
1940                         bit32             agIOStatus,
1941                         agsaFisHeader_t   *agFirstDword,
1942                         bit32             agIOInfoLen,
1943                         agsaFrameHandle_t agFrameHandle,
1944                         void              *ioContext
1945                         );
1946 /*****************************************************************************
1947 *! \brief  satVerify10CB
1948 *
1949 *   This routine is a callback function called from ossaSATACompleted().
1950 *   This CB routine deals with Verify(10) completion.
1951 *
1952 *  \param   agRoot:       Handles for this instance of SAS/SATA hardware
1953 *  \param   agIORequest:  Pointer to the LL I/O request context for this I/O.
1954 *  \param   agIOStatus:   Status of completed I/O.
1955 *  \param   agSATAParm1:  Additional info based on status.
1956 *  \param   agIOInfoLen:  Length in bytes of overrun/underrun residual or FIS
1957 *                         length.
1958 *  \param   ioContext:    Pointer to satIOContext_t.
1959 *
1960 *  \return: none
1961 *
1962 *****************************************************************************/
1963 void satVerify10CB(
1964                    agsaRoot_t        *agRoot,
1965                    agsaIORequest_t   *agIORequest,
1966                    bit32             agIOStatus,
1967                    agsaFisHeader_t   *agFirstDword,
1968                    bit32             agIOInfoLen,
1969                    agsaFrameHandle_t agFrameHandle,
1970                    void              *ioContex
1971                    );
1972 
1973 void satNonChainedVerifyCB(
1974                            agsaRoot_t        *agRoot,
1975                            agsaIORequest_t   *agIORequest,
1976                            bit32             agIOStatus,
1977                            agsaFisHeader_t   *agFirstDword,
1978                            bit32             agIOInfoLen,
1979                            agsaFrameHandle_t agFrameHandle,
1980                            void              *ioContext
1981                            );
1982 
1983 void satChainedVerifyCB(
1984                            agsaRoot_t        *agRoot,
1985                            agsaIORequest_t   *agIORequest,
1986                            bit32             agIOStatus,
1987                            agsaFisHeader_t   *agFirstDword,
1988                            bit32             agIOInfoLen,
1989                            agsaFrameHandle_t agFrameHandle,
1990                            void              *ioContext
1991                            );
1992 
1993 /*****************************************************************************
1994  *! \brief  satTmResetLUN
1995  *
1996  *   This routine is called to initiate a TM RESET LUN request to SATL.
1997  *   This routine is independent of HW/LL API.
1998  *
1999  *  \param  tiRoot:           Pointer to TISA initiator driver/port instance.
2000  *  \param  tiDeviceHandle:   Pointer to TISA device handle for this I/O.
2001  *  \param  lun:              Pointer to LUN.
2002  *  \param  currentTaskTag:   Pointer to tag/context for this TM request.
2003  *
2004  *  \return:
2005  *
2006  *  \e tiSuccess:     I/O request successfully initiated.
2007  *  \e tiBusy:        No resources available, try again later.
2008  *  \e tiIONoDevice:  Invalid device handle.
2009  *  \e tiError:       Other errors that prevent the I/O request to be started.
2010  *
2011  *
2012  *****************************************************************************/
2013 osGLOBAL bit32 satTmResetLUN(
2014                             tiRoot_t                  *tiRoot,
2015                             tiIORequest_t             *tiIORequest,
2016                             tiDeviceHandle_t          *tiDeviceHandle,
2017                             tiScsiInitiatorRequest_t *tiScsiRequest,
2018                             satIOContext_t            *satIOContext,
2019                             tiLUN_t                   *lun);
2020 
2021 osGLOBAL bit32 satTmWarmReset(
2022                             tiRoot_t                  *tiRoot,
2023                             tiIORequest_t             *tiIORequest,
2024                             tiDeviceHandle_t          *tiDeviceHandle,
2025                             tiScsiInitiatorRequest_t *tiScsiRequest,
2026                             satIOContext_t            *satIOContext);
2027 
2028 osGLOBAL bit32 satTDInternalTmReset(
2029                             tiRoot_t                  *tiRoot,
2030                             tiIORequest_t             *tiIORequest,
2031                             tiDeviceHandle_t          *tiDeviceHandle,
2032                             tiScsiInitiatorRequest_t *tiScsiRequest,
2033                             satIOContext_t            *satIOContext);
2034 
2035 /*****************************************************************************
2036  *! \brief  satTmAbortTask
2037  *
2038  *   This routine is called to initiate a TM ABORT TASK request to SATL.
2039  *   This routine is independent of HW/LL API.
2040  *
2041  *  \param  tiRoot:           Pointer to TISA initiator driver/port instance.
2042  *  \param  tiDeviceHandle:   Pointer to TISA device handle for this I/O.
2043  *  \param  taskTag:          Pointer to the associated task where the TM
2044  *                            command is to be applied.
2045  *  \param  currentTaskTag:   Pointer to tag/context for this TM request.
2046  *
2047  *  \return:
2048  *
2049  *  \e tiSuccess:     I/O request successfully initiated.
2050  *  \e tiBusy:        No resources available, try again later.
2051  *  \e tiIONoDevice:  Invalid device handle.
2052  *  \e tiError:       Other errors that prevent the I/O request to be started.
2053  *
2054  *
2055  *****************************************************************************/
2056 osGLOBAL bit32 satTmAbortTask(
2057                             tiRoot_t                  *tiRoot,
2058                             tiIORequest_t             *tiIORequest,
2059                             tiDeviceHandle_t          *tiDeviceHandle,
2060                             tiScsiInitiatorRequest_t *tiScsiRequest,
2061                             satIOContext_t            *satIOContext,
2062                             tiIORequest_t             *taskTag);
2063 
2064 /*****************************************************************************
2065  *! \brief  osSatResetCB
2066  *
2067  *   This routine is called to notify the completion of SATA device reset
2068  *   which was initiated previously through the call to sataLLReset().
2069  *   This routine is independent of HW/LL API.
2070  *
2071  *  \param  tiRoot:           Pointer to TISA initiator driver/port instance.
2072  *  \param  tiDeviceHandle:   Pointer to TISA device handle for this I/O.
2073  *  \param  resetStatus:      Reset status either tiSuccess or tiError.
2074  *  \param  respFis:          Pointer to the Register Device-To-Host FIS
2075  *                            received from the device.
2076  *
2077  *  \return: None
2078  *
2079  *****************************************************************************/
2080 
2081 osGLOBAL void osSatResetCB(
2082                 tiRoot_t          *tiRoot,
2083                 tiDeviceHandle_t  *tiDeviceHandle,
2084                 bit32             resetStatus,
2085                 void              *respFis);
2086 
2087 osGLOBAL void
2088 ossaSATADeviceResetCB(
2089                       agsaRoot_t        *agRoot,
2090                       agsaDevHandle_t   *agDevHandle,
2091                       bit32             resetStatus,
2092                       void              *resetparm);
2093 
2094 /*****************************************************************************
2095  *! \brief  osSatIOCompleted
2096  *
2097  *   This routine is a callback for SATA completion that required FIS status
2098  *   translation to SCSI status.
2099  *
2100  *  \param   tiRoot:          Pointer to TISA initiator driver/port instance.
2101  *  \param   tiIORequest:     Pointer to TISA I/O request context for this I/O.
2102  *  \param   respFis:         Pointer to status FIS to read.
2103  *  \param   respFisLen:      Length of response FIS to read.
2104  *  \param   satIOContext:    Pointer to SAT context.
2105  *  \param   interruptContext:      Interrupt context
2106  *
2107  *  \return: None
2108  *
2109  *****************************************************************************/
2110 osGLOBAL void osSatIOCompleted(
2111                           tiRoot_t           *tiRoot,
2112                           tiIORequest_t      *tiIORequest,
2113                           agsaFisHeader_t    *agFirstDword,
2114                           bit32              respFisLen,
2115                           agsaFrameHandle_t agFrameHandle,
2116                           satIOContext_t     *satIOContext,
2117                           bit32              interruptContext);
2118 
2119 
2120 /*****************************************************************************
2121 *! \brief tdssAddSataToSharedcontext
2122 *
2123 *  Purpose:  This function adds a discovered SATA device to a device list of
2124 *            a port context
2125 *
2126 *  \param   tdsaPortContext          Pointer to a port context
2127 *  \param   tdsaDeviceData           Pointer to a device data
2128 *  \param   tsddPortContext_Instance Pointer to the target port context
2129 *  \param   agRoot                   Pointer to the root data structure of
2130 *                                    TD and Lower layer
2131 *  \param   agDevHandle              Pointer to a device handle
2132 *  \param   agSATADeviceInfo         Pointer to SATA device info structure
2133 *
2134 *  \Return: none
2135 *
2136 *****************************************************************************/
2137 osGLOBAL void
2138 tdssRemoveSATAFromSharedcontext(
2139                                tdsaPortContext_t *tdsaPortContext_Ins,
2140                                tdsaDeviceData_t  *tdsaDeviceData_ins,
2141                                agsaRoot_t        *agRoot
2142                                );
2143 
2144 /*****************************************************************************/
2145 /*! \brief  SAT default ATA status and ATA error translation to SCSI.
2146  *
2147  *  SSAT default ATA status and ATA error translation to SCSI.
2148  *
2149  *  \param   tiRoot:        Pointer to TISA initiator driver/port instance.
2150  *  \param   tiIORequest:   Pointer to TISA I/O request context for this I/O.
2151  *  \param   satIOContext:  Pointer to the SAT IO Context
2152  *  \param   pSense:        Pointer to scsiRspSense_t
2153  *  \param   ataStatus:     ATA status register
2154  *  \param   ataError:      ATA error register
2155  *  \param   interruptContext:    Interrupt context
2156  *
2157  *  \return  None
2158  */
2159 /*****************************************************************************/
2160 
2161 GLOBAL void  osSatDefaultTranslation(
2162                    tiRoot_t             *tiRoot,
2163                    tiIORequest_t        *tiIORequest,
2164                    satIOContext_t       *satIOContext,
2165                    scsiRspSense_t       *pSense,
2166                    bit8                 ataStatus,
2167                    bit8                 ataError,
2168                    bit32                interruptContext );
2169 
2170 /*****************************************************************************/
2171 /*! \brief  Allocate resource for SAT intervally generated I/O.
2172  *
2173  *  Allocate resource for SAT intervally generated I/O.
2174  *
2175  *  \param   tiRoot:      Pointer to TISA driver/port instance.
2176  *  \param   satDevData:  Pointer to SAT specific device data.
2177  *  \param   allocLength: Length in byte of the DMA mem to allocate, upto
2178  *                        one page size.
2179  *  \param   satIntIo:    Pointer (output) to context for SAT internally
2180  *                        generated I/O that is allocated by this routine.
2181  *
2182  *  \return If command is started successfully
2183  *    - \e tiSuccess:     Success.
2184  *    - \e tiError:       Failed allocating resource.
2185  */
2186 /*****************************************************************************/
2187 GLOBAL satInternalIo_t *  satAllocIntIoResource(
2188                     tiRoot_t              *tiRoot,
2189                     tiIORequest_t         *tiIORequest,
2190                     satDeviceData_t       *satDevData,
2191                     bit32                 dmaAllocLength,
2192                     satInternalIo_t       *satIntIo);
2193 
2194 /*****************************************************************************/
2195 /*! \brief  Send READ LOG EXT ATA PAGE 10h command to sata drive.
2196  *
2197  *  Send READ LOG EXT ATA command PAGE 10h request to LL layer.
2198  *
2199  *  \param   tiRoot:           Pointer to TISA initiator driver/port instance.
2200  *  \param   tiIORequest:      Pointer to TISA I/O request context for this I/O.
2201  *  \param   tiDeviceHandle:   Pointer to TISA device handle for this I/O.
2202  *  \param   tiScsiRequest:    Pointer to TISA SCSI I/O request and SGL list.
2203  *  \param   satIOContext_t:   Pointer to the SAT IO Context
2204  *
2205  *  \return If command is started successfully
2206  *    - \e tiSuccess:     I/O request successfully initiated.
2207  *    - \e tiBusy:        No resources available, try again later.
2208  *    - \e tiIONoDevice:  Invalid device handle.
2209  *    - \e tiError:       Other errors.
2210  */
2211 /*****************************************************************************/
2212 GLOBAL bit32  satSendReadLogExt(
2213                    tiRoot_t                  *tiRoot,
2214                    tiIORequest_t             *tiIORequest,
2215                    tiDeviceHandle_t          *tiDeviceHandle,
2216                    tiScsiInitiatorRequest_t *tiScsiRequest,
2217                    satIOContext_t            *satIOContext);
2218 
2219 
2220 /*****************************************************************************/
2221 /*! \brief SAT implementation for SCSI satReadMediaSerialNumber.
2222  *
2223  *  SAT implementation for SCSI Read Media Serial Number.
2224  *
2225  *  \param   tiRoot:           Pointer to TISA initiator driver/port instance.
2226  *  \param   tiIORequest:      Pointer to TISA I/O request context for this I/O.
2227  *  \param   tiDeviceHandle:   Pointer to TISA device handle for this I/O.
2228  *  \param   tiScsiRequest:    Pointer to TISA SCSI I/O request and SGL list.
2229  *  \param   satIOContext_t:   Pointer to the SAT IO Context
2230  *
2231  *  \return If command is started successfully
2232  *    - \e tiSuccess:     I/O request successfully initiated.
2233  *    - \e tiBusy:        No resources available, try again later.
2234  *    - \e tiIONoDevice:  Invalid device handle.
2235  *    - \e tiError:       Other errors.
2236  */
2237 /*****************************************************************************/
2238 GLOBAL bit32  satReadMediaSerialNumber(
2239                    tiRoot_t                  *tiRoot,
2240                    tiIORequest_t             *tiIORequest,
2241                    tiDeviceHandle_t          *tiDeviceHandle,
2242                    tiScsiInitiatorRequest_t *tiScsiRequest,
2243                    satIOContext_t            *satIOContext);
2244 
2245 /*****************************************************************************
2246 *! \brief  satReadMediaSerialNumberCB
2247 *
2248 *   This routine is a callback function called from ossaSATACompleted().
2249 *   This CB routine deals with Read Media Serial Number completion.
2250 *
2251 *  \param   agRoot:       Handles for this instance of SAS/SATA hardware
2252 *  \param   agIORequest:  Pointer to the LL I/O request context for this I/O.
2253 *  \param   agIOStatus:   Status of completed I/O.
2254 *  \param   agSATAParm1:  Additional info based on status.
2255 *  \param   agIOInfoLen:  Length in bytes of overrun/underrun residual or FIS
2256 *                         length.
2257 *  \param   ioContext:    Pointer to satIOContext_t.
2258 *
2259 *  \return: none
2260 *
2261 *****************************************************************************/
2262 void satReadMediaSerialNumberCB(
2263                         agsaRoot_t        *agRoot,
2264                         agsaIORequest_t   *agIORequest,
2265                         bit32             agIOStatus,
2266                         agsaFisHeader_t   *agFirstDword,
2267                         bit32             agIOInfoLen,
2268                         agsaFrameHandle_t agFrameHandle,
2269                         void              *ioContext
2270                         );
2271 
2272 /*****************************************************************************/
2273 /*! \brief SAT implementation for SCSI satReadBuffer.
2274  *
2275  *  SAT implementation for SCSI Read Buffer.
2276  *
2277  *  \param   tiRoot:           Pointer to TISA initiator driver/port instance.
2278  *  \param   tiIORequest:      Pointer to TISA I/O request context for this I/O.
2279  *  \param   tiDeviceHandle:   Pointer to TISA device handle for this I/O.
2280  *  \param   tiScsiRequest:    Pointer to TISA SCSI I/O request and SGL list.
2281  *  \param   satIOContext_t:   Pointer to the SAT IO Context
2282  *
2283  *  \return If command is started successfully
2284  *    - \e tiSuccess:     I/O request successfully initiated.
2285  *    - \e tiBusy:        No resources available, try again later.
2286  *    - \e tiIONoDevice:  Invalid device handle.
2287  *    - \e tiError:       Other errors.
2288  */
2289 /*****************************************************************************/
2290 GLOBAL bit32  satReadBuffer(
2291                    tiRoot_t                  *tiRoot,
2292                    tiIORequest_t             *tiIORequest,
2293                    tiDeviceHandle_t          *tiDeviceHandle,
2294                    tiScsiInitiatorRequest_t *tiScsiRequest,
2295                    satIOContext_t            *satIOContext);
2296 
2297 /*****************************************************************************
2298 *! \brief  satReadBufferCB
2299 *
2300 *   This routine is a callback function called from ossaSATACompleted().
2301 *   This CB routine deals with Read Buffer.
2302 *
2303 *  \param   agRoot:       Handles for this instance of SAS/SATA hardware
2304 *  \param   agIORequest:  Pointer to the LL I/O request context for this I/O.
2305 *  \param   agIOStatus:   Status of completed I/O.
2306 *  \param   agSATAParm1:  Additional info based on status.
2307 *  \param   agIOInfoLen:  Length in bytes of overrun/underrun residual or FIS
2308 *                         length.
2309 *  \param   ioContext:    Pointer to satIOContext_t.
2310 *
2311 *  \return: none
2312 *
2313 *****************************************************************************/
2314 void satReadBufferCB(
2315                         agsaRoot_t        *agRoot,
2316                         agsaIORequest_t   *agIORequest,
2317                         bit32             agIOStatus,
2318                         agsaFisHeader_t   *agFirstDword,
2319                         bit32             agIOInfoLen,
2320                         agsaFrameHandle_t agFrameHandle,
2321                         void              *ioContext
2322                         );
2323 
2324 /*****************************************************************************/
2325 /*! \brief SAT implementation for SCSI satWriteBuffer.
2326  *
2327  *  SAT implementation for SCSI Write Buffer.
2328  *
2329  *  \param   tiRoot:           Pointer to TISA initiator driver/port instance.
2330  *  \param   tiIORequest:      Pointer to TISA I/O request context for this I/O.
2331  *  \param   tiDeviceHandle:   Pointer to TISA device handle for this I/O.
2332  *  \param   tiScsiRequest:    Pointer to TISA SCSI I/O request and SGL list.
2333  *  \param   satIOContext_t:   Pointer to the SAT IO Context
2334  *
2335  *  \return If command is started successfully
2336  *    - \e tiSuccess:     I/O request successfully initiated.
2337  *    - \e tiBusy:        No resources available, try again later.
2338  *    - \e tiIONoDevice:  Invalid device handle.
2339  *    - \e tiError:       Other errors.
2340  */
2341 /*****************************************************************************/
2342 GLOBAL bit32  satWriteBuffer(
2343                    tiRoot_t                  *tiRoot,
2344                    tiIORequest_t             *tiIORequest,
2345                    tiDeviceHandle_t          *tiDeviceHandle,
2346                    tiScsiInitiatorRequest_t *tiScsiRequest,
2347                    satIOContext_t            *satIOContext);
2348 
2349 /*****************************************************************************
2350 *! \brief  satWriteBufferCB
2351 *
2352 *   This routine is a callback function called from ossaSATACompleted().
2353 *   This CB routine deals with Write Buffer.
2354 *
2355 *  \param   agRoot:       Handles for this instance of SAS/SATA hardware
2356 *  \param   agIORequest:  Pointer to the LL I/O request context for this I/O.
2357 *  \param   agIOStatus:   Status of completed I/O.
2358 *  \param   agSATAParm1:  Additional info based on status.
2359 *  \param   agIOInfoLen:  Length in bytes of overrun/underrun residual or FIS
2360 *                         length.
2361 *  \param   ioContext:    Pointer to satIOContext_t.
2362 *
2363 *  \return: none
2364 *
2365 *****************************************************************************/
2366 void satWriteBufferCB(
2367                         agsaRoot_t        *agRoot,
2368                         agsaIORequest_t   *agIORequest,
2369                         bit32             agIOStatus,
2370                         agsaFisHeader_t   *agFirstDword,
2371                         bit32             agIOInfoLen,
2372                         agsaFrameHandle_t agFrameHandle,
2373                         void              *ioContext
2374                         );
2375 
2376 /*****************************************************************************/
2377 /*! \brief SAT implementation for SCSI satReassignBlocks.
2378  *
2379  *  SAT implementation for SCSI Reassign Blocks.
2380  *
2381  *  \param   tiRoot:           Pointer to TISA initiator driver/port instance.
2382  *  \param   tiIORequest:      Pointer to TISA I/O request context for this I/O.
2383  *  \param   tiDeviceHandle:   Pointer to TISA device handle for this I/O.
2384  *  \param   tiScsiRequest:    Pointer to TISA SCSI I/O request and SGL list.
2385  *  \param   satIOContext_t:   Pointer to the SAT IO Context
2386  *
2387  *  \return If command is started successfully
2388  *    - \e tiSuccess:     I/O request successfully initiated.
2389  *    - \e tiBusy:        No resources available, try again later.
2390  *    - \e tiIONoDevice:  Invalid device handle.
2391  *    - \e tiError:       Other errors.
2392  */
2393 /*****************************************************************************/
2394 GLOBAL bit32  satReassignBlocks(
2395                    tiRoot_t                  *tiRoot,
2396                    tiIORequest_t             *tiIORequest,
2397                    tiDeviceHandle_t          *tiDeviceHandle,
2398                    tiScsiInitiatorRequest_t *tiScsiRequest,
2399                    satIOContext_t            *satIOContext);
2400 
2401 /*****************************************************************************
2402 *! \brief  satReassignBlocksCB
2403 *
2404 *   This routine is a callback function called from ossaSATACompleted().
2405 *   This CB routine deals with Reassign Blocks.
2406 *
2407 *  \param   agRoot:       Handles for this instance of SAS/SATA hardware
2408 *  \param   agIORequest:  Pointer to the LL I/O request context for this I/O.
2409 *  \param   agIOStatus:   Status of completed I/O.
2410 *  \param   agSATAParm1:  Additional info based on status.
2411 *  \param   agIOInfoLen:  Length in bytes of overrun/underrun residual or FIS
2412 *                         length.
2413 *  \param   ioContext:    Pointer to satIOContext_t.
2414 *
2415 *  \return: none
2416 *
2417 *****************************************************************************/
2418 void satReassignBlocksCB(
2419                         agsaRoot_t        *agRoot,
2420                         agsaIORequest_t   *agIORequest,
2421                         bit32             agIOStatus,
2422                         agsaFisHeader_t   *agFirstDword,
2423                         bit32             agIOInfoLen,
2424                         agsaFrameHandle_t agFrameHandle,
2425                         void              *ioContext
2426                         );
2427 
2428 /*****************************************************************************/
2429 /*! \brief SAT implementation for SCSI satReassignBlocks_1.
2430  *
2431  *  SAT implementation for SCSI Reassign Blocks. This is helper function for
2432  *  satReassignBlocks and satReassignBlocksCB. This sends ATA verify command.
2433  *
2434  *  \param   tiRoot:           Pointer to TISA initiator driver/port instance.
2435  *  \param   tiIORequest:      Pointer to TISA I/O request context for this I/O.
2436  *  \param   tiDeviceHandle:   Pointer to TISA device handle for this I/O.
2437  *  \param   tiScsiRequest:    Pointer to TISA SCSI I/O request and SGL list.
2438  *  \param   satIOContext_t:   Pointer to the SAT IO Context
2439  *
2440  *  \return If command is started successfully
2441  *    - \e tiSuccess:     I/O request successfully initiated.
2442  *    - \e tiBusy:        No resources available, try again later.
2443  *    - \e tiIONoDevice:  Invalid device handle.
2444  *    - \e tiError:       Other errors.
2445  */
2446 /*****************************************************************************/
2447 GLOBAL bit32  satReassignBlocks_1(
2448                    tiRoot_t                  *tiRoot,
2449                    tiIORequest_t             *tiIORequest,
2450                    tiDeviceHandle_t          *tiDeviceHandle,
2451                    tiScsiInitiatorRequest_t *tiScsiRequest,
2452                    satIOContext_t            *satIOContext,
2453                    satIOContext_t            *satOrgIOContext);
2454 
2455 /*****************************************************************************/
2456 /*! \brief SAT implementation for SCSI satReassignBlocks_2.
2457  *
2458  *  SAT implementation for SCSI Reassign Blocks. This is helper function for
2459  *  satReassignBlocks and satReassignBlocksCB. This sends ATA write command.
2460  *
2461  *  \param   tiRoot:           Pointer to TISA initiator driver/port instance.
2462  *  \param   tiIORequest:      Pointer to TISA I/O request context for this I/O.
2463  *  \param   tiDeviceHandle:   Pointer to TISA device handle for this I/O.
2464  *  \param   tiScsiRequest:    Pointer to TISA SCSI I/O request and SGL list.
2465  *  \param   satIOContext_t:   Pointer to the SAT IO Context
2466  *  \param   LBA:              Pointer to the LBA to be processed
2467  *
2468  *  \return If command is started successfully
2469  *    - \e tiSuccess:     I/O request successfully initiated.
2470  *    - \e tiBusy:        No resources available, try again later.
2471  *    - \e tiIONoDevice:  Invalid device handle.
2472  *    - \e tiError:       Other errors.
2473  */
2474 /*****************************************************************************/
2475 GLOBAL bit32  satReassignBlocks_2(
2476                    tiRoot_t                  *tiRoot,
2477                    tiIORequest_t             *tiIORequest,
2478                    tiDeviceHandle_t          *tiDeviceHandle,
2479                    tiScsiInitiatorRequest_t *tiScsiRequest,
2480                    satIOContext_t            *satIOContext,
2481                    bit8                      *LBA
2482                    );
2483 
2484 /*****************************************************************************/
2485 /*! \brief SAT implementation for SCSI satPrepareNewIO.
2486  *
2487  *  This function fills in the fields of internal IO generated by TD layer.
2488  *  This is mostly used in the callback functions.
2489  *
2490  *  \param   satNewIntIo:      Pointer to the internal IO structure.
2491  *  \param   tiOrgIORequest:   Pointer to the original tiIOrequest sent by OS layer
2492  *  \param   satDevData:       Pointer to the device data.
2493  *  \param   scsiCmnd:         Pointer to SCSI command.
2494  *  \param   satOrgIOContext:  Pointer to the original SAT IO Context
2495  *
2496  *  \return
2497  *    - \e Pointer to the new SAT IO Context
2498  */
2499 /*****************************************************************************/
2500 GLOBAL satIOContext_t *satPrepareNewIO(
2501                             satInternalIo_t         *satNewIntIo,
2502                             tiIORequest_t           *tiOrgIORequest,
2503                             satDeviceData_t         *satDevData,
2504                             tiIniScsiCmnd_t         *scsiCmnd,
2505                             satIOContext_t          *satOrgIOContext
2506                             );
2507 
2508 /*****************************************************************************
2509  *! \brief  sataLLIOAbort
2510  *
2511  *   This routine is called to initiate an I/O abort to LL layer.
2512  *   This function implements/encapsulates HW and LL API dependency.
2513  *
2514  *  \param   tiRoot:      Pointer to TISA initiator driver/port instance.
2515  *  \param   taskTag:     Pointer to TISA I/O context to be aborted.
2516  *
2517  *  \return:
2518  *
2519  *  \e tiSuccess:     Abort request was successfully initiated.
2520  *  \e tiBusy:        No resources available, try again later.
2521  *  \e tiError:       Other errors that prevent the abort request from being
2522  *                    started..
2523  *
2524  *
2525  *****************************************************************************/
2526 
2527 GLOBAL bit32 sataLLIOAbort (
2528                 tiRoot_t        *tiRoot,
2529                 tiIORequest_t   *taskTag );
2530 
2531 
2532 
2533 void satInquiryCB(
2534                    agsaRoot_t        *agRoot,
2535                    agsaIORequest_t   *agIORequest,
2536                    bit32             agIOStatus,
2537                    agsaFisHeader_t   *agFirstDword,
2538                    bit32             agIOInfoLen,
2539                    agsaFrameHandle_t agFrameHandle,
2540                    void              *ioContext
2541                    );
2542 
2543 void satInquiryIntCB(
2544                    tiRoot_t                  *tiRoot,
2545                    tiIORequest_t             *tiIORequest,
2546                    tiDeviceHandle_t          *tiDeviceHandle,
2547                    tiScsiInitiatorRequest_t *tiScsiRequest,
2548                    satIOContext_t            *satIOContext
2549                    );
2550 
2551 GLOBAL bit32  satSendIDDev(
2552                            tiRoot_t                  *tiRoot,
2553                            tiIORequest_t             *tiIORequest,
2554                            tiDeviceHandle_t          *tiDeviceHandle,
2555                            tiScsiInitiatorRequest_t *tiScsiRequest,
2556                            satIOContext_t            *satIOContext);
2557 
2558 
2559 GLOBAL bit32  satStartIDDev(
2560                             tiRoot_t                  *tiRoot,
2561                             tiIORequest_t             *tiIORequest,
2562                             tiDeviceHandle_t          *tiDeviceHandle,
2563                             tiScsiInitiatorRequest_t *tiScsiRequest,
2564                             satIOContext_t            *satIOContext
2565                             );
2566 
2567 void satSetDevInfo(
2568                    satDeviceData_t           *satDevData,
2569                    agsaSATAIdentifyData_t    *SATAIdData
2570                    );
2571 
2572 GLOBAL bit32  satAddSATAStartIDDev(
2573                                    tiRoot_t                  *tiRoot,
2574                                    tiIORequest_t             *tiIORequest,
2575                                    tiDeviceHandle_t          *tiDeviceHandle,
2576                                    tiScsiInitiatorRequest_t *tiScsiRequest,
2577                                    satIOContext_t            *satIOContext
2578                                   );
2579 
2580 GLOBAL bit32  satAddSATASendIDDev(
2581                                   tiRoot_t                  *tiRoot,
2582                                   tiIORequest_t             *tiIORequest,
2583                                   tiDeviceHandle_t          *tiDeviceHandle,
2584                                   tiScsiInitiatorRequest_t *tiScsiRequest,
2585                                   satIOContext_t            *satIOContext
2586                                  );
2587 
2588 void satAddSATAIDDevCB(
2589                    agsaRoot_t        *agRoot,
2590                    agsaIORequest_t   *agIORequest,
2591                    bit32             agIOStatus,
2592                    agsaFisHeader_t   *agFirstDword,
2593                    bit32             agIOInfoLen,
2594                    agsaFrameHandle_t agFrameHandle,
2595                    void              *ioContext
2596                    );
2597 
2598 void satAddSATAIDDevCBReset(
2599                    agsaRoot_t        *agRoot,
2600                    tdsaDeviceData_t  *oneDeviceData,
2601                    satIOContext_t    *satIOContext,
2602                    tdIORequestBody_t *tdIORequestBody
2603                    );
2604 
2605 void satAddSATAIDDevCBCleanup(
2606                    agsaRoot_t        *agRoot,
2607                    tdsaDeviceData_t  *oneDeviceData,
2608                    satIOContext_t    *satIOContext,
2609                    tdIORequestBody_t *tdIORequestBody
2610                    );
2611 
2612 GLOBAL bit32 tdsaDiscoveryIntStartIDDev(
2613                                    tiRoot_t                  *tiRoot,
2614                                    tiIORequest_t             *tiIORequest,
2615                                    tiDeviceHandle_t          *tiDeviceHandle,
2616                                    tiScsiInitiatorRequest_t *tiScsiRequest,
2617                                    satIOContext_t            *satIOContext
2618                                   );
2619 
2620 GLOBAL bit32 tdsaDiscoverySendIDDev(
2621                                    tiRoot_t                  *tiRoot,
2622                                    tiIORequest_t             *tiIORequest,
2623                                    tiDeviceHandle_t          *tiDeviceHandle,
2624                                    tiScsiInitiatorRequest_t *tiScsiRequest,
2625                                    satIOContext_t            *satIOContext
2626                                   );
2627 
2628 void tdsaDiscoveryStartIDDevCB(
2629                    agsaRoot_t        *agRoot,
2630                    agsaIORequest_t   *agIORequest,
2631                    bit32             agIOStatus,
2632                    agsaFisHeader_t   *agFirstDword,
2633                    bit32             agIOInfoLen,
2634                    agsaFrameHandle_t agFrameHandle,
2635                    void              *ioContext
2636                    );
2637 
2638 
2639 /*
2640   utility functions
2641  */
2642 
2643 bit32 satComputeCDB10LBA(satIOContext_t            *satIOContext);
2644 bit32 satComputeCDB10TL(satIOContext_t            *satIOContext);
2645 bit32 satComputeCDB12LBA(satIOContext_t            *satIOContext);
2646 bit32 satComputeCDB12TL(satIOContext_t            *satIOContext);
2647 bit32 satComputeCDB16LBA(satIOContext_t            *satIOContext);
2648 bit32 satComputeCDB16TL(satIOContext_t            *satIOContext);
2649 bit32 satComputeLoopNum(bit32 a,
2650                         bit32 b);
2651 bit32 satAddNComparebit64(bit8 *a, bit8 *b);
2652 bit32 satAddNComparebit32(bit8 *a, bit8 *b);
2653 bit32 satCompareLBALimitbit(bit8 *lba);
2654 
2655 /*****************************************************************************
2656 *! \brief
2657 *  Purpose: bitwise set
2658 *
2659 *  Parameters:
2660 *   data        - input output buffer
2661 *   index       - bit to set
2662 *
2663 *  Return:
2664 *   none
2665 *
2666 *****************************************************************************/
2667 GLOBAL void
2668 satBitSet(bit8 *data, bit32 index);
2669 
2670 /*****************************************************************************
2671 *! \brief
2672 *  Purpose: bitwise clear
2673 *
2674 *  Parameters:
2675 *   data        - input output buffer
2676 *   index       - bit to clear
2677 *
2678 *  Return:
2679 *   none
2680 *
2681 *****************************************************************************/
2682 GLOBAL void
2683 satBitClear(bit8 *data, bit32 index);
2684 
2685 /*****************************************************************************
2686 *! \brief
2687 *  Purpose: bitwise test
2688 *
2689 *  Parameters:
2690 *   data        - input output buffer
2691 *   index       - bit to test
2692 *
2693 *  Return:
2694 *   0 - not set
2695 *   1 - set
2696 *
2697 *****************************************************************************/
2698 GLOBAL agBOOLEAN
2699 satBitTest(bit8 *data, bit32 index);
2700 
2701 /******************************************************************************/
2702 /*! \brief allocate an available SATA tag
2703  *
2704  *  allocate an available SATA tag
2705  *
2706  *  \param pSatDevData
2707  *  \param pTag
2708  *
2709  *  \return -Success or fail-
2710  */
2711 /*******************************************************************************/
2712 GLOBAL bit32 satTagAlloc(
2713                            tiRoot_t          *tiRoot,
2714                            satDeviceData_t   *pSatDevData,
2715                            bit8              *pTag
2716                            );
2717 
2718 /******************************************************************************/
2719 /*! \brief release an SATA tag
2720  *
2721  *  release an available SATA tag
2722  *
2723  *  \param pSatDevData
2724  *
2725  *  \return -the tag-
2726  */
2727 /*******************************************************************************/
2728 GLOBAL bit32 satTagRelease(
2729                               tiRoot_t          *tiRoot,
2730                               satDeviceData_t   *pSatDevData,
2731                               bit8              tag
2732                               );
2733 
2734 GLOBAL void
2735 satDecrementPendingIO(
2736                       tiRoot_t                *tiRoot,
2737                       tdsaContext_t           *tdsaAllShared,
2738                       satIOContext_t          *satIOContext
2739                       );
2740 
2741 GLOBAL bit32  satStartResetDevice(
2742                             tiRoot_t                  *tiRoot,
2743                             tiIORequest_t             *tiIORequest,
2744                             tiDeviceHandle_t          *tiDeviceHandle,
2745                             tiScsiInitiatorRequest_t *tiScsiRequest,
2746                             satIOContext_t            *satIOContext
2747                             );
2748 
2749 GLOBAL bit32  satResetDevice(
2750                             tiRoot_t                  *tiRoot,
2751                             tiIORequest_t             *tiIORequest,
2752                             tiDeviceHandle_t          *tiDeviceHandle,
2753                             tiScsiInitiatorRequest_t *tiScsiRequest,
2754                             satIOContext_t            *satIOContext
2755                             );
2756 
2757 GLOBAL void satResetDeviceCB(
2758                    agsaRoot_t        *agRoot,
2759                    agsaIORequest_t   *agIORequest,
2760                    bit32             agIOStatus,
2761                    agsaFisHeader_t   *agFirstDword,
2762                    bit32             agIOInfoLen,
2763                    agsaFrameHandle_t agFrameHandle,
2764                    void              *ioContext
2765                    );
2766 
2767 osGLOBAL bit32 satSubTM(
2768                         tiRoot_t          *tiRoot,
2769                         tiDeviceHandle_t  *tiDeviceHandle,
2770                         bit32             task,
2771                         tiLUN_t           *lun,
2772                         tiIORequest_t     *taskTag,
2773                         tiIORequest_t     *currentTaskTag,
2774                         bit32              NotifyOS
2775                         );
2776 
2777 GLOBAL bit32  satStartDeResetDevice(
2778                             tiRoot_t                  *tiRoot,
2779                             tiIORequest_t             *tiIORequest,
2780                             tiDeviceHandle_t          *tiDeviceHandle,
2781                             tiScsiInitiatorRequest_t *tiScsiRequest,
2782                             satIOContext_t            *satIOContext
2783                             );
2784 
2785 GLOBAL bit32  satDeResetDevice(
2786                             tiRoot_t                  *tiRoot,
2787                             tiIORequest_t             *tiIORequest,
2788                             tiDeviceHandle_t          *tiDeviceHandle,
2789                             tiScsiInitiatorRequest_t *tiScsiRequest,
2790                             satIOContext_t            *satIOContext
2791                             );
2792 
2793 
2794 GLOBAL void satDeResetDeviceCB(
2795                    agsaRoot_t        *agRoot,
2796                    agsaIORequest_t   *agIORequest,
2797                    bit32             agIOStatus,
2798                    agsaFisHeader_t   *agFirstDword,
2799                    bit32             agIOInfoLen,
2800                    agsaFrameHandle_t agFrameHandle,
2801                    void              *ioContext
2802                    );
2803 
2804 
2805 GLOBAL bit32  satStartCheckPowerMode(
2806                             tiRoot_t                  *tiRoot,
2807                             tiIORequest_t             *tiIORequest,
2808                             tiDeviceHandle_t          *tiDeviceHandle,
2809                             tiScsiInitiatorRequest_t *tiScsiRequest,
2810                             satIOContext_t            *satIOContext
2811                             );
2812 
2813 GLOBAL bit32  satCheckPowerMode(
2814                             tiRoot_t                  *tiRoot,
2815                             tiIORequest_t             *tiIORequest,
2816                             tiDeviceHandle_t          *tiDeviceHandle,
2817                             tiScsiInitiatorRequest_t *tiScsiRequest,
2818                             satIOContext_t            *satIOContext
2819                             );
2820 
2821 GLOBAL void satCheckPowerModeCB(
2822                    agsaRoot_t        *agRoot,
2823                    agsaIORequest_t   *agIORequest,
2824                    bit32             agIOStatus,
2825                    agsaFisHeader_t   *agFirstDword,
2826                    bit32             agIOInfoLen,
2827                    agsaFrameHandle_t agFrameHandle,
2828                    void              *ioContext
2829                    );
2830 
2831 GLOBAL void satAbort(agsaRoot_t        *agRoot,
2832                      satIOContext_t    *satIOContext
2833                      );
2834 
2835 GLOBAL void satTranslateATAPIErrorsToSCSIErrors(
2836                    bit8   bCommand,
2837                    bit8   bATAStatus,
2838                    bit8   bATAError,
2839                    bit8   *pSenseKey,
2840                    bit16  *pSenseCodeInfo
2841                    );
2842 
2843 osGLOBAL void
2844 satSATADeviceReset(tiRoot_t            *tiRoot,
2845                   tdsaDeviceData_t    *oneDeviceData,
2846                   bit32               flag);
2847 
2848 #ifdef REMOVED
2849 osGLOBAL void
2850 satSATADeviceReset(                                                                                                     tiRoot_t            *tiRoot,
2851                    tdsaDeviceData_t    *oneDeviceData,
2852                    bit32               flag
2853                    );
2854 #endif
2855 #endif  /*__SATPROTO_H__ */
2856