saapi.h revision 302408
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: stable/11/sys/dev/pms/RefTisa/sallsdk/api/saapi.h 285242 2015-07-07 13:17:02Z achim $ 22* 23********************************************************************************/ 24/*******************************************************************************/ 25/*! \file saapi.h 26 * \brief The file defines the declaration of tSDK APIs 27 * 28 * 29 * 30 * 31 */ 32/******************************************************************************/ 33 34#ifndef __SSDKAPI_H__ 35#define __SSDKAPI_H__ 36 37/******************************************************************************** 38 * SA LL Function Declaration * 39 ********************************************************************************/ 40 41/*************************************************************************** 42 * Definition of interrupt related functions start * 43 ***************************************************************************/ 44 45 46GLOBAL bit32 FORCEINLINE saDelayedInterruptHandler( 47 agsaRoot_t *agRoot, 48 bit32 interruptVectorIndex, 49 bit32 count 50 ); 51 52GLOBAL bit32 FORCEINLINE saInterruptHandler( 53 agsaRoot_t *agRoot, 54 bit32 interruptVectorIndex 55 ); 56 57GLOBAL void saSystemInterruptsActive( 58 agsaRoot_t *agRoot, 59 agBOOLEAN sysIntsActive 60 ); 61 62GLOBAL FORCEINLINE void saSystemInterruptsEnable( 63 agsaRoot_t *agRoot, 64 bit32 interruptVectorIndex 65 ); 66/*************************************************************************** 67 * Definition of interrupt related functions end * 68 ***************************************************************************/ 69 70 71/*************************************************************************** 72 * Definition of timer related functions start * 73 ***************************************************************************/ 74GLOBAL void saTimerTick(agsaRoot_t *agRoot); 75/*************************************************************************** 76 * Definition of timer related functions end * 77 ***************************************************************************/ 78 79/*************************************************************************** 80 * Definition of initialization related functions start * 81 ***************************************************************************/ 82GLOBAL void saGetRequirements( 83 agsaRoot_t *agRoot, 84 agsaSwConfig_t *swConfig, 85 agsaMemoryRequirement_t *memoryRequirement, 86 bit32 *usecsPerTick, 87 bit32 *maxNumLocks 88 ); 89 90GLOBAL bit32 saInitialize( 91 agsaRoot_t *agRoot, 92 agsaMemoryRequirement_t *memoryAllocated, 93 agsaHwConfig_t *hwConfig, 94 agsaSwConfig_t *swConfig, 95 bit32 usecsPerTick 96 ); 97/*************************************************************************** 98 * Definition of initialization related functions end * 99 ***************************************************************************/ 100 101/*************************************************************************** 102 * Definition of hardware related functions start * 103 ***************************************************************************/ 104GLOBAL void saHwReset( 105 agsaRoot_t *agRoot, 106 bit32 resetType, 107 bit32 resetParm 108 ); 109 110GLOBAL void saHwShutdown(agsaRoot_t *agRoot); 111 112/*************************************************************************** 113 * Definition of hardware related functions end * 114 ***************************************************************************/ 115 116/*************************************************************************** 117 * Definition of phy related functions start * 118 ***************************************************************************/ 119GLOBAL bit32 saPhyStart( 120 agsaRoot_t *agRoot, 121 agsaContext_t *agContext, 122 bit32 queueNum, 123 bit32 phyId, 124 agsaPhyConfig_t *agPhyConfig, 125 agsaSASIdentify_t *agSASIdentify 126 ); 127 128GLOBAL bit32 saPhyStop( 129 agsaRoot_t *agRoot, 130 agsaContext_t *agContext, 131 bit32 queueNum, 132 bit32 phyId 133 ); 134 135 136GLOBAL bit32 saLocalPhyControl( 137 agsaRoot_t *agRoot, 138 agsaContext_t *agContext, 139 bit32 queueNum, 140 bit32 phyId, 141 bit32 phyOperation, 142 ossaLocalPhyControlCB_t agCB 143 ); 144 145GLOBAL bit32 saGetPhyProfile( 146 agsaRoot_t *agRoot, 147 agsaContext_t *agContext, 148 bit32 queueNum, 149 bit32 ppc, 150 bit32 phyID 151 ); 152 153GLOBAL bit32 saSetPhyProfile ( 154 agsaRoot_t *agRoot, 155 agsaContext_t *agContext, 156 bit32 queueNum, 157 bit32 ppc, 158 bit32 length, 159 void *buffer, 160 bit32 phyID 161 ); 162 163GLOBAL bit32 saHwEventAck( 164 agsaRoot_t *agRoot, 165 agsaContext_t *agContext, 166 bit32 queueNum, 167 agsaEventSource_t *eventSource, 168 bit32 param0, 169 bit32 param1 170 ); 171 172 173/*************************************************************************** 174 * Definition of phy related functions end * 175 ***************************************************************************/ 176 177/*************************************************************************** 178 * Definition of discovery related functions start * 179 ***************************************************************************/ 180GLOBAL bit32 saDiscover( 181 agsaRoot_t *agRoot, 182 agsaPortContext_t *agPortContext, 183 bit32 type, 184 bit32 option 185 ); 186/*************************************************************************** 187 * Definition of discovery related functions end * 188 ***************************************************************************/ 189 190/*************************************************************************** 191 * Definition of frame related functions start * 192 ***************************************************************************/ 193GLOBAL bit32 saFrameReadBit32( 194 agsaRoot_t *agRoot, 195 agsaFrameHandle_t agFrame, 196 bit32 frameOffset 197 ); 198 199GLOBAL void saFrameReadBlock( 200 agsaRoot_t *agRoot, 201 agsaFrameHandle_t agFrame, 202 bit32 frameOffset, 203 void *frameBuffer, 204 bit32 frameBufLen 205 ); 206/*************************************************************************** 207 * Definition of frame related functions end * 208 ***************************************************************************/ 209 210/*************************************************************************** 211 * Definition of SATA related functions start * 212 ***************************************************************************/ 213GLOBAL bit32 saSATAStart( 214 agsaRoot_t *agRoot, 215 agsaIORequest_t *agIORequest, 216 bit32 queueNum, 217 agsaDevHandle_t *agDevHandle, 218 bit32 agRequestType, 219 agsaSATAInitiatorRequest_t *agSATAReq, 220 bit8 agTag, 221 ossaSATACompletedCB_t agCB 222 ); 223 224GLOBAL bit32 saSATAAbort( 225 agsaRoot_t *agRoot, 226 agsaIORequest_t *agIORequest, 227 bit32 queueNum, 228 agsaDevHandle_t *agDevHandle, 229 bit32 flag, 230 void *abortParam, 231 ossaGenericAbortCB_t agCB 232 ); 233 234/*************************************************************************** 235 * Definition of SATA related functions end * 236 ***************************************************************************/ 237 238/*************************************************************************** 239 * Definition of SAS related functions start * 240 ***************************************************************************/ 241 242GLOBAL bit32 saSendSMPIoctl( 243 agsaRoot_t *agRoot, 244 agsaDevHandle_t *agDevHandle, 245 bit32 queueNum, 246 agsaSMPFrame_t *pSMPFrame, 247 ossaSMPCompletedCB_t agCB 248 ); 249 250GLOBAL bit32 saSMPStart( 251 agsaRoot_t *agRoot, 252 agsaIORequest_t *agIORequest, 253 bit32 queueNum, 254 agsaDevHandle_t *agDevHandle, 255 bit32 agRequestType, 256 agsaSASRequestBody_t *agRequestBody, 257 ossaSMPCompletedCB_t agCB 258 ); 259 260GLOBAL bit32 saSMPAbort( 261 agsaRoot_t *agRoot, 262 agsaIORequest_t *agIORequest, 263 bit32 queueNum, 264 agsaDevHandle_t *agDevHandle, 265 bit32 flag, 266 void *abortParam, 267 ossaGenericAbortCB_t agCB 268 ); 269 270GLOBAL bit32 saSSPStart( 271 agsaRoot_t *agRoot, 272 agsaIORequest_t *agIORequest, 273 bit32 queueNum, 274 agsaDevHandle_t *agDevHandle, 275 bit32 agRequestType, 276 agsaSASRequestBody_t *agRequestBody, 277 agsaIORequest_t *agTMRequest, 278 ossaSSPCompletedCB_t agCB 279 ); 280 281#ifdef FAST_IO_TEST 282GLOBAL void *saFastSSPPrepare( 283 void *ioHandle, 284 agsaFastCommand_t *fc, 285 ossaSSPCompletedCB_t cb, 286 void *cbArg); 287 288GLOBAL bit32 saFastSSPSend(void *ioHandle); 289GLOBAL bit32 saFastSSPCancel(void *ioHandle); 290#endif 291 292GLOBAL bit32 saSSPAbort( 293 agsaRoot_t *agRoot, 294 agsaIORequest_t *agIORequest, 295 bit32 queueNum, 296 agsaDevHandle_t *agDevHandle, 297 bit32 flag, 298 void *abortParam, 299 ossaGenericAbortCB_t agCB 300 ); 301 302GLOBAL void saGetDifErrorDetails( 303 agsaRoot_t *agRoot, 304 agsaIORequest_t *agIORequest, 305 agsaDifDetails_t *difDetails 306 ); 307 308GLOBAL bit32 saRegisterEventCallback( 309 agsaRoot_t *agRoot, 310 bit32 eventSourceType, 311 ossaGenericCB_t callbackPtr 312 ); 313 314/*************************************************************************** 315 * Definition of SAS related functions end * 316 ***************************************************************************/ 317 318/*************************************************************************** 319 * Definition of Device related functions start * 320 ***************************************************************************/ 321GLOBAL bit32 saRegisterNewDevice( 322 agsaRoot_t *agRoot, 323 agsaContext_t *agContext, 324 bit32 queueNum, 325 agsaDeviceInfo_t *agDeviceInfo, 326 agsaPortContext_t *agPortContext, 327 bit16 hostAssignedDeviceId 328 ); 329 330GLOBAL bit32 saDeregisterDeviceHandle( 331 agsaRoot_t *agRoot, 332 agsaContext_t *agContext, 333 agsaDevHandle_t *agDevHandle, 334 bit32 queueNum 335 ); 336 337GLOBAL bit32 saGetDeviceHandles( 338 agsaRoot_t *agRoot, 339 agsaContext_t *agContext, 340 bit32 queueNum, 341 agsaPortContext_t *agPortContext, 342 bit32 flags, 343 agsaDevHandle_t *agDev[], 344 bit32 skipCount, 345 bit32 maxDevs 346 ); 347 348GLOBAL bit32 saGetDeviceInfo( 349 agsaRoot_t *agRoot, 350 agsaContext_t *agContext, 351 bit32 option, 352 bit32 queueNum, 353 agsaDevHandle_t *agDevHandle 354 ); 355 356GLOBAL bit32 saGetDeviceState( 357 agsaRoot_t *agRoot, 358 agsaContext_t *agContext, 359 bit32 queueNum, 360 agsaDevHandle_t *agDevHandle 361 ); 362 363GLOBAL bit32 saSetDeviceInfo( 364 agsaRoot_t *agRoot, 365 agsaContext_t *agContext, 366 bit32 queueNum , 367 agsaDevHandle_t *agDevHandle, 368 bit32 option, 369 bit32 param, 370 ossaSetDeviceInfoCB_t agCB 371 ); 372 373GLOBAL bit32 saSetDeviceState( 374 agsaRoot_t *agRoot, 375 agsaContext_t *agContext, 376 bit32 queueNum, 377 agsaDevHandle_t *agDevHandle, 378 bit32 newDeviceState 379 ); 380 381/*************************************************************************** 382 * Definition of Device related functions end * 383 ***************************************************************************/ 384 385/*************************************************************************** 386 * Definition of Misc related functions start * 387 ***************************************************************************/ 388GLOBAL bit32 saFwFlashUpdate( 389 agsaRoot_t *agRoot, 390 agsaContext_t *agContext, 391 bit32 queueNum, 392 agsaUpdateFwFlash_t *flashUpdateInfo 393 ); 394 395GLOBAL bit32 saFlashExtExecute ( 396 agsaRoot_t *agRoot, 397 agsaContext_t *agContext, 398 bit32 queueNum, 399 agsaFlashExtExecute_t *agFlashExtExe 400 ); 401 402#ifdef SPC_ENABLE_PROFILE 403GLOBAL bit32 saFwProfile( 404 agsaRoot_t *agRoot, 405 agsaContext_t *agContext, 406 bit32 queueNum, 407 agsaFwProfile_t *fwProfileInfo 408 ); 409#endif 410 411GLOBAL bit32 saEchoCommand( 412 agsaRoot_t *agRoot, 413 agsaContext_t *agContext, 414 bit32 queueNum, 415 void *echoPayload 416 ); 417 418GLOBAL bit32 saGetControllerInfo( 419 agsaRoot_t *agRoot, 420 agsaControllerInfo_t *controllerInfo 421 ); 422 423GLOBAL bit32 saGetControllerStatus( 424 agsaRoot_t *agRoot, 425 agsaControllerStatus_t *controllerStatus 426 ); 427 428GLOBAL bit32 saGetControllerEventLogInfo( 429 agsaRoot_t *agRoot, 430 agsaControllerEventLog_t *eventLogInfo 431 ); 432 433GLOBAL bit32 saGpioEventSetup( 434 agsaRoot_t *agRoot, 435 agsaContext_t *agContext, 436 bit32 queueNum, 437 agsaGpioEventSetupInfo_t *gpioEventSetupInfo 438 ); 439 440GLOBAL bit32 saGpioPinSetup( 441 agsaRoot_t *agRoot, 442 agsaContext_t *agContext, 443 bit32 queueNum, 444 agsaGpioPinSetupInfo_t *gpioPinSetupInfo 445 ); 446 447GLOBAL bit32 saGpioRead( 448 agsaRoot_t *agRoot, 449 agsaContext_t *agContext, 450 bit32 queueNum 451 ); 452 453GLOBAL bit32 saGpioWrite( 454 agsaRoot_t *agRoot, 455 agsaContext_t *agContext, 456 bit32 queueNum, 457 bit32 gpioWriteMask, 458 bit32 gpioWriteValue 459 ); 460 461GLOBAL bit32 saSASDiagExecute( 462 agsaRoot_t *agRoot, 463 agsaContext_t *agContext, 464 bit32 queueNum, 465 agsaSASDiagExecute_t *diag 466 ); 467 468GLOBAL bit32 saSASDiagStartEnd( 469 agsaRoot_t *agRoot, 470 agsaContext_t *agContext, 471 bit32 queueNum, 472 bit32 phyId, 473 bit32 operation 474 ); 475 476GLOBAL bit32 saGetTimeStamp( 477 agsaRoot_t *agRoot, 478 agsaContext_t *agContext, 479 bit32 queueNum 480 ); 481 482GLOBAL bit32 saPortControl( 483 agsaRoot_t *agRoot, 484 agsaContext_t *agContext, 485 bit32 queueNum, 486 agsaPortContext_t *agPortContext, 487 bit32 portOperation, 488 bit32 param0, 489 bit32 param1 490 ); 491 492GLOBAL bit32 saGetRegisterDump( 493 agsaRoot_t *agRoot, 494 agsaContext_t *agContext, 495 bit32 queueNum, 496 agsaRegDumpInfo_t *regDumpInfo 497 ); 498 499GLOBAL bit32 saGetForensicData( 500 agsaRoot_t *agRoot, 501 agsaContext_t *agContext, 502 agsaForensicData_t *forensicData 503 ); 504 505bit32 saGetIOErrorStats( 506 agsaRoot_t *agRoot, 507 agsaContext_t *agContext, 508 bit32 flag 509 ); 510 511bit32 saGetIOEventStats( 512 agsaRoot_t *agRoot, 513 agsaContext_t *agContext, 514 bit32 flag 515 ); 516 517GLOBAL bit32 saGetNVMDCommand( 518 agsaRoot_t *agRoot, 519 agsaContext_t *agContext, 520 bit32 queueNum, 521 agsaNVMDData_t *NVMDInfo 522 ); 523 524GLOBAL bit32 saSetNVMDCommand( 525 agsaRoot_t *agRoot, 526 agsaContext_t *agContext, 527 bit32 queueNum, 528 agsaNVMDData_t *NVMDInfo 529 ); 530 531GLOBAL bit32 saReconfigSASParams( 532 agsaRoot_t *agRoot, 533 agsaContext_t *agContext, 534 bit32 queueNum , 535 agsaSASReconfig_t *agSASConfig 536 ); 537 538GLOBAL bit32 saSgpio( 539 agsaRoot_t *agRoot, 540 agsaContext_t *agContext, 541 bit32 queueNum, 542 agsaSGpioReqResponse_t *pSGpioReq 543 ); 544 545GLOBAL bit32 saPCIeDiagExecute( 546 agsaRoot_t *agRoot, 547 agsaContext_t *agContext, 548 bit32 queueNum, 549 agsaPCIeDiagExecute_t *diag); 550 551 552GLOBAL bit32 saEncryptSelftestExecute( 553 agsaRoot_t *agRoot, 554 agsaContext_t *agContext, 555 bit32 queueNum, 556 bit32 type, 557 bit32 length, 558 void *TestDescriptor); 559 560GLOBAL bit32 saSetOperator( 561 agsaRoot_t *agRoot, 562 agsaContext_t *agContext, 563 bit32 queueNum, 564 bit32 flag, 565 void *cert); 566 567GLOBAL bit32 saGetOperator( 568 agsaRoot_t *agRoot, 569 agsaContext_t *agContext, 570 bit32 queueNum, 571 bit32 option, 572 bit32 AddrHi, 573 bit32 AddrLo); 574 575GLOBAL bit32 saOperatorManagement( 576 agsaRoot_t *agRoot, 577 agsaContext_t *agContext, 578 bit32 queueNum, 579 bit32 flag, 580 bit8 role, 581 agsaID_t *id, 582 agsaEncryptKekBlob_t *kblob); 583 584 585/*************************************************************************** 586 * Definition of Misc. related functions end * 587 ***************************************************************************/ 588 589GLOBAL bit32 saSetControllerConfig( 590 agsaRoot_t *agRoot, 591 bit32 queueNum, 592 bit32 modePage, 593 bit32 length, 594 void *buffer, 595 agsaContext_t *agContext 596 ); 597 598 599GLOBAL bit32 saGetControllerConfig( 600 agsaRoot_t *agRoot, 601 bit32 queueNum, 602 bit32 modePage, 603 bit32 flag0, 604 bit32 flag1, 605 agsaContext_t *agContext 606 ); 607 608GLOBAL bit32 saEncryptDekCacheUpdate( 609 agsaRoot_t *agRoot, 610 agsaContext_t *agContext, 611 bit32 queueNum, 612 bit32 kekIndex, 613 bit32 dekTableSelect, 614 bit32 dekAddrHi, 615 bit32 dekAddrLo, 616 bit32 dekIndex, 617 bit32 dekNumberOfEntries, 618 bit32 dekBlobFormat, 619 bit32 dekTableKeyEntrySize 620 ); 621 622GLOBAL bit32 saEncryptDekCacheInvalidate( 623 agsaRoot_t *agRoot, 624 agsaContext_t *agContext, 625 bit32 queueNum, 626 bit32 dekTable, 627 bit32 dekIndex 628 ); 629 630GLOBAL bit32 saEncryptGetMode( 631 agsaRoot_t *agRoot, 632 agsaContext_t *agContext, 633 agsaEncryptInfo_t *encryptInfo 634 ); 635 636GLOBAL bit32 saEncryptSetMode ( 637 agsaRoot_t *agRoot, 638 agsaContext_t *agContext, 639 bit32 queueNum, 640 agsaEncryptInfo_t *mode 641 ); 642 643GLOBAL bit32 saEncryptKekInvalidate( 644 agsaRoot_t *agRoot, 645 agsaContext_t *agContext, 646 bit32 queueNum, 647 bit32 kekIndex 648 ); 649 650GLOBAL bit32 saEncryptKekUpdate( 651 agsaRoot_t *agRoot, 652 agsaContext_t *agContext, 653 bit32 queueNum, 654 bit32 flags, 655 bit32 newKekIndex, 656 bit32 wrapperKekIndex, 657 bit32 blobFormat, 658 agsaEncryptKekBlob_t *encryptKekBlob 659 ); 660 661#ifdef HIALEAH_ENCRYPTION 662GLOBAL bit32 saEncryptHilUpdate( 663 agsaRoot_t *agRoot, 664 agsaContext_t *agContext, 665 bit32 queueNum 666 ); 667#endif /* HIALEAH_ENCRYPTION */ 668 669GLOBAL bit32 saGetDFEData( 670 agsaRoot_t *agRoot, 671 agsaContext_t *agContext, 672 bit32 queueNum, 673 bit32 interface, 674 bit32 laneNumber, 675 bit32 interations, 676 agsaSgl_t *agSgl); 677 678 679GLOBAL bit32 saFatalInterruptHandler( 680 agsaRoot_t *agRoot, 681 bit32 interruptVectorIndex 682 ); 683 684 685GLOBAL bit32 saDIFEncryptionOffloadStart( 686 agsaRoot_t *agRoot, 687 agsaContext_t *agContext, 688 bit32 queueNum, 689 bit32 op, 690 agsaDifEncPayload_t *agsaDifEncPayload, 691 ossaDIFEncryptionOffloadStartCB_t agCB); 692 693 694GLOBAL bit32 saVhistCapture( 695 agsaRoot_t *agRoot, 696 agsaContext_t *agContext, 697 bit32 queueNum, 698 bit32 Channel, 699 bit32 NumBitLo, 700 bit32 NumBitHi, 701 bit32 PcieAddrLo, 702 bit32 PcieAddrHi, 703 bit32 ByteCount ); 704 705 706GLOBAL void saCountActiveIORequests( agsaRoot_t *agRoot); 707 708#ifdef SA_64BIT_TIMESTAMP 709osGLOBAL bit64 osTimeStamp64(void); 710#endif /* SA_64BIT_TIMESTAMP */ 711 712#ifdef SALL_API_TEST 713/*************************************************************************** 714 * Definition of LL Test related API functions start * 715 ***************************************************************************/ 716GLOBAL bit32 saGetLLCounters( 717 agsaRoot_t *agRoot, 718 bit32 counters, 719 agsaLLCountInfo_t *LLCountInfo 720 ); 721 722GLOBAL bit32 saResetLLCounters( 723 agsaRoot_t *agRoot, 724 bit32 counters 725 ); 726#endif 727 728#endif /*__SSDKAPI_H__ */ 729