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