Lines Matching full:llcp_cb
90 if ( (llcp_cb.lcb.inact_timer.in_use == FALSE)
91 &&(llcp_cb.lcb.inact_timeout > 0) )
93 LLCP_TRACE_DEBUG1 ("Start inactivity_timer: %d ms", llcp_cb.lcb.inact_timeout);
95 nfc_start_quick_timer (&llcp_cb.lcb.inact_timer, NFC_TTYPE_LLCP_LINK_INACT,
96 ((UINT32) llcp_cb.lcb.inact_timeout) * QUICK_TIMER_TICKS_PER_SEC / 1000);
111 if (llcp_cb.lcb.inact_timer.in_use)
115 nfc_stop_quick_timer (&llcp_cb.lcb.inact_timer);
130 if (llcp_cb.lcb.symm_state == LLCP_LINK_SYMM_LOCAL_XMIT_NEXT)
133 nfc_start_quick_timer (&llcp_cb.lcb.timer, NFC_TTYPE_LLCP_LINK_MANAGER,
134 (((UINT32) llcp_cb.lcb.symm_delay) * QUICK_TIMER_TICKS_PER_SEC) / 1000);
139 nfc_start_quick_timer (&llcp_cb.lcb.timer, NFC_TTYPE_LLCP_LINK_MANAGER,
140 ((UINT32) llcp_cb.lcb.peer_lto) * QUICK_TIMER_TICKS_PER_SEC / 1000);
155 nfc_stop_quick_timer (&llcp_cb.lcb.timer);
185 (*llcp_cb.lcb.p_link_cback) (LLCP_LINK_ACTIVATION_FAILED_EVT, LLCP_LINK_BAD_GEN_BYTES);
193 if ((p_config->is_initiator) && (llcp_link_rwt[p_config->waiting_time] > llcp_cb.lcb.peer_lto))
198 llcp_cb.lcb.peer_lto);
202 llcp_cb.lcb.peer_lto += LLCP_INTERNAL_TX_DELAY + LLCP_INTERNAL_RX_DELAY;
208 (*llcp_cb.lcb.p_link_cback) (LLCP_LINK_ACTIVATION_FAILED_EVT, LLCP_LINK_VERSION_FAILED);
212 llcp_cb.lcb.received_first_packet = FALSE;
213 llcp_cb.lcb.is_initiator = p_config->is_initiator;
216 llcp_cb.lcb.flags = 0x00;
220 if (llcp_cb.lcb.local_link_miu >= llcp_cb.lcb.peer_miu)
221 llcp_cb.lcb.effective_miu = llcp_cb.lcb.peer_miu;
223 llcp_cb.lcb.effective_miu = llcp_cb.lcb.local_link_miu;
229 if (llcp_cb.lcb.is_initiator)
233 llcp_cb.lcb.inact_timeout = llcp_cb.lcb.inact_timeout_init;
234 llcp_cb.lcb.symm_state = LLCP_LINK_SYMM_LOCAL_XMIT_NEXT;
236 if (llcp_cb.lcb.delay_first_pdu_timeout > 0)
239 nfc_start_quick_timer (&llcp_cb.lcb.timer, NFC_TTYPE_LLCP_DELAY_FIRST_PDU,
240 (((UINT32) llcp_cb.lcb.delay_first_pdu_timeout) * QUICK_TIMER_TICKS_PER_SEC) / 1000);
250 llcp_cb.lcb.inact_timeout = llcp_cb.lcb.inact_timeout_target;
251 llcp_cb.lcb.symm_state = LLCP_LINK_SYMM_REMOTE_XMIT_NEXT;
262 llcp_cb.lcb.link_state = LLCP_LINK_STATE_ACTIVATED;
265 (*llcp_cb.lcb.p_link_cback) (LLCP_LINK_ACTIVATION_COMPLETE_EVT, LLCP_LINK_SUCCESS);
293 llcp_cb.lcb.link_state = LLCP_LINK_STATE_DEACTIVATED;
301 (*llcp_cb.lcb.p_link_cback) (LLCP_LINK_DEACTIVATED_EVT, reason);
315 if (llcp_cb.lcb.link_state == LLCP_LINK_STATE_ACTIVATED)
317 if ((llcp_cb.lcb.symm_delay > 0) && (llcp_cb.lcb.symm_state == LLCP_LINK_SYMM_LOCAL_XMIT_NEXT))
327 if (llcp_cb.num_data_link_connection == 0)
338 else if (llcp_cb.lcb.link_state == LLCP_LINK_STATE_DEACTIVATING)
340 llcp_deactivate_cleanup (llcp_cb.lcb.link_deact_reason);
364 while (llcp_cb.lcb.sig_xmit_q.p_first)
365 GKI_freebuf (GKI_dequeue (&llcp_cb.lcb.sig_xmit_q));
385 llcp_cb.total_tx_ui_pdu = 0;
386 llcp_cb.total_rx_ui_pdu = 0;
391 if (llcp_cb.dlcb[idx].state != LLCP_DLC_STATE_IDLE)
393 p_dlcb = &(llcp_cb.dlcb[idx]);
398 llcp_cb.total_tx_i_pdu = 0;
399 llcp_cb.total_rx_i_pdu = 0;
401 llcp_cb.overall_tx_congested = FALSE;
402 llcp_cb.overall_rx_congested = FALSE;
415 llcp_cb.lcb.link_state = LLCP_LINK_STATE_DEACTIVATING;
417 if (llcp_cb.lcb.sig_xmit_q.count == 0)
420 nfc_start_quick_timer (&llcp_cb.lcb.timer, NFC_TTYPE_LLCP_LINK_MANAGER,
424 llcp_cb.lcb.link_deact_reason = reason;
428 &&(!llcp_cb.lcb.is_initiator) )
462 llcp_cb.lcb.peer_miu = LLCP_DEFAULT_MIU;
463 llcp_cb.lcb.peer_lto = LLCP_DEFAULT_LTO_IN_MS;
488 peer_major_version = LLCP_GET_MAJOR_VERSION (llcp_cb.lcb.peer_version);
489 peer_minor_version = LLCP_GET_MINOR_VERSION (llcp_cb.lcb.peer_version);
500 llcp_cb.lcb.agreed_major_version = LLCP_VERSION_MAJOR;
503 llcp_cb.lcb.agreed_minor_version = LLCP_VERSION_MINOR;
507 llcp_cb.lcb.agreed_minor_version = peer_minor_version;
513 llcp_cb.lcb.agreed_major_version = peer_major_version;
514 llcp_cb.lcb.agreed_minor_version = peer_minor_version;
519 llcp_cb.lcb.agreed_major_version = LLCP_VERSION_MAJOR;
520 llcp_cb.lcb.agreed_minor_version = LLCP_VERSION_MINOR;
526 llcp_cb.lcb.agreed_major_version, llcp_cb.lcb.agreed_minor_version);
549 data.link_status.is_initiator = llcp_cb.lcb.is_initiator;
581 if (llcp_cb.overall_tx_congested)
587 if (llcp_cb.total_tx_ui_pdu + llcp_cb.total_tx_i_pdu >= llcp_cb.max_num_tx_buff)
590 llcp_cb.overall_tx_congested = TRUE;
593 llcp_cb.total_tx_ui_pdu, llcp_cb.total_tx_i_pdu);
629 if ( (llcp_cb.dlcb[idx].state == LLCP_DLC_STATE_CONNECTED)
630 &&(llcp_cb.dlcb[idx].remote_busy == FALSE)
631 &&(llcp_cb.dlcb[idx].is_tx_congested == FALSE) )
633 llcp_cb.dlcb[idx].is_tx_congested = TRUE;
636 llcp_cb.dlcb[idx].local_sap, llcp_cb.dlcb[idx].remote_sap,
637 llcp_cb.dlcb[idx].i_xmit_q.count);
639 data.congest.local_sap = llcp_cb.dlcb[idx].local_sap;
640 data.congest.remote_sap = llcp_cb.dlcb[idx].remote_sap;
642 (*llcp_cb.dlcb[idx].p_app_cb->p_app_cback) (&data);
665 if (llcp_cb.overall_tx_congested)
667 if (llcp_cb.total_tx_ui_pdu + llcp_cb.total_tx_i_pdu <= llcp_cb.max_num_tx_buff / 2)
670 llcp_cb.overall_tx_congested = FALSE;
673 llcp_cb.total_tx_ui_pdu, llcp_cb.total_tx_i_pdu);
686 if (llcp_cb.total_tx_ui_pdu < llcp_cb.max_num_ll_tx_buff)
696 sap = llcp_cb.ll_tx_uncongest_ntf_start_sap;
709 &&(p_app_cb->ui_xmit_q.count <= llcp_cb.ll_tx_congest_end) )
728 sap = (llcp_cb.ll_tx_uncongest_ntf_start_sap + 1) % LLCP_NUM_SAPS;
738 llcp_cb.ll_tx_uncongest_ntf_start_sap = sap;
752 idx = llcp_cb.dl_tx_uncongest_ntf_start_idx;
757 if ( (llcp_cb.dlcb[idx].state == LLCP_DLC_STATE_CONNECTED)
758 &&(llcp_cb.dlcb[idx].is_tx_congested)
759 &&(llcp_cb.dlcb[idx].i_xmit_q.count <= llcp_cb.dlcb[idx].remote_rw / 2) )
761 llcp_cb.dlcb[idx].is_tx_congested = FALSE;
763 if (llcp_cb.dlcb[idx].remote_busy == FALSE)
766 llcp_cb.dlcb[idx].local_sap, llcp_cb.dlcb[idx].remote_sap,
767 llcp_cb.dlcb[idx].i_xmit_q.count);
769 data.congest.local_sap = llcp_cb.dlcb[idx].local_sap;
770 data.congest.remote_sap = llcp_cb.dlcb[idx].remote_sap;
772 (*llcp_cb.dlcb[idx].p_app_cb->p_app_cback) (&data);
781 idx = (llcp_cb.dl_tx_uncongest_ntf_start_idx + 1) % LLCP_MAX_DATA_LINK;
782 if (llcp_cb.dlcb[idx].state == LLCP_DLC_STATE_CONNECTED)
784 llcp_cb.dl_tx_uncongest_ntf_start_idx = idx;
832 if (llcp_cb.lcb.is_sending_data)
835 llcp_cb.lcb.is_sending_data = TRUE;
843 if (llcp_cb.lcb.symm_state == LLCP_LINK_SYMM_LOCAL_XMIT_NEXT)
876 if (llcp_cb.lcb.link_state == LLCP_LINK_STATE_ACTIVATED)
878 if (llcp_cb.lcb.symm_delay > 0)
882 llcp_cb.lcb.is_sending_data = FALSE;
890 if (llcp_cb.num_data_link_connection == 0)
898 llcp_cb.lcb.is_sending_data = FALSE;
903 if (llcp_cb.lcb.link_state == LLCP_LINK_STATE_DEACTIVATING)
906 nfc_start_quick_timer (&llcp_cb.lcb.timer, NFC_TTYPE_LLCP_LINK_MANAGER,
916 llcp_cb.lcb.is_sending_data = FALSE;
1040 llcp_cb.total_rx_ui_pdu++;
1044 if (p_app_cb->ui_rx_q.count > llcp_cb.ll_rx_congest_start)
1050 llcp_cb.total_rx_ui_pdu--;
1273 if (llcp_cb.lcb.symm_state == LLCP_LINK_SYMM_REMOTE_XMIT_NEXT)
1277 if (llcp_cb.lcb.received_first_packet == FALSE)
1279 llcp_cb.lcb.received_first_packet = TRUE;
1280 (*llcp_cb.lcb.p_link_cback) (LLCP_LINK_FIRST_PACKET_RECEIVED_EVT, LLCP_LINK_SUCCESS);
1282 if ( (llcp_cb.lcb.link_state == LLCP_LINK_STATE_DEACTIVATING)
1283 &&(llcp_cb.lcb.sig_xmit_q.count == 0) )
1326 if ((!frame_error) && (info_length > llcp_cb.lcb.local_link_miu))
1329 llcp_cb.lcb.local_link_miu, info_length);
1359 llcp_cb.lcb.symm_state = LLCP_LINK_SYMM_LOCAL_XMIT_NEXT;
1391 if (llcp_cb.lcb.sig_xmit_q.p_first)
1395 p_msg = (BT_HDR*) llcp_cb.lcb.sig_xmit_q.p_first;
1400 p_msg = (BT_HDR*) GKI_dequeue (&llcp_cb.lcb.sig_xmit_q);
1409 if (!llcp_cb.lcb.ll_served)
1415 p_app_cb = llcp_util_get_app_cb (llcp_cb.lcb.ll_idx);
1431 llcp_cb.lcb.ll_served = !llcp_cb.lcb.ll_served;
1434 llcp_cb.total_tx_ui_pdu--;
1437 llcp_cb.lcb.ll_idx = (llcp_cb.lcb.ll_idx + 1) % LLCP_NUM_SAPS;
1445 llcp_cb.lcb.ll_idx = (llcp_cb.lcb.ll_idx + 1) % LLCP_NUM_SAPS;
1450 llcp_cbllcp_cb.lcb.ll_served;
1458 if (llcp_cb.dlcb[llcp_cb.lcb.dl_idx].state != LLCP_DLC_STATE_IDLE)
1462 *p_next_pdu_length = llcp_dlc_get_next_pdu_length (&llcp_cb.dlcb[llcp_cb.lcb.dl_idx]);
1472 llcp_cb.lcb.dl_idx = (llcp_cb.lcb.dl_idx + 1) % LLCP_MAX_DATA_LINK;
1477 p_msg = llcp_dlc_get_next_pdu (&llcp_cb.dlcb[llcp_cb.lcb.dl_idx]);
1480 llcp_cb.lcb.dl_idx = (llcp_cb.lcb.dl_idx + 1) % LLCP_MAX_DATA_LINK;
1485 llcp_cb.lcb.ll_served = !llcp_cb.lcb.ll_served;
1493 llcp_cb.lcb.dl_idx = (llcp_cb.lcb.dl_idx + 1) % LLCP_MAX_DATA_LINK;
1500 llcp_cb.lcb.ll_served = !llcp_cb.lcb.ll_served;
1569 if (2 + p_msg->len + 2 + next_pdu_length <= llcp_cb.lcb.effective_miu)
1600 if (p_agf->len - LLCP_PDU_HEADER_SIZE + 2 + next_pdu_length <= llcp_cb.lcb.effective_miu)
1644 llcp_cb.lcb.symm_state = LLCP_LINK_SYMM_REMOTE_XMIT_NEXT;
1665 if (llcp_cb.lcb.link_state == LLCP_LINK_STATE_DEACTIVATED)
1673 llcp_cb.lcb.flags |= LLCP_LINK_FLAGS_RX_ANY_LLC_PDU;
1684 if ( (llcp_cb.lcb.link_state == LLCP_LINK_STATE_DEACTIVATING)
1685 &&(!llcp_cb.lcb.is_initiator) )
1691 else if (llcp_cb.lcb.link_state != LLCP_LINK_STATE_DEACTIVATED)