VeraCrypt
aboutsummaryrefslogtreecommitdiff
path: root/Library/CommonLib/EfiBluetooth.c
diff options
context:
space:
mode:
authorkavsrf <kavsrf@gmail.com>2017-01-23 15:30:22 +0300
committerMounir IDRASSI <mounir.idrassi@idrix.fr>2017-06-05 17:36:52 +0200
commitf648e29d050cab362cc660c1a5c5109182028768 (patch)
treeda3a3ce3f3b03edee797c4606a1cd1227cd6eb95 /Library/CommonLib/EfiBluetooth.c
parentd37d6d681061fdefc2a909b5975b40b604a27c62 (diff)
downloadVeraCrypt-DCS-f648e29d050cab362cc660c1a5c5109182028768.tar.gz
VeraCrypt-DCS-f648e29d050cab362cc660c1a5c5109182028768.zip
DcsInfo added
DcsBoot is driver now (to support DriverOrder list)
Diffstat (limited to 'Library/CommonLib/EfiBluetooth.c')
-rw-r--r--Library/CommonLib/EfiBluetooth.c50
1 files changed, 50 insertions, 0 deletions
diff --git a/Library/CommonLib/EfiBluetooth.c b/Library/CommonLib/EfiBluetooth.c
new file mode 100644
index 0000000..13b03e3
--- /dev/null
+++ b/Library/CommonLib/EfiBluetooth.c
@@ -0,0 +1,50 @@
+/** @file
+EFI BLUETOOTH helpers
+
+Copyright (c) 2016. Disk Cryptography Services for EFI (DCS), Alex Kolotnikov
+Copyright (c) 2016. VeraCrypt, Mounir IDRASSI
+
+This program and the accompanying materials are licensed and made available
+under the terms and conditions of the GNU Lesser General Public License, version 3.0 (LGPL-3.0).
+
+The full text of the license may be found at
+https://opensource.org/licenses/LGPL-3.0
+**/
+
+#include <Library/CommonLib.h>
+#include <Library/UefiBootServicesTableLib.h>
+#include <Library/DevicePathLib.h>
+#include <Library/PrintLib.h>
+#include <Protocol/BluetoothIo.h>
+#include <Protocol/BluetoothConfig.h>
+#include <Protocol/BluetoothHc.h>
+
+EFI_HANDLE* gBluetoothIoHandles = NULL;
+UINTN gBluetoothIoCount = 0;
+
+EFI_HANDLE* gBluetoothHcHandles = NULL;
+UINTN gBluetoothHcCount = 0;
+
+EFI_HANDLE* gBluetoothConfigHandles = NULL;
+UINTN gBluetoothConfigCount = 0;
+
+EFI_STATUS
+InitBluetooth() {
+ EFI_STATUS res;
+ res = EfiGetHandles(ByProtocol, &gEfiBluetoothIoProtocolGuid, 0, &gBluetoothIoHandles, &gBluetoothIoCount);
+ res = EfiGetHandles(ByProtocol, &gEfiBluetoothHcProtocolGuid, 0, &gBluetoothHcHandles, &gBluetoothHcCount);
+ res = EfiGetHandles(ByProtocol, &gEfiBluetoothConfigProtocolGuid, 0, &gBluetoothConfigHandles, &gBluetoothConfigCount);
+ return res;
+}
+
+EFI_STATUS
+BluetoothGetIO(
+ IN EFI_HANDLE Handle,
+ OUT EFI_BLUETOOTH_IO_PROTOCOL** io
+ ) {
+ if (!io) {
+ return EFI_INVALID_PARAMETER;
+ }
+ return gBS->HandleProtocol(Handle, &gEfiBluetoothIoProtocolGuid, (VOID**)io);
+}
+