Lines Matching refs:con

128 	ng_hci_unit_con_p		 con = NULL;
162 con = ng_hci_con_by_bdaddr(unit, &ep->bdaddr, NG_HCI_LINK_ACL);
163 if (con != NULL) {
164 switch (con->state) {
171 con->flags |= NG_HCI_CON_NOTIFY_ACL;
173 con->flags |= NG_HCI_CON_NOTIFY_SCO;
190 cfm->link_type = con->link_type;
191 cfm->con_handle = con->con_handle;
192 bcopy(&con->bdaddr, &cfm->bdaddr,
214 __func__, NG_NODE_NAME(unit->node), con->state);
227 con = ng_hci_new_con(unit, NG_HCI_LINK_ACL);
228 if (con == NULL) {
233 bcopy(&ep->bdaddr, &con->bdaddr, sizeof(con->bdaddr));
241 ng_hci_free_con(con);
295 con->flags |= NG_HCI_CON_NOTIFY_ACL;
297 con->flags |= NG_HCI_CON_NOTIFY_SCO;
299 con->state = NG_HCI_CON_W4_CONN_COMPLETE;
300 ng_hci_con_timeout(con);
492 ng_hci_unit_con_p con = NULL;
529 con = ng_hci_con_by_bdaddr(unit, &ep->bdaddr, link_type);
530 if (con != NULL) {
531 switch (con->state) {
538 con->flags |= NG_HCI_CON_NOTIFY_ACL;
540 con->flags |= NG_HCI_CON_NOTIFY_SCO;
557 cfm->link_type = con->link_type;
558 cfm->con_handle = con->con_handle;
559 bcopy(&con->bdaddr, &cfm->bdaddr,
581 __func__, NG_NODE_NAME(unit->node), con->state);
594 con = ng_hci_new_con(unit, link_type);
595 if (con == NULL) {
600 bcopy(&ep->bdaddr, &con->bdaddr, sizeof(con->bdaddr));
608 ng_hci_free_con(con);
637 con->flags |= NG_HCI_CON_NOTIFY_ACL;
639 con->flags |= NG_HCI_CON_NOTIFY_SCO;
641 con->state = NG_HCI_CON_W4_CONN_COMPLETE;
642 ng_hci_con_timeout(con);
670 ng_hci_unit_con_p con = NULL;
696 con = ng_hci_con_by_handle(unit, ep->con_handle);
697 if (con == NULL) {
706 if (con->state != NG_HCI_CON_OPEN) {
709 __func__, NG_NODE_NAME(unit->node), con->state,
754 ng_hci_lp_con_cfm(ng_hci_unit_con_p con, int status)
756 ng_hci_unit_p unit = con->unit;
767 if (con->link_type != NG_HCI_LINK_SCO &&
768 con->flags & NG_HCI_CON_NOTIFY_ACL) {
775 ep->link_type = con->link_type;
776 ep->con_handle = con->con_handle;
777 bcopy(&con->bdaddr, &ep->bdaddr,
788 con->flags &= ~NG_HCI_CON_NOTIFY_ACL;
791 if (con->flags & NG_HCI_CON_NOTIFY_SCO) {
798 ep->link_type = con->link_type;
799 ep->con_handle = con->con_handle;
800 bcopy(&con->bdaddr, &ep->bdaddr,
811 con->flags &= ~NG_HCI_CON_NOTIFY_SCO;
818 ng_hci_lp_enc_change(ng_hci_unit_con_p con, int status)
820 ng_hci_unit_p unit = con->unit;
826 if (con->link_type != NG_HCI_LINK_SCO) {
833 ep->link_type = con->link_type;
834 ep->con_handle = con->con_handle;
853 ng_hci_lp_con_ind(ng_hci_unit_con_p con, u_int8_t *uclass)
855 ng_hci_unit_p unit = con->unit;
866 if (con->link_type != NG_HCI_LINK_SCO)
878 ep->link_type = con->link_type;
880 bcopy(&con->bdaddr, &ep->bdaddr, sizeof(ep->bdaddr));
909 ng_hci_unit_con_p con = NULL;
942 * 1) con->link_type == ep->link_type
944 * 2) con->state == NG_HCI_CON_W4_LP_CON_RSP ||
945 * con->state == NG_HCI_CON_W4_CONN_COMPLETE
947 * 3) con->bdaddr == ep->bdaddr
967 LIST_FOREACH(con, &unit->con_list, next)
968 if (con->link_type == ep->link_type &&
969 (con->state == NG_HCI_CON_W4_LP_CON_RSP ||
970 con->state == NG_HCI_CON_W4_CONN_COMPLETE) &&
971 bcmp(&con->bdaddr, &ep->bdaddr, sizeof(bdaddr_t)) == 0)
974 if (con == NULL) {
986 if ((error = ng_hci_con_untimeout(con)) != 0)
989 switch (con->state) {
1033 con->flags |= NG_HCI_CON_NOTIFY_ACL;
1035 con->flags |= NG_HCI_CON_NOTIFY_SCO;
1037 con->state = NG_HCI_CON_W4_CONN_COMPLETE;
1038 ng_hci_con_timeout(con);
1055 ng_hci_free_con(con);
1069 con->flags |= NG_HCI_CON_NOTIFY_ACL;
1071 con->flags |= NG_HCI_CON_NOTIFY_SCO;
1079 __func__, NG_NODE_NAME(unit->node), con->state);
1093 ng_hci_lp_discon_ind(ng_hci_unit_con_p con, int reason)
1095 ng_hci_unit_p unit = con->unit;
1107 if (con->link_type != NG_HCI_LINK_SCO) {
1116 ep->link_type = con->link_type;
1117 ep->con_handle = con->con_handle;
1134 ep->link_type = con->link_type;
1135 ep->con_handle = con->con_handle;
1158 ng_hci_unit_con_p con = NULL;
1184 con = ng_hci_con_by_handle(unit, ep->con_handle);
1185 if (con == NULL) {
1194 if (con->link_type != NG_HCI_LINK_ACL) {
1196 __func__, NG_NODE_NAME(unit->node), con->link_type);
1202 if (con->state != NG_HCI_CON_OPEN) {
1205 __func__, NG_NODE_NAME(unit->node), con->state,
1206 con->con_handle);
1242 con->flags |= NG_HCI_CON_NOTIFY_ACL;
1244 con->flags |= NG_HCI_CON_NOTIFY_SCO;
1264 ng_hci_lp_qos_cfm(ng_hci_unit_con_p con, int status)
1266 ng_hci_unit_p unit = con->unit;
1271 if (con->flags & NG_HCI_CON_NOTIFY_ACL) {
1278 ep->con_handle = con->con_handle;
1288 con->flags &= ~NG_HCI_CON_NOTIFY_ACL;
1291 if (con->flags & NG_HCI_CON_NOTIFY_SCO) {
1298 ep->con_handle = con->con_handle;
1308 con->flags &= ~NG_HCI_CON_NOTIFY_SCO;
1319 ng_hci_lp_qos_ind(ng_hci_unit_con_p con)
1321 ng_hci_unit_p unit = con->unit;
1338 ep->con_handle = con->con_handle;
1353 ep->con_handle = con->con_handle;
1372 ng_hci_unit_con_p con = NULL;
1380 con = ng_hci_con_by_handle(unit, con_handle);
1382 if (con == NULL) {
1389 if (!(con->flags & NG_HCI_CON_TIMEOUT_PENDING)) {
1392 __func__, NG_NODE_NAME(node), con_handle, con->state,
1393 con->flags);
1397 con->flags &= ~NG_HCI_CON_TIMEOUT_PENDING;
1412 switch (con->state) {
1417 ng_hci_lp_con_cfm(con, 0xee);
1423 __func__, NG_NODE_NAME(node), con->state);
1427 ng_hci_free_con(con);