]> git.proxmox.com Git - qemu.git/blobdiff - hw/bt-hci.c
vhost: error code
[qemu.git] / hw / bt-hci.c
index 6a7909406ce73b79067b8ce06b82a67bd7e45895..f1ee92cfd4186cedc18bf364a914fd33cbe0f316 100644 (file)
@@ -419,7 +419,7 @@ static void bt_submit_raw_acl(struct bt_piconet_s *net, int length, uint8_t *dat
  * be continuously allocated.  We do it though, to preserve similar
  * behaviour between hosts.  Some things, like the BD_ADDR cannot be
  * preserved though (for example if a real hci is used).  */
-#ifdef WORDS_BIGENDIAN
+#ifdef HOST_WORDS_BIGENDIAN
 # define HNDL(raw)     bswap16(raw)
 #else
 # define HNDL(raw)     (raw)
@@ -577,7 +577,7 @@ static void bt_hci_inquiry_result(struct bt_hci_s *hci,
 static void bt_hci_mod_timer_1280ms(QEMUTimer *timer, int period)
 {
     qemu_mod_timer(timer, qemu_get_clock(vm_clock) +
-                    muldiv64(period << 7, ticks_per_sec, 100));
+                   muldiv64(period << 7, get_ticks_per_sec(), 100));
 }
 
 static void bt_hci_inquiry_start(struct bt_hci_s *hci, int length)
@@ -994,13 +994,12 @@ static int bt_hci_features_req(struct bt_hci_s *hci, uint16_t handle)
 
 static int bt_hci_version_req(struct bt_hci_s *hci, uint16_t handle)
 {
-    struct bt_device_s *slave;
     evt_read_remote_version_complete params;
 
     if (bt_hci_handle_bad(hci, handle))
         return -ENODEV;
 
-    slave = bt_hci_remote_dev(hci, handle);
+    bt_hci_remote_dev(hci, handle);
 
     bt_hci_event_status(hci, HCI_SUCCESS);
 
@@ -1086,7 +1085,7 @@ static int bt_hci_mode_change(struct bt_hci_s *hci, uint16_t handle,
     bt_hci_event_status(hci, HCI_SUCCESS);
 
     qemu_mod_timer(link->acl_mode_timer, qemu_get_clock(vm_clock) +
-                            muldiv64(interval * 625, ticks_per_sec, 1000000));
+                   muldiv64(interval * 625, get_ticks_per_sec(), 1000000));
     bt_hci_lmp_mode_change_master(hci, link->link, mode, interval);
 
     return 0;
@@ -2080,7 +2079,6 @@ static void bt_submit_sco(struct HCIInfo *info,
                 const uint8_t *data, int length)
 {
     struct bt_hci_s *hci = hci_from_info(info);
-    struct bt_link_s *link;
     uint16_t handle;
     int datalen;
 
@@ -2089,7 +2087,6 @@ static void bt_submit_sco(struct HCIInfo *info,
 
     handle = acl_handle((data[1] << 8) | data[0]);
     datalen = data[2];
-    data += 3;
     length -= 3;
 
     if (bt_hci_handle_bad(hci, handle)) {
@@ -2097,7 +2094,6 @@ static void bt_submit_sco(struct HCIInfo *info,
                         __FUNCTION__, handle);
         return;
     }
-    handle &= ~HCI_HANDLE_OFFSET;
 
     if (datalen > length) {
         fprintf(stderr, "%s: SCO packet too short (%iB < %iB)\n",
@@ -2105,7 +2101,6 @@ static void bt_submit_sco(struct HCIInfo *info,
         return;
     }
 
-    link = hci->lm.handle[handle].link;
     /* TODO */
 
     /* TODO: increase counter and send EVT_NUM_COMP_PKTS if synchronous