From: Johan Hedberg Date: Thu, 12 Sep 2013 14:42:36 +0000 (+0300) Subject: shared/hciemu: Fix sending a proper vhci create request for new kernels X-Git-Tag: android-x86-4.4-r3~7628 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=dda571b9192125804f288d29d488e930c590edde;p=android-x86%2Fexternal-bluetooth-bluez.git shared/hciemu: Fix sending a proper vhci create request for new kernels --- diff --git a/src/shared/hciemu.c b/src/shared/hciemu.c index 90c21f329..0ea191f0a 100644 --- a/src/shared/hciemu.c +++ b/src/shared/hciemu.c @@ -35,6 +35,9 @@ #include +#include +#include + #include "monitor/bt.h" #include "emulator/btdev.h" #include "emulator/bthost.h" @@ -201,6 +204,8 @@ static guint create_source_btdev(int fd, struct btdev *btdev) static bool create_vhci(struct hciemu *hciemu) { struct btdev *btdev; + uint8_t create_req[2]; + ssize_t written; int fd; btdev = btdev_create(hciemu->btdev_type, 0x00); @@ -215,6 +220,15 @@ static bool create_vhci(struct hciemu *hciemu) return false; } + create_req[0] = HCI_VENDOR_PKT; + create_req[1] = HCI_BREDR; + written = write(fd, create_req, sizeof(create_req)); + if (written < 0) { + close(fd); + btdev_destroy(btdev); + return false; + } + hciemu->master_dev = btdev; hciemu->master_source = create_source_btdev(fd, btdev);