Diff between 1ffa2638265db9376260babd61e0d46b1bc3f109 and 946e51cdc39f44b8abcf4c149b36212e6f499511

Changed Files

File Additions Deletions Status
emulator/vhci.c +11 -1 modified
emulator/vhci.h +2 -0 modified

Full Patch

diff --git a/emulator/vhci.c b/emulator/vhci.c
index 52876ba..8fddef7 100644
--- a/emulator/vhci.c
+++ b/emulator/vhci.c
@@ -37,6 +37,8 @@
 #include "btdev.h"
 #include "vhci.h"
 
+#define uninitialized_var(x) x = x
+
 struct vhci {
 	enum vhci_type type;
 	int fd;
@@ -83,9 +85,17 @@ static void vhci_read_callback(int fd, uint32_t events, void *user_data)
 struct vhci *vhci_open(enum vhci_type type)
 {
 	struct vhci *vhci;
+	enum btdev_type uninitialized_var(btdev_type);
 
 	switch (type) {
+	case VHCI_TYPE_BREDRLE:
+		btdev_type = BTDEV_TYPE_BREDRLE;
+		break;
 	case VHCI_TYPE_BREDR:
+		btdev_type = BTDEV_TYPE_BREDR;
+		break;
+	case VHCI_TYPE_LE:
+		btdev_type = BTDEV_TYPE_LE;
 		break;
 	case VHCI_TYPE_AMP:
 		return NULL;
@@ -104,7 +114,7 @@ struct vhci *vhci_open(enum vhci_type type)
 		return NULL;
 	}
 
-	vhci->btdev = btdev_create(BTDEV_TYPE_BREDR, 0x23);
+	vhci->btdev = btdev_create(btdev_type, 0x23);
 	if (!vhci->btdev) {
 		close(vhci->fd);
 		free(vhci);
diff --git a/emulator/vhci.h b/emulator/vhci.h
index a9d8069..b9ae63f 100644
--- a/emulator/vhci.h
+++ b/emulator/vhci.h
@@ -25,7 +25,9 @@
 #include <stdint.h>
 
 enum vhci_type {
+	VHCI_TYPE_BREDRLE,
 	VHCI_TYPE_BREDR,
+	VHCI_TYPE_LE,
 	VHCI_TYPE_AMP,
 };