Lines Matching refs:fcrb

173   if (p_ccb->fcrb.wait_ack) {  in l2c_fcr_start_timer()
180 if (!alarm_is_scheduled(p_ccb->fcrb.mon_retrans_timer)) { in l2c_fcr_start_timer()
181 alarm_set_on_mloop(p_ccb->fcrb.mon_retrans_timer, tout, in l2c_fcr_start_timer()
197 alarm_cancel(p_ccb->fcrb.mon_retrans_timer); in l2c_fcr_stop_timer()
212 tL2C_FCRB* p_fcrb = &p_ccb->fcrb; in l2c_fcr_cleanup()
234 p_ccb->fcrb.connect_tick_count; in l2c_fcr_cleanup()
248 p_ccb->fcrb.pkts_retransmitted, p_ccb->fcrb.xmit_window_closed, in l2c_fcr_cleanup()
249 p_ccb->fcrb.retrans_touts, p_ccb->fcrb.xmit_ack_touts); in l2c_fcr_cleanup()
254 p_ccb->fcrb.controller_idle); in l2c_fcr_cleanup()
258 p_ccb->fcrb.max_held_acks, p_ccb->peer_cfg.fcr.tx_win_sz); in l2c_fcr_cleanup()
264 p_ccb->fcrb.ertm_pkt_counts[0], p_ccb->fcrb.ertm_byte_counts[0], in l2c_fcr_cleanup()
265 (dur >= 10 ? (p_ccb->fcrb.ertm_byte_counts[0] * 100) / (dur / 10) : 0), in l2c_fcr_cleanup()
266 p_ccb->fcrb.s_frames_sent[0], p_ccb->fcrb.s_frames_sent[1], in l2c_fcr_cleanup()
267 p_ccb->fcrb.s_frames_sent[2], p_ccb->fcrb.s_frames_sent[3]); in l2c_fcr_cleanup()
276 p_ccb->fcrb.ertm_pkt_counts[1], p_ccb->fcrb.ertm_byte_counts[1], in l2c_fcr_cleanup()
277 (dur >= 10 ? (p_ccb->fcrb.ertm_byte_counts[1] * 100) / (dur / 10) : 0), in l2c_fcr_cleanup()
278 p_ccb->fcrb.s_frames_rcvd[0], p_ccb->fcrb.s_frames_rcvd[1], in l2c_fcr_cleanup()
279 p_ccb->fcrb.s_frames_rcvd[2], p_ccb->fcrb.s_frames_rcvd[3]); in l2c_fcr_cleanup()
289 if (i == p_ccb->fcrb.ack_delay_avg_index) { in l2c_fcr_cleanup()
298 i, p_ccb->fcrb.throughput[i], p_ccb->fcrb.ack_delay_avg[i], in l2c_fcr_cleanup()
299 p_ccb->fcrb.ack_delay_min[i], p_ccb->fcrb.ack_delay_max[i], in l2c_fcr_cleanup()
300 p_ccb->fcrb.ack_q_count_avg[i], p_ccb->fcrb.ack_q_count_min[i], in l2c_fcr_cleanup()
301 p_ccb->fcrb.ack_q_count_max[i]); in l2c_fcr_cleanup()
306 throughput_avg += p_ccb->fcrb.throughput[i]; in l2c_fcr_cleanup()
307 ack_delay_avg += p_ccb->fcrb.ack_delay_avg[i]; in l2c_fcr_cleanup()
308 ack_q_count_avg += p_ccb->fcrb.ack_q_count_avg[i]; in l2c_fcr_cleanup()
379 if ((p_ccb->fcrb.remote_busy) || in l2c_fcr_is_flow_controlled()
380 (fixed_queue_length(p_ccb->fcrb.waiting_for_ack_q) >= in l2c_fcr_is_flow_controlled()
384 p_ccb->fcrb.xmit_window_closed++; in l2c_fcr_is_flow_controlled()
388 p_ccb->fcrb.controller_idle++; in l2c_fcr_is_flow_controlled()
412 tL2C_FCRB* p_fcrb = &p_ccb->fcrb; in prepare_I_frame()
441 p_fcrb->last_ack_sent = p_ccb->fcrb.next_seq_expected; in prepare_I_frame()
443 alarm_cancel(p_ccb->fcrb.ack_timer); in prepare_I_frame()
516 p_ccb->fcrb.s_frames_sent[function_code]++; in l2c_fcr_send_S_frame()
520 p_ccb->fcrb.wait_ack = true; in l2c_fcr_send_S_frame()
528 ctrl_word |= (p_ccb->fcrb.next_seq_expected << L2CAP_FCR_REQ_SEQ_BITS_SHIFT); in l2c_fcr_send_S_frame()
584 p_ccb->fcrb.last_ack_sent = p_ccb->fcrb.next_seq_expected; in l2c_fcr_send_S_frame()
586 alarm_cancel(p_ccb->fcrb.ack_timer); in l2c_fcr_send_S_frame()
665 p_ccb->fcrb.next_tx_seq, p_ccb->fcrb.last_rx_ack, in l2c_fcr_proc_pdu()
666 p_ccb->fcrb.next_seq_expected, p_ccb->fcrb.last_ack_sent, in l2c_fcr_proc_pdu()
667 fixed_queue_length(p_ccb->fcrb.waiting_for_ack_q), p_ccb->fcrb.num_tries); in l2c_fcr_proc_pdu()
694 if (p_ccb->fcrb.wait_ack) { in l2c_fcr_proc_pdu()
699 if (p_ccb->fcrb.srej_sent) in l2c_fcr_proc_pdu()
712 alarm_set_on_mloop(p_ccb->fcrb.mon_retrans_timer, BT_1SEC_TIMEOUT_MS, in l2c_fcr_proc_pdu()
719 p_ccb->fcrb.wait_ack = false; in l2c_fcr_proc_pdu()
724 if (fixed_queue_is_empty(p_ccb->fcrb.waiting_for_ack_q)) in l2c_fcr_proc_pdu()
725 p_ccb->fcrb.num_tries = 0; in l2c_fcr_proc_pdu()
751 if ((!p_ccb->fcrb.srej_sent) && in l2c_fcr_proc_pdu()
752 (!fixed_queue_is_empty(p_ccb->fcrb.srej_rcv_hold_q))) { in l2c_fcr_proc_pdu()
753 fixed_queue_t* temp_q = p_ccb->fcrb.srej_rcv_hold_q; in l2c_fcr_proc_pdu()
754 p_ccb->fcrb.srej_rcv_hold_q = fixed_queue_new(SIZE_MAX); in l2c_fcr_proc_pdu()
768 p_ccb->fcrb.next_seq_expected); in l2c_fcr_proc_pdu()
777 if (p_ccb->fcrb.rej_after_srej) { in l2c_fcr_proc_pdu()
778 p_ccb->fcrb.rej_after_srej = false; in l2c_fcr_proc_pdu()
779 p_ccb->fcrb.rej_sent = true; in l2c_fcr_proc_pdu()
787 if ((!p_ccb->fcrb.rej_sent) && (!p_ccb->fcrb.srej_sent) && in l2c_fcr_proc_pdu()
788 (p_ccb->fcrb.next_seq_expected != p_ccb->fcrb.last_ack_sent)) in l2c_fcr_proc_pdu()
794 p_ccb->local_cid, 0, p_ccb->fcrb.rej_sent, p_ccb->fcrb.srej_sent, in l2c_fcr_proc_pdu()
795 p_ccb->fcrb.next_seq_expected, p_ccb->fcrb.last_ack_sent); in l2c_fcr_proc_pdu()
800 if ((!fixed_queue_is_empty(p_ccb->fcrb.retrans_q) || in l2c_fcr_proc_pdu()
802 (!p_ccb->fcrb.wait_ack) && (!l2c_fcr_is_flow_controlled(p_ccb))) { in l2c_fcr_proc_pdu()
922 p_ccb->local_cid, p_ccb->fcrb.num_tries, p_ccb->peer_cfg.fcr.max_transmit, in l2c_fcr_proc_tout()
923 p_ccb->fcrb.wait_ack, fixed_queue_length(p_ccb->fcrb.waiting_for_ack_q)); in l2c_fcr_proc_tout()
926 p_ccb->fcrb.retrans_touts++; in l2c_fcr_proc_tout()
930 (++p_ccb->fcrb.num_tries > p_ccb->peer_cfg.fcr.max_transmit)) { in l2c_fcr_proc_tout()
933 if (!p_ccb->fcrb.srej_sent && !p_ccb->fcrb.rej_sent) { in l2c_fcr_proc_tout()
952 p_ccb->local_cid, p_ccb->chnl_state, p_ccb->fcrb.wait_ack, in l2c_fcr_proc_ack_tout()
953 p_ccb->fcrb.next_seq_expected, p_ccb->fcrb.last_ack_sent); in l2c_fcr_proc_ack_tout()
955 if ((p_ccb->chnl_state == CST_OPEN) && (!p_ccb->fcrb.wait_ack) && in l2c_fcr_proc_ack_tout()
956 (p_ccb->fcrb.last_ack_sent != p_ccb->fcrb.next_seq_expected)) { in l2c_fcr_proc_ack_tout()
958 p_ccb->fcrb.xmit_ack_touts++; in l2c_fcr_proc_ack_tout()
975 tL2C_FCRB* p_fcrb = &p_ccb->fcrb; in process_reqseq()
1036 if (!p_ccb->fcrb.wait_ack) l2c_fcr_stop_timer(p_ccb); in process_reqseq()
1072 tL2C_FCRB* p_fcrb = &p_ccb->fcrb; in process_s_frame()
1086 p_ccb->fcrb.s_frames_rcvd[s_frame_type]++; in process_s_frame()
1153 tL2C_FCRB* p_fcrb = &p_ccb->fcrb; in process_i_frame()
1166 p_ccb->fcrb.ertm_pkt_counts[1]++; in process_i_frame()
1167 p_ccb->fcrb.ertm_byte_counts[1] += p_buf->len; in process_i_frame()
1273 alarm_cancel(p_ccb->fcrb.ack_timer); in process_i_frame()
1301 if (num_to_ack < p_ccb->fcrb.max_held_acks) delay_ack = true; in process_i_frame()
1309 if (!alarm_is_scheduled(p_ccb->fcrb.ack_timer)) { in process_i_frame()
1310 alarm_set_on_mloop(p_ccb->fcrb.ack_timer, L2CAP_FCR_ACK_TIMEOUT_MS, in process_i_frame()
1315 fixed_queue_is_empty(p_ccb->fcrb.srej_rcv_hold_q)) { in process_i_frame()
1386 if (tx_seq != p_ccb->fcrb.next_seq_expected) { in process_stream_frame()
1390 p_ccb->local_cid, p_ccb->fcrb.next_seq_expected, tx_seq, in process_stream_frame()
1391 p_ccb->fcrb.p_rx_sdu); in process_stream_frame()
1394 osi_free_and_reset((void**)&p_ccb->fcrb.p_rx_sdu); in process_stream_frame()
1397 p_ccb->fcrb.next_seq_expected = (tx_seq + 1) & L2CAP_FCR_SEQ_MODULO; in process_stream_frame()
1401 osi_free_and_reset((void**)&p_ccb->fcrb.p_rx_sdu); in process_stream_frame()
1419 tL2C_FCRB* p_fcrb = &p_ccb->fcrb; in do_sar_reassembly()
1536 if ((!fixed_queue_is_empty(p_ccb->fcrb.waiting_for_ack_q)) && in retransmit_i_frames()
1538 (p_ccb->fcrb.num_tries >= p_ccb->peer_cfg.fcr.max_transmit)) { in retransmit_i_frames()
1542 p_ccb->fcrb.last_rx_ack, p_ccb->local_cid, p_ccb->fcrb.num_tries, in retransmit_i_frames()
1544 fixed_queue_length(p_ccb->fcrb.waiting_for_ack_q)); in retransmit_i_frames()
1554 if (!fixed_queue_is_empty(p_ccb->fcrb.waiting_for_ack_q)) { in retransmit_i_frames()
1555 list_ack = fixed_queue_get_list(p_ccb->fcrb.waiting_for_ack_q); in retransmit_i_frames()
1583 fixed_queue_length(p_ccb->fcrb.waiting_for_ack_q)); in retransmit_i_frames()
1602 while (!fixed_queue_is_empty(p_ccb->fcrb.retrans_q)) in retransmit_i_frames()
1603 osi_free(fixed_queue_try_dequeue(p_ccb->fcrb.retrans_q)); in retransmit_i_frames()
1617 fixed_queue_enqueue(p_ccb->fcrb.retrans_q, p_buf2); in retransmit_i_frames()
1626 if (fixed_queue_length(p_ccb->fcrb.waiting_for_ack_q)) { in retransmit_i_frames()
1627 p_ccb->fcrb.num_tries++; in retransmit_i_frames()
1657 p_buf = (BT_HDR*)fixed_queue_try_dequeue(p_ccb->fcrb.retrans_q); in l2c_fcr_get_next_xmit_sdu_seg()
1666 p_ccb->fcrb.pkts_retransmitted++; in l2c_fcr_get_next_xmit_sdu_seg()
1667 p_ccb->fcrb.ertm_pkt_counts[0]++; in l2c_fcr_get_next_xmit_sdu_seg()
1668 p_ccb->fcrb.ertm_byte_counts[0] += (p_buf->len - 8); in l2c_fcr_get_next_xmit_sdu_seg()
1772 fixed_queue_enqueue(p_ccb->fcrb.waiting_for_ack_q, p_xmit); in l2c_fcr_get_next_xmit_sdu_seg()
1790 fixed_queue_enqueue(p_ccb->fcrb.waiting_for_ack_q, p_wack); in l2c_fcr_get_next_xmit_sdu_seg()
1794 p_ccb->fcrb.ertm_pkt_counts[0]++; in l2c_fcr_get_next_xmit_sdu_seg()
1795 p_ccb->fcrb.ertm_byte_counts[0] += (p_xmit->len - 8); in l2c_fcr_get_next_xmit_sdu_seg()
2340 index = p_ccb->fcrb.ack_delay_avg_index; in l2c_fcr_collect_ack_delay()
2343 p_ccb->fcrb.ack_q_count_avg[index] += in l2c_fcr_collect_ack_delay()
2344 fixed_queue_length(p_ccb->fcrb.waiting_for_ack_q); in l2c_fcr_collect_ack_delay()
2346 if (fixed_queue_length(p_ccb->fcrb.waiting_for_ack_q) > in l2c_fcr_collect_ack_delay()
2347 p_ccb->fcrb.ack_q_count_max[index]) in l2c_fcr_collect_ack_delay()
2348 p_ccb->fcrb.ack_q_count_max[index] = in l2c_fcr_collect_ack_delay()
2349 fixed_queue_length(p_ccb->fcrb.waiting_for_ack_q); in l2c_fcr_collect_ack_delay()
2351 if (fixed_queue_length(p_ccb->fcrb.waiting_for_ack_q) < in l2c_fcr_collect_ack_delay()
2352 p_ccb->fcrb.ack_q_count_min[index]) in l2c_fcr_collect_ack_delay()
2353 p_ccb->fcrb.ack_q_count_min[index] = in l2c_fcr_collect_ack_delay()
2354 fixed_queue_length(p_ccb->fcrb.waiting_for_ack_q); in l2c_fcr_collect_ack_delay()
2358 if (!fixed_queue_is_empty(p_ccb->fcrb.waiting_for_ack_q)) in l2c_fcr_collect_ack_delay()
2359 list = fixed_queue_get_list(p_ccb->fcrb.waiting_for_ack_q); in l2c_fcr_collect_ack_delay()
2366 p_ccb->fcrb.throughput[index] += p_buf->len - 8; in l2c_fcr_collect_ack_delay()
2380 p_ccb->fcrb.ack_delay_avg[index] += delay; in l2c_fcr_collect_ack_delay()
2381 if (delay > p_ccb->fcrb.ack_delay_max[index]) in l2c_fcr_collect_ack_delay()
2382 p_ccb->fcrb.ack_delay_max[index] = delay; in l2c_fcr_collect_ack_delay()
2383 if (delay < p_ccb->fcrb.ack_delay_min[index]) in l2c_fcr_collect_ack_delay()
2384 p_ccb->fcrb.ack_delay_min[index] = delay; in l2c_fcr_collect_ack_delay()
2389 p_ccb->fcrb.ack_delay_avg_count++; in l2c_fcr_collect_ack_delay()
2392 if (p_ccb->fcrb.ack_delay_avg_count > L2CAP_ERTM_STATS_AVG_NUM_SAMPLES) { in l2c_fcr_collect_ack_delay()
2393 p_ccb->fcrb.ack_delay_avg_count = 0; in l2c_fcr_collect_ack_delay()
2395 p_ccb->fcrb.ack_q_count_avg[index] /= L2CAP_ERTM_STATS_AVG_NUM_SAMPLES; in l2c_fcr_collect_ack_delay()
2396 p_ccb->fcrb.ack_delay_avg[index] /= L2CAP_ERTM_STATS_AVG_NUM_SAMPLES; in l2c_fcr_collect_ack_delay()
2400 if (timestamp - p_ccb->fcrb.throughput_start > 0) in l2c_fcr_collect_ack_delay()
2401 p_ccb->fcrb.throughput[index] /= in l2c_fcr_collect_ack_delay()
2402 (timestamp - p_ccb->fcrb.throughput_start); in l2c_fcr_collect_ack_delay()
2404 p_ccb->fcrb.throughput_start = timestamp; in l2c_fcr_collect_ack_delay()
2410 index, p_ccb->fcrb.throughput[index], p_ccb->fcrb.ack_delay_avg[index], in l2c_fcr_collect_ack_delay()
2411 p_ccb->fcrb.ack_delay_min[index], p_ccb->fcrb.ack_delay_max[index], in l2c_fcr_collect_ack_delay()
2412 p_ccb->fcrb.ack_q_count_avg[index], p_ccb->fcrb.ack_q_count_min[index], in l2c_fcr_collect_ack_delay()
2413 p_ccb->fcrb.ack_q_count_max[index]); in l2c_fcr_collect_ack_delay()
2419 p_ccb->fcrb.ack_delay_avg_index = index; in l2c_fcr_collect_ack_delay()
2421 p_ccb->fcrb.ack_q_count_max[index] = 0; in l2c_fcr_collect_ack_delay()
2422 p_ccb->fcrb.ack_q_count_min[index] = 0xFFFFFFFF; in l2c_fcr_collect_ack_delay()
2423 p_ccb->fcrb.ack_q_count_avg[index] = 0; in l2c_fcr_collect_ack_delay()
2425 p_ccb->fcrb.ack_delay_max[index] = 0; in l2c_fcr_collect_ack_delay()
2426 p_ccb->fcrb.ack_delay_min[index] = 0xFFFFFFFF; in l2c_fcr_collect_ack_delay()
2427 p_ccb->fcrb.ack_delay_avg[index] = 0; in l2c_fcr_collect_ack_delay()
2429 p_ccb->fcrb.throughput[index] = 0; in l2c_fcr_collect_ack_delay()