Lines Matching refs:p_hcon
136 tHID_CONN *p_hcon = &hh_cb.devices[dhandle].conn; in hidh_conn_disconnect() local
140 if ((p_hcon->ctrl_cid != 0) || (p_hcon->intr_cid != 0)) in hidh_conn_disconnect()
142 p_hcon->conn_state = HID_CONN_STATE_DISCONNECTING; in hidh_conn_disconnect()
148 if (p_hcon->intr_cid) in hidh_conn_disconnect()
149 L2CA_DisconnectReq (p_hcon->intr_cid); in hidh_conn_disconnect()
150 else if (p_hcon->ctrl_cid) in hidh_conn_disconnect()
151 L2CA_DisconnectReq (p_hcon->ctrl_cid); in hidh_conn_disconnect()
155 p_hcon->conn_state = HID_CONN_STATE_UNUSED; in hidh_conn_disconnect()
212 tHID_CONN *p_hcon; in hidh_l2cif_connect_ind() local
226 p_hcon = &hh_cb.devices[i].conn; in hidh_l2cif_connect_ind()
232 if (p_hcon->ctrl_cid == 0) in hidh_l2cif_connect_ind()
237 if (p_hcon->conn_state != HID_CONN_STATE_CONNECTING_INTR) in hidh_l2cif_connect_ind()
240 p_hcon->conn_state); in hidh_l2cif_connect_ind()
247 p_hcon->ctrl_cid = p_hcon->intr_cid = 0; in hidh_l2cif_connect_ind()
248 p_hcon->conn_state = HID_CONN_STATE_UNUSED; in hidh_l2cif_connect_ind()
250 if (p_hcon->conn_state != HID_CONN_STATE_UNUSED) in hidh_l2cif_connect_ind()
253 p_hcon->conn_state); in hidh_l2cif_connect_ind()
267 p_hcon->conn_flags = 0; in hidh_l2cif_connect_ind()
268 p_hcon->ctrl_cid = l2cap_cid; in hidh_l2cif_connect_ind()
269 p_hcon->ctrl_id = l2cap_id; in hidh_l2cif_connect_ind()
270 …p_hcon->disc_reason = HID_L2CAP_CONN_FAIL; /* In case disconnection occurs before security is com… in hidh_l2cif_connect_ind()
272 p_hcon->conn_state = HID_CONN_STATE_SECURITY; in hidh_l2cif_connect_ind()
285 p_hcon->conn_state = HID_CONN_STATE_CONFIG; in hidh_l2cif_connect_ind()
286 p_hcon->intr_cid = l2cap_cid; in hidh_l2cif_connect_ind()
390 tHID_CONN *p_hcon = NULL; in hidh_l2cif_connect_cfm() local
398 p_hcon = &hh_cb.devices[dhandle].conn; in hidh_l2cif_connect_cfm()
401 if ((p_hcon == NULL) in hidh_l2cif_connect_cfm()
402 || (!(p_hcon->conn_flags & HID_CONN_FLAGS_IS_ORIG)) in hidh_l2cif_connect_cfm()
403 || ((l2cap_cid == p_hcon->ctrl_cid) && (p_hcon->conn_state != HID_CONN_STATE_CONNECTING_CTRL)) in hidh_l2cif_connect_cfm()
404 || ((l2cap_cid == p_hcon->intr_cid) && (p_hcon->conn_state != HID_CONN_STATE_CONNECTING_INTR) in hidh_l2cif_connect_cfm()
405 && (p_hcon->conn_state != HID_CONN_STATE_DISCONNECTING))) in hidh_l2cif_connect_cfm()
413 if (l2cap_cid == p_hcon->ctrl_cid) in hidh_l2cif_connect_cfm()
414 p_hcon->ctrl_cid = 0; in hidh_l2cif_connect_cfm()
416 p_hcon->intr_cid = 0; in hidh_l2cif_connect_cfm()
436 if (l2cap_cid == p_hcon->ctrl_cid) in hidh_l2cif_connect_cfm()
439 p_hcon->conn_state = HID_CONN_STATE_SECURITY; in hidh_l2cif_connect_cfm()
440 …p_hcon->disc_reason = HID_L2CAP_CONN_FAIL; /* In case disconnection occurs before security is com… in hidh_l2cif_connect_cfm()
449 p_hcon->conn_state = HID_CONN_STATE_CONFIG; in hidh_l2cif_connect_cfm()
471 tHID_CONN *p_hcon = NULL; in hidh_l2cif_config_ind() local
477 p_hcon = &hh_cb.devices[dhandle].conn; in hidh_l2cif_config_ind()
480 if (p_hcon == NULL) in hidh_l2cif_config_ind()
490 p_hcon->rem_mtu_size = HID_HOST_MTU; in hidh_l2cif_config_ind()
492 p_hcon->rem_mtu_size = p_cfg->mtu; in hidh_l2cif_config_ind()
501 if (l2cap_cid == p_hcon->ctrl_cid) in hidh_l2cif_config_ind()
503 p_hcon->conn_flags |= HID_CONN_FLAGS_HIS_CTRL_CFG_DONE; in hidh_l2cif_config_ind()
504 if ((p_hcon->conn_flags & HID_CONN_FLAGS_IS_ORIG) && in hidh_l2cif_config_ind()
505 (p_hcon->conn_flags & HID_CONN_FLAGS_MY_CTRL_CFG_DONE)) in hidh_l2cif_config_ind()
508 …p_hcon->disc_reason = HID_L2CAP_CONN_FAIL; /* Reset initial reason for CLOSE_EVT: Connection Attem… in hidh_l2cif_config_ind()
509 … if ((p_hcon->intr_cid = L2CA_ConnectReq (HID_PSM_INTERRUPT, hh_cb.devices[dhandle].addr)) == 0) in hidh_l2cif_config_ind()
513 p_hcon->conn_state = HID_CONN_STATE_UNUSED; in hidh_l2cif_config_ind()
521 p_hcon->conn_state = HID_CONN_STATE_CONNECTING_INTR; in hidh_l2cif_config_ind()
526 p_hcon->conn_flags |= HID_CONN_FLAGS_HIS_INTR_CFG_DONE; in hidh_l2cif_config_ind()
529 if (((p_hcon->conn_flags & HID_CONN_FLAGS_ALL_CONFIGURED) == HID_CONN_FLAGS_ALL_CONFIGURED) in hidh_l2cif_config_ind()
530 && (p_hcon->conn_state == HID_CONN_STATE_CONFIG)) in hidh_l2cif_config_ind()
532 p_hcon->conn_state = HID_CONN_STATE_CONNECTED; in hidh_l2cif_config_ind()
534 p_hcon->disc_reason = HID_SUCCESS; in hidh_l2cif_config_ind()
555 tHID_CONN *p_hcon = NULL; in hidh_l2cif_config_cfm() local
562 p_hcon = &hh_cb.devices[dhandle].conn; in hidh_l2cif_config_cfm()
564 if (p_hcon == NULL) in hidh_l2cif_config_cfm()
579 if (l2cap_cid == p_hcon->ctrl_cid) in hidh_l2cif_config_cfm()
581 p_hcon->conn_flags |= HID_CONN_FLAGS_MY_CTRL_CFG_DONE; in hidh_l2cif_config_cfm()
582 if ((p_hcon->conn_flags & HID_CONN_FLAGS_IS_ORIG) && in hidh_l2cif_config_cfm()
583 (p_hcon->conn_flags & HID_CONN_FLAGS_HIS_CTRL_CFG_DONE)) in hidh_l2cif_config_cfm()
586 …p_hcon->disc_reason = HID_L2CAP_CONN_FAIL; /* Reset initial reason for CLOSE_EVT: Connection Atte… in hidh_l2cif_config_cfm()
587 … if ((p_hcon->intr_cid = L2CA_ConnectReq (HID_PSM_INTERRUPT, hh_cb.devices[dhandle].addr)) == 0) in hidh_l2cif_config_cfm()
591 p_hcon->conn_state = HID_CONN_STATE_UNUSED; in hidh_l2cif_config_cfm()
599 p_hcon->conn_state = HID_CONN_STATE_CONNECTING_INTR; in hidh_l2cif_config_cfm()
604 p_hcon->conn_flags |= HID_CONN_FLAGS_MY_INTR_CFG_DONE; in hidh_l2cif_config_cfm()
607 if (((p_hcon->conn_flags & HID_CONN_FLAGS_ALL_CONFIGURED) == HID_CONN_FLAGS_ALL_CONFIGURED) in hidh_l2cif_config_cfm()
608 && (p_hcon->conn_state == HID_CONN_STATE_CONFIG)) in hidh_l2cif_config_cfm()
610 p_hcon->conn_state = HID_CONN_STATE_CONNECTED; in hidh_l2cif_config_cfm()
612 p_hcon->disc_reason = HID_SUCCESS; in hidh_l2cif_config_cfm()
633 tHID_CONN *p_hcon = NULL; in hidh_l2cif_disconnect_ind() local
639 p_hcon = &hh_cb.devices[dhandle].conn; in hidh_l2cif_disconnect_ind()
641 if (p_hcon == NULL) in hidh_l2cif_disconnect_ind()
652 p_hcon->conn_state = HID_CONN_STATE_DISCONNECTING; in hidh_l2cif_disconnect_ind()
654 if (l2cap_cid == p_hcon->ctrl_cid) in hidh_l2cif_disconnect_ind()
655 p_hcon->ctrl_cid = 0; in hidh_l2cif_disconnect_ind()
657 p_hcon->intr_cid = 0; in hidh_l2cif_disconnect_ind()
659 if ((p_hcon->ctrl_cid == 0) && (p_hcon->intr_cid == 0)) in hidh_l2cif_disconnect_ind()
662 p_hcon->conn_state = HID_CONN_STATE_UNUSED; in hidh_l2cif_disconnect_ind()
683 hid_close_evt_reason = p_hcon->disc_reason; in hidh_l2cif_disconnect_ind()
716 tHID_CONN *p_hcon = NULL; in hidh_l2cif_disconnect_cfm() local
721 p_hcon = &hh_cb.devices[dhandle].conn; in hidh_l2cif_disconnect_cfm()
723 if (p_hcon == NULL) in hidh_l2cif_disconnect_cfm()
731 if (l2cap_cid == p_hcon->ctrl_cid) in hidh_l2cif_disconnect_cfm()
732 p_hcon->ctrl_cid = 0; in hidh_l2cif_disconnect_cfm()
735 p_hcon->intr_cid = 0; in hidh_l2cif_disconnect_cfm()
736 if (p_hcon->ctrl_cid) in hidh_l2cif_disconnect_cfm()
739 L2CA_DisconnectReq (p_hcon->ctrl_cid); in hidh_l2cif_disconnect_cfm()
743 if ((p_hcon->ctrl_cid == 0) && (p_hcon->intr_cid == 0)) in hidh_l2cif_disconnect_cfm()
746 p_hcon->conn_state = HID_CONN_STATE_UNUSED; in hidh_l2cif_disconnect_cfm()
747 …hh_cb.callback( dhandle, hh_cb.devices[dhandle].addr, HID_HDEV_EVT_CLOSE, p_hcon->disc_reason, NUL… in hidh_l2cif_disconnect_cfm()
764 tHID_CONN *p_hcon = NULL; in hidh_l2cif_cong_ind() local
768 p_hcon = &hh_cb.devices[dhandle].conn; in hidh_l2cif_cong_ind()
770 if (p_hcon == NULL) in hidh_l2cif_cong_ind()
779 p_hcon->conn_flags |= HID_CONN_FLAGS_CONGESTED; in hidh_l2cif_cong_ind()
782 p_hcon->conn_flags &= ~HID_CONN_FLAGS_CONGESTED; in hidh_l2cif_cong_ind()
808 tHID_CONN *p_hcon = NULL; in hidh_l2cif_data_ind() local
814 p_hcon = &hh_cb.devices[dhandle].conn; in hidh_l2cif_data_ind()
816 if (p_hcon == NULL) in hidh_l2cif_data_ind()
886 tHID_CONN *p_hcon = &hh_cb.devices[dhandle].conn; in hidh_conn_snd_data() local
903 if (p_hcon->conn_flags & HID_CONN_FLAGS_CONGESTED) in hidh_conn_snd_data()
918 cid = p_hcon->ctrl_cid; in hidh_conn_snd_data()
922 cid = p_hcon->intr_cid; in hidh_conn_snd_data()
946 else if ( (buf->len > (p_hcon->rem_mtu_size - 1))) in hidh_conn_snd_data()
953 bytes_copied = p_hcon->rem_mtu_size - 1; in hidh_conn_snd_data()
995 if ((p_hcon->conn_flags & HID_CONN_FLAGS_CONGESTED) || (!L2CA_DataWrite (cid, p_buf))) in hidh_conn_snd_data()
1000 else if( bytes_copied == (p_hcon->rem_mtu_size - 1) ) in hidh_conn_snd_data()