IxAtmdAcc.h 45 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194
  1. /**
  2. * @file IxAtmdAcc.h
  3. *
  4. * @date 07-Nov-2001
  5. *
  6. * @brief IxAtmdAcc Public API
  7. *
  8. * This file contains the public API of IxAtmdAcc, related to the
  9. * data 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 IxAtmdAccAPI IXP400 ATM Driver Access (IxAtmdAcc) API
  56. *
  57. * @brief The public API for the IXP400 Atm Driver Data component
  58. *
  59. * IxAtmdAcc is the low level interface by which AAL0/AAL5 and
  60. * OAM data gets transmitted to,and received from the Utopia bus.
  61. *
  62. * For AAL0/AAL5 services transmit and receive connections may
  63. * be established independantly for unique combinations of
  64. * port,VPI,and VCI.
  65. *
  66. * Two AAL0 services supporting 48 or 52 byte cell data are provided.
  67. * Submitted AAL0 PDUs must be a multiple of the cell data size (48/52).
  68. * AAL0_52 is a raw cell service the client must format
  69. * the PDU with an ATM cell header (excluding HEC) at the start of
  70. * each cell, note that AtmdAcc does not validate the cell headers in
  71. * a submitted PDU.
  72. *
  73. * OAM cells cannot be received over the AAL0 service but instead
  74. * are received over a dedicated OAM service.
  75. *
  76. * For the OAM service an "OAM Tx channel" may be enabled for a port
  77. * by establishing a single dedicated OAM Tx connection on that port.
  78. * A single "OAM Rx channel" for all ports may be enabled by
  79. * establishing a dedicated OAM Rx connection.
  80. *
  81. * The OAM service allows buffers containing 52 byte OAM F4/F5 cells
  82. * to be transmitted and received over the dedicated OAM channels.
  83. * HEC is appended/removed, and CRC-10 performed by the NPE. The OAM
  84. * service offered by AtmdAcc is a raw cell transport service.
  85. * It is assumed that ITU I.610 procedures that make use of this
  86. * service are implemented above AtmdAcc.
  87. *
  88. * Note that the dedicated OAM connections are established on
  89. * reserved VPI,VCI, and (in the case of Rx) port values defined below.
  90. * These values are used purely to descriminate the dedicated OAM channels
  91. * and do not identify a particular OAM F4/F5 flow. F4/F5 flows may be
  92. * realised for particluar VPI/VCIs by manipulating the VPI,VCI
  93. * fields of the ATM cell headers of cells in the buffers passed
  94. * to AtmdAcc. Note that AtmdAcc does not validate the cell headers
  95. * in a submitted OAM PDU.
  96. *
  97. *
  98. *
  99. * This part is related to the User datapath processing
  100. *
  101. * @{
  102. */
  103. #ifndef IXATMDACC_H
  104. #define IXATMDACC_H
  105. #include "IxAtmTypes.h"
  106. /* ------------------------------------------------------
  107. AtmdAcc Data Types definition
  108. ------------------------------------------------------ */
  109. /**
  110. *
  111. * @ingroup IxAtmdAccAPI
  112. *
  113. * @def IX_ATMDACC_WARNING
  114. *
  115. * @brief Warning return code
  116. *
  117. * This constant is used to tell IxAtmDAcc user about a special case.
  118. *
  119. */
  120. #define IX_ATMDACC_WARNING 2
  121. /**
  122. *
  123. * @ingroup IxAtmdAccAPI
  124. *
  125. * @def IX_ATMDACC_BUSY
  126. *
  127. * @brief Busy return code
  128. *
  129. * This constant is used to tell IxAtmDAcc user that the request
  130. * is correct, but cannot be processed because the IxAtmAcc resources
  131. * are already used. The user has to retry its request later
  132. *
  133. */
  134. #define IX_ATMDACC_BUSY 3
  135. /**
  136. *
  137. * @ingroup IxAtmdAccAPI
  138. *
  139. * @def IX_ATMDACC_RESOURCES_STILL_ALLOCATED
  140. *
  141. * @brief Disconnect return code
  142. *
  143. * This constant is used to tell IxAtmDAcc user that the disconnect
  144. * functions are not complete because the resources used by the driver
  145. * are not yet released. The user has to retry the disconnect call
  146. * later.
  147. *
  148. */
  149. #define IX_ATMDACC_RESOURCES_STILL_ALLOCATED 4
  150. /**
  151. *
  152. * @ingroup IxAtmdAccAPI
  153. *
  154. * @def IX_ATMDACC_DEFAULT_REPLENISH_COUNT
  155. *
  156. * @brief Default resources usage for RxVcFree replenish mechanism
  157. *
  158. * This constant is used to tell IxAtmDAcc to allocate and use
  159. * the minimum of resources for rx free replenish.
  160. *
  161. * @sa ixAtmdAccRxVcConnect
  162. */
  163. #define IX_ATMDACC_DEFAULT_REPLENISH_COUNT 0
  164. /**
  165. * @ingroup IxAtmdAccAPI
  166. *
  167. * @def IX_ATMDACC_OAM_TX_VPI
  168. *
  169. * @brief The reserved value used for the dedicated OAM
  170. * Tx connection. This "well known" value is used by atmdAcc and
  171. * its clients to dsicriminate the OAM channel, and should be chosen so
  172. * that it does not coencide with the VPI value used in an AAL0/AAL5 connection.
  173. * Any attempt to connect a service type other than OAM on this VPI will fail.
  174. *
  175. *
  176. */
  177. #define IX_ATMDACC_OAM_TX_VPI 0
  178. /**
  179. * @ingroup IxAtmdAccAPI
  180. *
  181. * @def IX_ATMDACC_OAM_TX_VCI
  182. *
  183. * @brief The reserved value used for the dedicated OAM
  184. * Tx connection. This "well known" value is used by atmdAcc and
  185. * its clients to dsicriminate the OAM channel, and should be chosen so
  186. * that it does not coencide with the VCI value used in an AAL0/AAL5 connection.
  187. * Any attempt to connect a service type other than OAM on this VCI will fail.
  188. */
  189. #define IX_ATMDACC_OAM_TX_VCI 0
  190. /**
  191. * @ingroup IxAtmdAccAPI
  192. *
  193. * @def IX_ATMDACC_OAM_RX_PORT
  194. *
  195. * @brief The reserved dummy PORT used for all dedicated OAM
  196. * Rx connections. Note that this is not a real port but must
  197. * have a value that lies within the valid range of port values.
  198. */
  199. #define IX_ATMDACC_OAM_RX_PORT IX_UTOPIA_PORT_0
  200. /**
  201. * @ingroup IxAtmdAccAPI
  202. *
  203. * @def IX_ATMDACC_OAM_RX_VPI
  204. *
  205. * @brief The reserved value value used for the dedicated OAM
  206. * Rx connection. This value should be chosen so that it does not
  207. * coencide with the VPI value used in an AAL0/AAL5 connection.
  208. * Any attempt to connect a service type other than OAM on this VPI will fail.
  209. */
  210. #define IX_ATMDACC_OAM_RX_VPI 0
  211. /**
  212. * @ingroup IxAtmdAccAPI
  213. *
  214. * @def IX_ATMDACC_OAM_RX_VCI
  215. *
  216. * @brief The reserved value value used for the dedicated OAM
  217. * Rx connection. This value should be chosen so that it does not
  218. * coencide with the VCI value used in an AAL0/AAL5 connection.
  219. * Any attempt to connect a service type other than OAM on this VCI will fail.
  220. */
  221. #define IX_ATMDACC_OAM_RX_VCI 0
  222. /**
  223. * @enum IxAtmdAccPduStatus
  224. *
  225. * @ingroup IxAtmdAccAPI
  226. *
  227. * @brief IxAtmdAcc Pdu status :
  228. *
  229. * IxAtmdAccPduStatus is used during a RX operation to indicate
  230. * the status of the received PDU
  231. *
  232. */
  233. typedef enum
  234. {
  235. IX_ATMDACC_AAL0_VALID = 0, /**< aal0 pdu */
  236. IX_ATMDACC_OAM_VALID, /**< OAM pdu */
  237. IX_ATMDACC_AAL2_VALID, /**< aal2 pdu @b reserved for future use */
  238. IX_ATMDACC_AAL5_VALID, /**< aal5 pdu complete and trailer is valid */
  239. IX_ATMDACC_AAL5_PARTIAL, /**< aal5 pdu not complete, trailer is missing */
  240. IX_ATMDACC_AAL5_CRC_ERROR, /**< aal5 pdu not complete, crc error/length error */
  241. IX_ATMDACC_MBUF_RETURN /**< empty buffer returned to the user */
  242. } IxAtmdAccPduStatus;
  243. /**
  244. *
  245. * @enum IxAtmdAccAalType
  246. *
  247. * @ingroup IxAtmdAccAPI
  248. *
  249. * @brief IxAtmdAcc AAL Service Type :
  250. *
  251. * IxAtmdAccAalType defines the type of traffic to run on this VC
  252. *
  253. */
  254. typedef enum
  255. {
  256. IX_ATMDACC_AAL5, /**< ITU-T AAL5 */
  257. IX_ATMDACC_AAL2, /**< ITU-T AAL2 @b reserved for future use */
  258. IX_ATMDACC_AAL0_48, /**< AAL0 48 byte payloads (cell header is added by NPE)*/
  259. IX_ATMDACC_AAL0_52, /**< AAL0 52 byte cell data (HEC is added by NPE) */
  260. IX_ATMDACC_OAM, /**< OAM cell transport service (HEC is added by NPE)*/
  261. IX_ATMDACC_MAX_SERVICE_TYPE /**< not a service, used for parameter validation */
  262. } IxAtmdAccAalType;
  263. /**
  264. *
  265. * @enum IxAtmdAccClpStatus
  266. *
  267. * @ingroup IxAtmdAccAPI
  268. *
  269. * @brief IxAtmdAcc CLP indication
  270. *
  271. * IxAtmdAccClpStatus defines the CLP status of the current PDU
  272. *
  273. */
  274. typedef enum
  275. {
  276. IX_ATMDACC_CLP_NOT_SET = 0, /**< CLP indication is not set */
  277. IX_ATMDACC_CLP_SET = 1 /**< CLP indication is set */
  278. } IxAtmdAccClpStatus;
  279. /**
  280. * @typedef IxAtmdAccUserId
  281. *
  282. * @ingroup IxAtmdAccAPI
  283. *
  284. * @brief User-supplied Id
  285. *
  286. * IxAtmdAccUserId is passed through callbacks and allows the
  287. * IxAtmdAcc user to identify the source of a call back. The range of
  288. * this user-owned Id is [0...2^32-1)].
  289. *
  290. * The user provides this own Ids on a per-channel basis as a parameter
  291. * in a call to @a ixAtmdAccRxVcConnect() or @a ixAtmdAccRxVcConnect()
  292. *
  293. * @sa ixAtmdAccRxVcConnect
  294. * @sa ixAtmdAccTxVcConnect
  295. *
  296. */
  297. typedef unsigned int IxAtmdAccUserId;
  298. /* ------------------------------------------------------
  299. Part of the IxAtmdAcc interface related to RX traffic
  300. ------------------------------------------------------ */
  301. /**
  302. *
  303. * @ingroup IxAtmdAccAPI
  304. *
  305. * @brief Rx callback prototype
  306. *
  307. * IxAtmdAccRxVcRxCallback is the prototype of the Rx callback user
  308. * function called once per PDU to pass a receive Pdu to a user on a
  309. * partilcular connection. The callback is likely to push the mbufs
  310. * to a protocol layer, and recycle the mbufs for a further use.
  311. *
  312. * @note -This function is called ONLY in the context of
  313. * the @a ixAtmdAccRxDispatch() function
  314. *
  315. * @sa ixAtmdAccRxDispatch
  316. * @sa ixAtmdAccRxVcConnect
  317. *
  318. * @param port @ref IxAtmLogicalPort [in] - the port on which this PDU was received
  319. * a logical PHY port [@a IX_UTOPIA_PORT_0 .. @a IX_UTOPIA_MAX_PORTS - 1]
  320. * @param userId @ref IxAtmdAccUserId [in] - user Id provided in the call
  321. * to @a ixAtmdAccRxVcConnect()
  322. * @param status @ref IxAtmdAccPduStatus [in] - an indication about the PDU validity.
  323. * In the case of AAL0 the only possibile value is
  324. * AAL0_VALID, in this case the client may optionally determine
  325. * that an rx timeout occured by checking if the mbuf is
  326. * compleletly or only partially filled, the later case
  327. * indicating a timeout.
  328. * In the case of OAM the only possible value is OAM valid.
  329. * The status is set to @a IX_ATMDACC_MBUF_RETURN when
  330. * the mbuf is released during a disconnect process.
  331. * @param clp @ref IxAtmdAccClpStatus [in] - clp indication for this PDU.
  332. * For AAL5/AAL0_48 this information
  333. * is set if the clp bit of any rx cell is set
  334. * For AAL0-52/OAM the client may inspect the CLP in individual
  335. * cell headers in the PDU, and this parameter is set to 0.
  336. * @param *mbufPtr @ref IX_OSAL_MBUF [in] - depending on the servive type a pointer to
  337. * an mbuf (AAL5/AAL0/OAM) or mbuf chain (AAL5 only),
  338. * that comprises the complete PDU data.
  339. *
  340. * This parameter is guaranteed not to be a null pointer.
  341. *
  342. */
  343. typedef void (*IxAtmdAccRxVcRxCallback) (IxAtmLogicalPort port,
  344. IxAtmdAccUserId userId,
  345. IxAtmdAccPduStatus status,
  346. IxAtmdAccClpStatus clp,
  347. IX_OSAL_MBUF * mbufPtr);
  348. /**
  349. *
  350. * @ingroup IxAtmdAccAPI
  351. *
  352. * @brief Callback prototype for free buffer level is low.
  353. *
  354. * IxAtmdAccRxVcFreeLowCallback is the prototype of the user function
  355. * which get called on a per-VC basis, when more mbufs are needed to
  356. * continue the ATM data reception. This function is likely to supply
  357. * more available mbufs by one or many calls to the replenish function
  358. * @a ixAtmdAccRxVcFreeReplenish()
  359. *
  360. * This function is called when the number of available buffers for
  361. * reception is going under the threshold level as defined
  362. * in @a ixAtmdAccRxVcFreeLowCallbackRegister()
  363. *
  364. * This function is called inside an Qmgr dispatch context. No system
  365. * resource or interrupt-unsafe feature should be used inside this
  366. * callback.
  367. *
  368. * @sa ixAtmdAccRxVcFreeLowCallbackRegister
  369. * @sa IxAtmdAccRxVcFreeLowCallback
  370. * @sa ixAtmdAccRxVcFreeReplenish
  371. * @sa ixAtmdAccRxVcFreeEntriesQuery
  372. * @sa ixAtmdAccRxVcConnect
  373. *
  374. * @param userId @ref IxAtmdAccUserId [in] - user Id provided in the call
  375. * to @a ixAtmdAccRxVcConnect()
  376. *
  377. * @return None
  378. *
  379. */
  380. typedef void (*IxAtmdAccRxVcFreeLowCallback) (IxAtmdAccUserId userId);
  381. /* ------------------------------------------------------
  382. Part of the IxAtmdAcc interface related to TX traffic
  383. ------------------------------------------------------ */
  384. /**
  385. *
  386. * @ingroup IxAtmdAccAPI
  387. *
  388. * @brief Buffer callback prototype.
  389. *
  390. * This function is called to relinguish ownership of a transmitted
  391. * buffer chain to the user.
  392. *
  393. * @note -In the case of a chained mbuf the AmtdAcc component can
  394. * chain many user buffers together and pass ownership to the user in
  395. * one function call.
  396. *
  397. * @param userId @ref IxAtmdAccUserId [in] - user If provided at registration of this
  398. * callback.
  399. * @param mbufPtr @ref IX_OSAL_MBUF [in] - a pointer to mbufs or chain of mbufs and is
  400. * guaranteed not to be a null pointer.
  401. *
  402. */
  403. typedef void (*IxAtmdAccTxVcBufferReturnCallback) (IxAtmdAccUserId userId,
  404. IX_OSAL_MBUF * mbufPtr);
  405. /* ------------------------------------------------------
  406. Part of the IxAtmdAcc interface related to Initialisation
  407. ------------------------------------------------------ */
  408. /**
  409. *
  410. * @ingroup IxAtmdAccAPI
  411. *
  412. * @fn ixAtmdAccInit (void)
  413. *
  414. * @brief Initialise the IxAtmdAcc Component
  415. *
  416. * This function initialise the IxAtmdAcc component. This function shall
  417. * be called before any other function of the API. Its role is to
  418. * initialise all internal resources of the IxAtmdAcc component.
  419. *
  420. * The ixQmgr component needs to be initialized prior the use of
  421. * @a ixAtmdAccInit()
  422. *
  423. * @param none
  424. *
  425. * Failing to initilialize the IxAtmdAcc API before any use of it will
  426. * result in a failed status.
  427. * If the specified component is not present, a success status will still be
  428. * returned, however, a warning indicating the NPE to download to is not
  429. * present will be issued.
  430. *
  431. * @return @li IX_SUCCESS initialisation is complete (in case of component not
  432. * being present, a warning is clearly indicated)
  433. * @return @li IX_FAIL unable to process this request either
  434. * because this IxAtmdAcc is already initialised
  435. * or some unspecified error has occrred.
  436. */
  437. PUBLIC IX_STATUS ixAtmdAccInit (void);
  438. /**
  439. *
  440. * @ingroup IxAtmdAccAPI
  441. *
  442. * @fn ixAtmdAccShow (void)
  443. *
  444. * @brief Show IxAtmdAcc configuration on a per port basis
  445. *
  446. * @param none
  447. *
  448. * @return none
  449. *
  450. * @note - Display use printf() and are redirected to stdout
  451. */
  452. PUBLIC void
  453. ixAtmdAccShow (void);
  454. /**
  455. *
  456. * @ingroup IxAtmdAccAPI
  457. *
  458. * @fn ixAtmdAccStatsShow (void)
  459. *
  460. * @brief Show all IxAtmdAcc stats
  461. *
  462. * @param none
  463. *
  464. * @return none
  465. *
  466. * @note - Stats display use printf() and are redirected to stdout
  467. */
  468. PUBLIC void
  469. ixAtmdAccStatsShow (void);
  470. /**
  471. *
  472. * @ingroup IxAtmdAccAPI
  473. *
  474. * @fn ixAtmdAccStatsReset (void)
  475. *
  476. * @brief Reset all IxAtmdAcc stats
  477. *
  478. * @param none
  479. *
  480. * @return none
  481. *
  482. */
  483. PUBLIC void
  484. ixAtmdAccStatsReset (void);
  485. /* ------------------------------------------------------
  486. Part of the IxAtmdAcc interface related to RX traffic
  487. ------------------------------------------------------ */
  488. /**
  489. *
  490. * @ingroup IxAtmdAccAPI
  491. *
  492. * @fn ixAtmdAccRxVcConnect (IxAtmLogicalPort port,
  493. unsigned int vpi,
  494. unsigned int vci,
  495. IxAtmdAccAalType aalServiceType,
  496. IxAtmRxQueueId rxQueueId,
  497. IxAtmdAccUserId userCallbackId,
  498. IxAtmdAccRxVcRxCallback rxCallback,
  499. unsigned int minimumReplenishCount,
  500. IxAtmConnId * connIdPtr,
  501. IxAtmNpeRxVcId * npeVcIdPtr )
  502. *
  503. * @brief Connect to a Aal Pdu receive service for a particular
  504. * port/vpi/vci, and service type.
  505. *
  506. * This function allows a user to connect to an Aal5/Aal0/OAM Pdu receive service
  507. * for a particular port/vpi/vci. It registers the callback and allocates
  508. * internal resources and a Connection Id to be used in further API calls
  509. * related to this VCC.
  510. *
  511. * The function will setup VC receive service on the specified rx queue.
  512. *
  513. * This function is blocking and makes use internal locks, and hence
  514. * should not be called from an interrupt context.
  515. *
  516. * On return from @a ixAtmdAccRxVcConnect() with a failure status, the
  517. * connection Id parameter is unspecified. Its value cannot be used.
  518. * A connId is the reference by which IxAtmdAcc refers to a
  519. * connected VC. This identifier is the result of a succesful call
  520. * to a connect function. This identifier is invalid after a
  521. * sucessful call to a disconnect function.
  522. *
  523. * Calling this function for the same combination of Vpi, Vci and more
  524. * than once without calling @a ixAtmdAccRxVcTryDisconnect() will result in a
  525. * failure status.
  526. *
  527. * If this function returns success the user should supply receive
  528. * buffers by calling @a ixAtmdAccRxVcFreeReplenish() and then call
  529. * @a ixAtmdAccRxVcEnable() to begin receiving pdus.
  530. *
  531. * There is a choice of two receive Qs on which the VC pdus could be
  532. * receive. The user must associate the VC with one of these. Essentially
  533. * having two qs allows more flexible system configuration such as have
  534. * high prioriy traffic on one q (e.g. voice) and low priority traffic on
  535. * the other (e.g. data). The high priority Q could be serviced in
  536. * preference to the low priority Q. One queue may be configured to be
  537. * serviced as soon as there is traffic, the other queue may be configured
  538. * to be serviced by a polling mechanism running at idle time.
  539. *
  540. * Two AAL0 services supporting 48 or 52 byte cell data are provided.
  541. * Received AAL0 PDUs will be be a multiple of the cell data size (48/52).
  542. * AAL0_52 is a raw cell service and includes an ATM cell header
  543. * (excluding HEC) at the start of each cell.
  544. *
  545. * A single "OAM Rx channel" for all ports may be enabled by
  546. * establishing a dedicated OAM Rx connection.
  547. *
  548. * The OAM service allows buffers containing 52 byte OAM F4/F5 cells
  549. * to be transmitted and received over the dedicated OAM channels.
  550. * HEC is appended/removed, and CRC-10 performed by the NPE. The OAM
  551. * service offered by AtmdAcc is a raw cell transport service.
  552. * It is assumed that ITU I.610 procedures that make use of this
  553. * service are implemented above AtmdAcc.
  554. *
  555. * Note that the dedicated OAM connections are established on
  556. * reserved VPI,VCI, and (in the case of Rx) port values.
  557. * These values are used purely to descriminate the dedicated OAM channels
  558. * and do not identify a particular OAM F4/F5 flow. F4/F5 flows may be
  559. * realised for particluar VPI/VCIs by manipulating the VPI,VCI
  560. * fields of the ATM cell headers of cells in the buffers passed
  561. * to AtmdAcc.
  562. *
  563. * Calling this function prior to enable the port will fail.
  564. *
  565. * @sa ixAtmdAccRxDispatch
  566. * @sa ixAtmdAccRxVcEnable
  567. * @sa ixAtmdAccRxVcDisable
  568. * @sa ixAtmdAccRxVcTryDisconnect
  569. * @sa ixAtmdAccPortEnable
  570. *
  571. * @param port @ref IxAtmLogicalPort [in] - VC identification : logical PHY port
  572. * [@a IX_UTOPIA_PORT_0 .. @a IX_UTOPIA_MAX_PORTS - 1]
  573. * @param vpi unsigned int [in] - VC identification : ATM Vpi [0..255] or IX_ATMDACC_OAM_VPI
  574. * @param vci unsigned int [in] - VC identification : ATM Vci [0..65535] or IX_ATMDACC_OAM_VCI
  575. * @param aalServiceType @ref IxAtmdAccAalType [in] - type of service: AAL5, AAL0_48, AAL0_52, or OAM
  576. * @param rxQueueId @ref IxAtmRxQueueId [in] - this identifieds which of two Qs the VC
  577. * should use.when icoming traffic is processed
  578. * @param userCallbackId @ref IxAtmdAccUserId [in] - user Id used later as a parameter to
  579. * the supplied rxCallback.
  580. * @param rxCallback [in] @ref IxAtmdAccRxVxRxCallback - function called when mbufs are received.
  581. * This parameter cannot be a null pointer.
  582. * @param bufferFreeCallback [in] - function to be called to return
  583. * ownership of buffers to IxAtmdAcc user.
  584. * @param minimumReplenishCount unsigned int [in] - For AAL5/AAL0 the number of free mbufs
  585. * to be used with this channel. Use a high number when the expected traffic
  586. * rate on this channel is high, or when the user's mbufs are small, or when
  587. * the RxVcFreeLow Notification has to be invoked less often. When this
  588. * value is IX_ATMDACC_DEFAULT_REPLENISH_COUNT, the minimum of
  589. * resources will be used. Depending on traffic rate, pdu
  590. * size and mbuf size, rxfree queue size, polling/interrupt rate, this value may
  591. * require to be replaced by a different value in the range 1-128
  592. * For OAM the rxFree queue size is fixed by atmdAcc and this parameter is ignored.
  593. * @param connIdPtr @ref IxAtmConnId [out] - pointer to a connection Id
  594. * This parameter cannot be a null pointer.
  595. * @param npeVcIdPtr @ref IxAtmNpeRxVcId [out] - pointer to an npe Vc Id
  596. * This parameter cannot be a null pointer.
  597. *
  598. * @return @li IX_SUCCESS successful call to IxAtmdAccRxVcConnect
  599. * @return @li IX_ATMDACC_BUSY cannot process this request :
  600. * no VC is available
  601. * @return @li IX_FAIL
  602. * parameter error,
  603. * VC already in use,
  604. * attempt to connect AAL service on reserved OAM VPI/VCI,
  605. * attempt to connect OAM service on VPI/VCI other than the reserved OAM VPI/VCI,
  606. * port is not initialised,
  607. * or some other error occurs during processing.
  608. *
  609. */
  610. PUBLIC IX_STATUS ixAtmdAccRxVcConnect (IxAtmLogicalPort port,
  611. unsigned int vpi,
  612. unsigned int vci,
  613. IxAtmdAccAalType aalServiceType,
  614. IxAtmRxQueueId rxQueueId,
  615. IxAtmdAccUserId userCallbackId,
  616. IxAtmdAccRxVcRxCallback rxCallback,
  617. unsigned int minimumReplenishCount,
  618. IxAtmConnId * connIdPtr,
  619. IxAtmNpeRxVcId * npeVcIdPtr );
  620. /**
  621. *
  622. * @ingroup IxAtmdAccAPI
  623. *
  624. * @fn ixAtmdAccRxVcFreeReplenish (IxAtmConnId connId,
  625. IX_OSAL_MBUF * mbufPtr)
  626. *
  627. * @brief Provide free mbufs for data reception on a connection.
  628. *
  629. * This function provides mbufs for data reception by the hardware. This
  630. * function needs to be called by the user on a regular basis to ensure
  631. * no packet loss. Providing free buffers is a connection-based feature;
  632. * each connection can have different requirements in terms of buffer size
  633. * number of buffers, recycling rate. This function could be invoked from
  634. * within the context of a @a IxAtmdAccRxVcFreeLowCallback() callback
  635. * for a particular VC
  636. *
  637. * Mbufs provided through this function call can be chained. They will be
  638. * unchained internally. A call to this function with chained mbufs or
  639. * multiple calls with unchained mbufs are equivalent, but calls with
  640. * unchained mbufs are more efficients.
  641. *
  642. * Mbufs provided to this interface need to be able to hold at least one
  643. * full cell payload (48/52 bytes, depending on service type).
  644. * Chained buffers with a size less than the size supported by the hardware
  645. * will be returned through the rx callback provided during the connect step.
  646. *
  647. * Failing to invoke this function prior to enabling the RX traffic
  648. * can result in packet loss.
  649. *
  650. * This function is not reentrant for the same connId.
  651. *
  652. * This function does not use system resources and can be
  653. * invoked from an interrupt context.
  654. *
  655. * @note - Over replenish is detected, and extra mbufs are returned through
  656. * the rx callback provided during the connect step.
  657. *
  658. * @note - Mbuf provided to the replenish function should have a length greater or
  659. * equal to 48/52 bytes according to service type.
  660. *
  661. * @note - The memory cache of mMbuf payload should be invalidated prior to Mbuf
  662. * submission. Flushing the Mbuf headers is handled by IxAtmdAcc.
  663. *
  664. * @note - When a chained mbuf is provided, this function process the mbufs
  665. * up to the hardware limit and invokes the user-supplied callback
  666. * to release extra buffers.
  667. *
  668. * @sa ixAtmdAccRxVcFreeLowCallbackRegister
  669. * @sa IxAtmdAccRxVcFreeLowCallback
  670. * @sa ixAtmdAccRxVcConnect
  671. *
  672. * @param connId @ref IxAtmConnId [in] - connection Id as returned from a succesfull call to
  673. * @a IxAtmdAccRxVcConnect()
  674. * @param mbufPtr @ref IX_OSAL_MBUF [in] - pointer to a mbuf structure to be used for data
  675. * reception. The mbuf pointed to by this parameter can be chained
  676. * to an other mbuf.
  677. *
  678. * @return @li IX_SUCCESS successful call to @a ixAtmdAccRxVcFreeReplenish()
  679. * and the mbuf is now ready to use for incoming traffic.
  680. * @return @li IX_ATMDACC_BUSY cannot process this request because
  681. * the max number of outstanding free buffers has been reached
  682. * or the internal resources have exhausted for this VC.
  683. * The user is responsible for retrying this request later.
  684. * @return @li IX_FAIL cannot process this request because of parameter
  685. * errors or some unspecified internal error has occurred.
  686. *
  687. * @note - It is not always guaranteed the replenish step to be as fast as the
  688. * hardware is consuming Rx Free mbufs. There is nothing in IxAtmdAcc to
  689. * guarantee that replenish reaches the rxFree threshold level. If the
  690. * threshold level is not reached, the next rxFree low notification for
  691. * this channel will not be triggered.
  692. * The preferred ways to replenish can be as follows (depending on
  693. * applications and implementations) :
  694. * @li Replenish in a rxFree low notification until the function
  695. * ixAtmdAccRxVcFreeReplenish() returns IX_ATMDACC_BUSY
  696. * @li Query the queue level using @sa ixAtmdAccRxVcFreeEntriesQuery, then
  697. * , replenish using @a ixAtmdAccRxVcFreeReplenish(), then query the queue
  698. * level again, and replenish if the threshold is still not reached.
  699. * @li Trigger replenish from an other event source and use rxFree starvation
  700. * to throttle the Rx traffic.
  701. *
  702. */
  703. PUBLIC IX_STATUS ixAtmdAccRxVcFreeReplenish (IxAtmConnId connId,
  704. IX_OSAL_MBUF * mbufPtr);
  705. /**
  706. *
  707. * @ingroup IxAtmdAccAPI
  708. *
  709. * @fn ixAtmdAccRxVcFreeLowCallbackRegister (IxAtmConnId connId,
  710. unsigned int numberOfMbufs,
  711. IxAtmdAccRxVcFreeLowCallback callback)
  712. *
  713. * @brief Configure the RX Free threshold value and register a callback
  714. * to handle threshold notifications.
  715. *
  716. * The function ixAtmdAccRxVcFreeLowCallbackRegister sets the threshold value for
  717. * a particular RX VC. When the number of buffers reaches this threshold
  718. * the callback is invoked.
  719. *
  720. * This function should be called once per VC before RX traffic is
  721. * enabled.This function will fail if the curent level of the free buffers
  722. * is equal or less than the threshold value.
  723. *
  724. * @sa ixAtmdAccRxVcFreeLowCallbackRegister
  725. * @sa IxAtmdAccRxVcFreeLowCallback
  726. * @sa ixAtmdAccRxVcFreeReplenish
  727. * @sa ixAtmdAccRxVcFreeEntriesQuery
  728. * @sa ixAtmdAccRxVcConnect
  729. *
  730. * @param connId @ref IxAtmConnId [in] - connection Id as resulted from a succesfull call
  731. * to @a IxAtmdAccRxVcConnect()
  732. * @param numberOfMbufs unsigned int [in] - threshold number of buffers. This number
  733. * has to be a power of 2, one of the values 0,1,2,4,8,16,32....
  734. * The maximum value cannot be more than half of the rxFree queue
  735. * size (which can be retrieved using @a ixAtmdAccRxVcFreeEntriesQuery()
  736. * before any use of the @a ixAtmdAccRxVcFreeReplenish() function)
  737. * @param callback @ref IxAtmdAccRxVcFreeLowCallback [in] - function telling the user that the number of
  738. * free buffers has reduced to the threshold value.
  739. *
  740. * @return @li IX_SUCCESS Threshold set successfully.
  741. * @return @li IX_FAIL parameter error or the current number of free buffers
  742. * is less than or equal to the threshold supplied or some
  743. * unspecified error has occrred.
  744. *
  745. * @note - the callback will be called when the threshold level will drop from
  746. * exactly (numberOfMbufs + 1) to (numberOfMbufs).
  747. *
  748. */
  749. PUBLIC IX_STATUS ixAtmdAccRxVcFreeLowCallbackRegister (IxAtmConnId connId,
  750. unsigned int numberOfMbufs,
  751. IxAtmdAccRxVcFreeLowCallback callback);
  752. /**
  753. *
  754. * @ingroup IxAtmdAccAPI
  755. *
  756. * @fn ixAtmdAccRxVcFreeEntriesQuery (IxAtmConnId connId,
  757. unsigned int *numberOfMbufsPtr)
  758. *
  759. * @brief Get the number of rx mbufs the system can accept to replenish the
  760. * the rx reception mechanism on a particular channel
  761. *
  762. * The ixAtmdAccRxVcFreeEntriesQuery function is used to retrieve the current
  763. * number of available mbuf entries for reception, on a per-VC basis. This
  764. * function can be used to know the number of mbufs which can be provided
  765. * using @a ixAtmdAccRxVcFreeReplenish().
  766. *
  767. * This function can be used from a timer context, or can be associated
  768. * with a threshold event, or can be used inside an active polling
  769. * mechanism which is under user control.
  770. *
  771. * This function is reentrant and does not use system resources and can
  772. * be invoked from an interrupt context.
  773. *
  774. * @param connId @ref IxAtmConnId [in] - connection Id as resulted from a succesfull call
  775. * to @a IxAtmdAccRxVcConnect()
  776. * @param numberOfMbufsPtr unsigned int [out] - Pointer to the number of available entries.
  777. * . This parameter cannot be a null pointer.
  778. *
  779. * @return @li IX_SUCCESS the current number of mbufs not yet used for incoming traffic
  780. * @return @li IX_FAIL invalid parameter
  781. *
  782. * @sa ixAtmdAccRxVcFreeReplenish
  783. *
  784. */
  785. PUBLIC IX_STATUS ixAtmdAccRxVcFreeEntriesQuery (IxAtmConnId connId,
  786. unsigned int *numberOfMbufsPtr);
  787. /**
  788. *
  789. * @ingroup IxAtmdAccAPI
  790. *
  791. * @fn ixAtmdAccRxVcEnable (IxAtmConnId connId)
  792. *
  793. * @brief Start the RX service on a VC.
  794. *
  795. * This functions kicks-off the traffic reception for a particular VC.
  796. * Once invoked, incoming PDUs will be made available by the hardware
  797. * and are eventually directed to the @a IxAtmdAccRxVcRxCallback() callback
  798. * registered for the connection.
  799. *
  800. * If the traffic is already running, this function returns IX_SUCCESS.
  801. * This function can be invoked many times.
  802. *
  803. * IxAtmdAccRxVcFreeLowCallback event will occur only after
  804. * @a ixAtmdAccRxVcEnable() function is invoked.
  805. *
  806. * Before using this function, the @a ixAtmdAccRxVcFreeReplenish() function
  807. * has to be used to replenish the RX Free queue. If not, incoming traffic
  808. * may be discarded.and in the case of interrupt driven reception the
  809. * @a IxAtmdAccRxVcFreeLowCallback() callback may be invoked as a side effect
  810. * during a replenish action.
  811. *
  812. * This function is not reentrant and should not be used inside an
  813. * interrupt context.
  814. *
  815. * For an VC connection this function can be called after a call to
  816. * @a ixAtmdAccRxVcDisable() and should not be called after
  817. * @a ixAtmdAccRxVcTryDisconnect()
  818. *
  819. * @sa ixAtmdAccRxVcDisable
  820. * @sa ixAtmdAccRxVcConnect
  821. * @sa ixAtmdAccRxVcFreeReplenish
  822. *
  823. * @param connId @ref IxAtmConnId [in] - connection Id as resulted from a succesfull call
  824. * to @a IxAtmdAccRxVcConnect()
  825. *
  826. * @return @li IX_SUCCESS successful call to ixAtmdAccRxVcEnable
  827. * @return @li IX_ATMDACC_WARNING the channel is already enabled
  828. * @return @li IX_FAIL invalid parameters or some unspecified internal
  829. * error occured.
  830. *
  831. */
  832. PUBLIC IX_STATUS ixAtmdAccRxVcEnable (IxAtmConnId connId);
  833. /**
  834. *
  835. * @ingroup IxAtmdAccAPI
  836. *
  837. * @fn ixAtmdAccRxVcDisable (IxAtmConnId connId)
  838. *
  839. * @brief Stop the RX service on a VC.
  840. *
  841. * This functions stops the traffic reception for a particular VC connection.
  842. *
  843. * Once invoked, incoming Pdus are discarded by the hardware. Any Pdus
  844. * pending will be freed to the user
  845. *
  846. * Hence once this function returns no more receive callbacks will be
  847. * called for that VC. However, buffer free callbacks will be invoked
  848. * until such time as all buffers supplied by the user have been freed
  849. * back to the user
  850. *
  851. * Calling this function doe not invalidate the connId.
  852. * @a ixAtmdAccRxVcEnable() can be invoked to enable Pdu reception again.
  853. *
  854. * If the traffic is already stopped, this function returns IX_SUCCESS.
  855. *
  856. * This function is not reentrant and should not be used inside an
  857. * interrupt context.
  858. *
  859. * @sa ixAtmdAccRxVcConnect
  860. * @sa ixAtmdAccRxVcEnable
  861. * @sa ixAtmdAccRxVcDisable
  862. *
  863. * @param connId @ref IxAtmConnId [in] - connection Id as resulted from a succesfull call to @a
  864. * IxAtmdAccRxVcConnect()
  865. *
  866. * @return @li IX_SUCCESS successful call to @a ixAtmdAccRxVcDisable().
  867. * @return @li IX_ATMDACC_WARNING the channel is already disabled
  868. * @return @li IX_FAIL invalid parameters or some unspecified internal error occured
  869. *
  870. */
  871. PUBLIC IX_STATUS ixAtmdAccRxVcDisable (IxAtmConnId connId);
  872. /**
  873. *
  874. * @ingroup IxAtmdAccAPI
  875. *
  876. * @fn ixAtmdAccRxVcTryDisconnect (IxAtmConnId connId)
  877. *
  878. * @brief Disconnect a VC from the RX service.
  879. *
  880. * This function deregisters the VC and guarantees that all resources
  881. * associated with this VC are free. After its execution, the connection
  882. * Id is not available.
  883. *
  884. * This function will fail until such time as all resources allocated to
  885. * the VC connection have been freed. The user is responsible to delay and
  886. * call again this function many times until a success status is returned.
  887. *
  888. * This function needs internal locks and should not be called from an
  889. * interrupt context
  890. *
  891. * @param connId @ref IxAtmConnId [in] - connection Id as resulted from a succesfull call to
  892. * @a IxAtmdAccRxVcConnect()
  893. *
  894. * @return @li IX_SUCCESS successful call to ixAtmdAccRxVcDisable
  895. * @return @li IX_ATMDACC_RESOURCES_STILL_ALLOCATED not all resources
  896. * associated with the connection have been freed.
  897. * @return @li IX_FAIL cannot process this request because of a parameter
  898. * error
  899. *
  900. */
  901. PUBLIC IX_STATUS ixAtmdAccRxVcTryDisconnect (IxAtmConnId connId);
  902. /* ------------------------------------------------------
  903. Part of the IxAtmdAcc interface related to TX traffic
  904. ------------------------------------------------------ */
  905. /**
  906. *
  907. * @ingroup IxAtmdAccAPI
  908. *
  909. * @fn ixAtmdAccTxVcConnect (IxAtmLogicalPort port,
  910. unsigned int vpi,
  911. unsigned int vci,
  912. IxAtmdAccAalType aalServiceType,
  913. IxAtmdAccUserId userId,
  914. IxAtmdAccTxVcBufferReturnCallback bufferFreeCallback,
  915. IxAtmConnId * connIdPtr)
  916. *
  917. * @brief Connect to a Aal Pdu transmit service for a particular
  918. * port/vpi/vci and service type.
  919. *
  920. * This function allows a user to connect to an Aal5/Aal0/OAM Pdu transmit service
  921. * for a particular port/vpi/vci. It registers the callback and allocates
  922. * internal resources and a Connection Id to be used in further API calls
  923. * related to this VC.
  924. *
  925. * The function will setup VC transmit service on the specified on the
  926. * specified port. A connId is the reference by which IxAtmdAcc refers to a
  927. * connected VC. This identifier is the result of a succesful call
  928. * to a connect function. This identifier is invalid after a
  929. * sucessful call to a disconnect function.
  930. *
  931. * This function needs internal locks, and hence should not be called
  932. * from an interrupt context.
  933. *
  934. * On return from @a ixAtmdAccTxVcConnect() with a failure status, the
  935. * connection Id parameter is unspecified. Its value cannot be used.
  936. *
  937. * Calling this function for the same combination of port, Vpi, Vci and
  938. * more than once without calling @a ixAtmdAccTxVcTryDisconnect() will result
  939. * in a failure status.
  940. *
  941. * Two AAL0 services supporting 48 or 52 byte cell data are provided.
  942. * Submitted AAL0 PDUs must be a multiple of the cell data size (48/52).
  943. * AAL0_52 is a raw cell service the client must format
  944. * the PDU with an ATM cell header (excluding HEC) at the start of
  945. * each cell, note that AtmdAcc does not validate the cell headers in
  946. * a submitted PDU.
  947. *
  948. * For the OAM service an "OAM Tx channel" may be enabled for a port
  949. * by establishing a single dedicated OAM Tx connection on that port.
  950. *
  951. * The OAM service allows buffers containing 52 byte OAM F4/F5 cells
  952. * to be transmitted and received over the dedicated OAM channels.
  953. * HEC is appended/removed, and CRC-10 performed by the NPE. The OAM
  954. * service offered by AtmdAcc is a raw cell transport service.
  955. * It is assumed that ITU I.610 procedures that make use of this
  956. * service are implemented above AtmdAcc.
  957. *
  958. * Note that the dedicated OAM connections are established on
  959. * reserved VPI,VCI, and (in the case of Rx) port values.
  960. * These values are used purely to descriminate the dedicated OAM channels
  961. * and do not identify a particular OAM F4/F5 flow. F4/F5 flows may be
  962. * realised for particluar VPI/VCIs by manipulating the VPI,VCI
  963. * fields of the ATM cell headers of cells in the buffers passed
  964. * to AtmdAcc.
  965. *
  966. * Calling this function before enabling the port will fail.
  967. *
  968. * @sa ixAtmdAccTxVcTryDisconnect
  969. * @sa ixAtmdAccPortTxScheduledModeEnable
  970. * @sa ixAtmdAccPortEnable
  971. *
  972. * @param port @ref IxAtmLogicalPort [in] - VC identification : logical PHY port
  973. * [@a IX_UTOPIA_PORT_0 .. @a IX_UTOPIA_MAX_PORTS - 1]
  974. * @param vpi unsigned int [in] - VC identification : ATM Vpi [0..255] or IX_ATMDACC_OAM_VPI
  975. * @param vci unsigned int [in] - VC identification : ATM Vci [0..65535] or IX_ATMDACC_OAM_VCI
  976. * @param aalServiceType @ref IxAtmdAccAalType [in] - type of service AAL5, AAL0_48, AAL0_52, or OAM
  977. * @param userId @ref IxAtmdAccUserId [in] - user id to be used later during callbacks related
  978. * to this channel
  979. * @param bufferFreeCallback @ref IxAtmdAccTxVcBufferReturnCallback [in] - function called when mbufs
  980. * transmission is complete. This parameter cannot be a null
  981. * pointer.
  982. * @param connIdPtr @ref IxAtmConnId [out] - Pointer to a connection Id.
  983. * This parameter cannot be a null pointer.
  984. *
  985. * @return @li IX_SUCCESS successful call to @a IxAtmdAccRxVcConnect().
  986. * @return @li IX_ATMDACC_BUSY cannot process this request
  987. * because no VC is available
  988. * @return @li IX_FAIL
  989. * parameter error,
  990. * VC already in use,
  991. * attempt to connect AAL service on reserved OAM VPI/VCI,
  992. * attempt to connect OAM service on VPI/VCI other than the reserved OAM VPI/VCI,
  993. * port is not initialised,
  994. * or some other error occurs during processing.
  995. *
  996. * @note - Unscheduled mode is not supported in ixp425 1.0. Therefore, the
  997. * function @a ixAtmdAccPortTxScheduledModeEnable() need to be called
  998. * for this port before any establishing a Tx Connection
  999. */
  1000. PUBLIC IX_STATUS ixAtmdAccTxVcConnect (IxAtmLogicalPort port,
  1001. unsigned int vpi,
  1002. unsigned int vci,
  1003. IxAtmdAccAalType aalServiceType,
  1004. IxAtmdAccUserId userId,
  1005. IxAtmdAccTxVcBufferReturnCallback bufferFreeCallback,
  1006. IxAtmConnId * connIdPtr);
  1007. /**
  1008. *
  1009. * @ingroup IxAtmdAccAPI
  1010. *
  1011. * @fn ixAtmdAccTxVcPduSubmit (IxAtmConnId connId,
  1012. IX_OSAL_MBUF * mbufPtr,
  1013. IxAtmdAccClpStatus clp,
  1014. unsigned int numberOfCells)
  1015. *
  1016. * @brief Submit a Pdu for transmission on connection.
  1017. *
  1018. * A data user calls this function to submit an mbufs containing a Pdu
  1019. * to be transmitted. The buffer supplied can be chained and the Pdu it
  1020. * contains must be complete.
  1021. *
  1022. * The transmission behavior of this call depends on the operational mode
  1023. * of the port on which the connection is made.
  1024. *
  1025. * In unscheduled mode the mbuf will be submitted to the hardware
  1026. * immediately if sufficent resource is available. Otherwise the function
  1027. * will return failure.
  1028. *
  1029. * In scheduled mode the buffer is queued internally in IxAtmdAcc. The cell
  1030. * demand is made known to the traffic shaping entity. Cells from the
  1031. * buffers are MUXed onto the port some time later as dictated by the
  1032. * traffic shaping entity. The traffic shaping entity does this by sending
  1033. * transmit schedules to IxAtmdAcc via @a ixAtmdAccPortTxProcess() function call.
  1034. *
  1035. * Note that the dedicated OAM channel is scheduled just like any
  1036. * other channel. This means that any OAM traffic relating to an
  1037. * active AAL0/AAL5 connection will be scheduled independantly of the
  1038. * AAL0/AAL5 traffic for that connection.
  1039. *
  1040. * When transmission is complete, the TX Done mechanism will give the
  1041. * owmnership of these buffers back to the customer. The tx done mechanism
  1042. * must be in operation before transmission is attempted.
  1043. *
  1044. * For AAL0/OAM submitted AAL0 PDUs must be a multiple of the cell data
  1045. * size (48/52). AAL0_52 and OAM are raw cell services, and the client
  1046. * must format the PDU with an ATM cell header (excluding HEC) at the
  1047. * start of each cell, note that AtmdAcc does not validate the cell headers in
  1048. * a submitted PDU.
  1049. *
  1050. *
  1051. * @sa IxAtmdAccTxVcBufferReturnCallback
  1052. * @sa ixAtmdAccTxDoneDispatch
  1053. *
  1054. * @param connId @ref IxAtmConnId [in] - connection Id as resulted from a succesfull call to
  1055. * @a ixAtmdAccTxVcConnect()
  1056. * @param mbufPtr @ref IX_OSAL_MBUF [in] - pointer to a chained structure of mbufs to transmit.
  1057. * This parameter cannot be a null pointer.
  1058. * @param clp @ref IxAtmdAccClpStatus [in] - clp indication for this PDU. All cells of this pdu
  1059. * will be sent with the clp bit set
  1060. * @param numberOfCells unsigned int [in] - number of cells in the PDU.
  1061. *
  1062. * @return @li IX_SUCCESS successful call to @a ixAtmdAccTxVcPduSubmit()
  1063. * The pdu pointed by the mbufPtr parameter will be
  1064. * transmitted
  1065. * @return @li IX_ATMDACC_BUSY unable to process this request because
  1066. * internal resources are all used. The caller is responsible
  1067. * for retrying this request later.
  1068. * @return @li IX_FAIL unable to process this request because of error
  1069. * in the parameters (wrong connId supplied,
  1070. * or wrong mbuf pointer supplied), the total length of all buffers
  1071. * in the chain should be a multiple of the cell size
  1072. * ( 48/52 depending on the service type ),
  1073. * or unspecified error during processing
  1074. *
  1075. * @note - This function in not re-entrant for the same VC (e.g. : two
  1076. * thread cannot send PDUs for the same VC). But two threads can
  1077. * safely call this function with a different connection Id
  1078. *
  1079. * @note - In unscheduled mode, this function is not re-entrant on a per
  1080. * port basis. The size of pdus is limited to 8Kb.
  1081. *
  1082. * @note - 0-length mbufs should be removed from the chain before submission.
  1083. * The total length of the pdu (sdu + padding +trailer) has to be
  1084. * updated in the header of the first mbuf of a chain of mbufs.
  1085. *
  1086. * @note - Aal5 trailer information (UUI, CPI, SDU length) has to be supplied
  1087. * before submission.
  1088. *
  1089. * @note - The payload memory cache should be flushed, if needed, prior to
  1090. * transmission. Mbuf headers are flushed by IxAtmdAcc
  1091. *
  1092. * @note - This function does not use system resources and can be used
  1093. * inside an interrupt context
  1094. */
  1095. PUBLIC IX_STATUS ixAtmdAccTxVcPduSubmit (IxAtmConnId connId,
  1096. IX_OSAL_MBUF * mbufPtr,
  1097. IxAtmdAccClpStatus clp,
  1098. unsigned int numberOfCells);
  1099. /**
  1100. *
  1101. * @ingroup IxAtmdAccAPI
  1102. *
  1103. * @fn ixAtmdAccTxVcTryDisconnect (IxAtmConnId connId)
  1104. *
  1105. * @brief Disconnect from a Aal Pdu transmit service for a particular
  1106. * port/vpi/vci.
  1107. *
  1108. * This function deregisters the VC and guarantees that all resources
  1109. * associated with this VC are free. After its execution, the connection
  1110. * Id is not available.
  1111. *
  1112. * This function will fail until such time as all resources allocated to
  1113. * the VC connection have been freed. The user is responsible to delay
  1114. * and call again this function many times until a success status is
  1115. * returned.
  1116. *
  1117. * After its execution, the connection Id is not available.
  1118. *
  1119. * @param connId @ref IxAtmConnId [in] - connection Id as resulted from a succesfull call to
  1120. * @a ixAtmdAccTxVcConnect()
  1121. *
  1122. * @return @li IX_SUCCESS successful call to @a ixAtmdAccTxVcTryDisconnect()
  1123. * @return @li IX_ATMDACC_RESOURCES_STILL_ALLOCATED not all resources
  1124. * associated with the connection have been freed. This condition will
  1125. * disappear after Tx and TxDone is complete for this channel.
  1126. * @return @li IX_FAIL unable to process this request because of errors
  1127. * in the parameters (wrong connId supplied)
  1128. *
  1129. * @note - This function needs internal locks and should not be called
  1130. * from an interrupt context
  1131. *
  1132. * @note - If the @a IX_ATMDACC_RESOURCES_STILL_ALLOCATED error does not
  1133. * clear after a while, this may be linked to a previous problem
  1134. * of cell overscheduling. Diabling the port and retry a disconnect
  1135. * will free the resources associated with this channel.
  1136. *
  1137. * @sa ixAtmdAccPortTxProcess
  1138. *
  1139. */
  1140. PUBLIC IX_STATUS ixAtmdAccTxVcTryDisconnect (IxAtmConnId connId);
  1141. #endif /* IXATMDACC_H */
  1142. /**
  1143. * @} defgroup IxAtmdAccAPI
  1144. */