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 * SPDX-License-Identifier: BSD-3-Clause
22 * -- End of Copyright Notice --
26 * System defined include files.
30 * User defined include files.
34 #include "IxQMgrQCfg_p.h"
35 #include "IxQMgrDispatcher_p.h"
36 #include "IxQMgrLog_p.h"
37 #include "IxQMgrQAccess_p.h"
38 #include "IxQMgrDefines_p.h"
39 #include "IxQMgrAqmIf_p.h"
42 * Set to true if initialized
43 * N.B. global so integration/unit tests can reinitialize
45 BOOL qMgrIsInitialized = false;
48 * Function definitions.
53 if (qMgrIsInitialized)
55 IX_QMGR_LOG0("ixQMgrInit: IxQMgr already initialised\n");
59 /* Initialise the QCfg component */
62 /* Initialise the Dispatcher component */
63 ixQMgrDispatcherInit ();
65 /* Initialise the Access component */
68 /* Initialization complete */
69 qMgrIsInitialized = true;
77 if (!qMgrIsInitialized)
82 /* Uninitialise the QCfg component */
85 /* Uninitialization complete */
86 qMgrIsInitialized = false;
94 IxQMgrQCfgStats *qCfgStats = NULL;
95 IxQMgrDispatcherStats *dispatcherStats = NULL;
97 UINT32 lowIntRegRead, upIntRegRead;
99 qCfgStats = ixQMgrQCfgStatsGet ();
100 dispatcherStats = ixQMgrDispatcherStatsGet ();
101 ixQMgrAqmIfQInterruptRegRead (IX_QMGR_QUELOW_GROUP, &lowIntRegRead);
102 ixQMgrAqmIfQInterruptRegRead (IX_QMGR_QUEUPP_GROUP, &upIntRegRead);
103 printf("Generic Stats........\n");
104 printf("=====================\n");
105 printf("Loop Run Count..........%u\n",dispatcherStats->loopRunCnt);
106 printf("Watermark set count.....%d\n", qCfgStats->wmSetCnt);
107 printf("===========================================\n");
108 printf("On the fly Interrupt Register Stats........\n");
109 printf("===========================================\n");
110 printf("Lower Interrupt Register............0x%08x\n",lowIntRegRead);
111 printf("Upper Interrupt Register............0x%08x\n",upIntRegRead);
112 printf("==============================================\n");
113 printf("Queue Specific Stats........\n");
114 printf("============================\n");
116 for (i=0; i<IX_QMGR_MAX_NUM_QUEUES; i++)
118 if (ixQMgrQIsConfigured(i))
124 printf("============================\n");
128 ixQMgrQShow (IxQMgrQId qId)
130 IxQMgrQCfgStats *qCfgStats = NULL;
131 IxQMgrDispatcherStats *dispatcherStats = NULL;
133 if (!ixQMgrQIsConfigured(qId))
135 return IX_QMGR_Q_NOT_CONFIGURED;
138 dispatcherStats = ixQMgrDispatcherStatsGet ();
139 qCfgStats = ixQMgrQCfgQStatsGet (qId);
141 printf("QId %d\n", qId);
143 printf(" IxQMgrQCfg Stats\n");
144 printf(" Name..................... \"%s\"\n", qCfgStats->qStats[qId].qName);
145 printf(" Size in words............ %u\n", qCfgStats->qStats[qId].qSizeInWords);
146 printf(" Entry size in words...... %u\n", qCfgStats->qStats[qId].qEntrySizeInWords);
147 printf(" Nearly empty watermark... %u\n", qCfgStats->qStats[qId].ne);
148 printf(" Nearly full watermark.... %u\n", qCfgStats->qStats[qId].nf);
149 printf(" Number of full entries... %u\n", qCfgStats->qStats[qId].numEntries);
150 printf(" Sram base address........ 0x%X\n", qCfgStats->qStats[qId].baseAddress);
151 printf(" Read pointer............. 0x%X\n", qCfgStats->qStats[qId].readPtr);
152 printf(" Write pointer............ 0x%X\n", qCfgStats->qStats[qId].writePtr);
155 if (dispatcherStats->queueStats[qId].notificationEnabled)
157 char *localEvent = "none ????";
158 switch (dispatcherStats->queueStats[qId].srcSel)
160 case IX_QMGR_Q_SOURCE_ID_E:
161 localEvent = "Empty";
163 case IX_QMGR_Q_SOURCE_ID_NE:
164 localEvent = "Nearly Empty";
166 case IX_QMGR_Q_SOURCE_ID_NF:
167 localEvent = "Nearly Full";
169 case IX_QMGR_Q_SOURCE_ID_F:
172 case IX_QMGR_Q_SOURCE_ID_NOT_E:
173 localEvent = "Not Empty";
175 case IX_QMGR_Q_SOURCE_ID_NOT_NE:
176 localEvent = "Not Nearly Empty";
178 case IX_QMGR_Q_SOURCE_ID_NOT_NF:
179 localEvent = "Not Nearly Full";
181 case IX_QMGR_Q_SOURCE_ID_NOT_F:
182 localEvent = "Not Full";
187 printf(" Notifications localEvent...... %s\n", localEvent);
191 printf(" Notifications............ not enabled\n");
193 printf(" IxQMgrDispatcher Stats\n");
194 printf(" Callback count................%d\n",
195 dispatcherStats->queueStats[qId].callbackCnt);
196 printf(" Priority change count.........%d\n",
197 dispatcherStats->queueStats[qId].priorityChangeCnt);
198 printf(" Interrupt no callback count...%d\n",
199 dispatcherStats->queueStats[qId].intNoCallbackCnt);
200 printf(" Interrupt lost callback count...%d\n",
201 dispatcherStats->queueStats[qId].intLostCallbackCnt);