1/******************************************************************************
2 *
3 *  Copyright (C) 2007-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#ifndef UIPC_H
19#define UIPC_H
20
21#ifndef UDRV_API
22#define UDRV_API
23#endif
24
25#define UIPC_CH_ID_AV_CTRL  0
26#define UIPC_CH_ID_AV_AUDIO 1
27#define UIPC_CH_NUM         2
28
29#define UIPC_CH_ID_ALL      3   /* used to address all the ch id at once */
30
31#define DEFAULT_READ_POLL_TMO_MS 100
32
33typedef UINT8 tUIPC_CH_ID;
34
35/* Events generated */
36typedef enum {
37    UIPC_OPEN_EVT           = 0x0001,
38    UIPC_CLOSE_EVT          = 0x0002,
39    UIPC_RX_DATA_EVT        = 0x0004,
40    UIPC_RX_DATA_READY_EVT  = 0x0008,
41    UIPC_TX_DATA_READY_EVT  = 0x0010
42} tUIPC_EVENT;
43
44/*
45 * UIPC IOCTL Requests
46 */
47
48#define UIPC_REQ_RX_FLUSH               1
49#define UIPC_REG_CBACK                  2
50#define UIPC_REG_REMOVE_ACTIVE_READSET  3
51#define UIPC_SET_READ_POLL_TMO          4
52
53typedef void (tUIPC_RCV_CBACK)(tUIPC_CH_ID ch_id, tUIPC_EVENT event); /* points to BT_HDR which describes event type and length of data; len contains the number of bytes of entire message (sizeof(BT_HDR) + offset + size of data) */
54
55#ifdef __cplusplus
56extern "C"
57{
58#endif
59
60const char* dump_uipc_event(tUIPC_EVENT event);
61
62
63/*******************************************************************************
64**
65** Function         UIPC_Init
66**
67** Description      Initialize UIPC module
68**
69** Returns          void
70**
71*******************************************************************************/
72UDRV_API extern void UIPC_Init(void *);
73
74/*******************************************************************************
75**
76** Function         UIPC_Open
77**
78** Description      Open UIPC interface
79**
80** Returns          void
81**
82*******************************************************************************/
83UDRV_API extern BOOLEAN UIPC_Open(tUIPC_CH_ID ch_id, tUIPC_RCV_CBACK *p_cback);
84
85/*******************************************************************************
86**
87** Function         UIPC_Close
88**
89** Description      Close UIPC interface
90**
91** Returns          void
92**
93*******************************************************************************/
94UDRV_API extern void UIPC_Close(tUIPC_CH_ID ch_id);
95
96/*******************************************************************************
97**
98** Function         UIPC_SendBuf
99**
100** Description      Called to transmit a message over UIPC.
101**                  Message buffer will be freed by UIPC_SendBuf.
102**
103** Returns          void
104**
105*******************************************************************************/
106UDRV_API extern BOOLEAN UIPC_SendBuf(tUIPC_CH_ID ch_id, BT_HDR *p_msg);
107
108/*******************************************************************************
109**
110** Function         UIPC_Send
111**
112** Description      Called to transmit a message over UIPC.
113**
114** Returns          void
115**
116*******************************************************************************/
117UDRV_API extern BOOLEAN UIPC_Send(tUIPC_CH_ID ch_id, UINT16 msg_evt, UINT8 *p_buf, UINT16 msglen);
118
119/*******************************************************************************
120**
121** Function         UIPC_Read
122**
123** Description      Called to read a message from UIPC.
124**
125** Returns          void
126**
127*******************************************************************************/
128UDRV_API extern UINT32 UIPC_Read(tUIPC_CH_ID ch_id, UINT16 *p_msg_evt, UINT8 *p_buf, UINT32 len);
129
130/*******************************************************************************
131**
132** Function         UIPC_Ioctl
133**
134** Description      Called to control UIPC.
135**
136** Returns          void
137**
138*******************************************************************************/
139UDRV_API extern BOOLEAN UIPC_Ioctl(tUIPC_CH_ID ch_id, UINT32 request, void *param);
140
141
142#ifdef __cplusplus
143}
144#endif
145
146
147#endif  /* UIPC_H */
148
149
150