Lines Matching defs:unit

87 ng_hci_process_event(ng_hci_unit_p unit, struct mbuf *event)
101 __func__, NG_NODE_NAME(unit->node), hdr->event, hdr->length);
129 error = le_event(unit, event);
133 error = inquiry_result(unit, event);
137 error = con_compl(unit, event);
141 error = con_req(unit, event);
145 error = discon_compl(unit, event);
149 error = encryption_change(unit, event);
153 error = read_remote_features_compl(unit, event);
157 error = qos_setup_compl(unit, event);
161 error = ng_hci_process_command_complete(unit, event);
165 error = ng_hci_process_command_status(unit, event);
169 error = hardware_error(unit, event);
173 error = role_change(unit, event);
177 error = num_compl_pkts(unit, event);
181 error = mode_change(unit, event);
185 error = data_buffer_overflow(unit, event);
189 error = read_clock_offset_compl(unit, event);
193 error = qos_violation(unit, event);
197 error = page_scan_mode_change(unit, event);
201 error = page_scan_rep_mode_change(unit, event);
214 * Send ACL and/or SCO data to the unit driver
218 ng_hci_send_data(ng_hci_unit_p unit)
223 NG_HCI_BUFF_ACL_AVAIL(unit->buffer, count);
227 __func__, NG_NODE_NAME(unit->node), count);
230 count = send_data_packets(unit, NG_HCI_LINK_ACL, count);
231 NG_HCI_STAT_ACL_SENT(unit->stat, count);
232 NG_HCI_BUFF_ACL_USE(unit->buffer, count);
236 NG_HCI_BUFF_SCO_AVAIL(unit->buffer, count);
240 __func__, NG_NODE_NAME(unit->node), count);
243 count = send_data_packets(unit, NG_HCI_LINK_SCO, count);
244 NG_HCI_STAT_SCO_SENT(unit->stat, count);
245 NG_HCI_BUFF_SCO_USE(unit->buffer, count);
254 send_data_packets(ng_hci_unit_p unit, int link_type, int limit)
270 LIST_FOREACH(con, &unit->con_list, next) {
301 __func__, NG_NODE_NAME(unit->node),
305 v = (unit->drv != NULL && NG_HOOK_IS_VALID(unit->drv));
306 if (!v || (unit->state & NG_HCI_UNIT_READY) !=
310 __func__, NG_NODE_NAME(unit->node),
312 unit->state);
320 ng_hci_mtap(unit, NGI_M(item));
323 NG_FWD_ITEM_HOOK(error, item, unit->drv);
329 __func__, NG_NODE_NAME(unit->node),
335 NG_HCI_STAT_BYTES_SENT(unit->stat, v);
341 sync_con_queue(unit, winner, sent);
352 sync_con_queue(ng_hci_unit_p unit, ng_hci_unit_con_p con, int completed)
359 hook = (con->link_type != NG_HCI_LINK_SCO)? unit->acl : unit->sco;
372 NG_SEND_MSG_HOOK(error, unit->node, msg, hook, 0);
379 le_advertizing_report(ng_hci_unit_p unit, struct mbuf *event)
401 /* Get remote unit address */
414 n = ng_hci_get_neighbor(unit, &bdaddr, (addr_type) ? NG_HCI_LINK_LE_RANDOM:NG_HCI_LINK_LE_PUBLIC);
417 n = ng_hci_new_neighbor(unit);
471 static int le_connection_complete(ng_hci_unit_p unit, struct mbuf *event)
494 LIST_FOREACH(con, &unit->con_list, next)
521 con = ng_hci_new_con(unit, link_type);
571 static int le_connection_update(ng_hci_unit_p unit, struct mbuf *event)
581 le_event(ng_hci_unit_p unit, struct mbuf *event)
594 le_connection_complete(unit, event);
597 le_advertizing_report(unit, event);
600 le_connection_update(unit, event);
616 inquiry_result(ng_hci_unit_p unit, struct mbuf *event)
631 /* Get remote unit address */
636 n = ng_hci_get_neighbor(unit, &bdaddr, NG_HCI_LINK_ACL);
639 n = ng_hci_new_neighbor(unit);
677 con_compl(ng_hci_unit_p unit, struct mbuf *event)
697 LIST_FOREACH(con, &unit->con_list, next)
723 con = ng_hci_new_con(unit, ep->link_type);
776 if ((unit->features[0] & NG_HCI_LMP_SWITCH) &&
777 unit->role_switch)
779 if (unit->features[0] & NG_HCI_LMP_HOLD_MODE)
781 if (unit->features[0] & NG_HCI_LMP_SNIFF_MODE)
783 if (unit->features[1] & NG_HCI_LMP_PARK_MODE)
786 lp->cp.settings &= unit->link_policy_mask;
789 NG_BT_MBUFQ_ENQUEUE(&unit->cmdq, m);
790 if (!(unit->state & NG_HCI_UNIT_COMMAND_PENDING))
791 ng_hci_send_command(unit);
803 con_req(ng_hci_unit_p unit, struct mbuf *event)
837 * an ACL connection to the remote unit, but we did not send
838 * command yet. At the same time the remote unit has requested
857 LIST_FOREACH(con, &unit->con_list, next)
865 con = ng_hci_new_con(unit, ep->link_type);
888 discon_compl(ng_hci_unit_p unit, struct mbuf *event)
910 con = ng_hci_con_by_handle(unit, h);
922 __func__, NG_NODE_NAME(unit->node), h);
934 encryption_change(ng_hci_unit_p unit, struct mbuf *event)
947 con = ng_hci_con_by_handle(unit, h);
953 __func__, NG_NODE_NAME(unit->node), h);
958 __func__, NG_NODE_NAME(unit->node),
969 __func__, NG_NODE_NAME(unit->node), ep->status);
981 read_remote_features_compl(ng_hci_unit_p unit, struct mbuf *event)
998 con = ng_hci_con_by_handle(unit, h);
1002 __func__, NG_NODE_NAME(unit->node), h);
1008 n = ng_hci_get_neighbor(unit, &con->bdaddr, NG_HCI_LINK_ACL);
1010 n = ng_hci_new_neighbor(unit);
1024 "%s: %s - failed to read remote unit features, status=%d\n",
1025 __func__, NG_NODE_NAME(unit->node), ep->status);
1034 qos_setup_compl(ng_hci_unit_p unit, struct mbuf *event)
1049 con = ng_hci_con_by_handle(unit, h);
1053 __func__, NG_NODE_NAME(unit->node), h);
1058 __func__, NG_NODE_NAME(unit->node), con->link_type, h);
1063 __func__, NG_NODE_NAME(unit->node),
1076 hardware_error(ng_hci_unit_p unit, struct mbuf *event)
1080 __func__, NG_NODE_NAME(unit->node), *mtod(event, u_int8_t *));
1089 role_change(ng_hci_unit_p unit, struct mbuf *event)
1102 con = ng_hci_con_by_bdaddr(unit, &ep->bdaddr, NG_HCI_LINK_ACL);
1108 __func__, NG_NODE_NAME(unit->node),
1115 __func__, NG_NODE_NAME(unit->node), ep->status,
1126 num_compl_pkts(ng_hci_unit_p unit, struct mbuf *event)
1151 con = ng_hci_con_by_handle(unit, h);
1157 "handle=%d, pending=%d, ncp=%d\n", __func__, NG_NODE_NAME(unit->node),
1165 NG_HCI_BUFF_ACL_FREE(unit->buffer, p);
1167 NG_HCI_BUFF_SCO_FREE(unit->buffer, p);
1171 __func__, NG_NODE_NAME(unit->node), h);
1177 ng_hci_send_data(unit);
1184 mode_change(ng_hci_unit_p unit, struct mbuf *event)
1199 con = ng_hci_con_by_handle(unit, h);
1203 __func__, NG_NODE_NAME(unit->node), h);
1208 __func__, NG_NODE_NAME(unit->node),
1216 __func__, NG_NODE_NAME(unit->node), ep->status);
1225 data_buffer_overflow(ng_hci_unit_p unit, struct mbuf *event)
1229 __func__, NG_NODE_NAME(unit->node),
1239 read_clock_offset_compl(ng_hci_unit_p unit, struct mbuf *event)
1255 con = ng_hci_con_by_handle(unit, h);
1259 __func__, NG_NODE_NAME(unit->node), h);
1265 n = ng_hci_get_neighbor(unit, &con->bdaddr, NG_HCI_LINK_ACL);
1267 n = ng_hci_new_neighbor(unit);
1282 __func__, NG_NODE_NAME(unit->node), ep->status);
1291 qos_violation(ng_hci_unit_p unit, struct mbuf *event)
1306 con = ng_hci_con_by_handle(unit, h);
1310 __func__, NG_NODE_NAME(unit->node), h);
1315 __func__, NG_NODE_NAME(unit->node), con->link_type);
1320 __func__, NG_NODE_NAME(unit->node), con->state, h);
1332 page_scan_mode_change(ng_hci_unit_p unit, struct mbuf *event)
1345 n = ng_hci_get_neighbor(unit, &ep->bdaddr, NG_HCI_LINK_ACL);
1347 n = ng_hci_new_neighbor(unit);
1367 page_scan_rep_mode_change(ng_hci_unit_p unit, struct mbuf *event)
1380 n = ng_hci_get_neighbor(unit, &ep->bdaddr, NG_HCI_LINK_ACL);
1382 n = ng_hci_new_neighbor(unit);