IxAtmdAccCtrl.h 73 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934
  1. /**
  2. * @file IxAtmdAccCtrl.h
  3. *
  4. * @date 20-Mar-2002
  5. *
  6. * @brief IxAtmdAcc Public API
  7. *
  8. * This file contains the public API of IxAtmdAcc, related to the
  9. * control functions of the component.
  10. *
  11. *
  12. * @par
  13. * IXP400 SW Release version 2.0
  14. *
  15. * -- Copyright Notice --
  16. *
  17. * @par
  18. * Copyright 2001-2005, Intel Corporation.
  19. * All rights reserved.
  20. *
  21. * @par
  22. * SPDX-License-Identifier: BSD-3-Clause
  23. * @par
  24. * -- End of Copyright Notice --
  25. */
  26. /* ------------------------------------------------------
  27. Doxygen group definitions
  28. ------------------------------------------------------ */
  29. /**
  30. *
  31. * @defgroup IxAtmdAccCtrlAPI IXP400 ATM Driver Access (IxAtmdAcc) Control API
  32. *
  33. * @brief The public API for the IXP400 Atm Driver Control component
  34. *
  35. * IxAtmdAcc is the low level interface by which AAL PDU get transmitted
  36. * to,and received from the Utopia bus
  37. *
  38. * This part is related to the Control configuration
  39. *
  40. * @{
  41. */
  42. #ifndef IXATMDACCCTRL_H
  43. #define IXATMDACCCTRL_H
  44. #include "IxAtmdAcc.h"
  45. /* ------------------------------------------------------
  46. AtmdAccCtrl Data Types definition
  47. ------------------------------------------------------ */
  48. /**
  49. *
  50. * @ingroup IxAtmdAccCtrlAPI
  51. *
  52. * @def IX_ATMDACC_PORT_DISABLE_IN_PROGRESS
  53. *
  54. * @brief Port enable return code
  55. *
  56. * This constant is used to tell IxAtmDAcc user that the port disable
  57. * functions are not complete. The user can call ixAtmdAccPortDisableComplete()
  58. * to find out when the disable has finished. The port enable can then proceed.
  59. *
  60. */
  61. #define IX_ATMDACC_PORT_DISABLE_IN_PROGRESS 5
  62. /**
  63. *
  64. * @ingroup IxAtmdAccCtrlAPI
  65. *
  66. * @def IX_ATMDACC_ALLPDUS
  67. *
  68. * @brief All PDUs
  69. *
  70. * This constant is used to tell IxAtmDAcc to process all PDUs from
  71. * the RX queue or the TX Done
  72. *
  73. * @sa IxAtmdAccRxDispatcher
  74. * @sa IxAtmdAccTxDoneDispatcher
  75. *
  76. */
  77. #define IX_ATMDACC_ALLPDUS 0xffffffff
  78. /* ------------------------------------------------------
  79. Part of the IxAtmdAcc interface related to RX traffic
  80. ------------------------------------------------------ */
  81. /**
  82. *
  83. * @ingroup IxAtmdAccCtrlAPI
  84. *
  85. * @brief Callback prototype for notification of available PDUs for
  86. * an Rx Q.
  87. *
  88. * This a protoype for a function which is called when there is at
  89. * least one Pdu available for processing on a particular Rx Q.
  90. *
  91. * This function should call @a ixAtmdAccRxDispatch() with
  92. * the aprropriate number of parameters to read and process the Rx Q.
  93. *
  94. * @sa ixAtmdAccRxDispatch
  95. * @sa ixAtmdAccRxVcConnect
  96. * @sa ixAtmdAccRxDispatcherRegister
  97. *
  98. * @param rxQueueId @ref IxAtmRxQueueId [in] indicates which RX queue to has Pdus to process.
  99. * @param numberOfPdusToProcess unsigned int [in] indicates the minimum number of
  100. * PDUs available to process all PDUs from the queue.
  101. * @param reservedPtr unsigned int* [out] pointer to a int location which can
  102. * be written to, but does not retain written values. This is
  103. * provided to make this prototype compatible
  104. * with @a ixAtmdAccRxDispatch()
  105. *
  106. * @return @li int - ignored.
  107. *
  108. */
  109. typedef IX_STATUS (*IxAtmdAccRxDispatcher) (IxAtmRxQueueId rxQueueId,
  110. unsigned int numberOfPdusToProcess,
  111. unsigned int *reservedPtr);
  112. /* ------------------------------------------------------
  113. Part of the IxAtmdAcc interface related to TX traffic
  114. ------------------------------------------------------ */
  115. /**
  116. *
  117. * @ingroup IxAtmdAccCtrlAPI
  118. *
  119. * @brief Callback prototype for transmitted mbuf when threshold level is
  120. * crossed.
  121. *
  122. * IxAtmdAccTxDoneDispatcher is the prototype of the user function
  123. * which get called when pdus are completely transmitted. This function
  124. * is likely to call the @a ixAtmdAccTxDoneDispatch() function.
  125. *
  126. * This function is called when the number of available pdus for
  127. * reception is crossing the threshold level as defined
  128. * in @a ixAtmdAccTxDoneDispatcherRegister()
  129. *
  130. * This function is called inside an Qmgr dispatch context. No system
  131. * resource or interrupt-unsafe feature should be used inside this
  132. * callback.
  133. *
  134. * Transmitted buffers recycling implementation is a sytem-wide mechanism
  135. * and needs to be set before any traffic is started. If this threshold
  136. * mechanism is not used, the user is responsible for polling the
  137. * transmitted buffers with @a ixAtmdAccTxDoneDispatch()
  138. * and @a ixAtmdAccTxDoneLevelQuery() functions.
  139. *
  140. * @sa ixAtmdAccTxDoneDispatcherRegister
  141. * @sa ixAtmdAccTxDoneDispatch
  142. * @sa ixAtmdAccTxDoneLevelQuery
  143. *
  144. * @param numberOfPdusToProcess unsigned int [in] - The current number of pdus currently
  145. * available for recycling
  146. * @param *reservedPtr unsigned int [out] - pointer to a int location which can be
  147. * written to but does not retain written values. This is provided
  148. * to make this prototype compatible
  149. * with @a ixAtmdAccTxDoneDispatch()
  150. *
  151. * @return @li IX_SUCCESS This is provided to make
  152. * this prototype compatible with @a ixAtmdAccTxDoneDispatch()
  153. * @return @li IX_FAIL invalid parameters or some unspecified internal
  154. * error occured. This is provided to make
  155. * this prototype compatible with @a ixAtmdAccTxDoneDispatch()
  156. *
  157. */
  158. typedef IX_STATUS (*IxAtmdAccTxDoneDispatcher) (unsigned int numberOfPdusToProcess,
  159. unsigned int *reservedPtr);
  160. /**
  161. *
  162. * @ingroup IxAtmdAccCtrlAPI
  163. *
  164. * @brief Notification that the threshold number of scheduled cells
  165. * remains in a port's transmit Q.
  166. *
  167. * The is the prototype for of the user notification function which
  168. * gets called on a per-port basis, when the number of remaining
  169. * scheduled cells to be transmitted decreases to the threshold level.
  170. * The number of cells passed as a parameter can be used for scheduling
  171. * purposes as the maximum number of cells that can be passed in a
  172. * schedule table to the @a ixAtmdAccPortTxProcess() function.
  173. *
  174. * @sa ixAtmdAccPortTxCallbackRegister
  175. * @sa ixAtmdAccPortTxProcess
  176. * @sa ixAtmdAccPortTxFreeEntriesQuery
  177. *
  178. * @param port @ref IxAtmLogicalPort [in] - logical PHY port [@a IX_UTOPIA_PORT_0 .. @a IX_UTOPIA_MAX_PORTS - 1]
  179. * @param numberOfAvailableCells unsigned int [in] - number of available
  180. * cell entries.for the port
  181. *
  182. * @note - This functions shall not use system resources when used
  183. * inside an interrupt context.
  184. *
  185. */
  186. typedef void (*IxAtmdAccPortTxLowCallback) (IxAtmLogicalPort port,
  187. unsigned int numberOfAvailableCells);
  188. /**
  189. *
  190. * @ingroup IxAtmdAccCtrlAPI
  191. *
  192. * @brief Prototype to submit cells for transmission
  193. *
  194. * IxAtmdAccTxVcDemandUpdateCallback is the prototype of the callback
  195. * function used by AtmD to notify an ATM Scheduler that the user of
  196. * a VC has submitted cells for transmission.
  197. *
  198. * @sa IxAtmdAccTxVcDemandUpdateCallback
  199. * @sa IxAtmdAccTxVcDemandClearCallback
  200. * @sa IxAtmdAccTxSchVcIdGetCallback
  201. * @sa ixAtmdAccPortTxScheduledModeEnable
  202. *
  203. * @param port @ref IxAtmLogicalPort [in] - Specifies the ATM port on which the VC to be updated
  204. * is established
  205. * @param vcId int [in] - Identifies the VC to be updated. This is the value
  206. * returned by the @a IxAtmdAccTxSchVcIdGetCallback() call .
  207. * @param numberOfCells unsigned int [in] - Indicates how many ATM cells should be added
  208. * to the queue for this VC.
  209. *
  210. * @return @li IX_SUCCESS the function is registering the cell demand for
  211. * this VC.
  212. * @return @li IX_FAIL the function cannot register cell for this VC : the
  213. * scheduler maybe overloaded or misconfigured
  214. *
  215. */
  216. typedef IX_STATUS (*IxAtmdAccTxVcDemandUpdateCallback) (IxAtmLogicalPort port,
  217. int vcId,
  218. unsigned int numberOfCells);
  219. /**
  220. *
  221. * @ingroup IxAtmdAccCtrlAPI
  222. *
  223. * @brief prototype to remove all currently queued cells from a
  224. * registered VC
  225. *
  226. * IxAtmdAccTxVcDemandClearCallback is the prototype of the function
  227. * to remove all currently queued cells from a registered VC. The
  228. * pending cell count for the specified VC is reset to zero. After the
  229. * use of this callback, the scheduler shall not schedule more cells
  230. * for this VC.
  231. *
  232. * This callback function is called during a VC disconnection
  233. * @a ixAtmdAccTxVcTryDisconnect()
  234. *
  235. * @sa IxAtmdAccTxVcDemandUpdateCallback
  236. * @sa IxAtmdAccTxVcDemandClearCallback
  237. * @sa IxAtmdAccTxSchVcIdGetCallback
  238. * @sa ixAtmdAccPortTxScheduledModeEnable
  239. * @sa ixAtmdAccTxVcTryDisconnect
  240. *
  241. * @param port @ref IxAtmLogicalPort [in] - Specifies the ATM port on which the VC to be cleared
  242. * is established
  243. * @param vcId int [in] - Identifies the VC to be cleared. This is the value
  244. * returned by the @a IxAtmdAccTxSchVcIdGetCallback() call .
  245. *
  246. * @return none
  247. *
  248. */
  249. typedef void (*IxAtmdAccTxVcDemandClearCallback) (IxAtmLogicalPort port,
  250. int vcId);
  251. /**
  252. *
  253. * @ingroup IxAtmdAccCtrlAPI
  254. *
  255. * @brief prototype to get a scheduler vc id
  256. *
  257. * IxAtmdAccTxSchVcIdGetCallback is the prototype of the function to get
  258. * a scheduler vcId
  259. *
  260. * @sa IxAtmdAccTxVcDemandUpdateCallback
  261. * @sa IxAtmdAccTxVcDemandClearCallback
  262. * @sa IxAtmdAccTxSchVcIdGetCallback
  263. * @sa ixAtmdAccPortTxScheduledModeEnable
  264. *
  265. * @param port @ref IxAtmLogicalPort [in] - Specifies the ATM logical port on which the VC is
  266. * established
  267. * @param vpi unsigned int [in] - For AAL0/AAL5 specifies the ATM vpi on which the
  268. * VC is established.
  269. * For OAM specifies the dedicated "OAM Tx channel" VPI.
  270. * @param vci unsigned int [in] - For AAL0/AAL5 specifies the ATM vci on which the
  271. * VC is established.
  272. * For OAM specifies the dedicated "OAM Tx channel" VCI.
  273. * @param connId @ref IxAtmConnId [in] - specifies the IxAtmdAcc connection Id already
  274. * associated with this VC
  275. * @param vcId int* [out] - pointer to a vcId
  276. *
  277. * @return @li IX_SUCCESS the function is returning a Scheduler vcId for this
  278. * VC
  279. * @return @li IX_FAIL the function cannot process scheduling for this VC.
  280. * the contents of vcId is unspecified
  281. *
  282. */
  283. typedef IX_STATUS (*IxAtmdAccTxSchVcIdGetCallback) (IxAtmLogicalPort port,
  284. unsigned int vpi,
  285. unsigned int vci,
  286. IxAtmConnId connId,
  287. int *vcId);
  288. /* ------------------------------------------------------
  289. Part of the IxAtmdAcc interface related to RX traffic
  290. ------------------------------------------------------ */
  291. /**
  292. *
  293. * @ingroup IxAtmdAccCtrlAPI
  294. *
  295. * @fn ixAtmdAccRxDispatcherRegister (
  296. IxAtmRxQueueId queueId,
  297. IxAtmdAccRxDispatcher callback)
  298. *
  299. * @brief Register a notification callback to be invoked when there is
  300. * at least one entry on a particular Rx queue.
  301. *
  302. * This function registers a callback to be invoked when there is at
  303. * least one entry in a particular queue. The registered callback is
  304. * called every time when the hardware adds one or more pdus to the
  305. * specified Rx queue.
  306. *
  307. * This function cannot be used when a Rx Vc using this queue is
  308. * already existing.
  309. *
  310. * @note -The callback function can be the API function
  311. * @a ixAtmdAccRxDispatch() : every time the threhold level
  312. * of the queue is reached, the ixAtmdAccRxDispatch() is
  313. * invoked to remove all entries from the queue.
  314. *
  315. * @sa ixAtmdAccRxDispatch
  316. * @sa IxAtmdAccRxDispatcher
  317. *
  318. * @param queueId @ref IxAtmRxQueueId [in] RX queue identification
  319. * @param callback @ref IxAtmdAccRxDispatcher [in] function triggering the delivery of incoming
  320. * traffic. This parameter cannot be a null pointer.
  321. *
  322. * @return @li IX_SUCCESS Successful call to @a ixAtmdAccRxDispatcherRegister()
  323. * @return @li IX_FAIL error in the parameters, or there is an
  324. * already active RX VC for this queue or some unspecified
  325. * internal error occurred.
  326. *
  327. */
  328. PUBLIC IX_STATUS ixAtmdAccRxDispatcherRegister (
  329. IxAtmRxQueueId queueId,
  330. IxAtmdAccRxDispatcher callback);
  331. /**
  332. *
  333. * @ingroup IxAtmdAccCtrlAPI
  334. *
  335. * @fn ixAtmdAccRxDispatch (IxAtmRxQueueId rxQueueId,
  336. unsigned int numberOfPdusToProcess,
  337. unsigned int *numberOfPdusProcessedPtr)
  338. *
  339. *
  340. * @brief Control function which executes Rx processing for a particular
  341. * Rx stream.
  342. *
  343. * The @a IxAtmdAccRxDispatch() function is used to process received Pdus
  344. * available from one of the two incoming RX streams. When this function
  345. * is invoked, the incoming traffic (up to the number of PDUs passed as
  346. * a parameter) will be transferred to the IxAtmdAcc users through the
  347. * callback @a IxAtmdAccRxVcRxCallback(), as registered during the
  348. * @a ixAtmdAccRxVcConnect() call.
  349. *
  350. * The user receive callbacks will be executed in the context of this
  351. * function.
  352. *
  353. * Failing to use this function on a regular basis when there is traffic
  354. * will block incoming traffic and can result in Pdus being dropped by
  355. * the hardware.
  356. *
  357. * This should be used to control when received pdus are handed off from
  358. * the hardware to Aal users from a particluar stream. The function can
  359. * be used from a timer context, or can be registered as a callback in
  360. * response to an rx stream threshold event, or can be used inside an
  361. * active polling mechanism which is under user control.
  362. *
  363. * @note - The signature of this function is directly compatible with the
  364. * callback prototype which can be register with @a ixAtmdAccRxDispatcherRegister().
  365. *
  366. * @sa ixAtmdAccRxDispatcherRegister
  367. * @sa IxAtmdAccRxVcRxCallback
  368. * @sa ixAtmdAccRxVcFreeEntriesQuery
  369. *
  370. * @param rxQueueId @ref IxAtmRxQueueId [in] - indicates which RX queue to process.
  371. * @param numberOfPdusToProcess unsigned int [in] - indicates the maxiumum number of PDU to
  372. * remove from the RX queue. A value of IX_ATMDACC_ALLPDUS indicates
  373. * to process all PDUs from the queue. This includes at least the PDUs
  374. * in the queue when the fuction is invoked. Because of real-time
  375. * constraints, there is no guarantee thatthe queue will be empty
  376. * when the function exits. If this parameter is greater than the
  377. * number of entries of the queues, the function will succeed
  378. * and the parameter numberOfPdusProcessedPtr will reflect the exact
  379. * number of PDUs processed.
  380. * @param *numberOfPdusProcessedPtr unsigned int [out] - indicates the actual number of PDU
  381. * processed during this call. This parameter cannot be a null
  382. * pointer.
  383. *
  384. * @return @li IX_SUCCESS the number of PDUs as indicated in
  385. * numberOfPdusProcessedPtr are removed from the RX queue and the VC callback
  386. * are called.
  387. * @return @li IX_FAIL invalid parameters or some unspecified internal
  388. * error occured.
  389. *
  390. */
  391. PUBLIC IX_STATUS ixAtmdAccRxDispatch (IxAtmRxQueueId rxQueueId,
  392. unsigned int numberOfPdusToProcess,
  393. unsigned int *numberOfPdusProcessedPtr);
  394. /**
  395. *
  396. * @ingroup IxAtmdAccCtrlAPI
  397. *
  398. * @fn ixAtmdAccRxLevelQuery (IxAtmRxQueueId rxQueueId,
  399. unsigned int *numberOfPdusPtr)
  400. *
  401. * @brief Query the number of entries in a particular RX queue.
  402. *
  403. * This function is used to retrieve the number of pdus received by
  404. * the hardware and ready for distribution to users.
  405. *
  406. * @param rxQueueId @ref IxAtmRxQueueId [in] - indicates which of two RX queues to query.
  407. * @param numberOfPdusPtr unsigned int* [out] - Pointer to store the number of available
  408. * PDUs in the RX queue. This parameter cannot be a null pointer.
  409. *
  410. * @return @li IX_SUCCESS the value in numberOfPdusPtr specifies the
  411. * number of incoming pdus waiting in this queue
  412. * @return @li IX_FAIL an error occurs during processing.
  413. * The value in numberOfPdusPtr is unspecified.
  414. *
  415. * @note - This function is reentrant, doesn't use system resources
  416. * and can be used from an interrupt context.
  417. *
  418. */
  419. PUBLIC IX_STATUS ixAtmdAccRxLevelQuery (IxAtmRxQueueId rxQueueId,
  420. unsigned int *numberOfPdusPtr);
  421. /**
  422. *
  423. * @ingroup IxAtmdAccCtrlAPI
  424. *
  425. * @fn ixAtmdAccRxQueueSizeQuery (IxAtmRxQueueId rxQueueId,
  426. unsigned int *numberOfPdusPtr)
  427. *
  428. * @brief Query the size of a particular RX queue.
  429. *
  430. * This function is used to retrieve the number of pdus the system is
  431. * able to queue when reception is complete.
  432. *
  433. * @param rxQueueId @ref IxAtmRxQueueId [in] - indicates which of two RX queues to query.
  434. * @param numberOfPdusPtr unsigned int* [out] - Pointer to store the number of pdus
  435. * the system is able to queue in the RX queue. This parameter
  436. * cannot be a null pointer.
  437. *
  438. * @return @li IX_SUCCESS the value in numberOfPdusPtr specifies the
  439. * number of pdus the system is able to queue.
  440. * @return @li IX_FAIL an error occurs during processing.
  441. * The value in numberOfPdusPtr is unspecified.
  442. *
  443. * @note - This function is reentrant, doesn't use system resources
  444. * and can be used from an interrupt context.
  445. *
  446. */
  447. PUBLIC IX_STATUS ixAtmdAccRxQueueSizeQuery (IxAtmRxQueueId rxQueueId,
  448. unsigned int *numberOfPdusPtr);
  449. /* ------------------------------------------------------
  450. Part of the IxAtmdAcc interface related to TX traffic
  451. ------------------------------------------------------ */
  452. /**
  453. *
  454. * @ingroup IxAtmdAccCtrlAPI
  455. *
  456. * @fn ixAtmdAccPortTxFreeEntriesQuery (IxAtmLogicalPort port,
  457. unsigned int *numberOfCellsPtr)
  458. *
  459. * @brief Get the number of available cells the system can accept for
  460. * transmission.
  461. *
  462. * The function is used to retrieve the number of cells that can be
  463. * queued for transmission to the hardware.
  464. *
  465. * This number is based on the worst schedule table where one cell
  466. * is stored in one schedule table entry, depending on the pdus size
  467. * and mbuf size and fragmentation.
  468. *
  469. * This function doesn't use system resources and can be used from a
  470. * timer context, or can be associated with a threshold event, or can
  471. * be used inside an active polling mechanism
  472. *
  473. * @param port @ref IxAtmLogicalPort [in] - logical PHY port [@a IX_UTOPIA_PORT_0 .. @a IX_UTOPIA_MAX_PORTS - 1]
  474. * @param numberOfCellsPtr unsigned int* [out] - number of available cells.
  475. * This parameter cannot be a null pointer.
  476. *
  477. * @sa ixAtmdAccPortTxProcess
  478. *
  479. * @return @li IX_SUCCESS numberOfCellsPtr contains the number of cells that can be scheduled
  480. * for this port.
  481. * @return @li IX_FAIL error in the parameters, or some processing error
  482. * occured.
  483. *
  484. */
  485. PUBLIC IX_STATUS ixAtmdAccPortTxFreeEntriesQuery (IxAtmLogicalPort port,
  486. unsigned int *numberOfCellsPtr);
  487. /**
  488. *
  489. * @ingroup IxAtmdAccCtrlAPI
  490. *
  491. * @fn ixAtmdAccPortTxCallbackRegister (IxAtmLogicalPort port,
  492. unsigned int numberOfCells,
  493. IxAtmdAccPortTxLowCallback callback)
  494. *
  495. * @brief Configure the Tx port threshold value and register a callback to handle
  496. * threshold notifications.
  497. *
  498. * This function sets the threshold in cells
  499. *
  500. * @sa ixAtmdAccPortTxCallbackRegister
  501. * @sa ixAtmdAccPortTxProcess
  502. * @sa ixAtmdAccPortTxFreeEntriesQuery
  503. *
  504. * @param port @ref IxAtmLogicalPort [in] - logical PHY port [@a IX_UTOPIA_PORT_0 .. @a IX_UTOPIA_MAX_PORTS - 1]
  505. * @param numberOfCells unsigned int [in] - threshold value which triggers the callback
  506. * invocation, This number has to be one of the
  507. * values 0,1,2,4,8,16,32 ....
  508. * The maximum value cannot be more than half of the txVc queue
  509. * size (which can be retrieved using @a ixAtmdAccPortTxFreeEntriesQuery()
  510. * before any Tx traffic is sent for this port)
  511. * @param callback @ref IxAtmdAccPortTxLowCallback [in] - callback function to invoke when the threshold
  512. * level is reached.
  513. * This parameter cannot be a null pointer.
  514. *
  515. * @return @li IX_SUCCESS Successful call to @a ixAtmdAccPortTxCallbackRegister()
  516. * @return @li IX_FAIL error in the parameters, Tx channel already set for this port
  517. * threshold level is not correct or within the range regarding the
  518. * queue size:or unspecified error during processing:
  519. *
  520. * @note - This callback function get called when the threshold level drops from
  521. * (numberOfCells+1) cells to (numberOfCells) cells
  522. *
  523. * @note - This function should be called during system initialisation,
  524. * outside an interrupt context
  525. *
  526. */
  527. PUBLIC IX_STATUS ixAtmdAccPortTxCallbackRegister (IxAtmLogicalPort port,
  528. unsigned int numberOfCells,
  529. IxAtmdAccPortTxLowCallback callback);
  530. /**
  531. *
  532. * @ingroup IxAtmdAccCtrlAPI
  533. *
  534. * @fn ixAtmdAccPortTxScheduledModeEnable (IxAtmLogicalPort port,
  535. IxAtmdAccTxVcDemandUpdateCallback vcDemandUpdateCallback,
  536. IxAtmdAccTxVcDemandClearCallback vcDemandClearCallback,
  537. IxAtmdAccTxSchVcIdGetCallback vcIdGetCallback)
  538. *
  539. * @brief Put the port into Scheduled Mode
  540. *
  541. * This function puts the specified port into scheduled mode of
  542. * transmission which means an external s/w entity controls the
  543. * transmission of cells on this port. This faciltates traffic shaping on
  544. * the port.
  545. *
  546. * Any buffers submitted on a VC for this port will be queued in IxAtmdAcc.
  547. * The transmission of these buffers to and by the hardware will be driven
  548. * by a transmit schedule submitted regulary in calls to
  549. * @a ixAtmdAccPortTxProcess() by traffic shaping entity.
  550. *
  551. * The transmit schedule is expected to be dynamic in nature based on
  552. * the demand in cells for each VC on the port. Hence the callback
  553. * parameters provided to this function allow IxAtmdAcc to inform the
  554. * shaping entity of demand changes for each VC on the port.
  555. *
  556. * By default a port is in Unscheduled Mode so if this function is not
  557. * called, transmission of data is done without sheduling rules, on a
  558. * first-come, first-out basis.
  559. *
  560. * Once a port is put in scheduled mode it cannot be reverted to
  561. * un-scheduled mode. Note that unscheduled mode is not supported
  562. * in ixp425 1.0
  563. *
  564. * @note - This function should be called before any VCs have be
  565. * connected on a port. Otherwise this function call will return failure.
  566. *
  567. * @note - This function uses internal locks and should not be called from
  568. * an interrupt context
  569. *
  570. * @sa IxAtmdAccTxVcDemandUpdateCallback
  571. * @sa IxAtmdAccTxVcDemandClearCallback
  572. * @sa IxAtmdAccTxSchVcIdGetCallback
  573. * @sa ixAtmdAccPortTxProcess
  574. *
  575. * @param port @ref IxAtmLogicalPort [in] - logical PHY port [@a IX_UTOPIA_PORT_0 .. @a IX_UTOPIA_MAX_PORTS - 1]
  576. * @param vcDemandUpdateCallback @ref IxAtmdAccTxVcDemandUpdateCallback [in] - callback function used to update
  577. * the number of outstanding cells for transmission. This parameter
  578. * cannot be a null pointer.
  579. * @param vcDemandClearCallback @ref IxAtmdAccTxVcDemandClearCallback [in] - callback function used to remove all
  580. * clear the number of outstanding cells for a VC. This parameter
  581. * cannot be a null pointer.
  582. * @param vcIdGetCallback @ref IxAtmdAccTxSchVcIdGetCallback [in] - callback function used to exchange vc
  583. * Identifiers between IxAtmdAcc and the entity supplying the
  584. * transmit schedule. This parameter cannot be a null pointer.
  585. *
  586. * @return @li IX_SUCCESS scheduler registration is complete and the port
  587. * is now in scheduled mode.
  588. * @return @li IX_FAIL failed (wrong parameters, or traffic is already
  589. * enabled on this port, possibly without ATM shaping)
  590. *
  591. */
  592. PUBLIC IX_STATUS ixAtmdAccPortTxScheduledModeEnable (IxAtmLogicalPort port,
  593. IxAtmdAccTxVcDemandUpdateCallback vcDemandUpdateCallback,
  594. IxAtmdAccTxVcDemandClearCallback vcDemandClearCallback,
  595. IxAtmdAccTxSchVcIdGetCallback vcIdGetCallback);
  596. /**
  597. *
  598. * @ingroup IxAtmdAccCtrlAPI
  599. *
  600. * @fn ixAtmdAccPortTxProcess (IxAtmLogicalPort port,
  601. IxAtmScheduleTable* scheduleTablePtr)
  602. *
  603. * @brief Transmit queue cells to the H/W based on the supplied schedule
  604. * table.
  605. *
  606. * This function @a ixAtmdAccPortTxProcess() process the schedule
  607. * table provided as a parameter to the function. As a result cells are
  608. * sent to the underlaying hardware for transmission.
  609. *
  610. * The schedule table is executed in its entirety or not at all. So the
  611. * onus is on the caller not to submit a table containing more cells than
  612. * can be transmitted at that point. The maximum numbers that can be
  613. * transmitted is guaranteed to be the number of cells as returned by the
  614. * function @a ixAtmdAccPortTxFreeEntriesQuery().
  615. *
  616. * When the scheduler is invoked on a threshold level, IxAtmdAcc gives the
  617. * minimum number of cells (to ensure the callback will fire again later)
  618. * and the maximum number of cells that @a ixAtmdAccPortTxProcess()
  619. * will be able to process (assuming the ATM scheduler is able
  620. * to produce the worst-case schedule table, i.e. one entry per cell).
  621. *
  622. * When invoked ouside a threshold level, the overall number of cells of
  623. * the schedule table should be less than the number of cells returned
  624. * by the @a ixAtmdAccPortTxFreeEntriesQuery() function.
  625. *
  626. * After invoking the @a ixAtmdAccPortTxProcess() function, it is the
  627. * user choice to query again the queue level with the function
  628. * @a ixAtmdAccPortTxFreeEntriesQuery() and, depending on a new cell
  629. * number, submit an other schedule table.
  630. *
  631. * IxAtmdAcc will check that the number of cells in the schedule table
  632. * is compatible with the current transmit level. If the
  633. *
  634. * Obsolete or invalid connection Id will be silently discarded.
  635. *
  636. * This function is not reentrant for the same port.
  637. *
  638. * This functions doesn't use system resources and can be used inside an
  639. * interrupt context.
  640. *
  641. * This function is used as a response to the hardware requesting more
  642. * cells to transmit.
  643. *
  644. * @sa ixAtmdAccPortTxScheduledModeEnable
  645. * @sa ixAtmdAccPortTxFreeEntriesQuery
  646. * @sa ixAtmdAccPortTxCallbackRegister
  647. * @sa ixAtmdAccPortEnable
  648. *
  649. * @param port @ref IxAtmLogicalPort [in] - logical PHY port [@a IX_UTOPIA_PORT_0 .. @a IX_UTOPIA_MAX_PORTS - 1]
  650. * @param scheduleTablePtr @ref IxAtmScheduleTable* [in] - pointer to a scheduler update table. The
  651. * content of this table is not modified by this function. This
  652. * parameter cannot be a null pointer.
  653. *
  654. * @return @li IX_SUCCESS the schedule table process is complete
  655. * and cells are transmitted to the hardware
  656. * @return @li IX_ATMDACC_WARNING : Traffic will be dropped: the schedule table exceed
  657. * the hardware capacity If this error is ignored, further traffic
  658. * and schedule will work correctly.
  659. * Overscheduling does not occur when the schedule table does
  660. * not contain more entries that the number of free entries returned
  661. * by @a ixAtmdAccPortTxFreeEntriesQuery().
  662. * However, Disconnect attempts just after this error will fail permanently
  663. * with the error code @a IX_ATMDACC_RESOURCES_STILL_ALLOCATED, and it is
  664. * necessary to disable the port to make @a ixAtmdAccTxVcTryDisconnect()
  665. * successful.
  666. * @return @li IX_FAIL a wrong parameter is supplied, or the format of
  667. * the schedule table is invalid, or the port is not Enabled, or
  668. * an internal severe error occured. No cells is transmitted to the hardware
  669. *
  670. * @note - If the failure is linked to an overschedule of data cells
  671. * the result is an inconsistency in the output traffic (one or many
  672. * cells may be missing and the traffic contract is not respected).
  673. *
  674. */
  675. PUBLIC IX_STATUS ixAtmdAccPortTxProcess (IxAtmLogicalPort port,
  676. IxAtmScheduleTable* scheduleTablePtr);
  677. /**
  678. *
  679. * @ingroup IxAtmdAccCtrlAPI
  680. *
  681. * @fn ixAtmdAccTxDoneDispatch (unsigned int numberOfPdusToProcess,
  682. unsigned int *numberOfPdusProcessedPtr)
  683. *
  684. * @brief Process a number of pending transmit done pdus from the hardware.
  685. *
  686. * As a by-product of Atm transmit operation buffers which transmission
  687. * is complete need to be recycled to users. This function is invoked
  688. * to service the oustanding list of transmitted buffers and pass them
  689. * to VC users.
  690. *
  691. * Users are handed back pdus by invoking the free callback registered
  692. * during the @a ixAtmdAccTxVcConnect() call.
  693. *
  694. * There is a single Tx done stream servicing all active Atm Tx ports
  695. * which can contain a maximum of 64 entries. If this stream fills port
  696. * transmission will stop so this function must be call sufficently
  697. * frequently to ensure no disruption to the transmit operation.
  698. *
  699. * This function can be used from a timer context, or can be associated
  700. * with a TxDone level threshold event (see @a ixAtmdAccTxDoneDispatcherRegister() ),
  701. * or can be used inside an active polling mechanism under user control.
  702. *
  703. * For ease of use the signature of this function is compatible with the
  704. * TxDone threshold event callback prototype.
  705. *
  706. * This functions can be used inside an interrupt context.
  707. *
  708. * @sa ixAtmdAccTxDoneDispatcherRegister
  709. * @sa IxAtmdAccTxVcBufferReturnCallback
  710. * @sa ixAtmdAccTxDoneLevelQuery
  711. *
  712. * @param numberOfPdusToProcess unsigned int [in] - maxiumum number of pdus to remove
  713. * from the TX Done queue
  714. * @param *numberOfPdusProcessedPtr unsigned int [out] - number of pdus removed from
  715. * the TX Done queue. This parameter cannot be a null pointer.
  716. *
  717. * @return @li IX_SUCCESS the number of pdus as indicated in
  718. * numberOfPdusToProcess are removed from the TX Done hardware
  719. * and passed to the user through the Tx Done callback registered
  720. * during a call to @a ixAtmdAccTxVcConnect()
  721. * @return @li IX_FAIL invalid parameters or numberOfPdusProcessedPtr is
  722. * a null pointer or some unspecified internal error occured.
  723. *
  724. */
  725. PUBLIC IX_STATUS
  726. ixAtmdAccTxDoneDispatch (unsigned int numberOfPdusToProcess,
  727. unsigned int *numberOfPdusProcessedPtr);
  728. /**
  729. *
  730. * @ingroup IxAtmdAccCtrlAPI
  731. *
  732. * @fn ixAtmdAccTxDoneLevelQuery (unsigned int *numberOfPdusPtr)
  733. *
  734. * @brief Query the current number of transmit pdus ready for
  735. * recycling.
  736. *
  737. * This function is used to get the number of transmitted pdus which
  738. * the hardware is ready to hand back to user.
  739. *
  740. * This function can be used from a timer context, or can be associated
  741. * with a threshold event, on can be used inside an active polling
  742. * mechanism
  743. *
  744. * @sa ixAtmdAccTxDoneDispatch
  745. *
  746. * @param *numberOfPdusPtr unsigned int [out] - Pointer to the number of pdus transmitted
  747. * at the time of this function call, and ready for recycling
  748. * This parameter cannot be a null pointer.
  749. *
  750. * @return @li IX_SUCCESS numberOfPdusPtr contains the number of pdus
  751. * ready for recycling at the time of this function call
  752. *
  753. * @return @li IX_FAIL wrong parameter (null pointer as parameter).or
  754. * unspecified rocessing error occurs..The value in numberOfPdusPtr
  755. * is unspecified.
  756. *
  757. */
  758. PUBLIC IX_STATUS
  759. ixAtmdAccTxDoneLevelQuery (unsigned int *numberOfPdusPtr);
  760. /**
  761. *
  762. * @ingroup IxAtmdAccCtrlAPI
  763. *
  764. * @fn ixAtmdAccTxDoneQueueSizeQuery (unsigned int *numberOfPdusPtr)
  765. *
  766. * @brief Query the TxDone queue size.
  767. *
  768. * This function is used to get the number of pdus which
  769. * the hardware is able to store after transmission is complete
  770. *
  771. * The returned value can be used to set a threshold and enable
  772. * a callback to be notified when the number of pdus is going over
  773. * the threshold.
  774. *
  775. * @sa ixAtmdAccTxDoneDispatcherRegister
  776. *
  777. * @param *numberOfPdusPtr unsigned int [out] - Pointer to the number of pdus the system
  778. * is able to queue after transmission
  779. *
  780. * @return @li IX_SUCCESS numberOfPdusPtr contains the the number of
  781. * pdus the system is able to queue after transmission
  782. * @return @li IX_FAIL wrong parameter (null pointer as parameter).or
  783. * unspecified rocessing error occurs..The value in numberOfPdusPtr
  784. * is unspecified.
  785. *
  786. * @note - This function is reentrant, doesn't use system resources
  787. * and can be used from an interrupt context.
  788. */
  789. PUBLIC IX_STATUS
  790. ixAtmdAccTxDoneQueueSizeQuery (unsigned int *numberOfPdusPtr);
  791. /**
  792. *
  793. * @ingroup IxAtmdAccCtrlAPI
  794. *
  795. * @fn ixAtmdAccTxDoneDispatcherRegister (unsigned int numberOfPdus,
  796. IxAtmdAccTxDoneDispatcher notificationCallback)
  797. *
  798. * @brief Configure the Tx Done stream threshold value and register a
  799. * callback to handle threshold notifications.
  800. *
  801. * This function sets the threshold level in term of number of pdus at
  802. * which the supplied notification function should be called.
  803. *
  804. * The higher the threshold value is, the less events will be necessary
  805. * to process transmitted buffers.
  806. *
  807. * Transmitted buffers recycling implementation is a sytem-wide mechanism
  808. * and needs to be set prior any traffic is started. If this threshold
  809. * mechanism is not used, the user is responsible for polling the
  810. * transmitted buffers thanks to @a ixAtmdAccTxDoneDispatch() and
  811. * @a ixAtmdAccTxDoneLevelQuery() functions.
  812. *
  813. * This function should be called during system initialisation outside
  814. * an interrupt context
  815. *
  816. * @sa ixAtmdAccTxDoneDispatcherRegister
  817. * @sa ixAtmdAccTxDoneDispatch
  818. * @sa ixAtmdAccTxDoneLevelQuery
  819. *
  820. * @param numberOfPdus unsigned int [in] - The number of TxDone pdus which triggers the
  821. * callback invocation This number has to be a power of 2, one of the
  822. * values 0,1,2,4,8,16,32 ...
  823. * The maximum value cannot be more than half of the txDone queue
  824. * size (which can be retrieved using @a ixAtmdAccTxDoneQueueSizeQuery())
  825. * @param notificationCallback @ref IxAtmdAccTxDoneDispatcher [in] - The function to invoke. (This
  826. * parameter can be @a ixAtmdAccTxDoneDispatch()).This
  827. * parameter ust not be a null pointer.
  828. *
  829. * @return @li IX_SUCCESS Successful call to ixAtmdAccTxDoneDispatcherRegister
  830. * @return @li IX_FAIL error in the parameters:
  831. *
  832. * @note - The notificationCallback will be called exactly when the threshold level
  833. * will increase from (numberOfPdus) to (numberOfPdus+1)
  834. *
  835. * @note - If there is no Tx traffic, there is no guarantee that TxDone Pdus will
  836. * be released to the user (when txDone level is permanently under the threshold
  837. * level. One of the preffered way to return resources to the user is to use
  838. * a mix of txDone notifications, used together with a slow
  839. * rate timer and an exclusion mechanism protecting from re-entrancy
  840. *
  841. * @note - The TxDone threshold will only hand back buffers when the threshold level is
  842. * crossed. Setting this threshold to a great number reduce the interrupt rate
  843. * and the cpu load, but also increase the number of outstanding mbufs and has
  844. * a system wide impact when these mbufs are needed by other components.
  845. *
  846. */
  847. PUBLIC IX_STATUS ixAtmdAccTxDoneDispatcherRegister (unsigned int numberOfPdus,
  848. IxAtmdAccTxDoneDispatcher notificationCallback);
  849. /* ------------------------------------------------------
  850. Part of the IxAtmdAcc interface related to Utopia config
  851. ------------------------------------------------------ */
  852. /**
  853. *
  854. * @ingroup IxAtmdAccCtrlAPI
  855. *
  856. * @defgroup IxAtmdAccUtopiaCtrlAPI IXP400 ATM Driver Access (IxAtmdAcc) Utopia Control API
  857. *
  858. * @brief The public API for the IXP400 Atm Driver Control component
  859. *
  860. * IxAtmdAcc is the low level interface by which AAL PDU get
  861. * transmitted to,and received from the Utopia bus
  862. *
  863. * This part is related to the UTOPIA configuration.
  864. *
  865. * @{
  866. */
  867. /**
  868. *
  869. * @brief Utopia configuration
  870. *
  871. * This structure is used to set the Utopia parameters
  872. * @li contains the values of Utopia registers, to be set during initialisation
  873. * @li contains debug commands for NPE, to be used during development steps
  874. *
  875. * @note - the exact description of all parameters is done in the Utopia reference
  876. * documents.
  877. *
  878. */
  879. typedef struct
  880. {
  881. /**
  882. * @ingroup IxAtmdAccUtopiaCtrlAPI
  883. * @struct UtTxConfig_
  884. * @brief Utopia Tx Config Register
  885. */
  886. struct UtTxConfig_
  887. {
  888. unsigned int reserved_1:1; /**< [31] These bits are always 0.*/
  889. unsigned int txInterface:1; /**< [30] Utopia Transmit Interface. The following encoding
  890. * is used to set the Utopia Transmit interface as ATM master
  891. * or PHY slave:
  892. * @li 1 - PHY
  893. * @li 0 - ATM
  894. */
  895. unsigned int txMode:1; /**< [29] Utopia Transmit Mode. The following encoding is used
  896. * to set the Utopia Transmit mode to SPHY or MPHY:
  897. * @li 1 - SPHY
  898. * @li 0 - MPHY
  899. */
  900. unsigned int txOctet:1; /**< [28] Utopia Transmit cell transfer protocol. Used to set
  901. * the Utopia cell transfer protocol to Octet-level handshaking.
  902. * Note this is only applicable in SPHY mode.
  903. * @li 1 - Octet-handshaking enabled
  904. * @li 0 - Cell-handshaking enabled
  905. */
  906. unsigned int txParity:1; /**< [27] Utopia Transmit parity enabled when set. TxEvenParity
  907. * defines the parity format odd/even.
  908. * @li 1 - Enable Parity generation.
  909. * @li 0 - ut_op_prty held low.
  910. */
  911. unsigned int txEvenParity:1; /**< [26] Utopia Transmit Parity Mode
  912. * @li 1 - Even Parity Generated.
  913. * @li 0 - Odd Parity Generated.
  914. */
  915. unsigned int txHEC:1; /**< [25] Header Error Check Insertion Mode. Specifies if the transmit
  916. * cell header check byte is calculated and inserted when set.
  917. * @li 1 - Generate HEC.
  918. * @li 0 - Disable HEC generation.
  919. */
  920. unsigned int txCOSET:1; /**< [24] If enabled the HEC is Exclusive-OR'ed with the value 0x55 before
  921. * being presented on the Utopia bus.
  922. * @li 1 - Enable HEC ExOR with value 0x55
  923. * @li 0 - Use generated HEC value.
  924. */
  925. unsigned int reserved_2:1; /**< [23] These bits are always 0
  926. */
  927. unsigned int txCellSize:7; /**< [22:16] Transmit expected cell size. Configures the cell size
  928. * for the transmit module: Values between 52-64 are valid.
  929. */
  930. unsigned int reserved_3:3; /**< [15:13] These bits are always 0 */
  931. unsigned int txAddrRange:5; /**< [12:8] When configured as an ATM master in MPHY mode this
  932. * register specifies the upper limit of the PHY polling logical
  933. * range. The number of active PHYs are TxAddrRange + 1.
  934. */
  935. unsigned int reserved_4:3; /**< [7:5] These bits are always 0 */
  936. unsigned int txPHYAddr:5; /**< [4:0] When configured as a slave in an MPHY system this register
  937. * specifies the physical address of the PHY.
  938. */
  939. }
  940. utTxConfig; /**< Tx config Utopia register */
  941. /**
  942. * @ingroup IxAtmdAccUtopiaCtrlAPI
  943. * @struct UtTxStatsConfig_
  944. * @brief Utopia Tx stats Register
  945. */
  946. struct UtTxStatsConfig_
  947. {
  948. unsigned int vpi:12; /**< [31:20] ATM VPI [11:0] OR GFC [3:0] and VPI [7:0]
  949. @li Note: if VCStatsTxGFC is set to 0 the GFC field is ignored in test. */
  950. unsigned int vci:16; /**< [19:4] ATM VCI [15:0] or PHY Address[4] */
  951. unsigned int pti:3; /**< [3:1] ATM PTI [2:0] or PHY Address[3:1]
  952. @li Note: if VCStatsTxPTI is set to 0 the PTI field is ignored in test.
  953. @li Note: if VCStatsTxEnb is set to 0 only the transmit PHY port
  954. address as defined by this register is used for ATM statistics [4:0]. */
  955. unsigned int clp:1; /**< [0] ATM CLP or PHY Address [0]
  956. @li Note: if VCStatsTxCLP is set to 0 the CLP field is ignored in test.
  957. @li Note: if VCStatsTxEnb is set to 0 only the transmit PHY port
  958. address as defined by this register is used for ATM statistics [4:0]. */
  959. }
  960. utTxStatsConfig; /**< Tx stats config Utopia register */
  961. /**
  962. * @ingroup IxAtmdAccUtopiaCtrlAPI
  963. * @struct UtTxDefineIdle_
  964. * @brief Utopia Tx idle cells Register
  965. */
  966. struct UtTxDefineIdle_
  967. {
  968. unsigned int vpi:12; /**< [31:20] ATM VPI [11:0] OR GFC [3:0] and VPI [7:0]
  969. @li Note: if VCIdleTxGFC is set to 0 the GFC field is ignored in test. */
  970. unsigned int vci:16; /**< [19:4] ATM VCI [15:0] */
  971. unsigned int pti:3; /**< [3:1] ATM PTI PTI [2:0]
  972. @li Note: if VCIdleTxPTI is set to 0 the PTI field is ignored in test.*/
  973. unsigned int clp:1; /**< [0] ATM CLP [0]
  974. @li Note: if VCIdleTxCLP is set to 0 the CLP field is ignored in test.*/
  975. }
  976. utTxDefineIdle; /**< Tx idle cell config Utopia register */
  977. /**
  978. * @ingroup IxAtmdAccUtopiaCtrlAPI
  979. * @struct UtTxEnableFields_
  980. * @brief Utopia Tx ienable fields Register
  981. */
  982. struct UtTxEnableFields_
  983. {
  984. unsigned int defineTxIdleGFC:1; /**< [31] This register is used to include or exclude the GFC
  985. field of the ATM header when testing for Idle cells.
  986. @li 1 - GFC field is valid.
  987. @li 0 - GFC field ignored.*/
  988. unsigned int defineTxIdlePTI:1; /**< [30] This register is used to include or exclude the PTI
  989. field of the ATM header when testing for Idle cells.
  990. @li 1 - PTI field is valid
  991. @li 0 - PTI field ignored.*/
  992. unsigned int defineTxIdleCLP:1; /**< [29] This register is used to include or
  993. exclude the CLP field of the ATM header when testing for Idle cells.
  994. @li 1 - CLP field is valid.
  995. @li 0 - CLP field ignored. */
  996. unsigned int phyStatsTxEnb:1; /**< [28] This register is used to enable or disable ATM
  997. statistics gathering based on the specified PHY address as defined
  998. in TxStatsConfig register.
  999. @li 1 - Enable statistics for specified transmit PHY address.
  1000. @li 0 - Disable statistics for specified transmit PHY address. */
  1001. unsigned int vcStatsTxEnb:1; /**< [27] This register is used to change the ATM
  1002. statistics-gathering mode from the specified logical PHY address
  1003. to a specific VPI/VCI address.
  1004. @li 1 - Enable statistics for specified VPI/VCI address.
  1005. @li 0 - Disable statistics for specified VPI/VCI address */
  1006. unsigned int vcStatsTxGFC:1; /**< [26] This register is used to include or exclude the GFC
  1007. field of the ATM header when ATM VPI/VCI statistics are enabled.
  1008. GFC is only available at the UNI and uses the first 4-bits of
  1009. the VPI field.
  1010. @li 1 - GFC field is valid
  1011. @li 0 - GFC field ignored.*/
  1012. unsigned int vcStatsTxPTI:1; /**< [25] This register is used to include or exclude the PTI
  1013. field of the ATM header when ATM VPI/VCI statistics are enabled.
  1014. @li 1 - PTI field is valid
  1015. @li 0 - PTI field ignored.*/
  1016. unsigned int vcStatsTxCLP:1; /**< [24] This register is used to include or exclude the CLP
  1017. field of the ATM header when ATM VPI/VCI statistics are enabled.
  1018. @li 1 - CLP field is valid
  1019. @li 0 - CLP field ignored. */
  1020. unsigned int reserved_1:3; /**< [23-21] These bits are always 0 */
  1021. unsigned int txPollStsInt:1; /**< [20] Enable the assertion of the ucp_tx_poll_sts condition
  1022. where there is a change in polling status.
  1023. @li 1 - ucp_tx_poll_sts asserted whenever there is a change in status
  1024. @li 0 - ucp_tx_poll_sts asserted if ANY transmit PHY is available
  1025. */
  1026. unsigned int txCellOvrInt:1; /**< [19] Enable TxCellCount overflow CBI Transmit Status condition
  1027. assertion.
  1028. @li 1 - If TxCellCountOvr is set assert the Transmit Status Condition.
  1029. @li 0 - No CBI Transmit Status condition assertion */
  1030. unsigned int txIdleCellOvrInt:1; /**< [18] Enable TxIdleCellCount overflow Transmit Status Condition
  1031. @li 1 - If TxIdleCellCountOvr is set assert the Transmit Status Condition
  1032. @li 0 - No CBI Transmit Status condition assertion..*/
  1033. unsigned int enbIdleCellCnt:1; /**< [17] Enable Transmit Idle Cell Count.
  1034. @li 1 - Enable count of Idle cells transmitted.
  1035. @li 0 - No count is maintained. */
  1036. unsigned int enbTxCellCnt:1; /**< [16] Enable Transmit Valid Cell Count of non-idle/non-error cells
  1037. @li 1 - Enable count of valid cells transmitted- non-idle/non-error
  1038. @li 0 - No count is maintained.*/
  1039. unsigned int reserved_2:16; /**< [15:0] These bits are always 0 */
  1040. } utTxEnableFields; /**< Tx enable Utopia register */
  1041. /**
  1042. * @ingroup IxAtmdAccUtopiaCtrlAPI
  1043. * @struct UtTxTransTable0_
  1044. * @brief Utopia Tx translation table Register
  1045. */
  1046. struct UtTxTransTable0_
  1047. {
  1048. unsigned int phy0:5; /**< [31-27] Tx Mapping value of logical phy 0 */
  1049. unsigned int phy1:5; /**< [26-22] Tx Mapping value of logical phy 1 */
  1050. unsigned int phy2:5; /**< [21-17] Tx Mapping value of logical phy 2 */
  1051. unsigned int reserved_1:1; /**< [16] These bits are always 0.*/
  1052. unsigned int phy3:5; /**< [15-11] Tx Mapping value of logical phy 3 */
  1053. unsigned int phy4:5; /**< [10-6] Tx Mapping value of logical phy 4 */
  1054. unsigned int phy5:5; /**< [5-1] Tx Mapping value of logical phy 5 */
  1055. unsigned int reserved_2:1; /**< [0] These bits are always 0 */
  1056. } utTxTransTable0; /**< Tx translation table */
  1057. /**
  1058. * @ingroup IxAtmdAccUtopiaCtrlAPI
  1059. * @struct UtTxTransTable1_
  1060. * @brief Utopia Tx translation table Register
  1061. */
  1062. struct UtTxTransTable1_
  1063. {
  1064. unsigned int phy6:5; /**< [31-27] Tx Mapping value of logical phy 6 */
  1065. unsigned int phy7:5; /**< [26-22] Tx Mapping value of logical phy 7 */
  1066. unsigned int phy8:5; /**< [21-17] Tx Mapping value of logical phy 8 */
  1067. unsigned int reserved_1:1; /**< [16-0] These bits are always 0 */
  1068. unsigned int phy9:5; /**< [15-11] Tx Mapping value of logical phy 3 */
  1069. unsigned int phy10:5; /**< [10-6] Tx Mapping value of logical phy 4 */
  1070. unsigned int phy11:5; /**< [5-1] Tx Mapping value of logical phy 5 */
  1071. unsigned int reserved_2:1; /**< [0] These bits are always 0 */
  1072. } utTxTransTable1; /**< Tx translation table */
  1073. /**
  1074. * @ingroup IxAtmdAccUtopiaCtrlAPI
  1075. * @struct UtTxTransTable2_
  1076. * @brief Utopia Tx translation table Register
  1077. */
  1078. struct UtTxTransTable2_
  1079. {
  1080. unsigned int phy12:5; /**< [31-27] Tx Mapping value of logical phy 6 */
  1081. unsigned int phy13:5; /**< [26-22] Tx Mapping value of logical phy 7 */
  1082. unsigned int phy14:5; /**< [21-17] Tx Mapping value of logical phy 8 */
  1083. unsigned int reserved_1:1; /**< [16-0] These bits are always 0 */
  1084. unsigned int phy15:5; /**< [15-11] Tx Mapping value of logical phy 3 */
  1085. unsigned int phy16:5; /**< [10-6] Tx Mapping value of logical phy 4 */
  1086. unsigned int phy17:5; /**< [5-1] Tx Mapping value of logical phy 5 */
  1087. unsigned int reserved_2:1; /**< [0] These bits are always 0 */
  1088. } utTxTransTable2; /**< Tx translation table */
  1089. /**
  1090. * @ingroup IxAtmdAccUtopiaCtrlAPI
  1091. * @struct UtTxTransTable3_
  1092. * @brief Utopia Tx translation table Register
  1093. */
  1094. struct UtTxTransTable3_
  1095. {
  1096. unsigned int phy18:5; /**< [31-27] Tx Mapping value of logical phy 6 */
  1097. unsigned int phy19:5; /**< [26-22] Tx Mapping value of logical phy 7 */
  1098. unsigned int phy20:5; /**< [21-17] Tx Mapping value of logical phy 8 */
  1099. unsigned int reserved_1:1; /**< [16-0] These bits are always 0 */
  1100. unsigned int phy21:5; /**< [15-11] Tx Mapping value of logical phy 3 */
  1101. unsigned int phy22:5; /**< [10-6] Tx Mapping value of logical phy 4 */
  1102. unsigned int phy23:5; /**< [5-1] Tx Mapping value of logical phy 5 */
  1103. unsigned int reserved_2:1; /**< [0] These bits are always 0 */
  1104. } utTxTransTable3; /**< Tx translation table */
  1105. /**
  1106. * @ingroup IxAtmdAccUtopiaCtrlAPI
  1107. * @struct UtTxTransTable4_
  1108. * @brief Utopia Tx translation table Register
  1109. */
  1110. struct UtTxTransTable4_
  1111. {
  1112. unsigned int phy24:5; /**< [31-27] Tx Mapping value of logical phy 6 */
  1113. unsigned int phy25:5; /**< [26-22] Tx Mapping value of logical phy 7 */
  1114. unsigned int phy26:5; /**< [21-17] Tx Mapping value of logical phy 8 */
  1115. unsigned int reserved_1:1; /**< [16-0] These bits are always 0 */
  1116. unsigned int phy27:5; /**< [15-11] Tx Mapping value of logical phy 3 */
  1117. unsigned int phy28:5; /**< [10-6] Tx Mapping value of logical phy 4 */
  1118. unsigned int phy29:5; /**< [5-1] Tx Mapping value of logical phy 5 */
  1119. unsigned int reserved_2:1; /**< [0] These bits are always 0 */
  1120. } utTxTransTable4; /**< Tx translation table */
  1121. /**
  1122. * @ingroup IxAtmdAccUtopiaCtrlAPI
  1123. * @struct UtTxTransTable5_
  1124. * @brief Utopia Tx translation table Register
  1125. */
  1126. struct UtTxTransTable5_
  1127. {
  1128. unsigned int phy30:5; /**< [31-27] Tx Mapping value of logical phy 6 */
  1129. unsigned int reserved_1:27; /**< [26-0] These bits are always 0 */
  1130. } utTxTransTable5; /**< Tx translation table */
  1131. /**
  1132. * @ingroup IxAtmdAccUtopiaCtrlAPI
  1133. * @struct UtRxConfig_
  1134. * @brief Utopia Rx config Register
  1135. */
  1136. struct UtRxConfig_
  1137. {
  1138. unsigned int rxInterface:1; /**< [31] Utopia Receive Interface. The following encoding is used
  1139. to set the Utopia Receive interface as ATM master or PHY slave:
  1140. @li 1 - PHY
  1141. @li 0 - ATM */
  1142. unsigned int rxMode:1; /**< [30] Utopia Receive Mode. The following encoding is used to set
  1143. the Utopia Receive mode to SPHY or MPHY:
  1144. @li 1 - SPHY
  1145. @li 0 - MPHY */
  1146. unsigned int rxOctet:1; /**< [29] Utopia Receive cell transfer protocol. Used to set the Utopia
  1147. cell transfer protocol to Octet-level handshaking. Note this is only
  1148. applicable in SPHY mode.
  1149. @li 1 - Octet-handshaking enabled
  1150. @li 0 - Cell-handshaking enabled */
  1151. unsigned int rxParity:1; /**< [28] Utopia Receive Parity Checking enable.
  1152. @li 1 - Parity checking enabled
  1153. @li 0 - Parity checking disabled */
  1154. unsigned int rxEvenParity:1;/**< [27] Utopia Receive Parity Mode
  1155. @li 1 - Check for Even Parity
  1156. @li 0 - Check for Odd Parity.*/
  1157. unsigned int rxHEC:1; /**< [26] RxHEC Header Error Check Mode. Enables/disables cell header
  1158. error checking on the received cell header.
  1159. @li 1 - HEC checking enabled
  1160. @li 0 - HEC checking disabled */
  1161. unsigned int rxCOSET:1; /**< [25] If enabled the HEC is Exclusive-OR'ed with the value 0x55
  1162. before being tested with the received HEC.
  1163. @li 1 - Enable HEC ExOR with value 0x55.
  1164. @li 0 - Use generated HEC value.*/
  1165. unsigned int rxHECpass:1; /**< [24] Specifies if the incoming cell HEC byte should be transferred
  1166. after optional processing to the NPE2 Coprocessor Bus Interface or
  1167. if it should be discarded.
  1168. @li 1 - HEC maintained 53-byte/UDC cell sent to NPE2.
  1169. @li 0 - HEC discarded 52-byte/UDC cell sent to NPE2 coprocessor.*/
  1170. unsigned int reserved_1:1; /**< [23] These bits are always 0 */
  1171. unsigned int rxCellSize:7; /**< [22:16] Receive cell size. Configures the receive cell size.
  1172. Values between 52-64 are valid */
  1173. unsigned int rxHashEnbGFC:1; /**< [15] Specifies if the VPI field [11:8]/GFC field should be
  1174. included in the Hash data input or if the bits should be padded
  1175. with 1'b0.
  1176. @li 1 - VPI [11:8]/GFC field valid and used in Hash residue calculation.
  1177. @li 0 - VPI [11:8]/GFC field padded with 1'b0 */
  1178. unsigned int rxPreHash:1; /**< [14] Enable Pre-hash value generation. Specifies if the
  1179. incoming cell data should be pre-hashed to allow VPI/VCI header look-up
  1180. in a hash table.
  1181. @li 1 - Pre-hashing enabled
  1182. @li 0 - Pre-hashing disabled */
  1183. unsigned int reserved_2:1; /**< [13] These bits are always 0 */
  1184. unsigned int rxAddrRange:5; /**< [12:8] In ATM master, MPHY mode,
  1185. * this register specifies the upper
  1186. * limit of the PHY polling logical range. The number of active PHYs are
  1187. * RxAddrRange + 1.
  1188. */
  1189. unsigned int reserved_3:3; /**< [7-5] These bits are always 0 .*/
  1190. unsigned int rxPHYAddr:5; /**< [4:0] When configured as a slave in an MPHY system this register
  1191. * specifies the physical address of the PHY.
  1192. */
  1193. } utRxConfig; /**< Rx config Utopia register */
  1194. /**
  1195. * @ingroup IxAtmdAccUtopiaCtrlAPI
  1196. * @struct UtRxStatsConfig_
  1197. * @brief Utopia Rx stats config Register
  1198. */
  1199. struct UtRxStatsConfig_
  1200. {
  1201. unsigned int vpi:12; /**< [31:20] ATM VPI VPI [11:0] OR GFC [3:0] and VPI [7:0]
  1202. @li Note: if VCStatsRxGFC is set to 0 the GFC field is ignored in test. */
  1203. unsigned int vci:16; /**< [19:4] VCI [15:0] or PHY Address [4] */
  1204. unsigned int pti:3; /**< [3:1] PTI [2:0] or or PHY Address [3:1]
  1205. @li Note: if VCStatsRxPTI is set to 0 the PTI field is ignored in test.
  1206. @li Note: if VCStatsRxEnb is set to 0 only the PHY port address is used
  1207. for statistics gathering.. */
  1208. unsigned int clp:1; /**< [0] CLP [0] or PHY Address [0]
  1209. @li Note: if VCStatsRxCLP is set to 0 the CLP field is ignored in test.
  1210. @li Note: if VCStatsRxEnb is set to 0 only the PHY port address is used
  1211. for statistics gathering.. */
  1212. } utRxStatsConfig; /**< Rx stats config Utopia register */
  1213. /**
  1214. * @ingroup IxAtmdAccUtopiaCtrlAPI
  1215. * @struct UtRxDefineIdle_
  1216. * @brief Utopia Rx idle cells config Register
  1217. */
  1218. struct UtRxDefineIdle_
  1219. {
  1220. unsigned int vpi:12; /**< [31:20] ATM VPI [11:0] OR GFC [3:0] and VPI [7:0]
  1221. @li Note: if VCIdleRxGFC is set to 0 the GFC field is ignored in test. */
  1222. unsigned int vci:16; /**< [19:4] ATM VCI [15:0] */
  1223. unsigned int pti:3; /**< [3:1] ATM PTI PTI [2:0]
  1224. @li Note: if VCIdleRxPTI is set to 0 the PTI field is ignored in test.*/
  1225. unsigned int clp:1; /**< [0] ATM CLP [0]
  1226. @li Note: if VCIdleRxCLP is set to 0 the CLP field is ignored in test.*/
  1227. } utRxDefineIdle; /**< Rx idle cell config Utopia register */
  1228. /**
  1229. * @ingroup IxAtmdAccUtopiaCtrlAPI
  1230. * @struct UtRxEnableFields_
  1231. * @brief Utopia Rx enable Register
  1232. */
  1233. struct UtRxEnableFields_
  1234. {
  1235. unsigned int defineRxIdleGFC:1;/**< [31] This register is used to include or exclude the GFC
  1236. field of the ATM header when testing for Idle cells.
  1237. @li 1 - GFC field is valid.
  1238. @li 0 - GFC field ignored.*/
  1239. unsigned int defineRxIdlePTI:1;/**< [30] This register is used to include or exclude the PTI
  1240. field of the ATM header when testing for Idle cells.
  1241. @li 1 - PTI field is valid.
  1242. @li 0 - PTI field ignored.*/
  1243. unsigned int defineRxIdleCLP:1;/**< [29] This register is used to include or exclude the CLP
  1244. field of the ATM header when testing for Idle cells.
  1245. @li 1 - CLP field is valid.
  1246. @li 0 - CLP field ignored.*/
  1247. unsigned int phyStatsRxEnb:1;/**< [28] This register is used to enable or disable ATM statistics
  1248. gathering based on the specified PHY address as defined in RxStatsConfig
  1249. register.
  1250. @li 1 - Enable statistics for specified receive PHY address.
  1251. @li 0 - Disable statistics for specified receive PHY address.*/
  1252. unsigned int vcStatsRxEnb:1;/**< [27] This register is used to enable or disable ATM statistics
  1253. gathering based on a specific VPI/VCI address.
  1254. @li 1 - Enable statistics for specified VPI/VCI address.
  1255. @li 0 - Disable statistics for specified VPI/VCI address.*/
  1256. unsigned int vcStatsRxGFC:1;/**< [26] This register is used to include or exclude the GFC field
  1257. of the ATM header when ATM VPI/VCI statistics are enabled. GFC is only
  1258. available at the UNI and uses the first 4-bits of the VPI field.
  1259. @li 1 - GFC field is valid.
  1260. @li 0 - GFC field ignored. */
  1261. unsigned int vcStatsRxPTI:1;/**< [25] This register is used to include or exclude the PTI field
  1262. of the ATM header when ATM VPI/VCI statistics are enabled.
  1263. @li 1 - PTI field is valid.
  1264. @li 0 - PTI field ignored.*/
  1265. unsigned int vcStatsRxCLP:1;/**< [24] This register is used to include or exclude the CLP field
  1266. of the ATM header when ATM VPI/VCI statistics are enabled.
  1267. @li 1 - CLP field is valid.
  1268. @li 0 - CLP field ignored. */
  1269. unsigned int discardHecErr:1;/**< [23] Discard cells with an invalid HEC.
  1270. @li 1 - Discard cells with HEC errors
  1271. @li 0 - Cells with HEC errors are passed */
  1272. unsigned int discardParErr:1;/**< [22] Discard cells containing parity errors.
  1273. @li 1 - Discard cells with parity errors
  1274. @li 0 - Cells with parity errors are passed */
  1275. unsigned int discardIdle:1; /**< [21] Discard Idle Cells based on DefineIdle register values
  1276. @li 1 - Discard IDLE cells
  1277. @li 0 - IDLE cells passed */
  1278. unsigned int enbHecErrCnt:1;/**< [20] Enable Receive HEC Error Count.
  1279. @li 1 - Enable count of received cells containing HEC errors
  1280. @li 0 - No count is maintained. */
  1281. unsigned int enbParErrCnt:1;/**< [19] Enable Parity Error Count
  1282. @li 1 - Enable count of received cells containing Parity errors
  1283. @li 0 - No count is maintained. */
  1284. unsigned int enbIdleCellCnt:1;/**< [18] Enable Receive Idle Cell Count.
  1285. @li 1 - Enable count of Idle cells received.
  1286. @li 0 - No count is maintained.*/
  1287. unsigned int enbSizeErrCnt:1;/**< [17] Enable Receive Size Error Count.
  1288. @li 1 - Enable count of received cells of incorrect size
  1289. @li 0 - No count is maintained. */
  1290. unsigned int enbRxCellCnt:1;/**< [16] Enable Receive Valid Cell Count of non-idle/non-error cells.
  1291. @li 1 - Enable count of valid cells received - non-idle/non-error
  1292. @li 0 - No count is maintained. */
  1293. unsigned int reserved_1:3; /**< [15:13] These bits are always 0 */
  1294. unsigned int rxCellOvrInt:1; /**< [12] Enable CBI Utopia Receive Status Condition if the RxCellCount
  1295. register overflows.
  1296. @li 1 - CBI Receive Status asserted.
  1297. @li 0 - No CBI Receive Status asserted.*/
  1298. unsigned int invalidHecOvrInt:1; /**< [11] Enable CBI Receive Status Condition if the InvalidHecCount
  1299. register overflows.
  1300. @li 1 - CBI Receive Condition asserted.
  1301. @li 0 - No CBI Receive Condition asserted */
  1302. unsigned int invalidParOvrInt:1; /**< [10] Enable CBI Receive Status Condition if the InvalidParCount
  1303. register overflows
  1304. @li 1 - CBI Receive Condition asserted.
  1305. @li 0 - No CBI Receive Condition asserted */
  1306. unsigned int invalidSizeOvrInt:1; /**< [9] Enable CBI Receive Status Condition if the InvalidSizeCount
  1307. register overflows.
  1308. @li 1 - CBI Receive Status Condition asserted.
  1309. @li 0 - No CBI Receive Status asserted */
  1310. unsigned int rxIdleOvrInt:1; /**< [8] Enable CBI Receive Status Condition if the RxIdleCount overflows.
  1311. @li 1 - CBI Receive Condition asserted.
  1312. @li 0 - No CBI Receive Condition asserted */
  1313. unsigned int reserved_2:3; /**< [7:5] These bits are always 0 */
  1314. unsigned int rxAddrMask:5; /**< [4:0] This register is used as a mask to allow the user to increase
  1315. the PHY receive address range. The register should be programmed with
  1316. the address-range limit, i.e. if set to 0x3 the address range increases
  1317. to a maximum of 4 addresses. */
  1318. } utRxEnableFields; /**< Rx enable Utopia register */
  1319. /**
  1320. * @ingroup IxAtmdAccUtopiaCtrlAPI
  1321. * @struct UtRxTransTable0_
  1322. * @brief Utopia Rx translation table Register
  1323. */
  1324. struct UtRxTransTable0_
  1325. {
  1326. unsigned int phy0:5; /**< [31-27] Rx Mapping value of logical phy 0 */
  1327. unsigned int phy1:5; /**< [26-22] Rx Mapping value of logical phy 1 */
  1328. unsigned int phy2:5; /**< [21-17] Rx Mapping value of logical phy 2 */
  1329. unsigned int reserved_1:1; /**< [16] These bits are always 0 */
  1330. unsigned int phy3:5; /**< [15-11] Rx Mapping value of logical phy 3 */
  1331. unsigned int phy4:5; /**< [10-6] Rx Mapping value of logical phy 4 */
  1332. unsigned int phy5:5; /**< [5-1] Rx Mapping value of logical phy 5 */
  1333. unsigned int reserved_2:1; /**< [0] These bits are always 0 */
  1334. }
  1335. utRxTransTable0; /**< Rx translation table */
  1336. /**
  1337. * @ingroup IxAtmdAccUtopiaCtrlAPI
  1338. * @struct UtRxTransTable1_
  1339. * @brief Utopia Rx translation table Register
  1340. */
  1341. struct UtRxTransTable1_
  1342. {
  1343. unsigned int phy6:5; /**< [31-27] Rx Mapping value of logical phy 6 */
  1344. unsigned int phy7:5; /**< [26-22] Rx Mapping value of logical phy 7 */
  1345. unsigned int phy8:5; /**< [21-17] Rx Mapping value of logical phy 8 */
  1346. unsigned int reserved_1:1; /**< [16-0] These bits are always 0 */
  1347. unsigned int phy9:5; /**< [15-11] Rx Mapping value of logical phy 3 */
  1348. unsigned int phy10:5; /**< [10-6] Rx Mapping value of logical phy 4 */
  1349. unsigned int phy11:5; /**< [5-1] Rx Mapping value of logical phy 5 */
  1350. unsigned int reserved_2:1; /**< [0] These bits are always 0 */
  1351. }
  1352. utRxTransTable1; /**< Rx translation table */
  1353. /**
  1354. * @ingroup IxAtmdAccUtopiaCtrlAPI
  1355. * @struct UtRxTransTable2_
  1356. * @brief Utopia Rx translation table Register
  1357. */
  1358. struct UtRxTransTable2_
  1359. {
  1360. unsigned int phy12:5; /**< [31-27] Rx Mapping value of logical phy 6 */
  1361. unsigned int phy13:5; /**< [26-22] Rx Mapping value of logical phy 7 */
  1362. unsigned int phy14:5; /**< [21-17] Rx Mapping value of logical phy 8 */
  1363. unsigned int reserved_1:1; /**< [16-0] These bits are always 0 */
  1364. unsigned int phy15:5; /**< [15-11] Rx Mapping value of logical phy 3 */
  1365. unsigned int phy16:5; /**< [10-6] Rx Mapping value of logical phy 4 */
  1366. unsigned int phy17:5; /**< [5-1] Rx Mapping value of logical phy 5 */
  1367. unsigned int reserved_2:1; /**< [0] These bits are always 0 */
  1368. } utRxTransTable2; /**< Rx translation table */
  1369. /**
  1370. * @ingroup IxAtmdAccUtopiaCtrlAPI
  1371. * @struct UtRxTransTable3_
  1372. * @brief Utopia Rx translation table Register
  1373. */
  1374. struct UtRxTransTable3_
  1375. {
  1376. unsigned int phy18:5; /**< [31-27] Rx Mapping value of logical phy 6 */
  1377. unsigned int phy19:5; /**< [26-22] Rx Mapping value of logical phy 7 */
  1378. unsigned int phy20:5; /**< [21-17] Rx Mapping value of logical phy 8 */
  1379. unsigned int reserved_1:1; /**< [16-0] These bits are always 0 */
  1380. unsigned int phy21:5; /**< [15-11] Rx Mapping value of logical phy 3 */
  1381. unsigned int phy22:5; /**< [10-6] Rx Mapping value of logical phy 4 */
  1382. unsigned int phy23:5; /**< [5-1] Rx Mapping value of logical phy 5 */
  1383. unsigned int reserved_2:1; /**< [0] These bits are always 0 */
  1384. } utRxTransTable3; /**< Rx translation table */
  1385. /**
  1386. * @ingroup IxAtmdAccUtopiaCtrlAPI
  1387. * @struct UtRxTransTable4_
  1388. * @brief Utopia Rx translation table Register
  1389. */
  1390. struct UtRxTransTable4_
  1391. {
  1392. unsigned int phy24:5; /**< [31-27] Rx Mapping value of logical phy 6 */
  1393. unsigned int phy25:5; /**< [26-22] Rx Mapping value of logical phy 7 */
  1394. unsigned int phy26:5; /**< [21-17] Rx Mapping value of logical phy 8 */
  1395. unsigned int reserved_1:1; /**< [16-0] These bits are always 0 */
  1396. unsigned int phy27:5; /**< [15-11] Rx Mapping value of logical phy 3 */
  1397. unsigned int phy28:5; /**< [10-6] Rx Mapping value of logical phy 4 */
  1398. unsigned int phy29:5; /**< [5-1] Rx Mapping value of logical phy 5 */
  1399. unsigned int reserved_2:1; /**< [0] These bits are always 0 */
  1400. } utRxTransTable4; /**< Rx translation table */
  1401. /**
  1402. * @ingroup IxAtmdAccUtopiaCtrlAPI
  1403. * @struct UtRxTransTable5_
  1404. * @brief Utopia Rx translation table Register
  1405. */
  1406. struct UtRxTransTable5_
  1407. {
  1408. unsigned int phy30:5; /**< [31-27] Rx Mapping value of logical phy 6 */
  1409. unsigned int reserved_1:27; /**< [26-0] These bits are always 0 */
  1410. } utRxTransTable5; /**< Rx translation table */
  1411. /**
  1412. * @ingroup IxAtmdAccUtopiaCtrlAPI
  1413. * @struct UtSysConfig_
  1414. * @brief NPE setup Register
  1415. */
  1416. struct UtSysConfig_
  1417. {
  1418. unsigned int reserved_1:2; /**< [31-30] These bits are always 0 */
  1419. unsigned int txEnbFSM:1; /**< [29] Enables the operation ofthe Utopia Transmit FSM
  1420. * @li 1 - FSM enabled
  1421. * @li 0 - FSM inactive
  1422. */
  1423. unsigned int rxEnbFSM:1; /**< [28] Enables the operation ofthe Utopia Revieve FSM
  1424. * @li 1 - FSM enabled
  1425. * @li 0 - FSM inactive
  1426. */
  1427. unsigned int disablePins:1; /**< [27] Disable Utopia interface I/O pins forcing the signals to an
  1428. * inactive state. Note that this bit is set on reset and must be
  1429. * de-asserted
  1430. * @li 0 - Normal data transfer
  1431. * @li 1 - Utopia interface pins are forced inactive
  1432. */
  1433. unsigned int tstLoop:1; /**< [26] Test Loop Back Enable.
  1434. * @li Note: For loop back to function RxMode and Tx Mode must both be set
  1435. * to single PHY mode.
  1436. * @li 0 - Loop back
  1437. * @li 1 - Normal operating mode
  1438. */
  1439. unsigned int txReset:1; /**< [25] Resets the Utopia Coprocessor transmit module to a known state.
  1440. * @li Note: All transmit configuration and status registers will be reset
  1441. * to their reset values.
  1442. * @li 0 - Normal operating mode
  1443. * @li 1 - Reset transmit modules
  1444. */
  1445. unsigned int rxReset:1; /**< [24] Resets the Utopia Coprocessor receive module to a known state.
  1446. * @li Note: All receive configuration and status registers will be reset
  1447. * to their reset values.
  1448. * @li 0 - Normal operating mode
  1449. * @li 1 - Reset receive modules
  1450. */
  1451. unsigned int reserved_2:24; /**< [23-0] These bits are always 0 */
  1452. } utSysConfig; /**< NPE debug config */
  1453. }
  1454. IxAtmdAccUtopiaConfig;
  1455. /**
  1456. *
  1457. * @brief Utopia status
  1458. *
  1459. * This structure is used to set/get the Utopia status parameters
  1460. * @li contains debug cell counters, to be accessed during a read operation
  1461. *
  1462. * @note - the exact description of all parameters is done in the Utopia reference
  1463. * documents.
  1464. *
  1465. */
  1466. typedef struct
  1467. {
  1468. unsigned int utTxCellCount; /**< count of cells transmitted */
  1469. unsigned int utTxIdleCellCount; /**< count of idle cells transmitted */
  1470. /**
  1471. * @ingroup IxAtmdAccUtopiaCtrlAPI
  1472. * @struct UtTxCellConditionStatus_
  1473. * @brief Utopia Tx Status Register
  1474. */
  1475. struct UtTxCellConditionStatus_
  1476. {
  1477. unsigned int reserved_1:2; /**< [31:30] These bits are always 0 */
  1478. unsigned int txFIFO2Underflow:1; /**< [29] This bit is set if 64-byte
  1479. * Transmit FIFO2 indicates a FIFO underflow
  1480. * error condition.
  1481. */
  1482. unsigned int txFIFO1Underflow:1; /**< [28] This bit is set if
  1483. * 64-byte Transmit FIFO1 indicates a FIFO
  1484. * underflow error condition.
  1485. */
  1486. unsigned int txFIFO2Overflow:1; /**< [27] This bit is set if 64-byte
  1487. * Transmit FIFO2 indicates a FIFO overflow
  1488. * error condition.
  1489. */
  1490. unsigned int txFIFO1Overflow:1; /**< [26] This bit is set if 64-byte
  1491. * Transmit FIFO1 indicates a FIFO overflow
  1492. * error condition.
  1493. */
  1494. unsigned int txIdleCellCountOvr:1; /**< [25] This bit is set if the
  1495. * TxIdleCellCount register overflows.
  1496. */
  1497. unsigned int txCellCountOvr:1; /**< [24] This bit is set if the
  1498. * TxCellCount register overflows
  1499. */
  1500. unsigned int reserved_2:24; /**< [23:0] These bits are always 0 */
  1501. } utTxCellConditionStatus; /**< Tx cells condition status */
  1502. unsigned int utRxCellCount; /**< count of cell received */
  1503. unsigned int utRxIdleCellCount; /**< count of idle cell received */
  1504. unsigned int utRxInvalidHECount; /**< count of invalid cell
  1505. * received because of HEC errors
  1506. */
  1507. unsigned int utRxInvalidParCount; /**< count of invalid cell received
  1508. * because of parity errors
  1509. */
  1510. unsigned int utRxInvalidSizeCount; /**< count of invalid cell
  1511. * received because of cell
  1512. * size errors
  1513. */
  1514. /**
  1515. * @ingroup IxAtmdAccUtopiaCtrlAPI
  1516. * @struct UtRxCellConditionStatus_
  1517. * @brief Utopia Rx Status Register
  1518. */
  1519. struct UtRxCellConditionStatus_
  1520. {
  1521. unsigned int reserved_1:3; /**< [31:29] These bits are always 0.*/
  1522. unsigned int rxCellCountOvr:1; /**< [28] This bit is set if the RxCellCount register overflows. */
  1523. unsigned int invalidHecCountOvr:1; /**< [27] This bit is set if the InvalidHecCount register overflows.*/
  1524. unsigned int invalidParCountOvr:1; /**< [26] This bit is set if the InvalidParCount register overflows.*/
  1525. unsigned int invalidSizeCountOvr:1; /**< [25] This bit is set if the InvalidSizeCount register overflows.*/
  1526. unsigned int rxIdleCountOvr:1; /**< [24] This bit is set if the RxIdleCount register overflows.*/
  1527. unsigned int reserved_2:4; /**< [23:20] These bits are always 0 */
  1528. unsigned int rxFIFO2Underflow:1; /**< [19] This bit is set if 64-byte Receive FIFO2
  1529. * indicates a FIFO underflow error condition.
  1530. */
  1531. unsigned int rxFIFO1Underflow:1; /**< [18] This bit is set if 64-byte Receive
  1532. * FIFO1 indicates a FIFO underflow error condition
  1533. . */
  1534. unsigned int rxFIFO2Overflow:1; /**< [17] This bit is set if 64-byte Receive FIFO2
  1535. * indicates a FIFO overflow error condition.
  1536. */
  1537. unsigned int rxFIFO1Overflow:1; /**< [16] This bit is set if 64-byte Receive FIFO1
  1538. * indicates a FIFO overflow error condition.
  1539. */
  1540. unsigned int reserved_3:16; /**< [15:0] These bits are always 0. */
  1541. } utRxCellConditionStatus; /**< Rx cells condition status */
  1542. } IxAtmdAccUtopiaStatus;
  1543. /**
  1544. * @} defgroup IxAtmdAccUtopiaCtrlAPI
  1545. */
  1546. /**
  1547. *
  1548. * @ingroup IxAtmdAccCtrlAPI
  1549. *
  1550. * @fn ixAtmdAccUtopiaConfigSet (const IxAtmdAccUtopiaConfig *
  1551. ixAtmdAccUtopiaConfigPtr)
  1552. *
  1553. * @brief Send the configuration structure to the Utopia interface
  1554. *
  1555. * This function downloads the @a IxAtmdAccUtopiaConfig structure to
  1556. * the Utopia and has the following effects
  1557. * @li setup the Utopia interface
  1558. * @li initialise the NPE
  1559. * @li reset the Utopia cell counters and status registers to known values
  1560. *
  1561. * This action has to be done once at initialisation. A lock is preventing
  1562. * the concurrent use of @a ixAtmdAccUtopiaStatusGet() and
  1563. * @A ixAtmdAccUtopiaConfigSet()
  1564. *
  1565. * @param *ixAtmdAccNPEConfigPtr @ref IxAtmdAccUtopiaConfig [in] - pointer to a structure to download to
  1566. * Utopia. This parameter cannot be a null pointer.
  1567. *
  1568. * @return @li IX_SUCCESS successful download
  1569. * @return @li IX_FAIL error in the parameters, or configuration is not
  1570. * complete or failed
  1571. *
  1572. * @sa ixAtmdAccUtopiaStatusGet
  1573. *
  1574. */
  1575. PUBLIC IX_STATUS ixAtmdAccUtopiaConfigSet (const IxAtmdAccUtopiaConfig *
  1576. ixAtmdAccUtopiaConfigPtr);
  1577. /**
  1578. *
  1579. * @ingroup IxAtmdAccCtrlAPI
  1580. *
  1581. * @fn ixAtmdAccUtopiaStatusGet (IxAtmdAccUtopiaStatus *
  1582. ixAtmdAccUtopiaStatus)
  1583. *
  1584. * @brief Get the Utopia interface configuration.
  1585. *
  1586. * This function reads the Utopia registers and the Cell counts
  1587. * and fills the @a IxAtmdAccUtopiaStatus structure
  1588. *
  1589. * A lock is preventing the concurrent
  1590. * use of @a ixAtmdAccUtopiaStatusGet() and @A ixAtmdAccUtopiaConfigSet()
  1591. *
  1592. * @param ixAtmdAccUtopiaStatus @ref IxAtmdAccUtopiaStatus [out] - pointer to structure to be updated from internal
  1593. * hardware counters. This parameter cannot be a NULL pointer.
  1594. *
  1595. * @return @li IX_SUCCESS successful read
  1596. * @return @li IX_FAIL error in the parameters null pointer, or
  1597. * configuration read is not complete or failed
  1598. *
  1599. * @sa ixAtmdAccUtopiaConfigSet
  1600. *
  1601. */
  1602. PUBLIC IX_STATUS ixAtmdAccUtopiaStatusGet (IxAtmdAccUtopiaStatus *
  1603. ixAtmdAccUtopiaStatus);
  1604. /**
  1605. *
  1606. * @ingroup IxAtmdAcc
  1607. *
  1608. * @fn ixAtmdAccPortEnable (IxAtmLogicalPort port)
  1609. *
  1610. * @brief enable a PHY logical port
  1611. *
  1612. * This function enables the transmission over one port. It should be
  1613. * called before accessing any resource from this port and before the
  1614. * establishment of a VC.
  1615. *
  1616. * When a port is enabled, the cell transmission to the Utopia interface
  1617. * is started. If there is no traffic already running, idle cells are
  1618. * sent over the interface.
  1619. *
  1620. * This function can be called multiple times.
  1621. *
  1622. * @param port @ref IxAtmLogicalPort [in] - logical PHY port [@a IX_UTOPIA_PORT_0 .. @a IX_UTOPIA_MAX_PORTS - 1]
  1623. *
  1624. * @return @li IX_SUCCESS enable is complete
  1625. * @return @li IX_ATMDACC_WARNING port already enabled
  1626. * @return @li IX_FAIL enable failed, wrong parameter, or cannot
  1627. * initialise this port (the port is maybe already in use,
  1628. * or there is a hardware issue)
  1629. *
  1630. * @note - This function needs internal locks and should not be
  1631. * called from an interrupt context
  1632. *
  1633. * @sa ixAtmdAccPortDisable
  1634. *
  1635. */
  1636. PUBLIC IX_STATUS ixAtmdAccPortEnable (IxAtmLogicalPort port);
  1637. /**
  1638. *
  1639. * @ingroup IxAtmdAccCtrlAPI
  1640. *
  1641. * @fn ixAtmdAccPortDisable (IxAtmLogicalPort port)
  1642. *
  1643. * @brief disable a PHY logical port
  1644. *
  1645. * This function disable the transmission over one port.
  1646. *
  1647. * When a port is disabled, the cell transmission to the Utopia interface
  1648. * is stopped.
  1649. *
  1650. * @param port @ref IxAtmLogicalPort [in] - logical PHY port [@a IX_UTOPIA_PORT_0 .. @a IX_UTOPIA_MAX_PORTS - 1]
  1651. *
  1652. * @return @li IX_SUCCESS disable is complete
  1653. * @return @li IX_ATMDACC_WARNING port already disabled
  1654. * @return @li IX_FAIL disable failed, wrong parameter .
  1655. *
  1656. * @note - This function needs internal locks and should not be called
  1657. * from an interrupt context
  1658. *
  1659. * @note - The response from hardware is done through the txDone mechanism
  1660. * to ensure the synchrnisation with tx resources. Therefore, the
  1661. * txDone mechanism needs to be serviced to make a PortDisable complete.
  1662. *
  1663. * @sa ixAtmdAccPortEnable
  1664. * @sa ixAtmdAccPortDisableComplete
  1665. * @sa ixAtmdAccTxDoneDispatch
  1666. *
  1667. */
  1668. PUBLIC IX_STATUS ixAtmdAccPortDisable (IxAtmLogicalPort port);
  1669. /**
  1670. *
  1671. * @ingroup IxAtmdAccCtrlAPI
  1672. *
  1673. * @fn ixAtmdAccPortDisableComplete (IxAtmLogicalPort port)
  1674. *
  1675. * @brief disable a PHY logical port
  1676. *
  1677. * This function indicates if the port disable for a port has completed. This
  1678. * function will return true if the port has never been enabled.
  1679. *
  1680. * @param port @ref IxAtmLogicalPort [in] - logical PHY port [@a IX_UTOPIA_PORT_0 .. @a IX_UTOPIA_MAX_PORTS - 1]
  1681. *
  1682. * @return @li true disable is complete
  1683. * @return @li false disable failed, wrong parameter .
  1684. *
  1685. * @note - This function needs internal locks and should not be called
  1686. * from an interrupt context
  1687. *
  1688. * @sa ixAtmdAccPortEnable
  1689. * @sa ixAtmdAccPortDisable
  1690. *
  1691. */
  1692. PUBLIC BOOL ixAtmdAccPortDisableComplete (IxAtmLogicalPort port);
  1693. #endif /* IXATMDACCCTRL_H */
  1694. /**
  1695. * @} defgroup IxAtmdAccCtrlAPI
  1696. */