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 implements the functions to handle/enable/disable interrupt
27 /*******************************************************************************/
28 #include <sys/cdefs.h>
29 __FBSDID("$FreeBSD$");
30 #include <dev/pms/config.h>
32 #include <dev/pms/RefTisa/sallsdk/spc/saglobal.h>
33 #define SA_CLEAR_ODCR_IN_INTERRUPT
35 //#define SA_TEST_FW_SPURIOUS_INT
37 #ifdef SA_TEST_FW_SPURIOUS_INT
38 bit32 gOurIntCount = 0;
39 bit32 gSpuriousIntCount = 0;
40 bit32 gSpuriousInt[64]=
51 bit32 gSpuriousInt1[64]=
62 #endif /* SA_TEST_FW_SPURIOUS_INT */
64 #ifdef SA_ENABLE_TRACE_FUNCTIONS
67 #endif /* siTraceFileID */
68 #define siTraceFileID 'G'
69 #endif /* SA_ENABLE_TRACE_FUNCTIONS */
71 LOCAL FORCEINLINE bit32 siProcessOBMsg(
77 LOCAL bit32 siFatalInterruptHandler(
79 bit32 interruptVectorIndex
82 agsaLLRoot_t *saRoot = agNULL;
83 agsaFatalErrorInfo_t fatal_error;
85 bit32 ret = AGSA_RC_FAILURE;
86 bit32 Sendfatal = agTRUE;
88 SA_ASSERT((agNULL != agRoot), "");
91 SA_DBG1(("siFatalInterruptHandler: agRoot == agNULL\n"));
92 return AGSA_RC_FAILURE;
94 saRoot = (agsaLLRoot_t *)(agRoot->sdkData);
95 SA_ASSERT((agNULL != saRoot), "");
98 SA_DBG1(("siFatalInterruptHandler: saRoot == agNULL\n"));
99 return AGSA_RC_FAILURE;
102 value = siHalRegReadExt(agRoot, GEN_MSGU_SCRATCH_PAD_1, MSGU_SCRATCH_PAD_1);
103 if (saRoot->ResetFailed)
105 SA_DBG1(("siFatalInterruptHandler: ResetFailed\n"));
106 ossaDisableInterrupts(agRoot, interruptVectorIndex);
107 return AGSA_RC_FAILURE;
110 if(SCRATCH_PAD1_V_ERROR_STATE( value ) )
112 si_memset(&fatal_error, 0, sizeof(agsaFatalErrorInfo_t));
113 /* read detail fatal errors */
114 value = siHalRegReadExt(agRoot, GEN_MSGU_SCRATCH_PAD_0, MSGU_SCRATCH_PAD_0);
115 fatal_error.errorInfo0 = value;
116 SA_DBG1(("siFatalInterruptHandler: ScratchPad0 AAP error 0x%x code 0x%x\n",SCRATCH_PAD1_V_ERROR_STATE( value ), value));
118 value = siHalRegReadExt(agRoot, GEN_MSGU_SCRATCH_PAD_1, MSGU_SCRATCH_PAD_1);
119 fatal_error.errorInfo1 = value;
120 /* AAP error state */
121 SA_DBG1(("siFatalInterruptHandler: AAP error state and error code 0x%x\n", value));
122 value = siHalRegReadExt(agRoot, GEN_MSGU_SCRATCH_PAD_2, MSGU_SCRATCH_PAD_2);
123 fatal_error.errorInfo2 = value;
124 SA_DBG1(("siFatalInterruptHandler: SCRATCH_PAD2 0x%08x\n", fatal_error.errorInfo2 ));
126 #if defined(SALLSDK_DEBUG)
127 if(fatal_error.errorInfo2 & SCRATCH_PAD2_FW_ILA_ERR)
129 SA_DBG1(("siFatalInterruptHandler:SCRATCH_PAD1_V_ERROR_STATE SCRATCH_PAD2_FW_ILA_ERR 0x%08x\n", SCRATCH_PAD2_FW_ILA_ERR));
131 if(fatal_error.errorInfo2 & SCRATCH_PAD2_FW_FLM_ERR)
133 SA_DBG1(("siFatalInterruptHandler: SCRATCH_PAD2_FW_FLM_ERR 0x%08x\n", SCRATCH_PAD2_FW_FLM_ERR));
135 if(fatal_error.errorInfo2 & SCRATCH_PAD2_FW_FW_ASRT_ERR)
137 SA_DBG1(("siFatalInterruptHandler: SCRATCH_PAD2_FW_FW_ASRT_ERR 0x%08x\n", SCRATCH_PAD2_FW_FW_ASRT_ERR));
139 if(fatal_error.errorInfo2 & SCRATCH_PAD2_FW_HW_WDG_ERR)
141 SA_DBG1(("siFatalInterruptHandler: SCRATCH_PAD2_FW_HW_WDG_ERR 0x%08x\n", SCRATCH_PAD2_FW_HW_WDG_ERR));
143 if(fatal_error.errorInfo2 & SCRATCH_PAD2_FW_GEN_EXCEPTION_ERR)
145 SA_DBG1(("siFatalInterruptHandler: SCRATCH_PAD2_FW_GEN_EXCEPTION_ERR 0x%08x\n", SCRATCH_PAD2_FW_GEN_EXCEPTION_ERR));
147 if(fatal_error.errorInfo2 & SCRATCH_PAD2_FW_UNDTMN_ERR)
149 SA_DBG1(("siFatalInterruptHandler: SCRATCH_PAD2_FW_UNDTMN_ERR 0x%08x\n",SCRATCH_PAD2_FW_UNDTMN_ERR ));
151 if(fatal_error.errorInfo2 & SCRATCH_PAD2_FW_HW_FATAL_ERR)
153 SA_DBG1(("siFatalInterruptHandler: SCRATCH_PAD2_FW_HW_FATAL_ERR 0x%08x\n", SCRATCH_PAD2_FW_HW_FATAL_ERR));
155 if((fatal_error.errorInfo2 & SCRATCH_PAD2_FW_HW_MASK) == SCRATCH_PAD2_HW_ERROR_INT_INDX_PCS_ERR )
157 SA_DBG1(("siFatalInterruptHandler: SCRATCH_PAD2_HW_ERROR_INT_INDX_PCS_ERR 0x%08x\n", value));
159 if((fatal_error.errorInfo2 & SCRATCH_PAD2_FW_HW_MASK) == SCRATCH_PAD2_HW_ERROR_INT_INDX_GSM_ERR )
161 SA_DBG1(("siFatalInterruptHandler: SCRATCH_PAD2_HW_ERROR_INT_INDX_GSM_ERR 0x%08x\n", value));
163 if((fatal_error.errorInfo2 & SCRATCH_PAD2_FW_HW_MASK) == SCRATCH_PAD2_HW_ERROR_INT_INDX_OSSP0_ERR )
165 SA_DBG1(("siFatalInterruptHandler: SCRATCH_PAD2_HW_ERROR_INT_INDX_OSSP0_ERR 0x%08x\n", value));
167 if((fatal_error.errorInfo2 & SCRATCH_PAD2_FW_HW_MASK) ==SCRATCH_PAD2_HW_ERROR_INT_INDX_OSSP1_ERR )
169 SA_DBG1(("siFatalInterruptHandler: SCRATCH_PAD2_HW_ERROR_INT_INDX_OSSP1_ERR 0x%08x\n", value));
171 if((fatal_error.errorInfo2 & SCRATCH_PAD2_FW_HW_MASK) == SCRATCH_PAD2_HW_ERROR_INT_INDX_OSSP2_ERR )
173 SA_DBG1(("siFatalInterruptHandler: SCRATCH_PAD2_HW_ERROR_INT_INDX_OSSP2_ERR 0x%08x\n", value));
175 if((fatal_error.errorInfo2 & SCRATCH_PAD2_FW_HW_MASK) == SCRATCH_PAD2_HW_ERROR_INT_INDX_ERAAE_ERR )
177 SA_DBG1(("siFatalInterruptHandler: SCRATCH_PAD2_HW_ERROR_INT_INDX_ERAAE_ERR 0x%08x\n", value));
179 if((fatal_error.errorInfo2 & SCRATCH_PAD2_FW_HW_MASK) == SCRATCH_PAD2_HW_ERROR_INT_INDX_SDS_ERR )
181 SA_DBG1(("siFatalInterruptHandler: SCRATCH_PAD2_HW_ERROR_INT_INDX_SDS_ERR 0x%08x\n", value));
183 if((fatal_error.errorInfo2 & SCRATCH_PAD2_FW_HW_MASK) == SCRATCH_PAD2_HW_ERROR_INT_INDX_PCIE_CORE_ERR )
185 SA_DBG1(("siFatalInterruptHandler: SCRATCH_PAD2_HW_ERROR_INT_INDX_PCIE_CORE_ERR 0x%08x\n", value));
187 if((fatal_error.errorInfo2 & SCRATCH_PAD2_FW_HW_MASK) == SCRATCH_PAD2_HW_ERROR_INT_INDX_PCIE_AL_ERR )
189 SA_DBG1(("siFatalInterruptHandler: SCRATCH_PAD2_HW_ERROR_INT_INDX_PCIE_AL_ERR 0x%08x\n", value));
191 if((fatal_error.errorInfo2 & SCRATCH_PAD2_FW_HW_MASK) == SCRATCH_PAD2_HW_ERROR_INT_INDX_MSGU_ERR )
193 SA_DBG1(("siFatalInterruptHandler: SCRATCH_PAD2_HW_ERROR_INT_INDX_MSGU_ERR 0x%08x\n", value));
195 if((fatal_error.errorInfo2 & SCRATCH_PAD2_FW_HW_MASK) == SCRATCH_PAD2_HW_ERROR_INT_INDX_SPBC_ERR )
197 SA_DBG1(("siFatalInterruptHandler: SCRATCH_PAD2_HW_ERROR_INT_INDX_SPBC_ERR 0x%08x\n", value));
199 if((fatal_error.errorInfo2 & SCRATCH_PAD2_FW_HW_MASK) == SCRATCH_PAD2_HW_ERROR_INT_INDX_BDMA_ERR )
201 SA_DBG1(("siFatalInterruptHandler: SCRATCH_PAD2_HW_ERROR_INT_INDX_BDMA_ERR 0x%08x\n", value));
203 if((fatal_error.errorInfo2 & SCRATCH_PAD2_FW_HW_MASK) == SCRATCH_PAD2_HW_ERROR_INT_INDX_MCPSL2B_ERR)
205 SA_DBG1(("siFatalInterruptHandler: SCRATCH_PAD2_HW_ERROR_INT_INDX_MCPSL2B_ERR 0x%08x\n", value));
207 if((fatal_error.errorInfo2 & SCRATCH_PAD2_FW_HW_MASK) == SCRATCH_PAD2_HW_ERROR_INT_INDX_MCPSDC_ERR )
209 SA_DBG1(("siFatalInterruptHandler: SCRATCH_PAD2_HW_ERROR_INT_INDX_MCPSDC_ERR 0x%08x\n", value));
211 if((fatal_error.errorInfo2 & SCRATCH_PAD2_FW_HW_MASK) == SCRATCH_PAD2_HW_ERROR_INT_INDX_UNDETERMINED_ERROR_OCCURRED )
213 SA_DBG1(("siFatalInterruptHandler: SCRATCH_PAD2_HW_ERROR_INT_INDX_UNDETERMINED_ERROR_OCCURRED 0x%08x\n", value));
215 #endif /* SALLSDK_DEBUG */
217 if( fatal_error.errorInfo2 & SCRATCH_PAD2_FW_HW_NON_FATAL_ERR &&
218 !(fatal_error.errorInfo2 & SCRATCH_PAD2_FW_ILA_ERR) &&
219 !(fatal_error.errorInfo2 & SCRATCH_PAD2_FW_FLM_ERR) &&
220 !(fatal_error.errorInfo2 & SCRATCH_PAD2_FW_FW_ASRT_ERR) &&
221 !(fatal_error.errorInfo2 & SCRATCH_PAD2_FW_HW_WDG_ERR) &&
222 !(fatal_error.errorInfo2 & SCRATCH_PAD2_FW_GEN_EXCEPTION_ERR) &&
223 !(fatal_error.errorInfo2 & SCRATCH_PAD2_FW_UNDTMN_ERR) &&
224 !(fatal_error.errorInfo2 & SCRATCH_PAD2_HW_ERROR_INT_INDX_PCS_ERR) &&
225 !(fatal_error.errorInfo2 & SCRATCH_PAD2_HW_ERROR_INT_INDX_GSM_ERR) &&
226 !(fatal_error.errorInfo2 & SCRATCH_PAD2_HW_ERROR_INT_INDX_OSSP0_ERR) &&
227 !(fatal_error.errorInfo2 & SCRATCH_PAD2_HW_ERROR_INT_INDX_OSSP2_ERR) &&
228 !(fatal_error.errorInfo2 & SCRATCH_PAD2_HW_ERROR_INT_INDX_ERAAE_ERR) &&
229 !(fatal_error.errorInfo2 & SCRATCH_PAD2_HW_ERROR_INT_INDX_SDS_ERR) &&
230 !(fatal_error.errorInfo2 & SCRATCH_PAD2_HW_ERROR_INT_INDX_PCIE_CORE_ERR) &&
231 !(fatal_error.errorInfo2 & SCRATCH_PAD2_HW_ERROR_INT_INDX_PCIE_AL_ERR) &&
232 !(fatal_error.errorInfo2 & SCRATCH_PAD2_HW_ERROR_INT_INDX_MSGU_ERR) &&
233 !(fatal_error.errorInfo2 & SCRATCH_PAD2_HW_ERROR_INT_INDX_SPBC_ERR) &&
234 !(fatal_error.errorInfo2 & SCRATCH_PAD2_HW_ERROR_INT_INDX_BDMA_ERR) &&
235 !(fatal_error.errorInfo2 & SCRATCH_PAD2_HW_ERROR_INT_INDX_MCPSL2B_ERR) &&
236 !(fatal_error.errorInfo2 & SCRATCH_PAD2_HW_ERROR_INT_INDX_MCPSDC_ERR) &&
237 !(fatal_error.errorInfo2 & SCRATCH_PAD2_HW_ERROR_INT_INDX_UNDETERMINED_ERROR_OCCURRED) &&
238 !(fatal_error.errorInfo2 & SCRATCH_PAD2_FW_HW_FATAL_ERR) )
240 SA_DBG1(("siFatalInterruptHandler: SCRATCH_PAD2_FW_HW_NON_FATAL_ERR 0x%08x\n", value));
244 value = siHalRegReadExt(agRoot, GEN_MSGU_SCRATCH_PAD_3, MSGU_SCRATCH_PAD_3);
245 SA_DBG1(("siFatalInterruptHandler: ScratchPad3 IOP error code 0x%08x\n", value));
246 fatal_error.errorInfo3 = value;
248 if (agNULL != saRoot)
250 fatal_error.regDumpBusBaseNum0 = saRoot->mainConfigTable.regDumpPCIBAR;
251 fatal_error.regDumpOffset0 = saRoot->mainConfigTable.FatalErrorDumpOffset0;
252 fatal_error.regDumpLen0 = saRoot->mainConfigTable.FatalErrorDumpLength0;
253 fatal_error.regDumpBusBaseNum1 = saRoot->mainConfigTable.regDumpPCIBAR;
254 fatal_error.regDumpOffset1 = saRoot->mainConfigTable.FatalErrorDumpOffset1;
255 fatal_error.regDumpLen1 = saRoot->mainConfigTable.FatalErrorDumpLength1;
259 fatal_error.regDumpBusBaseNum0 = 0;
260 fatal_error.regDumpOffset0 = 0;
261 fatal_error.regDumpLen0 = 0;
262 fatal_error.regDumpBusBaseNum1 = 0;
263 fatal_error.regDumpOffset1 = 0;
264 fatal_error.regDumpLen1 = 0;
266 /* Call Back with error */
267 SA_DBG1(("siFatalInterruptHandler: Sendfatal %x HostR0 0x%x\n",Sendfatal ,ossaHwRegReadExt(agRoot, PCIBAR0,V_Scratchpad_Rsvd_0_Register ) ));
268 SA_DBG1(("siFatalInterruptHandler: ScratchPad2 0x%x ScratchPad3 0x%x\n",
269 ossaHwRegReadExt(agRoot, PCIBAR0,V_Host_Scratchpad_2_Register),
270 ossaHwRegReadExt(agRoot, PCIBAR0,V_Host_Scratchpad_3_Register) ));
272 ossaHwCB(agRoot, agNULL, OSSA_HW_EVENT_MALFUNCTION, Sendfatal, (void *)&fatal_error, agNULL);
273 ret = AGSA_RC_SUCCESS;
278 host_reg0 = ossaHwRegReadExt(agRoot, PCIBAR0,V_Scratchpad_Rsvd_0_Register );
279 if( host_reg0 == 0x2)
283 SA_DBG1(("siFatalInterruptHandler: Non fatal ScratchPad1 0x%x HostR0 0x%x\n", value,host_reg0));
284 SA_DBG1(("siFatalInterruptHandler: ScratchPad0 0x%x ScratchPad1 0x%x\n",
285 ossaHwRegReadExt(agRoot, PCIBAR0,V_Scratchpad_0_Register),
286 ossaHwRegReadExt(agRoot, PCIBAR0,V_Scratchpad_1_Register) ));
287 SA_DBG1(("siFatalInterruptHandler: ScratchPad2 0x%x ScratchPad3 0x%x\n",
288 ossaHwRegReadExt(agRoot, PCIBAR0,V_Scratchpad_2_Register),
289 ossaHwRegReadExt(agRoot, PCIBAR0,V_Scratchpad_3_Register) ));
291 ossaHwCB(agRoot, agNULL, OSSA_HW_EVENT_MALFUNCTION, Sendfatal, (void *)&fatal_error, agNULL);
292 ret = AGSA_RC_SUCCESS;
294 else if( host_reg0 == HDA_AES_DIF_FUNC)
296 SA_DBG1(("siFatalInterruptHandler: HDA_AES_DIF_FUNC 0x%x\n",
297 ossaHwRegReadExt(agRoot, PCIBAR0,V_Scratchpad_Rsvd_0_Register)));
299 ret = AGSA_RC_SUCCESS;
303 SA_DBG1(("siFatalInterruptHandler: No error detected ScratchPad1 0x%x HostR0 0x%x\n", value,host_reg0));
304 SA_DBG1(("siFatalInterruptHandler: ScratchPad0 0x%x ScratchPad1 0x%x\n",
305 ossaHwRegReadExt(agRoot, PCIBAR0,V_Scratchpad_0_Register),
306 ossaHwRegReadExt(agRoot, PCIBAR0,V_Scratchpad_1_Register) ));
307 SA_DBG1(("siFatalInterruptHandler: ScratchPad2 0x%x ScratchPad3 0x%x\n",
308 ossaHwRegReadExt(agRoot, PCIBAR0,V_Scratchpad_2_Register),
309 ossaHwRegReadExt(agRoot, PCIBAR0,V_Scratchpad_3_Register) ));
311 SA_DBG1(("siFatalInterruptHandler: Doorbell_Set %08X U %08X\n",
312 ossaHwRegReadExt(agRoot, PCIBAR0, V_Outbound_Doorbell_Set_Register),
313 ossaHwRegReadExt(agRoot, PCIBAR0, V_Outbound_Doorbell_Set_RegisterU)));
314 SA_DBG1(("siFatalInterruptHandler: Doorbell_Mask %08X U %08X\n",
315 ossaHwRegReadExt(agRoot, PCIBAR0, V_Outbound_Doorbell_Mask_Set_Register ),
316 ossaHwRegReadExt(agRoot, PCIBAR0, V_Outbound_Doorbell_Mask_Set_RegisterU )));
318 ret = AGSA_RC_FAILURE;
325 GLOBAL bit32 saFatalInterruptHandler(
327 bit32 interruptVectorIndex
330 agsaLLRoot_t *saRoot = agNULL;
331 bit32 ret = AGSA_RC_FAILURE;
334 SA_ASSERT((agNULL != agRoot), "");
335 saRoot = (agsaLLRoot_t *)(agRoot->sdkData);
336 SA_ASSERT((agNULL != saRoot), "");
338 if (saRoot->ResetFailed)
340 SA_DBG1(("saFatalInterruptHandler: ResetFailed\n"));
341 ossaDisableInterrupts(agRoot, interruptVectorIndex);
342 return AGSA_RC_FAILURE;
344 if (saRoot->swConfig.fatalErrorInterruptEnable != 1)
346 SA_DBG1(("saFatalInterruptHandler: fatalErrorInterrtupt is NOT enabled\n"));
347 ossaDisableInterrupts(agRoot, interruptVectorIndex);
348 return AGSA_RC_FAILURE;
351 if (saRoot->swConfig.fatalErrorInterruptVector != interruptVectorIndex)
353 SA_DBG1(("saFatalInterruptHandler: interruptVectorIndex does not match 0x%x 0x%x\n",
354 saRoot->swConfig.fatalErrorInterruptVector, interruptVectorIndex));
355 SA_DBG1(("saFatalInterruptHandler: ScratchPad0 0x%x ScratchPad1 0x%x\n",
356 ossaHwRegReadExt(agRoot, PCIBAR0,V_Scratchpad_0_Register),
357 ossaHwRegReadExt(agRoot, PCIBAR0,V_Scratchpad_1_Register) ));
358 SA_DBG1(("saFatalInterruptHandler: ScratchPad2 0x%x ScratchPad3 0x%x\n",
359 ossaHwRegReadExt(agRoot, PCIBAR0,V_Scratchpad_2_Register),
360 ossaHwRegReadExt(agRoot, PCIBAR0,V_Scratchpad_3_Register) ));
361 ossaDisableInterrupts(agRoot, interruptVectorIndex);
362 return AGSA_RC_FAILURE;
365 ret = siFatalInterruptHandler(agRoot,interruptVectorIndex);
368 ossaDisableInterrupts(agRoot, interruptVectorIndex);
372 /******************************************************************************/
373 /*! \brief Function to process the interrupts
375 * The saInterruptHandler() function is called after an interrupts has
377 * This function disables interrupts
379 * \param agRoot OS Layer-specific and LL Layer-specific context handles for this
380 * instance of SAS/SATA hardware
381 * \param interruptVectorIndex message that caused MSI message
383 * \return TRUE if we caused interrupt
386 /*******************************************************************************/
390 bit32 interruptVectorIndex
393 agsaLLRoot_t *saRoot = (agsaLLRoot_t *)(agRoot->sdkData);
394 bit32 ToBeProcessedCount = 0;
396 #ifdef SA_TEST_FW_SPURIOUS_INT
398 #endif/* SA_TEST_FW_SPURIOUS_INT */
400 if( agNULL == saRoot )
402 /* Can be called before initialize is completed in a shared
403 interrupt environment like windows 2003
405 return(ToBeProcessedCount);
408 if( (our_int = saRoot->OurInterrupt(agRoot,interruptVectorIndex)) == FALSE )
410 #ifdef SA_TEST_FW_SPURIOUS_INT
412 smTrace(hpDBG_REGISTERS,"S1",gSpuriousIntCount);
413 /* TP:S1 gSpuriousIntCount */
414 #endif /* SA_TEST_FW_SPURIOUS_INT */
415 return(ToBeProcessedCount);
418 smTraceFuncEnter(hpDBG_TICK_INT, "5q");
420 smTrace(hpDBG_TICK_INT,"VI",interruptVectorIndex);
421 /* TP:Vi interrupt VectorIndex */
423 if ( agFALSE == saRoot->sysIntsActive )
425 // SA_ASSERT(0, "saInterruptHandler sysIntsActive not set");
427 #ifdef SA_PRINTOUT_IN_WINDBG
429 DbgPrint("saInterruptHandler: sysIntsActive not set Doorbell_Mask_Set %08X U %08X\n",
430 ossaHwRegReadExt(agRoot, PCIBAR0, V_Outbound_Doorbell_Mask_Set_Register),
431 ossaHwRegReadExt(agRoot, PCIBAR0, V_Outbound_Doorbell_Mask_Set_RegisterU) );
433 #endif /* SA_PRINTOUT_IN_WINDBG */
436 SA_DBG1(("saInterruptHandler: Doorbell_Mask_Set %08X U %08X\n",
437 ossaHwRegReadExt(agRoot, PCIBAR0, V_Outbound_Doorbell_Mask_Set_Register),
438 ossaHwRegReadExt(agRoot, PCIBAR0, V_Outbound_Doorbell_Mask_Set_RegisterU)));
439 ossaDisableInterrupts(agRoot, interruptVectorIndex);
440 return(ToBeProcessedCount);
444 /* Allow replacement of disable interrupt */
445 ossaDisableInterrupts(agRoot, interruptVectorIndex);
448 #ifdef SA_TEST_FW_SPURIOUS_INT
450 /* count for my interrupt */
453 smTrace(hpDBG_REGISTERS,"S4",gOurIntCount);
454 /* TP:S4 gOurIntCount */
455 #endif /* SA_TEST_FW_SPURIOUS_INT */
457 smTraceFuncExit(hpDBG_TICK_INT, 'a', "5q");
462 /******************************************************************************/
463 /*! \brief Function to disable MSIX interrupts
465 * siDisableMSIXInterrupts disables interrupts
466 * called thru macro ossaDisableInterrupts
467 * \param agRoot OS Layer-specific and LL Layer-specific context handles for this
468 * instance of SAS/SATA hardware
469 * \param interruptVectorIndex - vector index for message
472 /*******************************************************************************/
473 GLOBAL void siDisableMSIXInterrupts(
475 bit32 interruptVectorIndex
479 #ifndef SA_CLEAR_ODCR_IN_INTERRUPT
481 #endif /* SA_CLEAR_ODCR_IN_INTERRUPT */
482 msi_index = interruptVectorIndex * MSIX_TABLE_ELEMENT_SIZE;
483 msi_index += MSIX_TABLE_BASE;
484 ossaHwRegWrite(agRoot,msi_index , MSIX_INTERRUPT_DISABLE);
485 ossaHwRegRead(agRoot, msi_index); /* Dummy read */
486 #ifndef SA_CLEAR_ODCR_IN_INTERRUPT
487 value = (1 << interruptVectorIndex);
488 ossaHwRegWrite(agRoot, MSGU_ODCR, value);
489 #endif /* SA_CLEAR_ODCR_IN_INTERRUPT */
492 /******************************************************************************/
493 /*! \brief Function to disable MSIX V interrupts
495 * siDisableMSIXInterrupts disables interrupts
496 * called thru macro ossaDisableInterrupts
497 * \param agRoot OS Layer-specific and LL Layer-specific context handles for this
498 * instance of SAS/SATA hardware
499 * \param interruptVectorIndex - vector index for message
502 /*******************************************************************************/
503 void siDisableMSIX_V_Interrupts(
505 bit32 interruptVectorIndex
510 mask =( (bit64)1 << interruptVectorIndex);
512 if(smIS64bInt(agRoot))
514 SA_DBG4(("siDisableMSIX_V_Interrupts: VI %d U 0x%08X L 0x%08X\n",interruptVectorIndex,u64.S32[1],u64.S32[0]));
515 ossaHwRegWriteExt(agRoot, PCIBAR0,V_Outbound_Doorbell_Mask_Set_RegisterU,u64.S32[1]);
517 ossaHwRegWriteExt(agRoot, PCIBAR0,V_Outbound_Doorbell_Mask_Set_Register, u64.S32[0]);
520 /******************************************************************************/
521 /*! \brief Function to disable MSI interrupts
523 * siDisableMSIInterrupts disables interrupts
524 * called thru macro ossaDisableInterrupts
525 * \param agRoot OS Layer-specific and LL Layer-specific context handles for this
526 * instance of SAS/SATA hardware
527 * \param interruptVectorIndex - vector index for message
530 /*******************************************************************************/
531 GLOBAL void siDisableMSIInterrupts(
533 bit32 interruptVectorIndex
538 mask = 1 << interruptVectorIndex;
540 /*Must be protected for interuption */
541 ODMRValue = ossaHwRegRead(agRoot, MSGU_ODMR);
544 ossaHwRegWrite(agRoot, MSGU_ODMR, ODMRValue);
545 ossaHwRegWrite(agRoot, MSGU_ODCR, mask);
548 /******************************************************************************/
549 /*! \brief Function to disable MSI V interrupts
551 * siDisableMSIInterrupts disables interrupts
552 * called thru macro ossaDisableInterrupts
553 * \param agRoot OS Layer-specific and LL Layer-specific context handles for this
554 * instance of SAS/SATA hardware
555 * \param interruptVectorIndex - vector index for message
558 /*******************************************************************************/
559 GLOBAL void siDisableMSI_V_Interrupts(
561 bit32 interruptVectorIndex
564 SA_ASSERT(0, "Should not be called");
565 SA_DBG4(("siDisableMSI_V_Interrupts:\n"));
568 /******************************************************************************/
569 /*! \brief Function to process Legacy interrupts
571 * siDisableLegacyInterrupts disables interrupts
572 * called thru macro ossaDisableInterrupts
574 * \param agRoot OS Layer-specific and LL Layer-specific context handles for this
575 * instance of SAS/SATA hardware
576 * \param interruptVectorIndex not used in legacy case
579 /*******************************************************************************/
580 GLOBAL void siDisableLegacyInterrupts(
582 bit32 interruptVectorIndex
585 ossaHwRegWrite(agRoot, MSGU_ODMR, ODMR_MASK_ALL);
586 #ifndef SA_CLEAR_ODCR_IN_INTERRUPT
587 ossaHwRegWrite(agRoot, MSGU_ODCR, ODCR_CLEAR_ALL);
588 #endif /* SA_CLEAR_ODCR_IN_INTERRUPT */
591 /******************************************************************************/
592 /*! \brief Function to process Legacy V interrupts
594 * siDisableLegacyInterrupts disables interrupts
595 * called thru macro ossaDisableInterrupts
597 * \param agRoot OS Layer-specific and LL Layer-specific context handles for this
598 * instance of SAS/SATA hardware
599 * \param interruptVectorIndex not used in legacy case
602 /*******************************************************************************/
603 GLOBAL void siDisableLegacy_V_Interrupts(
605 bit32 interruptVectorIndex
611 mask =( (bit64)1 << interruptVectorIndex);
614 SA_DBG4(("siDisableLegacy_V_Interrupts:IN MSGU_READ_ODR %08X\n",siHalRegReadExt(agRoot, GEN_MSGU_ODR, V_Outbound_Doorbell_Set_Register)));
615 SA_DBG4(("siDisableLegacy_V_Interrupts:IN MSGU_READ_ODMR %08X\n",siHalRegReadExt(agRoot, GEN_MSGU_ODMR, V_Outbound_Doorbell_Mask_Set_Register )));
616 if(smIS64bInt(agRoot))
618 SA_DBG4(("siDisableLegacy_V_Interrupts: VI %d U 0x%08X L 0x%08X\n",interruptVectorIndex,u64.S32[1],u64.S32[0]));
619 ossaHwRegWriteExt(agRoot, PCIBAR0,V_Outbound_Doorbell_Mask_Set_Register,u64.S32[1] );
621 ossaHwRegWriteExt(agRoot, PCIBAR0,V_Outbound_Doorbell_Mask_Set_RegisterU,u64.S32[0]);
624 /******************************************************************************/
625 /*! \brief Function to process MSIX interrupts
627 * siOurMSIXInterrupt checks if we generated interrupt
628 * called thru function pointer saRoot->OurInterrupt
630 * \param agRoot OS Layer-specific and LL Layer-specific context handles for this
631 * instance of SAS/SATA hardware
632 * \return always true
634 /*******************************************************************************/
635 GLOBAL bit32 siOurMSIXInterrupt(
637 bit32 interruptVectorIndex
643 /******************************************************************************/
644 /*! \brief Function to process MSIX V interrupts
646 * siOurMSIXInterrupt checks if we generated interrupt
647 * called thru function pointer saRoot->OurInterrupt
649 * \param agRoot OS Layer-specific and LL Layer-specific context handles for this
650 * instance of SAS/SATA hardware
651 * \return always true
653 /*******************************************************************************/
654 GLOBAL bit32 siOurMSIX_V_Interrupt(
656 bit32 interruptVectorIndex
661 /******************************************************************************/
662 /*! \brief Function to process MSI interrupts
664 * siOurMSIInterrupt checks if we generated interrupt
665 * called thru function pointer saRoot->OurInterrupt
667 * \param agRoot OS Layer-specific and LL Layer-specific context handles for this
668 * instance of SAS/SATA hardware
669 * \return always true
671 /*******************************************************************************/
672 bit32 siOurMSIInterrupt(
674 bit32 interruptVectorIndex
680 /******************************************************************************/
681 /*! \brief Function to process MSI V interrupts
683 * siOurMSIInterrupt checks if we generated interrupt
684 * called thru function pointer saRoot->OurInterrupt
686 * \param agRoot OS Layer-specific and LL Layer-specific context handles for this
687 * instance of SAS/SATA hardware
688 * \return always true
690 /*******************************************************************************/
691 bit32 siOurMSI_V_Interrupt(
693 bit32 interruptVectorIndex
696 SA_DBG4((":siOurMSI_V_Interrupt\n"));
700 /******************************************************************************/
701 /*! \brief Function to process Legacy interrupts
703 * siOurLegacyInterrupt checks if we generated interrupt
704 * called thru function pointer saRoot->OurInterrupt
706 * \param agRoot OS Layer-specific and LL Layer-specific context handles for this
707 * instance of SAS/SATA hardware
708 * \return true if we claim interrupt
710 /*******************************************************************************/
711 bit32 siOurLegacyInterrupt(
713 bit32 interruptVectorIndex
718 Int_masked = MSGU_READ_ODMR;
719 Int_active = MSGU_READ_ODR;
733 /******************************************************************************/
734 /*! \brief Function to process Legacy V interrupts
736 * siOurLegacyInterrupt checks if we generated interrupt
737 * called thru function pointer saRoot->OurInterrupt
739 * \param agRoot OS Layer-specific and LL Layer-specific context handles for this
740 * instance of SAS/SATA hardware
741 * \return true if we claim interrupt
743 /*******************************************************************************/
744 bit32 siOurLegacy_V_Interrupt(
746 bit32 interruptVectorIndex
750 Int_active = siHalRegReadExt(agRoot, GEN_MSGU_ODR, V_Outbound_Doorbell_Set_Register );
752 return(Int_active ? TRUE : FALSE);
756 /******************************************************************************/
757 /*! \brief Function to process the cause of interrupt
759 * The saDelayedInterruptHandler() function is called after an interrupt messages has
760 * been received it may be called by a deferred procedure call
762 * \param agRoot OS Layer-specific and LL Layer-specific context handles for this
763 * instance of SAS/SATA hardware
764 * \param interruptVectorIndex - vector index for message
765 * \param count Number of completion queue entries to consume
767 * \return number of messages processed
770 /*******************************************************************************/
772 saDelayedInterruptHandler(
774 bit32 interruptVectorIndex,
778 agsaLLRoot_t *saRoot = (agsaLLRoot_t *)(agRoot->sdkData);
779 bit32 processedMsgCount = 0;
782 #if defined(SALLSDK_DEBUG)
787 OSSA_OUT_ENTER(agRoot);
789 smTraceFuncEnter(hpDBG_VERY_LOUD,"5p");
791 smTrace(hpDBG_VERY_LOUD,"Vd",interruptVectorIndex);
792 /* TP:Vd delayed VectorIndex */
793 smTrace(hpDBG_VERY_LOUD,"Vc",count);
794 /* TP:Vc IOMB count*/
796 if( saRoot->swConfig.fatalErrorInterruptEnable &&
797 saRoot->swConfig.fatalErrorInterruptVector == interruptVectorIndex )
799 pad1 = siHalRegReadExt(agRoot,GEN_MSGU_SCRATCH_PAD_1, MSGU_SCRATCH_PAD_1);
800 host_reg0 = ossaHwRegReadExt(agRoot, PCIBAR0,V_Scratchpad_Rsvd_0_Register );
803 if(saRoot->swConfig.hostDirectAccessMode & 2 )
805 if( host_reg0 == HDA_AES_DIF_FUNC)
812 #if defined(SALLSDK_DEBUG)
813 host_reg1 = ossaHwRegReadExt(agRoot, PCIBAR0,V_Scratchpad_Rsvd_1_Register );
815 if( (SCRATCH_PAD1_V_ERROR_STATE( pad1 ) != 0 ) && host_reg0 )
818 SA_DBG1(("saDelayedInterruptHandler: vi %d Error %08X\n",interruptVectorIndex, SCRATCH_PAD1_V_ERROR_STATE( pad1 )));
819 SA_DBG1(("saDelayedInterruptHandler: Sp 1 %08X Hr0 %08X Hr1 %08X\n",pad1,host_reg0,host_reg1 ));
820 SA_DBG1(("saDelayedInterruptHandler: SCRATCH_PAD1_V_ERROR_STATE %08X\n", SCRATCH_PAD1_V_ERROR_STATE( pad1 )));
821 SA_DBG1(("saDelayedInterruptHandler: SCRATCH_PAD1_V_ILA_ERROR_STATE %08X\n", SCRATCH_PAD1_V_ILA_ERROR_STATE( pad1 )));
822 SA_DBG1(("saDelayedInterruptHandler: SCRATCH_PAD1_V_RAAE_ERROR_STATE %08X\n", SCRATCH_PAD1_V_RAAE_ERROR_STATE( pad1 )));
823 SA_DBG1(("saDelayedInterruptHandler: SCRATCH_PAD1_V_IOP0_ERROR_STATE %08X\n", SCRATCH_PAD1_V_IOP0_ERROR_STATE( pad1 )));
824 SA_DBG1(("saDelayedInterruptHandler: SCRATCH_PAD1_V_IOP1_ERROR_STATE %08X\n", SCRATCH_PAD1_V_IOP1_ERROR_STATE( pad1 )));
826 siFatalInterruptHandler( agRoot, interruptVectorIndex );
827 ossaDisableInterrupts(agRoot, interruptVectorIndex);
832 SA_DBG2(("saDelayedInterruptHandler: Fatal Check VI %d SCRATCH_PAD1 %08X host_reg0 %08X host_reg1 %08X\n",interruptVectorIndex, pad1,host_reg0,host_reg1));
833 SA_DBG2(("saDelayedInterruptHandler: ScratchPad0 0x%x ScratchPad1 0x%x\n",
834 ossaHwRegReadExt(agRoot, PCIBAR0,V_Scratchpad_0_Register),
835 ossaHwRegReadExt(agRoot, PCIBAR0,V_Scratchpad_1_Register) ));
836 SA_DBG2(("saDelayedInterruptHandler: ScratchPad2 0x%x ScratchPad3 0x%x\n",
837 ossaHwRegReadExt(agRoot, PCIBAR0,V_Scratchpad_2_Register),
838 ossaHwRegReadExt(agRoot, PCIBAR0,V_Scratchpad_3_Register) ));
840 SA_DBG2(("saDelayedInterruptHandler: Doorbell_Set %08X U %08X\n",
841 ossaHwRegReadExt(agRoot, PCIBAR0, V_Outbound_Doorbell_Set_Register),
842 ossaHwRegReadExt(agRoot, PCIBAR0, V_Outbound_Doorbell_Set_RegisterU)));
843 SA_DBG2(("saDelayedInterruptHandler: Doorbell_Mask %08X U %08X\n",
844 ossaHwRegReadExt(agRoot, PCIBAR0, V_Outbound_Doorbell_Mask_Set_Register ),
845 ossaHwRegReadExt(agRoot, PCIBAR0, V_Outbound_Doorbell_Mask_Set_RegisterU )));
851 #ifdef SA_LNX_PERF_MODE
852 return siProcessOBMsg(agRoot, count, interruptVectorIndex);
855 /* check all the configuration outbound queues within a vector bitmap */
856 SA_ASSERT((saRoot->QueueConfig.numOutboundQueues < 65), "numOutboundQueue");
858 for ( i = 0; i < saRoot->QueueConfig.numOutboundQueues; i++ )
860 /* process IOMB in the outbound queue 0 to 31 if bit set in the vector bitmap */
863 if (saRoot->interruptVecIndexBitMap[interruptVectorIndex] & (1 << i))
865 processedMsgCount += siProcessOBMsg(agRoot, count, i);
867 else if (saRoot->QueueConfig.outboundQueues[i].interruptEnable == 0)
869 /* polling mode - interruptVectorIndex = 0 only and no bit set */
870 processedMsgCount += siProcessOBMsg(agRoot, count, i);
872 #ifdef SA_FW_TEST_INTERRUPT_REASSERT
873 else if (saRoot->CheckAll)
875 /* polling mode - interruptVectorIndex = 0 only and no bit set */
876 processedMsgCount += siProcessOBMsg(agRoot, count, i);
878 #endif /* SA_FW_TEST_INTERRUPT_REASSERT */
883 /* process IOMB in the outbound queue 32 to 63 if bit set in the vector bitmap */
884 if (saRoot->interruptVecIndexBitMap1[interruptVectorIndex] & (1 << (i - OQ_NUM_32)))
886 processedMsgCount += siProcessOBMsg(agRoot, count, i);
888 /* check interruptEnable bit for polling mode of OQ */
889 /* the following code can be removed, we do not care about the bit */
890 else if (saRoot->QueueConfig.outboundQueues[i].interruptEnable == 0)
892 /* polling mode - interruptVectorIndex = 0 only and no bit set */
893 processedMsgCount += siProcessOBMsg(agRoot, count, i);
895 #ifdef SA_FW_TEST_INTERRUPT_REASSERT
896 else if (saRoot->CheckAll)
898 /* polling mode - interruptVectorIndex = 0 only and no bit set */
899 processedMsgCount += siProcessOBMsg(agRoot, count, i);
901 #endif /* SA_FW_TEST_INTERRUPT_REASSERT */
905 #ifdef SA_FW_TEST_INTERRUPT_REASSERT
906 saRoot->CheckAll = 0;
907 #endif /* SA_FW_TEST_INTERRUPT_REASSERT */
909 #ifndef SA_RENABLE_IN_OSLAYER
910 if ( agTRUE == saRoot->sysIntsActive )
912 /* Allow replacement of enable interrupt */
913 ossaReenableInterrupts(agRoot, interruptVectorIndex);
915 #endif /* SA_RENABLE_IN_OSLAYER */
917 smTraceFuncExit(hpDBG_VERY_LOUD, 'a', "5p");
919 OSSA_OUT_LEAVE(agRoot);
920 return processedMsgCount;
923 /******************************************************************************/
924 /*! \brief Function to reenable MSIX interrupts
926 * siReenableMSIXInterrupts reenableinterrupts
927 * called thru macro ossaReenableInterrupts
929 * \param agRoot OS Layer-specific and LL Layer-specific context handles for this
930 * instance of SAS/SATA hardware
931 * \param interruptVectorIndex - vector index for message
934 /*******************************************************************************/
935 void siReenableMSIXInterrupts(
937 bit32 interruptVectorIndex
941 #ifdef SA_CLEAR_ODCR_IN_INTERRUPT
943 #endif /* SA_CLEAR_ODCR_IN_INTERRUPT */
944 msi_index = interruptVectorIndex * MSIX_TABLE_ELEMENT_SIZE;
945 msi_index += MSIX_TABLE_BASE;
946 ossaHwRegWriteExt(agRoot, PCIBAR0,msi_index, MSIX_INTERRUPT_ENABLE);
948 SA_DBG4(("siReenableMSIXInterrupts:interruptVectorIndex %d\n",interruptVectorIndex));
950 #ifdef SA_CLEAR_ODCR_IN_INTERRUPT
951 value = (1 << interruptVectorIndex);
952 siHalRegWriteExt(agRoot, GEN_MSGU_ODCR, MSGU_ODCR, value);
953 #endif /* SA_CLEAR_ODCR_IN_INTERRUPT */
955 /******************************************************************************/
956 /*! \brief Function to reenable MSIX interrupts
958 * siReenableMSIXInterrupts reenableinterrupts
959 * called thru macro ossaReenableInterrupts
961 * \param agRoot OS Layer-specific and LL Layer-specific context handles for this
962 * instance of SAS/SATA hardware
963 * \param interruptVectorIndex - vector index for message
966 /*******************************************************************************/
967 void siReenableMSIX_V_Interrupts(
969 bit32 interruptVectorIndex
972 agsaLLRoot_t *saRoot = (agsaLLRoot_t *)(agRoot->sdkData);
975 mask =( (bit64)1 << interruptVectorIndex);
978 SA_DBG4(("siReenableMSIX_V_Interrupts:\n"));
980 if(saRoot->sysIntsActive)
982 if(smIS64bInt(agRoot))
984 SA_DBG4(("siReenableMSIX_V_Interrupts: VI %d U 0x%08X L 0x%08X\n",interruptVectorIndex,u64.S32[1],u64.S32[0]));
985 ossaHwRegWriteExt(agRoot, PCIBAR0,V_Outbound_Doorbell_Mask_Clear_RegisterU,u64.S32[1] );
987 ossaHwRegWriteExt(agRoot, PCIBAR0,V_Outbound_Doorbell_Mask_Clear_Register,u64.S32[0]);
991 SA_DBG1(("siReenableMSIX_V_Interrupts: VI %d sysIntsActive off\n",interruptVectorIndex));
996 /******************************************************************************/
997 /*! \brief Function to reenable MSI interrupts
999 * siReenableMSIXInterrupts reenableinterrupts
1000 * called thru macro ossaReenableInterrupts
1002 * \param agRoot OS Layer-specific and LL Layer-specific context handles for this
1003 * instance of SAS/SATA hardware
1004 * \param interruptVectorIndex - vector index for message
1007 /*******************************************************************************/
1008 GLOBAL void siReenableMSIInterrupts(
1010 bit32 interruptVectorIndex
1015 ODMRValue = siHalRegReadExt(agRoot, GEN_MSGU_ODMR, MSGU_ODMR);
1016 ODMRValue &= ~(1 << interruptVectorIndex);
1018 siHalRegWriteExt(agRoot, GEN_MSGU_ODMR, MSGU_ODMR, ODMRValue);
1021 /******************************************************************************/
1022 /*! \brief Function to reenable MSI V interrupts
1024 * siReenableMSIXInterrupts reenableinterrupts
1025 * called thru macro ossaReenableInterrupts
1027 * \param agRoot OS Layer-specific and LL Layer-specific context handles for this
1028 * instance of SAS/SATA hardware
1029 * \param interruptVectorIndex - vector index for message
1032 /*******************************************************************************/
1033 GLOBAL void siReenableMSI_V_Interrupts(
1035 bit32 interruptVectorIndex
1038 SA_ASSERT(0, "Should not be called");
1040 SA_DBG4(("siReenableMSI_V_Interrupts:\n"));
1043 /******************************************************************************/
1044 /*! \brief Function to reenable Legacy interrupts
1046 * siReenableLegacyInterrupts reenableinterrupts
1047 * called thru macro ossaReenableInterrupts
1049 * \param agRoot OS Layer-specific and LL Layer-specific context handles for this
1050 * instance of SAS/SATA hardware
1051 * \param interruptVectorIndex always zero
1054 /*******************************************************************************/
1055 GLOBAL void siReenableLegacyInterrupts(
1057 bit32 interruptVectorIndex
1060 siHalRegWriteExt(agRoot, GEN_MSGU_ODMR, MSGU_ODMR, ODMR_CLEAR_ALL);
1062 #ifdef SA_CLEAR_ODCR_IN_INTERRUPT
1063 siHalRegWriteExt(agRoot, GEN_MSGU_ODCR, MSGU_ODCR, ODCR_CLEAR_ALL);
1064 #endif /* SA_CLEAR_ODCR_IN_INTERRUPT */
1067 /******************************************************************************/
1068 /*! \brief Function to reenable Legacy V interrupts
1070 * siReenableLegacyInterrupts reenableinterrupts
1071 * called thru macro ossaReenableInterrupts
1073 * \param agRoot OS Layer-specific and LL Layer-specific context handles for this
1074 * instance of SAS/SATA hardware
1075 * \param interruptVectorIndex always zero
1078 /*******************************************************************************/
1079 GLOBAL void siReenableLegacy_V_Interrupts(
1081 bit32 interruptVectorIndex
1086 mask = 1 << interruptVectorIndex;
1088 SA_DBG5(("siReenableLegacy_V_Interrupts:IN MSGU_READ_ODR %08X\n",siHalRegReadExt(agRoot, GEN_MSGU_ODR, V_Outbound_Doorbell_Set_Register)));
1089 SA_DBG5(("siReenableLegacy_V_Interrupts:IN MSGU_READ_ODMR %08X\n",siHalRegReadExt(agRoot, GEN_MSGU_ODMR, V_Outbound_Doorbell_Mask_Set_Register )));
1091 ossaHwRegWriteExt(agRoot, PCIBAR0,V_Outbound_Doorbell_Mask_Clear_Register, mask);
1092 ossaHwRegWriteExt(agRoot, PCIBAR0,V_Outbound_Doorbell_Clear_Register, mask );
1095 SA_DBG5(("siReenableLegacy_V_Interrupts:OUT MSGU_READ_ODMR %08X\n",siHalRegReadExt(agRoot, GEN_MSGU_ODMR, V_Outbound_Doorbell_Mask_Set_Register )));
1099 /******************************************************************************/
1100 /*! \brief Function to enable a single interrupt vector
1104 * \param agRoot OS Layer-specific and LL Layer-specific context handles for this
1105 * instance of SAS/SATA hardware
1106 * \param interruptVectorIndex Interrupt vector to enable
1109 /*******************************************************************************/
1110 /******************************************************************************/
1111 /*! \brief saSystemInterruptsEnable
1112 * Function to enable a single interrupt vector
1114 * \param agRoot OS Layer-specific and LL Layer-specific context handles for this
1115 * instance of SAS/SATA hardware
1116 * \param interruptVectorIndex Interrupt vector to enable
1119 /*******************************************************************************/
1121 void saSystemInterruptsEnable(
1123 bit32 interruptVectorIndex
1126 ossaReenableInterrupts(agRoot, interruptVectorIndex);
1128 /******************************************************************************/
1129 /*! \brief Routine to handle Outbound Message
1131 * The handle for outbound message
1133 * \param agRoot handles for this instance of SAS/SATA hardware
1134 * \param count interrupt message count
1135 * \param queueNum outbound queue
1139 /*******************************************************************************/
1140 LOCAL FORCEINLINE bit32
1147 agsaLLRoot_t *saRoot = (agsaLLRoot_t *)(agRoot->sdkData);
1148 mpiOCQueue_t *circularQ = agNULL;
1149 void *pMsg1 = agNULL;
1150 bit32 ret, processedMsgCount = 0;
1151 bit32 ParseOBIombStatus = 0;
1152 #ifdef SA_ENABLE_TRACE_FUNCTIONS
1156 mpiMsgCategory_t category;
1159 smTraceFuncEnter(hpDBG_VERY_LOUD,"5r");
1162 SA_DBG3(("siProcessOBMsg: queueNum 0x%x\n", queueNum));
1164 ossaSingleThreadedEnter(agRoot, LL_IOREQ_OBQ_LOCK + queueNum);
1166 circularQ = &saRoot->outboundQueue[queueNum];
1167 OSSA_READ_LE_32(circularQ->agRoot, &circularQ->producerIdx, circularQ->piPointer, 0);
1169 if (circularQ->producerIdx == circularQ->consumerIdx)
1171 ossaSingleThreadedLeave(agRoot, LL_IOREQ_OBQ_LOCK + queueNum);
1172 smTraceFuncExit(hpDBG_VERY_LOUD, 'a', "5r");
1173 return processedMsgCount;
1176 ossaSingleThreadedLeave(agRoot, LL_IOREQ_OBQ_LOCK + queueNum);
1180 /* ossaSingleThreadedEnter(agRoot, LL_IOREQ_OBQ_LOCK + queueNum); */
1181 ret = mpiMsgConsume(circularQ, &pMsg1, &category, &opcode, &bc);
1182 /* ossaSingleThreadedLeave(agRoot, LL_IOREQ_OBQ_LOCK + queueNum); */
1184 if (AGSA_RC_SUCCESS == ret)
1186 smTrace(hpDBG_IOMB,"M0",queueNum);
1187 /* TP:M0 queueNum */
1188 smTrace(hpDBG_VERY_LOUD,"MA",opcode);
1190 smTrace(hpDBG_IOMB,"MB",category);
1191 /* TP:MB category */
1193 #ifdef SA_ENABLE_TRACE_FUNCTIONS
1194 for (i=0; i<((bit32)bc*(circularQ->elementSize/4)); i++)
1196 /* The -sizeof(mpiMsgHeader_t) is to account for mpiMsgConsume incrementing the pointer past the header*/
1197 smTrace(hpDBG_IOMB,"MC",*( ((bit32*)((bit8 *)pMsg1 - sizeof(mpiMsgHeader_t))) + i));
1198 /* TP:MC Outbound IOMB Dword */
1202 MPI_DEBUG_TRACE( circularQ->qNumber,((circularQ->producerIdx << 16 ) | circularQ->consumerIdx),MPI_DEBUG_TRACE_OBQ, (void *)(((bit8*)pMsg1) - sizeof(mpiMsgHeader_t)), circularQ->elementSize);
1204 ossaLogIomb(circularQ->agRoot,
1207 (void *)(((bit8*)pMsg1) - sizeof(mpiMsgHeader_t)),
1208 bc*circularQ->elementSize);
1210 ossaQueueProcessed(agRoot, queueNum, circularQ->producerIdx, circularQ->consumerIdx);
1211 /* process the outbound message */
1212 ParseOBIombStatus = mpiParseOBIomb(agRoot, (bit32 *)pMsg1, category, opcode);
1213 if (ParseOBIombStatus == AGSA_RC_FAILURE)
1215 SA_DBG1(("siProcessOBMsg, Failed Q %2d PI 0x%03x CI 0x%03x\n", queueNum, circularQ->producerIdx, circularQ->consumerIdx));
1216 #if defined(SALLSDK_DEBUG)
1217 /* free the message for debug: this is a hang! */
1219 mpiMsgFreeSet(circularQ, pMsg1, bc);
1220 processedMsgCount ++;
1225 /* free the message from the outbound circular buffer */
1226 mpiMsgFreeSet(circularQ, pMsg1, bc);
1227 processedMsgCount ++;
1230 //if (AGSA_RC_BUSY == ret) // always (circularQ->producerIdx == circularQ->consumerIdx)
1231 // || (AGSA_RC_FAILURE == ret)
1236 /* end of message processing if hit the count */
1237 while(count > processedMsgCount);
1239 /* #define SALLSDK_FATAL_ERROR_DETECT 1 */
1241 this comments are to be removed
1242 fill in 0x1D 0x1e 0x1f 0x20 in MPI table for
1243 bit32 regDumpBusBaseNum0;
1244 bit32 regDumpOffset0;
1246 bit32 regDumpBusBaseNum1;
1247 bit32 regDumpOffset1;
1249 in agsaFatalErrorInfo_t
1251 ??? regDumpBusBaseNum0 and regDumpBusBaseNum1
1252 saRoot->mainConfigTable.regDumpPCIBAR = pcibar;
1253 saRoot->mainConfigTable.FatalErrorDumpOffset0 = config->FatalErrorDumpOffset0;
1254 saRoot->mainConfigTable.FatalErrorDumpLength0 = config->FatalErrorDumpLength0;
1255 saRoot->mainConfigTable.FatalErrorDumpOffset1 = config->FatalErrorDumpOffset1;
1256 saRoot->mainConfigTable.FatalErrorDumpLength1 = config->FatalErrorDumpLength1;
1261 #if defined(SALLSDK_FATAL_ERROR_DETECT)
1263 if( smIS_SPC(agRoot) ) /* SPC only */
1266 /* any fatal error happened */
1267 /* executing this code impacts performance by 1% when no error is detected */
1269 agsaFatalErrorInfo_t fatal_error;
1273 value = siHalRegReadExt(agRoot, GEN_MSGU_SCRATCH_PAD_1, MSGU_SCRATCH_PAD_1);
1274 value1 = siHalRegReadExt(agRoot, GEN_MSGU_SCRATCH_PAD_2, MSGU_SCRATCH_PAD_2);
1276 if( (value & SA_FATAL_ERROR_SP1_AAP1_ERR_MASK) == SA_FATAL_ERROR_FATAL_ERROR ||
1277 (value1 & SA_FATAL_ERROR_SP2_IOP_ERR_MASK) == SA_FATAL_ERROR_FATAL_ERROR )
1279 si_memset(&fatal_error, 0, sizeof(agsaFatalErrorInfo_t));
1280 /* read detail fatal errors */
1281 value = siHalRegReadExt(agRoot, GEN_MSGU_SCRATCH_PAD_0, MSGU_SCRATCH_PAD_0);
1282 fatal_error.errorInfo0 = value;
1283 SA_DBG1(("siProcessOBMsg: ScratchPad0 AAP error code 0x%x\n", value));
1285 value = siHalRegReadExt(agRoot, GEN_MSGU_SCRATCH_PAD_1, MSGU_SCRATCH_PAD_1);
1286 fatal_error.errorInfo1 = value;
1287 /* AAP error state */
1288 SA_DBG1(("siProcessOBMsg: AAP error state and error code 0x%x\n", value));
1289 value = siHalRegReadExt(agRoot, GEN_MSGU_SCRATCH_PAD_2, MSGU_SCRATCH_PAD_2);
1290 fatal_error.errorInfo2 = value;
1291 /* IOP error state */
1292 SA_DBG1(("siProcessOBMsg: IOP error state and error code 0x%x\n", value));
1293 value = siHalRegReadExt(agRoot, GEN_MSGU_SCRATCH_PAD_3, MSGU_SCRATCH_PAD_3);
1294 SA_DBG1(("siProcessOBMsg: ScratchPad3 IOP error code 0x%x\n", value));
1295 fatal_error.errorInfo3 = value;
1297 if (agNULL != saRoot)
1299 fatal_error.regDumpBusBaseNum0 = saRoot->mainConfigTable.regDumpPCIBAR;
1300 fatal_error.regDumpOffset0 = saRoot->mainConfigTable.FatalErrorDumpOffset0;
1301 fatal_error.regDumpLen0 = saRoot->mainConfigTable.FatalErrorDumpLength0;
1302 fatal_error.regDumpBusBaseNum1 = saRoot->mainConfigTable.regDumpPCIBAR;
1303 fatal_error.regDumpOffset1 = saRoot->mainConfigTable.FatalErrorDumpOffset1;
1304 fatal_error.regDumpLen1 = saRoot->mainConfigTable.FatalErrorDumpLength1;
1308 fatal_error.regDumpBusBaseNum0 = 0;
1309 fatal_error.regDumpOffset0 = 0;
1310 fatal_error.regDumpLen0 = 0;
1311 fatal_error.regDumpBusBaseNum1 = 0;
1312 fatal_error.regDumpOffset1 = 0;
1313 fatal_error.regDumpLen1 = 0;
1315 /* Call Back with error */
1316 SA_DBG1(("siProcessOBMsg: SALLSDK_FATAL_ERROR_DETECT \n"));
1317 ossaHwCB(agRoot, agNULL, OSSA_HW_EVENT_MALFUNCTION, 0, (void *)&fatal_error, agNULL);
1321 #endif /* SALLSDK_FATAL_ERROR_DETECT */
1322 smTraceFuncExit(hpDBG_VERY_LOUD, 'b', "5r");
1323 return processedMsgCount;
1326 /******************************************************************************/
1327 /*! \brief Function to enable/disable interrupts
1329 * The saSystemInterruptsActive() function is called to indicate to the LL Layer
1330 * whether interrupts are available. The parameter sysIntsActive indicates whether
1331 * interrupts are available at this time.
1333 * \param agRoot handles for this instance of SAS/SATA hardware
1334 * \param sysIntsActive flag for enable/disable interrupt
1339 /*******************************************************************************/
1340 GLOBAL void saSystemInterruptsActive(
1342 agBOOLEAN sysIntsActive
1346 agsaLLRoot_t *saRoot;
1348 SA_ASSERT((agNULL != agRoot), "");
1349 if (agRoot == agNULL)
1351 SA_DBG1(("saSystemInterruptsActive: agRoot == agNULL\n"));
1354 saRoot = (agsaLLRoot_t *)(agRoot->sdkData);
1355 SA_ASSERT((agNULL != saRoot), "");
1356 if (saRoot == agNULL)
1358 SA_DBG1(("saSystemInterruptsActive: saRoot == agNULL\n"));
1362 smTraceFuncEnter(hpDBG_TICK_INT,"5s");
1363 SA_DBG1(("saSystemInterruptsActive: now 0x%X new 0x%x\n",saRoot->sysIntsActive,sysIntsActive));
1364 SA_DBG3(("saSystemInterruptsActive: Doorbell_Set %08X U %08X\n",
1365 ossaHwRegReadExt(agRoot, PCIBAR0, V_Outbound_Doorbell_Set_Register),
1366 ossaHwRegReadExt(agRoot, PCIBAR0, V_Outbound_Doorbell_Set_RegisterU)));
1367 SA_DBG3(("saSystemInterruptsActive: Doorbell_Mask %08X U %08X\n",
1368 ossaHwRegReadExt(agRoot, PCIBAR0, V_Outbound_Doorbell_Mask_Set_Register ),
1369 ossaHwRegReadExt(agRoot, PCIBAR0, V_Outbound_Doorbell_Mask_Set_RegisterU )));
1371 if( saRoot->sysIntsActive && sysIntsActive )
1373 SA_DBG1(("saSystemInterruptsActive: Already active 0x%X new 0x%x\n",saRoot->sysIntsActive,sysIntsActive));
1374 smTraceFuncExit(hpDBG_TICK_INT, 'a', "5s");
1378 if( !saRoot->sysIntsActive && !sysIntsActive )
1380 if(smIS_SPC(agRoot))
1382 siHalRegWriteExt(agRoot, GEN_MSGU_ODMR, MSGU_ODMR,AGSA_INTERRUPT_HANDLE_ALL_CHANNELS );
1386 ossaHwRegWriteExt(agRoot, PCIBAR0,V_Outbound_Doorbell_Mask_Set_Register, AGSA_INTERRUPT_HANDLE_ALL_CHANNELS);
1387 ossaHwRegWriteExt(agRoot, PCIBAR0,V_Outbound_Doorbell_Mask_Set_RegisterU, AGSA_INTERRUPT_HANDLE_ALL_CHANNELS);
1389 SA_DBG1(("saSystemInterruptsActive: Already disabled 0x%X new 0x%x\n",saRoot->sysIntsActive,sysIntsActive));
1390 smTraceFuncExit(hpDBG_TICK_INT, 'b', "5s");
1394 /* Set the flag is sdkData */
1395 saRoot->sysIntsActive = (bit8)sysIntsActive;
1398 smTrace(hpDBG_TICK_INT,"Vq",sysIntsActive);
1399 /* TP:Vq sysIntsActive */
1400 /* If sysIntsActive is true */
1401 if ( agTRUE == sysIntsActive )
1404 SA_DBG1(("saSystemInterruptsActive: Doorbell_Set %08X U %08X\n",
1405 ossaHwRegReadExt(agRoot, PCIBAR0, V_Outbound_Doorbell_Set_Register),
1406 ossaHwRegReadExt(agRoot, PCIBAR0, V_Outbound_Doorbell_Set_RegisterU)));
1407 SA_DBG1(("saSystemInterruptsActive: Doorbell_Mask_Set %08X U %08X\n",
1408 ossaHwRegReadExt(agRoot, PCIBAR0, V_Outbound_Doorbell_Mask_Set_Register),
1409 ossaHwRegReadExt(agRoot, PCIBAR0, V_Outbound_Doorbell_Mask_Set_RegisterU)));
1410 if(smIS_SPCV(agRoot))
1412 ossaHwRegWriteExt(agRoot, PCIBAR0,V_Outbound_Doorbell_Clear_Register, 0xFFFFFFFF);
1413 ossaHwRegWriteExt(agRoot, PCIBAR0,V_Outbound_Doorbell_Clear_RegisterU, 0xFFFFFFFF);
1415 /* enable interrupt */
1416 for(x=0; x < saRoot->numInterruptVectors; x++)
1418 ossaReenableInterrupts(agRoot,x );
1421 if(saRoot->swConfig.fatalErrorInterruptEnable)
1423 ossaReenableInterrupts(agRoot,saRoot->swConfig.fatalErrorInterruptVector );
1426 siHalRegWriteExt(agRoot, GEN_MSGU_ODMR, MSGU_ODMR, 0);
1428 /* If sysIntsActive is false */
1431 /* disable interrupt */
1432 if(smIS_SPC(agRoot))
1434 siHalRegWriteExt(agRoot, GEN_MSGU_ODMR, MSGU_ODMR,AGSA_INTERRUPT_HANDLE_ALL_CHANNELS );
1438 ossaHwRegWriteExt(agRoot, PCIBAR0,V_Outbound_Doorbell_Mask_Set_Register, AGSA_INTERRUPT_HANDLE_ALL_CHANNELS);
1439 ossaHwRegWriteExt(agRoot, PCIBAR0,V_Outbound_Doorbell_Mask_Set_RegisterU, AGSA_INTERRUPT_HANDLE_ALL_CHANNELS);
1443 SA_DBG3(("saSystemInterruptsActive: Doorbell_Set %08X U %08X\n",
1444 ossaHwRegReadExt(agRoot, PCIBAR0, V_Outbound_Doorbell_Set_Register),
1445 ossaHwRegReadExt(agRoot, PCIBAR0, V_Outbound_Doorbell_Set_RegisterU)));
1446 SA_DBG3(("saSystemInterruptsActive: Doorbell_Mask %08X U %08X\n",
1447 ossaHwRegReadExt(agRoot, PCIBAR0, V_Outbound_Doorbell_Mask_Set_Register ),
1448 ossaHwRegReadExt(agRoot, PCIBAR0, V_Outbound_Doorbell_Mask_Set_RegisterU )));
1451 smTraceFuncExit(hpDBG_TICK_INT, 'c', "5s");
1454 /******************************************************************************/
1455 /*! \brief Routine to handle for received SAS with data payload event
1457 * The handle for received SAS with data payload event
1459 * \param agRoot handles for this instance of SAS/SATA hardware
1460 * \param pRequest handles for the IOrequest
1461 * \param pRespIU the pointer to the Response IU
1462 * \param param Payload Length
1466 /*******************************************************************************/
1467 GLOBAL void siEventSSPResponseWtDataRcvd(
1469 agsaIORequestDesc_t *pRequest,
1470 agsaSSPResponseInfoUnit_t *pRespIU,
1475 agsaLLRoot_t *saRoot = (agsaLLRoot_t *)(agRoot->sdkData);
1476 agsaDeviceDesc_t *pDevice;
1480 smTraceFuncEnter(hpDBG_VERY_LOUD,"5g");
1482 /* get frame handle */
1484 /* If the request is still valid */
1485 if ( agTRUE == pRequest->valid )
1488 pDevice = pRequest->pDevice;
1490 /* Delete the request from the pendingIORequests */
1491 ossaSingleThreadedEnter(agRoot, LL_IOREQ_LOCKEQ_LOCK);
1492 saLlistIORemove(&(pDevice->pendingIORequests), &(pRequest->linkNode));
1493 ossaSingleThreadedLeave(agRoot, LL_IOREQ_LOCKEQ_LOCK);
1495 if (sspTag & SSP_RESCV_BIT)
1497 /* get the pad count, bit 17 and 18 of sspTag */
1498 padCount = (sspTag >> SSP_RESCV_PAD_SHIFT) & 0x3;
1499 /* get Residual Count */
1500 count = *(bit32 *)((bit8 *)pRespIU + param + padCount);
1503 (*(ossaSSPCompletedCB_t)(pRequest->completionCB))(agRoot,
1504 pRequest->pIORequestContext,
1508 (bit16)(sspTag & SSPTAG_BITS),
1511 ossaSingleThreadedEnter(agRoot, LL_IOREQ_LOCKEQ_LOCK);
1512 pRequest->valid = agFALSE;
1513 /* return the request to free pool */
1514 if(saLlistIOGetCount(&(saRoot->freeReservedRequests)) < SA_RESERVED_REQUEST_COUNT)
1516 SA_DBG1(("siEventSSPResponseWtDataRcvd: saving pRequest (%p) for later use\n", pRequest));
1517 saLlistIOAdd(&(saRoot->freeReservedRequests), &(pRequest->linkNode));
1521 /* return the request to free pool */
1522 saLlistIOAdd(&(saRoot->freeIORequests), &(pRequest->linkNode));
1524 ossaSingleThreadedLeave(agRoot, LL_IOREQ_LOCKEQ_LOCK);
1529 SA_DBG1(("siEventSSPResponseWtDataRcvd: pRequest->Valid not TRUE\n"));
1532 smTraceFuncExit(hpDBG_VERY_LOUD, 'a', "5g");
1537 /******************************************************************************/
1538 /*! \brief Routine to handle successfully completed IO event
1540 * Handle successfully completed IO
1542 * \param agRoot handles for this instance of SAS/SATA hardware
1543 * \param pRequest Pointer of IO request of the IO
1544 * \param status status of the IO
1548 /*******************************************************************************/
1549 GLOBAL FORCEINLINE void siIODone(
1551 agsaIORequestDesc_t *pRequest,
1556 agsaLLRoot_t *saRoot = (agsaLLRoot_t *)(agRoot->sdkData);
1557 agsaDeviceDesc_t *pDevice = agNULL;
1559 smTraceFuncEnter(hpDBG_VERY_LOUD,"5h");
1561 SA_ASSERT(NULL != pRequest, "pRequest cannot be null");
1563 /* If the request is still valid */
1564 if ( agTRUE == pRequest->valid )
1567 pDevice = pRequest->pDevice;
1569 /* process different request type */
1570 switch (pRequest->requestType & AGSA_REQTYPE_MASK)
1572 case AGSA_SSP_REQTYPE:
1574 SA_ASSERT(pRequest->valid, "pRequest not valid");
1575 pRequest->completionCB(agRoot,
1576 pRequest->pIORequestContext,
1580 (bit16)(sspTag & SSPTAG_BITS),
1582 ossaSingleThreadedEnter(agRoot, LL_IOREQ_LOCKEQ_LOCK);
1583 /* Delete the request from the pendingIORequests */
1584 saLlistIORemove(&(pDevice->pendingIORequests), &(pRequest->linkNode));
1585 /* return the request to free pool */
1586 pRequest->valid = agFALSE;
1587 saLlistIOAdd(&(saRoot->freeIORequests), &(pRequest->linkNode));
1588 ossaSingleThreadedLeave(agRoot, LL_IOREQ_LOCKEQ_LOCK);
1593 case AGSA_SATA_REQTYPE:
1595 SA_DBG5(("siIODone: SATA complete\n"));
1597 if ( agNULL != pRequest->pIORequestContext )
1599 SA_DBG5(("siIODone: Complete Request\n"));
1601 (*(ossaSATACompletedCB_t)(pRequest->completionCB))(agRoot,
1602 pRequest->pIORequestContext,
1608 ossaSingleThreadedEnter(agRoot, LL_IOREQ_LOCKEQ_LOCK);
1609 /* Delete the request from the pendingIORequests */
1610 saLlistIORemove(&(pDevice->pendingIORequests), &(pRequest->linkNode));
1611 /* return the request to free pool */
1612 saLlistIOAdd(&(saRoot->freeIORequests), &(pRequest->linkNode));
1613 ossaSingleThreadedLeave(agRoot, LL_IOREQ_LOCKEQ_LOCK);
1615 pRequest->valid = agFALSE;
1619 case AGSA_SMP_REQTYPE:
1621 if ( agNULL != pRequest->pIORequestContext )
1623 (*(ossaSMPCompletedCB_t)(pRequest->completionCB))(agRoot,
1624 pRequest->pIORequestContext,
1630 ossaSingleThreadedEnter(agRoot, LL_IOREQ_LOCKEQ_LOCK);
1631 /* Delete the request from the pendingSMPRequests */
1632 saLlistIORemove(&(pDevice->pendingIORequests), &(pRequest->linkNode));
1633 /* return the request to free pool */
1634 if(saLlistIOGetCount(&(saRoot->freeReservedRequests)) < SA_RESERVED_REQUEST_COUNT)
1636 SA_DBG1(("siIODone: saving pRequest (%p) for later use\n", pRequest));
1637 saLlistIOAdd(&(saRoot->freeReservedRequests), &(pRequest->linkNode));
1641 saLlistIOAdd(&(saRoot->freeIORequests), &(pRequest->linkNode));
1643 ossaSingleThreadedLeave(agRoot, LL_IOREQ_LOCKEQ_LOCK);
1645 pRequest->valid = agFALSE;
1651 SA_DBG1(("siIODone: unknown request type (%x) is completed. HTag=0x%x\n", pRequest->requestType, pRequest->HTag));
1658 SA_DBG1(("siIODone: The request is not valid any more. HTag=0x%x requestType=0x%x\n", pRequest->HTag, pRequest->requestType));
1661 smTraceFuncExit(hpDBG_VERY_LOUD, 'a', "5h");
1665 /******************************************************************************/
1666 /*! \brief Routine to handle abnormal completed IO/SMP event
1668 * Handle abnormal completed IO/SMP
1670 * \param agRoot handles for this instance of SAS/SATA hardware
1671 * \param pRequest Pointer of IO request of the IO
1672 * \param status status of the IO
1673 * \param param Length
1677 /*******************************************************************************/
1678 GLOBAL void siAbnormal(
1680 agsaIORequestDesc_t *pRequest,
1686 agsaLLRoot_t *saRoot = (agsaLLRoot_t *)(agRoot->sdkData);
1687 agsaDeviceDesc_t *pDevice;
1689 smTraceFuncEnter(hpDBG_VERY_LOUD,"5i");
1691 if (agNULL == pRequest)
1693 SA_DBG1(("siAbnormal: pRequest is NULL.\n"));
1694 smTraceFuncExit(hpDBG_VERY_LOUD, 'a', "5i");
1698 /* If the request is still valid */
1699 if ( agTRUE == pRequest->valid )
1703 SA_ASSERT((pRequest->pIORequestContext->osData != pRequest->pIORequestContext->sdkData), "pIORequestContext");
1705 pDevice = pRequest->pDevice;
1707 /* remove the IO request from IOMap */
1708 saRoot->IOMap[pRequest->HTag].Tag = MARK_OFF;
1709 saRoot->IOMap[pRequest->HTag].IORequest = agNULL;
1710 saRoot->IOMap[pRequest->HTag].agContext = agNULL;
1712 smTrace(hpDBG_VERY_LOUD,"P6",status );
1713 /* TP:P6 siAbnormal status */
1714 smTrace(hpDBG_VERY_LOUD,"P7",param );
1715 /* TP:P7 siAbnormal param */
1716 /* process different request type */
1717 switch (pRequest->requestType & AGSA_REQTYPE_MASK)
1719 case AGSA_SSP_REQTYPE:
1721 (*(ossaSSPCompletedCB_t)(pRequest->completionCB))(agRoot,
1722 pRequest->pIORequestContext,
1726 (bit16)(sspTag & SSPTAG_BITS),
1727 ((sspTag & SSP_AGR_S_BIT)? (1 << 0) : 0));
1729 ossaSingleThreadedEnter(agRoot, LL_IOREQ_LOCKEQ_LOCK);
1730 /* Delete the request from the pendingIORequests */
1731 saLlistIORemove(&(pDevice->pendingIORequests), &(pRequest->linkNode));
1732 pRequest->valid = agFALSE;
1733 /* return the request to free pool */
1734 if(saLlistIOGetCount(&(saRoot->freeReservedRequests)) < SA_RESERVED_REQUEST_COUNT)
1736 SA_DBG1(("siAbnormal: saving pRequest (%p) for later use\n", pRequest));
1737 saLlistIOAdd(&(saRoot->freeReservedRequests), &(pRequest->linkNode));
1741 /* return the request to free pool */
1742 saLlistIOAdd(&(saRoot->freeIORequests), &(pRequest->linkNode));
1744 ossaSingleThreadedLeave(agRoot, LL_IOREQ_LOCKEQ_LOCK);
1748 case AGSA_SATA_REQTYPE:
1750 SA_DBG5(("siAbnormal: SATA \n"));
1752 if ( agNULL != pRequest->pIORequestContext )
1754 SA_DBG5(("siAbnormal: Calling SATACompletedCB\n"));
1756 (*(ossaSATACompletedCB_t)(pRequest->completionCB))(agRoot,
1757 pRequest->pIORequestContext,
1764 ossaSingleThreadedEnter(agRoot, LL_IOREQ_LOCKEQ_LOCK);
1765 /* Delete the request from the pendingIORequests */
1766 saLlistIORemove(&(pDevice->pendingIORequests), &(pRequest->linkNode));
1767 /* return the request to free pool */
1768 pRequest->valid = agFALSE;
1769 if(saLlistIOGetCount(&(saRoot->freeReservedRequests)) < SA_RESERVED_REQUEST_COUNT)
1771 SA_DBG1(("siAbnormal: saving pRequest (%p) for later use\n", pRequest));
1772 saLlistIOAdd(&(saRoot->freeReservedRequests), &(pRequest->linkNode));
1776 /* return the request to free pool */
1777 saLlistIOAdd(&(saRoot->freeIORequests), &(pRequest->linkNode));
1779 ossaSingleThreadedLeave(agRoot, LL_IOREQ_LOCKEQ_LOCK);
1783 case AGSA_SMP_REQTYPE:
1785 if ( agNULL != pRequest->pIORequestContext )
1787 (*(ossaSMPCompletedCB_t)(pRequest->completionCB))(agRoot,
1788 pRequest->pIORequestContext,
1794 ossaSingleThreadedEnter(agRoot, LL_IOREQ_LOCKEQ_LOCK);
1795 /* Delete the request from the pendingSMPRequests */
1796 saLlistIORemove(&(pDevice->pendingIORequests), &(pRequest->linkNode));
1797 /* return the request to free pool */
1798 pRequest->valid = agFALSE;
1799 if(saLlistIOGetCount(&(saRoot->freeReservedRequests)) < SA_RESERVED_REQUEST_COUNT)
1801 SA_DBG1(("siAbnormal: saving pRequest (%p) for later use\n", pRequest));
1802 saLlistIOAdd(&(saRoot->freeReservedRequests), &(pRequest->linkNode));
1806 /* return the request to free pool */
1807 saLlistIOAdd(&(saRoot->freeIORequests), &(pRequest->linkNode));
1809 ossaSingleThreadedLeave(agRoot, LL_IOREQ_LOCKEQ_LOCK);
1815 SA_DBG1(("siAbnormal: unknown request type (%x) is completed. Tag=0x%x\n", pRequest->requestType, pRequest->HTag));
1823 SA_DBG1(("siAbnormal: The request is not valid any more. Tag=0x%x\n", pRequest->HTag));
1826 smTraceFuncExit(hpDBG_VERY_LOUD, 'b', "5i");
1832 /******************************************************************************/
1833 /*! \brief Routine to handle abnormal DIF completed IO/SMP event
1835 * Handle abnormal completed IO/SMP
1837 * \param agRoot handles for this instance of SAS/SATA hardware
1838 * \param pRequest Pointer of IO request of the IO
1839 * \param status status of the IO
1840 * \param param Length
1844 /*******************************************************************************/
1845 GLOBAL void siDifAbnormal(
1847 agsaIORequestDesc_t *pRequest,
1854 agsaLLRoot_t *saRoot = (agsaLLRoot_t *)(agRoot->sdkData);
1855 agsaDeviceDesc_t *pDevice;
1857 smTraceFuncEnter(hpDBG_VERY_LOUD,"2S");
1859 if (agNULL == pRequest)
1861 SA_DBG1(("siDifAbnormal: pRequest is NULL.\n"));
1862 smTraceFuncExit(hpDBG_VERY_LOUD, 'a', "2S");
1866 /* If the request is still valid */
1867 if ( agTRUE == pRequest->valid )
1870 pDevice = pRequest->pDevice;
1872 /* remove the IO request from IOMap */
1873 saRoot->IOMap[pRequest->HTag].Tag = MARK_OFF;
1874 saRoot->IOMap[pRequest->HTag].IORequest = agNULL;
1875 saRoot->IOMap[pRequest->HTag].agContext = agNULL;
1877 smTrace(hpDBG_VERY_LOUD,"P6",status );
1878 /* TP:P6 siDifAbnormal status */
1879 /* process different request type */
1880 switch (pRequest->requestType & AGSA_REQTYPE_MASK)
1882 case AGSA_SSP_REQTYPE:
1884 agsaDifDetails_t agDifDetails;
1885 agsaSSPCompletionDifRsp_t *pIomb;
1886 pIomb = (agsaSSPCompletionDifRsp_t *)pMsg1;
1887 si_memset(&agDifDetails, 0, sizeof(agDifDetails));
1889 OSSA_READ_LE_32(agRoot, &agDifDetails.UpperLBA, pIomb, OSSA_OFFSET_OF(agsaSSPCompletionDifRsp_t,UpperLBA ));
1890 OSSA_READ_LE_32(agRoot, &agDifDetails.LowerLBA, pIomb, OSSA_OFFSET_OF(agsaSSPCompletionDifRsp_t,LowerLBA ));
1891 OSSA_READ_LE_32(agRoot, &agDifDetails.sasAddressHi, pIomb, OSSA_OFFSET_OF(agsaSSPCompletionDifRsp_t,sasAddressHi ));
1892 OSSA_READ_LE_32(agRoot, &agDifDetails.sasAddressLo, pIomb, OSSA_OFFSET_OF(agsaSSPCompletionDifRsp_t,sasAddressLo));
1893 OSSA_READ_LE_32(agRoot, &agDifDetails.ExpectedCRCUDT01, pIomb, OSSA_OFFSET_OF(agsaSSPCompletionDifRsp_t,ExpectedCRCUDT01 ));
1894 OSSA_READ_LE_32(agRoot, &agDifDetails.ExpectedUDT2345, pIomb, OSSA_OFFSET_OF(agsaSSPCompletionDifRsp_t,ExpectedUDT2345));
1895 OSSA_READ_LE_32(agRoot, &agDifDetails.ActualCRCUDT01, pIomb, OSSA_OFFSET_OF(agsaSSPCompletionDifRsp_t,ActualCRCUDT01 ));
1896 OSSA_READ_LE_32(agRoot, &agDifDetails.ActualUDT2345, pIomb, OSSA_OFFSET_OF(agsaSSPCompletionDifRsp_t,ActualUDT2345));
1897 OSSA_READ_LE_32(agRoot, &agDifDetails.DIFErrDevID, pIomb, OSSA_OFFSET_OF(agsaSSPCompletionDifRsp_t,DIFErrDevID ));
1898 OSSA_READ_LE_32(agRoot, &agDifDetails.ErrBoffsetEDataLen, pIomb, OSSA_OFFSET_OF(agsaSSPCompletionDifRsp_t,ErrBoffsetEDataLen ));
1899 agDifDetails.frame = (void *)(bit8*)(pIomb+ OSSA_OFFSET_OF(agsaSSPCompletionDifRsp_t, EDATA_FRM));
1901 (*(ossaSSPCompletedCB_t)(pRequest->completionCB))(agRoot,
1902 pRequest->pIORequestContext,
1906 (bit16)(sspTag & SSPTAG_BITS),
1907 ((sspTag & SSP_AGR_S_BIT)? (1 << 0) : 0));
1909 ossaSingleThreadedEnter(agRoot, LL_IOREQ_LOCKEQ_LOCK);
1910 pRequest->valid = agFALSE;
1911 /* Delete the request from the pendingIORequests */
1912 saLlistIORemove(&(pDevice->pendingIORequests), &(pRequest->linkNode));
1914 /* return the request to free pool */
1915 if(saLlistIOGetCount(&(saRoot->freeReservedRequests)) < SA_RESERVED_REQUEST_COUNT)
1917 SA_DBG1(("siDifAbnormal: saving pRequest (%p) for later use\n", pRequest));
1918 saLlistIOAdd(&(saRoot->freeReservedRequests), &(pRequest->linkNode));
1922 /* return the request to free pool */
1923 saLlistIOAdd(&(saRoot->freeIORequests), &(pRequest->linkNode));
1925 ossaSingleThreadedLeave(agRoot, LL_IOREQ_LOCKEQ_LOCK);
1931 SA_DBG1(("siDifAbnormal: unknown request type (%x) is completed. Tag=0x%x\n", pRequest->requestType, pRequest->HTag));
1939 SA_DBG1(("siDifAbnormal: The request is not valid any more. Tag=0x%x\n", pRequest->HTag));
1942 smTraceFuncExit(hpDBG_VERY_LOUD, 'b', "2S");
1948 /******************************************************************************/
1949 /*! \brief Routine to handle for received SMP response event
1951 * The handle for received SMP response event
1953 * \param agRoot handles for this instance of SAS/SATA hardware
1954 * \param pIomb Pointer of payload of IOMB
1955 * \param payloadSize size of the payload
1956 * \param tag the tag of the request SMP
1960 /*******************************************************************************/
1961 GLOBAL void siSMPRespRcvd(
1963 agsaSMPCompletionRsp_t *pIomb,
1968 agsaLLRoot_t *saRoot = (agsaLLRoot_t *)(agRoot->sdkData);
1969 agsaFrameHandle_t frameHandle;
1970 agsaIORequestDesc_t *pRequest;
1971 agsaDeviceDesc_t *pDevice;
1974 smTraceFuncEnter(hpDBG_VERY_LOUD,"5j");
1976 /* get the request */
1977 pRequest = (agsaIORequestDesc_t*)saRoot->IOMap[tag].IORequest;
1978 SA_ASSERT(pRequest, "pRequest");
1981 pPort = pRequest->pPort;
1982 SA_ASSERT(pPort, "pPort");
1984 if (pRequest->IRmode == 0)
1986 /* get frame handle - direct response mode */
1987 frameHandle = (agsaFrameHandle_t)(&(pIomb->SMPrsp[0]));
1988 #if defined(SALLSDK_DEBUG)
1989 SA_DBG3(("saSMPRespRcvd(direct): smpRspPtr=0x%p - len=0x%x\n",
1993 #endif /* SALLSDK_DEBUG */
1997 /* indirect response mode */
1998 frameHandle = agNULL;
2001 /* If the request is still valid */
2002 if ( agTRUE == pRequest->valid )
2005 pDevice = pRequest->pDevice;
2006 SA_ASSERT(pDevice, "pDevice");
2008 /* Delete the request from the pendingSMPRequests */
2009 ossaSingleThreadedEnter(agRoot, LL_IOREQ_LOCKEQ_LOCK);
2010 saLlistIORemove(&(pDevice->pendingIORequests), &(pRequest->linkNode));
2011 ossaSingleThreadedLeave(agRoot, LL_IOREQ_LOCKEQ_LOCK);
2013 /* If the request is from OS layer */
2014 if ( agNULL != pRequest->pIORequestContext )
2016 if (agNULL == frameHandle)
2019 /* call back with success */
2020 (*(ossaSMPCompletedCB_t)(pRequest->completionCB))(agRoot, pRequest->pIORequestContext, OSSA_IO_SUCCESS, payloadSize, frameHandle);
2025 /* call back with success */
2026 (*(ossaSMPCompletedCB_t)(pRequest->completionCB))(agRoot, pRequest->pIORequestContext, OSSA_IO_SUCCESS, payloadSize, frameHandle);
2030 /* remove the IO request from IOMap */
2031 saRoot->IOMap[tag].Tag = MARK_OFF;
2032 saRoot->IOMap[tag].IORequest = agNULL;
2033 saRoot->IOMap[tag].agContext = agNULL;
2034 ossaSingleThreadedEnter(agRoot, LL_IOREQ_LOCKEQ_LOCK);
2035 pRequest->valid = agFALSE;
2036 if(saLlistIOGetCount(&(saRoot->freeReservedRequests)) < SA_RESERVED_REQUEST_COUNT)
2038 SA_DBG1(("siSMPRespRcvd: saving pRequest (%p) for later use\n", pRequest));
2039 saLlistIOAdd(&(saRoot->freeReservedRequests), &(pRequest->linkNode));
2043 /* return the request to free pool */
2044 saLlistIOAdd(&(saRoot->freeIORequests), &(pRequest->linkNode));
2046 ossaSingleThreadedLeave(agRoot, LL_IOREQ_LOCKEQ_LOCK);
2049 smTraceFuncExit(hpDBG_VERY_LOUD, 'a', "5j");
2054 /******************************************************************************/
2055 /*! \brief Routine to handle for received Phy Up event
2057 * The handle for received Phy Up event
2059 * \param agRoot handles for this instance of SAS/SATA hardware
2060 * \param phyId for the Phy Up event happened
2061 * \param agSASIdentify is the remote phy Identify
2062 * \param portId is the port context index of the phy up event
2063 * \param deviceId is the device context index
2064 * \param linkRate link up rate from SPC
2068 /*******************************************************************************/
2069 GLOBAL void siEventPhyUpRcvd(
2072 agsaSASIdentify_t *agSASIdentify,
2078 agsaLLRoot_t *saRoot = (agsaLLRoot_t *)(agRoot->sdkData);
2079 agsaPhy_t *pPhy = &(saRoot->phys[phyId]);
2081 agsaSASIdentify_t remoteIdentify;
2082 agsaPortContext_t *agPortContext;
2084 smTraceFuncEnter(hpDBG_VERY_LOUD,"5k");
2086 /* Read remote SAS Identify from response message and save it */
2087 remoteIdentify = *agSASIdentify;
2089 /* get port context from portMap */
2090 SA_DBG2(("siEventPhyUpRcvd:PortID 0x%x PortStatus 0x%x PortContext %p\n",saRoot->PortMap[portId & PORTID_MASK].PortID,saRoot->PortMap[portId & PORTID_MASK].PortStatus,saRoot->PortMap[portId & PORTID_MASK].PortContext));
2091 agPortContext = (agsaPortContext_t *)saRoot->PortMap[portId].PortContext;
2093 SA_DBG2(("siEventPhyUpRcvd: portID %d PortContext %p linkRate 0x%X\n", portId, agPortContext,linkRate));
2094 if (smIS_SPCV8006(agRoot))
2096 SA_DBG1(("siEventPhyUpRcvd: SAS_PHY_UP received for SATA Controller\n"));
2100 if (agNULL != agPortContext)
2103 pPort = (agsaPort_t *) (agPortContext->sdkData);
2104 pPort->portId = portId;
2106 /* include the phy to the port */
2107 pPort->phyMap[phyId] = agTRUE;
2108 /* Set the port for the phy */
2109 saRoot->phys[phyId].pPort = pPort;
2111 /* Update port state */
2112 if (OSSA_PORT_VALID == (npipps & PORT_STATE_MASK))
2114 pPort->status &= ~PORT_INVALIDATING;
2115 saRoot->PortMap[portId].PortStatus &= ~PORT_INVALIDATING;
2116 SA_DBG1(("siEventPhyUpRcvd: portID %d PortContext %p, hitting workaround\n", portId, agPortContext));
2121 ossaSingleThreadedEnter(agRoot, LL_PORT_LOCK);
2123 /* Allocate a free port */
2124 pPort = (agsaPort_t *) saLlistGetHead(&(saRoot->freePorts));
2125 if (agNULL != pPort)
2127 /* Acquire port list lock */
2128 saLlistRemove(&(saRoot->freePorts), &(pPort->linkNode));
2130 /* setup the port data structure */
2131 pPort->portContext.osData = agNULL;
2132 pPort->portContext.sdkData = pPort;
2134 /* Add to valid port list */
2135 saLlistAdd(&(saRoot->validPorts), &(pPort->linkNode));
2136 /* Release port list lock */
2137 ossaSingleThreadedLeave(agRoot, LL_PORT_LOCK);
2139 /* include the phy to the port */
2140 pPort->phyMap[phyId] = agTRUE;
2141 /* Set the port for the phy */
2142 saRoot->phys[phyId].pPort = pPort;
2144 /* Setup portMap based on portId */
2145 saRoot->PortMap[portId].PortID = portId;
2146 saRoot->PortMap[portId].PortContext = &(pPort->portContext);
2147 pPort->portId = portId;
2149 SA_DBG3(("siEventPhyUpRcvd: NewPort portID %d PortContext %p\n", portId, saRoot->PortMap[portId].PortContext));
2153 ossaSingleThreadedLeave(agRoot, LL_PORT_LOCK);
2154 /* pPort is agNULL*/
2155 smTraceFuncExit(hpDBG_VERY_LOUD, 'a', "5k");
2159 if (OSSA_PORT_VALID == (npipps & PORT_STATE_MASK))
2161 pPort->status &= ~PORT_INVALIDATING;
2162 saRoot->PortMap[portId].PortStatus &= ~PORT_INVALIDATING;
2166 SA_DBG1(("siEventPhyUpRcvd: PortInvalid portID %d PortContext %p\n", portId, saRoot->PortMap[portId].PortContext));
2170 /* adjust the bit fields before callback */
2171 phyId = (linkRate << SHIFT8) | phyId;
2172 /* report PhyId, NPIP, PortState */
2173 phyId |= (npipps & PHY_IN_PORT_MASK) | ((npipps & PORT_STATE_MASK) << SHIFT16);
2174 ossaHwCB(agRoot, &(pPort->portContext), OSSA_HW_EVENT_SAS_PHY_UP, phyId, agNULL, &remoteIdentify);
2176 /* set PHY_UP status */
2177 PHY_STATUS_SET(pPhy, PHY_UP);
2179 smTraceFuncExit(hpDBG_VERY_LOUD, 'b', "5k");
2185 /******************************************************************************/
2186 /*! \brief Routine to handle for received SATA signature event
2188 * The handle for received SATA signature event
2190 * \param agRoot handles for this instance of SAS/SATA hardware
2191 * \param phyId the phy id of the phy received the frame
2192 * \param pMsg the pointer to the message payload
2193 * \param portId the port context index of the phy up event
2194 * \param deviceId the device context index
2195 * \param linkRate link up rate from SPC
2199 /*******************************************************************************/
2200 GLOBAL void siEventSATASignatureRcvd(
2209 agsaLLRoot_t *saRoot = (agsaLLRoot_t *)(agRoot->sdkData);
2210 agsaPhy_t *pPhy = &(saRoot->phys[phyId]);
2211 agsaPort_t *pPort = agNULL;
2212 agsaPortContext_t *agPortContext;
2213 #if defined(SALLSDK_DEBUG)
2214 agsaFisRegDeviceToHost_t *fisD2H;
2215 /* Read the D2H FIS */
2216 fisD2H = (agsaFisRegDeviceToHost_t *)pMsg;
2217 #endif /* SALLSDK_DEBUG */
2219 smTraceFuncEnter(hpDBG_VERY_LOUD,"5m");
2221 SA_DBG5(("siEventSATASignatureRcvd: About to read the signatureFIS data\n"));
2224 SA_DBG5(("agsaFisRegDeviceToHost_t:\n"));
2225 SA_DBG5((" fisType = %x\n", fisD2H->h.fisType));
2226 SA_DBG5((" i_pmPort = %x\n", fisD2H->h.i_pmPort));
2227 SA_DBG5((" status = %x\n", fisD2H->h.status));
2228 SA_DBG5((" error = %x\n", fisD2H->h.error));
2230 SA_DBG5((" lbaLow = %x\n", fisD2H->d.lbaLow));
2231 SA_DBG5((" lbaMid = %x\n", fisD2H->d.lbaMid));
2232 SA_DBG5((" lbaHigh = %x\n", fisD2H->d.lbaHigh));
2233 SA_DBG5((" device = %x\n", fisD2H->d.device));
2235 SA_DBG5((" lbaLowExp = %x\n", fisD2H->d.lbaLowExp));
2236 SA_DBG5((" lbaMidExp = %x\n", fisD2H->d.lbaMidExp));
2237 SA_DBG5((" lbaHighExp = %x\n", fisD2H->d.lbaHighExp));
2238 SA_DBG5((" reserved4 = %x\n", fisD2H->d.reserved4));
2240 SA_DBG5((" sectorCount = %x\n", fisD2H->d.sectorCount));
2241 SA_DBG5((" sectorCountExp = %x\n", fisD2H->d.sectorCountExp));
2242 SA_DBG5((" reserved5 = %x\n", fisD2H->d.reserved5));
2243 SA_DBG5((" reserved6 = %x\n", fisD2H->d.reserved6));
2245 SA_DBG5((" reserved7 (32) = %08X\n", fisD2H->d.reserved7));
2247 SA_DBG5(("siEventSATASignatureRcvd: GOOD signatureFIS data\n"));
2249 #if defined(SALLSDK_DEBUG)
2250 /* read signature */
2251 pPhy->remoteSignature[0] = (bit8) fisD2H->d.sectorCount;
2252 pPhy->remoteSignature[1] = (bit8) fisD2H->d.lbaLow;
2253 pPhy->remoteSignature[2] = (bit8) fisD2H->d.lbaMid;
2254 pPhy->remoteSignature[3] = (bit8) fisD2H->d.lbaHigh;
2255 pPhy->remoteSignature[4] = (bit8) fisD2H->d.device;
2258 /* get port context from portMap */
2259 SA_DBG2(("siEventSATASignatureRcvd:PortID 0x%x PortStatus 0x%x PortContext %p\n",saRoot->PortMap[portId & PORTID_MASK].PortID,saRoot->PortMap[portId & PORTID_MASK].PortStatus,saRoot->PortMap[portId & PORTID_MASK].PortContext));
2260 agPortContext = (agsaPortContext_t *)saRoot->PortMap[portId].PortContext;
2262 SA_DBG2(("siEventSATASignatureRcvd: portID %d PortContext %p\n", portId, agPortContext));
2264 if (agNULL != agPortContext)
2267 pPort = (agsaPort_t *) (agPortContext->sdkData);
2268 pPort->portId = portId;
2270 /* include the phy to the port */
2271 pPort->phyMap[phyId] = agTRUE;
2272 /* Set the port for the phy */
2273 saRoot->phys[phyId].pPort = pPort;
2277 ossaSingleThreadedEnter(agRoot, LL_PORT_LOCK);
2279 /* Allocate a free port */
2280 pPort = (agsaPort_t *) saLlistGetHead(&(saRoot->freePorts));
2281 if (agNULL != pPort)
2283 /* Acquire port list lock */
2284 saLlistRemove(&(saRoot->freePorts), &(pPort->linkNode));
2286 /* setup the port data structure */
2287 pPort->portContext.osData = agNULL;
2288 pPort->portContext.sdkData = pPort;
2290 /* Add to valid port list */
2291 saLlistAdd(&(saRoot->validPorts), &(pPort->linkNode));
2292 /* Release port list lock */
2293 ossaSingleThreadedLeave(agRoot, LL_PORT_LOCK);
2295 /* include the phy to the port */
2296 pPort->phyMap[phyId] = agTRUE;
2297 /* Set the port for the phy */
2298 saRoot->phys[phyId].pPort = pPort;
2300 /* Setup portMap based on portId */
2301 saRoot->PortMap[portId].PortID = portId;
2302 saRoot->PortMap[portId].PortContext = &(pPort->portContext);
2303 pPort->portId = portId;
2304 SA_DBG3(("siEventSATASignatureRcvd: NewPort portID %d portContect %p\n", portId, saRoot->PortMap[portId].PortContext));
2308 ossaSingleThreadedLeave(agRoot, LL_PORT_LOCK);
2309 /* pPort is agNULL*/
2310 smTraceFuncExit(hpDBG_VERY_LOUD, 'a', "5m");
2314 if (OSSA_PORT_VALID == (npipps & PORT_STATE_MASK))
2316 pPort->status &= ~PORT_INVALIDATING;
2317 saRoot->PortMap[portId].PortStatus &= ~PORT_INVALIDATING;
2321 SA_DBG1(("siEventSATASignatureRcvd: PortInvalid portID %d PortContext %p\n", portId, saRoot->PortMap[portId].PortContext));
2325 /* adjust the bit fields before callback */
2326 phyId = (linkRate << SHIFT8) | phyId;
2327 /* report PhyId, NPIP, PortState */
2328 phyId |= (npipps & PHY_IN_PORT_MASK) | ((npipps & PORT_STATE_MASK) << SHIFT16);
2329 ossaHwCB(agRoot, &(pPort->portContext), OSSA_HW_EVENT_SATA_PHY_UP, phyId, agNULL, pMsg);
2331 /* set PHY_UP status */
2332 PHY_STATUS_SET(pPhy, PHY_UP);
2334 smTraceFuncExit(hpDBG_VERY_LOUD, 'b', "5m");
2341 /******************************************************************************/
2342 /*! \brief Process Outbound IOMB Message
2344 * Process Outbound IOMB from SPC
2346 * \param agRoot Handles for this instance of SAS/SATA LL Layer
2347 * \param pMsg1 Pointer of Response IOMB message 1
2348 * \param category category of outbpond IOMB header
2349 * \param opcode Opcode of Outbound IOMB header
2350 * \param bc buffer count of IOMB header
2352 * \return success or fail
2355 /*******************************************************************************/
2356 GLOBAL bit32 mpiParseOBIomb(
2359 mpiMsgCategory_t category,
2363 agsaLLRoot_t *saRoot = (agsaLLRoot_t *)(agRoot->sdkData);
2364 bit32 ret = AGSA_RC_SUCCESS;
2365 bit32 parserStatus = AGSA_RC_SUCCESS;
2367 smTraceFuncEnter(hpDBG_VERY_LOUD, "2f");
2371 case OPC_OUB_COMBINED_SSP_COMP:
2373 agsaSSPCoalescedCompletionRsp_t *pIomb = (agsaSSPCoalescedCompletionRsp_t *)pMsg1;
2374 agsaIORequestDesc_t *pRequest = agNULL;
2379 #ifdef SALL_API_TEST
2380 saRoot->LLCounters.IOCounter.numSSPCompleted++;
2381 SA_DBG3(("mpiParseOBIomb, SSP_COMP Response received IOMB=%p %d\n",
2382 pMsg1, saRoot->LLCounters.IOCounter.numSSPCompleted));
2384 SA_DBG3(("mpiParseOBIomb, OPC_OUB_COMBINED_SSP_COMP Response received IOMB=%p\n", pMsg1));
2387 for (count = 0; count < pIomb->coalescedCount; count++)
2389 tag = pIomb->sspComplCxt[count].tag;
2390 sspTag = pIomb->sspComplCxt[count].SSPTag;
2391 pRequest = (agsaIORequestDesc_t *)saRoot->IOMap[tag].IORequest;
2392 SA_ASSERT((pRequest), "pRequest");
2394 if(pRequest == agNULL)
2396 SA_DBG1(("mpiParseOBIomb,OPC_OUB_COMBINED_SSP_COMP Resp IOMB tag=0x%x, status=0x%x, param=0x%x, SSPTag=0x%x\n", tag, OSSA_IO_SUCCESS, 0, sspTag));
2397 #ifdef SA_ENABLE_PCI_TRIGGER
2398 if( saRoot->swConfig.PCI_trigger & PCI_TRIGGER_COAL_IOMB_ERROR )
2400 siPCITriger(agRoot);
2402 #endif /* SA_ENABLE_PCI_TRIGGER */
2403 return(AGSA_RC_FAILURE);
2405 SA_ASSERT((pRequest->valid), "pRequest->valid");
2407 #ifdef SA_ENABLE_PCI_TRIGGER
2408 if(!pRequest->valid)
2410 if( saRoot->swConfig.PCI_trigger & PCI_TRIGGER_COAL_INVALID )
2412 siPCITriger(agRoot);
2415 #endif /* SA_ENABLE_PCI_TRIGGER */
2418 SA_DBG3(("mpiParseOBIomb, OPC_OUB_COMBINED_SSP_COMP IOMB tag=0x%x, status=0x%x, param=0x%x, SSPTag=0x%x\n", tag, OSSA_IO_SUCCESS, 0, sspTag));
2420 /* Completion of SSP without Response Data */
2421 siIODone( agRoot, pRequest, OSSA_IO_SUCCESS, sspTag);
2426 case OPC_OUB_SSP_COMP:
2428 #ifdef SALL_API_TEST
2429 saRoot->LLCounters.IOCounter.numSSPCompleted++;
2430 SA_DBG3(("mpiParseOBIomb, SSP_COMP Response received IOMB=%p %d\n",
2431 pMsg1, saRoot->LLCounters.IOCounter.numSSPCompleted));
2433 SA_DBG3(("mpiParseOBIomb, SSP_COMP Response received IOMB=%p\n", pMsg1));
2435 /* process the SSP IO Completed response message */
2436 mpiSSPCompletion(agRoot, pMsg1);
2439 case OPC_OUB_COMBINED_SATA_COMP:
2441 agsaSATACoalescedCompletionRsp_t *pIomb;
2442 agsaIORequestDesc_t *pRequest;
2446 #ifdef SALL_API_TEST
2447 saRoot->LLCounters.IOCounter.numSSPCompleted++;
2448 SA_DBG3(("mpiParseOBIomb, OPC_OUB_COMBINED_SATA_COMP Response received IOMB=%p %d\n",
2449 pMsg1, saRoot->LLCounters.IOCounter.numSSPCompleted));
2451 SA_DBG3(("mpiParseOBIomb, OPC_OUB_COMBINED_SATA_COMP Response received IOMB=%p\n", pMsg1));
2454 pIomb = (agsaSATACoalescedCompletionRsp_t *)pMsg1;
2456 for (count = 0; count < pIomb->coalescedCount; count++)
2458 tag = pIomb->stpComplCxt[count].tag;
2459 pRequest = (agsaIORequestDesc_t *)saRoot->IOMap[tag].IORequest;
2460 SA_ASSERT((pRequest), "pRequest");
2462 if(pRequest == agNULL)
2464 SA_DBG1(("mpiParseOBIomb,OPC_OUB_COMBINED_SATA_COMP Resp IOMB tag=0x%x, status=0x%x, param=0x%x\n", tag, OSSA_IO_SUCCESS, 0));
2465 return(AGSA_RC_FAILURE);
2467 SA_ASSERT((pRequest->valid), "pRequest->valid");
2469 SA_DBG3(("mpiParseOBIomb, OPC_OUB_COMBINED_SATA_COMP IOMB tag=0x%x, status=0x%x, param=0x%x\n", tag, OSSA_IO_SUCCESS, 0));
2471 /* Completion of SATA without Response Data */
2472 siIODone( agRoot, pRequest, OSSA_IO_SUCCESS, 0);
2476 case OPC_OUB_SATA_COMP:
2478 #ifdef SALL_API_TEST
2479 saRoot->LLCounters.IOCounter.numSataCompleted++;
2480 SA_DBG3(("mpiParseOBIomb, SATA_COMP Response received IOMB=%p %d\n",
2481 pMsg1, saRoot->LLCounters.IOCounter.numSataCompleted));
2483 SA_DBG3(("mpiParseOBIomb, SATA_COMP Response received IOMB=%p\n", pMsg1));
2485 /* process the response message */
2486 mpiSATACompletion(agRoot, pMsg1);
2489 case OPC_OUB_SSP_ABORT_RSP:
2491 #ifdef SALL_API_TEST
2492 saRoot->LLCounters.IOCounter.numSSPAbortedCB++;
2494 SA_DBG3(("mpiParseOBIomb, SSP_ABORT Response received IOMB=%p\n", pMsg1));
2496 /* process the response message */
2497 parserStatus = mpiSSPAbortRsp(agRoot, (agsaSSPAbortRsp_t *)pMsg1);
2498 if(parserStatus != AGSA_RC_SUCCESS)
2500 SA_DBG3(("mpiParseOBIomb, mpiSSPAbortRsp FAIL IOMB=%p\n", pMsg1));
2505 case OPC_OUB_SATA_ABORT_RSP:
2507 #ifdef SALL_API_TEST
2508 saRoot->LLCounters.IOCounter.numSataAbortedCB++;
2510 SA_DBG3(("mpiParseOBIomb, SATA_ABORT Response received IOMB=%p\n", pMsg1));
2512 /* process the response message */
2513 mpiSATAAbortRsp(agRoot, (agsaSATAAbortRsp_t *)pMsg1);
2516 case OPC_OUB_SATA_EVENT:
2518 SA_DBG3(("mpiParseOBIomb, SATA_EVENT Response received IOMB=%p\n", pMsg1));
2519 /* process the response message */
2520 mpiSATAEvent(agRoot, (agsaSATAEventRsp_t *)pMsg1);
2523 case OPC_OUB_SSP_EVENT:
2525 SA_DBG3(("mpiParseOBIomb, SSP_EVENT Response received IOMB=%p\n", pMsg1));
2526 /* process the response message */
2527 mpiSSPEvent(agRoot, (agsaSSPEventRsp_t *)pMsg1);
2530 case OPC_OUB_SMP_COMP:
2532 #ifdef SALL_API_TEST
2533 saRoot->LLCounters.IOCounter.numSMPCompleted++;
2534 SA_DBG3(("mpiParseOBIomb, SMP_COMP Response received IOMB=%p, %d\n",
2535 pMsg1, saRoot->LLCounters.IOCounter.numSMPCompleted));
2537 SA_DBG3(("mpiParseOBIomb, SMP_COMP Response received IOMB=%p\n", pMsg1));
2539 /* process the response message */
2540 mpiSMPCompletion(agRoot, (agsaSMPCompletionRsp_t *)pMsg1);
2545 #ifdef SALL_API_TEST
2546 saRoot->LLCounters.IOCounter.numEchoCB++;
2547 SA_DBG3(("mpiParseOBIomb, ECHO Response received %d\n", saRoot->LLCounters.IOCounter.numEchoCB));
2549 SA_DBG3(("mpiParseOBIomb, ECHO Response received\n"));
2551 /* process the response message */
2552 mpiEchoRsp(agRoot, (agsaEchoRsp_t *)pMsg1);
2555 case OPC_OUB_GET_NVMD_DATA:
2557 SA_DBG3(("mpiParseOBIomb, OPC_OUB_GET_NVMD_DATA received IOMB=%p\n", pMsg1));
2558 /* process the response message */
2559 mpiGetNVMDataRsp(agRoot, (agsaGetNVMDataRsp_t *)pMsg1);
2562 case OPC_OUB_SPC_HW_EVENT:
2564 SA_ASSERT((smIS_SPC(agRoot)), "smIS_SPC");
2565 SA_DBG3(("mpiParseOBIomb, OPC_OUB_SPC_HW_EVENT Response received IOMB=%p\n", pMsg1));
2566 /* process the response message */
2567 mpiHWevent(agRoot, (agsaHWEvent_SPC_OUB_t *)pMsg1);
2570 case OPC_OUB_HW_EVENT:
2572 SA_DBG3(("mpiParseOBIomb, HW_EVENT Response received IOMB=%p\n", pMsg1));
2573 /* process the response message */
2574 mpiHWevent(agRoot, (agsaHWEvent_SPC_OUB_t *)pMsg1);
2577 case OPC_OUB_PHY_START_RESPONSE:
2579 SA_DBG1(("mpiParseOBIomb, OPC_OUB_PHY_START_RESPONSE Response received IOMB=%p\n", pMsg1));
2580 /* process the response message */
2581 mpiPhyStartEvent( agRoot, (agsaHWEvent_Phy_OUB_t *)pMsg1 );
2585 case OPC_OUB_PHY_STOP_RESPONSE:
2587 SA_DBG1(("mpiParseOBIomb, OPC_OUB_PHY_STOP_RESPONSE Response received IOMB=%p\n", pMsg1));
2588 /* process the response message */
2589 mpiPhyStopEvent( agRoot, (agsaHWEvent_Phy_OUB_t *)pMsg1 );
2593 case OPC_OUB_LOCAL_PHY_CNTRL:
2595 SA_DBG3(("mpiParseOBIomb, PHY CONTROL Response received IOMB=%p\n", pMsg1));
2596 /* process the response message */
2597 mpiPhyCntrlRsp(agRoot, (agsaLocalPhyCntrlRsp_t *)pMsg1);
2600 case OPC_OUB_SPC_DEV_REGIST:
2602 SA_ASSERT((smIS_SPC(agRoot)), "smIS_SPC");
2603 SA_DBG3(("mpiParseOBIomb, OPC_OUB_SPC_DEV_REGIST Response received IOMB=%p\n", pMsg1));
2604 /* process the response message */
2605 mpiDeviceRegRsp(agRoot, (agsaDeviceRegistrationRsp_t *)pMsg1);
2608 case OPC_OUB_DEV_REGIST:
2610 SA_DBG2(("mpiParseOBIomb, DEV_REGISTRATION Response received IOMB=%p\n", pMsg1));
2611 /* process the response message */
2612 mpiDeviceRegRsp(agRoot, (agsaDeviceRegistrationRsp_t *)pMsg1);
2615 case OPC_OUB_DEREG_DEV:
2617 SA_DBG3(("mpiParseOBIomb, DEREGISTRATION DEVICE Response received IOMB=%p\n", pMsg1));
2618 /* process the response message */
2619 mpiDeregDevHandleRsp(agRoot, (agsaDeregDevHandleRsp_t *)pMsg1);
2622 case OPC_OUB_GET_DEV_HANDLE:
2624 SA_DBG3(("mpiParseOBIomb, GET_DEV_HANDLE Response received IOMB=%p\n", pMsg1));
2625 /* process the response message */
2626 mpiGetDevHandleRsp(agRoot, (agsaGetDevHandleRsp_t *)pMsg1);
2629 case OPC_OUB_SPC_DEV_HANDLE_ARRIV:
2631 SA_DBG3(("mpiParseOBIomb, SPC_DEV_HANDLE_ARRIV Response received IOMB=%p\n", pMsg1));
2632 /* process the response message */
2633 mpiDeviceHandleArrived(agRoot, (agsaDeviceHandleArrivedNotify_t *)pMsg1);
2636 case OPC_OUB_DEV_HANDLE_ARRIV:
2638 SA_DBG3(("mpiParseOBIomb, DEV_HANDLE_ARRIV Response received IOMB=%p\n", pMsg1));
2639 /* process the response message */
2640 mpiDeviceHandleArrived(agRoot, (agsaDeviceHandleArrivedNotify_t *)pMsg1);
2643 case OPC_OUB_SSP_RECV_EVENT:
2645 SA_DBG3(("mpiParseOBIomb, SSP_RECV_EVENT Response received IOMB=%p\n", pMsg1));
2646 /* process the response message */
2647 mpiSSPReqReceivedNotify(agRoot, (agsaSSPReqReceivedNotify_t *)pMsg1);
2650 case OPC_OUB_DEV_INFO:
2652 SA_ASSERT((smIS_SPCV(agRoot)), "smIS_SPCV");
2653 SA_DBG3(("mpiParseOBIomb, DEV_INFO Response received IOMB=%p\n", pMsg1));
2654 /* process the response message */
2655 mpiGetDevInfoRsp(agRoot, (agsaGetDevInfoRspV_t *)pMsg1);
2658 case OPC_OUB_GET_PHY_PROFILE_RSP:
2660 SA_ASSERT((smIS_SPCV(agRoot)), "smIS_SPCV");
2661 SA_DBG2(("mpiParseOBIomb, OPC_OUB_GET_PHY_PROFILE_RSP Response received IOMB=%p\n", pMsg1));
2662 /* process the response message */
2663 mpiGetPhyProfileRsp(agRoot, (agsaGetPhyProfileRspV_t *)pMsg1);
2666 case OPC_OUB_SET_PHY_PROFILE_RSP:
2668 SA_ASSERT((smIS_SPCV(agRoot)), "smIS_SPCV");
2669 SA_DBG3(("mpiParseOBIomb, OPC_OUB_SET_PHY_PROFILE_RSP Response received IOMB=%p\n", pMsg1));
2670 /* process the response message */
2671 mpiSetPhyProfileRsp(agRoot, (agsaSetPhyProfileRspV_t *)pMsg1);
2674 case OPC_OUB_SPC_DEV_INFO:
2676 SA_ASSERT((smIS_SPC(agRoot)), "smIS_SPC");
2677 SA_DBG3(("mpiParseOBIomb, DEV_INFO Response received IOMB=%p\n", pMsg1));
2678 /* process the response message */
2679 mpiGetDevInfoRspSpc(agRoot, (agsaGetDevInfoRsp_t *)pMsg1);
2682 case OPC_OUB_FW_FLASH_UPDATE:
2684 SA_DBG3(("mpiParseOBIomb, OPC_OUB_FW_FLASH_UPDATE Response received IOMB=%p\n", pMsg1));
2685 /* process the response message */
2686 mpiFwFlashUpdateRsp(agRoot, (agsaFwFlashUpdateRsp_t *)pMsg1);
2689 case OPC_OUB_FLASH_OP_EXT_RSP:
2691 SA_DBG3(("mpiParseOBIomb, OPC_OUB_FLASH_OP_EXT_RSP Response received IOMB=%p\n", pMsg1));
2692 /* process the response message */
2693 mpiFwExtFlashUpdateRsp(agRoot, (agsaFwFlashOpExtRsp_t *)pMsg1);
2696 #ifdef SPC_ENABLE_PROFILE
2697 case OPC_OUB_FW_PROFILE:
2699 SA_DBG3(("mpiParseOBIomb, OPC_OUB_FW_PROFILE Response received IOMB=%p\n", pMsg1));
2700 /* process the response message */
2701 mpiFwProfileRsp(agRoot, (agsaFwProfileRsp_t *)pMsg1);
2705 case OPC_OUB_SET_NVMD_DATA:
2707 SA_DBG3(("mpiParseOBIomb, OPC_OUB_SET_NVMD_DATA received IOMB=%p\n", pMsg1));
2708 /* process the response message */
2709 mpiSetNVMDataRsp(agRoot, (agsaSetNVMDataRsp_t *)pMsg1);
2712 case OPC_OUB_GPIO_RESPONSE:
2714 SA_DBG3(("mpiParseOBIomb, OPC_OUB_SET_GPIO_RESPONSE Response received IOMB=%p\n", pMsg1));
2715 /* process the response message */
2716 mpiGPIORsp(agRoot, (agsaGPIORsp_t *)pMsg1);
2719 case OPC_OUB_GPIO_EVENT:
2721 SA_DBG3(("mpiParseOBIomb, OPC_OUB_SET_GPIO_RESPONSE Response received IOMB=%p\n", pMsg1));
2722 /* process the response message */
2723 mpiGPIOEventRsp(agRoot, (agsaGPIOEvent_t *)pMsg1);
2726 case OPC_OUB_GENERAL_EVENT:
2728 SA_DBG3(("mpiParseOBIomb, OPC_OUB_SET_GENERAL_EVENT Response received IOMB=%p\n", pMsg1));
2729 /* process the response message */
2730 mpiGeneralEventRsp(agRoot, (agsaGeneralEventRsp_t *)pMsg1);
2733 case OPC_OUB_SAS_DIAG_MODE_START_END:
2735 SA_DBG3(("mpiParseOBIomb, OPC_OUB_SAS_DIAG_MODE_START_END Response received IOMB=%p\n", pMsg1));
2736 /* process the response message */
2737 mpiSASDiagStartEndRsp(agRoot, (agsaSASDiagStartEndRsp_t *)pMsg1);
2740 case OPC_OUB_SAS_DIAG_EXECUTE:
2742 SA_DBG3(("mpiParseOBIomb, OPC_OUB_SAS_DIAG_EXECUTE_RSP Response received IOMB=%p\n", pMsg1));
2743 /* process the response message */
2744 mpiSASDiagExecuteRsp(agRoot, (agsaSASDiagExecuteRsp_t *)pMsg1);
2747 case OPC_OUB_GET_TIME_STAMP:
2749 SA_DBG3(("mpiParseOBIomb, OPC_OUB_GET_TIME_STAMP Response received IOMB=%p\n", pMsg1));
2750 /* process the response message */
2751 mpiGetTimeStampRsp(agRoot, (agsaGetTimeStampRsp_t *)pMsg1);
2755 case OPC_OUB_SPC_SAS_HW_EVENT_ACK:
2757 SA_ASSERT((smIS_SPC(agRoot)), "smIS_SPC");
2758 SA_DBG3(("mpiParseOBIomb,OPC_OUB_SPC_SAS_HW_EVENT_ACK Response received IOMB=%p\n", pMsg1));
2759 /* process the response message */
2760 mpiSASHwEventAckRsp(agRoot, (agsaSASHwEventAckRsp_t *)pMsg1);
2764 case OPC_OUB_SAS_HW_EVENT_ACK:
2766 SA_ASSERT((smIS_SPCV(agRoot)), "smIS_SPCV");
2767 SA_DBG1(("mpiParseOBIomb, OPC_OUB_SAS_HW_EVENT_ACK Response received IOMB=%p\n", pMsg1));
2768 /* process the response message */
2769 mpiSASHwEventAckRsp(agRoot, (agsaSASHwEventAckRsp_t *)pMsg1);
2772 case OPC_OUB_PORT_CONTROL:
2774 SA_DBG1(("mpiParseOBIomb, OPC_OUB_PORT_CONTROL Response received IOMB=%p\n", pMsg1));
2775 /* process the response message */
2776 mpiPortControlRsp(agRoot, (agsaPortControlRsp_t *)pMsg1);
2779 case OPC_OUB_SMP_ABORT_RSP:
2781 #ifdef SALL_API_TEST
2782 saRoot->LLCounters.IOCounter.numSMPAbortedCB++;
2783 SA_DBG3(("mpiParseOBIomb, SMP_ABORT Response received IOMB=%p, %d\n",
2784 pMsg1, saRoot->LLCounters.IOCounter.numSMPAbortedCB));
2786 SA_DBG3(("mpiParseOBIomb, OPC_OUB_SMP_ABORT_RSP Response received IOMB=%p\n", pMsg1));
2788 /* process the response message */
2789 mpiSMPAbortRsp(agRoot, (agsaSMPAbortRsp_t *)pMsg1);
2792 case OPC_OUB_DEVICE_HANDLE_REMOVAL:
2794 SA_DBG3(("mpiParseOBIomb, OPC_OUB_DEVICE_HANDLE_REMOVAL received IOMB=%p\n", pMsg1));
2795 /* process the response message */
2796 mpiDeviceHandleRemoval(agRoot, (agsaDeviceHandleRemoval_t *)pMsg1);
2799 case OPC_OUB_SET_DEVICE_STATE:
2801 SA_DBG3(("mpiParseOBIomb, OPC_OUB_SET_DEVICE_STATE received IOMB=%p\n", pMsg1));
2802 /* process the response message */
2803 mpiSetDeviceStateRsp(agRoot, (agsaSetDeviceStateRsp_t *)pMsg1);
2806 case OPC_OUB_GET_DEVICE_STATE:
2808 SA_DBG3(("mpiParseOBIomb, OPC_OUB_GET_DEVICE_STATE received IOMB=%p\n", pMsg1));
2809 /* process the response message */
2810 mpiGetDeviceStateRsp(agRoot, (agsaGetDeviceStateRsp_t *)pMsg1);
2813 case OPC_OUB_SET_DEV_INFO:
2815 SA_DBG3(("mpiParseOBIomb, OPC_OUB_SET_DEV_INFO received IOMB=%p\n", pMsg1));
2816 /* process the response message */
2817 mpiSetDevInfoRsp(agRoot, (agsaSetDeviceInfoRsp_t *)pMsg1);
2820 case OPC_OUB_SAS_RE_INITIALIZE:
2822 SA_ASSERT((smIS_SPC(agRoot)), "smIS_SPC");
2823 SA_DBG3(("mpiParseOBIomb, OPC_OUB_SAS_RE_INITIALIZE received IOMB=%p\n", pMsg1));
2824 /* process the response message */
2825 mpiSasReInitializeRsp(agRoot, (agsaSasReInitializeRsp_t *)pMsg1);
2829 case OPC_OUB_SGPIO_RESPONSE:
2831 SA_DBG3(("mpiParseOBIomb, OPC_OUB_SGPIO_RESPONSE Response received IOMB=%p\n", pMsg1));
2832 /* process the response message */
2833 mpiSGpioRsp(agRoot, (agsaSGpioRsp_t *)pMsg1);
2837 case OPC_OUB_PCIE_DIAG_EXECUTE:
2839 SA_DBG3(("mpiParseOBIomb, OPC_OUB_PCIE_DIAG_EXECUTE Response received IOMB=%p\n", pMsg1));
2840 /* process the response message */
2841 mpiPCIeDiagExecuteRsp(agRoot, (agsaPCIeDiagExecuteRsp_t *)pMsg1);
2845 case OPC_OUB_GET_VIST_CAP_RSP:
2847 SA_DBG3(("mpiParseOBIomb, OPC_INB_GET_VIST_CAP Response received IOMB=%p\n", pMsg1));
2848 /* process the response message */
2849 mpiGetVHistRsp(agRoot, (agsaGetVHistCapRsp_t *)pMsg1);
2854 if(smIS_SPC6V(agRoot))
2856 SA_DBG3(("mpiParseOBIomb, OPC_OUB_GET_DFE_DATA_RSP Response received IOMB=%p\n", pMsg1));
2857 /* process the response message */
2858 mpiGetDFEDataRsp(agRoot, (agsaGetDDEFDataRsp_t *)pMsg1);
2860 if(smIS_SPC12V(agRoot))
2862 SA_DBG3(("mpiParseOBIomb, OPC_INB_GET_VIST_CAP Response received IOMB=%p\n", pMsg1));
2863 /* process the response message */
2864 mpiGetVHistRsp(agRoot, (agsaGetVHistCapRsp_t *)pMsg1);
2868 SA_DBG1(("mpiParseOBIomb, 2104 Response received IOMB=%p\n", pMsg1));
2869 /* process the response message */
2873 case OPC_OUB_SET_CONTROLLER_CONFIG:
2875 SA_DBG3(("mpiParseOBIomb, OPC_OUB_SET_CONTROLLER_CONFIG Response received IOMB=%p\n", pMsg1));
2876 mpiSetControllerConfigRsp(agRoot, (agsaSetControllerConfigRsp_t *)pMsg1);
2879 case OPC_OUB_GET_CONTROLLER_CONFIG:
2881 SA_DBG3(("mpiParseOBIomb, OPC_OUB_GET_CONTROLLER_CONFIG Response received IOMB=%p\n", pMsg1));
2882 mpiGetControllerConfigRsp(agRoot, (agsaGetControllerConfigRsp_t *)pMsg1);
2885 case OPC_OUB_KEK_MANAGEMENT:
2887 SA_DBG3(("mpiParseOBIomb, OPC_OUB_KEK_MANAGEMENT Response received IOMB=%p\n", pMsg1));
2888 mpiKekManagementRsp(agRoot, (agsaKekManagementRsp_t *)pMsg1);
2891 case OPC_OUB_DEK_MANAGEMENT:
2893 SA_DBG3(("mpiParseOBIomb, OPC_OUB_DEK_MANAGEMENT Response received IOMB=%p\n", pMsg1));
2894 mpiDekManagementRsp(agRoot, (agsaDekManagementRsp_t *)pMsg1);
2897 case OPC_OUB_OPR_MGMT:
2899 SA_DBG1(("mpiParseOBIomb, OPC_OUB_OPR_MGMT Response received IOMB=%p\n", pMsg1));
2900 mpiOperatorManagementRsp(agRoot, (agsaOperatorMangmenRsp_t *)pMsg1);
2903 case OPC_OUB_ENC_TEST_EXECUTE:
2905 SA_DBG1(("mpiParseOBIomb, OPC_OUB_ENC_TEST_EXECUTE Response received IOMB=%p\n", pMsg1));
2906 mpiBistRsp(agRoot, (agsaEncryptBistRsp_t *)pMsg1);
2909 case OPC_OUB_SET_OPERATOR:
2911 SA_DBG1(("mpiParseOBIomb, OPC_OUB_SET_OPERATOR Response received IOMB=%p\n", pMsg1));
2912 mpiSetOperatorRsp(agRoot, (agsaSetOperatorRsp_t *)pMsg1);
2915 case OPC_OUB_GET_OPERATOR:
2917 SA_DBG1(("mpiParseOBIomb, OPC_OUB_GET_OPERATOR Response received IOMB=%p\n", pMsg1));
2918 mpiGetOperatorRsp(agRoot, (agsaGetOperatorRsp_t *)pMsg1);
2921 case OPC_OUB_DIF_ENC_OFFLOAD_RSP:
2923 SA_ASSERT((smIS_SPCV(agRoot)), "smIS_SPCV");
2924 SA_DBG1(("mpiParseOBIomb, OPC_OUB_DIF_ENC_OFFLOAD_RSP Response received IOMB=%p\n", pMsg1));
2925 /* process the response message */
2926 mpiDifEncOffloadRsp(agRoot, (agsaDifEncOffloadRspV_t *)pMsg1);
2931 #ifdef SALL_API_TEST
2932 saRoot->LLCounters.IOCounter.numUNKNWRespIOMB++;
2933 SA_DBG1(("mpiParseOBIomb, UnKnown Response received IOMB=%p, %d\n",
2934 pMsg1, saRoot->LLCounters.IOCounter.numUNKNWRespIOMB));
2936 SA_DBG1(("mpiParseOBIomb, Unknown IOMB Response received opcode 0x%X IOMB=%p\n",opcode, pMsg1));
2942 smTraceFuncExit(hpDBG_VERY_LOUD, 'a', "2f");
2949 /******************************************************************************/
2950 /*! \brief SPC MPI SATA Completion
2952 * This function handles the SATA completion.
2954 * \param agRoot Handles for this instance of SAS/SATA LLL
2955 * \param pIomb1 Pointer of Message1
2956 * \param bc buffer count
2958 * \return The read value
2961 /*******************************************************************************/
2963 bit32 mpiSATACompletion(
2968 bit32 ret = AGSA_RC_SUCCESS;
2969 agsaLLRoot_t *saRoot = (agsaLLRoot_t *)(agRoot->sdkData);
2973 agsaIORequestDesc_t *pRequest;
2974 bit32 *agFirstDword;
2977 smTraceFuncEnter(hpDBG_VERY_LOUD,"2s");
2979 OSSA_READ_LE_32(AGROOT, &tag, pIomb1, OSSA_OFFSET_OF(agsaSATACompletionRsp_t, tag)) ;
2980 OSSA_READ_LE_32(AGROOT, &status, pIomb1, OSSA_OFFSET_OF(agsaSATACompletionRsp_t, status)) ;
2981 OSSA_READ_LE_32(AGROOT, ¶m, pIomb1, OSSA_OFFSET_OF(agsaSATACompletionRsp_t, param)) ;
2983 SA_DBG3(("mpiSATACompletion: start, HTAG=0x%x\n", tag));
2985 /* get IOrequest from IOMap */
2986 pRequest = (agsaIORequestDesc_t*)saRoot->IOMap[tag].IORequest;
2987 SA_ASSERT((pRequest), "pRequest");
2989 if(agNULL == pRequest)
2991 SA_DBG1(("mpiSATACompletion: agNULL == pRequest tag 0x%X status 0x%X\n",tag, status ));
2992 smTraceFuncExit(hpDBG_VERY_LOUD, 'a', "2s");
2993 return AGSA_RC_FAILURE;
2996 SA_ASSERT((pRequest->valid), "pRequest->valid");
2997 if(!pRequest->valid)
2999 SA_DBG1(("mpiSATACompletion: not valid IOMB tag=0x%x status=0x%x param=0x%x Device =0x%x\n", tag, status, param,
3000 pRequest->pDevice ? pRequest->pDevice->DeviceMapIndex : -1));
3005 case OSSA_IO_SUCCESS:
3007 SA_DBG3(("mpiSATACompletion: OSSA_IO_SUCCESS, param=0x%x\n", param));
3010 /* SATA request completion */
3011 siIODone( agRoot, pRequest, OSSA_IO_SUCCESS, 0);
3015 /* param number bytes of SATA Rsp */
3016 agFirstDword = &pIomb1[3];
3019 /* CB function to the up layer */
3020 /* Response Length not include firstDW */
3021 saRoot->IoErrorCount.agOSSA_IO_COMPLETED_ERROR_SCSI_STATUS++;
3022 SA_DBG2(("mpiSATACompletion: param 0x%x agFirstDwordResp 0x%x Resp 0x%x tag 0x%x\n",param,*agFirstDword,*pResp ,tag));
3023 siEventSATAResponseWtDataRcvd(agRoot, pRequest, agFirstDword, pResp, (param - 4));
3028 case OSSA_IO_ABORTED:
3030 SA_DBG2(("mpiSATACompletion: OSSA_IO_ABORTED tag 0x%X\n", tag));
3031 saRoot->IoErrorCount.agOSSA_IO_ABORTED++;
3032 siAbnormal(agRoot, pRequest, status, param, 0);
3035 case OSSA_IO_UNDERFLOW:
3037 /* SATA Completion with error */
3038 SA_DBG1(("mpiSATACompletion, OSSA_IO_UNDERFLOW tag 0x%X\n", tag));
3039 /*underflow means underrun, treat it as success*/
3040 saRoot->IoErrorCount.agOSSA_IO_UNDERFLOW++;
3041 siAbnormal(agRoot, pRequest, status, param, 0);
3044 case OSSA_IO_NO_DEVICE:
3046 SA_DBG1(("mpiSATACompletion, OSSA_IO_NO_DEVICE tag 0x%X\n", tag));
3047 saRoot->IoErrorCount.agOSSA_IO_NO_DEVICE++;
3048 siAbnormal(agRoot, pRequest, status, 0, 0);
3051 case OSSA_IO_XFER_ERROR_BREAK:
3053 SA_DBG1(("mpiSATACompletion, OSSA_IO_XFER_ERROR_BREAK SPC tag 0x%X\n", tag));
3054 saRoot->IoErrorCount.agOSSA_IO_XFER_ERROR_BREAK++;
3055 siAbnormal(agRoot, pRequest, status, 0, 0);
3058 case OSSA_IO_XFER_ERROR_PHY_NOT_READY:
3060 SA_DBG1(("mpiSATACompletion, OSSA_IO_XFER_ERROR_PHY_NOT_READY tag 0x%X\n", tag));
3061 saRoot->IoErrorCount.agOSSA_IO_XFER_ERROR_PHY_NOT_READY++;
3062 siAbnormal(agRoot, pRequest, status, 0, 0);
3065 case OSSA_IO_OPEN_CNX_ERROR_PROTOCOL_NOT_SUPPORTED:
3067 SA_DBG1(("mpiSATACompletion, OSSA_IO_OPEN_CNX_ERROR_PROTOCOL_NOT_SUPPORTED tag 0x%X\n", tag));
3068 saRoot->IoErrorCount.agOSSA_IO_OPEN_CNX_ERROR_PROTOCOL_NOT_SUPPORTED++;
3069 siAbnormal(agRoot, pRequest, status, 0, 0);
3072 case OSSA_IO_OPEN_CNX_ERROR_ZONE_VIOLATION:
3074 SA_DBG1(("mpiSATACompletion, OSSA_IO_OPEN_CNX_ERROR_ZONE_VIOLATION tag 0x%X\n", tag));
3075 saRoot->IoErrorCount.agOSSA_IO_OPEN_CNX_ERROR_ZONE_VIOLATION++;
3076 siAbnormal(agRoot, pRequest, status, 0, 0);
3079 case OSSA_IO_OPEN_CNX_ERROR_BREAK:
3081 SA_DBG1(("mpiSATACompletion, OSSA_IO_OPEN_CNX_ERROR_BREAK SPC tag 0x%X\n", tag));
3082 saRoot->IoErrorCount.agOSSA_IO_OPEN_CNX_ERROR_BREAK++;
3083 siAbnormal(agRoot, pRequest, status, 0, 0);
3086 case OSSA_IO_OPEN_CNX_ERROR_IT_NEXUS_LOSS:
3088 SA_DBG1(("mpiSATACompletion, OSSA_IO_OPEN_CNX_ERROR_IT_NEXUS_LOSS tag 0x%X\n", tag));
3089 saRoot->IoErrorCount.agOSSA_IO_OPEN_CNX_ERROR_IT_NEXUS_LOSS++;
3090 siAbnormal(agRoot, pRequest, status, 0, 0);
3093 case OSSA_IO_OPEN_CNX_ERROR_BAD_DESTINATION:
3095 SA_DBG1(("mpiSATACompletion, OSSA_IO_OPEN_CNX_ERROR_BAD_DESTINATION tag 0x%X\n", tag));
3096 saRoot->IoErrorCount.agOSSA_IO_OPEN_CNX_ERROR_BAD_DESTINATION++;
3097 siAbnormal(agRoot, pRequest, status, 0, 0);
3100 case OSSA_IO_OPEN_CNX_ERROR_CONNECTION_RATE_NOT_SUPPORTED:
3102 SA_DBG1(("mpiSATACompletion, OSSA_IO_OPEN_CNX_ERROR_CONNECTION_RATE_NOT_SUPPORTED tag 0x%X\n", tag));
3103 saRoot->IoErrorCount.agOSSA_IO_OPEN_CNX_ERROR_CONNECTION_RATE_NOT_SUPPORTED++;
3104 siAbnormal(agRoot, pRequest, status, 0, 0);
3107 case OSSA_IO_OPEN_CNX_ERROR_STP_RESOURCES_BUSY:
3109 SA_DBG1(("mpiSATACompletion, OSSA_IO_OPEN_CNX_ERROR_STP_RESOURCES_BUSY tag 0x%X\n", tag));
3110 saRoot->IoErrorCount.agOSSA_IO_OPEN_CNX_ERROR_STP_RESOURCES_BUSY++;
3111 siAbnormal(agRoot, pRequest, status, 0, 0);
3114 case OSSA_IO_OPEN_CNX_ERROR_WRONG_DESTINATION:
3116 SA_DBG1(("mpiSATACompletion, OSSA_IO_OPEN_CNX_ERROR_WRONG_DESTINATION tag 0x%X\n", tag));
3117 saRoot->IoErrorCount.agOSSA_IO_OPEN_CNX_ERROR_WRONG_DESTINATION++;
3118 siAbnormal(agRoot, pRequest, status, 0, 0);
3121 case OSSA_IO_XFER_ERROR_NAK_RECEIVED:
3123 SA_DBG1(("mpiSATACompletion, OSSA_IO_XFER_ERROR_NAK_RECEIVED tag 0x%X\n", tag));
3124 saRoot->IoErrorCount.agOSSA_IO_XFER_ERROR_NAK_RECEIVED++;
3125 siAbnormal(agRoot, pRequest, status, 0, 0);
3128 case OSSA_IO_XFER_ERROR_DMA:
3130 SA_DBG1(("mpiSATACompletion, OSSA_IO_XFER_ERROR_DMA tag 0x%X\n", tag));
3131 saRoot->IoErrorCount.agOSSA_IO_XFER_ERROR_DMA++;
3132 siAbnormal(agRoot, pRequest, status, 0, 0);
3135 case OSSA_IO_XFER_ERROR_SATA_LINK_TIMEOUT:
3137 SA_DBG1(("mpiSATACompletion, OSSA_IO_XFER_ERROR_SATA_LINK_TIMEOUT tag 0x%X\n", tag));
3138 saRoot->IoErrorCount.agOSSA_IO_XFER_ERROR_SATA_LINK_TIMEOUT++;
3139 siAbnormal(agRoot, pRequest, status, 0, 0);
3142 case OSSA_IO_XFER_ERROR_REJECTED_NCQ_MODE:
3144 SA_DBG1(("mpiSATACompletion, OSSA_IO_XFER_ERROR_REJECTED_NCQ_MODE tag 0x%X\n", tag));
3145 saRoot->IoErrorCount.agOSSA_IO_XFER_ERROR_REJECTED_NCQ_MODE++;
3146 siAbnormal(agRoot, pRequest, status, 0, 0);
3149 case OSSA_IO_XFER_OPEN_RETRY_TIMEOUT:
3151 SA_DBG1(("mpiSATACompletion, OSSA_IO_XFER_OPEN_RETRY_TIMEOUT tag 0x%X\n", tag));
3152 saRoot->IoErrorCount.agOSSA_IO_XFER_OPEN_RETRY_TIMEOUT++;
3153 siAbnormal(agRoot, pRequest, status, 0, 0);
3156 case OSSA_IO_PORT_IN_RESET:
3158 SA_DBG1(("mpiSATACompletion: OSSA_IO_PORT_IN_RESET tag 0x%X\n", tag));
3159 saRoot->IoErrorCount.agOSSA_IO_PORT_IN_RESET++;
3160 siAbnormal(agRoot, pRequest, status, 0, 0);
3163 case OSSA_IO_DS_NON_OPERATIONAL:
3165 SA_DBG1(("mpiSATACompletion: OSSA_IO_DS_NON_OPERATIONAL tag 0x%X\n", tag));
3166 saRoot->IoErrorCount.agOSSA_IO_DS_NON_OPERATIONAL++;
3167 siAbnormal(agRoot, pRequest, status, 0, 0);
3170 case OSSA_IO_DS_IN_RECOVERY:
3172 SA_DBG1(("mpiSATACompletion: OSSA_IO_DS_IN_RECOVERY tag 0x%X\n", tag));
3173 saRoot->IoErrorCount.agOSSA_IO_DS_IN_RECOVERY++;
3174 siAbnormal(agRoot, pRequest, status, 0, 0);
3177 case OSSA_IO_DS_IN_ERROR:
3179 SA_DBG1(("mpiSATACompletion: OSSA_IO_DS_IN_ERROR tag 0x%X\n", tag));
3180 saRoot->IoErrorCount.agOSSA_IO_DS_IN_ERROR++;
3181 siAbnormal(agRoot, pRequest, status, 0, 0);
3185 case OSSA_IO_OPEN_CNX_ERROR_HW_RESOURCE_BUSY:
3187 SA_DBG1(("mpiSATACompletion: OSSA_IO_OPEN_CNX_ERROR_HW_RESOURCE_BUSY tag 0x%X\n", tag));
3188 saRoot->IoErrorCount.agOSSA_IO_OPEN_CNX_ERROR_HW_RESOURCE_BUSY++;
3189 siAbnormal(agRoot, pRequest, status, 0, 0);
3192 case OSSA_IO_ABORT_IN_PROGRESS:
3194 SA_DBG1(("mpiSATACompletion: OSSA_IO_ABORT_IN_PROGRESS tag 0x%X\n", tag));
3195 saRoot->IoErrorCount.agOSSA_IO_ABORT_IN_PROGRESS++;
3196 siAbnormal(agRoot, pRequest, status, 0, 0);
3199 case OSSA_IO_ABORT_DELAYED:
3201 SA_DBG1(("mpiSATACompletion: OSSA_IO_ABORT_DELAYED tag 0x%X\n", tag));
3202 saRoot->IoErrorCount.agOSSA_IO_ABORT_DELAYED++;
3203 siAbnormal(agRoot, pRequest, status, 0, 0);
3206 case OSSA_IO_OPEN_CNX_ERROR_HW_RESOURCE_BUSY_ALT:
3208 SA_DBG1(("mpiSATACompletion: OSSA_IO_OPEN_CNX_ERROR_HW_RESOURCE_BUSY_ALT tag 0x%X\n", tag));
3209 saRoot->IoErrorCount.agOSSA_IO_OPEN_CNX_ERROR_HW_RESOURCE_BUSY_ALT++;
3210 siAbnormal(agRoot, pRequest, status, 0, 0);
3213 case OSSA_IO_OPEN_CNX_ERROR_IT_NEXUS_LOSS_OPEN_RETRY_BACKOFF_THRESHOLD_REACHED:
3215 SA_DBG1(("mpiSATACompletion: OSSA_IO_OPEN_CNX_ERROR_IT_NEXUS_LOSS_OPEN_RETRY_BACKOFF_THRESHOLD_REACHED HTAG = 0x%x\n", tag));
3216 saRoot->IoErrorCount.agOSSA_IO_OPEN_CNX_ERROR_IT_NEXUS_LOSS_OPEN_RETRY_BACKOFF_THRESHOLD_REACHED++;
3217 siAbnormal(agRoot, pRequest, status, 0, 0);
3220 case OSSA_IO_OPEN_CNX_ERROR_IT_NEXUS_LOSS_OPEN_TMO:
3222 SA_DBG1(("mpiSATACompletion, OSSA_IO_OPEN_CNX_ERROR_IT_NEXUS_LOSS_OPEN_TMO tag 0x%x\n", tag));
3223 saRoot->IoErrorCount.agOSSA_IO_OPEN_CNX_ERROR_IT_NEXUS_LOSS_OPEN_TMO++;
3224 siAbnormal(agRoot, pRequest, status, 0, 0 );
3227 case OSSA_IO_OPEN_CNX_ERROR_IT_NEXUS_LOSS_NO_DEST:
3229 SA_DBG1(("mpiSATACompletion, OSSA_IO_OPEN_CNX_ERROR_IT_NEXUS_LOSS_NO_DEST tag 0x%x\n", tag));
3230 saRoot->IoErrorCount.agOSSA_IO_OPEN_CNX_ERROR_IT_NEXUS_LOSS_NO_DEST++;
3231 siAbnormal(agRoot, pRequest, status, 0, 0 );
3234 case OSSA_IO_OPEN_CNX_ERROR_IT_NEXUS_LOSS_OPEN_COLLIDE:
3236 SA_DBG1(("mpiSATACompletion, OSSA_IO_OPEN_CNX_ERROR_IT_NEXUS_LOSS_OPEN_COLLIDE tag 0x%x\n", tag));
3237 saRoot->IoErrorCount.agOSSA_IO_OPEN_CNX_ERROR_IT_NEXUS_LOSS_OPEN_COLLIDE++;
3238 siAbnormal(agRoot, pRequest, status, 0, 0 );
3241 case OSSA_IO_OPEN_CNX_ERROR_IT_NEXUS_LOSS_PATHWAY_BLOCKED:
3243 SA_DBG1(("mpiSATACompletion, OSSA_IO_OPEN_CNX_ERROR_IT_NEXUS_LOSS_PATHWAY_BLOCKED tag 0x%x\n", tag));
3244 saRoot->IoErrorCount.agOSSA_IO_OPEN_CNX_ERROR_IT_NEXUS_LOSS_PATHWAY_BLOCKED++;
3245 siAbnormal(agRoot, pRequest, status, 0, 0 );
3248 case OSSA_IO_DS_INVALID:
3250 SA_DBG1(("mpiSATACompletion: OSSA_IO_DS_INVALID tag 0x%X\n", tag));
3251 saRoot->IoErrorCount.agOSSA_IO_DS_INVALID++;
3252 siAbnormal(agRoot, pRequest, status, 0, 0);
3255 case OSSA_IO_XFER_ERR_LAST_PIO_DATAIN_CRC_ERR:
3257 SA_DBG1(("mpiSATACompletion: OSSA_IO_XFER_ERR_LAST_PIO_DATAIN_CRC_ERR tag 0x%X\n", tag));
3258 saRoot->IoErrorCount.agOSSA_IO_XFER_ERR_LAST_PIO_DATAIN_CRC_ERR++;
3259 siAbnormal(agRoot, pRequest, status, 0, 0);
3262 case OSSA_MPI_IO_RQE_BUSY_FULL:
3264 SA_DBG1(("mpiSATACompletion: OSSA_MPI_IO_RQE_BUSY_FULL tag 0x%X\n", tag));
3265 saRoot->IoErrorCount.agOSSA_MPI_IO_RQE_BUSY_FULL++;
3266 siAbnormal(agRoot, pRequest, status, 0, 0);
3270 case OSSA_IO_XFER_ERR_EOB_DATA_OVERRUN:
3272 SA_DBG1(("mpiSATACompletion: OSSA_IO_XFER_ERR_EOB_DATA_OVERRUN tag 0x%x\n", tag));
3273 saRoot->IoErrorCount.agOSSA_IO_XFER_ERR_EOB_DATA_OVERRUN++;
3274 siAbnormal(agRoot, pRequest, status, 0, 0);
3278 case OSSA_MPI_ERR_IO_RESOURCE_UNAVAILABLE:
3280 SA_DBG1(("mpiSATACompletion: OPC_OUB_SATA_COMP:OSSA_MPI_ERR_IO_RESOURCE_UNAVAILABLE \n"));
3281 saRoot->IoErrorCount.agOSSA_MPI_ERR_IO_RESOURCE_UNAVAILABLE++;
3282 siAbnormal(agRoot, pRequest, status, 0, 0);
3285 case OSSA_MPI_ERR_ATAPI_DEVICE_BUSY:
3287 SA_DBG1(("mpiSATACompletion: OSSA_MPI_ERR_ATAPI_DEVICE_BUSY tag 0x%X\n", tag));
3288 saRoot->IoErrorCount.agOSSA_MPI_ERR_ATAPI_DEVICE_BUSY++;
3289 siAbnormal(agRoot, pRequest, status, param, 0 );
3292 case OSSA_IO_XFR_ERROR_DEK_KEY_CACHE_MISS:
3294 SA_DBG1(("mpiSATACompletion: OSSA_IO_XFR_ERROR_DEK_KEY_CACHE_MISS tag 0x%X\n", tag));
3295 saRoot->IoErrorCount.agOSSA_IO_XFR_ERROR_DEK_KEY_CACHE_MISS++;
3296 siAbnormal(agRoot, pRequest, status, 0, 0);
3299 case OSSA_IO_XFR_ERROR_CIPHER_MODE_INVALID:
3301 SA_DBG1(("mpiSATACompletion: OSSA_IO_XFR_ERROR_CIPHER_MODE_INVALID tag 0x%X\n", tag));
3302 saRoot->IoErrorCount.agOSSA_IO_XFR_ERROR_DEK_KEY_CACHE_MISS++;
3303 siAbnormal(agRoot, pRequest, status, 0, 0);
3306 case OSSA_IO_XFR_ERROR_DEK_IV_MISMATCH:
3308 SA_DBG1(("mpiSATACompletion: OSSA_IO_XFR_ERROR_DEK_IV_MISMATCH tag 0x%X\n", tag));
3309 saRoot->IoErrorCount.agOSSA_IO_XFR_ERROR_DEK_IV_MISMATCH++;
3310 siAbnormal(agRoot, pRequest, status, 0, 0);
3313 case OSSA_IO_XFR_ERROR_DEK_RAM_INTERFACE_ERROR:
3315 SA_DBG1(("mpiSATACompletion: OSSA_IO_XFR_ERROR_DEK_RAM_INTERFACE_ERROR tag 0x%X\n", tag));
3316 saRoot->IoErrorCount.agOSSA_IO_XFR_ERROR_DEK_RAM_INTERFACE_ERROR++;
3317 siAbnormal(agRoot, pRequest, status, 0, 0);
3320 case OSSA_IO_OPEN_CNX_ERROR_OPEN_PREEMPTED:
3322 SA_DBG1(("mpiSATACompletion: OSSA_IO_OPEN_CNX_ERROR_OPEN_PREEMPTED tag 0x%X\n", tag));
3323 saRoot->IoErrorCount.agOSSA_IO_OPEN_CNX_ERROR_OPEN_PREEMPTED++;
3324 siAbnormal(agRoot, pRequest, status, 0, 0);
3328 case OSSA_IO_XFR_ERROR_DEK_KEY_TAG_MISMATCH:
3330 SA_DBG1(("mpiSATACompletion: OSSA_IO_XFR_ERROR_DEK_KEY_TAG_MISMATCH tag 0x%X\n", tag));
3331 saRoot->IoErrorCount.agOSSA_IO_XFR_ERROR_DEK_KEY_TAG_MISMATCH++;
3332 siAbnormal(agRoot, pRequest, status, 0, 0);
3335 case OSSA_IO_XFR_ERROR_DEK_INDEX_OUT_OF_BOUNDS:
3337 SA_DBG1(("mpiSATACompletion: OSSA_IO_XFR_ERROR_DEK_INDEX_OUT_OF_BOUNDS tag 0x%X\n", tag));
3338 saRoot->IoErrorCount.agOSSA_IO_XFR_ERROR_DEK_INDEX_OUT_OF_BOUNDS++;
3339 siAbnormal(agRoot, pRequest, status, 0, 0);
3342 case OSSA_IO_XFR_ERROR_DEK_ILLEGAL_TABLE:
3344 SA_DBG1(("mpiSATACompletion: OSSA_IO_XFR_ERROR_DEK_ILLEGAL_TABLE tag 0x%X\n", tag));
3345 saRoot->IoErrorCount.agOSSA_IO_XFR_ERROR_DEK_INDEX_OUT_OF_BOUNDS++;
3346 siAbnormal(agRoot, pRequest, status, 0, 0);
3352 SA_DBG1(("mpiSATACompletion: Unknown status 0x%x tag 0x%x\n", status, tag));
3353 saRoot->IoErrorCount.agOSSA_IO_UNKNOWN_ERROR++;
3354 siAbnormal(agRoot, pRequest, status, param, 0);
3359 /* The HTag should equal to the IOMB tag */
3360 if (pRequest->HTag != tag)
3362 SA_DBG1(("mpiSATACompletion: Error Htag %d not equal IOMBtag %d\n", pRequest->HTag, tag));
3365 smTraceFuncExit(hpDBG_VERY_LOUD, 'b', "2s");
3369 /******************************************************************************/
3370 /*! \brief SPC MPI SSP Completion
3372 * This function handles the SSP completion.
3374 * \param agRoot Handles for this instance of SAS/SATA LLL
3375 * \param pIomb1 Pointer of Message1
3376 * \param bc buffer count
3378 * \return The read value
3381 /*******************************************************************************/
3383 bit32 mpiSSPCompletion(
3388 agsaLLRoot_t *saRoot = (agsaLLRoot_t *)(agRoot->sdkData);
3389 agsaSSPCompletionRsp_t *pIomb = (agsaSSPCompletionRsp_t *)pIomb1;
3390 agsaIORequestDesc_t *pRequest = agNULL;
3391 agsaSSPResponseInfoUnit_t *pRespIU = agNULL;
3394 bit32 status, param = 0;
3395 bit32 ret = AGSA_RC_SUCCESS;
3397 smTraceFuncEnter(hpDBG_VERY_LOUD, "5A");
3400 OSSA_READ_LE_32(agRoot, &tag, pIomb, OSSA_OFFSET_OF(agsaSSPCompletionRsp_t, tag));
3401 OSSA_READ_LE_32(agRoot, &status, pIomb, OSSA_OFFSET_OF(agsaSSPCompletionRsp_t, status));
3402 OSSA_READ_LE_32(agRoot, ¶m, pIomb, OSSA_OFFSET_OF(agsaSSPCompletionRsp_t, param));
3403 OSSA_READ_LE_32(agRoot, &sspTag, pIomb, OSSA_OFFSET_OF(agsaSSPCompletionRsp_t, SSPTag));
3404 /* get SSP_START IOrequest from IOMap */
3405 pRequest = (agsaIORequestDesc_t *)saRoot->IOMap[tag].IORequest;
3406 SA_ASSERT((pRequest), "pRequest");
3408 if(pRequest == agNULL)
3410 SA_DBG1(("mpiSSPCompletion,AGSA_RC_FAILURE SSP Resp IOMB tag=0x%x, status=0x%x, param=0x%x, SSPTag=0x%x\n", tag, status, param, sspTag));
3411 smTraceFuncExit(hpDBG_VERY_LOUD, 'a', "5A");
3412 return(AGSA_RC_FAILURE);
3414 SA_ASSERT((pRequest->valid), "pRequest->valid");
3416 if(!pRequest->valid)
3418 SA_DBG1(("mpiSSPCompletion, SSP Resp IOMB tag=0x%x, status=0x%x, param=0x%x, SSPTag=0x%x Device =0x%x\n", tag, status, param, sspTag,
3419 pRequest->pDevice ? pRequest->pDevice->DeviceMapIndex : -1));
3424 case OSSA_IO_SUCCESS:
3428 /* Completion of SSP without Response Data */
3429 siIODone( agRoot, pRequest, OSSA_IO_SUCCESS, sspTag);
3433 /* Get SSP Response with Response Data */
3434 pRespIU = (agsaSSPResponseInfoUnit_t *)&(pIomb->SSPrsp);
3435 if (pRespIU->status == 0x02 || pRespIU->status == 0x18 ||
3436 pRespIU->status == 0x30 || pRespIU->status == 0x40 )
3438 /* SCSI status is CHECK_CONDITION, RESV_CONFLICT, ACA_ACTIVE, TASK_ABORTED */
3439 saRoot->IoErrorCount.agOSSA_IO_COMPLETED_ERROR_SCSI_STATUS++;
3440 SA_DBG2(("mpiSSPCompletion: pRespIU->status 0x%x tag 0x%x\n", pRespIU->status,tag));
3442 siEventSSPResponseWtDataRcvd(agRoot, pRequest, pRespIU, param, sspTag);
3448 case OSSA_IO_XFR_ERROR_INVALID_SSP_RSP_FRAME:
3450 SA_DBG1(("mpiSSPCompletion: OSSA_IO_XFR_ERROR_INVALID_SSP_RSP_FRAME tag 0x%x sspTag 0x%x status 0x%x param 0x%x\n", tag,sspTag,status,param));
3451 saRoot->IoErrorCount.agOSSA_IO_XFR_ERROR_INVALID_SSP_RSP_FRAME++;
3452 /* Get SSP Response with Response Data */
3453 pRespIU = (agsaSSPResponseInfoUnit_t *)&(pIomb->SSPrsp);
3454 if (pRespIU->status == 0x02 || pRespIU->status == 0x18 ||
3455 pRespIU->status == 0x30 || pRespIU->status == 0x40 )
3457 /* SCSI status is CHECK_CONDITION, RESV_CONFLICT, ACA_ACTIVE, TASK_ABORTED */
3458 saRoot->IoErrorCount.agOSSA_IO_COMPLETED_ERROR_SCSI_STATUS++;
3459 SA_DBG2(("mpiSSPCompletion: pRespIU->status 0x%x tag 0x%x\n", pRespIU->status,tag));
3461 siEventSSPResponseWtDataRcvd(agRoot, pRequest, pRespIU, param, sspTag);
3466 case OSSA_IO_ABORTED:
3468 #ifdef SALL_API_TEST
3469 saRoot->LLCounters.IOCounter.numSSPAborted++;
3470 SA_DBG3(("mpiSSPCompletion, OSSA_IO_ABORTED Response received IOMB=%p %d\n",
3471 pIomb1, saRoot->LLCounters.IOCounter.numSSPAborted));
3473 SA_DBG2(("mpiSSPCompletion, OSSA_IO_ABORTED IOMB tag 0x%x sspTag 0x%x status 0x%x param 0x%x\n", tag,sspTag,status,param));
3474 saRoot->IoErrorCount.agOSSA_IO_ABORTED++;
3476 siAbnormal(agRoot, pRequest, status, param, sspTag);
3479 case OSSA_IO_UNDERFLOW:
3481 /* SSP Completion with error */
3482 SA_DBG2(("mpiSSPCompletion, OSSA_IO_UNDERFLOW tag 0x%x sspTag 0x%x status 0x%x param 0x%x\n", tag,sspTag,status,param));
3483 /*saRoot->IoErrorCount.agOSSA_IO_UNDERFLOW++;*/
3484 siAbnormal(agRoot, pRequest, status, param, sspTag);
3487 case OSSA_IO_NO_DEVICE:
3489 SA_DBG1(("mpiSSPCompletion: OSSA_IO_NO_DEVICE tag 0x%x sspTag 0x%x status 0x%x param 0x%x\n", tag,sspTag,status,param));
3490 saRoot->IoErrorCount.agOSSA_IO_NO_DEVICE++;
3491 siAbnormal(agRoot, pRequest, status, 0, sspTag);
3494 case OSSA_IO_XFER_ERROR_BREAK:
3496 SA_DBG1(("mpiSSPCompletion: OSSA_IO_XFER_ERROR_BREAK tag 0x%x sspTag 0x%x status 0x%x param 0x%x\n", tag,sspTag,status,param));
3497 saRoot->IoErrorCount.agOSSA_IO_XFER_ERROR_BREAK++;
3498 siAbnormal(agRoot, pRequest, status, 0, sspTag);
3501 case OSSA_IO_XFER_ERROR_PHY_NOT_READY:
3503 SA_DBG1(("mpiSSPCompletion: OSSA_IO_XFER_ERROR_PHY_NOT_READY tag 0x%x sspTag 0x%x status 0x%x param 0x%x\n", tag,sspTag,status,param));
3504 saRoot->IoErrorCount.agOSSA_IO_XFER_ERROR_PHY_NOT_READY++;
3505 siAbnormal(agRoot, pRequest, status, 0, sspTag);
3508 case OSSA_IO_OPEN_CNX_ERROR_PROTOCOL_NOT_SUPPORTED:
3510 SA_DBG1(("mpiSSPCompletion: OSSA_IO_OPEN_CNX_ERROR_PROTOCOL_NOT_SUPPORTED tag 0x%x sspTag 0x%x status 0x%x param 0x%x\n", tag,sspTag,status,param));
3511 saRoot->IoErrorCount.agOSSA_IO_OPEN_CNX_ERROR_PROTOCOL_NOT_SUPPORTED++;
3512 siAbnormal(agRoot, pRequest, status, 0, sspTag);
3515 case OSSA_IO_OPEN_CNX_ERROR_ZONE_VIOLATION:
3517 saRoot->IoErrorCount.agOSSA_IO_OPEN_CNX_ERROR_ZONE_VIOLATION++;
3518 siAbnormal(agRoot, pRequest, status, 0, sspTag);
3519 SA_DBG1(("mpiSSPCompletion: OSSA_IO_OPEN_CNX_ERROR_ZONE_VIOLATION tag 0x%x sspTag 0x%x status 0x%x param 0x%x\n", tag,sspTag,status,param));
3522 case OSSA_IO_OPEN_CNX_ERROR_BREAK:
3524 SA_DBG1(("mpiSSPCompletion: OSSA_IO_OPEN_CNX_ERROR_BREAK tag 0x%x sspTag 0x%x status 0x%x param 0x%x\n", tag,sspTag,status,param));
3525 saRoot->IoErrorCount.agOSSA_IO_OPEN_CNX_ERROR_BREAK++;
3526 siAbnormal(agRoot, pRequest, status, 0, sspTag);
3529 case OSSA_IO_OPEN_CNX_ERROR_IT_NEXUS_LOSS:
3531 SA_DBG1(("mpiSSPCompletion: OSSA_IO_OPEN_CNX_ERROR_IT_NEXUS_LOSS tag 0x%x sspTag 0x%x status 0x%x param 0x%x\n", tag,sspTag,status,param));
3532 saRoot->IoErrorCount.agOSSA_IO_OPEN_CNX_ERROR_IT_NEXUS_LOSS++;
3533 siAbnormal(agRoot, pRequest, status, 0, sspTag);
3536 case OSSA_IO_OPEN_CNX_ERROR_BAD_DESTINATION:
3538 SA_DBG1(("mpiSSPCompletion: OSSA_IO_OPEN_CNX_ERROR_BAD_DESTINATION tag 0x%x sspTag 0x%x status 0x%x param 0x%x\n", tag,sspTag,status,param));
3539 saRoot->IoErrorCount.agOSSA_IO_OPEN_CNX_ERROR_BAD_DESTINATION++;
3540 siAbnormal(agRoot, pRequest, status, 0, sspTag);
3543 case OSSA_IO_OPEN_CNX_ERROR_CONNECTION_RATE_NOT_SUPPORTED:
3545 SA_DBG1(("mpiSSPCompletion: OSSA_IO_OPEN_CNX_ERROR_CONNECTION_RATE_NOT_SUPPORTED tag 0x%x sspTag 0x%x status 0x%x param 0x%x\n", tag,sspTag,status,param));
3546 saRoot->IoErrorCount.agOSSA_IO_OPEN_CNX_ERROR_CONNECTION_RATE_NOT_SUPPORTED++;
3547 siAbnormal(agRoot, pRequest, status, 0, sspTag);
3550 case OSSA_IO_OPEN_CNX_ERROR_WRONG_DESTINATION:
3552 SA_DBG1(("mpiSSPCompletion: OSSA_IO_OPEN_CNX_ERROR_WRONG_DESTINATION tag 0x%x sspTag 0x%x status 0x%x param 0x%x\n", tag,sspTag,status,param));
3553 saRoot->IoErrorCount.agOSSA_IO_OPEN_CNX_ERROR_WRONG_DESTINATION++;
3554 siAbnormal(agRoot, pRequest, status, 0, sspTag);
3557 case OSSA_IO_XFER_ERROR_NAK_RECEIVED:
3559 SA_DBG1(("mpiSSPCompletion: OSSA_IO_XFER_ERROR_NAK_RECEIVED tag 0x%x sspTag 0x%x status 0x%x param 0x%x\n", tag,sspTag,status,param));
3560 saRoot->IoErrorCount.agOSSA_IO_XFER_ERROR_NAK_RECEIVED++;
3561 siAbnormal(agRoot, pRequest, status, 0, sspTag);
3564 case OSSA_IO_XFER_ERROR_ACK_NAK_TIMEOUT:
3566 SA_DBG1(("mpiSSPCompletion: OSSA_IO_XFER_ERROR_ACK_NAK_TIMEOUT tag 0x%x sspTag 0x%x status 0x%x param 0x%x\n", tag,sspTag,status,param));
3567 saRoot->IoErrorCount.agOSSA_IO_XFER_ERROR_ACK_NAK_TIMEOUT++;
3568 siAbnormal(agRoot, pRequest, status, 0, sspTag);
3571 case OSSA_IO_XFER_ERROR_DMA:
3573 SA_DBG1(("mpiSSPCompletion: OSSA_IO_XFER_ERROR_DMA tag 0x%x ssptag 0x%x status 0x%x param 0x%x\n", tag,sspTag,status,param));
3574 saRoot->IoErrorCount.agOSSA_IO_XFER_ERROR_DMA++;
3575 siAbnormal(agRoot, pRequest, status, 0, sspTag);
3578 case OSSA_IO_XFER_OPEN_RETRY_TIMEOUT:
3580 SA_DBG1(("mpiSSPCompletion: OSSA_IO_XFER_OPEN_RETRY_TIMEOUT tag 0x%x sspTag 0x%x status 0x%x param 0x%x\n", tag,sspTag,status,param));
3581 saRoot->IoErrorCount.agOSSA_IO_XFER_OPEN_RETRY_TIMEOUT++;
3582 siAbnormal(agRoot, pRequest, status, 0, sspTag);
3585 case OSSA_IO_XFER_ERROR_UNEXPECTED_PHASE:
3587 SA_DBG1(("mpiSSPCompletion: OSSA_IO_XFER_ERROR_UNEXPECTED_PHASE tag 0x%x sspTag 0x%x status 0x%x param 0x%x\n", tag,sspTag,status,param));
3588 saRoot->IoErrorCount.agOSSA_IO_XFER_ERROR_UNEXPECTED_PHASE++;
3589 siAbnormal(agRoot, pRequest, status, 0, sspTag);
3592 case OSSA_IO_XFER_ERROR_OFFSET_MISMATCH:
3594 SA_DBG1(("mpiSSPCompletion: OSSA_IO_XFER_ERROR_OFFSET_MISMATCH tag 0x%x sspTag 0x%x status 0x%x param 0x%x\n", tag,sspTag,status,param));
3595 saRoot->IoErrorCount.agOSSA_IO_XFER_ERROR_OFFSET_MISMATCH++;
3596 siAbnormal(agRoot, pRequest, status, 0, sspTag);
3599 case OSSA_IO_PORT_IN_RESET:
3601 SA_DBG1(("mpiSSPCompletion: OSSA_IO_PORT_IN_RESET tag 0x%x sspTag 0x%x status 0x%x param 0x%x\n", tag,sspTag,status,param));
3602 saRoot->IoErrorCount.agOSSA_IO_PORT_IN_RESET++;
3603 siAbnormal(agRoot, pRequest, status, 0, sspTag);
3606 case OSSA_IO_DS_NON_OPERATIONAL:
3608 SA_DBG1(("mpiSSPCompletion: OSSA_IO_DS_NON_OPERATIONAL tag 0x%x sspTag 0x%x status 0x%x param 0x%x\n", tag,sspTag,status,param));
3609 saRoot->IoErrorCount.agOSSA_IO_DS_NON_OPERATIONAL++;
3610 siAbnormal(agRoot, pRequest, status, 0, sspTag);
3613 case OSSA_IO_DS_IN_RECOVERY:
3615 SA_DBG1(("mpiSSPCompletion: OSSA_IO_DS_IN_RECOVERY tag 0x%x sspTag 0x%x status 0x%x param 0x%x\n", tag,sspTag,status,param));
3616 saRoot->IoErrorCount.agOSSA_IO_DS_IN_RECOVERY++;
3617 siAbnormal(agRoot, pRequest, status, 0, sspTag);
3620 case OSSA_IO_TM_TAG_NOT_FOUND:
3622 SA_DBG1(("mpiSSPCompletion: OSSA_IO_TM_TAG_NOT_FOUND tag 0x%x sspTag 0x%x status 0x%x param 0x%x\n", tag,sspTag,status,param));
3623 saRoot->IoErrorCount.agOSSA_IO_TM_TAG_NOT_FOUND++;
3624 siAbnormal(agRoot, pRequest, status, 0, sspTag);
3627 case OSSA_IO_XFER_PIO_SETUP_ERROR:
3629 SA_DBG1(("mpiSSPCompletion: OSSA_IO_XFER_PIO_SETUP_ERROR tag 0x%x sspTag 0x%x status 0x%x param 0x%x\n", tag,sspTag,status,param));
3630 saRoot->IoErrorCount.agOSSA_IO_XFER_PIO_SETUP_ERROR++;
3631 /* not allowed case. Therefore, return failed status */
3632 siAbnormal(agRoot, pRequest, OSSA_IO_FAILED, param, sspTag);
3635 case OSSA_IO_SSP_EXT_IU_ZERO_LEN_ERROR:
3637 SA_DBG1(("mpiSSPCompletion: OSSA_IO_SSP_IU_ZERO_LEN_ERROR tag 0x%x sspTag 0x%x status 0x%x param 0x%x\n", tag,sspTag,status,param));
3638 saRoot->IoErrorCount.agOSSA_IO_SSP_EXT_IU_ZERO_LEN_ERROR++;
3639 siAbnormal(agRoot, pRequest, status, 0, sspTag);
3642 case OSSA_IO_DS_IN_ERROR:
3644 SA_DBG1(("mpiSSPCompletion: OSSA_IO_DS_IN_ERROR tag 0x%x sspTag 0x%x status 0x%x param 0x%x\n", tag,sspTag,status,param));
3645 saRoot->IoErrorCount.agOSSA_IO_DS_IN_ERROR++;
3646 /* not allowed case. Therefore, return failed status */
3647 siAbnormal(agRoot, pRequest, OSSA_IO_FAILED, param, sspTag);
3650 case OSSA_IO_OPEN_CNX_ERROR_HW_RESOURCE_BUSY:
3652 SA_DBG1(("mpiSSPCompletion: OSSA_IO_OPEN_CNX_ERROR_HW_RESOURCE_BUSY tag 0x%x sspTag 0x%x status 0x%x param 0x%x\n", tag,sspTag,status,param));
3653 saRoot->IoErrorCount.agOSSA_IO_OPEN_CNX_ERROR_HW_RESOURCE_BUSY++;
3654 /* not allowed case. Therefore, return failed status */
3655 siAbnormal(agRoot, pRequest, OSSA_IO_FAILED, param, sspTag);
3658 case OSSA_IO_ABORT_IN_PROGRESS:
3660 SA_DBG1(("mpiSSPCompletion: OSSA_IO_ABORT_IN_PROGRESS tag 0x%x sspTag 0x%x status 0x%x param 0x%x\n", tag,sspTag,status,param));
3661 saRoot->IoErrorCount.agOSSA_IO_ABORT_IN_PROGRESS++;
3662 /* not allowed case. Therefore, return failed status */
3663 siAbnormal(agRoot, pRequest, OSSA_IO_FAILED, param, sspTag);
3666 case OSSA_IO_ABORT_DELAYED:
3668 SA_DBG1(("mpiSSPCompletion: OSSA_IO_ABORT_DELAYED tag 0x%x sspTag 0x%x status 0x%x param 0x%x\n", tag,sspTag,status,param));
3669 saRoot->IoErrorCount.agOSSA_IO_ABORT_DELAYED++;
3670 /* not allowed case. Therefore, return failed status */
3671 siAbnormal(agRoot, pRequest, OSSA_IO_FAILED, param, sspTag);
3674 case OSSA_IO_INVALID_LENGTH:
3676 SA_DBG1(("mpiSSPCompletion: OSSA_IO_INVALID_LENGTH tag 0x%x sspTag 0x%x status 0x%x param 0x%x\n", tag,sspTag,status,param));
3677 saRoot->IoErrorCount.agOSSA_IO_INVALID_LENGTH++;
3678 /* not allowed case. Therefore, return failed status */
3679 siAbnormal(agRoot, pRequest, OSSA_IO_FAILED, param, sspTag);
3682 case OSSA_IO_OPEN_CNX_ERROR_HW_RESOURCE_BUSY_ALT:
3684 SA_DBG1(("mpiSSPCompletion: OSSA_IO_OPEN_CNX_ERROR_HW_RESOURCE_BUSY_ALT tag 0x%x sspTag 0x%x status 0x%x param 0x%x\n", tag,sspTag,status,param));
3685 saRoot->IoErrorCount.agOSSA_IO_OPEN_CNX_ERROR_HW_RESOURCE_BUSY_ALT++;
3686 /* not allowed case. Therefore, return failed status */
3687 siAbnormal(agRoot, pRequest, OSSA_IO_FAILED, param, sspTag);
3690 case OSSA_IO_OPEN_CNX_ERROR_IT_NEXUS_LOSS_OPEN_RETRY_BACKOFF_THRESHOLD_REACHED:
3692 SA_DBG1(("mpiSSPCompletion: OSSA_IO_OPEN_CNX_ERROR_IT_NEXUS_LOSS_OPEN_RETRY_BACKOFF_THRESHOLD_REACHED HTAG = 0x%x ssptag = 0x%x\n", tag, sspTag));
3693 saRoot->IoErrorCount.agOSSA_IO_OPEN_CNX_ERROR_IT_NEXUS_LOSS_OPEN_RETRY_BACKOFF_THRESHOLD_REACHED++;
3694 siAbnormal(agRoot, pRequest, status, 0, sspTag);
3697 case OSSA_IO_OPEN_CNX_ERROR_IT_NEXUS_LOSS_OPEN_TMO:
3699 SA_DBG1(("mpiSSPCompletion: OSSA_IO_OPEN_CNX_ERROR_IT_NEXUS_LOSS_OPEN_TMO tag 0x%x sspTag 0x%x status 0x%x param 0x%x\n", tag,sspTag,status,param));
3700 saRoot->IoErrorCount.agOSSA_IO_OPEN_CNX_ERROR_IT_NEXUS_LOSS_OPEN_TMO++;
3701 siAbnormal(agRoot, pRequest, status, param, sspTag);
3704 case OSSA_IO_OPEN_CNX_ERROR_IT_NEXUS_LOSS_NO_DEST:
3706 SA_DBG1(("mpiSSPCompletion: OSSA_IO_OPEN_CNX_ERROR_IT_NEXUS_LOSS_NO_DEST tag 0x%x sspTag 0x%x status 0x%x param 0x%x\n", tag,sspTag,status,param));
3707 saRoot->IoErrorCount.agOSSA_IO_OPEN_CNX_ERROR_IT_NEXUS_LOSS_NO_DEST++;
3708 siAbnormal(agRoot, pRequest, status, param, sspTag);
3711 case OSSA_IO_OPEN_CNX_ERROR_IT_NEXUS_LOSS_OPEN_COLLIDE:
3713 SA_DBG1(("mpiSSPCompletion: OSSA_IO_OPEN_CNX_ERROR_IT_NEXUS_LOSS_OPEN_COLLIDE tag 0x%x sspTag 0x%x status 0x%x param 0x%x\n", tag,sspTag,status,param));
3714 saRoot->IoErrorCount.agOSSA_IO_OPEN_CNX_ERROR_IT_NEXUS_LOSS_OPEN_COLLIDE++;
3715 siAbnormal(agRoot, pRequest, status, param, sspTag);
3718 case OSSA_IO_OPEN_CNX_ERROR_IT_NEXUS_LOSS_PATHWAY_BLOCKED:
3720 SA_DBG1(("mpiSSPCompletion: OSSA_IO_OPEN_CNX_ERROR_IT_NEXUS_LOSS_PATHWAY_BLOCKED tag 0x%x sspTag 0x%x status 0x%x param 0x%x\n", tag,sspTag,status,param));
3721 saRoot->IoErrorCount.agOSSA_IO_OPEN_CNX_ERROR_IT_NEXUS_LOSS_PATHWAY_BLOCKED++;
3722 siAbnormal(agRoot, pRequest, status, param, sspTag);
3725 case OSSA_IO_DS_INVALID:
3727 SA_DBG1(("mpiSSPCompletion: OSSA_IO_DS_INVALID tag 0x%x sspTag 0x%x status 0x%x param 0x%x\n", tag,sspTag,status,param));
3728 saRoot->IoErrorCount.agOSSA_IO_DS_INVALID++;
3729 siAbnormal(agRoot, pRequest, status, param, sspTag);
3732 case OSSA_MPI_IO_RQE_BUSY_FULL:
3734 SA_DBG1(("mpiSSPCompletion: OSSA_MPI_IO_RQE_BUSY_FULL tag 0x%x sspTag 0x%x status 0x%x param 0x%x\n", tag,sspTag,status,param));
3735 saRoot->IoErrorCount.agOSSA_MPI_IO_RQE_BUSY_FULL++;
3736 siAbnormal(agRoot, pRequest, status, param, sspTag);
3739 case OSSA_MPI_ERR_IO_RESOURCE_UNAVAILABLE:
3741 SA_DBG1(("mpiSSPCompletion: OSSA_MPI_ERR_IO_RESOURCE_UNAVAILABLE tag 0x%x sspTag 0x%x status 0x%x param 0x%x\n", tag,sspTag,status,param));
3742 saRoot->IoErrorCount.agOSSA_MPI_ERR_IO_RESOURCE_UNAVAILABLE++;
3743 siAbnormal(agRoot, pRequest, status, param, sspTag);
3746 case OSSA_IO_XFR_ERROR_DEK_KEY_CACHE_MISS:
3748 SA_DBG1(("mpiSSPCompletion: OSSA_IO_XFR_ERROR_DEK_KEY_CACHE_MISS tag 0x%x sspTag 0x%x status 0x%x param 0x%x\n", tag,sspTag,status,param));
3749 saRoot->IoErrorCount.agOSSA_IO_XFR_ERROR_DEK_KEY_CACHE_MISS++;
3750 siAbnormal(agRoot, pRequest, status, param, sspTag);
3753 case OSSA_IO_XFR_ERROR_DEK_KEY_TAG_MISMATCH:
3755 SA_DBG1(("mpiSSPCompletion: OSSA_IO_XFR_ERROR_DEK_KEY_TAG_MISMATCH tag 0x%x sspTag 0x%x status 0x%x param 0x%x\n", tag,sspTag,status,param));
3756 saRoot->IoErrorCount.agOSSA_IO_XFR_ERROR_DEK_KEY_TAG_MISMATCH++;
3757 siAbnormal(agRoot, pRequest, status, param, sspTag);
3760 case OSSA_IO_XFR_ERROR_CIPHER_MODE_INVALID:
3762 SA_DBG1(("mpiSSPCompletion: OSSA_IO_XFR_ERROR_CIPHER_MODE_INVALID tag 0x%x sspTag 0x%x status 0x%x param 0x%x\n", tag,sspTag,status,param));
3763 saRoot->IoErrorCount.agOSSA_IO_XFR_ERROR_CIPHER_MODE_INVALID++;
3764 siAbnormal(agRoot, pRequest, status, param, sspTag);
3767 case OSSA_IO_XFR_ERROR_DEK_IV_MISMATCH:
3769 SA_DBG1(("mpiSSPCompletion: OSSA_IO_XFR_ERROR_DEK_IV_MISMATCH tag 0x%x sspTag 0x%x status 0x%x param 0x%x\n", tag,sspTag,status,param));
3770 saRoot->IoErrorCount.agOSSA_IO_XFR_ERROR_DEK_IV_MISMATCH++;
3771 siAbnormal(agRoot, pRequest, status, param, sspTag);
3774 case OSSA_IO_XFR_ERROR_DEK_RAM_INTERFACE_ERROR:
3776 SA_DBG1(("mpiSSPCompletion: OSSA_IO_XFR_ERROR_DEK_RAM_INTERFACE_ERROR tag 0x%x sspTag 0x%x status 0x%x param 0x%x\n", tag,sspTag,status,param));
3777 saRoot->IoErrorCount.agOSSA_IO_XFR_ERROR_DEK_RAM_INTERFACE_ERROR++;
3778 siAbnormal(agRoot, pRequest, status, param, sspTag);
3781 case OSSA_IO_XFR_ERROR_INTERNAL_RAM:
3783 SA_DBG1(("mpiSSPCompletion: OSSA_IO_XFR_ERROR_INTERNAL_RAM tag 0x%x sspTag 0x%x status 0x%x param 0x%x\n", tag,sspTag,status,param));
3784 saRoot->IoErrorCount.agOSSA_IO_XFR_ERROR_INTERNAL_RAM++;
3785 siAbnormal(agRoot, pRequest, status, param, sspTag);
3788 case OSSA_IO_XFR_ERROR_DEK_INDEX_OUT_OF_BOUNDS:
3790 SA_DBG1(("mpiSSPCompletion: OSSA_IO_XFR_ERROR_DEK_INDEX_OUT_OF_BOUNDS tag 0x%x sspTag 0x%x status 0x%x param 0x%x\n", tag,sspTag,status,param));
3791 saRoot->IoErrorCount.agOSSA_IO_XFR_ERROR_DEK_INDEX_OUT_OF_BOUNDS++;
3792 siAbnormal(agRoot, pRequest, status, param, sspTag);
3795 case OSSA_IO_XFR_ERROR_DEK_ILLEGAL_TABLE:
3797 SA_DBG1(("mpiSSPCompletion: OSSA_IO_XFR_ERROR_DEK_ILLEGAL_TABLE tag 0x%x sspTag 0x%x status 0x%x param 0x%x\n", tag,sspTag,status,param));
3798 saRoot->IoErrorCount.agOSSA_IO_XFR_ERROR_DEK_ILLEGAL_TABLE++;
3799 siAbnormal(agRoot, pRequest, status, param, sspTag);
3802 #ifdef SA_TESTBASE_EXTRA
3804 case OSSA_IO_HOST_BST_INVALID:
3806 SA_DBG1(("mpiParseOBIomb, OPC_OUB_SSP_COMP: OSSA_IO_HOST_BST_INVALID 0x%x\n", status));
3807 siAbnormal(agRoot, pRequest, status, param, sspTag);
3810 #endif /* SA_TESTBASE_EXTRA */
3811 case OSSA_IO_XFR_ERROR_DIF_MISMATCH:
3813 SA_DBG1(("mpiSSPCompletion: OSSA_IO_XFR_ERROR_DIF_MISMATCH tag 0x%x sspTag 0x%x status 0x%x param 0x%x\n", tag,sspTag,status,param));
3814 saRoot->IoErrorCount.agOSSA_IO_XFR_ERROR_DIF_MISMATCH++;
3815 siDifAbnormal(agRoot, pRequest, status, param, sspTag, pIomb1);
3818 case OSSA_IO_XFR_ERROR_DIF_APPLICATION_TAG_MISMATCH:
3820 SA_DBG1(("mpiSSPCompletion: OSSA_IO_XFR_ERROR_DIF_APPLICATION_TAG_MISMATCH tag 0x%x sspTag 0x%x status 0x%x param 0x%x\n", tag,sspTag,status,param));
3821 saRoot->IoErrorCount.agOSSA_IO_XFR_ERROR_DIF_APPLICATION_TAG_MISMATCH++;
3822 siDifAbnormal(agRoot, pRequest, status, param, sspTag, pIomb1);
3825 case OSSA_IO_XFR_ERROR_DIF_REFERENCE_TAG_MISMATCH:
3827 SA_DBG1(("mpiSSPCompletion: OSSA_IO_XFR_ERROR_DIF_REFERENCE_TAG_MISMATCH tag 0x%x sspTag 0x%x status 0x%x param 0x%x\n", tag,sspTag,status,param));
3828 saRoot->IoErrorCount.agOSSA_IO_XFR_ERROR_DIF_REFERENCE_TAG_MISMATCH++;
3829 siDifAbnormal(agRoot, pRequest, status, param, sspTag, pIomb1);
3832 case OSSA_IO_XFR_ERROR_DIF_CRC_MISMATCH:
3834 SA_DBG1(("mpiSSPCompletion: OSSA_IO_XFR_ERROR_DIF_CRC_MISMATCH tag 0x%x sspTag 0x%x status 0x%x param 0x%x\n", tag,sspTag,status,param));
3835 saRoot->IoErrorCount.agOSSA_IO_XFR_ERROR_DIF_CRC_MISMATCH++;
3836 siDifAbnormal(agRoot, pRequest, status, param, sspTag, pIomb1);
3839 case OSSA_IO_XFER_ERROR_DIF_INTERNAL_ERROR:
3841 SA_DBG1(("mpiSSPCompletion: OSSA_IO_XFER_ERROR_DIF_INTERNAL_ERROR tag 0x%x sspTag 0x%x status 0x%x param 0x%x\n", tag,sspTag,status,param));
3842 saRoot->IoErrorCount.agOSSA_IO_XFER_ERROR_DIF_INTERNAL_ERROR++;
3843 siDifAbnormal(agRoot, pRequest, status, param, sspTag, pIomb1);
3846 case OSSA_IO_XFER_ERR_EOB_DATA_OVERRUN:
3848 SA_DBG1(("mpiSSPCompletion: OSSA_IO_XFER_ERR_EOB_DATA_OVERRUN tag 0x%x sspTag 0x%x status 0x%x param 0x%x\n", tag,sspTag,status,param));
3849 saRoot->IoErrorCount.agOSSA_IO_XFER_ERR_EOB_DATA_OVERRUN++;
3850 siAbnormal(agRoot, pRequest, status, param, sspTag);
3853 case OSSA_IO_OPEN_CNX_ERROR_OPEN_PREEMPTED:
3855 SA_DBG1(("mpiSSPCompletion: OSSA_IO_OPEN_CNX_ERROR_OPEN_PREEMPTED tag 0x%x sspTag 0x%x status 0x%x param 0x%x\n", tag,sspTag,status,param));
3856 saRoot->IoErrorCount.agOSSA_IO_OPEN_CNX_ERROR_OPEN_PREEMPTED++;
3857 siAbnormal(agRoot, pRequest, status, param, sspTag);
3862 SA_DBG1(("mpiSSPCompletion: Unknown tag 0x%x sspTag 0x%x status 0x%x param 0x%x\n", tag,sspTag,status,param));
3863 /* not allowed case. Therefore, return failed status */
3864 saRoot->IoErrorCount.agOSSA_IO_UNKNOWN_ERROR++;
3865 siAbnormal(agRoot, pRequest, OSSA_IO_FAILED, param, sspTag);
3870 smTraceFuncExit(hpDBG_VERY_LOUD, 'b', "5A");