1 /*******************************************************************************
2 *Copyright (c) 2014 PMC-Sierra, Inc. All rights reserved.
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
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.
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
23 ********************************************************************************/
24 /*******************************************************************************/
26 * \brief The file defines the declaration of tSDK APIs
32 /******************************************************************************/
37 /********************************************************************************
38 * SA LL Function Declaration *
39 ********************************************************************************/
41 /***************************************************************************
42 * Definition of interrupt related functions start *
43 ***************************************************************************/
46 GLOBAL bit32 FORCEINLINE saDelayedInterruptHandler(
48 bit32 interruptVectorIndex,
52 GLOBAL bit32 FORCEINLINE saInterruptHandler(
54 bit32 interruptVectorIndex
57 GLOBAL void saSystemInterruptsActive(
59 agBOOLEAN sysIntsActive
62 GLOBAL FORCEINLINE void saSystemInterruptsEnable(
64 bit32 interruptVectorIndex
66 /***************************************************************************
67 * Definition of interrupt related functions end *
68 ***************************************************************************/
71 /***************************************************************************
72 * Definition of timer related functions start *
73 ***************************************************************************/
74 GLOBAL void saTimerTick(agsaRoot_t *agRoot);
75 /***************************************************************************
76 * Definition of timer related functions end *
77 ***************************************************************************/
79 /***************************************************************************
80 * Definition of initialization related functions start *
81 ***************************************************************************/
82 GLOBAL void saGetRequirements(
84 agsaSwConfig_t *swConfig,
85 agsaMemoryRequirement_t *memoryRequirement,
90 GLOBAL bit32 saInitialize(
92 agsaMemoryRequirement_t *memoryAllocated,
93 agsaHwConfig_t *hwConfig,
94 agsaSwConfig_t *swConfig,
97 /***************************************************************************
98 * Definition of initialization related functions end *
99 ***************************************************************************/
101 /***************************************************************************
102 * Definition of hardware related functions start *
103 ***************************************************************************/
104 GLOBAL void saHwReset(
110 GLOBAL void saHwShutdown(agsaRoot_t *agRoot);
112 /***************************************************************************
113 * Definition of hardware related functions end *
114 ***************************************************************************/
116 /***************************************************************************
117 * Definition of phy related functions start *
118 ***************************************************************************/
119 GLOBAL bit32 saPhyStart(
121 agsaContext_t *agContext,
124 agsaPhyConfig_t *agPhyConfig,
125 agsaSASIdentify_t *agSASIdentify
128 GLOBAL bit32 saPhyStop(
130 agsaContext_t *agContext,
136 GLOBAL bit32 saLocalPhyControl(
138 agsaContext_t *agContext,
142 ossaLocalPhyControlCB_t agCB
145 GLOBAL bit32 saGetPhyProfile(
147 agsaContext_t *agContext,
153 GLOBAL bit32 saSetPhyProfile (
155 agsaContext_t *agContext,
163 GLOBAL bit32 saHwEventAck(
165 agsaContext_t *agContext,
167 agsaEventSource_t *eventSource,
173 /***************************************************************************
174 * Definition of phy related functions end *
175 ***************************************************************************/
177 /***************************************************************************
178 * Definition of discovery related functions start *
179 ***************************************************************************/
180 GLOBAL bit32 saDiscover(
182 agsaPortContext_t *agPortContext,
186 /***************************************************************************
187 * Definition of discovery related functions end *
188 ***************************************************************************/
190 /***************************************************************************
191 * Definition of frame related functions start *
192 ***************************************************************************/
193 GLOBAL bit32 saFrameReadBit32(
195 agsaFrameHandle_t agFrame,
199 GLOBAL void saFrameReadBlock(
201 agsaFrameHandle_t agFrame,
206 /***************************************************************************
207 * Definition of frame related functions end *
208 ***************************************************************************/
210 /***************************************************************************
211 * Definition of SATA related functions start *
212 ***************************************************************************/
213 GLOBAL bit32 saSATAStart(
215 agsaIORequest_t *agIORequest,
217 agsaDevHandle_t *agDevHandle,
219 agsaSATAInitiatorRequest_t *agSATAReq,
221 ossaSATACompletedCB_t agCB
224 GLOBAL bit32 saSATAAbort(
226 agsaIORequest_t *agIORequest,
228 agsaDevHandle_t *agDevHandle,
231 ossaGenericAbortCB_t agCB
234 /***************************************************************************
235 * Definition of SATA related functions end *
236 ***************************************************************************/
238 /***************************************************************************
239 * Definition of SAS related functions start *
240 ***************************************************************************/
242 GLOBAL bit32 saSendSMPIoctl(
244 agsaDevHandle_t *agDevHandle,
246 agsaSMPFrame_t *pSMPFrame,
247 ossaSMPCompletedCB_t agCB
250 GLOBAL bit32 saSMPStart(
252 agsaIORequest_t *agIORequest,
254 agsaDevHandle_t *agDevHandle,
256 agsaSASRequestBody_t *agRequestBody,
257 ossaSMPCompletedCB_t agCB
260 GLOBAL bit32 saSMPAbort(
262 agsaIORequest_t *agIORequest,
264 agsaDevHandle_t *agDevHandle,
267 ossaGenericAbortCB_t agCB
270 GLOBAL bit32 saSSPStart(
272 agsaIORequest_t *agIORequest,
274 agsaDevHandle_t *agDevHandle,
276 agsaSASRequestBody_t *agRequestBody,
277 agsaIORequest_t *agTMRequest,
278 ossaSSPCompletedCB_t agCB
282 GLOBAL void *saFastSSPPrepare(
284 agsaFastCommand_t *fc,
285 ossaSSPCompletedCB_t cb,
288 GLOBAL bit32 saFastSSPSend(void *ioHandle);
289 GLOBAL bit32 saFastSSPCancel(void *ioHandle);
292 GLOBAL bit32 saSSPAbort(
294 agsaIORequest_t *agIORequest,
296 agsaDevHandle_t *agDevHandle,
299 ossaGenericAbortCB_t agCB
302 GLOBAL void saGetDifErrorDetails(
304 agsaIORequest_t *agIORequest,
305 agsaDifDetails_t *difDetails
308 GLOBAL bit32 saRegisterEventCallback(
310 bit32 eventSourceType,
311 ossaGenericCB_t callbackPtr
314 /***************************************************************************
315 * Definition of SAS related functions end *
316 ***************************************************************************/
318 /***************************************************************************
319 * Definition of Device related functions start *
320 ***************************************************************************/
321 GLOBAL bit32 saRegisterNewDevice(
323 agsaContext_t *agContext,
325 agsaDeviceInfo_t *agDeviceInfo,
326 agsaPortContext_t *agPortContext,
327 bit16 hostAssignedDeviceId
330 GLOBAL bit32 saDeregisterDeviceHandle(
332 agsaContext_t *agContext,
333 agsaDevHandle_t *agDevHandle,
337 GLOBAL bit32 saGetDeviceHandles(
339 agsaContext_t *agContext,
341 agsaPortContext_t *agPortContext,
343 agsaDevHandle_t *agDev[],
348 GLOBAL bit32 saGetDeviceInfo(
350 agsaContext_t *agContext,
353 agsaDevHandle_t *agDevHandle
356 GLOBAL bit32 saGetDeviceState(
358 agsaContext_t *agContext,
360 agsaDevHandle_t *agDevHandle
363 GLOBAL bit32 saSetDeviceInfo(
365 agsaContext_t *agContext,
367 agsaDevHandle_t *agDevHandle,
370 ossaSetDeviceInfoCB_t agCB
373 GLOBAL bit32 saSetDeviceState(
375 agsaContext_t *agContext,
377 agsaDevHandle_t *agDevHandle,
381 /***************************************************************************
382 * Definition of Device related functions end *
383 ***************************************************************************/
385 /***************************************************************************
386 * Definition of Misc related functions start *
387 ***************************************************************************/
388 GLOBAL bit32 saFwFlashUpdate(
390 agsaContext_t *agContext,
392 agsaUpdateFwFlash_t *flashUpdateInfo
395 GLOBAL bit32 saFlashExtExecute (
397 agsaContext_t *agContext,
399 agsaFlashExtExecute_t *agFlashExtExe
402 #ifdef SPC_ENABLE_PROFILE
403 GLOBAL bit32 saFwProfile(
405 agsaContext_t *agContext,
407 agsaFwProfile_t *fwProfileInfo
411 GLOBAL bit32 saEchoCommand(
413 agsaContext_t *agContext,
418 GLOBAL bit32 saGetControllerInfo(
420 agsaControllerInfo_t *controllerInfo
423 GLOBAL bit32 saGetControllerStatus(
425 agsaControllerStatus_t *controllerStatus
428 GLOBAL bit32 saGetControllerEventLogInfo(
430 agsaControllerEventLog_t *eventLogInfo
433 GLOBAL bit32 saGpioEventSetup(
435 agsaContext_t *agContext,
437 agsaGpioEventSetupInfo_t *gpioEventSetupInfo
440 GLOBAL bit32 saGpioPinSetup(
442 agsaContext_t *agContext,
444 agsaGpioPinSetupInfo_t *gpioPinSetupInfo
447 GLOBAL bit32 saGpioRead(
449 agsaContext_t *agContext,
453 GLOBAL bit32 saGpioWrite(
455 agsaContext_t *agContext,
461 GLOBAL bit32 saSASDiagExecute(
463 agsaContext_t *agContext,
465 agsaSASDiagExecute_t *diag
468 GLOBAL bit32 saSASDiagStartEnd(
470 agsaContext_t *agContext,
476 GLOBAL bit32 saGetTimeStamp(
478 agsaContext_t *agContext,
482 GLOBAL bit32 saPortControl(
484 agsaContext_t *agContext,
486 agsaPortContext_t *agPortContext,
492 GLOBAL bit32 saGetRegisterDump(
494 agsaContext_t *agContext,
496 agsaRegDumpInfo_t *regDumpInfo
499 GLOBAL bit32 saGetForensicData(
501 agsaContext_t *agContext,
502 agsaForensicData_t *forensicData
505 bit32 saGetIOErrorStats(
507 agsaContext_t *agContext,
511 bit32 saGetIOEventStats(
513 agsaContext_t *agContext,
517 GLOBAL bit32 saGetNVMDCommand(
519 agsaContext_t *agContext,
521 agsaNVMDData_t *NVMDInfo
524 GLOBAL bit32 saSetNVMDCommand(
526 agsaContext_t *agContext,
528 agsaNVMDData_t *NVMDInfo
531 GLOBAL bit32 saReconfigSASParams(
533 agsaContext_t *agContext,
535 agsaSASReconfig_t *agSASConfig
538 GLOBAL bit32 saSgpio(
540 agsaContext_t *agContext,
542 agsaSGpioReqResponse_t *pSGpioReq
545 GLOBAL bit32 saPCIeDiagExecute(
547 agsaContext_t *agContext,
549 agsaPCIeDiagExecute_t *diag);
552 GLOBAL bit32 saEncryptSelftestExecute(
554 agsaContext_t *agContext,
558 void *TestDescriptor);
560 GLOBAL bit32 saSetOperator(
562 agsaContext_t *agContext,
567 GLOBAL bit32 saGetOperator(
569 agsaContext_t *agContext,
575 GLOBAL bit32 saOperatorManagement(
577 agsaContext_t *agContext,
582 agsaEncryptKekBlob_t *kblob);
585 /***************************************************************************
586 * Definition of Misc. related functions end *
587 ***************************************************************************/
589 GLOBAL bit32 saSetControllerConfig(
595 agsaContext_t *agContext
599 GLOBAL bit32 saGetControllerConfig(
605 agsaContext_t *agContext
608 GLOBAL bit32 saEncryptDekCacheUpdate(
610 agsaContext_t *agContext,
613 bit32 dekTableSelect,
617 bit32 dekNumberOfEntries,
619 bit32 dekTableKeyEntrySize
622 GLOBAL bit32 saEncryptDekCacheInvalidate(
624 agsaContext_t *agContext,
630 GLOBAL bit32 saEncryptGetMode(
632 agsaContext_t *agContext,
633 agsaEncryptInfo_t *encryptInfo
636 GLOBAL bit32 saEncryptSetMode (
638 agsaContext_t *agContext,
640 agsaEncryptInfo_t *mode
643 GLOBAL bit32 saEncryptKekInvalidate(
645 agsaContext_t *agContext,
650 GLOBAL bit32 saEncryptKekUpdate(
652 agsaContext_t *agContext,
656 bit32 wrapperKekIndex,
658 agsaEncryptKekBlob_t *encryptKekBlob
661 #ifdef HIALEAH_ENCRYPTION
662 GLOBAL bit32 saEncryptHilUpdate(
664 agsaContext_t *agContext,
667 #endif /* HIALEAH_ENCRYPTION */
669 GLOBAL bit32 saGetDFEData(
671 agsaContext_t *agContext,
679 GLOBAL bit32 saFatalInterruptHandler(
681 bit32 interruptVectorIndex
685 GLOBAL bit32 saDIFEncryptionOffloadStart(
687 agsaContext_t *agContext,
690 agsaDifEncPayload_t *agsaDifEncPayload,
691 ossaDIFEncryptionOffloadStartCB_t agCB);
694 GLOBAL bit32 saVhistCapture(
696 agsaContext_t *agContext,
706 GLOBAL void saCountActiveIORequests( agsaRoot_t *agRoot);
708 #ifdef SA_64BIT_TIMESTAMP
709 osGLOBAL bit64 osTimeStamp64(void);
710 #endif /* SA_64BIT_TIMESTAMP */
713 /***************************************************************************
714 * Definition of LL Test related API functions start *
715 ***************************************************************************/
716 GLOBAL bit32 saGetLLCounters(
719 agsaLLCountInfo_t *LLCountInfo
722 GLOBAL bit32 saResetLLCounters(
728 #endif /*__SSDKAPI_H__ */