fix regression in RLC base introduced during refactor causing eMBMS to fail

master
Andre Puschmann 6 years ago
parent 22b4396c39
commit 86e02921f0

@ -88,6 +88,7 @@ public:
void add_bearer(uint32_t lcid, srslte_rlc_config_t cnfg); void add_bearer(uint32_t lcid, srslte_rlc_config_t cnfg);
void add_bearer_mrb(uint32_t lcid); void add_bearer_mrb(uint32_t lcid);
void del_bearer(uint32_t lcid); void del_bearer(uint32_t lcid);
void del_bearer_mrb(uint32_t lcid);
void change_lcid(uint32_t old_lcid, uint32_t new_lcid); void change_lcid(uint32_t old_lcid, uint32_t new_lcid);
private: private:

@ -280,7 +280,7 @@ uint32_t rlc::get_total_mch_buffer_state(uint32_t lcid)
uint32_t ret = 0; uint32_t ret = 0;
pthread_rwlock_rdlock(&rwlock); pthread_rwlock_rdlock(&rwlock);
if (valid_lcid(lcid)) { if (valid_lcid_mrb(lcid)) {
ret = rlc_array_mrb.at(lcid)->get_total_buffer_state(); ret = rlc_array_mrb.at(lcid)->get_total_buffer_state();
} }
pthread_rwlock_unlock(&rwlock); pthread_rwlock_unlock(&rwlock);
@ -306,7 +306,7 @@ int rlc::read_pdu_mch(uint32_t lcid, uint8_t *payload, uint32_t nof_bytes)
uint32_t ret = 0; uint32_t ret = 0;
pthread_rwlock_rdlock(&rwlock); pthread_rwlock_rdlock(&rwlock);
if (valid_lcid(lcid)) { if (valid_lcid_mrb(lcid)) {
ret = rlc_array_mrb.at(lcid)->read_pdu(payload, nof_bytes); ret = rlc_array_mrb.at(lcid)->read_pdu(payload, nof_bytes);
} }
pthread_rwlock_unlock(&rwlock); pthread_rwlock_unlock(&rwlock);
@ -508,7 +508,7 @@ void rlc::del_bearer(uint32_t lcid)
{ {
pthread_rwlock_wrlock(&rwlock); pthread_rwlock_wrlock(&rwlock);
if (valid_lcid_mrb(lcid)) { if (valid_lcid(lcid)) {
rlc_map_t::iterator it = rlc_array.find(lcid); rlc_map_t::iterator it = rlc_array.find(lcid);
it->second->stop(); it->second->stop();
delete(it->second); delete(it->second);
@ -522,6 +522,24 @@ void rlc::del_bearer(uint32_t lcid)
} }
void rlc::del_bearer_mrb(uint32_t lcid)
{
pthread_rwlock_wrlock(&rwlock);
if (valid_lcid_mrb(lcid)) {
rlc_map_t::iterator it = rlc_array_mrb.find(lcid);
it->second->stop();
delete(it->second);
rlc_array_mrb.erase(it);
rlc_log->warning("Deleted RLC MRB bearer %s\n", rrc->get_rb_name(lcid).c_str());
} else {
rlc_log->error("Can't delete bearer %s. Bearer doesn't exist.\n", rrc->get_rb_name(lcid).c_str());
}
pthread_rwlock_unlock(&rwlock);
}
void rlc::change_lcid(uint32_t old_lcid, uint32_t new_lcid) void rlc::change_lcid(uint32_t old_lcid, uint32_t new_lcid)
{ {
pthread_rwlock_wrlock(&rwlock); pthread_rwlock_wrlock(&rwlock);

Loading…
Cancel
Save