Lines Matching refs:p_hcon

130   tHID_CONN* p_hcon = &hh_cb.devices[dhandle].conn;  in hidh_conn_disconnect()  local
134 if ((p_hcon->ctrl_cid != 0) || (p_hcon->intr_cid != 0)) { in hidh_conn_disconnect()
135 p_hcon->conn_state = HID_CONN_STATE_DISCONNECTING; in hidh_conn_disconnect()
142 if (p_hcon->intr_cid) in hidh_conn_disconnect()
143 L2CA_DisconnectReq(p_hcon->intr_cid); in hidh_conn_disconnect()
144 else if (p_hcon->ctrl_cid) in hidh_conn_disconnect()
145 L2CA_DisconnectReq(p_hcon->ctrl_cid); in hidh_conn_disconnect()
147 p_hcon->conn_state = HID_CONN_STATE_UNUSED; in hidh_conn_disconnect()
207 tHID_CONN* p_hcon; in hidh_l2cif_connect_ind() local
221 p_hcon = &hh_cb.devices[i].conn; in hidh_l2cif_connect_ind()
226 if (p_hcon->ctrl_cid == 0) { in hidh_l2cif_connect_ind()
231 if (p_hcon->conn_state != HID_CONN_STATE_CONNECTING_INTR) { in hidh_l2cif_connect_ind()
233 p_hcon->conn_state); in hidh_l2cif_connect_ind()
239 p_hcon->ctrl_cid = p_hcon->intr_cid = 0; in hidh_l2cif_connect_ind()
240 p_hcon->conn_state = HID_CONN_STATE_UNUSED; in hidh_l2cif_connect_ind()
242 if (p_hcon->conn_state != HID_CONN_STATE_UNUSED) { in hidh_l2cif_connect_ind()
244 p_hcon->conn_state); in hidh_l2cif_connect_ind()
256 p_hcon->conn_flags = 0; in hidh_l2cif_connect_ind()
257 p_hcon->ctrl_cid = l2cap_cid; in hidh_l2cif_connect_ind()
258 p_hcon->ctrl_id = l2cap_id; in hidh_l2cif_connect_ind()
259 p_hcon->disc_reason = HID_L2CAP_CONN_FAIL; /* In case disconnection occurs in hidh_l2cif_connect_ind()
264 p_hcon->conn_state = HID_CONN_STATE_SECURITY; in hidh_l2cif_connect_ind()
277 p_hcon->conn_state = HID_CONN_STATE_CONFIG; in hidh_l2cif_connect_ind()
278 p_hcon->intr_cid = l2cap_cid; in hidh_l2cif_connect_ind()
378 tHID_CONN* p_hcon = NULL; in hidh_l2cif_connect_cfm() local
387 p_hcon = &hh_cb.devices[dhandle].conn; in hidh_l2cif_connect_cfm()
390 if ((p_hcon == NULL) || (!(p_hcon->conn_flags & HID_CONN_FLAGS_IS_ORIG)) || in hidh_l2cif_connect_cfm()
391 ((l2cap_cid == p_hcon->ctrl_cid) && in hidh_l2cif_connect_cfm()
392 (p_hcon->conn_state != HID_CONN_STATE_CONNECTING_CTRL)) || in hidh_l2cif_connect_cfm()
393 ((l2cap_cid == p_hcon->intr_cid) && in hidh_l2cif_connect_cfm()
394 (p_hcon->conn_state != HID_CONN_STATE_CONNECTING_INTR) && in hidh_l2cif_connect_cfm()
395 (p_hcon->conn_state != HID_CONN_STATE_DISCONNECTING))) { in hidh_l2cif_connect_cfm()
402 if (l2cap_cid == p_hcon->ctrl_cid) in hidh_l2cif_connect_cfm()
403 p_hcon->ctrl_cid = 0; in hidh_l2cif_connect_cfm()
405 p_hcon->intr_cid = 0; in hidh_l2cif_connect_cfm()
424 if (l2cap_cid == p_hcon->ctrl_cid) { in hidh_l2cif_connect_cfm()
426 p_hcon->conn_state = HID_CONN_STATE_SECURITY; in hidh_l2cif_connect_cfm()
427 p_hcon->disc_reason = HID_L2CAP_CONN_FAIL; /* In case disconnection occurs in hidh_l2cif_connect_cfm()
437 p_hcon->conn_state = HID_CONN_STATE_CONFIG; in hidh_l2cif_connect_cfm()
459 tHID_CONN* p_hcon = NULL; in hidh_l2cif_config_ind() local
465 p_hcon = &hh_cb.devices[dhandle].conn; in hidh_l2cif_config_ind()
468 if (p_hcon == NULL) { in hidh_l2cif_config_ind()
478 p_hcon->rem_mtu_size = HID_HOST_MTU; in hidh_l2cif_config_ind()
480 p_hcon->rem_mtu_size = p_cfg->mtu; in hidh_l2cif_config_ind()
489 if (l2cap_cid == p_hcon->ctrl_cid) { in hidh_l2cif_config_ind()
490 p_hcon->conn_flags |= HID_CONN_FLAGS_HIS_CTRL_CFG_DONE; in hidh_l2cif_config_ind()
491 if ((p_hcon->conn_flags & HID_CONN_FLAGS_IS_ORIG) && in hidh_l2cif_config_ind()
492 (p_hcon->conn_flags & HID_CONN_FLAGS_MY_CTRL_CFG_DONE)) { in hidh_l2cif_config_ind()
494 p_hcon->disc_reason = HID_L2CAP_CONN_FAIL; /* Reset initial reason for in hidh_l2cif_config_ind()
498 p_hcon->intr_cid = in hidh_l2cif_config_ind()
500 if (p_hcon->intr_cid == 0) { in hidh_l2cif_config_ind()
503 p_hcon->conn_state = HID_CONN_STATE_UNUSED; in hidh_l2cif_config_ind()
511 p_hcon->conn_state = HID_CONN_STATE_CONNECTING_INTR; in hidh_l2cif_config_ind()
515 p_hcon->conn_flags |= HID_CONN_FLAGS_HIS_INTR_CFG_DONE; in hidh_l2cif_config_ind()
519 if (((p_hcon->conn_flags & HID_CONN_FLAGS_ALL_CONFIGURED) == in hidh_l2cif_config_ind()
521 (p_hcon->conn_state == HID_CONN_STATE_CONFIG)) { in hidh_l2cif_config_ind()
522 p_hcon->conn_state = HID_CONN_STATE_CONNECTED; in hidh_l2cif_config_ind()
524 p_hcon->disc_reason = HID_SUCCESS; in hidh_l2cif_config_ind()
544 tHID_CONN* p_hcon = NULL; in hidh_l2cif_config_cfm() local
552 if (dhandle < HID_HOST_MAX_DEVICES) p_hcon = &hh_cb.devices[dhandle].conn; in hidh_l2cif_config_cfm()
554 if (p_hcon == NULL) { in hidh_l2cif_config_cfm()
569 if (l2cap_cid == p_hcon->ctrl_cid) { in hidh_l2cif_config_cfm()
570 p_hcon->conn_flags |= HID_CONN_FLAGS_MY_CTRL_CFG_DONE; in hidh_l2cif_config_cfm()
571 if ((p_hcon->conn_flags & HID_CONN_FLAGS_IS_ORIG) && in hidh_l2cif_config_cfm()
572 (p_hcon->conn_flags & HID_CONN_FLAGS_HIS_CTRL_CFG_DONE)) { in hidh_l2cif_config_cfm()
574 p_hcon->disc_reason = HID_L2CAP_CONN_FAIL; /* Reset initial reason for in hidh_l2cif_config_cfm()
578 p_hcon->intr_cid = in hidh_l2cif_config_cfm()
580 if (p_hcon->intr_cid == 0) { in hidh_l2cif_config_cfm()
583 p_hcon->conn_state = HID_CONN_STATE_UNUSED; in hidh_l2cif_config_cfm()
591 p_hcon->conn_state = HID_CONN_STATE_CONNECTING_INTR; in hidh_l2cif_config_cfm()
595 p_hcon->conn_flags |= HID_CONN_FLAGS_MY_INTR_CFG_DONE; in hidh_l2cif_config_cfm()
599 if (((p_hcon->conn_flags & HID_CONN_FLAGS_ALL_CONFIGURED) == in hidh_l2cif_config_cfm()
601 (p_hcon->conn_state == HID_CONN_STATE_CONFIG)) { in hidh_l2cif_config_cfm()
602 p_hcon->conn_state = HID_CONN_STATE_CONNECTED; in hidh_l2cif_config_cfm()
604 p_hcon->disc_reason = HID_SUCCESS; in hidh_l2cif_config_cfm()
624 tHID_CONN* p_hcon = NULL; in hidh_l2cif_disconnect_ind() local
630 if (dhandle < HID_HOST_MAX_DEVICES) p_hcon = &hh_cb.devices[dhandle].conn; in hidh_l2cif_disconnect_ind()
632 if (p_hcon == NULL) { in hidh_l2cif_disconnect_ind()
642 p_hcon->conn_state = HID_CONN_STATE_DISCONNECTING; in hidh_l2cif_disconnect_ind()
644 if (l2cap_cid == p_hcon->ctrl_cid) in hidh_l2cif_disconnect_ind()
645 p_hcon->ctrl_cid = 0; in hidh_l2cif_disconnect_ind()
647 p_hcon->intr_cid = 0; in hidh_l2cif_disconnect_ind()
649 if ((p_hcon->ctrl_cid == 0) && (p_hcon->intr_cid == 0)) { in hidh_l2cif_disconnect_ind()
651 p_hcon->conn_state = HID_CONN_STATE_UNUSED; in hidh_l2cif_disconnect_ind()
671 hid_close_evt_reason = p_hcon->disc_reason; in hidh_l2cif_disconnect_ind()
704 tHID_CONN* p_hcon = NULL; in hidh_l2cif_disconnect_cfm() local
708 if (dhandle < HID_HOST_MAX_DEVICES) p_hcon = &hh_cb.devices[dhandle].conn; in hidh_l2cif_disconnect_cfm()
710 if (p_hcon == NULL) { in hidh_l2cif_disconnect_cfm()
718 if (l2cap_cid == p_hcon->ctrl_cid) in hidh_l2cif_disconnect_cfm()
719 p_hcon->ctrl_cid = 0; in hidh_l2cif_disconnect_cfm()
721 p_hcon->intr_cid = 0; in hidh_l2cif_disconnect_cfm()
722 if (p_hcon->ctrl_cid) { in hidh_l2cif_disconnect_cfm()
724 L2CA_DisconnectReq(p_hcon->ctrl_cid); in hidh_l2cif_disconnect_cfm()
728 if ((p_hcon->ctrl_cid == 0) && (p_hcon->intr_cid == 0)) { in hidh_l2cif_disconnect_cfm()
730 p_hcon->conn_state = HID_CONN_STATE_UNUSED; in hidh_l2cif_disconnect_cfm()
732 p_hcon->disc_reason, NULL); in hidh_l2cif_disconnect_cfm()
747 tHID_CONN* p_hcon = NULL; in hidh_l2cif_cong_ind() local
751 if (dhandle < HID_HOST_MAX_DEVICES) p_hcon = &hh_cb.devices[dhandle].conn; in hidh_l2cif_cong_ind()
753 if (p_hcon == NULL) { in hidh_l2cif_cong_ind()
763 p_hcon->conn_flags |= HID_CONN_FLAGS_CONGESTED; in hidh_l2cif_cong_ind()
765 p_hcon->conn_flags &= ~HID_CONN_FLAGS_CONGESTED; in hidh_l2cif_cong_ind()
789 tHID_CONN* p_hcon = NULL; in hidh_l2cif_data_ind() local
796 if (dhandle < HID_HOST_MAX_DEVICES) p_hcon = &hh_cb.devices[dhandle].conn; in hidh_l2cif_data_ind()
798 if (p_hcon == NULL) { in hidh_l2cif_data_ind()
878 tHID_CONN* p_hcon = &hh_cb.devices[dhandle].conn; in hidh_conn_snd_data() local
895 if (p_hcon->conn_flags & HID_CONN_FLAGS_CONGESTED) { in hidh_conn_snd_data()
908 cid = p_hcon->ctrl_cid; in hidh_conn_snd_data()
912 cid = p_hcon->intr_cid; in hidh_conn_snd_data()
933 } else if ((buf->len > (p_hcon->rem_mtu_size - 1))) { in hidh_conn_snd_data()
939 bytes_copied = p_hcon->rem_mtu_size - 1; in hidh_conn_snd_data()
972 if ((p_hcon->conn_flags & HID_CONN_FLAGS_CONGESTED) || in hidh_conn_snd_data()
978 else if (bytes_copied == (p_hcon->rem_mtu_size - 1)) { in hidh_conn_snd_data()