From nobody Wed May 1 07:16:11 2024 Delivered-To: importer@patchew.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Authentication-Results: mx.zoho.com; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org; Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 1496720152706438.193418351452; Mon, 5 Jun 2017 20:35:52 -0700 (PDT) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 1E1C721959CA6; Mon, 5 Jun 2017 20:34:42 -0700 (PDT) Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id B231B21AE30D0 for ; Mon, 5 Jun 2017 20:34:40 -0700 (PDT) Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga105.jf.intel.com with ESMTP; 05 Jun 2017 20:35:46 -0700 Received: from ray-dev.ccr.corp.intel.com ([10.239.9.1]) by FMSMGA003.fm.intel.com with ESMTP; 05 Jun 2017 20:35:46 -0700 X-Original-To: edk2-devel@lists.01.org X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.39,304,1493708400"; d="scan'208";a="864937047" From: Ruiyu Ni To: edk2-devel@lists.01.org Date: Tue, 6 Jun 2017 11:35:39 +0800 Message-Id: <20170606033543.254936-2-ruiyu.ni@intel.com> X-Mailer: git-send-email 2.12.2.windows.2 In-Reply-To: <20170606033543.254936-1-ruiyu.ni@intel.com> References: <20170606033543.254936-1-ruiyu.ni@intel.com> Subject: [edk2] [PATCH v2 1/5] MdePkg/DevicePath: Add BluetoothLe device path node support X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Hao A Wu MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail: RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ruiyu Ni Cc: Hao A Wu Reviewed-by: Hao Wu Reviewed-by: Jiewen.yao@intel.com --- MdePkg/Include/IndustryStandard/Bluetooth.h | 17 +++++++++- MdePkg/Include/Protocol/DevicePath.h | 11 ++++++- .../Library/UefiDevicePathLib/DevicePathFromText.c | 34 +++++++++++++++++++ .../Library/UefiDevicePathLib/DevicePathToText.c | 38 ++++++++++++++++++= ++++ 4 files changed, 98 insertions(+), 2 deletions(-) diff --git a/MdePkg/Include/IndustryStandard/Bluetooth.h b/MdePkg/Include/I= ndustryStandard/Bluetooth.h index 7dc9d558dc..caea3ac034 100644 --- a/MdePkg/Include/IndustryStandard/Bluetooth.h +++ b/MdePkg/Include/IndustryStandard/Bluetooth.h @@ -2,7 +2,7 @@ This file contains the Bluetooth definitions that are consumed by driver= s. These definitions are from Bluetooth Core Specification Version 4.0 June= , 2010 =20 - Copyright (c) 2015, Intel Corporation. All rights reserved.
+ Copyright (c) 2015 - 2017, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made available under the terms and conditions of the BS= D License which accompanies this distribution. The full text of the license may b= e found at @@ -38,6 +38,21 @@ typedef struct { UINT16 MajorServiceClass:11; } BLUETOOTH_CLASS_OF_DEVICE; =20 +/// +/// BLUETOOTH_LE_ADDRESS +/// +typedef struct { + /// + /// 48-bit Bluetooth device address + /// + UINT8 Address[6]; + /// + /// 0x00 - Public Device Address + /// 0x01 - Random Device Address + /// + UINT8 Type; +} BLUETOOTH_LE_ADDRESS; + #pragma pack() =20 #define BLUETOOTH_HCI_COMMAND_LOCAL_READABLE_NAME_MAX_SIZE 248 diff --git a/MdePkg/Include/Protocol/DevicePath.h b/MdePkg/Include/Protocol= /DevicePath.h index aa7aec793e..220fa90765 100644 --- a/MdePkg/Include/Protocol/DevicePath.h +++ b/MdePkg/Include/Protocol/DevicePath.h @@ -5,7 +5,7 @@ from a software point of view. The path must persist from boot to boot, = so=20 it can not contain things like PCI bus numbers that change from boot to = boot. =20 -Copyright (c) 2006 - 2016, Intel Corporation. All rights reserved.
+Copyright (c) 2006 - 2017, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made availabl= e under=20 the terms and conditions of the BSD License that accompanies this distribu= tion. =20 The full text of the license may be found at @@ -938,6 +938,15 @@ typedef struct { UINT8 SSId[32]; } WIFI_DEVICE_PATH; =20 +/// +/// Bluetooth LE Device Path SubType. +/// +#define MSG_BLUETOOTH_LE_DP 0x1E +typedef struct { + EFI_DEVICE_PATH_PROTOCOL Header; + BLUETOOTH_LE_ADDRESS Address; +} BLUETOOTH_LE_DEVICE_PATH; + // // Media Device Path // diff --git a/MdePkg/Library/UefiDevicePathLib/DevicePathFromText.c b/MdePkg= /Library/UefiDevicePathLib/DevicePathFromText.c index 187c1cc4dc..f50c11cfa2 100644 --- a/MdePkg/Library/UefiDevicePathLib/DevicePathFromText.c +++ b/MdePkg/Library/UefiDevicePathLib/DevicePathFromText.c @@ -2692,6 +2692,39 @@ DevPathFromTextWiFi ( } =20 /** + Converts a text device path node to Bluetooth LE device path structure. + + @param TextDeviceNode The input Text device path node. + + @return A pointer to the newly-created Bluetooth LE device path structur= e. + +**/ +EFI_DEVICE_PATH_PROTOCOL * +DevPathFromTextBluetoothLE ( + IN CHAR16 *TextDeviceNode + ) +{ + CHAR16 *BluetoothLeAddrStr; + CHAR16 *BluetoothLeAddrTypeStr; + BLUETOOTH_LE_DEVICE_PATH *BluetoothLeDp; + + BluetoothLeAddrStr =3D GetNextParamStr (&TextDeviceNode); + BluetoothLeAddrTypeStr =3D GetNextParamStr (&TextDeviceNode); + BluetoothLeDp =3D (BLUETOOTH_LE_DEVICE_PATH *) CreateDeviceNode ( + MESSAGING_DEVICE_PATH, + MSG_BLUETOOTH_LE_DP, + (UINT16) sizeof (BLUETOOT= H_LE_DEVICE_PATH) + ); + + BluetoothLeDp->Address.Type =3D (UINT8) Strtoi (BluetoothLeAddrTypeStr); + StrHexToBytes ( + BluetoothLeAddrStr, sizeof (BluetoothLeDp->Address.Address) * 2, + BluetoothLeDp->Address.Address, sizeof (BluetoothLeDp->Address.Address) + ); + return (EFI_DEVICE_PATH_PROTOCOL *) BluetoothLeDp; +} + +/** Converts a text device path node to URI device path structure. =20 @param TextDeviceNode The input Text device path node. @@ -3367,6 +3400,7 @@ GLOBAL_REMOVE_IF_UNREFERENCED DEVICE_PATH_FROM_TEXT_T= ABLE mUefiDevicePathLibDevP {L"Uri", DevPathFromTextUri }, {L"Bluetooth", DevPathFromTextBluetooth }, {L"Wi-Fi", DevPathFromTextWiFi }, + {L"BluetoothLE", DevPathFromTextBluetoothLE }, {L"MediaPath", DevPathFromTextMediaPath }, {L"HD", DevPathFromTextHD }, {L"CDROM", DevPathFromTextCDROM }, diff --git a/MdePkg/Library/UefiDevicePathLib/DevicePathToText.c b/MdePkg/L= ibrary/UefiDevicePathLib/DevicePathToText.c index f45d3dd338..b8d9491885 100644 --- a/MdePkg/Library/UefiDevicePathLib/DevicePathToText.c +++ b/MdePkg/Library/UefiDevicePathLib/DevicePathToText.c @@ -1660,6 +1660,43 @@ DevPathToTextWiFi ( } =20 /** + Converts a Bluetooth device path structure to its string representative. + + @param Str The string representative of input device. + @param DevPath The input device path structure. + @param DisplayOnly If DisplayOnly is TRUE, then the shorter text rep= resentation + of the display node is used, where applicable. If= DisplayOnly + is FALSE, then the longer text representation of = the display node + is used. + @param AllowShortcuts If AllowShortcuts is TRUE, then the shortcut form= s of text + representation for a device node can be used, whe= re applicable. + +**/ +VOID +DevPathToTextBluetoothLE ( + IN OUT POOL_PRINT *Str, + IN VOID *DevPath, + IN BOOLEAN DisplayOnly, + IN BOOLEAN AllowShortcuts + ) +{ + BLUETOOTH_LE_DEVICE_PATH *BluetoothLE; + + BluetoothLE =3D DevPath; + UefiDevicePathLibCatPrint ( + Str, + L"BluetoothLE(%02x%02x%02x%02x%02x%02x,0x%02x)", + BluetoothLE->Address.Address[0], + BluetoothLE->Address.Address[1], + BluetoothLE->Address.Address[2], + BluetoothLE->Address.Address[3], + BluetoothLE->Address.Address[4], + BluetoothLE->Address.Address[5], + BluetoothLE->Address.Type + ); +} + +/** Converts a URI device path structure to its string representative. =20 @param Str The string representative of input device. @@ -2191,6 +2228,7 @@ GLOBAL_REMOVE_IF_UNREFERENCED const DEVICE_PATH_TO_TE= XT_TABLE mUefiDevicePathLib {MESSAGING_DEVICE_PATH, MSG_URI_DP, DevPathToTextU= ri }, {MESSAGING_DEVICE_PATH, MSG_BLUETOOTH_DP, DevPathToTextB= luetooth }, {MESSAGING_DEVICE_PATH, MSG_WIFI_DP, DevPathToTextW= iFi }, + {MESSAGING_DEVICE_PATH, MSG_BLUETOOTH_LE_DP, DevPathToTextB= luetoothLE }, {MEDIA_DEVICE_PATH, MEDIA_HARDDRIVE_DP, DevPathToTextH= ardDrive }, {MEDIA_DEVICE_PATH, MEDIA_CDROM_DP, DevPathToTextC= DROM }, {MEDIA_DEVICE_PATH, MEDIA_VENDOR_DP, DevPathToTextV= endor }, --=20 2.12.2.windows.2 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel From nobody Wed May 1 07:16:11 2024 Delivered-To: importer@patchew.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Authentication-Results: mx.zoho.com; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org; Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 149672015489727.301718351136174; Mon, 5 Jun 2017 20:35:54 -0700 (PDT) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 51E1221959CAD; Mon, 5 Jun 2017 20:34:43 -0700 (PDT) Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id ABB3821959CA3 for ; Mon, 5 Jun 2017 20:34:41 -0700 (PDT) Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga105.jf.intel.com with ESMTP; 05 Jun 2017 20:35:47 -0700 Received: from ray-dev.ccr.corp.intel.com ([10.239.9.1]) by FMSMGA003.fm.intel.com with ESMTP; 05 Jun 2017 20:35:47 -0700 X-Original-To: edk2-devel@lists.01.org X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.39,304,1493708400"; d="scan'208";a="864937056" From: Ruiyu Ni To: edk2-devel@lists.01.org Date: Tue, 6 Jun 2017 11:35:40 +0800 Message-Id: <20170606033543.254936-3-ruiyu.ni@intel.com> X-Mailer: git-send-email 2.12.2.windows.2 In-Reply-To: <20170606033543.254936-1-ruiyu.ni@intel.com> References: <20170606033543.254936-1-ruiyu.ni@intel.com> Subject: [edk2] [PATCH v2 2/5] MdePkg/BluetoothConfig: Add new EFI_BLUETOOTH_CONFIG_DATA_TYPE types X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jiewen Yao MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail: RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" UEFI spec 2.7 adds new EFI_BLUETOOTH_CONFIG_DATA_TYPE types. The patch adds them to the header file. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ruiyu Ni Cc: Jiewen Yao Reviewed-by: Jiewen.yao@intel.com --- MdePkg/Include/Protocol/BluetoothConfig.h | 25 ++++++++++++++++++++----- 1 file changed, 20 insertions(+), 5 deletions(-) diff --git a/MdePkg/Include/Protocol/BluetoothConfig.h b/MdePkg/Include/Pro= tocol/BluetoothConfig.h index b1b3f55126..4240ef0a14 100644 --- a/MdePkg/Include/Protocol/BluetoothConfig.h +++ b/MdePkg/Include/Protocol/BluetoothConfig.h @@ -2,7 +2,7 @@ EFI Bluetooth Configuration Protocol as defined in UEFI 2.5. This protocol abstracts user interface configuration for Bluetooth devic= e. =20 - Copyright (c) 2015, Intel Corporation. All rights reserved.
+ Copyright (c) 2015 - 2017, Intel Corporation. All rights reserved.
This program and the accompanying materials are licensed and made availa= ble under=20 the terms and conditions of the BSD License that accompanies this distri= bution. =20 The full text of the license may be found at @@ -69,7 +69,7 @@ typedef enum { /// /// Remote Bluetooth device state. Data structure is EFI_BLUETOOTH_CONFI= G_REMOTE_DEVICE_STATE_TYPE. /// - EfiBluetoothConfigDataTypeRemoteDeviceState, + EfiBluetoothConfigDataTypeRemoteDeviceState, /* Relevant for LE*/ /// /// Local/Remote Bluetooth device SDP information. Data structure is UIN= T8[]. /// @@ -77,11 +77,11 @@ typedef enum { /// /// Local Bluetooth device address. Data structure is BLUETOOTH_ADDRESS. /// - EfiBluetoothConfigDataTypeBDADDR, + EfiBluetoothConfigDataTypeBDADDR, /* Relevant for LE*/ /// /// Local Bluetooth discoverable state. Data structure is UINT8. (Page s= can and/or Inquiry scan) /// - EfiBluetoothConfigDataTypeDiscoverable, + EfiBluetoothConfigDataTypeDiscoverable, /* Relevant for LE*/ /// /// Local Bluetooth controller stored paired device list. Data structure= is BLUETOOTH_ADDRESS[]. /// @@ -90,6 +90,21 @@ typedef enum { /// Local available device list. Data structure is BLUETOOTH_ADDRESS[]. /// EfiBluetoothConfigDataTypeAvailableDeviceList, + EfiBluetoothConfigDataTypeRandomAddress, /* Relevant for LE*/ + EfiBluetoothConfigDataTypeRSSI, /* Relevant for LE*/ + /// + /// Advertisement report. Data structure is UNIT8[]. + /// + EfiBluetoothConfigDataTypeAdvertisementData, /* Relevant for LE*/ + EfiBluetoothConfigDataTypeIoCapability, /* Relevant for LE*/ + EfiBluetoothConfigDataTypeOOBDataFlag, /* Relevant for LE*/ + /// + /// KeyType of Authentication Requirements flag of local + /// device as UINT8, indicating requested security properties. + /// See Bluetooth specification 3.H.3.5.1. BIT0: MITM, BIT1:SC. + /// + EfiBluetoothConfigDataTypeKeyType, /* Relevant for LE*/ + EfiBluetoothConfigDataTypeEncKeySize, /* Relevant for LE*/ EfiBluetoothConfigDataTypeMax, } EFI_BLUETOOTH_CONFIG_DATA_TYPE; =20 @@ -324,7 +339,7 @@ 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 BLUETOOTH_ADDRESS *BDAddr, IN OUT UINTN *DataSize, IN OUT VOID *Data ); --=20 2.12.2.windows.2 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel From nobody Wed May 1 07:16:11 2024 Delivered-To: importer@patchew.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Authentication-Results: mx.zoho.com; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org; Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 1496720157559612.8710546247107; Mon, 5 Jun 2017 20:35:57 -0700 (PDT) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 8884321959CB3; Mon, 5 Jun 2017 20:34:44 -0700 (PDT) Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id D96B821959CAC for ; Mon, 5 Jun 2017 20:34:42 -0700 (PDT) Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga105.jf.intel.com with ESMTP; 05 Jun 2017 20:35:49 -0700 Received: from ray-dev.ccr.corp.intel.com ([10.239.9.1]) by FMSMGA003.fm.intel.com with ESMTP; 05 Jun 2017 20:35:48 -0700 X-Original-To: edk2-devel@lists.01.org X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.39,304,1493708400"; d="scan'208";a="864937065" From: Ruiyu Ni To: edk2-devel@lists.01.org Date: Tue, 6 Jun 2017 11:35:41 +0800 Message-Id: <20170606033543.254936-4-ruiyu.ni@intel.com> X-Mailer: git-send-email 2.12.2.windows.2 In-Reply-To: <20170606033543.254936-1-ruiyu.ni@intel.com> References: <20170606033543.254936-1-ruiyu.ni@intel.com> Subject: [edk2] [PATCH v2 3/5] MdePkg/BluetoothHc: Add detailed function header comments X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jiewen Yao MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail: RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ruiyu Ni Cc: Jiewen Yao Reviewed-by: Jiewen.yao@intel.com --- MdePkg/Include/Protocol/BluetoothHc.h | 510 ++++++++++++++++++++----------= ---- 1 file changed, 303 insertions(+), 207 deletions(-) diff --git a/MdePkg/Include/Protocol/BluetoothHc.h b/MdePkg/Include/Protoco= l/BluetoothHc.h index 37b7602679..b82c3285a0 100644 --- a/MdePkg/Include/Protocol/BluetoothHc.h +++ b/MdePkg/Include/Protocol/BluetoothHc.h @@ -2,16 +2,16 @@ EFI Bluetooth Host Controller Protocol as defined in UEFI 2.5. This protocol abstracts the Bluetooth host controller layer message tran= smit and receive. =20 - Copyright (c) 2015, Intel Corporation. All rights reserved.
- This program and the accompanying materials are licensed and made availa= ble under=20 - the terms and conditions of the BSD License that accompanies this distri= bution. =20 + Copyright (c) 2015 - 2017, Intel Corporation. All rights reserved.
+ This program and the accompanying materials are licensed and made availa= ble under + the terms and conditions of the BSD License that accompanies this distri= bution. The full text of the license may be found at - http://opensource.org/licenses/bsd-license.php. = =20 - =20 - THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, = =20 + 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 IMP= LIED. =20 - @par Revision Reference: =20 + @par Revision Reference: This Protocol is introduced in UEFI Specification 2.5 =20 **/ @@ -29,300 +29,396 @@ typedef struct _EFI_BLUETOOTH_HC_PROTOCOL EFI_BLUETOO= TH_HC_PROTOCOL; /** Send HCI command packet. =20 - @param This Pointer to the EFI_BLUETOOTH_HC_PROTOCOL instance. - @param BufferSize On input, indicates the size, in bytes, of the dat= a buffer specified by Buffer.=20 - On output, indicates the amount of data actually t= ransferred. - @param Buffer A pointer to the buffer of data that will be trans= mitted to Bluetooth host=20 - controller. - @param Timeout Indicating the transfer should be completed within= this time frame. The units are=20 - in milliseconds. If Timeout is 0, then the caller = must wait for the function to=20 - be completed until EFI_SUCCESS or EFI_DEVICE_ERROR= is returned. - - @retval EFI_SUCCESS The HCI command packet is sent successfull= y. - @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 tim= eout. - @retval EFI_DEVICE_ERROR Sending HCI command packet fail due to hos= t controller or device error. + The SendCommand() function sends HCI command packet. Buffer holds the wh= ole HCI + command packet, including OpCode, OCF, OGF, parameter length, and parame= ters. When + this function is returned, it just means the HCI command packet is sent,= it does not mean + the command is success or complete. Caller might need to wait a command = status event + to know the command status, or wait a command complete event to know if = the + command is completed. + + @param[in] This Pointer to the EFI_BLUETOOTH_HC_PROTOC= OL instance. + @param[in,out] BufferSize On input, indicates the size, in bytes= , of the data buffer + specified by Buffer. On output, indica= tes the amount of + data actually transferred. + @param[in] Buffer A pointer to the buffer of data that w= ill be transmitted to + Bluetooth host controller. + @param[in] Timeout Indicating the transfer should be comp= leted within this + time frame. The units are in milliseco= nds. If Timeout is 0, + then the caller must wait for the func= tion to be completed + until EFI_SUCCESS or EFI_DEVICE_ERROR = is returned. + + @retval EFI_SUCCESS The HCI command packet is sent success= fully. + @retval EFI_INVALID_PARAMETER One or more of the following condition= s 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. =20 **/ -typedef=20 +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 + IN EFI_BLUETOOTH_HC_PROTOCOL *This, + IN OUT UINTN *BufferSize, + IN VOID *Buffer, + IN UINTN Timeout ); - =20 =20 /** Receive HCI event packet. =20 - @param This Pointer to the EFI_BLUETOOTH_HC_PROTOCOL instance. - @param BufferSize On input, indicates the size, in bytes, of the dat= a buffer specified by Buffer.=20 - On output, indicates the amount of data actually t= ransferred. - @param Buffer A pointer to the buffer of data that will be recei= ved from Bluetooth host controller. - @param Timeout Indicating the transfer should be completed within= this time frame. The units are=20 - in milliseconds. If Timeout is 0, then the caller = must wait for the function to=20 - be completed until EFI_SUCCESS or EFI_DEVICE_ERROR= is returned. - - @retval EFI_SUCCESS The HCI event packet is received successfu= lly. - @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 tim= eout. - @retval EFI_DEVICE_ERROR Receiving HCI event packet fail due to hos= t controller or device error. + The ReceiveEvent() function receives HCI event packet. Buffer holds the = whole HCI event + packet, including EventCode, parameter length, and parameters. + + @param[in] This Pointer to the EFI_BLUETOOTH_HC_PROTOC= OL instance. + @param[in,out] BufferSize On input, indicates the size, in bytes= , of the data buffer + specified by Buffer. On output, indica= tes the amount of + data actually transferred. + @param[out] Buffer A pointer to the buffer of data that w= ill be received from + Bluetooth host controller. + @param[in] Timeout Indicating the transfer should be comp= leted within this + time frame. The units are in milliseco= nds. If Timeout is 0, + then the caller must wait for the func= tion to be completed + until EFI_SUCCESS or EFI_DEVICE_ERROR = is returned. + + @retval EFI_SUCCESS The HCI event packet is received succe= ssfully. + @retval EFI_INVALID_PARAMETER One or more of the following condition= s 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. =20 **/ 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 + IN EFI_BLUETOOTH_HC_PROTOCOL *This, + IN OUT UINTN *BufferSize, + OUT VOID *Buffer, + IN UINTN Timeout ); - =20 + /** - Callback function, it is called when asynchronous transfer is completed. + The async callback of AsyncReceiveEvent(). =20 - @param Data Pointer to the EFI_BLUETOOTH_HC_PROTOCOL insta= nce. - @param DataLength Specifies the length, in bytes, of the data to= be received. - @param Context Data passed into Callback function. This is op= tional parameter and may be NULL. + @param[in] Data Data received via asynchronous transfe= r. + @param[in] DataLength The length of Data in bytes, received = via asynchronous + transfer. + @param[in] Context Context passed from asynchronous trans= fer request. =20 - @retval EFI_SUCCESS The callback function complete successfu= lly. + @retval EFI_SUCCESS The callback does execute successfully. + @retval Others The callback doesn't execute successfu= lly. =20 **/ typedef EFI_STATUS (EFIAPI *EFI_BLUETOOTH_HC_ASYNC_FUNC_CALLBACK) ( - IN VOID *Data, - IN UINTN DataLength, - IN VOID *Context + IN VOID *Data, + IN UINTN DataLength, + IN VOID *Context ); - =20 + /** Receive HCI event packet in non-blocking way. =20 - @param This Pointer to the EFI_BLUETOOTH_HC_PROTOCOL insta= nce. - @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=20 - completed. - @param Context Data passed into Callback function. This is op= tional parameter and may be NULL. - - @retval EFI_SUCCESS The HCI asynchronous receive request is su= bmitted successfully. - @retval EFI_INVALID_PARAMETER One or more of the following conditions is= TRUE: - - DataLength is 0. - - If IsNewTransfer is TRUE, and an asynchr= onous receive request already exists. - + The AsyncReceiveEvent() function receives HCI event packet in non-blocki= ng way. Data + in Callback function holds the whole HCI event packet, including EventCo= de, parameter + length, and parameters. + + @param[in] This Pointer to the EFI_BLUETOOTH_HC_PROTOC= OL instance. + @param[in] IsNewTransfer If TRUE, a new transfer will be submit= ted. If FALSE, the + request is deleted. + @param[in] PollingInterval Indicates the periodic rate, in millis= econds, that the + transfer is to be executed. + @param[in] DataLength Specifies the length, in bytes, of the= data to be received. + @param[in] Callback The callback function. This function i= s called if the + asynchronous transfer is completed. + @param[in] Context Data passed into Callback function. Th= is is optional + parameter and may be NULL. + + @retval EFI_SUCCESS The HCI asynchronous receive request i= s submitted successfully. + @retval EFI_INVALID_PARAMETER One or more of the following condition= s is TRUE: + DataLength is 0. + If IsNewTransfer is TRUE, and an asy= nchronous 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 +(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 ); - =20 + /** Send HCI ACL data packet. =20 - @param This Pointer to the EFI_BLUETOOTH_HC_PROTOCOL instance. - @param BufferSize On input, indicates the size, in bytes, of the dat= a buffer specified by Buffer.=20 - On output, indicates the amount of data actually t= ransferred. - @param Buffer A pointer to the buffer of data that will be trans= mitted to Bluetooth host=20 - controller. - @param Timeout Indicating the transfer should be completed within= this time frame. The units are=20 - in milliseconds. If Timeout is 0, then the caller = must wait for the function to=20 - be completed until EFI_SUCCESS or EFI_DEVICE_ERROR= is returned. - - @retval EFI_SUCCESS The HCI ACL data packet is sent successful= ly. - @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 ti= meout. - @retval EFI_DEVICE_ERROR Sending HCI ACL data packet fail due to ho= st controller or device error. + The SendACLData() function sends HCI ACL data packet. Buffer holds the w= hole HCI ACL + data packet, including Handle, PB flag, BC flag, data length, and data. + + The SendACLData() function and ReceiveACLData() function just send and r= eceive data + payload from application layer. In order to protect the payload data, th= e Bluetooth bus is + required to call HCI_Set_Connection_Encryption command to enable hardwar= e based + encryption after authentication completed, according to pairing mode and= host + capability. + + @param[in] This Pointer to the EFI_BLUETOOTH_HC_PROTOC= OL instance. + @param[in, out] BufferSize On input, indicates the size, in bytes= , of the data buffer + specified by Buffer. On output, indica= tes the amount of + data actually transferred. + @param[in] Buffer A pointer to the buffer of data that w= ill be transmitted to + Bluetooth host controller. + @param[in] Timeout Indicating the transfer should be comp= leted within this + time frame. The units are in milliseco= nds. If Timeout is 0, + then the caller must wait for the func= tion to be completed + until EFI_SUCCESS or EFI_DEVICE_ERROR = is returned. + + @retval EFI_SUCCESS The HCI ACL data packet is sent succes= sfully. + @retval EFI_INVALID_PARAMETER One or more of the following condition= s is TRUE: + BufferSize is NULL. + *BufferSize is 0. + Buffer is NULL. + @retval EFI_TIMEOUT Sending HCI ACL data packet fail due t= o timeout. + @retval EFI_DEVICE_ERROR Sending HCI ACL data packet fail due t= o host controller or device + error. =20 **/ 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 + IN EFI_BLUETOOTH_HC_PROTOCOL *This, + IN OUT UINTN *BufferSize, + IN VOID *Buffer, + IN UINTN Timeout ); - =20 + /** Receive HCI ACL data packet. =20 - @param This Pointer to the EFI_BLUETOOTH_HC_PROTOCOL instance. - @param BufferSize On input, indicates the size, in bytes, of the dat= a buffer specified by Buffer.=20 - On output, indicates the amount of data actually t= ransferred. - @param Buffer A pointer to the buffer of data that will be recei= ved from Bluetooth host controller. - @param Timeout Indicating the transfer should be completed within= this time frame. The units are=20 - in milliseconds. If Timeout is 0, then the caller = must wait for the function to=20 - be completed until EFI_SUCCESS or EFI_DEVICE_ERROR= is returned. - - @retval EFI_SUCCESS The HCI ACL data packet is received succes= sfully. - @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. + The ReceiveACLData() function receives HCI ACL data packet. Buffer holds= the whole HCI + ACL data packet, including Handle, PB flag, BC flag, data length, and da= ta. + + @param[in] This Pointer to the EFI_BLUETOOTH_HC_PROTOC= OL instance. + @param[in, out] BufferSize On input, indicates the size, in bytes= , of the data buffer + specified by Buffer. On output, indica= tes the amount of + data actually transferred. + @param[out] Buffer A pointer to the buffer of data that w= ill be received from + Bluetooth host controller. + @param[in] Timeout Indicating the transfer should be comp= leted within this + time frame. The units are in milliseco= nds. If Timeout is 0, + then the caller must wait for the func= tion to be completed + until EFI_SUCCESS or EFI_DEVICE_ERROR = is returned. + + @retval EFI_SUCCESS The HCI ACL data packet is received su= ccessfully. + @retval EFI_INVALID_PARAMETER One or more of the following condition= s 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. =20 **/ 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 + IN EFI_BLUETOOTH_HC_PROTOCOL *This, + IN OUT UINTN *BufferSize, + OUT VOID *Buffer, + IN UINTN Timeout ); - =20 =20 /** Receive HCI ACL data packet in non-blocking way. =20 - @param This Pointer to the EFI_BLUETOOTH_HC_PROTOCOL insta= nce. - @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=20 - completed. - @param Context Data passed into Callback function. This is op= tional parameter and may be NULL. - - @retval EFI_SUCCESS The HCI asynchronous receive request is su= bmitted successfully. - @retval EFI_INVALID_PARAMETER One or more of the following conditions is= TRUE: - - DataLength is 0. - - If IsNewTransfer is TRUE, and an asynchr= onous receive request already exists. - + The AsyncReceiveACLData() function receives HCI ACL data packet in non-b= locking way. + Data in Callback holds the whole HCI ACL data packet, including Handle, = PB flag, BC flag, + data length, and data. + + @param[in] This Pointer to the EFI_BLUETOOTH_HC_PROTOC= OL instance. + @param[in] IsNewTransfer If TRUE, a new transfer will be submit= ted. If FALSE, the + request is deleted. + @param[in] PollingInterval Indicates the periodic rate, in millis= econds, that the + transfer is to be executed. + @param[in] DataLength Specifies the length, in bytes, of the= data to be received. + @param[in] Callback The callback function. This function i= s called if the + asynchronous transfer is completed. + @param[in] Context Data passed into Callback function. Th= is is optional + parameter and may be NULL. + + @retval EFI_SUCCESS The HCI asynchronous receive request i= s submitted successfully. + @retval EFI_INVALID_PARAMETER One or more of the following condition= s is TRUE: + DataLength is 0. + If IsNewTransfer is TRUE, and an asy= nchronous 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 + 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 ); - =20 + /** Send HCI SCO data packet. =20 - @param This Pointer to the EFI_BLUETOOTH_HC_PROTOCOL instance. - @param BufferSize On input, indicates the size, in bytes, of the dat= a buffer specified by Buffer.=20 - On output, indicates the amount of data actually t= ransferred. - @param Buffer A pointer to the buffer of data that will be trans= mitted to Bluetooth host=20 - controller. - @param Timeout Indicating the transfer should be completed within= this time frame. The units are=20 - in milliseconds. If Timeout is 0, then the caller = must wait for the function to=20 - be completed until EFI_SUCCESS or EFI_DEVICE_ERROR= is returned. - - @retval EFI_SUCCESS The HCI SCO data packet is sent successful= ly. - @retval EFI_UNSUPPORTED The implementation does not support HCI SC= O 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 ti= meout. - @retval EFI_DEVICE_ERROR Sending HCI SCO data packet fail due to ho= st controller or device error. - + The SendSCOData() function sends HCI SCO data packet. Buffer holds the w= hole HCI SCO + data packet, including ConnectionHandle, PacketStatus flag, data length,= and data. + + @param[in] This Pointer to the EFI_BLUETOOTH_HC_PROTOC= OL instance. + @param[in,out] BufferSize On input, indicates the size, in bytes= , of the data buffer + specified by Buffer. On output, indica= tes the amount of + data actually transferred. + @param[in] Buffer A pointer to the buffer of data that w= ill be transmitted to + Bluetooth host controller. + @param[in] Timeout Indicating the transfer should be comp= leted within this + time frame. The units are in milliseco= nds. If Timeout is 0, + then the caller must wait for the func= tion to be completed + until EFI_SUCCESS or EFI_DEVICE_ERROR = is returned. + + @retval EFI_SUCCESS The HCI SCO data packet is sent succes= sfully. + @retval EFI_UNSUPPORTED The implementation does not support HC= I SCO transfer. + @retval EFI_INVALID_PARAMETER One or more of the following condition= s is TRUE: + BufferSize is NULL. + *BufferSize is 0. + Buffer is NULL. + @retval EFI_TIMEOUT Sending HCI SCO data packet fail due t= o timeout. + @retval EFI_DEVICE_ERROR Sending HCI SCO data packet fail due t= o 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 + IN EFI_BLUETOOTH_HC_PROTOCOL *This, + IN OUT UINTN *BufferSize, + IN VOID *Buffer, + IN UINTN Timeout ); - =20 + /** Receive HCI SCO data packet. =20 - @param This Pointer to the EFI_BLUETOOTH_HC_PROTOCOL instance. - @param BufferSize On input, indicates the size, in bytes, of the dat= a buffer specified by Buffer.=20 - On output, indicates the amount of data actually t= ransferred. - @param Buffer A pointer to the buffer of data that will be recei= ved from Bluetooth host controller. - @param Timeout Indicating the transfer should be completed within= this time frame. The units are=20 - in milliseconds. If Timeout is 0, then the caller = must wait for the function to=20 - be completed until EFI_SUCCESS or EFI_DEVICE_ERROR= is returned. - - @retval EFI_SUCCESS The HCI SCO data packet is received succes= sfully. - @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. - + The ReceiveSCOData() function receives HCI SCO data packet. Buffer holds= the whole HCI + SCO data packet, including ConnectionHandle, PacketStatus flag, data len= gth, and data. + + @param[in] This Pointer to the EFI_BLUETOOTH_HC_PROTOC= OL instance. + @param[in,out] BufferSize On input, indicates the size, in bytes= , of the data buffer + specified by Buffer. On output, indica= tes the amount of + data actually transferred. + @param[out] Buffer A pointer to the buffer of data that w= ill be received from + Bluetooth host controller. + @param[in] Timeout Indicating the transfer should be comp= leted within this + time frame. The units are in milliseco= nds. If Timeout is 0, + then the caller must wait for the func= tion to be completed + until EFI_SUCCESS or EFI_DEVICE_ERROR = is returned. + + @retval EFI_SUCCESS The HCI SCO data packet is received su= ccessfully. + @retval EFI_INVALID_PARAMETER One or more of the following condition= s 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 + IN EFI_BLUETOOTH_HC_PROTOCOL *This, + IN OUT UINTN *BufferSize, + OUT VOID *Buffer, + IN UINTN Timeout ); =20 /** Receive HCI SCO data packet in non-blocking way. =20 - @param This Pointer to the EFI_BLUETOOTH_HC_PROTOCOL insta= nce. - @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=20 - completed. - @param Context Data passed into Callback function. This is op= tional parameter and may be NULL. - - @retval EFI_SUCCESS The HCI asynchronous receive request is su= bmitted successfully. - @retval EFI_INVALID_PARAMETER One or more of the following conditions is= TRUE: - - DataLength is 0. - - If IsNewTransfer is TRUE, and an asynchr= onous receive request already exists. - + The AsyncReceiveSCOData() function receives HCI SCO data packet in non-b= locking way. + Data in Callback holds the whole HCI SCO data packet, including Connecti= onHandle, + PacketStatus flag, data length, and data. + + @param[in] This Pointer to the EFI_BLUETOOTH_HC_PROTOC= OL instance. + @param[in] IsNewTransfer If TRUE, a new transfer will be submit= ted. If FALSE, the + request is deleted. + @param[in] PollingInterval Indicates the periodic rate, in millis= econds, that the + transfer is to be executed. + @param[in] DataLength Specifies the length, in bytes, of the= data to be received. + @param[in] Callback The callback function. This function i= s called if the + asynchronous transfer is completed. + @param[in] Context Data passed into Callback function. Th= is is optional + parameter and may be NULL. + + @retval EFI_SUCCESS The HCI asynchronous receive request i= s submitted successfully. + @retval EFI_INVALID_PARAMETER One or more of the following condition= s is TRUE: + DataLength is 0. + If IsNewTransfer is TRUE, and an asy= nchronous 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 + 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 ); - =20 -/// -/// This protocol abstracts the Bluetooth host controller layer message tr= ansmit and receive. -/// + +// +// The EFI_BLUETOOTH_HC_PROTOCOL is used to transmit or receive HCI layer = data packets. +// struct _EFI_BLUETOOTH_HC_PROTOCOL { + // + // Send HCI command packet. + // EFI_BLUETOOTH_HC_SEND_COMMAND SendCommand; + // + // Receive HCI event packets. + // EFI_BLUETOOTH_HC_RECEIVE_EVENT ReceiveEvent; + // + // Non-blocking receive HCI event packets. + // EFI_BLUETOOTH_HC_ASYNC_RECEIVE_EVENT AsyncReceiveEvent; + // + // Send HCI ACL (asynchronous connection-oriented) data packets. + // EFI_BLUETOOTH_HC_SEND_ACL_DATA SendACLData; + // + // Receive HCI ACL data packets. + // EFI_BLUETOOTH_HC_RECEIVE_ACL_DATA ReceiveACLData; + // + // Non-blocking receive HCI ACL data packets. + // EFI_BLUETOOTH_HC_ASYNC_RECEIVE_ACL_DATA AsyncReceiveACLData; + // + // Send HCI synchronous (SCO and eSCO) data packets. + // EFI_BLUETOOTH_HC_SEND_SCO_DATA SendSCOData; + // + // Receive HCI synchronous data packets. + // EFI_BLUETOOTH_HC_RECEIVE_SCO_DATA ReceiveSCOData; + // + // Non-blocking receive HCI synchronous data packets. + // EFI_BLUETOOTH_HC_ASYNC_RECEIVE_SCO_DATA AsyncReceiveSCOData; }; - =20 + extern EFI_GUID gEfiBluetoothHcProtocolGuid; =20 #endif + --=20 2.12.2.windows.2 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel From nobody Wed May 1 07:16:11 2024 Delivered-To: importer@patchew.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Authentication-Results: mx.zoho.com; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org; Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 1496720161849803.9458214981263; Mon, 5 Jun 2017 20:36:01 -0700 (PDT) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id E44B021959CB7; Mon, 5 Jun 2017 20:34:44 -0700 (PDT) Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id C327721959CA1 for ; Mon, 5 Jun 2017 20:34:43 -0700 (PDT) Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga105.jf.intel.com with ESMTP; 05 Jun 2017 20:35:50 -0700 Received: from ray-dev.ccr.corp.intel.com ([10.239.9.1]) by FMSMGA003.fm.intel.com with ESMTP; 05 Jun 2017 20:35:49 -0700 X-Original-To: edk2-devel@lists.01.org X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.39,304,1493708400"; d="scan'208";a="864937074" From: Ruiyu Ni To: edk2-devel@lists.01.org Date: Tue, 6 Jun 2017 11:35:42 +0800 Message-Id: <20170606033543.254936-5-ruiyu.ni@intel.com> X-Mailer: git-send-email 2.12.2.windows.2 In-Reply-To: <20170606033543.254936-1-ruiyu.ni@intel.com> References: <20170606033543.254936-1-ruiyu.ni@intel.com> Subject: [edk2] [PATCH v2 4/5] MdePkg/BluetoothIo: Formalize function header comments. X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jiewen Yao MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail: RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ruiyu Ni Cc: Jiewen Yao Reviewed-by: Jiewen.yao@intel.com --- MdePkg/Include/Protocol/BluetoothIo.h | 287 +++++++++++++++++-------------= ---- 1 file changed, 144 insertions(+), 143 deletions(-) diff --git a/MdePkg/Include/Protocol/BluetoothIo.h b/MdePkg/Include/Protoco= l/BluetoothIo.h index d750767f09..50d08f18d2 100644 --- a/MdePkg/Include/Protocol/BluetoothIo.h +++ b/MdePkg/Include/Protocol/BluetoothIo.h @@ -1,19 +1,19 @@ /** @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 Blue= tooth IO Protocol drivers to=20 + The EFI Bluetooth IO Service Binding Protocol is used to locate EFI Blue= tooth IO Protocol drivers to create and destroy child of the driver to communicate with other Bluetoo= th device by using Bluetooth IO protocol. =20 - Copyright (c) 2015, Intel Corporation. All rights reserved.
- This program and the accompanying materials are licensed and made availa= ble under=20 - the terms and conditions of the BSD License that accompanies this distri= bution. =20 + Copyright (c) 2015 - 2017, Intel Corporation. All rights reserved.
+ This program and the accompanying materials are licensed and made availa= ble under + the terms and conditions of the BSD License that accompanies this distri= bution. The full text of the license may be found at - http://opensource.org/licenses/bsd-license.php. = =20 - =20 - THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, = =20 + 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 IMP= LIED. =20 - @par Revision Reference: =20 + @par Revision Reference: This Protocol is introduced in UEFI Specification 2.5 =20 **/ @@ -25,14 +25,14 @@ =20 #define EFI_BLUETOOTH_IO_SERVICE_BINDING_PROTOCOL_GUID \ { \ - 0x388278d3, 0x7b85, 0x42f0, { 0xab, 0xa9, 0xfb, 0x4b, 0xfd, 0x69, 0xf5= , 0xab } \ + 0x388278d3, 0x7b85, 0x42f0, { 0xab, 0xa9, 0xfb, 0x4b, 0xfd, 0x69, 0xf5= , 0xab } \ } - =20 + #define EFI_BLUETOOTH_IO_PROTOCOL_GUID \ { \ - 0x467313de, 0x4e30, 0x43f1, { 0x94, 0x3e, 0x32, 0x3f, 0x89, 0x84, 0x5d= , 0xb5 } \ + 0x467313de, 0x4e30, 0x43f1, { 0x94, 0x3e, 0x32, 0x3f, 0x89, 0x84, 0x5d= , 0xb5 } \ } - =20 + typedef struct _EFI_BLUETOOTH_IO_PROTOCOL EFI_BLUETOOTH_IO_PROTOCOL; =20 /// @@ -72,51 +72,51 @@ typedef struct { /** Get Bluetooth device information. =20 - @param This Pointer to the EFI_BLUETOOTH_IO_PROTOCOL instanc= e. - @param DeviceInfoSize A pointer to the size, in bytes, of the DeviceIn= fo buffer. - @param DeviceInfo A pointer to a callee allocated buffer that retu= rns Bluetooth device information. + @param[in] This Pointer to the EFI_BLUETOOTH_IO_PROTOCOL= instance. + @param[out] DeviceInfoSize A pointer to the size, in bytes, of the = DeviceInfo buffer. + @param[out] DeviceInfo A pointer to a callee allocated buffer t= hat returns Bluetooth device information. =20 - @retval EFI_SUCCESS The Bluetooth device information is return= ed successfully. - @retval EFI_DEVICE_ERROR A hardware error occurred trying to retrie= ve the Bluetooth device information. + @retval EFI_SUCCESS The Bluetooth device information is retu= rned successfully. + @retval EFI_DEVICE_ERROR A hardware error occurred trying to retr= ieve the Bluetooth device information. =20 **/ -typedef=20 +typedef EFI_STATUS (EFIAPI *EFI_BLUETOOTH_IO_GET_DEVICE_INFO)( - IN EFI_BLUETOOTH_IO_PROTOCOL *This, - OUT UINTN *DeviceInfoSize, - OUT VOID **DeviceInfo + IN EFI_BLUETOOTH_IO_PROTOCOL *This, + OUT UINTN *DeviceInfoSize, + OUT VOID **DeviceInfo ); - =20 + /** Get Bluetooth SDP information. =20 - @param This Pointer to the EFI_BLUETOOTH_IO_PROTOCOL instanc= e. - @param SdpInfoSize A pointer to the size, in bytes, of the SdpInfo = buffer. - @param SdpInfo A pointer to a callee allocated buffer that retu= rns Bluetooth SDP information. + @param[in] This Pointer to the EFI_BLUETOOTH_IO_PROTOCOL= instance. + @param[out] SdpInfoSize A pointer to the size, in bytes, of the = SdpInfo buffer. + @param[out] SdpInfo A pointer to a callee allocated buffer t= hat returns Bluetooth SDP information. =20 - @retval EFI_SUCCESS The Bluetooth device information is return= ed successfully. - @retval EFI_DEVICE_ERROR A hardware error occurred trying to retrie= ve the Bluetooth SDP information. + @retval EFI_SUCCESS The Bluetooth device information is retu= rned successfully. + @retval EFI_DEVICE_ERROR A hardware error occurred trying to retr= ieve the Bluetooth SDP information. =20 **/ -typedef=20 +typedef EFI_STATUS (EFIAPI *EFI_BLUETOOTH_IO_GET_SDP_INFO)( - IN EFI_BLUETOOTH_IO_PROTOCOL *This, - OUT UINTN *SdpInfoSize, - OUT VOID **SdpInfo + IN EFI_BLUETOOTH_IO_PROTOCOL *This, + OUT UINTN *SdpInfoSize, + OUT VOID **SdpInfo ); - =20 + /** Send L2CAP message (including L2CAP header). =20 - @param This Pointer to the EFI_BLUETOOTH_IO_PROTOCOL instanc= e. - @param BufferSize On input, indicates the size, in bytes, of the d= ata buffer specified by Buffer.=20 - On output, indicates the amount of data actually= transferred. - @param Buffer A pointer to the buffer of data that will be tra= nsmitted to Bluetooth L2CAP layer. - @param Timeout Indicating the transfer should be completed with= in this time frame. The units are in=20 - milliseconds. If Timeout is 0, then the caller m= ust wait for the function to be completed=20 - until EFI_SUCCESS or EFI_DEVICE_ERROR is returne= d. + @param[in] This Pointer to the EFI_BLUETOOTH_IO_PROTOCOL= instance. + @param[in, out] 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[in] Buffer A pointer to the buffer of data that wil= l be transmitted to Bluetooth L2CAP layer. + @param[in] Timeout Indicating the transfer should be comple= ted 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. =20 @retval EFI_SUCCESS The L2CAP message is sent successfully. @retval EFI_INVALID_PARAMETER One or more of the following conditions = is TRUE: @@ -127,25 +127,25 @@ EFI_STATUS @retval EFI_DEVICE_ERROR Sending L2CAP message fail due to host c= ontroller or device error. =20 **/ -typedef=20 +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 + IN EFI_BLUETOOTH_IO_PROTOCOL *This, + IN OUT UINTN *BufferSize, + IN VOID *Buffer, + IN UINTN Timeout ); - =20 + /** Receive L2CAP message (including L2CAP header). =20 - @param This Pointer to the EFI_BLUETOOTH_IO_PROTOCOL instanc= e. - @param BufferSize On input, indicates the size, in bytes, of the d= ata buffer specified by Buffer.=20 - On output, indicates the amount of data actually= transferred. - @param Buffer A pointer to the buffer of data that will be rec= eived from Bluetooth L2CAP layer. - @param Timeout Indicating the transfer should be completed with= in this time frame. The units are in=20 - milliseconds. If Timeout is 0, then the caller m= ust wait for the function to be completed=20 - until EFI_SUCCESS or EFI_DEVICE_ERROR is returne= d. + @param[in] This Pointer to the EFI_BLUETOOTH_IO_PROTOCOL= instance. + @param[in] 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[out] Buffer A pointer to the buffer of data that wil= l be received from Bluetooth L2CAP layer. + @param[in] Timeout Indicating the transfer should be comple= ted 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. =20 @retval EFI_SUCCESS The L2CAP message is received successful= ly. @retval EFI_INVALID_PARAMETER One or more of the following conditions = is TRUE: @@ -156,7 +156,7 @@ EFI_STATUS @retval EFI_DEVICE_ERROR Receiving L2CAP message fail due to host= controller or device error. =20 **/ -typedef=20 +typedef EFI_STATUS (EFIAPI *EFI_BLUETOOTH_IO_L2CAP_RAW_RECEIVE)( IN EFI_BLUETOOTH_IO_PROTOCOL *This, @@ -164,16 +164,16 @@ EFI_STATUS OUT VOID *Buffer, IN UINTN Timeout ); - =20 + /** Callback function, it is called when asynchronous transfer is completed. =20 - @param ChannelID Bluetooth L2CAP message channel ID. - @param Data Data received via asynchronous transfer. - @param DataLength The length of Data in bytes, received via asyn= chronous transfer. - @param Context Context passed from asynchronous transfer requ= est. + @param[in] ChannelID Bluetooth L2CAP message channel ID. + @param[in] Data Data received via asynchronous transfer. + @param[in] DataLength The length of Data in bytes, received via = asynchronous transfer. + @param[in] Context Context passed from asynchronous transfer = request. =20 - @retval EFI_SUCCESS The callback function complete successfully. + @retval EFI_SUCCESS The callback function complete successfull= y. =20 **/ typedef @@ -184,25 +184,25 @@ EFI_STATUS IN UINTN DataLength, IN VOID *Context ); - =20 + /** Receive L2CAP message (including L2CAP header) in non-blocking way. =20 - @param This Pointer to the EFI_BLUETOOTH_IO_PROTOCOL instanc= e. - @param IsNewTransfer If TRUE, a new transfer will be submitted. If FA= LSE, the request is deleted. - @param PollingInterval Indicates the periodic rate, in milliseconds, th= at the transfer is to be executed. - @param DataLength Specifies the length, in bytes, of the data to b= e received. - @param Callback The callback function. This function is called i= f the asynchronous transfer is=20 - completed. - @param Context Data passed into Callback function. This is opti= onal parameter and may be NULL.=20 - =20 + @param[in] This Pointer to the EFI_BLUETOOTH_IO_PROTOCOL= instance. + @param[in] IsNewTransfer If TRUE, a new transfer will be submitte= d. If FALSE, the request is deleted. + @param[in] PollingInterval Indicates the periodic rate, in millisec= onds, that the transfer is to be executed. + @param[in] DataLength Specifies the length, in bytes, of the d= ata to be received. + @param[in] Callback The callback function. This function is = called if the asynchronous transfer is + completed. + @param[in] Context Data passed into Callback function. This= is optional parameter and may be NULL. + @retval EFI_SUCCESS The L2CAP asynchronous receive request i= s submitted successfully. @retval EFI_INVALID_PARAMETER One or more of the following conditions = is TRUE: - DataLength is 0. - If IsNewTransfer is TRUE, and an async= hronous receive request already exists. =20 **/ -typedef=20 +typedef EFI_STATUS (EFIAPI *EFI_BLUETOOTH_IO_L2CAP_RAW_ASYNC_RECEIVE)( IN EFI_BLUETOOTH_IO_PROTOCOL *This, @@ -216,14 +216,14 @@ EFI_STATUS /** Send L2CAP message (excluding L2CAP header) to a specific channel. =20 - @param This Pointer to the EFI_BLUETOOTH_IO_PROTOCOL instanc= e. - @param Handle A handle created by EFI_BLUETOOTH_IO_PROTOCOL.L2= CapConnect indicates which channel to send. - @param BufferSize On input, indicates the size, in bytes, of the d= ata buffer specified by Buffer.=20 - On output, indicates the amount of data actually= transferred. - @param Buffer A pointer to the buffer of data that will be tra= nsmitted to Bluetooth L2CAP layer. - @param Timeout Indicating the transfer should be completed with= in this time frame. The units are in=20 - milliseconds. If Timeout is 0, then the caller m= ust wait for the function to be completed=20 - until EFI_SUCCESS or EFI_DEVICE_ERROR is returne= d. + @param[in] This Pointer to the EFI_BLUETOOTH_IO_PROTOCOL= instance. + @param[in] Handle A handle created by EFI_BLUETOOTH_IO_PRO= TOCOL.L2CapConnect indicates which channel to send. + @param[in, out] 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[in] Buffer A pointer to the buffer of data that wil= l be transmitted to Bluetooth L2CAP layer. + @param[in] Timeout Indicating the transfer should be comple= ted 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. =20 @retval EFI_SUCCESS The L2CAP message is sent successfully. @retval EFI_NOT_FOUND Handle is invalid or not found. @@ -235,26 +235,26 @@ EFI_STATUS @retval EFI_DEVICE_ERROR Sending L2CAP message fail due to host c= ontroller or device error. =20 **/ -typedef=20 +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 + IN EFI_BLUETOOTH_IO_PROTOCOL *This, + IN EFI_HANDLE Handle, + IN OUT UINTN *BufferSize, + IN VOID *Buffer, + IN UINTN Timeout ); - =20 + /** Receive L2CAP message (excluding L2CAP header) from a specific channel. =20 - @param This Pointer to the EFI_BLUETOOTH_IO_PROTOCOL instanc= e. - @param Handle A handle created by EFI_BLUETOOTH_IO_PROTOCOL.L2= CapConnect 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 rec= eived from Bluetooth L2CAP layer. - @param Timeout Indicating the transfer should be completed with= in this time frame. The units are in=20 - milliseconds. If Timeout is 0, then the caller m= ust wait for the function to be completed=20 - until EFI_SUCCESS or EFI_DEVICE_ERROR is returne= d. + @param[in] This Pointer to the EFI_BLUETOOTH_IO_PROTOCOL= instance. + @param[in] Handle A handle created by EFI_BLUETOOTH_IO_PRO= TOCOL.L2CapConnect indicates which channel to receive. + @param[out] BufferSize Indicates the size, in bytes, of the dat= a buffer specified by Buffer. + @param[out] Buffer A pointer to the buffer of data that wil= l be received from Bluetooth L2CAP layer. + @param[in] Timeout Indicating the transfer should be comple= ted 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. =20 @retval EFI_SUCCESS The L2CAP message is received successful= ly. @retval EFI_NOT_FOUND Handle is invalid or not found. @@ -266,22 +266,22 @@ EFI_STATUS @retval EFI_DEVICE_ERROR Receiving L2CAP message fail due to host= controller or device error. =20 **/ -typedef=20 +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 + IN EFI_BLUETOOTH_IO_PROTOCOL *This, + IN EFI_HANDLE Handle, + OUT UINTN *BufferSize, + OUT VOID **Buffer, + IN UINTN Timeout ); - =20 + /** Callback function, it is called when asynchronous transfer is completed. =20 - @param Data Data received via asynchronous transfer. - @param DataLength The length of Data in bytes, received via asyn= chronous transfer. - @param Context Context passed from asynchronous transfer requ= est. + @param[in] Data Data received via asynchronous transfer. + @param[in] DataLength The length of Data in bytes, received vi= a asynchronous transfer. + @param[in] Context Context passed from asynchronous transfe= r request. =20 @retval EFI_SUCCESS The callback function complete successfully. =20 @@ -289,20 +289,21 @@ EFI_STATUS typedef EFI_STATUS (EFIAPI *EFI_BLUETOOTH_IO_CHANNEL_SERVICE_CALLBACK) ( - IN VOID *Data, - IN UINTN DataLength, - IN VOID *Context + IN VOID *Data, + IN UINTN DataLength, + IN VOID *Context ); - =20 + /** Receive L2CAP message (excluding L2CAP header) in non-blocking way from = a specific channel. =20 - @param This Pointer to the EFI_BLUETOOTH_IO_PROTOCOL instanc= e. - @param Handel A handle created by EFI_BLUETOOTH_IO_PROTOCOL.L2= CapConnect indicates which channel to receive. - @param Callback The callback function. This function is called i= f the asynchronous transfer is=20 - completed. - @param Context Data passed into Callback function. This is opti= onal parameter and may be NULL.=20 - =20 + @param[in] This Pointer to the EFI_BLUETOOTH_IO_PROTOCOL= instance. + @param[in] Handel A handle created by EFI_BLUETOOTH_IO_PRO= TOCOL.L2CapConnect indicates which channel + to receive. + @param[in] Callback The callback function. This function is = called if the asynchronous transfer is + completed. + @param[in] Context Data passed into Callback function. This= is optional parameter and may be NULL. + @retval EFI_SUCCESS The L2CAP asynchronous receive request i= s 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: @@ -310,33 +311,33 @@ EFI_STATUS - If an asynchronous receive request alr= eady exists on same Handle. =20 **/ -typedef=20 +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 + IN EFI_BLUETOOTH_IO_PROTOCOL *This, + IN EFI_HANDLE Handle, + IN EFI_BLUETOOTH_IO_CHANNEL_SERVICE_CALLBACK Callback, + IN VOID* Context ); - =20 + /** Do L2CAP connection. =20 - @param This Pointer to the EFI_BLUETOOTH_IO_PROTOCOL instanc= e. - @param Handel A handle to indicate this L2CAP connection. - @param Psm Bluetooth PSM. See Bluetooth specification for d= etail. - @param Mtu Bluetooth MTU. See Bluetooth specification for d= etail. - @param Callback The callback function. This function is called w= henever there is message received=20 - in this channel. - @param Context Data passed into Callback function. This is opti= onal parameter and may be NULL. - =20 + @param[in] This Pointer to the EFI_BLUETOOTH_IO_PROTOCOL= instance. + @param[out] Handel A handle to indicate this L2CAP connecti= on. + @param[in] Psm Bluetooth PSM. See Bluetooth specificati= on for detail. + @param[in] Mtu Bluetooth MTU. See Bluetooth specificati= on for detail. + @param[in] Callback The callback function. This function is = called whenever there is message received + in this channel. + @param[in] 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 B= luetooth L2CAP connection. =20 **/ -typedef=20 +typedef EFI_STATUS (EFIAPI *EFI_BLUETOOTH_IO_L2CAP_CONNECT)( IN EFI_BLUETOOTH_IO_PROTOCOL *This, @@ -346,42 +347,42 @@ EFI_STATUS IN EFI_BLUETOOTH_IO_CHANNEL_SERVICE_CALLBACK Callback, IN VOID *Context ); - =20 + /** Do L2CAP disconnection. =20 - @param This Pointer to the EFI_BLUETOOTH_IO_PROTOCOL instanc= e. - @param Handel A handle to indicate this L2CAP connection. - =20 + @param[in] This Pointer to the EFI_BLUETOOTH_IO_PROTOCOL= instance. + @param[in] Handel A handle to indicate this L2CAP connecti= on. + @retval EFI_SUCCESS The Bluetooth L2CAP layer is disconnecte= d successfully. @retval EFI_NOT_FOUND Handle is invalid or not found. @retval EFI_DEVICE_ERROR A hardware error occurred trying to do B= luetooth L2CAP disconnection. =20 **/ -typedef=20 +typedef EFI_STATUS (EFIAPI *EFI_BLUETOOTH_IO_L2CAP_DISCONNECT)( IN EFI_BLUETOOTH_IO_PROTOCOL *This, IN EFI_HANDLE Handle ); - =20 + /** Register L2CAP callback function for special channel. =20 - @param This Pointer to the EFI_BLUETOOTH_IO_PROTOCOL instanc= e. - @param Handel A handle to indicate this L2CAP connection. - @param Psm Bluetooth PSM. See Bluetooth specification for d= etail. - @param Mtu Bluetooth MTU. See Bluetooth specification for d= etail. - @param Callback The callback function. This function is called w= henever there is message received=20 - in this channel. NULL means unregister. - @param Context Data passed into Callback function. This is opti= onal parameter and may be NULL. - =20 + @param[in] This Pointer to the EFI_BLUETOOTH_IO_PROTOCOL= instance. + @param[out] Handel A handle to indicate this L2CAP connecti= on. + @param[in] Psm Bluetooth PSM. See Bluetooth specificati= on for detail. + @param[in] Mtu Bluetooth MTU. See Bluetooth specificati= on for detail. + @param[in] Callback The callback function. This function is = called whenever there is message received + in this channel. NULL means unregister. + @param[in] 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 whe= n register. @retval EFI_NOT_FOUND The callback function does not exist whe= n unregister. =20 **/ -typedef=20 +typedef EFI_STATUS (EFIAPI *EFI_BLUETOOTH_IO_L2CAP_REGISTER_SERVICE)( IN EFI_BLUETOOTH_IO_PROTOCOL *This, @@ -391,9 +392,9 @@ EFI_STATUS IN EFI_BLUETOOTH_IO_CHANNEL_SERVICE_CALLBACK Callback, IN VOID *Context ); - =20 + /// -/// This protocol provides service for Bluetooth L2CAP (Logical Link Contr= ol and Adaptation Protocol)=20 +/// This protocol provides service for Bluetooth L2CAP (Logical Link Contr= ol and Adaptation Protocol) /// and SDP (Service Discovery Protocol). /// struct _EFI_BLUETOOTH_IO_PROTOCOL { --=20 2.12.2.windows.2 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel From nobody Wed May 1 07:16:11 2024 Delivered-To: importer@patchew.org Received-SPF: none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) client-ip=198.145.21.10; envelope-from=edk2-devel-bounces@lists.01.org; helo=ml01.01.org; Authentication-Results: mx.zoho.com; spf=none (zoho.com: 198.145.21.10 is neither permitted nor denied by domain of lists.01.org) smtp.mailfrom=edk2-devel-bounces@lists.01.org; Return-Path: Received: from ml01.01.org (ml01.01.org [198.145.21.10]) by mx.zohomail.com with SMTPS id 1496720164964968.9640745865465; Mon, 5 Jun 2017 20:36:04 -0700 (PDT) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 2A87321AE30D0; Mon, 5 Jun 2017 20:34:47 -0700 (PDT) Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 2F54321959CB0 for ; Mon, 5 Jun 2017 20:34:45 -0700 (PDT) Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga105.jf.intel.com with ESMTP; 05 Jun 2017 20:35:51 -0700 Received: from ray-dev.ccr.corp.intel.com ([10.239.9.1]) by FMSMGA003.fm.intel.com with ESMTP; 05 Jun 2017 20:35:50 -0700 X-Original-To: edk2-devel@lists.01.org X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.39,304,1493708400"; d="scan'208";a="864937083" From: Ruiyu Ni To: edk2-devel@lists.01.org Date: Tue, 6 Jun 2017 11:35:43 +0800 Message-Id: <20170606033543.254936-6-ruiyu.ni@intel.com> X-Mailer: git-send-email 2.12.2.windows.2 In-Reply-To: <20170606033543.254936-1-ruiyu.ni@intel.com> References: <20170606033543.254936-1-ruiyu.ni@intel.com> Subject: [edk2] [PATCH v2 5/5] MdePkg: Add BluetoothAttribute.h and BluetoothLeConfig.h X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Jiewen Yao MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" X-ZohoMail: RSF_4 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" UEFI Spec 2.7 introduces BluetoothAttribute and BluetoothLeConfig protocols. The patch adds the definitions for them. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ruiyu Ni Cc: Jiewen Yao Reviewed-by: Jiewen.yao@intel.com --- MdePkg/Include/Protocol/BluetoothAttribute.h | 283 ++++++++++++ MdePkg/Include/Protocol/BluetoothLeConfig.h | 634 +++++++++++++++++++++++= ++++ MdePkg/MdePkg.dec | 10 + 3 files changed, 927 insertions(+) create mode 100644 MdePkg/Include/Protocol/BluetoothAttribute.h create mode 100644 MdePkg/Include/Protocol/BluetoothLeConfig.h diff --git a/MdePkg/Include/Protocol/BluetoothAttribute.h b/MdePkg/Include/= Protocol/BluetoothAttribute.h new file mode 100644 index 0000000000..f168422cf0 --- /dev/null +++ b/MdePkg/Include/Protocol/BluetoothAttribute.h @@ -0,0 +1,283 @@ +/** @file + EFI Bluetooth Attribute Protocol as defined in UEFI 2.7. + This protocol provides service for Bluetooth ATT (Attribute Protocol) an= d GATT (Generic + Attribute Profile) based protocol interfaces. + + Copyright (c) 2017, Intel Corporation. All rights reserved.
+ This program and the accompanying materials are licensed and made availa= ble under + the terms and conditions of the BSD License that accompanies this distri= bution. + 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 IMP= LIED. + + @par Revision Reference: + This Protocol is introduced in UEFI Specification 2.7 + +**/ + +#ifndef __EFI_BLUETOOTH_ATTRIBUTE_H__ +#define __EFI_BLUETOOTH_ATTRIBUTE_H__ + +#define EFI_BLUETOOTH_ATTRIBUTE_SERVICE_BINDING_PROTOCOL_GUID \ + { \ + 0x5639867a, 0x8c8e, 0x408d, { 0xac, 0x2f, 0x4b, 0x61, 0xbd, 0xc0, 0xbb= , 0xbb } \ + } + +#define EFI_BLUETOOTH_ATTRIBUTE_PROTOCOL_GUID \ + { \ + 0x898890e9, 0x84b2, 0x4f3a, { 0x8c, 0x58, 0xd8, 0x57, 0x78, 0x13, 0xe0= , 0xac } \ + } + +typedef struct _EFI_BLUETOOTH_ATTRIBUTE_PROTOCOL EFI_BLUETOOTH_ATTRIBUTE_P= ROTOCOL; + +#pragma pack(1) + +// +// Bluetooth UUID +// +typedef struct { + UINT8 Length; + union { + UINT16 Uuid16; + UINT32 Uuid32; + UINT8 Uuid128[16]; + } Data; +} EFI_BLUETOOTH_UUID; + + +#define UUID_16BIT_TYPE_LEN 2 +#define UUID_32BIT_TYPE_LEN 4 +#define UUID_128BIT_TYPE_LEN 16 + +#define BLUETOOTH_IS_ATTRIBUTE_OF_TYPE(a,t) ((a)->Type.Length =3D=3D UUID_= 16BIT_TYPE_LEN && (a)->Type.Data.Uuid16 =3D=3D (t)) + +// +// Bluetooth Attribute Permission +// +typedef union { + struct { + UINT16 Readable : 1; + UINT16 ReadEncryption : 1; + UINT16 ReadAuthentication : 1; + UINT16 ReadAuthorization : 1; + UINT16 ReadKeySize : 5; + UINT16 Reserved1 : 7; + UINT16 Writeable : 1; + UINT16 WriteEncryption : 1; + UINT16 WriteAuthentication : 1; + UINT16 WriteAuthorization : 1; + UINT16 WriteKeySize : 5; + UINT16 Reserved2 : 7; + } Permission; + UINT32 Data32; +} EFI_BLUETOOTH_ATTRIBUTE_PERMISSION; + +typedef struct { + EFI_BLUETOOTH_UUID Type; + UINT16 Length; + UINT16 AttributeHandle; + EFI_BLUETOOTH_ATTRIBUTE_PERMISSION AttributePermission; +} EFI_BLUETOOTH_ATTRIBUTE_HEADER; + +typedef struct { + EFI_BLUETOOTH_ATTRIBUTE_HEADER Header; + UINT16 EndGroupHandle; + EFI_BLUETOOTH_UUID ServiceUuid; +} EFI_BLUETOOTH_GATT_PRIMARY_SERVICE_INFO; + +typedef struct { + EFI_BLUETOOTH_ATTRIBUTE_HEADER Header; + UINT16 StartGroupHandle; + UINT16 EndGroupHandle; + EFI_BLUETOOTH_UUID ServiceUuid; +} EFI_BLUETOOTH_GATT_INCLUDE_SERVICE_INFO; + +typedef struct { + EFI_BLUETOOTH_ATTRIBUTE_HEADER Header; + UINT8 CharacteristicProperties; + UINT16 CharacteristicValueHandle; + EFI_BLUETOOTH_UUID CharacteristicUuid; +} EFI_BLUETOOTH_GATT_CHARACTERISTIC_INFO; + +typedef struct { + EFI_BLUETOOTH_ATTRIBUTE_HEADER Header; + EFI_BLUETOOTH_UUID CharacteristicDescriptorUuid; +} EFI_BLUETOOTH_GATT_CHARACTERISTIC_DESCRIPTOR_INFO; + +#pragma pack() + +typedef struct { + UINT16 AttributeHandle; +} EFI_BLUETOOTH_ATTRIBUTE_CALLBACK_PARAMETER_NOTIFICATION; + +typedef struct { + UINT16 AttributeHandle; +} EFI_BLUETOOTH_ATTRIBUTE_CALLBACK_PARAMETER_INDICATION; + +typedef struct { + UINT32 Version; + UINT8 AttributeOpCo= de; + union { + EFI_BLUETOOTH_ATTRIBUTE_CALLBACK_PARAMETER_NOTIFICATION Notification; + EFI_BLUETOOTH_ATTRIBUTE_CALLBACK_PARAMETER_INDICATION Indication; + } Parameter; +} EFI_BLUETOOTH_ATTRIBUTE_CALLBACK_PARAMETER; + +typedef struct { + UINT32 Version; + BLUETOOTH_LE_ADDRESS BD_ADDR; + BLUETOOTH_LE_ADDRESS DirectAddress; + UINT8 RSSI; + UINTN AdvertisementDataSize; + VOID *AdvertisementData; +} EFI_BLUETOOTH_LE_DEVICE_INFO; + +/** + The callback function to send request. + + @param[in] This Pointer to the EFI_BLUETOOTH_ATTRIBUTE_P= ROTOCOL instance. + @param[in] Data Data received. The first byte is the att= ribute opcode, followed by opcode specific + fields. See Bluetooth specification, Vol= 3, Part F, Attribute Protocol. It might be a + normal RESPONSE message, or ERROR RESPON= SE messag + @param[in] DataLength The length of Data in bytes. + @param[in] Context The context passed from the callback reg= istration request. + + @retval EFI_SUCCESS The callback function complete successfully. + +**/ +typedef +EFI_STATUS +(EFIAPI *EFI_BLUETOOTH_ATTRIBUTE_CALLBACK_FUNCTION) ( + IN EFI_BLUETOOTH_ATTRIBUTE_PROTOCOL *This, + IN VOID *Data, + IN UINTN DataLength, + IN VOID *Context + ); + +/** + Send a "REQUEST" or "COMMAND" message to remote server and receive a "RE= SPONSE" message + for "REQUEST" from remote server according to Bluetooth attribute protoc= ol data unit(PDU). + + @param[in] This Pointer to the EFI_BLUETOOTH_ATTRIBUTE_PRO= TOCOL instance. + @param[in] Data Data of a REQUEST or COMMAND message. The = first byte is the attribute PDU + related opcode, followed by opcode specifi= c fields. See Bluetooth specification, + Vol 3, Part F, Attribute Protocol. + @param[in] DataLength The length of Data in bytes. + @param[in] Callback Callback function to notify the RESPONSE i= s received to the caller, with the + response buffer. Caller must check the res= ponse buffer content to know if the + request action is success or fail. It may = be NULL if the data is a COMMAND. + @param[in] Context Data passed into Callback function. It is = optional parameter and may be NULL. + + @retval EFI_SUCCESS The request is sent successfully. + @retval EFI_INVALID_PARAMETER One or more parameters are invalid due to = following conditions: + - The Buffer is NULL. + - The BufferLength is 0. + - The opcode in Buffer is not a valid OPCO= DE according to Bluetooth specification. + - The Callback is NULL. + @retval EFI_DEVICE_ERROR Sending the request failed due to the host= controller or the device error. + @retval EFI_NOT_READY A GATT operation is already underway for t= his device. + @retval EFI_UNSUPPORTED The attribute does not support the corresp= onding operation. + +**/ +typedef +EFI_STATUS +(EFIAPI *EFI_BLUETOOTH_ATTRIBUTE_SEND_REQUEST) ( + IN EFI_BLUETOOTH_ATTRIBUTE_PROTOCOL *This, + IN VOID *Data, + IN UINTN DataLength, + IN EFI_BLUETOOTH_ATTRIBUTE_CALLBACK_FUNCTION Callback, + IN VOID *Context + ); + +/** + Register or unregister a server initiated message, such as NOTIFICATION = or INDICATION, on a + characteristic value on remote server. + + @param[in] This Pointer to the EFI_BLUETOOTH_ATTRIBUTE_PRO= TOCOL instance. + @param[in] CallbackParameter The parameter of the callback. + @param[in] Callback Callback function for server initiated att= ribute protocol. NULL callback + function means unregister the server initi= ated callback. + @param[in] Context Data passed into Callback function. It is = optional parameter and may be NULL. + + @retval EFI_SUCCESS The callback function is registered or unr= egistered successfully + @retval EFI_INVALID_PARAMETER The attribute opcode is not server initiat= ed message opcode. See + Bluetooth specification, Vol 3, Part F, At= tribute Protocol. + @retval EFI_ALREADY_STARTED A callback function is already registered = on the same attribute + opcode and attribute handle, when the Call= back is not NULL. + @retval EFI_NOT_STARTED A callback function is not registered on t= he same attribute opcode + and attribute handle, when the Callback is= NULL. + @retval EFI_NOT_READY A GATT operation is already underway for t= his device. + @retval EFI_UNSUPPORTED The attribute does not support notificatio= n. + +**/ +typedef +EFI_STATUS +(EFIAPI *EFI_BLUETOOTH_ATTRIBUTE_REGISTER_FOR_SERVER_NOTIFICATION)( + IN EFI_BLUETOOTH_ATTRIBUTE_PROTOCOL *This, + IN EFI_BLUETOOTH_ATTRIBUTE_CALLBACK_PARAMETER *CallbackParameter, + IN EFI_BLUETOOTH_ATTRIBUTE_CALLBACK_FUNCTION Callback, + IN VOID *Context + ); + +/** + Get Bluetooth discovered service information. + + @param[in] This Pointer to the EFI_BLUETOOTH_ATTRIBUTE_PRO= TOCOL instance. + @param[out] ServiceInfoSize A pointer to the size, in bytes, of the Se= rviceInfo buffer. + @param[out] ServiceInfo A pointer to a callee allocated buffer tha= t returns Bluetooth + discovered service information. Callee all= ocates this buffer by + using EFI Boot Service AllocatePool(). + + @retval EFI_SUCCESS The Bluetooth discovered service informati= on is returned successfully. + @retval EFI_DEVICE_ERROR A hardware error occurred trying to retrie= ve the Bluetooth discovered + service information. + +**/ +typedef +EFI_STATUS +(EFIAPI *EFI_BLUETOOTH_ATTRIBUTE_GET_SERVICE_INFO)( + IN EFI_BLUETOOTH_ATTRIBUTE_PROTOCOL *This, + OUT UINTN *ServiceInfoSize, + OUT VOID **ServiceInfo + ); + +/** + Get Bluetooth device information. + + @param[in] This Pointer to the EFI_BLUETOOTH_ATTRIBUTE_PRO= TOCOL instance. + @param[out] DeviceInfoSize A pointer to the size, in bytes, of the De= viceInfo buffer. + @param[out] DeviceInfo A pointer to a callee allocated buffer tha= t returns Bluetooth + device information. Callee allocates this = buffer by using EFI Boot + Service AllocatePool(). If this device is = Bluetooth classic + device, EFI_BLUETOOTH_DEVICE_INFO should b= e used. If + this device is Bluetooth LE device, EFI_BL= UETOOTH_LE_DEVICE_INFO + should be used. + + @retval EFI_SUCCESS The Bluetooth device information is return= ed successfully. + @retval EFI_DEVICE_ERROR A hardware error occurred trying to retrie= ve the Bluetooth device + information + +**/ +typedef +EFI_STATUS +(EFIAPI *EFI_BLUETOOTH_ATTRIBUTE_GET_DEVICE_INFO)( + IN EFI_BLUETOOTH_ATTRIBUTE_PROTOCOL *This, + OUT UINTN *DeviceInfoSize, + OUT VOID **DeviceInfo + ); + +struct _EFI_BLUETOOTH_ATTRIBUTE_PROTOCOL { + EFI_BLUETOOTH_ATTRIBUTE_SEND_REQUEST SendRequest; + EFI_BLUETOOTH_ATTRIBUTE_REGISTER_FOR_SERVER_NOTIFICATION RegisterForServ= erNotification; + EFI_BLUETOOTH_ATTRIBUTE_GET_SERVICE_INFO GetServiceInfo; + EFI_BLUETOOTH_ATTRIBUTE_GET_DEVICE_INFO GetDeviceInfo; +}; + + +extern EFI_GUID gEfiBluetoothAttributeProtocolGuid; +extern EFI_GUID gEfiBluetoothAttributeServiceBindingProtocolGuid; + +#endif + diff --git a/MdePkg/Include/Protocol/BluetoothLeConfig.h b/MdePkg/Include/P= rotocol/BluetoothLeConfig.h new file mode 100644 index 0000000000..92d4fc2667 --- /dev/null +++ b/MdePkg/Include/Protocol/BluetoothLeConfig.h @@ -0,0 +1,634 @@ +/** @file + EFI Bluetooth LE Config Protocol as defined in UEFI 2.7. + This protocol abstracts user interface configuration for BluetoothLe dev= ice. + + Copyright (c) 2017, Intel Corporation. All rights reserved.
+ This program and the accompanying materials are licensed and made availa= ble under + the terms and conditions of the BSD License that accompanies this distri= bution. + 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 IMP= LIED. + + @par Revision Reference: + This Protocol is introduced in UEFI Specification 2.7 + +**/ + +#ifndef __EFI_BLUETOOTH_LE_CONFIG_H__ +#define __EFI_BLUETOOTH_LE_CONFIG_H__ + +#include +#include + +#define EFI_BLUETOOTH_LE_CONFIG_PROTOCOL_GUID \ + { \ + 0x8f76da58, 0x1f99, 0x4275, { 0xa4, 0xec, 0x47, 0x56, 0x51, 0x5b, 0x1c= , 0xe8 } \ + } + +typedef struct _EFI_BLUETOOTH_LE_CONFIG_PROTOCOL EFI_BLUETOOTH_LE_CONFIG_P= ROTOCOL; + +/** + Initialize BluetoothLE host controller and local device. + + The Init() function initializes BluetoothLE host controller and local de= vice. + + @param[in] This Pointer to the EFI_BLUETOOTH_LE_CONFIG_PRO= TOCOL instance. + + @retval EFI_SUCCESS The BluetoothLE host controller and local = device is initialized successfully. + @retval EFI_DEVICE_ERROR A hardware error occurred trying to initia= lize the BluetoothLE host controller + and local device. + +**/ +typedef +EFI_STATUS +(EFIAPI *EFI_BLUETOOTH_LE_CONFIG_INIT)( + IN EFI_BLUETOOTH_LE_CONFIG_PROTOCOL *This + ); + +typedef struct { + /// + /// The version of the structure. A value of zero represents the EFI_BLU= ETOOTH_LE_CONFIG_SCAN_PARAMETER + /// structure as defined here. Future version of this specification may = extend this data structure in a + /// backward compatible way and increase the value of Version. + /// + UINT32 Version; + /// + /// Passive scanning or active scanning. See Bluetooth specification. + /// + UINT8 ScanType; + /// + /// Recommended scan interval to be used while performing scan. + /// + UINT16 ScanInterval; + /// + /// Recommended scan window to be used while performing a scan. + /// + UINT16 ScanWindow; + /// + /// Recommended scanning filter policy to be used while performing a sca= n. + /// + UINT8 ScanningFilterPolicy; + /// + /// This is one byte flag to serve as a filter to remove unneeded scan + /// result. For example, set BIT0 means scan in LE Limited Discoverable + /// Mode. Set BIT1 means scan in LE General Discoverable Mode. + /// + UINT8 AdvertisementFlagFilter; +} EFI_BLUETOOTH_LE_CONFIG_SCAN_PARAMETER; + +typedef struct{ + BLUETOOTH_LE_ADDRESS BDAddr; + BLUETOOTH_LE_ADDRESS DirectAddress; + UINT8 RemoteDeviceState; + INT8 RSSI; + UINTN AdvertisementDataSize; + VOID *AdvertisementData; +} EFI_BLUETOOTH_LE_SCAN_CALLBACK_INFORMATION; + +/** + Callback function, it is called if a BluetoothLE device is found during = scan process. + + @param[in] This Pointer to the EFI_BLUETOOTH_LE_CONFIG_PROTO= COL instance. + @param[in] Context Context passed from scan request. + @param[in] CallbackInfo Data related to scan result. NULL CallbackIn= fo means scan complete. + + @retval EFI_SUCCESS The callback function complete successfully. + +**/ +typedef +EFI_STATUS +(EFIAPI *EFI_BLUETOOTH_LE_CONFIG_SCAN_CALLBACK_FUNCTION) ( + IN EFI_BLUETOOTH_LE_CONFIG_PROTOCOL *This, + IN VOID *Context, + IN EFI_BLUETOOTH_LE_SCAN_CALLBACK_INFORMATION *CallbackInfo + ); + +/** + Scan BluetoothLE device. + + The Scan() function scans BluetoothLE device. When this function is retu= rned, it just means scan + request is submitted. It does not mean scan process is started or finish= ed. Whenever there is a + BluetoothLE device is found, the Callback function will be called. Callb= ack function might be + called before this function returns or after this function returns + + @param[in] This Pointer to the EFI_BLUETOOTH_LE_CONFIG_PRO= TOCOL instance. + @param[in] ReScan If TRUE, a new scan request is submitted n= o matter there is scan result before. + If FALSE and there is scan result, the pre= vious scan result is returned and no scan request + is submitted. + @param[in] Timeout Duration in milliseconds for which to scan. + @param[in] ScanParameter If it is not NULL, the ScanParameter is us= ed to perform a scan by the BluetoothLE bus driver. + If it is NULL, the default parameter is us= ed. + @param[in] Callback The callback function. This function is ca= lled if a BluetoothLE device is found during + scan process. + @param[in] Context Data passed into Callback function. This i= s 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 t= he BluetoothLE device. + +**/ +typedef +EFI_STATUS +(EFIAPI *EFI_BLUETOOTH_LE_CONFIG_SCAN)( + IN EFI_BLUETOOTH_LE_CONFIG_PROTOCOL *This, + IN BOOLEAN ReScan, + IN UINT32 Timeout, + IN EFI_BLUETOOTH_LE_CONFIG_SCAN_PARAMETER *ScanParameter, OPTIO= NAL + IN EFI_BLUETOOTH_LE_CONFIG_SCAN_CALLBACK_FUNCTION Callback, + IN VOID *Context + ); + +typedef struct { + /// + /// The version of the structure. A value of zero represents the + /// EFI_BLUETOOTH_LE_CONFIG_CONNECT_PARAMETER + /// structure as defined here. Future version of this specification may + /// extend this data structure in a backward compatible way and + /// increase the value of Version. + /// + UINT32 Version; + /// + /// Recommended scan interval to be used while performing scan before co= nnect. + /// + UINT16 ScanInterval; + /// + /// Recommended scan window to be used while performing a connection + /// + UINT16 ScanWindow; + /// + /// Minimum allowed connection interval. Shall be less than or equal to = ConnIntervalMax. + /// + UINT16 ConnIntervalMin; + /// + /// Maximum allowed connection interval. Shall be greater than or equal = to ConnIntervalMin. + /// + UINT16 ConnIntervalMax; + /// + /// Slave latency for the connection in number of connection events. + /// + UINT16 ConnLatency; + /// + /// Link supervision timeout for the connection. + /// + UINT16 SupervisionTimeout; +} EFI_BLUETOOTH_LE_CONFIG_CONNECT_PARAMETER; + +/** + Connect a BluetoothLE device. + + The Connect() function connects a Bluetooth device. When this function i= s returned successfully, + a new EFI_BLUETOOTH_IO_PROTOCOL is created. + + @param[in] This Pointer to the EFI_BLUETOOTH_LE_CONFIG_PRO= TOCOL instance. + @param[in] AutoReconnect If TRUE, the BluetoothLE host controller n= eeds to do an auto + reconnect. If FALSE, the BluetoothLE host = controller does not do + an auto reconnect. + @param[in] DoBonding If TRUE, the BluetoothLE host controller n= eeds to do a bonding. + If FALSE, the BluetoothLE host controller = does not do a bonding. + @param[in] ConnectParameter If it is not NULL, the ConnectParameter is= used to perform a + scan by the BluetoothLE bus driver. If it = is NULL, the default + parameter is used. + @param[in] BD_ADDR The address of the BluetoothLE device to b= e connected. + + @retval EFI_SUCCESS The BluetoothLE device is connected succes= sfully. + @retval EFI_ALREADY_STARTED The BluetoothLE device is already connecte= d. + @retval EFI_NOT_FOUND The BluetoothLE device is not found. + @retval EFI_DEVICE_ERROR A hardware error occurred trying to connec= t the BluetoothLE device. + +**/ +typedef +EFI_STATUS +(EFIAPI *EFI_BLUETOOTH_LE_CONFIG_CONNECT)( + IN EFI_BLUETOOTH_LE_CONFIG_PROTOCOL *This, + IN BOOLEAN AutoReconnect, + IN BOOLEAN DoBonding, + IN EFI_BLUETOOTH_LE_CONFIG_CONNECT_PARAMETER *ConnectParameter, OPTIO= NAL + IN BLUETOOTH_LE_ADDRESS *BD_ADDR + ); + +/** + Disconnect a BluetoothLE device. + + The Disconnect() function disconnects a BluetoothLE device. When this fu= nction is returned + successfully, the EFI_BLUETOOTH_ATTRIBUTE_PROTOCOL associated with this = device is + destroyed and all services associated are stopped. + + @param[in] This Pointer to the EFI_BLUETOOTH_LE_CONFIG_PROTOCO= L instance. + @param[in] BD_ADDR The address of BluetoothLE device to be connec= ted. + @param[in] Reason Bluetooth disconnect reason. See Bluetooth spe= cification for detail. + + @retval EFI_SUCCESS The BluetoothLE device is disconnected suc= cessfully. + @retval EFI_NOT_STARTED The BluetoothLE device is not connected. + @retval EFI_NOT_FOUND The BluetoothLE device is not found. + @retval EFI_DEVICE_ERROR A hardware error occurred trying to discon= nect the BluetoothLE device. + +**/ +typedef +EFI_STATUS +(EFIAPI *EFI_BLUETOOTH_LE_CONFIG_DISCONNECT)( + IN EFI_BLUETOOTH_LE_CONFIG_PROTOCOL *This, + IN BLUETOOTH_LE_ADDRESS *BD_ADDR, + IN UINT8 Reason + ); + +/** + Get BluetoothLE configuration data. + + The GetData() function returns BluetoothLE configuration data. For remot= e BluetoothLE device + configuration data, please use GetRemoteData() function with valid BD_AD= DR. + + @param[in] This Pointer to the EFI_BLUETOOTH_LE_CONFIG_PRO= TOCOL instance. + @param[in] DataType Configuration data type. + @param[in, out] DataSize On input, indicates the size, in bytes, of= the data buffer specified by Data. + On output, indicates the amount of data ac= tually returned. + @param[in, out] Data A pointer to the buffer of data that will = be returned. + + @retval EFI_SUCCESS The BluetoothLE configuration data is retu= rned 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_LE_CONFIG_GET_DATA) ( + IN EFI_BLUETOOTH_LE_CONFIG_PROTOCOL *This, + IN EFI_BLUETOOTH_CONFIG_DATA_TYPE DataType, + IN OUT UINTN *DataSize, + IN OUT VOID *Data OPTIONAL + ); + +/** + Set BluetoothLE configuration data. + + The SetData() function sets local BluetoothLE device configuration data.= Not all DataType can be + set. + + @param[in] This Pointer to the EFI_BLUETOOTH_LE_CONFIG_PRO= TOCOL instance. + @param[in] DataType Configuration data type. + @param[in] DataSize Indicates the size, in bytes, of the data = buffer specified by Data. + @param[in] Data A pointer to the buffer of data that will = be set. + + @retval EFI_SUCCESS The BluetoothLE 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_WRITE_PROTECTED Cannot set configuration data. + +**/ +typedef +EFI_STATUS +(EFIAPI *EFI_BLUETOOTH_LE_CONFIG_SET_DATA) ( + IN EFI_BLUETOOTH_LE_CONFIG_PROTOCOL *This, + IN EFI_BLUETOOTH_CONFIG_DATA_TYPE DataType, + IN UINTN DataSize, + IN VOID *Data + ); + +/** + Get remove BluetoothLE device configuration data. + + The GetRemoteData() function returns remote BluetoothLE device configura= tion data. + + @param[in] This Pointer to the EFI_BLUETOOTH_LE_CONFIG_PRO= TOCOL instance. + @param[in] DataType Configuration data type. + @param[in] BDAddr Remote BluetoothLE device address. + @param[in, out] DataSize On input, indicates the size, in bytes, of= the data buffer specified by Data. + On output, indicates the amount of data ac= tually returned. + @param[in, out] Data A pointer to the buffer of data that will = be returned. + + @retval EFI_SUCCESS The remote BluetoothLE device configuratio= n 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_LE_CONFIG_GET_REMOTE_DATA) ( + IN EFI_BLUETOOTH_LE_CONFIG_PROTOCOL *This, + IN EFI_BLUETOOTH_CONFIG_DATA_TYPE DataType, + IN BLUETOOTH_LE_ADDRESS *BDAddr, + IN OUT UINTN *DataSize, + IN OUT VOID *Data + ); + +typedef enum { + /// + /// It indicates an authorization request. No data is associated with th= e callback + /// input. In the output data, the application should return the authori= zation value. + /// The data structure is BOOLEAN. TRUE means YES. FALSE means NO. + /// + EfiBluetoothSmpAuthorizationRequestEvent, + /// + /// It indicates that a passkey has been generated locally by the driver= , and the same + /// passkey should be entered at the remote device. The callback input d= ata is the + /// passkey of type UINT32, to be displayed by the application. No outpu= t data + /// should be returned. + /// + EfiBluetoothSmpPasskeyReadyEvent, + /// + /// It indicates that the driver is requesting for the passkey has been = generated at + /// the remote device. No data is associated with the callback input. Th= e output data + /// is the passkey of type UINT32, to be entered by the user. + /// + EfiBluetoothSmpPasskeyRequestEvent, + /// + /// It indicates that the driver is requesting for the passkey that has = been pre-shared + /// out-of-band with the remote device. No data is associated with the c= allback + /// input. The output data is the stored OOB data of type UINT8[16]. + /// + EfiBluetoothSmpOOBDataRequestEvent, + /// + /// In indicates that a number have been generated locally by the bus dr= iver, and + /// also at the remote device, and the bus driver wants to know if the t= wo numbers + /// match. The callback input data is the number of type UINT32. The out= put data + /// is confirmation value of type BOOLEAN. TRUE means comparison pass. F= ALSE + /// means comparison fail. + /// + EfiBluetoothSmpNumericComparisonEvent, +} EFI_BLUETOOTH_LE_SMP_EVENT_DATA_TYPE; + +/** + The callback function for SMP. + + @param[in] This Pointer to the EFI_BLUETOOTH_LE_CONFIG_P= ROTOCOL instance. + @param[in] Context Data passed into callback function. This= is optional parameter + and may be NULL. + @param[in] BDAddr Remote BluetoothLE device address. + @param[in] EventDataType Event data type in EFI_BLUETOOTH_LE_SMP_= EVENT_DATA_TYPE. + @param[in] DataSize Indicates the size, in bytes, of the dat= a buffer specified by Data. + @param[in] Data A pointer to the buffer of data. + + @retval EFI_SUCCESS The callback function complete successfully. + +**/ +typedef +EFI_STATUS +(EFIAPI *EFI_BLUETOOTH_LE_SMP_CALLBACK) ( + IN EFI_BLUETOOTH_LE_CONFIG_PROTOCOL *This, + IN VOID *Context, + IN BLUETOOTH_LE_ADDRESS *BDAddr, + IN EFI_BLUETOOTH_LE_SMP_EVENT_DATA_TYPE EventDataType, + IN UINTN DataSize, + IN VOID *Data + ); + +/** + Register Security Manager Protocol callback function for user authentica= tion/authorization. + + The RegisterSmpAuthCallback() function register Security Manager Protoco= l callback + function for user authentication/authorization. + + @param[in] This Pointer to the EFI_BLUETOOTH_LE_CONFIG_PROTO= COL instance. + @param[in] Callback Callback function for user authentication/au= thorization. + @param[in] Context Data passed into Callback function. This is = optional parameter and may be NULL. + + @retval EFI_SUCCESS The SMP callback function is registered succ= essfully. + @retval EFI_ALREADY_STARTED A callback function is already registered on= the same attribute + opcode and attribute handle, when the Callba= ck is not NULL. + @retval EFI_NOT_STARTED A callback function is not registered on the= same attribute opcode + and attribute handle, when the Callback is N= ULL. + +**/ +typedef +EFI_STATUS +(EFIAPI *EFI_BLUETOOTH_LE_REGISTER_SMP_AUTH_CALLBACK) ( + IN EFI_BLUETOOTH_LE_CONFIG_PROTOCOL *This, + IN EFI_BLUETOOTH_LE_SMP_CALLBACK Callback, + IN VOID *Context + ); + +/** + Send user authentication/authorization to remote device. + + The SendSmpAuthData() function sends user authentication/authorization t= o remote device. It + should be used to send these information after the caller gets the reque= st data from the callback + function by RegisterSmpAuthCallback(). + + @param[in] This Pointer to the EFI_BLUETOOTH_LE_CONFIG_PROTO= COL instance. + @param[in] BDAddr Remote BluetoothLE device address. + @param[in] EventDataType Event data type in EFI_BLUETOOTH_LE_SMP_EVEN= T_DATA_TYPE. + @param[in] DataSize The size of Data in bytes, of the data buffe= r specified by Data. + @param[in] Data A pointer to the buffer of data that will be= sent. The data format + depends on the type of SMP event data being = responded to. + + @retval EFI_SUCCESS The SMP authorization data is sent successfu= lly. + @retval EFI_NOT_READY SMP is not in the correct state to receive t= he auth data. + +**/ +typedef +EFI_STATUS +(EFIAPI *EFI_BLUETOOTH_LE_SEND_SMP_AUTH_DATA) ( + IN EFI_BLUETOOTH_LE_CONFIG_PROTOCOL *This, + IN BLUETOOTH_LE_ADDRESS *BDAddr, + IN EFI_BLUETOOTH_LE_SMP_EVENT_DATA_TYPE EventDataType, + IN UINTN DataSize, + IN VOID *Data + ); + +typedef enum { + // For local device only + EfiBluetoothSmpLocalIR, /* If Key hierarchy is supported */ + EfiBluetoothSmpLocalER, /* If Key hierarchy is supported */ + EfiBluetoothSmpLocalDHK, /* If Key hierarchy is supported. OPTIONAL */ + // For peer specific + EfiBluetoothSmpKeysDistributed =3D 0x1000, + EfiBluetoothSmpKeySize, + EfiBluetoothSmpKeyType, + EfiBluetoothSmpPeerLTK, + EfiBluetoothSmpPeerIRK, + EfiBluetoothSmpPeerCSRK, + EfiBluetoothSmpPeerRand, + EfiBluetoothSmpPeerEDIV, + EfiBluetoothSmpPeerSignCounter, + EfiBluetoothSmpLocalLTK, /* If Key hierarchy not supported */ + EfiBluetoothSmpLocalIRK, /* If Key hierarchy not supported */ + EfiBluetoothSmpLocalCSRK, /* If Key hierarchy not supported */ + EfiBluetoothSmpLocalSignCounter, + EfiBluetoothSmpLocalDIV, +} EFI_BLUETOOTH_LE_SMP_DATA_TYPE; + +/** + The callback function to get SMP data. + + @param[in] This Pointer to the EFI_BLUETOOTH_LE_CONFIG_P= ROTOCOL instance. + @param[in] Context Data passed into callback function. This= is optional parameter + and may be NULL. + @param[in] BDAddr Remote BluetoothLE device address. For L= ocal device setting, it + should be NULL. + @param[in] DataType Data type in EFI_BLUETOOTH_LE_SMP_DATA_T= YPE. + @param[in, out] 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[out] Data A pointer to the buffer of data that wil= l be returned. + + @retval EFI_SUCCESS The callback function complete successfully. + +**/ +typedef +EFI_STATUS +(EFIAPI * EFI_BLUETOOTH_LE_CONFIG_SMP_GET_DATA_CALLBACK) ( + IN EFI_BLUETOOTH_LE_CONFIG_PROTOCOL *This, + IN VOID *Context, + IN BLUETOOTH_LE_ADDRESS *BDAddr, + IN EFI_BLUETOOTH_LE_SMP_DATA_TYPE DataType, + IN OUT UINTN *DataSize, + OUT VOID *Data + ); + +/** + Register a callback function to get SMP related data. + + The RegisterSmpGetDataCallback() function registers a callback function = to get SMP related data. + + @param[in] This Pointer to the EFI_BLUETOOTH_LE_CONFIG_PROTO= COL instance. + @param[in] Callback Callback function for SMP get data. + @param[in] Context Data passed into Callback function. This is = optional parameter and may be NULL. + + @retval EFI_SUCCESS The SMP get data callback function is regist= ered successfully. + @retval EFI_ALREADY_STARTED A callback function is already registered on= the same attribute + opcode and attribute handle, when the Callba= ck is not NULL. + @retval EFI_NOT_STARTED A callback function is not registered on the= same attribute opcode + and attribute handle, when the Callback is N= ULL +**/ +typedef +EFI_STATUS +(EFIAPI * EFI_BLUETOOTH_LE_CONFIG_REGISTER_SMP_GET_DATA_CALLBACK) ( + IN EFI_BLUETOOTH_LE_CONFIG_PROTOCOL *This, + IN EFI_BLUETOOTH_LE_CONFIG_SMP_GET_DATA_CALLBACK Callback, + IN VOID *Context + ); + +/** + The callback function to set SMP data. + + @param[in] This Pointer to the EFI_BLUETOOTH_LE_CONFIG_P= ROTOCOL instance. + @param[in] Context Data passed into callback function. This= is optional parameter + and may be NULL. + @param[in] BDAddr Remote BluetoothLE device address. + @param[in] DataType Data type in EFI_BLUETOOTH_LE_SMP_DATA_T= YPE. + @param[in] DataSize Indicates the size, in bytes, of the dat= a buffer specified by Data. + @param[in] Data A pointer to the buffer of data. + + @retval EFI_SUCCESS The callback function complete successfully. + +**/ +typedef +EFI_STATUS +(EFIAPI * EFI_BLUETOOTH_LE_CONFIG_SMP_SET_DATA_CALLBACK) ( + IN EFI_BLUETOOTH_LE_CONFIG_PROTOCOL *This, + IN VOID *Context, + IN BLUETOOTH_LE_ADDRESS *BDAddr, + IN EFI_BLUETOOTH_LE_SMP_DATA_TYPE Type, + IN UINTN DataSize, + IN VOID *Data + ); + +/** + Register a callback function to set SMP related data. + + The RegisterSmpSetDataCallback() function registers a callback function = to set SMP related data. + + @param[in] This Pointer to the EFI_BLUETOOTH_LE_CONFIG_PROTO= COL instance. + @param[in] Callback Callback function for SMP set data. + @param[in] Context Data passed into Callback function. This is = optional parameter and may be NULL. + + @retval EFI_SUCCESS The SMP set data callback function is regist= ered successfully. + @retval EFI_ALREADY_STARTED A callback function is already registered on= the same attribute + opcode and attribute handle, when the Callba= ck is not NULL. + @retval EFI_NOT_STARTED A callback function is not registered on the= same attribute opcode + and attribute handle, when the Callback is N= ULL +**/ +typedef +EFI_STATUS +(EFIAPI * EFI_BLUETOOTH_LE_CONFIG_REGISTER_SMP_SET_DATA_CALLBACK) ( + IN EFI_BLUETOOTH_LE_CONFIG_PROTOCOL *This, + IN EFI_BLUETOOTH_LE_CONFIG_SMP_SET_DATA_CALLBACK Callback, + IN VOID *Context + ); + +/** + The callback function to hook connect complete event. + + @param[in] This Pointer to the EFI_BLUETOOTH_LE_CONFIG_P= ROTOCOL instance. + @param[in] Context Data passed into callback function. This= is optional parameter + and may be NULL. + @param[in] CallbackType The value defined in EFI_BLUETOOTH_CONNE= CT_COMPLETE_CALLBACK_TYPE. + @param[in] BDAddr Remote BluetoothLE device address. + @param[in] InputBuffer A pointer to the buffer of data that is = input from callback caller. + @param[in] InputBufferSize Indicates the size, in bytes, of the dat= a buffer specified by InputBuffer. + + @retval EFI_SUCCESS The callback function complete successfully. + +**/ +typedef +EFI_STATUS +(EFIAPI *EFI_BLUETOOTH_LE_CONFIG_CONNECT_COMPLETE_CALLBACK) ( + IN EFI_BLUETOOTH_LE_CONFIG_PROTOCOL *This, + IN VOID *Context, + IN EFI_BLUETOOTH_CONNECT_COMPLETE_CALLBACK_TYPE CallbackType, + IN BLUETOOTH_LE_ADDRESS *BDAddr, + IN VOID *InputBuffer, + IN UINTN InputBufferSize + ); + +/** + Register link connect complete callback function. + + The RegisterLinkConnectCompleteCallback() function registers Bluetooth l= ink connect + complete callback function. The Bluetooth Configuration driver may call + RegisterLinkConnectCompleteCallback() to register a callback function. D= uring pairing, + Bluetooth bus driver must trigger this callback function to report devic= e state, if it is registered. + Then Bluetooth Configuration driver will get information on device conne= ction, according to + CallbackType defined by EFI_BLUETOOTH_CONNECT_COMPLETE_CALLBACK_TYPE + + @param[in] This Pointer to the EFI_BLUETOOTH_LE_CONFIG_PROTO= COL instance. + @param[in] Callback The callback function. NULL means unregister. + @param[in] 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. + @retval EFI_ALREADY_STARTED A callback function is already registered on= the same attribute + opcode and attribute handle, when the Callba= ck is not NULL. + @retval EFI_NOT_STARTED A callback function is not registered on the= same attribute opcode + and attribute handle, when the Callback is N= ULL +**/ +typedef +EFI_STATUS +(EFIAPI *EFI_BLUETOOTH_LE_CONFIG_REGISTER_CONNECT_COMPLETE_CALLBACK) ( + IN EFI_BLUETOOTH_LE_CONFIG_PROTOCOL *This, + IN EFI_BLUETOOTH_LE_CONFIG_CONNECT_COMPLETE_CALLBACK Callback, + IN VOID *Context + ); + +/// +/// This protocol abstracts user interface configuration for BluetoothLe d= evice. +/// +struct _EFI_BLUETOOTH_LE_CONFIG_PROTOCOL { + EFI_BLUETOOTH_LE_CONFIG_INIT Init; + EFI_BLUETOOTH_LE_CONFIG_SCAN Scan; + EFI_BLUETOOTH_LE_CONFIG_CONNECT Connect; + EFI_BLUETOOTH_LE_CONFIG_DISCONNECT Disconnect; + EFI_BLUETOOTH_LE_CONFIG_GET_DATA GetData; + EFI_BLUETOOTH_LE_CONFIG_SET_DATA SetData; + EFI_BLUETOOTH_LE_CONFIG_GET_REMOTE_DATA GetRemoteData; + EFI_BLUETOOTH_LE_REGISTER_SMP_AUTH_CALLBACK RegisterSmpAu= thCallback; + EFI_BLUETOOTH_LE_SEND_SMP_AUTH_DATA SendSmpAuthDa= ta; + EFI_BLUETOOTH_LE_CONFIG_REGISTER_SMP_GET_DATA_CALLBACK RegisterSmpGe= tDataCallback; + EFI_BLUETOOTH_LE_CONFIG_REGISTER_SMP_SET_DATA_CALLBACK RegisterSmpSe= tDataCallback; + EFI_BLUETOOTH_LE_CONFIG_REGISTER_CONNECT_COMPLETE_CALLBACK RegisterLinkC= onnectCompleteCallback; +}; + +extern EFI_GUID gEfiBluetoothLeConfigProtocolGuid; + +#endif + diff --git a/MdePkg/MdePkg.dec b/MdePkg/MdePkg.dec index 0c0672af52..7a7504b7a3 100644 --- a/MdePkg/MdePkg.dec +++ b/MdePkg/MdePkg.dec @@ -1662,6 +1662,16 @@ [Protocols] gEfiEraseBlockProtocolGuid =3D { 0x95a9a93e, 0xa86e, 0x4926, {= 0xaa, 0xef, 0x99, 0x18, 0xe7, 0x72, 0xd9, 0x87 }} =20 # + # Protocols defined in UEFI2.7 + # + ## Include/Protocol/BluetoothAttribute.h + gEfiBluetoothAttributeProtocolGuid =3D { 0x898890e9, 0x84b2, 0x4f= 3a, { 0x8c, 0x58, 0xd8, 0x57, 0x78, 0x13, 0xe0, 0xac } } + gEfiBluetoothAttributeServiceBindingProtocolGuid =3D { 0x5639867a, 0x8c8= e, 0x408d, {0xac, 0x2f, 0x4b, 0x61, 0xbd, 0xc0, 0xbb, 0xbb }} + + ## Include/Protocol/BluetoothLeConfig.h + gEfiBluetoothLeConfigProtocolGuid =3D { 0x8f76da58, 0x1f99, 0x42= 75, { 0xa4, 0xec, 0x47, 0x56, 0x51, 0x5b, 0x1c, 0xe8 } } + + # # Protocols defined in Shell2.0 # ## Include/Protocol/Shell.h --=20 2.12.2.windows.2 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel