IxNpeMhConfig.c 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608
  1. /**
  2. * @file IxNpeMhConfig.c
  3. *
  4. * @author Intel Corporation
  5. * @date 18 Jan 2002
  6. *
  7. * @brief This file contains the implementation of the private API for the
  8. * Configuration module.
  9. *
  10. *
  11. * @par
  12. * IXP400 SW Release version 2.0
  13. *
  14. * -- Copyright Notice --
  15. *
  16. * @par
  17. * Copyright 2001-2005, Intel Corporation.
  18. * All rights reserved.
  19. *
  20. * @par
  21. * Redistribution and use in source and binary forms, with or without
  22. * modification, are permitted provided that the following conditions
  23. * are met:
  24. * 1. Redistributions of source code must retain the above copyright
  25. * notice, this list of conditions and the following disclaimer.
  26. * 2. Redistributions in binary form must reproduce the above copyright
  27. * notice, this list of conditions and the following disclaimer in the
  28. * documentation and/or other materials provided with the distribution.
  29. * 3. Neither the name of the Intel Corporation nor the names of its contributors
  30. * may be used to endorse or promote products derived from this software
  31. * without specific prior written permission.
  32. *
  33. * @par
  34. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
  35. * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  36. * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  37. * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
  38. * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  39. * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  40. * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  41. * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  42. * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  43. * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  44. * SUCH DAMAGE.
  45. *
  46. * @par
  47. * -- End of Copyright Notice --
  48. */
  49. /*
  50. * Put the system defined include files required.
  51. */
  52. /*
  53. * Put the user defined include files required.
  54. */
  55. #include "IxOsal.h"
  56. #include "IxNpeMhMacros_p.h"
  57. #include "IxNpeMhConfig_p.h"
  58. /*
  59. * #defines and macros used in this file.
  60. */
  61. #define IX_NPE_MH_MAX_NUM_OF_RETRIES 1000000 /**< Maximum number of
  62. * retries before
  63. * timeout
  64. */
  65. /*
  66. * Typedefs whose scope is limited to this file.
  67. */
  68. /**
  69. * @struct IxNpeMhConfigStats
  70. *
  71. * @brief This structure is used to maintain statistics for the
  72. * Configuration module.
  73. */
  74. typedef struct
  75. {
  76. UINT32 outFifoReads; /**< outFifo reads */
  77. UINT32 inFifoWrites; /**< inFifo writes */
  78. UINT32 maxInFifoFullRetries; /**< max retries if inFIFO full */
  79. UINT32 maxOutFifoEmptyRetries; /**< max retries if outFIFO empty */
  80. } IxNpeMhConfigStats;
  81. /*
  82. * Variable declarations global to this file only. Externs are followed by
  83. * static variables.
  84. */
  85. IxNpeMhConfigNpeInfo ixNpeMhConfigNpeInfo[IX_NPEMH_NUM_NPES] =
  86. {
  87. {
  88. 0,
  89. IX_NPEMH_NPEA_INT,
  90. 0,
  91. 0,
  92. 0,
  93. 0,
  94. 0,
  95. NULL,
  96. FALSE
  97. },
  98. {
  99. 0,
  100. IX_NPEMH_NPEB_INT,
  101. 0,
  102. 0,
  103. 0,
  104. 0,
  105. 0,
  106. NULL,
  107. FALSE
  108. },
  109. {
  110. 0,
  111. IX_NPEMH_NPEC_INT,
  112. 0,
  113. 0,
  114. 0,
  115. 0,
  116. 0,
  117. NULL,
  118. FALSE
  119. }
  120. };
  121. PRIVATE IxNpeMhConfigStats ixNpeMhConfigStats[IX_NPEMH_NUM_NPES];
  122. /*
  123. * Extern function prototypes.
  124. */
  125. /*
  126. * Static function prototypes.
  127. */
  128. PRIVATE
  129. void ixNpeMhConfigIsr (void *parameter);
  130. /*
  131. * Function definition: ixNpeMhConfigIsr
  132. */
  133. PRIVATE
  134. void ixNpeMhConfigIsr (void *parameter)
  135. {
  136. IxNpeMhNpeId npeId = (IxNpeMhNpeId)parameter;
  137. UINT32 ofint;
  138. volatile UINT32 *statusReg =
  139. (UINT32 *)ixNpeMhConfigNpeInfo[npeId].statusRegister;
  140. IX_NPEMH_TRACE0 (IX_NPEMH_FN_ENTRY_EXIT, "Entering "
  141. "ixNpeMhConfigIsr\n");
  142. /* get the OFINT (OutFifo interrupt) bit of the status register */
  143. IX_NPEMH_REGISTER_READ_BITS (statusReg, &ofint, IX_NPEMH_NPE_STAT_OFINT);
  144. /* if the OFINT status bit is set */
  145. if (ofint)
  146. {
  147. /* if there is an ISR registered for this NPE */
  148. if (ixNpeMhConfigNpeInfo[npeId].isr != NULL)
  149. {
  150. /* invoke the ISR routine */
  151. ixNpeMhConfigNpeInfo[npeId].isr (npeId);
  152. }
  153. else
  154. {
  155. /* if we don't service the interrupt the NPE will continue */
  156. /* to trigger the interrupt indefinitely */
  157. IX_NPEMH_ERROR_REPORT ("No ISR registered to service "
  158. "interrupt\n");
  159. }
  160. }
  161. IX_NPEMH_TRACE0 (IX_NPEMH_FN_ENTRY_EXIT, "Exiting "
  162. "ixNpeMhConfigIsr\n");
  163. }
  164. /*
  165. * Function definition: ixNpeMhConfigInitialize
  166. */
  167. void ixNpeMhConfigInitialize (
  168. IxNpeMhNpeInterrupts npeInterrupts)
  169. {
  170. IxNpeMhNpeId npeId;
  171. UINT32 virtualAddr[IX_NPEMH_NUM_NPES];
  172. IX_NPEMH_TRACE0 (IX_NPEMH_FN_ENTRY_EXIT, "Entering "
  173. "ixNpeMhConfigInitialize\n");
  174. /* Request a mapping for the NPE-A config register address space */
  175. virtualAddr[IX_NPEMH_NPEID_NPEA] =
  176. (UINT32) IX_OSAL_MEM_MAP (IX_NPEMH_NPEA_BASE,
  177. IX_OSAL_IXP400_NPEA_MAP_SIZE);
  178. IX_OSAL_ASSERT (virtualAddr[IX_NPEMH_NPEID_NPEA]);
  179. /* Request a mapping for the NPE-B config register address space */
  180. virtualAddr[IX_NPEMH_NPEID_NPEB] =
  181. (UINT32) IX_OSAL_MEM_MAP (IX_NPEMH_NPEB_BASE,
  182. IX_OSAL_IXP400_NPEB_MAP_SIZE);
  183. IX_OSAL_ASSERT (virtualAddr[IX_NPEMH_NPEID_NPEB]);
  184. /* Request a mapping for the NPE-C config register address space */
  185. virtualAddr[IX_NPEMH_NPEID_NPEC] =
  186. (UINT32) IX_OSAL_MEM_MAP (IX_NPEMH_NPEC_BASE,
  187. IX_OSAL_IXP400_NPEC_MAP_SIZE);
  188. IX_OSAL_ASSERT (virtualAddr[IX_NPEMH_NPEID_NPEC]);
  189. /* for each NPE ... */
  190. for (npeId = 0; npeId < IX_NPEMH_NUM_NPES; npeId++)
  191. {
  192. /* declare a convenience pointer */
  193. IxNpeMhConfigNpeInfo *npeInfo = &ixNpeMhConfigNpeInfo[npeId];
  194. /* store the virtual addresses of the NPE registers for later use */
  195. npeInfo->virtualRegisterBase = virtualAddr[npeId];
  196. npeInfo->statusRegister = virtualAddr[npeId] + IX_NPEMH_NPESTAT_OFFSET;
  197. npeInfo->controlRegister = virtualAddr[npeId] + IX_NPEMH_NPECTL_OFFSET;
  198. npeInfo->inFifoRegister = virtualAddr[npeId] + IX_NPEMH_NPEFIFO_OFFSET;
  199. npeInfo->outFifoRegister = virtualAddr[npeId] + IX_NPEMH_NPEFIFO_OFFSET;
  200. /* for test purposes - to verify the register addresses */
  201. IX_NPEMH_TRACE2 (IX_NPEMH_DEBUG, "NPE %d status register = "
  202. "0x%08X\n", npeId, npeInfo->statusRegister);
  203. IX_NPEMH_TRACE2 (IX_NPEMH_DEBUG, "NPE %d control register = "
  204. "0x%08X\n", npeId, npeInfo->controlRegister);
  205. IX_NPEMH_TRACE2 (IX_NPEMH_DEBUG, "NPE %d inFifo register = "
  206. "0x%08X\n", npeId, npeInfo->inFifoRegister);
  207. IX_NPEMH_TRACE2 (IX_NPEMH_DEBUG, "NPE %d outFifo register = "
  208. "0x%08X\n", npeId, npeInfo->outFifoRegister);
  209. /* connect our ISR to the NPE interrupt */
  210. (void) ixOsalIrqBind (
  211. npeInfo->interruptId, ixNpeMhConfigIsr, (void *)npeId);
  212. /* initialise a mutex for this NPE */
  213. (void) ixOsalMutexInit (&npeInfo->mutex);
  214. /* if we should service the NPE's "outFIFO not empty" interrupt */
  215. if (npeInterrupts == IX_NPEMH_NPEINTERRUPTS_YES)
  216. {
  217. /* enable the NPE's "outFIFO not empty" interrupt */
  218. ixNpeMhConfigNpeInterruptEnable (npeId);
  219. }
  220. else
  221. {
  222. /* disable the NPE's "outFIFO not empty" interrupt */
  223. ixNpeMhConfigNpeInterruptDisable (npeId);
  224. }
  225. }
  226. IX_NPEMH_TRACE0 (IX_NPEMH_FN_ENTRY_EXIT, "Exiting "
  227. "ixNpeMhConfigInitialize\n");
  228. }
  229. /*
  230. * Function definition: ixNpeMhConfigUninit
  231. */
  232. void ixNpeMhConfigUninit (void)
  233. {
  234. IxNpeMhNpeId npeId;
  235. IX_NPEMH_TRACE0 (IX_NPEMH_FN_ENTRY_EXIT, "Entering "
  236. "ixNpeMhConfigUninit\n");
  237. /* for each NPE ... */
  238. for (npeId = 0; npeId < IX_NPEMH_NUM_NPES; npeId++)
  239. {
  240. /* declare a convenience pointer */
  241. IxNpeMhConfigNpeInfo *npeInfo = &ixNpeMhConfigNpeInfo[npeId];
  242. /* disconnect ISR */
  243. ixOsalIrqUnbind(npeInfo->interruptId);
  244. /* destroy mutex associated with this NPE */
  245. ixOsalMutexDestroy(&npeInfo->mutex);
  246. IX_OSAL_MEM_UNMAP (npeInfo->virtualRegisterBase);
  247. npeInfo->virtualRegisterBase = 0;
  248. npeInfo->statusRegister = 0;
  249. npeInfo->controlRegister = 0;
  250. npeInfo->inFifoRegister = 0;
  251. npeInfo->outFifoRegister = 0;
  252. }
  253. IX_NPEMH_TRACE0 (IX_NPEMH_FN_ENTRY_EXIT, "Exiting "
  254. "ixNpeMhConfigUninit\n");
  255. }
  256. /*
  257. * Function definition: ixNpeMhConfigIsrRegister
  258. */
  259. void ixNpeMhConfigIsrRegister (
  260. IxNpeMhNpeId npeId,
  261. IxNpeMhConfigIsr isr)
  262. {
  263. IX_NPEMH_TRACE0 (IX_NPEMH_FN_ENTRY_EXIT, "Entering "
  264. "ixNpeMhConfigIsrRegister\n");
  265. /* check if there is already an ISR registered for this NPE */
  266. if (ixNpeMhConfigNpeInfo[npeId].isr != NULL)
  267. {
  268. IX_NPEMH_TRACE0 (IX_NPEMH_DEBUG, "Over-writing registered NPE ISR\n");
  269. }
  270. /* save the ISR routine with the NPE info */
  271. ixNpeMhConfigNpeInfo[npeId].isr = isr;
  272. IX_NPEMH_TRACE0 (IX_NPEMH_FN_ENTRY_EXIT, "Exiting "
  273. "ixNpeMhConfigIsrRegister\n");
  274. }
  275. /*
  276. * Function definition: ixNpeMhConfigNpeInterruptEnable
  277. */
  278. BOOL ixNpeMhConfigNpeInterruptEnable (
  279. IxNpeMhNpeId npeId)
  280. {
  281. UINT32 ofe;
  282. volatile UINT32 *controlReg =
  283. (UINT32 *)ixNpeMhConfigNpeInfo[npeId].controlRegister;
  284. /* get the OFE (OutFifoEnable) bit of the control register */
  285. IX_NPEMH_REGISTER_READ_BITS (controlReg, &ofe, IX_NPEMH_NPE_CTL_OFE);
  286. /* if the interrupt is disabled then we must enable it */
  287. if (!ofe)
  288. {
  289. /* set the OFE (OutFifoEnable) bit of the control register */
  290. /* we must set the OFEWE (OutFifoEnableWriteEnable) at the same */
  291. /* time for the write to have effect */
  292. IX_NPEMH_REGISTER_WRITE_BITS (controlReg,
  293. (IX_NPEMH_NPE_CTL_OFE |
  294. IX_NPEMH_NPE_CTL_OFEWE),
  295. (IX_NPEMH_NPE_CTL_OFE |
  296. IX_NPEMH_NPE_CTL_OFEWE));
  297. }
  298. /* return the previous state of the interrupt */
  299. return (ofe != 0);
  300. }
  301. /*
  302. * Function definition: ixNpeMhConfigNpeInterruptDisable
  303. */
  304. BOOL ixNpeMhConfigNpeInterruptDisable (
  305. IxNpeMhNpeId npeId)
  306. {
  307. UINT32 ofe;
  308. volatile UINT32 *controlReg =
  309. (UINT32 *)ixNpeMhConfigNpeInfo[npeId].controlRegister;
  310. /* get the OFE (OutFifoEnable) bit of the control register */
  311. IX_NPEMH_REGISTER_READ_BITS (controlReg, &ofe, IX_NPEMH_NPE_CTL_OFE);
  312. /* if the interrupt is enabled then we must disable it */
  313. if (ofe)
  314. {
  315. /* unset the OFE (OutFifoEnable) bit of the control register */
  316. /* we must set the OFEWE (OutFifoEnableWriteEnable) at the same */
  317. /* time for the write to have effect */
  318. IX_NPEMH_REGISTER_WRITE_BITS (controlReg,
  319. (0 |
  320. IX_NPEMH_NPE_CTL_OFEWE),
  321. (IX_NPEMH_NPE_CTL_OFE |
  322. IX_NPEMH_NPE_CTL_OFEWE));
  323. }
  324. /* return the previous state of the interrupt */
  325. return (ofe != 0);
  326. }
  327. /*
  328. * Function definition: ixNpeMhConfigMessageIdGet
  329. */
  330. IxNpeMhMessageId ixNpeMhConfigMessageIdGet (
  331. IxNpeMhMessage message)
  332. {
  333. /* return the most-significant byte of the first word of the */
  334. /* message */
  335. return ((IxNpeMhMessageId) ((message.data[0] >> 24) & 0xFF));
  336. }
  337. /*
  338. * Function definition: ixNpeMhConfigNpeIdIsValid
  339. */
  340. BOOL ixNpeMhConfigNpeIdIsValid (
  341. IxNpeMhNpeId npeId)
  342. {
  343. /* check that the npeId parameter is within the range of valid IDs */
  344. return (npeId >= 0 && npeId < IX_NPEMH_NUM_NPES);
  345. }
  346. /*
  347. * Function definition: ixNpeMhConfigLockGet
  348. */
  349. void ixNpeMhConfigLockGet (
  350. IxNpeMhNpeId npeId)
  351. {
  352. IX_NPEMH_TRACE0 (IX_NPEMH_FN_ENTRY_EXIT, "Entering "
  353. "ixNpeMhConfigLockGet\n");
  354. /* lock the mutex for this NPE */
  355. (void) ixOsalMutexLock (&ixNpeMhConfigNpeInfo[npeId].mutex,
  356. IX_OSAL_WAIT_FOREVER);
  357. /* disable the NPE's "outFIFO not empty" interrupt */
  358. ixNpeMhConfigNpeInfo[npeId].oldInterruptState =
  359. ixNpeMhConfigNpeInterruptDisable (npeId);
  360. IX_NPEMH_TRACE0 (IX_NPEMH_FN_ENTRY_EXIT, "Exiting "
  361. "ixNpeMhConfigLockGet\n");
  362. }
  363. /*
  364. * Function definition: ixNpeMhConfigLockRelease
  365. */
  366. void ixNpeMhConfigLockRelease (
  367. IxNpeMhNpeId npeId)
  368. {
  369. IX_NPEMH_TRACE0 (IX_NPEMH_FN_ENTRY_EXIT, "Entering "
  370. "ixNpeMhConfigLockRelease\n");
  371. /* if the interrupt was previously enabled */
  372. if (ixNpeMhConfigNpeInfo[npeId].oldInterruptState)
  373. {
  374. /* enable the NPE's "outFIFO not empty" interrupt */
  375. ixNpeMhConfigNpeInfo[npeId].oldInterruptState =
  376. ixNpeMhConfigNpeInterruptEnable (npeId);
  377. }
  378. /* unlock the mutex for this NPE */
  379. (void) ixOsalMutexUnlock (&ixNpeMhConfigNpeInfo[npeId].mutex);
  380. IX_NPEMH_TRACE0 (IX_NPEMH_FN_ENTRY_EXIT, "Exiting "
  381. "ixNpeMhConfigLockRelease\n");
  382. }
  383. /*
  384. * Function definition: ixNpeMhConfigInFifoWrite
  385. */
  386. IX_STATUS ixNpeMhConfigInFifoWrite (
  387. IxNpeMhNpeId npeId,
  388. IxNpeMhMessage message)
  389. {
  390. volatile UINT32 *npeInFifo =
  391. (UINT32 *)ixNpeMhConfigNpeInfo[npeId].inFifoRegister;
  392. UINT32 retriesCount = 0;
  393. /* write the first word of the message to the NPE's inFIFO */
  394. IX_NPEMH_REGISTER_WRITE (npeInFifo, message.data[0]);
  395. /* need to wait for room to write second word - see SCR #493,
  396. poll for maximum number of retries, if exceed maximum
  397. retries, exit from while loop */
  398. while ((IX_NPE_MH_MAX_NUM_OF_RETRIES > retriesCount)
  399. && ixNpeMhConfigInFifoIsFull (npeId))
  400. {
  401. retriesCount++;
  402. }
  403. /* Return TIMEOUT status to caller, indicate that NPE Hang / Halt */
  404. if (IX_NPE_MH_MAX_NUM_OF_RETRIES == retriesCount)
  405. {
  406. return IX_NPEMH_CRITICAL_NPE_ERR;
  407. }
  408. /* write the second word of the message to the NPE's inFIFO */
  409. IX_NPEMH_REGISTER_WRITE (npeInFifo, message.data[1]);
  410. /* record in the stats the maximum number of retries needed */
  411. if (ixNpeMhConfigStats[npeId].maxInFifoFullRetries < retriesCount)
  412. {
  413. ixNpeMhConfigStats[npeId].maxInFifoFullRetries = retriesCount;
  414. }
  415. /* update statistical info */
  416. ixNpeMhConfigStats[npeId].inFifoWrites++;
  417. return IX_SUCCESS;
  418. }
  419. /*
  420. * Function definition: ixNpeMhConfigOutFifoRead
  421. */
  422. IX_STATUS ixNpeMhConfigOutFifoRead (
  423. IxNpeMhNpeId npeId,
  424. IxNpeMhMessage *message)
  425. {
  426. volatile UINT32 *npeOutFifo =
  427. (UINT32 *)ixNpeMhConfigNpeInfo[npeId].outFifoRegister;
  428. UINT32 retriesCount = 0;
  429. /* read the first word of the message from the NPE's outFIFO */
  430. IX_NPEMH_REGISTER_READ (npeOutFifo, &message->data[0]);
  431. /* need to wait for NPE to write second word - see SCR #493
  432. poll for maximum number of retries, if exceed maximum
  433. retries, exit from while loop */
  434. while ((IX_NPE_MH_MAX_NUM_OF_RETRIES > retriesCount)
  435. && ixNpeMhConfigOutFifoIsEmpty (npeId))
  436. {
  437. retriesCount++;
  438. }
  439. /* Return TIMEOUT status to caller, indicate that NPE Hang / Halt */
  440. if (IX_NPE_MH_MAX_NUM_OF_RETRIES == retriesCount)
  441. {
  442. return IX_NPEMH_CRITICAL_NPE_ERR;
  443. }
  444. /* read the second word of the message from the NPE's outFIFO */
  445. IX_NPEMH_REGISTER_READ (npeOutFifo, &message->data[1]);
  446. /* record in the stats the maximum number of retries needed */
  447. if (ixNpeMhConfigStats[npeId].maxOutFifoEmptyRetries < retriesCount)
  448. {
  449. ixNpeMhConfigStats[npeId].maxOutFifoEmptyRetries = retriesCount;
  450. }
  451. /* update statistical info */
  452. ixNpeMhConfigStats[npeId].outFifoReads++;
  453. return IX_SUCCESS;
  454. }
  455. /*
  456. * Function definition: ixNpeMhConfigShow
  457. */
  458. void ixNpeMhConfigShow (
  459. IxNpeMhNpeId npeId)
  460. {
  461. /* show the message fifo read counter */
  462. IX_NPEMH_SHOW ("Message FIFO reads",
  463. ixNpeMhConfigStats[npeId].outFifoReads);
  464. /* show the message fifo write counter */
  465. IX_NPEMH_SHOW ("Message FIFO writes",
  466. ixNpeMhConfigStats[npeId].inFifoWrites);
  467. /* show the max retries performed when inFIFO full */
  468. IX_NPEMH_SHOW ("Max inFIFO Full retries",
  469. ixNpeMhConfigStats[npeId].maxInFifoFullRetries);
  470. /* show the max retries performed when outFIFO empty */
  471. IX_NPEMH_SHOW ("Max outFIFO Empty retries",
  472. ixNpeMhConfigStats[npeId].maxOutFifoEmptyRetries);
  473. /* show the current status of the inFifo */
  474. ixOsalLog (IX_OSAL_LOG_LVL_USER, IX_OSAL_LOG_DEV_STDOUT,
  475. "InFifo is %s and %s\n",
  476. (ixNpeMhConfigInFifoIsEmpty (npeId) ?
  477. (int) "EMPTY" : (int) "NOT EMPTY"),
  478. (ixNpeMhConfigInFifoIsFull (npeId) ?
  479. (int) "FULL" : (int) "NOT FULL"),
  480. 0, 0, 0, 0);
  481. /* show the current status of the outFifo */
  482. ixOsalLog (IX_OSAL_LOG_LVL_USER, IX_OSAL_LOG_DEV_STDOUT,
  483. "OutFifo is %s and %s\n",
  484. (ixNpeMhConfigOutFifoIsEmpty (npeId) ?
  485. (int) "EMPTY" : (int) "NOT EMPTY"),
  486. (ixNpeMhConfigOutFifoIsFull (npeId) ?
  487. (int) "FULL" : (int) "NOT FULL"),
  488. 0, 0, 0, 0);
  489. }
  490. /*
  491. * Function definition: ixNpeMhConfigShowReset
  492. */
  493. void ixNpeMhConfigShowReset (
  494. IxNpeMhNpeId npeId)
  495. {
  496. /* reset the message fifo read counter */
  497. ixNpeMhConfigStats[npeId].outFifoReads = 0;
  498. /* reset the message fifo write counter */
  499. ixNpeMhConfigStats[npeId].inFifoWrites = 0;
  500. /* reset the max inFIFO Full retries counter */
  501. ixNpeMhConfigStats[npeId].maxInFifoFullRetries = 0;
  502. /* reset the max outFIFO empty retries counter */
  503. ixNpeMhConfigStats[npeId].maxOutFifoEmptyRetries = 0;
  504. }