IxHssAcc.h 47 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316
  1. /**
  2. * @file IxHssAcc.h
  3. *
  4. * @date 07-DEC-2001
  5. *
  6. * @brief This file contains the public API of the IXP400 HSS Access
  7. * component
  8. *
  9. *
  10. * @par
  11. * IXP400 SW Release version 2.0
  12. *
  13. * -- Copyright Notice --
  14. *
  15. * @par
  16. * Copyright 2001-2005, Intel Corporation.
  17. * All rights reserved.
  18. *
  19. * @par
  20. * Redistribution and use in source and binary forms, with or without
  21. * modification, are permitted provided that the following conditions
  22. * are met:
  23. * 1. Redistributions of source code must retain the above copyright
  24. * notice, this list of conditions and the following disclaimer.
  25. * 2. Redistributions in binary form must reproduce the above copyright
  26. * notice, this list of conditions and the following disclaimer in the
  27. * documentation and/or other materials provided with the distribution.
  28. * 3. Neither the name of the Intel Corporation nor the names of its contributors
  29. * may be used to endorse or promote products derived from this software
  30. * without specific prior written permission.
  31. *
  32. * @par
  33. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS IS''
  34. * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  35. * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
  36. * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
  37. * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  38. * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
  39. * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  40. * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
  41. * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
  42. * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  43. * SUCH DAMAGE.
  44. *
  45. * @par
  46. * -- End of Copyright Notice --
  47. */
  48. /* ------------------------------------------------------
  49. Doxygen group definitions
  50. ------------------------------------------------------ */
  51. /**
  52. * @defgroup IxHssAccAPI IXP400 HSS Access (IxHssAcc) API
  53. *
  54. * @brief The public API for the IXP400 HssAccess component
  55. *
  56. * IxHssAcc is the access layer to the HSS packetised and channelised
  57. * services
  58. *
  59. * <b> Design Notes </b><br>
  60. * <UL>
  61. * <LI>When a packet-pipe is configured for 56Kbps RAW mode, byte alignment of
  62. * the transmitted data is not preserved. All raw data that is transmitted
  63. * will be received in proper order by the receiver, but the first bit of
  64. * the packet may be seen at any offset within a byte; all subsequent bytes
  65. * will have the same offset for the duration of the packet. The same offset
  66. * also applies to all subsequent packets received on the packet-pipe too.
  67. * (Similar results will occur for data received from remote end.) While
  68. * this behavior will also occur for 56Kbps HDLC mode, the HDLC
  69. * encoding/decoding will preserve the original byte alignment at the
  70. * receiver end.
  71. * </UL>
  72. *
  73. * <b> 56Kbps Packetised Service Bandwidth Limitation </b><br>
  74. * <UL>
  75. * <LI>IxHssAcc supports 56Kbps packetised service at a maximum aggregate rate
  76. * for all HSS ports/HDLC channels of 12.288Mbps[1] in each direction, i.e.
  77. * it supports 56Kbps packetised service on up to 8 T1 trunks. It does
  78. * not support 56Kbps packetised service on 8 E1 trunks (i.e. 4 trunks per
  79. * HSS port) unless those trunks are running 'fractional E1' with maximum
  80. * aggregate rate of 12.288 Mbps in each direction.<br>
  81. * [1] 12.288Mbps = 1.536Mbp * 8 T1
  82. * </UL>
  83. * @{ */
  84. #ifndef IXHSSACC_H
  85. #define IXHSSACC_H
  86. #include "IxOsal.h"
  87. /*
  88. * #defines for function return types, etc.
  89. */
  90. /**
  91. * @def IX_HSSACC_TSLOTS_PER_HSS_PORT
  92. *
  93. * @brief The max number of TDM timeslots supported per HSS port - 4E1's =
  94. * 32x4 = 128
  95. */
  96. #define IX_HSSACC_TSLOTS_PER_HSS_PORT 128
  97. /* -----------------------------------------------------------
  98. The following are HssAccess return values returned through
  99. service interfaces. The globally defined IX_SUCCESS (0) and
  100. IX_FAIL (1) in IxOsalTypes.h are also used.
  101. ----------------------------------------------------------- */
  102. /**
  103. * @def IX_HSSACC_PARAM_ERR
  104. *
  105. * @brief HssAccess function return value for a parameter error
  106. */
  107. #define IX_HSSACC_PARAM_ERR 2
  108. /**
  109. * @def IX_HSSACC_RESOURCE_ERR
  110. *
  111. * @brief HssAccess function return value for a resource error
  112. */
  113. #define IX_HSSACC_RESOURCE_ERR 3
  114. /**
  115. * @def IX_HSSACC_PKT_DISCONNECTING
  116. *
  117. * @brief Indicates that a disconnect call is progressing and will
  118. * disconnect soon
  119. */
  120. #define IX_HSSACC_PKT_DISCONNECTING 4
  121. /**
  122. * @def IX_HSSACC_Q_WRITE_OVERFLOW
  123. *
  124. * @brief Indicates that an attempt to Tx or to replenish an
  125. * RxFree Q failed due to Q overflow.
  126. */
  127. #define IX_HSSACC_Q_WRITE_OVERFLOW 5
  128. /* -------------------------------------------------------------------
  129. The following errors are HSS/NPE errors returned on error retrieval
  130. ------------------------------------------------------------------- */
  131. /**
  132. * @def IX_HSSACC_NO_ERROR
  133. *
  134. * @brief HSS port no error present
  135. */
  136. #define IX_HSSACC_NO_ERROR 0
  137. /**
  138. * @def IX_HSSACC_TX_FRM_SYNC_ERR
  139. *
  140. * @brief HSS port TX Frame Sync error
  141. */
  142. #define IX_HSSACC_TX_FRM_SYNC_ERR 1
  143. /**
  144. * @def IX_HSSACC_TX_OVER_RUN_ERR
  145. *
  146. * @brief HSS port TX over-run error
  147. */
  148. #define IX_HSSACC_TX_OVER_RUN_ERR 2
  149. /**
  150. * @def IX_HSSACC_CHANNELISED_SW_TX_ERR
  151. *
  152. * @brief NPE software error in channelised TX
  153. */
  154. #define IX_HSSACC_CHANNELISED_SW_TX_ERR 3
  155. /**
  156. * @def IX_HSSACC_PACKETISED_SW_TX_ERR
  157. *
  158. * @brief NPE software error in packetised TX
  159. */
  160. #define IX_HSSACC_PACKETISED_SW_TX_ERR 4
  161. /**
  162. * @def IX_HSSACC_RX_FRM_SYNC_ERR
  163. *
  164. * @brief HSS port RX Frame Sync error
  165. */
  166. #define IX_HSSACC_RX_FRM_SYNC_ERR 5
  167. /**
  168. * @def IX_HSSACC_RX_OVER_RUN_ERR
  169. *
  170. * @brief HSS port RX over-run error
  171. */
  172. #define IX_HSSACC_RX_OVER_RUN_ERR 6
  173. /**
  174. * @def IX_HSSACC_CHANNELISED_SW_RX_ERR
  175. *
  176. * @brief NPE software error in channelised RX
  177. */
  178. #define IX_HSSACC_CHANNELISED_SW_RX_ERR 7
  179. /**
  180. * @def IX_HSSACC_PACKETISED_SW_RX_ERR
  181. *
  182. * @brief NPE software error in packetised TX
  183. */
  184. #define IX_HSSACC_PACKETISED_SW_RX_ERR 8
  185. /* -----------------------------------
  186. Packetised service specific defines
  187. ----------------------------------- */
  188. /**
  189. * @def IX_HSSACC_PKT_MIN_RX_MBUF_SIZE
  190. *
  191. * @brief Minimum size of the Rx mbuf in bytes which the client must supply
  192. * to the component.
  193. */
  194. #define IX_HSSACC_PKT_MIN_RX_MBUF_SIZE 64
  195. /* --------------------------------------------------------------------
  196. Enumerated Types - these enumerated values may be used in setting up
  197. the contents of hardware registers
  198. -------------------------------------------------------------------- */
  199. /**
  200. * @enum IxHssAccHssPort
  201. * @brief The HSS port ID - There are two identical ports (0-1).
  202. *
  203. */
  204. typedef enum
  205. {
  206. IX_HSSACC_HSS_PORT_0, /**< HSS Port 0 */
  207. IX_HSSACC_HSS_PORT_1, /**< HSS Port 1 */
  208. IX_HSSACC_HSS_PORT_MAX /**< Delimiter for error checks */
  209. } IxHssAccHssPort;
  210. /**
  211. * @enum IxHssAccHdlcPort
  212. * @brief The HDLC port ID - There are four identical HDLC ports (0-3) per
  213. * HSS port and they correspond to the 4 E1/T1 trunks.
  214. *
  215. */
  216. typedef enum
  217. {
  218. IX_HSSACC_HDLC_PORT_0, /**< HDLC Port 0 */
  219. IX_HSSACC_HDLC_PORT_1, /**< HDLC Port 1 */
  220. IX_HSSACC_HDLC_PORT_2, /**< HDLC Port 2 */
  221. IX_HSSACC_HDLC_PORT_3, /**< HDLC Port 3 */
  222. IX_HSSACC_HDLC_PORT_MAX /**< Delimiter for error checks */
  223. } IxHssAccHdlcPort;
  224. /**
  225. * @enum IxHssAccTdmSlotUsage
  226. * @brief The HSS TDM stream timeslot assignment types
  227. *
  228. */
  229. typedef enum
  230. {
  231. IX_HSSACC_TDMMAP_UNASSIGNED, /**< Unassigned */
  232. IX_HSSACC_TDMMAP_HDLC, /**< HDLC - packetised */
  233. IX_HSSACC_TDMMAP_VOICE56K, /**< Voice56K - channelised */
  234. IX_HSSACC_TDMMAP_VOICE64K, /**< Voice64K - channelised */
  235. IX_HSSACC_TDMMAP_MAX /**< Delimiter for error checks */
  236. } IxHssAccTdmSlotUsage;
  237. /**
  238. * @enum IxHssAccFrmSyncType
  239. * @brief The HSS frame sync pulse type
  240. *
  241. */
  242. typedef enum
  243. {
  244. IX_HSSACC_FRM_SYNC_ACTIVE_LOW, /**< Frame sync is sampled low */
  245. IX_HSSACC_FRM_SYNC_ACTIVE_HIGH, /**< sampled high */
  246. IX_HSSACC_FRM_SYNC_FALLINGEDGE, /**< sampled on a falling edge */
  247. IX_HSSACC_FRM_SYNC_RISINGEDGE, /**< sampled on a rising edge */
  248. IX_HSSACC_FRM_SYNC_TYPE_MAX /**< Delimiter for error checks */
  249. } IxHssAccFrmSyncType;
  250. /**
  251. * @enum IxHssAccFrmSyncEnable
  252. * @brief The IxHssAccFrmSyncEnable determines how the frame sync pulse is
  253. * used
  254. * */
  255. typedef enum
  256. {
  257. IX_HSSACC_FRM_SYNC_INPUT, /**< Frame sync is sampled as an input */
  258. IX_HSSACC_FRM_SYNC_INVALID_VALUE, /**< 1 is not used */
  259. IX_HSSACC_FRM_SYNC_OUTPUT_FALLING, /**< Frame sync is an output generated
  260. off a falling clock edge */
  261. IX_HSSACC_FRM_SYNC_OUTPUT_RISING, /**< Frame sync is an output generated
  262. off a rising clock edge */
  263. IX_HSSACC_FRM_SYNC_ENABLE_MAX /**< Delimiter for error checks */
  264. } IxHssAccFrmSyncEnable;
  265. /**
  266. * @enum IxHssAccClkEdge
  267. * @brief IxHssAccClkEdge is used to determine the clk edge to use for
  268. * framing and data
  269. *
  270. */
  271. typedef enum
  272. {
  273. IX_HSSACC_CLK_EDGE_FALLING, /**< Clock sampled off a falling edge */
  274. IX_HSSACC_CLK_EDGE_RISING, /**< Clock sampled off a rising edge */
  275. IX_HSSACC_CLK_EDGE_MAX /**< Delimiter for error checks */
  276. } IxHssAccClkEdge;
  277. /**
  278. * @enum IxHssAccClkDir
  279. * @brief The HSS clock direction
  280. *
  281. */
  282. typedef enum
  283. {
  284. IX_HSSACC_SYNC_CLK_DIR_INPUT, /**< Clock is an input */
  285. IX_HSSACC_SYNC_CLK_DIR_OUTPUT, /**< Clock is an output */
  286. IX_HSSACC_SYNC_CLK_DIR_MAX /**< Delimiter for error checks */
  287. } IxHssAccClkDir;
  288. /**
  289. * @enum IxHssAccFrmPulseUsage
  290. * @brief The HSS frame pulse usage
  291. *
  292. */
  293. typedef enum
  294. {
  295. IX_HSSACC_FRM_PULSE_ENABLED, /**< Generate/Receive frame pulses */
  296. IX_HSSACC_FRM_PULSE_DISABLED, /**< Disregard frame pulses */
  297. IX_HSSACC_FRM_PULSE_MAX /**< Delimiter for error checks */
  298. } IxHssAccFrmPulseUsage;
  299. /**
  300. * @enum IxHssAccDataRate
  301. * @brief The HSS Data rate in relation to the clock
  302. *
  303. */
  304. typedef enum
  305. {
  306. IX_HSSACC_CLK_RATE, /**< Data rate is at the configured clk speed */
  307. IX_HSSACC_HALF_CLK_RATE, /**< Data rate is half the configured clk speed */
  308. IX_HSSACC_DATA_RATE_MAX /**< Delimiter for error checks */
  309. } IxHssAccDataRate;
  310. /**
  311. * @enum IxHssAccDataPolarity
  312. * @brief The HSS data polarity type
  313. *
  314. */
  315. typedef enum
  316. {
  317. IX_HSSACC_DATA_POLARITY_SAME, /**< Don't invert data between NPE and
  318. HSS FIFOs */
  319. IX_HSSACC_DATA_POLARITY_INVERT, /**< Invert data between NPE and HSS
  320. FIFOs */
  321. IX_HSSACC_DATA_POLARITY_MAX /**< Delimiter for error checks */
  322. } IxHssAccDataPolarity;
  323. /**
  324. * @enum IxHssAccBitEndian
  325. * @brief HSS Data endianness
  326. *
  327. */
  328. typedef enum
  329. {
  330. IX_HSSACC_LSB_ENDIAN, /**< TX/RX Least Significant Bit first */
  331. IX_HSSACC_MSB_ENDIAN, /**< TX/RX Most Significant Bit first */
  332. IX_HSSACC_ENDIAN_MAX /**< Delimiter for the purposes of error checks */
  333. } IxHssAccBitEndian;
  334. /**
  335. * @enum IxHssAccDrainMode
  336. * @brief Tx pin open drain mode
  337. *
  338. */
  339. typedef enum
  340. {
  341. IX_HSSACC_TX_PINS_NORMAL, /**< Normal mode */
  342. IX_HSSACC_TX_PINS_OPEN_DRAIN, /**< Open Drain mode */
  343. IX_HSSACC_TX_PINS_MAX /**< Delimiter for error checks */
  344. } IxHssAccDrainMode;
  345. /**
  346. * @enum IxHssAccSOFType
  347. * @brief HSS start of frame types
  348. *
  349. */
  350. typedef enum
  351. {
  352. IX_HSSACC_SOF_FBIT, /**< Framing bit transmitted and expected on rx */
  353. IX_HSSACC_SOF_DATA, /**< Framing bit not transmitted nor expected on rx */
  354. IX_HSSACC_SOF_MAX /**< Delimiter for error checks */
  355. } IxHssAccSOFType;
  356. /**
  357. * @enum IxHssAccDataEnable
  358. * @brief IxHssAccDataEnable is used to determine whether or not to drive
  359. * the data pins
  360. *
  361. */
  362. typedef enum
  363. {
  364. IX_HSSACC_DE_TRI_STATE, /**< TRI-State the data pins */
  365. IX_HSSACC_DE_DATA, /**< Push data out the data pins */
  366. IX_HSSACC_DE_MAX /**< Delimiter for error checks */
  367. } IxHssAccDataEnable;
  368. /**
  369. * @enum IxHssAccTxSigType
  370. * @brief IxHssAccTxSigType is used to determine how to drive the data pins
  371. *
  372. */
  373. typedef enum
  374. {
  375. IX_HSSACC_TXSIG_LOW, /**< Drive the data pins low */
  376. IX_HSSACC_TXSIG_HIGH, /**< Drive the data pins high */
  377. IX_HSSACC_TXSIG_HIGH_IMP, /**< Drive the data pins with high impedance */
  378. IX_HSSACC_TXSIG_MAX /**< Delimiter for error checks */
  379. } IxHssAccTxSigType;
  380. /**
  381. * @enum IxHssAccFbType
  382. * @brief IxHssAccFbType determines how to drive the Fbit
  383. *
  384. * @warning This will only be used for T1 @ 1.544MHz
  385. *
  386. */
  387. typedef enum
  388. {
  389. IX_HSSACC_FB_FIFO, /**< Fbit is dictated in FIFO */
  390. IX_HSSACC_FB_HIGH_IMP, /**< Fbit is high impedance */
  391. IX_HSSACC_FB_MAX /**< Delimiter for error checks */
  392. } IxHssAccFbType;
  393. /**
  394. * @enum IxHssAcc56kEndianness
  395. * @brief 56k data endianness when using the 56k type
  396. *
  397. */
  398. typedef enum
  399. {
  400. IX_HSSACC_56KE_BIT_7_UNUSED, /**< High bit is unused */
  401. IX_HSSACC_56KE_BIT_0_UNUSED, /**< Low bit is unused */
  402. IX_HSSACC_56KE_MAX /**< Delimiter for error checks */
  403. } IxHssAcc56kEndianness;
  404. /**
  405. * @enum IxHssAcc56kSel
  406. * @brief 56k data transmission type when using the 56k type
  407. *
  408. */
  409. typedef enum
  410. {
  411. IX_HSSACC_56KS_32_8_DATA, /**< 32/8 bit data */
  412. IX_HSSACC_56KS_56K_DATA, /**< 56K data */
  413. IX_HSSACC_56KS_MAX /**< Delimiter for error checks */
  414. } IxHssAcc56kSel;
  415. /**
  416. * @enum IxHssAccClkSpeed
  417. * @brief IxHssAccClkSpeed represents the HSS clock speeds available
  418. *
  419. */
  420. typedef enum
  421. {
  422. IX_HSSACC_CLK_SPEED_512KHZ, /**< 512KHz */
  423. IX_HSSACC_CLK_SPEED_1536KHZ, /**< 1.536MHz */
  424. IX_HSSACC_CLK_SPEED_1544KHZ, /**< 1.544MHz */
  425. IX_HSSACC_CLK_SPEED_2048KHZ, /**< 2.048MHz */
  426. IX_HSSACC_CLK_SPEED_4096KHZ, /**< 4.096MHz */
  427. IX_HSSACC_CLK_SPEED_8192KHZ, /**< 8.192MHz */
  428. IX_HSSACC_CLK_SPEED_MAX /**< Delimiter for error checking */
  429. } IxHssAccClkSpeed;
  430. /**
  431. * @enum IxHssAccPktStatus
  432. * @brief Indicates the status of packets passed to the client
  433. *
  434. */
  435. typedef enum
  436. {
  437. IX_HSSACC_PKT_OK, /**< Error free.*/
  438. IX_HSSACC_STOP_SHUTDOWN_ERROR, /**< Errored due to stop or shutdown
  439. occurrance.*/
  440. IX_HSSACC_HDLC_ALN_ERROR, /**< HDLC alignment error */
  441. IX_HSSACC_HDLC_FCS_ERROR, /**< HDLC Frame Check Sum error.*/
  442. IX_HSSACC_RXFREE_Q_EMPTY_ERROR, /**< RxFree Q became empty
  443. while receiving this packet.*/
  444. IX_HSSACC_HDLC_MAX_FRAME_SIZE_EXCEEDED, /**< HDLC frame size
  445. received is greater than
  446. max specified at connect.*/
  447. IX_HSSACC_HDLC_ABORT_ERROR, /**< HDLC frame received is invalid due to an
  448. abort sequence received.*/
  449. IX_HSSACC_DISCONNECT_IN_PROGRESS /**< Packet returned
  450. because a disconnect is in progress */
  451. } IxHssAccPktStatus;
  452. /**
  453. * @enum IxHssAccPktCrcType
  454. * @brief HDLC CRC type
  455. *
  456. */
  457. typedef enum
  458. {
  459. IX_HSSACC_PKT_16_BIT_CRC = 16, /**< 16 bit CRC is being used */
  460. IX_HSSACC_PKT_32_BIT_CRC = 32 /**< 32 bit CRC is being used */
  461. } IxHssAccPktCrcType;
  462. /**
  463. * @enum IxHssAccPktHdlcIdleType
  464. * @brief HDLC idle transmission type
  465. *
  466. */
  467. typedef enum
  468. {
  469. IX_HSSACC_HDLC_IDLE_ONES, /**< idle tx/rx will be a succession of ones */
  470. IX_HSSACC_HDLC_IDLE_FLAGS /**< idle tx/rx will be repeated flags */
  471. } IxHssAccPktHdlcIdleType;
  472. /**
  473. * @brief Structure containing HSS port configuration parameters
  474. *
  475. * Note: All of these are used for TX. Only some are specific to RX.
  476. *
  477. */
  478. typedef struct
  479. {
  480. IxHssAccFrmSyncType frmSyncType; /**< frame sync pulse type (tx/rx) */
  481. IxHssAccFrmSyncEnable frmSyncIO; /**< how the frame sync pulse is
  482. used (tx/rx) */
  483. IxHssAccClkEdge frmSyncClkEdge; /**< frame sync clock edge type
  484. (tx/rx) */
  485. IxHssAccClkEdge dataClkEdge; /**< data clock edge type (tx/rx) */
  486. IxHssAccClkDir clkDirection; /**< clock direction (tx/rx) */
  487. IxHssAccFrmPulseUsage frmPulseUsage; /**< whether to use the frame sync
  488. pulse or not (tx/rx) */
  489. IxHssAccDataRate dataRate; /**< data rate in relation to the
  490. clock (tx/rx) */
  491. IxHssAccDataPolarity dataPolarity; /**< data polarity type (tx/rx) */
  492. IxHssAccBitEndian dataEndianness; /**< data endianness (tx/rx) */
  493. IxHssAccDrainMode drainMode; /**< tx pin open drain mode (tx) */
  494. IxHssAccSOFType fBitUsage; /**< start of frame types (tx/rx) */
  495. IxHssAccDataEnable dataEnable; /**< whether or not to drive the data
  496. pins (tx) */
  497. IxHssAccTxSigType voice56kType; /**< how to drive the data pins for
  498. voice56k type (tx) */
  499. IxHssAccTxSigType unassignedType; /**< how to drive the data pins for
  500. unassigned type (tx) */
  501. IxHssAccFbType fBitType; /**< how to drive the Fbit (tx) */
  502. IxHssAcc56kEndianness voice56kEndian;/**< 56k data endianness when using
  503. the 56k type (tx) */
  504. IxHssAcc56kSel voice56kSel; /**< 56k data transmission type when
  505. using the 56k type (tx) */
  506. unsigned frmOffset; /**< frame pulse offset in bits wrt
  507. the first timeslot (0-1023) (tx/rx) */
  508. unsigned maxFrmSize; /**< frame size in bits (1-1024)
  509. (tx/rx) */
  510. } IxHssAccPortConfig;
  511. /**
  512. * @brief Structure containing HSS configuration parameters
  513. *
  514. */
  515. typedef struct
  516. {
  517. IxHssAccPortConfig txPortConfig; /**< HSS tx port configuration */
  518. IxHssAccPortConfig rxPortConfig; /**< HSS rx port configuration */
  519. unsigned numChannelised; /**< The number of channelised
  520. timeslots (0-32) */
  521. unsigned hssPktChannelCount; /**< The number of packetised
  522. clients (0 - 4) */
  523. UINT8 channelisedIdlePattern; /**< The byte to be transmitted on
  524. channelised service when there
  525. is no client data to tx */
  526. BOOL loopback; /**< The HSS loopback state */
  527. unsigned packetizedIdlePattern; /**< The data to be transmitted on
  528. packetised service when there is
  529. no client data to tx */
  530. IxHssAccClkSpeed clkSpeed; /**< The HSS clock speed */
  531. } IxHssAccConfigParams;
  532. /**
  533. * @brief This structure contains 56Kbps, HDLC-mode configuration parameters
  534. *
  535. */
  536. typedef struct
  537. {
  538. BOOL hdlc56kMode; /**< 56kbps(TRUE)/64kbps(FALSE) HDLC */
  539. IxHssAcc56kEndianness hdlc56kEndian; /**< 56kbps data endianness
  540. - ignored if hdlc56kMode is FALSE*/
  541. BOOL hdlc56kUnusedBitPolarity0; /**< The polarity '0'(TRUE)/'1'(FALSE) of the unused
  542. bit while in 56kbps mode
  543. - ignored if hdlc56kMode is FALSE*/
  544. } IxHssAccHdlcMode;
  545. /**
  546. * @brief This structure contains information required by the NPE to
  547. * configure the HDLC co-processor
  548. *
  549. */
  550. typedef struct
  551. {
  552. IxHssAccPktHdlcIdleType hdlcIdleType; /**< What to transmit when a HDLC port is idle */
  553. IxHssAccBitEndian dataEndian; /**< The HDLC data endianness */
  554. IxHssAccPktCrcType crcType; /**< The CRC type to be used for this HDLC port */
  555. } IxHssAccPktHdlcFraming;
  556. /**
  557. * @typedef UINT32 IxHssAccPktUserId
  558. *
  559. * @brief The client supplied value which will be supplied as a parameter
  560. * with a given callback.
  561. *
  562. * This value will be passed into the ixHssAccPktPortConnect function once each
  563. * with given callbacks. This value will then be passed back to the client
  564. * as one of the parameters to each of these callbacks,
  565. * when these callbacks are called.
  566. */
  567. typedef UINT32 IxHssAccPktUserId;
  568. /**
  569. * @typedef IxHssAccLastErrorCallback
  570. * @brief Prototype of the clients function to accept notification of the
  571. * last error
  572. *
  573. * This function is registered through the config. The client will initiate
  574. * the last error retrieval. The HssAccess component will send a message to
  575. * the NPE through the NPE Message Handler. When a response to the read is
  576. * received, the NPE Message Handler will callback the HssAccess component
  577. * which will execute this function in the same IxNpeMh context. The client
  578. * will be passed the last error and the related service port (packetised
  579. * 0-3, channelised 0)
  580. *
  581. * @param lastHssError unsigned [in] - The last Hss error registered that
  582. * has been registered.
  583. * @param servicePort unsigned [in] - This is the service port number.
  584. * (packetised 0-3, channelised 0)
  585. *
  586. * @return void
  587. */
  588. typedef void (*IxHssAccLastErrorCallback) (unsigned lastHssError,
  589. unsigned servicePort);
  590. /**
  591. * @typedef IxHssAccPktRxCallback
  592. * @brief Prototype of the clients function to accept notification of
  593. * packetised rx
  594. *
  595. * This function is registered through the ixHssAccPktPortConnect. hssPktAcc will pass
  596. * received data in the form of mbufs to the client. The mbuf passed back
  597. * to the client could contain a chain of buffers, depending on the packet
  598. * size received.
  599. *
  600. * @param *buffer @ref IX_OSAL_MBUF [in] - This is the mbuf which contains the
  601. * payload received.
  602. * @param numHssErrs unsigned [in] - This is the number of hssErrors
  603. * the Npe has received
  604. * @param pktStatus @ref IxHssAccPktStatus [in] - This is the status of the
  605. * mbuf that has been received.
  606. * @param rxUserId @ref IxHssAccPktUserId [in] - This is the client supplied value
  607. * passed in at ixHssAccPktPortConnect time which is now returned to the client.
  608. *
  609. * @return void
  610. */
  611. typedef void (*IxHssAccPktRxCallback) (IX_OSAL_MBUF *buffer,
  612. unsigned numHssErrs,
  613. IxHssAccPktStatus pktStatus,
  614. IxHssAccPktUserId rxUserId);
  615. /**
  616. * @typedef IxHssAccPktRxFreeLowCallback
  617. * @brief Prototype of the clients function to accept notification of
  618. * requirement of more Rx Free buffers
  619. *
  620. * The client can choose to register a callback of this type when
  621. * calling a connecting. This function is registered through the ixHssAccPktPortConnect.
  622. * If defined, the access layer will provide the trigger for
  623. * this callback. The callback will be responsible for supplying mbufs to
  624. * the access layer for use on the receive path from the HSS using
  625. * ixHssPktAccFreeBufReplenish.
  626. *
  627. * @return void
  628. */
  629. typedef void (*IxHssAccPktRxFreeLowCallback) (IxHssAccPktUserId rxFreeLowUserId);
  630. /**
  631. * @typedef IxHssAccPktTxDoneCallback
  632. * @brief Prototype of the clients function to accept notification of
  633. * completion with Tx buffers
  634. *
  635. * This function is registered through the ixHssAccPktPortConnect. It enables
  636. * the hssPktAcc to pass buffers back to the client
  637. * when transmission is complete.
  638. *
  639. * @param *buffer @ref IX_OSAL_MBUF [in] - This is the mbuf which contained
  640. * the payload that was for Tx.
  641. * @param numHssErrs unsigned [in] - This is the number of hssErrors
  642. * the Npe has received
  643. * @param pktStatus @ref IxHssAccPktStatus [in] - This is the status of the
  644. * mbuf that has been transmitted.
  645. * @param txDoneUserId @ref IxHssAccPktUserId [in] - This is the client supplied value
  646. * passed in at ixHssAccPktPortConnect time which is now returned to the client.
  647. *
  648. * @return void
  649. */
  650. typedef void (*IxHssAccPktTxDoneCallback) (IX_OSAL_MBUF *buffer,
  651. unsigned numHssErrs,
  652. IxHssAccPktStatus pktStatus,
  653. IxHssAccPktUserId txDoneUserId);
  654. /**
  655. * @typedef IxHssAccChanRxCallback
  656. * @brief Prototype of the clients function to accept notification of
  657. * channelised rx
  658. *
  659. * This callback, if defined by the client in the connect, will get called
  660. * in the context of an IRQ. The IRQ will be triggered when the hssSyncQMQ
  661. * is not empty. The queued entry will be dequeued and this function will
  662. * be executed.
  663. *
  664. * @param hssPortId @ref IxHssAccHssPort - The HSS port Id. There are two
  665. * identical ports (0-1).
  666. * @param txOffset unsigned [in] - an offset indicating from where within
  667. * the txPtrList the NPE is currently transmitting from.
  668. * @param rxOffset unsigned [in] - an offset indicating where within the
  669. * receive buffers the NPE has just written the received data to.
  670. * @param numHssErrs unsigned [in] - This is the number of hssErrors
  671. * the Npe has received
  672. *
  673. * @return void
  674. */
  675. typedef void (*IxHssAccChanRxCallback) (IxHssAccHssPort hssPortId,
  676. unsigned rxOffset,
  677. unsigned txOffset,
  678. unsigned numHssErrs);
  679. /*
  680. * Prototypes for interface functions.
  681. */
  682. /**
  683. *
  684. * @ingroup IxHssAccAPI
  685. *
  686. * @fn IX_STATUS ixHssAccPortInit (IxHssAccHssPort hssPortId,
  687. IxHssAccConfigParams *configParams,
  688. IxHssAccTdmSlotUsage *tdmMap,
  689. IxHssAccLastErrorCallback lastHssErrorCallback)
  690. *
  691. * @brief Initialise a HSS port. No channelised or packetised connections
  692. * should exist in the HssAccess layer while this interface is being called.
  693. *
  694. * @param hssPortId @ref IxHssAccHssPort [in] - The HSS port Id. There are two
  695. * identical ports (0-1).
  696. * @param *configParams @ref IxHssAccConfigParams [in] - A pointer to the HSS
  697. * configuration structure
  698. * @param *tdmMap @ref IxHssAccTdmSlotUsage [in] - A pointer to an array of size
  699. * IX_HSSACC_TSLOTS_PER_HSS_PORT, defining the slot usage over the HSS port
  700. * @param lastHssErrorCallback @ref IxHssAccLastErrorCallback [in] - Client
  701. * callback to report last error
  702. *
  703. * @return
  704. * - IX_SUCCESS The function executed successfully
  705. * - IX_FAIL The function did not execute successfully
  706. * - IX_HSSACC_PARAM_ERR The function did not execute successfully due to a
  707. * parameter error
  708. */
  709. PUBLIC IX_STATUS
  710. ixHssAccPortInit (IxHssAccHssPort hssPortId,
  711. IxHssAccConfigParams *configParams,
  712. IxHssAccTdmSlotUsage *tdmMap,
  713. IxHssAccLastErrorCallback lastHssErrorCallback);
  714. /**
  715. *
  716. * @ingroup IxHssAccAPI
  717. *
  718. * @fn IX_STATUS ixHssAccLastErrorRetrievalInitiate (
  719. IxHssAccHssPort hssPortId)
  720. *
  721. * @brief Initiate the retrieval of the last HSS error. The HSS port
  722. * should be configured before attempting to call this interface.
  723. *
  724. * @param hssPortId @ref IxHssAccHssPort [in] - the HSS port ID
  725. *
  726. * @return
  727. * - IX_SUCCESS The function executed successfully
  728. * - IX_FAIL The function did not execute successfully
  729. * - IX_HSSACC_PARAM_ERR The function did not execute successfully due to a
  730. * parameter error
  731. */
  732. PUBLIC IX_STATUS
  733. ixHssAccLastErrorRetrievalInitiate (IxHssAccHssPort hssPortId);
  734. /**
  735. *
  736. * @ingroup IxHssAccAPI
  737. *
  738. * @fn IX_STATUS ixHssAccInit ()
  739. *
  740. * @brief This function is responsible for initialising resources for use
  741. * by the packetised and channelised clients. It should be called after
  742. * HSS NPE image has been downloaded into NPE-A and before any other
  743. * HssAccess interface is called.
  744. * No other HssAccPacketised interface should be called while this interface
  745. * is being processed.
  746. *
  747. * @return
  748. * - IX_SUCCESS The function executed successfully
  749. * - IX_FAIL The function did not execute successfully
  750. * - IX_HSSACC_RESOURCE_ERR The function did not execute successfully due
  751. * to a resource error
  752. */
  753. PUBLIC IX_STATUS
  754. ixHssAccInit (void);
  755. /**
  756. *
  757. * @ingroup IxHssAccAPI
  758. *
  759. * @fn ixHssAccPktPortConnect (IxHssAccHssPort hssPortId,
  760. IxHssAccHdlcPort hdlcPortId,
  761. BOOL hdlcFraming,
  762. IxHssAccHdlcMode hdlcMode,
  763. BOOL hdlcBitInvert,
  764. unsigned blockSizeInWords,
  765. UINT32 rawIdleBlockPattern,
  766. IxHssAccPktHdlcFraming hdlcTxFraming,
  767. IxHssAccPktHdlcFraming hdlcRxFraming,
  768. unsigned frmFlagStart,
  769. IxHssAccPktRxCallback rxCallback,
  770. IxHssAccPktUserId rxUserId,
  771. IxHssAccPktRxFreeLowCallback rxFreeLowCallback,
  772. IxHssAccPktUserId rxFreeLowUserId,
  773. IxHssAccPktTxDoneCallback txDoneCallback,
  774. IxHssAccPktUserId txDoneUserId)
  775. *
  776. * @brief This function is responsible for connecting a client to one of
  777. * the 4 available HDLC ports. The HSS port should be configured before
  778. * attempting a connect. No other HssAccPacketised interface should be
  779. * called while this connect is being processed.
  780. *
  781. * @param hssPortId @ref IxHssAccHssPort [in] - The HSS port Id. There are two
  782. * identical ports (0-1).
  783. * @param hdlcPortId @ref IxHssAccHdlcPort [in] - This is the number of the HDLC port and
  784. * it corresponds to the physical E1/T1 trunk i.e. 0, 1, 2, 3
  785. * @param hdlcFraming BOOL [in] - This value determines whether the service
  786. * will use HDLC data or the debug, raw data type i.e. no HDLC processing
  787. * @param hdlcMode @ref IxHssAccHdlcMode [in] - This structure contains 56Kbps, HDLC-mode
  788. * configuration parameters
  789. * @param hdlcBitInvert BOOL [in] - This value determines whether bit inversion
  790. * will occur between HDLC and HSS co-processors i.e. post-HDLC processing for
  791. * transmit and pre-HDLC processing for receive, for the specified HDLC Termination
  792. * Point
  793. * @param blockSizeInWords unsigned [in] - The max tx/rx block size
  794. * @param rawIdleBlockPattern UINT32 [in] - Tx idle pattern in raw mode
  795. * @param hdlcTxFraming @ref IxHssAccPktHdlcFraming [in] - This structure contains
  796. * the following information required by the NPE to configure the HDLC
  797. * co-processor for TX
  798. * @param hdlcRxFraming @ref IxHssAccPktHdlcFraming [in] - This structure contains
  799. * the following information required by the NPE to configure the HDLC
  800. * co-processor for RX
  801. * @param frmFlagStart unsigned - Number of flags to precede to
  802. * transmitted flags (0-2).
  803. * @param rxCallback @ref IxHssAccPktRxCallback [in] - Pointer to
  804. * the clients packet receive function.
  805. * @param rxUserId @ref IxHssAccPktUserId [in] - The client supplied rx value
  806. * to be passed back as an argument to the supplied rxCallback
  807. * @param rxFreeLowCallback @ref IxHssAccPktRxFreeLowCallback [in] - Pointer to
  808. * the clients Rx free buffer request function. If NULL, assume client will
  809. * trigger independently.
  810. * @param rxFreeLowUserId @ref IxHssAccPktUserId [in] - The client supplied RxFreeLow value
  811. * to be passed back as an argument to the supplied rxFreeLowCallback
  812. * @param txDoneCallback @ref IxHssAccPktTxDoneCallback [in] - Pointer to the
  813. * clients Tx done callback function
  814. * @param txDoneUserId @ref IxHssAccPktUserId [in] - The client supplied txDone value
  815. * to be passed back as an argument to the supplied txDoneCallback
  816. *
  817. * @return
  818. * - IX_SUCCESS The function executed successfully
  819. * - IX_FAIL The function did not execute successfully
  820. * - IX_HSSACC_PARAM_ERR The function did not execute successfully due to a
  821. * parameter error
  822. * - IX_HSSACC_RESOURCE_ERR The function did not execute successfully due
  823. * to a resource error
  824. */
  825. PUBLIC IX_STATUS
  826. ixHssAccPktPortConnect (IxHssAccHssPort hssPortId,
  827. IxHssAccHdlcPort hdlcPortId,
  828. BOOL hdlcFraming,
  829. IxHssAccHdlcMode hdlcMode,
  830. BOOL hdlcBitInvert,
  831. unsigned blockSizeInWords,
  832. UINT32 rawIdleBlockPattern,
  833. IxHssAccPktHdlcFraming hdlcTxFraming,
  834. IxHssAccPktHdlcFraming hdlcRxFraming,
  835. unsigned frmFlagStart,
  836. IxHssAccPktRxCallback rxCallback,
  837. IxHssAccPktUserId rxUserId,
  838. IxHssAccPktRxFreeLowCallback rxFreeLowCallback,
  839. IxHssAccPktUserId rxFreeLowUserId,
  840. IxHssAccPktTxDoneCallback txDoneCallback,
  841. IxHssAccPktUserId txDoneUserId);
  842. /**
  843. *
  844. * @ingroup IxHssAccAPI
  845. *
  846. * @fn IX_STATUS ixHssAccPktPortEnable (IxHssAccHssPort hssPortId,
  847. IxHssAccHdlcPort hdlcPortId)
  848. *
  849. * @brief This function is responsible for enabling a packetised service
  850. * for the specified HSS/HDLC port combination. It enables the RX flow. The
  851. * client must have already connected to a packetised service and is responsible
  852. * for ensuring an adequate amount of RX mbufs have been supplied to the access
  853. * component before enabling the packetised service. This function must be called
  854. * on a given port before any call to ixHssAccPktPortTx on the same port.
  855. * No other HssAccPacketised interface should be called while this interface is
  856. * being processed.
  857. *
  858. * @param hssPortId @ref IxHssAccHssPort [in] - The HSS port Id. There are two
  859. * identical ports (0-1).
  860. * @param hdlcPortId @ref IxHssAccHdlcPort [in] - The port id (0,1,2,3) to enable the service
  861. * on.
  862. *
  863. * @return
  864. * - IX_SUCCESS The function executed successfully
  865. * - IX_FAIL The function did not execute successfully
  866. * - IX_HSSACC_PARAM_ERR The function did not execute successfully due to a
  867. * parameter error
  868. */
  869. PUBLIC IX_STATUS
  870. ixHssAccPktPortEnable (IxHssAccHssPort hssPortId,
  871. IxHssAccHdlcPort hdlcPortId);
  872. /**
  873. * @fn IX_STATUS ixHssAccPktPortDisable (IxHssAccHssPort hssPortId,
  874. IxHssAccHdlcPort hdlcPortId)
  875. *
  876. * @brief This function is responsible for disabling a packetised service
  877. * for the specified HSS/HDLC port combination. It disables the RX flow.
  878. * The client must have already connected to and enabled a packetised service
  879. * for the specified HDLC port. This disable interface can be called before a
  880. * disconnect, but is not required to.
  881. *
  882. * @param hssPortId @ref IxHssAccHssPort [in] - The HSS port Id. There are two
  883. * identical ports (0-1).
  884. * @param hdlcPortId @ref IxHssAccHdlcPort [in] - The port id (0,1,2,3) to disable
  885. * the service on.
  886. *
  887. * @return
  888. * - IX_SUCCESS The function executed successfully
  889. * - IX_FAIL The function did not execute successfully
  890. * - IX_HSSACC_PARAM_ERR The function did not execute successfully due to a
  891. * parameter error
  892. */
  893. PUBLIC IX_STATUS
  894. ixHssAccPktPortDisable (IxHssAccHssPort hssPortId,
  895. IxHssAccHdlcPort hdlcPortId);
  896. /**
  897. *
  898. * @ingroup IxHssAccAPI
  899. *
  900. * @fn IX_STATUS ixHssAccPktPortDisconnect (IxHssAccHssPort hssPortId,
  901. IxHssAccHdlcPort hdlcPortId)
  902. *
  903. * @brief This function is responsible for disconnecting a client from one
  904. * of the 4 available HDLC ports. It is not required that the Rx Flow
  905. * has been disabled before calling this function. If the RX Flow has not been
  906. * disabled, the disconnect will disable it before proceeding with the
  907. * disconnect. No other HssAccPacketised
  908. * interface should be called while this interface is being processed.
  909. *
  910. * @param hssPortId @ref IxHssAccHssPort [in] - The HSS port Id. There are two
  911. * identical ports (0-1).
  912. * @param hdlcPortId @ref IxHssAccHdlcPort [in] - This is the number of the HDLC port
  913. * to disconnect and it corresponds to the physical E1/T1 trunk i.e. 0, 1, 2, 3
  914. *
  915. * @return
  916. * - IX_SUCCESS The function executed successfully
  917. * - IX_FAIL The function did not execute successfully
  918. * - IX_HSSACC_PKT_DISCONNECTING The function has initiated the disconnecting
  919. * procedure but it has not completed yet.
  920. */
  921. PUBLIC IX_STATUS
  922. ixHssAccPktPortDisconnect (IxHssAccHssPort hssPortId,
  923. IxHssAccHdlcPort hdlcPortId);
  924. /**
  925. *
  926. * @ingroup IxHssAccAPI
  927. *
  928. * @fn BOOL ixHssAccPktPortIsDisconnectComplete (IxHssAccHssPort hssPortId,
  929. IxHssAccHdlcPort hdlcPortId)
  930. *
  931. * @brief This function is called to check if a given HSS/HDLC port
  932. * combination is in a connected state or not. This function may be called
  933. * at any time to determine a ports state. No other HssAccPacketised
  934. * interface should be called while this interface is being processed.
  935. *
  936. * @param hssPortId @ref IxHssAccHssPort [in] - The HSS port Id. There are two
  937. * identical ports (0-1).
  938. * @param hdlcPortId @ref IxHssAccHdlcPort [in] - This is the number of the HDLC port
  939. * to disconnect and it corresponds to the physical E1/T1 trunk i.e. 0, 1, 2, 3
  940. *
  941. * @return
  942. * - TRUE The state of this HSS/HDLC port combination is disconnected,
  943. * so if a disconnect was called, it is now completed.
  944. * - FALSE The state of this HSS/HDLC port combination is connected,
  945. * so if a disconnect was called, it is not yet completed.
  946. */
  947. PUBLIC BOOL
  948. ixHssAccPktPortIsDisconnectComplete (IxHssAccHssPort hssPortId,
  949. IxHssAccHdlcPort hdlcPortId);
  950. /**
  951. *
  952. * @ingroup IxHssAccAPI
  953. *
  954. * @fn IX_STATUS ixHssAccPktPortRxFreeReplenish (IxHssAccHssPort hssPortId,
  955. IxHssAccHdlcPort hdlcPortId,
  956. IX_OSAL_MBUF *buffer)
  957. *
  958. * @brief Function which the client calls at regular intervals to provide
  959. * mbufs to the access component for RX. A connection should exist for
  960. * the specified hssPortId/hdlcPortId combination before attempting to call this
  961. * interface. Also, the connection should not be in a disconnecting state.
  962. *
  963. * @param hssPortId @ref IxHssAccHssPort [in] - The HSS port Id. There are two
  964. * identical ports (0-1).
  965. * @param hdlcPortId @ref IxHssAccHdlcPort [in] - This is the number of the HDLC port
  966. * and it corresponds to the physical E1/T1 trunk i.e. 0, 1, 2, 3
  967. * @param *buffer @ref IX_OSAL_MBUF [in] - A pointer to a free mbuf to filled with payload.
  968. *
  969. * @return
  970. * - IX_SUCCESS The function executed successfully
  971. * - IX_FAIL The function did not execute successfully
  972. * - IX_HSSACC_PARAM_ERR The function did not execute successfully due to a
  973. * parameter error
  974. * - IX_HSSACC_RESOURCE_ERR The function did not execute successfully due
  975. * to a resource error
  976. * - IX_HSSACC_Q_WRITE_OVERFLOW The function did not succeed due to a Q
  977. * overflow
  978. */
  979. PUBLIC IX_STATUS
  980. ixHssAccPktPortRxFreeReplenish (IxHssAccHssPort hssPortId,
  981. IxHssAccHdlcPort hdlcPortId,
  982. IX_OSAL_MBUF *buffer);
  983. /**
  984. *
  985. * @ingroup IxHssAccAPI
  986. *
  987. * @fn IX_STATUS ixHssAccPktPortTx (IxHssAccHssPort hssPortId,
  988. IxHssAccHdlcPort hdlcPortId,
  989. IX_OSAL_MBUF *buffer)
  990. *
  991. * @brief Function which the client calls when it wants to transmit
  992. * packetised data. An enabled connection should exist on the specified
  993. * hssPortId/hdlcPortId combination before attempting to call this interface.
  994. * No other HssAccPacketised
  995. * interface should be called while this interface is being processed.
  996. *
  997. * @param hssPortId @ref IxHssAccHssPort [in] - The HSS port Id. There are two
  998. * identical ports (0-1).
  999. * @param hdlcPortId @ref IxHssAccHdlcPort [in] - This is the number of the HDLC port
  1000. * and it corresponds to the physical E1/T1 trunk i.e. 0, 1, 2, 3
  1001. * @param *buffer @ref IX_OSAL_MBUF [in] - A pointer to a chain of mbufs which the
  1002. * client has filled with the payload
  1003. *
  1004. * @return
  1005. * - IX_SUCCESS The function executed successfully
  1006. * - IX_FAIL The function did not execute successfully
  1007. * - IX_HSSACC_PARAM_ERR The function did not execute successfully due to a
  1008. * parameter error
  1009. * - IX_HSSACC_RESOURCE_ERR The function did not execute successfully due
  1010. * to a resource error. See note.
  1011. * - IX_HSSACC_Q_WRITE_OVERFLOW The function did not succeed due to a Q
  1012. * overflow
  1013. *
  1014. * @note IX_HSSACC_RESOURCE_ERR is returned when a free descriptor cannot be
  1015. * obtained to send the chain of mbufs to the NPE. This is a normal scenario.
  1016. * HssAcc has a pool of descriptors and this error means that they are currently
  1017. * all in use.
  1018. * The recommended approach to this is to retry until a descriptor becomes free
  1019. * and the packet is successfully transmitted.
  1020. * Alternatively, the user could wait until the next IxHssAccPktTxDoneCallback
  1021. * callback is triggered, and then retry, as it is this event that causes a
  1022. * transmit descriptor to be freed.
  1023. */
  1024. PUBLIC IX_STATUS
  1025. ixHssAccPktPortTx (IxHssAccHssPort hssPortId,
  1026. IxHssAccHdlcPort hdlcPortId,
  1027. IX_OSAL_MBUF *buffer);
  1028. /**
  1029. *
  1030. * @ingroup IxHssAccAPI
  1031. *
  1032. * @fn IX_STATUS ixHssAccChanConnect (IxHssAccHssPort hssPortId,
  1033. unsigned bytesPerTSTrigger,
  1034. UINT8 *rxCircular,
  1035. unsigned numRxBytesPerTS,
  1036. UINT32 *txPtrList,
  1037. unsigned numTxPtrLists,
  1038. unsigned numTxBytesPerBlk,
  1039. IxHssAccChanRxCallback rxCallback)
  1040. *
  1041. * @brief This function allows the client to connect to the Tx/Rx NPE
  1042. * Channelised Service. There can only be one client per HSS port. The
  1043. * client is responsible for ensuring that the HSS port is configured
  1044. * appropriately before its connect request. No other HssAccChannelised
  1045. * interface should be called while this interface is being processed.
  1046. *
  1047. * @param hssPortId @ref IxHssAccHssPort [in] - The HSS port Id. There are two
  1048. * identical ports (0-1).
  1049. * @param bytesPerTSTrigger unsigned [in] - The NPE will trigger the access
  1050. * component after bytesPerTSTrigger have been received for all trunk
  1051. * timeslots. This figure is a multiple of 8 e.g. 8 for 1ms trigger, 16 for
  1052. * 2ms trigger.
  1053. * @param *rxCircular UINT8 [in] - A pointer to memory allocated by the
  1054. * client to be filled by data received. The buffer at this address is part
  1055. * of a pool of buffers to be accessed in a circular fashion. This address
  1056. * will be written to by the NPE. Therefore, it needs to be a physical address.
  1057. * @param numRxBytesPerTS unsigned [in] - The number of bytes allocated per
  1058. * timeslot within the receive memory. This figure will depend on the
  1059. * latency of the system. It needs to be deep enough for data to be read by
  1060. * the client before the NPE re-writes over that memory e.g. if the client
  1061. * samples at a rate of 40bytes per timeslot, numRxBytesPerTS may need to
  1062. * be 40bytes * 3. This would give the client 3 * 5ms of time before
  1063. * received data is over-written.
  1064. * @param *txPtrList UINT32 [in] - The address of an area of contiguous
  1065. * memory allocated by the client to be populated with pointers to data for
  1066. * transmission. Each pointer list contains a pointer per active channel.
  1067. * The txPtrs will point to data to be transmitted by the NPE. Therefore,
  1068. * they must point to physical addresses.
  1069. * @param numTxPtrLists unsigned [in] - The number of pointer lists in
  1070. * txPtrList. This figure is dependent on jitter.
  1071. * @param numTxBytesPerBlk unsigned [in] - The size of the Tx data, in
  1072. * bytes, that each pointer within the PtrList points to.
  1073. * @param rxCallback @ref IxHssAccChanRxCallback [in] - A client function
  1074. * pointer to be called back to handle the actual tx/rx of channelised
  1075. * data. If this is not NULL, an ISR will call this function. If this
  1076. * pointer is NULL, it implies that the client will use a polling mechanism
  1077. * to detect when the tx and rx of channelised data is to occur. The client
  1078. * will use hssChanAccStatus for this.
  1079. *
  1080. * @return
  1081. * - IX_SUCCESS The function executed successfully
  1082. * - IX_FAIL The function did not execute successfully
  1083. * - IX_HSSACC_PARAM_ERR The function did not execute successfully due to a
  1084. * parameter error
  1085. */
  1086. PUBLIC IX_STATUS
  1087. ixHssAccChanConnect (IxHssAccHssPort hssPortId,
  1088. unsigned bytesPerTSTrigger,
  1089. UINT8 *rxCircular,
  1090. unsigned numRxBytesPerTS,
  1091. UINT32 *txPtrList,
  1092. unsigned numTxPtrLists,
  1093. unsigned numTxBytesPerBlk,
  1094. IxHssAccChanRxCallback rxCallback);
  1095. /**
  1096. *
  1097. * @ingroup IxHssAccAPI
  1098. *
  1099. * @fn IX_STATUS ixHssAccChanPortEnable (IxHssAccHssPort hssPortId)
  1100. *
  1101. * @brief This function is responsible for enabling a channelised service
  1102. * for the specified HSS port. It enables the NPE RX flow. The client must
  1103. * have already connected to a channelised service before enabling the
  1104. * channelised service. No other HssAccChannelised
  1105. * interface should be called while this interface is being processed.
  1106. *
  1107. * @param hssPortId @ref IxHssAccHssPort [in] - The HSS port Id. There are two
  1108. * identical ports (0-1).
  1109. *
  1110. * @return
  1111. * - IX_SUCCESS The function executed successfully
  1112. * - IX_FAIL The function did not execute successfully
  1113. * - IX_HSSACC_PARAM_ERR The function did not execute successfully due to a
  1114. * parameter error
  1115. */
  1116. PUBLIC IX_STATUS
  1117. ixHssAccChanPortEnable (IxHssAccHssPort hssPortId);
  1118. /**
  1119. *
  1120. * @ingroup IxHssAccAPI
  1121. *
  1122. * @fn IX_STATUS ixHssAccChanPortDisable (IxHssAccHssPort hssPortId)
  1123. *
  1124. * @brief This function is responsible for disabling a channelised service
  1125. * for the specified HSS port. It disables the NPE RX flow. The client must
  1126. * have already connected to and enabled a channelised service for the
  1127. * specified HSS port. This disable interface can be called before a
  1128. * disconnect, but is not required to. No other HssAccChannelised
  1129. * interface should be called while this interface is being processed.
  1130. *
  1131. * @param hssPortId @ref IxHssAccHssPort [in] - The HSS port Id. There are two
  1132. * identical ports (0-1).
  1133. *
  1134. * @return
  1135. * - IX_SUCCESS The function executed successfully
  1136. * - IX_FAIL The function did not execute successfully
  1137. * - IX_HSSACC_PARAM_ERR The function did not execute successfully due to a
  1138. * parameter error
  1139. */
  1140. PUBLIC IX_STATUS
  1141. ixHssAccChanPortDisable (IxHssAccHssPort hssPortId);
  1142. /**
  1143. *
  1144. * @ingroup IxHssAccAPI
  1145. *
  1146. * @fn IX_STATUS ixHssAccChanDisconnect (IxHssAccHssPort hssPortId)
  1147. *
  1148. * @brief This function allows the client to Disconnect from a channelised
  1149. * service. If the NPE RX Flow has not been disabled, the disconnect will
  1150. * disable it before proceeding with other disconnect functionality.
  1151. * No other HssAccChannelised interface should be called while this
  1152. * interface is being processed.
  1153. *
  1154. * @param hssPortId @ref IxHssAccHssPort [in] - The HSS port Id. There are two
  1155. * identical ports (0-1).
  1156. *
  1157. * @return
  1158. * - IX_SUCCESS The function executed successfully
  1159. * - IX_FAIL The function did not execute successfully
  1160. * - IX_HSSACC_PARAM_ERR The function did not execute successfully due to a
  1161. * parameter error
  1162. */
  1163. PUBLIC IX_STATUS
  1164. ixHssAccChanDisconnect (IxHssAccHssPort hssPortId);
  1165. /**
  1166. *
  1167. * @ingroup IxHssAccAPI
  1168. *
  1169. * @fn IX_STATUS ixHssAccChanStatusQuery (IxHssAccHssPort hssPortId,
  1170. BOOL *dataRecvd,
  1171. unsigned *rxOffset,
  1172. unsigned *txOffset,
  1173. unsigned *numHssErrs)
  1174. *
  1175. * @brief This function is called by the client to query whether or not
  1176. * channelised data has been received. If there is, hssChanAcc will return
  1177. * the details in the output parameters. An enabled connection should
  1178. * exist on the specified hssPortId before attempting to call this interface.
  1179. * No other HssAccChannelised interface should be called while this
  1180. * interface is being processed.
  1181. *
  1182. * @param hssPortId @ref IxHssAccHssPort [in] - The HSS port Id. There are two
  1183. * identical ports (0-1).
  1184. * @param *dataRecvd BOOL [out] - This BOOL indicates to the client whether
  1185. * or not the access component has read any data for the client. If
  1186. * FALSE, the other output parameters will not have been written to.
  1187. * @param *rxOffset unsigned [out] - An offset to indicate to the client
  1188. * where within the receive buffers the NPE has just written the received
  1189. * data to.
  1190. * @param *txOffset unsigned [out] - An offset to indicate to the client
  1191. * from where within the txPtrList the NPE is currently transmitting from
  1192. * @param *numHssErrs unsigned [out] - The total number of HSS port errors
  1193. * since initial port configuration
  1194. *
  1195. *
  1196. * @return
  1197. * - IX_SUCCESS The function executed successfully
  1198. * - IX_FAIL The function did not execute successfully
  1199. * - IX_HSSACC_PARAM_ERR The function did not execute successfully due to a
  1200. * parameter error
  1201. */
  1202. PUBLIC IX_STATUS
  1203. ixHssAccChanStatusQuery (IxHssAccHssPort hssPortId,
  1204. BOOL *dataRecvd,
  1205. unsigned *rxOffset,
  1206. unsigned *txOffset,
  1207. unsigned *numHssErrs);
  1208. /**
  1209. *
  1210. * @ingroup IxHssAccAPI
  1211. *
  1212. * @fn void ixHssAccShow (void)
  1213. *
  1214. * @brief This function will display the current state of the IxHssAcc
  1215. * component. The output is sent to stdout.
  1216. *
  1217. * @return void
  1218. */
  1219. PUBLIC void
  1220. ixHssAccShow (void);
  1221. /**
  1222. *
  1223. * @ingroup IxHssAccAPI
  1224. *
  1225. * @fn void ixHssAccStatsInit (void)
  1226. *
  1227. * @brief This function will reset the IxHssAcc statistics.
  1228. *
  1229. * @return void
  1230. */
  1231. PUBLIC void
  1232. ixHssAccStatsInit (void);
  1233. #endif /* IXHSSACC_H */
  1234. /**
  1235. * @} defgroup IxHssAcc
  1236. */