• Home
  • Raw
  • Download

Lines Matching refs:p_lcb

45 static bool l2c_link_send_to_lower(tL2C_LCB* p_lcb, BT_HDR* p_buf,
59 tL2C_LCB* p_lcb; in l2c_link_hci_conn_req() local
65 p_lcb = l2cu_find_lcb_by_bd_addr(bd_addr, BT_TRANSPORT_BR_EDR); in l2c_link_hci_conn_req()
68 if (!p_lcb) { in l2c_link_hci_conn_req()
69 p_lcb = l2cu_allocate_lcb(bd_addr, false, BT_TRANSPORT_BR_EDR); in l2c_link_hci_conn_req()
70 if (!p_lcb) { in l2c_link_hci_conn_req()
81 if (p_lcb_cur == p_lcb) continue; in l2c_link_hci_conn_req()
85 p_lcb->link_role = HCI_ROLE_MASTER; in l2c_link_hci_conn_req()
92 p_lcb->link_role = HCI_ROLE_SLAVE; in l2c_link_hci_conn_req()
94 p_lcb->link_role = l2cu_get_conn_role(p_lcb); in l2c_link_hci_conn_req()
98 btsnd_hcic_accept_conn(bd_addr, p_lcb->link_role); in l2c_link_hci_conn_req()
100 p_lcb->link_state = LST_CONNECTING; in l2c_link_hci_conn_req()
103 alarm_set_on_mloop(p_lcb->l2c_lcb_timer, L2CAP_LINK_CONNECT_TIMEOUT_MS, in l2c_link_hci_conn_req()
104 l2c_lcb_timer_timeout, p_lcb); in l2c_link_hci_conn_req()
110 if ((p_lcb->link_state == LST_CONNECTING) || in l2c_link_hci_conn_req()
111 (p_lcb->link_state == LST_CONNECT_HOLDING)) { in l2c_link_hci_conn_req()
115 p_lcb->link_role = HCI_ROLE_SLAVE; in l2c_link_hci_conn_req()
117 p_lcb->link_role = l2cu_get_conn_role(p_lcb); in l2c_link_hci_conn_req()
119 btsnd_hcic_accept_conn(bd_addr, p_lcb->link_role); in l2c_link_hci_conn_req()
121 p_lcb->link_state = LST_CONNECTING; in l2c_link_hci_conn_req()
123 } else if (p_lcb->link_state == LST_DISCONNECTING) { in l2c_link_hci_conn_req()
129 p_lcb->link_state); in l2c_link_hci_conn_req()
149 tL2C_LCB* p_lcb; in l2c_link_hci_conn_comp() local
160 p_lcb = l2cu_find_lcb_by_bd_addr(ci.bd_addr, BT_TRANSPORT_BR_EDR); in l2c_link_hci_conn_comp()
163 if (p_lcb == nullptr) { in l2c_link_hci_conn_comp()
165 p_lcb = l2cu_allocate_lcb(ci.bd_addr, false, BT_TRANSPORT_BR_EDR); in l2c_link_hci_conn_comp()
166 if (p_lcb == nullptr) { in l2c_link_hci_conn_comp()
170 p_lcb->link_state = LST_CONNECTING; in l2c_link_hci_conn_comp()
173 if (p_lcb->link_state != LST_CONNECTING) { in l2c_link_hci_conn_comp()
175 p_lcb->link_state, status); in l2c_link_hci_conn_comp()
177 if (status != HCI_SUCCESS) l2c_link_hci_disc_comp(p_lcb->handle, status); in l2c_link_hci_conn_comp()
183 p_lcb->handle = handle; in l2c_link_hci_conn_comp()
187 p_lcb->link_state = LST_CONNECTED; in l2c_link_hci_conn_comp()
190 l2cu_send_peer_info_req(p_lcb, L2CAP_EXTENDED_FEATURES_INFO_TYPE); in l2c_link_hci_conn_comp()
196 p_dev_info->sec_bd_name, handle, p_lcb->link_role, in l2c_link_hci_conn_comp()
199 btm_acl_created(ci.bd_addr, NULL, NULL, handle, p_lcb->link_role, in l2c_link_hci_conn_comp()
205 if (p_lcb->is_bonding) { in l2c_link_hci_conn_comp()
212 alarm_cancel(p_lcb->l2c_lcb_timer); in l2c_link_hci_conn_comp()
215 for (p_ccb = p_lcb->ccb_queue.p_first_ccb; p_ccb; in l2c_link_hci_conn_comp()
220 if (p_lcb->p_echo_rsp_cb) { in l2c_link_hci_conn_comp()
221 l2cu_send_peer_echo_req(p_lcb, NULL, 0); in l2c_link_hci_conn_comp()
222 alarm_set_on_mloop(p_lcb->l2c_lcb_timer, L2CAP_ECHO_RSP_TIMEOUT_MS, in l2c_link_hci_conn_comp()
223 l2c_lcb_timer_timeout, p_lcb); in l2c_link_hci_conn_comp()
224 } else if (!p_lcb->ccb_queue.p_first_ccb) { in l2c_link_hci_conn_comp()
226 alarm_set_on_mloop(p_lcb->l2c_lcb_timer, timeout_ms, in l2c_link_hci_conn_comp()
227 l2c_lcb_timer_timeout, p_lcb); in l2c_link_hci_conn_comp()
234 p_lcb->link_state = LST_CONNECT_HOLDING; in l2c_link_hci_conn_comp()
235 p_lcb->handle = HCI_INVALID_HANDLE; in l2c_link_hci_conn_comp()
238 p_lcb->link_state = LST_DISCONNECTING; in l2c_link_hci_conn_comp()
242 for (p_ccb = p_lcb->ccb_queue.p_first_ccb; p_ccb;) { in l2c_link_hci_conn_comp()
250 p_lcb->disc_reason = status; in l2c_link_hci_conn_comp()
252 if (p_lcb->ccb_queue.p_first_ccb == NULL) in l2c_link_hci_conn_comp()
253 l2cu_release_lcb(p_lcb); in l2c_link_hci_conn_comp()
259 p_lcb->link_state = LST_CONNECTING; in l2c_link_hci_conn_comp()
261 l2cu_create_conn_br_edr(p_lcb); in l2c_link_hci_conn_comp()
288 tL2C_LCB* p_lcb; in l2c_link_sec_comp2() local
302 p_lcb = l2cu_find_lcb_by_bd_addr(p_bda, transport); in l2c_link_sec_comp2()
305 if (!p_lcb) { in l2c_link_sec_comp2()
311 for (p_ccb = p_lcb->ccb_queue.p_first_ccb; p_ccb; p_ccb = p_next_ccb) { in l2c_link_sec_comp2()
348 tL2C_LCB* p_lcb; in l2c_link_hci_disc_comp() local
355 p_lcb = l2cu_find_lcb_by_handle(handle); in l2c_link_hci_disc_comp()
358 if (!p_lcb) { in l2c_link_hci_disc_comp()
366 p_lcb->disc_reason = btm_cb.acl_disc_reason; in l2c_link_hci_disc_comp()
369 p_lcb->link_state = LST_DISCONNECTING; in l2c_link_hci_disc_comp()
372 if (p_lcb->transport == BT_TRANSPORT_LE) in l2c_link_hci_disc_comp()
373 btm_ble_update_link_topology_mask(p_lcb->link_role, false); in l2c_link_hci_disc_comp()
376 for (p_ccb = p_lcb->ccb_queue.p_first_ccb; p_ccb;) { in l2c_link_hci_disc_comp()
385 if (p_ccb != p_lcb->p_pending_ccb) { in l2c_link_hci_disc_comp()
391 if (p_lcb->transport == BT_TRANSPORT_BR_EDR) in l2c_link_hci_disc_comp()
393 btm_sco_acl_removed(&p_lcb->remote_bd_addr); in l2c_link_hci_disc_comp()
400 if (p_lcb->ccb_queue.p_first_ccb != NULL || p_lcb->p_pending_ccb) { in l2c_link_hci_disc_comp()
404 while (!list_is_empty(p_lcb->link_xmit_data_q)) { in l2c_link_hci_disc_comp()
406 static_cast<BT_HDR*>(list_front(p_lcb->link_xmit_data_q)); in l2c_link_hci_disc_comp()
407 list_remove(p_lcb->link_xmit_data_q, p_buf); in l2c_link_hci_disc_comp()
410 transport = p_lcb->transport; in l2c_link_hci_disc_comp()
413 if (p_lcb->transport == BT_TRANSPORT_LE) { in l2c_link_hci_disc_comp()
414 btm_acl_removed(p_lcb->remote_bd_addr, p_lcb->transport); in l2c_link_hci_disc_comp()
422 if (p_lcb->p_fixed_ccbs[xx] && in l2c_link_hci_disc_comp()
423 p_lcb->p_fixed_ccbs[xx] != p_lcb->p_pending_ccb) { in l2c_link_hci_disc_comp()
425 xx + L2CAP_FIRST_FIXED_CHNL, p_lcb->remote_bd_addr, false, in l2c_link_hci_disc_comp()
426 p_lcb->disc_reason, p_lcb->transport); in l2c_link_hci_disc_comp()
427 if (p_lcb->p_fixed_ccbs[xx] == NULL) { in l2c_link_hci_disc_comp()
433 __func__, xx, p_lcb->remote_bd_addr.ToString().c_str(), p_lcb, in l2c_link_hci_disc_comp()
434 p_lcb->in_use, p_lcb->link_state, p_lcb->handle, in l2c_link_hci_disc_comp()
435 p_lcb->link_role, p_lcb->is_bonding, p_lcb->disc_reason, in l2c_link_hci_disc_comp()
436 p_lcb->transport); in l2c_link_hci_disc_comp()
438 CHECK(p_lcb->p_fixed_ccbs[xx] != NULL); in l2c_link_hci_disc_comp()
439 l2cu_release_ccb(p_lcb->p_fixed_ccbs[xx]); in l2c_link_hci_disc_comp()
441 p_lcb->p_fixed_ccbs[xx] = NULL; in l2c_link_hci_disc_comp()
446 if (p_lcb->transport == BT_TRANSPORT_LE) { in l2c_link_hci_disc_comp()
447 if (l2cu_create_conn_le(p_lcb)) in l2c_link_hci_disc_comp()
450 if (l2cu_create_conn_br_edr(p_lcb)) in l2c_link_hci_disc_comp()
455 p_lcb->p_pending_ccb = NULL; in l2c_link_hci_disc_comp()
458 if (lcb_is_free) l2cu_release_lcb(p_lcb); in l2c_link_hci_disc_comp()
463 ((p_lcb = l2cu_find_lcb_by_state(LST_CONNECT_HOLDING)) != NULL)) { in l2c_link_hci_disc_comp()
465 l2cu_create_conn_br_edr(p_lcb); in l2c_link_hci_disc_comp()
482 tL2C_LCB* p_lcb; in l2c_link_hci_qos_violation() local
486 p_lcb = l2cu_find_lcb_by_handle(handle); in l2c_link_hci_qos_violation()
489 if (!p_lcb) return (false); in l2c_link_hci_qos_violation()
492 for (p_ccb = p_lcb->ccb_queue.p_first_ccb; p_ccb; p_ccb = p_ccb->p_next_ccb) { in l2c_link_hci_qos_violation()
509 void l2c_link_timeout(tL2C_LCB* p_lcb) { in l2c_link_timeout() argument
515 p_lcb->link_state, p_lcb->ccb_queue.p_first_ccb, p_lcb->is_bonding); in l2c_link_timeout()
519 if ((p_lcb->link_state == LST_CONNECTING_WAIT_SWITCH) || in l2c_link_timeout()
520 (p_lcb->link_state == LST_CONNECTING) || in l2c_link_timeout()
521 (p_lcb->link_state == LST_CONNECT_HOLDING) || in l2c_link_timeout()
522 (p_lcb->link_state == LST_DISCONNECTING)) { in l2c_link_timeout()
523 p_lcb->p_pending_ccb = NULL; in l2c_link_timeout()
527 for (p_ccb = p_lcb->ccb_queue.p_first_ccb; p_ccb;) { in l2c_link_timeout()
536 l2cu_release_lcb(p_lcb); in l2c_link_timeout()
540 if (p_lcb->link_state == LST_CONNECTED) { in l2c_link_timeout()
542 if (p_lcb->p_echo_rsp_cb) { in l2c_link_timeout()
543 tL2CA_ECHO_RSP_CB* p_cb = p_lcb->p_echo_rsp_cb; in l2c_link_timeout()
546 p_lcb->p_echo_rsp_cb = NULL; in l2c_link_timeout()
554 for (p_ccb = p_lcb->ccb_queue.p_first_ccb; p_ccb;) { in l2c_link_timeout()
564 if (!p_lcb->ccb_queue.p_first_ccb) { in l2c_link_timeout()
568 rc = btm_sec_disconnect(p_lcb->handle, HCI_ERR_PEER_USER); in l2c_link_timeout()
575 p_lcb->link_state = LST_DISCONNECTING; in l2c_link_timeout()
578 l2cu_process_fixed_disc_cback(p_lcb); in l2c_link_timeout()
581 p_lcb->link_state = LST_DISCONNECTING; in l2c_link_timeout()
586 } else if (p_lcb->is_bonding) { in l2c_link_timeout()
587 btsnd_hcic_disconnect(p_lcb->handle, HCI_ERR_PEER_USER); in l2c_link_timeout()
588 l2cu_process_fixed_disc_cback(p_lcb); in l2c_link_timeout()
589 p_lcb->link_state = LST_DISCONNECTING; in l2c_link_timeout()
597 alarm_set_on_mloop(p_lcb->l2c_lcb_timer, timeout_ms, in l2c_link_timeout()
598 l2c_lcb_timer_timeout, p_lcb); in l2c_link_timeout()
602 l2c_link_check_send_pkts(p_lcb, NULL, NULL); in l2c_link_timeout()
617 tL2C_LCB* p_lcb = (tL2C_LCB*)data; in l2c_info_resp_timer_timeout() local
623 if (p_lcb->w4_info_rsp) { in l2c_info_resp_timer_timeout()
625 for (p_ccb = p_lcb->ccb_queue.p_first_ccb; p_ccb; in l2c_info_resp_timer_timeout()
629 alarm_set_on_mloop(p_lcb->info_resp_timer, in l2c_info_resp_timer_timeout()
631 l2c_info_resp_timer_timeout, p_lcb); in l2c_info_resp_timer_timeout()
636 p_lcb->w4_info_rsp = false; in l2c_info_resp_timer_timeout()
639 if ((p_lcb->link_state != LST_DISCONNECTED) && in l2c_info_resp_timer_timeout()
640 (p_lcb->link_state != LST_DISCONNECTING)) { in l2c_info_resp_timer_timeout()
642 if (p_lcb->ccb_queue.p_first_ccb) { in l2c_info_resp_timer_timeout()
644 ci.bd_addr = p_lcb->remote_bd_addr; in l2c_info_resp_timer_timeout()
646 for (p_ccb = p_lcb->ccb_queue.p_first_ccb; p_ccb; in l2c_info_resp_timer_timeout()
672 tL2C_LCB* p_lcb; in l2c_link_adjust_allocation() local
687 for (yy = 0, p_lcb = &l2cb.lcb_pool[0]; yy < MAX_L2CAP_LINKS; yy++, p_lcb++) { in l2c_link_adjust_allocation()
688 if (p_lcb->in_use) { in l2c_link_adjust_allocation()
689 if (p_lcb->acl_priority == L2CAP_PRIORITY_HIGH) in l2c_link_adjust_allocation()
734 for (yy = 0, p_lcb = &l2cb.lcb_pool[0]; yy < MAX_L2CAP_LINKS; yy++, p_lcb++) { in l2c_link_adjust_allocation()
735 if (p_lcb->in_use) { in l2c_link_adjust_allocation()
736 if (p_lcb->acl_priority == L2CAP_PRIORITY_HIGH) { in l2c_link_adjust_allocation()
737 p_lcb->link_xmit_quota = high_pri_link_quota; in l2c_link_adjust_allocation()
744 if ((p_lcb->link_xmit_quota > 0) && (qq == 0)) in l2c_link_adjust_allocation()
745 l2cb.round_robin_unacked += p_lcb->sent_not_acked; in l2c_link_adjust_allocation()
747 p_lcb->link_xmit_quota = qq; in l2c_link_adjust_allocation()
749 p_lcb->link_xmit_quota++; in l2c_link_adjust_allocation()
756 p_lcb->acl_priority, p_lcb->link_xmit_quota); in l2c_link_adjust_allocation()
759 p_lcb->sent_not_acked, l2cb.round_robin_unacked); in l2c_link_adjust_allocation()
764 if ((p_lcb->link_state == LST_CONNECTED) && in l2c_link_adjust_allocation()
765 (!list_is_empty(p_lcb->link_xmit_data_q)) && in l2c_link_adjust_allocation()
766 (p_lcb->sent_not_acked < p_lcb->link_xmit_quota)) { in l2c_link_adjust_allocation()
767 alarm_set_on_mloop(p_lcb->l2c_lcb_timer, in l2c_link_adjust_allocation()
769 l2c_lcb_timer_timeout, p_lcb); in l2c_link_adjust_allocation()
860 tL2C_LCB* p_lcb; in l2c_link_role_changed() local
867 p_lcb = l2cu_find_lcb_by_bd_addr(*bd_addr, BT_TRANSPORT_BR_EDR); in l2c_link_role_changed()
868 if (p_lcb) { in l2c_link_role_changed()
869 p_lcb->link_role = new_role; in l2c_link_role_changed()
873 l2cu_set_acl_priority(*bd_addr, p_lcb->acl_priority, true); in l2c_link_role_changed()
878 for (xx = 0, p_lcb = &l2cb.lcb_pool[0]; xx < MAX_L2CAP_LINKS; xx++, p_lcb++) { in l2c_link_role_changed()
879 if ((p_lcb->in_use) && (p_lcb->link_state == LST_CONNECTING_WAIT_SWITCH)) { in l2c_link_role_changed()
880 l2cu_create_conn_after_switch(p_lcb); in l2c_link_role_changed()
899 tL2C_LCB* p_lcb = l2cu_find_lcb_by_bd_addr(bd_addr, BT_TRANSPORT_BR_EDR); in l2c_pin_code_request() local
901 if ((p_lcb) && (!p_lcb->ccb_queue.p_first_ccb)) { in l2c_pin_code_request()
902 alarm_set_on_mloop(p_lcb->l2c_lcb_timer, L2CAP_LINK_CONNECT_EXT_TIMEOUT_MS, in l2c_pin_code_request()
903 l2c_lcb_timer_timeout, p_lcb); in l2c_pin_code_request()
918 bool l2c_link_check_power_mode(tL2C_LCB* p_lcb) { in l2c_link_check_power_mode() argument
926 if (list_is_empty(p_lcb->link_xmit_data_q)) { in l2c_link_check_power_mode()
927 for (p_ccb = p_lcb->ccb_queue.p_first_ccb; p_ccb; in l2c_link_check_power_mode()
940 if (BTM_ReadPowerMode(p_lcb->remote_bd_addr, &mode) == BTM_SUCCESS) { in l2c_link_check_power_mode()
942 L2CAP_TRACE_DEBUG("LCB(0x%x) is in PM pending state", p_lcb->handle); in l2c_link_check_power_mode()
963 void l2c_link_check_send_pkts(tL2C_LCB* p_lcb, tL2C_CCB* p_ccb, BT_HDR* p_buf) { in l2c_link_check_send_pkts() argument
976 list_append(p_lcb->link_xmit_data_q, p_buf); in l2c_link_check_send_pkts()
978 if (p_lcb->link_xmit_quota == 0) { in l2c_link_check_send_pkts()
979 if (p_lcb->transport == BT_TRANSPORT_LE) in l2c_link_check_send_pkts()
995 if ((p_lcb == NULL) || (p_lcb->link_xmit_quota == 0)) { in l2c_link_check_send_pkts()
996 if (p_lcb == NULL) in l2c_link_check_send_pkts()
997 p_lcb = l2cb.lcb_pool; in l2c_link_check_send_pkts()
999 p_lcb++; in l2c_link_check_send_pkts()
1002 for (xx = 0; xx < MAX_L2CAP_LINKS; xx++, p_lcb++) { in l2c_link_check_send_pkts()
1004 if (p_lcb == &l2cb.lcb_pool[MAX_L2CAP_LINKS]) p_lcb = &l2cb.lcb_pool[0]; in l2c_link_check_send_pkts()
1009 (p_lcb->transport == BT_TRANSPORT_BR_EDR)) || in l2c_link_check_send_pkts()
1010 (p_lcb->transport == BT_TRANSPORT_LE && in l2c_link_check_send_pkts()
1015 if ((!p_lcb->in_use) || (p_lcb->partial_segment_being_sent) || in l2c_link_check_send_pkts()
1016 (p_lcb->link_state != LST_CONNECTED) || in l2c_link_check_send_pkts()
1017 (p_lcb->link_xmit_quota != 0) || (L2C_LINK_CHECK_POWER_MODE(p_lcb))) in l2c_link_check_send_pkts()
1021 if (!list_is_empty(p_lcb->link_xmit_data_q)) { in l2c_link_check_send_pkts()
1022 p_buf = (BT_HDR*)list_front(p_lcb->link_xmit_data_q); in l2c_link_check_send_pkts()
1023 list_remove(p_lcb->link_xmit_data_q, p_buf); in l2c_link_check_send_pkts()
1024 l2c_link_send_to_lower(p_lcb, p_buf, NULL); in l2c_link_check_send_pkts()
1032 p_buf = l2cu_get_next_buffer_to_send(p_lcb, &cbi); in l2c_link_check_send_pkts()
1034 l2c_link_send_to_lower(p_lcb, p_buf, &cbi); in l2c_link_check_send_pkts()
1042 (p_lcb->transport == BT_TRANSPORT_BR_EDR)) in l2c_link_check_send_pkts()
1047 (p_lcb->transport == BT_TRANSPORT_LE)) in l2c_link_check_send_pkts()
1052 if ((p_lcb->partial_segment_being_sent) || in l2c_link_check_send_pkts()
1053 (p_lcb->link_state != LST_CONNECTED) || in l2c_link_check_send_pkts()
1054 (L2C_LINK_CHECK_POWER_MODE(p_lcb))) in l2c_link_check_send_pkts()
1059 (p_lcb->transport == BT_TRANSPORT_BR_EDR)) || in l2c_link_check_send_pkts()
1061 (p_lcb->transport == BT_TRANSPORT_LE))) && in l2c_link_check_send_pkts()
1062 (p_lcb->sent_not_acked < p_lcb->link_xmit_quota)) { in l2c_link_check_send_pkts()
1063 if (list_is_empty(p_lcb->link_xmit_data_q)) break; in l2c_link_check_send_pkts()
1065 p_buf = (BT_HDR*)list_front(p_lcb->link_xmit_data_q); in l2c_link_check_send_pkts()
1066 list_remove(p_lcb->link_xmit_data_q, p_buf); in l2c_link_check_send_pkts()
1067 if (!l2c_link_send_to_lower(p_lcb, p_buf, NULL)) break; in l2c_link_check_send_pkts()
1073 (p_lcb->transport == BT_TRANSPORT_BR_EDR)) || in l2c_link_check_send_pkts()
1075 (p_lcb->transport == BT_TRANSPORT_LE))) && in l2c_link_check_send_pkts()
1076 (p_lcb->sent_not_acked < p_lcb->link_xmit_quota)) { in l2c_link_check_send_pkts()
1078 p_buf = l2cu_get_next_buffer_to_send(p_lcb, &cbi); in l2c_link_check_send_pkts()
1081 if (!l2c_link_send_to_lower(p_lcb, p_buf, &cbi)) break; in l2c_link_check_send_pkts()
1088 if ((!list_is_empty(p_lcb->link_xmit_data_q)) && in l2c_link_check_send_pkts()
1089 (p_lcb->sent_not_acked < p_lcb->link_xmit_quota)) { in l2c_link_check_send_pkts()
1090 alarm_set_on_mloop(p_lcb->l2c_lcb_timer, in l2c_link_check_send_pkts()
1092 l2c_lcb_timer_timeout, p_lcb); in l2c_link_check_send_pkts()
1106 static bool l2c_link_send_to_lower(tL2C_LCB* p_lcb, BT_HDR* p_buf, in l2c_link_send_to_lower() argument
1113 (p_lcb->transport == BT_TRANSPORT_BR_EDR)) || in l2c_link_send_to_lower()
1114 ((p_lcb->transport == BT_TRANSPORT_LE) && in l2c_link_send_to_lower()
1116 if (p_lcb->link_xmit_quota == 0) { in l2c_link_send_to_lower()
1117 if (p_lcb->transport == BT_TRANSPORT_LE) in l2c_link_send_to_lower()
1122 p_lcb->sent_not_acked++; in l2c_link_send_to_lower()
1125 if (p_lcb->transport == BT_TRANSPORT_LE) { in l2c_link_send_to_lower()
1134 if (p_lcb->transport == BT_TRANSPORT_LE) { in l2c_link_send_to_lower()
1146 if (p_lcb->link_xmit_quota == 0) { in l2c_link_send_to_lower()
1148 p_lcb->partial_segment_being_sent = true; in l2c_link_send_to_lower()
1153 p_lcb->partial_segment_being_sent = true; in l2c_link_send_to_lower()
1156 if (num_segs > (p_lcb->link_xmit_quota - p_lcb->sent_not_acked)) { in l2c_link_send_to_lower()
1157 num_segs = (p_lcb->link_xmit_quota - p_lcb->sent_not_acked); in l2c_link_send_to_lower()
1158 p_lcb->partial_segment_being_sent = true; in l2c_link_send_to_lower()
1163 if (p_lcb->transport == BT_TRANSPORT_LE) { in l2c_link_send_to_lower()
1165 if (p_lcb->link_xmit_quota == 0) l2cb.ble_round_robin_unacked += num_segs; in l2c_link_send_to_lower()
1169 if (p_lcb->link_xmit_quota == 0) l2cb.round_robin_unacked += num_segs; in l2c_link_send_to_lower()
1172 p_lcb->sent_not_acked += num_segs; in l2c_link_send_to_lower()
1173 if (p_lcb->transport == BT_TRANSPORT_LE) { in l2c_link_send_to_lower()
1182 if (p_lcb->transport == BT_TRANSPORT_LE) { in l2c_link_send_to_lower()
1185 l2cb.controller_le_xmit_window, p_lcb->handle, p_lcb->link_xmit_quota, in l2c_link_send_to_lower()
1186 p_lcb->sent_not_acked, l2cb.ble_round_robin_quota, in l2c_link_send_to_lower()
1191 l2cb.controller_xmit_window, p_lcb->handle, p_lcb->link_xmit_quota, in l2c_link_send_to_lower()
1192 p_lcb->sent_not_acked, l2cb.round_robin_quota, in l2c_link_send_to_lower()
1217 tL2C_LCB* p_lcb; in l2c_link_process_num_completed_pkts() local
1225 p_lcb = l2cu_find_lcb_by_handle(handle); in l2c_link_process_num_completed_pkts()
1229 if ((p_lcb != NULL) && (p_lcb->p_nocp_cb)) { in l2c_link_process_num_completed_pkts()
1231 (*p_lcb->p_nocp_cb)(p_lcb->remote_bd_addr); in l2c_link_process_num_completed_pkts()
1234 if (p_lcb) { in l2c_link_process_num_completed_pkts()
1235 if (p_lcb && (p_lcb->transport == BT_TRANSPORT_LE)) in l2c_link_process_num_completed_pkts()
1242 if (p_lcb->link_xmit_quota == 0) { in l2c_link_process_num_completed_pkts()
1243 if (p_lcb->transport == BT_TRANSPORT_LE) { in l2c_link_process_num_completed_pkts()
1259 if (p_lcb->sent_not_acked > num_sent) in l2c_link_process_num_completed_pkts()
1260 p_lcb->sent_not_acked -= num_sent; in l2c_link_process_num_completed_pkts()
1262 p_lcb->sent_not_acked = 0; in l2c_link_process_num_completed_pkts()
1264 l2c_link_check_send_pkts(p_lcb, NULL, NULL); in l2c_link_process_num_completed_pkts()
1267 if ((p_lcb->acl_priority == L2CAP_PRIORITY_HIGH) && in l2c_link_process_num_completed_pkts()
1272 if ((p_lcb->transport == BT_TRANSPORT_LE) && in l2c_link_process_num_completed_pkts()
1273 (p_lcb->acl_priority == L2CAP_PRIORITY_HIGH) && in l2c_link_process_num_completed_pkts()
1281 if (p_lcb) { in l2c_link_process_num_completed_pkts()
1282 if (p_lcb->transport == BT_TRANSPORT_LE) { in l2c_link_process_num_completed_pkts()
1285 l2cb.controller_le_xmit_window, p_lcb->handle, in l2c_link_process_num_completed_pkts()
1286 p_lcb->sent_not_acked, l2cb.ble_check_round_robin, in l2c_link_process_num_completed_pkts()
1291 l2cb.controller_xmit_window, p_lcb->handle, p_lcb->sent_not_acked, in l2c_link_process_num_completed_pkts()
1317 tL2C_LCB* p_lcb; in l2c_link_segments_xmitted() local
1324 p_lcb = l2cu_find_lcb_by_handle(handle); in l2c_link_segments_xmitted()
1325 if (p_lcb == NULL) { in l2c_link_segments_xmitted()
1332 if (p_lcb->link_state == LST_CONNECTED) { in l2c_link_segments_xmitted()
1335 list_prepend(p_lcb->link_xmit_data_q, p_msg); in l2c_link_segments_xmitted()
1337 p_lcb->partial_segment_being_sent = false; in l2c_link_segments_xmitted()
1339 l2c_link_check_send_pkts(p_lcb, NULL, NULL); in l2c_link_segments_xmitted()