]> git.proxmox.com Git - mirror_edk2.git/blame - MdePkg/Include/Protocol/BluetoothHc.h
MdePkg/MpService.h: Fixed typo in function header to match PI spec
[mirror_edk2.git] / MdePkg / Include / Protocol / BluetoothHc.h
CommitLineData
362c355c
QS
1/** @file\r
2 EFI Bluetooth Host Controller Protocol as defined in UEFI 2.5.\r
3 This protocol abstracts the Bluetooth host controller layer message transmit and receive.\r
4\r
5 Copyright (c) 2015, Intel Corporation. All rights reserved.<BR>\r
6 This program and the accompanying materials are licensed and made available under \r
7 the terms and conditions of the BSD License that accompanies this distribution. \r
8 The full text of the license may be found at\r
9 http://opensource.org/licenses/bsd-license.php. \r
10 \r
11 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, \r
12 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.\r
13\r
14 @par Revision Reference: \r
15 This Protocol is introduced in UEFI Specification 2.5\r
16\r
17**/\r
18\r
19#ifndef __EFI_BLUETOOTH_HC_PROTOCOL_H__\r
20#define __EFI_BLUETOOTH_HC_PROTOCOL_H__\r
21\r
22#define EFI_BLUETOOTH_HC_PROTOCOL_GUID \\r
23 { \\r
24 0xb3930571, 0xbeba, 0x4fc5, { 0x92, 0x3, 0x94, 0x27, 0x24, 0x2e, 0x6a, 0x43 } \\r
25 }\r
26 \r
27typedef struct _EFI_BLUETOOTH_HC_PROTOCOL EFI_BLUETOOTH_HC_PROTOCOL;\r
28\r
29/**\r
30 Send HCI command packet.\r
31\r
32 @param This Pointer to the EFI_BLUETOOTH_HC_PROTOCOL instance.\r
33 @param BufferSize On input, indicates the size, in bytes, of the data buffer specified by Buffer. \r
34 On output, indicates the amount of data actually transferred.\r
35 @param Buffer A pointer to the buffer of data that will be transmitted to Bluetooth host \r
36 controller.\r
37 @param Timeout Indicating the transfer should be completed within this time frame. The units are \r
38 in milliseconds. If Timeout is 0, then the caller must wait for the function to \r
39 be completed until EFI_SUCCESS or EFI_DEVICE_ERROR is returned.\r
40\r
41 @retval EFI_SUCCESS The HCI command packet is sent successfully.\r
42 @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:\r
43 - BufferSize is NULL.\r
44 - *BufferSize is 0.\r
45 - Buffer is NULL.\r
46 @retval EFI_TIMEOUT Sending HCI command packet fail due to timeout.\r
47 @retval EFI_DEVICE_ERROR Sending HCI command packet fail due to host controller or device error.\r
48\r
49**/\r
50typedef \r
51EFI_STATUS\r
52(EFIAPI *EFI_BLUETOOTH_HC_SEND_COMMAND)(\r
53 IN EFI_BLUETOOTH_HC_PROTOCOL *This,\r
54 IN OUT UINTN *BufferSize,\r
55 IN VOID *Buffer,\r
56 IN UINTN Timeout\r
57 );\r
58 \r
59\r
60/**\r
61 Receive HCI event packet.\r
62\r
63 @param This Pointer to the EFI_BLUETOOTH_HC_PROTOCOL instance.\r
64 @param BufferSize On input, indicates the size, in bytes, of the data buffer specified by Buffer. \r
65 On output, indicates the amount of data actually transferred.\r
66 @param Buffer A pointer to the buffer of data that will be received from Bluetooth host controller.\r
67 @param Timeout Indicating the transfer should be completed within this time frame. The units are \r
68 in milliseconds. If Timeout is 0, then the caller must wait for the function to \r
69 be completed until EFI_SUCCESS or EFI_DEVICE_ERROR is returned.\r
70\r
71 @retval EFI_SUCCESS The HCI event packet is received successfully.\r
72 @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:\r
73 - BufferSize is NULL.\r
74 - *BufferSize is 0.\r
75 - Buffer is NULL.\r
76 @retval EFI_TIMEOUT Receiving HCI event packet fail due to timeout.\r
77 @retval EFI_DEVICE_ERROR Receiving HCI event packet fail due to host controller or device error.\r
78\r
79**/\r
80typedef\r
81EFI_STATUS\r
82(EFIAPI *EFI_BLUETOOTH_HC_RECEIVE_EVENT)(\r
83 IN EFI_BLUETOOTH_HC_PROTOCOL *This,\r
84 IN OUT UINTN *BufferSize,\r
85 OUT VOID *Buffer,\r
86 IN UINTN Timeout\r
87 );\r
88 \r
89/**\r
90 Callback function, it is called when asynchronous transfer is completed.\r
91\r
92 @param Data Pointer to the EFI_BLUETOOTH_HC_PROTOCOL instance.\r
93 @param DataLength Specifies the length, in bytes, of the data to be received.\r
94 @param Context Data passed into Callback function. This is optional parameter and may be NULL.\r
95\r
96 @retval EFI_SUCCESS The callback function complete successfully.\r
97\r
98**/\r
99typedef\r
100EFI_STATUS\r
101(EFIAPI *EFI_BLUETOOTH_HC_ASYNC_FUNC_CALLBACK) (\r
102 IN VOID *Data,\r
103 IN UINTN DataLength,\r
104 IN VOID *Context\r
105 );\r
106 \r
107/**\r
108 Receive HCI event packet in non-blocking way.\r
109\r
110 @param This Pointer to the EFI_BLUETOOTH_HC_PROTOCOL instance.\r
111 @param IsNewTransfer If TRUE, a new transfer will be submitted. If FALSE, the request is deleted.\r
112 @param PollingInterval Indicates the periodic rate, in milliseconds, that the transfer is to be executed.\r
113 @param DataLength Specifies the length, in bytes, of the data to be received.\r
114 @param Callback The callback function. This function is called if the asynchronous transfer is \r
115 completed.\r
116 @param Context Data passed into Callback function. This is optional parameter and may be NULL.\r
117\r
118 @retval EFI_SUCCESS The HCI asynchronous receive request is submitted successfully.\r
119 @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:\r
120 - DataLength is 0.\r
121 - If IsNewTransfer is TRUE, and an asynchronous receive request already exists.\r
122\r
123**/\r
124typedef\r
125EFI_STATUS\r
126(EFIAPI *EFI_BLUETOOTH_HC_ASYNC_RECEIVE_EVENT)(\r
127 IN EFI_BLUETOOTH_HC_PROTOCOL *This,\r
128 IN BOOLEAN IsNewTransfer,\r
129 IN UINTN PollingInterval,\r
130 IN UINTN DataLength,\r
131 IN EFI_BLUETOOTH_HC_ASYNC_FUNC_CALLBACK Callback,\r
132 IN VOID *Context\r
133 );\r
134 \r
135/**\r
136 Send HCI ACL data packet.\r
137\r
138 @param This Pointer to the EFI_BLUETOOTH_HC_PROTOCOL instance.\r
139 @param BufferSize On input, indicates the size, in bytes, of the data buffer specified by Buffer. \r
140 On output, indicates the amount of data actually transferred.\r
141 @param Buffer A pointer to the buffer of data that will be transmitted to Bluetooth host \r
142 controller.\r
143 @param Timeout Indicating the transfer should be completed within this time frame. The units are \r
144 in milliseconds. If Timeout is 0, then the caller must wait for the function to \r
145 be completed until EFI_SUCCESS or EFI_DEVICE_ERROR is returned.\r
146\r
147 @retval EFI_SUCCESS The HCI ACL data packet is sent successfully.\r
148 @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:\r
149 - BufferSize is NULL.\r
150 - *BufferSize is 0.\r
151 - Buffer is NULL.\r
152 @retval EFI_TIMEOUT Sending HCI ACL data packet fail due to timeout.\r
153 @retval EFI_DEVICE_ERROR Sending HCI ACL data packet fail due to host controller or device error.\r
154\r
155**/\r
156typedef\r
157EFI_STATUS\r
158(EFIAPI *EFI_BLUETOOTH_HC_SEND_ACL_DATA)(\r
159 IN EFI_BLUETOOTH_HC_PROTOCOL *This,\r
160 IN OUT UINTN *BufferSize,\r
161 IN VOID *Buffer,\r
162 IN UINTN Timeout\r
163 );\r
164 \r
165/**\r
166 Receive HCI ACL data packet.\r
167\r
168 @param This Pointer to the EFI_BLUETOOTH_HC_PROTOCOL instance.\r
169 @param BufferSize On input, indicates the size, in bytes, of the data buffer specified by Buffer. \r
170 On output, indicates the amount of data actually transferred.\r
171 @param Buffer A pointer to the buffer of data that will be received from Bluetooth host controller.\r
172 @param Timeout Indicating the transfer should be completed within this time frame. The units are \r
173 in milliseconds. If Timeout is 0, then the caller must wait for the function to \r
174 be completed until EFI_SUCCESS or EFI_DEVICE_ERROR is returned.\r
175\r
176 @retval EFI_SUCCESS The HCI ACL data packet is received successfully.\r
177 @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:\r
178 - BufferSize is NULL.\r
179 - *BufferSize is 0.\r
180 - Buffer is NULL.\r
181 @retval EFI_TIMEOUT Receiving HCI ACL data packet fail due to timeout.\r
182 @retval EFI_DEVICE_ERROR Receiving HCI ACL data packet fail due to host controller or device error.\r
183\r
184**/\r
185typedef\r
186EFI_STATUS\r
187(EFIAPI *EFI_BLUETOOTH_HC_RECEIVE_ACL_DATA)(\r
188 IN EFI_BLUETOOTH_HC_PROTOCOL *This,\r
189 IN OUT UINTN *BufferSize,\r
190 OUT VOID *Buffer,\r
191 IN UINTN Timeout\r
192 );\r
193 \r
194\r
195/**\r
196 Receive HCI ACL data packet in non-blocking way.\r
197\r
198 @param This Pointer to the EFI_BLUETOOTH_HC_PROTOCOL instance.\r
199 @param IsNewTransfer If TRUE, a new transfer will be submitted. If FALSE, the request is deleted.\r
200 @param PollingInterval Indicates the periodic rate, in milliseconds, that the transfer is to be executed.\r
201 @param DataLength Specifies the length, in bytes, of the data to be received.\r
202 @param Callback The callback function. This function is called if the asynchronous transfer is \r
203 completed.\r
204 @param Context Data passed into Callback function. This is optional parameter and may be NULL.\r
205\r
206 @retval EFI_SUCCESS The HCI asynchronous receive request is submitted successfully.\r
207 @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:\r
208 - DataLength is 0.\r
209 - If IsNewTransfer is TRUE, and an asynchronous receive request already exists.\r
210\r
211**/\r
212typedef\r
213EFI_STATUS\r
214(EFIAPI *EFI_BLUETOOTH_HC_ASYNC_RECEIVE_ACL_DATA) (\r
215 IN EFI_BLUETOOTH_HC_PROTOCOL *This,\r
216 IN BOOLEAN IsNewTransfer,\r
217 IN UINTN PollingInterval,\r
218 IN UINTN DataLength,\r
219 IN EFI_BLUETOOTH_HC_ASYNC_FUNC_CALLBACK Callback,\r
220 IN VOID *Context\r
221 );\r
222 \r
223/**\r
224 Send HCI SCO data packet.\r
225\r
226 @param This Pointer to the EFI_BLUETOOTH_HC_PROTOCOL instance.\r
227 @param BufferSize On input, indicates the size, in bytes, of the data buffer specified by Buffer. \r
228 On output, indicates the amount of data actually transferred.\r
229 @param Buffer A pointer to the buffer of data that will be transmitted to Bluetooth host \r
230 controller.\r
231 @param Timeout Indicating the transfer should be completed within this time frame. The units are \r
232 in milliseconds. If Timeout is 0, then the caller must wait for the function to \r
233 be completed until EFI_SUCCESS or EFI_DEVICE_ERROR is returned.\r
234\r
235 @retval EFI_SUCCESS The HCI SCO data packet is sent successfully.\r
236 @retval EFI_UNSUPPORTED The implementation does not support HCI SCO transfer.\r
237 @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:\r
238 - BufferSize is NULL.\r
239 - *BufferSize is 0.\r
240 - Buffer is NULL.\r
241 @retval EFI_TIMEOUT Sending HCI SCO data packet fail due to timeout.\r
242 @retval EFI_DEVICE_ERROR Sending HCI SCO data packet fail due to host controller or device error.\r
243\r
244**/\r
245typedef\r
246EFI_STATUS\r
247(EFIAPI *EFI_BLUETOOTH_HC_SEND_SCO_DATA)(\r
248 IN EFI_BLUETOOTH_HC_PROTOCOL *This,\r
249 IN OUT UINTN *BufferSize,\r
250 IN VOID *Buffer,\r
251 IN UINTN Timeout\r
252 );\r
253 \r
254/**\r
255 Receive HCI SCO data packet.\r
256\r
257 @param This Pointer to the EFI_BLUETOOTH_HC_PROTOCOL instance.\r
258 @param BufferSize On input, indicates the size, in bytes, of the data buffer specified by Buffer. \r
259 On output, indicates the amount of data actually transferred.\r
260 @param Buffer A pointer to the buffer of data that will be received from Bluetooth host controller.\r
261 @param Timeout Indicating the transfer should be completed within this time frame. The units are \r
262 in milliseconds. If Timeout is 0, then the caller must wait for the function to \r
263 be completed until EFI_SUCCESS or EFI_DEVICE_ERROR is returned.\r
264\r
265 @retval EFI_SUCCESS The HCI SCO data packet is received successfully.\r
266 @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:\r
267 - BufferSize is NULL.\r
268 - *BufferSize is 0.\r
269 - Buffer is NULL.\r
270 @retval EFI_TIMEOUT Receiving HCI SCO data packet fail due to timeout\r
271 @retval EFI_DEVICE_ERROR Receiving HCI SCO data packet fail due to host controller or device error.\r
272\r
273**/\r
274typedef\r
275EFI_STATUS\r
276(EFIAPI *EFI_BLUETOOTH_HC_RECEIVE_SCO_DATA)(\r
277 IN EFI_BLUETOOTH_HC_PROTOCOL *This,\r
278 IN OUT UINTN *BufferSize,\r
279 OUT VOID *Buffer,\r
280 IN UINTN Timeout\r
281 );\r
282\r
283/**\r
284 Receive HCI SCO data packet in non-blocking way.\r
285\r
286 @param This Pointer to the EFI_BLUETOOTH_HC_PROTOCOL instance.\r
287 @param IsNewTransfer If TRUE, a new transfer will be submitted. If FALSE, the request is deleted.\r
288 @param PollingInterval Indicates the periodic rate, in milliseconds, that the transfer is to be executed.\r
289 @param DataLength Specifies the length, in bytes, of the data to be received.\r
290 @param Callback The callback function. This function is called if the asynchronous transfer is \r
291 completed.\r
292 @param Context Data passed into Callback function. This is optional parameter and may be NULL.\r
293\r
294 @retval EFI_SUCCESS The HCI asynchronous receive request is submitted successfully.\r
295 @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:\r
296 - DataLength is 0.\r
297 - If IsNewTransfer is TRUE, and an asynchronous receive request already exists.\r
298\r
299**/\r
300typedef\r
301EFI_STATUS\r
302(EFIAPI *EFI_BLUETOOTH_HC_ASYNC_RECEIVE_SCO_DATA) (\r
303 IN EFI_BLUETOOTH_HC_PROTOCOL *This,\r
304 IN BOOLEAN IsNewTransfer,\r
305 IN UINTN PollingInterval,\r
306 IN UINTN DataLength,\r
307 IN EFI_BLUETOOTH_HC_ASYNC_FUNC_CALLBACK Callback,\r
308 IN VOID *Context\r
309 );\r
310 \r
311///\r
312/// This protocol abstracts the Bluetooth host controller layer message transmit and receive.\r
313///\r
314struct _EFI_BLUETOOTH_HC_PROTOCOL {\r
315 EFI_BLUETOOTH_HC_SEND_COMMAND SendCommand;\r
316 EFI_BLUETOOTH_HC_RECEIVE_EVENT ReceiveEvent;\r
317 EFI_BLUETOOTH_HC_ASYNC_RECEIVE_EVENT AsyncReceiveEvent;\r
318 EFI_BLUETOOTH_HC_SEND_ACL_DATA SendACLData;\r
319 EFI_BLUETOOTH_HC_RECEIVE_ACL_DATA ReceiveACLData;\r
320 EFI_BLUETOOTH_HC_ASYNC_RECEIVE_ACL_DATA AsyncReceiveACLData;\r
321 EFI_BLUETOOTH_HC_SEND_SCO_DATA SendSCOData;\r
322 EFI_BLUETOOTH_HC_RECEIVE_SCO_DATA ReceiveSCOData;\r
323 EFI_BLUETOOTH_HC_ASYNC_RECEIVE_SCO_DATA AsyncReceiveSCOData;\r
324};\r
325 \r
326extern EFI_GUID gEfiBluetoothHcProtocolGuid;\r
327\r
328#endif\r