2 EFI Bluetooth Host Controller Protocol as defined in UEFI 2.5.
3 This protocol abstracts the Bluetooth host controller layer message transmit and receive.
5 Copyright (c) 2015 - 2018, Intel Corporation. All rights reserved.<BR>
6 This program and the accompanying materials are licensed and made available under
7 the terms and conditions of the BSD License that accompanies this distribution.
8 The full text of the license may be found at
9 http://opensource.org/licenses/bsd-license.php.
11 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
12 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
14 @par Revision Reference:
15 This Protocol is introduced in UEFI Specification 2.5
19 #ifndef __EFI_BLUETOOTH_HC_PROTOCOL_H__
20 #define __EFI_BLUETOOTH_HC_PROTOCOL_H__
22 #define EFI_BLUETOOTH_HC_PROTOCOL_GUID \
24 0xb3930571, 0xbeba, 0x4fc5, { 0x92, 0x3, 0x94, 0x27, 0x24, 0x2e, 0x6a, 0x43 } \
27 typedef struct _EFI_BLUETOOTH_HC_PROTOCOL EFI_BLUETOOTH_HC_PROTOCOL
;
30 Send HCI command packet.
32 The SendCommand() function sends HCI command packet. Buffer holds the whole HCI
33 command packet, including OpCode, OCF, OGF, parameter length, and parameters. When
34 this function is returned, it just means the HCI command packet is sent, it does not mean
35 the command is success or complete. Caller might need to wait a command status event
36 to know the command status, or wait a command complete event to know if the
39 @param[in] This Pointer to the EFI_BLUETOOTH_HC_PROTOCOL instance.
40 @param[in,out] BufferSize On input, indicates the size, in bytes, of the data buffer
41 specified by Buffer. On output, indicates the amount of
42 data actually transferred.
43 @param[in] Buffer A pointer to the buffer of data that will be transmitted to
44 Bluetooth host controller.
45 @param[in] Timeout Indicating the transfer should be completed within this
46 time frame. The units are in milliseconds. If Timeout is 0,
47 then the caller must wait for the function to be completed
48 until EFI_SUCCESS or EFI_DEVICE_ERROR is returned.
50 @retval EFI_SUCCESS The HCI command packet is sent successfully.
51 @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:
55 @retval EFI_TIMEOUT Sending HCI command packet fail due to timeout.
56 @retval EFI_DEVICE_ERROR Sending HCI command packet fail due to host controller or device
62 (EFIAPI
*EFI_BLUETOOTH_HC_SEND_COMMAND
)(
63 IN EFI_BLUETOOTH_HC_PROTOCOL
*This
,
64 IN OUT UINTN
*BufferSize
,
70 Receive HCI event packet.
72 The ReceiveEvent() function receives HCI event packet. Buffer holds the whole HCI event
73 packet, including EventCode, parameter length, and parameters.
75 @param[in] This Pointer to the EFI_BLUETOOTH_HC_PROTOCOL instance.
76 @param[in,out] BufferSize On input, indicates the size, in bytes, of the data buffer
77 specified by Buffer. On output, indicates the amount of
78 data actually transferred.
79 @param[out] Buffer A pointer to the buffer of data that will be received from
80 Bluetooth host controller.
81 @param[in] Timeout Indicating the transfer should be completed within this
82 time frame. The units are in milliseconds. If Timeout is 0,
83 then the caller must wait for the function to be completed
84 until EFI_SUCCESS or EFI_DEVICE_ERROR is returned.
86 @retval EFI_SUCCESS The HCI event packet is received successfully.
87 @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:
91 @retval EFI_TIMEOUT Receiving HCI event packet fail due to timeout.
92 @retval EFI_DEVICE_ERROR Receiving HCI event packet fail due to host controller or device
98 (EFIAPI
*EFI_BLUETOOTH_HC_RECEIVE_EVENT
)(
99 IN EFI_BLUETOOTH_HC_PROTOCOL
*This
,
100 IN OUT UINTN
*BufferSize
,
106 The async callback of AsyncReceiveEvent().
108 @param[in] Data Data received via asynchronous transfer.
109 @param[in] DataLength The length of Data in bytes, received via asynchronous
111 @param[in] Context Context passed from asynchronous transfer request.
113 @retval EFI_SUCCESS The callback does execute successfully.
114 @retval Others The callback doesn't execute successfully.
119 (EFIAPI
*EFI_BLUETOOTH_HC_ASYNC_FUNC_CALLBACK
) (
126 Receive HCI event packet in non-blocking way.
128 The AsyncReceiveEvent() function receives HCI event packet in non-blocking way. Data
129 in Callback function holds the whole HCI event packet, including EventCode, parameter
130 length, and parameters.
132 @param[in] This Pointer to the EFI_BLUETOOTH_HC_PROTOCOL instance.
133 @param[in] IsNewTransfer If TRUE, a new transfer will be submitted. If FALSE, the
135 @param[in] PollingInterval Indicates the periodic rate, in milliseconds, that the
136 transfer is to be executed.
137 @param[in] DataLength Specifies the length, in bytes, of the data to be received.
138 @param[in] Callback The callback function. This function is called if the
139 asynchronous transfer is completed.
140 @param[in] Context Data passed into Callback function. This is optional
141 parameter and may be NULL.
143 @retval EFI_SUCCESS The HCI asynchronous receive request is submitted successfully.
144 @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:
146 If IsNewTransfer is TRUE, and an asynchronous receive
147 request already exists.
151 (EFIAPI
*EFI_BLUETOOTH_HC_ASYNC_RECEIVE_EVENT
) (
152 IN EFI_BLUETOOTH_HC_PROTOCOL
*This
,
153 IN BOOLEAN IsNewTransfer
,
154 IN UINTN PollingInterval
,
156 IN EFI_BLUETOOTH_HC_ASYNC_FUNC_CALLBACK Callback
,
161 Send HCI ACL data packet.
163 The SendACLData() function sends HCI ACL data packet. Buffer holds the whole HCI ACL
164 data packet, including Handle, PB flag, BC flag, data length, and data.
166 The SendACLData() function and ReceiveACLData() function just send and receive data
167 payload from application layer. In order to protect the payload data, the Bluetooth bus is
168 required to call HCI_Set_Connection_Encryption command to enable hardware based
169 encryption after authentication completed, according to pairing mode and host
172 @param[in] This Pointer to the EFI_BLUETOOTH_HC_PROTOCOL instance.
173 @param[in, out] BufferSize On input, indicates the size, in bytes, of the data buffer
174 specified by Buffer. On output, indicates the amount of
175 data actually transferred.
176 @param[in] Buffer A pointer to the buffer of data that will be transmitted to
177 Bluetooth host controller.
178 @param[in] Timeout Indicating the transfer should be completed within this
179 time frame. The units are in milliseconds. If Timeout is 0,
180 then the caller must wait for the function to be completed
181 until EFI_SUCCESS or EFI_DEVICE_ERROR is returned.
183 @retval EFI_SUCCESS The HCI ACL data packet is sent successfully.
184 @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:
188 @retval EFI_TIMEOUT Sending HCI ACL data packet fail due to timeout.
189 @retval EFI_DEVICE_ERROR Sending HCI ACL data packet fail due to host controller or device
195 (EFIAPI
*EFI_BLUETOOTH_HC_SEND_ACL_DATA
)(
196 IN EFI_BLUETOOTH_HC_PROTOCOL
*This
,
197 IN OUT UINTN
*BufferSize
,
203 Receive HCI ACL data packet.
205 The ReceiveACLData() function receives HCI ACL data packet. Buffer holds the whole HCI
206 ACL data packet, including Handle, PB flag, BC flag, data length, and data.
208 @param[in] This Pointer to the EFI_BLUETOOTH_HC_PROTOCOL instance.
209 @param[in, out] BufferSize On input, indicates the size, in bytes, of the data buffer
210 specified by Buffer. On output, indicates the amount of
211 data actually transferred.
212 @param[out] Buffer A pointer to the buffer of data that will be received from
213 Bluetooth host controller.
214 @param[in] Timeout Indicating the transfer should be completed within this
215 time frame. The units are in milliseconds. If Timeout is 0,
216 then the caller must wait for the function to be completed
217 until EFI_SUCCESS or EFI_DEVICE_ERROR is returned.
219 @retval EFI_SUCCESS The HCI ACL data packet is received successfully.
220 @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:
224 @retval EFI_TIMEOUT Receiving HCI ACL data packet fail due to timeout.
225 @retval EFI_DEVICE_ERROR Receiving HCI ACL data packet fail due to host controller or device
231 (EFIAPI
*EFI_BLUETOOTH_HC_RECEIVE_ACL_DATA
)(
232 IN EFI_BLUETOOTH_HC_PROTOCOL
*This
,
233 IN OUT UINTN
*BufferSize
,
239 Receive HCI ACL data packet in non-blocking way.
241 The AsyncReceiveACLData() function receives HCI ACL data packet in non-blocking way.
242 Data in Callback holds the whole HCI ACL data packet, including Handle, PB flag, BC flag,
243 data length, and data.
245 @param[in] This Pointer to the EFI_BLUETOOTH_HC_PROTOCOL instance.
246 @param[in] IsNewTransfer If TRUE, a new transfer will be submitted. If FALSE, the
248 @param[in] PollingInterval Indicates the periodic rate, in milliseconds, that the
249 transfer is to be executed.
250 @param[in] DataLength Specifies the length, in bytes, of the data to be received.
251 @param[in] Callback The callback function. This function is called if the
252 asynchronous transfer is completed.
253 @param[in] Context Data passed into Callback function. This is optional
254 parameter and may be NULL.
256 @retval EFI_SUCCESS The HCI asynchronous receive request is submitted successfully.
257 @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:
259 If IsNewTransfer is TRUE, and an asynchronous receive
260 request already exists.
264 (EFIAPI
*EFI_BLUETOOTH_HC_ASYNC_RECEIVE_ACL_DATA
) (
265 IN EFI_BLUETOOTH_HC_PROTOCOL
*This
,
266 IN BOOLEAN IsNewTransfer
,
267 IN UINTN PollingInterval
,
269 IN EFI_BLUETOOTH_HC_ASYNC_FUNC_CALLBACK Callback
,
274 Send HCI SCO data packet.
276 The SendSCOData() function sends HCI SCO data packet. Buffer holds the whole HCI SCO
277 data packet, including ConnectionHandle, PacketStatus flag, data length, and data.
279 @param[in] This Pointer to the EFI_BLUETOOTH_HC_PROTOCOL instance.
280 @param[in,out] BufferSize On input, indicates the size, in bytes, of the data buffer
281 specified by Buffer. On output, indicates the amount of
282 data actually transferred.
283 @param[in] Buffer A pointer to the buffer of data that will be transmitted to
284 Bluetooth host controller.
285 @param[in] Timeout Indicating the transfer should be completed within this
286 time frame. The units are in milliseconds. If Timeout is 0,
287 then the caller must wait for the function to be completed
288 until EFI_SUCCESS or EFI_DEVICE_ERROR is returned.
290 @retval EFI_SUCCESS The HCI SCO data packet is sent successfully.
291 @retval EFI_UNSUPPORTED The implementation does not support HCI SCO transfer.
292 @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:
296 @retval EFI_TIMEOUT Sending HCI SCO data packet fail due to timeout.
297 @retval EFI_DEVICE_ERROR Sending HCI SCO data packet fail due to host controller or device
302 (EFIAPI
*EFI_BLUETOOTH_HC_SEND_SCO_DATA
)(
303 IN EFI_BLUETOOTH_HC_PROTOCOL
*This
,
304 IN OUT UINTN
*BufferSize
,
310 Receive HCI SCO data packet.
312 The ReceiveSCOData() function receives HCI SCO data packet. Buffer holds the whole HCI
313 SCO data packet, including ConnectionHandle, PacketStatus flag, data length, and data.
315 @param[in] This Pointer to the EFI_BLUETOOTH_HC_PROTOCOL instance.
316 @param[in,out] BufferSize On input, indicates the size, in bytes, of the data buffer
317 specified by Buffer. On output, indicates the amount of
318 data actually transferred.
319 @param[out] Buffer A pointer to the buffer of data that will be received from
320 Bluetooth host controller.
321 @param[in] Timeout Indicating the transfer should be completed within this
322 time frame. The units are in milliseconds. If Timeout is 0,
323 then the caller must wait for the function to be completed
324 until EFI_SUCCESS or EFI_DEVICE_ERROR is returned.
326 @retval EFI_SUCCESS The HCI SCO data packet is received successfully.
327 @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:
331 @retval EFI_TIMEOUT Receiving HCI SCO data packet fail due to timeout.
332 @retval EFI_DEVICE_ERROR Receiving HCI SCO data packet fail due to host controller or device
337 (EFIAPI
*EFI_BLUETOOTH_HC_RECEIVE_SCO_DATA
)(
338 IN EFI_BLUETOOTH_HC_PROTOCOL
*This
,
339 IN OUT UINTN
*BufferSize
,
345 Receive HCI SCO data packet in non-blocking way.
347 The AsyncReceiveSCOData() function receives HCI SCO data packet in non-blocking way.
348 Data in Callback holds the whole HCI SCO data packet, including ConnectionHandle,
349 PacketStatus flag, data length, and data.
351 @param[in] This Pointer to the EFI_BLUETOOTH_HC_PROTOCOL instance.
352 @param[in] IsNewTransfer If TRUE, a new transfer will be submitted. If FALSE, the
354 @param[in] PollingInterval Indicates the periodic rate, in milliseconds, that the
355 transfer is to be executed.
356 @param[in] DataLength Specifies the length, in bytes, of the data to be received.
357 @param[in] Callback The callback function. This function is called if the
358 asynchronous transfer is completed.
359 @param[in] Context Data passed into Callback function. This is optional
360 parameter and may be NULL.
362 @retval EFI_SUCCESS The HCI asynchronous receive request is submitted successfully.
363 @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:
365 If IsNewTransfer is TRUE, and an asynchronous receive
366 request already exists.
370 (EFIAPI
*EFI_BLUETOOTH_HC_ASYNC_RECEIVE_SCO_DATA
) (
371 IN EFI_BLUETOOTH_HC_PROTOCOL
*This
,
372 IN BOOLEAN IsNewTransfer
,
373 IN UINTN PollingInterval
,
375 IN EFI_BLUETOOTH_HC_ASYNC_FUNC_CALLBACK Callback
,
380 // The EFI_BLUETOOTH_HC_PROTOCOL is used to transmit or receive HCI layer data packets.
382 struct _EFI_BLUETOOTH_HC_PROTOCOL
{
384 // Send HCI command packet.
386 EFI_BLUETOOTH_HC_SEND_COMMAND SendCommand
;
388 // Receive HCI event packets.
390 EFI_BLUETOOTH_HC_RECEIVE_EVENT ReceiveEvent
;
392 // Non-blocking receive HCI event packets.
394 EFI_BLUETOOTH_HC_ASYNC_RECEIVE_EVENT AsyncReceiveEvent
;
396 // Send HCI ACL (asynchronous connection-oriented) data packets.
398 EFI_BLUETOOTH_HC_SEND_ACL_DATA SendACLData
;
400 // Receive HCI ACL data packets.
402 EFI_BLUETOOTH_HC_RECEIVE_ACL_DATA ReceiveACLData
;
404 // Non-blocking receive HCI ACL data packets.
406 EFI_BLUETOOTH_HC_ASYNC_RECEIVE_ACL_DATA AsyncReceiveACLData
;
408 // Send HCI synchronous (SCO and eSCO) data packets.
410 EFI_BLUETOOTH_HC_SEND_SCO_DATA SendSCOData
;
412 // Receive HCI synchronous data packets.
414 EFI_BLUETOOTH_HC_RECEIVE_SCO_DATA ReceiveSCOData
;
416 // Non-blocking receive HCI synchronous data packets.
418 EFI_BLUETOOTH_HC_ASYNC_RECEIVE_SCO_DATA AsyncReceiveSCOData
;
421 extern EFI_GUID gEfiBluetoothHcProtocolGuid
;