IxHssAcc.h 46 KB

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