Training courses

Kernel and Embedded Linux

Bootlin training courses

Embedded Linux, kernel,
Yocto Project, Buildroot, real-time,
graphics, boot time, debugging...

Bootlin logo

Elixir Cross Referencer

  1
  2
  3
  4
  5
  6
  7
  8
  9
 10
 11
 12
 13
 14
 15
 16
 17
 18
 19
 20
 21
 22
 23
 24
 25
 26
 27
 28
 29
 30
 31
 32
 33
 34
 35
 36
 37
 38
 39
 40
 41
 42
 43
 44
 45
 46
 47
 48
 49
 50
 51
 52
 53
 54
 55
 56
 57
 58
 59
 60
 61
 62
 63
 64
 65
 66
 67
 68
 69
 70
 71
 72
 73
 74
 75
 76
 77
 78
 79
 80
 81
 82
 83
 84
 85
 86
 87
 88
 89
 90
 91
 92
 93
 94
 95
 96
 97
 98
 99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
/*******************************************************************************
*Copyright (c) 2014 PMC-Sierra, Inc.  All rights reserved. 
*
*Redistribution and use in source and binary forms, with or without modification, are permitted provided 
*that the following conditions are met: 
*1. Redistributions of source code must retain the above copyright notice, this list of conditions and the
*following disclaimer. 
*2. Redistributions in binary form must reproduce the above copyright notice, 
*this list of conditions and the following disclaimer in the documentation and/or other materials provided
*with the distribution. 
*
*THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED 
*WARRANTIES,INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
*FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
*FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 
*NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR 
*BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT 
*LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 
*SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE
*
* $FreeBSD$
*
********************************************************************************/
/*******************************************************************************/
/*! \file saproto.h
 *  \brief The file defines the function delcaration for internal used function
 *
 */
/******************************************************************************/

#ifndef  __SAPROTO_H__

#define __SAPROTO_H__

/* function declaration */
/*** SATIMER.C ***/
GLOBAL agsaTimerDesc_t *siTimerAdd(
                                  agsaRoot_t      *agRoot,
                                  bit32           timeout,
                                  agsaCallback_t  pfnTimeout,
                                  bit32           Event,
                                  void *          pParm
                                  );

GLOBAL void siTimerRemove(
                          agsaRoot_t      *agRoot,
                          agsaTimerDesc_t *pTimer
                          );

GLOBAL void siTimerRemoveAll(agsaRoot_t   *agRoot);

/*** SAINIT.C ***/
GLOBAL bit32 siConfiguration(agsaRoot_t    *agRoot,
                            mpiConfig_t    *mpiConfig,
                            agsaHwConfig_t *hwConfig,
                            agsaSwConfig_t *swConfig
                            );

GLOBAL bit32 mpiInitialize(agsaRoot_t  *agRoot,
                           mpiMemReq_t *memoryAllocated,
                           mpiConfig_t *config
                           );

GLOBAL bit32 mpiWaitForConfigTable(agsaRoot_t *agRoot,
                                   spc_configMainDescriptor_t *config
                                   );

GLOBAL void mpiUpdateIBQueueCfgTable(agsaRoot_t *agRoot,
                                     spc_inboundQueueDescriptor_t *inQueueCfg,
                                     bit32 QueueTableOffset,
                                     bit8 pcibar
                                     );

GLOBAL void mpiUpdateOBQueueCfgTable(agsaRoot_t *agRoot,
                                     spc_outboundQueueDescriptor_t *outQueueCfg,
                                     bit32 QueueTableOffset,
                                     bit8 pcibar
                                     );
GLOBAL void mpiUpdateFatalErrorTable(agsaRoot_t             *agRoot, 
                              bit32                         FerrTableOffset,
                              bit32                         lowerBaseAddress,
                              bit32                         upperBaseAddress,
                              bit32                         length,
                              bit8                          pcibar);

GLOBAL bit32 mpiGetPCIBarIndex(agsaRoot_t *agRoot,
                               bit32 pciBar
                               );

GLOBAL bit32 mpiUnInitConfigTable(agsaRoot_t *agRoot);

GLOBAL void mpiReadGSTable(agsaRoot_t             *agRoot,
                         spc_GSTableDescriptor_t  *mpiGSTable);

GLOBAL void siInitResources(agsaRoot_t              *agRoot,
                            agsaMemoryRequirement_t *memoryAllocated,
                            agsaHwConfig_t          *hwConfig,
                            agsaSwConfig_t          *swConfig,
                            bit32                   usecsPerTick);

GLOBAL void mpiReadCALTable(agsaRoot_t      *agRoot,
                            spc_SPASTable_t *mpiCALTable,
                            bit32           index);

GLOBAL void mpiWriteCALTable(agsaRoot_t     *agRoot,
                            spc_SPASTable_t *mpiCALTable,
                            bit32           index);

GLOBAL void mpiWriteCALAll(agsaRoot_t     *agRoot,
                           agsaPhyAnalogSetupTable_t *mpiCALTable);

GLOBAL void mpiWrIntVecTable(agsaRoot_t *agRoot,
                            mpiConfig_t* config
                            );

GLOBAL void mpiWrAnalogSetupTable(agsaRoot_t *agRoot,
                            mpiConfig_t      *config
                            );


GLOBAL void mpiWrPhyAttrbTable(agsaRoot_t *agRoot,
                            sasPhyAttribute_t *phyAttrib
                            );

/*** SAPHY.C ***/
GLOBAL bit32 siPhyStopCB(
                      agsaRoot_t    *agRoot,
                      bit32         phyId,
                      bit32         status,
                      agsaContext_t *agContext,
                      bit32         portId,
                      bit32         npipps
                      );

/*** SAPORT.C ***/
GLOBAL void siPortInvalid(
                          agsaRoot_t  *agRoot,
                          agsaPort_t  *pPort
                          );

GLOBAL agsaDeviceDesc_t *siPortSASDeviceAdd(
                                    agsaRoot_t        *agRoot,
                                    agsaPort_t        *pPort,
                                    agsaSASIdentify_t sasIdentify,
                                    bit32             sasInitiator,
                                    bit32             smpTimeout,
                                    bit32             itNexusTimeout,
                                    bit32             firstBurstSize,
                                    bit8              dTypeSRate,
                                    bit32              flag
                                    );

GLOBAL void siPortDeviceRemove(
                              agsaRoot_t        *agRoot,
                              agsaPort_t        *pPort,
                              agsaDeviceDesc_t  *pDevice,
                              bit32             unmap
                              );

GLOBAL agsaDeviceDesc_t *siPortSATADeviceAdd(
                                              agsaRoot_t              *agRoot,
                                              agsaPort_t              *pPort,
                                              agsaDeviceDesc_t        *pSTPBridge,
                                              bit8                    *pSignature,
                                              bit8                    pm,
                                              bit8                    pmField,
                                              bit32                   smpReqTimeout,
                                              bit32                   itNexusTimeout,
                                              bit32                   firstBurstSize,
                                              bit8                    dTypeSRate,
                                              bit32                   flag
                                              );

GLOBAL void siPortDeviceListRemove(
                              agsaRoot_t        *agRoot,
                              agsaPort_t        *pPort,
                              agsaDeviceDesc_t  *pDevice
                              );

/*** SASATA.C ***/
GLOBAL void siSATASignatureCpy(
                                bit8  *pDstSignature,
                                bit8  *pSrcSignature
                                );

/*** SASSP.C ***/

/*** SAHW.C ***/
#ifdef SA_ENABLE_HDA_FUNCTIONS
GLOBAL bit32 siHDAMode(
                      agsaRoot_t  *agRoot,
                      bit32       HDAMode,
                      agsaFwImg_t *userFwImg
                      );

GLOBAL bit32 siHDAMode_V(
                      agsaRoot_t  *agRoot,
                      bit32       HDAMode,
                      agsaFwImg_t *userFwImg
                      );

#endif

GLOBAL bit32 siBar4Shift(
  agsaRoot_t  *agRoot,
  bit32       shiftValue
  );


GLOBAL bit32 siSoftReset(
                       agsaRoot_t  *agRoot,
                       bit32       signature
                       );

GLOBAL bit32 siSpcSoftReset(
                       agsaRoot_t  *agRoot,
                       bit32       signature
                       );

GLOBAL void siChipReset(
                       agsaRoot_t  *agRoot
                       );


GLOBAL bit32 siChipResetV(
                       agsaRoot_t  *agRoot,
                       bit32       signature
                       );

GLOBAL void siChipResetSpc(
                      agsaRoot_t  *agRoot
                      );


/*** SAUTIL.C ***/
GLOBAL void siPrintBuffer(
                          bit32                 debugLevel,
                          siPrintType           type,
                          char                  *header,
                          void                  *a,
                          bit32                 length
                          );
int siIsHexDigit(char a);
GLOBAL FORCEINLINE void* si_memcpy(void *dst, void *src, bit32 count);
GLOBAL FORCEINLINE void* si_memset(void *s, int c, bit32 n);

GLOBAL void siDumpActiveIORequests(
                          agsaRoot_t              *agRoot,
                          bit32                   count);


GLOBAL void siClearActiveIORequests(   agsaRoot_t  *agRoot);

GLOBAL void siCountActiveIORequestsOnDevice( agsaRoot_t *agRoot,  bit32      device );
GLOBAL void siClearActiveIORequestsOnDevice( agsaRoot_t *agRoot,  bit32      device );



/*** SAINT.C ***/
GLOBAL void siEventPhyUpRcvd(
                             agsaRoot_t  *agRoot,
                             bit32       phyId,
                             agsaSASIdentify_t *agSASIdentify,
                             bit32       portId,
                             bit32       npipps,
                             bit8        linkRate
                             );

GLOBAL void siEventSATASignatureRcvd(
                                    agsaRoot_t    *agRoot,
                                    bit32         phyId,
                                    void          *pMsg,
                                    bit32         portId,
                                    bit32         npipps,
                                    bit8          linkRate
                                    );

GLOBAL FORCEINLINE void siIODone(
                     agsaRoot_t          *agRoot,
                     agsaIORequestDesc_t *pRequest,
                     bit32               status,
                     bit32               sspTag
                     );

GLOBAL void siAbnormal(
                       agsaRoot_t          *agRoot,
                       agsaIORequestDesc_t *pRequest,
                       bit32               status,
                       bit32               param,
                       bit32               sspTag
                       );

GLOBAL void siDifAbnormal(
                         agsaRoot_t          *agRoot,
                         agsaIORequestDesc_t *pRequest,
                         bit32               status,
                         bit32               param,
                         bit32               sspTag,
                         bit32               *pMsg1
                         );

GLOBAL void siEventSSPResponseWtDataRcvd(
                                        agsaRoot_t                *agRoot,
                                        agsaIORequestDesc_t       *pRequest,
                                        agsaSSPResponseInfoUnit_t *pRespIU,
                                        bit32                     param,
                                        bit32                     sspTag
                                        );

GLOBAL void siSMPRespRcvd(
                          agsaRoot_t              *agRoot,
                          agsaSMPCompletionRsp_t  *pIomb,
                          bit32                   payloadSize,
                          bit32                   tag
                          );

GLOBAL void siEventSATAResponseWtDataRcvd(
                                          agsaRoot_t          *agRoot,
                                          agsaIORequestDesc_t *pRequest,
                                          bit32               *agFirstDword,
                                          bit32               *pResp,
                                          bit32               lengthResp
                                          );

/*** SADISC.C ***/
GLOBAL bit32 siRemoveDevHandle(
                              agsaRoot_t      *agRoot,
                              agsaDevHandle_t *agDevHandle
                              );

/*** SAMPIRSP.C ***/
GLOBAL FORCEINLINE bit32 mpiParseOBIomb(
                            agsaRoot_t            *agRoot,
                            bit32                 *pMsg1,
                            mpiMsgCategory_t      category,
                            bit16                 opcode
                            );

GLOBAL bit32 mpiEchoRsp(
                        agsaRoot_t          *agRoot,
                        agsaEchoRsp_t       *pIomb
                        );

GLOBAL bit32 mpiGetNVMDataRsp(
  agsaRoot_t          *agRoot,
  agsaGetNVMDataRsp_t *pIomb
  );

GLOBAL bit32 mpiHWevent(
  agsaRoot_t        *agRoot,
  agsaHWEvent_SPC_OUB_t  *pIomb
  );

GLOBAL bit32 mpiPhyStartEvent(
  agsaRoot_t        *agRoot,
  agsaHWEvent_Phy_OUB_t  *pIomb
  );

GLOBAL bit32 mpiPhyStopEvent(
  agsaRoot_t        *agRoot,
  agsaHWEvent_Phy_OUB_t  *pIomb
  );

GLOBAL bit32 mpiSMPCompletion(
  agsaRoot_t             *agRoot,
  agsaSMPCompletionRsp_t *pIomb
  );

GLOBAL bit32 mpiGetDevInfoRspSpc(
  agsaRoot_t          *agRoot,
  agsaGetDevInfoRsp_t *pIomb
  );

GLOBAL bit32 mpiGetPhyProfileRsp(
  agsaRoot_t             *agRoot,
  agsaGetPhyProfileRspV_t *pIomb
  );

GLOBAL bit32 mpiSetPhyProfileRsp(
  agsaRoot_t             *agRoot,
  agsaSetPhyProfileRspV_t *pIomb
  );

GLOBAL bit32 mpiGetDevInfoRsp(
  agsaRoot_t          *agRoot,
  agsaGetDevInfoRspV_t *pIomb
  );

GLOBAL bit32 mpiGetDevHandleRsp(
  agsaRoot_t            *agRoot,
  agsaGetDevHandleRsp_t *pIomb
  );

GLOBAL bit32 mpiPhyCntrlRsp(
  agsaRoot_t             *agRoot,
  agsaLocalPhyCntrlRsp_t *pIomb
  );

GLOBAL bit32 mpiDeviceRegRsp(
  agsaRoot_t                  *agRoot,
  agsaDeviceRegistrationRsp_t *pIomb
  );

GLOBAL bit32 mpiDeregDevHandleRsp(
  agsaRoot_t              *agRoot,
  agsaDeregDevHandleRsp_t *pIomb
  );

GLOBAL FORCEINLINE bit32 mpiSSPCompletion(
  agsaRoot_t        *agRoot,
  bit32             *pIomb
  );

GLOBAL FORCEINLINE bit32 mpiSATACompletion(
  agsaRoot_t        *agRoot,
  bit32             *pIomb
  );

GLOBAL bit32 mpiSSPEvent(
  agsaRoot_t        *agRoot,
  agsaSSPEventRsp_t *pIomb
  );

GLOBAL bit32 mpiSATAEvent(
  agsaRoot_t         *agRoot,
  agsaSATAEventRsp_t *pIomb
  );

GLOBAL bit32 mpiFwFlashUpdateRsp(
  agsaRoot_t             *agRoot,
  agsaFwFlashUpdateRsp_t *payload
  );


GLOBAL bit32 mpiFwExtFlashUpdateRsp(
  agsaRoot_t             *agRoot,
  agsaFwFlashOpExtRsp_t *payload
  );

#ifdef SPC_ENABLE_PROFILE
GLOBAL bit32 mpiFwProfileRsp(
  agsaRoot_t             *agRoot,
  agsaFwProfileRsp_t *payload
  );
#endif
GLOBAL bit32 mpiSetNVMDataRsp(
  agsaRoot_t          *agRoot,
  agsaSetNVMDataRsp_t *pIomb
  );

GLOBAL bit32 mpiSSPAbortRsp(
  agsaRoot_t         *agRoot,
  agsaSSPAbortRsp_t  *pIomb
  );

GLOBAL bit32 mpiSATAAbortRsp(
  agsaRoot_t         *agRoot,
  agsaSATAAbortRsp_t *pIomb
  );

GLOBAL bit32 mpiGPIORsp(
  agsaRoot_t          *agRoot,
  agsaGPIORsp_t       *pIomb
  );

GLOBAL bit32 mpiGPIOEventRsp(
  agsaRoot_t          *agRoot,
  agsaGPIOEvent_t     *pIomb
  );

GLOBAL bit32 mpiSASDiagStartEndRsp(
  agsaRoot_t               *agRoot,
  agsaSASDiagStartEndRsp_t *pIomb
  );

GLOBAL bit32 mpiSASDiagExecuteRsp(
  agsaRoot_t               *agRoot,
  agsaSASDiagExecuteRsp_t  *pIomb
  );

GLOBAL bit32 mpiGeneralEventRsp(
  agsaRoot_t               *agRoot,
  agsaGeneralEventRsp_t    *pIomb
  );

GLOBAL bit32 mpiSSPReqReceivedNotify(
  agsaRoot_t *agRoot,
  agsaSSPReqReceivedNotify_t *pMsg1
  );

GLOBAL bit32 mpiDeviceHandleArrived(
  agsaRoot_t *agRoot,
  agsaDeviceHandleArrivedNotify_t *pMsg1
  );

GLOBAL bit32 mpiGetTimeStampRsp(
  agsaRoot_t               *agRoot,
  agsaGetTimeStampRsp_t    *pIomb
  );

GLOBAL bit32 mpiSASHwEventAckRsp(
  agsaRoot_t               *agRoot,
  agsaSASHwEventAckRsp_t   *pIomb
  );

GLOBAL bit32 mpiSetDevInfoRsp(
  agsaRoot_t             *agRoot,
  agsaSetDeviceInfoRsp_t *pIomb
  );

GLOBAL bit32 mpiSetDeviceStateRsp(
  agsaRoot_t              *agRoot,
  agsaSetDeviceStateRsp_t *pIomb
  );

GLOBAL bit32 mpiGetDeviceStateRsp(
  agsaRoot_t             *agRoot,
  agsaGetDeviceStateRsp_t *pIomb
  );

GLOBAL bit32 mpiSasReInitializeRsp(
  agsaRoot_t               *agRoot,
  agsaSasReInitializeRsp_t *pIomb
  );

GLOBAL bit32 mpiSetControllerConfigRsp(
  agsaRoot_t               *agRoot,
  agsaSetControllerConfigRsp_t *pIomb
  );

GLOBAL bit32 mpiGetControllerConfigRsp(
  agsaRoot_t                  *agRoot,
  agsaGetControllerConfigRsp_t *pIomb
  );

GLOBAL bit32  mpiKekManagementRsp(
    agsaRoot_t               *agRoot,
    agsaKekManagementRsp_t   *pIomb
  );

GLOBAL bit32  mpiDekManagementRsp(
    agsaRoot_t               *agRoot,
    agsaDekManagementRsp_t   *pIomb
  );

GLOBAL bit32 mpiOperatorManagementRsp(
  agsaRoot_t               *agRoot,
  agsaOperatorMangmenRsp_t *pIomb
  );

GLOBAL bit32 mpiBistRsp(
  agsaRoot_t           *agRoot,
  agsaEncryptBistRsp_t *pIomb
  );

GLOBAL bit32 mpiSetOperatorRsp(
  agsaRoot_t               *agRoot,
  agsaSetOperatorRsp_t    *pIomb
  );

GLOBAL bit32 mpiGetOperatorRsp(
  agsaRoot_t               *agRoot,
  agsaGetOperatorRsp_t    *pIomb
  );

GLOBAL bit32 mpiDifEncOffloadRsp(
  agsaRoot_t               *agRoot,
  agsaDifEncOffloadRspV_t  *pIomb
  );

GLOBAL bit32 mpiGetVHistRsp(
   agsaRoot_t          *agRoot,
   agsaGetVHistCapRsp_t *pIomb
  );


/*** SAMPICMD.C ***/
GLOBAL bit32 mpiBuildCmd(
  agsaRoot_t        *agRoot,
  bit32             *payload,
  mpiMsgCategory_t  category,
  bit16             opcode,
  bit16             size,
  bit32             queueNum
  );


GLOBAL bit32 mpiVHistCapCmd(
  agsaRoot_t    *agRoot,
  agsaContext_t *agContext,
  bit32         queueNum,
  bit32         Channel,
  bit32         NumBitLo,
  bit32         NumBitHi,
  bit32         PcieAddrLo,
  bit32         PcieAddrHi,
  bit32         ByteCount );

GLOBAL bit32 mpiEchoCmd(
  agsaRoot_t          *agRoot,
  bit32               queueNum,
  agsaContext_t       *agContext,
  void                *echoPayload
  );

GLOBAL bit32 mpiGetPhyProfileCmd(
  agsaRoot_t          *agRoot,
  agsaContext_t       *agContext,
  bit32                Operation,
  bit32                PhyId,
  void                *agCB
  );

GLOBAL bit32 mpiSetPhyProfileCmd(
  agsaRoot_t    *agRoot,
  agsaContext_t *agContext,
  bit32         Operation,
  bit32         PhyId,
  bit32         length,
  void *        buffer
  );

GLOBAL bit32 mpiPhyStartCmd(
  agsaRoot_t          *agRoot,
  bit32               tag,
  bit32               phyId,
  agsaPhyConfig_t     *agPhyConfig,
  agsaSASIdentify_t   *agSASIdentify,
  bit32               queueNum
  );

GLOBAL bit32 mpiPhyStopCmd(
  agsaRoot_t          *agRoot,
  bit32               tag,
  bit32               phyId,
  bit32               queueNum
  );

GLOBAL bit32 mpiSMPCmd(
  agsaRoot_t             *agRoot,
  void                   *pIomb,
  bit16                  opcode,
  agsaSMPCmd_t           *payload,
  bit8                   inq,
  bit8                   outq
  );

GLOBAL bit32 mpiDeregDevHandleCmd(
  agsaRoot_t          *agRoot,
  agsaContext_t       *agContext,
  agsaDeviceDesc_t    *pDevice,
  bit32               deviceId,
  bit32               portId,
  bit32               queueNum
  );

GLOBAL bit32 mpiGetDeviceHandleCmd(
  agsaRoot_t          *agRoot,
  agsaContext_t       *agContext,
  bit32               portId,
  bit32               flags,
  bit32               maxDevs,
  bit32               queueNum,
  bit32               skipCount
  );

GLOBAL bit32 mpiLocalPhyControlCmd(
  agsaRoot_t          *agRoot,
  bit32               tag,
  bit32               phyId,
  bit32               operation,
  bit32               queueNum
  );

GLOBAL bit32 mpiGetDeviceInfoCmd(
  agsaRoot_t          *agRoot,
  agsaContext_t       *agContext,
  bit32               deviceid,
  bit32               option,
  bit32               queueNum
  );

GLOBAL bit32 mpiDevHandleAcceptCmd(
  agsaRoot_t          *agRoot,
  agsaContext_t       *agContext,
  bit32               ctag,
  bit32               deviceId,
  bit32               action,
  bit32               flag,
  bit32               itlnx,
  bit32               queueNum
  );

GLOBAL bit32 mpiPortControlRsp(
  agsaRoot_t           *agRoot,
  agsaPortControlRsp_t *pIomb
  );

GLOBAL bit32 mpiSMPAbortRsp(
  agsaRoot_t         *agRoot,
  agsaSMPAbortRsp_t  *pIomb
  );

GLOBAL bit32 siGetRegisterDumpGSM(
  agsaRoot_t        *agRoot,
  void              *destinationAddress,
  bit32             regDumpNum,
  bit32             regDumpOffset,
  bit32             len
  );

GLOBAL bit32 mpiNVMReadRegDumpCmd(
  agsaRoot_t          *agRoot,
  agsaContext_t       *agContext,
  bit32               queueNum,
  bit32               cpuId,
  bit32               cOffset,
  bit32               addrHi,
  bit32               addrLo,
  bit32               len
  );

GLOBAL bit32 mpiDeviceHandleRemoval(
  agsaRoot_t                *agRoot,
  agsaDeviceHandleRemoval_t *pMsg1);

GLOBAL bit32 mpiGetNVMDCmd(
  agsaRoot_t          *agRoot,
  agsaContext_t       *agContext,
  agsaNVMDData_t      *NVMDInfo,
  bit32               queueNum
  );

GLOBAL bit32 mpiSetNVMDCmd(
  agsaRoot_t          *agRoot,
  agsaContext_t       *agContext,
  agsaNVMDData_t      *NVMDInfo,
  bit32               queueNum
  );

GLOBAL bit32 mpiSetDeviceInfoCmd(
  agsaRoot_t          *agRoot,
  agsaContext_t       *agContext,
  bit32               deviceid,
  bit32               option,
  bit32               queueNum,
  bit32               param,
  ossaSetDeviceInfoCB_t   agCB
  );

GLOBAL bit32 mpiSetDeviceStateCmd(
  agsaRoot_t          *agRoot,
  agsaContext_t       *agContext,
  bit32               deviceId,
  bit32               nds,
  bit32               queueNum
  );

GLOBAL bit32 mpiGetDeviceStateCmd(
  agsaRoot_t          *agRoot,
  agsaContext_t       *agContext,
  bit32               deviceId,
  bit32               queueNum
  );

GLOBAL bit32 mpiSasReinitializeCmd(
  agsaRoot_t        *agRoot,
  agsaContext_t     *agContext,
  agsaSASReconfig_t *agSASConfig,
  bit32             queueNum
  );

GLOBAL bit32 mpiSGpioRsp(
  agsaRoot_t       *agRoot,
  agsaSGpioRsp_t   *pInIomb
  );

GLOBAL bit32 mpiPCIeDiagExecuteRsp(
  agsaRoot_t    *agRoot,
  void          *pInIomb
  );

GLOBAL bit32 mpiGetDFEDataRsp(
  agsaRoot_t    *agRoot,
  void          *pInIomb
  );

GLOBAL bit32 mpiGetVisDataRsp(
  agsaRoot_t    *agRoot,
  void          *pIomb
  );

GLOBAL bit32 mpiSetControllerConfigCmd(
  agsaRoot_t        *agRoot,
  agsaContext_t     *agContext,
  agsaSetControllerConfigCmd_t *agControllerConfig,
  bit32             queueNum,
  bit8              modePageContext
  );

GLOBAL bit32 mpiGetControllerConfigCmd(
   agsaRoot_t        *agRoot,
   agsaContext_t     *agContext,
   agsaGetControllerConfigCmd_t *agControllerConfig,
   bit32             queueNum
   );

GLOBAL bit32 mpiKekManagementCmd(
   agsaRoot_t        *agRoot,
   agsaContext_t     *agContext,
   agsaKekManagementCmd_t *agKekMgmt,
   bit32             queueNum
   );

GLOBAL bit32 mpiDekManagementCmd(
   agsaRoot_t        *agRoot,
   agsaContext_t     *agContext,
   agsaDekManagementCmd_t *agDekMgmt,
   bit32             queueNum
   );

GLOBAL bit32 mpiOperatorManagementCmd(
  agsaRoot_t                *agRoot,
  bit32                     queueNum,
  agsaContext_t             *agContext,
  agsaOperatorMangmentCmd_t *operatorcode );

GLOBAL bit32 mpiEncryptBistCmd(
  agsaRoot_t        *agRoot,
  bit32              queueNum,
  agsaContext_t     *agContext,
  agsaEncryptBist_t *bist );

GLOBAL bit32 mpiSetOperatorCmd(
  agsaRoot_t                *agRoot,
  bit32                      queueNum,
  agsaContext_t             *agContext,
  agsaSetOperatorCmd_t      *operatorcode
  );

GLOBAL bit32 mpiGetOperatorCmd(
  agsaRoot_t                *agRoot,
  bit32                      queueNum,
  agsaContext_t             *agContext,
  agsaGetOperatorCmd_t      *operatorcode
  );

GLOBAL bit32 mpiDIFEncryptionOffloadCmd(
   agsaRoot_t                *agRoot,
   agsaContext_t             *agContext,
   bit32                     queueNum,
   bit32                     op,
   agsaDifEncPayload_t      *agDifEncOffload,
   ossaDIFEncryptionOffloadStartCB_t agCB
   );

bit32 siOurMSIXInterrupt(agsaRoot_t *agRoot,bit32 interruptVectorIndex);
void siDisableMSIXInterrupts(agsaRoot_t *agRoot,bit32 interruptVectorIndex);
void siReenableMSIXInterrupts(agsaRoot_t *agRoot,bit32 interruptVectorIndex);

bit32 siOurMSIInterrupt(agsaRoot_t *agRoot,bit32 interruptVectorIndex);
void siDisableMSIInterrupts(agsaRoot_t *agRoot,bit32 interruptVectorIndex);
void siReenableMSIInterrupts(agsaRoot_t *agRoot,bit32 interruptVectorIndex);


bit32 siOurLegacyInterrupt(agsaRoot_t *agRoot,bit32 interruptVectorIndex);
void siDisableLegacyInterrupts(agsaRoot_t *agRoot,bit32 interruptVectorIndex);
void siReenableLegacyInterrupts(agsaRoot_t *agRoot,bit32 interruptVectorIndex);

bit32 siOurMSIX_V_Interrupt(agsaRoot_t *agRoot,bit32 interruptVectorIndex);
bit32 siOurMSI_V_Interrupt(agsaRoot_t *agRoot,bit32 interruptVectorIndex);
bit32 siOurLegacy_V_Interrupt(agsaRoot_t *agRoot,bit32 interruptVectorIndex);

void siDisableMSIX_V_Interrupts(agsaRoot_t *agRoot,bit32 interruptVectorIndex);
void siDisableMSI_V_Interrupts(agsaRoot_t *agRoot,bit32 interruptVectorIndex);
void siDisableLegacy_V_Interrupts(agsaRoot_t *agRoot,bit32 interruptVectorIndex);

void siReenableMSIX_V_Interrupts(agsaRoot_t *agRoot,bit32 interruptVectorIndex);
void siReenableMSI_V_Interrupts(agsaRoot_t *agRoot,bit32 interruptVectorIndex);
void siReenableLegacy_V_Interrupts(agsaRoot_t *agRoot,bit32 interruptVectorIndex);


GLOBAL void siUpdateBarOffsetTable(agsaRoot_t     *agRoot, bit32   Spc_Type);

GLOBAL void siPciCpyMem(agsaRoot_t *agRoot,
                       bit32 soffset,
                       const void *dst,
                       bit32 DWcount,
                       bit32 busBaseNumber
                       );

GLOBAL void siHalRegWriteExt(
                             agsaRoot_t  *agRoot,
                             bit32       generic,
                             bit32       regOffset,
                             bit32       regValue
                             );

GLOBAL bit32 siHalRegReadExt( agsaRoot_t  *agRoot,
                             bit32       generic,
                             bit32       regOffset
                             );

#ifdef SA_FW_TIMER_READS_STATUS
bit32 siReadControllerStatus(
                                  agsaRoot_t      *agRoot,
                                  bit32           Event,
                                  void *          pParm
                                  );
#endif /* SA_FW_TIMER_READS_STATUS */


#if defined(SALLSDK_DEBUG)
void sidump_hwConfig(agsaHwConfig_t  *hwConfig);
void sidump_swConfig(agsaSwConfig_t  *swConfig);
void sidump_Q_config( agsaQueueConfig_t *queueConfig );
#endif
GLOBAL bit32 siGetTableOffset(
              agsaRoot_t *agRoot,
              bit32  TableOffsetInTable
              );

GLOBAL bit32 siGetPciBar(
              agsaRoot_t *agRoot
              );

GLOBAL bit32 siScratchDump(agsaRoot_t *agRoot);

void si_macro_check(agsaRoot_t *agRoot);

GLOBAL bit32 si_check_V_HDA(agsaRoot_t *agRoot);
GLOBAL bit32 si_check_V_Ready(agsaRoot_t *agRoot);

GLOBAL void siPCITriger(agsaRoot_t *agRoot);

GLOBAL void siCheckQs(agsaRoot_t *agRoot);


GLOBAL bit32 smIsCfg_V_ANY( agsaRoot_t *agRoot);
GLOBAL bit32 smIS_SPC( agsaRoot_t *agRoot);
GLOBAL bit32 smIS_HIL( agsaRoot_t *agRoot);
GLOBAL bit32 smIS_SPC6V( agsaRoot_t *agRoot);
GLOBAL bit32 smIS_SPC12V( agsaRoot_t *agRoot);
GLOBAL bit32 smIS_SPCV( agsaRoot_t *agRoot);
GLOBAL bit32 smIS_ENCRYPT( agsaRoot_t *agRoot);
GLOBAL bit32 smIS_SPCV_2_IOP( agsaRoot_t *agRoot);
#endif  /*__SAPROTO_H__ */