Lines Matching defs:con

249 	ng_hci_unit_con_p	con = NULL, winner = NULL;
262 LIST_FOREACH(con, &unit->con_list, next) {
263 if (con->link_type != link_type)
265 if (NG_BT_ITEMQ_LEN(&con->conq) == 0)
268 if (con->pending < min_pending) {
269 winner = con;
270 min_pending = con->pending;
342 sync_con_queue(ng_hci_unit_p unit, ng_hci_unit_con_p con, int completed)
349 hook = (con->link_type == NG_HCI_LINK_ACL)? unit->acl : unit->sco;
359 state->con_handle = con->con_handle;
432 ng_hci_unit_con_p con = NULL;
444 * 1) con->link_type == ep->link_type
445 * 2) con->state == NG_HCI_CON_W4_CONN_COMPLETE
446 * 3) con->bdaddr == ep->bdaddr
449 LIST_FOREACH(con, &unit->con_list, next)
450 if (con->link_type == ep->link_type &&
451 con->state == NG_HCI_CON_W4_CONN_COMPLETE &&
452 bcmp(&con->bdaddr, &ep->bdaddr, sizeof(bdaddr_t)) == 0)
471 if (con == NULL) {
475 con = ng_hci_new_con(unit, ep->link_type);
476 if (con == NULL) {
481 bcopy(&ep->bdaddr, &con->bdaddr, sizeof(con->bdaddr));
482 } else if ((error = ng_hci_con_untimeout(con)) != 0)
490 con->con_handle = NG_HCI_CON_HANDLE(le16toh(ep->con_handle));
491 con->encryption_mode = ep->encryption_mode;
493 ng_hci_lp_con_cfm(con, ep->status);
497 ng_hci_free_con(con);
499 con->state = NG_HCI_CON_OPEN;
558 ng_hci_unit_con_p con = NULL;
570 * 1) con->link_type == ep->link_type
572 * 2) con->state == NG_HCI_CON_W4_LP_CON_RSP ||
573 * con->state == NG_HCI_CON_W4_CONN_COMPL
575 * 3) con->bdaddr == ep->bdaddr
609 LIST_FOREACH(con, &unit->con_list, next)
610 if (con->link_type == ep->link_type &&
611 (con->state == NG_HCI_CON_W4_LP_CON_RSP ||
612 con->state == NG_HCI_CON_W4_CONN_COMPLETE) &&
613 bcmp(&con->bdaddr, &ep->bdaddr, sizeof(bdaddr_t)) == 0)
616 if (con == NULL) {
617 con = ng_hci_new_con(unit, ep->link_type);
618 if (con != NULL) {
619 bcopy(&ep->bdaddr, &con->bdaddr, sizeof(con->bdaddr));
621 con->state = NG_HCI_CON_W4_LP_CON_RSP;
622 ng_hci_con_timeout(con);
624 error = ng_hci_lp_con_ind(con, ep->uclass);
626 ng_hci_con_untimeout(con);
627 ng_hci_free_con(con);
643 ng_hci_unit_con_p con = NULL;
662 con = ng_hci_con_by_handle(unit, h);
663 if (con != NULL) {
664 error = ng_hci_lp_discon_ind(con, ep->reason);
667 if (con->flags & NG_HCI_CON_TIMEOUT_PENDING)
668 ng_hci_con_untimeout(con);
670 ng_hci_free_con(con);
689 ng_hci_unit_con_p con = NULL;
701 con = ng_hci_con_by_handle(unit, h);
702 if (con == NULL) {
707 } else if (con->link_type != NG_HCI_LINK_ACL) {
711 con->link_type);
715 con->encryption_mode = NG_HCI_ENCRYPTION_MODE_P2P;
717 con->encryption_mode = NG_HCI_ENCRYPTION_MODE_NONE;
733 ng_hci_unit_con_p con = NULL;
747 con = ng_hci_con_by_handle(unit, h);
748 if (con == NULL) {
757 n = ng_hci_get_neighbor(unit, &con->bdaddr);
765 bcopy(&con->bdaddr, &n->bdaddr, sizeof(n->bdaddr));
785 ng_hci_unit_con_p con = NULL;
797 con = ng_hci_con_by_handle(unit, h);
798 if (con == NULL) {
803 } else if (con->link_type != NG_HCI_LINK_ACL) {
806 __func__, NG_NODE_NAME(unit->node), con->link_type, h);
808 } else if (con->state != NG_HCI_CON_OPEN) {
812 con->state, h);
815 error = ng_hci_lp_qos_cfm(con, ep->status);
840 ng_hci_unit_con_p con = NULL;
850 con = ng_hci_con_by_bdaddr(unit, &ep->bdaddr, NG_HCI_LINK_ACL);
851 if (con != NULL)
852 con->role = ep->role;
877 ng_hci_unit_con_p con = NULL;
899 con = ng_hci_con_by_handle(unit, h);
900 if (con != NULL) {
901 con->pending -= p;
902 if (con->pending < 0) {
906 con->con_handle, con->pending, p);
908 con->pending = 0;
912 if (con->link_type == NG_HCI_LINK_ACL)
935 ng_hci_unit_con_p con = NULL;
947 con = ng_hci_con_by_handle(unit, h);
948 if (con == NULL) {
953 } else if (con->link_type != NG_HCI_LINK_ACL) {
957 con->link_type);
960 con->mode = ep->unit_mode;
990 ng_hci_unit_con_p con = NULL;
1003 con = ng_hci_con_by_handle(unit, h);
1004 if (con == NULL) {
1013 n = ng_hci_get_neighbor(unit, &con->bdaddr);
1021 bcopy(&con->bdaddr, &n->bdaddr, sizeof(n->bdaddr));
1041 ng_hci_unit_con_p con = NULL;
1053 con = ng_hci_con_by_handle(unit, h);
1054 if (con == NULL) {
1059 } else if (con->link_type != NG_HCI_LINK_ACL) {
1062 __func__, NG_NODE_NAME(unit->node), con->link_type);
1064 } else if (con->state != NG_HCI_CON_OPEN) {
1067 __func__, NG_NODE_NAME(unit->node), con->state, h);
1070 error = ng_hci_lp_qos_ind(con);