Commit 04abbdb6 authored by Robert Schmidt's avatar Robert Schmidt

Implement PDCP reset counters for reestablishment

After a reestablishment, the PDCP sequence number counters have to be
reset. Implement an API to allow the RRC to reset the sequence numbers
for a particular UE in the case of reestablishment
parent b90a59a6
......@@ -1071,6 +1071,39 @@ bool nr_pdcp_data_req_srb(ue_id_t ue_id,
return 1;
}
void nr_pdcp_reestablishment(ue_id_t ue_id)
{
// TODO implement this on a per RB basis following TS 38.323 Sec 5.1.2
nr_pdcp_manager_lock(nr_pdcp_ue_manager);
nr_pdcp_ue_t *ue = nr_pdcp_manager_get_ue(nr_pdcp_ue_manager, ue_id);
if (ue == NULL) {
LOG_E(PDCP, "Cannot find PDCP entity for UE %lx\n", ue_id);
nr_pdcp_manager_unlock(nr_pdcp_ue_manager);
return;
}
for (int i = 0; i < 3; i++) {
nr_pdcp_entity_t *srb = ue->srb[i];
if (srb != NULL) {
srb->tx_next = 0;
srb->rx_next = 0;
srb->rx_deliv = 0;
srb->rx_reord = 0;
}
}
for (int i = 0; i < MAX_DRBS_PER_UE; i++) {
nr_pdcp_entity_t *drb = ue->drb[i];
if (drb != NULL) {
// drb->tx_next = 0; // Should continue from the previous value
drb->rx_next = 0;
//drb->rx_deliv = 0; // should continue from the previous value
drb->rx_reord = 0;
}
}
nr_pdcp_manager_unlock(nr_pdcp_ue_manager);
}
bool nr_pdcp_data_req_drb(protocol_ctxt_t *ctxt_pP,
const srb_flag_t srb_flagP,
const rb_id_t rb_id,
......
......@@ -58,6 +58,7 @@ void nr_pdcp_add_drbs(eNB_flag_t enb_flag,
void nr_DRB_preconfiguration(ue_id_t crntiMaybeUEid);
bool nr_pdcp_remove_UE(ue_id_t ue_id);
void nr_pdcp_reestablishment(ue_id_t ue_id);
void nr_pdcp_config_set_security(ue_id_t ue_id,
const rb_id_t rb_id,
......
......@@ -1238,6 +1238,7 @@ void rrc_gNB_generate_RRCReestablishment(const protocol_ctxt_t *ctxt_pP,
kRRCenc,
kRRCint,
kUPenc);
nr_pdcp_reestablishment(ctxt_pP->rntiMaybeUEid);
if (!NODE_IS_CU(rrc->node_type)) {
apply_macrlc_config_reest(rrc, ue_context_pP, ctxt_pP, ctxt_pP->rntiMaybeUEid);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment