4 * @author Intel Corporation
7 * @brief: Provided initialization of the QMgr component and its subcomponents.
11 * IXP400 SW Release version 2.0
13 * -- Copyright Notice --
16 * Copyright 2001-2005, Intel Corporation.
17 * All rights reserved.
20 * Redistribution and use in source and binary forms, with or without
21 * modification, are permitted provided that the following conditions
23 * 1. Redistributions of source code must retain the above copyright
24 * notice, this list of conditions and the following disclaimer.
25 * 2. Redistributions in binary form must reproduce the above copyright
26 * notice, this list of conditions and the following disclaimer in the
27 * documentation and/or other materials provided with the distribution.
28 * 3. Neither the name of the Intel Corporation nor the names of its contributors
29 * may be used to endorse or promote products derived from this software
30 * without specific prior written permission.
33 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
34 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
35 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
36 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
37 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
38 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
39 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
40 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
41 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
42 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
46 * -- End of Copyright Notice --
50 * System defined include files.
54 * User defined include files.
58 #include "IxQMgrQCfg_p.h"
59 #include "IxQMgrDispatcher_p.h"
60 #include "IxQMgrLog_p.h"
61 #include "IxQMgrQAccess_p.h"
62 #include "IxQMgrDefines_p.h"
63 #include "IxQMgrAqmIf_p.h"
66 * Set to true if initialized
67 * N.B. global so integration/unit tests can reinitialize
69 BOOL qMgrIsInitialized
= FALSE
;
72 * Function definitions.
77 if (qMgrIsInitialized
)
79 IX_QMGR_LOG0("ixQMgrInit: IxQMgr already initialised\n");
83 /* Initialise the QCfg component */
86 /* Initialise the Dispatcher component */
87 ixQMgrDispatcherInit ();
89 /* Initialise the Access component */
92 /* Initialization complete */
93 qMgrIsInitialized
= TRUE
;
101 if (!qMgrIsInitialized
)
106 /* Uninitialise the QCfg component */
109 /* Uninitialization complete */
110 qMgrIsInitialized
= FALSE
;
118 IxQMgrQCfgStats
*qCfgStats
= NULL
;
119 IxQMgrDispatcherStats
*dispatcherStats
= NULL
;
121 UINT32 lowIntRegRead
, upIntRegRead
;
123 qCfgStats
= ixQMgrQCfgStatsGet ();
124 dispatcherStats
= ixQMgrDispatcherStatsGet ();
125 ixQMgrAqmIfQInterruptRegRead (IX_QMGR_QUELOW_GROUP
, &lowIntRegRead
);
126 ixQMgrAqmIfQInterruptRegRead (IX_QMGR_QUEUPP_GROUP
, &upIntRegRead
);
127 printf("Generic Stats........\n");
128 printf("=====================\n");
129 printf("Loop Run Count..........%u\n",dispatcherStats
->loopRunCnt
);
130 printf("Watermark set count.....%d\n", qCfgStats
->wmSetCnt
);
131 printf("===========================================\n");
132 printf("On the fly Interrupt Register Stats........\n");
133 printf("===========================================\n");
134 printf("Lower Interrupt Register............0x%08x\n",lowIntRegRead
);
135 printf("Upper Interrupt Register............0x%08x\n",upIntRegRead
);
136 printf("==============================================\n");
137 printf("Queue Specific Stats........\n");
138 printf("============================\n");
140 for (i
=0; i
<IX_QMGR_MAX_NUM_QUEUES
; i
++)
142 if (ixQMgrQIsConfigured(i
))
148 printf("============================\n");
152 ixQMgrQShow (IxQMgrQId qId
)
154 IxQMgrQCfgStats
*qCfgStats
= NULL
;
155 IxQMgrDispatcherStats
*dispatcherStats
= NULL
;
157 if (!ixQMgrQIsConfigured(qId
))
159 return IX_QMGR_Q_NOT_CONFIGURED
;
162 dispatcherStats
= ixQMgrDispatcherStatsGet ();
163 qCfgStats
= ixQMgrQCfgQStatsGet (qId
);
165 printf("QId %d\n", qId
);
167 printf(" IxQMgrQCfg Stats\n");
168 printf(" Name..................... \"%s\"\n", qCfgStats
->qStats
[qId
].qName
);
169 printf(" Size in words............ %u\n", qCfgStats
->qStats
[qId
].qSizeInWords
);
170 printf(" Entry size in words...... %u\n", qCfgStats
->qStats
[qId
].qEntrySizeInWords
);
171 printf(" Nearly empty watermark... %u\n", qCfgStats
->qStats
[qId
].ne
);
172 printf(" Nearly full watermark.... %u\n", qCfgStats
->qStats
[qId
].nf
);
173 printf(" Number of full entries... %u\n", qCfgStats
->qStats
[qId
].numEntries
);
174 printf(" Sram base address........ 0x%X\n", qCfgStats
->qStats
[qId
].baseAddress
);
175 printf(" Read pointer............. 0x%X\n", qCfgStats
->qStats
[qId
].readPtr
);
176 printf(" Write pointer............ 0x%X\n", qCfgStats
->qStats
[qId
].writePtr
);
179 if (dispatcherStats
->queueStats
[qId
].notificationEnabled
)
181 char *localEvent
= "none ????";
182 switch (dispatcherStats
->queueStats
[qId
].srcSel
)
184 case IX_QMGR_Q_SOURCE_ID_E
:
185 localEvent
= "Empty";
187 case IX_QMGR_Q_SOURCE_ID_NE
:
188 localEvent
= "Nearly Empty";
190 case IX_QMGR_Q_SOURCE_ID_NF
:
191 localEvent
= "Nearly Full";
193 case IX_QMGR_Q_SOURCE_ID_F
:
196 case IX_QMGR_Q_SOURCE_ID_NOT_E
:
197 localEvent
= "Not Empty";
199 case IX_QMGR_Q_SOURCE_ID_NOT_NE
:
200 localEvent
= "Not Nearly Empty";
202 case IX_QMGR_Q_SOURCE_ID_NOT_NF
:
203 localEvent
= "Not Nearly Full";
205 case IX_QMGR_Q_SOURCE_ID_NOT_F
:
206 localEvent
= "Not Full";
211 printf(" Notifications localEvent...... %s\n", localEvent
);
215 printf(" Notifications............ not enabled\n");
217 printf(" IxQMgrDispatcher Stats\n");
218 printf(" Callback count................%d\n",
219 dispatcherStats
->queueStats
[qId
].callbackCnt
);
220 printf(" Priority change count.........%d\n",
221 dispatcherStats
->queueStats
[qId
].priorityChangeCnt
);
222 printf(" Interrupt no callback count...%d\n",
223 dispatcherStats
->queueStats
[qId
].intNoCallbackCnt
);
224 printf(" Interrupt lost callback count...%d\n",
225 dispatcherStats
->queueStats
[qId
].intLostCallbackCnt
);