From d3cb2eac8315d933257e205102758d315e747a8f Mon Sep 17 00:00:00 2001 From: Andre Puschmann Date: Fri, 17 Jan 2020 21:41:58 +0100 Subject: [PATCH] add RLC suspend/resume to eNB interface --- .../srslte/interfaces/enb_interfaces.h | 2 ++ srsenb/hdr/stack/upper/rlc.h | 2 ++ srsenb/src/stack/upper/rlc.cc | 24 +++++++++++++++++++ 3 files changed, 28 insertions(+) diff --git a/lib/include/srslte/interfaces/enb_interfaces.h b/lib/include/srslte/interfaces/enb_interfaces.h index 7d8bfea76..6c228760d 100644 --- a/lib/include/srslte/interfaces/enb_interfaces.h +++ b/lib/include/srslte/interfaces/enb_interfaces.h @@ -194,6 +194,8 @@ public: virtual void add_bearer_mrb(uint16_t rnti, uint32_t lcid) = 0; virtual void write_sdu(uint16_t rnti, uint32_t lcid, srslte::unique_byte_buffer_t sdu) = 0; virtual bool has_bearer(uint16_t rnti, uint32_t lcid) = 0; + virtual bool suspend_bearer(uint16_t rnti, uint32_t lcid) = 0; + virtual bool resume_bearer(uint16_t rnti, uint32_t lcid) = 0; }; // PDCP interface for GTPU diff --git a/srsenb/hdr/stack/upper/rlc.h b/srsenb/hdr/stack/upper/rlc.h index c461ae480..f614ced68 100644 --- a/srsenb/hdr/stack/upper/rlc.h +++ b/srsenb/hdr/stack/upper/rlc.h @@ -53,6 +53,8 @@ public: void add_bearer(uint16_t rnti, uint32_t lcid, srslte::rlc_config_t cnfg); void add_bearer_mrb(uint16_t rnti, uint32_t lcid); bool has_bearer(uint16_t rnti, uint32_t lcid); + bool suspend_bearer(uint16_t rnti, uint32_t lcid); + bool resume_bearer(uint16_t rnti, uint32_t lcid); // rlc_interface_pdcp void write_sdu(uint16_t rnti, uint32_t lcid, srslte::unique_byte_buffer_t sdu); diff --git a/srsenb/src/stack/upper/rlc.cc b/srsenb/src/stack/upper/rlc.cc index d68cf15f5..779529e19 100644 --- a/srsenb/src/stack/upper/rlc.cc +++ b/srsenb/src/stack/upper/rlc.cc @@ -121,6 +121,30 @@ bool rlc::has_bearer(uint16_t rnti, uint32_t lcid) return result; } +bool rlc::suspend_bearer(uint16_t rnti, uint32_t lcid) +{ + pthread_rwlock_rdlock(&rwlock); + bool result = false; + if (users.count(rnti)) { + users[rnti].rlc->suspend_bearer(lcid); + result = true; + } + pthread_rwlock_unlock(&rwlock); + return result; +} + +bool rlc::resume_bearer(uint16_t rnti, uint32_t lcid) +{ + pthread_rwlock_rdlock(&rwlock); + bool result = false; + if (users.count(rnti)) { + users[rnti].rlc->resume_bearer(lcid); + result = true; + } + pthread_rwlock_unlock(&rwlock); + return result; +} + void rlc::read_pdu_pcch(uint8_t* payload, uint32_t buffer_size) { rrc->read_pdu_pcch(payload, buffer_size);