fix RLC UM reestablishment

master
Andre Puschmann 6 years ago
parent c49dddc09a
commit e84d26ae4e

@ -156,6 +156,8 @@ private:
void timer_expired(uint32_t timeout_id);
private:
void reset();
byte_buffer_pool *pool;
srslte::log *log;
mac_interface_timers *mac_timers;

@ -550,8 +550,18 @@ void rlc_um::rlc_um_rx::init(srslte::log *log_, uint32_t lcid_, srsue::pdcp_inte
void rlc_um::rlc_um_rx::reestablish()
{
stop();
// try to reassemble any SDUs if possible
if (reordering_timer != NULL) {
if (reordering_timer->is_running()) {
reordering_timer->stop();
timer_expired(reordering_timer_id);
}
}
pthread_mutex_lock(&mutex);
reset();
rx_enabled = true;
pthread_mutex_unlock(&mutex);
}
@ -559,6 +569,19 @@ void rlc_um::rlc_um_rx::stop()
{
pthread_mutex_lock(&mutex);
reset();
if (mac_timers != NULL && reordering_timer != NULL) {
reordering_timer->stop();
mac_timers->timer_release_id(reordering_timer_id);
reordering_timer = NULL;
}
pthread_mutex_unlock(&mutex);
}
void rlc_um::rlc_um_rx::reset()
{
vr_ur = 0;
vr_ux = 0;
vr_uh = 0;
@ -570,19 +593,12 @@ void rlc_um::rlc_um_rx::stop()
rx_sdu = NULL;
}
if (mac_timers != NULL && reordering_timer != NULL) {
reordering_timer->stop();
mac_timers->timer_release_id(reordering_timer_id);
reordering_timer = NULL;
}
// Drop all messages in RX window
std::map<uint32_t, rlc_umd_pdu_t>::iterator it;
for(it = rx_window.begin(); it != rx_window.end(); it++) {
pool->deallocate(it->second.buf);
}
rx_window.clear();
pthread_mutex_unlock(&mutex);
}
@ -949,7 +965,9 @@ void rlc_um::rlc_um_rx::timer_expired(uint32_t timeout_id)
log->warning("Lost PDU SN: %d\n", vr_ur);
pdu_lost = true;
if (rx_sdu != NULL) {
rx_sdu->reset();
}
while(RX_MOD_BASE(vr_ur) < RX_MOD_BASE(vr_ux)) {
vr_ur = (vr_ur + 1)%cfg.rx_mod;

Loading…
Cancel
Save