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