Home | History | Annotate | Download | only in hw

Lines Matching refs:link

57             struct bt_link_s *link;
58 void (*lmp_acl_data)(struct bt_link_s *link,
620 !hci->lm.handle[handle & ~HCI_HANDLE_OFFSET].link;
631 struct bt_link_s *link = hci->lm.handle[handle & ~HCI_HANDLE_OFFSET].link;
633 return bt_hci_role_master(hci, handle) ? link->slave : link->host;
638 struct bt_link_s *link, int master)
640 hci->lm.handle[hci->lm.last_handle].link = link;
643 /* We are the master side of an ACL link */
647 link->slave->lmp_acl_data;
649 /* We are the slave side of an ACL link */
653 link->host->lmp_acl_resp;
658 link->acl_mode = acl_active;
660 qemu_new_timer_ns(vm_clock, bt_hci_mode_tick, link);
667 hci->lm.handle[handle].link = NULL;
678 struct bt_link_s link;
688 link.slave = slave;
689 link.host = &hci->device;
690 link.slave->lmp_connection_request(&link); /* Always last */
698 struct bt_link_s link = {
705 host->lmp_connection_complete(&link);
724 struct bt_hci_link_s *link = qemu_mallocz(sizeof(struct bt_hci_link_s));
732 while (hci->lm.handle[++ hci->lm.last_handle].link && -- tries)
739 qemu_free(link);
745 link->btlink.slave = &hci->device;
746 link->btlink.host = host;
747 link->handle = handle;
749 /* Link established */
750 bt_hci_lmp_link_establish(hci, &link->btlink, 0);
765 host->lmp_connection_complete(&link->btlink);
769 static void bt_hci_lmp_connection_request(struct bt_link_s *link)
771 struct bt_hci_s *hci = hci_from_device(link->slave);
775 bt_hci_connection_reject(hci, link->host,
779 hci->conn_req_host = link->host;
785 bacpy(&params.bdaddr, &link->host->bd_addr);
786 memcpy(&params.dev_class, &link->host->class, sizeof(params.dev_class));
809 * try to detach the link and send a Connection Complete. */
826 static void bt_hci_lmp_connection_complete(struct bt_link_s *link)
828 struct bt_hci_s *hci = hci_from_device(link->host);
834 if (bt_hci_lmp_connection_ready(hci, &link->slave->bd_addr)) {
836 link->slave->lmp_disconnect_slave(link);
850 while (hci->lm.handle[++ hci->lm.last_handle].link && -- tries)
857 link->slave->lmp_disconnect_slave(link);
862 /* Link established */
863 link->handle = handle;
864 bt_hci_lmp_link_establish(hci, link, 1);
870 bacpy(&params.bdaddr, &link->slave->bd_addr);
879 hci->lm.handle[handle & ~HCI_HANDLE_OFFSET].link;
880 struct bt_hci_link_s *link;
886 /* The link pointer is invalid from now on */
895 link = (struct bt_hci_link_s *) btlink;
896 qemu_free(link);
909 static void bt_hci_lmp_disconnect_host(struct bt_link_s *link)
911 struct bt_hci_s *hci = hci_from_device(link->host);
912 uint16_t handle = link->handle;
926 struct bt_hci_link_s *link = (struct bt_hci_link_s *) btlink;
928 uint16_t handle = link->handle;
931 qemu_free(link);
1039 static void bt_hci_event_mode(struct bt_hci_s *hci, struct bt_link_s *link,
1045 .mode = link->acl_mode,
1046 .interval = cpu_to_le16(link->acl_interval),
1053 struct bt_link_s *link, int mode, uint16_t interval)
1055 link->acl_mode = mode;
1056 link->acl_interval = interval;
1058 bt_hci_event_mode(hci, link, link->handle);
1060 link->slave->lmp_mode_change(link);
1065 struct bt_hci_link_s *link = (struct bt_hci_link_s *) btlink;
1068 bt_hci_event_mode(hci, btlink, link->handle);
1074 struct bt_hci_master_link_s *link;
1079 link = &hci->lm.handle[handle & ~HCI_HANDLE_OFFSET];
1080 if (link->link->acl_mode != acl_active) {
1087 qemu_mod_timer(link->acl_mode_timer, qemu_get_clock_ns(vm_clock) +
1089 bt_hci_lmp_mode_change_master(hci, link->link, mode, interval);
1096 struct bt_hci_master_link_s *link;
1101 link = &hci->lm.handle[handle & ~HCI_HANDLE_OFFSET];
1102 if (link->link->acl_mode != mode) {
1110 qemu_del_timer(link->acl_mode_timer);
1111 bt_hci_lmp_mode_change_master(hci, link->link, acl_active, 0);
1118 struct bt_link_s *link = opaque;
1119 struct bt_hci_s *hci = hci_from_device(link->host);
1121 bt_hci_lmp_mode_change_master(hci, link, acl_active, 0);
1596 if (bt_hci_role_master(hci, i) && hci->lm.handle[i].link &&
1597 !bacmp(&hci->lm.handle[i].link->slave->bd_addr,
1995 struct bt_hci_link_s *link = (struct bt_hci_link_s *) btlink;
1998 link->handle, data, start, len);
2001 static void bt_hci_lmp_acl_data_host(struct bt_link_s *link,
2004 bt_hci_lmp_acl_data(hci_from_device(link->host),
2005 link->handle, data, start, len);
2014 struct bt_link_s *link;
2042 link = hci->lm.handle[handle].link;
2074 hci->lm.handle[handle].lmp_acl_data(link, data,