Updated PDCP config struct for rat type

master
David Rupprecht 4 years ago committed by Andre Puschmann
parent 8fffbb34c2
commit 6b41ae7e8b

@ -126,7 +126,8 @@ public:
uint8_t sn_len_, uint8_t sn_len_,
pdcp_t_reordering_t t_reordering_, pdcp_t_reordering_t t_reordering_,
pdcp_discard_timer_t discard_timer_, pdcp_discard_timer_t discard_timer_,
bool status_report_required_) : bool status_report_required_,
srsran::srsran_rat_t rat_) :
bearer_id(bearer_id_), bearer_id(bearer_id_),
rb_type(rb_type_), rb_type(rb_type_),
tx_direction(tx_direction_), tx_direction(tx_direction_),
@ -134,7 +135,8 @@ public:
sn_len(sn_len_), sn_len(sn_len_),
t_reordering(t_reordering_), t_reordering(t_reordering_),
discard_timer(discard_timer_), discard_timer(discard_timer_),
status_report_required(status_report_required_) status_report_required(status_report_required_),
rat(rat_)
{ {
hdr_len_bytes = ceilf((float)sn_len / 8); hdr_len_bytes = ceilf((float)sn_len / 8);
} }
@ -148,6 +150,7 @@ public:
pdcp_t_reordering_t t_reordering = pdcp_t_reordering_t::ms500; pdcp_t_reordering_t t_reordering = pdcp_t_reordering_t::ms500;
pdcp_discard_timer_t discard_timer = pdcp_discard_timer_t::infinity; pdcp_discard_timer_t discard_timer = pdcp_discard_timer_t::infinity;
srsran::srsran_rat_t rat = srsran::srsran_rat_t::lte;
bool status_report_required = false; bool status_report_required = false;

@ -26,6 +26,10 @@ class pdcp : public srsue::pdcp_interface_rlc, public srsue::pdcp_interface_rrc
public: public:
pdcp(srsran::task_sched_handle task_sched_, const char* logname); pdcp(srsran::task_sched_handle task_sched_, const char* logname);
virtual ~pdcp(); virtual ~pdcp();
void init(srsue::rlc_interface_pdcp* rlc_,
srsue::rrc_interface_pdcp* rrc_,
srsue::rrc_interface_pdcp* rrc_nr_,
srsue::gw_interface_pdcp* gw_);
void init(srsue::rlc_interface_pdcp* rlc_, srsue::rrc_interface_pdcp* rrc_, srsue::gw_interface_pdcp* gw_); void init(srsue::rlc_interface_pdcp* rlc_, srsue::rrc_interface_pdcp* rrc_, srsue::gw_interface_pdcp* gw_);
void stop(); void stop();
@ -71,6 +75,7 @@ public:
private: private:
srsue::rlc_interface_pdcp* rlc = nullptr; srsue::rlc_interface_pdcp* rlc = nullptr;
srsue::rrc_interface_pdcp* rrc = nullptr; srsue::rrc_interface_pdcp* rrc = nullptr;
srsue::rrc_interface_pdcp* rrc_nr = nullptr;
srsue::gw_interface_pdcp* gw = nullptr; srsue::gw_interface_pdcp* gw = nullptr;
srsran::task_sched_handle task_sched; srsran::task_sched_handle task_sched;
srslog::basic_logger& logger; srslog::basic_logger& logger;

@ -151,7 +151,8 @@ protected:
PDCP_SN_LEN_12, PDCP_SN_LEN_12,
pdcp_t_reordering_t::ms500, pdcp_t_reordering_t::ms500,
pdcp_discard_timer_t::infinity, pdcp_discard_timer_t::infinity,
false}; false,
srsran_rat_t::lte};
srsran::as_security_config_t sec_cfg = {}; srsran::as_security_config_t sec_cfg = {};

@ -212,7 +212,8 @@ srsran::pdcp_config_t make_drb_pdcp_config_t(const uint8_t bearer_id, bool is_ue
sn_len, sn_len,
t_reordering, t_reordering,
discard_timer, discard_timer,
false); false,
srsran_rat_t::nr);
return cfg; return cfg;
} }

@ -207,7 +207,8 @@ srsran::pdcp_config_t make_srb_pdcp_config_t(const uint8_t bearer_id, bool is_ue
PDCP_SN_LEN_5, PDCP_SN_LEN_5,
pdcp_t_reordering_t::ms500, pdcp_t_reordering_t::ms500,
pdcp_discard_timer_t::infinity, pdcp_discard_timer_t::infinity,
false); false,
srsran_rat_t::lte);
return cfg; return cfg;
} }
@ -220,7 +221,8 @@ srsran::pdcp_config_t make_drb_pdcp_config_t(const uint8_t bearer_id, bool is_ue
PDCP_SN_LEN_12, PDCP_SN_LEN_12,
pdcp_t_reordering_t::ms500, pdcp_t_reordering_t::ms500,
pdcp_discard_timer_t::infinity, pdcp_discard_timer_t::infinity,
false); false,
srsran_rat_t::lte);
return cfg; return cfg;
} }
@ -325,7 +327,8 @@ srsran::pdcp_config_t make_drb_pdcp_config_t(const uint8_t bearer_id, bool is_ue
sn_len, sn_len,
t_reordering, t_reordering,
discard_timer, discard_timer,
status_report_required); status_report_required,
srsran_rat_t::lte);
return cfg; return cfg;
} }

@ -30,6 +30,15 @@ pdcp::~pdcp()
pdcp_array_mrb.clear(); pdcp_array_mrb.clear();
} }
void pdcp::init(srsue::rlc_interface_pdcp* rlc_,
srsue::rrc_interface_pdcp* rrc_,
srsue::rrc_interface_pdcp* rrc_nr_,
srsue::gw_interface_pdcp* gw_)
{
init(rlc_, rrc_, gw_);
rrc_nr = rrc_nr_;
}
void pdcp::init(srsue::rlc_interface_pdcp* rlc_, srsue::rrc_interface_pdcp* rrc_, srsue::gw_interface_pdcp* gw_) void pdcp::init(srsue::rlc_interface_pdcp* rlc_, srsue::rrc_interface_pdcp* rrc_, srsue::gw_interface_pdcp* gw_)
{ {
rlc = rlc_; rlc = rlc_;
@ -95,7 +104,16 @@ void pdcp::add_bearer(uint32_t lcid, pdcp_config_t cfg)
if (not valid_lcid(lcid)) { if (not valid_lcid(lcid)) {
std::unique_ptr<pdcp_entity_base> entity; std::unique_ptr<pdcp_entity_base> entity;
// For now we create an pdcp entity lte for nr due to it's maturity // For now we create an pdcp entity lte for nr due to it's maturity
if (cfg.rat == srsran::srsran_rat_t::lte) {
entity.reset(new pdcp_entity_lte{rlc, rrc, gw, task_sched, logger, lcid}); entity.reset(new pdcp_entity_lte{rlc, rrc, gw, task_sched, logger, lcid});
} else if (cfg.rat == srsran::srsran_rat_t::nr) {
if (rrc_nr == nullptr) {
logger.warning("Cannot add PDCP entity - missing rrc_nr parent pointer");
return;
}
entity.reset(new pdcp_entity_lte{rlc, rrc_nr, gw, task_sched, logger, lcid});
}
if (not entity->configure(cfg)) { if (not entity->configure(cfg)) {
logger.error("Can not configure PDCP entity"); logger.error("Can not configure PDCP entity");
return; return;

@ -92,7 +92,8 @@ srsran::unique_byte_buffer_t gen_expected_pdu(const srsran::unique_byte_buffer_t
pdcp_sn_len, pdcp_sn_len,
srsran::pdcp_t_reordering_t::ms500, srsran::pdcp_t_reordering_t::ms500,
srsran::pdcp_discard_timer_t::infinity, srsran::pdcp_discard_timer_t::infinity,
false}; false,
srsran::srsran_rat_t::lte};
pdcp_lte_test_helper pdcp_hlp(cfg, sec_cfg, logger); pdcp_lte_test_helper pdcp_hlp(cfg, sec_cfg, logger);
srsran::pdcp_entity_lte* pdcp = &pdcp_hlp.pdcp; srsran::pdcp_entity_lte* pdcp = &pdcp_hlp.pdcp;

@ -26,7 +26,8 @@ int test_tx_sdu_notify(const srsran::pdcp_lte_state_t& init_state,
srsran::PDCP_SN_LEN_12, srsran::PDCP_SN_LEN_12,
srsran::pdcp_t_reordering_t::ms500, srsran::pdcp_t_reordering_t::ms500,
discard_timeout, discard_timeout,
false}; false,
srsran::srsran_rat_t::lte};
pdcp_lte_test_helper pdcp_hlp(cfg, sec_cfg, logger); pdcp_lte_test_helper pdcp_hlp(cfg, sec_cfg, logger);
srsran::pdcp_entity_lte* pdcp = &pdcp_hlp.pdcp; srsran::pdcp_entity_lte* pdcp = &pdcp_hlp.pdcp;
@ -75,7 +76,8 @@ int test_tx_sdu_discard(const srsran::pdcp_lte_state_t& init_state,
srsran::PDCP_SN_LEN_12, srsran::PDCP_SN_LEN_12,
srsran::pdcp_t_reordering_t::ms500, srsran::pdcp_t_reordering_t::ms500,
discard_timeout, discard_timeout,
false}; false,
srsran::srsran_rat_t::lte};
pdcp_lte_test_helper pdcp_hlp(cfg, sec_cfg, logger); pdcp_lte_test_helper pdcp_hlp(cfg, sec_cfg, logger);
srsran::pdcp_entity_lte* pdcp = &pdcp_hlp.pdcp; srsran::pdcp_entity_lte* pdcp = &pdcp_hlp.pdcp;

@ -31,7 +31,8 @@ int test_rx(std::vector<pdcp_test_event_t> events,
pdcp_sn_len, pdcp_sn_len,
srsran::pdcp_t_reordering_t::ms500, srsran::pdcp_t_reordering_t::ms500,
srsran::pdcp_discard_timer_t::infinity, srsran::pdcp_discard_timer_t::infinity,
false}; false,
srsran::srsran_rat_t::lte};
pdcp_lte_test_helper pdcp_hlp_rx(cfg_rx, sec_cfg, logger); pdcp_lte_test_helper pdcp_hlp_rx(cfg_rx, sec_cfg, logger);
srsran::pdcp_entity_lte* pdcp_rx = &pdcp_hlp_rx.pdcp; srsran::pdcp_entity_lte* pdcp_rx = &pdcp_hlp_rx.pdcp;

@ -24,7 +24,8 @@ int test_tx_status_report(const srsran::pdcp_lte_state_t& init_state, srslog::ba
srsran::PDCP_SN_LEN_12, srsran::PDCP_SN_LEN_12,
srsran::pdcp_t_reordering_t::ms500, srsran::pdcp_t_reordering_t::ms500,
srsran::pdcp_discard_timer_t::ms500, srsran::pdcp_discard_timer_t::ms500,
true}; true,
srsran::srsran_rat_t::lte};
srsran::pdcp_config_t cfg_rx = {1, srsran::pdcp_config_t cfg_rx = {1,
srsran::PDCP_RB_IS_DRB, srsran::PDCP_RB_IS_DRB,
@ -33,7 +34,8 @@ int test_tx_status_report(const srsran::pdcp_lte_state_t& init_state, srslog::ba
srsran::PDCP_SN_LEN_12, srsran::PDCP_SN_LEN_12,
srsran::pdcp_t_reordering_t::ms500, srsran::pdcp_t_reordering_t::ms500,
srsran::pdcp_discard_timer_t::ms500, srsran::pdcp_discard_timer_t::ms500,
true}; true,
srsran::srsran_rat_t::lte};
// Setup TX // Setup TX
pdcp_lte_test_helper pdcp_hlp_tx(cfg_tx, sec_cfg, logger); pdcp_lte_test_helper pdcp_hlp_tx(cfg_tx, sec_cfg, logger);
@ -128,7 +130,8 @@ int test_tx_wraparound_status_report(const srsran::pdcp_lte_state_t& init_state,
srsran::PDCP_SN_LEN_12, srsran::PDCP_SN_LEN_12,
srsran::pdcp_t_reordering_t::ms500, srsran::pdcp_t_reordering_t::ms500,
srsran::pdcp_discard_timer_t::ms500, srsran::pdcp_discard_timer_t::ms500,
true}; true,
srsran::srsran_rat_t::lte};
srsran::pdcp_config_t cfg_rx = {1, srsran::pdcp_config_t cfg_rx = {1,
srsran::PDCP_RB_IS_DRB, srsran::PDCP_RB_IS_DRB,
@ -137,7 +140,8 @@ int test_tx_wraparound_status_report(const srsran::pdcp_lte_state_t& init_state,
srsran::PDCP_SN_LEN_12, srsran::PDCP_SN_LEN_12,
srsran::pdcp_t_reordering_t::ms500, srsran::pdcp_t_reordering_t::ms500,
srsran::pdcp_discard_timer_t::ms500, srsran::pdcp_discard_timer_t::ms500,
true}; true,
srsran::srsran_rat_t::lte};
// Setup TX // Setup TX
pdcp_lte_test_helper pdcp_hlp_tx(cfg_tx, sec_cfg, logger); pdcp_lte_test_helper pdcp_hlp_tx(cfg_tx, sec_cfg, logger);
@ -240,7 +244,8 @@ int test_rx_status_report(const srsran::pdcp_lte_state_t& init_state, srslog::ba
srsran::PDCP_SN_LEN_12, srsran::PDCP_SN_LEN_12,
srsran::pdcp_t_reordering_t::ms500, srsran::pdcp_t_reordering_t::ms500,
srsran::pdcp_discard_timer_t::ms500, srsran::pdcp_discard_timer_t::ms500,
true}; true,
srsran::srsran_rat_t::lte};
pdcp_lte_test_helper pdcp_hlp(cfg, sec_cfg, logger); pdcp_lte_test_helper pdcp_hlp(cfg, sec_cfg, logger);
srsran::pdcp_entity_lte* pdcp = &pdcp_hlp.pdcp; srsran::pdcp_entity_lte* pdcp = &pdcp_hlp.pdcp;

@ -125,7 +125,8 @@ srsran::unique_byte_buffer_t gen_expected_pdu(const srsran::unique_byte_buffer_t
pdcp_sn_len, pdcp_sn_len,
srsran::pdcp_t_reordering_t::ms500, srsran::pdcp_t_reordering_t::ms500,
srsran::pdcp_discard_timer_t::infinity, srsran::pdcp_discard_timer_t::infinity,
false}; false,
srsran::srsran_rat_t::nr};
pdcp_nr_test_helper pdcp_hlp(cfg, sec_cfg, logger); pdcp_nr_test_helper pdcp_hlp(cfg, sec_cfg, logger);
srsran::pdcp_entity_nr* pdcp = &pdcp_hlp.pdcp; srsran::pdcp_entity_nr* pdcp = &pdcp_hlp.pdcp;

@ -27,7 +27,8 @@ int test_tx_sdu_discard(const pdcp_initial_state& init_state,
srsran::PDCP_SN_LEN_12, srsran::PDCP_SN_LEN_12,
srsran::pdcp_t_reordering_t::ms500, srsran::pdcp_t_reordering_t::ms500,
discard_timeout, discard_timeout,
false}; false,
srsran::srsran_rat_t::nr};
pdcp_nr_test_helper pdcp_hlp(cfg, sec_cfg, logger); pdcp_nr_test_helper pdcp_hlp(cfg, sec_cfg, logger);
srsran::pdcp_entity_nr* pdcp = &pdcp_hlp.pdcp; srsran::pdcp_entity_nr* pdcp = &pdcp_hlp.pdcp;

@ -30,7 +30,8 @@ int test_rx(std::vector<pdcp_test_event_t> events,
pdcp_sn_len, pdcp_sn_len,
srsran::pdcp_t_reordering_t::ms500, srsran::pdcp_t_reordering_t::ms500,
srsran::pdcp_discard_timer_t::infinity, srsran::pdcp_discard_timer_t::infinity,
false}; false,
srsran::srsran_rat_t::nr};
pdcp_nr_test_helper pdcp_hlp_rx(cfg_rx, sec_cfg, logger); pdcp_nr_test_helper pdcp_hlp_rx(cfg_rx, sec_cfg, logger);
srsran::pdcp_entity_nr* pdcp_rx = &pdcp_hlp_rx.pdcp; srsran::pdcp_entity_nr* pdcp_rx = &pdcp_hlp_rx.pdcp;

@ -29,7 +29,8 @@ int test_tx(uint32_t n_packets,
pdcp_sn_len, pdcp_sn_len,
srsran::pdcp_t_reordering_t::ms500, srsran::pdcp_t_reordering_t::ms500,
srsran::pdcp_discard_timer_t::infinity, srsran::pdcp_discard_timer_t::infinity,
false}; false,
srsran::srsran_rat_t::nr};
pdcp_nr_test_helper pdcp_hlp(cfg, sec_cfg, logger); pdcp_nr_test_helper pdcp_hlp(cfg, sec_cfg, logger);
srsran::pdcp_entity_nr* pdcp = &pdcp_hlp.pdcp; srsran::pdcp_entity_nr* pdcp = &pdcp_hlp.pdcp;

@ -65,7 +65,8 @@ int rrc_nr::init(const rrc_nr_cfg_t& cfg_,
srsran::PDCP_SN_LEN_18, srsran::PDCP_SN_LEN_18,
srsran::pdcp_t_reordering_t::ms500, srsran::pdcp_t_reordering_t::ms500,
srsran::pdcp_discard_timer_t::infinity, srsran::pdcp_discard_timer_t::infinity,
false}; false,
srsran::srsran_rat_t::nr};
pdcp->add_bearer(cfg.coreless.rnti, cfg.coreless.drb_lcid, pdcp_cnfg); pdcp->add_bearer(cfg.coreless.rnti, cfg.coreless.drb_lcid, pdcp_cnfg);
logger.info("Started"); logger.info("Started");

@ -79,7 +79,8 @@ void rrc_nr::init_core_less()
srsran::PDCP_SN_LEN_18, srsran::PDCP_SN_LEN_18,
srsran::pdcp_t_reordering_t::ms500, srsran::pdcp_t_reordering_t::ms500,
srsran::pdcp_discard_timer_t::ms100, srsran::pdcp_discard_timer_t::ms100,
false}; false,
srsran_rat_t::nr};
pdcp->add_bearer(args.coreless.drb_lcid, pdcp_cnfg); pdcp->add_bearer(args.coreless.drb_lcid, pdcp_cnfg);
return; return;

@ -202,7 +202,7 @@ int ue_stack_lte::init(const stack_args_t& args_)
mac.init(phy, &rlc, &rrc); mac.init(phy, &rlc, &rrc);
rlc.init(&pdcp, &rrc, task_sched.get_timer_handler(), 0 /* RB_ID_SRB0 */); rlc.init(&pdcp, &rrc, task_sched.get_timer_handler(), 0 /* RB_ID_SRB0 */);
pdcp.init(&rlc, &rrc, gw); pdcp.init(&rlc, &rrc, &rrc_nr, gw);
nas.init(usim.get(), &rrc, gw, args.nas); nas.init(usim.get(), &rrc, gw, args.nas);
mac_nr_args_t mac_nr_args = {}; mac_nr_args_t mac_nr_args = {};

Loading…
Cancel
Save