|
|
@ -139,23 +139,22 @@ private:
|
|
|
|
bool poll_required();
|
|
|
|
bool poll_required();
|
|
|
|
bool do_status();
|
|
|
|
bool do_status();
|
|
|
|
|
|
|
|
|
|
|
|
rlc_am *parent;
|
|
|
|
rlc_am* parent = nullptr;
|
|
|
|
byte_buffer_pool *pool;
|
|
|
|
byte_buffer_pool* pool = nullptr;
|
|
|
|
srslte::log *log;
|
|
|
|
srslte::log* log = nullptr;
|
|
|
|
|
|
|
|
|
|
|
|
/****************************************************************************
|
|
|
|
/****************************************************************************
|
|
|
|
* Configurable parameters
|
|
|
|
* Configurable parameters
|
|
|
|
* Ref: 3GPP TS 36.322 v10.0.0 Section 7
|
|
|
|
* Ref: 3GPP TS 36.322 v10.0.0 Section 7
|
|
|
|
***************************************************************************/
|
|
|
|
***************************************************************************/
|
|
|
|
|
|
|
|
|
|
|
|
srslte_rlc_am_config_t cfg;
|
|
|
|
srslte_rlc_am_config_t cfg = {};
|
|
|
|
|
|
|
|
|
|
|
|
// TX SDU buffers
|
|
|
|
// TX SDU buffers
|
|
|
|
rlc_tx_queue tx_sdu_queue;
|
|
|
|
rlc_tx_queue tx_sdu_queue;
|
|
|
|
unique_byte_buffer_t tx_sdu;
|
|
|
|
unique_byte_buffer_t tx_sdu;
|
|
|
|
;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
bool tx_enabled;
|
|
|
|
bool tx_enabled = false;
|
|
|
|
|
|
|
|
|
|
|
|
/****************************************************************************
|
|
|
|
/****************************************************************************
|
|
|
|
* State variables and counters
|
|
|
|
* State variables and counters
|
|
|
@ -163,14 +162,14 @@ private:
|
|
|
|
***************************************************************************/
|
|
|
|
***************************************************************************/
|
|
|
|
|
|
|
|
|
|
|
|
// Tx state variables
|
|
|
|
// Tx state variables
|
|
|
|
uint32_t vt_a; // ACK state. SN of next PDU in sequence to be ACKed. Low edge of tx window.
|
|
|
|
uint32_t vt_a = 0; // ACK state. SN of next PDU in sequence to be ACKed. Low edge of tx window.
|
|
|
|
uint32_t vt_ms; // Max send state. High edge of tx window. vt_a + window_size.
|
|
|
|
uint32_t vt_ms = RLC_AM_WINDOW_SIZE; // Max send state. High edge of tx window. vt_a + window_size.
|
|
|
|
uint32_t vt_s; // Send state. SN to be assigned for next PDU.
|
|
|
|
uint32_t vt_s = 0; // Send state. SN to be assigned for next PDU.
|
|
|
|
uint32_t poll_sn; // Poll send state. SN of most recent PDU txed with poll bit set.
|
|
|
|
uint32_t poll_sn = 0; // Poll send state. SN of most recent PDU txed with poll bit set.
|
|
|
|
|
|
|
|
|
|
|
|
// Tx counters
|
|
|
|
// Tx counters
|
|
|
|
uint32_t pdu_without_poll;
|
|
|
|
uint32_t pdu_without_poll = 0;
|
|
|
|
uint32_t byte_without_poll;
|
|
|
|
uint32_t byte_without_poll = 0;
|
|
|
|
|
|
|
|
|
|
|
|
rlc_status_pdu_t tx_status;
|
|
|
|
rlc_status_pdu_t tx_status;
|
|
|
|
|
|
|
|
|
|
|
@ -179,11 +178,11 @@ private:
|
|
|
|
* Ref: 3GPP TS 36.322 v10.0.0 Section 7
|
|
|
|
* Ref: 3GPP TS 36.322 v10.0.0 Section 7
|
|
|
|
***************************************************************************/
|
|
|
|
***************************************************************************/
|
|
|
|
|
|
|
|
|
|
|
|
srslte::timers::timer *poll_retx_timer;
|
|
|
|
srslte::timers::timer* poll_retx_timer = nullptr;
|
|
|
|
uint32_t poll_retx_timer_id;
|
|
|
|
uint32_t poll_retx_timer_id = 0;
|
|
|
|
|
|
|
|
|
|
|
|
srslte::timers::timer *status_prohibit_timer;
|
|
|
|
srslte::timers::timer* status_prohibit_timer = nullptr;
|
|
|
|
uint32_t status_prohibit_timer_id;
|
|
|
|
uint32_t status_prohibit_timer_id = 0;
|
|
|
|
|
|
|
|
|
|
|
|
// Tx windows
|
|
|
|
// Tx windows
|
|
|
|
std::map<uint32_t, rlc_amd_tx_pdu_t> tx_window;
|
|
|
|
std::map<uint32_t, rlc_amd_tx_pdu_t> tx_window;
|
|
|
@ -193,7 +192,7 @@ private:
|
|
|
|
pthread_mutex_t mutex;
|
|
|
|
pthread_mutex_t mutex;
|
|
|
|
|
|
|
|
|
|
|
|
// Metrics
|
|
|
|
// Metrics
|
|
|
|
uint32_t num_tx_bytes;
|
|
|
|
uint32_t num_tx_bytes = 0;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
// Receiver sub-class
|
|
|
|
// Receiver sub-class
|
|
|
@ -230,15 +229,15 @@ private:
|
|
|
|
void print_rx_segments();
|
|
|
|
void print_rx_segments();
|
|
|
|
bool add_segment_and_check(rlc_amd_rx_pdu_segments_t *pdu, rlc_amd_rx_pdu_t *segment);
|
|
|
|
bool add_segment_and_check(rlc_amd_rx_pdu_segments_t *pdu, rlc_amd_rx_pdu_t *segment);
|
|
|
|
|
|
|
|
|
|
|
|
rlc_am *parent;
|
|
|
|
rlc_am* parent = nullptr;
|
|
|
|
byte_buffer_pool *pool;
|
|
|
|
byte_buffer_pool* pool = nullptr;
|
|
|
|
srslte::log *log;
|
|
|
|
srslte::log* log = nullptr;
|
|
|
|
|
|
|
|
|
|
|
|
/****************************************************************************
|
|
|
|
/****************************************************************************
|
|
|
|
* Configurable parameters
|
|
|
|
* Configurable parameters
|
|
|
|
* Ref: 3GPP TS 36.322 v10.0.0 Section 7
|
|
|
|
* Ref: 3GPP TS 36.322 v10.0.0 Section 7
|
|
|
|
***************************************************************************/
|
|
|
|
***************************************************************************/
|
|
|
|
srslte_rlc_am_config_t cfg;
|
|
|
|
srslte_rlc_am_config_t cfg = {};
|
|
|
|
|
|
|
|
|
|
|
|
// RX SDU buffers
|
|
|
|
// RX SDU buffers
|
|
|
|
unique_byte_buffer_t rx_sdu;
|
|
|
|
unique_byte_buffer_t rx_sdu;
|
|
|
@ -249,11 +248,11 @@ private:
|
|
|
|
***************************************************************************/
|
|
|
|
***************************************************************************/
|
|
|
|
|
|
|
|
|
|
|
|
// Rx state variables
|
|
|
|
// Rx state variables
|
|
|
|
uint32_t vr_r; // Receive state. SN following last in-sequence received PDU. Low edge of rx window
|
|
|
|
uint32_t vr_r = 0; // Receive state. SN following last in-sequence received PDU. Low edge of rx window
|
|
|
|
uint32_t vr_mr; // Max acceptable receive state. High edge of rx window. vr_r + window size.
|
|
|
|
uint32_t vr_mr = RLC_AM_WINDOW_SIZE; // Max acceptable receive state. High edge of rx window. vr_r + window size.
|
|
|
|
uint32_t vr_x; // t_reordering state. SN following PDU which triggered t_reordering.
|
|
|
|
uint32_t vr_x = 0; // t_reordering state. SN following PDU which triggered t_reordering.
|
|
|
|
uint32_t vr_ms; // Max status tx state. Highest possible value of SN for ACK_SN in status PDU.
|
|
|
|
uint32_t vr_ms = 0; // Max status tx state. Highest possible value of SN for ACK_SN in status PDU.
|
|
|
|
uint32_t vr_h; // Highest rx state. SN following PDU with highest SN among rxed PDUs.
|
|
|
|
uint32_t vr_h = 0; // Highest rx state. SN following PDU with highest SN among rxed PDUs.
|
|
|
|
|
|
|
|
|
|
|
|
// Mutexes
|
|
|
|
// Mutexes
|
|
|
|
pthread_mutex_t mutex;
|
|
|
|
pthread_mutex_t mutex;
|
|
|
@ -263,28 +262,28 @@ private:
|
|
|
|
std::map<uint32_t, rlc_amd_rx_pdu_segments_t> rx_segments;
|
|
|
|
std::map<uint32_t, rlc_amd_rx_pdu_segments_t> rx_segments;
|
|
|
|
|
|
|
|
|
|
|
|
// Metrics
|
|
|
|
// Metrics
|
|
|
|
uint32_t num_rx_bytes;
|
|
|
|
uint32_t num_rx_bytes = 0;
|
|
|
|
|
|
|
|
|
|
|
|
bool poll_received;
|
|
|
|
bool poll_received = false;
|
|
|
|
bool do_status;
|
|
|
|
bool do_status = false;
|
|
|
|
|
|
|
|
|
|
|
|
/****************************************************************************
|
|
|
|
/****************************************************************************
|
|
|
|
* Timers
|
|
|
|
* Timers
|
|
|
|
* Ref: 3GPP TS 36.322 v10.0.0 Section 7
|
|
|
|
* Ref: 3GPP TS 36.322 v10.0.0 Section 7
|
|
|
|
***************************************************************************/
|
|
|
|
***************************************************************************/
|
|
|
|
|
|
|
|
|
|
|
|
srslte::timers::timer *reordering_timer;
|
|
|
|
srslte::timers::timer* reordering_timer = nullptr;
|
|
|
|
uint32_t reordering_timer_id;
|
|
|
|
uint32_t reordering_timer_id = 0;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
// Common variables needed/provided by parent class
|
|
|
|
// Common variables needed/provided by parent class
|
|
|
|
srsue::rrc_interface_rlc *rrc;
|
|
|
|
srsue::rrc_interface_rlc* rrc = nullptr;
|
|
|
|
srslte::log *log;
|
|
|
|
srslte::log* log = nullptr;
|
|
|
|
srsue::pdcp_interface_rlc *pdcp;
|
|
|
|
srsue::pdcp_interface_rlc* pdcp = nullptr;
|
|
|
|
mac_interface_timers *mac_timers;
|
|
|
|
mac_interface_timers* mac_timers = nullptr;
|
|
|
|
uint32_t lcid;
|
|
|
|
uint32_t lcid = 0;
|
|
|
|
srslte_rlc_config_t cfg;
|
|
|
|
srslte_rlc_config_t cfg = {};
|
|
|
|
bool has_configuration;
|
|
|
|
bool has_configuration = false;
|
|
|
|
std::string rb_name;
|
|
|
|
std::string rb_name;
|
|
|
|
|
|
|
|
|
|
|
|
static const int poll_periodicity = 8; // After how many data PDUs a status PDU shall be requested
|
|
|
|
static const int poll_periodicity = 8; // After how many data PDUs a status PDU shall be requested
|
|
|
|