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 SPDX-License-Identifier: BSD-2-Clause-Patent
8 @par Revision Reference:
9 This Protocol is introduced in UEFI Specification 2.5
13 #ifndef __EFI_BLUETOOTH_HC_PROTOCOL_H__
14 #define __EFI_BLUETOOTH_HC_PROTOCOL_H__
16 #define EFI_BLUETOOTH_HC_PROTOCOL_GUID \
18 0xb3930571, 0xbeba, 0x4fc5, { 0x92, 0x3, 0x94, 0x27, 0x24, 0x2e, 0x6a, 0x43 } \
21 typedef struct _EFI_BLUETOOTH_HC_PROTOCOL EFI_BLUETOOTH_HC_PROTOCOL
;
24 Send HCI command packet.
26 The SendCommand() function sends HCI command packet. Buffer holds the whole HCI
27 command packet, including OpCode, OCF, OGF, parameter length, and parameters. When
28 this function is returned, it just means the HCI command packet is sent, it does not mean
29 the command is success or complete. Caller might need to wait a command status event
30 to know the command status, or wait a command complete event to know if the
33 @param[in] This Pointer to the EFI_BLUETOOTH_HC_PROTOCOL instance.
34 @param[in,out] BufferSize On input, indicates the size, in bytes, of the data buffer
35 specified by Buffer. On output, indicates the amount of
36 data actually transferred.
37 @param[in] Buffer A pointer to the buffer of data that will be transmitted to
38 Bluetooth host controller.
39 @param[in] Timeout Indicating the transfer should be completed within this
40 time frame. The units are in milliseconds. If Timeout is 0,
41 then the caller must wait for the function to be completed
42 until EFI_SUCCESS or EFI_DEVICE_ERROR is returned.
44 @retval EFI_SUCCESS The HCI command packet is sent successfully.
45 @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:
49 @retval EFI_TIMEOUT Sending HCI command packet fail due to timeout.
50 @retval EFI_DEVICE_ERROR Sending HCI command packet fail due to host controller or device
56 (EFIAPI
*EFI_BLUETOOTH_HC_SEND_COMMAND
)(
57 IN EFI_BLUETOOTH_HC_PROTOCOL
*This
,
58 IN OUT UINTN
*BufferSize
,
64 Receive HCI event packet.
66 The ReceiveEvent() function receives HCI event packet. Buffer holds the whole HCI event
67 packet, including EventCode, parameter length, and parameters.
69 @param[in] This Pointer to the EFI_BLUETOOTH_HC_PROTOCOL instance.
70 @param[in,out] BufferSize On input, indicates the size, in bytes, of the data buffer
71 specified by Buffer. On output, indicates the amount of
72 data actually transferred.
73 @param[out] Buffer A pointer to the buffer of data that will be received from
74 Bluetooth host controller.
75 @param[in] Timeout Indicating the transfer should be completed within this
76 time frame. The units are in milliseconds. If Timeout is 0,
77 then the caller must wait for the function to be completed
78 until EFI_SUCCESS or EFI_DEVICE_ERROR is returned.
80 @retval EFI_SUCCESS The HCI event packet is received successfully.
81 @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:
85 @retval EFI_TIMEOUT Receiving HCI event packet fail due to timeout.
86 @retval EFI_DEVICE_ERROR Receiving HCI event packet fail due to host controller or device
92 (EFIAPI
*EFI_BLUETOOTH_HC_RECEIVE_EVENT
)(
93 IN EFI_BLUETOOTH_HC_PROTOCOL
*This
,
94 IN OUT UINTN
*BufferSize
,
100 The async callback of AsyncReceiveEvent().
102 @param[in] Data Data received via asynchronous transfer.
103 @param[in] DataLength The length of Data in bytes, received via asynchronous
105 @param[in] Context Context passed from asynchronous transfer request.
107 @retval EFI_SUCCESS The callback does execute successfully.
108 @retval Others The callback doesn't execute successfully.
113 (EFIAPI
*EFI_BLUETOOTH_HC_ASYNC_FUNC_CALLBACK
) (
120 Receive HCI event packet in non-blocking way.
122 The AsyncReceiveEvent() function receives HCI event packet in non-blocking way. Data
123 in Callback function holds the whole HCI event packet, including EventCode, parameter
124 length, and parameters.
126 @param[in] This Pointer to the EFI_BLUETOOTH_HC_PROTOCOL instance.
127 @param[in] IsNewTransfer If TRUE, a new transfer will be submitted. If FALSE, the
129 @param[in] PollingInterval Indicates the periodic rate, in milliseconds, that the
130 transfer is to be executed.
131 @param[in] DataLength Specifies the length, in bytes, of the data to be received.
132 @param[in] Callback The callback function. This function is called if the
133 asynchronous transfer is completed.
134 @param[in] Context Data passed into Callback function. This is optional
135 parameter and may be NULL.
137 @retval EFI_SUCCESS The HCI asynchronous receive request is submitted successfully.
138 @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:
140 If IsNewTransfer is TRUE, and an asynchronous receive
141 request already exists.
145 (EFIAPI
*EFI_BLUETOOTH_HC_ASYNC_RECEIVE_EVENT
) (
146 IN EFI_BLUETOOTH_HC_PROTOCOL
*This
,
147 IN BOOLEAN IsNewTransfer
,
148 IN UINTN PollingInterval
,
150 IN EFI_BLUETOOTH_HC_ASYNC_FUNC_CALLBACK Callback
,
155 Send HCI ACL data packet.
157 The SendACLData() function sends HCI ACL data packet. Buffer holds the whole HCI ACL
158 data packet, including Handle, PB flag, BC flag, data length, and data.
160 The SendACLData() function and ReceiveACLData() function just send and receive data
161 payload from application layer. In order to protect the payload data, the Bluetooth bus is
162 required to call HCI_Set_Connection_Encryption command to enable hardware based
163 encryption after authentication completed, according to pairing mode and host
166 @param[in] This Pointer to the EFI_BLUETOOTH_HC_PROTOCOL instance.
167 @param[in, out] BufferSize On input, indicates the size, in bytes, of the data buffer
168 specified by Buffer. On output, indicates the amount of
169 data actually transferred.
170 @param[in] Buffer A pointer to the buffer of data that will be transmitted to
171 Bluetooth host controller.
172 @param[in] Timeout Indicating the transfer should be completed within this
173 time frame. The units are in milliseconds. If Timeout is 0,
174 then the caller must wait for the function to be completed
175 until EFI_SUCCESS or EFI_DEVICE_ERROR is returned.
177 @retval EFI_SUCCESS The HCI ACL data packet is sent successfully.
178 @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:
182 @retval EFI_TIMEOUT Sending HCI ACL data packet fail due to timeout.
183 @retval EFI_DEVICE_ERROR Sending HCI ACL data packet fail due to host controller or device
189 (EFIAPI
*EFI_BLUETOOTH_HC_SEND_ACL_DATA
)(
190 IN EFI_BLUETOOTH_HC_PROTOCOL
*This
,
191 IN OUT UINTN
*BufferSize
,
197 Receive HCI ACL data packet.
199 The ReceiveACLData() function receives HCI ACL data packet. Buffer holds the whole HCI
200 ACL data packet, including Handle, PB flag, BC flag, data length, and data.
202 @param[in] This Pointer to the EFI_BLUETOOTH_HC_PROTOCOL instance.
203 @param[in, out] BufferSize On input, indicates the size, in bytes, of the data buffer
204 specified by Buffer. On output, indicates the amount of
205 data actually transferred.
206 @param[out] Buffer A pointer to the buffer of data that will be received from
207 Bluetooth host controller.
208 @param[in] Timeout Indicating the transfer should be completed within this
209 time frame. The units are in milliseconds. If Timeout is 0,
210 then the caller must wait for the function to be completed
211 until EFI_SUCCESS or EFI_DEVICE_ERROR is returned.
213 @retval EFI_SUCCESS The HCI ACL data packet is received successfully.
214 @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:
218 @retval EFI_TIMEOUT Receiving HCI ACL data packet fail due to timeout.
219 @retval EFI_DEVICE_ERROR Receiving HCI ACL data packet fail due to host controller or device
225 (EFIAPI
*EFI_BLUETOOTH_HC_RECEIVE_ACL_DATA
)(
226 IN EFI_BLUETOOTH_HC_PROTOCOL
*This
,
227 IN OUT UINTN
*BufferSize
,
233 Receive HCI ACL data packet in non-blocking way.
235 The AsyncReceiveACLData() function receives HCI ACL data packet in non-blocking way.
236 Data in Callback holds the whole HCI ACL data packet, including Handle, PB flag, BC flag,
237 data length, and data.
239 @param[in] This Pointer to the EFI_BLUETOOTH_HC_PROTOCOL instance.
240 @param[in] IsNewTransfer If TRUE, a new transfer will be submitted. If FALSE, the
242 @param[in] PollingInterval Indicates the periodic rate, in milliseconds, that the
243 transfer is to be executed.
244 @param[in] DataLength Specifies the length, in bytes, of the data to be received.
245 @param[in] Callback The callback function. This function is called if the
246 asynchronous transfer is completed.
247 @param[in] Context Data passed into Callback function. This is optional
248 parameter and may be NULL.
250 @retval EFI_SUCCESS The HCI asynchronous receive request is submitted successfully.
251 @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:
253 If IsNewTransfer is TRUE, and an asynchronous receive
254 request already exists.
258 (EFIAPI
*EFI_BLUETOOTH_HC_ASYNC_RECEIVE_ACL_DATA
) (
259 IN EFI_BLUETOOTH_HC_PROTOCOL
*This
,
260 IN BOOLEAN IsNewTransfer
,
261 IN UINTN PollingInterval
,
263 IN EFI_BLUETOOTH_HC_ASYNC_FUNC_CALLBACK Callback
,
268 Send HCI SCO data packet.
270 The SendSCOData() function sends HCI SCO data packet. Buffer holds the whole HCI SCO
271 data packet, including ConnectionHandle, PacketStatus flag, data length, and data.
273 @param[in] This Pointer to the EFI_BLUETOOTH_HC_PROTOCOL instance.
274 @param[in,out] BufferSize On input, indicates the size, in bytes, of the data buffer
275 specified by Buffer. On output, indicates the amount of
276 data actually transferred.
277 @param[in] Buffer A pointer to the buffer of data that will be transmitted to
278 Bluetooth host controller.
279 @param[in] Timeout Indicating the transfer should be completed within this
280 time frame. The units are in milliseconds. If Timeout is 0,
281 then the caller must wait for the function to be completed
282 until EFI_SUCCESS or EFI_DEVICE_ERROR is returned.
284 @retval EFI_SUCCESS The HCI SCO data packet is sent successfully.
285 @retval EFI_UNSUPPORTED The implementation does not support HCI SCO transfer.
286 @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:
290 @retval EFI_TIMEOUT Sending HCI SCO data packet fail due to timeout.
291 @retval EFI_DEVICE_ERROR Sending HCI SCO data packet fail due to host controller or device
296 (EFIAPI
*EFI_BLUETOOTH_HC_SEND_SCO_DATA
)(
297 IN EFI_BLUETOOTH_HC_PROTOCOL
*This
,
298 IN OUT UINTN
*BufferSize
,
304 Receive HCI SCO data packet.
306 The ReceiveSCOData() function receives HCI SCO data packet. Buffer holds the whole HCI
307 SCO data packet, including ConnectionHandle, PacketStatus flag, data length, and data.
309 @param[in] This Pointer to the EFI_BLUETOOTH_HC_PROTOCOL instance.
310 @param[in,out] BufferSize On input, indicates the size, in bytes, of the data buffer
311 specified by Buffer. On output, indicates the amount of
312 data actually transferred.
313 @param[out] Buffer A pointer to the buffer of data that will be received from
314 Bluetooth host controller.
315 @param[in] Timeout Indicating the transfer should be completed within this
316 time frame. The units are in milliseconds. If Timeout is 0,
317 then the caller must wait for the function to be completed
318 until EFI_SUCCESS or EFI_DEVICE_ERROR is returned.
320 @retval EFI_SUCCESS The HCI SCO data packet is received successfully.
321 @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:
325 @retval EFI_TIMEOUT Receiving HCI SCO data packet fail due to timeout.
326 @retval EFI_DEVICE_ERROR Receiving HCI SCO data packet fail due to host controller or device
331 (EFIAPI
*EFI_BLUETOOTH_HC_RECEIVE_SCO_DATA
)(
332 IN EFI_BLUETOOTH_HC_PROTOCOL
*This
,
333 IN OUT UINTN
*BufferSize
,
339 Receive HCI SCO data packet in non-blocking way.
341 The AsyncReceiveSCOData() function receives HCI SCO data packet in non-blocking way.
342 Data in Callback holds the whole HCI SCO data packet, including ConnectionHandle,
343 PacketStatus flag, data length, and data.
345 @param[in] This Pointer to the EFI_BLUETOOTH_HC_PROTOCOL instance.
346 @param[in] IsNewTransfer If TRUE, a new transfer will be submitted. If FALSE, the
348 @param[in] PollingInterval Indicates the periodic rate, in milliseconds, that the
349 transfer is to be executed.
350 @param[in] DataLength Specifies the length, in bytes, of the data to be received.
351 @param[in] Callback The callback function. This function is called if the
352 asynchronous transfer is completed.
353 @param[in] Context Data passed into Callback function. This is optional
354 parameter and may be NULL.
356 @retval EFI_SUCCESS The HCI asynchronous receive request is submitted successfully.
357 @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:
359 If IsNewTransfer is TRUE, and an asynchronous receive
360 request already exists.
364 (EFIAPI
*EFI_BLUETOOTH_HC_ASYNC_RECEIVE_SCO_DATA
) (
365 IN EFI_BLUETOOTH_HC_PROTOCOL
*This
,
366 IN BOOLEAN IsNewTransfer
,
367 IN UINTN PollingInterval
,
369 IN EFI_BLUETOOTH_HC_ASYNC_FUNC_CALLBACK Callback
,
374 // The EFI_BLUETOOTH_HC_PROTOCOL is used to transmit or receive HCI layer data packets.
376 struct _EFI_BLUETOOTH_HC_PROTOCOL
{
378 // Send HCI command packet.
380 EFI_BLUETOOTH_HC_SEND_COMMAND SendCommand
;
382 // Receive HCI event packets.
384 EFI_BLUETOOTH_HC_RECEIVE_EVENT ReceiveEvent
;
386 // Non-blocking receive HCI event packets.
388 EFI_BLUETOOTH_HC_ASYNC_RECEIVE_EVENT AsyncReceiveEvent
;
390 // Send HCI ACL (asynchronous connection-oriented) data packets.
392 EFI_BLUETOOTH_HC_SEND_ACL_DATA SendACLData
;
394 // Receive HCI ACL data packets.
396 EFI_BLUETOOTH_HC_RECEIVE_ACL_DATA ReceiveACLData
;
398 // Non-blocking receive HCI ACL data packets.
400 EFI_BLUETOOTH_HC_ASYNC_RECEIVE_ACL_DATA AsyncReceiveACLData
;
402 // Send HCI synchronous (SCO and eSCO) data packets.
404 EFI_BLUETOOTH_HC_SEND_SCO_DATA SendSCOData
;
406 // Receive HCI synchronous data packets.
408 EFI_BLUETOOTH_HC_RECEIVE_SCO_DATA ReceiveSCOData
;
410 // Non-blocking receive HCI synchronous data packets.
412 EFI_BLUETOOTH_HC_ASYNC_RECEIVE_SCO_DATA AsyncReceiveSCOData
;
415 extern EFI_GUID gEfiBluetoothHcProtocolGuid
;