X-Git-Url: https://git.proxmox.com/?a=blobdiff_plain;f=bt-host.c;h=095254ddc6ef350e5f5e7f1f8b41ce0faa48b24f;hb=b7fa9214d8d4f57992c9acd0ccb125c54a095f00;hp=3701fbdbe776eebda99d8b5be72a6eb10e14aa6b;hpb=5ef4efa426d69643d51fc98afcee662bef6a2839;p=qemu.git diff --git a/bt-host.c b/bt-host.c index 3701fbdbe..095254ddc 100644 --- a/bt-host.c +++ b/bt-host.c @@ -14,13 +14,11 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License along - * with this program; if not, write to the Free Software Foundation, Inc., - * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + * with this program; if not, see . */ #include "qemu-common.h" #include "qemu-char.h" -#include "sysemu.h" #include "net.h" #include "bt-host.h" @@ -51,19 +49,19 @@ static void bt_host_send(struct HCIInfo *hci, struct bt_host_hci_s *s = (struct bt_host_hci_s *) hci; uint8_t pkt = type; struct iovec iv[2]; - int ret; - iv[0].iov_base = &pkt; + iv[0].iov_base = (void *)&pkt; iv[0].iov_len = 1; iv[1].iov_base = (void *) data; iv[1].iov_len = len; - while ((ret = writev(s->fd, iv, 2)) < 0) + while (writev(s->fd, iv, 2) < 0) { if (errno != EAGAIN && errno != EINTR) { fprintf(stderr, "qemu: error %i writing bluetooth packet.\n", errno); return; } + } } static void bt_host_cmd(struct HCIInfo *hci, const uint8_t *data, int len) @@ -81,13 +79,6 @@ static void bt_host_sco(struct HCIInfo *hci, const uint8_t *data, int len) bt_host_send(hci, HCI_SCODATA_PKT, data, len); } -static int bt_host_read_poll(void *opaque) -{ - struct bt_host_hci_s *s = (struct bt_host_hci_s *) opaque; - - return !!s->hci.evt_recv; -} - static void bt_host_read(void *opaque) { struct bt_host_hci_s *s = (struct bt_host_hci_s *) opaque; @@ -193,7 +184,7 @@ struct HCIInfo *bt_host_hci(const char *id) s->hci.acl_send = bt_host_acl; s->hci.bdaddr_set = bt_host_bdaddr_set; - qemu_set_fd_handler2(s->fd, bt_host_read_poll, bt_host_read, NULL, s); + qemu_set_fd_handler(s->fd, bt_host_read, NULL, s); return &s->hci; }