Lines Matching refs: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);
190 llcp_cb.lcb.link_state = LLCP_LINK_STATE_ACTIVATION_FAILED;
200 if ((p_config->is_initiator) && (llcp_link_rwt[p_config->waiting_time] > llcp_cb.lcb.peer_lto))
205 llcp_cb.lcb.peer_lto);
209 llcp_cb.lcb.peer_lto += LLCP_INTERNAL_TX_DELAY + LLCP_INTERNAL_RX_DELAY;
215 (*llcp_cb.lcb.p_link_cback) (LLCP_LINK_ACTIVATION_FAILED_EVT, LLCP_LINK_VERSION_FAILED);
220 llcp_cb.lcb.link_state = LLCP_LINK_STATE_ACTIVATION_FAILED;
226 llcp_cb.lcb.received_first_packet = FALSE;
227 llcp_cb.lcb.is_initiator = p_config->is_initiator;
230 llcp_cb.lcb.flags = 0x00;
234 if (llcp_cb.lcb.local_link_miu >= llcp_cb.lcb.peer_miu)
235 llcp_cb.lcb.effective_miu = llcp_cb.lcb.peer_miu;
237 llcp_cb.lcb.effective_miu = llcp_cb.lcb.local_link_miu;
243 if (llcp_cb.lcb.is_initiator)
247 llcp_cb.lcb.inact_timeout = llcp_cb.lcb.inact_timeout_init;
248 llcp_cb.lcb.symm_state = LLCP_LINK_SYMM_LOCAL_XMIT_NEXT;
250 if (llcp_cb.lcb.delay_first_pdu_timeout > 0)
253 nfc_start_quick_timer (&llcp_cb.lcb.timer, NFC_TTYPE_LLCP_DELAY_FIRST_PDU,
254 (((UINT32) llcp_cb.lcb.delay_first_pdu_timeout) * QUICK_TIMER_TICKS_PER_SEC) / 1000);
264 llcp_cb.lcb.inact_timeout = llcp_cb.lcb.inact_timeout_target;
265 llcp_cb.lcb.symm_state = LLCP_LINK_SYMM_REMOTE_XMIT_NEXT;
276 llcp_cb.lcb.link_state = LLCP_LINK_STATE_ACTIVATED;
279 (*llcp_cb.lcb.p_link_cback) (LLCP_LINK_ACTIVATION_COMPLETE_EVT, LLCP_LINK_SUCCESS);
307 llcp_cb.lcb.link_state = LLCP_LINK_STATE_DEACTIVATED;
315 (*llcp_cb.lcb.p_link_cback) (LLCP_LINK_DEACTIVATED_EVT, reason);
329 if (llcp_cb.lcb.link_state == LLCP_LINK_STATE_ACTIVATED)
331 if ((llcp_cb.lcb.symm_delay > 0) && (llcp_cb.lcb.symm_state == LLCP_LINK_SYMM_LOCAL_XMIT_NEXT))
341 if (llcp_cb.num_data_link_connection == 0)
352 else if (llcp_cb.lcb.link_state == LLCP_LINK_STATE_DEACTIVATING)
354 llcp_deactivate_cleanup (llcp_cb.lcb.link_deact_reason);
378 while (llcp_cb.lcb.sig_xmit_q.p_first)
379 GKI_freebuf (GKI_dequeue (&llcp_cb.lcb.sig_xmit_q));
399 llcp_cb.total_tx_ui_pdu = 0;
400 llcp_cb.total_rx_ui_pdu = 0;
405 if (llcp_cb.dlcb[idx].state != LLCP_DLC_STATE_IDLE)
407 p_dlcb = &(llcp_cb.dlcb[idx]);
412 llcp_cb.total_tx_i_pdu = 0;
413 llcp_cb.total_rx_i_pdu = 0;
415 llcp_cb.overall_tx_congested = FALSE;
416 llcp_cb.overall_rx_congested = FALSE;
429 llcp_cb.lcb.link_state = LLCP_LINK_STATE_DEACTIVATING;
431 if (llcp_cb.lcb.sig_xmit_q.count == 0)
434 nfc_start_quick_timer (&llcp_cb.lcb.timer, NFC_TTYPE_LLCP_LINK_MANAGER,
438 llcp_cb.lcb.link_deact_reason = reason;
442 &&(!llcp_cb.lcb.is_initiator) )
451 &&(!(llcp_cb.lcb.flags & LLCP_LINK_FLAGS_RX_ANY_LLC_PDU)))
482 llcp_cb.lcb.peer_miu = LLCP_DEFAULT_MIU;
483 llcp_cb.lcb.peer_lto = LLCP_DEFAULT_LTO_IN_MS;
508 peer_major_version = LLCP_GET_MAJOR_VERSION (llcp_cb.lcb.peer_version);
509 peer_minor_version = LLCP_GET_MINOR_VERSION (llcp_cb.lcb.peer_version);
520 llcp_cb.lcb.agreed_major_version = LLCP_VERSION_MAJOR;
523 llcp_cb.lcb.agreed_minor_version = LLCP_VERSION_MINOR;
527 llcp_cb.lcb.agreed_minor_version = peer_minor_version;
533 llcp_cb.lcb.agreed_major_version = peer_major_version;
534 llcp_cb.lcb.agreed_minor_version = peer_minor_version;
539 llcp_cb.lcb.agreed_major_version = LLCP_VERSION_MAJOR;
540 llcp_cb.lcb.agreed_minor_version = LLCP_VERSION_MINOR;
546 llcp_cb.lcb.agreed_major_version, llcp_cb.lcb.agreed_minor_version);
569 data.link_status.is_initiator = llcp_cb.lcb.is_initiator;
601 if (llcp_cb.overall_tx_congested)
607 if (llcp_cb.total_tx_ui_pdu + llcp_cb.total_tx_i_pdu >= llcp_cb.max_num_tx_buff)
610 llcp_cb.overall_tx_congested = TRUE;
613 llcp_cb.total_tx_ui_pdu, llcp_cb.total_tx_i_pdu);
649 if ( (llcp_cb.dlcb[idx].state == LLCP_DLC_STATE_CONNECTED)
650 &&(llcp_cb.dlcb[idx].remote_busy == FALSE)
651 &&(llcp_cb.dlcb[idx].is_tx_congested == FALSE) )
653 llcp_cb.dlcb[idx].is_tx_congested = TRUE;
656 llcp_cb.dlcb[idx].local_sap, llcp_cb.dlcb[idx].remote_sap,
657 llcp_cb.dlcb[idx].i_xmit_q.count);
659 data.congest.local_sap = llcp_cb.dlcb[idx].local_sap;
660 data.congest.remote_sap = llcp_cb.dlcb[idx].remote_sap;
662 (*llcp_cb.dlcb[idx].p_app_cb->p_app_cback) (&data);
685 if (llcp_cb.overall_tx_congested)
687 if (llcp_cb.total_tx_ui_pdu + llcp_cb.total_tx_i_pdu <= llcp_cb.max_num_tx_buff / 2)
690 llcp_cb.overall_tx_congested = FALSE;
693 llcp_cb.total_tx_ui_pdu, llcp_cb.total_tx_i_pdu);
706 if (llcp_cb.total_tx_ui_pdu < llcp_cb.max_num_ll_tx_buff)
716 sap = llcp_cb.ll_tx_uncongest_ntf_start_sap;
729 &&(p_app_cb->ui_xmit_q.count <= llcp_cb.ll_tx_congest_end) )
748 sap = (llcp_cb.ll_tx_uncongest_ntf_start_sap + 1) % LLCP_NUM_SAPS;
758 llcp_cb.ll_tx_uncongest_ntf_start_sap = sap;
772 idx = llcp_cb.dl_tx_uncongest_ntf_start_idx;
777 if ( (llcp_cb.dlcb[idx].state == LLCP_DLC_STATE_CONNECTED)
778 &&(llcp_cb.dlcb[idx].is_tx_congested)
779 &&(llcp_cb.dlcb[idx].i_xmit_q.count <= llcp_cb.dlcb[idx].remote_rw / 2) )
781 llcp_cb.dlcb[idx].is_tx_congested = FALSE;
783 if (llcp_cb.dlcb[idx].remote_busy == FALSE)
786 llcp_cb.dlcb[idx].local_sap, llcp_cb.dlcb[idx].remote_sap,
787 llcp_cb.dlcb[idx].i_xmit_q.count);
789 data.congest.local_sap = llcp_cb.dlcb[idx].local_sap;
790 data.congest.remote_sap = llcp_cb.dlcb[idx].remote_sap;
792 (*llcp_cb.dlcb[idx].p_app_cb->p_app_cback) (&data);
801 idx = (llcp_cb.dl_tx_uncongest_ntf_start_idx + 1) % LLCP_MAX_DATA_LINK;
802 if (llcp_cb.dlcb[idx].state == LLCP_DLC_STATE_CONNECTED)
804 llcp_cb.dl_tx_uncongest_ntf_start_idx = idx;
881 if (llcp_cb.lcb.is_sending_data)
884 llcp_cb.lcb.is_sending_data = TRUE;
892 if (llcp_cb.lcb.symm_state == LLCP_LINK_SYMM_LOCAL_XMIT_NEXT)
925 if (llcp_cb.lcb.link_state == LLCP_LINK_STATE_ACTIVATED)
927 if (llcp_cb.lcb.symm_delay > 0)
931 llcp_cb.lcb.is_sending_data = FALSE;
939 if (llcp_cb.num_data_link_connection == 0)
947 llcp_cb.lcb.is_sending_data = FALSE;
952 if (llcp_cb.lcb.link_state == LLCP_LINK_STATE_DEACTIVATING)
955 llcp_cb.lcb.timer, NFC_TTYPE_LLCP_LINK_MANAGER,
965 llcp_cb.lcb.is_sending_data = FALSE;
1089 llcp_cb.total_rx_ui_pdu++;
1093 if (p_app_cb->ui_rx_q.count > llcp_cb.ll_rx_congest_start)
1099 llcp_cb.total_rx_ui_pdu--;
1322 if (llcp_cb.lcb.symm_state == LLCP_LINK_SYMM_REMOTE_XMIT_NEXT)
1326 if (llcp_cb.lcb.received_first_packet == FALSE)
1328 llcp_cb.lcb.received_first_packet = TRUE;
1329 (*llcp_cb.lcb.p_link_cback) (LLCP_LINK_FIRST_PACKET_RECEIVED_EVT, LLCP_LINK_SUCCESS);
1331 if ( (llcp_cb.lcb.link_state == LLCP_LINK_STATE_DEACTIVATING)
1332 &&(llcp_cb.lcb.sig_xmit_q.count == 0) )
1375 if ((!frame_error) && (info_length > llcp_cb.lcb.local_link_miu))
1378 llcp_cb.lcb.local_link_miu, info_length);
1408 llcp_cb.lcb.symm_state = LLCP_LINK_SYMM_LOCAL_XMIT_NEXT;
1440 if (llcp_cb.lcb.sig_xmit_q.p_first)
1444 p_msg = (BT_HDR*) llcp_cb.lcb.sig_xmit_q.p_first;
1449 p_msg = (BT_HDR*) GKI_dequeue (&llcp_cb.lcb.sig_xmit_q);
1458 if (!llcp_cb.lcb.ll_served)
1464 p_app_cb = llcp_util_get_app_cb (llcp_cb.lcb.ll_idx);
1480 llcp_cb.lcb.ll_served = !llcp_cb.lcb.ll_served;
1483 llcp_cb.total_tx_ui_pdu--;
1486 llcp_cb.lcb.ll_idx = (llcp_cb.lcb.ll_idx + 1) % LLCP_NUM_SAPS;
1494 llcp_cb.lcb.ll_idx = (llcp_cb.lcb.ll_idx + 1) % LLCP_NUM_SAPS;
1499 llcp_cb.lcb.ll_served = !llcp_cb.lcb.ll_served;
1507 if (llcp_cb.dlcb[llcp_cb.lcb.dl_idx].state != LLCP_DLC_STATE_IDLE)
1511 *p_next_pdu_length = llcp_dlc_get_next_pdu_length (&llcp_cb.dlcb[llcp_cb.lcb.dl_idx]);
1521 llcp_cb.lcb.dl_idx = (llcp_cb.lcb.dl_idx + 1) % LLCP_MAX_DATA_LINK;
1526 p_msg = llcp_dlc_get_next_pdu (&llcp_cb.dlcb[llcp_cb.lcb.dl_idx]);
1529 llcp_cb.lcb.dl_idx = (llcp_cb.lcb.dl_idx + 1) % LLCP_MAX_DATA_LINK;
1534 llcp_cb.lcb.ll_served = !llcp_cb.lcb.ll_served;
1542 llcp_cb.lcb.dl_idx = (llcp_cb.lcb.dl_idx + 1) % LLCP_MAX_DATA_LINK;
1549 llcp_cb.lcb.ll_served = !llcp_cb.lcb.ll_served;
1618 if (2 + p_msg->len + 2 + next_pdu_length <= llcp_cb.lcb.effective_miu)
1649 if (p_agf->len - LLCP_PDU_HEADER_SIZE + 2 + next_pdu_length <= llcp_cb.lcb.effective_miu)
1693 llcp_cb.lcb.symm_state = LLCP_LINK_SYMM_REMOTE_XMIT_NEXT;
1714 if (llcp_cb.lcb.link_state == LLCP_LINK_STATE_DEACTIVATED)
1720 else if (llcp_cb.lcb.link_state == LLCP_LINK_STATE_ACTIVATION_FAILED)
1730 llcp_cb.lcb.flags |= LLCP_LINK_FLAGS_RX_ANY_LLC_PDU;
1741 if ( (llcp_cb.lcb.link_state == LLCP_LINK_STATE_DEACTIVATING)
1742 &&(!llcp_cb.lcb.is_initiator) )
1748 else if (llcp_cb.lcb.link_state == LLCP_LINK_STATE_ACTIVATION_FAILED)
1752 llcp_cb.lcb.link_state = LLCP_LINK_STATE_DEACTIVATED;
1754 else if (llcp_cb.lcb.link_state != LLCP_LINK_STATE_DEACTIVATED)
1763 if (llcp_cb.lcb.symm_state == LLCP_LINK_SYMM_REMOTE_XMIT_NEXT)