1*4e1bc9a0SAchim Leubner /*******************************************************************************
2*4e1bc9a0SAchim Leubner *Copyright (c) 2014 PMC-Sierra, Inc. All rights reserved.
3*4e1bc9a0SAchim Leubner *
4*4e1bc9a0SAchim Leubner *Redistribution and use in source and binary forms, with or without modification, are permitted provided
5*4e1bc9a0SAchim Leubner *that the following conditions are met:
6*4e1bc9a0SAchim Leubner *1. Redistributions of source code must retain the above copyright notice, this list of conditions and the
7*4e1bc9a0SAchim Leubner *following disclaimer.
8*4e1bc9a0SAchim Leubner *2. Redistributions in binary form must reproduce the above copyright notice,
9*4e1bc9a0SAchim Leubner *this list of conditions and the following disclaimer in the documentation and/or other materials provided
10*4e1bc9a0SAchim Leubner *with the distribution.
11*4e1bc9a0SAchim Leubner *
12*4e1bc9a0SAchim Leubner *THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED
13*4e1bc9a0SAchim Leubner *WARRANTIES,INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
14*4e1bc9a0SAchim Leubner *FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
15*4e1bc9a0SAchim Leubner *FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
16*4e1bc9a0SAchim Leubner *NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
17*4e1bc9a0SAchim Leubner *BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
18*4e1bc9a0SAchim Leubner *LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
19*4e1bc9a0SAchim Leubner *SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE
20*4e1bc9a0SAchim Leubner
21*4e1bc9a0SAchim Leubner ********************************************************************************/
22*4e1bc9a0SAchim Leubner /*******************************************************************************/
23*4e1bc9a0SAchim Leubner /*! \file saint.c
24*4e1bc9a0SAchim Leubner * \brief The file implements the functions to handle/enable/disable interrupt
25*4e1bc9a0SAchim Leubner *
26*4e1bc9a0SAchim Leubner */
27*4e1bc9a0SAchim Leubner /*******************************************************************************/
28*4e1bc9a0SAchim Leubner #include <sys/cdefs.h>
29*4e1bc9a0SAchim Leubner #include <dev/pms/config.h>
30*4e1bc9a0SAchim Leubner
31*4e1bc9a0SAchim Leubner #include <dev/pms/RefTisa/sallsdk/spc/saglobal.h>
32*4e1bc9a0SAchim Leubner #define SA_CLEAR_ODCR_IN_INTERRUPT
33*4e1bc9a0SAchim Leubner
34*4e1bc9a0SAchim Leubner //#define SA_TEST_FW_SPURIOUS_INT
35*4e1bc9a0SAchim Leubner
36*4e1bc9a0SAchim Leubner #ifdef SA_TEST_FW_SPURIOUS_INT
37*4e1bc9a0SAchim Leubner bit32 gOurIntCount = 0;
38*4e1bc9a0SAchim Leubner bit32 gSpuriousIntCount = 0;
39*4e1bc9a0SAchim Leubner bit32 gSpuriousInt[64]=
40*4e1bc9a0SAchim Leubner {
41*4e1bc9a0SAchim Leubner 0,0,0,0,0,0,0,0,
42*4e1bc9a0SAchim Leubner 0,0,0,0,0,0,0,0,
43*4e1bc9a0SAchim Leubner 0,0,0,0,0,0,0,0,
44*4e1bc9a0SAchim Leubner 0,0,0,0,0,0,0,0,
45*4e1bc9a0SAchim Leubner 0,0,0,0,0,0,0,0,
46*4e1bc9a0SAchim Leubner 0,0,0,0,0,0,0,0,
47*4e1bc9a0SAchim Leubner 0,0,0,0,0,0,0,0,
48*4e1bc9a0SAchim Leubner 0,0,0,0,0,0,0,0
49*4e1bc9a0SAchim Leubner };
50*4e1bc9a0SAchim Leubner bit32 gSpuriousInt1[64]=
51*4e1bc9a0SAchim Leubner {
52*4e1bc9a0SAchim Leubner 0,0,0,0,0,0,0,0,
53*4e1bc9a0SAchim Leubner 0,0,0,0,0,0,0,0,
54*4e1bc9a0SAchim Leubner 0,0,0,0,0,0,0,0,
55*4e1bc9a0SAchim Leubner 0,0,0,0,0,0,0,0,
56*4e1bc9a0SAchim Leubner 0,0,0,0,0,0,0,0,
57*4e1bc9a0SAchim Leubner 0,0,0,0,0,0,0,0,
58*4e1bc9a0SAchim Leubner 0,0,0,0,0,0,0,0,
59*4e1bc9a0SAchim Leubner 0,0,0,0,0,0,0,0
60*4e1bc9a0SAchim Leubner };
61*4e1bc9a0SAchim Leubner #endif /* SA_TEST_FW_SPURIOUS_INT */
62*4e1bc9a0SAchim Leubner
63*4e1bc9a0SAchim Leubner #ifdef SA_ENABLE_TRACE_FUNCTIONS
64*4e1bc9a0SAchim Leubner #ifdef siTraceFileID
65*4e1bc9a0SAchim Leubner #undef siTraceFileID
66*4e1bc9a0SAchim Leubner #endif /* siTraceFileID */
67*4e1bc9a0SAchim Leubner #define siTraceFileID 'G'
68*4e1bc9a0SAchim Leubner #endif /* SA_ENABLE_TRACE_FUNCTIONS */
69*4e1bc9a0SAchim Leubner
70*4e1bc9a0SAchim Leubner LOCAL FORCEINLINE bit32 siProcessOBMsg(
71*4e1bc9a0SAchim Leubner agsaRoot_t *agRoot,
72*4e1bc9a0SAchim Leubner bit32 count,
73*4e1bc9a0SAchim Leubner bit32 queueNum
74*4e1bc9a0SAchim Leubner );
75*4e1bc9a0SAchim Leubner
siFatalInterruptHandler(agsaRoot_t * agRoot,bit32 interruptVectorIndex)76*4e1bc9a0SAchim Leubner LOCAL bit32 siFatalInterruptHandler(
77*4e1bc9a0SAchim Leubner agsaRoot_t *agRoot,
78*4e1bc9a0SAchim Leubner bit32 interruptVectorIndex
79*4e1bc9a0SAchim Leubner )
80*4e1bc9a0SAchim Leubner {
81*4e1bc9a0SAchim Leubner agsaLLRoot_t *saRoot = agNULL;
82*4e1bc9a0SAchim Leubner agsaFatalErrorInfo_t fatal_error;
83*4e1bc9a0SAchim Leubner bit32 value;
84*4e1bc9a0SAchim Leubner bit32 ret = AGSA_RC_FAILURE;
85*4e1bc9a0SAchim Leubner bit32 Sendfatal = agTRUE;
86*4e1bc9a0SAchim Leubner
87*4e1bc9a0SAchim Leubner SA_ASSERT((agNULL != agRoot), "");
88*4e1bc9a0SAchim Leubner if (agRoot == agNULL)
89*4e1bc9a0SAchim Leubner {
90*4e1bc9a0SAchim Leubner SA_DBG1(("siFatalInterruptHandler: agRoot == agNULL\n"));
91*4e1bc9a0SAchim Leubner return AGSA_RC_FAILURE;
92*4e1bc9a0SAchim Leubner }
93*4e1bc9a0SAchim Leubner saRoot = (agsaLLRoot_t *)(agRoot->sdkData);
94*4e1bc9a0SAchim Leubner SA_ASSERT((agNULL != saRoot), "");
95*4e1bc9a0SAchim Leubner if (saRoot == agNULL)
96*4e1bc9a0SAchim Leubner {
97*4e1bc9a0SAchim Leubner SA_DBG1(("siFatalInterruptHandler: saRoot == agNULL\n"));
98*4e1bc9a0SAchim Leubner return AGSA_RC_FAILURE;
99*4e1bc9a0SAchim Leubner }
100*4e1bc9a0SAchim Leubner
101*4e1bc9a0SAchim Leubner value = siHalRegReadExt(agRoot, GEN_MSGU_SCRATCH_PAD_1, MSGU_SCRATCH_PAD_1);
102*4e1bc9a0SAchim Leubner if (saRoot->ResetFailed)
103*4e1bc9a0SAchim Leubner {
104*4e1bc9a0SAchim Leubner SA_DBG1(("siFatalInterruptHandler: ResetFailed\n"));
105*4e1bc9a0SAchim Leubner ossaDisableInterrupts(agRoot, interruptVectorIndex);
106*4e1bc9a0SAchim Leubner return AGSA_RC_FAILURE;
107*4e1bc9a0SAchim Leubner }
108*4e1bc9a0SAchim Leubner
109*4e1bc9a0SAchim Leubner if(SCRATCH_PAD1_V_ERROR_STATE( value ) )
110*4e1bc9a0SAchim Leubner {
111*4e1bc9a0SAchim Leubner si_memset(&fatal_error, 0, sizeof(agsaFatalErrorInfo_t));
112*4e1bc9a0SAchim Leubner /* read detail fatal errors */
113*4e1bc9a0SAchim Leubner value = siHalRegReadExt(agRoot, GEN_MSGU_SCRATCH_PAD_0, MSGU_SCRATCH_PAD_0);
114*4e1bc9a0SAchim Leubner fatal_error.errorInfo0 = value;
115*4e1bc9a0SAchim Leubner SA_DBG1(("siFatalInterruptHandler: ScratchPad0 AAP error 0x%x code 0x%x\n",SCRATCH_PAD1_V_ERROR_STATE( value ), value));
116*4e1bc9a0SAchim Leubner
117*4e1bc9a0SAchim Leubner value = siHalRegReadExt(agRoot, GEN_MSGU_SCRATCH_PAD_1, MSGU_SCRATCH_PAD_1);
118*4e1bc9a0SAchim Leubner fatal_error.errorInfo1 = value;
119*4e1bc9a0SAchim Leubner /* AAP error state */
120*4e1bc9a0SAchim Leubner SA_DBG1(("siFatalInterruptHandler: AAP error state and error code 0x%x\n", value));
121*4e1bc9a0SAchim Leubner value = siHalRegReadExt(agRoot, GEN_MSGU_SCRATCH_PAD_2, MSGU_SCRATCH_PAD_2);
122*4e1bc9a0SAchim Leubner fatal_error.errorInfo2 = value;
123*4e1bc9a0SAchim Leubner SA_DBG1(("siFatalInterruptHandler: SCRATCH_PAD2 0x%08x\n", fatal_error.errorInfo2 ));
124*4e1bc9a0SAchim Leubner
125*4e1bc9a0SAchim Leubner #if defined(SALLSDK_DEBUG)
126*4e1bc9a0SAchim Leubner if(fatal_error.errorInfo2 & SCRATCH_PAD2_FW_ILA_ERR)
127*4e1bc9a0SAchim Leubner {
128*4e1bc9a0SAchim Leubner SA_DBG1(("siFatalInterruptHandler:SCRATCH_PAD1_V_ERROR_STATE SCRATCH_PAD2_FW_ILA_ERR 0x%08x\n", SCRATCH_PAD2_FW_ILA_ERR));
129*4e1bc9a0SAchim Leubner }
130*4e1bc9a0SAchim Leubner if(fatal_error.errorInfo2 & SCRATCH_PAD2_FW_FLM_ERR)
131*4e1bc9a0SAchim Leubner {
132*4e1bc9a0SAchim Leubner SA_DBG1(("siFatalInterruptHandler: SCRATCH_PAD2_FW_FLM_ERR 0x%08x\n", SCRATCH_PAD2_FW_FLM_ERR));
133*4e1bc9a0SAchim Leubner }
134*4e1bc9a0SAchim Leubner if(fatal_error.errorInfo2 & SCRATCH_PAD2_FW_FW_ASRT_ERR)
135*4e1bc9a0SAchim Leubner {
136*4e1bc9a0SAchim Leubner SA_DBG1(("siFatalInterruptHandler: SCRATCH_PAD2_FW_FW_ASRT_ERR 0x%08x\n", SCRATCH_PAD2_FW_FW_ASRT_ERR));
137*4e1bc9a0SAchim Leubner }
138*4e1bc9a0SAchim Leubner if(fatal_error.errorInfo2 & SCRATCH_PAD2_FW_HW_WDG_ERR)
139*4e1bc9a0SAchim Leubner {
140*4e1bc9a0SAchim Leubner SA_DBG1(("siFatalInterruptHandler: SCRATCH_PAD2_FW_HW_WDG_ERR 0x%08x\n", SCRATCH_PAD2_FW_HW_WDG_ERR));
141*4e1bc9a0SAchim Leubner }
142*4e1bc9a0SAchim Leubner if(fatal_error.errorInfo2 & SCRATCH_PAD2_FW_GEN_EXCEPTION_ERR)
143*4e1bc9a0SAchim Leubner {
144*4e1bc9a0SAchim Leubner SA_DBG1(("siFatalInterruptHandler: SCRATCH_PAD2_FW_GEN_EXCEPTION_ERR 0x%08x\n", SCRATCH_PAD2_FW_GEN_EXCEPTION_ERR));
145*4e1bc9a0SAchim Leubner }
146*4e1bc9a0SAchim Leubner if(fatal_error.errorInfo2 & SCRATCH_PAD2_FW_UNDTMN_ERR)
147*4e1bc9a0SAchim Leubner {
148*4e1bc9a0SAchim Leubner SA_DBG1(("siFatalInterruptHandler: SCRATCH_PAD2_FW_UNDTMN_ERR 0x%08x\n",SCRATCH_PAD2_FW_UNDTMN_ERR ));
149*4e1bc9a0SAchim Leubner }
150*4e1bc9a0SAchim Leubner if(fatal_error.errorInfo2 & SCRATCH_PAD2_FW_HW_FATAL_ERR)
151*4e1bc9a0SAchim Leubner {
152*4e1bc9a0SAchim Leubner SA_DBG1(("siFatalInterruptHandler: SCRATCH_PAD2_FW_HW_FATAL_ERR 0x%08x\n", SCRATCH_PAD2_FW_HW_FATAL_ERR));
153*4e1bc9a0SAchim Leubner }
154*4e1bc9a0SAchim Leubner if((fatal_error.errorInfo2 & SCRATCH_PAD2_FW_HW_MASK) == SCRATCH_PAD2_HW_ERROR_INT_INDX_PCS_ERR )
155*4e1bc9a0SAchim Leubner {
156*4e1bc9a0SAchim Leubner SA_DBG1(("siFatalInterruptHandler: SCRATCH_PAD2_HW_ERROR_INT_INDX_PCS_ERR 0x%08x\n", value));
157*4e1bc9a0SAchim Leubner }
158*4e1bc9a0SAchim Leubner if((fatal_error.errorInfo2 & SCRATCH_PAD2_FW_HW_MASK) == SCRATCH_PAD2_HW_ERROR_INT_INDX_GSM_ERR )
159*4e1bc9a0SAchim Leubner {
160*4e1bc9a0SAchim Leubner SA_DBG1(("siFatalInterruptHandler: SCRATCH_PAD2_HW_ERROR_INT_INDX_GSM_ERR 0x%08x\n", value));
161*4e1bc9a0SAchim Leubner }
162*4e1bc9a0SAchim Leubner if((fatal_error.errorInfo2 & SCRATCH_PAD2_FW_HW_MASK) == SCRATCH_PAD2_HW_ERROR_INT_INDX_OSSP0_ERR )
163*4e1bc9a0SAchim Leubner {
164*4e1bc9a0SAchim Leubner SA_DBG1(("siFatalInterruptHandler: SCRATCH_PAD2_HW_ERROR_INT_INDX_OSSP0_ERR 0x%08x\n", value));
165*4e1bc9a0SAchim Leubner }
166*4e1bc9a0SAchim Leubner if((fatal_error.errorInfo2 & SCRATCH_PAD2_FW_HW_MASK) ==SCRATCH_PAD2_HW_ERROR_INT_INDX_OSSP1_ERR )
167*4e1bc9a0SAchim Leubner {
168*4e1bc9a0SAchim Leubner SA_DBG1(("siFatalInterruptHandler: SCRATCH_PAD2_HW_ERROR_INT_INDX_OSSP1_ERR 0x%08x\n", value));
169*4e1bc9a0SAchim Leubner }
170*4e1bc9a0SAchim Leubner if((fatal_error.errorInfo2 & SCRATCH_PAD2_FW_HW_MASK) == SCRATCH_PAD2_HW_ERROR_INT_INDX_OSSP2_ERR )
171*4e1bc9a0SAchim Leubner {
172*4e1bc9a0SAchim Leubner SA_DBG1(("siFatalInterruptHandler: SCRATCH_PAD2_HW_ERROR_INT_INDX_OSSP2_ERR 0x%08x\n", value));
173*4e1bc9a0SAchim Leubner }
174*4e1bc9a0SAchim Leubner if((fatal_error.errorInfo2 & SCRATCH_PAD2_FW_HW_MASK) == SCRATCH_PAD2_HW_ERROR_INT_INDX_ERAAE_ERR )
175*4e1bc9a0SAchim Leubner {
176*4e1bc9a0SAchim Leubner SA_DBG1(("siFatalInterruptHandler: SCRATCH_PAD2_HW_ERROR_INT_INDX_ERAAE_ERR 0x%08x\n", value));
177*4e1bc9a0SAchim Leubner }
178*4e1bc9a0SAchim Leubner if((fatal_error.errorInfo2 & SCRATCH_PAD2_FW_HW_MASK) == SCRATCH_PAD2_HW_ERROR_INT_INDX_SDS_ERR )
179*4e1bc9a0SAchim Leubner {
180*4e1bc9a0SAchim Leubner SA_DBG1(("siFatalInterruptHandler: SCRATCH_PAD2_HW_ERROR_INT_INDX_SDS_ERR 0x%08x\n", value));
181*4e1bc9a0SAchim Leubner }
182*4e1bc9a0SAchim Leubner if((fatal_error.errorInfo2 & SCRATCH_PAD2_FW_HW_MASK) == SCRATCH_PAD2_HW_ERROR_INT_INDX_PCIE_CORE_ERR )
183*4e1bc9a0SAchim Leubner {
184*4e1bc9a0SAchim Leubner SA_DBG1(("siFatalInterruptHandler: SCRATCH_PAD2_HW_ERROR_INT_INDX_PCIE_CORE_ERR 0x%08x\n", value));
185*4e1bc9a0SAchim Leubner }
186*4e1bc9a0SAchim Leubner if((fatal_error.errorInfo2 & SCRATCH_PAD2_FW_HW_MASK) == SCRATCH_PAD2_HW_ERROR_INT_INDX_PCIE_AL_ERR )
187*4e1bc9a0SAchim Leubner {
188*4e1bc9a0SAchim Leubner SA_DBG1(("siFatalInterruptHandler: SCRATCH_PAD2_HW_ERROR_INT_INDX_PCIE_AL_ERR 0x%08x\n", value));
189*4e1bc9a0SAchim Leubner }
190*4e1bc9a0SAchim Leubner if((fatal_error.errorInfo2 & SCRATCH_PAD2_FW_HW_MASK) == SCRATCH_PAD2_HW_ERROR_INT_INDX_MSGU_ERR )
191*4e1bc9a0SAchim Leubner {
192*4e1bc9a0SAchim Leubner SA_DBG1(("siFatalInterruptHandler: SCRATCH_PAD2_HW_ERROR_INT_INDX_MSGU_ERR 0x%08x\n", value));
193*4e1bc9a0SAchim Leubner }
194*4e1bc9a0SAchim Leubner if((fatal_error.errorInfo2 & SCRATCH_PAD2_FW_HW_MASK) == SCRATCH_PAD2_HW_ERROR_INT_INDX_SPBC_ERR )
195*4e1bc9a0SAchim Leubner {
196*4e1bc9a0SAchim Leubner SA_DBG1(("siFatalInterruptHandler: SCRATCH_PAD2_HW_ERROR_INT_INDX_SPBC_ERR 0x%08x\n", value));
197*4e1bc9a0SAchim Leubner }
198*4e1bc9a0SAchim Leubner if((fatal_error.errorInfo2 & SCRATCH_PAD2_FW_HW_MASK) == SCRATCH_PAD2_HW_ERROR_INT_INDX_BDMA_ERR )
199*4e1bc9a0SAchim Leubner {
200*4e1bc9a0SAchim Leubner SA_DBG1(("siFatalInterruptHandler: SCRATCH_PAD2_HW_ERROR_INT_INDX_BDMA_ERR 0x%08x\n", value));
201*4e1bc9a0SAchim Leubner }
202*4e1bc9a0SAchim Leubner if((fatal_error.errorInfo2 & SCRATCH_PAD2_FW_HW_MASK) == SCRATCH_PAD2_HW_ERROR_INT_INDX_MCPSL2B_ERR)
203*4e1bc9a0SAchim Leubner {
204*4e1bc9a0SAchim Leubner SA_DBG1(("siFatalInterruptHandler: SCRATCH_PAD2_HW_ERROR_INT_INDX_MCPSL2B_ERR 0x%08x\n", value));
205*4e1bc9a0SAchim Leubner }
206*4e1bc9a0SAchim Leubner if((fatal_error.errorInfo2 & SCRATCH_PAD2_FW_HW_MASK) == SCRATCH_PAD2_HW_ERROR_INT_INDX_MCPSDC_ERR )
207*4e1bc9a0SAchim Leubner {
208*4e1bc9a0SAchim Leubner SA_DBG1(("siFatalInterruptHandler: SCRATCH_PAD2_HW_ERROR_INT_INDX_MCPSDC_ERR 0x%08x\n", value));
209*4e1bc9a0SAchim Leubner }
210*4e1bc9a0SAchim Leubner if((fatal_error.errorInfo2 & SCRATCH_PAD2_FW_HW_MASK) == SCRATCH_PAD2_HW_ERROR_INT_INDX_UNDETERMINED_ERROR_OCCURRED )
211*4e1bc9a0SAchim Leubner {
212*4e1bc9a0SAchim Leubner SA_DBG1(("siFatalInterruptHandler: SCRATCH_PAD2_HW_ERROR_INT_INDX_UNDETERMINED_ERROR_OCCURRED 0x%08x\n", value));
213*4e1bc9a0SAchim Leubner }
214*4e1bc9a0SAchim Leubner #endif /* SALLSDK_DEBUG */
215*4e1bc9a0SAchim Leubner
216*4e1bc9a0SAchim Leubner if( fatal_error.errorInfo2 & SCRATCH_PAD2_FW_HW_NON_FATAL_ERR &&
217*4e1bc9a0SAchim Leubner !(fatal_error.errorInfo2 & SCRATCH_PAD2_FW_ILA_ERR) &&
218*4e1bc9a0SAchim Leubner !(fatal_error.errorInfo2 & SCRATCH_PAD2_FW_FLM_ERR) &&
219*4e1bc9a0SAchim Leubner !(fatal_error.errorInfo2 & SCRATCH_PAD2_FW_FW_ASRT_ERR) &&
220*4e1bc9a0SAchim Leubner !(fatal_error.errorInfo2 & SCRATCH_PAD2_FW_HW_WDG_ERR) &&
221*4e1bc9a0SAchim Leubner !(fatal_error.errorInfo2 & SCRATCH_PAD2_FW_GEN_EXCEPTION_ERR) &&
222*4e1bc9a0SAchim Leubner !(fatal_error.errorInfo2 & SCRATCH_PAD2_FW_UNDTMN_ERR) &&
223*4e1bc9a0SAchim Leubner !(fatal_error.errorInfo2 & SCRATCH_PAD2_HW_ERROR_INT_INDX_PCS_ERR) &&
224*4e1bc9a0SAchim Leubner !(fatal_error.errorInfo2 & SCRATCH_PAD2_HW_ERROR_INT_INDX_GSM_ERR) &&
225*4e1bc9a0SAchim Leubner !(fatal_error.errorInfo2 & SCRATCH_PAD2_HW_ERROR_INT_INDX_OSSP0_ERR) &&
226*4e1bc9a0SAchim Leubner !(fatal_error.errorInfo2 & SCRATCH_PAD2_HW_ERROR_INT_INDX_OSSP2_ERR) &&
227*4e1bc9a0SAchim Leubner !(fatal_error.errorInfo2 & SCRATCH_PAD2_HW_ERROR_INT_INDX_ERAAE_ERR) &&
228*4e1bc9a0SAchim Leubner !(fatal_error.errorInfo2 & SCRATCH_PAD2_HW_ERROR_INT_INDX_SDS_ERR) &&
229*4e1bc9a0SAchim Leubner !(fatal_error.errorInfo2 & SCRATCH_PAD2_HW_ERROR_INT_INDX_PCIE_CORE_ERR) &&
230*4e1bc9a0SAchim Leubner !(fatal_error.errorInfo2 & SCRATCH_PAD2_HW_ERROR_INT_INDX_PCIE_AL_ERR) &&
231*4e1bc9a0SAchim Leubner !(fatal_error.errorInfo2 & SCRATCH_PAD2_HW_ERROR_INT_INDX_MSGU_ERR) &&
232*4e1bc9a0SAchim Leubner !(fatal_error.errorInfo2 & SCRATCH_PAD2_HW_ERROR_INT_INDX_SPBC_ERR) &&
233*4e1bc9a0SAchim Leubner !(fatal_error.errorInfo2 & SCRATCH_PAD2_HW_ERROR_INT_INDX_BDMA_ERR) &&
234*4e1bc9a0SAchim Leubner !(fatal_error.errorInfo2 & SCRATCH_PAD2_HW_ERROR_INT_INDX_MCPSL2B_ERR) &&
235*4e1bc9a0SAchim Leubner !(fatal_error.errorInfo2 & SCRATCH_PAD2_HW_ERROR_INT_INDX_MCPSDC_ERR) &&
236*4e1bc9a0SAchim Leubner !(fatal_error.errorInfo2 & SCRATCH_PAD2_HW_ERROR_INT_INDX_UNDETERMINED_ERROR_OCCURRED) &&
237*4e1bc9a0SAchim Leubner !(fatal_error.errorInfo2 & SCRATCH_PAD2_FW_HW_FATAL_ERR) )
238*4e1bc9a0SAchim Leubner {
239*4e1bc9a0SAchim Leubner SA_DBG1(("siFatalInterruptHandler: SCRATCH_PAD2_FW_HW_NON_FATAL_ERR 0x%08x\n", value));
240*4e1bc9a0SAchim Leubner Sendfatal = agFALSE;
241*4e1bc9a0SAchim Leubner }
242*4e1bc9a0SAchim Leubner
243*4e1bc9a0SAchim Leubner value = siHalRegReadExt(agRoot, GEN_MSGU_SCRATCH_PAD_3, MSGU_SCRATCH_PAD_3);
244*4e1bc9a0SAchim Leubner SA_DBG1(("siFatalInterruptHandler: ScratchPad3 IOP error code 0x%08x\n", value));
245*4e1bc9a0SAchim Leubner fatal_error.errorInfo3 = value;
246*4e1bc9a0SAchim Leubner
247*4e1bc9a0SAchim Leubner if (agNULL != saRoot)
248*4e1bc9a0SAchim Leubner {
249*4e1bc9a0SAchim Leubner fatal_error.regDumpBusBaseNum0 = saRoot->mainConfigTable.regDumpPCIBAR;
250*4e1bc9a0SAchim Leubner fatal_error.regDumpOffset0 = saRoot->mainConfigTable.FatalErrorDumpOffset0;
251*4e1bc9a0SAchim Leubner fatal_error.regDumpLen0 = saRoot->mainConfigTable.FatalErrorDumpLength0;
252*4e1bc9a0SAchim Leubner fatal_error.regDumpBusBaseNum1 = saRoot->mainConfigTable.regDumpPCIBAR;
253*4e1bc9a0SAchim Leubner fatal_error.regDumpOffset1 = saRoot->mainConfigTable.FatalErrorDumpOffset1;
254*4e1bc9a0SAchim Leubner fatal_error.regDumpLen1 = saRoot->mainConfigTable.FatalErrorDumpLength1;
255*4e1bc9a0SAchim Leubner }
256*4e1bc9a0SAchim Leubner else
257*4e1bc9a0SAchim Leubner {
258*4e1bc9a0SAchim Leubner fatal_error.regDumpBusBaseNum0 = 0;
259*4e1bc9a0SAchim Leubner fatal_error.regDumpOffset0 = 0;
260*4e1bc9a0SAchim Leubner fatal_error.regDumpLen0 = 0;
261*4e1bc9a0SAchim Leubner fatal_error.regDumpBusBaseNum1 = 0;
262*4e1bc9a0SAchim Leubner fatal_error.regDumpOffset1 = 0;
263*4e1bc9a0SAchim Leubner fatal_error.regDumpLen1 = 0;
264*4e1bc9a0SAchim Leubner }
265*4e1bc9a0SAchim Leubner /* Call Back with error */
266*4e1bc9a0SAchim Leubner SA_DBG1(("siFatalInterruptHandler: Sendfatal %x HostR0 0x%x\n",Sendfatal ,ossaHwRegReadExt(agRoot, PCIBAR0,V_Scratchpad_Rsvd_0_Register ) ));
267*4e1bc9a0SAchim Leubner SA_DBG1(("siFatalInterruptHandler: ScratchPad2 0x%x ScratchPad3 0x%x\n",
268*4e1bc9a0SAchim Leubner ossaHwRegReadExt(agRoot, PCIBAR0,V_Host_Scratchpad_2_Register),
269*4e1bc9a0SAchim Leubner ossaHwRegReadExt(agRoot, PCIBAR0,V_Host_Scratchpad_3_Register) ));
270*4e1bc9a0SAchim Leubner
271*4e1bc9a0SAchim Leubner ossaHwCB(agRoot, agNULL, OSSA_HW_EVENT_MALFUNCTION, Sendfatal, (void *)&fatal_error, agNULL);
272*4e1bc9a0SAchim Leubner ret = AGSA_RC_SUCCESS;
273*4e1bc9a0SAchim Leubner }
274*4e1bc9a0SAchim Leubner else
275*4e1bc9a0SAchim Leubner {
276*4e1bc9a0SAchim Leubner bit32 host_reg0;
277*4e1bc9a0SAchim Leubner host_reg0 = ossaHwRegReadExt(agRoot, PCIBAR0,V_Scratchpad_Rsvd_0_Register );
278*4e1bc9a0SAchim Leubner if( host_reg0 == 0x2)
279*4e1bc9a0SAchim Leubner {
280*4e1bc9a0SAchim Leubner Sendfatal = agFALSE;
281*4e1bc9a0SAchim Leubner
282*4e1bc9a0SAchim Leubner SA_DBG1(("siFatalInterruptHandler: Non fatal ScratchPad1 0x%x HostR0 0x%x\n", value,host_reg0));
283*4e1bc9a0SAchim Leubner SA_DBG1(("siFatalInterruptHandler: ScratchPad0 0x%x ScratchPad1 0x%x\n",
284*4e1bc9a0SAchim Leubner ossaHwRegReadExt(agRoot, PCIBAR0,V_Scratchpad_0_Register),
285*4e1bc9a0SAchim Leubner ossaHwRegReadExt(agRoot, PCIBAR0,V_Scratchpad_1_Register) ));
286*4e1bc9a0SAchim Leubner SA_DBG1(("siFatalInterruptHandler: ScratchPad2 0x%x ScratchPad3 0x%x\n",
287*4e1bc9a0SAchim Leubner ossaHwRegReadExt(agRoot, PCIBAR0,V_Scratchpad_2_Register),
288*4e1bc9a0SAchim Leubner ossaHwRegReadExt(agRoot, PCIBAR0,V_Scratchpad_3_Register) ));
289*4e1bc9a0SAchim Leubner
290*4e1bc9a0SAchim Leubner ossaHwCB(agRoot, agNULL, OSSA_HW_EVENT_MALFUNCTION, Sendfatal, (void *)&fatal_error, agNULL);
291*4e1bc9a0SAchim Leubner ret = AGSA_RC_SUCCESS;
292*4e1bc9a0SAchim Leubner }
293*4e1bc9a0SAchim Leubner else if( host_reg0 == HDA_AES_DIF_FUNC)
294*4e1bc9a0SAchim Leubner {
295*4e1bc9a0SAchim Leubner SA_DBG1(("siFatalInterruptHandler: HDA_AES_DIF_FUNC 0x%x\n",
296*4e1bc9a0SAchim Leubner ossaHwRegReadExt(agRoot, PCIBAR0,V_Scratchpad_Rsvd_0_Register)));
297*4e1bc9a0SAchim Leubner Sendfatal = agFALSE;
298*4e1bc9a0SAchim Leubner ret = AGSA_RC_SUCCESS;
299*4e1bc9a0SAchim Leubner }
300*4e1bc9a0SAchim Leubner else
301*4e1bc9a0SAchim Leubner {
302*4e1bc9a0SAchim Leubner SA_DBG1(("siFatalInterruptHandler: No error detected ScratchPad1 0x%x HostR0 0x%x\n", value,host_reg0));
303*4e1bc9a0SAchim Leubner SA_DBG1(("siFatalInterruptHandler: ScratchPad0 0x%x ScratchPad1 0x%x\n",
304*4e1bc9a0SAchim Leubner ossaHwRegReadExt(agRoot, PCIBAR0,V_Scratchpad_0_Register),
305*4e1bc9a0SAchim Leubner ossaHwRegReadExt(agRoot, PCIBAR0,V_Scratchpad_1_Register) ));
306*4e1bc9a0SAchim Leubner SA_DBG1(("siFatalInterruptHandler: ScratchPad2 0x%x ScratchPad3 0x%x\n",
307*4e1bc9a0SAchim Leubner ossaHwRegReadExt(agRoot, PCIBAR0,V_Scratchpad_2_Register),
308*4e1bc9a0SAchim Leubner ossaHwRegReadExt(agRoot, PCIBAR0,V_Scratchpad_3_Register) ));
309*4e1bc9a0SAchim Leubner
310*4e1bc9a0SAchim Leubner SA_DBG1(("siFatalInterruptHandler: Doorbell_Set %08X U %08X\n",
311*4e1bc9a0SAchim Leubner ossaHwRegReadExt(agRoot, PCIBAR0, V_Outbound_Doorbell_Set_Register),
312*4e1bc9a0SAchim Leubner ossaHwRegReadExt(agRoot, PCIBAR0, V_Outbound_Doorbell_Set_RegisterU)));
313*4e1bc9a0SAchim Leubner SA_DBG1(("siFatalInterruptHandler: Doorbell_Mask %08X U %08X\n",
314*4e1bc9a0SAchim Leubner ossaHwRegReadExt(agRoot, PCIBAR0, V_Outbound_Doorbell_Mask_Set_Register ),
315*4e1bc9a0SAchim Leubner ossaHwRegReadExt(agRoot, PCIBAR0, V_Outbound_Doorbell_Mask_Set_RegisterU )));
316*4e1bc9a0SAchim Leubner
317*4e1bc9a0SAchim Leubner ret = AGSA_RC_FAILURE;
318*4e1bc9a0SAchim Leubner }
319*4e1bc9a0SAchim Leubner }
320*4e1bc9a0SAchim Leubner return ret;
321*4e1bc9a0SAchim Leubner
322*4e1bc9a0SAchim Leubner }
323*4e1bc9a0SAchim Leubner
saFatalInterruptHandler(agsaRoot_t * agRoot,bit32 interruptVectorIndex)324*4e1bc9a0SAchim Leubner GLOBAL bit32 saFatalInterruptHandler(
325*4e1bc9a0SAchim Leubner agsaRoot_t *agRoot,
326*4e1bc9a0SAchim Leubner bit32 interruptVectorIndex
327*4e1bc9a0SAchim Leubner )
328*4e1bc9a0SAchim Leubner {
329*4e1bc9a0SAchim Leubner agsaLLRoot_t *saRoot = agNULL;
330*4e1bc9a0SAchim Leubner bit32 ret = AGSA_RC_FAILURE;
331*4e1bc9a0SAchim Leubner
332*4e1bc9a0SAchim Leubner /* sanity check */
333*4e1bc9a0SAchim Leubner SA_ASSERT((agNULL != agRoot), "");
334*4e1bc9a0SAchim Leubner saRoot = (agsaLLRoot_t *)(agRoot->sdkData);
335*4e1bc9a0SAchim Leubner SA_ASSERT((agNULL != saRoot), "");
336*4e1bc9a0SAchim Leubner
337*4e1bc9a0SAchim Leubner if (saRoot->ResetFailed)
338*4e1bc9a0SAchim Leubner {
339*4e1bc9a0SAchim Leubner SA_DBG1(("saFatalInterruptHandler: ResetFailed\n"));
340*4e1bc9a0SAchim Leubner ossaDisableInterrupts(agRoot, interruptVectorIndex);
341*4e1bc9a0SAchim Leubner return AGSA_RC_FAILURE;
342*4e1bc9a0SAchim Leubner }
343*4e1bc9a0SAchim Leubner if (saRoot->swConfig.fatalErrorInterruptEnable != 1)
344*4e1bc9a0SAchim Leubner {
345*4e1bc9a0SAchim Leubner SA_DBG1(("saFatalInterruptHandler: fatalErrorInterrtupt is NOT enabled\n"));
346*4e1bc9a0SAchim Leubner ossaDisableInterrupts(agRoot, interruptVectorIndex);
347*4e1bc9a0SAchim Leubner return AGSA_RC_FAILURE;
348*4e1bc9a0SAchim Leubner }
349*4e1bc9a0SAchim Leubner
350*4e1bc9a0SAchim Leubner if (saRoot->swConfig.fatalErrorInterruptVector != interruptVectorIndex)
351*4e1bc9a0SAchim Leubner {
352*4e1bc9a0SAchim Leubner SA_DBG1(("saFatalInterruptHandler: interruptVectorIndex does not match 0x%x 0x%x\n",
353*4e1bc9a0SAchim Leubner saRoot->swConfig.fatalErrorInterruptVector, interruptVectorIndex));
354*4e1bc9a0SAchim Leubner SA_DBG1(("saFatalInterruptHandler: ScratchPad0 0x%x ScratchPad1 0x%x\n",
355*4e1bc9a0SAchim Leubner ossaHwRegReadExt(agRoot, PCIBAR0,V_Scratchpad_0_Register),
356*4e1bc9a0SAchim Leubner ossaHwRegReadExt(agRoot, PCIBAR0,V_Scratchpad_1_Register) ));
357*4e1bc9a0SAchim Leubner SA_DBG1(("saFatalInterruptHandler: ScratchPad2 0x%x ScratchPad3 0x%x\n",
358*4e1bc9a0SAchim Leubner ossaHwRegReadExt(agRoot, PCIBAR0,V_Scratchpad_2_Register),
359*4e1bc9a0SAchim Leubner ossaHwRegReadExt(agRoot, PCIBAR0,V_Scratchpad_3_Register) ));
360*4e1bc9a0SAchim Leubner ossaDisableInterrupts(agRoot, interruptVectorIndex);
361*4e1bc9a0SAchim Leubner return AGSA_RC_FAILURE;
362*4e1bc9a0SAchim Leubner }
363*4e1bc9a0SAchim Leubner
364*4e1bc9a0SAchim Leubner ret = siFatalInterruptHandler(agRoot,interruptVectorIndex);
365*4e1bc9a0SAchim Leubner
366*4e1bc9a0SAchim Leubner
367*4e1bc9a0SAchim Leubner ossaDisableInterrupts(agRoot, interruptVectorIndex);
368*4e1bc9a0SAchim Leubner
369*4e1bc9a0SAchim Leubner return ret;
370*4e1bc9a0SAchim Leubner }
371*4e1bc9a0SAchim Leubner /******************************************************************************/
372*4e1bc9a0SAchim Leubner /*! \brief Function to process the interrupts
373*4e1bc9a0SAchim Leubner *
374*4e1bc9a0SAchim Leubner * The saInterruptHandler() function is called after an interrupts has
375*4e1bc9a0SAchim Leubner * been received
376*4e1bc9a0SAchim Leubner * This function disables interrupts
377*4e1bc9a0SAchim Leubner *
378*4e1bc9a0SAchim Leubner * \param agRoot OS Layer-specific and LL Layer-specific context handles for this
379*4e1bc9a0SAchim Leubner * instance of SAS/SATA hardware
380*4e1bc9a0SAchim Leubner * \param interruptVectorIndex message that caused MSI message
381*4e1bc9a0SAchim Leubner *
382*4e1bc9a0SAchim Leubner * \return TRUE if we caused interrupt
383*4e1bc9a0SAchim Leubner *
384*4e1bc9a0SAchim Leubner */
385*4e1bc9a0SAchim Leubner /*******************************************************************************/
386*4e1bc9a0SAchim Leubner FORCEINLINE bit32
saInterruptHandler(agsaRoot_t * agRoot,bit32 interruptVectorIndex)387*4e1bc9a0SAchim Leubner saInterruptHandler(
388*4e1bc9a0SAchim Leubner agsaRoot_t *agRoot,
389*4e1bc9a0SAchim Leubner bit32 interruptVectorIndex
390*4e1bc9a0SAchim Leubner )
391*4e1bc9a0SAchim Leubner {
392*4e1bc9a0SAchim Leubner agsaLLRoot_t *saRoot = (agsaLLRoot_t *)(agRoot->sdkData);
393*4e1bc9a0SAchim Leubner bit32 ToBeProcessedCount = 0;
394*4e1bc9a0SAchim Leubner bit32 our_int = 0;
395*4e1bc9a0SAchim Leubner #ifdef SA_TEST_FW_SPURIOUS_INT
396*4e1bc9a0SAchim Leubner bit8 i;
397*4e1bc9a0SAchim Leubner #endif/* SA_TEST_FW_SPURIOUS_INT */
398*4e1bc9a0SAchim Leubner
399*4e1bc9a0SAchim Leubner if( agNULL == saRoot )
400*4e1bc9a0SAchim Leubner {
401*4e1bc9a0SAchim Leubner /* Can be called before initialize is completed in a shared
402*4e1bc9a0SAchim Leubner interrupt environment like windows 2003
403*4e1bc9a0SAchim Leubner */
404*4e1bc9a0SAchim Leubner return(ToBeProcessedCount);
405*4e1bc9a0SAchim Leubner }
406*4e1bc9a0SAchim Leubner
407*4e1bc9a0SAchim Leubner if( (our_int = saRoot->OurInterrupt(agRoot,interruptVectorIndex)) == FALSE )
408*4e1bc9a0SAchim Leubner {
409*4e1bc9a0SAchim Leubner #ifdef SA_TEST_FW_SPURIOUS_INT
410*4e1bc9a0SAchim Leubner gSpuriousIntCount++;
411*4e1bc9a0SAchim Leubner smTrace(hpDBG_REGISTERS,"S1",gSpuriousIntCount);
412*4e1bc9a0SAchim Leubner /* TP:S1 gSpuriousIntCount */
413*4e1bc9a0SAchim Leubner #endif /* SA_TEST_FW_SPURIOUS_INT */
414*4e1bc9a0SAchim Leubner return(ToBeProcessedCount);
415*4e1bc9a0SAchim Leubner }
416*4e1bc9a0SAchim Leubner
417*4e1bc9a0SAchim Leubner smTraceFuncEnter(hpDBG_TICK_INT, "5q");
418*4e1bc9a0SAchim Leubner
419*4e1bc9a0SAchim Leubner smTrace(hpDBG_TICK_INT,"VI",interruptVectorIndex);
420*4e1bc9a0SAchim Leubner /* TP:Vi interrupt VectorIndex */
421*4e1bc9a0SAchim Leubner
422*4e1bc9a0SAchim Leubner if ( agFALSE == saRoot->sysIntsActive )
423*4e1bc9a0SAchim Leubner {
424*4e1bc9a0SAchim Leubner // SA_ASSERT(0, "saInterruptHandler sysIntsActive not set");
425*4e1bc9a0SAchim Leubner
426*4e1bc9a0SAchim Leubner #ifdef SA_PRINTOUT_IN_WINDBG
427*4e1bc9a0SAchim Leubner #ifndef DBG
428*4e1bc9a0SAchim Leubner DbgPrint("saInterruptHandler: sysIntsActive not set Doorbell_Mask_Set %08X U %08X\n",
429*4e1bc9a0SAchim Leubner ossaHwRegReadExt(agRoot, PCIBAR0, V_Outbound_Doorbell_Mask_Set_Register),
430*4e1bc9a0SAchim Leubner ossaHwRegReadExt(agRoot, PCIBAR0, V_Outbound_Doorbell_Mask_Set_RegisterU) );
431*4e1bc9a0SAchim Leubner #endif /* DBG */
432*4e1bc9a0SAchim Leubner #endif /* SA_PRINTOUT_IN_WINDBG */
433*4e1bc9a0SAchim Leubner
434*4e1bc9a0SAchim Leubner
435*4e1bc9a0SAchim Leubner SA_DBG1(("saInterruptHandler: Doorbell_Mask_Set %08X U %08X\n",
436*4e1bc9a0SAchim Leubner ossaHwRegReadExt(agRoot, PCIBAR0, V_Outbound_Doorbell_Mask_Set_Register),
437*4e1bc9a0SAchim Leubner ossaHwRegReadExt(agRoot, PCIBAR0, V_Outbound_Doorbell_Mask_Set_RegisterU)));
438*4e1bc9a0SAchim Leubner ossaDisableInterrupts(agRoot, interruptVectorIndex);
439*4e1bc9a0SAchim Leubner return(ToBeProcessedCount);
440*4e1bc9a0SAchim Leubner
441*4e1bc9a0SAchim Leubner }
442*4e1bc9a0SAchim Leubner
443*4e1bc9a0SAchim Leubner /* Allow replacement of disable interrupt */
444*4e1bc9a0SAchim Leubner ossaDisableInterrupts(agRoot, interruptVectorIndex);
445*4e1bc9a0SAchim Leubner
446*4e1bc9a0SAchim Leubner
447*4e1bc9a0SAchim Leubner #ifdef SA_TEST_FW_SPURIOUS_INT
448*4e1bc9a0SAchim Leubner
449*4e1bc9a0SAchim Leubner /* count for my interrupt */
450*4e1bc9a0SAchim Leubner gOurIntCount++;
451*4e1bc9a0SAchim Leubner
452*4e1bc9a0SAchim Leubner smTrace(hpDBG_REGISTERS,"S4",gOurIntCount);
453*4e1bc9a0SAchim Leubner /* TP:S4 gOurIntCount */
454*4e1bc9a0SAchim Leubner #endif /* SA_TEST_FW_SPURIOUS_INT */
455*4e1bc9a0SAchim Leubner
456*4e1bc9a0SAchim Leubner smTraceFuncExit(hpDBG_TICK_INT, 'a', "5q");
457*4e1bc9a0SAchim Leubner return(TRUE);
458*4e1bc9a0SAchim Leubner
459*4e1bc9a0SAchim Leubner }
460*4e1bc9a0SAchim Leubner
461*4e1bc9a0SAchim Leubner /******************************************************************************/
462*4e1bc9a0SAchim Leubner /*! \brief Function to disable MSIX interrupts
463*4e1bc9a0SAchim Leubner *
464*4e1bc9a0SAchim Leubner * siDisableMSIXInterrupts disables interrupts
465*4e1bc9a0SAchim Leubner * called thru macro ossaDisableInterrupts
466*4e1bc9a0SAchim Leubner * \param agRoot OS Layer-specific and LL Layer-specific context handles for this
467*4e1bc9a0SAchim Leubner * instance of SAS/SATA hardware
468*4e1bc9a0SAchim Leubner * \param interruptVectorIndex - vector index for message
469*4e1bc9a0SAchim Leubner *
470*4e1bc9a0SAchim Leubner */
471*4e1bc9a0SAchim Leubner /*******************************************************************************/
siDisableMSIXInterrupts(agsaRoot_t * agRoot,bit32 interruptVectorIndex)472*4e1bc9a0SAchim Leubner GLOBAL void siDisableMSIXInterrupts(
473*4e1bc9a0SAchim Leubner agsaRoot_t *agRoot,
474*4e1bc9a0SAchim Leubner bit32 interruptVectorIndex
475*4e1bc9a0SAchim Leubner )
476*4e1bc9a0SAchim Leubner {
477*4e1bc9a0SAchim Leubner bit32 msi_index;
478*4e1bc9a0SAchim Leubner #ifndef SA_CLEAR_ODCR_IN_INTERRUPT
479*4e1bc9a0SAchim Leubner bit32 value;
480*4e1bc9a0SAchim Leubner #endif /* SA_CLEAR_ODCR_IN_INTERRUPT */
481*4e1bc9a0SAchim Leubner msi_index = interruptVectorIndex * MSIX_TABLE_ELEMENT_SIZE;
482*4e1bc9a0SAchim Leubner msi_index += MSIX_TABLE_BASE;
483*4e1bc9a0SAchim Leubner ossaHwRegWrite(agRoot,msi_index , MSIX_INTERRUPT_DISABLE);
484*4e1bc9a0SAchim Leubner ossaHwRegRead(agRoot, msi_index); /* Dummy read */
485*4e1bc9a0SAchim Leubner #ifndef SA_CLEAR_ODCR_IN_INTERRUPT
486*4e1bc9a0SAchim Leubner value = (1 << interruptVectorIndex);
487*4e1bc9a0SAchim Leubner ossaHwRegWrite(agRoot, MSGU_ODCR, value);
488*4e1bc9a0SAchim Leubner #endif /* SA_CLEAR_ODCR_IN_INTERRUPT */
489*4e1bc9a0SAchim Leubner }
490*4e1bc9a0SAchim Leubner
491*4e1bc9a0SAchim Leubner /******************************************************************************/
492*4e1bc9a0SAchim Leubner /*! \brief Function to disable MSIX V interrupts
493*4e1bc9a0SAchim Leubner *
494*4e1bc9a0SAchim Leubner * siDisableMSIXInterrupts disables interrupts
495*4e1bc9a0SAchim Leubner * called thru macro ossaDisableInterrupts
496*4e1bc9a0SAchim Leubner * \param agRoot OS Layer-specific and LL Layer-specific context handles for this
497*4e1bc9a0SAchim Leubner * instance of SAS/SATA hardware
498*4e1bc9a0SAchim Leubner * \param interruptVectorIndex - vector index for message
499*4e1bc9a0SAchim Leubner *
500*4e1bc9a0SAchim Leubner */
501*4e1bc9a0SAchim Leubner /*******************************************************************************/
siDisableMSIX_V_Interrupts(agsaRoot_t * agRoot,bit32 interruptVectorIndex)502*4e1bc9a0SAchim Leubner void siDisableMSIX_V_Interrupts(
503*4e1bc9a0SAchim Leubner agsaRoot_t *agRoot,
504*4e1bc9a0SAchim Leubner bit32 interruptVectorIndex
505*4e1bc9a0SAchim Leubner )
506*4e1bc9a0SAchim Leubner {
507*4e1bc9a0SAchim Leubner bit64 mask;
508*4e1bc9a0SAchim Leubner agsabit32bit64 u64;
509*4e1bc9a0SAchim Leubner mask =( (bit64)1 << interruptVectorIndex);
510*4e1bc9a0SAchim Leubner u64.B64 = mask;
511*4e1bc9a0SAchim Leubner if(smIS64bInt(agRoot))
512*4e1bc9a0SAchim Leubner {
513*4e1bc9a0SAchim Leubner SA_DBG4(("siDisableMSIX_V_Interrupts: VI %d U 0x%08X L 0x%08X\n",interruptVectorIndex,u64.S32[1],u64.S32[0]));
514*4e1bc9a0SAchim Leubner ossaHwRegWriteExt(agRoot, PCIBAR0,V_Outbound_Doorbell_Mask_Set_RegisterU,u64.S32[1]);
515*4e1bc9a0SAchim Leubner }
516*4e1bc9a0SAchim Leubner ossaHwRegWriteExt(agRoot, PCIBAR0,V_Outbound_Doorbell_Mask_Set_Register, u64.S32[0]);
517*4e1bc9a0SAchim Leubner
518*4e1bc9a0SAchim Leubner }
519*4e1bc9a0SAchim Leubner /******************************************************************************/
520*4e1bc9a0SAchim Leubner /*! \brief Function to disable MSI interrupts
521*4e1bc9a0SAchim Leubner *
522*4e1bc9a0SAchim Leubner * siDisableMSIInterrupts disables interrupts
523*4e1bc9a0SAchim Leubner * called thru macro ossaDisableInterrupts
524*4e1bc9a0SAchim Leubner * \param agRoot OS Layer-specific and LL Layer-specific context handles for this
525*4e1bc9a0SAchim Leubner * instance of SAS/SATA hardware
526*4e1bc9a0SAchim Leubner * \param interruptVectorIndex - vector index for message
527*4e1bc9a0SAchim Leubner *
528*4e1bc9a0SAchim Leubner */
529*4e1bc9a0SAchim Leubner /*******************************************************************************/
siDisableMSIInterrupts(agsaRoot_t * agRoot,bit32 interruptVectorIndex)530*4e1bc9a0SAchim Leubner GLOBAL void siDisableMSIInterrupts(
531*4e1bc9a0SAchim Leubner agsaRoot_t *agRoot,
532*4e1bc9a0SAchim Leubner bit32 interruptVectorIndex
533*4e1bc9a0SAchim Leubner )
534*4e1bc9a0SAchim Leubner {
535*4e1bc9a0SAchim Leubner bit32 ODMRValue;
536*4e1bc9a0SAchim Leubner bit32 mask;
537*4e1bc9a0SAchim Leubner mask = 1 << interruptVectorIndex;
538*4e1bc9a0SAchim Leubner
539*4e1bc9a0SAchim Leubner /*Must be protected for interuption */
540*4e1bc9a0SAchim Leubner ODMRValue = ossaHwRegRead(agRoot, MSGU_ODMR);
541*4e1bc9a0SAchim Leubner ODMRValue |= mask;
542*4e1bc9a0SAchim Leubner
543*4e1bc9a0SAchim Leubner ossaHwRegWrite(agRoot, MSGU_ODMR, ODMRValue);
544*4e1bc9a0SAchim Leubner ossaHwRegWrite(agRoot, MSGU_ODCR, mask);
545*4e1bc9a0SAchim Leubner }
546*4e1bc9a0SAchim Leubner
547*4e1bc9a0SAchim Leubner /******************************************************************************/
548*4e1bc9a0SAchim Leubner /*! \brief Function to disable MSI V interrupts
549*4e1bc9a0SAchim Leubner *
550*4e1bc9a0SAchim Leubner * siDisableMSIInterrupts disables interrupts
551*4e1bc9a0SAchim Leubner * called thru macro ossaDisableInterrupts
552*4e1bc9a0SAchim Leubner * \param agRoot OS Layer-specific and LL Layer-specific context handles for this
553*4e1bc9a0SAchim Leubner * instance of SAS/SATA hardware
554*4e1bc9a0SAchim Leubner * \param interruptVectorIndex - vector index for message
555*4e1bc9a0SAchim Leubner *
556*4e1bc9a0SAchim Leubner */
557*4e1bc9a0SAchim Leubner /*******************************************************************************/
siDisableMSI_V_Interrupts(agsaRoot_t * agRoot,bit32 interruptVectorIndex)558*4e1bc9a0SAchim Leubner GLOBAL void siDisableMSI_V_Interrupts(
559*4e1bc9a0SAchim Leubner agsaRoot_t *agRoot,
560*4e1bc9a0SAchim Leubner bit32 interruptVectorIndex
561*4e1bc9a0SAchim Leubner )
562*4e1bc9a0SAchim Leubner {
563*4e1bc9a0SAchim Leubner SA_ASSERT(0, "Should not be called");
564*4e1bc9a0SAchim Leubner SA_DBG4(("siDisableMSI_V_Interrupts:\n"));
565*4e1bc9a0SAchim Leubner }
566*4e1bc9a0SAchim Leubner
567*4e1bc9a0SAchim Leubner /******************************************************************************/
568*4e1bc9a0SAchim Leubner /*! \brief Function to process Legacy interrupts
569*4e1bc9a0SAchim Leubner *
570*4e1bc9a0SAchim Leubner * siDisableLegacyInterrupts disables interrupts
571*4e1bc9a0SAchim Leubner * called thru macro ossaDisableInterrupts
572*4e1bc9a0SAchim Leubner *
573*4e1bc9a0SAchim Leubner * \param agRoot OS Layer-specific and LL Layer-specific context handles for this
574*4e1bc9a0SAchim Leubner * instance of SAS/SATA hardware
575*4e1bc9a0SAchim Leubner * \param interruptVectorIndex not used in legacy case
576*4e1bc9a0SAchim Leubner *
577*4e1bc9a0SAchim Leubner */
578*4e1bc9a0SAchim Leubner /*******************************************************************************/
siDisableLegacyInterrupts(agsaRoot_t * agRoot,bit32 interruptVectorIndex)579*4e1bc9a0SAchim Leubner GLOBAL void siDisableLegacyInterrupts(
580*4e1bc9a0SAchim Leubner agsaRoot_t *agRoot,
581*4e1bc9a0SAchim Leubner bit32 interruptVectorIndex
582*4e1bc9a0SAchim Leubner )
583*4e1bc9a0SAchim Leubner {
584*4e1bc9a0SAchim Leubner ossaHwRegWrite(agRoot, MSGU_ODMR, ODMR_MASK_ALL);
585*4e1bc9a0SAchim Leubner #ifndef SA_CLEAR_ODCR_IN_INTERRUPT
586*4e1bc9a0SAchim Leubner ossaHwRegWrite(agRoot, MSGU_ODCR, ODCR_CLEAR_ALL);
587*4e1bc9a0SAchim Leubner #endif /* SA_CLEAR_ODCR_IN_INTERRUPT */
588*4e1bc9a0SAchim Leubner }
589*4e1bc9a0SAchim Leubner
590*4e1bc9a0SAchim Leubner /******************************************************************************/
591*4e1bc9a0SAchim Leubner /*! \brief Function to process Legacy V interrupts
592*4e1bc9a0SAchim Leubner *
593*4e1bc9a0SAchim Leubner * siDisableLegacyInterrupts disables interrupts
594*4e1bc9a0SAchim Leubner * called thru macro ossaDisableInterrupts
595*4e1bc9a0SAchim Leubner *
596*4e1bc9a0SAchim Leubner * \param agRoot OS Layer-specific and LL Layer-specific context handles for this
597*4e1bc9a0SAchim Leubner * instance of SAS/SATA hardware
598*4e1bc9a0SAchim Leubner * \param interruptVectorIndex not used in legacy case
599*4e1bc9a0SAchim Leubner *
600*4e1bc9a0SAchim Leubner */
601*4e1bc9a0SAchim Leubner /*******************************************************************************/
siDisableLegacy_V_Interrupts(agsaRoot_t * agRoot,bit32 interruptVectorIndex)602*4e1bc9a0SAchim Leubner GLOBAL void siDisableLegacy_V_Interrupts(
603*4e1bc9a0SAchim Leubner agsaRoot_t *agRoot,
604*4e1bc9a0SAchim Leubner bit32 interruptVectorIndex
605*4e1bc9a0SAchim Leubner )
606*4e1bc9a0SAchim Leubner {
607*4e1bc9a0SAchim Leubner
608*4e1bc9a0SAchim Leubner bit64 mask;
609*4e1bc9a0SAchim Leubner agsabit32bit64 u64;
610*4e1bc9a0SAchim Leubner mask =( (bit64)1 << interruptVectorIndex);
611*4e1bc9a0SAchim Leubner u64.B64 = mask;
612*4e1bc9a0SAchim Leubner
613*4e1bc9a0SAchim Leubner SA_DBG4(("siDisableLegacy_V_Interrupts:IN MSGU_READ_ODR %08X\n",siHalRegReadExt(agRoot, GEN_MSGU_ODR, V_Outbound_Doorbell_Set_Register)));
614*4e1bc9a0SAchim Leubner SA_DBG4(("siDisableLegacy_V_Interrupts:IN MSGU_READ_ODMR %08X\n",siHalRegReadExt(agRoot, GEN_MSGU_ODMR, V_Outbound_Doorbell_Mask_Set_Register )));
615*4e1bc9a0SAchim Leubner if(smIS64bInt(agRoot))
616*4e1bc9a0SAchim Leubner {
617*4e1bc9a0SAchim Leubner SA_DBG4(("siDisableLegacy_V_Interrupts: VI %d U 0x%08X L 0x%08X\n",interruptVectorIndex,u64.S32[1],u64.S32[0]));
618*4e1bc9a0SAchim Leubner ossaHwRegWriteExt(agRoot, PCIBAR0,V_Outbound_Doorbell_Mask_Set_Register,u64.S32[1] );
619*4e1bc9a0SAchim Leubner }
620*4e1bc9a0SAchim Leubner ossaHwRegWriteExt(agRoot, PCIBAR0,V_Outbound_Doorbell_Mask_Set_RegisterU,u64.S32[0]);
621*4e1bc9a0SAchim Leubner
622*4e1bc9a0SAchim Leubner }
623*4e1bc9a0SAchim Leubner /******************************************************************************/
624*4e1bc9a0SAchim Leubner /*! \brief Function to process MSIX interrupts
625*4e1bc9a0SAchim Leubner *
626*4e1bc9a0SAchim Leubner * siOurMSIXInterrupt checks if we generated interrupt
627*4e1bc9a0SAchim Leubner * called thru function pointer saRoot->OurInterrupt
628*4e1bc9a0SAchim Leubner *
629*4e1bc9a0SAchim Leubner * \param agRoot OS Layer-specific and LL Layer-specific context handles for this
630*4e1bc9a0SAchim Leubner * instance of SAS/SATA hardware
631*4e1bc9a0SAchim Leubner * \return always true
632*4e1bc9a0SAchim Leubner */
633*4e1bc9a0SAchim Leubner /*******************************************************************************/
siOurMSIXInterrupt(agsaRoot_t * agRoot,bit32 interruptVectorIndex)634*4e1bc9a0SAchim Leubner GLOBAL bit32 siOurMSIXInterrupt(
635*4e1bc9a0SAchim Leubner agsaRoot_t *agRoot,
636*4e1bc9a0SAchim Leubner bit32 interruptVectorIndex
637*4e1bc9a0SAchim Leubner )
638*4e1bc9a0SAchim Leubner {
639*4e1bc9a0SAchim Leubner return(TRUE);
640*4e1bc9a0SAchim Leubner }
641*4e1bc9a0SAchim Leubner
642*4e1bc9a0SAchim Leubner /******************************************************************************/
643*4e1bc9a0SAchim Leubner /*! \brief Function to process MSIX V interrupts
644*4e1bc9a0SAchim Leubner *
645*4e1bc9a0SAchim Leubner * siOurMSIXInterrupt checks if we generated interrupt
646*4e1bc9a0SAchim Leubner * called thru function pointer saRoot->OurInterrupt
647*4e1bc9a0SAchim Leubner *
648*4e1bc9a0SAchim Leubner * \param agRoot OS Layer-specific and LL Layer-specific context handles for this
649*4e1bc9a0SAchim Leubner * instance of SAS/SATA hardware
650*4e1bc9a0SAchim Leubner * \return always true
651*4e1bc9a0SAchim Leubner */
652*4e1bc9a0SAchim Leubner /*******************************************************************************/
siOurMSIX_V_Interrupt(agsaRoot_t * agRoot,bit32 interruptVectorIndex)653*4e1bc9a0SAchim Leubner GLOBAL bit32 siOurMSIX_V_Interrupt(
654*4e1bc9a0SAchim Leubner agsaRoot_t *agRoot,
655*4e1bc9a0SAchim Leubner bit32 interruptVectorIndex
656*4e1bc9a0SAchim Leubner )
657*4e1bc9a0SAchim Leubner {
658*4e1bc9a0SAchim Leubner return(TRUE);
659*4e1bc9a0SAchim Leubner }
660*4e1bc9a0SAchim Leubner /******************************************************************************/
661*4e1bc9a0SAchim Leubner /*! \brief Function to process MSI interrupts
662*4e1bc9a0SAchim Leubner *
663*4e1bc9a0SAchim Leubner * siOurMSIInterrupt checks if we generated interrupt
664*4e1bc9a0SAchim Leubner * called thru function pointer saRoot->OurInterrupt
665*4e1bc9a0SAchim Leubner *
666*4e1bc9a0SAchim Leubner * \param agRoot OS Layer-specific and LL Layer-specific context handles for this
667*4e1bc9a0SAchim Leubner * instance of SAS/SATA hardware
668*4e1bc9a0SAchim Leubner * \return always true
669*4e1bc9a0SAchim Leubner */
670*4e1bc9a0SAchim Leubner /*******************************************************************************/
siOurMSIInterrupt(agsaRoot_t * agRoot,bit32 interruptVectorIndex)671*4e1bc9a0SAchim Leubner bit32 siOurMSIInterrupt(
672*4e1bc9a0SAchim Leubner agsaRoot_t *agRoot,
673*4e1bc9a0SAchim Leubner bit32 interruptVectorIndex
674*4e1bc9a0SAchim Leubner )
675*4e1bc9a0SAchim Leubner {
676*4e1bc9a0SAchim Leubner return(TRUE);
677*4e1bc9a0SAchim Leubner }
678*4e1bc9a0SAchim Leubner
679*4e1bc9a0SAchim Leubner /******************************************************************************/
680*4e1bc9a0SAchim Leubner /*! \brief Function to process MSI V interrupts
681*4e1bc9a0SAchim Leubner *
682*4e1bc9a0SAchim Leubner * siOurMSIInterrupt checks if we generated interrupt
683*4e1bc9a0SAchim Leubner * called thru function pointer saRoot->OurInterrupt
684*4e1bc9a0SAchim Leubner *
685*4e1bc9a0SAchim Leubner * \param agRoot OS Layer-specific and LL Layer-specific context handles for this
686*4e1bc9a0SAchim Leubner * instance of SAS/SATA hardware
687*4e1bc9a0SAchim Leubner * \return always true
688*4e1bc9a0SAchim Leubner */
689*4e1bc9a0SAchim Leubner /*******************************************************************************/
siOurMSI_V_Interrupt(agsaRoot_t * agRoot,bit32 interruptVectorIndex)690*4e1bc9a0SAchim Leubner bit32 siOurMSI_V_Interrupt(
691*4e1bc9a0SAchim Leubner agsaRoot_t *agRoot,
692*4e1bc9a0SAchim Leubner bit32 interruptVectorIndex
693*4e1bc9a0SAchim Leubner )
694*4e1bc9a0SAchim Leubner {
695*4e1bc9a0SAchim Leubner SA_DBG4((":siOurMSI_V_Interrupt\n"));
696*4e1bc9a0SAchim Leubner return(TRUE);
697*4e1bc9a0SAchim Leubner }
698*4e1bc9a0SAchim Leubner
699*4e1bc9a0SAchim Leubner /******************************************************************************/
700*4e1bc9a0SAchim Leubner /*! \brief Function to process Legacy interrupts
701*4e1bc9a0SAchim Leubner *
702*4e1bc9a0SAchim Leubner * siOurLegacyInterrupt checks if we generated interrupt
703*4e1bc9a0SAchim Leubner * called thru function pointer saRoot->OurInterrupt
704*4e1bc9a0SAchim Leubner *
705*4e1bc9a0SAchim Leubner * \param agRoot OS Layer-specific and LL Layer-specific context handles for this
706*4e1bc9a0SAchim Leubner * instance of SAS/SATA hardware
707*4e1bc9a0SAchim Leubner * \return true if we claim interrupt
708*4e1bc9a0SAchim Leubner */
709*4e1bc9a0SAchim Leubner /*******************************************************************************/
siOurLegacyInterrupt(agsaRoot_t * agRoot,bit32 interruptVectorIndex)710*4e1bc9a0SAchim Leubner bit32 siOurLegacyInterrupt(
711*4e1bc9a0SAchim Leubner agsaRoot_t *agRoot,
712*4e1bc9a0SAchim Leubner bit32 interruptVectorIndex
713*4e1bc9a0SAchim Leubner )
714*4e1bc9a0SAchim Leubner {
715*4e1bc9a0SAchim Leubner bit32 Int_masked;
716*4e1bc9a0SAchim Leubner bit32 Int_active;
717*4e1bc9a0SAchim Leubner Int_masked = MSGU_READ_ODMR;
718*4e1bc9a0SAchim Leubner Int_active = MSGU_READ_ODR;
719*4e1bc9a0SAchim Leubner
720*4e1bc9a0SAchim Leubner if(Int_masked & 1 )
721*4e1bc9a0SAchim Leubner {
722*4e1bc9a0SAchim Leubner return(FALSE);
723*4e1bc9a0SAchim Leubner }
724*4e1bc9a0SAchim Leubner if(Int_active & 1 )
725*4e1bc9a0SAchim Leubner {
726*4e1bc9a0SAchim Leubner
727*4e1bc9a0SAchim Leubner return(TRUE);
728*4e1bc9a0SAchim Leubner }
729*4e1bc9a0SAchim Leubner return(FALSE);
730*4e1bc9a0SAchim Leubner }
731*4e1bc9a0SAchim Leubner
732*4e1bc9a0SAchim Leubner /******************************************************************************/
733*4e1bc9a0SAchim Leubner /*! \brief Function to process Legacy V interrupts
734*4e1bc9a0SAchim Leubner *
735*4e1bc9a0SAchim Leubner * siOurLegacyInterrupt checks if we generated interrupt
736*4e1bc9a0SAchim Leubner * called thru function pointer saRoot->OurInterrupt
737*4e1bc9a0SAchim Leubner *
738*4e1bc9a0SAchim Leubner * \param agRoot OS Layer-specific and LL Layer-specific context handles for this
739*4e1bc9a0SAchim Leubner * instance of SAS/SATA hardware
740*4e1bc9a0SAchim Leubner * \return true if we claim interrupt
741*4e1bc9a0SAchim Leubner */
742*4e1bc9a0SAchim Leubner /*******************************************************************************/
siOurLegacy_V_Interrupt(agsaRoot_t * agRoot,bit32 interruptVectorIndex)743*4e1bc9a0SAchim Leubner bit32 siOurLegacy_V_Interrupt(
744*4e1bc9a0SAchim Leubner agsaRoot_t *agRoot,
745*4e1bc9a0SAchim Leubner bit32 interruptVectorIndex
746*4e1bc9a0SAchim Leubner )
747*4e1bc9a0SAchim Leubner {
748*4e1bc9a0SAchim Leubner bit32 Int_active;
749*4e1bc9a0SAchim Leubner Int_active = siHalRegReadExt(agRoot, GEN_MSGU_ODR, V_Outbound_Doorbell_Set_Register );
750*4e1bc9a0SAchim Leubner
751*4e1bc9a0SAchim Leubner return(Int_active ? TRUE : FALSE);
752*4e1bc9a0SAchim Leubner }
753*4e1bc9a0SAchim Leubner
754*4e1bc9a0SAchim Leubner
755*4e1bc9a0SAchim Leubner /******************************************************************************/
756*4e1bc9a0SAchim Leubner /*! \brief Function to process the cause of interrupt
757*4e1bc9a0SAchim Leubner *
758*4e1bc9a0SAchim Leubner * The saDelayedInterruptHandler() function is called after an interrupt messages has
759*4e1bc9a0SAchim Leubner * been received it may be called by a deferred procedure call
760*4e1bc9a0SAchim Leubner *
761*4e1bc9a0SAchim Leubner * \param agRoot OS Layer-specific and LL Layer-specific context handles for this
762*4e1bc9a0SAchim Leubner * instance of SAS/SATA hardware
763*4e1bc9a0SAchim Leubner * \param interruptVectorIndex - vector index for message
764*4e1bc9a0SAchim Leubner * \param count Number of completion queue entries to consume
765*4e1bc9a0SAchim Leubner *
766*4e1bc9a0SAchim Leubner * \return number of messages processed
767*4e1bc9a0SAchim Leubner *
768*4e1bc9a0SAchim Leubner */
769*4e1bc9a0SAchim Leubner /*******************************************************************************/
770*4e1bc9a0SAchim Leubner FORCEINLINE bit32
saDelayedInterruptHandler(agsaRoot_t * agRoot,bit32 interruptVectorIndex,bit32 count)771*4e1bc9a0SAchim Leubner saDelayedInterruptHandler(
772*4e1bc9a0SAchim Leubner agsaRoot_t *agRoot,
773*4e1bc9a0SAchim Leubner bit32 interruptVectorIndex,
774*4e1bc9a0SAchim Leubner bit32 count
775*4e1bc9a0SAchim Leubner )
776*4e1bc9a0SAchim Leubner {
777*4e1bc9a0SAchim Leubner agsaLLRoot_t *saRoot = (agsaLLRoot_t *)(agRoot->sdkData);
778*4e1bc9a0SAchim Leubner bit32 processedMsgCount = 0;
779*4e1bc9a0SAchim Leubner bit32 pad1 = 0;
780*4e1bc9a0SAchim Leubner bit32 host_reg0 = 0;
781*4e1bc9a0SAchim Leubner #if defined(SALLSDK_DEBUG)
782*4e1bc9a0SAchim Leubner bit32 host_reg1 = 0;
783*4e1bc9a0SAchim Leubner #endif
784*4e1bc9a0SAchim Leubner bit8 i = 0;
785*4e1bc9a0SAchim Leubner
786*4e1bc9a0SAchim Leubner OSSA_OUT_ENTER(agRoot);
787*4e1bc9a0SAchim Leubner
788*4e1bc9a0SAchim Leubner smTraceFuncEnter(hpDBG_VERY_LOUD,"5p");
789*4e1bc9a0SAchim Leubner
790*4e1bc9a0SAchim Leubner smTrace(hpDBG_VERY_LOUD,"Vd",interruptVectorIndex);
791*4e1bc9a0SAchim Leubner /* TP:Vd delayed VectorIndex */
792*4e1bc9a0SAchim Leubner smTrace(hpDBG_VERY_LOUD,"Vc",count);
793*4e1bc9a0SAchim Leubner /* TP:Vc IOMB count*/
794*4e1bc9a0SAchim Leubner
795*4e1bc9a0SAchim Leubner if( saRoot->swConfig.fatalErrorInterruptEnable &&
796*4e1bc9a0SAchim Leubner saRoot->swConfig.fatalErrorInterruptVector == interruptVectorIndex )
797*4e1bc9a0SAchim Leubner {
798*4e1bc9a0SAchim Leubner pad1 = siHalRegReadExt(agRoot,GEN_MSGU_SCRATCH_PAD_1, MSGU_SCRATCH_PAD_1);
799*4e1bc9a0SAchim Leubner host_reg0 = ossaHwRegReadExt(agRoot, PCIBAR0,V_Scratchpad_Rsvd_0_Register );
800*4e1bc9a0SAchim Leubner
801*4e1bc9a0SAchim Leubner
802*4e1bc9a0SAchim Leubner if(saRoot->swConfig.hostDirectAccessMode & 2 )
803*4e1bc9a0SAchim Leubner {
804*4e1bc9a0SAchim Leubner if( host_reg0 == HDA_AES_DIF_FUNC)
805*4e1bc9a0SAchim Leubner {
806*4e1bc9a0SAchim Leubner host_reg0 = 0;
807*4e1bc9a0SAchim Leubner }
808*4e1bc9a0SAchim Leubner }
809*4e1bc9a0SAchim Leubner
810*4e1bc9a0SAchim Leubner
811*4e1bc9a0SAchim Leubner #if defined(SALLSDK_DEBUG)
812*4e1bc9a0SAchim Leubner host_reg1 = ossaHwRegReadExt(agRoot, PCIBAR0,V_Scratchpad_Rsvd_1_Register );
813*4e1bc9a0SAchim Leubner #endif
814*4e1bc9a0SAchim Leubner if( (SCRATCH_PAD1_V_ERROR_STATE( pad1 ) != 0 ) && host_reg0 )
815*4e1bc9a0SAchim Leubner {
816*4e1bc9a0SAchim Leubner
817*4e1bc9a0SAchim Leubner SA_DBG1(("saDelayedInterruptHandler: vi %d Error %08X\n",interruptVectorIndex, SCRATCH_PAD1_V_ERROR_STATE( pad1 )));
818*4e1bc9a0SAchim Leubner SA_DBG1(("saDelayedInterruptHandler: Sp 1 %08X Hr0 %08X Hr1 %08X\n",pad1,host_reg0,host_reg1 ));
819*4e1bc9a0SAchim Leubner SA_DBG1(("saDelayedInterruptHandler: SCRATCH_PAD1_V_ERROR_STATE %08X\n", SCRATCH_PAD1_V_ERROR_STATE( pad1 )));
820*4e1bc9a0SAchim Leubner SA_DBG1(("saDelayedInterruptHandler: SCRATCH_PAD1_V_ILA_ERROR_STATE %08X\n", SCRATCH_PAD1_V_ILA_ERROR_STATE( pad1 )));
821*4e1bc9a0SAchim Leubner SA_DBG1(("saDelayedInterruptHandler: SCRATCH_PAD1_V_RAAE_ERROR_STATE %08X\n", SCRATCH_PAD1_V_RAAE_ERROR_STATE( pad1 )));
822*4e1bc9a0SAchim Leubner SA_DBG1(("saDelayedInterruptHandler: SCRATCH_PAD1_V_IOP0_ERROR_STATE %08X\n", SCRATCH_PAD1_V_IOP0_ERROR_STATE( pad1 )));
823*4e1bc9a0SAchim Leubner SA_DBG1(("saDelayedInterruptHandler: SCRATCH_PAD1_V_IOP1_ERROR_STATE %08X\n", SCRATCH_PAD1_V_IOP1_ERROR_STATE( pad1 )));
824*4e1bc9a0SAchim Leubner
825*4e1bc9a0SAchim Leubner siFatalInterruptHandler( agRoot, interruptVectorIndex );
826*4e1bc9a0SAchim Leubner ossaDisableInterrupts(agRoot, interruptVectorIndex);
827*4e1bc9a0SAchim Leubner
828*4e1bc9a0SAchim Leubner }
829*4e1bc9a0SAchim Leubner else
830*4e1bc9a0SAchim Leubner {
831*4e1bc9a0SAchim Leubner SA_DBG2(("saDelayedInterruptHandler: Fatal Check VI %d SCRATCH_PAD1 %08X host_reg0 %08X host_reg1 %08X\n",interruptVectorIndex, pad1,host_reg0,host_reg1));
832*4e1bc9a0SAchim Leubner SA_DBG2(("saDelayedInterruptHandler: ScratchPad0 0x%x ScratchPad1 0x%x\n",
833*4e1bc9a0SAchim Leubner ossaHwRegReadExt(agRoot, PCIBAR0,V_Scratchpad_0_Register),
834*4e1bc9a0SAchim Leubner ossaHwRegReadExt(agRoot, PCIBAR0,V_Scratchpad_1_Register) ));
835*4e1bc9a0SAchim Leubner SA_DBG2(("saDelayedInterruptHandler: ScratchPad2 0x%x ScratchPad3 0x%x\n",
836*4e1bc9a0SAchim Leubner ossaHwRegReadExt(agRoot, PCIBAR0,V_Scratchpad_2_Register),
837*4e1bc9a0SAchim Leubner ossaHwRegReadExt(agRoot, PCIBAR0,V_Scratchpad_3_Register) ));
838*4e1bc9a0SAchim Leubner
839*4e1bc9a0SAchim Leubner SA_DBG2(("saDelayedInterruptHandler: Doorbell_Set %08X U %08X\n",
840*4e1bc9a0SAchim Leubner ossaHwRegReadExt(agRoot, PCIBAR0, V_Outbound_Doorbell_Set_Register),
841*4e1bc9a0SAchim Leubner ossaHwRegReadExt(agRoot, PCIBAR0, V_Outbound_Doorbell_Set_RegisterU)));
842*4e1bc9a0SAchim Leubner SA_DBG2(("saDelayedInterruptHandler: Doorbell_Mask %08X U %08X\n",
843*4e1bc9a0SAchim Leubner ossaHwRegReadExt(agRoot, PCIBAR0, V_Outbound_Doorbell_Mask_Set_Register ),
844*4e1bc9a0SAchim Leubner ossaHwRegReadExt(agRoot, PCIBAR0, V_Outbound_Doorbell_Mask_Set_RegisterU )));
845*4e1bc9a0SAchim Leubner }
846*4e1bc9a0SAchim Leubner
847*4e1bc9a0SAchim Leubner }
848*4e1bc9a0SAchim Leubner
849*4e1bc9a0SAchim Leubner
850*4e1bc9a0SAchim Leubner #ifdef SA_LNX_PERF_MODE
851*4e1bc9a0SAchim Leubner return siProcessOBMsg(agRoot, count, interruptVectorIndex);
852*4e1bc9a0SAchim Leubner #endif
853*4e1bc9a0SAchim Leubner
854*4e1bc9a0SAchim Leubner /* check all the configuration outbound queues within a vector bitmap */
855*4e1bc9a0SAchim Leubner SA_ASSERT((saRoot->QueueConfig.numOutboundQueues < 65), "numOutboundQueue");
856*4e1bc9a0SAchim Leubner
857*4e1bc9a0SAchim Leubner for ( i = 0; i < saRoot->QueueConfig.numOutboundQueues; i++ )
858*4e1bc9a0SAchim Leubner {
859*4e1bc9a0SAchim Leubner /* process IOMB in the outbound queue 0 to 31 if bit set in the vector bitmap */
860*4e1bc9a0SAchim Leubner if (i < OQ_NUM_32)
861*4e1bc9a0SAchim Leubner {
862*4e1bc9a0SAchim Leubner if (saRoot->interruptVecIndexBitMap[interruptVectorIndex] & (1 << i))
863*4e1bc9a0SAchim Leubner {
864*4e1bc9a0SAchim Leubner processedMsgCount += siProcessOBMsg(agRoot, count, i);
865*4e1bc9a0SAchim Leubner }
866*4e1bc9a0SAchim Leubner else if (saRoot->QueueConfig.outboundQueues[i].interruptEnable == 0)
867*4e1bc9a0SAchim Leubner {
868*4e1bc9a0SAchim Leubner /* polling mode - interruptVectorIndex = 0 only and no bit set */
869*4e1bc9a0SAchim Leubner processedMsgCount += siProcessOBMsg(agRoot, count, i);
870*4e1bc9a0SAchim Leubner }
871*4e1bc9a0SAchim Leubner #ifdef SA_FW_TEST_INTERRUPT_REASSERT
872*4e1bc9a0SAchim Leubner else if (saRoot->CheckAll)
873*4e1bc9a0SAchim Leubner {
874*4e1bc9a0SAchim Leubner /* polling mode - interruptVectorIndex = 0 only and no bit set */
875*4e1bc9a0SAchim Leubner processedMsgCount += siProcessOBMsg(agRoot, count, i);
876*4e1bc9a0SAchim Leubner }
877*4e1bc9a0SAchim Leubner #endif /* SA_FW_TEST_INTERRUPT_REASSERT */
878*4e1bc9a0SAchim Leubner
879*4e1bc9a0SAchim Leubner }
880*4e1bc9a0SAchim Leubner else
881*4e1bc9a0SAchim Leubner {
882*4e1bc9a0SAchim Leubner /* process IOMB in the outbound queue 32 to 63 if bit set in the vector bitmap */
883*4e1bc9a0SAchim Leubner if (saRoot->interruptVecIndexBitMap1[interruptVectorIndex] & (1 << (i - OQ_NUM_32)))
884*4e1bc9a0SAchim Leubner {
885*4e1bc9a0SAchim Leubner processedMsgCount += siProcessOBMsg(agRoot, count, i);
886*4e1bc9a0SAchim Leubner }
887*4e1bc9a0SAchim Leubner /* check interruptEnable bit for polling mode of OQ */
888*4e1bc9a0SAchim Leubner /* the following code can be removed, we do not care about the bit */
889*4e1bc9a0SAchim Leubner else if (saRoot->QueueConfig.outboundQueues[i].interruptEnable == 0)
890*4e1bc9a0SAchim Leubner {
891*4e1bc9a0SAchim Leubner /* polling mode - interruptVectorIndex = 0 only and no bit set */
892*4e1bc9a0SAchim Leubner processedMsgCount += siProcessOBMsg(agRoot, count, i);
893*4e1bc9a0SAchim Leubner }
894*4e1bc9a0SAchim Leubner #ifdef SA_FW_TEST_INTERRUPT_REASSERT
895*4e1bc9a0SAchim Leubner else if (saRoot->CheckAll)
896*4e1bc9a0SAchim Leubner {
897*4e1bc9a0SAchim Leubner /* polling mode - interruptVectorIndex = 0 only and no bit set */
898*4e1bc9a0SAchim Leubner processedMsgCount += siProcessOBMsg(agRoot, count, i);
899*4e1bc9a0SAchim Leubner }
900*4e1bc9a0SAchim Leubner #endif /* SA_FW_TEST_INTERRUPT_REASSERT */
901*4e1bc9a0SAchim Leubner }
902*4e1bc9a0SAchim Leubner }
903*4e1bc9a0SAchim Leubner
904*4e1bc9a0SAchim Leubner #ifdef SA_FW_TEST_INTERRUPT_REASSERT
905*4e1bc9a0SAchim Leubner saRoot->CheckAll = 0;
906*4e1bc9a0SAchim Leubner #endif /* SA_FW_TEST_INTERRUPT_REASSERT */
907*4e1bc9a0SAchim Leubner
908*4e1bc9a0SAchim Leubner #ifndef SA_RENABLE_IN_OSLAYER
909*4e1bc9a0SAchim Leubner if ( agTRUE == saRoot->sysIntsActive )
910*4e1bc9a0SAchim Leubner {
911*4e1bc9a0SAchim Leubner /* Allow replacement of enable interrupt */
912*4e1bc9a0SAchim Leubner ossaReenableInterrupts(agRoot, interruptVectorIndex);
913*4e1bc9a0SAchim Leubner }
914*4e1bc9a0SAchim Leubner #endif /* SA_RENABLE_IN_OSLAYER */
915*4e1bc9a0SAchim Leubner
916*4e1bc9a0SAchim Leubner smTraceFuncExit(hpDBG_VERY_LOUD, 'a', "5p");
917*4e1bc9a0SAchim Leubner
918*4e1bc9a0SAchim Leubner OSSA_OUT_LEAVE(agRoot);
919*4e1bc9a0SAchim Leubner return processedMsgCount;
920*4e1bc9a0SAchim Leubner }
921*4e1bc9a0SAchim Leubner
922*4e1bc9a0SAchim Leubner /******************************************************************************/
923*4e1bc9a0SAchim Leubner /*! \brief Function to reenable MSIX interrupts
924*4e1bc9a0SAchim Leubner *
925*4e1bc9a0SAchim Leubner * siReenableMSIXInterrupts reenableinterrupts
926*4e1bc9a0SAchim Leubner * called thru macro ossaReenableInterrupts
927*4e1bc9a0SAchim Leubner *
928*4e1bc9a0SAchim Leubner * \param agRoot OS Layer-specific and LL Layer-specific context handles for this
929*4e1bc9a0SAchim Leubner * instance of SAS/SATA hardware
930*4e1bc9a0SAchim Leubner * \param interruptVectorIndex - vector index for message
931*4e1bc9a0SAchim Leubner *
932*4e1bc9a0SAchim Leubner */
933*4e1bc9a0SAchim Leubner /*******************************************************************************/
siReenableMSIXInterrupts(agsaRoot_t * agRoot,bit32 interruptVectorIndex)934*4e1bc9a0SAchim Leubner void siReenableMSIXInterrupts(
935*4e1bc9a0SAchim Leubner agsaRoot_t *agRoot,
936*4e1bc9a0SAchim Leubner bit32 interruptVectorIndex
937*4e1bc9a0SAchim Leubner )
938*4e1bc9a0SAchim Leubner {
939*4e1bc9a0SAchim Leubner bit32 msi_index;
940*4e1bc9a0SAchim Leubner #ifdef SA_CLEAR_ODCR_IN_INTERRUPT
941*4e1bc9a0SAchim Leubner bit32 value;
942*4e1bc9a0SAchim Leubner #endif /* SA_CLEAR_ODCR_IN_INTERRUPT */
943*4e1bc9a0SAchim Leubner msi_index = interruptVectorIndex * MSIX_TABLE_ELEMENT_SIZE;
944*4e1bc9a0SAchim Leubner msi_index += MSIX_TABLE_BASE;
945*4e1bc9a0SAchim Leubner ossaHwRegWriteExt(agRoot, PCIBAR0,msi_index, MSIX_INTERRUPT_ENABLE);
946*4e1bc9a0SAchim Leubner
947*4e1bc9a0SAchim Leubner SA_DBG4(("siReenableMSIXInterrupts:interruptVectorIndex %d\n",interruptVectorIndex));
948*4e1bc9a0SAchim Leubner
949*4e1bc9a0SAchim Leubner #ifdef SA_CLEAR_ODCR_IN_INTERRUPT
950*4e1bc9a0SAchim Leubner value = (1 << interruptVectorIndex);
951*4e1bc9a0SAchim Leubner siHalRegWriteExt(agRoot, GEN_MSGU_ODCR, MSGU_ODCR, value);
952*4e1bc9a0SAchim Leubner #endif /* SA_CLEAR_ODCR_IN_INTERRUPT */
953*4e1bc9a0SAchim Leubner }
954*4e1bc9a0SAchim Leubner /******************************************************************************/
955*4e1bc9a0SAchim Leubner /*! \brief Function to reenable MSIX interrupts
956*4e1bc9a0SAchim Leubner *
957*4e1bc9a0SAchim Leubner * siReenableMSIXInterrupts reenableinterrupts
958*4e1bc9a0SAchim Leubner * called thru macro ossaReenableInterrupts
959*4e1bc9a0SAchim Leubner *
960*4e1bc9a0SAchim Leubner * \param agRoot OS Layer-specific and LL Layer-specific context handles for this
961*4e1bc9a0SAchim Leubner * instance of SAS/SATA hardware
962*4e1bc9a0SAchim Leubner * \param interruptVectorIndex - vector index for message
963*4e1bc9a0SAchim Leubner *
964*4e1bc9a0SAchim Leubner */
965*4e1bc9a0SAchim Leubner /*******************************************************************************/
siReenableMSIX_V_Interrupts(agsaRoot_t * agRoot,bit32 interruptVectorIndex)966*4e1bc9a0SAchim Leubner void siReenableMSIX_V_Interrupts(
967*4e1bc9a0SAchim Leubner agsaRoot_t *agRoot,
968*4e1bc9a0SAchim Leubner bit32 interruptVectorIndex
969*4e1bc9a0SAchim Leubner )
970*4e1bc9a0SAchim Leubner {
971*4e1bc9a0SAchim Leubner agsaLLRoot_t *saRoot = (agsaLLRoot_t *)(agRoot->sdkData);
972*4e1bc9a0SAchim Leubner bit64 mask;
973*4e1bc9a0SAchim Leubner agsabit32bit64 u64;
974*4e1bc9a0SAchim Leubner mask =( (bit64)1 << interruptVectorIndex);
975*4e1bc9a0SAchim Leubner u64.B64 = mask;
976*4e1bc9a0SAchim Leubner
977*4e1bc9a0SAchim Leubner SA_DBG4(("siReenableMSIX_V_Interrupts:\n"));
978*4e1bc9a0SAchim Leubner
979*4e1bc9a0SAchim Leubner if(saRoot->sysIntsActive)
980*4e1bc9a0SAchim Leubner {
981*4e1bc9a0SAchim Leubner if(smIS64bInt(agRoot))
982*4e1bc9a0SAchim Leubner {
983*4e1bc9a0SAchim Leubner SA_DBG4(("siReenableMSIX_V_Interrupts: VI %d U 0x%08X L 0x%08X\n",interruptVectorIndex,u64.S32[1],u64.S32[0]));
984*4e1bc9a0SAchim Leubner ossaHwRegWriteExt(agRoot, PCIBAR0,V_Outbound_Doorbell_Mask_Clear_RegisterU,u64.S32[1] );
985*4e1bc9a0SAchim Leubner }
986*4e1bc9a0SAchim Leubner ossaHwRegWriteExt(agRoot, PCIBAR0,V_Outbound_Doorbell_Mask_Clear_Register,u64.S32[0]);
987*4e1bc9a0SAchim Leubner }
988*4e1bc9a0SAchim Leubner else
989*4e1bc9a0SAchim Leubner {
990*4e1bc9a0SAchim Leubner SA_DBG1(("siReenableMSIX_V_Interrupts: VI %d sysIntsActive off\n",interruptVectorIndex));
991*4e1bc9a0SAchim Leubner }
992*4e1bc9a0SAchim Leubner
993*4e1bc9a0SAchim Leubner }
994*4e1bc9a0SAchim Leubner
995*4e1bc9a0SAchim Leubner /******************************************************************************/
996*4e1bc9a0SAchim Leubner /*! \brief Function to reenable MSI interrupts
997*4e1bc9a0SAchim Leubner *
998*4e1bc9a0SAchim Leubner * siReenableMSIXInterrupts reenableinterrupts
999*4e1bc9a0SAchim Leubner * called thru macro ossaReenableInterrupts
1000*4e1bc9a0SAchim Leubner *
1001*4e1bc9a0SAchim Leubner * \param agRoot OS Layer-specific and LL Layer-specific context handles for this
1002*4e1bc9a0SAchim Leubner * instance of SAS/SATA hardware
1003*4e1bc9a0SAchim Leubner * \param interruptVectorIndex - vector index for message
1004*4e1bc9a0SAchim Leubner *
1005*4e1bc9a0SAchim Leubner */
1006*4e1bc9a0SAchim Leubner /*******************************************************************************/
siReenableMSIInterrupts(agsaRoot_t * agRoot,bit32 interruptVectorIndex)1007*4e1bc9a0SAchim Leubner GLOBAL void siReenableMSIInterrupts(
1008*4e1bc9a0SAchim Leubner agsaRoot_t *agRoot,
1009*4e1bc9a0SAchim Leubner bit32 interruptVectorIndex
1010*4e1bc9a0SAchim Leubner )
1011*4e1bc9a0SAchim Leubner {
1012*4e1bc9a0SAchim Leubner bit32 ODMRValue;
1013*4e1bc9a0SAchim Leubner
1014*4e1bc9a0SAchim Leubner ODMRValue = siHalRegReadExt(agRoot, GEN_MSGU_ODMR, MSGU_ODMR);
1015*4e1bc9a0SAchim Leubner ODMRValue &= ~(1 << interruptVectorIndex);
1016*4e1bc9a0SAchim Leubner
1017*4e1bc9a0SAchim Leubner siHalRegWriteExt(agRoot, GEN_MSGU_ODMR, MSGU_ODMR, ODMRValue);
1018*4e1bc9a0SAchim Leubner }
1019*4e1bc9a0SAchim Leubner
1020*4e1bc9a0SAchim Leubner /******************************************************************************/
1021*4e1bc9a0SAchim Leubner /*! \brief Function to reenable MSI V interrupts
1022*4e1bc9a0SAchim Leubner *
1023*4e1bc9a0SAchim Leubner * siReenableMSIXInterrupts reenableinterrupts
1024*4e1bc9a0SAchim Leubner * called thru macro ossaReenableInterrupts
1025*4e1bc9a0SAchim Leubner *
1026*4e1bc9a0SAchim Leubner * \param agRoot OS Layer-specific and LL Layer-specific context handles for this
1027*4e1bc9a0SAchim Leubner * instance of SAS/SATA hardware
1028*4e1bc9a0SAchim Leubner * \param interruptVectorIndex - vector index for message
1029*4e1bc9a0SAchim Leubner *
1030*4e1bc9a0SAchim Leubner */
1031*4e1bc9a0SAchim Leubner /*******************************************************************************/
siReenableMSI_V_Interrupts(agsaRoot_t * agRoot,bit32 interruptVectorIndex)1032*4e1bc9a0SAchim Leubner GLOBAL void siReenableMSI_V_Interrupts(
1033*4e1bc9a0SAchim Leubner agsaRoot_t *agRoot,
1034*4e1bc9a0SAchim Leubner bit32 interruptVectorIndex
1035*4e1bc9a0SAchim Leubner )
1036*4e1bc9a0SAchim Leubner {
1037*4e1bc9a0SAchim Leubner SA_ASSERT(0, "Should not be called");
1038*4e1bc9a0SAchim Leubner
1039*4e1bc9a0SAchim Leubner SA_DBG4(("siReenableMSI_V_Interrupts:\n"));
1040*4e1bc9a0SAchim Leubner
1041*4e1bc9a0SAchim Leubner }
1042*4e1bc9a0SAchim Leubner /******************************************************************************/
1043*4e1bc9a0SAchim Leubner /*! \brief Function to reenable Legacy interrupts
1044*4e1bc9a0SAchim Leubner *
1045*4e1bc9a0SAchim Leubner * siReenableLegacyInterrupts reenableinterrupts
1046*4e1bc9a0SAchim Leubner * called thru macro ossaReenableInterrupts
1047*4e1bc9a0SAchim Leubner *
1048*4e1bc9a0SAchim Leubner * \param agRoot OS Layer-specific and LL Layer-specific context handles for this
1049*4e1bc9a0SAchim Leubner * instance of SAS/SATA hardware
1050*4e1bc9a0SAchim Leubner * \param interruptVectorIndex always zero
1051*4e1bc9a0SAchim Leubner *
1052*4e1bc9a0SAchim Leubner */
1053*4e1bc9a0SAchim Leubner /*******************************************************************************/
siReenableLegacyInterrupts(agsaRoot_t * agRoot,bit32 interruptVectorIndex)1054*4e1bc9a0SAchim Leubner GLOBAL void siReenableLegacyInterrupts(
1055*4e1bc9a0SAchim Leubner agsaRoot_t *agRoot,
1056*4e1bc9a0SAchim Leubner bit32 interruptVectorIndex
1057*4e1bc9a0SAchim Leubner )
1058*4e1bc9a0SAchim Leubner {
1059*4e1bc9a0SAchim Leubner siHalRegWriteExt(agRoot, GEN_MSGU_ODMR, MSGU_ODMR, ODMR_CLEAR_ALL);
1060*4e1bc9a0SAchim Leubner
1061*4e1bc9a0SAchim Leubner #ifdef SA_CLEAR_ODCR_IN_INTERRUPT
1062*4e1bc9a0SAchim Leubner siHalRegWriteExt(agRoot, GEN_MSGU_ODCR, MSGU_ODCR, ODCR_CLEAR_ALL);
1063*4e1bc9a0SAchim Leubner #endif /* SA_CLEAR_ODCR_IN_INTERRUPT */
1064*4e1bc9a0SAchim Leubner }
1065*4e1bc9a0SAchim Leubner
1066*4e1bc9a0SAchim Leubner /******************************************************************************/
1067*4e1bc9a0SAchim Leubner /*! \brief Function to reenable Legacy V interrupts
1068*4e1bc9a0SAchim Leubner *
1069*4e1bc9a0SAchim Leubner * siReenableLegacyInterrupts reenableinterrupts
1070*4e1bc9a0SAchim Leubner * called thru macro ossaReenableInterrupts
1071*4e1bc9a0SAchim Leubner *
1072*4e1bc9a0SAchim Leubner * \param agRoot OS Layer-specific and LL Layer-specific context handles for this
1073*4e1bc9a0SAchim Leubner * instance of SAS/SATA hardware
1074*4e1bc9a0SAchim Leubner * \param interruptVectorIndex always zero
1075*4e1bc9a0SAchim Leubner *
1076*4e1bc9a0SAchim Leubner */
1077*4e1bc9a0SAchim Leubner /*******************************************************************************/
siReenableLegacy_V_Interrupts(agsaRoot_t * agRoot,bit32 interruptVectorIndex)1078*4e1bc9a0SAchim Leubner GLOBAL void siReenableLegacy_V_Interrupts(
1079*4e1bc9a0SAchim Leubner agsaRoot_t *agRoot,
1080*4e1bc9a0SAchim Leubner bit32 interruptVectorIndex
1081*4e1bc9a0SAchim Leubner )
1082*4e1bc9a0SAchim Leubner {
1083*4e1bc9a0SAchim Leubner
1084*4e1bc9a0SAchim Leubner bit32 mask;
1085*4e1bc9a0SAchim Leubner mask = 1 << interruptVectorIndex;
1086*4e1bc9a0SAchim Leubner
1087*4e1bc9a0SAchim Leubner SA_DBG5(("siReenableLegacy_V_Interrupts:IN MSGU_READ_ODR %08X\n",siHalRegReadExt(agRoot, GEN_MSGU_ODR, V_Outbound_Doorbell_Set_Register)));
1088*4e1bc9a0SAchim Leubner SA_DBG5(("siReenableLegacy_V_Interrupts:IN MSGU_READ_ODMR %08X\n",siHalRegReadExt(agRoot, GEN_MSGU_ODMR, V_Outbound_Doorbell_Mask_Set_Register )));
1089*4e1bc9a0SAchim Leubner
1090*4e1bc9a0SAchim Leubner ossaHwRegWriteExt(agRoot, PCIBAR0,V_Outbound_Doorbell_Mask_Clear_Register, mask);
1091*4e1bc9a0SAchim Leubner ossaHwRegWriteExt(agRoot, PCIBAR0,V_Outbound_Doorbell_Clear_Register, mask );
1092*4e1bc9a0SAchim Leubner
1093*4e1bc9a0SAchim Leubner
1094*4e1bc9a0SAchim Leubner SA_DBG5(("siReenableLegacy_V_Interrupts:OUT MSGU_READ_ODMR %08X\n",siHalRegReadExt(agRoot, GEN_MSGU_ODMR, V_Outbound_Doorbell_Mask_Set_Register )));
1095*4e1bc9a0SAchim Leubner
1096*4e1bc9a0SAchim Leubner }
1097*4e1bc9a0SAchim Leubner
1098*4e1bc9a0SAchim Leubner /******************************************************************************/
1099*4e1bc9a0SAchim Leubner /*! \brief Function to enable a single interrupt vector
1100*4e1bc9a0SAchim Leubner *
1101*4e1bc9a0SAchim Leubner *
1102*4e1bc9a0SAchim Leubner *
1103*4e1bc9a0SAchim Leubner * \param agRoot OS Layer-specific and LL Layer-specific context handles for this
1104*4e1bc9a0SAchim Leubner * instance of SAS/SATA hardware
1105*4e1bc9a0SAchim Leubner * \param interruptVectorIndex Interrupt vector to enable
1106*4e1bc9a0SAchim Leubner *
1107*4e1bc9a0SAchim Leubner */
1108*4e1bc9a0SAchim Leubner /*******************************************************************************/
1109*4e1bc9a0SAchim Leubner /******************************************************************************/
1110*4e1bc9a0SAchim Leubner /*! \brief saSystemInterruptsEnable
1111*4e1bc9a0SAchim Leubner * Function to enable a single interrupt vector
1112*4e1bc9a0SAchim Leubner *
1113*4e1bc9a0SAchim Leubner * \param agRoot OS Layer-specific and LL Layer-specific context handles for this
1114*4e1bc9a0SAchim Leubner * instance of SAS/SATA hardware
1115*4e1bc9a0SAchim Leubner * \param interruptVectorIndex Interrupt vector to enable
1116*4e1bc9a0SAchim Leubner *
1117*4e1bc9a0SAchim Leubner */
1118*4e1bc9a0SAchim Leubner /*******************************************************************************/
1119*4e1bc9a0SAchim Leubner GLOBAL FORCEINLINE
saSystemInterruptsEnable(agsaRoot_t * agRoot,bit32 interruptVectorIndex)1120*4e1bc9a0SAchim Leubner void saSystemInterruptsEnable(
1121*4e1bc9a0SAchim Leubner agsaRoot_t *agRoot,
1122*4e1bc9a0SAchim Leubner bit32 interruptVectorIndex
1123*4e1bc9a0SAchim Leubner )
1124*4e1bc9a0SAchim Leubner {
1125*4e1bc9a0SAchim Leubner ossaReenableInterrupts(agRoot, interruptVectorIndex);
1126*4e1bc9a0SAchim Leubner }
1127*4e1bc9a0SAchim Leubner /******************************************************************************/
1128*4e1bc9a0SAchim Leubner /*! \brief Routine to handle Outbound Message
1129*4e1bc9a0SAchim Leubner *
1130*4e1bc9a0SAchim Leubner * The handle for outbound message
1131*4e1bc9a0SAchim Leubner *
1132*4e1bc9a0SAchim Leubner * \param agRoot handles for this instance of SAS/SATA hardware
1133*4e1bc9a0SAchim Leubner * \param count interrupt message count
1134*4e1bc9a0SAchim Leubner * \param queueNum outbound queue
1135*4e1bc9a0SAchim Leubner *
1136*4e1bc9a0SAchim Leubner * \return
1137*4e1bc9a0SAchim Leubner */
1138*4e1bc9a0SAchim Leubner /*******************************************************************************/
1139*4e1bc9a0SAchim Leubner LOCAL FORCEINLINE bit32
siProcessOBMsg(agsaRoot_t * agRoot,bit32 count,bit32 queueNum)1140*4e1bc9a0SAchim Leubner siProcessOBMsg(
1141*4e1bc9a0SAchim Leubner agsaRoot_t *agRoot,
1142*4e1bc9a0SAchim Leubner bit32 count,
1143*4e1bc9a0SAchim Leubner bit32 queueNum
1144*4e1bc9a0SAchim Leubner )
1145*4e1bc9a0SAchim Leubner {
1146*4e1bc9a0SAchim Leubner agsaLLRoot_t *saRoot = (agsaLLRoot_t *)(agRoot->sdkData);
1147*4e1bc9a0SAchim Leubner mpiOCQueue_t *circularQ = agNULL;
1148*4e1bc9a0SAchim Leubner void *pMsg1 = agNULL;
1149*4e1bc9a0SAchim Leubner bit32 ret, processedMsgCount = 0;
1150*4e1bc9a0SAchim Leubner bit32 ParseOBIombStatus = 0;
1151*4e1bc9a0SAchim Leubner #ifdef SA_ENABLE_TRACE_FUNCTIONS
1152*4e1bc9a0SAchim Leubner bit32 i = 0;
1153*4e1bc9a0SAchim Leubner #endif
1154*4e1bc9a0SAchim Leubner bit16 opcode = 0;
1155*4e1bc9a0SAchim Leubner mpiMsgCategory_t category;
1156*4e1bc9a0SAchim Leubner bit8 bc = 0;
1157*4e1bc9a0SAchim Leubner
1158*4e1bc9a0SAchim Leubner smTraceFuncEnter(hpDBG_VERY_LOUD,"5r");
1159*4e1bc9a0SAchim Leubner
1160*4e1bc9a0SAchim Leubner
1161*4e1bc9a0SAchim Leubner SA_DBG3(("siProcessOBMsg: queueNum 0x%x\n", queueNum));
1162*4e1bc9a0SAchim Leubner
1163*4e1bc9a0SAchim Leubner ossaSingleThreadedEnter(agRoot, LL_IOREQ_OBQ_LOCK + queueNum);
1164*4e1bc9a0SAchim Leubner
1165*4e1bc9a0SAchim Leubner circularQ = &saRoot->outboundQueue[queueNum];
1166*4e1bc9a0SAchim Leubner OSSA_READ_LE_32(circularQ->agRoot, &circularQ->producerIdx, circularQ->piPointer, 0);
1167*4e1bc9a0SAchim Leubner
1168*4e1bc9a0SAchim Leubner if (circularQ->producerIdx == circularQ->consumerIdx)
1169*4e1bc9a0SAchim Leubner {
1170*4e1bc9a0SAchim Leubner ossaSingleThreadedLeave(agRoot, LL_IOREQ_OBQ_LOCK + queueNum);
1171*4e1bc9a0SAchim Leubner smTraceFuncExit(hpDBG_VERY_LOUD, 'a', "5r");
1172*4e1bc9a0SAchim Leubner return processedMsgCount;
1173*4e1bc9a0SAchim Leubner }
1174*4e1bc9a0SAchim Leubner
1175*4e1bc9a0SAchim Leubner ossaSingleThreadedLeave(agRoot, LL_IOREQ_OBQ_LOCK + queueNum);
1176*4e1bc9a0SAchim Leubner
1177*4e1bc9a0SAchim Leubner do
1178*4e1bc9a0SAchim Leubner {
1179*4e1bc9a0SAchim Leubner /* ossaSingleThreadedEnter(agRoot, LL_IOREQ_OBQ_LOCK + queueNum); */
1180*4e1bc9a0SAchim Leubner ret = mpiMsgConsume(circularQ, &pMsg1, &category, &opcode, &bc);
1181*4e1bc9a0SAchim Leubner /* ossaSingleThreadedLeave(agRoot, LL_IOREQ_OBQ_LOCK + queueNum); */
1182*4e1bc9a0SAchim Leubner
1183*4e1bc9a0SAchim Leubner if (AGSA_RC_SUCCESS == ret)
1184*4e1bc9a0SAchim Leubner {
1185*4e1bc9a0SAchim Leubner smTrace(hpDBG_IOMB,"M0",queueNum);
1186*4e1bc9a0SAchim Leubner /* TP:M0 queueNum */
1187*4e1bc9a0SAchim Leubner smTrace(hpDBG_VERY_LOUD,"MA",opcode);
1188*4e1bc9a0SAchim Leubner /* TP:MA opcode */
1189*4e1bc9a0SAchim Leubner smTrace(hpDBG_IOMB,"MB",category);
1190*4e1bc9a0SAchim Leubner /* TP:MB category */
1191*4e1bc9a0SAchim Leubner
1192*4e1bc9a0SAchim Leubner #ifdef SA_ENABLE_TRACE_FUNCTIONS
1193*4e1bc9a0SAchim Leubner for (i=0; i<((bit32)bc*(circularQ->elementSize/4)); i++)
1194*4e1bc9a0SAchim Leubner {
1195*4e1bc9a0SAchim Leubner /* The -sizeof(mpiMsgHeader_t) is to account for mpiMsgConsume incrementing the pointer past the header*/
1196*4e1bc9a0SAchim Leubner smTrace(hpDBG_IOMB,"MC",*( ((bit32*)((bit8 *)pMsg1 - sizeof(mpiMsgHeader_t))) + i));
1197*4e1bc9a0SAchim Leubner /* TP:MC Outbound IOMB Dword */
1198*4e1bc9a0SAchim Leubner }
1199*4e1bc9a0SAchim Leubner #endif
1200*4e1bc9a0SAchim Leubner
1201*4e1bc9a0SAchim Leubner MPI_DEBUG_TRACE( circularQ->qNumber,((circularQ->producerIdx << 16 ) | circularQ->consumerIdx),MPI_DEBUG_TRACE_OBQ, (void *)(((bit8*)pMsg1) - sizeof(mpiMsgHeader_t)), circularQ->elementSize);
1202*4e1bc9a0SAchim Leubner
1203*4e1bc9a0SAchim Leubner ossaLogIomb(circularQ->agRoot,
1204*4e1bc9a0SAchim Leubner circularQ->qNumber,
1205*4e1bc9a0SAchim Leubner FALSE,
1206*4e1bc9a0SAchim Leubner (void *)(((bit8*)pMsg1) - sizeof(mpiMsgHeader_t)),
1207*4e1bc9a0SAchim Leubner bc*circularQ->elementSize);
1208*4e1bc9a0SAchim Leubner
1209*4e1bc9a0SAchim Leubner ossaQueueProcessed(agRoot, queueNum, circularQ->producerIdx, circularQ->consumerIdx);
1210*4e1bc9a0SAchim Leubner /* process the outbound message */
1211*4e1bc9a0SAchim Leubner ParseOBIombStatus = mpiParseOBIomb(agRoot, (bit32 *)pMsg1, category, opcode);
1212*4e1bc9a0SAchim Leubner if (ParseOBIombStatus == AGSA_RC_FAILURE)
1213*4e1bc9a0SAchim Leubner {
1214*4e1bc9a0SAchim Leubner SA_DBG1(("siProcessOBMsg, Failed Q %2d PI 0x%03x CI 0x%03x\n", queueNum, circularQ->producerIdx, circularQ->consumerIdx));
1215*4e1bc9a0SAchim Leubner #if defined(SALLSDK_DEBUG)
1216*4e1bc9a0SAchim Leubner /* free the message for debug: this is a hang! */
1217*4e1bc9a0SAchim Leubner
1218*4e1bc9a0SAchim Leubner mpiMsgFreeSet(circularQ, pMsg1, bc);
1219*4e1bc9a0SAchim Leubner processedMsgCount ++;
1220*4e1bc9a0SAchim Leubner #endif /**/
1221*4e1bc9a0SAchim Leubner break;
1222*4e1bc9a0SAchim Leubner }
1223*4e1bc9a0SAchim Leubner
1224*4e1bc9a0SAchim Leubner /* free the message from the outbound circular buffer */
1225*4e1bc9a0SAchim Leubner mpiMsgFreeSet(circularQ, pMsg1, bc);
1226*4e1bc9a0SAchim Leubner processedMsgCount ++;
1227*4e1bc9a0SAchim Leubner }
1228*4e1bc9a0SAchim Leubner else
1229*4e1bc9a0SAchim Leubner //if (AGSA_RC_BUSY == ret) // always (circularQ->producerIdx == circularQ->consumerIdx)
1230*4e1bc9a0SAchim Leubner // || (AGSA_RC_FAILURE == ret)
1231*4e1bc9a0SAchim Leubner {
1232*4e1bc9a0SAchim Leubner break;
1233*4e1bc9a0SAchim Leubner }
1234*4e1bc9a0SAchim Leubner }
1235*4e1bc9a0SAchim Leubner /* end of message processing if hit the count */
1236*4e1bc9a0SAchim Leubner while(count > processedMsgCount);
1237*4e1bc9a0SAchim Leubner
1238*4e1bc9a0SAchim Leubner /* #define SALLSDK_FATAL_ERROR_DETECT 1 */
1239*4e1bc9a0SAchim Leubner /*
1240*4e1bc9a0SAchim Leubner this comments are to be removed
1241*4e1bc9a0SAchim Leubner fill in 0x1D 0x1e 0x1f 0x20 in MPI table for
1242*4e1bc9a0SAchim Leubner bit32 regDumpBusBaseNum0;
1243*4e1bc9a0SAchim Leubner bit32 regDumpOffset0;
1244*4e1bc9a0SAchim Leubner bit32 regDumpLen0;
1245*4e1bc9a0SAchim Leubner bit32 regDumpBusBaseNum1;
1246*4e1bc9a0SAchim Leubner bit32 regDumpOffset1;
1247*4e1bc9a0SAchim Leubner bit32 regDumpLen1;
1248*4e1bc9a0SAchim Leubner in agsaFatalErrorInfo_t
1249*4e1bc9a0SAchim Leubner
1250*4e1bc9a0SAchim Leubner ??? regDumpBusBaseNum0 and regDumpBusBaseNum1
1251*4e1bc9a0SAchim Leubner saRoot->mainConfigTable.regDumpPCIBAR = pcibar;
1252*4e1bc9a0SAchim Leubner saRoot->mainConfigTable.FatalErrorDumpOffset0 = config->FatalErrorDumpOffset0;
1253*4e1bc9a0SAchim Leubner saRoot->mainConfigTable.FatalErrorDumpLength0 = config->FatalErrorDumpLength0;
1254*4e1bc9a0SAchim Leubner saRoot->mainConfigTable.FatalErrorDumpOffset1 = config->FatalErrorDumpOffset1;
1255*4e1bc9a0SAchim Leubner saRoot->mainConfigTable.FatalErrorDumpLength1 = config->FatalErrorDumpLength1;
1256*4e1bc9a0SAchim Leubner
1257*4e1bc9a0SAchim Leubner
1258*4e1bc9a0SAchim Leubner
1259*4e1bc9a0SAchim Leubner */
1260*4e1bc9a0SAchim Leubner #if defined(SALLSDK_FATAL_ERROR_DETECT)
1261*4e1bc9a0SAchim Leubner
1262*4e1bc9a0SAchim Leubner if( smIS_SPC(agRoot) ) /* SPC only */
1263*4e1bc9a0SAchim Leubner {
1264*4e1bc9a0SAchim Leubner
1265*4e1bc9a0SAchim Leubner /* any fatal error happened */
1266*4e1bc9a0SAchim Leubner /* executing this code impacts performance by 1% when no error is detected */
1267*4e1bc9a0SAchim Leubner {
1268*4e1bc9a0SAchim Leubner agsaFatalErrorInfo_t fatal_error;
1269*4e1bc9a0SAchim Leubner bit32 value;
1270*4e1bc9a0SAchim Leubner bit32 value1;
1271*4e1bc9a0SAchim Leubner
1272*4e1bc9a0SAchim Leubner value = siHalRegReadExt(agRoot, GEN_MSGU_SCRATCH_PAD_1, MSGU_SCRATCH_PAD_1);
1273*4e1bc9a0SAchim Leubner value1 = siHalRegReadExt(agRoot, GEN_MSGU_SCRATCH_PAD_2, MSGU_SCRATCH_PAD_2);
1274*4e1bc9a0SAchim Leubner
1275*4e1bc9a0SAchim Leubner if( (value & SA_FATAL_ERROR_SP1_AAP1_ERR_MASK) == SA_FATAL_ERROR_FATAL_ERROR ||
1276*4e1bc9a0SAchim Leubner (value1 & SA_FATAL_ERROR_SP2_IOP_ERR_MASK) == SA_FATAL_ERROR_FATAL_ERROR )
1277*4e1bc9a0SAchim Leubner {
1278*4e1bc9a0SAchim Leubner si_memset(&fatal_error, 0, sizeof(agsaFatalErrorInfo_t));
1279*4e1bc9a0SAchim Leubner /* read detail fatal errors */
1280*4e1bc9a0SAchim Leubner value = siHalRegReadExt(agRoot, GEN_MSGU_SCRATCH_PAD_0, MSGU_SCRATCH_PAD_0);
1281*4e1bc9a0SAchim Leubner fatal_error.errorInfo0 = value;
1282*4e1bc9a0SAchim Leubner SA_DBG1(("siProcessOBMsg: ScratchPad0 AAP error code 0x%x\n", value));
1283*4e1bc9a0SAchim Leubner
1284*4e1bc9a0SAchim Leubner value = siHalRegReadExt(agRoot, GEN_MSGU_SCRATCH_PAD_1, MSGU_SCRATCH_PAD_1);
1285*4e1bc9a0SAchim Leubner fatal_error.errorInfo1 = value;
1286*4e1bc9a0SAchim Leubner /* AAP error state */
1287*4e1bc9a0SAchim Leubner SA_DBG1(("siProcessOBMsg: AAP error state and error code 0x%x\n", value));
1288*4e1bc9a0SAchim Leubner value = siHalRegReadExt(agRoot, GEN_MSGU_SCRATCH_PAD_2, MSGU_SCRATCH_PAD_2);
1289*4e1bc9a0SAchim Leubner fatal_error.errorInfo2 = value;
1290*4e1bc9a0SAchim Leubner /* IOP error state */
1291*4e1bc9a0SAchim Leubner SA_DBG1(("siProcessOBMsg: IOP error state and error code 0x%x\n", value));
1292*4e1bc9a0SAchim Leubner value = siHalRegReadExt(agRoot, GEN_MSGU_SCRATCH_PAD_3, MSGU_SCRATCH_PAD_3);
1293*4e1bc9a0SAchim Leubner SA_DBG1(("siProcessOBMsg: ScratchPad3 IOP error code 0x%x\n", value));
1294*4e1bc9a0SAchim Leubner fatal_error.errorInfo3 = value;
1295*4e1bc9a0SAchim Leubner
1296*4e1bc9a0SAchim Leubner if (agNULL != saRoot)
1297*4e1bc9a0SAchim Leubner {
1298*4e1bc9a0SAchim Leubner fatal_error.regDumpBusBaseNum0 = saRoot->mainConfigTable.regDumpPCIBAR;
1299*4e1bc9a0SAchim Leubner fatal_error.regDumpOffset0 = saRoot->mainConfigTable.FatalErrorDumpOffset0;
1300*4e1bc9a0SAchim Leubner fatal_error.regDumpLen0 = saRoot->mainConfigTable.FatalErrorDumpLength0;
1301*4e1bc9a0SAchim Leubner fatal_error.regDumpBusBaseNum1 = saRoot->mainConfigTable.regDumpPCIBAR;
1302*4e1bc9a0SAchim Leubner fatal_error.regDumpOffset1 = saRoot->mainConfigTable.FatalErrorDumpOffset1;
1303*4e1bc9a0SAchim Leubner fatal_error.regDumpLen1 = saRoot->mainConfigTable.FatalErrorDumpLength1;
1304*4e1bc9a0SAchim Leubner }
1305*4e1bc9a0SAchim Leubner else
1306*4e1bc9a0SAchim Leubner {
1307*4e1bc9a0SAchim Leubner fatal_error.regDumpBusBaseNum0 = 0;
1308*4e1bc9a0SAchim Leubner fatal_error.regDumpOffset0 = 0;
1309*4e1bc9a0SAchim Leubner fatal_error.regDumpLen0 = 0;
1310*4e1bc9a0SAchim Leubner fatal_error.regDumpBusBaseNum1 = 0;
1311*4e1bc9a0SAchim Leubner fatal_error.regDumpOffset1 = 0;
1312*4e1bc9a0SAchim Leubner fatal_error.regDumpLen1 = 0;
1313*4e1bc9a0SAchim Leubner }
1314*4e1bc9a0SAchim Leubner /* Call Back with error */
1315*4e1bc9a0SAchim Leubner SA_DBG1(("siProcessOBMsg: SALLSDK_FATAL_ERROR_DETECT \n"));
1316*4e1bc9a0SAchim Leubner ossaHwCB(agRoot, agNULL, OSSA_HW_EVENT_MALFUNCTION, 0, (void *)&fatal_error, agNULL);
1317*4e1bc9a0SAchim Leubner }
1318*4e1bc9a0SAchim Leubner }
1319*4e1bc9a0SAchim Leubner }
1320*4e1bc9a0SAchim Leubner #endif /* SALLSDK_FATAL_ERROR_DETECT */
1321*4e1bc9a0SAchim Leubner smTraceFuncExit(hpDBG_VERY_LOUD, 'b', "5r");
1322*4e1bc9a0SAchim Leubner return processedMsgCount;
1323*4e1bc9a0SAchim Leubner }
1324*4e1bc9a0SAchim Leubner
1325*4e1bc9a0SAchim Leubner /******************************************************************************/
1326*4e1bc9a0SAchim Leubner /*! \brief Function to enable/disable interrupts
1327*4e1bc9a0SAchim Leubner *
1328*4e1bc9a0SAchim Leubner * The saSystemInterruptsActive() function is called to indicate to the LL Layer
1329*4e1bc9a0SAchim Leubner * whether interrupts are available. The parameter sysIntsActive indicates whether
1330*4e1bc9a0SAchim Leubner * interrupts are available at this time.
1331*4e1bc9a0SAchim Leubner *
1332*4e1bc9a0SAchim Leubner * \param agRoot handles for this instance of SAS/SATA hardware
1333*4e1bc9a0SAchim Leubner * \param sysIntsActive flag for enable/disable interrupt
1334*4e1bc9a0SAchim Leubner *
1335*4e1bc9a0SAchim Leubner * \return -void-
1336*4e1bc9a0SAchim Leubner *
1337*4e1bc9a0SAchim Leubner */
1338*4e1bc9a0SAchim Leubner /*******************************************************************************/
saSystemInterruptsActive(agsaRoot_t * agRoot,agBOOLEAN sysIntsActive)1339*4e1bc9a0SAchim Leubner GLOBAL void saSystemInterruptsActive(
1340*4e1bc9a0SAchim Leubner agsaRoot_t *agRoot,
1341*4e1bc9a0SAchim Leubner agBOOLEAN sysIntsActive
1342*4e1bc9a0SAchim Leubner )
1343*4e1bc9a0SAchim Leubner {
1344*4e1bc9a0SAchim Leubner bit32 x;
1345*4e1bc9a0SAchim Leubner agsaLLRoot_t *saRoot;
1346*4e1bc9a0SAchim Leubner
1347*4e1bc9a0SAchim Leubner SA_ASSERT((agNULL != agRoot), "");
1348*4e1bc9a0SAchim Leubner if (agRoot == agNULL)
1349*4e1bc9a0SAchim Leubner {
1350*4e1bc9a0SAchim Leubner SA_DBG1(("saSystemInterruptsActive: agRoot == agNULL\n"));
1351*4e1bc9a0SAchim Leubner return;
1352*4e1bc9a0SAchim Leubner }
1353*4e1bc9a0SAchim Leubner saRoot = (agsaLLRoot_t *)(agRoot->sdkData);
1354*4e1bc9a0SAchim Leubner SA_ASSERT((agNULL != saRoot), "");
1355*4e1bc9a0SAchim Leubner if (saRoot == agNULL)
1356*4e1bc9a0SAchim Leubner {
1357*4e1bc9a0SAchim Leubner SA_DBG1(("saSystemInterruptsActive: saRoot == agNULL\n"));
1358*4e1bc9a0SAchim Leubner return;
1359*4e1bc9a0SAchim Leubner }
1360*4e1bc9a0SAchim Leubner
1361*4e1bc9a0SAchim Leubner smTraceFuncEnter(hpDBG_TICK_INT,"5s");
1362*4e1bc9a0SAchim Leubner SA_DBG1(("saSystemInterruptsActive: now 0x%X new 0x%x\n",saRoot->sysIntsActive,sysIntsActive));
1363*4e1bc9a0SAchim Leubner SA_DBG3(("saSystemInterruptsActive: Doorbell_Set %08X U %08X\n",
1364*4e1bc9a0SAchim Leubner ossaHwRegReadExt(agRoot, PCIBAR0, V_Outbound_Doorbell_Set_Register),
1365*4e1bc9a0SAchim Leubner ossaHwRegReadExt(agRoot, PCIBAR0, V_Outbound_Doorbell_Set_RegisterU)));
1366*4e1bc9a0SAchim Leubner SA_DBG3(("saSystemInterruptsActive: Doorbell_Mask %08X U %08X\n",
1367*4e1bc9a0SAchim Leubner ossaHwRegReadExt(agRoot, PCIBAR0, V_Outbound_Doorbell_Mask_Set_Register ),
1368*4e1bc9a0SAchim Leubner ossaHwRegReadExt(agRoot, PCIBAR0, V_Outbound_Doorbell_Mask_Set_RegisterU )));
1369*4e1bc9a0SAchim Leubner
1370*4e1bc9a0SAchim Leubner if( saRoot->sysIntsActive && sysIntsActive )
1371*4e1bc9a0SAchim Leubner {
1372*4e1bc9a0SAchim Leubner SA_DBG1(("saSystemInterruptsActive: Already active 0x%X new 0x%x\n",saRoot->sysIntsActive,sysIntsActive));
1373*4e1bc9a0SAchim Leubner smTraceFuncExit(hpDBG_TICK_INT, 'a', "5s");
1374*4e1bc9a0SAchim Leubner return;
1375*4e1bc9a0SAchim Leubner }
1376*4e1bc9a0SAchim Leubner
1377*4e1bc9a0SAchim Leubner if( !saRoot->sysIntsActive && !sysIntsActive )
1378*4e1bc9a0SAchim Leubner {
1379*4e1bc9a0SAchim Leubner if(smIS_SPC(agRoot))
1380*4e1bc9a0SAchim Leubner {
1381*4e1bc9a0SAchim Leubner siHalRegWriteExt(agRoot, GEN_MSGU_ODMR, MSGU_ODMR,AGSA_INTERRUPT_HANDLE_ALL_CHANNELS );
1382*4e1bc9a0SAchim Leubner }
1383*4e1bc9a0SAchim Leubner else
1384*4e1bc9a0SAchim Leubner {
1385*4e1bc9a0SAchim Leubner ossaHwRegWriteExt(agRoot, PCIBAR0,V_Outbound_Doorbell_Mask_Set_Register, AGSA_INTERRUPT_HANDLE_ALL_CHANNELS);
1386*4e1bc9a0SAchim Leubner ossaHwRegWriteExt(agRoot, PCIBAR0,V_Outbound_Doorbell_Mask_Set_RegisterU, AGSA_INTERRUPT_HANDLE_ALL_CHANNELS);
1387*4e1bc9a0SAchim Leubner }
1388*4e1bc9a0SAchim Leubner SA_DBG1(("saSystemInterruptsActive: Already disabled 0x%X new 0x%x\n",saRoot->sysIntsActive,sysIntsActive));
1389*4e1bc9a0SAchim Leubner smTraceFuncExit(hpDBG_TICK_INT, 'b', "5s");
1390*4e1bc9a0SAchim Leubner return;
1391*4e1bc9a0SAchim Leubner }
1392*4e1bc9a0SAchim Leubner
1393*4e1bc9a0SAchim Leubner /* Set the flag is sdkData */
1394*4e1bc9a0SAchim Leubner saRoot->sysIntsActive = (bit8)sysIntsActive;
1395*4e1bc9a0SAchim Leubner
1396*4e1bc9a0SAchim Leubner
1397*4e1bc9a0SAchim Leubner smTrace(hpDBG_TICK_INT,"Vq",sysIntsActive);
1398*4e1bc9a0SAchim Leubner /* TP:Vq sysIntsActive */
1399*4e1bc9a0SAchim Leubner /* If sysIntsActive is true */
1400*4e1bc9a0SAchim Leubner if ( agTRUE == sysIntsActive )
1401*4e1bc9a0SAchim Leubner {
1402*4e1bc9a0SAchim Leubner
1403*4e1bc9a0SAchim Leubner SA_DBG1(("saSystemInterruptsActive: Doorbell_Set %08X U %08X\n",
1404*4e1bc9a0SAchim Leubner ossaHwRegReadExt(agRoot, PCIBAR0, V_Outbound_Doorbell_Set_Register),
1405*4e1bc9a0SAchim Leubner ossaHwRegReadExt(agRoot, PCIBAR0, V_Outbound_Doorbell_Set_RegisterU)));
1406*4e1bc9a0SAchim Leubner SA_DBG1(("saSystemInterruptsActive: Doorbell_Mask_Set %08X U %08X\n",
1407*4e1bc9a0SAchim Leubner ossaHwRegReadExt(agRoot, PCIBAR0, V_Outbound_Doorbell_Mask_Set_Register),
1408*4e1bc9a0SAchim Leubner ossaHwRegReadExt(agRoot, PCIBAR0, V_Outbound_Doorbell_Mask_Set_RegisterU)));
1409*4e1bc9a0SAchim Leubner if(smIS_SPCV(agRoot))
1410*4e1bc9a0SAchim Leubner {
1411*4e1bc9a0SAchim Leubner ossaHwRegWriteExt(agRoot, PCIBAR0,V_Outbound_Doorbell_Clear_Register, 0xFFFFFFFF);
1412*4e1bc9a0SAchim Leubner ossaHwRegWriteExt(agRoot, PCIBAR0,V_Outbound_Doorbell_Clear_RegisterU, 0xFFFFFFFF);
1413*4e1bc9a0SAchim Leubner }
1414*4e1bc9a0SAchim Leubner /* enable interrupt */
1415*4e1bc9a0SAchim Leubner for(x=0; x < saRoot->numInterruptVectors; x++)
1416*4e1bc9a0SAchim Leubner {
1417*4e1bc9a0SAchim Leubner ossaReenableInterrupts(agRoot,x );
1418*4e1bc9a0SAchim Leubner }
1419*4e1bc9a0SAchim Leubner
1420*4e1bc9a0SAchim Leubner if(saRoot->swConfig.fatalErrorInterruptEnable)
1421*4e1bc9a0SAchim Leubner {
1422*4e1bc9a0SAchim Leubner ossaReenableInterrupts(agRoot,saRoot->swConfig.fatalErrorInterruptVector );
1423*4e1bc9a0SAchim Leubner }
1424*4e1bc9a0SAchim Leubner
1425*4e1bc9a0SAchim Leubner siHalRegWriteExt(agRoot, GEN_MSGU_ODMR, MSGU_ODMR, 0);
1426*4e1bc9a0SAchim Leubner }
1427*4e1bc9a0SAchim Leubner /* If sysIntsActive is false */
1428*4e1bc9a0SAchim Leubner else
1429*4e1bc9a0SAchim Leubner {
1430*4e1bc9a0SAchim Leubner /* disable interrupt */
1431*4e1bc9a0SAchim Leubner if(smIS_SPC(agRoot))
1432*4e1bc9a0SAchim Leubner {
1433*4e1bc9a0SAchim Leubner siHalRegWriteExt(agRoot, GEN_MSGU_ODMR, MSGU_ODMR,AGSA_INTERRUPT_HANDLE_ALL_CHANNELS );
1434*4e1bc9a0SAchim Leubner }
1435*4e1bc9a0SAchim Leubner else
1436*4e1bc9a0SAchim Leubner {
1437*4e1bc9a0SAchim Leubner ossaHwRegWriteExt(agRoot, PCIBAR0,V_Outbound_Doorbell_Mask_Set_Register, AGSA_INTERRUPT_HANDLE_ALL_CHANNELS);
1438*4e1bc9a0SAchim Leubner ossaHwRegWriteExt(agRoot, PCIBAR0,V_Outbound_Doorbell_Mask_Set_RegisterU, AGSA_INTERRUPT_HANDLE_ALL_CHANNELS);
1439*4e1bc9a0SAchim Leubner }
1440*4e1bc9a0SAchim Leubner }
1441*4e1bc9a0SAchim Leubner
1442*4e1bc9a0SAchim Leubner SA_DBG3(("saSystemInterruptsActive: Doorbell_Set %08X U %08X\n",
1443*4e1bc9a0SAchim Leubner ossaHwRegReadExt(agRoot, PCIBAR0, V_Outbound_Doorbell_Set_Register),
1444*4e1bc9a0SAchim Leubner ossaHwRegReadExt(agRoot, PCIBAR0, V_Outbound_Doorbell_Set_RegisterU)));
1445*4e1bc9a0SAchim Leubner SA_DBG3(("saSystemInterruptsActive: Doorbell_Mask %08X U %08X\n",
1446*4e1bc9a0SAchim Leubner ossaHwRegReadExt(agRoot, PCIBAR0, V_Outbound_Doorbell_Mask_Set_Register ),
1447*4e1bc9a0SAchim Leubner ossaHwRegReadExt(agRoot, PCIBAR0, V_Outbound_Doorbell_Mask_Set_RegisterU )));
1448*4e1bc9a0SAchim Leubner
1449*4e1bc9a0SAchim Leubner
1450*4e1bc9a0SAchim Leubner smTraceFuncExit(hpDBG_TICK_INT, 'c', "5s");
1451*4e1bc9a0SAchim Leubner }
1452*4e1bc9a0SAchim Leubner
1453*4e1bc9a0SAchim Leubner /******************************************************************************/
1454*4e1bc9a0SAchim Leubner /*! \brief Routine to handle for received SAS with data payload event
1455*4e1bc9a0SAchim Leubner *
1456*4e1bc9a0SAchim Leubner * The handle for received SAS with data payload event
1457*4e1bc9a0SAchim Leubner *
1458*4e1bc9a0SAchim Leubner * \param agRoot handles for this instance of SAS/SATA hardware
1459*4e1bc9a0SAchim Leubner * \param pRequest handles for the IOrequest
1460*4e1bc9a0SAchim Leubner * \param pRespIU the pointer to the Response IU
1461*4e1bc9a0SAchim Leubner * \param param Payload Length
1462*4e1bc9a0SAchim Leubner *
1463*4e1bc9a0SAchim Leubner * \return -void-
1464*4e1bc9a0SAchim Leubner */
1465*4e1bc9a0SAchim Leubner /*******************************************************************************/
siEventSSPResponseWtDataRcvd(agsaRoot_t * agRoot,agsaIORequestDesc_t * pRequest,agsaSSPResponseInfoUnit_t * pRespIU,bit32 param,bit32 sspTag)1466*4e1bc9a0SAchim Leubner GLOBAL void siEventSSPResponseWtDataRcvd(
1467*4e1bc9a0SAchim Leubner agsaRoot_t *agRoot,
1468*4e1bc9a0SAchim Leubner agsaIORequestDesc_t *pRequest,
1469*4e1bc9a0SAchim Leubner agsaSSPResponseInfoUnit_t *pRespIU,
1470*4e1bc9a0SAchim Leubner bit32 param,
1471*4e1bc9a0SAchim Leubner bit32 sspTag
1472*4e1bc9a0SAchim Leubner )
1473*4e1bc9a0SAchim Leubner {
1474*4e1bc9a0SAchim Leubner agsaLLRoot_t *saRoot = (agsaLLRoot_t *)(agRoot->sdkData);
1475*4e1bc9a0SAchim Leubner agsaDeviceDesc_t *pDevice;
1476*4e1bc9a0SAchim Leubner bit32 count = 0;
1477*4e1bc9a0SAchim Leubner bit32 padCount;
1478*4e1bc9a0SAchim Leubner
1479*4e1bc9a0SAchim Leubner smTraceFuncEnter(hpDBG_VERY_LOUD,"5g");
1480*4e1bc9a0SAchim Leubner
1481*4e1bc9a0SAchim Leubner /* get frame handle */
1482*4e1bc9a0SAchim Leubner
1483*4e1bc9a0SAchim Leubner /* If the request is still valid */
1484*4e1bc9a0SAchim Leubner if ( agTRUE == pRequest->valid )
1485*4e1bc9a0SAchim Leubner {
1486*4e1bc9a0SAchim Leubner /* get device */
1487*4e1bc9a0SAchim Leubner pDevice = pRequest->pDevice;
1488*4e1bc9a0SAchim Leubner
1489*4e1bc9a0SAchim Leubner /* Delete the request from the pendingIORequests */
1490*4e1bc9a0SAchim Leubner ossaSingleThreadedEnter(agRoot, LL_IOREQ_LOCKEQ_LOCK);
1491*4e1bc9a0SAchim Leubner saLlistIORemove(&(pDevice->pendingIORequests), &(pRequest->linkNode));
1492*4e1bc9a0SAchim Leubner ossaSingleThreadedLeave(agRoot, LL_IOREQ_LOCKEQ_LOCK);
1493*4e1bc9a0SAchim Leubner
1494*4e1bc9a0SAchim Leubner if (sspTag & SSP_RESCV_BIT)
1495*4e1bc9a0SAchim Leubner {
1496*4e1bc9a0SAchim Leubner /* get the pad count, bit 17 and 18 of sspTag */
1497*4e1bc9a0SAchim Leubner padCount = (sspTag >> SSP_RESCV_PAD_SHIFT) & 0x3;
1498*4e1bc9a0SAchim Leubner /* get Residual Count */
1499*4e1bc9a0SAchim Leubner count = *(bit32 *)((bit8 *)pRespIU + param + padCount);
1500*4e1bc9a0SAchim Leubner }
1501*4e1bc9a0SAchim Leubner
1502*4e1bc9a0SAchim Leubner (*(ossaSSPCompletedCB_t)(pRequest->completionCB))(agRoot,
1503*4e1bc9a0SAchim Leubner pRequest->pIORequestContext,
1504*4e1bc9a0SAchim Leubner OSSA_IO_SUCCESS,
1505*4e1bc9a0SAchim Leubner param,
1506*4e1bc9a0SAchim Leubner (void *)pRespIU,
1507*4e1bc9a0SAchim Leubner (bit16)(sspTag & SSPTAG_BITS),
1508*4e1bc9a0SAchim Leubner count);
1509*4e1bc9a0SAchim Leubner
1510*4e1bc9a0SAchim Leubner ossaSingleThreadedEnter(agRoot, LL_IOREQ_LOCKEQ_LOCK);
1511*4e1bc9a0SAchim Leubner pRequest->valid = agFALSE;
1512*4e1bc9a0SAchim Leubner /* return the request to free pool */
1513*4e1bc9a0SAchim Leubner if(saLlistIOGetCount(&(saRoot->freeReservedRequests)) < SA_RESERVED_REQUEST_COUNT)
1514*4e1bc9a0SAchim Leubner {
1515*4e1bc9a0SAchim Leubner SA_DBG1(("siEventSSPResponseWtDataRcvd: saving pRequest (%p) for later use\n", pRequest));
1516*4e1bc9a0SAchim Leubner saLlistIOAdd(&(saRoot->freeReservedRequests), &(pRequest->linkNode));
1517*4e1bc9a0SAchim Leubner }
1518*4e1bc9a0SAchim Leubner else
1519*4e1bc9a0SAchim Leubner {
1520*4e1bc9a0SAchim Leubner /* return the request to free pool */
1521*4e1bc9a0SAchim Leubner saLlistIOAdd(&(saRoot->freeIORequests), &(pRequest->linkNode));
1522*4e1bc9a0SAchim Leubner }
1523*4e1bc9a0SAchim Leubner ossaSingleThreadedLeave(agRoot, LL_IOREQ_LOCKEQ_LOCK);
1524*4e1bc9a0SAchim Leubner
1525*4e1bc9a0SAchim Leubner }
1526*4e1bc9a0SAchim Leubner else
1527*4e1bc9a0SAchim Leubner {
1528*4e1bc9a0SAchim Leubner SA_DBG1(("siEventSSPResponseWtDataRcvd: pRequest->Valid not TRUE\n"));
1529*4e1bc9a0SAchim Leubner }
1530*4e1bc9a0SAchim Leubner
1531*4e1bc9a0SAchim Leubner smTraceFuncExit(hpDBG_VERY_LOUD, 'a', "5g");
1532*4e1bc9a0SAchim Leubner
1533*4e1bc9a0SAchim Leubner return;
1534*4e1bc9a0SAchim Leubner }
1535*4e1bc9a0SAchim Leubner
1536*4e1bc9a0SAchim Leubner /******************************************************************************/
1537*4e1bc9a0SAchim Leubner /*! \brief Routine to handle successfully completed IO event
1538*4e1bc9a0SAchim Leubner *
1539*4e1bc9a0SAchim Leubner * Handle successfully completed IO
1540*4e1bc9a0SAchim Leubner *
1541*4e1bc9a0SAchim Leubner * \param agRoot handles for this instance of SAS/SATA hardware
1542*4e1bc9a0SAchim Leubner * \param pRequest Pointer of IO request of the IO
1543*4e1bc9a0SAchim Leubner * \param status status of the IO
1544*4e1bc9a0SAchim Leubner *
1545*4e1bc9a0SAchim Leubner * \return -void-
1546*4e1bc9a0SAchim Leubner */
1547*4e1bc9a0SAchim Leubner /*******************************************************************************/
siIODone(agsaRoot_t * agRoot,agsaIORequestDesc_t * pRequest,bit32 status,bit32 sspTag)1548*4e1bc9a0SAchim Leubner GLOBAL FORCEINLINE void siIODone(
1549*4e1bc9a0SAchim Leubner agsaRoot_t *agRoot,
1550*4e1bc9a0SAchim Leubner agsaIORequestDesc_t *pRequest,
1551*4e1bc9a0SAchim Leubner bit32 status,
1552*4e1bc9a0SAchim Leubner bit32 sspTag
1553*4e1bc9a0SAchim Leubner )
1554*4e1bc9a0SAchim Leubner {
1555*4e1bc9a0SAchim Leubner agsaLLRoot_t *saRoot = (agsaLLRoot_t *)(agRoot->sdkData);
1556*4e1bc9a0SAchim Leubner agsaDeviceDesc_t *pDevice = agNULL;
1557*4e1bc9a0SAchim Leubner
1558*4e1bc9a0SAchim Leubner smTraceFuncEnter(hpDBG_VERY_LOUD,"5h");
1559*4e1bc9a0SAchim Leubner
1560*4e1bc9a0SAchim Leubner SA_ASSERT(NULL != pRequest, "pRequest cannot be null");
1561*4e1bc9a0SAchim Leubner
1562*4e1bc9a0SAchim Leubner /* If the request is still valid */
1563*4e1bc9a0SAchim Leubner if ( agTRUE == pRequest->valid )
1564*4e1bc9a0SAchim Leubner {
1565*4e1bc9a0SAchim Leubner /* get device */
1566*4e1bc9a0SAchim Leubner pDevice = pRequest->pDevice;
1567*4e1bc9a0SAchim Leubner
1568*4e1bc9a0SAchim Leubner /* process different request type */
1569*4e1bc9a0SAchim Leubner switch (pRequest->requestType & AGSA_REQTYPE_MASK)
1570*4e1bc9a0SAchim Leubner {
1571*4e1bc9a0SAchim Leubner case AGSA_SSP_REQTYPE:
1572*4e1bc9a0SAchim Leubner {
1573*4e1bc9a0SAchim Leubner SA_ASSERT(pRequest->valid, "pRequest not valid");
1574*4e1bc9a0SAchim Leubner pRequest->completionCB(agRoot,
1575*4e1bc9a0SAchim Leubner pRequest->pIORequestContext,
1576*4e1bc9a0SAchim Leubner OSSA_IO_SUCCESS,
1577*4e1bc9a0SAchim Leubner 0,
1578*4e1bc9a0SAchim Leubner agNULL,
1579*4e1bc9a0SAchim Leubner (bit16)(sspTag & SSPTAG_BITS),
1580*4e1bc9a0SAchim Leubner 0);
1581*4e1bc9a0SAchim Leubner ossaSingleThreadedEnter(agRoot, LL_IOREQ_LOCKEQ_LOCK);
1582*4e1bc9a0SAchim Leubner /* Delete the request from the pendingIORequests */
1583*4e1bc9a0SAchim Leubner saLlistIORemove(&(pDevice->pendingIORequests), &(pRequest->linkNode));
1584*4e1bc9a0SAchim Leubner /* return the request to free pool */
1585*4e1bc9a0SAchim Leubner pRequest->valid = agFALSE;
1586*4e1bc9a0SAchim Leubner saLlistIOAdd(&(saRoot->freeIORequests), &(pRequest->linkNode));
1587*4e1bc9a0SAchim Leubner ossaSingleThreadedLeave(agRoot, LL_IOREQ_LOCKEQ_LOCK);
1588*4e1bc9a0SAchim Leubner
1589*4e1bc9a0SAchim Leubner
1590*4e1bc9a0SAchim Leubner break;
1591*4e1bc9a0SAchim Leubner }
1592*4e1bc9a0SAchim Leubner case AGSA_SATA_REQTYPE:
1593*4e1bc9a0SAchim Leubner {
1594*4e1bc9a0SAchim Leubner SA_DBG5(("siIODone: SATA complete\n"));
1595*4e1bc9a0SAchim Leubner
1596*4e1bc9a0SAchim Leubner if ( agNULL != pRequest->pIORequestContext )
1597*4e1bc9a0SAchim Leubner {
1598*4e1bc9a0SAchim Leubner SA_DBG5(("siIODone: Complete Request\n"));
1599*4e1bc9a0SAchim Leubner
1600*4e1bc9a0SAchim Leubner (*(ossaSATACompletedCB_t)(pRequest->completionCB))(agRoot,
1601*4e1bc9a0SAchim Leubner pRequest->pIORequestContext,
1602*4e1bc9a0SAchim Leubner OSSA_IO_SUCCESS,
1603*4e1bc9a0SAchim Leubner agNULL,
1604*4e1bc9a0SAchim Leubner 0,
1605*4e1bc9a0SAchim Leubner agNULL);
1606*4e1bc9a0SAchim Leubner }
1607*4e1bc9a0SAchim Leubner ossaSingleThreadedEnter(agRoot, LL_IOREQ_LOCKEQ_LOCK);
1608*4e1bc9a0SAchim Leubner /* Delete the request from the pendingIORequests */
1609*4e1bc9a0SAchim Leubner saLlistIORemove(&(pDevice->pendingIORequests), &(pRequest->linkNode));
1610*4e1bc9a0SAchim Leubner /* return the request to free pool */
1611*4e1bc9a0SAchim Leubner saLlistIOAdd(&(saRoot->freeIORequests), &(pRequest->linkNode));
1612*4e1bc9a0SAchim Leubner ossaSingleThreadedLeave(agRoot, LL_IOREQ_LOCKEQ_LOCK);
1613*4e1bc9a0SAchim Leubner
1614*4e1bc9a0SAchim Leubner pRequest->valid = agFALSE;
1615*4e1bc9a0SAchim Leubner
1616*4e1bc9a0SAchim Leubner break;
1617*4e1bc9a0SAchim Leubner }
1618*4e1bc9a0SAchim Leubner case AGSA_SMP_REQTYPE:
1619*4e1bc9a0SAchim Leubner {
1620*4e1bc9a0SAchim Leubner if ( agNULL != pRequest->pIORequestContext )
1621*4e1bc9a0SAchim Leubner {
1622*4e1bc9a0SAchim Leubner (*(ossaSMPCompletedCB_t)(pRequest->completionCB))(agRoot,
1623*4e1bc9a0SAchim Leubner pRequest->pIORequestContext,
1624*4e1bc9a0SAchim Leubner OSSA_IO_SUCCESS,
1625*4e1bc9a0SAchim Leubner 0,
1626*4e1bc9a0SAchim Leubner agNULL);
1627*4e1bc9a0SAchim Leubner }
1628*4e1bc9a0SAchim Leubner
1629*4e1bc9a0SAchim Leubner ossaSingleThreadedEnter(agRoot, LL_IOREQ_LOCKEQ_LOCK);
1630*4e1bc9a0SAchim Leubner /* Delete the request from the pendingSMPRequests */
1631*4e1bc9a0SAchim Leubner saLlistIORemove(&(pDevice->pendingIORequests), &(pRequest->linkNode));
1632*4e1bc9a0SAchim Leubner /* return the request to free pool */
1633*4e1bc9a0SAchim Leubner if(saLlistIOGetCount(&(saRoot->freeReservedRequests)) < SA_RESERVED_REQUEST_COUNT)
1634*4e1bc9a0SAchim Leubner {
1635*4e1bc9a0SAchim Leubner SA_DBG1(("siIODone: saving pRequest (%p) for later use\n", pRequest));
1636*4e1bc9a0SAchim Leubner saLlistIOAdd(&(saRoot->freeReservedRequests), &(pRequest->linkNode));
1637*4e1bc9a0SAchim Leubner }
1638*4e1bc9a0SAchim Leubner else
1639*4e1bc9a0SAchim Leubner {
1640*4e1bc9a0SAchim Leubner saLlistIOAdd(&(saRoot->freeIORequests), &(pRequest->linkNode));
1641*4e1bc9a0SAchim Leubner }
1642*4e1bc9a0SAchim Leubner ossaSingleThreadedLeave(agRoot, LL_IOREQ_LOCKEQ_LOCK);
1643*4e1bc9a0SAchim Leubner
1644*4e1bc9a0SAchim Leubner pRequest->valid = agFALSE;
1645*4e1bc9a0SAchim Leubner
1646*4e1bc9a0SAchim Leubner break;
1647*4e1bc9a0SAchim Leubner }
1648*4e1bc9a0SAchim Leubner default:
1649*4e1bc9a0SAchim Leubner {
1650*4e1bc9a0SAchim Leubner SA_DBG1(("siIODone: unknown request type (%x) is completed. HTag=0x%x\n", pRequest->requestType, pRequest->HTag));
1651*4e1bc9a0SAchim Leubner break;
1652*4e1bc9a0SAchim Leubner }
1653*4e1bc9a0SAchim Leubner }
1654*4e1bc9a0SAchim Leubner }
1655*4e1bc9a0SAchim Leubner else
1656*4e1bc9a0SAchim Leubner {
1657*4e1bc9a0SAchim Leubner SA_DBG1(("siIODone: The request is not valid any more. HTag=0x%x requestType=0x%x\n", pRequest->HTag, pRequest->requestType));
1658*4e1bc9a0SAchim Leubner }
1659*4e1bc9a0SAchim Leubner
1660*4e1bc9a0SAchim Leubner smTraceFuncExit(hpDBG_VERY_LOUD, 'a', "5h");
1661*4e1bc9a0SAchim Leubner
1662*4e1bc9a0SAchim Leubner }
1663*4e1bc9a0SAchim Leubner
1664*4e1bc9a0SAchim Leubner /******************************************************************************/
1665*4e1bc9a0SAchim Leubner /*! \brief Routine to handle abnormal completed IO/SMP event
1666*4e1bc9a0SAchim Leubner *
1667*4e1bc9a0SAchim Leubner * Handle abnormal completed IO/SMP
1668*4e1bc9a0SAchim Leubner *
1669*4e1bc9a0SAchim Leubner * \param agRoot handles for this instance of SAS/SATA hardware
1670*4e1bc9a0SAchim Leubner * \param pRequest Pointer of IO request of the IO
1671*4e1bc9a0SAchim Leubner * \param status status of the IO
1672*4e1bc9a0SAchim Leubner * \param param Length
1673*4e1bc9a0SAchim Leubner *
1674*4e1bc9a0SAchim Leubner * \return -void-
1675*4e1bc9a0SAchim Leubner */
1676*4e1bc9a0SAchim Leubner /*******************************************************************************/
siAbnormal(agsaRoot_t * agRoot,agsaIORequestDesc_t * pRequest,bit32 status,bit32 param,bit32 sspTag)1677*4e1bc9a0SAchim Leubner GLOBAL void siAbnormal(
1678*4e1bc9a0SAchim Leubner agsaRoot_t *agRoot,
1679*4e1bc9a0SAchim Leubner agsaIORequestDesc_t *pRequest,
1680*4e1bc9a0SAchim Leubner bit32 status,
1681*4e1bc9a0SAchim Leubner bit32 param,
1682*4e1bc9a0SAchim Leubner bit32 sspTag
1683*4e1bc9a0SAchim Leubner )
1684*4e1bc9a0SAchim Leubner {
1685*4e1bc9a0SAchim Leubner agsaLLRoot_t *saRoot = (agsaLLRoot_t *)(agRoot->sdkData);
1686*4e1bc9a0SAchim Leubner agsaDeviceDesc_t *pDevice;
1687*4e1bc9a0SAchim Leubner
1688*4e1bc9a0SAchim Leubner smTraceFuncEnter(hpDBG_VERY_LOUD,"5i");
1689*4e1bc9a0SAchim Leubner
1690*4e1bc9a0SAchim Leubner if (agNULL == pRequest)
1691*4e1bc9a0SAchim Leubner {
1692*4e1bc9a0SAchim Leubner SA_DBG1(("siAbnormal: pRequest is NULL.\n"));
1693*4e1bc9a0SAchim Leubner smTraceFuncExit(hpDBG_VERY_LOUD, 'a', "5i");
1694*4e1bc9a0SAchim Leubner return;
1695*4e1bc9a0SAchim Leubner }
1696*4e1bc9a0SAchim Leubner
1697*4e1bc9a0SAchim Leubner /* If the request is still valid */
1698*4e1bc9a0SAchim Leubner if ( agTRUE == pRequest->valid )
1699*4e1bc9a0SAchim Leubner {
1700*4e1bc9a0SAchim Leubner /* get device */
1701*4e1bc9a0SAchim Leubner
1702*4e1bc9a0SAchim Leubner SA_ASSERT((pRequest->pIORequestContext->osData != pRequest->pIORequestContext->sdkData), "pIORequestContext");
1703*4e1bc9a0SAchim Leubner
1704*4e1bc9a0SAchim Leubner pDevice = pRequest->pDevice;
1705*4e1bc9a0SAchim Leubner
1706*4e1bc9a0SAchim Leubner /* remove the IO request from IOMap */
1707*4e1bc9a0SAchim Leubner saRoot->IOMap[pRequest->HTag].Tag = MARK_OFF;
1708*4e1bc9a0SAchim Leubner saRoot->IOMap[pRequest->HTag].IORequest = agNULL;
1709*4e1bc9a0SAchim Leubner saRoot->IOMap[pRequest->HTag].agContext = agNULL;
1710*4e1bc9a0SAchim Leubner
1711*4e1bc9a0SAchim Leubner smTrace(hpDBG_VERY_LOUD,"P6",status );
1712*4e1bc9a0SAchim Leubner /* TP:P6 siAbnormal status */
1713*4e1bc9a0SAchim Leubner smTrace(hpDBG_VERY_LOUD,"P7",param );
1714*4e1bc9a0SAchim Leubner /* TP:P7 siAbnormal param */
1715*4e1bc9a0SAchim Leubner /* process different request type */
1716*4e1bc9a0SAchim Leubner switch (pRequest->requestType & AGSA_REQTYPE_MASK)
1717*4e1bc9a0SAchim Leubner {
1718*4e1bc9a0SAchim Leubner case AGSA_SSP_REQTYPE:
1719*4e1bc9a0SAchim Leubner {
1720*4e1bc9a0SAchim Leubner (*(ossaSSPCompletedCB_t)(pRequest->completionCB))(agRoot,
1721*4e1bc9a0SAchim Leubner pRequest->pIORequestContext,
1722*4e1bc9a0SAchim Leubner status,
1723*4e1bc9a0SAchim Leubner param,
1724*4e1bc9a0SAchim Leubner agNULL,
1725*4e1bc9a0SAchim Leubner (bit16)(sspTag & SSPTAG_BITS),
1726*4e1bc9a0SAchim Leubner ((sspTag & SSP_AGR_S_BIT)? (1 << 0) : 0));
1727*4e1bc9a0SAchim Leubner
1728*4e1bc9a0SAchim Leubner ossaSingleThreadedEnter(agRoot, LL_IOREQ_LOCKEQ_LOCK);
1729*4e1bc9a0SAchim Leubner /* Delete the request from the pendingIORequests */
1730*4e1bc9a0SAchim Leubner saLlistIORemove(&(pDevice->pendingIORequests), &(pRequest->linkNode));
1731*4e1bc9a0SAchim Leubner pRequest->valid = agFALSE;
1732*4e1bc9a0SAchim Leubner /* return the request to free pool */
1733*4e1bc9a0SAchim Leubner if(saLlistIOGetCount(&(saRoot->freeReservedRequests)) < SA_RESERVED_REQUEST_COUNT)
1734*4e1bc9a0SAchim Leubner {
1735*4e1bc9a0SAchim Leubner SA_DBG1(("siAbnormal: saving pRequest (%p) for later use\n", pRequest));
1736*4e1bc9a0SAchim Leubner saLlistIOAdd(&(saRoot->freeReservedRequests), &(pRequest->linkNode));
1737*4e1bc9a0SAchim Leubner }
1738*4e1bc9a0SAchim Leubner else
1739*4e1bc9a0SAchim Leubner {
1740*4e1bc9a0SAchim Leubner /* return the request to free pool */
1741*4e1bc9a0SAchim Leubner saLlistIOAdd(&(saRoot->freeIORequests), &(pRequest->linkNode));
1742*4e1bc9a0SAchim Leubner }
1743*4e1bc9a0SAchim Leubner ossaSingleThreadedLeave(agRoot, LL_IOREQ_LOCKEQ_LOCK);
1744*4e1bc9a0SAchim Leubner
1745*4e1bc9a0SAchim Leubner break;
1746*4e1bc9a0SAchim Leubner }
1747*4e1bc9a0SAchim Leubner case AGSA_SATA_REQTYPE:
1748*4e1bc9a0SAchim Leubner {
1749*4e1bc9a0SAchim Leubner SA_DBG5(("siAbnormal: SATA \n"));
1750*4e1bc9a0SAchim Leubner
1751*4e1bc9a0SAchim Leubner if ( agNULL != pRequest->pIORequestContext )
1752*4e1bc9a0SAchim Leubner {
1753*4e1bc9a0SAchim Leubner SA_DBG5(("siAbnormal: Calling SATACompletedCB\n"));
1754*4e1bc9a0SAchim Leubner
1755*4e1bc9a0SAchim Leubner (*(ossaSATACompletedCB_t)(pRequest->completionCB))(agRoot,
1756*4e1bc9a0SAchim Leubner pRequest->pIORequestContext,
1757*4e1bc9a0SAchim Leubner status,
1758*4e1bc9a0SAchim Leubner agNULL,
1759*4e1bc9a0SAchim Leubner param,
1760*4e1bc9a0SAchim Leubner agNULL);
1761*4e1bc9a0SAchim Leubner }
1762*4e1bc9a0SAchim Leubner
1763*4e1bc9a0SAchim Leubner ossaSingleThreadedEnter(agRoot, LL_IOREQ_LOCKEQ_LOCK);
1764*4e1bc9a0SAchim Leubner /* Delete the request from the pendingIORequests */
1765*4e1bc9a0SAchim Leubner saLlistIORemove(&(pDevice->pendingIORequests), &(pRequest->linkNode));
1766*4e1bc9a0SAchim Leubner /* return the request to free pool */
1767*4e1bc9a0SAchim Leubner pRequest->valid = agFALSE;
1768*4e1bc9a0SAchim Leubner if(saLlistIOGetCount(&(saRoot->freeReservedRequests)) < SA_RESERVED_REQUEST_COUNT)
1769*4e1bc9a0SAchim Leubner {
1770*4e1bc9a0SAchim Leubner SA_DBG1(("siAbnormal: saving pRequest (%p) for later use\n", pRequest));
1771*4e1bc9a0SAchim Leubner saLlistIOAdd(&(saRoot->freeReservedRequests), &(pRequest->linkNode));
1772*4e1bc9a0SAchim Leubner }
1773*4e1bc9a0SAchim Leubner else
1774*4e1bc9a0SAchim Leubner {
1775*4e1bc9a0SAchim Leubner /* return the request to free pool */
1776*4e1bc9a0SAchim Leubner saLlistIOAdd(&(saRoot->freeIORequests), &(pRequest->linkNode));
1777*4e1bc9a0SAchim Leubner }
1778*4e1bc9a0SAchim Leubner ossaSingleThreadedLeave(agRoot, LL_IOREQ_LOCKEQ_LOCK);
1779*4e1bc9a0SAchim Leubner
1780*4e1bc9a0SAchim Leubner break;
1781*4e1bc9a0SAchim Leubner }
1782*4e1bc9a0SAchim Leubner case AGSA_SMP_REQTYPE:
1783*4e1bc9a0SAchim Leubner {
1784*4e1bc9a0SAchim Leubner if ( agNULL != pRequest->pIORequestContext )
1785*4e1bc9a0SAchim Leubner {
1786*4e1bc9a0SAchim Leubner (*(ossaSMPCompletedCB_t)(pRequest->completionCB))(agRoot,
1787*4e1bc9a0SAchim Leubner pRequest->pIORequestContext,
1788*4e1bc9a0SAchim Leubner status,
1789*4e1bc9a0SAchim Leubner param,
1790*4e1bc9a0SAchim Leubner agNULL);
1791*4e1bc9a0SAchim Leubner }
1792*4e1bc9a0SAchim Leubner
1793*4e1bc9a0SAchim Leubner ossaSingleThreadedEnter(agRoot, LL_IOREQ_LOCKEQ_LOCK);
1794*4e1bc9a0SAchim Leubner /* Delete the request from the pendingSMPRequests */
1795*4e1bc9a0SAchim Leubner saLlistIORemove(&(pDevice->pendingIORequests), &(pRequest->linkNode));
1796*4e1bc9a0SAchim Leubner /* return the request to free pool */
1797*4e1bc9a0SAchim Leubner pRequest->valid = agFALSE;
1798*4e1bc9a0SAchim Leubner if(saLlistIOGetCount(&(saRoot->freeReservedRequests)) < SA_RESERVED_REQUEST_COUNT)
1799*4e1bc9a0SAchim Leubner {
1800*4e1bc9a0SAchim Leubner SA_DBG1(("siAbnormal: saving pRequest (%p) for later use\n", pRequest));
1801*4e1bc9a0SAchim Leubner saLlistIOAdd(&(saRoot->freeReservedRequests), &(pRequest->linkNode));
1802*4e1bc9a0SAchim Leubner }
1803*4e1bc9a0SAchim Leubner else
1804*4e1bc9a0SAchim Leubner {
1805*4e1bc9a0SAchim Leubner /* return the request to free pool */
1806*4e1bc9a0SAchim Leubner saLlistIOAdd(&(saRoot->freeIORequests), &(pRequest->linkNode));
1807*4e1bc9a0SAchim Leubner }
1808*4e1bc9a0SAchim Leubner ossaSingleThreadedLeave(agRoot, LL_IOREQ_LOCKEQ_LOCK);
1809*4e1bc9a0SAchim Leubner
1810*4e1bc9a0SAchim Leubner break;
1811*4e1bc9a0SAchim Leubner }
1812*4e1bc9a0SAchim Leubner default:
1813*4e1bc9a0SAchim Leubner {
1814*4e1bc9a0SAchim Leubner SA_DBG1(("siAbnormal: unknown request type (%x) is completed. Tag=0x%x\n", pRequest->requestType, pRequest->HTag));
1815*4e1bc9a0SAchim Leubner break;
1816*4e1bc9a0SAchim Leubner }
1817*4e1bc9a0SAchim Leubner }
1818*4e1bc9a0SAchim Leubner
1819*4e1bc9a0SAchim Leubner }
1820*4e1bc9a0SAchim Leubner else
1821*4e1bc9a0SAchim Leubner {
1822*4e1bc9a0SAchim Leubner SA_DBG1(("siAbnormal: The request is not valid any more. Tag=0x%x\n", pRequest->HTag));
1823*4e1bc9a0SAchim Leubner }
1824*4e1bc9a0SAchim Leubner
1825*4e1bc9a0SAchim Leubner smTraceFuncExit(hpDBG_VERY_LOUD, 'b', "5i");
1826*4e1bc9a0SAchim Leubner
1827*4e1bc9a0SAchim Leubner return;
1828*4e1bc9a0SAchim Leubner }
1829*4e1bc9a0SAchim Leubner
1830*4e1bc9a0SAchim Leubner
1831*4e1bc9a0SAchim Leubner /******************************************************************************/
1832*4e1bc9a0SAchim Leubner /*! \brief Routine to handle abnormal DIF completed IO/SMP event
1833*4e1bc9a0SAchim Leubner *
1834*4e1bc9a0SAchim Leubner * Handle abnormal completed IO/SMP
1835*4e1bc9a0SAchim Leubner *
1836*4e1bc9a0SAchim Leubner * \param agRoot handles for this instance of SAS/SATA hardware
1837*4e1bc9a0SAchim Leubner * \param pRequest Pointer of IO request of the IO
1838*4e1bc9a0SAchim Leubner * \param status status of the IO
1839*4e1bc9a0SAchim Leubner * \param param Length
1840*4e1bc9a0SAchim Leubner *
1841*4e1bc9a0SAchim Leubner * \return -void-
1842*4e1bc9a0SAchim Leubner */
1843*4e1bc9a0SAchim Leubner /*******************************************************************************/
siDifAbnormal(agsaRoot_t * agRoot,agsaIORequestDesc_t * pRequest,bit32 status,bit32 param,bit32 sspTag,bit32 * pMsg1)1844*4e1bc9a0SAchim Leubner GLOBAL void siDifAbnormal(
1845*4e1bc9a0SAchim Leubner agsaRoot_t *agRoot,
1846*4e1bc9a0SAchim Leubner agsaIORequestDesc_t *pRequest,
1847*4e1bc9a0SAchim Leubner bit32 status,
1848*4e1bc9a0SAchim Leubner bit32 param,
1849*4e1bc9a0SAchim Leubner bit32 sspTag,
1850*4e1bc9a0SAchim Leubner bit32 *pMsg1
1851*4e1bc9a0SAchim Leubner )
1852*4e1bc9a0SAchim Leubner {
1853*4e1bc9a0SAchim Leubner agsaLLRoot_t *saRoot = (agsaLLRoot_t *)(agRoot->sdkData);
1854*4e1bc9a0SAchim Leubner agsaDeviceDesc_t *pDevice;
1855*4e1bc9a0SAchim Leubner
1856*4e1bc9a0SAchim Leubner smTraceFuncEnter(hpDBG_VERY_LOUD,"2S");
1857*4e1bc9a0SAchim Leubner
1858*4e1bc9a0SAchim Leubner if (agNULL == pRequest)
1859*4e1bc9a0SAchim Leubner {
1860*4e1bc9a0SAchim Leubner SA_DBG1(("siDifAbnormal: pRequest is NULL.\n"));
1861*4e1bc9a0SAchim Leubner smTraceFuncExit(hpDBG_VERY_LOUD, 'a', "2S");
1862*4e1bc9a0SAchim Leubner return;
1863*4e1bc9a0SAchim Leubner }
1864*4e1bc9a0SAchim Leubner
1865*4e1bc9a0SAchim Leubner /* If the request is still valid */
1866*4e1bc9a0SAchim Leubner if ( agTRUE == pRequest->valid )
1867*4e1bc9a0SAchim Leubner {
1868*4e1bc9a0SAchim Leubner /* get device */
1869*4e1bc9a0SAchim Leubner pDevice = pRequest->pDevice;
1870*4e1bc9a0SAchim Leubner
1871*4e1bc9a0SAchim Leubner /* remove the IO request from IOMap */
1872*4e1bc9a0SAchim Leubner saRoot->IOMap[pRequest->HTag].Tag = MARK_OFF;
1873*4e1bc9a0SAchim Leubner saRoot->IOMap[pRequest->HTag].IORequest = agNULL;
1874*4e1bc9a0SAchim Leubner saRoot->IOMap[pRequest->HTag].agContext = agNULL;
1875*4e1bc9a0SAchim Leubner
1876*4e1bc9a0SAchim Leubner smTrace(hpDBG_VERY_LOUD,"P6",status );
1877*4e1bc9a0SAchim Leubner /* TP:P6 siDifAbnormal status */
1878*4e1bc9a0SAchim Leubner /* process different request type */
1879*4e1bc9a0SAchim Leubner switch (pRequest->requestType & AGSA_REQTYPE_MASK)
1880*4e1bc9a0SAchim Leubner {
1881*4e1bc9a0SAchim Leubner case AGSA_SSP_REQTYPE:
1882*4e1bc9a0SAchim Leubner {
1883*4e1bc9a0SAchim Leubner agsaDifDetails_t agDifDetails;
1884*4e1bc9a0SAchim Leubner agsaSSPCompletionDifRsp_t *pIomb;
1885*4e1bc9a0SAchim Leubner pIomb = (agsaSSPCompletionDifRsp_t *)pMsg1;
1886*4e1bc9a0SAchim Leubner si_memset(&agDifDetails, 0, sizeof(agDifDetails));
1887*4e1bc9a0SAchim Leubner
1888*4e1bc9a0SAchim Leubner OSSA_READ_LE_32(agRoot, &agDifDetails.UpperLBA, pIomb, OSSA_OFFSET_OF(agsaSSPCompletionDifRsp_t,UpperLBA ));
1889*4e1bc9a0SAchim Leubner OSSA_READ_LE_32(agRoot, &agDifDetails.LowerLBA, pIomb, OSSA_OFFSET_OF(agsaSSPCompletionDifRsp_t,LowerLBA ));
1890*4e1bc9a0SAchim Leubner OSSA_READ_LE_32(agRoot, &agDifDetails.sasAddressHi, pIomb, OSSA_OFFSET_OF(agsaSSPCompletionDifRsp_t,sasAddressHi ));
1891*4e1bc9a0SAchim Leubner OSSA_READ_LE_32(agRoot, &agDifDetails.sasAddressLo, pIomb, OSSA_OFFSET_OF(agsaSSPCompletionDifRsp_t,sasAddressLo));
1892*4e1bc9a0SAchim Leubner OSSA_READ_LE_32(agRoot, &agDifDetails.ExpectedCRCUDT01, pIomb, OSSA_OFFSET_OF(agsaSSPCompletionDifRsp_t,ExpectedCRCUDT01 ));
1893*4e1bc9a0SAchim Leubner OSSA_READ_LE_32(agRoot, &agDifDetails.ExpectedUDT2345, pIomb, OSSA_OFFSET_OF(agsaSSPCompletionDifRsp_t,ExpectedUDT2345));
1894*4e1bc9a0SAchim Leubner OSSA_READ_LE_32(agRoot, &agDifDetails.ActualCRCUDT01, pIomb, OSSA_OFFSET_OF(agsaSSPCompletionDifRsp_t,ActualCRCUDT01 ));
1895*4e1bc9a0SAchim Leubner OSSA_READ_LE_32(agRoot, &agDifDetails.ActualUDT2345, pIomb, OSSA_OFFSET_OF(agsaSSPCompletionDifRsp_t,ActualUDT2345));
1896*4e1bc9a0SAchim Leubner OSSA_READ_LE_32(agRoot, &agDifDetails.DIFErrDevID, pIomb, OSSA_OFFSET_OF(agsaSSPCompletionDifRsp_t,DIFErrDevID ));
1897*4e1bc9a0SAchim Leubner OSSA_READ_LE_32(agRoot, &agDifDetails.ErrBoffsetEDataLen, pIomb, OSSA_OFFSET_OF(agsaSSPCompletionDifRsp_t,ErrBoffsetEDataLen ));
1898*4e1bc9a0SAchim Leubner agDifDetails.frame = (void *)(bit8*)(pIomb+ OSSA_OFFSET_OF(agsaSSPCompletionDifRsp_t, EDATA_FRM));
1899*4e1bc9a0SAchim Leubner
1900*4e1bc9a0SAchim Leubner (*(ossaSSPCompletedCB_t)(pRequest->completionCB))(agRoot,
1901*4e1bc9a0SAchim Leubner pRequest->pIORequestContext,
1902*4e1bc9a0SAchim Leubner status,
1903*4e1bc9a0SAchim Leubner param,
1904*4e1bc9a0SAchim Leubner &agDifDetails,
1905*4e1bc9a0SAchim Leubner (bit16)(sspTag & SSPTAG_BITS),
1906*4e1bc9a0SAchim Leubner ((sspTag & SSP_AGR_S_BIT)? (1 << 0) : 0));
1907*4e1bc9a0SAchim Leubner
1908*4e1bc9a0SAchim Leubner ossaSingleThreadedEnter(agRoot, LL_IOREQ_LOCKEQ_LOCK);
1909*4e1bc9a0SAchim Leubner pRequest->valid = agFALSE;
1910*4e1bc9a0SAchim Leubner /* Delete the request from the pendingIORequests */
1911*4e1bc9a0SAchim Leubner saLlistIORemove(&(pDevice->pendingIORequests), &(pRequest->linkNode));
1912*4e1bc9a0SAchim Leubner
1913*4e1bc9a0SAchim Leubner /* return the request to free pool */
1914*4e1bc9a0SAchim Leubner if(saLlistIOGetCount(&(saRoot->freeReservedRequests)) < SA_RESERVED_REQUEST_COUNT)
1915*4e1bc9a0SAchim Leubner {
1916*4e1bc9a0SAchim Leubner SA_DBG1(("siDifAbnormal: saving pRequest (%p) for later use\n", pRequest));
1917*4e1bc9a0SAchim Leubner saLlistIOAdd(&(saRoot->freeReservedRequests), &(pRequest->linkNode));
1918*4e1bc9a0SAchim Leubner }
1919*4e1bc9a0SAchim Leubner else
1920*4e1bc9a0SAchim Leubner {
1921*4e1bc9a0SAchim Leubner /* return the request to free pool */
1922*4e1bc9a0SAchim Leubner saLlistIOAdd(&(saRoot->freeIORequests), &(pRequest->linkNode));
1923*4e1bc9a0SAchim Leubner }
1924*4e1bc9a0SAchim Leubner ossaSingleThreadedLeave(agRoot, LL_IOREQ_LOCKEQ_LOCK);
1925*4e1bc9a0SAchim Leubner
1926*4e1bc9a0SAchim Leubner break;
1927*4e1bc9a0SAchim Leubner }
1928*4e1bc9a0SAchim Leubner default:
1929*4e1bc9a0SAchim Leubner {
1930*4e1bc9a0SAchim Leubner SA_DBG1(("siDifAbnormal: unknown request type (%x) is completed. Tag=0x%x\n", pRequest->requestType, pRequest->HTag));
1931*4e1bc9a0SAchim Leubner break;
1932*4e1bc9a0SAchim Leubner }
1933*4e1bc9a0SAchim Leubner }
1934*4e1bc9a0SAchim Leubner
1935*4e1bc9a0SAchim Leubner }
1936*4e1bc9a0SAchim Leubner else
1937*4e1bc9a0SAchim Leubner {
1938*4e1bc9a0SAchim Leubner SA_DBG1(("siDifAbnormal: The request is not valid any more. Tag=0x%x\n", pRequest->HTag));
1939*4e1bc9a0SAchim Leubner }
1940*4e1bc9a0SAchim Leubner
1941*4e1bc9a0SAchim Leubner smTraceFuncExit(hpDBG_VERY_LOUD, 'b', "2S");
1942*4e1bc9a0SAchim Leubner
1943*4e1bc9a0SAchim Leubner return;
1944*4e1bc9a0SAchim Leubner }
1945*4e1bc9a0SAchim Leubner
1946*4e1bc9a0SAchim Leubner
1947*4e1bc9a0SAchim Leubner /******************************************************************************/
1948*4e1bc9a0SAchim Leubner /*! \brief Routine to handle for received SMP response event
1949*4e1bc9a0SAchim Leubner *
1950*4e1bc9a0SAchim Leubner * The handle for received SMP response event
1951*4e1bc9a0SAchim Leubner *
1952*4e1bc9a0SAchim Leubner * \param agRoot handles for this instance of SAS/SATA hardware
1953*4e1bc9a0SAchim Leubner * \param pIomb Pointer of payload of IOMB
1954*4e1bc9a0SAchim Leubner * \param payloadSize size of the payload
1955*4e1bc9a0SAchim Leubner * \param tag the tag of the request SMP
1956*4e1bc9a0SAchim Leubner *
1957*4e1bc9a0SAchim Leubner * \return -void-
1958*4e1bc9a0SAchim Leubner */
1959*4e1bc9a0SAchim Leubner /*******************************************************************************/
siSMPRespRcvd(agsaRoot_t * agRoot,agsaSMPCompletionRsp_t * pIomb,bit32 payloadSize,bit32 tag)1960*4e1bc9a0SAchim Leubner GLOBAL void siSMPRespRcvd(
1961*4e1bc9a0SAchim Leubner agsaRoot_t *agRoot,
1962*4e1bc9a0SAchim Leubner agsaSMPCompletionRsp_t *pIomb,
1963*4e1bc9a0SAchim Leubner bit32 payloadSize,
1964*4e1bc9a0SAchim Leubner bit32 tag
1965*4e1bc9a0SAchim Leubner )
1966*4e1bc9a0SAchim Leubner {
1967*4e1bc9a0SAchim Leubner agsaLLRoot_t *saRoot = (agsaLLRoot_t *)(agRoot->sdkData);
1968*4e1bc9a0SAchim Leubner agsaFrameHandle_t frameHandle;
1969*4e1bc9a0SAchim Leubner agsaIORequestDesc_t *pRequest;
1970*4e1bc9a0SAchim Leubner agsaDeviceDesc_t *pDevice;
1971*4e1bc9a0SAchim Leubner agsaPort_t *pPort;
1972*4e1bc9a0SAchim Leubner
1973*4e1bc9a0SAchim Leubner smTraceFuncEnter(hpDBG_VERY_LOUD,"5j");
1974*4e1bc9a0SAchim Leubner
1975*4e1bc9a0SAchim Leubner /* get the request */
1976*4e1bc9a0SAchim Leubner pRequest = (agsaIORequestDesc_t*)saRoot->IOMap[tag].IORequest;
1977*4e1bc9a0SAchim Leubner SA_ASSERT(pRequest, "pRequest");
1978*4e1bc9a0SAchim Leubner
1979*4e1bc9a0SAchim Leubner /* get the port */
1980*4e1bc9a0SAchim Leubner pPort = pRequest->pPort;
1981*4e1bc9a0SAchim Leubner SA_ASSERT(pPort, "pPort");
1982*4e1bc9a0SAchim Leubner
1983*4e1bc9a0SAchim Leubner if (pRequest->IRmode == 0)
1984*4e1bc9a0SAchim Leubner {
1985*4e1bc9a0SAchim Leubner /* get frame handle - direct response mode */
1986*4e1bc9a0SAchim Leubner frameHandle = (agsaFrameHandle_t)(&(pIomb->SMPrsp[0]));
1987*4e1bc9a0SAchim Leubner #if defined(SALLSDK_DEBUG)
1988*4e1bc9a0SAchim Leubner SA_DBG3(("saSMPRespRcvd(direct): smpRspPtr=0x%p - len=0x%x\n",
1989*4e1bc9a0SAchim Leubner frameHandle,
1990*4e1bc9a0SAchim Leubner payloadSize
1991*4e1bc9a0SAchim Leubner ));
1992*4e1bc9a0SAchim Leubner #endif /* SALLSDK_DEBUG */
1993*4e1bc9a0SAchim Leubner }
1994*4e1bc9a0SAchim Leubner else
1995*4e1bc9a0SAchim Leubner {
1996*4e1bc9a0SAchim Leubner /* indirect response mode */
1997*4e1bc9a0SAchim Leubner frameHandle = agNULL;
1998*4e1bc9a0SAchim Leubner }
1999*4e1bc9a0SAchim Leubner
2000*4e1bc9a0SAchim Leubner /* If the request is still valid */
2001*4e1bc9a0SAchim Leubner if ( agTRUE == pRequest->valid )
2002*4e1bc9a0SAchim Leubner {
2003*4e1bc9a0SAchim Leubner /* get device */
2004*4e1bc9a0SAchim Leubner pDevice = pRequest->pDevice;
2005*4e1bc9a0SAchim Leubner SA_ASSERT(pDevice, "pDevice");
2006*4e1bc9a0SAchim Leubner
2007*4e1bc9a0SAchim Leubner /* Delete the request from the pendingSMPRequests */
2008*4e1bc9a0SAchim Leubner ossaSingleThreadedEnter(agRoot, LL_IOREQ_LOCKEQ_LOCK);
2009*4e1bc9a0SAchim Leubner saLlistIORemove(&(pDevice->pendingIORequests), &(pRequest->linkNode));
2010*4e1bc9a0SAchim Leubner ossaSingleThreadedLeave(agRoot, LL_IOREQ_LOCKEQ_LOCK);
2011*4e1bc9a0SAchim Leubner
2012*4e1bc9a0SAchim Leubner /* If the request is from OS layer */
2013*4e1bc9a0SAchim Leubner if ( agNULL != pRequest->pIORequestContext )
2014*4e1bc9a0SAchim Leubner {
2015*4e1bc9a0SAchim Leubner if (agNULL == frameHandle)
2016*4e1bc9a0SAchim Leubner {
2017*4e1bc9a0SAchim Leubner /* indirect mode */
2018*4e1bc9a0SAchim Leubner /* call back with success */
2019*4e1bc9a0SAchim Leubner (*(ossaSMPCompletedCB_t)(pRequest->completionCB))(agRoot, pRequest->pIORequestContext, OSSA_IO_SUCCESS, payloadSize, frameHandle);
2020*4e1bc9a0SAchim Leubner }
2021*4e1bc9a0SAchim Leubner else
2022*4e1bc9a0SAchim Leubner {
2023*4e1bc9a0SAchim Leubner /* direct mode */
2024*4e1bc9a0SAchim Leubner /* call back with success */
2025*4e1bc9a0SAchim Leubner (*(ossaSMPCompletedCB_t)(pRequest->completionCB))(agRoot, pRequest->pIORequestContext, OSSA_IO_SUCCESS, payloadSize, frameHandle);
2026*4e1bc9a0SAchim Leubner }
2027*4e1bc9a0SAchim Leubner }
2028*4e1bc9a0SAchim Leubner
2029*4e1bc9a0SAchim Leubner /* remove the IO request from IOMap */
2030*4e1bc9a0SAchim Leubner saRoot->IOMap[tag].Tag = MARK_OFF;
2031*4e1bc9a0SAchim Leubner saRoot->IOMap[tag].IORequest = agNULL;
2032*4e1bc9a0SAchim Leubner saRoot->IOMap[tag].agContext = agNULL;
2033*4e1bc9a0SAchim Leubner ossaSingleThreadedEnter(agRoot, LL_IOREQ_LOCKEQ_LOCK);
2034*4e1bc9a0SAchim Leubner pRequest->valid = agFALSE;
2035*4e1bc9a0SAchim Leubner if(saLlistIOGetCount(&(saRoot->freeReservedRequests)) < SA_RESERVED_REQUEST_COUNT)
2036*4e1bc9a0SAchim Leubner {
2037*4e1bc9a0SAchim Leubner SA_DBG1(("siSMPRespRcvd: saving pRequest (%p) for later use\n", pRequest));
2038*4e1bc9a0SAchim Leubner saLlistIOAdd(&(saRoot->freeReservedRequests), &(pRequest->linkNode));
2039*4e1bc9a0SAchim Leubner }
2040*4e1bc9a0SAchim Leubner else
2041*4e1bc9a0SAchim Leubner {
2042*4e1bc9a0SAchim Leubner /* return the request to free pool */
2043*4e1bc9a0SAchim Leubner saLlistIOAdd(&(saRoot->freeIORequests), &(pRequest->linkNode));
2044*4e1bc9a0SAchim Leubner }
2045*4e1bc9a0SAchim Leubner ossaSingleThreadedLeave(agRoot, LL_IOREQ_LOCKEQ_LOCK);
2046*4e1bc9a0SAchim Leubner }
2047*4e1bc9a0SAchim Leubner
2048*4e1bc9a0SAchim Leubner smTraceFuncExit(hpDBG_VERY_LOUD, 'a', "5j");
2049*4e1bc9a0SAchim Leubner
2050*4e1bc9a0SAchim Leubner return;
2051*4e1bc9a0SAchim Leubner }
2052*4e1bc9a0SAchim Leubner
2053*4e1bc9a0SAchim Leubner /******************************************************************************/
2054*4e1bc9a0SAchim Leubner /*! \brief Routine to handle for received Phy Up event
2055*4e1bc9a0SAchim Leubner *
2056*4e1bc9a0SAchim Leubner * The handle for received Phy Up event
2057*4e1bc9a0SAchim Leubner *
2058*4e1bc9a0SAchim Leubner * \param agRoot handles for this instance of SAS/SATA hardware
2059*4e1bc9a0SAchim Leubner * \param phyId for the Phy Up event happened
2060*4e1bc9a0SAchim Leubner * \param agSASIdentify is the remote phy Identify
2061*4e1bc9a0SAchim Leubner * \param portId is the port context index of the phy up event
2062*4e1bc9a0SAchim Leubner * \param deviceId is the device context index
2063*4e1bc9a0SAchim Leubner * \param linkRate link up rate from SPC
2064*4e1bc9a0SAchim Leubner *
2065*4e1bc9a0SAchim Leubner * \return -void-
2066*4e1bc9a0SAchim Leubner */
2067*4e1bc9a0SAchim Leubner /*******************************************************************************/
siEventPhyUpRcvd(agsaRoot_t * agRoot,bit32 phyId,agsaSASIdentify_t * agSASIdentify,bit32 portId,bit32 npipps,bit8 linkRate)2068*4e1bc9a0SAchim Leubner GLOBAL void siEventPhyUpRcvd(
2069*4e1bc9a0SAchim Leubner agsaRoot_t *agRoot,
2070*4e1bc9a0SAchim Leubner bit32 phyId,
2071*4e1bc9a0SAchim Leubner agsaSASIdentify_t *agSASIdentify,
2072*4e1bc9a0SAchim Leubner bit32 portId,
2073*4e1bc9a0SAchim Leubner bit32 npipps,
2074*4e1bc9a0SAchim Leubner bit8 linkRate
2075*4e1bc9a0SAchim Leubner )
2076*4e1bc9a0SAchim Leubner {
2077*4e1bc9a0SAchim Leubner agsaLLRoot_t *saRoot = (agsaLLRoot_t *)(agRoot->sdkData);
2078*4e1bc9a0SAchim Leubner agsaPhy_t *pPhy = &(saRoot->phys[phyId]);
2079*4e1bc9a0SAchim Leubner agsaPort_t *pPort;
2080*4e1bc9a0SAchim Leubner agsaSASIdentify_t remoteIdentify;
2081*4e1bc9a0SAchim Leubner agsaPortContext_t *agPortContext;
2082*4e1bc9a0SAchim Leubner
2083*4e1bc9a0SAchim Leubner smTraceFuncEnter(hpDBG_VERY_LOUD,"5k");
2084*4e1bc9a0SAchim Leubner
2085*4e1bc9a0SAchim Leubner /* Read remote SAS Identify from response message and save it */
2086*4e1bc9a0SAchim Leubner remoteIdentify = *agSASIdentify;
2087*4e1bc9a0SAchim Leubner
2088*4e1bc9a0SAchim Leubner /* get port context from portMap */
2089*4e1bc9a0SAchim Leubner 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));
2090*4e1bc9a0SAchim Leubner agPortContext = (agsaPortContext_t *)saRoot->PortMap[portId].PortContext;
2091*4e1bc9a0SAchim Leubner
2092*4e1bc9a0SAchim Leubner SA_DBG2(("siEventPhyUpRcvd: portID %d PortContext %p linkRate 0x%X\n", portId, agPortContext,linkRate));
2093*4e1bc9a0SAchim Leubner if (smIS_SPCV8006(agRoot))
2094*4e1bc9a0SAchim Leubner {
2095*4e1bc9a0SAchim Leubner SA_DBG1(("siEventPhyUpRcvd: SAS_PHY_UP received for SATA Controller\n"));
2096*4e1bc9a0SAchim Leubner return;
2097*4e1bc9a0SAchim Leubner }
2098*4e1bc9a0SAchim Leubner
2099*4e1bc9a0SAchim Leubner if (agNULL != agPortContext)
2100*4e1bc9a0SAchim Leubner {
2101*4e1bc9a0SAchim Leubner /* existing port */
2102*4e1bc9a0SAchim Leubner pPort = (agsaPort_t *) (agPortContext->sdkData);
2103*4e1bc9a0SAchim Leubner pPort->portId = portId;
2104*4e1bc9a0SAchim Leubner
2105*4e1bc9a0SAchim Leubner /* include the phy to the port */
2106*4e1bc9a0SAchim Leubner pPort->phyMap[phyId] = agTRUE;
2107*4e1bc9a0SAchim Leubner /* Set the port for the phy */
2108*4e1bc9a0SAchim Leubner saRoot->phys[phyId].pPort = pPort;
2109*4e1bc9a0SAchim Leubner
2110*4e1bc9a0SAchim Leubner /* Update port state */
2111*4e1bc9a0SAchim Leubner if (OSSA_PORT_VALID == (npipps & PORT_STATE_MASK))
2112*4e1bc9a0SAchim Leubner {
2113*4e1bc9a0SAchim Leubner pPort->status &= ~PORT_INVALIDATING;
2114*4e1bc9a0SAchim Leubner saRoot->PortMap[portId].PortStatus &= ~PORT_INVALIDATING;
2115*4e1bc9a0SAchim Leubner SA_DBG1(("siEventPhyUpRcvd: portID %d PortContext %p, hitting workaround\n", portId, agPortContext));
2116*4e1bc9a0SAchim Leubner }
2117*4e1bc9a0SAchim Leubner }
2118*4e1bc9a0SAchim Leubner else
2119*4e1bc9a0SAchim Leubner {
2120*4e1bc9a0SAchim Leubner ossaSingleThreadedEnter(agRoot, LL_PORT_LOCK);
2121*4e1bc9a0SAchim Leubner /* new port */
2122*4e1bc9a0SAchim Leubner /* Allocate a free port */
2123*4e1bc9a0SAchim Leubner pPort = (agsaPort_t *) saLlistGetHead(&(saRoot->freePorts));
2124*4e1bc9a0SAchim Leubner if (agNULL != pPort)
2125*4e1bc9a0SAchim Leubner {
2126*4e1bc9a0SAchim Leubner /* Acquire port list lock */
2127*4e1bc9a0SAchim Leubner saLlistRemove(&(saRoot->freePorts), &(pPort->linkNode));
2128*4e1bc9a0SAchim Leubner
2129*4e1bc9a0SAchim Leubner /* setup the port data structure */
2130*4e1bc9a0SAchim Leubner pPort->portContext.osData = agNULL;
2131*4e1bc9a0SAchim Leubner pPort->portContext.sdkData = pPort;
2132*4e1bc9a0SAchim Leubner
2133*4e1bc9a0SAchim Leubner /* Add to valid port list */
2134*4e1bc9a0SAchim Leubner saLlistAdd(&(saRoot->validPorts), &(pPort->linkNode));
2135*4e1bc9a0SAchim Leubner /* Release port list lock */
2136*4e1bc9a0SAchim Leubner ossaSingleThreadedLeave(agRoot, LL_PORT_LOCK);
2137*4e1bc9a0SAchim Leubner
2138*4e1bc9a0SAchim Leubner /* include the phy to the port */
2139*4e1bc9a0SAchim Leubner pPort->phyMap[phyId] = agTRUE;
2140*4e1bc9a0SAchim Leubner /* Set the port for the phy */
2141*4e1bc9a0SAchim Leubner saRoot->phys[phyId].pPort = pPort;
2142*4e1bc9a0SAchim Leubner
2143*4e1bc9a0SAchim Leubner /* Setup portMap based on portId */
2144*4e1bc9a0SAchim Leubner saRoot->PortMap[portId].PortID = portId;
2145*4e1bc9a0SAchim Leubner saRoot->PortMap[portId].PortContext = &(pPort->portContext);
2146*4e1bc9a0SAchim Leubner pPort->portId = portId;
2147*4e1bc9a0SAchim Leubner
2148*4e1bc9a0SAchim Leubner SA_DBG3(("siEventPhyUpRcvd: NewPort portID %d PortContext %p\n", portId, saRoot->PortMap[portId].PortContext));
2149*4e1bc9a0SAchim Leubner }
2150*4e1bc9a0SAchim Leubner else
2151*4e1bc9a0SAchim Leubner {
2152*4e1bc9a0SAchim Leubner ossaSingleThreadedLeave(agRoot, LL_PORT_LOCK);
2153*4e1bc9a0SAchim Leubner /* pPort is agNULL*/
2154*4e1bc9a0SAchim Leubner smTraceFuncExit(hpDBG_VERY_LOUD, 'a', "5k");
2155*4e1bc9a0SAchim Leubner return;
2156*4e1bc9a0SAchim Leubner }
2157*4e1bc9a0SAchim Leubner
2158*4e1bc9a0SAchim Leubner if (OSSA_PORT_VALID == (npipps & PORT_STATE_MASK))
2159*4e1bc9a0SAchim Leubner {
2160*4e1bc9a0SAchim Leubner pPort->status &= ~PORT_INVALIDATING;
2161*4e1bc9a0SAchim Leubner saRoot->PortMap[portId].PortStatus &= ~PORT_INVALIDATING;
2162*4e1bc9a0SAchim Leubner }
2163*4e1bc9a0SAchim Leubner else
2164*4e1bc9a0SAchim Leubner {
2165*4e1bc9a0SAchim Leubner SA_DBG1(("siEventPhyUpRcvd: PortInvalid portID %d PortContext %p\n", portId, saRoot->PortMap[portId].PortContext));
2166*4e1bc9a0SAchim Leubner }
2167*4e1bc9a0SAchim Leubner }
2168*4e1bc9a0SAchim Leubner
2169*4e1bc9a0SAchim Leubner /* adjust the bit fields before callback */
2170*4e1bc9a0SAchim Leubner phyId = (linkRate << SHIFT8) | phyId;
2171*4e1bc9a0SAchim Leubner /* report PhyId, NPIP, PortState */
2172*4e1bc9a0SAchim Leubner phyId |= (npipps & PHY_IN_PORT_MASK) | ((npipps & PORT_STATE_MASK) << SHIFT16);
2173*4e1bc9a0SAchim Leubner ossaHwCB(agRoot, &(pPort->portContext), OSSA_HW_EVENT_SAS_PHY_UP, phyId, agNULL, &remoteIdentify);
2174*4e1bc9a0SAchim Leubner
2175*4e1bc9a0SAchim Leubner /* set PHY_UP status */
2176*4e1bc9a0SAchim Leubner PHY_STATUS_SET(pPhy, PHY_UP);
2177*4e1bc9a0SAchim Leubner
2178*4e1bc9a0SAchim Leubner smTraceFuncExit(hpDBG_VERY_LOUD, 'b', "5k");
2179*4e1bc9a0SAchim Leubner
2180*4e1bc9a0SAchim Leubner /* return */
2181*4e1bc9a0SAchim Leubner return;
2182*4e1bc9a0SAchim Leubner }
2183*4e1bc9a0SAchim Leubner
2184*4e1bc9a0SAchim Leubner /******************************************************************************/
2185*4e1bc9a0SAchim Leubner /*! \brief Routine to handle for received SATA signature event
2186*4e1bc9a0SAchim Leubner *
2187*4e1bc9a0SAchim Leubner * The handle for received SATA signature event
2188*4e1bc9a0SAchim Leubner *
2189*4e1bc9a0SAchim Leubner * \param agRoot handles for this instance of SAS/SATA hardware
2190*4e1bc9a0SAchim Leubner * \param phyId the phy id of the phy received the frame
2191*4e1bc9a0SAchim Leubner * \param pMsg the pointer to the message payload
2192*4e1bc9a0SAchim Leubner * \param portId the port context index of the phy up event
2193*4e1bc9a0SAchim Leubner * \param deviceId the device context index
2194*4e1bc9a0SAchim Leubner * \param linkRate link up rate from SPC
2195*4e1bc9a0SAchim Leubner *
2196*4e1bc9a0SAchim Leubner * \return -void-
2197*4e1bc9a0SAchim Leubner */
2198*4e1bc9a0SAchim Leubner /*******************************************************************************/
siEventSATASignatureRcvd(agsaRoot_t * agRoot,bit32 phyId,void * pMsg,bit32 portId,bit32 npipps,bit8 linkRate)2199*4e1bc9a0SAchim Leubner GLOBAL void siEventSATASignatureRcvd(
2200*4e1bc9a0SAchim Leubner agsaRoot_t *agRoot,
2201*4e1bc9a0SAchim Leubner bit32 phyId,
2202*4e1bc9a0SAchim Leubner void *pMsg,
2203*4e1bc9a0SAchim Leubner bit32 portId,
2204*4e1bc9a0SAchim Leubner bit32 npipps,
2205*4e1bc9a0SAchim Leubner bit8 linkRate
2206*4e1bc9a0SAchim Leubner )
2207*4e1bc9a0SAchim Leubner {
2208*4e1bc9a0SAchim Leubner agsaLLRoot_t *saRoot = (agsaLLRoot_t *)(agRoot->sdkData);
2209*4e1bc9a0SAchim Leubner agsaPhy_t *pPhy = &(saRoot->phys[phyId]);
2210*4e1bc9a0SAchim Leubner agsaPort_t *pPort = agNULL;
2211*4e1bc9a0SAchim Leubner agsaPortContext_t *agPortContext;
2212*4e1bc9a0SAchim Leubner #if defined(SALLSDK_DEBUG)
2213*4e1bc9a0SAchim Leubner agsaFisRegDeviceToHost_t *fisD2H;
2214*4e1bc9a0SAchim Leubner /* Read the D2H FIS */
2215*4e1bc9a0SAchim Leubner fisD2H = (agsaFisRegDeviceToHost_t *)pMsg;
2216*4e1bc9a0SAchim Leubner #endif /* SALLSDK_DEBUG */
2217*4e1bc9a0SAchim Leubner
2218*4e1bc9a0SAchim Leubner smTraceFuncEnter(hpDBG_VERY_LOUD,"5m");
2219*4e1bc9a0SAchim Leubner
2220*4e1bc9a0SAchim Leubner SA_DBG5(("siEventSATASignatureRcvd: About to read the signatureFIS data\n"));
2221*4e1bc9a0SAchim Leubner
2222*4e1bc9a0SAchim Leubner
2223*4e1bc9a0SAchim Leubner SA_DBG5(("agsaFisRegDeviceToHost_t:\n"));
2224*4e1bc9a0SAchim Leubner SA_DBG5((" fisType = %x\n", fisD2H->h.fisType));
2225*4e1bc9a0SAchim Leubner SA_DBG5((" i_pmPort = %x\n", fisD2H->h.i_pmPort));
2226*4e1bc9a0SAchim Leubner SA_DBG5((" status = %x\n", fisD2H->h.status));
2227*4e1bc9a0SAchim Leubner SA_DBG5((" error = %x\n", fisD2H->h.error));
2228*4e1bc9a0SAchim Leubner
2229*4e1bc9a0SAchim Leubner SA_DBG5((" lbaLow = %x\n", fisD2H->d.lbaLow));
2230*4e1bc9a0SAchim Leubner SA_DBG5((" lbaMid = %x\n", fisD2H->d.lbaMid));
2231*4e1bc9a0SAchim Leubner SA_DBG5((" lbaHigh = %x\n", fisD2H->d.lbaHigh));
2232*4e1bc9a0SAchim Leubner SA_DBG5((" device = %x\n", fisD2H->d.device));
2233*4e1bc9a0SAchim Leubner
2234*4e1bc9a0SAchim Leubner SA_DBG5((" lbaLowExp = %x\n", fisD2H->d.lbaLowExp));
2235*4e1bc9a0SAchim Leubner SA_DBG5((" lbaMidExp = %x\n", fisD2H->d.lbaMidExp));
2236*4e1bc9a0SAchim Leubner SA_DBG5((" lbaHighExp = %x\n", fisD2H->d.lbaHighExp));
2237*4e1bc9a0SAchim Leubner SA_DBG5((" reserved4 = %x\n", fisD2H->d.reserved4));
2238*4e1bc9a0SAchim Leubner
2239*4e1bc9a0SAchim Leubner SA_DBG5((" sectorCount = %x\n", fisD2H->d.sectorCount));
2240*4e1bc9a0SAchim Leubner SA_DBG5((" sectorCountExp = %x\n", fisD2H->d.sectorCountExp));
2241*4e1bc9a0SAchim Leubner SA_DBG5((" reserved5 = %x\n", fisD2H->d.reserved5));
2242*4e1bc9a0SAchim Leubner SA_DBG5((" reserved6 = %x\n", fisD2H->d.reserved6));
2243*4e1bc9a0SAchim Leubner
2244*4e1bc9a0SAchim Leubner SA_DBG5((" reserved7 (32) = %08X\n", fisD2H->d.reserved7));
2245*4e1bc9a0SAchim Leubner
2246*4e1bc9a0SAchim Leubner SA_DBG5(("siEventSATASignatureRcvd: GOOD signatureFIS data\n"));
2247*4e1bc9a0SAchim Leubner
2248*4e1bc9a0SAchim Leubner #if defined(SALLSDK_DEBUG)
2249*4e1bc9a0SAchim Leubner /* read signature */
2250*4e1bc9a0SAchim Leubner pPhy->remoteSignature[0] = (bit8) fisD2H->d.sectorCount;
2251*4e1bc9a0SAchim Leubner pPhy->remoteSignature[1] = (bit8) fisD2H->d.lbaLow;
2252*4e1bc9a0SAchim Leubner pPhy->remoteSignature[2] = (bit8) fisD2H->d.lbaMid;
2253*4e1bc9a0SAchim Leubner pPhy->remoteSignature[3] = (bit8) fisD2H->d.lbaHigh;
2254*4e1bc9a0SAchim Leubner pPhy->remoteSignature[4] = (bit8) fisD2H->d.device;
2255*4e1bc9a0SAchim Leubner #endif
2256*4e1bc9a0SAchim Leubner
2257*4e1bc9a0SAchim Leubner /* get port context from portMap */
2258*4e1bc9a0SAchim Leubner 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));
2259*4e1bc9a0SAchim Leubner agPortContext = (agsaPortContext_t *)saRoot->PortMap[portId].PortContext;
2260*4e1bc9a0SAchim Leubner
2261*4e1bc9a0SAchim Leubner SA_DBG2(("siEventSATASignatureRcvd: portID %d PortContext %p\n", portId, agPortContext));
2262*4e1bc9a0SAchim Leubner
2263*4e1bc9a0SAchim Leubner if (agNULL != agPortContext)
2264*4e1bc9a0SAchim Leubner {
2265*4e1bc9a0SAchim Leubner /* exist port */
2266*4e1bc9a0SAchim Leubner pPort = (agsaPort_t *) (agPortContext->sdkData);
2267*4e1bc9a0SAchim Leubner pPort->portId = portId;
2268*4e1bc9a0SAchim Leubner
2269*4e1bc9a0SAchim Leubner /* include the phy to the port */
2270*4e1bc9a0SAchim Leubner pPort->phyMap[phyId] = agTRUE;
2271*4e1bc9a0SAchim Leubner /* Set the port for the phy */
2272*4e1bc9a0SAchim Leubner saRoot->phys[phyId].pPort = pPort;
2273*4e1bc9a0SAchim Leubner }
2274*4e1bc9a0SAchim Leubner else
2275*4e1bc9a0SAchim Leubner {
2276*4e1bc9a0SAchim Leubner ossaSingleThreadedEnter(agRoot, LL_PORT_LOCK);
2277*4e1bc9a0SAchim Leubner /* new port */
2278*4e1bc9a0SAchim Leubner /* Allocate a free port */
2279*4e1bc9a0SAchim Leubner pPort = (agsaPort_t *) saLlistGetHead(&(saRoot->freePorts));
2280*4e1bc9a0SAchim Leubner if (agNULL != pPort)
2281*4e1bc9a0SAchim Leubner {
2282*4e1bc9a0SAchim Leubner /* Acquire port list lock */
2283*4e1bc9a0SAchim Leubner saLlistRemove(&(saRoot->freePorts), &(pPort->linkNode));
2284*4e1bc9a0SAchim Leubner
2285*4e1bc9a0SAchim Leubner /* setup the port data structure */
2286*4e1bc9a0SAchim Leubner pPort->portContext.osData = agNULL;
2287*4e1bc9a0SAchim Leubner pPort->portContext.sdkData = pPort;
2288*4e1bc9a0SAchim Leubner
2289*4e1bc9a0SAchim Leubner /* Add to valid port list */
2290*4e1bc9a0SAchim Leubner saLlistAdd(&(saRoot->validPorts), &(pPort->linkNode));
2291*4e1bc9a0SAchim Leubner /* Release port list lock */
2292*4e1bc9a0SAchim Leubner ossaSingleThreadedLeave(agRoot, LL_PORT_LOCK);
2293*4e1bc9a0SAchim Leubner
2294*4e1bc9a0SAchim Leubner /* include the phy to the port */
2295*4e1bc9a0SAchim Leubner pPort->phyMap[phyId] = agTRUE;
2296*4e1bc9a0SAchim Leubner /* Set the port for the phy */
2297*4e1bc9a0SAchim Leubner saRoot->phys[phyId].pPort = pPort;
2298*4e1bc9a0SAchim Leubner
2299*4e1bc9a0SAchim Leubner /* Setup portMap based on portId */
2300*4e1bc9a0SAchim Leubner saRoot->PortMap[portId].PortID = portId;
2301*4e1bc9a0SAchim Leubner saRoot->PortMap[portId].PortContext = &(pPort->portContext);
2302*4e1bc9a0SAchim Leubner pPort->portId = portId;
2303*4e1bc9a0SAchim Leubner SA_DBG3(("siEventSATASignatureRcvd: NewPort portID %d portContect %p\n", portId, saRoot->PortMap[portId].PortContext));
2304*4e1bc9a0SAchim Leubner }
2305*4e1bc9a0SAchim Leubner else
2306*4e1bc9a0SAchim Leubner {
2307*4e1bc9a0SAchim Leubner ossaSingleThreadedLeave(agRoot, LL_PORT_LOCK);
2308*4e1bc9a0SAchim Leubner /* pPort is agNULL*/
2309*4e1bc9a0SAchim Leubner smTraceFuncExit(hpDBG_VERY_LOUD, 'a', "5m");
2310*4e1bc9a0SAchim Leubner return;
2311*4e1bc9a0SAchim Leubner }
2312*4e1bc9a0SAchim Leubner
2313*4e1bc9a0SAchim Leubner if (OSSA_PORT_VALID == (npipps & PORT_STATE_MASK))
2314*4e1bc9a0SAchim Leubner {
2315*4e1bc9a0SAchim Leubner pPort->status &= ~PORT_INVALIDATING;
2316*4e1bc9a0SAchim Leubner saRoot->PortMap[portId].PortStatus &= ~PORT_INVALIDATING;
2317*4e1bc9a0SAchim Leubner }
2318*4e1bc9a0SAchim Leubner else
2319*4e1bc9a0SAchim Leubner {
2320*4e1bc9a0SAchim Leubner SA_DBG1(("siEventSATASignatureRcvd: PortInvalid portID %d PortContext %p\n", portId, saRoot->PortMap[portId].PortContext));
2321*4e1bc9a0SAchim Leubner }
2322*4e1bc9a0SAchim Leubner }
2323*4e1bc9a0SAchim Leubner
2324*4e1bc9a0SAchim Leubner /* adjust the bit fields before callback */
2325*4e1bc9a0SAchim Leubner phyId = (linkRate << SHIFT8) | phyId;
2326*4e1bc9a0SAchim Leubner /* report PhyId, NPIP, PortState */
2327*4e1bc9a0SAchim Leubner phyId |= (npipps & PHY_IN_PORT_MASK) | ((npipps & PORT_STATE_MASK) << SHIFT16);
2328*4e1bc9a0SAchim Leubner ossaHwCB(agRoot, &(pPort->portContext), OSSA_HW_EVENT_SATA_PHY_UP, phyId, agNULL, pMsg);
2329*4e1bc9a0SAchim Leubner
2330*4e1bc9a0SAchim Leubner /* set PHY_UP status */
2331*4e1bc9a0SAchim Leubner PHY_STATUS_SET(pPhy, PHY_UP);
2332*4e1bc9a0SAchim Leubner
2333*4e1bc9a0SAchim Leubner smTraceFuncExit(hpDBG_VERY_LOUD, 'b', "5m");
2334*4e1bc9a0SAchim Leubner
2335*4e1bc9a0SAchim Leubner /* return */
2336*4e1bc9a0SAchim Leubner return;
2337*4e1bc9a0SAchim Leubner }
2338*4e1bc9a0SAchim Leubner
2339*4e1bc9a0SAchim Leubner
2340*4e1bc9a0SAchim Leubner /******************************************************************************/
2341*4e1bc9a0SAchim Leubner /*! \brief Process Outbound IOMB Message
2342*4e1bc9a0SAchim Leubner *
2343*4e1bc9a0SAchim Leubner * Process Outbound IOMB from SPC
2344*4e1bc9a0SAchim Leubner *
2345*4e1bc9a0SAchim Leubner * \param agRoot Handles for this instance of SAS/SATA LL Layer
2346*4e1bc9a0SAchim Leubner * \param pMsg1 Pointer of Response IOMB message 1
2347*4e1bc9a0SAchim Leubner * \param category category of outbpond IOMB header
2348*4e1bc9a0SAchim Leubner * \param opcode Opcode of Outbound IOMB header
2349*4e1bc9a0SAchim Leubner * \param bc buffer count of IOMB header
2350*4e1bc9a0SAchim Leubner *
2351*4e1bc9a0SAchim Leubner * \return success or fail
2352*4e1bc9a0SAchim Leubner *
2353*4e1bc9a0SAchim Leubner */
2354*4e1bc9a0SAchim Leubner /*******************************************************************************/
mpiParseOBIomb(agsaRoot_t * agRoot,bit32 * pMsg1,mpiMsgCategory_t category,bit16 opcode)2355*4e1bc9a0SAchim Leubner GLOBAL bit32 mpiParseOBIomb(
2356*4e1bc9a0SAchim Leubner agsaRoot_t *agRoot,
2357*4e1bc9a0SAchim Leubner bit32 *pMsg1,
2358*4e1bc9a0SAchim Leubner mpiMsgCategory_t category,
2359*4e1bc9a0SAchim Leubner bit16 opcode
2360*4e1bc9a0SAchim Leubner )
2361*4e1bc9a0SAchim Leubner {
2362*4e1bc9a0SAchim Leubner agsaLLRoot_t *saRoot = (agsaLLRoot_t *)(agRoot->sdkData);
2363*4e1bc9a0SAchim Leubner bit32 ret = AGSA_RC_SUCCESS;
2364*4e1bc9a0SAchim Leubner bit32 parserStatus = AGSA_RC_SUCCESS;
2365*4e1bc9a0SAchim Leubner
2366*4e1bc9a0SAchim Leubner smTraceFuncEnter(hpDBG_VERY_LOUD, "2f");
2367*4e1bc9a0SAchim Leubner
2368*4e1bc9a0SAchim Leubner switch (opcode)
2369*4e1bc9a0SAchim Leubner {
2370*4e1bc9a0SAchim Leubner case OPC_OUB_COMBINED_SSP_COMP:
2371*4e1bc9a0SAchim Leubner {
2372*4e1bc9a0SAchim Leubner agsaSSPCoalescedCompletionRsp_t *pIomb = (agsaSSPCoalescedCompletionRsp_t *)pMsg1;
2373*4e1bc9a0SAchim Leubner agsaIORequestDesc_t *pRequest = agNULL;
2374*4e1bc9a0SAchim Leubner bit32 tag = 0;
2375*4e1bc9a0SAchim Leubner bit32 sspTag = 0;
2376*4e1bc9a0SAchim Leubner bit32 count = 0;
2377*4e1bc9a0SAchim Leubner
2378*4e1bc9a0SAchim Leubner #ifdef SALL_API_TEST
2379*4e1bc9a0SAchim Leubner saRoot->LLCounters.IOCounter.numSSPCompleted++;
2380*4e1bc9a0SAchim Leubner SA_DBG3(("mpiParseOBIomb, SSP_COMP Response received IOMB=%p %d\n",
2381*4e1bc9a0SAchim Leubner pMsg1, saRoot->LLCounters.IOCounter.numSSPCompleted));
2382*4e1bc9a0SAchim Leubner #else
2383*4e1bc9a0SAchim Leubner SA_DBG3(("mpiParseOBIomb, OPC_OUB_COMBINED_SSP_COMP Response received IOMB=%p\n", pMsg1));
2384*4e1bc9a0SAchim Leubner #endif
2385*4e1bc9a0SAchim Leubner /* get Tag */
2386*4e1bc9a0SAchim Leubner for (count = 0; count < pIomb->coalescedCount; count++)
2387*4e1bc9a0SAchim Leubner {
2388*4e1bc9a0SAchim Leubner tag = pIomb->sspComplCxt[count].tag;
2389*4e1bc9a0SAchim Leubner sspTag = pIomb->sspComplCxt[count].SSPTag;
2390*4e1bc9a0SAchim Leubner pRequest = (agsaIORequestDesc_t *)saRoot->IOMap[tag].IORequest;
2391*4e1bc9a0SAchim Leubner SA_ASSERT((pRequest), "pRequest");
2392*4e1bc9a0SAchim Leubner
2393*4e1bc9a0SAchim Leubner if(pRequest == agNULL)
2394*4e1bc9a0SAchim Leubner {
2395*4e1bc9a0SAchim Leubner 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));
2396*4e1bc9a0SAchim Leubner #ifdef SA_ENABLE_PCI_TRIGGER
2397*4e1bc9a0SAchim Leubner if( saRoot->swConfig.PCI_trigger & PCI_TRIGGER_COAL_IOMB_ERROR )
2398*4e1bc9a0SAchim Leubner {
2399*4e1bc9a0SAchim Leubner siPCITriger(agRoot);
2400*4e1bc9a0SAchim Leubner }
2401*4e1bc9a0SAchim Leubner #endif /* SA_ENABLE_PCI_TRIGGER */
2402*4e1bc9a0SAchim Leubner return(AGSA_RC_FAILURE);
2403*4e1bc9a0SAchim Leubner }
2404*4e1bc9a0SAchim Leubner SA_ASSERT((pRequest->valid), "pRequest->valid");
2405*4e1bc9a0SAchim Leubner
2406*4e1bc9a0SAchim Leubner #ifdef SA_ENABLE_PCI_TRIGGER
2407*4e1bc9a0SAchim Leubner if(!pRequest->valid)
2408*4e1bc9a0SAchim Leubner {
2409*4e1bc9a0SAchim Leubner if( saRoot->swConfig.PCI_trigger & PCI_TRIGGER_COAL_INVALID )
2410*4e1bc9a0SAchim Leubner {
2411*4e1bc9a0SAchim Leubner siPCITriger(agRoot);
2412*4e1bc9a0SAchim Leubner }
2413*4e1bc9a0SAchim Leubner }
2414*4e1bc9a0SAchim Leubner #endif /* SA_ENABLE_PCI_TRIGGER */
2415*4e1bc9a0SAchim Leubner
2416*4e1bc9a0SAchim Leubner
2417*4e1bc9a0SAchim Leubner 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));
2418*4e1bc9a0SAchim Leubner
2419*4e1bc9a0SAchim Leubner /* Completion of SSP without Response Data */
2420*4e1bc9a0SAchim Leubner siIODone( agRoot, pRequest, OSSA_IO_SUCCESS, sspTag);
2421*4e1bc9a0SAchim Leubner }
2422*4e1bc9a0SAchim Leubner }
2423*4e1bc9a0SAchim Leubner break;
2424*4e1bc9a0SAchim Leubner
2425*4e1bc9a0SAchim Leubner case OPC_OUB_SSP_COMP:
2426*4e1bc9a0SAchim Leubner {
2427*4e1bc9a0SAchim Leubner #ifdef SALL_API_TEST
2428*4e1bc9a0SAchim Leubner saRoot->LLCounters.IOCounter.numSSPCompleted++;
2429*4e1bc9a0SAchim Leubner SA_DBG3(("mpiParseOBIomb, SSP_COMP Response received IOMB=%p %d\n",
2430*4e1bc9a0SAchim Leubner pMsg1, saRoot->LLCounters.IOCounter.numSSPCompleted));
2431*4e1bc9a0SAchim Leubner #else
2432*4e1bc9a0SAchim Leubner SA_DBG3(("mpiParseOBIomb, SSP_COMP Response received IOMB=%p\n", pMsg1));
2433*4e1bc9a0SAchim Leubner #endif
2434*4e1bc9a0SAchim Leubner /* process the SSP IO Completed response message */
2435*4e1bc9a0SAchim Leubner mpiSSPCompletion(agRoot, pMsg1);
2436*4e1bc9a0SAchim Leubner break;
2437*4e1bc9a0SAchim Leubner }
2438*4e1bc9a0SAchim Leubner case OPC_OUB_COMBINED_SATA_COMP:
2439*4e1bc9a0SAchim Leubner {
2440*4e1bc9a0SAchim Leubner agsaSATACoalescedCompletionRsp_t *pIomb;
2441*4e1bc9a0SAchim Leubner agsaIORequestDesc_t *pRequest;
2442*4e1bc9a0SAchim Leubner bit32 tag;
2443*4e1bc9a0SAchim Leubner bit32 count;
2444*4e1bc9a0SAchim Leubner
2445*4e1bc9a0SAchim Leubner #ifdef SALL_API_TEST
2446*4e1bc9a0SAchim Leubner saRoot->LLCounters.IOCounter.numSSPCompleted++;
2447*4e1bc9a0SAchim Leubner SA_DBG3(("mpiParseOBIomb, OPC_OUB_COMBINED_SATA_COMP Response received IOMB=%p %d\n",
2448*4e1bc9a0SAchim Leubner pMsg1, saRoot->LLCounters.IOCounter.numSSPCompleted));
2449*4e1bc9a0SAchim Leubner #else
2450*4e1bc9a0SAchim Leubner SA_DBG3(("mpiParseOBIomb, OPC_OUB_COMBINED_SATA_COMP Response received IOMB=%p\n", pMsg1));
2451*4e1bc9a0SAchim Leubner #endif
2452*4e1bc9a0SAchim Leubner
2453*4e1bc9a0SAchim Leubner pIomb = (agsaSATACoalescedCompletionRsp_t *)pMsg1;
2454*4e1bc9a0SAchim Leubner /* get Tag */
2455*4e1bc9a0SAchim Leubner for (count = 0; count < pIomb->coalescedCount; count++)
2456*4e1bc9a0SAchim Leubner {
2457*4e1bc9a0SAchim Leubner tag = pIomb->stpComplCxt[count].tag;
2458*4e1bc9a0SAchim Leubner pRequest = (agsaIORequestDesc_t *)saRoot->IOMap[tag].IORequest;
2459*4e1bc9a0SAchim Leubner SA_ASSERT((pRequest), "pRequest");
2460*4e1bc9a0SAchim Leubner
2461*4e1bc9a0SAchim Leubner if(pRequest == agNULL)
2462*4e1bc9a0SAchim Leubner {
2463*4e1bc9a0SAchim Leubner 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));
2464*4e1bc9a0SAchim Leubner return(AGSA_RC_FAILURE);
2465*4e1bc9a0SAchim Leubner }
2466*4e1bc9a0SAchim Leubner SA_ASSERT((pRequest->valid), "pRequest->valid");
2467*4e1bc9a0SAchim Leubner
2468*4e1bc9a0SAchim Leubner SA_DBG3(("mpiParseOBIomb, OPC_OUB_COMBINED_SATA_COMP IOMB tag=0x%x, status=0x%x, param=0x%x\n", tag, OSSA_IO_SUCCESS, 0));
2469*4e1bc9a0SAchim Leubner
2470*4e1bc9a0SAchim Leubner /* Completion of SATA without Response Data */
2471*4e1bc9a0SAchim Leubner siIODone( agRoot, pRequest, OSSA_IO_SUCCESS, 0);
2472*4e1bc9a0SAchim Leubner }
2473*4e1bc9a0SAchim Leubner break;
2474*4e1bc9a0SAchim Leubner }
2475*4e1bc9a0SAchim Leubner case OPC_OUB_SATA_COMP:
2476*4e1bc9a0SAchim Leubner {
2477*4e1bc9a0SAchim Leubner #ifdef SALL_API_TEST
2478*4e1bc9a0SAchim Leubner saRoot->LLCounters.IOCounter.numSataCompleted++;
2479*4e1bc9a0SAchim Leubner SA_DBG3(("mpiParseOBIomb, SATA_COMP Response received IOMB=%p %d\n",
2480*4e1bc9a0SAchim Leubner pMsg1, saRoot->LLCounters.IOCounter.numSataCompleted));
2481*4e1bc9a0SAchim Leubner #else
2482*4e1bc9a0SAchim Leubner SA_DBG3(("mpiParseOBIomb, SATA_COMP Response received IOMB=%p\n", pMsg1));
2483*4e1bc9a0SAchim Leubner #endif
2484*4e1bc9a0SAchim Leubner /* process the response message */
2485*4e1bc9a0SAchim Leubner mpiSATACompletion(agRoot, pMsg1);
2486*4e1bc9a0SAchim Leubner break;
2487*4e1bc9a0SAchim Leubner }
2488*4e1bc9a0SAchim Leubner case OPC_OUB_SSP_ABORT_RSP:
2489*4e1bc9a0SAchim Leubner {
2490*4e1bc9a0SAchim Leubner #ifdef SALL_API_TEST
2491*4e1bc9a0SAchim Leubner saRoot->LLCounters.IOCounter.numSSPAbortedCB++;
2492*4e1bc9a0SAchim Leubner #else
2493*4e1bc9a0SAchim Leubner SA_DBG3(("mpiParseOBIomb, SSP_ABORT Response received IOMB=%p\n", pMsg1));
2494*4e1bc9a0SAchim Leubner #endif
2495*4e1bc9a0SAchim Leubner /* process the response message */
2496*4e1bc9a0SAchim Leubner parserStatus = mpiSSPAbortRsp(agRoot, (agsaSSPAbortRsp_t *)pMsg1);
2497*4e1bc9a0SAchim Leubner if(parserStatus != AGSA_RC_SUCCESS)
2498*4e1bc9a0SAchim Leubner {
2499*4e1bc9a0SAchim Leubner SA_DBG3(("mpiParseOBIomb, mpiSSPAbortRsp FAIL IOMB=%p\n", pMsg1));
2500*4e1bc9a0SAchim Leubner }
2501*4e1bc9a0SAchim Leubner
2502*4e1bc9a0SAchim Leubner break;
2503*4e1bc9a0SAchim Leubner }
2504*4e1bc9a0SAchim Leubner case OPC_OUB_SATA_ABORT_RSP:
2505*4e1bc9a0SAchim Leubner {
2506*4e1bc9a0SAchim Leubner #ifdef SALL_API_TEST
2507*4e1bc9a0SAchim Leubner saRoot->LLCounters.IOCounter.numSataAbortedCB++;
2508*4e1bc9a0SAchim Leubner #else
2509*4e1bc9a0SAchim Leubner SA_DBG3(("mpiParseOBIomb, SATA_ABORT Response received IOMB=%p\n", pMsg1));
2510*4e1bc9a0SAchim Leubner #endif
2511*4e1bc9a0SAchim Leubner /* process the response message */
2512*4e1bc9a0SAchim Leubner mpiSATAAbortRsp(agRoot, (agsaSATAAbortRsp_t *)pMsg1);
2513*4e1bc9a0SAchim Leubner break;
2514*4e1bc9a0SAchim Leubner }
2515*4e1bc9a0SAchim Leubner case OPC_OUB_SATA_EVENT:
2516*4e1bc9a0SAchim Leubner {
2517*4e1bc9a0SAchim Leubner SA_DBG3(("mpiParseOBIomb, SATA_EVENT Response received IOMB=%p\n", pMsg1));
2518*4e1bc9a0SAchim Leubner /* process the response message */
2519*4e1bc9a0SAchim Leubner mpiSATAEvent(agRoot, (agsaSATAEventRsp_t *)pMsg1);
2520*4e1bc9a0SAchim Leubner break;
2521*4e1bc9a0SAchim Leubner }
2522*4e1bc9a0SAchim Leubner case OPC_OUB_SSP_EVENT:
2523*4e1bc9a0SAchim Leubner {
2524*4e1bc9a0SAchim Leubner SA_DBG3(("mpiParseOBIomb, SSP_EVENT Response received IOMB=%p\n", pMsg1));
2525*4e1bc9a0SAchim Leubner /* process the response message */
2526*4e1bc9a0SAchim Leubner mpiSSPEvent(agRoot, (agsaSSPEventRsp_t *)pMsg1);
2527*4e1bc9a0SAchim Leubner break;
2528*4e1bc9a0SAchim Leubner }
2529*4e1bc9a0SAchim Leubner case OPC_OUB_SMP_COMP:
2530*4e1bc9a0SAchim Leubner {
2531*4e1bc9a0SAchim Leubner #ifdef SALL_API_TEST
2532*4e1bc9a0SAchim Leubner saRoot->LLCounters.IOCounter.numSMPCompleted++;
2533*4e1bc9a0SAchim Leubner SA_DBG3(("mpiParseOBIomb, SMP_COMP Response received IOMB=%p, %d\n",
2534*4e1bc9a0SAchim Leubner pMsg1, saRoot->LLCounters.IOCounter.numSMPCompleted));
2535*4e1bc9a0SAchim Leubner #else
2536*4e1bc9a0SAchim Leubner SA_DBG3(("mpiParseOBIomb, SMP_COMP Response received IOMB=%p\n", pMsg1));
2537*4e1bc9a0SAchim Leubner #endif
2538*4e1bc9a0SAchim Leubner /* process the response message */
2539*4e1bc9a0SAchim Leubner mpiSMPCompletion(agRoot, (agsaSMPCompletionRsp_t *)pMsg1);
2540*4e1bc9a0SAchim Leubner break;
2541*4e1bc9a0SAchim Leubner }
2542*4e1bc9a0SAchim Leubner case OPC_OUB_ECHO:
2543*4e1bc9a0SAchim Leubner {
2544*4e1bc9a0SAchim Leubner #ifdef SALL_API_TEST
2545*4e1bc9a0SAchim Leubner saRoot->LLCounters.IOCounter.numEchoCB++;
2546*4e1bc9a0SAchim Leubner SA_DBG3(("mpiParseOBIomb, ECHO Response received %d\n", saRoot->LLCounters.IOCounter.numEchoCB));
2547*4e1bc9a0SAchim Leubner #else
2548*4e1bc9a0SAchim Leubner SA_DBG3(("mpiParseOBIomb, ECHO Response received\n"));
2549*4e1bc9a0SAchim Leubner #endif
2550*4e1bc9a0SAchim Leubner /* process the response message */
2551*4e1bc9a0SAchim Leubner mpiEchoRsp(agRoot, (agsaEchoRsp_t *)pMsg1);
2552*4e1bc9a0SAchim Leubner break;
2553*4e1bc9a0SAchim Leubner }
2554*4e1bc9a0SAchim Leubner case OPC_OUB_GET_NVMD_DATA:
2555*4e1bc9a0SAchim Leubner {
2556*4e1bc9a0SAchim Leubner SA_DBG3(("mpiParseOBIomb, OPC_OUB_GET_NVMD_DATA received IOMB=%p\n", pMsg1));
2557*4e1bc9a0SAchim Leubner /* process the response message */
2558*4e1bc9a0SAchim Leubner mpiGetNVMDataRsp(agRoot, (agsaGetNVMDataRsp_t *)pMsg1);
2559*4e1bc9a0SAchim Leubner break;
2560*4e1bc9a0SAchim Leubner }
2561*4e1bc9a0SAchim Leubner case OPC_OUB_SPC_HW_EVENT:
2562*4e1bc9a0SAchim Leubner {
2563*4e1bc9a0SAchim Leubner SA_ASSERT((smIS_SPC(agRoot)), "smIS_SPC");
2564*4e1bc9a0SAchim Leubner SA_DBG3(("mpiParseOBIomb, OPC_OUB_SPC_HW_EVENT Response received IOMB=%p\n", pMsg1));
2565*4e1bc9a0SAchim Leubner /* process the response message */
2566*4e1bc9a0SAchim Leubner mpiHWevent(agRoot, (agsaHWEvent_SPC_OUB_t *)pMsg1);
2567*4e1bc9a0SAchim Leubner break;
2568*4e1bc9a0SAchim Leubner }
2569*4e1bc9a0SAchim Leubner case OPC_OUB_HW_EVENT:
2570*4e1bc9a0SAchim Leubner {
2571*4e1bc9a0SAchim Leubner SA_DBG3(("mpiParseOBIomb, HW_EVENT Response received IOMB=%p\n", pMsg1));
2572*4e1bc9a0SAchim Leubner /* process the response message */
2573*4e1bc9a0SAchim Leubner mpiHWevent(agRoot, (agsaHWEvent_SPC_OUB_t *)pMsg1);
2574*4e1bc9a0SAchim Leubner break;
2575*4e1bc9a0SAchim Leubner }
2576*4e1bc9a0SAchim Leubner case OPC_OUB_PHY_START_RESPONSE:
2577*4e1bc9a0SAchim Leubner {
2578*4e1bc9a0SAchim Leubner SA_DBG1(("mpiParseOBIomb, OPC_OUB_PHY_START_RESPONSE Response received IOMB=%p\n", pMsg1));
2579*4e1bc9a0SAchim Leubner /* process the response message */
2580*4e1bc9a0SAchim Leubner mpiPhyStartEvent( agRoot, (agsaHWEvent_Phy_OUB_t *)pMsg1 );
2581*4e1bc9a0SAchim Leubner
2582*4e1bc9a0SAchim Leubner break;
2583*4e1bc9a0SAchim Leubner }
2584*4e1bc9a0SAchim Leubner case OPC_OUB_PHY_STOP_RESPONSE:
2585*4e1bc9a0SAchim Leubner {
2586*4e1bc9a0SAchim Leubner SA_DBG1(("mpiParseOBIomb, OPC_OUB_PHY_STOP_RESPONSE Response received IOMB=%p\n", pMsg1));
2587*4e1bc9a0SAchim Leubner /* process the response message */
2588*4e1bc9a0SAchim Leubner mpiPhyStopEvent( agRoot, (agsaHWEvent_Phy_OUB_t *)pMsg1 );
2589*4e1bc9a0SAchim Leubner break;
2590*4e1bc9a0SAchim Leubner }
2591*4e1bc9a0SAchim Leubner
2592*4e1bc9a0SAchim Leubner case OPC_OUB_LOCAL_PHY_CNTRL:
2593*4e1bc9a0SAchim Leubner {
2594*4e1bc9a0SAchim Leubner SA_DBG3(("mpiParseOBIomb, PHY CONTROL Response received IOMB=%p\n", pMsg1));
2595*4e1bc9a0SAchim Leubner /* process the response message */
2596*4e1bc9a0SAchim Leubner mpiPhyCntrlRsp(agRoot, (agsaLocalPhyCntrlRsp_t *)pMsg1);
2597*4e1bc9a0SAchim Leubner break;
2598*4e1bc9a0SAchim Leubner }
2599*4e1bc9a0SAchim Leubner case OPC_OUB_SPC_DEV_REGIST:
2600*4e1bc9a0SAchim Leubner {
2601*4e1bc9a0SAchim Leubner SA_ASSERT((smIS_SPC(agRoot)), "smIS_SPC");
2602*4e1bc9a0SAchim Leubner SA_DBG3(("mpiParseOBIomb, OPC_OUB_SPC_DEV_REGIST Response received IOMB=%p\n", pMsg1));
2603*4e1bc9a0SAchim Leubner /* process the response message */
2604*4e1bc9a0SAchim Leubner mpiDeviceRegRsp(agRoot, (agsaDeviceRegistrationRsp_t *)pMsg1);
2605*4e1bc9a0SAchim Leubner break;
2606*4e1bc9a0SAchim Leubner }
2607*4e1bc9a0SAchim Leubner case OPC_OUB_DEV_REGIST:
2608*4e1bc9a0SAchim Leubner {
2609*4e1bc9a0SAchim Leubner SA_DBG2(("mpiParseOBIomb, DEV_REGISTRATION Response received IOMB=%p\n", pMsg1));
2610*4e1bc9a0SAchim Leubner /* process the response message */
2611*4e1bc9a0SAchim Leubner mpiDeviceRegRsp(agRoot, (agsaDeviceRegistrationRsp_t *)pMsg1);
2612*4e1bc9a0SAchim Leubner break;
2613*4e1bc9a0SAchim Leubner }
2614*4e1bc9a0SAchim Leubner case OPC_OUB_DEREG_DEV:
2615*4e1bc9a0SAchim Leubner {
2616*4e1bc9a0SAchim Leubner SA_DBG3(("mpiParseOBIomb, DEREGISTRATION DEVICE Response received IOMB=%p\n", pMsg1));
2617*4e1bc9a0SAchim Leubner /* process the response message */
2618*4e1bc9a0SAchim Leubner mpiDeregDevHandleRsp(agRoot, (agsaDeregDevHandleRsp_t *)pMsg1);
2619*4e1bc9a0SAchim Leubner break;
2620*4e1bc9a0SAchim Leubner }
2621*4e1bc9a0SAchim Leubner case OPC_OUB_GET_DEV_HANDLE:
2622*4e1bc9a0SAchim Leubner {
2623*4e1bc9a0SAchim Leubner SA_DBG3(("mpiParseOBIomb, GET_DEV_HANDLE Response received IOMB=%p\n", pMsg1));
2624*4e1bc9a0SAchim Leubner /* process the response message */
2625*4e1bc9a0SAchim Leubner mpiGetDevHandleRsp(agRoot, (agsaGetDevHandleRsp_t *)pMsg1);
2626*4e1bc9a0SAchim Leubner break;
2627*4e1bc9a0SAchim Leubner }
2628*4e1bc9a0SAchim Leubner case OPC_OUB_SPC_DEV_HANDLE_ARRIV:
2629*4e1bc9a0SAchim Leubner {
2630*4e1bc9a0SAchim Leubner SA_DBG3(("mpiParseOBIomb, SPC_DEV_HANDLE_ARRIV Response received IOMB=%p\n", pMsg1));
2631*4e1bc9a0SAchim Leubner /* process the response message */
2632*4e1bc9a0SAchim Leubner mpiDeviceHandleArrived(agRoot, (agsaDeviceHandleArrivedNotify_t *)pMsg1);
2633*4e1bc9a0SAchim Leubner break;
2634*4e1bc9a0SAchim Leubner }
2635*4e1bc9a0SAchim Leubner case OPC_OUB_DEV_HANDLE_ARRIV:
2636*4e1bc9a0SAchim Leubner {
2637*4e1bc9a0SAchim Leubner SA_DBG3(("mpiParseOBIomb, DEV_HANDLE_ARRIV Response received IOMB=%p\n", pMsg1));
2638*4e1bc9a0SAchim Leubner /* process the response message */
2639*4e1bc9a0SAchim Leubner mpiDeviceHandleArrived(agRoot, (agsaDeviceHandleArrivedNotify_t *)pMsg1);
2640*4e1bc9a0SAchim Leubner break;
2641*4e1bc9a0SAchim Leubner }
2642*4e1bc9a0SAchim Leubner case OPC_OUB_SSP_RECV_EVENT:
2643*4e1bc9a0SAchim Leubner {
2644*4e1bc9a0SAchim Leubner SA_DBG3(("mpiParseOBIomb, SSP_RECV_EVENT Response received IOMB=%p\n", pMsg1));
2645*4e1bc9a0SAchim Leubner /* process the response message */
2646*4e1bc9a0SAchim Leubner mpiSSPReqReceivedNotify(agRoot, (agsaSSPReqReceivedNotify_t *)pMsg1);
2647*4e1bc9a0SAchim Leubner break;
2648*4e1bc9a0SAchim Leubner }
2649*4e1bc9a0SAchim Leubner case OPC_OUB_DEV_INFO:
2650*4e1bc9a0SAchim Leubner {
2651*4e1bc9a0SAchim Leubner SA_ASSERT((smIS_SPCV(agRoot)), "smIS_SPCV");
2652*4e1bc9a0SAchim Leubner SA_DBG3(("mpiParseOBIomb, DEV_INFO Response received IOMB=%p\n", pMsg1));
2653*4e1bc9a0SAchim Leubner /* process the response message */
2654*4e1bc9a0SAchim Leubner mpiGetDevInfoRsp(agRoot, (agsaGetDevInfoRspV_t *)pMsg1);
2655*4e1bc9a0SAchim Leubner break;
2656*4e1bc9a0SAchim Leubner }
2657*4e1bc9a0SAchim Leubner case OPC_OUB_GET_PHY_PROFILE_RSP:
2658*4e1bc9a0SAchim Leubner {
2659*4e1bc9a0SAchim Leubner SA_ASSERT((smIS_SPCV(agRoot)), "smIS_SPCV");
2660*4e1bc9a0SAchim Leubner SA_DBG2(("mpiParseOBIomb, OPC_OUB_GET_PHY_PROFILE_RSP Response received IOMB=%p\n", pMsg1));
2661*4e1bc9a0SAchim Leubner /* process the response message */
2662*4e1bc9a0SAchim Leubner mpiGetPhyProfileRsp(agRoot, (agsaGetPhyProfileRspV_t *)pMsg1);
2663*4e1bc9a0SAchim Leubner break;
2664*4e1bc9a0SAchim Leubner }
2665*4e1bc9a0SAchim Leubner case OPC_OUB_SET_PHY_PROFILE_RSP:
2666*4e1bc9a0SAchim Leubner {
2667*4e1bc9a0SAchim Leubner SA_ASSERT((smIS_SPCV(agRoot)), "smIS_SPCV");
2668*4e1bc9a0SAchim Leubner SA_DBG3(("mpiParseOBIomb, OPC_OUB_SET_PHY_PROFILE_RSP Response received IOMB=%p\n", pMsg1));
2669*4e1bc9a0SAchim Leubner /* process the response message */
2670*4e1bc9a0SAchim Leubner mpiSetPhyProfileRsp(agRoot, (agsaSetPhyProfileRspV_t *)pMsg1);
2671*4e1bc9a0SAchim Leubner break;
2672*4e1bc9a0SAchim Leubner }
2673*4e1bc9a0SAchim Leubner case OPC_OUB_SPC_DEV_INFO:
2674*4e1bc9a0SAchim Leubner {
2675*4e1bc9a0SAchim Leubner SA_ASSERT((smIS_SPC(agRoot)), "smIS_SPC");
2676*4e1bc9a0SAchim Leubner SA_DBG3(("mpiParseOBIomb, DEV_INFO Response received IOMB=%p\n", pMsg1));
2677*4e1bc9a0SAchim Leubner /* process the response message */
2678*4e1bc9a0SAchim Leubner mpiGetDevInfoRspSpc(agRoot, (agsaGetDevInfoRsp_t *)pMsg1);
2679*4e1bc9a0SAchim Leubner break;
2680*4e1bc9a0SAchim Leubner }
2681*4e1bc9a0SAchim Leubner case OPC_OUB_FW_FLASH_UPDATE:
2682*4e1bc9a0SAchim Leubner {
2683*4e1bc9a0SAchim Leubner SA_DBG3(("mpiParseOBIomb, OPC_OUB_FW_FLASH_UPDATE Response received IOMB=%p\n", pMsg1));
2684*4e1bc9a0SAchim Leubner /* process the response message */
2685*4e1bc9a0SAchim Leubner mpiFwFlashUpdateRsp(agRoot, (agsaFwFlashUpdateRsp_t *)pMsg1);
2686*4e1bc9a0SAchim Leubner break;
2687*4e1bc9a0SAchim Leubner }
2688*4e1bc9a0SAchim Leubner case OPC_OUB_FLASH_OP_EXT_RSP:
2689*4e1bc9a0SAchim Leubner {
2690*4e1bc9a0SAchim Leubner SA_DBG3(("mpiParseOBIomb, OPC_OUB_FLASH_OP_EXT_RSP Response received IOMB=%p\n", pMsg1));
2691*4e1bc9a0SAchim Leubner /* process the response message */
2692*4e1bc9a0SAchim Leubner mpiFwExtFlashUpdateRsp(agRoot, (agsaFwFlashOpExtRsp_t *)pMsg1);
2693*4e1bc9a0SAchim Leubner break;
2694*4e1bc9a0SAchim Leubner }
2695*4e1bc9a0SAchim Leubner #ifdef SPC_ENABLE_PROFILE
2696*4e1bc9a0SAchim Leubner case OPC_OUB_FW_PROFILE:
2697*4e1bc9a0SAchim Leubner {
2698*4e1bc9a0SAchim Leubner SA_DBG3(("mpiParseOBIomb, OPC_OUB_FW_PROFILE Response received IOMB=%p\n", pMsg1));
2699*4e1bc9a0SAchim Leubner /* process the response message */
2700*4e1bc9a0SAchim Leubner mpiFwProfileRsp(agRoot, (agsaFwProfileRsp_t *)pMsg1);
2701*4e1bc9a0SAchim Leubner break;
2702*4e1bc9a0SAchim Leubner }
2703*4e1bc9a0SAchim Leubner #endif
2704*4e1bc9a0SAchim Leubner case OPC_OUB_SET_NVMD_DATA:
2705*4e1bc9a0SAchim Leubner {
2706*4e1bc9a0SAchim Leubner SA_DBG3(("mpiParseOBIomb, OPC_OUB_SET_NVMD_DATA received IOMB=%p\n", pMsg1));
2707*4e1bc9a0SAchim Leubner /* process the response message */
2708*4e1bc9a0SAchim Leubner mpiSetNVMDataRsp(agRoot, (agsaSetNVMDataRsp_t *)pMsg1);
2709*4e1bc9a0SAchim Leubner break;
2710*4e1bc9a0SAchim Leubner }
2711*4e1bc9a0SAchim Leubner case OPC_OUB_GPIO_RESPONSE:
2712*4e1bc9a0SAchim Leubner {
2713*4e1bc9a0SAchim Leubner SA_DBG3(("mpiParseOBIomb, OPC_OUB_SET_GPIO_RESPONSE Response received IOMB=%p\n", pMsg1));
2714*4e1bc9a0SAchim Leubner /* process the response message */
2715*4e1bc9a0SAchim Leubner mpiGPIORsp(agRoot, (agsaGPIORsp_t *)pMsg1);
2716*4e1bc9a0SAchim Leubner break;
2717*4e1bc9a0SAchim Leubner }
2718*4e1bc9a0SAchim Leubner case OPC_OUB_GPIO_EVENT:
2719*4e1bc9a0SAchim Leubner {
2720*4e1bc9a0SAchim Leubner SA_DBG3(("mpiParseOBIomb, OPC_OUB_SET_GPIO_RESPONSE Response received IOMB=%p\n", pMsg1));
2721*4e1bc9a0SAchim Leubner /* process the response message */
2722*4e1bc9a0SAchim Leubner mpiGPIOEventRsp(agRoot, (agsaGPIOEvent_t *)pMsg1);
2723*4e1bc9a0SAchim Leubner break;
2724*4e1bc9a0SAchim Leubner }
2725*4e1bc9a0SAchim Leubner case OPC_OUB_GENERAL_EVENT:
2726*4e1bc9a0SAchim Leubner {
2727*4e1bc9a0SAchim Leubner SA_DBG3(("mpiParseOBIomb, OPC_OUB_SET_GENERAL_EVENT Response received IOMB=%p\n", pMsg1));
2728*4e1bc9a0SAchim Leubner /* process the response message */
2729*4e1bc9a0SAchim Leubner mpiGeneralEventRsp(agRoot, (agsaGeneralEventRsp_t *)pMsg1);
2730*4e1bc9a0SAchim Leubner break;
2731*4e1bc9a0SAchim Leubner }
2732*4e1bc9a0SAchim Leubner case OPC_OUB_SAS_DIAG_MODE_START_END:
2733*4e1bc9a0SAchim Leubner {
2734*4e1bc9a0SAchim Leubner SA_DBG3(("mpiParseOBIomb, OPC_OUB_SAS_DIAG_MODE_START_END Response received IOMB=%p\n", pMsg1));
2735*4e1bc9a0SAchim Leubner /* process the response message */
2736*4e1bc9a0SAchim Leubner mpiSASDiagStartEndRsp(agRoot, (agsaSASDiagStartEndRsp_t *)pMsg1);
2737*4e1bc9a0SAchim Leubner break;
2738*4e1bc9a0SAchim Leubner }
2739*4e1bc9a0SAchim Leubner case OPC_OUB_SAS_DIAG_EXECUTE:
2740*4e1bc9a0SAchim Leubner {
2741*4e1bc9a0SAchim Leubner SA_DBG3(("mpiParseOBIomb, OPC_OUB_SAS_DIAG_EXECUTE_RSP Response received IOMB=%p\n", pMsg1));
2742*4e1bc9a0SAchim Leubner /* process the response message */
2743*4e1bc9a0SAchim Leubner mpiSASDiagExecuteRsp(agRoot, (agsaSASDiagExecuteRsp_t *)pMsg1);
2744*4e1bc9a0SAchim Leubner break;
2745*4e1bc9a0SAchim Leubner }
2746*4e1bc9a0SAchim Leubner case OPC_OUB_GET_TIME_STAMP:
2747*4e1bc9a0SAchim Leubner {
2748*4e1bc9a0SAchim Leubner SA_DBG3(("mpiParseOBIomb, OPC_OUB_GET_TIME_STAMP Response received IOMB=%p\n", pMsg1));
2749*4e1bc9a0SAchim Leubner /* process the response message */
2750*4e1bc9a0SAchim Leubner mpiGetTimeStampRsp(agRoot, (agsaGetTimeStampRsp_t *)pMsg1);
2751*4e1bc9a0SAchim Leubner break;
2752*4e1bc9a0SAchim Leubner }
2753*4e1bc9a0SAchim Leubner
2754*4e1bc9a0SAchim Leubner case OPC_OUB_SPC_SAS_HW_EVENT_ACK:
2755*4e1bc9a0SAchim Leubner {
2756*4e1bc9a0SAchim Leubner SA_ASSERT((smIS_SPC(agRoot)), "smIS_SPC");
2757*4e1bc9a0SAchim Leubner SA_DBG3(("mpiParseOBIomb,OPC_OUB_SPC_SAS_HW_EVENT_ACK Response received IOMB=%p\n", pMsg1));
2758*4e1bc9a0SAchim Leubner /* process the response message */
2759*4e1bc9a0SAchim Leubner mpiSASHwEventAckRsp(agRoot, (agsaSASHwEventAckRsp_t *)pMsg1);
2760*4e1bc9a0SAchim Leubner break;
2761*4e1bc9a0SAchim Leubner }
2762*4e1bc9a0SAchim Leubner
2763*4e1bc9a0SAchim Leubner case OPC_OUB_SAS_HW_EVENT_ACK:
2764*4e1bc9a0SAchim Leubner {
2765*4e1bc9a0SAchim Leubner SA_ASSERT((smIS_SPCV(agRoot)), "smIS_SPCV");
2766*4e1bc9a0SAchim Leubner SA_DBG1(("mpiParseOBIomb, OPC_OUB_SAS_HW_EVENT_ACK Response received IOMB=%p\n", pMsg1));
2767*4e1bc9a0SAchim Leubner /* process the response message */
2768*4e1bc9a0SAchim Leubner mpiSASHwEventAckRsp(agRoot, (agsaSASHwEventAckRsp_t *)pMsg1);
2769*4e1bc9a0SAchim Leubner break;
2770*4e1bc9a0SAchim Leubner }
2771*4e1bc9a0SAchim Leubner case OPC_OUB_PORT_CONTROL:
2772*4e1bc9a0SAchim Leubner {
2773*4e1bc9a0SAchim Leubner SA_DBG1(("mpiParseOBIomb, OPC_OUB_PORT_CONTROL Response received IOMB=%p\n", pMsg1));
2774*4e1bc9a0SAchim Leubner /* process the response message */
2775*4e1bc9a0SAchim Leubner mpiPortControlRsp(agRoot, (agsaPortControlRsp_t *)pMsg1);
2776*4e1bc9a0SAchim Leubner break;
2777*4e1bc9a0SAchim Leubner }
2778*4e1bc9a0SAchim Leubner case OPC_OUB_SMP_ABORT_RSP:
2779*4e1bc9a0SAchim Leubner {
2780*4e1bc9a0SAchim Leubner #ifdef SALL_API_TEST
2781*4e1bc9a0SAchim Leubner saRoot->LLCounters.IOCounter.numSMPAbortedCB++;
2782*4e1bc9a0SAchim Leubner SA_DBG3(("mpiParseOBIomb, SMP_ABORT Response received IOMB=%p, %d\n",
2783*4e1bc9a0SAchim Leubner pMsg1, saRoot->LLCounters.IOCounter.numSMPAbortedCB));
2784*4e1bc9a0SAchim Leubner #else
2785*4e1bc9a0SAchim Leubner SA_DBG3(("mpiParseOBIomb, OPC_OUB_SMP_ABORT_RSP Response received IOMB=%p\n", pMsg1));
2786*4e1bc9a0SAchim Leubner #endif
2787*4e1bc9a0SAchim Leubner /* process the response message */
2788*4e1bc9a0SAchim Leubner mpiSMPAbortRsp(agRoot, (agsaSMPAbortRsp_t *)pMsg1);
2789*4e1bc9a0SAchim Leubner break;
2790*4e1bc9a0SAchim Leubner }
2791*4e1bc9a0SAchim Leubner case OPC_OUB_DEVICE_HANDLE_REMOVAL:
2792*4e1bc9a0SAchim Leubner {
2793*4e1bc9a0SAchim Leubner SA_DBG3(("mpiParseOBIomb, OPC_OUB_DEVICE_HANDLE_REMOVAL received IOMB=%p\n", pMsg1));
2794*4e1bc9a0SAchim Leubner /* process the response message */
2795*4e1bc9a0SAchim Leubner mpiDeviceHandleRemoval(agRoot, (agsaDeviceHandleRemoval_t *)pMsg1);
2796*4e1bc9a0SAchim Leubner break;
2797*4e1bc9a0SAchim Leubner }
2798*4e1bc9a0SAchim Leubner case OPC_OUB_SET_DEVICE_STATE:
2799*4e1bc9a0SAchim Leubner {
2800*4e1bc9a0SAchim Leubner SA_DBG3(("mpiParseOBIomb, OPC_OUB_SET_DEVICE_STATE received IOMB=%p\n", pMsg1));
2801*4e1bc9a0SAchim Leubner /* process the response message */
2802*4e1bc9a0SAchim Leubner mpiSetDeviceStateRsp(agRoot, (agsaSetDeviceStateRsp_t *)pMsg1);
2803*4e1bc9a0SAchim Leubner break;
2804*4e1bc9a0SAchim Leubner }
2805*4e1bc9a0SAchim Leubner case OPC_OUB_GET_DEVICE_STATE:
2806*4e1bc9a0SAchim Leubner {
2807*4e1bc9a0SAchim Leubner SA_DBG3(("mpiParseOBIomb, OPC_OUB_GET_DEVICE_STATE received IOMB=%p\n", pMsg1));
2808*4e1bc9a0SAchim Leubner /* process the response message */
2809*4e1bc9a0SAchim Leubner mpiGetDeviceStateRsp(agRoot, (agsaGetDeviceStateRsp_t *)pMsg1);
2810*4e1bc9a0SAchim Leubner break;
2811*4e1bc9a0SAchim Leubner }
2812*4e1bc9a0SAchim Leubner case OPC_OUB_SET_DEV_INFO:
2813*4e1bc9a0SAchim Leubner {
2814*4e1bc9a0SAchim Leubner SA_DBG3(("mpiParseOBIomb, OPC_OUB_SET_DEV_INFO received IOMB=%p\n", pMsg1));
2815*4e1bc9a0SAchim Leubner /* process the response message */
2816*4e1bc9a0SAchim Leubner mpiSetDevInfoRsp(agRoot, (agsaSetDeviceInfoRsp_t *)pMsg1);
2817*4e1bc9a0SAchim Leubner break;
2818*4e1bc9a0SAchim Leubner }
2819*4e1bc9a0SAchim Leubner case OPC_OUB_SAS_RE_INITIALIZE:
2820*4e1bc9a0SAchim Leubner {
2821*4e1bc9a0SAchim Leubner SA_ASSERT((smIS_SPC(agRoot)), "smIS_SPC");
2822*4e1bc9a0SAchim Leubner SA_DBG3(("mpiParseOBIomb, OPC_OUB_SAS_RE_INITIALIZE received IOMB=%p\n", pMsg1));
2823*4e1bc9a0SAchim Leubner /* process the response message */
2824*4e1bc9a0SAchim Leubner mpiSasReInitializeRsp(agRoot, (agsaSasReInitializeRsp_t *)pMsg1);
2825*4e1bc9a0SAchim Leubner break;
2826*4e1bc9a0SAchim Leubner }
2827*4e1bc9a0SAchim Leubner
2828*4e1bc9a0SAchim Leubner case OPC_OUB_SGPIO_RESPONSE:
2829*4e1bc9a0SAchim Leubner {
2830*4e1bc9a0SAchim Leubner SA_DBG3(("mpiParseOBIomb, OPC_OUB_SGPIO_RESPONSE Response received IOMB=%p\n", pMsg1));
2831*4e1bc9a0SAchim Leubner /* process the response message */
2832*4e1bc9a0SAchim Leubner mpiSGpioRsp(agRoot, (agsaSGpioRsp_t *)pMsg1);
2833*4e1bc9a0SAchim Leubner break;
2834*4e1bc9a0SAchim Leubner }
2835*4e1bc9a0SAchim Leubner
2836*4e1bc9a0SAchim Leubner case OPC_OUB_PCIE_DIAG_EXECUTE:
2837*4e1bc9a0SAchim Leubner {
2838*4e1bc9a0SAchim Leubner SA_DBG3(("mpiParseOBIomb, OPC_OUB_PCIE_DIAG_EXECUTE Response received IOMB=%p\n", pMsg1));
2839*4e1bc9a0SAchim Leubner /* process the response message */
2840*4e1bc9a0SAchim Leubner mpiPCIeDiagExecuteRsp(agRoot, (agsaPCIeDiagExecuteRsp_t *)pMsg1);
2841*4e1bc9a0SAchim Leubner break;
2842*4e1bc9a0SAchim Leubner }
2843*4e1bc9a0SAchim Leubner
2844*4e1bc9a0SAchim Leubner case OPC_OUB_GET_VIST_CAP_RSP:
2845*4e1bc9a0SAchim Leubner {
2846*4e1bc9a0SAchim Leubner SA_DBG3(("mpiParseOBIomb, OPC_INB_GET_VIST_CAP Response received IOMB=%p\n", pMsg1));
2847*4e1bc9a0SAchim Leubner /* process the response message */
2848*4e1bc9a0SAchim Leubner mpiGetVHistRsp(agRoot, (agsaGetVHistCapRsp_t *)pMsg1);
2849*4e1bc9a0SAchim Leubner break;
2850*4e1bc9a0SAchim Leubner }
2851*4e1bc9a0SAchim Leubner case 2104:
2852*4e1bc9a0SAchim Leubner {
2853*4e1bc9a0SAchim Leubner if(smIS_SPC6V(agRoot))
2854*4e1bc9a0SAchim Leubner {
2855*4e1bc9a0SAchim Leubner SA_DBG3(("mpiParseOBIomb, OPC_OUB_GET_DFE_DATA_RSP Response received IOMB=%p\n", pMsg1));
2856*4e1bc9a0SAchim Leubner /* process the response message */
2857*4e1bc9a0SAchim Leubner mpiGetDFEDataRsp(agRoot, (agsaGetDDEFDataRsp_t *)pMsg1);
2858*4e1bc9a0SAchim Leubner }
2859*4e1bc9a0SAchim Leubner if(smIS_SPC12V(agRoot))
2860*4e1bc9a0SAchim Leubner {
2861*4e1bc9a0SAchim Leubner SA_DBG3(("mpiParseOBIomb, OPC_INB_GET_VIST_CAP Response received IOMB=%p\n", pMsg1));
2862*4e1bc9a0SAchim Leubner /* process the response message */
2863*4e1bc9a0SAchim Leubner mpiGetVHistRsp(agRoot, (agsaGetVHistCapRsp_t *)pMsg1);
2864*4e1bc9a0SAchim Leubner }
2865*4e1bc9a0SAchim Leubner else
2866*4e1bc9a0SAchim Leubner {
2867*4e1bc9a0SAchim Leubner SA_DBG1(("mpiParseOBIomb, 2104 Response received IOMB=%p\n", pMsg1));
2868*4e1bc9a0SAchim Leubner /* process the response message */
2869*4e1bc9a0SAchim Leubner }
2870*4e1bc9a0SAchim Leubner break;
2871*4e1bc9a0SAchim Leubner }
2872*4e1bc9a0SAchim Leubner case OPC_OUB_SET_CONTROLLER_CONFIG:
2873*4e1bc9a0SAchim Leubner {
2874*4e1bc9a0SAchim Leubner SA_DBG3(("mpiParseOBIomb, OPC_OUB_SET_CONTROLLER_CONFIG Response received IOMB=%p\n", pMsg1));
2875*4e1bc9a0SAchim Leubner mpiSetControllerConfigRsp(agRoot, (agsaSetControllerConfigRsp_t *)pMsg1);
2876*4e1bc9a0SAchim Leubner break;
2877*4e1bc9a0SAchim Leubner }
2878*4e1bc9a0SAchim Leubner case OPC_OUB_GET_CONTROLLER_CONFIG:
2879*4e1bc9a0SAchim Leubner {
2880*4e1bc9a0SAchim Leubner SA_DBG3(("mpiParseOBIomb, OPC_OUB_GET_CONTROLLER_CONFIG Response received IOMB=%p\n", pMsg1));
2881*4e1bc9a0SAchim Leubner mpiGetControllerConfigRsp(agRoot, (agsaGetControllerConfigRsp_t *)pMsg1);
2882*4e1bc9a0SAchim Leubner break;
2883*4e1bc9a0SAchim Leubner }
2884*4e1bc9a0SAchim Leubner case OPC_OUB_KEK_MANAGEMENT:
2885*4e1bc9a0SAchim Leubner {
2886*4e1bc9a0SAchim Leubner SA_DBG3(("mpiParseOBIomb, OPC_OUB_KEK_MANAGEMENT Response received IOMB=%p\n", pMsg1));
2887*4e1bc9a0SAchim Leubner mpiKekManagementRsp(agRoot, (agsaKekManagementRsp_t *)pMsg1);
2888*4e1bc9a0SAchim Leubner break;
2889*4e1bc9a0SAchim Leubner }
2890*4e1bc9a0SAchim Leubner case OPC_OUB_DEK_MANAGEMENT:
2891*4e1bc9a0SAchim Leubner {
2892*4e1bc9a0SAchim Leubner SA_DBG3(("mpiParseOBIomb, OPC_OUB_DEK_MANAGEMENT Response received IOMB=%p\n", pMsg1));
2893*4e1bc9a0SAchim Leubner mpiDekManagementRsp(agRoot, (agsaDekManagementRsp_t *)pMsg1);
2894*4e1bc9a0SAchim Leubner break;
2895*4e1bc9a0SAchim Leubner }
2896*4e1bc9a0SAchim Leubner case OPC_OUB_OPR_MGMT:
2897*4e1bc9a0SAchim Leubner {
2898*4e1bc9a0SAchim Leubner SA_DBG1(("mpiParseOBIomb, OPC_OUB_OPR_MGMT Response received IOMB=%p\n", pMsg1));
2899*4e1bc9a0SAchim Leubner mpiOperatorManagementRsp(agRoot, (agsaOperatorMangmenRsp_t *)pMsg1);
2900*4e1bc9a0SAchim Leubner break;
2901*4e1bc9a0SAchim Leubner }
2902*4e1bc9a0SAchim Leubner case OPC_OUB_ENC_TEST_EXECUTE:
2903*4e1bc9a0SAchim Leubner {
2904*4e1bc9a0SAchim Leubner SA_DBG1(("mpiParseOBIomb, OPC_OUB_ENC_TEST_EXECUTE Response received IOMB=%p\n", pMsg1));
2905*4e1bc9a0SAchim Leubner mpiBistRsp(agRoot, (agsaEncryptBistRsp_t *)pMsg1);
2906*4e1bc9a0SAchim Leubner break;
2907*4e1bc9a0SAchim Leubner }
2908*4e1bc9a0SAchim Leubner case OPC_OUB_SET_OPERATOR:
2909*4e1bc9a0SAchim Leubner {
2910*4e1bc9a0SAchim Leubner SA_DBG1(("mpiParseOBIomb, OPC_OUB_SET_OPERATOR Response received IOMB=%p\n", pMsg1));
2911*4e1bc9a0SAchim Leubner mpiSetOperatorRsp(agRoot, (agsaSetOperatorRsp_t *)pMsg1);
2912*4e1bc9a0SAchim Leubner break;
2913*4e1bc9a0SAchim Leubner }
2914*4e1bc9a0SAchim Leubner case OPC_OUB_GET_OPERATOR:
2915*4e1bc9a0SAchim Leubner {
2916*4e1bc9a0SAchim Leubner SA_DBG1(("mpiParseOBIomb, OPC_OUB_GET_OPERATOR Response received IOMB=%p\n", pMsg1));
2917*4e1bc9a0SAchim Leubner mpiGetOperatorRsp(agRoot, (agsaGetOperatorRsp_t *)pMsg1);
2918*4e1bc9a0SAchim Leubner break;
2919*4e1bc9a0SAchim Leubner }
2920*4e1bc9a0SAchim Leubner case OPC_OUB_DIF_ENC_OFFLOAD_RSP:
2921*4e1bc9a0SAchim Leubner {
2922*4e1bc9a0SAchim Leubner SA_ASSERT((smIS_SPCV(agRoot)), "smIS_SPCV");
2923*4e1bc9a0SAchim Leubner SA_DBG1(("mpiParseOBIomb, OPC_OUB_DIF_ENC_OFFLOAD_RSP Response received IOMB=%p\n", pMsg1));
2924*4e1bc9a0SAchim Leubner /* process the response message */
2925*4e1bc9a0SAchim Leubner mpiDifEncOffloadRsp(agRoot, (agsaDifEncOffloadRspV_t *)pMsg1);
2926*4e1bc9a0SAchim Leubner break;
2927*4e1bc9a0SAchim Leubner }
2928*4e1bc9a0SAchim Leubner default:
2929*4e1bc9a0SAchim Leubner {
2930*4e1bc9a0SAchim Leubner #ifdef SALL_API_TEST
2931*4e1bc9a0SAchim Leubner saRoot->LLCounters.IOCounter.numUNKNWRespIOMB++;
2932*4e1bc9a0SAchim Leubner SA_DBG1(("mpiParseOBIomb, UnKnown Response received IOMB=%p, %d\n",
2933*4e1bc9a0SAchim Leubner pMsg1, saRoot->LLCounters.IOCounter.numUNKNWRespIOMB));
2934*4e1bc9a0SAchim Leubner #else
2935*4e1bc9a0SAchim Leubner SA_DBG1(("mpiParseOBIomb, Unknown IOMB Response received opcode 0x%X IOMB=%p\n",opcode, pMsg1));
2936*4e1bc9a0SAchim Leubner #endif
2937*4e1bc9a0SAchim Leubner break;
2938*4e1bc9a0SAchim Leubner }
2939*4e1bc9a0SAchim Leubner } /* switch */
2940*4e1bc9a0SAchim Leubner
2941*4e1bc9a0SAchim Leubner smTraceFuncExit(hpDBG_VERY_LOUD, 'a', "2f");
2942*4e1bc9a0SAchim Leubner
2943*4e1bc9a0SAchim Leubner return ret;
2944*4e1bc9a0SAchim Leubner
2945*4e1bc9a0SAchim Leubner }
2946*4e1bc9a0SAchim Leubner
2947*4e1bc9a0SAchim Leubner
2948*4e1bc9a0SAchim Leubner /******************************************************************************/
2949*4e1bc9a0SAchim Leubner /*! \brief SPC MPI SATA Completion
2950*4e1bc9a0SAchim Leubner *
2951*4e1bc9a0SAchim Leubner * This function handles the SATA completion.
2952*4e1bc9a0SAchim Leubner *
2953*4e1bc9a0SAchim Leubner * \param agRoot Handles for this instance of SAS/SATA LLL
2954*4e1bc9a0SAchim Leubner * \param pIomb1 Pointer of Message1
2955*4e1bc9a0SAchim Leubner * \param bc buffer count
2956*4e1bc9a0SAchim Leubner *
2957*4e1bc9a0SAchim Leubner * \return The read value
2958*4e1bc9a0SAchim Leubner *
2959*4e1bc9a0SAchim Leubner */
2960*4e1bc9a0SAchim Leubner /*******************************************************************************/
2961*4e1bc9a0SAchim Leubner GLOBAL FORCEINLINE
mpiSATACompletion(agsaRoot_t * agRoot,bit32 * pIomb1)2962*4e1bc9a0SAchim Leubner bit32 mpiSATACompletion(
2963*4e1bc9a0SAchim Leubner agsaRoot_t *agRoot,
2964*4e1bc9a0SAchim Leubner bit32 *pIomb1
2965*4e1bc9a0SAchim Leubner )
2966*4e1bc9a0SAchim Leubner {
2967*4e1bc9a0SAchim Leubner bit32 ret = AGSA_RC_SUCCESS;
2968*4e1bc9a0SAchim Leubner agsaLLRoot_t *saRoot = (agsaLLRoot_t *)(agRoot->sdkData);
2969*4e1bc9a0SAchim Leubner bit32 status;
2970*4e1bc9a0SAchim Leubner bit32 tag;
2971*4e1bc9a0SAchim Leubner bit32 param;
2972*4e1bc9a0SAchim Leubner agsaIORequestDesc_t *pRequest;
2973*4e1bc9a0SAchim Leubner bit32 *agFirstDword;
2974*4e1bc9a0SAchim Leubner bit32 *pResp;
2975*4e1bc9a0SAchim Leubner
2976*4e1bc9a0SAchim Leubner smTraceFuncEnter(hpDBG_VERY_LOUD,"2s");
2977*4e1bc9a0SAchim Leubner
2978*4e1bc9a0SAchim Leubner OSSA_READ_LE_32(AGROOT, &tag, pIomb1, OSSA_OFFSET_OF(agsaSATACompletionRsp_t, tag)) ;
2979*4e1bc9a0SAchim Leubner OSSA_READ_LE_32(AGROOT, &status, pIomb1, OSSA_OFFSET_OF(agsaSATACompletionRsp_t, status)) ;
2980*4e1bc9a0SAchim Leubner OSSA_READ_LE_32(AGROOT, ¶m, pIomb1, OSSA_OFFSET_OF(agsaSATACompletionRsp_t, param)) ;
2981*4e1bc9a0SAchim Leubner
2982*4e1bc9a0SAchim Leubner SA_DBG3(("mpiSATACompletion: start, HTAG=0x%x\n", tag));
2983*4e1bc9a0SAchim Leubner
2984*4e1bc9a0SAchim Leubner /* get IOrequest from IOMap */
2985*4e1bc9a0SAchim Leubner pRequest = (agsaIORequestDesc_t*)saRoot->IOMap[tag].IORequest;
2986*4e1bc9a0SAchim Leubner SA_ASSERT((pRequest), "pRequest");
2987*4e1bc9a0SAchim Leubner
2988*4e1bc9a0SAchim Leubner if(agNULL == pRequest)
2989*4e1bc9a0SAchim Leubner {
2990*4e1bc9a0SAchim Leubner SA_DBG1(("mpiSATACompletion: agNULL == pRequest tag 0x%X status 0x%X\n",tag, status ));
2991*4e1bc9a0SAchim Leubner smTraceFuncExit(hpDBG_VERY_LOUD, 'a', "2s");
2992*4e1bc9a0SAchim Leubner return AGSA_RC_FAILURE;
2993*4e1bc9a0SAchim Leubner }
2994*4e1bc9a0SAchim Leubner
2995*4e1bc9a0SAchim Leubner SA_ASSERT((pRequest->valid), "pRequest->valid");
2996*4e1bc9a0SAchim Leubner if(!pRequest->valid)
2997*4e1bc9a0SAchim Leubner {
2998*4e1bc9a0SAchim Leubner SA_DBG1(("mpiSATACompletion: not valid IOMB tag=0x%x status=0x%x param=0x%x Device =0x%x\n", tag, status, param,
2999*4e1bc9a0SAchim Leubner pRequest->pDevice ? pRequest->pDevice->DeviceMapIndex : -1));
3000*4e1bc9a0SAchim Leubner }
3001*4e1bc9a0SAchim Leubner
3002*4e1bc9a0SAchim Leubner switch (status)
3003*4e1bc9a0SAchim Leubner {
3004*4e1bc9a0SAchim Leubner case OSSA_IO_SUCCESS:
3005*4e1bc9a0SAchim Leubner {
3006*4e1bc9a0SAchim Leubner SA_DBG3(("mpiSATACompletion: OSSA_IO_SUCCESS, param=0x%x\n", param));
3007*4e1bc9a0SAchim Leubner if (!param)
3008*4e1bc9a0SAchim Leubner {
3009*4e1bc9a0SAchim Leubner /* SATA request completion */
3010*4e1bc9a0SAchim Leubner siIODone( agRoot, pRequest, OSSA_IO_SUCCESS, 0);
3011*4e1bc9a0SAchim Leubner }
3012*4e1bc9a0SAchim Leubner else
3013*4e1bc9a0SAchim Leubner {
3014*4e1bc9a0SAchim Leubner /* param number bytes of SATA Rsp */
3015*4e1bc9a0SAchim Leubner agFirstDword = &pIomb1[3];
3016*4e1bc9a0SAchim Leubner pResp = &pIomb1[4];
3017*4e1bc9a0SAchim Leubner
3018*4e1bc9a0SAchim Leubner /* CB function to the up layer */
3019*4e1bc9a0SAchim Leubner /* Response Length not include firstDW */
3020*4e1bc9a0SAchim Leubner saRoot->IoErrorCount.agOSSA_IO_COMPLETED_ERROR_SCSI_STATUS++;
3021*4e1bc9a0SAchim Leubner SA_DBG2(("mpiSATACompletion: param 0x%x agFirstDwordResp 0x%x Resp 0x%x tag 0x%x\n",param,*agFirstDword,*pResp ,tag));
3022*4e1bc9a0SAchim Leubner siEventSATAResponseWtDataRcvd(agRoot, pRequest, agFirstDword, pResp, (param - 4));
3023*4e1bc9a0SAchim Leubner }
3024*4e1bc9a0SAchim Leubner
3025*4e1bc9a0SAchim Leubner break;
3026*4e1bc9a0SAchim Leubner }
3027*4e1bc9a0SAchim Leubner case OSSA_IO_ABORTED:
3028*4e1bc9a0SAchim Leubner {
3029*4e1bc9a0SAchim Leubner SA_DBG2(("mpiSATACompletion: OSSA_IO_ABORTED tag 0x%X\n", tag));
3030*4e1bc9a0SAchim Leubner saRoot->IoErrorCount.agOSSA_IO_ABORTED++;
3031*4e1bc9a0SAchim Leubner siAbnormal(agRoot, pRequest, status, param, 0);
3032*4e1bc9a0SAchim Leubner break;
3033*4e1bc9a0SAchim Leubner }
3034*4e1bc9a0SAchim Leubner case OSSA_IO_UNDERFLOW:
3035*4e1bc9a0SAchim Leubner {
3036*4e1bc9a0SAchim Leubner /* SATA Completion with error */
3037*4e1bc9a0SAchim Leubner SA_DBG1(("mpiSATACompletion, OSSA_IO_UNDERFLOW tag 0x%X\n", tag));
3038*4e1bc9a0SAchim Leubner /*underflow means underrun, treat it as success*/
3039*4e1bc9a0SAchim Leubner saRoot->IoErrorCount.agOSSA_IO_UNDERFLOW++;
3040*4e1bc9a0SAchim Leubner siAbnormal(agRoot, pRequest, status, param, 0);
3041*4e1bc9a0SAchim Leubner break;
3042*4e1bc9a0SAchim Leubner }
3043*4e1bc9a0SAchim Leubner case OSSA_IO_NO_DEVICE:
3044*4e1bc9a0SAchim Leubner {
3045*4e1bc9a0SAchim Leubner SA_DBG1(("mpiSATACompletion, OSSA_IO_NO_DEVICE tag 0x%X\n", tag));
3046*4e1bc9a0SAchim Leubner saRoot->IoErrorCount.agOSSA_IO_NO_DEVICE++;
3047*4e1bc9a0SAchim Leubner siAbnormal(agRoot, pRequest, status, 0, 0);
3048*4e1bc9a0SAchim Leubner break;
3049*4e1bc9a0SAchim Leubner }
3050*4e1bc9a0SAchim Leubner case OSSA_IO_XFER_ERROR_BREAK:
3051*4e1bc9a0SAchim Leubner {
3052*4e1bc9a0SAchim Leubner SA_DBG1(("mpiSATACompletion, OSSA_IO_XFER_ERROR_BREAK SPC tag 0x%X\n", tag));
3053*4e1bc9a0SAchim Leubner saRoot->IoErrorCount.agOSSA_IO_XFER_ERROR_BREAK++;
3054*4e1bc9a0SAchim Leubner siAbnormal(agRoot, pRequest, status, 0, 0);
3055*4e1bc9a0SAchim Leubner break;
3056*4e1bc9a0SAchim Leubner }
3057*4e1bc9a0SAchim Leubner case OSSA_IO_XFER_ERROR_PHY_NOT_READY:
3058*4e1bc9a0SAchim Leubner {
3059*4e1bc9a0SAchim Leubner SA_DBG1(("mpiSATACompletion, OSSA_IO_XFER_ERROR_PHY_NOT_READY tag 0x%X\n", tag));
3060*4e1bc9a0SAchim Leubner saRoot->IoErrorCount.agOSSA_IO_XFER_ERROR_PHY_NOT_READY++;
3061*4e1bc9a0SAchim Leubner siAbnormal(agRoot, pRequest, status, 0, 0);
3062*4e1bc9a0SAchim Leubner break;
3063*4e1bc9a0SAchim Leubner }
3064*4e1bc9a0SAchim Leubner case OSSA_IO_OPEN_CNX_ERROR_PROTOCOL_NOT_SUPPORTED:
3065*4e1bc9a0SAchim Leubner {
3066*4e1bc9a0SAchim Leubner SA_DBG1(("mpiSATACompletion, OSSA_IO_OPEN_CNX_ERROR_PROTOCOL_NOT_SUPPORTED tag 0x%X\n", tag));
3067*4e1bc9a0SAchim Leubner saRoot->IoErrorCount.agOSSA_IO_OPEN_CNX_ERROR_PROTOCOL_NOT_SUPPORTED++;
3068*4e1bc9a0SAchim Leubner siAbnormal(agRoot, pRequest, status, 0, 0);
3069*4e1bc9a0SAchim Leubner break;
3070*4e1bc9a0SAchim Leubner }
3071*4e1bc9a0SAchim Leubner case OSSA_IO_OPEN_CNX_ERROR_ZONE_VIOLATION:
3072*4e1bc9a0SAchim Leubner {
3073*4e1bc9a0SAchim Leubner SA_DBG1(("mpiSATACompletion, OSSA_IO_OPEN_CNX_ERROR_ZONE_VIOLATION tag 0x%X\n", tag));
3074*4e1bc9a0SAchim Leubner saRoot->IoErrorCount.agOSSA_IO_OPEN_CNX_ERROR_ZONE_VIOLATION++;
3075*4e1bc9a0SAchim Leubner siAbnormal(agRoot, pRequest, status, 0, 0);
3076*4e1bc9a0SAchim Leubner break;
3077*4e1bc9a0SAchim Leubner }
3078*4e1bc9a0SAchim Leubner case OSSA_IO_OPEN_CNX_ERROR_BREAK:
3079*4e1bc9a0SAchim Leubner {
3080*4e1bc9a0SAchim Leubner SA_DBG1(("mpiSATACompletion, OSSA_IO_OPEN_CNX_ERROR_BREAK SPC tag 0x%X\n", tag));
3081*4e1bc9a0SAchim Leubner saRoot->IoErrorCount.agOSSA_IO_OPEN_CNX_ERROR_BREAK++;
3082*4e1bc9a0SAchim Leubner siAbnormal(agRoot, pRequest, status, 0, 0);
3083*4e1bc9a0SAchim Leubner break;
3084*4e1bc9a0SAchim Leubner }
3085*4e1bc9a0SAchim Leubner case OSSA_IO_OPEN_CNX_ERROR_IT_NEXUS_LOSS:
3086*4e1bc9a0SAchim Leubner {
3087*4e1bc9a0SAchim Leubner SA_DBG1(("mpiSATACompletion, OSSA_IO_OPEN_CNX_ERROR_IT_NEXUS_LOSS tag 0x%X\n", tag));
3088*4e1bc9a0SAchim Leubner saRoot->IoErrorCount.agOSSA_IO_OPEN_CNX_ERROR_IT_NEXUS_LOSS++;
3089*4e1bc9a0SAchim Leubner siAbnormal(agRoot, pRequest, status, 0, 0);
3090*4e1bc9a0SAchim Leubner break;
3091*4e1bc9a0SAchim Leubner }
3092*4e1bc9a0SAchim Leubner case OSSA_IO_OPEN_CNX_ERROR_BAD_DESTINATION:
3093*4e1bc9a0SAchim Leubner {
3094*4e1bc9a0SAchim Leubner SA_DBG1(("mpiSATACompletion, OSSA_IO_OPEN_CNX_ERROR_BAD_DESTINATION tag 0x%X\n", tag));
3095*4e1bc9a0SAchim Leubner saRoot->IoErrorCount.agOSSA_IO_OPEN_CNX_ERROR_BAD_DESTINATION++;
3096*4e1bc9a0SAchim Leubner siAbnormal(agRoot, pRequest, status, 0, 0);
3097*4e1bc9a0SAchim Leubner break;
3098*4e1bc9a0SAchim Leubner }
3099*4e1bc9a0SAchim Leubner case OSSA_IO_OPEN_CNX_ERROR_CONNECTION_RATE_NOT_SUPPORTED:
3100*4e1bc9a0SAchim Leubner {
3101*4e1bc9a0SAchim Leubner SA_DBG1(("mpiSATACompletion, OSSA_IO_OPEN_CNX_ERROR_CONNECTION_RATE_NOT_SUPPORTED tag 0x%X\n", tag));
3102*4e1bc9a0SAchim Leubner saRoot->IoErrorCount.agOSSA_IO_OPEN_CNX_ERROR_CONNECTION_RATE_NOT_SUPPORTED++;
3103*4e1bc9a0SAchim Leubner siAbnormal(agRoot, pRequest, status, 0, 0);
3104*4e1bc9a0SAchim Leubner break;
3105*4e1bc9a0SAchim Leubner }
3106*4e1bc9a0SAchim Leubner case OSSA_IO_OPEN_CNX_ERROR_STP_RESOURCES_BUSY:
3107*4e1bc9a0SAchim Leubner {
3108*4e1bc9a0SAchim Leubner SA_DBG1(("mpiSATACompletion, OSSA_IO_OPEN_CNX_ERROR_STP_RESOURCES_BUSY tag 0x%X\n", tag));
3109*4e1bc9a0SAchim Leubner saRoot->IoErrorCount.agOSSA_IO_OPEN_CNX_ERROR_STP_RESOURCES_BUSY++;
3110*4e1bc9a0SAchim Leubner siAbnormal(agRoot, pRequest, status, 0, 0);
3111*4e1bc9a0SAchim Leubner break;
3112*4e1bc9a0SAchim Leubner }
3113*4e1bc9a0SAchim Leubner case OSSA_IO_OPEN_CNX_ERROR_WRONG_DESTINATION:
3114*4e1bc9a0SAchim Leubner {
3115*4e1bc9a0SAchim Leubner SA_DBG1(("mpiSATACompletion, OSSA_IO_OPEN_CNX_ERROR_WRONG_DESTINATION tag 0x%X\n", tag));
3116*4e1bc9a0SAchim Leubner saRoot->IoErrorCount.agOSSA_IO_OPEN_CNX_ERROR_WRONG_DESTINATION++;
3117*4e1bc9a0SAchim Leubner siAbnormal(agRoot, pRequest, status, 0, 0);
3118*4e1bc9a0SAchim Leubner break;
3119*4e1bc9a0SAchim Leubner }
3120*4e1bc9a0SAchim Leubner case OSSA_IO_XFER_ERROR_NAK_RECEIVED:
3121*4e1bc9a0SAchim Leubner {
3122*4e1bc9a0SAchim Leubner SA_DBG1(("mpiSATACompletion, OSSA_IO_XFER_ERROR_NAK_RECEIVED tag 0x%X\n", tag));
3123*4e1bc9a0SAchim Leubner saRoot->IoErrorCount.agOSSA_IO_XFER_ERROR_NAK_RECEIVED++;
3124*4e1bc9a0SAchim Leubner siAbnormal(agRoot, pRequest, status, 0, 0);
3125*4e1bc9a0SAchim Leubner break;
3126*4e1bc9a0SAchim Leubner }
3127*4e1bc9a0SAchim Leubner case OSSA_IO_XFER_ERROR_DMA:
3128*4e1bc9a0SAchim Leubner {
3129*4e1bc9a0SAchim Leubner SA_DBG1(("mpiSATACompletion, OSSA_IO_XFER_ERROR_DMA tag 0x%X\n", tag));
3130*4e1bc9a0SAchim Leubner saRoot->IoErrorCount.agOSSA_IO_XFER_ERROR_DMA++;
3131*4e1bc9a0SAchim Leubner siAbnormal(agRoot, pRequest, status, 0, 0);
3132*4e1bc9a0SAchim Leubner break;
3133*4e1bc9a0SAchim Leubner }
3134*4e1bc9a0SAchim Leubner case OSSA_IO_XFER_ERROR_SATA_LINK_TIMEOUT:
3135*4e1bc9a0SAchim Leubner {
3136*4e1bc9a0SAchim Leubner SA_DBG1(("mpiSATACompletion, OSSA_IO_XFER_ERROR_SATA_LINK_TIMEOUT tag 0x%X\n", tag));
3137*4e1bc9a0SAchim Leubner saRoot->IoErrorCount.agOSSA_IO_XFER_ERROR_SATA_LINK_TIMEOUT++;
3138*4e1bc9a0SAchim Leubner siAbnormal(agRoot, pRequest, status, 0, 0);
3139*4e1bc9a0SAchim Leubner break;
3140*4e1bc9a0SAchim Leubner }
3141*4e1bc9a0SAchim Leubner case OSSA_IO_XFER_ERROR_REJECTED_NCQ_MODE:
3142*4e1bc9a0SAchim Leubner {
3143*4e1bc9a0SAchim Leubner SA_DBG1(("mpiSATACompletion, OSSA_IO_XFER_ERROR_REJECTED_NCQ_MODE tag 0x%X\n", tag));
3144*4e1bc9a0SAchim Leubner saRoot->IoErrorCount.agOSSA_IO_XFER_ERROR_REJECTED_NCQ_MODE++;
3145*4e1bc9a0SAchim Leubner siAbnormal(agRoot, pRequest, status, 0, 0);
3146*4e1bc9a0SAchim Leubner break;
3147*4e1bc9a0SAchim Leubner }
3148*4e1bc9a0SAchim Leubner case OSSA_IO_XFER_OPEN_RETRY_TIMEOUT:
3149*4e1bc9a0SAchim Leubner {
3150*4e1bc9a0SAchim Leubner SA_DBG1(("mpiSATACompletion, OSSA_IO_XFER_OPEN_RETRY_TIMEOUT tag 0x%X\n", tag));
3151*4e1bc9a0SAchim Leubner saRoot->IoErrorCount.agOSSA_IO_XFER_OPEN_RETRY_TIMEOUT++;
3152*4e1bc9a0SAchim Leubner siAbnormal(agRoot, pRequest, status, 0, 0);
3153*4e1bc9a0SAchim Leubner break;
3154*4e1bc9a0SAchim Leubner }
3155*4e1bc9a0SAchim Leubner case OSSA_IO_PORT_IN_RESET:
3156*4e1bc9a0SAchim Leubner {
3157*4e1bc9a0SAchim Leubner SA_DBG1(("mpiSATACompletion: OSSA_IO_PORT_IN_RESET tag 0x%X\n", tag));
3158*4e1bc9a0SAchim Leubner saRoot->IoErrorCount.agOSSA_IO_PORT_IN_RESET++;
3159*4e1bc9a0SAchim Leubner siAbnormal(agRoot, pRequest, status, 0, 0);
3160*4e1bc9a0SAchim Leubner break;
3161*4e1bc9a0SAchim Leubner }
3162*4e1bc9a0SAchim Leubner case OSSA_IO_DS_NON_OPERATIONAL:
3163*4e1bc9a0SAchim Leubner {
3164*4e1bc9a0SAchim Leubner SA_DBG1(("mpiSATACompletion: OSSA_IO_DS_NON_OPERATIONAL tag 0x%X\n", tag));
3165*4e1bc9a0SAchim Leubner saRoot->IoErrorCount.agOSSA_IO_DS_NON_OPERATIONAL++;
3166*4e1bc9a0SAchim Leubner siAbnormal(agRoot, pRequest, status, 0, 0);
3167*4e1bc9a0SAchim Leubner break;
3168*4e1bc9a0SAchim Leubner }
3169*4e1bc9a0SAchim Leubner case OSSA_IO_DS_IN_RECOVERY:
3170*4e1bc9a0SAchim Leubner {
3171*4e1bc9a0SAchim Leubner SA_DBG1(("mpiSATACompletion: OSSA_IO_DS_IN_RECOVERY tag 0x%X\n", tag));
3172*4e1bc9a0SAchim Leubner saRoot->IoErrorCount.agOSSA_IO_DS_IN_RECOVERY++;
3173*4e1bc9a0SAchim Leubner siAbnormal(agRoot, pRequest, status, 0, 0);
3174*4e1bc9a0SAchim Leubner break;
3175*4e1bc9a0SAchim Leubner }
3176*4e1bc9a0SAchim Leubner case OSSA_IO_DS_IN_ERROR:
3177*4e1bc9a0SAchim Leubner {
3178*4e1bc9a0SAchim Leubner SA_DBG1(("mpiSATACompletion: OSSA_IO_DS_IN_ERROR tag 0x%X\n", tag));
3179*4e1bc9a0SAchim Leubner saRoot->IoErrorCount.agOSSA_IO_DS_IN_ERROR++;
3180*4e1bc9a0SAchim Leubner siAbnormal(agRoot, pRequest, status, 0, 0);
3181*4e1bc9a0SAchim Leubner break;
3182*4e1bc9a0SAchim Leubner }
3183*4e1bc9a0SAchim Leubner
3184*4e1bc9a0SAchim Leubner case OSSA_IO_OPEN_CNX_ERROR_HW_RESOURCE_BUSY:
3185*4e1bc9a0SAchim Leubner {
3186*4e1bc9a0SAchim Leubner SA_DBG1(("mpiSATACompletion: OSSA_IO_OPEN_CNX_ERROR_HW_RESOURCE_BUSY tag 0x%X\n", tag));
3187*4e1bc9a0SAchim Leubner saRoot->IoErrorCount.agOSSA_IO_OPEN_CNX_ERROR_HW_RESOURCE_BUSY++;
3188*4e1bc9a0SAchim Leubner siAbnormal(agRoot, pRequest, status, 0, 0);
3189*4e1bc9a0SAchim Leubner break;
3190*4e1bc9a0SAchim Leubner }
3191*4e1bc9a0SAchim Leubner case OSSA_IO_ABORT_IN_PROGRESS:
3192*4e1bc9a0SAchim Leubner {
3193*4e1bc9a0SAchim Leubner SA_DBG1(("mpiSATACompletion: OSSA_IO_ABORT_IN_PROGRESS tag 0x%X\n", tag));
3194*4e1bc9a0SAchim Leubner saRoot->IoErrorCount.agOSSA_IO_ABORT_IN_PROGRESS++;
3195*4e1bc9a0SAchim Leubner siAbnormal(agRoot, pRequest, status, 0, 0);
3196*4e1bc9a0SAchim Leubner break;
3197*4e1bc9a0SAchim Leubner }
3198*4e1bc9a0SAchim Leubner case OSSA_IO_ABORT_DELAYED:
3199*4e1bc9a0SAchim Leubner {
3200*4e1bc9a0SAchim Leubner SA_DBG1(("mpiSATACompletion: OSSA_IO_ABORT_DELAYED tag 0x%X\n", tag));
3201*4e1bc9a0SAchim Leubner saRoot->IoErrorCount.agOSSA_IO_ABORT_DELAYED++;
3202*4e1bc9a0SAchim Leubner siAbnormal(agRoot, pRequest, status, 0, 0);
3203*4e1bc9a0SAchim Leubner break;
3204*4e1bc9a0SAchim Leubner }
3205*4e1bc9a0SAchim Leubner case OSSA_IO_OPEN_CNX_ERROR_HW_RESOURCE_BUSY_ALT:
3206*4e1bc9a0SAchim Leubner {
3207*4e1bc9a0SAchim Leubner SA_DBG1(("mpiSATACompletion: OSSA_IO_OPEN_CNX_ERROR_HW_RESOURCE_BUSY_ALT tag 0x%X\n", tag));
3208*4e1bc9a0SAchim Leubner saRoot->IoErrorCount.agOSSA_IO_OPEN_CNX_ERROR_HW_RESOURCE_BUSY_ALT++;
3209*4e1bc9a0SAchim Leubner siAbnormal(agRoot, pRequest, status, 0, 0);
3210*4e1bc9a0SAchim Leubner break;
3211*4e1bc9a0SAchim Leubner }
3212*4e1bc9a0SAchim Leubner case OSSA_IO_OPEN_CNX_ERROR_IT_NEXUS_LOSS_OPEN_RETRY_BACKOFF_THRESHOLD_REACHED:
3213*4e1bc9a0SAchim Leubner {
3214*4e1bc9a0SAchim Leubner SA_DBG1(("mpiSATACompletion: OSSA_IO_OPEN_CNX_ERROR_IT_NEXUS_LOSS_OPEN_RETRY_BACKOFF_THRESHOLD_REACHED HTAG = 0x%x\n", tag));
3215*4e1bc9a0SAchim Leubner saRoot->IoErrorCount.agOSSA_IO_OPEN_CNX_ERROR_IT_NEXUS_LOSS_OPEN_RETRY_BACKOFF_THRESHOLD_REACHED++;
3216*4e1bc9a0SAchim Leubner siAbnormal(agRoot, pRequest, status, 0, 0);
3217*4e1bc9a0SAchim Leubner break;
3218*4e1bc9a0SAchim Leubner }
3219*4e1bc9a0SAchim Leubner case OSSA_IO_OPEN_CNX_ERROR_IT_NEXUS_LOSS_OPEN_TMO:
3220*4e1bc9a0SAchim Leubner {
3221*4e1bc9a0SAchim Leubner SA_DBG1(("mpiSATACompletion, OSSA_IO_OPEN_CNX_ERROR_IT_NEXUS_LOSS_OPEN_TMO tag 0x%x\n", tag));
3222*4e1bc9a0SAchim Leubner saRoot->IoErrorCount.agOSSA_IO_OPEN_CNX_ERROR_IT_NEXUS_LOSS_OPEN_TMO++;
3223*4e1bc9a0SAchim Leubner siAbnormal(agRoot, pRequest, status, 0, 0 );
3224*4e1bc9a0SAchim Leubner break;
3225*4e1bc9a0SAchim Leubner }
3226*4e1bc9a0SAchim Leubner case OSSA_IO_OPEN_CNX_ERROR_IT_NEXUS_LOSS_NO_DEST:
3227*4e1bc9a0SAchim Leubner {
3228*4e1bc9a0SAchim Leubner SA_DBG1(("mpiSATACompletion, OSSA_IO_OPEN_CNX_ERROR_IT_NEXUS_LOSS_NO_DEST tag 0x%x\n", tag));
3229*4e1bc9a0SAchim Leubner saRoot->IoErrorCount.agOSSA_IO_OPEN_CNX_ERROR_IT_NEXUS_LOSS_NO_DEST++;
3230*4e1bc9a0SAchim Leubner siAbnormal(agRoot, pRequest, status, 0, 0 );
3231*4e1bc9a0SAchim Leubner break;
3232*4e1bc9a0SAchim Leubner }
3233*4e1bc9a0SAchim Leubner case OSSA_IO_OPEN_CNX_ERROR_IT_NEXUS_LOSS_OPEN_COLLIDE:
3234*4e1bc9a0SAchim Leubner {
3235*4e1bc9a0SAchim Leubner SA_DBG1(("mpiSATACompletion, OSSA_IO_OPEN_CNX_ERROR_IT_NEXUS_LOSS_OPEN_COLLIDE tag 0x%x\n", tag));
3236*4e1bc9a0SAchim Leubner saRoot->IoErrorCount.agOSSA_IO_OPEN_CNX_ERROR_IT_NEXUS_LOSS_OPEN_COLLIDE++;
3237*4e1bc9a0SAchim Leubner siAbnormal(agRoot, pRequest, status, 0, 0 );
3238*4e1bc9a0SAchim Leubner break;
3239*4e1bc9a0SAchim Leubner }
3240*4e1bc9a0SAchim Leubner case OSSA_IO_OPEN_CNX_ERROR_IT_NEXUS_LOSS_PATHWAY_BLOCKED:
3241*4e1bc9a0SAchim Leubner {
3242*4e1bc9a0SAchim Leubner SA_DBG1(("mpiSATACompletion, OSSA_IO_OPEN_CNX_ERROR_IT_NEXUS_LOSS_PATHWAY_BLOCKED tag 0x%x\n", tag));
3243*4e1bc9a0SAchim Leubner saRoot->IoErrorCount.agOSSA_IO_OPEN_CNX_ERROR_IT_NEXUS_LOSS_PATHWAY_BLOCKED++;
3244*4e1bc9a0SAchim Leubner siAbnormal(agRoot, pRequest, status, 0, 0 );
3245*4e1bc9a0SAchim Leubner break;
3246*4e1bc9a0SAchim Leubner }
3247*4e1bc9a0SAchim Leubner case OSSA_IO_DS_INVALID:
3248*4e1bc9a0SAchim Leubner {
3249*4e1bc9a0SAchim Leubner SA_DBG1(("mpiSATACompletion: OSSA_IO_DS_INVALID tag 0x%X\n", tag));
3250*4e1bc9a0SAchim Leubner saRoot->IoErrorCount.agOSSA_IO_DS_INVALID++;
3251*4e1bc9a0SAchim Leubner siAbnormal(agRoot, pRequest, status, 0, 0);
3252*4e1bc9a0SAchim Leubner break;
3253*4e1bc9a0SAchim Leubner }
3254*4e1bc9a0SAchim Leubner case OSSA_IO_XFER_ERR_LAST_PIO_DATAIN_CRC_ERR:
3255*4e1bc9a0SAchim Leubner {
3256*4e1bc9a0SAchim Leubner SA_DBG1(("mpiSATACompletion: OSSA_IO_XFER_ERR_LAST_PIO_DATAIN_CRC_ERR tag 0x%X\n", tag));
3257*4e1bc9a0SAchim Leubner saRoot->IoErrorCount.agOSSA_IO_XFER_ERR_LAST_PIO_DATAIN_CRC_ERR++;
3258*4e1bc9a0SAchim Leubner siAbnormal(agRoot, pRequest, status, 0, 0);
3259*4e1bc9a0SAchim Leubner break;
3260*4e1bc9a0SAchim Leubner }
3261*4e1bc9a0SAchim Leubner case OSSA_MPI_IO_RQE_BUSY_FULL:
3262*4e1bc9a0SAchim Leubner {
3263*4e1bc9a0SAchim Leubner SA_DBG1(("mpiSATACompletion: OSSA_MPI_IO_RQE_BUSY_FULL tag 0x%X\n", tag));
3264*4e1bc9a0SAchim Leubner saRoot->IoErrorCount.agOSSA_MPI_IO_RQE_BUSY_FULL++;
3265*4e1bc9a0SAchim Leubner siAbnormal(agRoot, pRequest, status, 0, 0);
3266*4e1bc9a0SAchim Leubner break;
3267*4e1bc9a0SAchim Leubner }
3268*4e1bc9a0SAchim Leubner #ifdef REMOVED
3269*4e1bc9a0SAchim Leubner case OSSA_IO_XFER_ERR_EOB_DATA_OVERRUN:
3270*4e1bc9a0SAchim Leubner {
3271*4e1bc9a0SAchim Leubner SA_DBG1(("mpiSATACompletion: OSSA_IO_XFER_ERR_EOB_DATA_OVERRUN tag 0x%x\n", tag));
3272*4e1bc9a0SAchim Leubner saRoot->IoErrorCount.agOSSA_IO_XFER_ERR_EOB_DATA_OVERRUN++;
3273*4e1bc9a0SAchim Leubner siAbnormal(agRoot, pRequest, status, 0, 0);
3274*4e1bc9a0SAchim Leubner break;
3275*4e1bc9a0SAchim Leubner }
3276*4e1bc9a0SAchim Leubner #endif
3277*4e1bc9a0SAchim Leubner case OSSA_MPI_ERR_IO_RESOURCE_UNAVAILABLE:
3278*4e1bc9a0SAchim Leubner {
3279*4e1bc9a0SAchim Leubner SA_DBG1(("mpiSATACompletion: OPC_OUB_SATA_COMP:OSSA_MPI_ERR_IO_RESOURCE_UNAVAILABLE \n"));
3280*4e1bc9a0SAchim Leubner saRoot->IoErrorCount.agOSSA_MPI_ERR_IO_RESOURCE_UNAVAILABLE++;
3281*4e1bc9a0SAchim Leubner siAbnormal(agRoot, pRequest, status, 0, 0);
3282*4e1bc9a0SAchim Leubner break;
3283*4e1bc9a0SAchim Leubner }
3284*4e1bc9a0SAchim Leubner case OSSA_MPI_ERR_ATAPI_DEVICE_BUSY:
3285*4e1bc9a0SAchim Leubner {
3286*4e1bc9a0SAchim Leubner SA_DBG1(("mpiSATACompletion: OSSA_MPI_ERR_ATAPI_DEVICE_BUSY tag 0x%X\n", tag));
3287*4e1bc9a0SAchim Leubner saRoot->IoErrorCount.agOSSA_MPI_ERR_ATAPI_DEVICE_BUSY++;
3288*4e1bc9a0SAchim Leubner siAbnormal(agRoot, pRequest, status, param, 0 );
3289*4e1bc9a0SAchim Leubner break;
3290*4e1bc9a0SAchim Leubner }
3291*4e1bc9a0SAchim Leubner case OSSA_IO_XFR_ERROR_DEK_KEY_CACHE_MISS:
3292*4e1bc9a0SAchim Leubner {
3293*4e1bc9a0SAchim Leubner SA_DBG1(("mpiSATACompletion: OSSA_IO_XFR_ERROR_DEK_KEY_CACHE_MISS tag 0x%X\n", tag));
3294*4e1bc9a0SAchim Leubner saRoot->IoErrorCount.agOSSA_IO_XFR_ERROR_DEK_KEY_CACHE_MISS++;
3295*4e1bc9a0SAchim Leubner siAbnormal(agRoot, pRequest, status, 0, 0);
3296*4e1bc9a0SAchim Leubner break;
3297*4e1bc9a0SAchim Leubner }
3298*4e1bc9a0SAchim Leubner case OSSA_IO_XFR_ERROR_CIPHER_MODE_INVALID:
3299*4e1bc9a0SAchim Leubner {
3300*4e1bc9a0SAchim Leubner SA_DBG1(("mpiSATACompletion: OSSA_IO_XFR_ERROR_CIPHER_MODE_INVALID tag 0x%X\n", tag));
3301*4e1bc9a0SAchim Leubner saRoot->IoErrorCount.agOSSA_IO_XFR_ERROR_DEK_KEY_CACHE_MISS++;
3302*4e1bc9a0SAchim Leubner siAbnormal(agRoot, pRequest, status, 0, 0);
3303*4e1bc9a0SAchim Leubner break;
3304*4e1bc9a0SAchim Leubner }
3305*4e1bc9a0SAchim Leubner case OSSA_IO_XFR_ERROR_DEK_IV_MISMATCH:
3306*4e1bc9a0SAchim Leubner {
3307*4e1bc9a0SAchim Leubner SA_DBG1(("mpiSATACompletion: OSSA_IO_XFR_ERROR_DEK_IV_MISMATCH tag 0x%X\n", tag));
3308*4e1bc9a0SAchim Leubner saRoot->IoErrorCount.agOSSA_IO_XFR_ERROR_DEK_IV_MISMATCH++;
3309*4e1bc9a0SAchim Leubner siAbnormal(agRoot, pRequest, status, 0, 0);
3310*4e1bc9a0SAchim Leubner break;
3311*4e1bc9a0SAchim Leubner }
3312*4e1bc9a0SAchim Leubner case OSSA_IO_XFR_ERROR_DEK_RAM_INTERFACE_ERROR:
3313*4e1bc9a0SAchim Leubner {
3314*4e1bc9a0SAchim Leubner SA_DBG1(("mpiSATACompletion: OSSA_IO_XFR_ERROR_DEK_RAM_INTERFACE_ERROR tag 0x%X\n", tag));
3315*4e1bc9a0SAchim Leubner saRoot->IoErrorCount.agOSSA_IO_XFR_ERROR_DEK_RAM_INTERFACE_ERROR++;
3316*4e1bc9a0SAchim Leubner siAbnormal(agRoot, pRequest, status, 0, 0);
3317*4e1bc9a0SAchim Leubner break;
3318*4e1bc9a0SAchim Leubner }
3319*4e1bc9a0SAchim Leubner case OSSA_IO_OPEN_CNX_ERROR_OPEN_PREEMPTED:
3320*4e1bc9a0SAchim Leubner {
3321*4e1bc9a0SAchim Leubner SA_DBG1(("mpiSATACompletion: OSSA_IO_OPEN_CNX_ERROR_OPEN_PREEMPTED tag 0x%X\n", tag));
3322*4e1bc9a0SAchim Leubner saRoot->IoErrorCount.agOSSA_IO_OPEN_CNX_ERROR_OPEN_PREEMPTED++;
3323*4e1bc9a0SAchim Leubner siAbnormal(agRoot, pRequest, status, 0, 0);
3324*4e1bc9a0SAchim Leubner break;
3325*4e1bc9a0SAchim Leubner }
3326*4e1bc9a0SAchim Leubner
3327*4e1bc9a0SAchim Leubner case OSSA_IO_XFR_ERROR_DEK_KEY_TAG_MISMATCH:
3328*4e1bc9a0SAchim Leubner {
3329*4e1bc9a0SAchim Leubner SA_DBG1(("mpiSATACompletion: OSSA_IO_XFR_ERROR_DEK_KEY_TAG_MISMATCH tag 0x%X\n", tag));
3330*4e1bc9a0SAchim Leubner saRoot->IoErrorCount.agOSSA_IO_XFR_ERROR_DEK_KEY_TAG_MISMATCH++;
3331*4e1bc9a0SAchim Leubner siAbnormal(agRoot, pRequest, status, 0, 0);
3332*4e1bc9a0SAchim Leubner break;
3333*4e1bc9a0SAchim Leubner }
3334*4e1bc9a0SAchim Leubner case OSSA_IO_XFR_ERROR_DEK_INDEX_OUT_OF_BOUNDS:
3335*4e1bc9a0SAchim Leubner {
3336*4e1bc9a0SAchim Leubner SA_DBG1(("mpiSATACompletion: OSSA_IO_XFR_ERROR_DEK_INDEX_OUT_OF_BOUNDS tag 0x%X\n", tag));
3337*4e1bc9a0SAchim Leubner saRoot->IoErrorCount.agOSSA_IO_XFR_ERROR_DEK_INDEX_OUT_OF_BOUNDS++;
3338*4e1bc9a0SAchim Leubner siAbnormal(agRoot, pRequest, status, 0, 0);
3339*4e1bc9a0SAchim Leubner break;
3340*4e1bc9a0SAchim Leubner }
3341*4e1bc9a0SAchim Leubner case OSSA_IO_XFR_ERROR_DEK_ILLEGAL_TABLE:
3342*4e1bc9a0SAchim Leubner {
3343*4e1bc9a0SAchim Leubner SA_DBG1(("mpiSATACompletion: OSSA_IO_XFR_ERROR_DEK_ILLEGAL_TABLE tag 0x%X\n", tag));
3344*4e1bc9a0SAchim Leubner saRoot->IoErrorCount.agOSSA_IO_XFR_ERROR_DEK_INDEX_OUT_OF_BOUNDS++;
3345*4e1bc9a0SAchim Leubner siAbnormal(agRoot, pRequest, status, 0, 0);
3346*4e1bc9a0SAchim Leubner break;
3347*4e1bc9a0SAchim Leubner }
3348*4e1bc9a0SAchim Leubner
3349*4e1bc9a0SAchim Leubner default:
3350*4e1bc9a0SAchim Leubner {
3351*4e1bc9a0SAchim Leubner SA_DBG1(("mpiSATACompletion: Unknown status 0x%x tag 0x%x\n", status, tag));
3352*4e1bc9a0SAchim Leubner saRoot->IoErrorCount.agOSSA_IO_UNKNOWN_ERROR++;
3353*4e1bc9a0SAchim Leubner siAbnormal(agRoot, pRequest, status, param, 0);
3354*4e1bc9a0SAchim Leubner break;
3355*4e1bc9a0SAchim Leubner }
3356*4e1bc9a0SAchim Leubner }
3357*4e1bc9a0SAchim Leubner
3358*4e1bc9a0SAchim Leubner /* The HTag should equal to the IOMB tag */
3359*4e1bc9a0SAchim Leubner if (pRequest->HTag != tag)
3360*4e1bc9a0SAchim Leubner {
3361*4e1bc9a0SAchim Leubner SA_DBG1(("mpiSATACompletion: Error Htag %d not equal IOMBtag %d\n", pRequest->HTag, tag));
3362*4e1bc9a0SAchim Leubner }
3363*4e1bc9a0SAchim Leubner
3364*4e1bc9a0SAchim Leubner smTraceFuncExit(hpDBG_VERY_LOUD, 'b', "2s");
3365*4e1bc9a0SAchim Leubner return ret;
3366*4e1bc9a0SAchim Leubner }
3367*4e1bc9a0SAchim Leubner
3368*4e1bc9a0SAchim Leubner /******************************************************************************/
3369*4e1bc9a0SAchim Leubner /*! \brief SPC MPI SSP Completion
3370*4e1bc9a0SAchim Leubner *
3371*4e1bc9a0SAchim Leubner * This function handles the SSP completion.
3372*4e1bc9a0SAchim Leubner *
3373*4e1bc9a0SAchim Leubner * \param agRoot Handles for this instance of SAS/SATA LLL
3374*4e1bc9a0SAchim Leubner * \param pIomb1 Pointer of Message1
3375*4e1bc9a0SAchim Leubner * \param bc buffer count
3376*4e1bc9a0SAchim Leubner *
3377*4e1bc9a0SAchim Leubner * \return The read value
3378*4e1bc9a0SAchim Leubner *
3379*4e1bc9a0SAchim Leubner */
3380*4e1bc9a0SAchim Leubner /*******************************************************************************/
3381*4e1bc9a0SAchim Leubner GLOBAL FORCEINLINE
mpiSSPCompletion(agsaRoot_t * agRoot,bit32 * pIomb1)3382*4e1bc9a0SAchim Leubner bit32 mpiSSPCompletion(
3383*4e1bc9a0SAchim Leubner agsaRoot_t *agRoot,
3384*4e1bc9a0SAchim Leubner bit32 *pIomb1
3385*4e1bc9a0SAchim Leubner )
3386*4e1bc9a0SAchim Leubner {
3387*4e1bc9a0SAchim Leubner agsaLLRoot_t *saRoot = (agsaLLRoot_t *)(agRoot->sdkData);
3388*4e1bc9a0SAchim Leubner agsaSSPCompletionRsp_t *pIomb = (agsaSSPCompletionRsp_t *)pIomb1;
3389*4e1bc9a0SAchim Leubner agsaIORequestDesc_t *pRequest = agNULL;
3390*4e1bc9a0SAchim Leubner agsaSSPResponseInfoUnit_t *pRespIU = agNULL;
3391*4e1bc9a0SAchim Leubner bit32 tag = 0;
3392*4e1bc9a0SAchim Leubner bit32 sspTag = 0;
3393*4e1bc9a0SAchim Leubner bit32 status, param = 0;
3394*4e1bc9a0SAchim Leubner bit32 ret = AGSA_RC_SUCCESS;
3395*4e1bc9a0SAchim Leubner
3396*4e1bc9a0SAchim Leubner smTraceFuncEnter(hpDBG_VERY_LOUD, "5A");
3397*4e1bc9a0SAchim Leubner
3398*4e1bc9a0SAchim Leubner /* get Tag */
3399*4e1bc9a0SAchim Leubner OSSA_READ_LE_32(agRoot, &tag, pIomb, OSSA_OFFSET_OF(agsaSSPCompletionRsp_t, tag));
3400*4e1bc9a0SAchim Leubner OSSA_READ_LE_32(agRoot, &status, pIomb, OSSA_OFFSET_OF(agsaSSPCompletionRsp_t, status));
3401*4e1bc9a0SAchim Leubner OSSA_READ_LE_32(agRoot, ¶m, pIomb, OSSA_OFFSET_OF(agsaSSPCompletionRsp_t, param));
3402*4e1bc9a0SAchim Leubner OSSA_READ_LE_32(agRoot, &sspTag, pIomb, OSSA_OFFSET_OF(agsaSSPCompletionRsp_t, SSPTag));
3403*4e1bc9a0SAchim Leubner /* get SSP_START IOrequest from IOMap */
3404*4e1bc9a0SAchim Leubner pRequest = (agsaIORequestDesc_t *)saRoot->IOMap[tag].IORequest;
3405*4e1bc9a0SAchim Leubner SA_ASSERT((pRequest), "pRequest");
3406*4e1bc9a0SAchim Leubner
3407*4e1bc9a0SAchim Leubner if(pRequest == agNULL)
3408*4e1bc9a0SAchim Leubner {
3409*4e1bc9a0SAchim Leubner 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));
3410*4e1bc9a0SAchim Leubner smTraceFuncExit(hpDBG_VERY_LOUD, 'a', "5A");
3411*4e1bc9a0SAchim Leubner return(AGSA_RC_FAILURE);
3412*4e1bc9a0SAchim Leubner }
3413*4e1bc9a0SAchim Leubner SA_ASSERT((pRequest->valid), "pRequest->valid");
3414*4e1bc9a0SAchim Leubner
3415*4e1bc9a0SAchim Leubner if(!pRequest->valid)
3416*4e1bc9a0SAchim Leubner {
3417*4e1bc9a0SAchim Leubner 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,
3418*4e1bc9a0SAchim Leubner pRequest->pDevice ? pRequest->pDevice->DeviceMapIndex : -1));
3419*4e1bc9a0SAchim Leubner }
3420*4e1bc9a0SAchim Leubner
3421*4e1bc9a0SAchim Leubner switch (status)
3422*4e1bc9a0SAchim Leubner {
3423*4e1bc9a0SAchim Leubner case OSSA_IO_SUCCESS:
3424*4e1bc9a0SAchim Leubner {
3425*4e1bc9a0SAchim Leubner if (!param)
3426*4e1bc9a0SAchim Leubner {
3427*4e1bc9a0SAchim Leubner /* Completion of SSP without Response Data */
3428*4e1bc9a0SAchim Leubner siIODone( agRoot, pRequest, OSSA_IO_SUCCESS, sspTag);
3429*4e1bc9a0SAchim Leubner }
3430*4e1bc9a0SAchim Leubner else
3431*4e1bc9a0SAchim Leubner {
3432*4e1bc9a0SAchim Leubner /* Get SSP Response with Response Data */
3433*4e1bc9a0SAchim Leubner pRespIU = (agsaSSPResponseInfoUnit_t *)&(pIomb->SSPrsp);
3434*4e1bc9a0SAchim Leubner if (pRespIU->status == 0x02 || pRespIU->status == 0x18 ||
3435*4e1bc9a0SAchim Leubner pRespIU->status == 0x30 || pRespIU->status == 0x40 )
3436*4e1bc9a0SAchim Leubner {
3437*4e1bc9a0SAchim Leubner /* SCSI status is CHECK_CONDITION, RESV_CONFLICT, ACA_ACTIVE, TASK_ABORTED */
3438*4e1bc9a0SAchim Leubner saRoot->IoErrorCount.agOSSA_IO_COMPLETED_ERROR_SCSI_STATUS++;
3439*4e1bc9a0SAchim Leubner SA_DBG2(("mpiSSPCompletion: pRespIU->status 0x%x tag 0x%x\n", pRespIU->status,tag));
3440*4e1bc9a0SAchim Leubner }
3441*4e1bc9a0SAchim Leubner siEventSSPResponseWtDataRcvd(agRoot, pRequest, pRespIU, param, sspTag);
3442*4e1bc9a0SAchim Leubner }
3443*4e1bc9a0SAchim Leubner
3444*4e1bc9a0SAchim Leubner break;
3445*4e1bc9a0SAchim Leubner }
3446*4e1bc9a0SAchim Leubner
3447*4e1bc9a0SAchim Leubner case OSSA_IO_XFR_ERROR_INVALID_SSP_RSP_FRAME:
3448*4e1bc9a0SAchim Leubner {
3449*4e1bc9a0SAchim Leubner 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));
3450*4e1bc9a0SAchim Leubner saRoot->IoErrorCount.agOSSA_IO_XFR_ERROR_INVALID_SSP_RSP_FRAME++;
3451*4e1bc9a0SAchim Leubner /* Get SSP Response with Response Data */
3452*4e1bc9a0SAchim Leubner pRespIU = (agsaSSPResponseInfoUnit_t *)&(pIomb->SSPrsp);
3453*4e1bc9a0SAchim Leubner if (pRespIU->status == 0x02 || pRespIU->status == 0x18 ||
3454*4e1bc9a0SAchim Leubner pRespIU->status == 0x30 || pRespIU->status == 0x40 )
3455*4e1bc9a0SAchim Leubner {
3456*4e1bc9a0SAchim Leubner /* SCSI status is CHECK_CONDITION, RESV_CONFLICT, ACA_ACTIVE, TASK_ABORTED */
3457*4e1bc9a0SAchim Leubner saRoot->IoErrorCount.agOSSA_IO_COMPLETED_ERROR_SCSI_STATUS++;
3458*4e1bc9a0SAchim Leubner SA_DBG2(("mpiSSPCompletion: pRespIU->status 0x%x tag 0x%x\n", pRespIU->status,tag));
3459*4e1bc9a0SAchim Leubner }
3460*4e1bc9a0SAchim Leubner siEventSSPResponseWtDataRcvd(agRoot, pRequest, pRespIU, param, sspTag);
3461*4e1bc9a0SAchim Leubner
3462*4e1bc9a0SAchim Leubner break;
3463*4e1bc9a0SAchim Leubner }
3464*4e1bc9a0SAchim Leubner
3465*4e1bc9a0SAchim Leubner case OSSA_IO_ABORTED:
3466*4e1bc9a0SAchim Leubner {
3467*4e1bc9a0SAchim Leubner #ifdef SALL_API_TEST
3468*4e1bc9a0SAchim Leubner saRoot->LLCounters.IOCounter.numSSPAborted++;
3469*4e1bc9a0SAchim Leubner SA_DBG3(("mpiSSPCompletion, OSSA_IO_ABORTED Response received IOMB=%p %d\n",
3470*4e1bc9a0SAchim Leubner pIomb1, saRoot->LLCounters.IOCounter.numSSPAborted));
3471*4e1bc9a0SAchim Leubner #endif
3472*4e1bc9a0SAchim Leubner SA_DBG2(("mpiSSPCompletion, OSSA_IO_ABORTED IOMB tag 0x%x sspTag 0x%x status 0x%x param 0x%x\n", tag,sspTag,status,param));
3473*4e1bc9a0SAchim Leubner saRoot->IoErrorCount.agOSSA_IO_ABORTED++;
3474*4e1bc9a0SAchim Leubner /* SSP Abort CB */
3475*4e1bc9a0SAchim Leubner siAbnormal(agRoot, pRequest, status, param, sspTag);
3476*4e1bc9a0SAchim Leubner break;
3477*4e1bc9a0SAchim Leubner }
3478*4e1bc9a0SAchim Leubner case OSSA_IO_UNDERFLOW:
3479*4e1bc9a0SAchim Leubner {
3480*4e1bc9a0SAchim Leubner /* SSP Completion with error */
3481*4e1bc9a0SAchim Leubner SA_DBG2(("mpiSSPCompletion, OSSA_IO_UNDERFLOW tag 0x%x sspTag 0x%x status 0x%x param 0x%x\n", tag,sspTag,status,param));
3482*4e1bc9a0SAchim Leubner /*saRoot->IoErrorCount.agOSSA_IO_UNDERFLOW++;*/
3483*4e1bc9a0SAchim Leubner siAbnormal(agRoot, pRequest, status, param, sspTag);
3484*4e1bc9a0SAchim Leubner break;
3485*4e1bc9a0SAchim Leubner }
3486*4e1bc9a0SAchim Leubner case OSSA_IO_NO_DEVICE:
3487*4e1bc9a0SAchim Leubner {
3488*4e1bc9a0SAchim Leubner SA_DBG1(("mpiSSPCompletion: OSSA_IO_NO_DEVICE tag 0x%x sspTag 0x%x status 0x%x param 0x%x\n", tag,sspTag,status,param));
3489*4e1bc9a0SAchim Leubner saRoot->IoErrorCount.agOSSA_IO_NO_DEVICE++;
3490*4e1bc9a0SAchim Leubner siAbnormal(agRoot, pRequest, status, 0, sspTag);
3491*4e1bc9a0SAchim Leubner break;
3492*4e1bc9a0SAchim Leubner }
3493*4e1bc9a0SAchim Leubner case OSSA_IO_XFER_ERROR_BREAK:
3494*4e1bc9a0SAchim Leubner {
3495*4e1bc9a0SAchim Leubner 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));
3496*4e1bc9a0SAchim Leubner saRoot->IoErrorCount.agOSSA_IO_XFER_ERROR_BREAK++;
3497*4e1bc9a0SAchim Leubner siAbnormal(agRoot, pRequest, status, 0, sspTag);
3498*4e1bc9a0SAchim Leubner break;
3499*4e1bc9a0SAchim Leubner }
3500*4e1bc9a0SAchim Leubner case OSSA_IO_XFER_ERROR_PHY_NOT_READY:
3501*4e1bc9a0SAchim Leubner {
3502*4e1bc9a0SAchim Leubner 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));
3503*4e1bc9a0SAchim Leubner saRoot->IoErrorCount.agOSSA_IO_XFER_ERROR_PHY_NOT_READY++;
3504*4e1bc9a0SAchim Leubner siAbnormal(agRoot, pRequest, status, 0, sspTag);
3505*4e1bc9a0SAchim Leubner break;
3506*4e1bc9a0SAchim Leubner }
3507*4e1bc9a0SAchim Leubner case OSSA_IO_OPEN_CNX_ERROR_PROTOCOL_NOT_SUPPORTED:
3508*4e1bc9a0SAchim Leubner {
3509*4e1bc9a0SAchim Leubner 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));
3510*4e1bc9a0SAchim Leubner saRoot->IoErrorCount.agOSSA_IO_OPEN_CNX_ERROR_PROTOCOL_NOT_SUPPORTED++;
3511*4e1bc9a0SAchim Leubner siAbnormal(agRoot, pRequest, status, 0, sspTag);
3512*4e1bc9a0SAchim Leubner break;
3513*4e1bc9a0SAchim Leubner }
3514*4e1bc9a0SAchim Leubner case OSSA_IO_OPEN_CNX_ERROR_ZONE_VIOLATION:
3515*4e1bc9a0SAchim Leubner {
3516*4e1bc9a0SAchim Leubner saRoot->IoErrorCount.agOSSA_IO_OPEN_CNX_ERROR_ZONE_VIOLATION++;
3517*4e1bc9a0SAchim Leubner siAbnormal(agRoot, pRequest, status, 0, sspTag);
3518*4e1bc9a0SAchim Leubner 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));
3519*4e1bc9a0SAchim Leubner break;
3520*4e1bc9a0SAchim Leubner }
3521*4e1bc9a0SAchim Leubner case OSSA_IO_OPEN_CNX_ERROR_BREAK:
3522*4e1bc9a0SAchim Leubner {
3523*4e1bc9a0SAchim Leubner 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));
3524*4e1bc9a0SAchim Leubner saRoot->IoErrorCount.agOSSA_IO_OPEN_CNX_ERROR_BREAK++;
3525*4e1bc9a0SAchim Leubner siAbnormal(agRoot, pRequest, status, 0, sspTag);
3526*4e1bc9a0SAchim Leubner break;
3527*4e1bc9a0SAchim Leubner }
3528*4e1bc9a0SAchim Leubner case OSSA_IO_OPEN_CNX_ERROR_IT_NEXUS_LOSS:
3529*4e1bc9a0SAchim Leubner {
3530*4e1bc9a0SAchim Leubner 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));
3531*4e1bc9a0SAchim Leubner saRoot->IoErrorCount.agOSSA_IO_OPEN_CNX_ERROR_IT_NEXUS_LOSS++;
3532*4e1bc9a0SAchim Leubner siAbnormal(agRoot, pRequest, status, 0, sspTag);
3533*4e1bc9a0SAchim Leubner break;
3534*4e1bc9a0SAchim Leubner }
3535*4e1bc9a0SAchim Leubner case OSSA_IO_OPEN_CNX_ERROR_BAD_DESTINATION:
3536*4e1bc9a0SAchim Leubner {
3537*4e1bc9a0SAchim Leubner 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));
3538*4e1bc9a0SAchim Leubner saRoot->IoErrorCount.agOSSA_IO_OPEN_CNX_ERROR_BAD_DESTINATION++;
3539*4e1bc9a0SAchim Leubner siAbnormal(agRoot, pRequest, status, 0, sspTag);
3540*4e1bc9a0SAchim Leubner break;
3541*4e1bc9a0SAchim Leubner }
3542*4e1bc9a0SAchim Leubner case OSSA_IO_OPEN_CNX_ERROR_CONNECTION_RATE_NOT_SUPPORTED:
3543*4e1bc9a0SAchim Leubner {
3544*4e1bc9a0SAchim Leubner 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));
3545*4e1bc9a0SAchim Leubner saRoot->IoErrorCount.agOSSA_IO_OPEN_CNX_ERROR_CONNECTION_RATE_NOT_SUPPORTED++;
3546*4e1bc9a0SAchim Leubner siAbnormal(agRoot, pRequest, status, 0, sspTag);
3547*4e1bc9a0SAchim Leubner break;
3548*4e1bc9a0SAchim Leubner }
3549*4e1bc9a0SAchim Leubner case OSSA_IO_OPEN_CNX_ERROR_WRONG_DESTINATION:
3550*4e1bc9a0SAchim Leubner {
3551*4e1bc9a0SAchim Leubner 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));
3552*4e1bc9a0SAchim Leubner saRoot->IoErrorCount.agOSSA_IO_OPEN_CNX_ERROR_WRONG_DESTINATION++;
3553*4e1bc9a0SAchim Leubner siAbnormal(agRoot, pRequest, status, 0, sspTag);
3554*4e1bc9a0SAchim Leubner break;
3555*4e1bc9a0SAchim Leubner }
3556*4e1bc9a0SAchim Leubner case OSSA_IO_XFER_ERROR_NAK_RECEIVED:
3557*4e1bc9a0SAchim Leubner {
3558*4e1bc9a0SAchim Leubner 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));
3559*4e1bc9a0SAchim Leubner saRoot->IoErrorCount.agOSSA_IO_XFER_ERROR_NAK_RECEIVED++;
3560*4e1bc9a0SAchim Leubner siAbnormal(agRoot, pRequest, status, 0, sspTag);
3561*4e1bc9a0SAchim Leubner break;
3562*4e1bc9a0SAchim Leubner }
3563*4e1bc9a0SAchim Leubner case OSSA_IO_XFER_ERROR_ACK_NAK_TIMEOUT:
3564*4e1bc9a0SAchim Leubner {
3565*4e1bc9a0SAchim Leubner 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));
3566*4e1bc9a0SAchim Leubner saRoot->IoErrorCount.agOSSA_IO_XFER_ERROR_ACK_NAK_TIMEOUT++;
3567*4e1bc9a0SAchim Leubner siAbnormal(agRoot, pRequest, status, 0, sspTag);
3568*4e1bc9a0SAchim Leubner break;
3569*4e1bc9a0SAchim Leubner }
3570*4e1bc9a0SAchim Leubner case OSSA_IO_XFER_ERROR_DMA:
3571*4e1bc9a0SAchim Leubner {
3572*4e1bc9a0SAchim Leubner 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));
3573*4e1bc9a0SAchim Leubner saRoot->IoErrorCount.agOSSA_IO_XFER_ERROR_DMA++;
3574*4e1bc9a0SAchim Leubner siAbnormal(agRoot, pRequest, status, 0, sspTag);
3575*4e1bc9a0SAchim Leubner break;
3576*4e1bc9a0SAchim Leubner }
3577*4e1bc9a0SAchim Leubner case OSSA_IO_XFER_OPEN_RETRY_TIMEOUT:
3578*4e1bc9a0SAchim Leubner {
3579*4e1bc9a0SAchim Leubner 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));
3580*4e1bc9a0SAchim Leubner saRoot->IoErrorCount.agOSSA_IO_XFER_OPEN_RETRY_TIMEOUT++;
3581*4e1bc9a0SAchim Leubner siAbnormal(agRoot, pRequest, status, 0, sspTag);
3582*4e1bc9a0SAchim Leubner break;
3583*4e1bc9a0SAchim Leubner }
3584*4e1bc9a0SAchim Leubner case OSSA_IO_XFER_ERROR_UNEXPECTED_PHASE:
3585*4e1bc9a0SAchim Leubner {
3586*4e1bc9a0SAchim Leubner 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));
3587*4e1bc9a0SAchim Leubner saRoot->IoErrorCount.agOSSA_IO_XFER_ERROR_UNEXPECTED_PHASE++;
3588*4e1bc9a0SAchim Leubner siAbnormal(agRoot, pRequest, status, 0, sspTag);
3589*4e1bc9a0SAchim Leubner break;
3590*4e1bc9a0SAchim Leubner }
3591*4e1bc9a0SAchim Leubner case OSSA_IO_XFER_ERROR_OFFSET_MISMATCH:
3592*4e1bc9a0SAchim Leubner {
3593*4e1bc9a0SAchim Leubner 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));
3594*4e1bc9a0SAchim Leubner saRoot->IoErrorCount.agOSSA_IO_XFER_ERROR_OFFSET_MISMATCH++;
3595*4e1bc9a0SAchim Leubner siAbnormal(agRoot, pRequest, status, 0, sspTag);
3596*4e1bc9a0SAchim Leubner break;
3597*4e1bc9a0SAchim Leubner }
3598*4e1bc9a0SAchim Leubner case OSSA_IO_PORT_IN_RESET:
3599*4e1bc9a0SAchim Leubner {
3600*4e1bc9a0SAchim Leubner 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));
3601*4e1bc9a0SAchim Leubner saRoot->IoErrorCount.agOSSA_IO_PORT_IN_RESET++;
3602*4e1bc9a0SAchim Leubner siAbnormal(agRoot, pRequest, status, 0, sspTag);
3603*4e1bc9a0SAchim Leubner break;
3604*4e1bc9a0SAchim Leubner }
3605*4e1bc9a0SAchim Leubner case OSSA_IO_DS_NON_OPERATIONAL:
3606*4e1bc9a0SAchim Leubner {
3607*4e1bc9a0SAchim Leubner 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));
3608*4e1bc9a0SAchim Leubner saRoot->IoErrorCount.agOSSA_IO_DS_NON_OPERATIONAL++;
3609*4e1bc9a0SAchim Leubner siAbnormal(agRoot, pRequest, status, 0, sspTag);
3610*4e1bc9a0SAchim Leubner break;
3611*4e1bc9a0SAchim Leubner }
3612*4e1bc9a0SAchim Leubner case OSSA_IO_DS_IN_RECOVERY:
3613*4e1bc9a0SAchim Leubner {
3614*4e1bc9a0SAchim Leubner 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));
3615*4e1bc9a0SAchim Leubner saRoot->IoErrorCount.agOSSA_IO_DS_IN_RECOVERY++;
3616*4e1bc9a0SAchim Leubner siAbnormal(agRoot, pRequest, status, 0, sspTag);
3617*4e1bc9a0SAchim Leubner break;
3618*4e1bc9a0SAchim Leubner }
3619*4e1bc9a0SAchim Leubner case OSSA_IO_TM_TAG_NOT_FOUND:
3620*4e1bc9a0SAchim Leubner {
3621*4e1bc9a0SAchim Leubner 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));
3622*4e1bc9a0SAchim Leubner saRoot->IoErrorCount.agOSSA_IO_TM_TAG_NOT_FOUND++;
3623*4e1bc9a0SAchim Leubner siAbnormal(agRoot, pRequest, status, 0, sspTag);
3624*4e1bc9a0SAchim Leubner break;
3625*4e1bc9a0SAchim Leubner }
3626*4e1bc9a0SAchim Leubner case OSSA_IO_XFER_PIO_SETUP_ERROR:
3627*4e1bc9a0SAchim Leubner {
3628*4e1bc9a0SAchim Leubner 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));
3629*4e1bc9a0SAchim Leubner saRoot->IoErrorCount.agOSSA_IO_XFER_PIO_SETUP_ERROR++;
3630*4e1bc9a0SAchim Leubner /* not allowed case. Therefore, return failed status */
3631*4e1bc9a0SAchim Leubner siAbnormal(agRoot, pRequest, OSSA_IO_FAILED, param, sspTag);
3632*4e1bc9a0SAchim Leubner break;
3633*4e1bc9a0SAchim Leubner }
3634*4e1bc9a0SAchim Leubner case OSSA_IO_SSP_EXT_IU_ZERO_LEN_ERROR:
3635*4e1bc9a0SAchim Leubner {
3636*4e1bc9a0SAchim Leubner 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));
3637*4e1bc9a0SAchim Leubner saRoot->IoErrorCount.agOSSA_IO_SSP_EXT_IU_ZERO_LEN_ERROR++;
3638*4e1bc9a0SAchim Leubner siAbnormal(agRoot, pRequest, status, 0, sspTag);
3639*4e1bc9a0SAchim Leubner break;
3640*4e1bc9a0SAchim Leubner }
3641*4e1bc9a0SAchim Leubner case OSSA_IO_DS_IN_ERROR:
3642*4e1bc9a0SAchim Leubner {
3643*4e1bc9a0SAchim Leubner 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));
3644*4e1bc9a0SAchim Leubner saRoot->IoErrorCount.agOSSA_IO_DS_IN_ERROR++;
3645*4e1bc9a0SAchim Leubner /* not allowed case. Therefore, return failed status */
3646*4e1bc9a0SAchim Leubner siAbnormal(agRoot, pRequest, OSSA_IO_FAILED, param, sspTag);
3647*4e1bc9a0SAchim Leubner break;
3648*4e1bc9a0SAchim Leubner }
3649*4e1bc9a0SAchim Leubner case OSSA_IO_OPEN_CNX_ERROR_HW_RESOURCE_BUSY:
3650*4e1bc9a0SAchim Leubner {
3651*4e1bc9a0SAchim Leubner 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));
3652*4e1bc9a0SAchim Leubner saRoot->IoErrorCount.agOSSA_IO_OPEN_CNX_ERROR_HW_RESOURCE_BUSY++;
3653*4e1bc9a0SAchim Leubner /* not allowed case. Therefore, return failed status */
3654*4e1bc9a0SAchim Leubner siAbnormal(agRoot, pRequest, OSSA_IO_FAILED, param, sspTag);
3655*4e1bc9a0SAchim Leubner break;
3656*4e1bc9a0SAchim Leubner }
3657*4e1bc9a0SAchim Leubner case OSSA_IO_ABORT_IN_PROGRESS:
3658*4e1bc9a0SAchim Leubner {
3659*4e1bc9a0SAchim Leubner 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));
3660*4e1bc9a0SAchim Leubner saRoot->IoErrorCount.agOSSA_IO_ABORT_IN_PROGRESS++;
3661*4e1bc9a0SAchim Leubner /* not allowed case. Therefore, return failed status */
3662*4e1bc9a0SAchim Leubner siAbnormal(agRoot, pRequest, OSSA_IO_FAILED, param, sspTag);
3663*4e1bc9a0SAchim Leubner break;
3664*4e1bc9a0SAchim Leubner }
3665*4e1bc9a0SAchim Leubner case OSSA_IO_ABORT_DELAYED:
3666*4e1bc9a0SAchim Leubner {
3667*4e1bc9a0SAchim Leubner SA_DBG1(("mpiSSPCompletion: OSSA_IO_ABORT_DELAYED tag 0x%x sspTag 0x%x status 0x%x param 0x%x\n", tag,sspTag,status,param));
3668*4e1bc9a0SAchim Leubner saRoot->IoErrorCount.agOSSA_IO_ABORT_DELAYED++;
3669*4e1bc9a0SAchim Leubner /* not allowed case. Therefore, return failed status */
3670*4e1bc9a0SAchim Leubner siAbnormal(agRoot, pRequest, OSSA_IO_FAILED, param, sspTag);
3671*4e1bc9a0SAchim Leubner break;
3672*4e1bc9a0SAchim Leubner }
3673*4e1bc9a0SAchim Leubner case OSSA_IO_INVALID_LENGTH:
3674*4e1bc9a0SAchim Leubner {
3675*4e1bc9a0SAchim Leubner SA_DBG1(("mpiSSPCompletion: OSSA_IO_INVALID_LENGTH tag 0x%x sspTag 0x%x status 0x%x param 0x%x\n", tag,sspTag,status,param));
3676*4e1bc9a0SAchim Leubner saRoot->IoErrorCount.agOSSA_IO_INVALID_LENGTH++;
3677*4e1bc9a0SAchim Leubner /* not allowed case. Therefore, return failed status */
3678*4e1bc9a0SAchim Leubner siAbnormal(agRoot, pRequest, OSSA_IO_FAILED, param, sspTag);
3679*4e1bc9a0SAchim Leubner break;
3680*4e1bc9a0SAchim Leubner }
3681*4e1bc9a0SAchim Leubner case OSSA_IO_OPEN_CNX_ERROR_HW_RESOURCE_BUSY_ALT:
3682*4e1bc9a0SAchim Leubner {
3683*4e1bc9a0SAchim Leubner 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));
3684*4e1bc9a0SAchim Leubner saRoot->IoErrorCount.agOSSA_IO_OPEN_CNX_ERROR_HW_RESOURCE_BUSY_ALT++;
3685*4e1bc9a0SAchim Leubner /* not allowed case. Therefore, return failed status */
3686*4e1bc9a0SAchim Leubner siAbnormal(agRoot, pRequest, OSSA_IO_FAILED, param, sspTag);
3687*4e1bc9a0SAchim Leubner break;
3688*4e1bc9a0SAchim Leubner }
3689*4e1bc9a0SAchim Leubner case OSSA_IO_OPEN_CNX_ERROR_IT_NEXUS_LOSS_OPEN_RETRY_BACKOFF_THRESHOLD_REACHED:
3690*4e1bc9a0SAchim Leubner {
3691*4e1bc9a0SAchim Leubner 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));
3692*4e1bc9a0SAchim Leubner saRoot->IoErrorCount.agOSSA_IO_OPEN_CNX_ERROR_IT_NEXUS_LOSS_OPEN_RETRY_BACKOFF_THRESHOLD_REACHED++;
3693*4e1bc9a0SAchim Leubner siAbnormal(agRoot, pRequest, status, 0, sspTag);
3694*4e1bc9a0SAchim Leubner break;
3695*4e1bc9a0SAchim Leubner }
3696*4e1bc9a0SAchim Leubner case OSSA_IO_OPEN_CNX_ERROR_IT_NEXUS_LOSS_OPEN_TMO:
3697*4e1bc9a0SAchim Leubner {
3698*4e1bc9a0SAchim Leubner 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));
3699*4e1bc9a0SAchim Leubner saRoot->IoErrorCount.agOSSA_IO_OPEN_CNX_ERROR_IT_NEXUS_LOSS_OPEN_TMO++;
3700*4e1bc9a0SAchim Leubner siAbnormal(agRoot, pRequest, status, param, sspTag);
3701*4e1bc9a0SAchim Leubner break;
3702*4e1bc9a0SAchim Leubner }
3703*4e1bc9a0SAchim Leubner case OSSA_IO_OPEN_CNX_ERROR_IT_NEXUS_LOSS_NO_DEST:
3704*4e1bc9a0SAchim Leubner {
3705*4e1bc9a0SAchim Leubner 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));
3706*4e1bc9a0SAchim Leubner saRoot->IoErrorCount.agOSSA_IO_OPEN_CNX_ERROR_IT_NEXUS_LOSS_NO_DEST++;
3707*4e1bc9a0SAchim Leubner siAbnormal(agRoot, pRequest, status, param, sspTag);
3708*4e1bc9a0SAchim Leubner break;
3709*4e1bc9a0SAchim Leubner }
3710*4e1bc9a0SAchim Leubner case OSSA_IO_OPEN_CNX_ERROR_IT_NEXUS_LOSS_OPEN_COLLIDE:
3711*4e1bc9a0SAchim Leubner {
3712*4e1bc9a0SAchim Leubner 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));
3713*4e1bc9a0SAchim Leubner saRoot->IoErrorCount.agOSSA_IO_OPEN_CNX_ERROR_IT_NEXUS_LOSS_OPEN_COLLIDE++;
3714*4e1bc9a0SAchim Leubner siAbnormal(agRoot, pRequest, status, param, sspTag);
3715*4e1bc9a0SAchim Leubner break;
3716*4e1bc9a0SAchim Leubner }
3717*4e1bc9a0SAchim Leubner case OSSA_IO_OPEN_CNX_ERROR_IT_NEXUS_LOSS_PATHWAY_BLOCKED:
3718*4e1bc9a0SAchim Leubner {
3719*4e1bc9a0SAchim Leubner 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));
3720*4e1bc9a0SAchim Leubner saRoot->IoErrorCount.agOSSA_IO_OPEN_CNX_ERROR_IT_NEXUS_LOSS_PATHWAY_BLOCKED++;
3721*4e1bc9a0SAchim Leubner siAbnormal(agRoot, pRequest, status, param, sspTag);
3722*4e1bc9a0SAchim Leubner break;
3723*4e1bc9a0SAchim Leubner }
3724*4e1bc9a0SAchim Leubner case OSSA_IO_DS_INVALID:
3725*4e1bc9a0SAchim Leubner {
3726*4e1bc9a0SAchim Leubner SA_DBG1(("mpiSSPCompletion: OSSA_IO_DS_INVALID tag 0x%x sspTag 0x%x status 0x%x param 0x%x\n", tag,sspTag,status,param));
3727*4e1bc9a0SAchim Leubner saRoot->IoErrorCount.agOSSA_IO_DS_INVALID++;
3728*4e1bc9a0SAchim Leubner siAbnormal(agRoot, pRequest, status, param, sspTag);
3729*4e1bc9a0SAchim Leubner break;
3730*4e1bc9a0SAchim Leubner }
3731*4e1bc9a0SAchim Leubner case OSSA_MPI_IO_RQE_BUSY_FULL:
3732*4e1bc9a0SAchim Leubner {
3733*4e1bc9a0SAchim Leubner 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));
3734*4e1bc9a0SAchim Leubner saRoot->IoErrorCount.agOSSA_MPI_IO_RQE_BUSY_FULL++;
3735*4e1bc9a0SAchim Leubner siAbnormal(agRoot, pRequest, status, param, sspTag);
3736*4e1bc9a0SAchim Leubner break;
3737*4e1bc9a0SAchim Leubner }
3738*4e1bc9a0SAchim Leubner case OSSA_MPI_ERR_IO_RESOURCE_UNAVAILABLE:
3739*4e1bc9a0SAchim Leubner {
3740*4e1bc9a0SAchim Leubner 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));
3741*4e1bc9a0SAchim Leubner saRoot->IoErrorCount.agOSSA_MPI_ERR_IO_RESOURCE_UNAVAILABLE++;
3742*4e1bc9a0SAchim Leubner siAbnormal(agRoot, pRequest, status, param, sspTag);
3743*4e1bc9a0SAchim Leubner break;
3744*4e1bc9a0SAchim Leubner }
3745*4e1bc9a0SAchim Leubner case OSSA_IO_XFR_ERROR_DEK_KEY_CACHE_MISS:
3746*4e1bc9a0SAchim Leubner {
3747*4e1bc9a0SAchim Leubner 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));
3748*4e1bc9a0SAchim Leubner saRoot->IoErrorCount.agOSSA_IO_XFR_ERROR_DEK_KEY_CACHE_MISS++;
3749*4e1bc9a0SAchim Leubner siAbnormal(agRoot, pRequest, status, param, sspTag);
3750*4e1bc9a0SAchim Leubner break;
3751*4e1bc9a0SAchim Leubner }
3752*4e1bc9a0SAchim Leubner case OSSA_IO_XFR_ERROR_DEK_KEY_TAG_MISMATCH:
3753*4e1bc9a0SAchim Leubner {
3754*4e1bc9a0SAchim Leubner 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));
3755*4e1bc9a0SAchim Leubner saRoot->IoErrorCount.agOSSA_IO_XFR_ERROR_DEK_KEY_TAG_MISMATCH++;
3756*4e1bc9a0SAchim Leubner siAbnormal(agRoot, pRequest, status, param, sspTag);
3757*4e1bc9a0SAchim Leubner break;
3758*4e1bc9a0SAchim Leubner }
3759*4e1bc9a0SAchim Leubner case OSSA_IO_XFR_ERROR_CIPHER_MODE_INVALID:
3760*4e1bc9a0SAchim Leubner {
3761*4e1bc9a0SAchim Leubner 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));
3762*4e1bc9a0SAchim Leubner saRoot->IoErrorCount.agOSSA_IO_XFR_ERROR_CIPHER_MODE_INVALID++;
3763*4e1bc9a0SAchim Leubner siAbnormal(agRoot, pRequest, status, param, sspTag);
3764*4e1bc9a0SAchim Leubner break;
3765*4e1bc9a0SAchim Leubner }
3766*4e1bc9a0SAchim Leubner case OSSA_IO_XFR_ERROR_DEK_IV_MISMATCH:
3767*4e1bc9a0SAchim Leubner {
3768*4e1bc9a0SAchim Leubner 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));
3769*4e1bc9a0SAchim Leubner saRoot->IoErrorCount.agOSSA_IO_XFR_ERROR_DEK_IV_MISMATCH++;
3770*4e1bc9a0SAchim Leubner siAbnormal(agRoot, pRequest, status, param, sspTag);
3771*4e1bc9a0SAchim Leubner break;
3772*4e1bc9a0SAchim Leubner }
3773*4e1bc9a0SAchim Leubner case OSSA_IO_XFR_ERROR_DEK_RAM_INTERFACE_ERROR:
3774*4e1bc9a0SAchim Leubner {
3775*4e1bc9a0SAchim Leubner 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));
3776*4e1bc9a0SAchim Leubner saRoot->IoErrorCount.agOSSA_IO_XFR_ERROR_DEK_RAM_INTERFACE_ERROR++;
3777*4e1bc9a0SAchim Leubner siAbnormal(agRoot, pRequest, status, param, sspTag);
3778*4e1bc9a0SAchim Leubner break;
3779*4e1bc9a0SAchim Leubner }
3780*4e1bc9a0SAchim Leubner case OSSA_IO_XFR_ERROR_INTERNAL_RAM:
3781*4e1bc9a0SAchim Leubner {
3782*4e1bc9a0SAchim Leubner 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));
3783*4e1bc9a0SAchim Leubner saRoot->IoErrorCount.agOSSA_IO_XFR_ERROR_INTERNAL_RAM++;
3784*4e1bc9a0SAchim Leubner siAbnormal(agRoot, pRequest, status, param, sspTag);
3785*4e1bc9a0SAchim Leubner break;
3786*4e1bc9a0SAchim Leubner }
3787*4e1bc9a0SAchim Leubner case OSSA_IO_XFR_ERROR_DEK_INDEX_OUT_OF_BOUNDS:
3788*4e1bc9a0SAchim Leubner {
3789*4e1bc9a0SAchim Leubner 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));
3790*4e1bc9a0SAchim Leubner saRoot->IoErrorCount.agOSSA_IO_XFR_ERROR_DEK_INDEX_OUT_OF_BOUNDS++;
3791*4e1bc9a0SAchim Leubner siAbnormal(agRoot, pRequest, status, param, sspTag);
3792*4e1bc9a0SAchim Leubner break;
3793*4e1bc9a0SAchim Leubner }
3794*4e1bc9a0SAchim Leubner case OSSA_IO_XFR_ERROR_DEK_ILLEGAL_TABLE:
3795*4e1bc9a0SAchim Leubner {
3796*4e1bc9a0SAchim Leubner 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));
3797*4e1bc9a0SAchim Leubner saRoot->IoErrorCount.agOSSA_IO_XFR_ERROR_DEK_ILLEGAL_TABLE++;
3798*4e1bc9a0SAchim Leubner siAbnormal(agRoot, pRequest, status, param, sspTag);
3799*4e1bc9a0SAchim Leubner break;
3800*4e1bc9a0SAchim Leubner }
3801*4e1bc9a0SAchim Leubner #ifdef SA_TESTBASE_EXTRA
3802*4e1bc9a0SAchim Leubner /* TestBase */
3803*4e1bc9a0SAchim Leubner case OSSA_IO_HOST_BST_INVALID:
3804*4e1bc9a0SAchim Leubner {
3805*4e1bc9a0SAchim Leubner SA_DBG1(("mpiParseOBIomb, OPC_OUB_SSP_COMP: OSSA_IO_HOST_BST_INVALID 0x%x\n", status));
3806*4e1bc9a0SAchim Leubner siAbnormal(agRoot, pRequest, status, param, sspTag);
3807*4e1bc9a0SAchim Leubner break;
3808*4e1bc9a0SAchim Leubner }
3809*4e1bc9a0SAchim Leubner #endif /* SA_TESTBASE_EXTRA */
3810*4e1bc9a0SAchim Leubner case OSSA_IO_XFR_ERROR_DIF_MISMATCH:
3811*4e1bc9a0SAchim Leubner {
3812*4e1bc9a0SAchim Leubner 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));
3813*4e1bc9a0SAchim Leubner saRoot->IoErrorCount.agOSSA_IO_XFR_ERROR_DIF_MISMATCH++;
3814*4e1bc9a0SAchim Leubner siDifAbnormal(agRoot, pRequest, status, param, sspTag, pIomb1);
3815*4e1bc9a0SAchim Leubner break;
3816*4e1bc9a0SAchim Leubner }
3817*4e1bc9a0SAchim Leubner case OSSA_IO_XFR_ERROR_DIF_APPLICATION_TAG_MISMATCH:
3818*4e1bc9a0SAchim Leubner {
3819*4e1bc9a0SAchim Leubner 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));
3820*4e1bc9a0SAchim Leubner saRoot->IoErrorCount.agOSSA_IO_XFR_ERROR_DIF_APPLICATION_TAG_MISMATCH++;
3821*4e1bc9a0SAchim Leubner siDifAbnormal(agRoot, pRequest, status, param, sspTag, pIomb1);
3822*4e1bc9a0SAchim Leubner break;
3823*4e1bc9a0SAchim Leubner }
3824*4e1bc9a0SAchim Leubner case OSSA_IO_XFR_ERROR_DIF_REFERENCE_TAG_MISMATCH:
3825*4e1bc9a0SAchim Leubner {
3826*4e1bc9a0SAchim Leubner 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));
3827*4e1bc9a0SAchim Leubner saRoot->IoErrorCount.agOSSA_IO_XFR_ERROR_DIF_REFERENCE_TAG_MISMATCH++;
3828*4e1bc9a0SAchim Leubner siDifAbnormal(agRoot, pRequest, status, param, sspTag, pIomb1);
3829*4e1bc9a0SAchim Leubner break;
3830*4e1bc9a0SAchim Leubner }
3831*4e1bc9a0SAchim Leubner case OSSA_IO_XFR_ERROR_DIF_CRC_MISMATCH:
3832*4e1bc9a0SAchim Leubner {
3833*4e1bc9a0SAchim Leubner 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));
3834*4e1bc9a0SAchim Leubner saRoot->IoErrorCount.agOSSA_IO_XFR_ERROR_DIF_CRC_MISMATCH++;
3835*4e1bc9a0SAchim Leubner siDifAbnormal(agRoot, pRequest, status, param, sspTag, pIomb1);
3836*4e1bc9a0SAchim Leubner break;
3837*4e1bc9a0SAchim Leubner }
3838*4e1bc9a0SAchim Leubner case OSSA_IO_XFER_ERROR_DIF_INTERNAL_ERROR:
3839*4e1bc9a0SAchim Leubner {
3840*4e1bc9a0SAchim Leubner 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));
3841*4e1bc9a0SAchim Leubner saRoot->IoErrorCount.agOSSA_IO_XFER_ERROR_DIF_INTERNAL_ERROR++;
3842*4e1bc9a0SAchim Leubner siDifAbnormal(agRoot, pRequest, status, param, sspTag, pIomb1);
3843*4e1bc9a0SAchim Leubner break;
3844*4e1bc9a0SAchim Leubner }
3845*4e1bc9a0SAchim Leubner case OSSA_IO_XFER_ERR_EOB_DATA_OVERRUN:
3846*4e1bc9a0SAchim Leubner {
3847*4e1bc9a0SAchim Leubner 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));
3848*4e1bc9a0SAchim Leubner saRoot->IoErrorCount.agOSSA_IO_XFER_ERR_EOB_DATA_OVERRUN++;
3849*4e1bc9a0SAchim Leubner siAbnormal(agRoot, pRequest, status, param, sspTag);
3850*4e1bc9a0SAchim Leubner break;
3851*4e1bc9a0SAchim Leubner }
3852*4e1bc9a0SAchim Leubner case OSSA_IO_OPEN_CNX_ERROR_OPEN_PREEMPTED:
3853*4e1bc9a0SAchim Leubner {
3854*4e1bc9a0SAchim Leubner 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));
3855*4e1bc9a0SAchim Leubner saRoot->IoErrorCount.agOSSA_IO_OPEN_CNX_ERROR_OPEN_PREEMPTED++;
3856*4e1bc9a0SAchim Leubner siAbnormal(agRoot, pRequest, status, param, sspTag);
3857*4e1bc9a0SAchim Leubner break;
3858*4e1bc9a0SAchim Leubner }
3859*4e1bc9a0SAchim Leubner default:
3860*4e1bc9a0SAchim Leubner {
3861*4e1bc9a0SAchim Leubner SA_DBG1(("mpiSSPCompletion: Unknown tag 0x%x sspTag 0x%x status 0x%x param 0x%x\n", tag,sspTag,status,param));
3862*4e1bc9a0SAchim Leubner /* not allowed case. Therefore, return failed status */
3863*4e1bc9a0SAchim Leubner saRoot->IoErrorCount.agOSSA_IO_UNKNOWN_ERROR++;
3864*4e1bc9a0SAchim Leubner siAbnormal(agRoot, pRequest, OSSA_IO_FAILED, param, sspTag);
3865*4e1bc9a0SAchim Leubner break;
3866*4e1bc9a0SAchim Leubner }
3867*4e1bc9a0SAchim Leubner }
3868*4e1bc9a0SAchim Leubner
3869*4e1bc9a0SAchim Leubner smTraceFuncExit(hpDBG_VERY_LOUD, 'b', "5A");
3870*4e1bc9a0SAchim Leubner return ret;
3871*4e1bc9a0SAchim Leubner }
3872