Lines Matching refs:p_hcon
81 tHID_CONN* p_hcon; in hidd_check_config_done() local
83 p_hcon = &hd_cb.device.conn; in hidd_check_config_done()
85 if (((p_hcon->conn_flags & HID_CONN_FLAGS_ALL_CONFIGURED) == in hidd_check_config_done()
87 (p_hcon->conn_state == HID_CONN_STATE_CONFIG)) { in hidd_check_config_done()
88 p_hcon->conn_state = HID_CONN_STATE_CONNECTED; in hidd_check_config_done()
96 L2CA_DataWrite(p_hcon->intr_cid, hd_cb.pending_data); in hidd_check_config_done()
180 tHID_CONN* p_hcon; in hidd_l2cif_connect_ind() local
195 p_hcon = &hd_cb.device.conn; in hidd_l2cif_connect_ind()
199 if (p_hcon->ctrl_cid == 0) { in hidd_l2cif_connect_ind()
205 if (p_hcon->conn_state != HID_CONN_STATE_CONNECTING_INTR) { in hidd_l2cif_connect_ind()
208 __func__, p_hcon->conn_state); in hidd_l2cif_connect_ind()
214 if (p_hcon->conn_state != HID_CONN_STATE_UNUSED) { in hidd_l2cif_connect_ind()
217 __func__, p_hcon->conn_state); in hidd_l2cif_connect_ind()
241 p_hcon->conn_flags = 0; in hidd_l2cif_connect_ind()
242 p_hcon->ctrl_cid = cid; in hidd_l2cif_connect_ind()
243 p_hcon->ctrl_id = id; in hidd_l2cif_connect_ind()
244 p_hcon->disc_reason = HID_L2CAP_CONN_FAIL; in hidd_l2cif_connect_ind()
246 p_hcon->conn_state = HID_CONN_STATE_SECURITY; in hidd_l2cif_connect_ind()
258 p_hcon->conn_state = HID_CONN_STATE_CONFIG; in hidd_l2cif_connect_ind()
259 p_hcon->intr_cid = cid; in hidd_l2cif_connect_ind()
276 tHID_CONN* p_hcon = &hd_cb.device.conn; in hidd_l2cif_connect_cfm() local
280 if (p_hcon->ctrl_cid != cid && p_hcon->intr_cid != cid) { in hidd_l2cif_connect_cfm()
285 if (!(p_hcon->conn_flags & HID_CONN_FLAGS_IS_ORIG) || in hidd_l2cif_connect_cfm()
286 ((cid == p_hcon->ctrl_cid) && in hidd_l2cif_connect_cfm()
287 (p_hcon->conn_state != HID_CONN_STATE_CONNECTING_CTRL)) || in hidd_l2cif_connect_cfm()
288 ((cid == p_hcon->intr_cid) && in hidd_l2cif_connect_cfm()
289 (p_hcon->conn_state != HID_CONN_STATE_CONNECTING_INTR))) { in hidd_l2cif_connect_cfm()
297 if (cid == p_hcon->ctrl_cid) in hidd_l2cif_connect_cfm()
298 p_hcon->ctrl_cid = 0; in hidd_l2cif_connect_cfm()
300 p_hcon->intr_cid = 0; in hidd_l2cif_connect_cfm()
310 if (cid == p_hcon->ctrl_cid) { in hidd_l2cif_connect_cfm()
311 p_hcon->conn_state = HID_CONN_STATE_SECURITY; in hidd_l2cif_connect_cfm()
312 p_hcon->disc_reason = in hidd_l2cif_connect_cfm()
319 p_hcon->conn_state = HID_CONN_STATE_CONFIG; in hidd_l2cif_connect_cfm()
336 tHID_CONN* p_hcon; in hidd_l2cif_config_ind() local
340 p_hcon = &hd_cb.device.conn; in hidd_l2cif_config_ind()
342 if (p_hcon->ctrl_cid != cid && p_hcon->intr_cid != cid) { in hidd_l2cif_config_ind()
348 p_hcon->rem_mtu_size = HID_DEV_MTU_SIZE; in hidd_l2cif_config_ind()
350 p_hcon->rem_mtu_size = p_cfg->mtu; in hidd_l2cif_config_ind()
357 if (cid == p_hcon->intr_cid && hd_cb.use_in_qos && !p_cfg->qos_present) { in hidd_l2cif_config_ind()
365 if (cid == p_hcon->ctrl_cid) { in hidd_l2cif_config_ind()
366 p_hcon->conn_flags |= HID_CONN_FLAGS_HIS_CTRL_CFG_DONE; in hidd_l2cif_config_ind()
368 if ((p_hcon->conn_flags & HID_CONN_FLAGS_IS_ORIG) && in hidd_l2cif_config_ind()
369 (p_hcon->conn_flags & HID_CONN_FLAGS_MY_CTRL_CFG_DONE)) { in hidd_l2cif_config_ind()
370 p_hcon->disc_reason = HID_L2CAP_CONN_FAIL; in hidd_l2cif_config_ind()
371 if ((p_hcon->intr_cid = in hidd_l2cif_config_ind()
374 p_hcon->conn_state = HID_CONN_STATE_UNUSED; in hidd_l2cif_config_ind()
382 p_hcon->conn_state = HID_CONN_STATE_CONNECTING_INTR; in hidd_l2cif_config_ind()
386 p_hcon->conn_flags |= HID_CONN_FLAGS_HIS_INTR_CFG_DONE; in hidd_l2cif_config_ind()
402 tHID_CONN* p_hcon; in hidd_l2cif_config_cfm() local
408 p_hcon = &hd_cb.device.conn; in hidd_l2cif_config_cfm()
410 if (p_hcon->ctrl_cid != cid && p_hcon->intr_cid != cid) { in hidd_l2cif_config_cfm()
415 if (p_hcon->intr_cid == cid && in hidd_l2cif_config_cfm()
429 } else if (p_hcon->intr_cid == cid && in hidd_l2cif_config_cfm()
448 if (cid == p_hcon->ctrl_cid) { in hidd_l2cif_config_cfm()
449 p_hcon->conn_flags |= HID_CONN_FLAGS_MY_CTRL_CFG_DONE; in hidd_l2cif_config_cfm()
451 if ((p_hcon->conn_flags & HID_CONN_FLAGS_IS_ORIG) && in hidd_l2cif_config_cfm()
452 (p_hcon->conn_flags & HID_CONN_FLAGS_HIS_CTRL_CFG_DONE)) { in hidd_l2cif_config_cfm()
453 p_hcon->disc_reason = HID_L2CAP_CONN_FAIL; in hidd_l2cif_config_cfm()
454 if ((p_hcon->intr_cid = in hidd_l2cif_config_cfm()
457 p_hcon->conn_state = HID_CONN_STATE_UNUSED; in hidd_l2cif_config_cfm()
465 p_hcon->conn_state = HID_CONN_STATE_CONNECTING_INTR; in hidd_l2cif_config_cfm()
469 p_hcon->conn_flags |= HID_CONN_FLAGS_MY_INTR_CFG_DONE; in hidd_l2cif_config_cfm()
485 tHID_CONN* p_hcon; in hidd_l2cif_disconnect_ind() local
489 p_hcon = &hd_cb.device.conn; in hidd_l2cif_disconnect_ind()
491 if (p_hcon->conn_state == HID_CONN_STATE_UNUSED || in hidd_l2cif_disconnect_ind()
492 (p_hcon->ctrl_cid != cid && p_hcon->intr_cid != cid)) { in hidd_l2cif_disconnect_ind()
499 p_hcon->conn_state = HID_CONN_STATE_DISCONNECTING; in hidd_l2cif_disconnect_ind()
501 if (cid == p_hcon->ctrl_cid) in hidd_l2cif_disconnect_ind()
502 p_hcon->ctrl_cid = 0; in hidd_l2cif_disconnect_ind()
504 p_hcon->intr_cid = 0; in hidd_l2cif_disconnect_ind()
506 if ((p_hcon->ctrl_cid == 0) && (p_hcon->intr_cid == 0)) { in hidd_l2cif_disconnect_ind()
516 p_hcon->conn_state = HID_CONN_STATE_UNUSED; in hidd_l2cif_disconnect_ind()
518 hd_cb.callback(hd_cb.device.addr, HID_DHOST_EVT_CLOSE, p_hcon->disc_reason, in hidd_l2cif_disconnect_ind()
533 tHID_CONN* p_hcon; in hidd_l2cif_disconnect_cfm() local
537 p_hcon = &hd_cb.device.conn; in hidd_l2cif_disconnect_cfm()
539 if (p_hcon->conn_state == HID_CONN_STATE_UNUSED || in hidd_l2cif_disconnect_cfm()
540 (p_hcon->ctrl_cid != cid && p_hcon->intr_cid != cid)) { in hidd_l2cif_disconnect_cfm()
545 if (cid == p_hcon->ctrl_cid) { in hidd_l2cif_disconnect_cfm()
546 p_hcon->ctrl_cid = 0; in hidd_l2cif_disconnect_cfm()
548 p_hcon->intr_cid = 0; in hidd_l2cif_disconnect_cfm()
551 L2CA_DisconnectReq(p_hcon->ctrl_cid); in hidd_l2cif_disconnect_cfm()
554 if ((p_hcon->ctrl_cid == 0) && (p_hcon->intr_cid == 0)) { in hidd_l2cif_disconnect_cfm()
558 p_hcon->conn_state = HID_CONN_STATE_UNUSED; in hidd_l2cif_disconnect_cfm()
562 p_hcon->disc_reason, NULL); in hidd_l2cif_disconnect_cfm()
566 p_hcon->disc_reason, NULL); in hidd_l2cif_disconnect_cfm()
581 tHID_CONN* p_hcon; in hidd_l2cif_cong_ind() local
585 p_hcon = &hd_cb.device.conn; in hidd_l2cif_cong_ind()
587 if (p_hcon->conn_state == HID_CONN_STATE_UNUSED || in hidd_l2cif_cong_ind()
588 (p_hcon->ctrl_cid != cid && p_hcon->intr_cid != cid)) { in hidd_l2cif_cong_ind()
594 p_hcon->conn_flags |= HID_CONN_FLAGS_CONGESTED; in hidd_l2cif_cong_ind()
596 p_hcon->conn_flags &= ~HID_CONN_FLAGS_CONGESTED; in hidd_l2cif_cong_ind()
610 tHID_CONN* p_hcon; in hidd_l2cif_data_ind() local
623 p_hcon = &hd_cb.device.conn; in hidd_l2cif_data_ind()
625 if (p_hcon->conn_state == HID_CONN_STATE_UNUSED || in hidd_l2cif_data_ind()
626 (p_hcon->ctrl_cid != cid && p_hcon->intr_cid != cid)) { in hidd_l2cif_data_ind()
635 if (msg_type == HID_TRANS_DATA && cid == p_hcon->intr_cid) { in hidd_l2cif_data_ind()
853 tHID_CONN* p_hcon; in hidd_conn_disconnect() local
863 p_hcon = &hd_cb.device.conn; in hidd_conn_disconnect()
865 if ((p_hcon->ctrl_cid != 0) || (p_hcon->intr_cid != 0)) { in hidd_conn_disconnect()
866 p_hcon->conn_state = HID_CONN_STATE_DISCONNECTING; in hidd_conn_disconnect()
872 if (p_hcon->intr_cid) { in hidd_conn_disconnect()
873 L2CA_DisconnectReq(p_hcon->intr_cid); in hidd_conn_disconnect()
874 } else if (p_hcon->ctrl_cid) { in hidd_conn_disconnect()
875 L2CA_DisconnectReq(p_hcon->ctrl_cid); in hidd_conn_disconnect()
879 p_hcon->conn_state = HID_CONN_STATE_UNUSED; in hidd_conn_disconnect()
897 tHID_CONN* p_hcon; in hidd_conn_send_data() local
906 p_hcon = &hd_cb.device.conn; in hidd_conn_send_data()
908 if (p_hcon->conn_flags & HID_CONN_FLAGS_CONGESTED) { in hidd_conn_send_data()
915 cid = p_hcon->ctrl_cid; in hidd_conn_send_data()
920 cid = p_hcon->ctrl_cid; in hidd_conn_send_data()
923 cid = p_hcon->intr_cid; in hidd_conn_send_data()
958 if (msg_type == HID_TRANS_DATA && cid == p_hcon->intr_cid) { in hidd_conn_send_data()