avdt_int.h 30 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748
  1. /******************************************************************************
  2. *
  3. * Copyright (C) 2002-2012 Broadcom Corporation
  4. *
  5. * Licensed under the Apache License, Version 2.0 (the "License");
  6. * you may not use this file except in compliance with the License.
  7. * You may obtain a copy of the License at:
  8. *
  9. * http://www.apache.org/licenses/LICENSE-2.0
  10. *
  11. * Unless required by applicable law or agreed to in writing, software
  12. * distributed under the License is distributed on an "AS IS" BASIS,
  13. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  14. * See the License for the specific language governing permissions and
  15. * limitations under the License.
  16. *
  17. ******************************************************************************/
  18. /******************************************************************************
  19. *
  20. * This file contains interfaces which are internal to AVDTP.
  21. *
  22. ******************************************************************************/
  23. #ifndef AVDT_INT_H
  24. #define AVDT_INT_H
  25. #include "stack/avdt_api.h"
  26. #include "stack/avdtc_api.h"
  27. #include "avdt_defs.h"
  28. #include "stack/l2c_api.h"
  29. #include "stack/btm_api.h"
  30. #include "osi/fixed_queue.h"
  31. #if (AVRC_INCLUDED == TRUE)
  32. #ifndef AVDT_DEBUG
  33. #define AVDT_DEBUG FALSE
  34. #endif
  35. /*****************************************************************************
  36. ** constants
  37. *****************************************************************************/
  38. /* channel types */
  39. enum {
  40. AVDT_CHAN_SIG, /* signaling channel */
  41. AVDT_CHAN_MEDIA, /* media channel */
  42. #if AVDT_REPORTING == TRUE
  43. AVDT_CHAN_REPORT, /* reporting channel */
  44. #endif
  45. AVDT_CHAN_NUM_TYPES
  46. };
  47. /* protocol service capabilities of this AVDTP implementation */
  48. /* for now multiplexing will be used only for fragmentation */
  49. #if ((AVDT_MULTIPLEXING == TRUE) && (AVDT_REPORTING == TRUE))
  50. #define AVDT_PSC (AVDT_PSC_TRANS | AVDT_PSC_MUX | AVDT_PSC_REPORT | AVDT_PSC_DELAY_RPT)
  51. #define AVDT_LEG_PSC (AVDT_PSC_TRANS | AVDT_PSC_MUX | AVDT_PSC_REPORT)
  52. #else /* AVDT_MULTIPLEXING && AVDT_REPORTING */
  53. #if (AVDT_MULTIPLEXING == TRUE)
  54. #define AVDT_PSC (AVDT_PSC_TRANS | AVDT_PSC_MUX | AVDT_PSC_DELAY_RPT)
  55. #define AVDT_LEG_PSC (AVDT_PSC_TRANS | AVDT_PSC_MUX)
  56. #else /* AVDT_MULTIPLEXING */
  57. #if (AVDT_REPORTING == TRUE)
  58. #define AVDT_PSC (AVDT_PSC_TRANS | AVDT_PSC_REPORT | AVDT_PSC_DELAY_RPT)
  59. #define AVDT_LEG_PSC (AVDT_PSC_TRANS | AVDT_PSC_REPORT)
  60. #else /* AVDT_REPORTING */
  61. #define AVDT_PSC (AVDT_PSC_TRANS | AVDT_PSC_DELAY_RPT)
  62. #define AVDT_LEG_PSC (AVDT_PSC_TRANS)
  63. #endif /* AVDT_REPORTING */
  64. #endif /* AVDT_MULTIPLEXING */
  65. #endif /* AVDT_MULTIPLEXING && AVDT_REPORTING */
  66. /* initiator/acceptor signaling roles */
  67. #define AVDT_CLOSE_ACP 0
  68. #define AVDT_CLOSE_INT 1
  69. #define AVDT_OPEN_ACP 2
  70. #define AVDT_OPEN_INT 3
  71. /* states for avdt_scb_verify */
  72. #define AVDT_VERIFY_OPEN 0
  73. #define AVDT_VERIFY_STREAMING 1
  74. #define AVDT_VERIFY_SUSPEND 2
  75. #define AVDT_VERIFY_START 3
  76. /* to distinguish CCB events from SCB events */
  77. #define AVDT_CCB_MKR 0x80
  78. /* offset where AVDTP signaling message header starts in message */
  79. #define AVDT_HDR_OFFSET (L2CAP_MIN_OFFSET + AVDT_NUM_SEPS)
  80. /* offset where AVDTP signaling message content starts;
  81. ** use the size of a start header since it's the largest possible
  82. ** layout of signaling message in a buffer is:
  83. **
  84. ** | BT_HDR | SCB handles | L2CAP + HCI header | AVDTP header | data ... |
  85. **
  86. ** Note that we "hide" the scb handles at the top of the message buffer.
  87. */
  88. #define AVDT_MSG_OFFSET (L2CAP_MIN_OFFSET + AVDT_NUM_SEPS + AVDT_LEN_TYPE_START)
  89. /* scb transport channel connect timeout value */
  90. #define AVDT_SCB_TC_CONN_TOUT 10
  91. /* scb transport channel disconnect timeout value */
  92. #define AVDT_SCB_TC_DISC_TOUT 10
  93. /* maximum number of command retransmissions */
  94. #ifndef AVDT_RET_MAX
  95. #define AVDT_RET_MAX 1
  96. #endif
  97. /* ccb state machine states */
  98. enum {
  99. AVDT_CCB_IDLE_ST,
  100. AVDT_CCB_OPENING_ST,
  101. AVDT_CCB_OPEN_ST,
  102. AVDT_CCB_CLOSING_ST
  103. };
  104. /* state machine action enumeration list */
  105. enum {
  106. AVDT_CCB_CHAN_OPEN,
  107. AVDT_CCB_CHAN_CLOSE,
  108. AVDT_CCB_CHK_CLOSE,
  109. AVDT_CCB_HDL_DISCOVER_CMD,
  110. AVDT_CCB_HDL_DISCOVER_RSP,
  111. AVDT_CCB_HDL_GETCAP_CMD,
  112. AVDT_CCB_HDL_GETCAP_RSP,
  113. AVDT_CCB_HDL_START_CMD,
  114. AVDT_CCB_HDL_START_RSP,
  115. AVDT_CCB_HDL_SUSPEND_CMD,
  116. AVDT_CCB_HDL_SUSPEND_RSP,
  117. AVDT_CCB_SND_DISCOVER_CMD,
  118. AVDT_CCB_SND_DISCOVER_RSP,
  119. AVDT_CCB_SND_GETCAP_CMD,
  120. AVDT_CCB_SND_GETCAP_RSP,
  121. AVDT_CCB_SND_START_CMD,
  122. AVDT_CCB_SND_START_RSP,
  123. AVDT_CCB_SND_SUSPEND_CMD,
  124. AVDT_CCB_SND_SUSPEND_RSP,
  125. AVDT_CCB_CLEAR_CMDS,
  126. AVDT_CCB_CMD_FAIL,
  127. AVDT_CCB_FREE_CMD,
  128. AVDT_CCB_CONG_STATE,
  129. AVDT_CCB_RET_CMD,
  130. AVDT_CCB_SND_CMD,
  131. AVDT_CCB_SND_MSG,
  132. AVDT_CCB_SET_RECONN,
  133. AVDT_CCB_CLR_RECONN,
  134. AVDT_CCB_CHK_RECONN,
  135. AVDT_CCB_CHK_TIMER,
  136. AVDT_CCB_SET_CONN,
  137. AVDT_CCB_SET_DISCONN,
  138. AVDT_CCB_DO_DISCONN,
  139. AVDT_CCB_LL_CLOSED,
  140. AVDT_CCB_LL_OPENED,
  141. AVDT_CCB_DEALLOC,
  142. AVDT_CCB_NUM_ACTIONS
  143. };
  144. #define AVDT_CCB_IGNORE AVDT_CCB_NUM_ACTIONS
  145. /* ccb state machine events */
  146. enum {
  147. AVDT_CCB_API_DISCOVER_REQ_EVT,
  148. AVDT_CCB_API_GETCAP_REQ_EVT,
  149. AVDT_CCB_API_START_REQ_EVT,
  150. AVDT_CCB_API_SUSPEND_REQ_EVT,
  151. AVDT_CCB_API_DISCOVER_RSP_EVT,
  152. AVDT_CCB_API_GETCAP_RSP_EVT,
  153. AVDT_CCB_API_START_RSP_EVT,
  154. AVDT_CCB_API_SUSPEND_RSP_EVT,
  155. AVDT_CCB_API_CONNECT_REQ_EVT,
  156. AVDT_CCB_API_DISCONNECT_REQ_EVT,
  157. AVDT_CCB_MSG_DISCOVER_CMD_EVT,
  158. AVDT_CCB_MSG_GETCAP_CMD_EVT,
  159. AVDT_CCB_MSG_START_CMD_EVT,
  160. AVDT_CCB_MSG_SUSPEND_CMD_EVT,
  161. AVDT_CCB_MSG_DISCOVER_RSP_EVT,
  162. AVDT_CCB_MSG_GETCAP_RSP_EVT,
  163. AVDT_CCB_MSG_START_RSP_EVT,
  164. AVDT_CCB_MSG_SUSPEND_RSP_EVT,
  165. AVDT_CCB_RCVRSP_EVT,
  166. AVDT_CCB_SENDMSG_EVT,
  167. AVDT_CCB_RET_TOUT_EVT,
  168. AVDT_CCB_RSP_TOUT_EVT,
  169. AVDT_CCB_IDLE_TOUT_EVT,
  170. AVDT_CCB_UL_OPEN_EVT,
  171. AVDT_CCB_UL_CLOSE_EVT,
  172. AVDT_CCB_LL_OPEN_EVT,
  173. AVDT_CCB_LL_CLOSE_EVT,
  174. AVDT_CCB_LL_CONG_EVT
  175. };
  176. /* scb state machine states; these state values are private to this module so
  177. ** the scb state cannot be read or set by actions functions
  178. */
  179. enum {
  180. AVDT_SCB_IDLE_ST,
  181. AVDT_SCB_CONF_ST,
  182. AVDT_SCB_OPENING_ST,
  183. AVDT_SCB_OPEN_ST,
  184. AVDT_SCB_STREAM_ST,
  185. AVDT_SCB_CLOSING_ST
  186. };
  187. /* state machine action enumeration list */
  188. enum {
  189. AVDT_SCB_HDL_ABORT_CMD,
  190. AVDT_SCB_HDL_ABORT_RSP,
  191. AVDT_SCB_HDL_CLOSE_CMD,
  192. AVDT_SCB_HDL_CLOSE_RSP,
  193. AVDT_SCB_HDL_GETCONFIG_CMD,
  194. AVDT_SCB_HDL_GETCONFIG_RSP,
  195. AVDT_SCB_HDL_OPEN_CMD,
  196. AVDT_SCB_HDL_OPEN_REJ,
  197. AVDT_SCB_HDL_OPEN_RSP,
  198. AVDT_SCB_HDL_PKT,
  199. AVDT_SCB_DROP_PKT,
  200. AVDT_SCB_HDL_RECONFIG_CMD,
  201. AVDT_SCB_HDL_RECONFIG_RSP,
  202. AVDT_SCB_HDL_SECURITY_CMD,
  203. AVDT_SCB_HDL_SECURITY_RSP,
  204. AVDT_SCB_HDL_SETCONFIG_CMD,
  205. AVDT_SCB_HDL_SETCONFIG_REJ,
  206. AVDT_SCB_HDL_SETCONFIG_RSP,
  207. AVDT_SCB_HDL_START_CMD,
  208. AVDT_SCB_HDL_START_RSP,
  209. AVDT_SCB_HDL_SUSPEND_CMD,
  210. AVDT_SCB_HDL_SUSPEND_RSP,
  211. AVDT_SCB_HDL_TC_CLOSE,
  212. #if AVDT_REPORTING == TRUE
  213. AVDT_SCB_HDL_TC_CLOSE_STO,
  214. #endif
  215. AVDT_SCB_HDL_TC_OPEN,
  216. #if AVDT_REPORTING == TRUE
  217. AVDT_SCB_HDL_TC_OPEN_STO,
  218. #endif
  219. AVDT_SCB_SND_DELAY_RPT_REQ,
  220. AVDT_SCB_HDL_DELAY_RPT_CMD,
  221. AVDT_SCB_HDL_DELAY_RPT_RSP,
  222. AVDT_SCB_HDL_WRITE_REQ,
  223. AVDT_SCB_SND_ABORT_REQ,
  224. AVDT_SCB_SND_ABORT_RSP,
  225. AVDT_SCB_SND_CLOSE_REQ,
  226. AVDT_SCB_SND_STREAM_CLOSE,
  227. AVDT_SCB_SND_CLOSE_RSP,
  228. AVDT_SCB_SND_GETCONFIG_REQ,
  229. AVDT_SCB_SND_GETCONFIG_RSP,
  230. AVDT_SCB_SND_OPEN_REQ,
  231. AVDT_SCB_SND_OPEN_RSP,
  232. AVDT_SCB_SND_RECONFIG_REQ,
  233. AVDT_SCB_SND_RECONFIG_RSP,
  234. AVDT_SCB_SND_SECURITY_REQ,
  235. AVDT_SCB_SND_SECURITY_RSP,
  236. AVDT_SCB_SND_SETCONFIG_REQ,
  237. AVDT_SCB_SND_SETCONFIG_REJ,
  238. AVDT_SCB_SND_SETCONFIG_RSP,
  239. AVDT_SCB_SND_TC_CLOSE,
  240. AVDT_SCB_CB_ERR,
  241. AVDT_SCB_CONG_STATE,
  242. AVDT_SCB_REJ_STATE,
  243. AVDT_SCB_REJ_IN_USE,
  244. AVDT_SCB_REJ_NOT_IN_USE,
  245. AVDT_SCB_SET_REMOVE,
  246. AVDT_SCB_FREE_PKT,
  247. AVDT_SCB_CLR_PKT,
  248. AVDT_SCB_CHK_SND_PKT,
  249. AVDT_SCB_TC_TIMER,
  250. AVDT_SCB_CLR_VARS,
  251. AVDT_SCB_DEALLOC,
  252. AVDT_SCB_NUM_ACTIONS
  253. };
  254. #define AVDT_SCB_IGNORE AVDT_SCB_NUM_ACTIONS
  255. /* scb state machine events */
  256. enum {
  257. AVDT_SCB_API_REMOVE_EVT,
  258. AVDT_SCB_API_WRITE_REQ_EVT,
  259. AVDT_SCB_API_GETCONFIG_REQ_EVT,
  260. AVDT_SCB_API_DELAY_RPT_REQ_EVT,
  261. AVDT_SCB_API_SETCONFIG_REQ_EVT,
  262. AVDT_SCB_API_OPEN_REQ_EVT,
  263. AVDT_SCB_API_CLOSE_REQ_EVT,
  264. AVDT_SCB_API_RECONFIG_REQ_EVT,
  265. AVDT_SCB_API_SECURITY_REQ_EVT,
  266. AVDT_SCB_API_ABORT_REQ_EVT,
  267. AVDT_SCB_API_GETCONFIG_RSP_EVT,
  268. AVDT_SCB_API_SETCONFIG_RSP_EVT,
  269. AVDT_SCB_API_SETCONFIG_REJ_EVT,
  270. AVDT_SCB_API_OPEN_RSP_EVT,
  271. AVDT_SCB_API_CLOSE_RSP_EVT,
  272. AVDT_SCB_API_RECONFIG_RSP_EVT,
  273. AVDT_SCB_API_SECURITY_RSP_EVT,
  274. AVDT_SCB_API_ABORT_RSP_EVT,
  275. AVDT_SCB_MSG_SETCONFIG_CMD_EVT,
  276. AVDT_SCB_MSG_GETCONFIG_CMD_EVT,
  277. AVDT_SCB_MSG_OPEN_CMD_EVT,
  278. AVDT_SCB_MSG_START_CMD_EVT,
  279. AVDT_SCB_MSG_SUSPEND_CMD_EVT,
  280. AVDT_SCB_MSG_CLOSE_CMD_EVT,
  281. AVDT_SCB_MSG_ABORT_CMD_EVT,
  282. AVDT_SCB_MSG_RECONFIG_CMD_EVT,
  283. AVDT_SCB_MSG_SECURITY_CMD_EVT,
  284. AVDT_SCB_MSG_DELAY_RPT_CMD_EVT,
  285. AVDT_SCB_MSG_DELAY_RPT_RSP_EVT,
  286. AVDT_SCB_MSG_SETCONFIG_RSP_EVT,
  287. AVDT_SCB_MSG_GETCONFIG_RSP_EVT,
  288. AVDT_SCB_MSG_OPEN_RSP_EVT,
  289. AVDT_SCB_MSG_START_RSP_EVT,
  290. AVDT_SCB_MSG_SUSPEND_RSP_EVT,
  291. AVDT_SCB_MSG_CLOSE_RSP_EVT,
  292. AVDT_SCB_MSG_ABORT_RSP_EVT,
  293. AVDT_SCB_MSG_RECONFIG_RSP_EVT,
  294. AVDT_SCB_MSG_SECURITY_RSP_EVT,
  295. AVDT_SCB_MSG_SETCONFIG_REJ_EVT,
  296. AVDT_SCB_MSG_OPEN_REJ_EVT,
  297. AVDT_SCB_MSG_START_REJ_EVT,
  298. AVDT_SCB_MSG_SUSPEND_REJ_EVT,
  299. AVDT_SCB_TC_TOUT_EVT,
  300. AVDT_SCB_TC_OPEN_EVT,
  301. AVDT_SCB_TC_CLOSE_EVT,
  302. AVDT_SCB_TC_CONG_EVT,
  303. AVDT_SCB_TC_DATA_EVT,
  304. AVDT_SCB_CC_CLOSE_EVT
  305. };
  306. /* adaption layer number of stream routing table entries */
  307. #if AVDT_REPORTING == TRUE
  308. /* 2 channels(1 media, 1 report) for each SEP and one for signalling */
  309. #define AVDT_NUM_RT_TBL ((AVDT_NUM_SEPS<<1) + 1)
  310. #else
  311. #define AVDT_NUM_RT_TBL (AVDT_NUM_SEPS + 1)
  312. #endif
  313. /* adaption layer number of transport channel table entries - moved to target.h
  314. #define AVDT_NUM_TC_TBL (AVDT_NUM_SEPS + AVDT_NUM_LINKS) */
  315. /* "states" used in transport channel table */
  316. #define AVDT_AD_ST_UNUSED 0 /* Unused - unallocated */
  317. #define AVDT_AD_ST_IDLE 1 /* No connection */
  318. #define AVDT_AD_ST_ACP 2 /* Waiting to accept a connection */
  319. #define AVDT_AD_ST_INT 3 /* Initiating a connection */
  320. #define AVDT_AD_ST_CONN 4 /* Waiting for connection confirm */
  321. #define AVDT_AD_ST_CFG 5 /* Waiting for configuration complete */
  322. #define AVDT_AD_ST_OPEN 6 /* Channel opened */
  323. #define AVDT_AD_ST_SEC_INT 7 /* Security process as INT */
  324. #define AVDT_AD_ST_SEC_ACP 8 /* Security process as ACP */
  325. /* Configuration flags. tAVDT_TC_TBL.cfg_flags */
  326. #define AVDT_L2C_CFG_IND_DONE (1<<0)
  327. #define AVDT_L2C_CFG_CFM_DONE (1<<1)
  328. #define AVDT_L2C_CFG_CONN_INT (1<<2)
  329. #define AVDT_L2C_CFG_CONN_ACP (1<<3)
  330. /* result code for avdt_ad_write_req() (L2CA_DataWrite()) */
  331. #define AVDT_AD_FAILED L2CAP_DW_FAILED /* FALSE */
  332. #define AVDT_AD_SUCCESS L2CAP_DW_SUCCESS /* TRUE */
  333. #define AVDT_AD_CONGESTED L2CAP_DW_CONGESTED /* 2 */
  334. /*****************************************************************************
  335. ** data types
  336. *****************************************************************************/
  337. /* msg union of all message parameter types */
  338. typedef union {
  339. tAVDT_EVT_HDR hdr;
  340. tAVDT_EVT_HDR single;
  341. tAVDT_SETCONFIG config_cmd;
  342. tAVDT_CONFIG reconfig_cmd;
  343. tAVDT_MULTI multi;
  344. tAVDT_SECURITY security_cmd;
  345. tAVDT_DISCOVER discover_rsp;
  346. tAVDT_CONFIG svccap;
  347. tAVDT_SECURITY security_rsp;
  348. tAVDT_DELAY_RPT delay_rpt_cmd;
  349. } tAVDT_MSG;
  350. /* data type for AVDT_CCB_API_DISCOVER_REQ_EVT */
  351. typedef struct {
  352. tAVDT_CTRL_CBACK *p_cback;
  353. tAVDT_SEP_INFO *p_sep_info;
  354. UINT8 num_seps;
  355. } tAVDT_CCB_API_DISCOVER;
  356. /* data type for AVDT_CCB_API_GETCAP_REQ_EVT */
  357. typedef struct {
  358. tAVDT_EVT_HDR single;
  359. tAVDT_CTRL_CBACK *p_cback;
  360. tAVDT_CFG *p_cfg;
  361. } tAVDT_CCB_API_GETCAP;
  362. /* data type for AVDT_CCB_API_CONNECT_REQ_EVT */
  363. typedef struct {
  364. tAVDT_CTRL_CBACK *p_cback;
  365. UINT8 sec_mask;
  366. } tAVDT_CCB_API_CONNECT;
  367. /* data type for AVDT_CCB_API_DISCONNECT_REQ_EVT */
  368. typedef struct {
  369. tAVDT_CTRL_CBACK *p_cback;
  370. } tAVDT_CCB_API_DISCONNECT;
  371. /* union associated with ccb state machine events */
  372. typedef union {
  373. tAVDT_CCB_API_DISCOVER discover;
  374. tAVDT_CCB_API_GETCAP getcap;
  375. tAVDT_CCB_API_CONNECT connect;
  376. tAVDT_CCB_API_DISCONNECT disconnect;
  377. tAVDT_MSG msg;
  378. BOOLEAN llcong;
  379. UINT8 err_code;
  380. } tAVDT_CCB_EVT;
  381. /* channel control block type */
  382. typedef struct {
  383. BD_ADDR peer_addr; /* BD address of peer */
  384. TIMER_LIST_ENT timer_entry; /* CCB timer list entry */
  385. fixed_queue_t *cmd_q; /* Queue for outgoing command messages */
  386. fixed_queue_t *rsp_q; /* Queue for outgoing response and reject messages */
  387. tAVDT_CTRL_CBACK *proc_cback; /* Procedure callback function */
  388. tAVDT_CTRL_CBACK *p_conn_cback; /* Connection/disconnection callback function */
  389. void *p_proc_data; /* Pointer to data storage for procedure */
  390. BT_HDR *p_curr_cmd; /* Current command being sent awaiting response */
  391. BT_HDR *p_curr_msg; /* Current message being sent */
  392. BT_HDR *p_rx_msg; /* Current message being received */
  393. BOOLEAN allocated; /* Whether ccb is allocated */
  394. UINT8 state; /* The CCB state machine state */
  395. BOOLEAN ll_opened; /* TRUE if LL is opened */
  396. BOOLEAN proc_busy; /* TRUE when a discover or get capabilities procedure in progress */
  397. UINT8 proc_param; /* Procedure parameter; either SEID for get capabilities or number of SEPS for discover */
  398. BOOLEAN cong; /* Whether signaling channel is congested */
  399. UINT8 label; /* Message header "label" (sequence number) */
  400. BOOLEAN reconn; /* If TRUE, reinitiate connection after transitioning from CLOSING to IDLE state */
  401. UINT8 ret_count; /* Command retransmission count */
  402. UINT8 disc_rsn; /* disconnection reason */
  403. } tAVDT_CCB;
  404. /* type for action functions */
  405. typedef void (*tAVDT_CCB_ACTION)(tAVDT_CCB *p_ccb, tAVDT_CCB_EVT *p_data);
  406. /* type for AVDT_SCB_API_WRITE_REQ_EVT */
  407. typedef struct {
  408. BT_HDR *p_buf;
  409. UINT32 time_stamp;
  410. #if AVDT_MULTIPLEXING == TRUE
  411. fixed_queue_t *frag_q; /* Queue for outgoing media fragments. p_buf should be 0 */
  412. UINT8 *p_data;
  413. UINT32 data_len;
  414. #endif
  415. UINT8 m_pt;
  416. tAVDT_DATA_OPT_MASK opt;
  417. } tAVDT_SCB_APIWRITE;
  418. /* type for AVDT_SCB_TC_CLOSE_EVT */
  419. typedef struct {
  420. UINT8 old_tc_state; /* channel state before closed */
  421. UINT8 tcid; /* TCID */
  422. UINT8 type; /* channel type */
  423. UINT8 disc_rsn; /* disconnection reason */
  424. } tAVDT_SCB_TC_CLOSE;
  425. /* type for scb event data */
  426. typedef union {
  427. tAVDT_MSG msg;
  428. tAVDT_SCB_APIWRITE apiwrite;
  429. tAVDT_DELAY_RPT apidelay;
  430. tAVDT_OPEN open;
  431. tAVDT_SCB_TC_CLOSE close;
  432. BOOLEAN llcong;
  433. BT_HDR *p_pkt;
  434. } tAVDT_SCB_EVT;
  435. /* stream control block type */
  436. typedef struct {
  437. tAVDT_CS cs; /* stream creation struct */
  438. tAVDT_CFG curr_cfg; /* current configuration */
  439. tAVDT_CFG req_cfg; /* requested configuration */
  440. TIMER_LIST_ENT timer_entry; /* timer entry */
  441. BT_HDR *p_pkt; /* packet waiting to be sent */
  442. tAVDT_CCB *p_ccb; /* ccb associated with this scb */
  443. UINT16 media_seq; /* media packet sequence number */
  444. BOOLEAN allocated; /* whether scb is allocated or unused */
  445. BOOLEAN in_use; /* whether stream being used by peer */
  446. BOOLEAN sink_activated; /* A2DP Sink activated/de-activated from Application */
  447. UINT8 role; /* initiator/acceptor role in current procedure */
  448. BOOLEAN remove; /* whether CB is marked for removal */
  449. UINT8 state; /* state machine state */
  450. UINT8 peer_seid; /* SEID of peer stream */
  451. UINT8 curr_evt; /* current event; set only by state machine */
  452. BOOLEAN cong; /* Whether media transport channel is congested */
  453. UINT8 close_code; /* Error code received in close response */
  454. #if AVDT_MULTIPLEXING == TRUE
  455. fixed_queue_t *frag_q; /* Queue for outgoing media fragments */
  456. UINT32 frag_off; /* length of already received media fragments */
  457. UINT32 frag_org_len; /* original length before fragmentation of receiving media packet */
  458. UINT8 *p_next_frag; /* next fragment to send */
  459. UINT8 *p_media_buf; /* buffer for media packet assigned by AVDT_SetMediaBuf */
  460. UINT32 media_buf_len; /* length of buffer for media packet assigned by AVDT_SetMediaBuf */
  461. #endif
  462. } tAVDT_SCB;
  463. /* type for action functions */
  464. typedef void (*tAVDT_SCB_ACTION)(tAVDT_SCB *p_scb, tAVDT_SCB_EVT *p_data);
  465. /* adaption layer type for transport channel table */
  466. typedef struct {
  467. UINT16 peer_mtu; /* L2CAP mtu of the peer device */
  468. UINT16 my_mtu; /* Our MTU for this channel */
  469. UINT16 my_flush_to; /* Our flush timeout for this channel */
  470. UINT16 lcid;
  471. UINT8 tcid; /* transport channel id */
  472. UINT8 ccb_idx; /* channel control block associated with this tc */
  473. UINT8 state; /* transport channel state */
  474. UINT8 cfg_flags; /* L2CAP configuration flags */
  475. UINT8 id;
  476. } tAVDT_TC_TBL;
  477. /* adaption layer type for stream routing table */
  478. typedef struct {
  479. UINT16 lcid; /* L2CAP LCID of the associated transport channel */
  480. UINT8 scb_hdl; /* stream control block associated with this tc */
  481. } tAVDT_RT_TBL;
  482. /* adaption layer control block */
  483. typedef struct {
  484. tAVDT_RT_TBL rt_tbl[AVDT_NUM_LINKS][AVDT_NUM_RT_TBL];
  485. tAVDT_TC_TBL tc_tbl[AVDT_NUM_TC_TBL];
  486. UINT8 lcid_tbl[MAX_L2CAP_CHANNELS]; /* map LCID to tc_tbl index */
  487. } tAVDT_AD;
  488. /* Control block for AVDT */
  489. typedef struct {
  490. tAVDT_REG rcb; /* registration control block */
  491. tAVDT_CCB ccb[AVDT_NUM_LINKS]; /* channel control blocks */
  492. tAVDT_SCB scb[AVDT_NUM_SEPS]; /* stream control blocks */
  493. tAVDT_AD ad; /* adaption layer control block */
  494. tAVDTC_CTRL_CBACK *p_conf_cback; /* conformance callback function */
  495. tAVDT_CCB_ACTION *p_ccb_act; /* pointer to CCB action functions */
  496. tAVDT_SCB_ACTION *p_scb_act; /* pointer to SCB action functions */
  497. tAVDT_CTRL_CBACK *p_conn_cback; /* connection callback function */
  498. UINT8 trace_level; /* trace level */
  499. } tAVDT_CB;
  500. /*****************************************************************************
  501. ** function declarations
  502. *****************************************************************************/
  503. /* CCB function declarations */
  504. extern void avdt_ccb_init(void);
  505. extern void avdt_ccb_event(tAVDT_CCB *p_ccb, UINT8 event, tAVDT_CCB_EVT *p_data);
  506. extern tAVDT_CCB *avdt_ccb_by_bd(BD_ADDR bd_addr);
  507. extern tAVDT_CCB *avdt_ccb_alloc(BD_ADDR bd_addr);
  508. extern void avdt_ccb_dealloc(tAVDT_CCB *p_ccb, tAVDT_CCB_EVT *p_data);
  509. extern UINT8 avdt_ccb_to_idx(tAVDT_CCB *p_ccb);
  510. extern tAVDT_CCB *avdt_ccb_by_idx(UINT8 idx);
  511. /* CCB action functions */
  512. extern void avdt_ccb_chan_open(tAVDT_CCB *p_ccb, tAVDT_CCB_EVT *p_data);
  513. extern void avdt_ccb_chan_close(tAVDT_CCB *p_ccb, tAVDT_CCB_EVT *p_data);
  514. extern void avdt_ccb_chk_close(tAVDT_CCB *p_ccb, tAVDT_CCB_EVT *p_data);
  515. extern void avdt_ccb_hdl_discover_cmd(tAVDT_CCB *p_ccb, tAVDT_CCB_EVT *p_data);
  516. extern void avdt_ccb_hdl_discover_rsp(tAVDT_CCB *p_ccb, tAVDT_CCB_EVT *p_data);
  517. extern void avdt_ccb_hdl_getcap_cmd(tAVDT_CCB *p_ccb, tAVDT_CCB_EVT *p_data);
  518. extern void avdt_ccb_hdl_getcap_rsp(tAVDT_CCB *p_ccb, tAVDT_CCB_EVT *p_data);
  519. extern void avdt_ccb_hdl_start_cmd(tAVDT_CCB *p_ccb, tAVDT_CCB_EVT *p_data);
  520. extern void avdt_ccb_hdl_start_rsp(tAVDT_CCB *p_ccb, tAVDT_CCB_EVT *p_data);
  521. extern void avdt_ccb_hdl_suspend_cmd(tAVDT_CCB *p_ccb, tAVDT_CCB_EVT *p_data);
  522. extern void avdt_ccb_hdl_suspend_rsp(tAVDT_CCB *p_ccb, tAVDT_CCB_EVT *p_data);
  523. extern void avdt_ccb_snd_discover_cmd(tAVDT_CCB *p_ccb, tAVDT_CCB_EVT *p_data);
  524. extern void avdt_ccb_snd_discover_rsp(tAVDT_CCB *p_ccb, tAVDT_CCB_EVT *p_data);
  525. extern void avdt_ccb_snd_getcap_cmd(tAVDT_CCB *p_ccb, tAVDT_CCB_EVT *p_data);
  526. extern void avdt_ccb_snd_getcap_rsp(tAVDT_CCB *p_ccb, tAVDT_CCB_EVT *p_data);
  527. extern void avdt_ccb_snd_start_cmd(tAVDT_CCB *p_ccb, tAVDT_CCB_EVT *p_data);
  528. extern void avdt_ccb_snd_start_rsp(tAVDT_CCB *p_ccb, tAVDT_CCB_EVT *p_data);
  529. extern void avdt_ccb_snd_suspend_cmd(tAVDT_CCB *p_ccb, tAVDT_CCB_EVT *p_data);
  530. extern void avdt_ccb_snd_suspend_rsp(tAVDT_CCB *p_ccb, tAVDT_CCB_EVT *p_data);
  531. extern void avdt_ccb_clear_cmds(tAVDT_CCB *p_ccb, tAVDT_CCB_EVT *p_data);
  532. extern void avdt_ccb_cmd_fail(tAVDT_CCB *p_ccb, tAVDT_CCB_EVT *p_data);
  533. extern void avdt_ccb_free_cmd(tAVDT_CCB *p_ccb, tAVDT_CCB_EVT *p_data);
  534. extern void avdt_ccb_cong_state(tAVDT_CCB *p_ccb, tAVDT_CCB_EVT *p_data);
  535. extern void avdt_ccb_ret_cmd(tAVDT_CCB *p_ccb, tAVDT_CCB_EVT *p_data);
  536. extern void avdt_ccb_snd_cmd(tAVDT_CCB *p_ccb, tAVDT_CCB_EVT *p_data);
  537. extern void avdt_ccb_snd_msg(tAVDT_CCB *p_ccb, tAVDT_CCB_EVT *p_data);
  538. extern void avdt_ccb_set_reconn(tAVDT_CCB *p_ccb, tAVDT_CCB_EVT *p_data);
  539. extern void avdt_ccb_clr_reconn(tAVDT_CCB *p_ccb, tAVDT_CCB_EVT *p_data);
  540. extern void avdt_ccb_chk_reconn(tAVDT_CCB *p_ccb, tAVDT_CCB_EVT *p_data);
  541. extern void avdt_ccb_chk_timer(tAVDT_CCB *p_ccb, tAVDT_CCB_EVT *p_data);
  542. extern void avdt_ccb_set_conn(tAVDT_CCB *p_ccb, tAVDT_CCB_EVT *p_data);
  543. extern void avdt_ccb_set_disconn(tAVDT_CCB *p_ccb, tAVDT_CCB_EVT *p_data);
  544. extern void avdt_ccb_do_disconn(tAVDT_CCB *p_ccb, tAVDT_CCB_EVT *p_data);
  545. extern void avdt_ccb_ll_closed(tAVDT_CCB *p_ccb, tAVDT_CCB_EVT *p_data);
  546. extern void avdt_ccb_ll_opened(tAVDT_CCB *p_ccb, tAVDT_CCB_EVT *p_data);
  547. /* SCB function prototypes */
  548. extern void avdt_scb_event(tAVDT_SCB *p_scb, UINT8 event, tAVDT_SCB_EVT *p_data);
  549. extern void avdt_scb_init(void);
  550. extern tAVDT_SCB *avdt_scb_alloc(tAVDT_CS *p_cs);
  551. extern void avdt_scb_dealloc(tAVDT_SCB *p_scb, tAVDT_SCB_EVT *p_data);
  552. extern UINT8 avdt_scb_to_hdl(tAVDT_SCB *p_scb);
  553. extern tAVDT_SCB *avdt_scb_by_hdl(UINT8 hdl);
  554. extern UINT8 avdt_scb_verify(tAVDT_CCB *p_ccb, UINT8 state, UINT8 *p_seid, UINT16 num_seid, UINT8 *p_err_code);
  555. extern void avdt_scb_peer_seid_list(tAVDT_MULTI *p_multi);
  556. extern UINT32 avdt_scb_gen_ssrc(tAVDT_SCB *p_scb);
  557. /* SCB action functions */
  558. extern void avdt_scb_hdl_abort_cmd(tAVDT_SCB *p_scb, tAVDT_SCB_EVT *p_data);
  559. extern void avdt_scb_hdl_abort_rsp(tAVDT_SCB *p_scb, tAVDT_SCB_EVT *p_data);
  560. extern void avdt_scb_hdl_close_cmd(tAVDT_SCB *p_scb, tAVDT_SCB_EVT *p_data);
  561. extern void avdt_scb_hdl_close_rsp(tAVDT_SCB *p_scb, tAVDT_SCB_EVT *p_data);
  562. extern void avdt_scb_hdl_getconfig_cmd(tAVDT_SCB *p_scb, tAVDT_SCB_EVT *p_data);
  563. extern void avdt_scb_hdl_getconfig_rsp(tAVDT_SCB *p_scb, tAVDT_SCB_EVT *p_data);
  564. extern void avdt_scb_hdl_open_cmd(tAVDT_SCB *p_scb, tAVDT_SCB_EVT *p_data);
  565. extern void avdt_scb_hdl_open_rej(tAVDT_SCB *p_scb, tAVDT_SCB_EVT *p_data);
  566. extern void avdt_scb_hdl_open_rsp(tAVDT_SCB *p_scb, tAVDT_SCB_EVT *p_data);
  567. extern void avdt_scb_hdl_pkt(tAVDT_SCB *p_scb, tAVDT_SCB_EVT *p_data);
  568. extern void avdt_scb_drop_pkt(tAVDT_SCB *p_scb, tAVDT_SCB_EVT *p_data);
  569. extern void avdt_scb_hdl_reconfig_cmd(tAVDT_SCB *p_scb, tAVDT_SCB_EVT *p_data);
  570. extern void avdt_scb_hdl_reconfig_rsp(tAVDT_SCB *p_scb, tAVDT_SCB_EVT *p_data);
  571. extern void avdt_scb_hdl_security_cmd(tAVDT_SCB *p_scb, tAVDT_SCB_EVT *p_data);
  572. extern void avdt_scb_hdl_security_rsp(tAVDT_SCB *p_scb, tAVDT_SCB_EVT *p_data);
  573. extern void avdt_scb_hdl_setconfig_cmd(tAVDT_SCB *p_scb, tAVDT_SCB_EVT *p_data);
  574. extern void avdt_scb_hdl_setconfig_rej(tAVDT_SCB *p_scb, tAVDT_SCB_EVT *p_data);
  575. extern void avdt_scb_hdl_setconfig_rsp(tAVDT_SCB *p_scb, tAVDT_SCB_EVT *p_data);
  576. extern void avdt_scb_hdl_start_cmd(tAVDT_SCB *p_scb, tAVDT_SCB_EVT *p_data);
  577. extern void avdt_scb_hdl_start_rsp(tAVDT_SCB *p_scb, tAVDT_SCB_EVT *p_data);
  578. extern void avdt_scb_hdl_suspend_cmd(tAVDT_SCB *p_scb, tAVDT_SCB_EVT *p_data);
  579. extern void avdt_scb_hdl_suspend_rsp(tAVDT_SCB *p_scb, tAVDT_SCB_EVT *p_data);
  580. extern void avdt_scb_snd_delay_rpt_req(tAVDT_SCB *p_scb, tAVDT_SCB_EVT *p_data);
  581. extern void avdt_scb_hdl_delay_rpt_cmd(tAVDT_SCB *p_scb, tAVDT_SCB_EVT *p_data);
  582. extern void avdt_scb_hdl_delay_rpt_rsp(tAVDT_SCB *p_scb, tAVDT_SCB_EVT *p_data);
  583. extern void avdt_scb_hdl_tc_close(tAVDT_SCB *p_scb, tAVDT_SCB_EVT *p_data);
  584. extern void avdt_scb_hdl_tc_open(tAVDT_SCB *p_scb, tAVDT_SCB_EVT *p_data);
  585. extern void avdt_scb_hdl_tc_close_sto(tAVDT_SCB *p_scb, tAVDT_SCB_EVT *p_data);
  586. extern void avdt_scb_hdl_tc_open_sto(tAVDT_SCB *p_scb, tAVDT_SCB_EVT *p_data);
  587. extern void avdt_scb_hdl_write_req(tAVDT_SCB *p_scb, tAVDT_SCB_EVT *p_data);
  588. extern void avdt_scb_snd_abort_req(tAVDT_SCB *p_scb, tAVDT_SCB_EVT *p_data);
  589. extern void avdt_scb_snd_abort_rsp(tAVDT_SCB *p_scb, tAVDT_SCB_EVT *p_data);
  590. extern void avdt_scb_snd_close_req(tAVDT_SCB *p_scb, tAVDT_SCB_EVT *p_data);
  591. extern void avdt_scb_snd_stream_close(tAVDT_SCB *p_scb, tAVDT_SCB_EVT *p_data);
  592. extern void avdt_scb_snd_close_rsp(tAVDT_SCB *p_scb, tAVDT_SCB_EVT *p_data);
  593. extern void avdt_scb_snd_getconfig_req(tAVDT_SCB *p_scb, tAVDT_SCB_EVT *p_data);
  594. extern void avdt_scb_snd_getconfig_rsp(tAVDT_SCB *p_scb, tAVDT_SCB_EVT *p_data);
  595. extern void avdt_scb_snd_open_req(tAVDT_SCB *p_scb, tAVDT_SCB_EVT *p_data);
  596. extern void avdt_scb_snd_open_rsp(tAVDT_SCB *p_scb, tAVDT_SCB_EVT *p_data);
  597. extern void avdt_scb_snd_reconfig_req(tAVDT_SCB *p_scb, tAVDT_SCB_EVT *p_data);
  598. extern void avdt_scb_snd_reconfig_rsp(tAVDT_SCB *p_scb, tAVDT_SCB_EVT *p_data);
  599. extern void avdt_scb_snd_security_req(tAVDT_SCB *p_scb, tAVDT_SCB_EVT *p_data);
  600. extern void avdt_scb_snd_security_rsp(tAVDT_SCB *p_scb, tAVDT_SCB_EVT *p_data);
  601. extern void avdt_scb_snd_setconfig_req(tAVDT_SCB *p_scb, tAVDT_SCB_EVT *p_data);
  602. extern void avdt_scb_snd_setconfig_rej(tAVDT_SCB *p_scb, tAVDT_SCB_EVT *p_data);
  603. extern void avdt_scb_snd_setconfig_rsp(tAVDT_SCB *p_scb, tAVDT_SCB_EVT *p_data);
  604. extern void avdt_scb_snd_tc_close(tAVDT_SCB *p_scb, tAVDT_SCB_EVT *p_data);
  605. extern void avdt_scb_cb_err(tAVDT_SCB *p_scb, tAVDT_SCB_EVT *p_data);
  606. extern void avdt_scb_cong_state(tAVDT_SCB *p_scb, tAVDT_SCB_EVT *p_data);
  607. extern void avdt_scb_rej_state(tAVDT_SCB *p_scb, tAVDT_SCB_EVT *p_data);
  608. extern void avdt_scb_rej_in_use(tAVDT_SCB *p_scb, tAVDT_SCB_EVT *p_data);
  609. extern void avdt_scb_rej_not_in_use(tAVDT_SCB *p_scb, tAVDT_SCB_EVT *p_data);
  610. extern void avdt_scb_set_remove(tAVDT_SCB *p_scb, tAVDT_SCB_EVT *p_data);
  611. extern void avdt_scb_free_pkt(tAVDT_SCB *p_scb, tAVDT_SCB_EVT *p_data);
  612. extern void avdt_scb_chk_snd_pkt(tAVDT_SCB *p_scb, tAVDT_SCB_EVT *p_data);
  613. extern void avdt_scb_clr_pkt(tAVDT_SCB *p_scb, tAVDT_SCB_EVT *p_data);
  614. extern void avdt_scb_tc_timer(tAVDT_SCB *p_scb, tAVDT_SCB_EVT *p_data);
  615. extern void avdt_scb_clr_vars(tAVDT_SCB *p_scb, tAVDT_SCB_EVT *p_data);
  616. extern void avdt_scb_queue_frags(tAVDT_SCB *p_scb, UINT8 **pp_data, UINT32 *p_data_len, fixed_queue_t *pq);
  617. /* msg function declarations */
  618. extern BOOLEAN avdt_msg_send(tAVDT_CCB *p_ccb, BT_HDR *p_msg);
  619. extern void avdt_msg_send_cmd(tAVDT_CCB *p_ccb, void *p_scb, UINT8 sig_id, tAVDT_MSG *p_params);
  620. extern void avdt_msg_send_rsp(tAVDT_CCB *p_ccb, UINT8 sig_id, tAVDT_MSG *p_params);
  621. extern void avdt_msg_send_rej(tAVDT_CCB *p_ccb, UINT8 sig_id, tAVDT_MSG *p_params);
  622. extern void avdt_msg_send_grej(tAVDT_CCB *p_ccb, UINT8 sig_id, tAVDT_MSG *p_params);
  623. extern void avdt_msg_ind(tAVDT_CCB *p_ccb, BT_HDR *p_buf);
  624. /* adaption layer function declarations */
  625. extern void avdt_ad_init(void);
  626. extern UINT8 avdt_ad_type_to_tcid(UINT8 type, tAVDT_SCB *p_scb);
  627. extern tAVDT_TC_TBL *avdt_ad_tc_tbl_by_st(UINT8 type, tAVDT_CCB *p_ccb, UINT8 state);
  628. extern tAVDT_TC_TBL *avdt_ad_tc_tbl_by_lcid(UINT16 lcid);
  629. extern tAVDT_TC_TBL *avdt_ad_tc_tbl_alloc(tAVDT_CCB *p_ccb);
  630. extern UINT8 avdt_ad_tc_tbl_to_idx(tAVDT_TC_TBL *p_tbl);
  631. extern void avdt_ad_tc_close_ind(tAVDT_TC_TBL *p_tbl, UINT16 reason);
  632. extern void avdt_ad_tc_open_ind(tAVDT_TC_TBL *p_tbl);
  633. extern void avdt_ad_tc_cong_ind(tAVDT_TC_TBL *p_tbl, BOOLEAN is_congested);
  634. extern void avdt_ad_tc_data_ind(tAVDT_TC_TBL *p_tbl, BT_HDR *p_buf);
  635. extern tAVDT_TC_TBL *avdt_ad_tc_tbl_by_type(UINT8 type, tAVDT_CCB *p_ccb, tAVDT_SCB *p_scb);
  636. extern UINT8 avdt_ad_write_req(UINT8 type, tAVDT_CCB *p_ccb, tAVDT_SCB *p_scb, BT_HDR *p_buf);
  637. extern void avdt_ad_open_req(UINT8 type, tAVDT_CCB *p_ccb, tAVDT_SCB *p_scb, UINT8 role);
  638. extern void avdt_ad_close_req(UINT8 type, tAVDT_CCB *p_ccb, tAVDT_SCB *p_scb);
  639. extern void avdt_process_timeout(TIMER_LIST_ENT *p_tle);
  640. /*****************************************************************************
  641. ** macros
  642. *****************************************************************************/
  643. /* we store the scb and the label in the layer_specific field of the
  644. ** current cmd
  645. */
  646. #define AVDT_BLD_LAYERSPEC(ls, msg, label) \
  647. ls = (((label) << 4) | (msg))
  648. #define AVDT_LAYERSPEC_LABEL(ls) ((UINT8)((ls) >> 4))
  649. #define AVDT_LAYERSPEC_MSG(ls) ((UINT8)((ls) & 0x000F))
  650. /*****************************************************************************
  651. ** global data
  652. *****************************************************************************/
  653. #ifdef __cplusplus
  654. extern "C"
  655. {
  656. #endif
  657. /******************************************************************************
  658. ** Main Control Block
  659. *******************************************************************************/
  660. #if AVDT_DYNAMIC_MEMORY == FALSE
  661. extern tAVDT_CB avdt_cb;
  662. #else
  663. extern tAVDT_CB *avdt_cb_ptr;
  664. #define avdt_cb (*avdt_cb_ptr)
  665. #endif
  666. /* L2CAP callback registration structure */
  667. extern const tL2CAP_APPL_INFO avdt_l2c_appl;
  668. /* reject message event lookup table */
  669. extern const UINT8 avdt_msg_rej_2_evt[];
  670. #ifdef __cplusplus
  671. }
  672. #endif
  673. #endif ///AVRC_INCLUDED == TRUE
  674. #endif /* AVDT_INT_H */