Skip to content

Commit

Permalink
Disable bluetooth proxy compilation on win32.
Browse files Browse the repository at this point in the history
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@5365 c046a42c-6fe2-441c-8c8c-71466251a162
  • Loading branch information
balrog committed Sep 30, 2008
1 parent 9d56d2d commit 2e9b08e
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 18 deletions.
39 changes: 24 additions & 15 deletions bt-host.c
Original file line number Diff line number Diff line change
Expand Up @@ -24,17 +24,18 @@
#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;
Expand Down Expand Up @@ -154,7 +155,7 @@ struct HCIInfo *bt_host_hci(const char *id)
{
struct bt_host_hci_s *s;
int fd = -1;
#ifdef CONFIG_BLUEZ
# ifdef CONFIG_BLUEZ
int dev_id = hci_devid(id);
struct hci_filter flt;

Expand All @@ -166,15 +167,15 @@ struct HCIInfo *bt_host_hci(const char *id)
fd = hci_open_dev(dev_id);

/* XXX: can we ensure nobody else has the device opened? */
#endif
# endif

if (fd < 0) {
fprintf(stderr, "qemu: Can't open `%s': %s (%i)\n",
id, strerror(errno), errno);
return 0;
}

#ifdef CONFIG_BLUEZ
# ifdef CONFIG_BLUEZ
hci_filter_clear(&flt);
hci_filter_all_ptypes(&flt);
hci_filter_all_events(&flt);
Expand All @@ -183,7 +184,7 @@ struct HCIInfo *bt_host_hci(const char *id)
fprintf(stderr, "qemu: Can't set HCI filter on socket (%i)\n", errno);
return 0;
}
#endif
# endif

s = qemu_mallocz(sizeof(struct bt_host_hci_s));
s->fd = fd;
Expand All @@ -196,3 +197,11 @@ struct HCIInfo *bt_host_hci(const char *id)

return &s->hci;
}
#else
struct HCIInfo *bt_host_hci(const char *id)
{
fprintf(stderr, "qemu: bluetooth passthrough not supported (yet)\n", errno);

return 0;
}
#endif
4 changes: 1 addition & 3 deletions bt-vhci.c
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,7 @@
#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 {
Expand Down

0 comments on commit 2e9b08e

Please sign in to comment.