IxAtmdAccCtrl.h 74 KB

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