#include "sysemu.h"
#include "net.h"
#include "sysemu.h"
#include "net.h"
-#include <errno.h>
-#include <sys/ioctl.h>
-#include <sys/uio.h>
-#ifdef CONFIG_BLUEZ
-# include <bluetooth/bluetooth.h>
-# include <bluetooth/hci.h>
-# include <bluetooth/hci_lib.h>
-#else
-# include "hw/bt.h"
-# define HCI_MAX_FRAME_SIZE 1028
-#endif
+#ifndef _WIN32
+# include <errno.h>
+# include <sys/ioctl.h>
+# include <sys/uio.h>
+# ifdef CONFIG_BLUEZ
+# include <bluetooth/bluetooth.h>
+# include <bluetooth/hci.h>
+# include <bluetooth/hci_lib.h>
+# else
+# include "hw/bt.h"
+# define HCI_MAX_FRAME_SIZE 1028
+# endif
struct bt_host_hci_s {
struct HCIInfo hci;
struct bt_host_hci_s {
struct HCIInfo hci;
{
struct bt_host_hci_s *s;
int fd = -1;
{
struct bt_host_hci_s *s;
int fd = -1;
int dev_id = hci_devid(id);
struct hci_filter flt;
int dev_id = hci_devid(id);
struct hci_filter flt;
fd = hci_open_dev(dev_id);
/* XXX: can we ensure nobody else has the device opened? */
fd = hci_open_dev(dev_id);
/* XXX: can we ensure nobody else has the device opened? */
if (fd < 0) {
fprintf(stderr, "qemu: Can't open `%s': %s (%i)\n",
if (fd < 0) {
fprintf(stderr, "qemu: Can't open `%s': %s (%i)\n",
hci_filter_clear(&flt);
hci_filter_all_ptypes(&flt);
hci_filter_all_events(&flt);
hci_filter_clear(&flt);
hci_filter_all_ptypes(&flt);
hci_filter_all_events(&flt);
fprintf(stderr, "qemu: Can't set HCI filter on socket (%i)\n", errno);
return 0;
}
fprintf(stderr, "qemu: Can't set HCI filter on socket (%i)\n", errno);
return 0;
}
s = qemu_mallocz(sizeof(struct bt_host_hci_s));
s->fd = fd;
s = qemu_mallocz(sizeof(struct bt_host_hci_s));
s->fd = fd;
+#else
+struct HCIInfo *bt_host_hci(const char *id)
+{
+ fprintf(stderr, "qemu: bluetooth passthrough not supported (yet)\n", errno);
+
+ return 0;
+}
+#endif
#include "net.h"
#include "hw/bt.h"
#include "net.h"
#include "hw/bt.h"
-#include <sys/uio.h>
-
-#define VHCI_DEV "/dev/vhci"
+#define VHCI_DEV "/dev/vhci"
#define VHCI_UDEV "/dev/hci_vhci"
struct bt_vhci_s {
#define VHCI_UDEV "/dev/hci_vhci"
struct bt_vhci_s {