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
21 ********************************************************************************/
22 /*******************************************************************************/
24 * \brief The file contains general helper routines.
28 /******************************************************************************/
29 #include <sys/cdefs.h>
30 __FBSDID("$FreeBSD$");
31 #include <dev/pms/config.h>
33 #include <dev/pms/RefTisa/sallsdk/spc/saglobal.h>
34 #ifdef SA_TESTBASE_EXTRA
36 #endif /* SA_TESTBASE_EXTRA */
39 #ifdef SA_ENABLE_TRACE_FUNCTIONS
43 #define siTraceFileID 'S'
46 /******************************************************************************/
47 /*! \brief Check for Hex digit
55 /*******************************************************************************/
56 int siIsHexDigit(char a)
58 return ( (((a) >= 'a') && ((a) <= 'z')) ||
59 (((a) >= 'A') && ((a) <= 'Z')) ||
60 (((a) >= '0') && ((a) <= '9')) ||
64 /******************************************************************************/
73 /*******************************************************************************/
76 si_memcpy(void *dst, void *src, bit32 count)
80 unsigned char *dst1 = (unsigned char *)dst;
81 unsigned char *src1 = (unsigned char *)src;
83 for (x=0; x < count; x++)
88 return memcpy(dst, src, count);
92 /******************************************************************************/
101 /*******************************************************************************/
104 si_memset(void *s, int c, bit32 n)
108 char *dst = (char *)s;
109 for (i=0; i < n; i++)
113 return (void *)(&dst[i-n]);
115 return memset(s, c, n);
119 /******************************************************************************/
120 /*! \brief siDumpActiveIORequests
128 /*******************************************************************************/
130 siDumpActiveIORequests(
134 bit32 j, num_found = 0;
135 agsaIORequestDesc_t *pRequestDesc = agNULL;
136 agsaLLRoot_t *saRoot = agNULL;
138 mpiOCQueue_t *circularQ;
141 SA_ASSERT((agNULL != agRoot), "");
142 saRoot = (agsaLLRoot_t *)(agRoot->sdkData);
143 SA_ASSERT((agNULL != saRoot), "");
146 saCountActiveIORequests(agRoot);
150 if(smIS_SPCV(agRoot))
153 sp1= ossaHwRegRead(agRoot,V_Scratchpad_1_Register );
155 if(SCRATCH_PAD1_V_ERROR_STATE(sp1))
157 SA_DBG1(("siDumpActiveIORequests: SCRATCH_PAD1_V_ERROR_STAT 0x%x\n",sp1 ));
159 SA_DBG1(("siDumpActiveIORequests: SCRATCH_PAD0 value = 0x%x\n", ossaHwRegRead(agRoot, V_Scratchpad_0_Register)));
160 SA_DBG1(("siDumpActiveIORequests: SCRATCH_PAD1 value = 0x%x\n", ossaHwRegRead(agRoot, V_Scratchpad_1_Register)));
161 SA_DBG1(("siDumpActiveIORequests: SCRATCH_PAD2 value = 0x%x\n", ossaHwRegRead(agRoot, V_Scratchpad_2_Register)));
162 SA_DBG1(("siDumpActiveIORequests: SCRATCH_PAD3 value = 0x%x\n", ossaHwRegRead(agRoot, V_Scratchpad_3_Register)));
165 for ( i = 0; i < saRoot->QueueConfig.numOutboundQueues; i++ )
167 circularQ = &saRoot->outboundQueue[i];
168 OSSA_READ_LE_32(circularQ->agRoot, &circularQ->producerIdx, circularQ->piPointer, 0);
169 if(circularQ->producerIdx != circularQ->consumerIdx)
171 SA_DBG1(("siDumpActiveIORequests:OBQ%d PI 0x%03x CI 0x%03x\n", i,circularQ->producerIdx, circularQ->consumerIdx ));
175 pRequestDesc = (agsaIORequestDesc_t *) AGSAMEM_ELEMENT_READ(&(saRoot->IORequestMem), 0);
176 SA_DBG1(("siDumpActiveIORequests: Current Time: %d ticks (usecpertick=%d)\n",
177 saRoot->timeTick, saRoot->usecsPerTick));
179 for ( j = 0; j < count; j ++ )
181 pRequestDesc = (agsaIORequestDesc_t *) AGSAMEM_ELEMENT_READ(&(saRoot->IORequestMem), j);
183 if (pRequestDesc->valid == agTRUE)
186 SA_DBG1(("siDumpActiveIORequests: IO #%4d: %p Tag=%03X Type=%08X Device 0x%X Pending for %d seconds\n",
188 pRequestDesc->pIORequestContext,
190 pRequestDesc->requestType,
191 pRequestDesc->pDevice ? pRequestDesc->pDevice->DeviceMapIndex : 0,
192 ((saRoot->timeTick - pRequestDesc->startTick)*saRoot->usecsPerTick)/1000000 ));
198 SA_DBG1(("siDumpActiveIORequests: %d found active\n",num_found));
203 /******************************************************************************/
204 /*! \brief saCountActiveIORequests
212 /*******************************************************************************/
214 siClearActiveIORequests(
219 agsaIORequestDesc_t *pRequestDesc = agNULL;
220 agsaLLRoot_t *saRoot = agNULL;
223 SA_ASSERT((agNULL != agRoot), "");
224 saRoot = (agsaLLRoot_t *)(agRoot->sdkData);
225 SA_ASSERT((agNULL != saRoot), "");
229 pRequestDesc = (agsaIORequestDesc_t *) AGSAMEM_ELEMENT_READ(&(saRoot->IORequestMem), 0);
231 for ( j = 0; j < saRoot->swConfig.maxActiveIOs; j++ )
233 pRequestDesc = (agsaIORequestDesc_t *) AGSAMEM_ELEMENT_READ(&(saRoot->IORequestMem), j);
235 if (pRequestDesc->valid == agTRUE)
238 pRequestDesc->valid = agFALSE;
243 SA_DBG1(("siClearActiveIORequests %d found active\n",num_found));
248 SA_DBG1(("siClearActiveIORequests saroot NULL\n"));
253 /******************************************************************************/
254 /*! \brief siCountActiveIORequestsOnDevice
255 * count all active IO's
262 /*******************************************************************************/
264 siClearActiveIORequestsOnDevice(
268 bit32 j, num_found = 0;
269 agsaIORequestDesc_t *pRequestDesc = agNULL;
270 agsaLLRoot_t *saRoot = agNULL;
273 SA_ASSERT((agNULL != agRoot), "");
274 saRoot = (agsaLLRoot_t *)(agRoot->sdkData);
275 SA_ASSERT((agNULL != saRoot), "");
277 pRequestDesc = (agsaIORequestDesc_t *) AGSAMEM_ELEMENT_READ(&(saRoot->IORequestMem), 0);
279 for ( j = 0; j < saRoot->swConfig.maxActiveIOs; j++ )
281 pRequestDesc = (agsaIORequestDesc_t *) AGSAMEM_ELEMENT_READ(&(saRoot->IORequestMem), j);
283 if (pRequestDesc->valid == agTRUE)
285 if (pRequestDesc->pDevice)
287 if (pRequestDesc->pDevice->DeviceMapIndex == device)
290 pRequestDesc->valid = agFALSE;
297 SA_DBG1(("siClearActiveIORequestsOnDevice 0x%x %d cleared\n",device,num_found));
304 /******************************************************************************/
305 /*! \brief siCountActiveIORequestsOnDevice
306 * count all active IO's
313 /*******************************************************************************/
315 siCountActiveIORequestsOnDevice(
319 bit32 j, num_found = 0;
320 agsaIORequestDesc_t *pRequestDesc = agNULL;
321 agsaLLRoot_t *saRoot = agNULL;
324 SA_ASSERT((agNULL != agRoot), "");
325 saRoot = (agsaLLRoot_t *)(agRoot->sdkData);
326 SA_ASSERT((agNULL != saRoot), "");
328 pRequestDesc = (agsaIORequestDesc_t *) AGSAMEM_ELEMENT_READ(&(saRoot->IORequestMem), 0);
330 for ( j = 0; j < saRoot->swConfig.maxActiveIOs; j++ )
332 pRequestDesc = (agsaIORequestDesc_t *) AGSAMEM_ELEMENT_READ(&(saRoot->IORequestMem), j);
334 if (pRequestDesc->valid == agTRUE)
336 if (pRequestDesc->pDevice)
338 if (pRequestDesc->pDevice->DeviceMapIndex == device)
341 if(saRoot->ResetStartTick > pRequestDesc->startTick)
343 SA_DBG2(("siCountActiveIORequestsOnDevice: saRoot->ResetStartTick %d pRequestDesc->startTick %d\n",
344 saRoot->ResetStartTick, pRequestDesc->startTick));
352 SA_DBG1(("siCountActiveIORequestsOnDevice 0x%x %d found active\n",device,num_found));
359 /******************************************************************************/
360 /*! \brief saCountActiveIORequests
361 * count all active IO's
368 /*******************************************************************************/
370 saCountActiveIORequests(
373 bit32 j, num_found = 0;
374 agsaIORequestDesc_t *pRequestDesc = agNULL;
375 agsaLLRoot_t *saRoot = agNULL;
378 SA_ASSERT((agNULL != agRoot), "");
379 if( agRoot == agNULL)
383 saRoot = (agsaLLRoot_t *)(agRoot->sdkData);
384 if( saRoot == agNULL)
388 pRequestDesc = (agsaIORequestDesc_t *) AGSAMEM_ELEMENT_READ(&(saRoot->IORequestMem), 0);
390 for ( j = 0; j < saRoot->swConfig.maxActiveIOs; j++ )
392 pRequestDesc = (agsaIORequestDesc_t *) AGSAMEM_ELEMENT_READ(&(saRoot->IORequestMem), j);
394 if (pRequestDesc->valid == agTRUE)
397 if(saRoot->ResetStartTick > pRequestDesc->startTick)
399 SA_DBG2(("saCountActiveIORequests: saRoot->ResetStartTick %d pRequestDesc->startTick %d\n",
400 saRoot->ResetStartTick, pRequestDesc->startTick));
406 SA_DBG1(("saCountActiveIORequests %d found active\n",num_found));
412 GLOBAL bit32 smIsCfg_V_ANY( agsaRoot_t *agRoot)
415 if(smIsCfg_V8008(agRoot) == 1) return 1;
416 if(smIsCfg_V8009(agRoot) == 1) return 1;
417 if(smIsCfg_V8018(agRoot) == 1) return 1;
418 if(smIsCfg_V8019(agRoot) == 1) return 1;
419 if(smIsCfg_V8088(agRoot) == 1) return 1;
420 if(smIsCfg_V8089(agRoot) == 1) return 1;
421 if(smIsCfg_V8070(agRoot) == 1) return 1;
422 if(smIsCfg_V8071(agRoot) == 1) return 1;
423 if(smIsCfg_V8072(agRoot) == 1) return 1;
424 if(smIsCfg_V8073(agRoot) == 1) return 1;
425 if(smIS_SPCV8074(agRoot) == 1) return 1;
426 if(smIS_SPCV8075(agRoot) == 1) return 1;
427 if(smIS_SPCV8076(agRoot) == 1) return 1;
428 if(smIS_SPCV8077(agRoot) == 1) return 1;
429 if(smIsCfg_V8025(agRoot) == 1) return 1;
430 if(smIsCfg_V9015(agRoot) == 1) return 1;
431 if(smIsCfg_V9060(agRoot) == 1) return 1;
432 if(smIsCfg_V8006(agRoot) == 1) return 1;
437 GLOBAL bit32 smIS_SPC( agsaRoot_t *agRoot)
439 if(smIS_spc8001(agRoot) == 1) return 1;
440 if(smIS_spc8081(agRoot) == 1) return 1;
441 if(smIS_SFC_AS_SPC(agRoot) == 1) return 1;
446 GLOBAL bit32 smIS_HIL( agsaRoot_t *agRoot) /* or delray */
448 if(smIS_spc8081(agRoot) == 1) return 1;
449 if(smIS_ADAP8088(agRoot) == 1) return 1;
450 if(smIS_ADAP8089(agRoot) == 1) return 1;
451 if(smIS_SPCV8074(agRoot) == 1) return 1;
452 if(smIS_SPCV8075(agRoot) == 1) return 1;
453 if(smIS_SPCV8076(agRoot) == 1) return 1;
454 if(smIS_SPCV8077(agRoot) == 1) return 1;
459 GLOBAL bit32 smIS_SPC6V( agsaRoot_t *agRoot)
461 if(smIS_SPCV8008(agRoot) == 1) return 1;
462 if(smIS_SPCV8009(agRoot) == 1) return 1;
463 if(smIS_SPCV8018(agRoot) == 1) return 1;
464 if(smIS_SPCV8019(agRoot) == 1) return 1;
465 if(smIS_ADAP8088(agRoot) == 1) return 1;
466 if(smIS_ADAP8089(agRoot) == 1) return 1;
470 GLOBAL bit32 smIS_SPC12V( agsaRoot_t *agRoot)
472 if(smIS_SPCV8070(agRoot) == 1) return 1;
473 if(smIS_SPCV8071(agRoot) == 1) return 1;
474 if(smIS_SPCV8072(agRoot) == 1) return 1;
475 if(smIS_SPCV8073(agRoot) == 1) return 1;
476 if(smIS_SPCV8074(agRoot) == 1) return 1;
477 if(smIS_SPCV8075(agRoot) == 1) return 1;
478 if(smIS_SPCV8076(agRoot) == 1) return 1;
479 if(smIS_SPCV8077(agRoot) == 1) return 1;
480 if(smIS_SPCV9015(agRoot) == 1) return 1;
481 if(smIS_SPCV9060(agRoot) == 1) return 1;
482 if(smIS_SPCV8006(agRoot) == 1) return 1;
486 GLOBAL bit32 smIS_SPCV_2_IOP( agsaRoot_t *agRoot)
488 if(smIS_SPCV8009(agRoot) == 1) return 1;
489 if(smIS_SPCV8018(agRoot) == 1) return 1;
490 if(smIS_SPCV8019(agRoot) == 1) return 1;
491 if(smIS_SPCV8071(agRoot) == 1) return 1;
492 if(smIS_SPCV8072(agRoot) == 1) return 1;
493 if(smIS_SPCV8073(agRoot) == 1) return 1;
494 if(smIS_SPCV8076(agRoot) == 1) return 1;
495 if(smIS_SPCV8077(agRoot) == 1) return 1;
496 if(smIS_ADAP8088(agRoot) == 1) return 1;
497 if(smIS_ADAP8089(agRoot) == 1) return 1;
498 if(smIS_SPCV8006(agRoot) == 1) return 1;
502 GLOBAL bit32 smIS_SPCV( agsaRoot_t *agRoot)
504 if(smIS_SPC6V(agRoot) == 1) return 1;
505 if(smIS_SPC12V(agRoot) == 1) return 1;
506 if(smIS_SFC_AS_V(agRoot) == 1 ) return 1;
510 GLOBAL bit32 smIS_ENCRYPT( agsaRoot_t *agRoot)
512 if(smIS_SPCV8009(agRoot) == 1) return 1;
513 if(smIS_ADAP8088(agRoot) == 1) return 1;
514 if(smIS_SPCV8019(agRoot) == 1) return 1;
515 if(smIS_SPCV8071(agRoot) == 1) return 1;
516 if(smIS_SPCV8073(agRoot) == 1) return 1;
517 if(smIS_SPCV8077(agRoot) == 1) return 1;
518 if(smIS_SPCV9015(agRoot) == 1) return 1;
519 if(smIS_SPCV9060(agRoot) == 1) return 1;
525 #if defined(SALLSDK_DEBUG)
527 /******************************************************************************/
528 /*! \brief Routine print buffer
531 * \param debugLevel verbosity level
532 * \param header header to print
533 * \param buffer buffer to print
534 * \param length length of buffer in bytes
539 /*******************************************************************************/
540 GLOBAL void siPrintBuffer(
549 bit8 *buffer = (bit8 *)a;
553 ossaLogDebugString(gLLDebugLevel, debugLevel, ("%s\n", header));
557 for (x=0; x < length/16; x++)
559 ossaLogDebugString(gLLDebugLevel, debugLevel,
560 ("%02x %02x %02x %02x %02x %02x %02x %02x - %02x %02x %02x %02x %02x %02x %02x %02x == "
561 "%c%c%c%c%c%c%c%c - %c%c%c%c%c%c%c%c\n",
578 siIsHexDigit(*(buffer)) ? *(buffer) : ' ',
579 siIsHexDigit(*(buffer+1)) ? *(buffer+1) : ' ',
580 siIsHexDigit(*(buffer+2)) ? *(buffer+2) : ' ',
581 siIsHexDigit(*(buffer+3)) ? *(buffer+3) : ' ',
582 siIsHexDigit(*(buffer+4)) ? *(buffer+4) : ' ',
583 siIsHexDigit(*(buffer+5)) ? *(buffer+5) : ' ',
584 siIsHexDigit(*(buffer+6)) ? *(buffer+6) : ' ',
585 siIsHexDigit(*(buffer+7)) ? *(buffer+7) : ' ',
586 siIsHexDigit(*(buffer+8)) ? *(buffer+8) : ' ',
587 siIsHexDigit(*(buffer+9)) ? *(buffer+9) : ' ',
588 siIsHexDigit(*(buffer+10)) ? *(buffer+10) : ' ',
589 siIsHexDigit(*(buffer+11)) ? *(buffer+11) : ' ',
590 siIsHexDigit(*(buffer+12)) ? *(buffer+12) : ' ',
591 siIsHexDigit(*(buffer+13)) ? *(buffer+13) : ' ',
592 siIsHexDigit(*(buffer+14)) ? *(buffer+14) : ' ',
593 siIsHexDigit(*(buffer+15)) ? *(buffer+15) : ' ')
602 for (x = 0; x < 16; x++)
607 for (x = 0; x < rem; x++)
609 temp[x] = *(buffer+x);
614 ossaLogDebugString(gLLDebugLevel, debugLevel,
615 ("%02x %02x %02x %02x %02x %02x %02x %02x - %02x %02x %02x %02x %02x %02x %02x %02x == "
616 "%c%c%c%c%c%c%c%c - %c%c%c%c%c%c%c%c\n",
633 siIsHexDigit(*(buffer)) ? *(buffer) : ' ',
634 siIsHexDigit(*(buffer+1)) ? *(buffer+1) : ' ',
635 siIsHexDigit(*(buffer+2)) ? *(buffer+2) : ' ',
636 siIsHexDigit(*(buffer+3)) ? *(buffer+3) : ' ',
637 siIsHexDigit(*(buffer+4)) ? *(buffer+4) : ' ',
638 siIsHexDigit(*(buffer+5)) ? *(buffer+5) : ' ',
639 siIsHexDigit(*(buffer+6)) ? *(buffer+6) : ' ',
640 siIsHexDigit(*(buffer+7)) ? *(buffer+7) : ' ',
641 siIsHexDigit(*(buffer+8)) ? *(buffer+8) : ' ',
642 siIsHexDigit(*(buffer+9)) ? *(buffer+9) : ' ',
643 siIsHexDigit(*(buffer+10)) ? *(buffer+10) : ' ',
644 siIsHexDigit(*(buffer+11)) ? *(buffer+11) : ' ',
645 siIsHexDigit(*(buffer+12)) ? *(buffer+12) : ' ',
646 siIsHexDigit(*(buffer+13)) ? *(buffer+13) : ' ',
647 siIsHexDigit(*(buffer+14)) ? *(buffer+14) : ' ',
648 siIsHexDigit(*(buffer+15)) ? *(buffer+15) : ' ')
654 bit32 *ltemp = (bit32 *)temp;
657 for (x=0; x < length/4; x++)
659 ossaLogDebugString(gLLDebugLevel, debugLevel,
660 ("%08x %08x %08x %08x\n",
673 for (x = 0; x < 4; x++)
678 for (x = 0; x < rem; x++)
685 ossaLogDebugString(gLLDebugLevel, debugLevel,
686 ("%08x %08x %08x %08x\n",
699 void sidump_hwConfig(agsaHwConfig_t *hwConfig)
701 SA_DBG2(("sidump_hwConfig:hwConfig->hwInterruptCoalescingTimer 0x%x\n",hwConfig->hwInterruptCoalescingTimer ));
702 SA_DBG2(("sidump_hwConfig:hwConfig->hwInterruptCoalescingControl 0x%x\n",hwConfig->hwInterruptCoalescingControl ));
703 SA_DBG2(("sidump_hwConfig:hwConfig->intReassertionOption 0x%x\n",hwConfig->intReassertionOption ));
704 SA_DBG2(("sidump_hwConfig:hwConfig->phyAnalogConfig.phyAnalogSetupRegisters->spaRegister0 0x%x\n",hwConfig->phyAnalogConfig.phyAnalogSetupRegisters->spaRegister0 ));
705 SA_DBG2(("sidump_hwConfig:hwConfig->phyAnalogConfig.phyAnalogSetupRegisters->spaRegister1 0x%x\n",hwConfig->phyAnalogConfig.phyAnalogSetupRegisters->spaRegister1 ));
706 SA_DBG2(("sidump_hwConfig:hwConfig->phyAnalogConfig.phyAnalogSetupRegisters->spaRegister2 0x%x\n",hwConfig->phyAnalogConfig.phyAnalogSetupRegisters->spaRegister2 ));
707 SA_DBG2(("sidump_hwConfig:hwConfig->phyAnalogConfig.phyAnalogSetupRegisters->spaRegister3 0x%x\n",hwConfig->phyAnalogConfig.phyAnalogSetupRegisters->spaRegister3 ));
708 SA_DBG2(("sidump_hwConfig:hwConfig->phyAnalogConfig.phyAnalogSetupRegisters->spaRegister4 0x%x\n",hwConfig->phyAnalogConfig.phyAnalogSetupRegisters->spaRegister4 ));
709 SA_DBG2(("sidump_hwConfig:hwConfig->phyAnalogConfig.phyAnalogSetupRegisters->spaRegister5 0x%x\n",hwConfig->phyAnalogConfig.phyAnalogSetupRegisters->spaRegister5 ));
710 SA_DBG2(("sidump_hwConfig:hwConfig->phyAnalogConfig.phyAnalogSetupRegisters->spaRegister6 0x%x\n",hwConfig->phyAnalogConfig.phyAnalogSetupRegisters->spaRegister6 ));
711 SA_DBG2(("sidump_hwConfig:hwConfig->phyAnalogConfig.phyAnalogSetupRegisters->spaRegister7 0x%x\n",hwConfig->phyAnalogConfig.phyAnalogSetupRegisters->spaRegister7 ));
712 SA_DBG2(("sidump_hwConfig:hwConfig->phyAnalogConfig.phyAnalogSetupRegisters->spaRegister8 0x%x\n",hwConfig->phyAnalogConfig.phyAnalogSetupRegisters->spaRegister8 ));
713 SA_DBG2(("sidump_hwConfig:hwConfig->phyAnalogConfig.phyAnalogSetupRegisters->spaRegister9 0x%x\n",hwConfig->phyAnalogConfig.phyAnalogSetupRegisters->spaRegister9 ));
714 SA_DBG2(("sidump_hwConfig:hwConfig->hwOption 0x%x\n",hwConfig->hwOption ));
717 void sidump_swConfig(agsaSwConfig_t *swConfig)
719 SA_DBG2(("sidump_swConfig:swConfig->maxActiveIOs 0x%x\n",swConfig->maxActiveIOs ));
720 SA_DBG2(("sidump_swConfig:swConfig->numDevHandles 0x%x\n",swConfig->numDevHandles ));
721 SA_DBG2(("sidump_swConfig:swConfig->smpReqTimeout 0x%x\n",swConfig->smpReqTimeout ));
722 SA_DBG2(("sidump_swConfig:swConfig->numberOfEventRegClients 0x%x\n",swConfig->numberOfEventRegClients ));
723 SA_DBG2(("sidump_swConfig:swConfig->sizefEventLog1 0x%x\n",swConfig->sizefEventLog1 ));
724 SA_DBG2(("sidump_swConfig:swConfig->sizefEventLog2 0x%x\n",swConfig->sizefEventLog2 ));
725 SA_DBG2(("sidump_swConfig:swConfig->eventLog1Option 0x%x\n",swConfig->eventLog1Option ));
726 SA_DBG2(("sidump_swConfig:swConfig->eventLog2Option 0x%x\n",swConfig->eventLog2Option ));
727 SA_DBG2(("sidump_swConfig:swConfig->fatalErrorInterruptEnable 0x%x\n",swConfig->fatalErrorInterruptEnable ));
728 SA_DBG2(("sidump_swConfig:swConfig->fatalErrorInterruptVector 0x%x\n",swConfig->fatalErrorInterruptVector ));
729 SA_DBG2(("sidump_swConfig:swConfig->max_MSI_InterruptVectors 0x%x\n",swConfig->max_MSI_InterruptVectors ));
730 SA_DBG2(("sidump_swConfig:swConfig->max_MSIX_InterruptVectors 0x%x\n",swConfig->max_MSIX_InterruptVectors ));
731 SA_DBG2(("sidump_swConfig:swConfig->legacyInt_X 0x%x\n",swConfig->legacyInt_X ));
732 SA_DBG2(("sidump_swConfig:swConfig->hostDirectAccessSupport 0x%x\n",swConfig->hostDirectAccessSupport ));
733 SA_DBG2(("sidump_swConfig:swConfig->hostDirectAccessMode 0x%x\n",swConfig->hostDirectAccessMode ));
734 SA_DBG2(("sidump_swConfig:swConfig->param1 0x%x\n",swConfig->param1 ));
735 SA_DBG2(("sidump_swConfig:swConfig->param2 0x%x\n",swConfig->param2 ));
736 SA_DBG2(("sidump_swConfig:swConfig->param3 %p\n",swConfig->param3 ));
737 SA_DBG2(("sidump_swConfig:swConfig->param4 %p\n",swConfig->param4 ));
742 void sidump_Q_config( agsaQueueConfig_t *queueConfig )
746 SA_DBG2(("sidump_Q_config: queueConfig->generalEventQueue 0x%x\n", queueConfig->generalEventQueue ));
747 SA_DBG2(("sidump_Q_config: queueConfig->numInboundQueues 0x%x\n", queueConfig->numInboundQueues ));
748 SA_DBG2(("sidump_Q_config: queueConfig->numOutboundQueues 0x%x\n", queueConfig->numOutboundQueues ));
749 SA_DBG2(("sidump_Q_config: queueConfig->iqHighPriorityProcessingDepth 0x%x\n", queueConfig->iqHighPriorityProcessingDepth ));
750 SA_DBG2(("sidump_Q_config: queueConfig->iqNormalPriorityProcessingDepth 0x%x\n", queueConfig->iqNormalPriorityProcessingDepth ));
751 SA_DBG2(("sidump_Q_config: queueConfig->queueOption 0x%x\n", queueConfig->queueOption ));
752 SA_DBG2(("sidump_Q_config: queueConfig->tgtDeviceRemovedEventQueue 0x%x\n", queueConfig->tgtDeviceRemovedEventQueue ));
754 for(x=0;x < queueConfig->numInboundQueues;x++)
756 SA_DBG2(("sidump_Q_config: queueConfig->inboundQueues[%d].elementCount 0x%x\n",x,queueConfig->inboundQueues[x].elementCount ));
757 SA_DBG2(("sidump_Q_config: queueConfig->inboundQueues[%d].elementSize 0x%x\n",x,queueConfig->inboundQueues[x].elementSize ));
760 for(x=0;x < queueConfig->numOutboundQueues;x++)
763 SA_DBG2(("sidump_Q_config: queueConfig->outboundQueues[%d].elementCount 0x%x\n",x,queueConfig->outboundQueues[x].elementCount ));
764 SA_DBG2(("sidump_Q_config: queueConfig->outboundQueues[%d].elementSize 0x%x\n",x,queueConfig->outboundQueues[x].elementSize ));
771 /******************************************************************************/
772 /*! \brief Get Performance IO counters
774 * Start/Abort SAS/SATA discovery
776 * \param agRoot Handles for this instance of SAS/SATA hardware
777 * \param counters bit map of the counters
778 * \param LLCountInfo pointer to the LLCounters
781 * - \e AGSA_RC_SUCCESS
784 /*******************************************************************************/
785 GLOBAL bit32 saGetLLCounters(
788 agsaLLCountInfo_t *LLCountInfo
791 agsaLLRoot_t *saRoot = (agsaLLRoot_t *) (agRoot->sdkData);
794 for (i = 0; i < LL_COUNTERS; i++)
796 if (counters & (1 << i))
797 LLCountInfo->arrayIOCounter[i] = saRoot->LLCounters.arrayIOCounter[i];
800 return AGSA_RC_SUCCESS;
803 /******************************************************************************/
804 /*! \brief Function for target to remove stale initiator device handle
806 * function is called to ask the LL layer to remove all LL layer and SPC firmware
807 * internal resources associated with a device handle
809 * \param agRoot Handles for this instance of SAS/SATA hardware
810 * \param counters Bit map of the IO counters
813 * - \e AGSA_RC_SUCCESS
816 /*******************************************************************************/
817 GLOBAL bit32 saResetLLCounters(
822 agsaLLRoot_t *saRoot = (agsaLLRoot_t *) (agRoot->sdkData);
825 for (i = 0; i < LL_COUNTERS; i++)
827 if (counters & (1 << i))
828 saRoot->LLCounters.arrayIOCounter[i] = 0;
831 return AGSA_RC_SUCCESS;