diff options
-rw-r--r-- | MdePkg/Include/IndustryStandard/Bluetooth.h | 47 | ||||
-rw-r--r-- | MdePkg/Include/Protocol/BluetoothConfig.h | 514 | ||||
-rw-r--r-- | MdePkg/Include/Protocol/BluetoothHc.h | 328 | ||||
-rw-r--r-- | MdePkg/Include/Protocol/BluetoothIo.h | 416 | ||||
-rw-r--r-- | MdePkg/Include/Protocol/DevicePath.h | 16 | ||||
-rw-r--r-- | MdePkg/MdePkg.dec | 10 |
6 files changed, 1330 insertions, 1 deletions
diff --git a/MdePkg/Include/IndustryStandard/Bluetooth.h b/MdePkg/Include/IndustryStandard/Bluetooth.h new file mode 100644 index 0000000..7dc9d55 --- /dev/null +++ b/MdePkg/Include/IndustryStandard/Bluetooth.h @@ -0,0 +1,47 @@ +/** @file
+ This file contains the Bluetooth definitions that are consumed by drivers.
+ These definitions are from Bluetooth Core Specification Version 4.0 June, 2010
+
+ Copyright (c) 2015, Intel Corporation. All rights reserved.<BR>
+ This program and the accompanying materials
+ are licensed and made available under the terms and conditions of the BSD License
+ which accompanies this distribution. The full text of the license may be found at
+ http://opensource.org/licenses/bsd-license.php
+
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+**/
+
+#ifndef _BLUETOOTH_H_
+#define _BLUETOOTH_H_
+
+#pragma pack(1)
+
+///
+/// BLUETOOTH_ADDRESS
+///
+typedef struct {
+ ///
+ /// 48bit Bluetooth device address.
+ ///
+ UINT8 Address[6];
+} BLUETOOTH_ADDRESS;
+
+///
+/// BLUETOOTH_CLASS_OF_DEVICE. See Bluetooth specification for detail.
+///
+typedef struct {
+ UINT8 FormatType:2;
+ UINT8 MinorDeviceClass: 6;
+ UINT16 MajorDeviceClass: 5;
+ UINT16 MajorServiceClass:11;
+} BLUETOOTH_CLASS_OF_DEVICE;
+
+#pragma pack()
+
+#define BLUETOOTH_HCI_COMMAND_LOCAL_READABLE_NAME_MAX_SIZE 248
+
+#define BLUETOOTH_HCI_LINK_KEY_SIZE 16
+
+#endif
diff --git a/MdePkg/Include/Protocol/BluetoothConfig.h b/MdePkg/Include/Protocol/BluetoothConfig.h new file mode 100644 index 0000000..b1b3f55 --- /dev/null +++ b/MdePkg/Include/Protocol/BluetoothConfig.h @@ -0,0 +1,514 @@ +/** @file
+ EFI Bluetooth Configuration Protocol as defined in UEFI 2.5.
+ This protocol abstracts user interface configuration for Bluetooth device.
+
+ Copyright (c) 2015, Intel Corporation. All rights reserved.<BR>
+ This program and the accompanying materials are licensed and made available under
+ the terms and conditions of the BSD License that accompanies this distribution.
+ The full text of the license may be found at
+ http://opensource.org/licenses/bsd-license.php.
+
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+ @par Revision Reference:
+ This Protocol is introduced in UEFI Specification 2.5
+
+**/
+
+#ifndef __EFI_BLUETOOTH_CONFIG_PROTOCOL_H__
+#define __EFI_BLUETOOTH_CONFIG_PROTOCOL_H__
+
+#include <IndustryStandard/Bluetooth.h>
+
+#define EFI_BLUETOOTH_CONFIG_PROTOCOL_GUID \
+ { \
+ 0x62960cf3, 0x40ff, 0x4263, { 0xa7, 0x7c, 0xdf, 0xde, 0xbd, 0x19, 0x1b, 0x4b } \
+ }
+
+typedef struct _EFI_BLUETOOTH_CONFIG_PROTOCOL EFI_BLUETOOTH_CONFIG_PROTOCOL;
+
+typedef UINT32 EFI_BLUETOOTH_CONFIG_REMOTE_DEVICE_STATE_TYPE;
+#define EFI_BLUETOOTH_CONFIG_REMOTE_DEVICE_STATE_CONNECTED 0x1
+#define EFI_BLUETOOTH_CONFIG_REMOTE_DEVICE_STATE_PAIRED 0x2
+
+///
+/// EFI_BLUETOOTH_SCAN_CALLBACK_INFORMATION
+///
+typedef struct {
+ ///
+ /// 48bit Bluetooth device address.
+ ///
+ BLUETOOTH_ADDRESS BDAddr;
+ ///
+ /// State of the remote deive
+ ///
+ UINT8 RemoteDeviceState;
+ ///
+ /// Bluetooth ClassOfDevice. See Bluetooth specification for detail.
+ ///
+ BLUETOOTH_CLASS_OF_DEVICE ClassOfDevice;
+ ///
+ /// Remote device name
+ ///
+ UINT8 RemoteDeviceName[BLUETOOTH_HCI_COMMAND_LOCAL_READABLE_NAME_MAX_SIZE];
+} EFI_BLUETOOTH_SCAN_CALLBACK_INFORMATION;
+
+///
+/// EFI_BLUETOOTH_CONFIG_DATA_TYPE
+///
+typedef enum {
+ ///
+ /// Local/Remote Bluetooth device name. Data structure is zero terminated CHAR8[].
+ ///
+ EfiBluetoothConfigDataTypeDeviceName,
+ ///
+ /// Local/Remote Bluetooth device ClassOfDevice. Data structure is BLUETOOTH_CLASS_OF_DEVICE.
+ ///
+ EfiBluetoothConfigDataTypeClassOfDevice,
+ ///
+ /// Remote Bluetooth device state. Data structure is EFI_BLUETOOTH_CONFIG_REMOTE_DEVICE_STATE_TYPE.
+ ///
+ EfiBluetoothConfigDataTypeRemoteDeviceState,
+ ///
+ /// Local/Remote Bluetooth device SDP information. Data structure is UINT8[].
+ ///
+ EfiBluetoothConfigDataTypeSdpInfo,
+ ///
+ /// Local Bluetooth device address. Data structure is BLUETOOTH_ADDRESS.
+ ///
+ EfiBluetoothConfigDataTypeBDADDR,
+ ///
+ /// Local Bluetooth discoverable state. Data structure is UINT8. (Page scan and/or Inquiry scan)
+ ///
+ EfiBluetoothConfigDataTypeDiscoverable,
+ ///
+ /// Local Bluetooth controller stored paired device list. Data structure is BLUETOOTH_ADDRESS[].
+ ///
+ EfiBluetoothConfigDataTypeControllerStoredPairedDeviceList,
+ ///
+ /// Local available device list. Data structure is BLUETOOTH_ADDRESS[].
+ ///
+ EfiBluetoothConfigDataTypeAvailableDeviceList,
+ EfiBluetoothConfigDataTypeMax,
+} EFI_BLUETOOTH_CONFIG_DATA_TYPE;
+
+///
+/// EFI_BLUETOOTH_PIN_CALLBACK_TYPE.
+///
+typedef enum {
+ ///
+ /// For SSP - passkey entry. Input buffer is Passkey (4 bytes). No output buffer.
+ /// See Bluetooth HCI command for detail.
+ ///
+ EfiBluetoothCallbackTypeUserPasskeyNotification,
+ ///
+ /// For SSP - just work and numeric comparison. Input buffer is numeric value (4 bytes).
+ /// Output buffer is BOOLEAN (1 byte). See Bluetooth HCI command for detail.
+ ///
+ EfiBluetoothCallbackTypeUserConfirmationRequest,
+ ///
+ /// For SSP - OOB. See Bluetooth HCI command for detail.
+ ///
+ EfiBluetoothCallbackTypeOOBDataRequest,
+ ///
+ /// For legacy paring. No input buffer. Output buffer is PIN code( <= 16 bytes).
+ /// See Bluetooth HCI command for detail.
+ ///
+ EfiBluetoothCallbackTypePinCodeRequest,
+ EfiBluetoothCallbackTypeMax
+} EFI_BLUETOOTH_PIN_CALLBACK_TYPE;
+
+///
+/// EFI_BLUETOOTH_CONNECT_COMPLETE_CALLBACK_TYPE.
+///
+typedef enum {
+ ///
+ /// This callback is called when Bluetooth receive Disconnection_Complete event. Input buffer is Event
+ /// Parameters of Disconnection_Complete Event defined in Bluetooth specification.
+ ///
+ EfiBluetoothConnCallbackTypeDisconnected,
+ ///
+ /// This callback is called when Bluetooth receive Connection_Complete event. Input buffer is Event
+ /// Parameters of Connection_Complete Event defined in Bluetooth specification.
+ ///
+ EfiBluetoothConnCallbackTypeConnected,
+ ///
+ /// This callback is called when Bluetooth receive Authentication_Complete event. Input buffer is Event
+ /// Parameters of Authentication_Complete Event defined in Bluetooth specification.
+ ///
+ EfiBluetoothConnCallbackTypeAuthenticated,
+ ///
+ /// This callback is called when Bluetooth receive Encryption_Change event. Input buffer is Event
+ /// Parameters of Encryption_Change Event defined in Bluetooth specification.
+ ///
+ EfiBluetoothConnCallbackTypeEncrypted
+} EFI_BLUETOOTH_CONNECT_COMPLETE_CALLBACK_TYPE;
+
+
+/**
+ Initialize Bluetooth host controller and local device.
+
+ @param This Pointer to the EFI_BLUETOOTH_CONFIG_PROTOCOL instance.
+
+ @retval EFI_SUCCESS The Bluetooth host controller and local device is initialized successfully.
+ @retval EFI_DEVICE_ERROR A hardware error occurred trying to initialize the Bluetooth host controller
+ and local device.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_BLUETOOTH_CONFIG_INIT)(
+ IN EFI_BLUETOOTH_CONFIG_PROTOCOL *This
+ );
+
+/**
+ Callback function, it is called if a Bluetooth device is found during scan process.
+
+ @param This Pointer to the EFI_BLUETOOTH_CONFIG_PROTOCOL instance.
+ @param Context Context passed from scan request.
+ @param CallbackInfo Data related to scan result. NULL CallbackInfo means scan complete.
+
+ @retval EFI_SUCCESS The callback function complete successfully.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_BLUETOOTH_CONFIG_SCAN_CALLBACK_FUNCTION) (
+ IN EFI_BLUETOOTH_CONFIG_PROTOCOL *This,
+ IN VOID *Context,
+ IN EFI_BLUETOOTH_SCAN_CALLBACK_INFORMATION *CallbackInfo
+ );
+
+/**
+ Scan Bluetooth device.
+
+ @param This Pointer to the EFI_BLUETOOTH_CONFIG_PROTOCOL instance.
+ @param ReScan If TRUE, a new scan request is submitted no matter there is scan result before.
+ If FALSE and there is scan result, the previous scan result is returned and no scan request
+ is submitted.
+ @param ScanType Bluetooth scan type, Inquiry and/or Page. See Bluetooth specification for detail.
+ @param Callback The callback function. This function is called if a Bluetooth device is found during scan
+ process.
+ @param Context Data passed into Callback function. This is optional parameter and may be NULL.
+
+ @retval EFI_SUCCESS The Bluetooth scan request is submitted.
+ @retval EFI_DEVICE_ERROR A hardware error occurred trying to scan the Bluetooth device.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_BLUETOOTH_CONFIG_SCAN)(
+ IN EFI_BLUETOOTH_CONFIG_PROTOCOL *This,
+ IN BOOLEAN ReScan,
+ IN UINT8 ScanType,
+ IN EFI_BLUETOOTH_CONFIG_SCAN_CALLBACK_FUNCTION Callback,
+ IN VOID *Context
+ );
+
+/**
+ Connect a Bluetooth device.
+
+ @param This Pointer to the EFI_BLUETOOTH_CONFIG_PROTOCOL instance.
+ @param BD_ADDR The address of Bluetooth device to be connected.
+
+ @retval EFI_SUCCESS The Bluetooth device is connected successfully.
+ @retval EFI_ALREADY_STARTED The Bluetooth device is already connected.
+ @retval EFI_NOT_FOUND The Bluetooth device is not found.
+ @retval EFI_DEVICE_ERROR A hardware error occurred trying to connect the Bluetooth device.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_BLUETOOTH_CONFIG_CONNECT)(
+ IN EFI_BLUETOOTH_CONFIG_PROTOCOL *This,
+ IN BLUETOOTH_ADDRESS *BD_ADDR
+ );
+
+/**
+ Disconnect a Bluetooth device.
+
+ @param This Pointer to the EFI_BLUETOOTH_CONFIG_PROTOCOL instance.
+ @param BD_ADDR The address of Bluetooth device to be connected.
+ @param Reason Bluetooth disconnect reason. See Bluetooth specification for detail.
+
+ @retval EFI_SUCCESS The Bluetooth device is disconnected successfully.
+ @retval EFI_NOT_STARTED The Bluetooth device is not connected.
+ @retval EFI_NOT_FOUND The Bluetooth device is not found.
+ @retval EFI_DEVICE_ERROR A hardware error occurred trying to disconnect the Bluetooth device.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_BLUETOOTH_CONFIG_DISCONNECT)(
+ IN EFI_BLUETOOTH_CONFIG_PROTOCOL *This,
+ IN BLUETOOTH_ADDRESS *BD_ADDR,
+ IN UINT8 Reason
+ );
+
+/**
+ Get Bluetooth configuration data.
+
+ @param This Pointer to the EFI_BLUETOOTH_CONFIG_PROTOCOL instance.
+ @param DataType Configuration data type.
+ @param DataSize On input, indicates the size, in bytes, of the data buffer specified by Data.
+ On output, indicates the amount of data actually returned.
+ @param Data A pointer to the buffer of data that will be returned.
+
+ @retval EFI_SUCCESS The Bluetooth configuration data is returned successfully.
+ @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:
+ - DataSize is NULL.
+ - *DataSize is 0.
+ - Data is NULL.
+ @retval EFI_UNSUPPORTED The DataType is unsupported.
+ @retval EFI_NOT_FOUND The DataType is not found.
+ @retval EFI_BUFFER_TOO_SMALL The buffer is too small to hold the buffer.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_BLUETOOTH_CONFIG_GET_DATA)(
+ IN EFI_BLUETOOTH_CONFIG_PROTOCOL *This,
+ IN EFI_BLUETOOTH_CONFIG_DATA_TYPE DataType,
+ IN OUT UINTN *DataSize,
+ IN OUT VOID *Data
+ );
+
+/**
+ Set Bluetooth configuration data.
+
+ @param This Pointer to the EFI_BLUETOOTH_CONFIG_PROTOCOL instance.
+ @param DataType Configuration data type.
+ @param DataSize Indicates the size, in bytes, of the data buffer specified by Data.
+ @param Data A pointer to the buffer of data that will be set.
+
+ @retval EFI_SUCCESS The Bluetooth configuration data is set successfully.
+ @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:
+ - DataSize is 0.
+ - Data is NULL.
+ @retval EFI_UNSUPPORTED The DataType is unsupported.
+ @retval EFI_BUFFER_TOO_SMALL Cannot set configuration data.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_BLUETOOTH_CONFIG_SET_DATA)(
+ IN EFI_BLUETOOTH_CONFIG_PROTOCOL *This,
+ IN EFI_BLUETOOTH_CONFIG_DATA_TYPE DataType,
+ IN UINTN DataSize,
+ IN VOID *Data
+ );
+
+/**
+ Get remove Bluetooth device configuration data.
+
+ @param This Pointer to the EFI_BLUETOOTH_CONFIG_PROTOCOL instance.
+ @param DataType Configuration data type.
+ @param BDAddr Remote Bluetooth device address.
+ @param DataSize On input, indicates the size, in bytes, of the data buffer specified by Data.
+ On output, indicates the amount of data actually returned.
+ @param Data A pointer to the buffer of data that will be returned.
+
+ @retval EFI_SUCCESS The remote Bluetooth device configuration data is returned successfully.
+ @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:
+ - DataSize is NULL.
+ - *DataSize is 0.
+ - Data is NULL.
+ @retval EFI_UNSUPPORTED The DataType is unsupported.
+ @retval EFI_NOT_FOUND The DataType is not found.
+ @retval EFI_BUFFER_TOO_SMALL The buffer is too small to hold the buffer.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_BLUETOOTH_CONFIG_GET_REMOTE_DATA)(
+ IN EFI_BLUETOOTH_CONFIG_PROTOCOL *This,
+ IN EFI_BLUETOOTH_CONFIG_DATA_TYPE DataType,
+ IN BLUETOOTH_ADDRESS BDAddr,
+ IN OUT UINTN *DataSize,
+ IN OUT VOID *Data
+ );
+
+/**
+ The callback function for PIN code.
+
+ @param This Pointer to the EFI_BLUETOOTH_CONFIG_PROTOCOL instance.
+ @param Context Context passed from registration.
+ @param CallbackType Callback type in EFI_BLUETOOTH_PIN_CALLBACK_TYPE.
+ @param InputBuffer A pointer to the buffer of data that is input from callback caller.
+ @param InputBufferSize Indicates the size, in bytes, of the data buffer specified by InputBuffer.
+ @param OutputBuffer A pointer to the buffer of data that will be output from callback callee.
+ Callee allocates this buffer by using EFI Boot Service AllocatePool().
+ @param OutputBufferSize Indicates the size, in bytes, of the data buffer specified by OutputBuffer.
+
+ @retval EFI_SUCCESS The callback function complete successfully.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_BLUETOOTH_CONFIG_REGISTER_PIN_CALLBACK_FUNCTION)(
+ IN EFI_BLUETOOTH_CONFIG_PROTOCOL *This,
+ IN VOID *Context,
+ IN EFI_BLUETOOTH_PIN_CALLBACK_TYPE CallbackType,
+ IN VOID *InputBuffer,
+ IN UINTN InputBufferSize,
+ OUT VOID **OutputBuffer,
+ OUT UINTN *OutputBufferSize
+ );
+
+/**
+ Register PIN callback function.
+
+ @param This Pointer to the EFI_BLUETOOTH_CONFIG_PROTOCOL instance.
+ @param Callback The callback function. NULL means unregister.
+ @param Context Data passed into Callback function. This is optional parameter and may be NULL.
+
+ @retval EFI_SUCCESS The PIN callback function is registered successfully.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_BLUETOOTH_CONFIG_REGISTER_PIN_CALLBACK)(
+ IN EFI_BLUETOOTH_CONFIG_PROTOCOL *This,
+ IN EFI_BLUETOOTH_CONFIG_REGISTER_PIN_CALLBACK_FUNCTION Callback,
+ IN VOID *Context
+ );
+
+/**
+ The callback function to get link key.
+
+ @param This Pointer to the EFI_BLUETOOTH_CONFIG_PROTOCOL instance.
+ @param Context Context passed from registration.
+ @param BDAddr A pointer to Bluetooth device address.
+ @param LinkKey A pointer to the buffer of link key.
+
+ @retval EFI_SUCCESS The callback function complete successfully.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_BLUETOOTH_CONFIG_REGISTER_GET_LINK_KEY_CALLBACK_FUNCTION)(
+ IN EFI_BLUETOOTH_CONFIG_PROTOCOL *This,
+ IN VOID *Context,
+ IN BLUETOOTH_ADDRESS *BDAddr,
+ OUT UINT8 LinkKey[BLUETOOTH_HCI_LINK_KEY_SIZE]
+ );
+
+/**
+ Register get link key callback function.
+
+ @param This Pointer to the EFI_BLUETOOTH_CONFIG_PROTOCOL instance.
+ @param Callback The callback function. NULL means unregister.
+ @param Context Data passed into Callback function. This is optional parameter and may be NULL.
+
+ @retval EFI_SUCCESS The link key callback function is registered successfully.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_BLUETOOTH_CONFIG_REGISTER_GET_LINK_KEY_CALLBACK)(
+ IN EFI_BLUETOOTH_CONFIG_PROTOCOL *This,
+ IN EFI_BLUETOOTH_CONFIG_REGISTER_GET_LINK_KEY_CALLBACK_FUNCTION Callback,
+ IN VOID *Context
+ );
+
+/**
+ The callback function to set link key.
+
+ @param This Pointer to the EFI_BLUETOOTH_CONFIG_PROTOCOL instance.
+ @param Context Context passed from registration.
+ @param BDAddr A pointer to Bluetooth device address.
+ @param LinkKey A pointer to the buffer of link key.
+
+ @retval EFI_SUCCESS The callback function complete successfully.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_BLUETOOTH_CONFIG_REGISTER_SET_LINK_KEY_CALLBACK_FUNCTION)(
+ IN EFI_BLUETOOTH_CONFIG_PROTOCOL *This,
+ IN VOID *Context,
+ IN BLUETOOTH_ADDRESS *BDAddr,
+ IN UINT8 LinkKey[BLUETOOTH_HCI_LINK_KEY_SIZE]
+ );
+
+/**
+ Register set link key callback function.
+
+ @param This Pointer to the EFI_BLUETOOTH_CONFIG_PROTOCOL instance.
+ @param Callback The callback function. NULL means unregister.
+ @param Context Data passed into Callback function. This is optional parameter and may be NULL.
+
+ @retval EFI_SUCCESS The link key callback function is registered successfully.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_BLUETOOTH_CONFIG_REGISTER_SET_LINK_KEY_CALLBACK)(
+ IN EFI_BLUETOOTH_CONFIG_PROTOCOL *This,
+ IN EFI_BLUETOOTH_CONFIG_REGISTER_SET_LINK_KEY_CALLBACK_FUNCTION Callback,
+ IN VOID *Context
+ );
+
+/**
+ The callback function. It is called after connect completed.
+
+ @param This Pointer to the EFI_BLUETOOTH_CONFIG_PROTOCOL instance.
+ @param Context Context passed from registration.
+ @param CallbackType Callback type in EFI_BLUETOOTH_CONNECT_COMPLETE_CALLBACK_TYPE.
+ @param BDAddr A pointer to Bluetooth device address.
+ @param InputBuffer A pointer to the buffer of data that is input from callback caller.
+ @param InputBufferSize Indicates the size, in bytes, of the data buffer specified by InputBuffer.
+
+ @retval EFI_SUCCESS The callback function complete successfully.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_BLUETOOTH_CONFIG_REGISTER_CONNECT_COMPLETE_CALLBACK_FUNCTION)(
+ IN EFI_BLUETOOTH_CONFIG_PROTOCOL *This,
+ IN VOID *Context,
+ IN EFI_BLUETOOTH_CONNECT_COMPLETE_CALLBACK_TYPE CallbackType,
+ IN BLUETOOTH_ADDRESS *BDAddr,
+ IN VOID *InputBuffer,
+ IN UINTN InputBufferSize
+ );
+
+/**
+ Register link connect complete callback function.
+
+ @param This Pointer to the EFI_BLUETOOTH_CONFIG_PROTOCOL instance.
+ @param Callback The callback function. NULL means unregister.
+ @param Context Data passed into Callback function. This is optional parameter and may be NULL.
+
+ @retval EFI_SUCCESS The link connect complete callback function is registered successfully.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_BLUETOOTH_CONFIG_REGISTER_CONNECT_COMPLETE_CALLBACK)(
+ IN EFI_BLUETOOTH_CONFIG_PROTOCOL *This,
+ IN EFI_BLUETOOTH_CONFIG_REGISTER_CONNECT_COMPLETE_CALLBACK_FUNCTION Callback,
+ IN VOID *Context
+ );
+
+///
+/// This protocol abstracts user interface configuration for Bluetooth device.
+///
+struct _EFI_BLUETOOTH_CONFIG_PROTOCOL {
+ EFI_BLUETOOTH_CONFIG_INIT Init;
+ EFI_BLUETOOTH_CONFIG_SCAN Scan;
+ EFI_BLUETOOTH_CONFIG_CONNECT Connect;
+ EFI_BLUETOOTH_CONFIG_DISCONNECT Disconnect;
+ EFI_BLUETOOTH_CONFIG_GET_DATA GetData;
+ EFI_BLUETOOTH_CONFIG_SET_DATA SetData;
+ EFI_BLUETOOTH_CONFIG_GET_REMOTE_DATA GetRemoteData;
+ EFI_BLUETOOTH_CONFIG_REGISTER_PIN_CALLBACK RegisterPinCallback;
+ EFI_BLUETOOTH_CONFIG_REGISTER_GET_LINK_KEY_CALLBACK RegisterGetLinkKeyCallback;
+ EFI_BLUETOOTH_CONFIG_REGISTER_SET_LINK_KEY_CALLBACK RegisterSetLinkKeyCallback;
+ EFI_BLUETOOTH_CONFIG_REGISTER_CONNECT_COMPLETE_CALLBACK RegisterLinkConnectCompleteCallback;
+};
+
+extern EFI_GUID gEfiBluetoothConfigProtocolGuid;
+
+#endif
diff --git a/MdePkg/Include/Protocol/BluetoothHc.h b/MdePkg/Include/Protocol/BluetoothHc.h new file mode 100644 index 0000000..37b7602 --- /dev/null +++ b/MdePkg/Include/Protocol/BluetoothHc.h @@ -0,0 +1,328 @@ +/** @file
+ EFI Bluetooth Host Controller Protocol as defined in UEFI 2.5.
+ This protocol abstracts the Bluetooth host controller layer message transmit and receive.
+
+ Copyright (c) 2015, Intel Corporation. All rights reserved.<BR>
+ This program and the accompanying materials are licensed and made available under
+ the terms and conditions of the BSD License that accompanies this distribution.
+ The full text of the license may be found at
+ http://opensource.org/licenses/bsd-license.php.
+
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+ @par Revision Reference:
+ This Protocol is introduced in UEFI Specification 2.5
+
+**/
+
+#ifndef __EFI_BLUETOOTH_HC_PROTOCOL_H__
+#define __EFI_BLUETOOTH_HC_PROTOCOL_H__
+
+#define EFI_BLUETOOTH_HC_PROTOCOL_GUID \
+ { \
+ 0xb3930571, 0xbeba, 0x4fc5, { 0x92, 0x3, 0x94, 0x27, 0x24, 0x2e, 0x6a, 0x43 } \
+ }
+
+typedef struct _EFI_BLUETOOTH_HC_PROTOCOL EFI_BLUETOOTH_HC_PROTOCOL;
+
+/**
+ Send HCI command packet.
+
+ @param This Pointer to the EFI_BLUETOOTH_HC_PROTOCOL instance.
+ @param BufferSize On input, indicates the size, in bytes, of the data buffer specified by Buffer.
+ On output, indicates the amount of data actually transferred.
+ @param Buffer A pointer to the buffer of data that will be transmitted to Bluetooth host
+ controller.
+ @param Timeout Indicating the transfer should be completed within this time frame. The units are
+ in milliseconds. If Timeout is 0, then the caller must wait for the function to
+ be completed until EFI_SUCCESS or EFI_DEVICE_ERROR is returned.
+
+ @retval EFI_SUCCESS The HCI command packet is sent successfully.
+ @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:
+ - BufferSize is NULL.
+ - *BufferSize is 0.
+ - Buffer is NULL.
+ @retval EFI_TIMEOUT Sending HCI command packet fail due to timeout.
+ @retval EFI_DEVICE_ERROR Sending HCI command packet fail due to host controller or device error.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_BLUETOOTH_HC_SEND_COMMAND)(
+ IN EFI_BLUETOOTH_HC_PROTOCOL *This,
+ IN OUT UINTN *BufferSize,
+ IN VOID *Buffer,
+ IN UINTN Timeout
+ );
+
+
+/**
+ Receive HCI event packet.
+
+ @param This Pointer to the EFI_BLUETOOTH_HC_PROTOCOL instance.
+ @param BufferSize On input, indicates the size, in bytes, of the data buffer specified by Buffer.
+ On output, indicates the amount of data actually transferred.
+ @param Buffer A pointer to the buffer of data that will be received from Bluetooth host controller.
+ @param Timeout Indicating the transfer should be completed within this time frame. The units are
+ in milliseconds. If Timeout is 0, then the caller must wait for the function to
+ be completed until EFI_SUCCESS or EFI_DEVICE_ERROR is returned.
+
+ @retval EFI_SUCCESS The HCI event packet is received successfully.
+ @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:
+ - BufferSize is NULL.
+ - *BufferSize is 0.
+ - Buffer is NULL.
+ @retval EFI_TIMEOUT Receiving HCI event packet fail due to timeout.
+ @retval EFI_DEVICE_ERROR Receiving HCI event packet fail due to host controller or device error.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_BLUETOOTH_HC_RECEIVE_EVENT)(
+ IN EFI_BLUETOOTH_HC_PROTOCOL *This,
+ IN OUT UINTN *BufferSize,
+ OUT VOID *Buffer,
+ IN UINTN Timeout
+ );
+
+/**
+ Callback function, it is called when asynchronous transfer is completed.
+
+ @param Data Pointer to the EFI_BLUETOOTH_HC_PROTOCOL instance.
+ @param DataLength Specifies the length, in bytes, of the data to be received.
+ @param Context Data passed into Callback function. This is optional parameter and may be NULL.
+
+ @retval EFI_SUCCESS The callback function complete successfully.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_BLUETOOTH_HC_ASYNC_FUNC_CALLBACK) (
+ IN VOID *Data,
+ IN UINTN DataLength,
+ IN VOID *Context
+ );
+
+/**
+ Receive HCI event packet in non-blocking way.
+
+ @param This Pointer to the EFI_BLUETOOTH_HC_PROTOCOL instance.
+ @param IsNewTransfer If TRUE, a new transfer will be submitted. If FALSE, the request is deleted.
+ @param PollingInterval Indicates the periodic rate, in milliseconds, that the transfer is to be executed.
+ @param DataLength Specifies the length, in bytes, of the data to be received.
+ @param Callback The callback function. This function is called if the asynchronous transfer is
+ completed.
+ @param Context Data passed into Callback function. This is optional parameter and may be NULL.
+
+ @retval EFI_SUCCESS The HCI asynchronous receive request is submitted successfully.
+ @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:
+ - DataLength is 0.
+ - If IsNewTransfer is TRUE, and an asynchronous receive request already exists.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_BLUETOOTH_HC_ASYNC_RECEIVE_EVENT)(
+ IN EFI_BLUETOOTH_HC_PROTOCOL *This,
+ IN BOOLEAN IsNewTransfer,
+ IN UINTN PollingInterval,
+ IN UINTN DataLength,
+ IN EFI_BLUETOOTH_HC_ASYNC_FUNC_CALLBACK Callback,
+ IN VOID *Context
+ );
+
+/**
+ Send HCI ACL data packet.
+
+ @param This Pointer to the EFI_BLUETOOTH_HC_PROTOCOL instance.
+ @param BufferSize On input, indicates the size, in bytes, of the data buffer specified by Buffer.
+ On output, indicates the amount of data actually transferred.
+ @param Buffer A pointer to the buffer of data that will be transmitted to Bluetooth host
+ controller.
+ @param Timeout Indicating the transfer should be completed within this time frame. The units are
+ in milliseconds. If Timeout is 0, then the caller must wait for the function to
+ be completed until EFI_SUCCESS or EFI_DEVICE_ERROR is returned.
+
+ @retval EFI_SUCCESS The HCI ACL data packet is sent successfully.
+ @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:
+ - BufferSize is NULL.
+ - *BufferSize is 0.
+ - Buffer is NULL.
+ @retval EFI_TIMEOUT Sending HCI ACL data packet fail due to timeout.
+ @retval EFI_DEVICE_ERROR Sending HCI ACL data packet fail due to host controller or device error.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_BLUETOOTH_HC_SEND_ACL_DATA)(
+ IN EFI_BLUETOOTH_HC_PROTOCOL *This,
+ IN OUT UINTN *BufferSize,
+ IN VOID *Buffer,
+ IN UINTN Timeout
+ );
+
+/**
+ Receive HCI ACL data packet.
+
+ @param This Pointer to the EFI_BLUETOOTH_HC_PROTOCOL instance.
+ @param BufferSize On input, indicates the size, in bytes, of the data buffer specified by Buffer.
+ On output, indicates the amount of data actually transferred.
+ @param Buffer A pointer to the buffer of data that will be received from Bluetooth host controller.
+ @param Timeout Indicating the transfer should be completed within this time frame. The units are
+ in milliseconds. If Timeout is 0, then the caller must wait for the function to
+ be completed until EFI_SUCCESS or EFI_DEVICE_ERROR is returned.
+
+ @retval EFI_SUCCESS The HCI ACL data packet is received successfully.
+ @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:
+ - BufferSize is NULL.
+ - *BufferSize is 0.
+ - Buffer is NULL.
+ @retval EFI_TIMEOUT Receiving HCI ACL data packet fail due to timeout.
+ @retval EFI_DEVICE_ERROR Receiving HCI ACL data packet fail due to host controller or device error.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_BLUETOOTH_HC_RECEIVE_ACL_DATA)(
+ IN EFI_BLUETOOTH_HC_PROTOCOL *This,
+ IN OUT UINTN *BufferSize,
+ OUT VOID *Buffer,
+ IN UINTN Timeout
+ );
+
+
+/**
+ Receive HCI ACL data packet in non-blocking way.
+
+ @param This Pointer to the EFI_BLUETOOTH_HC_PROTOCOL instance.
+ @param IsNewTransfer If TRUE, a new transfer will be submitted. If FALSE, the request is deleted.
+ @param PollingInterval Indicates the periodic rate, in milliseconds, that the transfer is to be executed.
+ @param DataLength Specifies the length, in bytes, of the data to be received.
+ @param Callback The callback function. This function is called if the asynchronous transfer is
+ completed.
+ @param Context Data passed into Callback function. This is optional parameter and may be NULL.
+
+ @retval EFI_SUCCESS The HCI asynchronous receive request is submitted successfully.
+ @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:
+ - DataLength is 0.
+ - If IsNewTransfer is TRUE, and an asynchronous receive request already exists.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_BLUETOOTH_HC_ASYNC_RECEIVE_ACL_DATA) (
+ IN EFI_BLUETOOTH_HC_PROTOCOL *This,
+ IN BOOLEAN IsNewTransfer,
+ IN UINTN PollingInterval,
+ IN UINTN DataLength,
+ IN EFI_BLUETOOTH_HC_ASYNC_FUNC_CALLBACK Callback,
+ IN VOID *Context
+ );
+
+/**
+ Send HCI SCO data packet.
+
+ @param This Pointer to the EFI_BLUETOOTH_HC_PROTOCOL instance.
+ @param BufferSize On input, indicates the size, in bytes, of the data buffer specified by Buffer.
+ On output, indicates the amount of data actually transferred.
+ @param Buffer A pointer to the buffer of data that will be transmitted to Bluetooth host
+ controller.
+ @param Timeout Indicating the transfer should be completed within this time frame. The units are
+ in milliseconds. If Timeout is 0, then the caller must wait for the function to
+ be completed until EFI_SUCCESS or EFI_DEVICE_ERROR is returned.
+
+ @retval EFI_SUCCESS The HCI SCO data packet is sent successfully.
+ @retval EFI_UNSUPPORTED The implementation does not support HCI SCO transfer.
+ @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:
+ - BufferSize is NULL.
+ - *BufferSize is 0.
+ - Buffer is NULL.
+ @retval EFI_TIMEOUT Sending HCI SCO data packet fail due to timeout.
+ @retval EFI_DEVICE_ERROR Sending HCI SCO data packet fail due to host controller or device error.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_BLUETOOTH_HC_SEND_SCO_DATA)(
+ IN EFI_BLUETOOTH_HC_PROTOCOL *This,
+ IN OUT UINTN *BufferSize,
+ IN VOID *Buffer,
+ IN UINTN Timeout
+ );
+
+/**
+ Receive HCI SCO data packet.
+
+ @param This Pointer to the EFI_BLUETOOTH_HC_PROTOCOL instance.
+ @param BufferSize On input, indicates the size, in bytes, of the data buffer specified by Buffer.
+ On output, indicates the amount of data actually transferred.
+ @param Buffer A pointer to the buffer of data that will be received from Bluetooth host controller.
+ @param Timeout Indicating the transfer should be completed within this time frame. The units are
+ in milliseconds. If Timeout is 0, then the caller must wait for the function to
+ be completed until EFI_SUCCESS or EFI_DEVICE_ERROR is returned.
+
+ @retval EFI_SUCCESS The HCI SCO data packet is received successfully.
+ @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:
+ - BufferSize is NULL.
+ - *BufferSize is 0.
+ - Buffer is NULL.
+ @retval EFI_TIMEOUT Receiving HCI SCO data packet fail due to timeout
+ @retval EFI_DEVICE_ERROR Receiving HCI SCO data packet fail due to host controller or device error.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_BLUETOOTH_HC_RECEIVE_SCO_DATA)(
+ IN EFI_BLUETOOTH_HC_PROTOCOL *This,
+ IN OUT UINTN *BufferSize,
+ OUT VOID *Buffer,
+ IN UINTN Timeout
+ );
+
+/**
+ Receive HCI SCO data packet in non-blocking way.
+
+ @param This Pointer to the EFI_BLUETOOTH_HC_PROTOCOL instance.
+ @param IsNewTransfer If TRUE, a new transfer will be submitted. If FALSE, the request is deleted.
+ @param PollingInterval Indicates the periodic rate, in milliseconds, that the transfer is to be executed.
+ @param DataLength Specifies the length, in bytes, of the data to be received.
+ @param Callback The callback function. This function is called if the asynchronous transfer is
+ completed.
+ @param Context Data passed into Callback function. This is optional parameter and may be NULL.
+
+ @retval EFI_SUCCESS The HCI asynchronous receive request is submitted successfully.
+ @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:
+ - DataLength is 0.
+ - If IsNewTransfer is TRUE, and an asynchronous receive request already exists.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_BLUETOOTH_HC_ASYNC_RECEIVE_SCO_DATA) (
+ IN EFI_BLUETOOTH_HC_PROTOCOL *This,
+ IN BOOLEAN IsNewTransfer,
+ IN UINTN PollingInterval,
+ IN UINTN DataLength,
+ IN EFI_BLUETOOTH_HC_ASYNC_FUNC_CALLBACK Callback,
+ IN VOID *Context
+ );
+
+///
+/// This protocol abstracts the Bluetooth host controller layer message transmit and receive.
+///
+struct _EFI_BLUETOOTH_HC_PROTOCOL {
+ EFI_BLUETOOTH_HC_SEND_COMMAND SendCommand;
+ EFI_BLUETOOTH_HC_RECEIVE_EVENT ReceiveEvent;
+ EFI_BLUETOOTH_HC_ASYNC_RECEIVE_EVENT AsyncReceiveEvent;
+ EFI_BLUETOOTH_HC_SEND_ACL_DATA SendACLData;
+ EFI_BLUETOOTH_HC_RECEIVE_ACL_DATA ReceiveACLData;
+ EFI_BLUETOOTH_HC_ASYNC_RECEIVE_ACL_DATA AsyncReceiveACLData;
+ EFI_BLUETOOTH_HC_SEND_SCO_DATA SendSCOData;
+ EFI_BLUETOOTH_HC_RECEIVE_SCO_DATA ReceiveSCOData;
+ EFI_BLUETOOTH_HC_ASYNC_RECEIVE_SCO_DATA AsyncReceiveSCOData;
+};
+
+extern EFI_GUID gEfiBluetoothHcProtocolGuid;
+
+#endif
diff --git a/MdePkg/Include/Protocol/BluetoothIo.h b/MdePkg/Include/Protocol/BluetoothIo.h new file mode 100644 index 0000000..d750767 --- /dev/null +++ b/MdePkg/Include/Protocol/BluetoothIo.h @@ -0,0 +1,416 @@ +/** @file
+ EFI Bluetooth IO Service Binding Protocol as defined in UEFI 2.5.
+ EFI Bluetooth IO Protocol as defined in UEFI 2.5.
+ The EFI Bluetooth IO Service Binding Protocol is used to locate EFI Bluetooth IO Protocol drivers to
+ create and destroy child of the driver to communicate with other Bluetooth device by using Bluetooth IO protocol.
+
+ Copyright (c) 2015, Intel Corporation. All rights reserved.<BR>
+ This program and the accompanying materials are licensed and made available under
+ the terms and conditions of the BSD License that accompanies this distribution.
+ The full text of the license may be found at
+ http://opensource.org/licenses/bsd-license.php.
+
+ THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+ @par Revision Reference:
+ This Protocol is introduced in UEFI Specification 2.5
+
+**/
+
+#ifndef __EFI_BLUETOOTH_IO_PROTOCOL_H__
+#define __EFI_BLUETOOTH_IO_PROTOCOL_H__
+
+#include <IndustryStandard/Bluetooth.h>
+
+#define EFI_BLUETOOTH_IO_SERVICE_BINDING_PROTOCOL_GUID \
+ { \
+ 0x388278d3, 0x7b85, 0x42f0, { 0xab, 0xa9, 0xfb, 0x4b, 0xfd, 0x69, 0xf5, 0xab } \
+ }
+
+#define EFI_BLUETOOTH_IO_PROTOCOL_GUID \
+ { \
+ 0x467313de, 0x4e30, 0x43f1, { 0x94, 0x3e, 0x32, 0x3f, 0x89, 0x84, 0x5d, 0xb5 } \
+ }
+
+typedef struct _EFI_BLUETOOTH_IO_PROTOCOL EFI_BLUETOOTH_IO_PROTOCOL;
+
+///
+/// EFI_BLUETOOTH_DEVICE_INFO
+///
+typedef struct {
+ ///
+ /// The version of the structure
+ ///
+ UINT32 Version;
+ ///
+ /// 48bit Bluetooth device address.
+ ///
+ BLUETOOTH_ADDRESS BD_ADDR;
+ ///
+ /// Bluetooth PageScanRepetitionMode. See Bluetooth specification for detail.
+ ///
+ UINT8 PageScanRepetitionMode;
+ ///
+ /// Bluetooth ClassOfDevice. See Bluetooth specification for detail.
+ ///
+ BLUETOOTH_CLASS_OF_DEVICE ClassOfDevice;
+ ///
+ /// Bluetooth CloseOffset. See Bluetooth specification for detail.
+ ///
+ UINT16 ClockOffset;
+ ///
+ /// Bluetooth RSSI. See Bluetooth specification for detail.
+ ///
+ UINT8 RSSI;
+ ///
+ /// Bluetooth ExtendedInquiryResponse. See Bluetooth specification for detail.
+ ///
+ UINT8 ExtendedInquiryResponse[240];
+} EFI_BLUETOOTH_DEVICE_INFO;
+
+/**
+ Get Bluetooth device information.
+
+ @param This Pointer to the EFI_BLUETOOTH_IO_PROTOCOL instance.
+ @param DeviceInfoSize A pointer to the size, in bytes, of the DeviceInfo buffer.
+ @param DeviceInfo A pointer to a callee allocated buffer that returns Bluetooth device information.
+
+ @retval EFI_SUCCESS The Bluetooth device information is returned successfully.
+ @retval EFI_DEVICE_ERROR A hardware error occurred trying to retrieve the Bluetooth device information.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_BLUETOOTH_IO_GET_DEVICE_INFO)(
+ IN EFI_BLUETOOTH_IO_PROTOCOL *This,
+ OUT UINTN *DeviceInfoSize,
+ OUT VOID **DeviceInfo
+ );
+
+/**
+ Get Bluetooth SDP information.
+
+ @param This Pointer to the EFI_BLUETOOTH_IO_PROTOCOL instance.
+ @param SdpInfoSize A pointer to the size, in bytes, of the SdpInfo buffer.
+ @param SdpInfo A pointer to a callee allocated buffer that returns Bluetooth SDP information.
+
+ @retval EFI_SUCCESS The Bluetooth device information is returned successfully.
+ @retval EFI_DEVICE_ERROR A hardware error occurred trying to retrieve the Bluetooth SDP information.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_BLUETOOTH_IO_GET_SDP_INFO)(
+ IN EFI_BLUETOOTH_IO_PROTOCOL *This,
+ OUT UINTN *SdpInfoSize,
+ OUT VOID **SdpInfo
+ );
+
+/**
+ Send L2CAP message (including L2CAP header).
+
+ @param This Pointer to the EFI_BLUETOOTH_IO_PROTOCOL instance.
+ @param BufferSize On input, indicates the size, in bytes, of the data buffer specified by Buffer.
+ On output, indicates the amount of data actually transferred.
+ @param Buffer A pointer to the buffer of data that will be transmitted to Bluetooth L2CAP layer.
+ @param Timeout Indicating the transfer should be completed within this time frame. The units are in
+ milliseconds. If Timeout is 0, then the caller must wait for the function to be completed
+ until EFI_SUCCESS or EFI_DEVICE_ERROR is returned.
+
+ @retval EFI_SUCCESS The L2CAP message is sent successfully.
+ @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:
+ - BufferSize is NULL.
+ - *BufferSize is 0.
+ - Buffer is NULL.
+ @retval EFI_TIMEOUT Sending L2CAP message fail due to timeout.
+ @retval EFI_DEVICE_ERROR Sending L2CAP message fail due to host controller or device error.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_BLUETOOTH_IO_L2CAP_RAW_SEND)(
+ IN EFI_BLUETOOTH_IO_PROTOCOL *This,
+ IN OUT UINTN *BufferSize,
+ IN VOID *Buffer,
+ IN UINTN Timeout
+ );
+
+/**
+ Receive L2CAP message (including L2CAP header).
+
+ @param This Pointer to the EFI_BLUETOOTH_IO_PROTOCOL instance.
+ @param BufferSize On input, indicates the size, in bytes, of the data buffer specified by Buffer.
+ On output, indicates the amount of data actually transferred.
+ @param Buffer A pointer to the buffer of data that will be received from Bluetooth L2CAP layer.
+ @param Timeout Indicating the transfer should be completed within this time frame. The units are in
+ milliseconds. If Timeout is 0, then the caller must wait for the function to be completed
+ until EFI_SUCCESS or EFI_DEVICE_ERROR is returned.
+
+ @retval EFI_SUCCESS The L2CAP message is received successfully.
+ @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:
+ - BufferSize is NULL.
+ - *BufferSize is 0.
+ - Buffer is NULL.
+ @retval EFI_TIMEOUT Receiving L2CAP message fail due to timeout.
+ @retval EFI_DEVICE_ERROR Receiving L2CAP message fail due to host controller or device error.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_BLUETOOTH_IO_L2CAP_RAW_RECEIVE)(
+ IN EFI_BLUETOOTH_IO_PROTOCOL *This,
+ IN OUT UINTN *BufferSize,
+ OUT VOID *Buffer,
+ IN UINTN Timeout
+ );
+
+/**
+ Callback function, it is called when asynchronous transfer is completed.
+
+ @param ChannelID Bluetooth L2CAP message channel ID.
+ @param Data Data received via asynchronous transfer.
+ @param DataLength The length of Data in bytes, received via asynchronous transfer.
+ @param Context Context passed from asynchronous transfer request.
+
+ @retval EFI_SUCCESS The callback function complete successfully.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_BLUETOOTH_IO_ASYNC_FUNC_CALLBACK) (
+ IN UINT16 ChannelID,
+ IN VOID *Data,
+ IN UINTN DataLength,
+ IN VOID *Context
+ );
+
+/**
+ Receive L2CAP message (including L2CAP header) in non-blocking way.
+
+ @param This Pointer to the EFI_BLUETOOTH_IO_PROTOCOL instance.
+ @param IsNewTransfer If TRUE, a new transfer will be submitted. If FALSE, the request is deleted.
+ @param PollingInterval Indicates the periodic rate, in milliseconds, that the transfer is to be executed.
+ @param DataLength Specifies the length, in bytes, of the data to be received.
+ @param Callback The callback function. This function is called if the asynchronous transfer is
+ completed.
+ @param Context Data passed into Callback function. This is optional parameter and may be NULL.
+
+ @retval EFI_SUCCESS The L2CAP asynchronous receive request is submitted successfully.
+ @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:
+ - DataLength is 0.
+ - If IsNewTransfer is TRUE, and an asynchronous receive request already exists.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_BLUETOOTH_IO_L2CAP_RAW_ASYNC_RECEIVE)(
+ IN EFI_BLUETOOTH_IO_PROTOCOL *This,
+ IN BOOLEAN IsNewTransfer,
+ IN UINTN PollingInterval,
+ IN UINTN DataLength,
+ IN EFI_BLUETOOTH_IO_ASYNC_FUNC_CALLBACK Callback,
+ IN VOID *Context
+ );
+
+/**
+ Send L2CAP message (excluding L2CAP header) to a specific channel.
+
+ @param This Pointer to the EFI_BLUETOOTH_IO_PROTOCOL instance.
+ @param Handle A handle created by EFI_BLUETOOTH_IO_PROTOCOL.L2CapConnect indicates which channel to send.
+ @param BufferSize On input, indicates the size, in bytes, of the data buffer specified by Buffer.
+ On output, indicates the amount of data actually transferred.
+ @param Buffer A pointer to the buffer of data that will be transmitted to Bluetooth L2CAP layer.
+ @param Timeout Indicating the transfer should be completed within this time frame. The units are in
+ milliseconds. If Timeout is 0, then the caller must wait for the function to be completed
+ until EFI_SUCCESS or EFI_DEVICE_ERROR is returned.
+
+ @retval EFI_SUCCESS The L2CAP message is sent successfully.
+ @retval EFI_NOT_FOUND Handle is invalid or not found.
+ @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:
+ - BufferSize is NULL.
+ - *BufferSize is 0.
+ - Buffer is NULL.
+ @retval EFI_TIMEOUT Sending L2CAP message fail due to timeout.
+ @retval EFI_DEVICE_ERROR Sending L2CAP message fail due to host controller or device error.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_BLUETOOTH_IO_L2CAP_SEND)(
+ IN EFI_BLUETOOTH_IO_PROTOCOL *This,
+ IN EFI_HANDLE Handle,
+ IN OUT UINTN *BufferSize,
+ IN VOID *Buffer,
+ IN UINTN Timeout
+ );
+
+/**
+ Receive L2CAP message (excluding L2CAP header) from a specific channel.
+
+ @param This Pointer to the EFI_BLUETOOTH_IO_PROTOCOL instance.
+ @param Handle A handle created by EFI_BLUETOOTH_IO_PROTOCOL.L2CapConnect indicates which channel to receive.
+ @param BufferSize Indicates the size, in bytes, of the data buffer specified by Buffer.
+ @param Buffer A pointer to the buffer of data that will be received from Bluetooth L2CAP layer.
+ @param Timeout Indicating the transfer should be completed within this time frame. The units are in
+ milliseconds. If Timeout is 0, then the caller must wait for the function to be completed
+ until EFI_SUCCESS or EFI_DEVICE_ERROR is returned.
+
+ @retval EFI_SUCCESS The L2CAP message is received successfully.
+ @retval EFI_NOT_FOUND Handle is invalid or not found.
+ @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:
+ - BufferSize is NULL.
+ - *BufferSize is 0.
+ - Buffer is NULL.
+ @retval EFI_TIMEOUT Receiving L2CAP message fail due to timeout.
+ @retval EFI_DEVICE_ERROR Receiving L2CAP message fail due to host controller or device error.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_BLUETOOTH_IO_L2CAP_RECEIVE)(
+ IN EFI_BLUETOOTH_IO_PROTOCOL *This,
+ IN EFI_HANDLE Handle,
+ OUT UINTN *BufferSize,
+ OUT VOID **Buffer,
+ IN UINTN Timeout
+ );
+
+/**
+ Callback function, it is called when asynchronous transfer is completed.
+
+ @param Data Data received via asynchronous transfer.
+ @param DataLength The length of Data in bytes, received via asynchronous transfer.
+ @param Context Context passed from asynchronous transfer request.
+
+ @retval EFI_SUCCESS The callback function complete successfully.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_BLUETOOTH_IO_CHANNEL_SERVICE_CALLBACK) (
+ IN VOID *Data,
+ IN UINTN DataLength,
+ IN VOID *Context
+ );
+
+/**
+ Receive L2CAP message (excluding L2CAP header) in non-blocking way from a specific channel.
+
+ @param This Pointer to the EFI_BLUETOOTH_IO_PROTOCOL instance.
+ @param Handel A handle created by EFI_BLUETOOTH_IO_PROTOCOL.L2CapConnect indicates which channel to receive.
+ @param Callback The callback function. This function is called if the asynchronous transfer is
+ completed.
+ @param Context Data passed into Callback function. This is optional parameter and may be NULL.
+
+ @retval EFI_SUCCESS The L2CAP asynchronous receive request is submitted successfully.
+ @retval EFI_NOT_FOUND Handle is invalid or not found.
+ @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:
+ - DataLength is 0.
+ - If an asynchronous receive request already exists on same Handle.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_BLUETOOTH_IO_L2CAP_ASYNC_RECEIVE)(
+ IN EFI_BLUETOOTH_IO_PROTOCOL *This,
+ IN EFI_HANDLE Handle,
+ IN EFI_BLUETOOTH_IO_CHANNEL_SERVICE_CALLBACK Callback,
+ IN VOID *Context
+ );
+
+/**
+ Do L2CAP connection.
+
+ @param This Pointer to the EFI_BLUETOOTH_IO_PROTOCOL instance.
+ @param Handel A handle to indicate this L2CAP connection.
+ @param Psm Bluetooth PSM. See Bluetooth specification for detail.
+ @param Mtu Bluetooth MTU. See Bluetooth specification for detail.
+ @param Callback The callback function. This function is called whenever there is message received
+ in this channel.
+ @param Context Data passed into Callback function. This is optional parameter and may be NULL.
+
+ @retval EFI_SUCCESS The Bluetooth L2CAP layer connection is created successfully.
+ @retval EFI_INVALID_PARAMETER One or more of the following conditions is TRUE:
+ - Handle is NULL.
+ @retval EFI_DEVICE_ERROR A hardware error occurred trying to do Bluetooth L2CAP connection.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_BLUETOOTH_IO_L2CAP_CONNECT)(
+ IN EFI_BLUETOOTH_IO_PROTOCOL *This,
+ OUT EFI_HANDLE *Handle,
+ IN UINT16 Psm,
+ IN UINT16 Mtu,
+ IN EFI_BLUETOOTH_IO_CHANNEL_SERVICE_CALLBACK Callback,
+ IN VOID *Context
+ );
+
+/**
+ Do L2CAP disconnection.
+
+ @param This Pointer to the EFI_BLUETOOTH_IO_PROTOCOL instance.
+ @param Handel A handle to indicate this L2CAP connection.
+
+ @retval EFI_SUCCESS The Bluetooth L2CAP layer is disconnected successfully.
+ @retval EFI_NOT_FOUND Handle is invalid or not found.
+ @retval EFI_DEVICE_ERROR A hardware error occurred trying to do Bluetooth L2CAP disconnection.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_BLUETOOTH_IO_L2CAP_DISCONNECT)(
+ IN EFI_BLUETOOTH_IO_PROTOCOL *This,
+ IN EFI_HANDLE Handle
+ );
+
+/**
+ Register L2CAP callback function for special channel.
+
+ @param This Pointer to the EFI_BLUETOOTH_IO_PROTOCOL instance.
+ @param Handel A handle to indicate this L2CAP connection.
+ @param Psm Bluetooth PSM. See Bluetooth specification for detail.
+ @param Mtu Bluetooth MTU. See Bluetooth specification for detail.
+ @param Callback The callback function. This function is called whenever there is message received
+ in this channel. NULL means unregister.
+ @param Context Data passed into Callback function. This is optional parameter and may be NULL.
+
+ @retval EFI_SUCCESS The Bluetooth L2CAP callback function is registered successfully.
+ @retval EFI_ALREADY_STARTED The callback function already exists when register.
+ @retval EFI_NOT_FOUND The callback function does not exist when unregister.
+
+**/
+typedef
+EFI_STATUS
+(EFIAPI *EFI_BLUETOOTH_IO_L2CAP_REGISTER_SERVICE)(
+ IN EFI_BLUETOOTH_IO_PROTOCOL *This,
+ OUT EFI_HANDLE *Handle,
+ IN UINT16 Psm,
+ IN UINT16 Mtu,
+ IN EFI_BLUETOOTH_IO_CHANNEL_SERVICE_CALLBACK Callback,
+ IN VOID *Context
+ );
+
+///
+/// This protocol provides service for Bluetooth L2CAP (Logical Link Control and Adaptation Protocol)
+/// and SDP (Service Discovery Protocol).
+///
+struct _EFI_BLUETOOTH_IO_PROTOCOL {
+ EFI_BLUETOOTH_IO_GET_DEVICE_INFO GetDeviceInfo;
+ EFI_BLUETOOTH_IO_GET_SDP_INFO GetSdpInfo;
+ EFI_BLUETOOTH_IO_L2CAP_RAW_SEND L2CapRawSend;
+ EFI_BLUETOOTH_IO_L2CAP_RAW_RECEIVE L2CapRawReceive;
+ EFI_BLUETOOTH_IO_L2CAP_RAW_ASYNC_RECEIVE L2CapRawAsyncReceive;
+ EFI_BLUETOOTH_IO_L2CAP_SEND L2CapSend;
+ EFI_BLUETOOTH_IO_L2CAP_RECEIVE L2CapReceive;
+ EFI_BLUETOOTH_IO_L2CAP_ASYNC_RECEIVE L2CapAsyncReceive;
+ EFI_BLUETOOTH_IO_L2CAP_CONNECT L2CapConnect;
+ EFI_BLUETOOTH_IO_L2CAP_DISCONNECT L2CapDisconnect;
+ EFI_BLUETOOTH_IO_L2CAP_REGISTER_SERVICE L2CapRegisterService;
+};
+
+extern EFI_GUID gEfiBluetoothIoServiceBindingProtocolGuid;
+extern EFI_GUID gEfiBluetoothIoProtocolGuid;
+
+#endif
diff --git a/MdePkg/Include/Protocol/DevicePath.h b/MdePkg/Include/Protocol/DevicePath.h index 3c9b1ec..4d2f340 100644 --- a/MdePkg/Include/Protocol/DevicePath.h +++ b/MdePkg/Include/Protocol/DevicePath.h @@ -20,7 +20,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. #define __EFI_DEVICE_PATH_PROTOCOL_H__
#include <Guid/PcAnsi.h>
-
+#include <IndustryStandard/Bluetooth.h>
///
/// Device Path protocol.
///
@@ -862,6 +862,18 @@ typedef struct { UINT16 VlanId;
} VLAN_DEVICE_PATH;
+///
+/// Bluetooth Device Path SubType.
+///
+#define MSG_BLUETOOTH_DP 0x1b
+typedef struct {
+ EFI_DEVICE_PATH_PROTOCOL Header;
+ ///
+ /// 48bit Bluetooth device address.
+ ///
+ BLUETOOTH_ADDRESS BD_ADDR;
+} BLUETOOTH_DEVICE_PATH;
+
//
// Media Device Path
//
@@ -1110,6 +1122,7 @@ typedef union { SAS_DEVICE_PATH Sas;
SASEX_DEVICE_PATH SasEx;
NVME_NAMESPACE_DEVICE_PATH NvmeNamespace;
+ BLUETOOTH_DEVICE_PATH Bluetooth;
UFS_DEVICE_PATH Ufs;
HARDDRIVE_DEVICE_PATH HardDrive;
CDROM_DEVICE_PATH CD;
@@ -1161,6 +1174,7 @@ typedef union { SAS_DEVICE_PATH *Sas;
SASEX_DEVICE_PATH *SasEx;
NVME_NAMESPACE_DEVICE_PATH *NvmeNamespace;
+ BLUETOOTH_DEVICE_PATH *Bluetooth;
UFS_DEVICE_PATH *Ufs;
HARDDRIVE_DEVICE_PATH *HardDrive;
CDROM_DEVICE_PATH *CD;
diff --git a/MdePkg/MdePkg.dec b/MdePkg/MdePkg.dec index d8291e1..da42ede 100644 --- a/MdePkg/MdePkg.dec +++ b/MdePkg/MdePkg.dec @@ -1446,6 +1446,16 @@ ## Include/Protocol/UsbFunctionIo.h
gEfiUsbFunctionIoProtocolGuid = { 0x32d2963a, 0xfe5d, 0x4f30, {0xb6, 0x33, 0x6e, 0x5d, 0xc5, 0x58, 0x3, 0xcc }}
+
+ ## Include/Protocol/BluetoothHc.h
+ gEfiBluetoothHcProtocolGuid = { 0xb3930571, 0xbeba, 0x4fc5, { 0x92, 0x3, 0x94, 0x27, 0x24, 0x2e, 0x6a, 0x43 }}
+
+ ## Include/Protocol/BluetoothIo.h
+ gEfiBluetoothIoServiceBindingProtocolGuid = { 0x388278d3, 0x7b85, 0x42f0, { 0xab, 0xa9, 0xfb, 0x4b, 0xfd, 0x69, 0xf5, 0xab }}
+ gEfiBluetoothIoProtocolGuid = { 0x467313de, 0x4e30, 0x43f1, { 0x94, 0x3e, 0x32, 0x3f, 0x89, 0x84, 0x5d, 0xb5 }}
+
+ ## Include/Protocol/BluetoothConfig.h
+ gEfiBluetoothConfigProtocolGuid = { 0x62960cf3, 0x40ff, 0x4263, { 0xa7, 0x7c, 0xdf, 0xde, 0xbd, 0x19, 0x1b, 0x4b }}
#
# [Error.gEfiMdePkgTokenSpaceGuid]
|