X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;f=bt-host.c;h=2f8f631c2528a866e4fb9bbb5d7876b9889750d2;hb=ca3538039012258973ab75775109dbe9577097f6;hp=095254ddc6ef350e5f5e7f1f8b41ce0faa48b24f;hpb=5300f1a5487f67f0bde8ee1081b799108668cb1d;p=mirror_qemu.git diff --git a/bt-host.c b/bt-host.c index 095254ddc6..2f8f631c25 100644 --- a/bt-host.c +++ b/bt-host.c @@ -17,13 +17,12 @@ * with this program; if not, see . */ +#include "qemu/osdep.h" #include "qemu-common.h" -#include "qemu-char.h" -#include "net.h" -#include "bt-host.h" +#include "sysemu/bt.h" +#include "qemu/main-loop.h" #ifndef _WIN32 -# include # include # include # ifdef CONFIG_BLUEZ @@ -130,6 +129,7 @@ static void bt_host_read(void *opaque) pktlen = MIN(pkt[2] + 3, s->len); s->len -= pktlen; pkt += pktlen; + break; default: bad_pkt: @@ -171,13 +171,13 @@ struct HCIInfo *bt_host_hci(const char *id) hci_filter_all_ptypes(&flt); hci_filter_all_events(&flt); - if (setsockopt(fd, SOL_HCI, HCI_FILTER, &flt, sizeof(flt)) < 0) { + if (qemu_setsockopt(fd, SOL_HCI, HCI_FILTER, &flt, sizeof(flt)) < 0) { fprintf(stderr, "qemu: Can't set HCI filter on socket (%i)\n", errno); return 0; } # endif - s = qemu_mallocz(sizeof(struct bt_host_hci_s)); + s = g_malloc0(sizeof(struct bt_host_hci_s)); s->fd = fd; s->hci.cmd_send = bt_host_cmd; s->hci.sco_send = bt_host_sco;