Lines Matching refs:con

145 		ng_hci_unit_con_p	con = LIST_FIRST(&unit->con_list);
148 if (con->flags & NG_HCI_CON_TIMEOUT_PENDING)
149 ng_hci_con_untimeout(con);
156 ng_hci_lp_discon_ind(con, reason);
157 ng_hci_free_con(con);
258 ng_hci_unit_con_p con = NULL;
262 con = malloc(sizeof(*con), M_NETGRAPH_HCI,
264 if (con != NULL) {
265 con->unit = unit;
266 con->state = NG_HCI_CON_CLOSED;
282 con->con_handle = fake_con_handle ++;
286 con->link_type = link_type;
288 if (con->link_type != NG_HCI_LINK_SCO)
293 NG_BT_ITEMQ_INIT(&con->conq, num_pkts);
295 ng_callout_init(&con->con_timo);
297 LIST_INSERT_HEAD(&unit->con_list, con, next);
300 return (con);
308 ng_hci_free_con(ng_hci_unit_con_p con)
310 LIST_REMOVE(con, next);
317 if (con->link_type != NG_HCI_LINK_SCO)
318 NG_HCI_BUFF_ACL_FREE(con->unit->buffer, con->pending);
320 NG_HCI_BUFF_SCO_FREE(con->unit->buffer, con->pending);
322 NG_BT_ITEMQ_DESTROY(&con->conq);
324 bzero(con, sizeof(*con));
325 free(con, M_NETGRAPH_HCI);
335 ng_hci_unit_con_p con = NULL;
337 LIST_FOREACH(con, &unit->con_list, next)
338 if (con->con_handle == con_handle)
341 return (con);
351 ng_hci_unit_con_p con = NULL;
353 LIST_FOREACH(con, &unit->con_list, next)
354 if (con->link_type == link_type &&
355 bcmp(&con->bdaddr, bdaddr, sizeof(bdaddr_t)) == 0)
358 return (con);
406 ng_hci_con_timeout(ng_hci_unit_con_p con)
408 if (con->flags & NG_HCI_CON_TIMEOUT_PENDING)
411 __func__, NG_NODE_NAME(con->unit->node));
413 con->flags |= NG_HCI_CON_TIMEOUT_PENDING;
414 ng_callout(&con->con_timo, con->unit->node, NULL,
417 con->con_handle);
427 ng_hci_con_untimeout(ng_hci_unit_con_p con)
429 if (!(con->flags & NG_HCI_CON_TIMEOUT_PENDING))
431 "%s: %s - No connection timeout!\n", __func__, NG_NODE_NAME(con->unit->node));
433 if (ng_uncallout(&con->con_timo, con->unit->node) == 0)
436 con->flags &= ~NG_HCI_CON_TIMEOUT_PENDING;