From 005ee7f8626d4733e8fa01f3589154287ed163ed Mon Sep 17 00:00:00 2001 From: Jacob Erlbeck Date: Fri, 20 Mar 2015 14:53:54 +0100 Subject: tbf: Add frames_since_last_poll method This functions calculates the number of frames that have passed since the last DL poll (RRBP flag set) has been sent. It returns a value less than zero (fn_now - fn_sched) if the block has been scheduled but not yet sent. If the function is called before the first data block has been sent it will return -1. If the function is called before the first DL poll is sent, it returns the number of frames since the first data block has been sent. Sponsored-by: On-Waves ehf --- src/tbf.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/tbf.h') diff --git a/src/tbf.h b/src/tbf.h index ba7af36f..ca5fedff 100644 --- a/src/tbf.h +++ b/src/tbf.h @@ -325,6 +325,7 @@ struct gprs_rlcmac_dl_tbf : public gprs_rlcmac_tbf { void request_dl_ack(); bool need_control_ts() const; bool have_data() const; + int frames_since_last_poll(unsigned fn) const; bool is_control_ts(uint8_t ts) const { return ts == control_ts; @@ -342,6 +343,7 @@ struct gprs_rlcmac_dl_tbf : public gprs_rlcmac_tbf { int32_t m_tx_counter; /* count all transmitted blocks */ uint8_t m_wait_confirm; /* wait for CCCH IMM.ASS cnf */ bool m_dl_ack_requested; + int32_t m_last_dl_poll_fn; struct { struct timeval dl_bw_tv; /* timestamp for dl bw calculation */ -- cgit v1.2.3