htc_api.h 23 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460
  1. //------------------------------------------------------------------------------
  2. // <copyright file="htc_api.h" company="Atheros">
  3. // Copyright (c) 2007-2008 Atheros Corporation. All rights reserved.
  4. //
  5. // This program is free software; you can redistribute it and/or modify
  6. // it under the terms of the GNU General Public License version 2 as
  7. // published by the Free Software Foundation;
  8. //
  9. // Software distributed under the License is distributed on an "AS
  10. // IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
  11. // implied. See the License for the specific language governing
  12. // rights and limitations under the License.
  13. //
  14. //
  15. //------------------------------------------------------------------------------
  16. //==============================================================================
  17. // Author(s): ="Atheros"
  18. //==============================================================================
  19. #ifndef _HTC_API_H_
  20. #define _HTC_API_H_
  21. #include <htc.h>
  22. #include <htc_services.h>
  23. #include "htc_packet.h"
  24. #ifdef __cplusplus
  25. extern "C" {
  26. #endif /* __cplusplus */
  27. /* TODO.. for BMI */
  28. #define ENDPOINT1 0
  29. // TODO -remove me, but we have to fix BMI first
  30. #define HTC_MAILBOX_NUM_MAX 4
  31. /* this is the amount of header room required by users of HTC */
  32. #define HTC_HEADER_LEN HTC_HDR_LENGTH
  33. typedef void *HTC_HANDLE;
  34. typedef A_UINT16 HTC_SERVICE_ID;
  35. typedef struct _HTC_INIT_INFO {
  36. void *pContext; /* context for target failure notification */
  37. void (*TargetFailure)(void *Instance, A_STATUS Status);
  38. } HTC_INIT_INFO;
  39. /* per service connection send completion */
  40. typedef void (*HTC_EP_SEND_PKT_COMPLETE)(void *,HTC_PACKET *);
  41. /* per service connection pkt received */
  42. typedef void (*HTC_EP_RECV_PKT)(void *,HTC_PACKET *);
  43. /* Optional per service connection receive buffer re-fill callback,
  44. * Packets are allocated from a global pool and indicated up
  45. * to the network stack. The driver never gets the packets back from the stack. So
  46. * refill callback can be used to allocate and re-queue buffers into HTC.
  47. *
  48. * On other cases,, the network stack can call into the driver's specifc "return_packet" handler and
  49. * the driver can re-queue these buffers into HTC. In this regard a refill callback is
  50. * unnecessary */
  51. typedef void (*HTC_EP_RECV_REFILL)(void *, HTC_ENDPOINT_ID Endpoint);
  52. /* Optional per service connection receive buffer allocation callback.
  53. * On some systems packet buffers are an extremely limited resource. Rather than
  54. * queue largest-possible-sized buffers to HTC, some systems would rather
  55. * allocate a specific size as the packet is received. The trade off is
  56. * slightly more processing (callback invoked for each RX packet)
  57. * for the benefit of committing fewer buffer resources into HTC.
  58. *
  59. * The callback is provided the length of the pending packet to fetch. This includes the
  60. * HTC header length plus the length of payload. The callback can return a pointer to
  61. * the allocated HTC packet for immediate use.
  62. *
  63. * NOTE*** This callback is mutually exclusive with the the refill callback above.
  64. *
  65. * */
  66. typedef HTC_PACKET *(*HTC_EP_RECV_ALLOC)(void *, HTC_ENDPOINT_ID Endpoint, int Length);
  67. typedef enum _HTC_SEND_FULL_ACTION {
  68. HTC_SEND_FULL_KEEP = 0, /* packet that overflowed should be kept in the queue */
  69. HTC_SEND_FULL_DROP = 1, /* packet that overflowed should be dropped */
  70. } HTC_SEND_FULL_ACTION;
  71. /* Optional per service connection callback when a send queue is full. This can occur if the
  72. * host continues queueing up TX packets faster than credits can arrive
  73. * To prevent the host from continuously queueing packets
  74. * and consuming resources, this callback is provided so that that the host
  75. * can disable TX in the subsystem (i.e. network stack).
  76. * This callback is invoked for each packet that "overflows" the HTC queue. The callback can
  77. * determine whether the new packet that overflowed the queue can be kept (HTC_SEND_FULL_KEEP) or
  78. * dropped (HTC_SEND_FULL_DROP). If a packet is dropped, the EpTxComplete handler will be called
  79. * and the packet's status field will be set to A_NO_RESOURCE.
  80. * In other cases, "per-packet" indication for each completed TX packet, this
  81. * closed loop mechanism will prevent the network stack from overunning the NIC
  82. * The packet to keep or drop is passed for inspection to the registered handler the handler
  83. * must ONLY inspect the packet, it may not free or reclaim the packet. */
  84. typedef HTC_SEND_FULL_ACTION (*HTC_EP_SEND_QUEUE_FULL)(void *, HTC_PACKET *pPacket);
  85. typedef struct _HTC_EP_CALLBACKS {
  86. void *pContext; /* context for each callback */
  87. HTC_EP_SEND_PKT_COMPLETE EpTxComplete; /* tx completion callback for connected endpoint */
  88. HTC_EP_RECV_PKT EpRecv; /* receive callback for connected endpoint */
  89. HTC_EP_RECV_REFILL EpRecvRefill; /* OPTIONAL receive re-fill callback for connected endpoint */
  90. HTC_EP_SEND_QUEUE_FULL EpSendFull; /* OPTIONAL send full callback */
  91. HTC_EP_RECV_ALLOC EpRecvAlloc; /* OPTIONAL recv allocation callback */
  92. } HTC_EP_CALLBACKS;
  93. /* service connection information */
  94. typedef struct _HTC_SERVICE_CONNECT_REQ {
  95. HTC_SERVICE_ID ServiceID; /* service ID to connect to */
  96. A_UINT16 ConnectionFlags; /* connection flags, see htc protocol definition */
  97. A_UINT8 *pMetaData; /* ptr to optional service-specific meta-data */
  98. A_UINT8 MetaDataLength; /* optional meta data length */
  99. HTC_EP_CALLBACKS EpCallbacks; /* endpoint callbacks */
  100. int MaxSendQueueDepth; /* maximum depth of any send queue */
  101. } HTC_SERVICE_CONNECT_REQ;
  102. /* service connection response information */
  103. typedef struct _HTC_SERVICE_CONNECT_RESP {
  104. A_UINT8 *pMetaData; /* caller supplied buffer to optional meta-data */
  105. A_UINT8 BufferLength; /* length of caller supplied buffer */
  106. A_UINT8 ActualLength; /* actual length of meta data */
  107. HTC_ENDPOINT_ID Endpoint; /* endpoint to communicate over */
  108. int MaxMsgLength; /* max length of all messages over this endpoint */
  109. A_UINT8 ConnectRespCode; /* connect response code from target */
  110. } HTC_SERVICE_CONNECT_RESP;
  111. /* endpoint distribution structure */
  112. typedef struct _HTC_ENDPOINT_CREDIT_DIST {
  113. struct _HTC_ENDPOINT_CREDIT_DIST *pNext;
  114. struct _HTC_ENDPOINT_CREDIT_DIST *pPrev;
  115. HTC_SERVICE_ID ServiceID; /* Service ID (set by HTC) */
  116. HTC_ENDPOINT_ID Endpoint; /* endpoint for this distribution struct (set by HTC) */
  117. A_UINT32 DistFlags; /* distribution flags, distribution function can
  118. set default activity using SET_EP_ACTIVE() macro */
  119. int TxCreditsNorm; /* credits for normal operation, anything above this
  120. indicates the endpoint is over-subscribed, this field
  121. is only relevant to the credit distribution function */
  122. int TxCreditsMin; /* floor for credit distribution, this field is
  123. only relevant to the credit distribution function */
  124. int TxCreditsAssigned; /* number of credits assigned to this EP, this field
  125. is only relevant to the credit dist function */
  126. int TxCredits; /* current credits available, this field is used by
  127. HTC to determine whether a message can be sent or
  128. must be queued */
  129. int TxCreditsToDist; /* pending credits to distribute on this endpoint, this
  130. is set by HTC when credit reports arrive.
  131. The credit distribution functions sets this to zero
  132. when it distributes the credits */
  133. int TxCreditsSeek; /* this is the number of credits that the current pending TX
  134. packet needs to transmit. This is set by HTC when
  135. and endpoint needs credits in order to transmit */
  136. int TxCreditSize; /* size in bytes of each credit (set by HTC) */
  137. int TxCreditsPerMaxMsg; /* credits required for a maximum sized messages (set by HTC) */
  138. void *pHTCReserved; /* reserved for HTC use */
  139. int TxQueueDepth; /* current depth of TX queue , i.e. messages waiting for credits
  140. This field is valid only when HTC_CREDIT_DIST_ACTIVITY_CHANGE
  141. or HTC_CREDIT_DIST_SEND_COMPLETE is indicated on an endpoint
  142. that has non-zero credits to recover
  143. */
  144. } HTC_ENDPOINT_CREDIT_DIST;
  145. #define HTC_EP_ACTIVE ((A_UINT32) (((A_UINT32) 1) << 31))
  146. /* macro to check if an endpoint has gone active, useful for credit
  147. * distributions */
  148. #define IS_EP_ACTIVE(epDist) ((epDist)->DistFlags & HTC_EP_ACTIVE)
  149. #define SET_EP_ACTIVE(epDist) (epDist)->DistFlags |= HTC_EP_ACTIVE
  150. /* credit distibution code that is passed into the distrbution function,
  151. * there are mandatory and optional codes that must be handled */
  152. typedef enum _HTC_CREDIT_DIST_REASON {
  153. HTC_CREDIT_DIST_SEND_COMPLETE = 0, /* credits available as a result of completed
  154. send operations (MANDATORY) resulting in credit reports */
  155. HTC_CREDIT_DIST_ACTIVITY_CHANGE = 1, /* a change in endpoint activity occured (OPTIONAL) */
  156. HTC_CREDIT_DIST_SEEK_CREDITS, /* an endpoint needs to "seek" credits (OPTIONAL) */
  157. HTC_DUMP_CREDIT_STATE /* for debugging, dump any state information that is kept by
  158. the distribution function */
  159. } HTC_CREDIT_DIST_REASON;
  160. typedef void (*HTC_CREDIT_DIST_CALLBACK)(void *Context,
  161. HTC_ENDPOINT_CREDIT_DIST *pEPList,
  162. HTC_CREDIT_DIST_REASON Reason);
  163. typedef void (*HTC_CREDIT_INIT_CALLBACK)(void *Context,
  164. HTC_ENDPOINT_CREDIT_DIST *pEPList,
  165. int TotalCredits);
  166. /* endpoint statistics action */
  167. typedef enum _HTC_ENDPOINT_STAT_ACTION {
  168. HTC_EP_STAT_SAMPLE = 0, /* only read statistics */
  169. HTC_EP_STAT_SAMPLE_AND_CLEAR = 1, /* sample and immediately clear statistics */
  170. HTC_EP_STAT_CLEAR /* clear only */
  171. } HTC_ENDPOINT_STAT_ACTION;
  172. /* endpoint statistics */
  173. typedef struct _HTC_ENDPOINT_STATS {
  174. A_UINT32 TxCreditLowIndications; /* number of times the host set the credit-low flag in a send message on
  175. this endpoint */
  176. A_UINT32 TxIssued; /* running count of TX packets issued */
  177. A_UINT32 TxDropped; /* tx packets that were dropped */
  178. A_UINT32 TxCreditRpts; /* running count of total credit reports received for this endpoint */
  179. A_UINT32 TxCreditRptsFromRx; /* credit reports received from this endpoint's RX packets */
  180. A_UINT32 TxCreditRptsFromOther; /* credit reports received from RX packets of other endpoints */
  181. A_UINT32 TxCreditRptsFromEp0; /* credit reports received from endpoint 0 RX packets */
  182. A_UINT32 TxCreditsFromRx; /* count of credits received via Rx packets on this endpoint */
  183. A_UINT32 TxCreditsFromOther; /* count of credits received via another endpoint */
  184. A_UINT32 TxCreditsFromEp0; /* count of credits received via another endpoint */
  185. A_UINT32 TxCreditsConsummed; /* count of consummed credits */
  186. A_UINT32 TxCreditsReturned; /* count of credits returned */
  187. A_UINT32 RxReceived; /* count of RX packets received */
  188. A_UINT32 RxLookAheads; /* count of lookahead records
  189. found in messages received on this endpoint */
  190. } HTC_ENDPOINT_STATS;
  191. /* ------ Function Prototypes ------ */
  192. /*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  193. @desc: Create an instance of HTC over the underlying HIF device
  194. @function name: HTCCreate
  195. @input: HifDevice - hif device handle,
  196. pInfo - initialization information
  197. @output:
  198. @return: HTC_HANDLE on success, NULL on failure
  199. @notes:
  200. @example:
  201. @see also: HTCDestroy
  202. +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
  203. HTC_HANDLE HTCCreate(void *HifDevice, HTC_INIT_INFO *pInfo);
  204. /*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  205. @desc: Get the underlying HIF device handle
  206. @function name: HTCGetHifDevice
  207. @input: HTCHandle - handle passed into the AddInstance callback
  208. @output:
  209. @return: opaque HIF device handle usable in HIF API calls.
  210. @notes:
  211. @example:
  212. @see also:
  213. +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
  214. void *HTCGetHifDevice(HTC_HANDLE HTCHandle);
  215. /*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  216. @desc: Set credit distribution parameters
  217. @function name: HTCSetCreditDistribution
  218. @input: HTCHandle - HTC handle
  219. pCreditDistCont - caller supplied context to pass into distribution functions
  220. CreditDistFunc - Distribution function callback
  221. CreditDistInit - Credit Distribution initialization callback
  222. ServicePriorityOrder - Array containing list of service IDs, lowest index is highest
  223. priority
  224. ListLength - number of elements in ServicePriorityOrder
  225. @output:
  226. @return:
  227. @notes: The user can set a custom credit distribution function to handle special requirements
  228. for each endpoint. A default credit distribution routine can be used by setting
  229. CreditInitFunc to NULL. The default credit distribution is only provided for simple
  230. "fair" credit distribution without regard to any prioritization.
  231. @example:
  232. @see also:
  233. +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
  234. void HTCSetCreditDistribution(HTC_HANDLE HTCHandle,
  235. void *pCreditDistContext,
  236. HTC_CREDIT_DIST_CALLBACK CreditDistFunc,
  237. HTC_CREDIT_INIT_CALLBACK CreditInitFunc,
  238. HTC_SERVICE_ID ServicePriorityOrder[],
  239. int ListLength);
  240. /*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  241. @desc: Wait for the target to indicate the HTC layer is ready
  242. @function name: HTCWaitTarget
  243. @input: HTCHandle - HTC handle
  244. @output:
  245. @return:
  246. @notes: This API blocks until the target responds with an HTC ready message.
  247. The caller should not connect services until the target has indicated it is
  248. ready.
  249. @example:
  250. @see also: HTCConnectService
  251. +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
  252. A_STATUS HTCWaitTarget(HTC_HANDLE HTCHandle);
  253. /*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  254. @desc: Start target service communications
  255. @function name: HTCStart
  256. @input: HTCHandle - HTC handle
  257. @output:
  258. @return:
  259. @notes: This API indicates to the target that the service connection phase is complete
  260. and the target can freely start all connected services. This API should only be
  261. called AFTER all service connections have been made. TCStart will issue a
  262. SETUP_COMPLETE message to the target to indicate that all service connections
  263. have been made and the target can start communicating over the endpoints.
  264. @example:
  265. @see also: HTCConnectService
  266. +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
  267. A_STATUS HTCStart(HTC_HANDLE HTCHandle);
  268. /*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  269. @desc: Add receive packet to HTC
  270. @function name: HTCAddReceivePkt
  271. @input: HTCHandle - HTC handle
  272. pPacket - HTC receive packet to add
  273. @output:
  274. @return: A_OK on success
  275. @notes: user must supply HTC packets for capturing incomming HTC frames. The caller
  276. must initialize each HTC packet using the SET_HTC_PACKET_INFO_RX_REFILL()
  277. macro.
  278. @example:
  279. @see also:
  280. +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
  281. A_STATUS HTCAddReceivePkt(HTC_HANDLE HTCHandle, HTC_PACKET *pPacket);
  282. /*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  283. @desc: Connect to an HTC service
  284. @function name: HTCConnectService
  285. @input: HTCHandle - HTC handle
  286. pReq - connection details
  287. @output: pResp - connection response
  288. @return:
  289. @notes: Service connections must be performed before HTCStart. User provides callback handlers
  290. for various endpoint events.
  291. @example:
  292. @see also: HTCStart
  293. +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
  294. A_STATUS HTCConnectService(HTC_HANDLE HTCHandle,
  295. HTC_SERVICE_CONNECT_REQ *pReq,
  296. HTC_SERVICE_CONNECT_RESP *pResp);
  297. /*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  298. @desc: Send an HTC packet
  299. @function name: HTCSendPkt
  300. @input: HTCHandle - HTC handle
  301. pPacket - packet to send
  302. @output:
  303. @return: A_OK
  304. @notes: Caller must initialize packet using SET_HTC_PACKET_INFO_TX() macro.
  305. This interface is fully asynchronous. On error, HTC SendPkt will
  306. call the registered Endpoint callback to cleanup the packet.
  307. @example:
  308. @see also: HTCFlushEndpoint
  309. +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
  310. A_STATUS HTCSendPkt(HTC_HANDLE HTCHandle, HTC_PACKET *pPacket);
  311. /*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  312. @desc: Stop HTC service communications
  313. @function name: HTCStop
  314. @input: HTCHandle - HTC handle
  315. @output:
  316. @return:
  317. @notes: HTC communications is halted. All receive and pending TX packets will
  318. be flushed.
  319. @example:
  320. @see also:
  321. +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
  322. void HTCStop(HTC_HANDLE HTCHandle);
  323. /*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  324. @desc: Destory HTC service
  325. @function name: HTCDestroy
  326. @input: HTCHandle
  327. @output:
  328. @return:
  329. @notes: This cleans up all resources allocated by HTCCreate().
  330. @example:
  331. @see also: HTCCreate
  332. +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
  333. void HTCDestroy(HTC_HANDLE HTCHandle);
  334. /*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  335. @desc: Flush pending TX packets
  336. @function name: HTCFlushEndpoint
  337. @input: HTCHandle - HTC handle
  338. Endpoint - Endpoint to flush
  339. Tag - flush tag
  340. @output:
  341. @return:
  342. @notes: The Tag parameter is used to selectively flush packets with matching tags.
  343. The value of 0 forces all packets to be flush regardless of tag.
  344. @example:
  345. @see also: HTCSendPkt
  346. +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
  347. void HTCFlushEndpoint(HTC_HANDLE HTCHandle, HTC_ENDPOINT_ID Endpoint, HTC_TX_TAG Tag);
  348. /*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  349. @desc: Dump credit distribution state
  350. @function name: HTCDumpCreditStates
  351. @input: HTCHandle - HTC handle
  352. @output:
  353. @return:
  354. @notes: This dumps all credit distribution information to the debugger
  355. @example:
  356. @see also:
  357. +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
  358. void HTCDumpCreditStates(HTC_HANDLE HTCHandle);
  359. /*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  360. @desc: Indicate a traffic activity change on an endpoint
  361. @function name: HTCIndicateActivityChange
  362. @input: HTCHandle - HTC handle
  363. Endpoint - endpoint in which activity has changed
  364. Active - TRUE if active, FALSE if it has become inactive
  365. @output:
  366. @return:
  367. @notes: This triggers the registered credit distribution function to
  368. re-adjust credits for active/inactive endpoints.
  369. @example:
  370. @see also:
  371. +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
  372. void HTCIndicateActivityChange(HTC_HANDLE HTCHandle,
  373. HTC_ENDPOINT_ID Endpoint,
  374. A_BOOL Active);
  375. /*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  376. @desc: Get endpoint statistics
  377. @function name: HTCGetEndpointStatistics
  378. @input: HTCHandle - HTC handle
  379. Endpoint - Endpoint identifier
  380. Action - action to take with statistics
  381. @output:
  382. pStats - statistics that were sampled (can be NULL if Action is HTC_EP_STAT_CLEAR)
  383. @return: TRUE if statistics profiling is enabled, otherwise FALSE.
  384. @notes: Statistics is a compile-time option and this function may return FALSE
  385. if HTC is not compiled with profiling.
  386. The caller can specify the statistic "action" to take when sampling
  387. the statistics. This includes:
  388. HTC_EP_STAT_SAMPLE: The pStats structure is filled with the current values.
  389. HTC_EP_STAT_SAMPLE_AND_CLEAR: The structure is filled and the current statistics
  390. are cleared.
  391. HTC_EP_STAT_CLEA : the statistics are cleared, the called can pass a NULL value for
  392. pStats
  393. @example:
  394. @see also:
  395. +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
  396. A_BOOL HTCGetEndpointStatistics(HTC_HANDLE HTCHandle,
  397. HTC_ENDPOINT_ID Endpoint,
  398. HTC_ENDPOINT_STAT_ACTION Action,
  399. HTC_ENDPOINT_STATS *pStats);
  400. /*+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
  401. @desc: Unblock HTC message reception
  402. @function name: HTCUnblockRecv
  403. @input: HTCHandle - HTC handle
  404. @output:
  405. @return:
  406. @notes:
  407. HTC will block the receiver if the EpRecvAlloc callback fails to provide a packet.
  408. The caller can use this API to indicate to HTC when resources (buffers) are available
  409. such that the receiver can be unblocked and HTC may re-attempt fetching the pending message.
  410. This API is not required if the user uses the EpRecvRefill callback or uses the HTCAddReceivePacket()
  411. API to recycle or provide receive packets to HTC.
  412. @example:
  413. @see also:
  414. +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++*/
  415. void HTCUnblockRecv(HTC_HANDLE HTCHandle);
  416. /* internally used functions for testing... */
  417. void HTCEnableRecv(HTC_HANDLE HTCHandle);
  418. void HTCDisableRecv(HTC_HANDLE HTCHandle);
  419. #ifdef __cplusplus
  420. }
  421. #endif
  422. #endif /* _HTC_API_H_ */