Commit 1642c10d authored by Robert Schmidt's avatar Robert Schmidt Committed by Makarand kulkarni

Hack: Make reestablishment work

For the reestablishment, the SRB2 in the RRC reconfiguration
following the reestablishment needs to include ReestablishPDCP true.
We were not sending that. In this commit, I add a parameter to
add that parameter on demand. There might be a better solution.
parent ee1af533
......@@ -304,7 +304,7 @@ unsigned int rrc_gNB_get_next_transaction_identifier(module_id_t gnb_mod_idP)
return tmp;
}
static NR_SRB_ToAddModList_t *createSRBlist(gNB_RRC_UE_t *ue)
static NR_SRB_ToAddModList_t *createSRBlist(gNB_RRC_UE_t *ue, bool reestablish)
{
if (!ue->Srb[1].Active) {
LOG_E(NR_RRC, "Call SRB list while SRB1 doesn't exist\n");
......@@ -315,6 +315,9 @@ static NR_SRB_ToAddModList_t *createSRBlist(gNB_RRC_UE_t *ue)
if (ue->Srb[i].Active) {
asn1cSequenceAdd(list->list, NR_SRB_ToAddMod_t, srb);
srb->srb_Identity = i;
if (reestablish && i == 2) {
asn1cCallocOne(srb->reestablishPDCP, NR_SRB_ToAddMod__reestablishPDCP_true);
}
}
return list;
}
......@@ -361,7 +364,7 @@ static void rrc_gNB_generate_RRCSetup(instance_t instance,
unsigned char buf[1024];
uint8_t xid = rrc_gNB_get_next_transaction_identifier(instance);
ue_p->xids[xid] = RRC_SETUP;
NR_SRB_ToAddModList_t *SRBs = createSRBlist(ue_p);
NR_SRB_ToAddModList_t *SRBs = createSRBlist(ue_p, false);
int size = do_RRCSetup(ue_context_pP, buf, xid, masterCellGroup, masterCellGroup_len, &rrc->configuration, SRBs);
AssertFatal(size > 0, "do_RRCSetup failed\n");
......@@ -398,7 +401,7 @@ static int rrc_gNB_generate_RRCSetup_for_RRCReestablishmentRequest(module_id_t m
unsigned char buf[1024];
uint8_t xid = rrc_gNB_get_next_transaction_identifier(module_id);
ue_p->xids[xid] = RRC_SETUP_FOR_REESTABLISHMENT;
NR_SRB_ToAddModList_t *SRBs = createSRBlist(ue_p);
NR_SRB_ToAddModList_t *SRBs = createSRBlist(ue_p, true);
int size = do_RRCSetup(ue_context_pP, buf, xid, NULL, 0, &rrc_instance_p->configuration, SRBs);
AssertFatal(size > 0, "do_RRCSetup failed\n");
......@@ -700,7 +703,7 @@ void rrc_gNB_generate_dedicatedRRCReconfiguration(const protocol_ctxt_t *const c
AssertFatal(xid > -1, "Invalid xid %d. No PDU sessions setup to configure.\n", xid);
uint8_t buffer[RRC_BUF_SIZE] = {0};
NR_SRB_ToAddModList_t *SRBs = createSRBlist(ue_p);
NR_SRB_ToAddModList_t *SRBs = createSRBlist(ue_p, false);
int size = do_RRCReconfiguration(ctxt_pP,
buffer,
RRC_BUF_SIZE,
......@@ -1047,7 +1050,7 @@ static void rrc_gNB_process_RRCReconfigurationComplete(const protocol_ctxt_t *co
}
}
}
NR_SRB_ToAddModList_t *SRBs = createSRBlist(ue_p);
NR_SRB_ToAddModList_t *SRBs = createSRBlist(ue_p, false);
nr_pdcp_add_srbs(ctxt_pP->enb_flag,
ctxt_pP->rntiMaybeUEid,
......@@ -1170,7 +1173,7 @@ void rrc_gNB_generate_RRCReestablishment(const protocol_ctxt_t *ctxt_pP,
uint8_t buffer[RRC_BUF_SIZE] = {0};
uint8_t xid = rrc_gNB_get_next_transaction_identifier(module_id);
ue_p->xids[xid] = RRC_REESTABLISH;
NR_SRB_ToAddModList_t *SRBs = createSRBlist(ue_p);
NR_SRB_ToAddModList_t *SRBs = createSRBlist(ue_p, true);
int size = do_RRCReestablishment(ctxt_pP,
ue_context_pP,
CC_id,
......@@ -1340,7 +1343,6 @@ void rrc_gNB_process_RRCReestablishmentComplete(const protocol_ctxt_t *const ctx
ue_p->xids[new_xid] = RRC_REESTABLISH_COMPLETE;
ue_p->StatusRrc = NR_RRC_CONNECTED;
//*SRB2_config->reestablishPDCP = NR_SRB_ToAddMod__reestablishPDCP_true;
ue_p->Srb[1].Active = 1;
if (get_softmodem_params()->sa) {
uint8_t send_security_mode_command = false;
......@@ -1381,7 +1383,7 @@ void rrc_gNB_process_RRCReestablishmentComplete(const protocol_ctxt_t *const ctx
}
uint8_t buffer[RRC_BUF_SIZE] = {0};
NR_SRB_ToAddModList_t *SRBs = createSRBlist(ue_p);
NR_SRB_ToAddModList_t *SRBs = createSRBlist(ue_p, true);
int size = do_RRCReconfiguration(ctxt_pP,
buffer,
RRC_BUF_SIZE,
......
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