Skip to content

Commit dfc2ea0

Browse files
committed
nr,gnb,pdcp: extend the use of local rb_name member to pdcp nr
1 parent c64be66 commit dfc2ea0

File tree

3 files changed

+9
-7
lines changed

3 files changed

+9
-7
lines changed

lib/include/srsran/interfaces/pdcp_interface_types.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -165,6 +165,8 @@ class pdcp_config_t
165165
status_report_required == other.status_report_required;
166166
}
167167
bool operator!=(const pdcp_config_t& other) const { return not(*this == other); }
168+
169+
std::string get_rb_name() const { return (rb_type == PDCP_RB_IS_DRB ? "DRB" : "SRB") + std::to_string(bearer_id); }
168170
};
169171

170172
// Specifies in which direction security (integrity and ciphering) are enabled for PDCP

lib/src/pdcp/pdcp_entity_lte.cc

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,7 @@ bool pdcp_entity_lte::configure(const pdcp_config_t& cnfg_)
6161
}
6262

6363
cfg = cnfg_;
64-
rb_name = cfg.rb_type == PDCP_RB_IS_DRB ? "DRB" : "SRB";
65-
rb_name += std::to_string(cfg.bearer_id);
64+
rb_name = cfg.get_rb_name();
6665

6766
maximum_pdcp_sn = (1u << cfg.sn_len) - 1u;
6867
st.last_submitted_pdcp_rx_sn = maximum_pdcp_sn;

lib/src/pdcp/pdcp_entity_nr.cc

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ pdcp_entity_nr::~pdcp_entity_nr() {}
3737
// Reestablishment procedure: 38.323 5.2
3838
void pdcp_entity_nr::reestablish()
3939
{
40-
logger.info("Re-establish %s with bearer ID: %d", rrc->get_rb_name(lcid), cfg.bearer_id);
40+
logger.info("Re-establish %s with bearer ID: %d", rb_name.c_str(), cfg.bearer_id);
4141
// TODO
4242
}
4343

@@ -46,13 +46,14 @@ bool pdcp_entity_nr::configure(const pdcp_config_t& cnfg_)
4646
if (active) {
4747
// Already configured
4848
if (cnfg_ != cfg) {
49-
logger.error("Bearer reconfiguration not supported. LCID=%s.", rrc->get_rb_name(lcid));
49+
logger.error("Bearer reconfiguration not supported. LCID=%s.", rb_name.c_str());
5050
return false;
5151
}
5252
return true;
5353
}
5454

5555
cfg = cnfg_;
56+
rb_name = cfg.get_rb_name();
5657
window_size = 1 << (cfg.sn_len - 1);
5758

5859
// Timers
@@ -70,7 +71,7 @@ bool pdcp_entity_nr::configure(const pdcp_config_t& cnfg_)
7071
void pdcp_entity_nr::reset()
7172
{
7273
active = false;
73-
logger.debug("Reset %s", rrc->get_rb_name(lcid));
74+
logger.debug("Reset %s", rb_name.c_str());
7475
}
7576

7677
// SDAP/RRC interface
@@ -80,7 +81,7 @@ void pdcp_entity_nr::write_sdu(unique_byte_buffer_t sdu, int sn)
8081
logger.info(sdu->msg,
8182
sdu->N_bytes,
8283
"TX %s SDU, integrity=%s, encryption=%s",
83-
rrc->get_rb_name(lcid),
84+
rb_name.c_str(),
8485
srsran_direction_text[integrity_direction],
8586
srsran_direction_text[encryption_direction]);
8687

@@ -136,7 +137,7 @@ void pdcp_entity_nr::write_pdu(unique_byte_buffer_t pdu)
136137
logger.info(pdu->msg,
137138
pdu->N_bytes,
138139
"RX %s PDU (%d B), integrity=%s, encryption=%s",
139-
rrc->get_rb_name(lcid),
140+
rb_name.c_str(),
140141
pdu->N_bytes,
141142
srsran_direction_text[integrity_direction],
142143
srsran_direction_text[encryption_direction]);

0 commit comments

Comments
 (0)