Lines Matching defs:con

146 		ng_hci_unit_con_p	con = LIST_FIRST(&unit->con_list);
149 if (con->flags & NG_HCI_CON_TIMEOUT_PENDING)
150 ng_hci_con_untimeout(con);
157 ng_hci_lp_discon_ind(con, reason);
158 ng_hci_free_con(con);
259 ng_hci_unit_con_p con = NULL;
263 con = malloc(sizeof(*con), M_NETGRAPH_HCI,
265 if (con != NULL) {
266 con->unit = unit;
267 con->state = NG_HCI_CON_CLOSED;
283 con->con_handle = fake_con_handle ++;
287 con->link_type = link_type;
289 if (con->link_type != NG_HCI_LINK_SCO)
294 NG_BT_ITEMQ_INIT(&con->conq, num_pkts);
296 ng_callout_init(&con->con_timo);
298 LIST_INSERT_HEAD(&unit->con_list, con, next);
301 return (con);
309 ng_hci_free_con(ng_hci_unit_con_p con)
311 LIST_REMOVE(con, next);
318 if (con->link_type != NG_HCI_LINK_SCO)
319 NG_HCI_BUFF_ACL_FREE(con->unit->buffer, con->pending);
321 NG_HCI_BUFF_SCO_FREE(con->unit->buffer, con->pending);
323 NG_BT_ITEMQ_DESTROY(&con->conq);
325 bzero(con, sizeof(*con));
326 free(con, M_NETGRAPH_HCI);
336 ng_hci_unit_con_p con = NULL;
338 LIST_FOREACH(con, &unit->con_list, next)
339 if (con->con_handle == con_handle)
342 return (con);
352 ng_hci_unit_con_p con = NULL;
354 LIST_FOREACH(con, &unit->con_list, next)
355 if (con->link_type == link_type &&
356 bcmp(&con->bdaddr, bdaddr, sizeof(bdaddr_t)) == 0)
359 return (con);
407 ng_hci_con_timeout(ng_hci_unit_con_p con)
409 if (con->flags & NG_HCI_CON_TIMEOUT_PENDING)
412 __func__, NG_NODE_NAME(con->unit->node));
414 con->flags |= NG_HCI_CON_TIMEOUT_PENDING;
415 ng_callout(&con->con_timo, con->unit->node, NULL,
418 con->con_handle);
428 ng_hci_con_untimeout(ng_hci_unit_con_p con)
430 if (!(con->flags & NG_HCI_CON_TIMEOUT_PENDING))
432 "%s: %s - No connection timeout!\n", __func__, NG_NODE_NAME(con->unit->node));
434 if (ng_uncallout(&con->con_timo, con->unit->node) < 1)
437 con->flags &= ~NG_HCI_CON_TIMEOUT_PENDING;