• Home
  • Raw
  • Download

Lines Matching refs:p_lcb

45 static void l2cble_start_conn_update(tL2C_LCB* p_lcb);
59 tL2C_LCB* p_lcb = l2cu_find_lcb_by_bd_addr(rem_bda, BT_TRANSPORT_LE); in L2CA_CancelBleConnectReq() local
63 if (p_lcb != NULL && p_lcb->link_state == LST_CONNECTING) { in L2CA_CancelBleConnectReq()
73 if (p_lcb != NULL && in L2CA_CancelBleConnectReq()
74 !(p_lcb->link_role == HCI_ROLE_SLAVE && in L2CA_CancelBleConnectReq()
76 p_lcb->disc_reason = L2CAP_CONN_CANCEL; in L2CA_CancelBleConnectReq()
77 l2cu_release_lcb(p_lcb); in L2CA_CancelBleConnectReq()
97 tL2C_LCB* p_lcb; in L2CA_UpdateBleConnParams() local
101 p_lcb = l2cu_find_lcb_by_bd_addr(rem_bda, BT_TRANSPORT_LE); in L2CA_UpdateBleConnParams()
104 if (!p_lcb || !p_acl_cb) { in L2CA_UpdateBleConnParams()
109 if (p_lcb->transport != BT_TRANSPORT_LE) { in L2CA_UpdateBleConnParams()
118 p_lcb->min_interval = min_int; in L2CA_UpdateBleConnParams()
119 p_lcb->max_interval = max_int; in L2CA_UpdateBleConnParams()
120 p_lcb->latency = latency; in L2CA_UpdateBleConnParams()
121 p_lcb->timeout = timeout; in L2CA_UpdateBleConnParams()
122 p_lcb->conn_update_mask |= L2C_BLE_NEW_CONN_PARAM; in L2CA_UpdateBleConnParams()
123 p_lcb->min_ce_len = min_ce_len; in L2CA_UpdateBleConnParams()
124 p_lcb->max_ce_len = max_ce_len; in L2CA_UpdateBleConnParams()
126 l2cble_start_conn_update(p_lcb); in L2CA_UpdateBleConnParams()
153 tL2C_LCB* p_lcb; in L2CA_EnableUpdateBleConnParams() local
156 p_lcb = l2cu_find_lcb_by_bd_addr(rem_bda, BT_TRANSPORT_LE); in L2CA_EnableUpdateBleConnParams()
158 if (!p_lcb) { in L2CA_EnableUpdateBleConnParams()
165 p_lcb->conn_update_mask); in L2CA_EnableUpdateBleConnParams()
167 if (p_lcb->transport != BT_TRANSPORT_LE) { in L2CA_EnableUpdateBleConnParams()
169 << " not LE, link role " << p_lcb->link_role; in L2CA_EnableUpdateBleConnParams()
174 p_lcb->conn_update_mask &= ~L2C_BLE_CONN_UPDATE_DISABLE; in L2CA_EnableUpdateBleConnParams()
176 p_lcb->conn_update_mask |= L2C_BLE_CONN_UPDATE_DISABLE; in L2CA_EnableUpdateBleConnParams()
178 l2cble_start_conn_update(p_lcb); in L2CA_EnableUpdateBleConnParams()
195 tL2C_LCB* p_lcb; in L2CA_GetBleConnRole() local
197 p_lcb = l2cu_find_lcb_by_bd_addr(bd_addr, BT_TRANSPORT_LE); in L2CA_GetBleConnRole()
198 if (p_lcb != NULL) role = p_lcb->link_role; in L2CA_GetBleConnRole()
213 tL2C_LCB* p_lcb; in L2CA_GetDisconnectReason() local
216 p_lcb = l2cu_find_lcb_by_bd_addr(remote_bda, transport); in L2CA_GetDisconnectReason()
217 if (p_lcb != NULL) reason = p_lcb->disc_reason; in L2CA_GetDisconnectReason()
234 tL2C_LCB* p_lcb = l2cu_find_lcb_by_bd_addr(bda, BT_TRANSPORT_LE); in l2cble_notify_le_connection() local
238 if (p_lcb != NULL && p_acl != NULL && p_lcb->link_state != LST_CONNECTED) { in l2cble_notify_le_connection()
242 p_lcb->link_state = LST_CONNECTED; in l2cble_notify_le_connection()
243 l2cu_process_fixed_chnl_resp(p_lcb); in l2cble_notify_le_connection()
246 if (p_lcb != NULL) { in l2cble_notify_le_connection()
248 for (p_ccb = p_lcb->ccb_queue.p_first_ccb; p_ccb; in l2cble_notify_le_connection()
272 tL2C_LCB* p_lcb = l2cu_find_lcb_by_bd_addr(bda, BT_TRANSPORT_LE); in l2cble_conn_comp() local
275 if (!p_lcb) { in l2cble_conn_comp()
276 p_lcb = l2cu_allocate_lcb(bda, false, BT_TRANSPORT_LE); in l2cble_conn_comp()
277 if (!p_lcb) { in l2cble_conn_comp()
283 p_lcb, L2CAP_ATT_CID, in l2cble_conn_comp()
291 } else if (role == HCI_ROLE_MASTER && p_lcb->link_state != LST_CONNECTING) { in l2cble_conn_comp()
293 << +p_lcb->link_state; in l2cble_conn_comp()
297 if (role == HCI_ROLE_MASTER) alarm_cancel(p_lcb->l2c_lcb_timer); in l2cble_conn_comp()
300 p_lcb->handle = handle; in l2cble_conn_comp()
304 p_lcb->link_role = role; in l2cble_conn_comp()
305 p_lcb->transport = BT_TRANSPORT_LE; in l2cble_conn_comp()
308 p_lcb->min_interval = p_lcb->max_interval = conn_interval; in l2cble_conn_comp()
309 p_lcb->timeout = conn_timeout; in l2cble_conn_comp()
310 p_lcb->latency = conn_latency; in l2cble_conn_comp()
311 p_lcb->conn_update_mask = L2C_BLE_NOT_DEFAULT_PARAM; in l2cble_conn_comp()
315 btm_acl_created(bda, NULL, p_dev_rec->sec_bd_name, handle, p_lcb->link_role, in l2cble_conn_comp()
318 p_lcb->peer_chnl_mask[0] = L2CAP_FIXED_CHNL_ATT_BIT | in l2cble_conn_comp()
329 p_lcb->link_state = LST_CONNECTED; in l2cble_conn_comp()
330 l2cu_process_fixed_chnl_resp(p_lcb); in l2cble_conn_comp()
347 static void l2cble_start_conn_update(tL2C_LCB* p_lcb) { in l2cble_start_conn_update() argument
349 tACL_CONN* p_acl_cb = btm_bda_to_acl(p_lcb->remote_bd_addr, BT_TRANSPORT_LE); in l2cble_start_conn_update()
351 LOG(ERROR) << "No known connection ACL for " << p_lcb->remote_bd_addr; in l2cble_start_conn_update()
358 btm_find_or_alloc_dev(p_lcb->remote_bd_addr); in l2cble_start_conn_update()
360 if (p_lcb->conn_update_mask & L2C_BLE_UPDATE_PENDING) return; in l2cble_start_conn_update()
362 if (p_lcb->conn_update_mask & L2C_BLE_CONN_UPDATE_DISABLE) { in l2cble_start_conn_update()
366 if (p_lcb->conn_update_mask & L2C_BLE_NOT_DEFAULT_PARAM && in l2cble_start_conn_update()
368 p_lcb->min_interval > BTM_BLE_CONN_INT_MIN) { in l2cble_start_conn_update()
379 if (p_lcb->link_role == HCI_ROLE_MASTER in l2cble_start_conn_update()
386 btsnd_hcic_ble_upd_ll_conn_params(p_lcb->handle, min_conn_int, in l2cble_start_conn_update()
389 p_lcb->conn_update_mask |= L2C_BLE_UPDATE_PENDING; in l2cble_start_conn_update()
391 l2cu_send_peer_ble_par_req(p_lcb, min_conn_int, max_conn_int, in l2cble_start_conn_update()
394 p_lcb->conn_update_mask &= ~L2C_BLE_NOT_DEFAULT_PARAM; in l2cble_start_conn_update()
395 p_lcb->conn_update_mask |= L2C_BLE_NEW_CONN_PARAM; in l2cble_start_conn_update()
399 if (p_lcb->conn_update_mask & L2C_BLE_NEW_CONN_PARAM) { in l2cble_start_conn_update()
401 if (p_lcb->link_role == HCI_ROLE_MASTER in l2cble_start_conn_update()
408 btsnd_hcic_ble_upd_ll_conn_params(p_lcb->handle, p_lcb->min_interval, in l2cble_start_conn_update()
409 p_lcb->max_interval, p_lcb->latency, in l2cble_start_conn_update()
410 p_lcb->timeout, p_lcb->min_ce_len, in l2cble_start_conn_update()
411 p_lcb->max_ce_len); in l2cble_start_conn_update()
412 p_lcb->conn_update_mask |= L2C_BLE_UPDATE_PENDING; in l2cble_start_conn_update()
414 l2cu_send_peer_ble_par_req(p_lcb, p_lcb->min_interval, in l2cble_start_conn_update()
415 p_lcb->max_interval, p_lcb->latency, in l2cble_start_conn_update()
416 p_lcb->timeout); in l2cble_start_conn_update()
418 p_lcb->conn_update_mask &= ~L2C_BLE_NEW_CONN_PARAM; in l2cble_start_conn_update()
419 p_lcb->conn_update_mask |= L2C_BLE_NOT_DEFAULT_PARAM; in l2cble_start_conn_update()
441 tL2C_LCB* p_lcb = l2cu_find_lcb_by_handle(handle); in l2cble_process_conn_update_evt() local
442 if (!p_lcb) { in l2cble_process_conn_update_evt()
447 p_lcb->conn_update_mask &= ~L2C_BLE_UPDATE_PENDING; in l2cble_process_conn_update_evt()
453 l2cble_start_conn_update(p_lcb); in l2cble_process_conn_update_evt()
456 p_lcb->conn_update_mask); in l2cble_process_conn_update_evt()
469 void l2cble_process_sig_cmd(tL2C_LCB* p_lcb, uint8_t* p, uint16_t pkt_len) { in l2cble_process_sig_cmd() argument
508 l2cu_send_peer_cmd_reject(p_lcb, L2CAP_CMD_REJ_NOT_UNDERSTOOD, id, 0, 0); in l2cble_process_sig_cmd()
523 if (p_lcb->link_role == HCI_ROLE_MASTER) { in l2cble_process_sig_cmd()
537 l2cu_send_peer_ble_par_rsp(p_lcb, L2CAP_CFG_UNACCEPTABLE_PARAMS, id); in l2cble_process_sig_cmd()
539 l2cu_send_peer_ble_par_rsp(p_lcb, L2CAP_CFG_OK, id); in l2cble_process_sig_cmd()
541 p_lcb->min_interval = min_interval; in l2cble_process_sig_cmd()
542 p_lcb->max_interval = max_interval; in l2cble_process_sig_cmd()
543 p_lcb->latency = latency; in l2cble_process_sig_cmd()
544 p_lcb->timeout = timeout; in l2cble_process_sig_cmd()
545 p_lcb->conn_update_mask |= L2C_BLE_NEW_CONN_PARAM; in l2cble_process_sig_cmd()
547 l2cble_start_conn_update(p_lcb); in l2cble_process_sig_cmd()
550 l2cu_send_peer_cmd_reject(p_lcb, L2CAP_CMD_REJ_NOT_UNDERSTOOD, id, 0, in l2cble_process_sig_cmd()
578 p_ccb = l2cu_find_ccb_by_remote_cid(p_lcb, rcid); in l2cble_process_sig_cmd()
583 p_lcb, id, L2CAP_LE_RESULT_SOURCE_CID_ALREADY_ALLOCATED); in l2cble_process_sig_cmd()
591 l2cu_reject_ble_connection(p_lcb, id, L2CAP_LE_RESULT_NO_PSM); in l2cble_process_sig_cmd()
598 l2cu_reject_ble_connection(p_lcb, id, L2CAP_CONN_NO_PSM); in l2cble_process_sig_cmd()
604 p_ccb = l2cu_allocate_ccb(p_lcb, 0); in l2cble_process_sig_cmd()
607 l2cu_reject_ble_connection(p_lcb, id, L2CAP_CONN_NO_RESOURCES); in l2cble_process_sig_cmd()
615 l2cu_reject_ble_connection(p_lcb, id, L2CAP_CONN_NO_RESOURCES); in l2cble_process_sig_cmd()
639 for (temp_p_ccb = p_lcb->ccb_queue.p_first_ccb; temp_p_ccb; in l2cble_process_sig_cmd()
706 p_ccb = l2cu_find_ccb_by_remote_cid(p_lcb, lcid); in l2cble_process_sig_cmd()
726 p_ccb = l2cu_find_ccb_by_cid(p_lcb, lcid); in l2cble_process_sig_cmd()
733 l2cu_send_peer_disc_rsp(p_lcb, id, lcid, rcid); in l2cble_process_sig_cmd()
746 p_ccb = l2cu_find_ccb_by_cid(p_lcb, lcid); in l2cble_process_sig_cmd()
755 l2cu_send_peer_cmd_reject(p_lcb, L2CAP_CMD_REJ_NOT_UNDERSTOOD, id, 0, 0); in l2cble_process_sig_cmd()
762 bool l2cble_create_conn(tL2C_LCB* p_lcb) { in l2cble_create_conn() argument
764 p_lcb->remote_bd_addr); in l2cble_create_conn()
767 p_lcb->link_state = LST_CONNECTING; in l2cble_create_conn()
771 alarm_set_on_mloop(p_lcb->l2c_lcb_timer, L2CAP_BLE_LINK_CONNECT_TIMEOUT_MS, in l2cble_create_conn()
772 l2c_lcb_timer_timeout, p_lcb); in l2cble_create_conn()
813 tL2C_LCB* p_lcb; in l2c_ble_link_adjust_allocation() local
828 for (yy = 0, p_lcb = &l2cb.lcb_pool[0]; yy < MAX_L2CAP_LINKS; yy++, p_lcb++) { in l2c_ble_link_adjust_allocation()
829 if (p_lcb->in_use && p_lcb->transport == BT_TRANSPORT_LE) { in l2c_ble_link_adjust_allocation()
830 if (p_lcb->acl_priority == L2CAP_PRIORITY_HIGH) in l2c_ble_link_adjust_allocation()
875 for (yy = 0, p_lcb = &l2cb.lcb_pool[0]; yy < MAX_L2CAP_LINKS; yy++, p_lcb++) { in l2c_ble_link_adjust_allocation()
876 if (p_lcb->in_use && p_lcb->transport == BT_TRANSPORT_LE) { in l2c_ble_link_adjust_allocation()
877 if (p_lcb->acl_priority == L2CAP_PRIORITY_HIGH) { in l2c_ble_link_adjust_allocation()
878 p_lcb->link_xmit_quota = high_pri_link_quota; in l2c_ble_link_adjust_allocation()
885 if ((p_lcb->link_xmit_quota > 0) && (qq == 0)) in l2c_ble_link_adjust_allocation()
886 l2cb.ble_round_robin_unacked += p_lcb->sent_not_acked; in l2c_ble_link_adjust_allocation()
888 p_lcb->link_xmit_quota = qq; in l2c_ble_link_adjust_allocation()
890 p_lcb->link_xmit_quota++; in l2c_ble_link_adjust_allocation()
897 yy, p_lcb->acl_priority, p_lcb->link_xmit_quota); in l2c_ble_link_adjust_allocation()
900 p_lcb->sent_not_acked, l2cb.round_robin_unacked); in l2c_ble_link_adjust_allocation()
905 if ((p_lcb->link_state == LST_CONNECTED) && in l2c_ble_link_adjust_allocation()
906 (!list_is_empty(p_lcb->link_xmit_data_q)) && in l2c_ble_link_adjust_allocation()
907 (p_lcb->sent_not_acked < p_lcb->link_xmit_quota)) { in l2c_ble_link_adjust_allocation()
908 alarm_set_on_mloop(p_lcb->l2c_lcb_timer, in l2c_ble_link_adjust_allocation()
910 l2c_lcb_timer_timeout, p_lcb); in l2c_ble_link_adjust_allocation()
929 tL2C_LCB* p_lcb = l2cu_find_lcb_by_handle(handle); in l2cble_process_rc_param_request_evt() local
931 if (p_lcb != NULL) { in l2cble_process_rc_param_request_evt()
932 p_lcb->min_interval = int_min; in l2cble_process_rc_param_request_evt()
933 p_lcb->max_interval = int_max; in l2cble_process_rc_param_request_evt()
934 p_lcb->latency = latency; in l2cble_process_rc_param_request_evt()
935 p_lcb->timeout = timeout; in l2cble_process_rc_param_request_evt()
938 if ((p_lcb->conn_update_mask & L2C_BLE_CONN_UPDATE_DISABLE) == 0) { in l2cble_process_rc_param_request_evt()
943 p_lcb->conn_update_mask |= L2C_BLE_NEW_CONN_PARAM; in l2cble_process_rc_param_request_evt()
963 void l2cble_update_data_length(tL2C_LCB* p_lcb) { in l2cble_update_data_length() argument
970 if (p_lcb == NULL) return; in l2cble_update_data_length()
974 if ((p_lcb->p_fixed_ccbs[i] != NULL) && in l2cble_update_data_length()
975 (tx_mtu < (p_lcb->p_fixed_ccbs[i]->tx_data_len + L2CAP_PKT_OVERHEAD))) in l2cble_update_data_length()
976 tx_mtu = p_lcb->p_fixed_ccbs[i]->tx_data_len + L2CAP_PKT_OVERHEAD; in l2cble_update_data_length()
983 if (p_lcb->tx_data_len != tx_mtu) in l2cble_update_data_length()
984 BTM_SetBleDataLength(p_lcb->remote_bd_addr, tx_mtu); in l2cble_update_data_length()
999 tL2C_LCB* p_lcb = l2cu_find_lcb_by_handle(handle); in l2cble_process_data_length_change_event() local
1002 if (p_lcb == NULL) return; in l2cble_process_data_length_change_event()
1004 if (tx_data_len > 0) p_lcb->tx_data_len = tx_data_len; in l2cble_process_data_length_change_event()
1022 tL2C_LCB* p_lcb = l2cu_find_lcb_by_bd_addr(remote_bda, BT_TRANSPORT_LE); in l2cble_set_fixed_channel_tx_data_length() local
1033 if (p_lcb == NULL) return; in l2cble_set_fixed_channel_tx_data_length()
1035 if (p_lcb->p_fixed_ccbs[cid] != NULL) { in l2cble_set_fixed_channel_tx_data_length()
1038 p_lcb->p_fixed_ccbs[cid]->tx_data_len = tx_mtu; in l2cble_set_fixed_channel_tx_data_length()
1041 l2cble_update_data_length(p_lcb); in l2cble_set_fixed_channel_tx_data_length()
1057 if (p_ccb->p_lcb && p_ccb->p_lcb->transport != BT_TRANSPORT_LE) { in l2cble_credit_based_conn_req()
1079 if (p_ccb->p_lcb && p_ccb->p_lcb->transport != BT_TRANSPORT_LE) { in l2cble_credit_based_conn_res()
1101 if (p_ccb->p_lcb && p_ccb->p_lcb->transport != BT_TRANSPORT_LE) { in l2cble_send_flow_control_credit()
1124 if (p_ccb->p_lcb && p_ccb->p_lcb->transport != BT_TRANSPORT_LE) { in l2cble_send_peer_disc_req()
1146 tL2C_LCB* p_lcb = l2cu_find_lcb_by_bd_addr(p_bda, BT_TRANSPORT_LE); in l2cble_sec_comp() local
1151 if (!p_lcb) { in l2cble_sec_comp()
1157 sec_act = p_lcb->sec_act; in l2cble_sec_comp()
1158 p_lcb->sec_act = 0; in l2cble_sec_comp()
1160 if (!fixed_queue_is_empty(p_lcb->le_sec_pending_q)) { in l2cble_sec_comp()
1161 p_buf = (tL2CAP_SEC_DATA*)fixed_queue_dequeue(p_lcb->le_sec_pending_q); in l2cble_sec_comp()
1184 __func__, p_lcb->sec_act); in l2cble_sec_comp()
1197 while (!fixed_queue_is_empty(p_lcb->le_sec_pending_q)) { in l2cble_sec_comp()
1198 p_buf = (tL2CAP_SEC_DATA*)fixed_queue_dequeue(p_lcb->le_sec_pending_q); in l2cble_sec_comp()
1226 tL2C_LCB* p_lcb = NULL; in l2ble_sec_access_req() local
1233 p_lcb = l2cu_find_lcb_by_bd_addr(bd_addr, BT_TRANSPORT_LE); in l2ble_sec_access_req()
1235 if (!p_lcb) { in l2ble_sec_access_req()
1252 fixed_queue_enqueue(p_lcb->le_sec_pending_q, p_buf); in l2ble_sec_access_req()