xref: /freebsd/sys/dev/pms/RefTisa/tisa/sassata/common/tdproto.h (revision 5ca8e32633c4ffbbcd6762e5888b6a4ba0708c6c)
1 /*******************************************************************************
2 *Copyright (c) 2014 PMC-Sierra, Inc.  All rights reserved.
3 *
4 *Redistribution and use in source and binary forms, with or without modification, are permitted provided
5 *that the following conditions are met:
6 *1. Redistributions of source code must retain the above copyright notice, this list of conditions and the
7 *following disclaimer.
8 *2. Redistributions in binary form must reproduce the above copyright notice,
9 *this list of conditions and the following disclaimer in the documentation and/or other materials provided
10 *with the distribution.
11 *
12 *THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED
13 *WARRANTIES,INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
14 *FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
15 *FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
16 *NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
17 *BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
18 *LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
19 *SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE
20 *
21 *
22 ********************************************************************************/
23 /*******************************************************************************/
24 /** \file
25  *
26  * function definitions used in SAS/SATA TD layer
27  *
28  */
29 
30 #ifndef __TDPROTO_H__
31 #define __TDPROTO_H__
32 
33 #ifdef FDS_DM
34 #include <dev/pms/RefTisa/discovery/api/dm.h>
35 #endif
36 
37 /*****************************************************************************
38 *
39 * SA SHARED PROTOTYPES
40 *
41 *****************************************************************************/
42 
43 osGLOBAL void
44 tdsaQueueConfigInit(
45              tiRoot_t *tiRoot
46              );
47 
48 osGLOBAL void
49 tdsaEsglInit(
50              tiRoot_t *tiRoot
51              );
52 
53 osGLOBAL void
54 tdsaResetComMemFlags(
55                    tiRoot_t *tiRoot
56                    );
57 
58 
59 osGLOBAL void
60 tdsaInitTimerRequest(
61                      tiRoot_t                *tiRoot,
62                      tdsaTimerRequest_t      *timerRequest
63                      );
64 
65 osGLOBAL void
66 tdsaSetTimerRequest(
67                   tiRoot_t            *tiRoot,
68                   tdsaTimerRequest_t  *timerRequest,
69                   bit32               timeout,
70                   tdsaTimerCBFunc_t   CBFunc,
71                   void                *timerData1,
72                   void                *timerData2,
73                   void                *timerData3
74                   );
75 
76 osGLOBAL void
77 tdsaAddTimer (
78               tiRoot_t            *tiRoot,
79               tdList_t            *timerListHdr,
80               tdsaTimerRequest_t  *timerRequest
81              );
82 
83 osGLOBAL void
84 tdsaKillTimer(
85               tiRoot_t            *tiRoot,
86               tdsaTimerRequest_t  *timerRequest
87               );
88 
89 
90 
91 
92 
93 osGLOBAL void
94 tdsaLoLevelGetResource (
95                         tiRoot_t              * tiRoot,
96                         tiLoLevelResource_t   * loResource
97                         );
98 
99 osGLOBAL void
100 tdsaSharedMemCalculate (
101                         tiRoot_t              * tiRoot,
102                         tiLoLevelResource_t   * loResource,
103                         tiTdSharedMem_t       * tdSharedMem
104                         );
105 
106 osGLOBAL void
107 tdsaGetEsglPagesInfo(
108                      tiRoot_t *tiRoot,
109                      bit32    *PageSize,
110                      bit32    *NumPages
111                      );
112 
113 osGLOBAL void
114 tdsaGetPortParams(
115                   tiRoot_t *tiRoot
116                   );
117 
118 
119 
120 osGLOBAL void
121 tdsaGetSwConfigParams(
122                       tiRoot_t *tiRoot
123                       );
124 
125 osGLOBAL void
126 tdsaGetHwConfigParams(
127                       tiRoot_t *tiRoot
128                       );
129 
130 osGLOBAL void
131 tdsaGetCardPhyParams(
132                        tiRoot_t *tiRoot
133                        );
134 
135 
136 osGLOBAL void
137 tdsaGetGlobalPhyParams(
138                        tiRoot_t *tiRoot
139                        );
140 
141 osGLOBAL bit32
142 tdsaGetCardIDString(
143                     tiRoot_t *tiRoot
144                     );
145 
146 osGLOBAL void
147 tdsaParseLinkRateMode(
148                       tiRoot_t *tiRoot,
149                       bit32 index,
150                       bit32 LinkRateRead,
151                       bit32 ModeRead,
152                       bit32 OpticalModeRead,
153                       bit32 LinkRate,
154                       bit32 Mode,
155                       bit32 OpticalMode
156                       );
157 
158 osGLOBAL void
159 tdsaInitTimers(
160                tiRoot_t *tiRoot
161                );
162 
163 osGLOBAL void
164 tdsaProcessTimers(
165                   tiRoot_t *tiRoot
166                   );
167 
168 osGLOBAL void
169 tdsaInitTimerHandler(
170                      tiRoot_t  *tiRoot,
171                      void      *timerData
172                      );
173 
174 osGLOBAL void
175 tdsaGetEsglPages(
176                  tiRoot_t *tiRoot,
177                  tdList_t *EsglListHdr,
178                  tiSgl_t  *ptiSgl,
179                  tiSgl_t  *virtSgl
180                  );
181 
182 osGLOBAL void
183 tdsaFreeEsglPages(
184                   tiRoot_t *tiRoot,
185                   tdList_t *EsglListHdr
186                   );
187 
188 osGLOBAL void
189 tdssGetMaxTargetsParams(
190                       tiRoot_t                *tiRoot,
191                       bit32                   *pMaxTargets
192                       );
193 
194 osGLOBAL void
195 tdssGetSATAOnlyModeParams(
196                       tiRoot_t                *tiRoot,
197                       bit32                   *pMaxTargets
198                       );
199 
200 osGLOBAL bit32
201 tdipFWControlIoctl(
202                    tiRoot_t            *tiRoot,
203                    tiIOCTLPayload_t    *agIOCTLPayload,
204                    void                *agParam1,
205                    void                *agParam2,
206                    void                *agParam3
207                    );
208 
209 osGLOBAL bit32
210 tdsaVPDGetIoctl(
211                 tiRoot_t            *tiRoot,
212                 tiIOCTLPayload_t    *agIOCTLPayload,
213                 void                *agParam1,
214                 void                *agParam2,
215                 void                *agParam3
216                 );
217 
218 osGLOBAL bit32
219 tdsaVPDSetIoctl(
220                 tiRoot_t            *tiRoot,
221                 tiIOCTLPayload_t    *agIOCTLPayload,
222                 void                *agParam1,
223                 void                *agParam2,
224                 void                *agParam3
225                 );
226 
227 osGLOBAL void
228 ostiCOMMgntVPDSetIOCTLRsp(
229                           tiRoot_t            *tiRoot,
230                           bit32               status
231                           );
232 
233 osGLOBAL void
234 tdsaFreeCardID(tiRoot_t *tiRoot,
235                bit32    CardID
236                );
237 
238 
239 osGLOBAL bit32
240 tdsaAbortAll(
241              tiRoot_t                   *tiRoot,
242              agsaRoot_t                 *agRoot,
243              tdsaDeviceData_t           *oneDeviceData
244              );
245 
246 osGLOBAL bit32
247 tdsaFindLocalMCN(
248                  tiRoot_t                   *tiRoot,
249                  tdsaPortContext_t          *onePortContext
250                 );
251 
252 osGLOBAL bit32
253 tdsaRegDumpGetIoctl(
254                 tiRoot_t            *tiRoot,
255                 tiIOCTLPayload_t    *agIOCTLPayload,
256                 void                *agParam1,
257                 void                *agParam2,
258                 void                *agParam3
259                 );
260 
261 osGLOBAL bit32
262 tdsaNVMDSetIoctl(
263                 tiRoot_t            *tiRoot,
264                 tiIOCTLPayload_t    *agIOCTLPayload,
265                 void                *agParam1,
266                 void                *agParam2,
267                 void                *agParam3
268                 );
269 
270 osGLOBAL bit32
271 tdsaNVMDGetIoctl(
272                 tiRoot_t            *tiRoot,
273                 tiIOCTLPayload_t    *agIOCTLPayload,
274                 void                *agParam1,
275                 void                *agParam2,
276                 void                *agParam3
277                 );
278 
279 osGLOBAL void ostiGetGpioIOCTLRsp(
280 		tiRoot_t	       *tiRoot,
281 		bit32		       status,
282 		bit32		       gpioReadValue,
283 		agsaGpioPinSetupInfo_t *gpioPinSetupInfo,
284 		agsaGpioEventSetupInfo_t *gpioEventSetupInfo
285 		);
286 
287 osGLOBAL bit32
288 tdsaGpioSetup(
289 		tiRoot_t		*tiRoot,
290 		agsaContext_t		*agContext,
291 		tiIOCTLPayload_t	*agIOCTLPayload,
292 		void			*agParam1,
293 		void			*agParam2
294 		);
295 
296 
297 osGLOBAL bit32
298 tdsaSGpioIoctlSetup(
299                     tiRoot_t            *tiRoot,
300                     agsaContext_t       *agContext,
301                     tiIOCTLPayload_t    *agIOCTLPayload,
302                     void                *agParam1,
303                     void                *agParam2
304                     );
305 
306 osGLOBAL void ostiSgpioIoctlRsp(
307                                 tiRoot_t                *tiRoot,
308                                 agsaSGpioReqResponse_t  *pSgpioResponse
309                                 );
310 osGLOBAL bit32
311 tdsaDeviceInfoGetIoctl(
312                 tiRoot_t            *tiRoot,
313                 tiIOCTLPayload_t    *agIOCTLPayload,
314                 void                *agParam1,
315                 void                *agParam2,
316                 void                *agParam3
317                 );
318 
319 osGLOBAL bit32
320 tdsaIoErrorStatisticGetIoctl(
321                  tiRoot_t            *tiRoot,
322                  tiIOCTLPayload_t    *agIOCTLPayload,
323                  void                *agParam1,
324                  void                *agParam2,
325                  void                *agParam3
326                  );
327 
328 osGLOBAL bit32
329 tdsaIoEventStatisticGetIoctl(
330                  tiRoot_t            *tiRoot,
331                  tiIOCTLPayload_t    *agIOCTLPayload,
332                  void                *agParam1,
333                  void                *agParam2,
334                  void                *agParam3
335                  );
336 
337 osGLOBAL bit32
338 tdsaForensicDataGetIoctl(
339                  tiRoot_t            *tiRoot,
340                  tiIOCTLPayload_t    *agIOCTLPayload,
341                  void                *agParam1,
342                  void                *agParam2,
343                  void                *agParam3
344                  );
345 
346 osGLOBAL bit32
347 tdsaSendSMPIoctl(
348                 tiRoot_t            *tiRoot,
349                 tiIOCTLPayload_t    *agIOCTLPayload,
350                 void                *agParam1,
351                 void                *agParam2,
352                 void                *agParam3
353                 );
354 
355 osGLOBAL bit32
356 tdsaSendBISTIoctl(
357                  tiRoot_t            *tiRoot,
358                  tiIOCTLPayload_t    *agIOCTLPayload,
359                  void                *agParam1,
360                  void                *agParam2,
361                  void                *agParam3
362                  );
363 
364 osGLOBAL bit32
365 tdsaSendTMFIoctl(
366 		tiRoot_t	*tiRoot,
367 		tiIOCTLPayload_t *agIOCTLPayload,
368 		void		*agParam1,
369 		void		*agParam2,
370 		unsigned long	resetType
371 	       );
372 
373 
374 osGLOBAL bit32
375 tdsaRegisterIoctl(
376                  tiRoot_t            *tiRoot,
377                  tiIOCTLPayload_t    *agIOCTLPayload,
378                  void                *agParam1,
379                  void                *agParam2,
380                  void                *agParam3
381                  );
382 
383 osGLOBAL bit32
384 tdsaGetPhyGeneralStatusIoctl(
385 	                tiRoot_t                  *tiRoot,
386 	                agsaPhyGeneralState_t     *PhyData
387 	                );
388 
389 osGLOBAL void ostiGetPhyGeneralStatusRsp(
390 									tiRoot_t				      *tiRoot,
391                                     agsaSASPhyGeneralStatusPage_t *GenStatus,
392                                     bit32                          phyID
393 									);
394 
395 
396 osGLOBAL bit32
397 tdsaPhyProfileIoctl(
398                  tiRoot_t            *tiRoot,
399                  tiIOCTLPayload_t    *agIOCTLPayload,
400                  void                *agParam1,
401                  void                *agParam2,
402                  void                *agParam3
403                  );
404 
405 osGLOBAL void
406 tdsaDeregisterDevicesInPort(
407                 tiRoot_t             *tiRoot,
408                 tdsaPortContext_t    *onePortContext
409                );
410 
411 #ifdef VPD_TESTING
412 osGLOBAL bit32
413 tdsaVPDGet(
414                 tiRoot_t            *tiRoot
415                 );
416 
417 osGLOBAL bit32
418 tdsaVPDSet(
419                 tiRoot_t            *tiRoot
420                 );
421 
422 #endif
423 
424 /*****************************************************************************
425 *
426 * SAS SHARED PROTOTYPES
427 *
428 *****************************************************************************/
429 osGLOBAL void
430 tdsaJumpTableInit(
431                   tiRoot_t *tiRoot
432                   );
433 
434 osGLOBAL void
435 tdsaPortContextInit(
436                     tiRoot_t *tiRoot
437                     );
438 
439 osGLOBAL void
440 tdsaPortContextReInit(
441                       tiRoot_t             *tiRoot,
442                       tdsaPortContext_t    *onePortContext
443                     );
444 
445 osGLOBAL void
446 tdsaDeviceDataInit(
447                    tiRoot_t *tiRoot
448                    );
449 
450 osGLOBAL void
451 tdsaDeviceDataReInit(
452                    tiRoot_t             *tiRoot,
453                    tdsaDeviceData_t     *oneDeviceData
454                    );
455 
456 #ifdef TD_INT_COALESCE
457 osGLOBAL void
458 tdsaIntCoalCxtInit(
459                     tiRoot_t *tiRoot
460                     );
461 #endif
462 
463 osGLOBAL FORCEINLINE bit32
464 tdsaRotateQnumber(tiRoot_t                *tiRoot,
465                   tdsaDeviceData_t        *oneDeviceData);
466 
467 osGLOBAL bit32
468 tdsaRotateQnumber1(tiRoot_t                *tiRoot,
469                   tdsaDeviceData_t        *oneDeviceData );
470 osGLOBAL void
471 tdssRemoveSASSATAFromSharedcontext(
472                           agsaRoot_t           *agRoot,
473                           tdsaPortContext_t    *PortContext_Instance
474                           );
475 osGLOBAL void
476 tdssRemoveSASSATAFromSharedcontextByReset(
477                           agsaRoot_t           *agRoot
478                           );
479 osGLOBAL bit32
480 tdssSASFindDiscoveringExpander(
481                           tiRoot_t                 *tiRoot,
482                           tdsaPortContext_t        *onePortContext,
483                           tdsaExpander_t           *oneExpander
484                           );
485 
486 osGLOBAL void
487 tdssAddSASToSharedcontext(
488                           tdsaPortContext_t    *tdsaPortContext_Instance,
489                           agsaRoot_t           *agRoot,
490                           agsaDevHandle_t      *agDevHandle,
491                           tdsaSASSubID_t       *agSASSubID,
492                           bit32                registered,
493                           bit8                 phyID,
494                           bit32                flag
495                           );
496 
497 osGLOBAL void
498 tdssRemoveSASFromSharedcontext(
499                                tdsaPortContext_t *tdsaPortContext_Ins,
500                                tdsaDeviceData_t  *tdsaDeviceData_ins,
501                                agsaRoot_t        *agRoot
502                                );
503 
504 osGLOBAL void
505 tdssRemoveAllDevicelistFromPortcontext(
506                                        tdsaPortContext_t *PortContext_Ins,
507                                        agsaRoot_t        *agRoot
508                                        );
509 
510 osGLOBAL void
511 tdssAddSATAToSharedcontext( tdsaPortContext_t    *tdsaPortContext_Instance,
512                             agsaRoot_t           *agRoot,
513                             agsaDevHandle_t      *agDevHandle,
514                             agsaSATADeviceInfo_t *agSATADeviceInfo,
515                             bit32                 registered,
516                             bit8                  phyID
517                             );
518 
519 osGLOBAL void
520 tdssSubAddSATAToSharedcontext( tiRoot_t             *tiRoot,
521                                tdsaDeviceData_t     *oneDeviceData
522                               );
523 
524 osGLOBAL void
525 tdssRetrySATAID( tiRoot_t             *tiRoot,
526                  tdsaDeviceData_t     *oneDeviceData
527                );
528 
529 osGLOBAL void
530 tdssInitSASPortStartInfo(
531                          tiRoot_t *tiRoot
532                          );
533 #ifndef ossaDeviceRegistrationCB
534 osGLOBAL void
535 ossaDeviceRegistrationCB(
536                          agsaRoot_t        *agRoot,
537                          agsaContext_t     *agContext,
538                          bit32             status,
539                          agsaDevHandle_t   *agDevHandle,
540                          bit32                   deviceID);
541 #endif
542 
543 #ifndef ossaDeregisterDeviceHandleCB
544 osGLOBAL void
545 ossaDeregisterDeviceHandleCB(
546                              agsaRoot_t          *agRoot,
547                              agsaContext_t       *agContext,
548                              agsaDevHandle_t     *agDevHandle,
549                              bit32               status
550                              );
551 #endif
552 
553 #ifdef INITIATOR_DRIVER
554 /*****************************************************************************
555 *
556 * SAS Initiator only PROTOTYPES
557 *
558 *****************************************************************************/
559 osGLOBAL bit32
560 itdssInit(
561           tiRoot_t              *tiRoot,
562           tiInitiatorResource_t *initiatorResource,
563           tiTdSharedMem_t       *tdSharedMem
564           );
565 
566 osGLOBAL void
567 itdssInitTimers (
568                  tiRoot_t *tiRoot
569                  );
570 
571 osGLOBAL FORCEINLINE void
572 itdssIOCompleted(
573                  agsaRoot_t             *agRoot,
574                  agsaIORequest_t        *agIORequest,
575                  bit32                  agIOStatus,
576                  bit32                  agIOInfoLen,
577                  void                   *agParam,
578                  bit32                  agOtherInfo
579                  );
580 
581 osGLOBAL void
582 itdssTaskCompleted(
583                    agsaRoot_t             *agRoot,
584                    agsaIORequest_t        *agIORequest,
585                    bit32                  agIOStatus,
586                    bit32                  agIOInfoLen,
587                    void                   *agParam,
588                    bit32                  agOtherInfo
589                    );
590 
591 osGLOBAL void
592 itdssQueryTaskCompleted(
593                         agsaRoot_t             *agRoot,
594                         agsaIORequest_t        *agIORequest,
595                         bit32                  agIOStatus,
596                         bit32                  agIOInfoLen,
597                         void                   *agParam,
598                         bit32                  agOtherInfo
599                         );
600 
601 osGLOBAL void
602 itdssSMPCompleted (
603                    agsaRoot_t            *agRoot,
604                    agsaIORequest_t       *agIORequest,
605                    bit32                 agIOStatus,
606                    bit32                 agIOInfoLen,
607                    agsaFrameHandle_t     agFrameHandle
608                    );
609 
610 osGLOBAL void
611 ossaSMPCAMCompleted(
612                     agsaRoot_t            *agRoot,
613                     agsaIORequest_t       *agIORequest,
614                     bit32                 agIOStatus,
615                     bit32                 agIOInfoLen,
616                     agsaFrameHandle_t     agFrameHandle
617                    );
618 
619 osGLOBAL void
620 itdssIOSuccessHandler(
621                       agsaRoot_t           *agRoot,
622                       agsaIORequest_t      *agIORequest,
623                       bit32                agIOStatus,
624                       bit32                agIOInfoLen,
625                       void                 *agParam,
626                       bit32                 agOtherInfo
627                       );
628 osGLOBAL void
629 itdssIOAbortedHandler(
630                       agsaRoot_t           *agRoot,
631                       agsaIORequest_t      *agIORequest,
632                       bit32                agIOStatus,
633                       bit32                agIOInfoLen,
634                       void                 *agParam,
635                       bit32                agOtherInfo
636                       );
637 
638 #ifdef REMOVED
639 osGLOBAL void
640 itdssIOOverFlowHandler(
641                        agsaRoot_t           *agRoot,
642                        agsaIORequest_t      *agIORequest,
643                        bit32                 agIOStatus,
644                        bit32                 agIOInfoLen,
645                        void                 *agParam
646                        );
647 #endif
648 
649 osGLOBAL void
650 itdssIOUnderFlowHandler(
651                         agsaRoot_t           *agRoot,
652                         agsaIORequest_t      *agIORequest,
653                         bit32                agIOStatus,
654                         bit32                agIOInfoLen,
655                         void                 *agParam,
656                         bit32                agOtherInfo
657                         );
658 
659 osGLOBAL void
660 itdssIOFailedHandler(
661                      agsaRoot_t           *agRoot,
662                      agsaIORequest_t      *agIORequest,
663                      bit32                agIOStatus,
664                      bit32                agIOInfoLen,
665                      void                 *agParam,
666                      bit32                agOtherInfo
667                      );
668 
669 osGLOBAL void
670 itdssIOAbortResetHandler(
671                          agsaRoot_t           *agRoot,
672                          agsaIORequest_t      *agIORequest,
673                          bit32                agIOStatus,
674                          bit32                agIOInfoLen,
675                          void                 *agParam,
676                          bit32                agOtherInfo
677                          );
678 osGLOBAL void
679 itdssIONotValidHandler(
680                        agsaRoot_t               *agRoot,
681                        agsaIORequest_t          *agIORequest,
682                        bit32                    agIOStatus,
683                        bit32                    agIOInfoLen,
684                        void                     *agParam,
685                        bit32                    agOtherInfo
686                        );
687 
688 osGLOBAL void
689 itdssIONoDeviceHandler(
690                        agsaRoot_t           *agRoot,
691                        agsaIORequest_t      *agIORequest,
692                        bit32                agIOStatus,
693                        bit32                agIOInfoLen,
694                        void                 *agParam,
695                        bit32                agOtherInfo
696                        );
697 
698 #ifdef REMOVED /* removed from spec */
699 osGLOBAL void
700 itdssIllegalParameterHandler(
701                        agsaRoot_t           *agRoot,
702                        agsaIORequest_t      *agIORequest,
703                        bit32                agIOStatus,
704                        bit32                agIOInfoLen,
705                        void                 *agParam
706                        );
707 #endif
708 
709 osGLOBAL void
710 itdssLinkFailureHandler(
711                        agsaRoot_t           *agRoot,
712                        agsaIORequest_t      *agIORequest,
713                        bit32                agIOStatus,
714                        bit32                agIOInfoLen,
715                        void                 *agParam,
716                        bit32                agOtherInfo
717                        );
718 osGLOBAL void
719 itdssProgErrorHandler(
720                        agsaRoot_t           *agRoot,
721                        agsaIORequest_t      *agIORequest,
722                        bit32                agIOStatus,
723                        bit32                agIOInfoLen,
724                        void                 *agParam,
725                        bit32                agOtherInfo
726                        );
727 osGLOBAL void
728 itdssXferErrorBreakHandler(
729                        agsaRoot_t           *agRoot,
730                        agsaIORequest_t      *agIORequest,
731                        bit32                agIOStatus,
732                        bit32                agIOInfoLen,
733                        void                 *agParam,
734                        bit32                agOtherInfo
735                        );
736 osGLOBAL void
737 itdssXferErrorPhyNotReadyHandler(
738                        agsaRoot_t           *agRoot,
739                        agsaIORequest_t      *agIORequest,
740                        bit32                agIOStatus,
741                        bit32                agIOInfoLen,
742                        void                 *agParam,
743                        bit32                agOtherInfo
744                        );
745 osGLOBAL void
746 itdssOpenCnxErrorProtocolNotSupprotedHandler(
747                        agsaRoot_t           *agRoot,
748                        agsaIORequest_t      *agIORequest,
749                        bit32                agIOStatus,
750                        bit32                agIOInfoLen,
751                        void                 *agParam,
752                        bit32                agOtherInfo
753                        );
754 osGLOBAL void
755 itdssOpenCnxErrorZoneViolationHandler(
756                        agsaRoot_t           *agRoot,
757                        agsaIORequest_t      *agIORequest,
758                        bit32                agIOStatus,
759                        bit32                agIOInfoLen,
760                        void                 *agParam,
761                        bit32                agOtherInfo
762                        );
763 osGLOBAL void
764 itdssOpenCnxErrorBreakHandler(
765                        agsaRoot_t           *agRoot,
766                        agsaIORequest_t      *agIORequest,
767                        bit32                agIOStatus,
768                        bit32                agIOInfoLen,
769                        void                 *agParam,
770                        bit32                agOtherInfo
771                        );
772 osGLOBAL void
773 itdssOpenCnxErrorITNexusLossHandler(
774                        agsaRoot_t           *agRoot,
775                        agsaIORequest_t      *agIORequest,
776                        bit32                agIOStatus,
777                        bit32                agIOInfoLen,
778                        void                 *agParam,
779                        bit32                agOtherInfo
780                        );
781 osGLOBAL void
782 itdssOpenCnxErrorBadDestinationHandler(
783                        agsaRoot_t           *agRoot,
784                        agsaIORequest_t      *agIORequest,
785                        bit32                agIOStatus,
786                        bit32                agIOInfoLen,
787                        void                 *agParam,
788                        bit32                agOtherInfo
789                        );
790 osGLOBAL void
791 itdssOpenCnxErrorConnectionRateNotSupportedHandler(
792                        agsaRoot_t           *agRoot,
793                        agsaIORequest_t      *agIORequest,
794                        bit32                agIOStatus,
795                        bit32                agIOInfoLen,
796                        void                 *agParam,
797                        bit32                agOtherInfo
798                        );
799 
800 osGLOBAL void
801 itdssOpenCnxErrorSTPResourceBusyHandler(
802                        agsaRoot_t           *agRoot,
803                        agsaIORequest_t      *agIORequest,
804                        bit32                agIOStatus,
805                        bit32                agIOInfoLen,
806                        void                 *agParam,
807                        bit32                agOtherInfo
808                        );
809 osGLOBAL void
810 itdssOpenCnxErrorWrongDestinationHandler(
811                        agsaRoot_t           *agRoot,
812                        agsaIORequest_t      *agIORequest,
813                        bit32                agIOStatus,
814                        bit32                agIOInfoLen,
815                        void                 *agParam,
816                        bit32                agOtherInfo
817                        );
818 osGLOBAL void
819 itdssOpenCnxErrorUnknownErrorHandler(
820                        agsaRoot_t           *agRoot,
821                        agsaIORequest_t      *agIORequest,
822                        bit32                agIOStatus,
823                        bit32                agIOInfoLen,
824                        void                 *agParam,
825                        bit32                agOtherInfo
826                        );
827 osGLOBAL void
828 itdssXferErrorNAKReceivedHandler(
829                        agsaRoot_t           *agRoot,
830                        agsaIORequest_t      *agIORequest,
831                        bit32                agIOStatus,
832                        bit32                agIOInfoLen,
833                        void                 *agParam,
834                        bit32                agOtherInfo
835                        );
836 osGLOBAL void
837 itdssXferErrorACKNAKTimeoutHandler(
838                        agsaRoot_t           *agRoot,
839                        agsaIORequest_t      *agIORequest,
840                        bit32                agIOStatus,
841                        bit32                agIOInfoLen,
842                        void                 *agParam,
843                        bit32                agOtherInfo
844                        );
845 osGLOBAL void
846 itdssXferErrorPeerAbortedHandler(
847                        agsaRoot_t           *agRoot,
848                        agsaIORequest_t      *agIORequest,
849                        bit32                agIOStatus,
850                        bit32                agIOInfoLen,
851                        void                 *agParam,
852                        bit32                agOtherInfo
853                        );
854 osGLOBAL void
855 itdssXferErrorRxFrameHandler(
856                        agsaRoot_t           *agRoot,
857                        agsaIORequest_t      *agIORequest,
858                        bit32                agIOStatus,
859                        bit32                agIOInfoLen,
860                        void                 *agParam,
861                        bit32                agOtherInfo
862                        );
863 osGLOBAL void
864 itdssXferErrorDMAHandler(
865                        agsaRoot_t           *agRoot,
866                        agsaIORequest_t      *agIORequest,
867                        bit32                agIOStatus,
868                        bit32                agIOInfoLen,
869                        void                 *agParam,
870                        bit32                agOtherInfo
871                        );
872 osGLOBAL void
873 itdssXferErrorCreditTimeoutHandler(
874                        agsaRoot_t           *agRoot,
875                        agsaIORequest_t      *agIORequest,
876                        bit32                agIOStatus,
877                        bit32                agIOInfoLen,
878                        void                 *agParam,
879                        bit32                agOtherInfo
880                        );
881 
882 osGLOBAL void
883 itdssXferErrorCMDIssueACKNAKTimeoutHandler(
884                        agsaRoot_t           *agRoot,
885                        agsaIORequest_t      *agIORequest,
886                        bit32                agIOStatus,
887                        bit32                agIOInfoLen,
888                        void                 *agParam,
889                        bit32                agOtherInfo
890                        );
891 osGLOBAL void
892 itdssXferErrorCMDIssueBreakBeforeACKNAKHandler(
893                        agsaRoot_t           *agRoot,
894                        agsaIORequest_t      *agIORequest,
895                        bit32                agIOStatus,
896                        bit32                agIOInfoLen,
897                        void                 *agParam,
898                        bit32                agOtherInfo
899                        );
900 osGLOBAL void
901 itdssXferErrorCMDIssuePhyDownBeforeACKNAKHandler(
902                        agsaRoot_t           *agRoot,
903                        agsaIORequest_t      *agIORequest,
904                        bit32                agIOStatus,
905                        bit32                agIOInfoLen,
906                        void                 *agParam,
907                        bit32                agOtherInfo
908                        );
909 osGLOBAL void
910 itdssXferErrorDisruptedPhyDownHandler(
911                        agsaRoot_t           *agRoot,
912                        agsaIORequest_t      *agIORequest,
913                        bit32                agIOStatus,
914                        bit32                agIOInfoLen,
915                        void                 *agParam,
916                        bit32                agOtherInfo
917                        );
918 osGLOBAL void
919 itdssXferErrorOffsetMismatchHandler(
920                        agsaRoot_t           *agRoot,
921                        agsaIORequest_t      *agIORequest,
922                        bit32                agIOStatus,
923                        bit32                agIOInfoLen,
924                        void                 *agParam,
925                        bit32                agOtherInfo
926                        );
927 osGLOBAL void
928 itdssXferErrorXferZeroDataLenHandler(
929                        agsaRoot_t           *agRoot,
930                        agsaIORequest_t      *agIORequest,
931                        bit32                agIOStatus,
932                        bit32                agIOInfoLen,
933                        void                 *agParam,
934                        bit32                agOtherInfo
935                        );
936 
937 osGLOBAL void
938 itdssXferOpenRetryTimeoutHandler(
939                        agsaRoot_t           *agRoot,
940                        agsaIORequest_t      *agIORequest,
941                        bit32                agIOStatus,
942                        bit32                agIOInfoLen,
943                        void                 *agParam,
944                        bit32                agOtherInfo
945                        );
946 
947 osGLOBAL void
948 itdssPortInResetHandler(
949                        agsaRoot_t           *agRoot,
950                        agsaIORequest_t      *agIORequest,
951                        bit32                agIOStatus,
952                        bit32                agIOInfoLen,
953                        void                 *agParam,
954                        bit32                agOtherInfo
955                        );
956 
957 osGLOBAL void
958 itdssDsNonOperationalHandler(
959                        agsaRoot_t           *agRoot,
960                        agsaIORequest_t      *agIORequest,
961                        bit32                agIOStatus,
962                        bit32                agIOInfoLen,
963                        void                 *agParam,
964                        bit32                agOtherInfo
965                        );
966 osGLOBAL void
967 itdssDsInRecoveryHandler(
968                        agsaRoot_t           *agRoot,
969                        agsaIORequest_t      *agIORequest,
970                        bit32                agIOStatus,
971                        bit32                agIOInfoLen,
972                        void                 *agParam,
973                        bit32                agOtherInfo
974                        );
975 osGLOBAL void
976 itdssTmTagNotFoundHandler(
977                        agsaRoot_t           *agRoot,
978                        agsaIORequest_t      *agIORequest,
979                        bit32                agIOStatus,
980                        bit32                agIOInfoLen,
981                        void                 *agParam,
982                        bit32                agOtherInfo
983                        );
984 osGLOBAL void
985 itdssSSPExtIUZeroLenHandler(
986                        agsaRoot_t           *agRoot,
987                        agsaIORequest_t      *agIORequest,
988                        bit32                agIOStatus,
989                        bit32                agIOInfoLen,
990                        void                 *agParam,
991                        bit32                agOtherInfo
992                        );
993 osGLOBAL void
994 itdssXferErrorUnexpectedPhaseHandler(
995                        agsaRoot_t           *agRoot,
996                        agsaIORequest_t      *agIORequest,
997                        bit32                agIOStatus,
998                        bit32                agIOInfoLen,
999                        void                 *agParam,
1000                        bit32                agOtherInfo
1001                        );
1002 
1003 #ifdef REMOVED
1004 osGLOBAL void
1005 itdssIOUnderFlowWithChkConditionHandler(
1006                        agsaRoot_t           *agRoot,
1007                        agsaIORequest_t      *agIORequest,
1008                        bit32                agIOStatus,
1009                        bit32                agIOInfoLen,
1010                        void                 *agParam
1011                        );
1012 #endif
1013 
1014 osGLOBAL void
1015 itdssEncryptionHandler (
1016                        agsaRoot_t              *agRoot,
1017                        agsaIORequest_t         *agIORequest,
1018                        bit32                   agIOStatus,
1019                        bit32                   agIOInfoLen,
1020                        void                    *agParam,
1021                        bit32                   agOtherInfo
1022                        );
1023 
1024 osGLOBAL void
1025 itdssXferOpenRetryBackoffThresholdReachedHandler(
1026                                                  agsaRoot_t           *agRoot,
1027                                                  agsaIORequest_t      *agIORequest,
1028                                                  bit32                agIOStatus,
1029                                                  bit32                agIOInfoLen,
1030                                                  void                 *agParam,
1031                                                  bit32                agOtherInfo
1032                                                 );
1033 
1034 osGLOBAL void
1035 itdssOpenCnxErrorItNexusLossOpenTmoHandler(
1036                                            agsaRoot_t           *agRoot,
1037                                            agsaIORequest_t      *agIORequest,
1038                                            bit32                agIOStatus,
1039                                            bit32                agIOInfoLen,
1040                                            void                 *agParam,
1041                                            bit32                agOtherInfo
1042                                           );
1043 osGLOBAL void
1044 itdssOpenCnxErrorItNexusLossNoDestHandler(
1045                                           agsaRoot_t           *agRoot,
1046                                           agsaIORequest_t      *agIORequest,
1047                                           bit32                agIOStatus,
1048                                           bit32                agIOInfoLen,
1049                                           void                 *agParam,
1050                                           bit32                agOtherInfo
1051                                          );
1052 osGLOBAL void
1053 itdssOpenCnxErrorItNexusLossOpenCollideHandler(
1054                                                agsaRoot_t           *agRoot,
1055                                                agsaIORequest_t      *agIORequest,
1056                                                bit32                agIOStatus,
1057                                                bit32                agIOInfoLen,
1058                                                void                 *agParam,
1059                                                bit32                agOtherInfo
1060                                               );
1061 osGLOBAL void
1062 itdssOpenCnxErrorItNexusLossOpenPathwayBlockedHandler(
1063                                                       agsaRoot_t           *agRoot,
1064                                                       agsaIORequest_t      *agIORequest,
1065                                                       bit32                agIOStatus,
1066                                                       bit32                agIOInfoLen,
1067                                                       void                 *agParam,
1068                                                       bit32                agOtherInfo
1069                                                      );
1070 osGLOBAL void
1071 itdssDifHandler(
1072                 agsaRoot_t           *agRoot,
1073                 agsaIORequest_t      *agIORequest,
1074                 bit32                agIOStatus,
1075                 bit32                agIOInfoLen,
1076                 void                 *agParam,
1077                 bit32                agOtherInfo
1078                );
1079 
1080 osGLOBAL void
1081 itdssIOResourceUnavailableHandler(
1082                                   agsaRoot_t              *agRoot,
1083                                   agsaIORequest_t         *agIORequest,
1084                                   bit32                   agIOStatus,
1085                                   bit32                   agIOInfoLen,
1086                                   void                    *agParam,
1087                                   bit32                   agOtherInfo
1088                                  );
1089 
1090 osGLOBAL void
1091 itdssIORQEBusyFullHandler(
1092                                   agsaRoot_t              *agRoot,
1093                                   agsaIORequest_t         *agIORequest,
1094                                   bit32                   agIOStatus,
1095                                   bit32                   agIOInfoLen,
1096                                   void                    *agParam,
1097                                   bit32                   agOtherInfo
1098                                  );
1099 
1100 osGLOBAL void
1101 itdssXferErrorInvalidSSPRspFrameHandler(
1102                                   agsaRoot_t              *agRoot,
1103                                   agsaIORequest_t         *agIORequest,
1104                                   bit32                   agIOStatus,
1105                                   bit32                   agIOInfoLen,
1106                                   void                    *agParam,
1107                                   bit32                   agOtherInfo
1108                                  );
1109 
1110 osGLOBAL void
1111 itdssXferErrorEOBDataOverrunHandler(
1112                                   agsaRoot_t              *agRoot,
1113                                   agsaIORequest_t         *agIORequest,
1114                                   bit32                   agIOStatus,
1115                                   bit32                   agIOInfoLen,
1116                                   void                    *agParam,
1117                                   bit32                   agOtherInfo
1118                                  );
1119 
1120 osGLOBAL void
1121 itdssOpenCnxErrorOpenPreemptedHandler(
1122                                   agsaRoot_t              *agRoot,
1123                                   agsaIORequest_t         *agIORequest,
1124                                   bit32                   agIOStatus,
1125                                   bit32                   agIOInfoLen,
1126                                   void                    *agParam,
1127                                   bit32                   agOtherInfo
1128                                  );
1129 
1130 /* default handler */
1131 osGLOBAL void
1132 itdssIODefaultHandler (
1133                        agsaRoot_t           *agRoot,
1134                        agsaIORequest_t      *agIORequest,
1135                        bit32                agIOStatus,
1136                        bit32                agIOInfoLen,
1137                        void                 *agParam,
1138                        bit32                agOtherInfo
1139                        );
1140 osGLOBAL void
1141 itdssIOForDebugging1Completed(
1142                  agsaRoot_t             *agRoot,
1143                  agsaIORequest_t        *agIORequest,
1144                  bit32                  agIOStatus,
1145                  bit32                  agIOInfoLen,
1146                  void                   *agParam,
1147                  bit32                  agOtherInfo
1148                  );
1149 
1150 osGLOBAL void
1151 itdssIOForDebugging2Completed(
1152                  agsaRoot_t             *agRoot,
1153                  agsaIORequest_t        *agIORequest,
1154                  bit32                  agIOStatus,
1155                  bit32                  agIOInfoLen,
1156                  void                   *agParam,
1157                  bit32                  agOtherInfo
1158                  );
1159 
1160 osGLOBAL void
1161 itdssIOForDebugging3Completed(
1162                  agsaRoot_t             *agRoot,
1163                  agsaIORequest_t        *agIORequest,
1164                  bit32                  agIOStatus,
1165                  bit32                  agIOInfoLen,
1166                  void                   *agParam,
1167                  bit32                  agOtherInfo
1168                  );
1169 
1170 osGLOBAL void
1171 itdssInitDiscoveryModule (
1172                           tiRoot_t *tiRoot
1173                           );
1174 
1175 osGLOBAL void
1176 itdssGetResource (
1177                   tiRoot_t              *tiRoot,
1178                   tiInitiatorResource_t *initiatorResource
1179                   );
1180 
1181 
1182 osGLOBAL void
1183 itdssGetOperatingOptionParams(
1184                               tiRoot_t              *tiRoot,
1185                               itdssOperatingOption_t  *OperatingOption
1186                               );
1187 
1188 
1189 osGLOBAL FORCEINLINE bit32
1190 itdssIOPrepareSGL(
1191                   tiRoot_t            *tiRoot,
1192                   tdIORequestBody_t   *IORequestBody,
1193                   tiSgl_t             *tiSgl1,
1194                   void                *sglVirtualAddr
1195                   );
1196 
1197 #ifdef FDS_SM
1198 osGLOBAL void
1199 smReportRemoval(
1200                  tiRoot_t             *tiRoot,
1201                  agsaRoot_t           *agRoot,
1202                  tdsaDeviceData_t     *oneDeviceData,
1203                  tdsaPortContext_t    *onePortContext
1204 	       );
1205 osGLOBAL void
1206 smReportRemovalDirect(
1207                        tiRoot_t             *tiRoot,
1208                        agsaRoot_t           *agRoot,
1209                        tdsaDeviceData_t     *oneDeviceData
1210 		     );
1211 osGLOBAL void
1212 smHandleDirect(
1213                 tiRoot_t             *tiRoot,
1214                 agsaRoot_t           *agRoot,
1215                 tdsaDeviceData_t     *oneDeviceData,
1216                 void                 *IDdata
1217 	      );
1218 
1219 osGLOBAL void
1220 ossaSATAIDAbortCB(
1221                   agsaRoot_t               *agRoot,
1222                   agsaIORequest_t          *agIORequest,
1223                   bit32                    flag,
1224                   bit32                    status
1225                  );
1226 
1227 osGLOBAL void
1228 ossaIniSetDeviceInfoCB(
1229                         agsaRoot_t        *agRoot,
1230                         agsaContext_t     *agContext,
1231                         agsaDevHandle_t   *agDevHandle,
1232                         bit32             status,
1233                         bit32             option,
1234                         bit32             param
1235                       );
1236 
1237 #endif /* FDS_SM */
1238 
1239 #endif /* INITIATOR_DRIVER */
1240 
1241 #ifdef TARGET_DRIVER
1242 /*****************************************************************************
1243 *
1244 * SAS Target only PROTOTYPES (ttdproto.h)
1245 *
1246 *****************************************************************************/
1247 osGLOBAL bit32
1248 ttdssInit(
1249           tiRoot_t              *tiRoot,
1250           tiTargetResource_t    *targetResource,
1251           tiTdSharedMem_t       *tdSharedMem
1252           );
1253 
1254 osGLOBAL void
1255 ttdssGetResource (
1256                   tiRoot_t              *tiRoot,
1257                   tiTargetResource_t    *targetResource
1258                   );
1259 
1260 osGLOBAL void
1261 ttdssGetTargetParams(
1262                      tiRoot_t          *tiRoot
1263                      );
1264 
1265 osGLOBAL void
1266 ttdssGetOperatingOptionParams(
1267                               tiRoot_t                *tiRoot,
1268                               ttdssOperatingOption_t  *OperatingOption
1269                               );
1270 
1271 osGLOBAL agBOOLEAN
1272 ttdsaXchgInit(
1273               tiRoot_t           *tiRoot,
1274               ttdsaXchgData_t    *ttdsaXchgData,
1275               tiTargetMem_t      *tgtMem,
1276               bit32              maxNumXchgs
1277               );
1278 
1279 osGLOBAL void
1280 ttdsaXchgLinkInit(
1281                    tiRoot_t           *tiRoot,
1282                    ttdsaXchg_t        *ttdsaXchg
1283                    );
1284 
1285 
1286 osGLOBAL void
1287 ttdsaXchgFreeStruct(
1288                    tiRoot_t           *tiRoot,
1289                    ttdsaXchg_t        *ttdsaXchg
1290                    );
1291 osGLOBAL void
1292 ttdsaSSPReqReceived(
1293                    agsaRoot_t           *agRoot,
1294                    agsaDevHandle_t      *agDevHandle,
1295                    agsaFrameHandle_t    agFrameHandle,
1296                    bit32                agInitiatorTag,
1297                    bit32                parameter,
1298                    bit32                agFrameLen
1299                    );
1300 
1301 osGLOBAL ttdsaXchg_t
1302 *ttdsaXchgGetStruct(
1303                     agsaRoot_t *agRoot
1304                     );
1305 osGLOBAL void
1306 ttdsaDumpallXchg(tiRoot_t           *tiRoot);
1307 
1308 osGLOBAL void
1309 tdsaProcessCDB(
1310                agsaSSPCmdInfoUnit_t      *cmdIU,
1311                ttdsaXchg_t               *ttdsaXchg
1312                );
1313 
1314 osGLOBAL bit32
1315 ttdssIOPrepareSGL(
1316                   tiRoot_t                 *tiRoot,
1317                   tdIORequestBody_t        *tdIORequestBody,
1318                   tiSgl_t                  *tiSgl1,
1319                   tiSgl_t                  *tiSgl2,
1320                   void                     *sglVirtualAddr);
1321 
1322 osGLOBAL void
1323 ttdsaIOCompleted(
1324                  agsaRoot_t             *agRoot,
1325                  agsaIORequest_t        *agIORequest,
1326                  bit32                  agIOStatus,
1327                  bit32                  agIOInfoLen,
1328                  agsaFrameHandle_t      agFrameHandle,
1329                  bit32                  agOtherInfo
1330                  );
1331 
1332 osGLOBAL void
1333 ttdsaTMProcess(
1334                tiRoot_t    *tiRoot,
1335                ttdsaXchg_t *ttdsaXchg
1336                );
1337 
1338 osGLOBAL void
1339 ttdsaSMPReqReceived(
1340                     agsaRoot_t            *agRoot,
1341                     agsaDevHandle_t       *agDevHandle,
1342                     agsaSMPFrameHeader_t  *agFrameHeader,
1343                     agsaFrameHandle_t     agFrameHandle,
1344                     bit32                 agFrameLength,
1345                     bit32                 phyId
1346                     );
1347 osGLOBAL void
1348 ttdsaSMPCompleted(
1349                   agsaRoot_t            *agRoot,
1350                   agsaIORequest_t       *agIORequest,
1351                   bit32                 agIOStatus,
1352                   //agsaSMPFrameHeader_t  *agFrameHeader,   (TP)
1353                   bit32                 agIOInfoLen,
1354                   agsaFrameHandle_t     agFrameHandle
1355                   );
1356 osGLOBAL bit32
1357 ttdsaSendResp(
1358               agsaRoot_t            *agRoot,
1359               ttdsaXchg_t           *ttdsaXchg
1360               );
1361 
1362 osGLOBAL void
1363 ttdssReportRemovals(
1364                     agsaRoot_t           *agRoot,
1365                     tdsaPortContext_t    *onePortContext,
1366                     bit32                flag
1367                     );
1368 
1369 
1370 osGLOBAL void
1371 ttdsaAbortAll(
1372              tiRoot_t                   *tiRoot,
1373              agsaRoot_t                 *agRoot,
1374              tdsaDeviceData_t           *oneDeviceData
1375              );
1376 
1377 osGLOBAL void
1378 ttdssIOAbortedHandler(
1379                       agsaRoot_t           *agRoot,
1380                       agsaIORequest_t      *agIORequest,
1381                       bit32                agIOStatus,
1382                       bit32                agIOInfoLen,
1383                       void                 *agParam,
1384                       bit32                agOtherInfo
1385                       );
1386 
1387 #endif /* TARGET_DRIVER */
1388 
1389 
1390 
1391 /*****************************************************************************
1392 *
1393 * For debugging only
1394 *
1395 *****************************************************************************/
1396 osGLOBAL void
1397 tdsaPrintSwConfig(
1398                 agsaSwConfig_t *SwConfig
1399                 );
1400 
1401 osGLOBAL void
1402 tdsaPrintHwConfig(
1403                 agsaHwConfig_t *HwConfig
1404                 );
1405 osGLOBAL void
1406 tdssPrintSASIdentify(
1407                      agsaSASIdentify_t *id
1408                      );
1409 osGLOBAL void
1410 print_tdlist_flink(tdList_t *hdr, int type, int flag);
1411 
1412 osGLOBAL void
1413 print_tdlist_blink(tdList_t *hdr, int flag);
1414 
1415 osGLOBAL void
1416 tdhexdump(const char *ptitle, bit8 *pbuf, int len);
1417 
1418 
1419 /*****************************************************************************
1420 *
1421 * SAT only PROTOTYPE
1422 *
1423 *****************************************************************************/
1424 
1425 #ifdef  SATA_ENABLE
1426 
1427 /*****************************************************************************
1428  *! \brief  satIOStart
1429  *
1430  *   This routine is called to initiate a new SCSI request to SATL.
1431  *
1432  *  \param   tiRoot:           Pointer to TISA initiator driver/port instance.
1433  *  \param   tiIORequest:      Pointer to TISA I/O request context for this I/O.
1434  *  \param   tiDeviceHandle:   Pointer to TISA device handle for this I/O.
1435  *  \param   tiScsiRequest:    Pointer to TISA SCSI I/O request and SGL list.
1436  *  \param   satIOContext_t:   Pointer to the SAT IO Context
1437  *
1438  *  \return:
1439  *
1440  *  \e tiSuccess:     I/O request successfully initiated.
1441  *  \e tiBusy:        No resources available, try again later.
1442  *  \e tiIONoDevice:  Invalid device handle.
1443  *  \e tiError:       Other errors that prevent the I/O request to be started.
1444  *
1445  *
1446  *****************************************************************************/
1447 
1448 GLOBAL bit32  satIOStart(
1449                    tiRoot_t                  *tiRoot,
1450                    tiIORequest_t             *tiIORequest,
1451                    tiDeviceHandle_t          *tiDeviceHandle,
1452                    tiScsiInitiatorRequest_t *tiScsiRequest,
1453                    satIOContext_t            *satIOContext
1454                   );
1455 
1456 /*****************************************************************************
1457  *! \brief  satIOAbort
1458  *
1459  *   This routine is called to initiate a I/O abort to SATL.
1460  *   This routine is independent of HW/LL API.
1461  *
1462  *  \param  tiRoot:     Pointer to TISA initiator driver/port instance.
1463  *  \param  taskTag:    Pointer to TISA I/O request context/tag to be aborted.
1464  *
1465  *  \return:
1466  *
1467  *  \e tiSuccess:     I/O request successfully initiated.
1468  *  \e tiBusy:        No resources available, try again later.
1469  *  \e tiError:       Other errors that prevent the I/O request to be started.
1470  *
1471  *
1472  *****************************************************************************/
1473 
1474 GLOBAL bit32 satIOAbort(
1475                           tiRoot_t      *tiRoot,
1476                           tiIORequest_t *taskTag );
1477 
1478 
1479 /*****************************************************************************
1480  *! \brief  satTM
1481  *
1482  *   This routine is called to initiate a TM request to SATL.
1483  *   This routine is independent of HW/LL API.
1484  *
1485  *  \param  tiRoot:           Pointer to TISA initiator driver/port instance.
1486  *  \param  tiDeviceHandle:   Pointer to TISA device handle for this I/O.
1487  *  \param  task:             SAM-3 task management request.
1488  *  \param  lun:              Pointer to LUN.
1489  *  \param  taskTag:          Pointer to the associated task where the TM
1490  *                            command is to be applied.
1491  *  \param  currentTaskTag:   Pointer to tag/context for this TM request.
1492  *
1493  *  \return:
1494  *
1495  *  \e tiSuccess:     I/O request successfully initiated.
1496  *  \e tiBusy:        No resources available, try again later.
1497  *  \e tiIONoDevice:  Invalid device handle.
1498  *  \e tiError:       Other errors that prevent the I/O request to be started.
1499  *
1500  *
1501  *****************************************************************************/
1502 
1503 osGLOBAL bit32 satTM(
1504                         tiRoot_t          *tiRoot,
1505                         tiDeviceHandle_t  *tiDeviceHandle,
1506                         bit32             task,
1507                         tiLUN_t           *lun,
1508                         tiIORequest_t     *taskTag,
1509                         tiIORequest_t     *currentTaskTag,
1510                         tdIORequestBody_t *tiRequestBody,
1511                         bit32              NotifyOS
1512                         );
1513 
1514 
1515 #endif  /* SAT only */
1516 
1517 #ifdef INITIATOR_DRIVER
1518 #ifdef TD_DISCOVER
1519 
1520 osGLOBAL void
1521 tdsaExpanderInit(
1522                  tiRoot_t *tiRoot
1523                  );
1524 
1525 osGLOBAL bit32
1526 tdsaDiscover(
1527              tiRoot_t          *tiRoot,
1528              tdsaPortContext_t *onePortContext,
1529              bit32             type,
1530              bit32             option
1531              );
1532 
1533 osGLOBAL bit32
1534 tdsaSASFullDiscover(
1535                     tiRoot_t          *tiRoot,
1536                     tdsaPortContext_t *onePortContext
1537                     );
1538 
1539 osGLOBAL bit32
1540 tdsaSATAFullDiscover(
1541                      tiRoot_t          *tiRoot,
1542                      tdsaPortContext_t *onePortContext
1543                      );
1544 osGLOBAL bit32
1545 tdsaSASIncrementalDiscover(
1546                     tiRoot_t          *tiRoot,
1547                     tdsaPortContext_t *onePortContext
1548                     );
1549 
1550 osGLOBAL bit32
1551 tdsaSATAIncrementalDiscover(
1552                      tiRoot_t          *tiRoot,
1553                      tdsaPortContext_t *onePortContext
1554                      );
1555 
1556 osGLOBAL void
1557 tdsaSASUpStreamDiscoverStart(
1558                              tiRoot_t             *tiRoot,
1559                              tdsaPortContext_t    *onePortContext,
1560                              tdsaDeviceData_t     *oneDeviceData
1561                              );
1562 
1563 osGLOBAL void
1564 tdsaSASUpStreamDiscovering(
1565                            tiRoot_t             *tiRoot,
1566                            tdsaPortContext_t    *onePortContext,
1567                            tdsaDeviceData_t     *oneDeviceData
1568                            );
1569 
1570 
1571 osGLOBAL void
1572 tdsaSASDownStreamDiscoverStart(
1573                                tiRoot_t             *tiRoot,
1574                                tdsaPortContext_t    *onePortContext,
1575                                tdsaDeviceData_t     *oneDeviceData
1576                                );
1577 
1578 osGLOBAL void
1579 tdsaSASDownStreamDiscovering(
1580                              tiRoot_t             *tiRoot,
1581                              tdsaPortContext_t    *onePortContext,
1582                              tdsaDeviceData_t     *oneDeviceData
1583                              );
1584 
1585 osGLOBAL void
1586 tdsaSASDiscoverDone(
1587                     tiRoot_t             *tiRoot,
1588                     tdsaPortContext_t    *onePortContext,
1589                     bit32                 flag
1590                     );
1591 
1592 osGLOBAL void
1593 tdsaSATADiscoverDone(
1594                     tiRoot_t             *tiRoot,
1595                     tdsaPortContext_t    *onePortContext,
1596                     bit32                flag
1597                     );
1598 
1599 osGLOBAL void
1600 tdsaAckBC(
1601                     tiRoot_t             *tiRoot,
1602                     tdsaPortContext_t    *onePortContext
1603                     );
1604 
1605 osGLOBAL void
1606 tdsaDiscoveryResetProcessed(
1607                     tiRoot_t             *tiRoot,
1608                     tdsaPortContext_t    *onePortContext
1609                     );
1610 
1611 
1612 
1613 osGLOBAL void
1614 tdsaSASUpStreamDiscoverExpanderPhy(
1615                                    tiRoot_t              *tiRoot,
1616                                    tdsaPortContext_t     *onePortContext,
1617                                    tdsaExpander_t        *oneExpander,
1618                                    smpRespDiscover_t     *pDiscoverResp
1619                                    );
1620 osGLOBAL tdsaExpander_t *
1621 tdsaFindUpStreamConfigurableExp(tiRoot_t              *tiRoot,
1622                                 tdsaExpander_t        *oneExpander);
1623 
1624 osGLOBAL void
1625 tdsaSASDownStreamDiscoverExpanderPhy(
1626                                      tiRoot_t              *tiRoot,
1627                                      tdsaPortContext_t     *onePortContext,
1628                                      tdsaExpander_t        *oneExpander,
1629                                      smpRespDiscover_t     *pDiscoverResp
1630                                      );
1631 osGLOBAL void
1632 tdsaSASUpStreamDiscoverExpanderPhySkip(
1633                                    tiRoot_t              *tiRoot,
1634                                    tdsaPortContext_t     *onePortContext,
1635                                    tdsaExpander_t        *oneExpander
1636                                    );
1637 osGLOBAL tdsaExpander_t *
1638 tdsaFindDownStreamConfigurableExp(tiRoot_t              *tiRoot,
1639                                   tdsaExpander_t        *oneExpander);
1640 
1641 osGLOBAL void
1642 tdsaSASDownStreamDiscoverExpanderPhySkip(
1643                                      tiRoot_t              *tiRoot,
1644                                      tdsaPortContext_t     *onePortContext,
1645                                      tdsaExpander_t        *oneExpander
1646                                      );
1647 osGLOBAL void
1648 tdsaDiscoveringStpSATADevice(
1649                              tiRoot_t              *tiRoot,
1650                              tdsaPortContext_t     *onePortContext,
1651                              tdsaDeviceData_t      *oneDeviceData
1652                              );
1653 
1654 
1655 osGLOBAL void
1656 tdsaSASExpanderUpStreamPhyAdd(
1657                               tiRoot_t          *tiRoot,
1658                               tdsaExpander_t    *oneExpander,
1659                               bit8              phyId
1660                               );
1661 
1662 osGLOBAL void
1663 tdsaSASExpanderDownStreamPhyAdd(
1664                               tiRoot_t          *tiRoot,
1665                               tdsaExpander_t    *oneExpander,
1666                               bit8              phyId
1667                               );
1668 osGLOBAL bit16
1669 tdsaFindCurrentDownStreamPhyIndex(
1670                               tiRoot_t          *tiRoot,
1671                               tdsaExpander_t    *oneExpander
1672                               );
1673 
1674 osGLOBAL tdsaDeviceData_t *
1675 tdsaPortSASDeviceFind(
1676                       tiRoot_t           *tiRoot,
1677                       tdsaPortContext_t  *onePortContext,
1678                       bit32              sasAddrLo,
1679                       bit32              sasAddrHi
1680                       );
1681 
1682 GLOBAL tdsaDeviceData_t *
1683 tdsaPortSASDeviceAdd(
1684                      tiRoot_t            *tiRoot,
1685                      tdsaPortContext_t   *onePortContext,
1686                      agsaSASIdentify_t   sasIdentify,
1687                      bit32               sasInitiator,
1688                      bit8                connectionRate,
1689                      bit32               itNexusTimeout,
1690                      bit32               firstBurstSize,
1691                      bit32               deviceType,
1692                      tdsaDeviceData_t    *oneExpDeviceData,
1693                      bit8                phyID
1694                      );
1695 
1696 
1697 
1698 
1699 
1700 /* in tdport.c */
1701 osGLOBAL tdsaDeviceData_t *
1702 tdssNewAddSASToSharedcontext(
1703                                  agsaRoot_t           *agRoot,
1704                                  tdsaPortContext_t    *onePortContext,
1705                                  tdsaSASSubID_t       *agSASSubID,
1706                                  tdsaDeviceData_t     *oneExpDeviceData,
1707                                  bit8                 phyID
1708                                  );
1709 osGLOBAL void
1710 tdsaResetValidDeviceData(
1711                                  agsaRoot_t           *agRoot,
1712                                  tdsaPortContext_t    *onePortContext
1713                                  );
1714 
1715 
1716 osGLOBAL void
1717 tdssReportChanges(
1718                                  agsaRoot_t           *agRoot,
1719                                  tdsaPortContext_t    *onePortContext                                                 );
1720 
1721 osGLOBAL void
1722 tdssReportRemovals(
1723                                  agsaRoot_t           *agRoot,
1724                                  tdsaPortContext_t    *onePortContext,
1725                                  bit32                flag
1726                                  );
1727 osGLOBAL void
1728 tdssInternalRemovals(
1729                                  agsaRoot_t           *agRoot,
1730                                  tdsaPortContext_t    *onePortContext
1731                                  );
1732 osGLOBAL void
1733 tdssDiscoveryErrorRemovals(
1734                                  agsaRoot_t           *agRoot,
1735                                  tdsaPortContext_t    *onePortContext
1736                                  );
1737 
1738 osGLOBAL void
1739 tdsaSASDiscoverAbort(
1740                     tiRoot_t             *tiRoot,
1741                     tdsaPortContext_t    *onePortContext
1742                     );
1743 
1744 
1745 osGLOBAL tdsaDeviceData_t *
1746 tdsaFindRegNValid(
1747                                  agsaRoot_t           *agRoot,
1748                                  tdsaPortContext_t    *onePortContext,
1749                                  tdsaSASSubID_t       *agSASSubID
1750                   );
1751 bit32
1752 tdssNewSASorNot(
1753                                  agsaRoot_t           *agRoot,
1754                                  tdsaPortContext_t    *onePortContext,
1755                                  tdsaSASSubID_t       *agSASSubID
1756                                  );
1757 
1758 
1759 osGLOBAL tdsaExpander_t *
1760 tdssSASDiscoveringExpanderAlloc(
1761                                 tiRoot_t                 *tiRoot,
1762                                 tdsaPortContext_t        *onePortContext,
1763                                 tdsaDeviceData_t         *oneDeviceData
1764                                 );
1765 
1766 osGLOBAL void
1767 tdssSASDiscoveringExpanderAdd(
1768                               tiRoot_t                 *tiRoot,
1769                               tdsaPortContext_t        *onePortContext,
1770                               tdsaExpander_t           *oneExpander
1771                               );
1772 
1773 osGLOBAL void
1774 tdssSASDiscoveringExpanderRemove(
1775                                  tiRoot_t                 *tiRoot,
1776                                  tdsaPortContext_t        *onePortContext,
1777                                  tdsaExpander_t           *oneExpander
1778                                  );
1779 
1780 GLOBAL bit32
1781 tdssSATADeviceTypeDecode(
1782                          bit8  *pSignature
1783                          );
1784 
1785 
1786 GLOBAL tdsaDeviceData_t *
1787 tdsaPortSATADeviceAdd(
1788                       tiRoot_t                *tiRoot,
1789                       tdsaPortContext_t       *onePortContext,
1790                       tdsaDeviceData_t        *oneSTPBridge,
1791                       bit8                    *Signature,
1792                       bit8                    pm,
1793                       bit8                    pmField,
1794                       bit8                    connectionRate,
1795                       tdsaDeviceData_t        *oneExpDeviceData,
1796                       bit8                    phyID
1797                       );
1798 
1799 /* in tdport.c */
1800 osGLOBAL tdsaDeviceData_t *
1801 tdssNewAddSATAToSharedcontext(tiRoot_t             *tiRoot,
1802                               agsaRoot_t           *agRoot,
1803                               tdsaPortContext_t    *onePortContext,
1804                               agsaSATADeviceInfo_t *agSATADeviceInfo,
1805                               bit8                    *Signature,
1806                               bit8                    pm,
1807                               bit8                    pmField,
1808                               bit32                   connectionRate,
1809                               tdsaDeviceData_t        *oneExpDeviceData,
1810                               bit8                    phyID
1811                               );
1812 
1813 osGLOBAL tdsaDeviceData_t  *
1814 tdsaFindRightDevice(
1815                    tiRoot_t               *tiRoot,
1816                    tdsaPortContext_t      *onePortContext,
1817                    tdsaDeviceData_t       *tdsaDeviceData
1818                    );
1819 GLOBAL void
1820 ossaIDCDiscoverCompleted(
1821                   agsaRoot_t        *agRoot,
1822                   agsaIORequest_t   *agIORequest,
1823                   bit32             agIOStatus,
1824                   void              *agFirstDword,
1825                   bit32             agIOInfoLen,
1826                   agsaFrameHandle_t agFrameHandle
1827                   );
1828 
1829 osGLOBAL bit8
1830 tdsaFindLocalLinkRate(
1831                       tiRoot_t                  *tiRoot,
1832                       tdsaPortStartInfo_t       *tdsaPortStartInfo
1833                       );
1834 
1835 /* SMP related */
1836 
1837 osGLOBAL bit32
1838 tdSMPStart(
1839            tiRoot_t              *tiRoot,
1840            agsaRoot_t            *agRoot,
1841            tdsaDeviceData_t      *oneDeviceData,
1842            bit32                 functionCode,
1843            bit8                  *pSmpBody,
1844            bit32                 smpBodySize,
1845            bit32                 agRequestType,
1846            tiIORequest_t         *CurrentTaskTag,
1847            bit32                 queueNumber
1848            );
1849 //temp for testing
1850 osGLOBAL void
1851 tdsaReportManInfoSend(
1852                       tiRoot_t             *tiRoot,
1853                       tdsaDeviceData_t     *oneDeviceData
1854                       );
1855 
1856 osGLOBAL void
1857 tdsaReportManInfoRespRcvd(
1858                           tiRoot_t              *tiRoot,
1859                           agsaRoot_t            *agRoot,
1860                           tdsaDeviceData_t      *oneDeviceData,
1861                           tdssSMPFrameHeader_t  *frameHeader,
1862                           agsaFrameHandle_t     frameHandle
1863                           );
1864 
1865 //end temp for testing
1866 
1867 osGLOBAL void
1868 tdsaReportGeneralSend(
1869                       tiRoot_t             *tiRoot,
1870                       tdsaDeviceData_t     *oneDeviceData
1871                       );
1872 
1873 osGLOBAL void
1874 tdsaReportGeneralRespRcvd(
1875                           tiRoot_t              *tiRoot,
1876                           agsaRoot_t            *agRoot,
1877                           agsaIORequest_t       *agIORequest,
1878                           tdsaDeviceData_t      *oneDeviceData,
1879                           tdssSMPFrameHeader_t  *frameHeader,
1880                           agsaFrameHandle_t     frameHandle
1881               );
1882 osGLOBAL void
1883 tdsaDiscoverSend(
1884                  tiRoot_t             *tiRoot,
1885                  tdsaDeviceData_t     *oneDeviceData
1886                  );
1887 
1888 osGLOBAL void
1889 tdsaDiscoverRespRcvd(
1890                      tiRoot_t              *tiRoot,
1891                      agsaRoot_t            *agRoot,
1892                      agsaIORequest_t       *agIORequest,
1893                      tdsaDeviceData_t      *oneDeviceData,
1894                      tdssSMPFrameHeader_t  *frameHeader,
1895                      agsaFrameHandle_t     frameHandle
1896                      );
1897 
1898 
1899 osGLOBAL void
1900 tdsaReportPhySataSend(
1901                       tiRoot_t             *tiRoot,
1902                       tdsaDeviceData_t     *oneDeviceData,
1903                       bit8                 phyId
1904                       );
1905 
1906 
1907 
1908 osGLOBAL void
1909 tdsaReportPhySataRcvd(
1910                       tiRoot_t              *tiRoot,
1911                       agsaRoot_t            *agRoot,
1912                       agsaIORequest_t       *agIORequest,
1913                       tdsaDeviceData_t      *oneDeviceData,
1914                       tdssSMPFrameHeader_t  *frameHeader,
1915                       agsaFrameHandle_t     frameHandle
1916                       );
1917 
1918 osGLOBAL bit32
1919 tdsaSASRoutingEntryAdd(
1920                        tiRoot_t          *tiRoot,
1921                        tdsaExpander_t    *oneExpander,
1922                        bit32             phyId,
1923                        bit32             configSASAddressHi,
1924                        bit32             configSASAddressLo
1925                        );
1926 
1927 
1928 osGLOBAL void
1929 tdsaConfigRoutingInfoRespRcvd(
1930                               tiRoot_t              *tiRoot,
1931                               agsaRoot_t            *agRoot,
1932                               agsaIORequest_t       *agIORequest,
1933                               tdsaDeviceData_t      *oneDeviceData,
1934                               tdssSMPFrameHeader_t  *frameHeader,
1935                               agsaFrameHandle_t     frameHandle
1936                               );
1937 
1938 osGLOBAL bit32
1939 tdsaPhyControlSend(
1940                    tiRoot_t             *tiRoot,
1941                    tdsaDeviceData_t     *oneDeviceData,
1942                    bit8                 phyOp,
1943                    tiIORequest_t        *CurrentTaskTag,
1944                    bit32                queueNumber
1945                    );
1946 
1947 osGLOBAL void
1948 tdsaPhyControlRespRcvd(
1949                        tiRoot_t              *tiRoot,
1950                        agsaRoot_t            *agRoot,
1951                        agsaIORequest_t       *agIORequest,
1952                        tdsaDeviceData_t      *oneDeviceData,
1953                        tdssSMPFrameHeader_t  *frameHeader,
1954                        agsaFrameHandle_t     frameHandle,
1955                        tiIORequest_t         *CurrentTaskTag
1956                        );
1957 
1958 osGLOBAL void
1959 tdsaPhyControlFailureRespRcvd(
1960                               tiRoot_t              *tiRoot,
1961                               agsaRoot_t            *agRoot,
1962                               tdsaDeviceData_t      *oneDeviceData,
1963                               tdssSMPFrameHeader_t  *frameHeader,
1964                               agsaFrameHandle_t     frameHandle,
1965                               tiIORequest_t         *CurrentTaskTag
1966                              );
1967 
1968 
1969 osGLOBAL void
1970 tdsaDumpAllExp(
1971                               tiRoot_t                 *tiRoot,
1972                               tdsaPortContext_t        *onePortContext,
1973                               tdsaExpander_t           *oneExpander
1974                               );
1975 osGLOBAL void
1976 tdsaDumpAllUpExp(
1977                               tiRoot_t                 *tiRoot,
1978                               tdsaPortContext_t        *onePortContext,
1979                               tdsaExpander_t           *oneExpander
1980                               );
1981 osGLOBAL void
1982 tdsaCleanAllExp(
1983                               tiRoot_t                 *tiRoot,
1984                               tdsaPortContext_t        *onePortContext
1985                               );
1986 osGLOBAL void
1987 tdsaFreeAllExp(
1988                               tiRoot_t                 *tiRoot,
1989                               tdsaPortContext_t        *onePortContext
1990                               );
1991 osGLOBAL void
1992 tdsaDumpAllFreeExp(
1993                               tiRoot_t                 *tiRoot
1994                               );
1995 
1996 osGLOBAL void
1997 tdsaDiscoveryTimer(tiRoot_t                 *tiRoot,
1998                    tdsaPortContext_t        *onePortContext,
1999                    tdsaDeviceData_t         *oneDeviceData
2000                    );
2001 
2002 osGLOBAL void
2003 tdsaDiscoveryTimerCB(
2004                        tiRoot_t    * tiRoot,
2005                        void        * timerData1,
2006                        void        * timerData2,
2007                        void        * timerData3
2008                        );
2009 
2010 osGLOBAL void
2011 tdsaConfigureRouteTimer(tiRoot_t                 *tiRoot,
2012                         tdsaPortContext_t        *onePortContext,
2013                         tdsaExpander_t           *oneExpander,
2014                         smpRespDiscover_t        *ptdSMPDiscoverResp
2015                        );
2016 
2017 osGLOBAL void
2018 tdsaConfigureRouteTimerCB(
2019                           tiRoot_t    * tiRoot,
2020                           void        * timerData1,
2021                           void        * timerData2,
2022                           void        * timerData3
2023                          );
2024 
2025 osGLOBAL void
2026 tdsaDeviceRegistrationTimer(tiRoot_t                 *tiRoot,
2027                             tdsaPortContext_t        *onePortContext,
2028                             tdsaDeviceData_t         *oneDeviceData
2029                             );
2030 
2031 osGLOBAL void
2032 tdsaDeviceRegistrationTimerCB(
2033                               tiRoot_t    * tiRoot,
2034                               void        * timerData1,
2035                               void        * timerData2,
2036                               void        * timerData3
2037                              );
2038 
2039 osGLOBAL void
2040 tdsaSMPBusyTimer(tiRoot_t                 *tiRoot,
2041                  tdsaPortContext_t        *onePortContext,
2042                  tdsaDeviceData_t         *oneDeviceData,
2043                  tdssSMPRequestBody_t     *tdSMPRequestBody
2044                  );
2045 
2046 osGLOBAL void
2047 tdsaSMPBusyTimerCB(
2048                        tiRoot_t    * tiRoot,
2049                        void        * timerData1,
2050                        void        * timerData2,
2051                        void        * timerData3
2052                        );
2053 
2054 osGLOBAL void
2055 tdsaSATAIDDeviceTimer(tiRoot_t                 *tiRoot,
2056                       tdsaDeviceData_t         *oneDeviceData
2057                      );
2058 #ifdef FDS_SM
2059 osGLOBAL void
2060 tdIDStartTimer(tiRoot_t                 *tiRoot,
2061                smIORequest_t            *smIORequest,
2062                tdsaDeviceData_t         *oneDeviceData
2063                );
2064 osGLOBAL void
2065 tdIDStartTimerCB(
2066                   tiRoot_t    * tiRoot,
2067                   void        * timerData1,
2068                   void        * timerData2,
2069                   void        * timerData3
2070                 );
2071 #endif
2072 osGLOBAL void
2073 tdsaBCTimer(tiRoot_t                 *tiRoot,
2074             tdsaPortContext_t        *onePortContext
2075            );
2076 
2077 osGLOBAL void
2078 tdsaBCTimerCB(
2079               tiRoot_t    * tiRoot,
2080               void        * timerData1,
2081               void        * timerData2,
2082               void        * timerData3
2083               );
2084 
2085 osGLOBAL void
2086 tdsaSATAIDDeviceTimerCB(
2087                        tiRoot_t    * tiRoot,
2088                        void        * timerData1,
2089                        void        * timerData2,
2090                        void        * timerData3
2091                        );
2092 
2093 osGLOBAL void
2094 tdsaDiscoverySMPTimer(tiRoot_t                 *tiRoot,
2095                       tdsaPortContext_t        *onePortContext,
2096                       bit32                    functionCode,
2097                       tdssSMPRequestBody_t     *tdSMPRequestBody
2098                      );
2099 
2100 osGLOBAL void
2101 tdsaDiscoverySMPTimerCB(
2102                         tiRoot_t    * tiRoot,
2103                         void        * timerData1,
2104                         void        * timerData2,
2105                         void        * timerData3
2106                        );
2107 
2108 osGLOBAL void
2109 dumpRoutingAttributes(
2110                       tiRoot_t                 *tiRoot,
2111                       tdsaExpander_t           *oneExpander,
2112                       bit8                     phyID
2113                       );
2114 
2115 osGLOBAL bit32
2116 tdsaDuplicateConfigSASAddr(
2117                       tiRoot_t                 *tiRoot,
2118                       tdsaExpander_t           *oneExpander,
2119                       bit32                    configSASAddressHi,
2120                       bit32                    configSASAddressLo
2121                       );
2122 
2123 osGLOBAL tdsaExpander_t *
2124 tdsaFindConfigurableExp(
2125                          tiRoot_t                 *tiRoot,
2126                          tdsaPortContext_t        *onePortContext,
2127                          tdsaExpander_t           *oneExpander
2128                         );
2129 
2130 GLOBAL bit32
2131 tdsaDiscoveryStartIDDev(
2132                         tiRoot_t                  *tiRoot,
2133                         tiIORequest_t             *tiIORequest,
2134                         tiDeviceHandle_t          *tiDeviceHandle,
2135                         tiScsiInitiatorRequest_t *tiScsiRequest,
2136                         tdsaDeviceData_t          *oneDeviceData
2137                         );
2138 
2139 GLOBAL void  satFreeIntIoResource(
2140                     tiRoot_t              *tiRoot,
2141                     satDeviceData_t       *satDevData,
2142                     satInternalIo_t       *satIntIo);
2143 osGLOBAL void
2144 tddmDeregisterDevicesInPort(
2145                 tiRoot_t             *tiRoot,
2146                 tdsaPortContext_t    *onePortContext
2147                );
2148 
2149 #ifdef AGTIAPI_CTL
2150 osGLOBAL void
2151 tdsaCTLSet(
2152            tiRoot_t          *tiRoot,
2153            tdsaPortContext_t *onePortContext,
2154            tiIntrEventType_t eventType,
2155            bit32             eventStatus);
2156 
2157 STATIC void
2158 tdsaCTLNextDevice(
2159                   tiRoot_t          *tiRoot,
2160                   tdsaPortContext_t *onePortContext,
2161                   tdIORequest_t     *tdIORequest,
2162                   tdList_t          *DeviceList);
2163 
2164 STATIC int
2165 tdsaCTLModeSelect(
2166                   tiRoot_t                  *tiRoot,
2167                   tiDeviceHandle_t          *tiDeviceHandle,
2168                   tdIORequest_t             *tdIORequest);
2169 
2170 STATIC void
2171 tdsaCTLIOCompleted(
2172                    agsaRoot_t      *agRoot,
2173                    agsaIORequest_t *agIORequest,
2174                    bit32           agIOStatus,
2175                    bit32           agIOInfoLen,
2176                    void            *agParam,
2177                    bit16           sspTag,
2178                    bit32           agOtherInfo);
2179 #endif /* AGTIAPI_CTL */
2180 
2181 #endif /* TD_DISCOVER */
2182 #endif /* INITIATOR_DRIVER */
2183 
2184 #ifdef FDS_DM
2185 /**********		For DM		*******/
2186 osGLOBAL tdsaDeviceData_t *
2187 tddmPortDeviceAdd(
2188                      tiRoot_t            *tiRoot,
2189                      tdsaPortContext_t   *onePortContext,
2190                      dmDeviceInfo_t      *dmDeviceInfo,
2191                      tdsaDeviceData_t    *oneExpDeviceData
2192                      );
2193 
2194 osGLOBAL void
2195 tddmInvalidateDevicesInPort(
2196                 tiRoot_t             *tiRoot,
2197                 tdsaPortContext_t    *onePortContext
2198                );
2199 
2200 osGLOBAL bit32
2201 tddmNewSASorNot(
2202                                  tiRoot_t             *tiRoot,
2203                                  tdsaPortContext_t    *onePortContext,
2204                                  tdsaSASSubID_t       *agSASSubID
2205                                  );
2206 
2207 osGLOBAL tdsaDeviceData_t *
2208 tddmPortSASDeviceFind(
2209                       tiRoot_t           *tiRoot,
2210                       tdsaPortContext_t  *onePortContext,
2211                       bit32              sasAddrLo,
2212                       bit32              sasAddrHi
2213                       );
2214 
2215 osGLOBAL tdsaDeviceData_t *
2216 tddmAddToSharedcontext(
2217                        agsaRoot_t           *agRoot,
2218                        tdsaPortContext_t    *onePortContext,
2219                        tdsaSASSubID_t       *agSASSubID,
2220                        tdsaDeviceData_t     *oneExpDeviceData,
2221                        bit8                 phyID
2222                       );
2223 
2224 osGLOBAL void
2225 tdsaUpdateMCN(
2226               dmRoot_t 	           *dmRoot,
2227               tdsaPortContext_t    *onePortContext
2228              );
2229 #endif
2230 
2231 GLOBAL void
2232 tdsaSingleThreadedEnter(tiRoot_t *ptiRoot, bit32 queueId);
2233 
2234 GLOBAL void
2235 tdsaSingleThreadedLeave(tiRoot_t *ptiRoot, bit32 queueId);
2236 
2237 #ifdef PERF_COUNT
2238 GLOBAL void
2239 tdsaEnter(tiRoot_t *ptiRoot, int io);
2240 
2241 GLOBAL void
2242 tdsaLeave(tiRoot_t *ptiRoot, int io);
2243 
2244 #define TDSA_INP_ENTER(root) tdsaEnter(root, 0)
2245 #define TDSA_INP_LEAVE(root) tdsaLeave(root, 0)
2246 #define TDSA_OUT_ENTER(root) tdsaEnter(root, 1)
2247 #define TDSA_OUT_LEAVE(root) tdsaLeave(root, 1)
2248 #else
2249 #define TDSA_INP_ENTER(root)
2250 #define TDSA_INP_LEAVE(root)
2251 #define TDSA_OUT_ENTER(root)
2252 #define TDSA_OUT_LEAVE(root)
2253 #endif
2254 
2255 #if defined(FDS_DM) && defined(FDS_SM)
2256 GLOBAL void
2257 tdIDStart(
2258            tiRoot_t             *tiRoot,
2259            agsaRoot_t           *agRoot,
2260            smRoot_t             *smRoot,
2261            tdsaDeviceData_t     *oneDeviceData,
2262            tdsaPortContext_t    *onePortContext
2263           );
2264 #endif
2265 
2266 void t_MacroCheck(  agsaRoot_t       *agRoot);
2267 
2268 #endif                          /* __TDPROTO_H__ */
2269