[PATCH 1/4] uefi: uefidump: add dumping for BluetoothLE device path
Ivan Hu
ivan.hu at canonical.com
Thu Oct 26 09:42:20 UTC 2017
BluetoothLE device path was added on UEFI spec version 2.7
Signed-off-by: Ivan Hu <ivan.hu at canonical.com>
---
src/lib/include/fwts_uefi.h | 9 ++++++++-
src/uefi/uefidump/uefidump.c | 9 +++++++++
2 files changed, 17 insertions(+), 1 deletion(-)
diff --git a/src/lib/include/fwts_uefi.h b/src/lib/include/fwts_uefi.h
index 5afc968..db83f2f 100644
--- a/src/lib/include/fwts_uefi.h
+++ b/src/lib/include/fwts_uefi.h
@@ -253,7 +253,8 @@ typedef enum {
FWTS_UEFI_SD_DEVICE_PATH_SUBTYPE = (0x1a),
FWTS_UEFI_BLUETOOTH_DEVICE_PATH_SUBTYPE = (0x1b),
FWTS_UEFI_WIRELESS_DEVICE_PATH_SUBTYPE = (0x1c),
- FWTS_UEFI_EMMC_DEVICE_PATH_SUBTYPE = (0x1d)
+ FWTS_UEFI_EMMC_DEVICE_PATH_SUBTYPE = (0x1d),
+ FWTS_UEFI_BLUETOOTHLE_DEVICE_PATH_SUBTYPE = (0x1e)
} messaging_dev_path_subtypes;
typedef enum {
@@ -558,6 +559,12 @@ typedef struct {
typedef struct {
fwts_uefi_dev_path dev_path;
+ uint8_t bluetooth_addr[6];
+ uint8_t addr_type;
+} __attribute__((packed)) fwts_uefi_bluetoothle_dev_path;
+
+typedef struct {
+ fwts_uefi_dev_path dev_path;
uint32_t partition_number;
uint64_t partition_start;
uint64_t partition_size;
diff --git a/src/uefi/uefidump/uefidump.c b/src/uefi/uefidump/uefidump.c
index c4c44b1..af20f85 100644
--- a/src/uefi/uefidump/uefidump.c
+++ b/src/uefi/uefidump/uefidump.c
@@ -540,6 +540,15 @@ static char *uefidump_build_dev_path(char *path, fwts_uefi_dev_path *dev_path, c
path = uefidump_vprintf(path, "\\eMMC(0x%" PRIx8 ")", e->slot_num);
}
break;
+ case FWTS_UEFI_BLUETOOTHLE_DEVICE_PATH_SUBTYPE:
+ if (dev_path_len >= sizeof(fwts_uefi_bluetoothle_dev_path)) {
+ fwts_uefi_bluetoothle_dev_path *b = (fwts_uefi_bluetoothle_dev_path *)dev_path;
+ path = uefidump_vprintf(path, "\\BluetoothLE("
+ "%02" PRIx8 "%02" PRIx8 "%02" PRIx8 "%02" PRIx8 "%02" PRIx8 "%02" PRIx8 ",0x%" PRIx8 ")",
+ b->bluetooth_addr[0], b->bluetooth_addr[1], b->bluetooth_addr[2],
+ b->bluetooth_addr[3], b->bluetooth_addr[4], b->bluetooth_addr[5], b->addr_type);
+ }
+ break;
default:
path = uefidump_vprintf(path, "\\Unknown-MESSAGING-DEV-PATH(0x%" PRIx8 ")", dev_path->subtype);
break;
--
2.7.4
More information about the fwts-devel
mailing list