Commit 8cd2d446 authored by francescomani's avatar francescomani Committed by Jaroslava Fiedlerova

using ue-id instead of rnti to address RLC at UE

parent 08f0283c
......@@ -992,7 +992,7 @@ void init_NR_UE(int nb_inst, char *uecap_file, char *reconfig_file, char *rbconf
init_nsa_message(&rrc_inst[i], reconfig_file, rbconfig_file);
// TODO why do we need noS1 configuration?
// temporarily moved here to understand why not using the one provided by gNB
nr_rlc_activate_srb0(mac->crnti, NULL, send_srb0_rrc);
nr_rlc_activate_srb0(i, NULL, send_srb0_rrc);
if (IS_SOFTMODEM_NOS1) {
// get default noS1 configuration
NR_RadioBearerConfig_t *rbconfig = NULL;
......@@ -1002,7 +1002,7 @@ void init_NR_UE(int nb_inst, char *uecap_file, char *reconfig_file, char *rbconf
// set up PDCP, RLC, MAC
nr_pdcp_layer_init(false);
nr_pdcp_add_drbs(ENB_FLAG_NO, i, rbconfig->drb_ToAddModList, 0, NULL, NULL);
nr_rlc_add_drb(mac->crnti, rbconfig->drb_ToAddModList->list.array[0]->drb_Identity, rlc_rbconfig);
nr_rlc_add_drb(i, rbconfig->drb_ToAddModList->list.array[0]->drb_Identity, rlc_rbconfig);
struct NR_CellGroupConfig__rlc_BearerToAddModList rlc_toadd_list;
rlc_toadd_list.list.count = 1;
rlc_toadd_list.list.array = calloc(1, sizeof(NR_RLC_BearerConfig_t));
......
......@@ -56,7 +56,7 @@ void send_srb0_rrc(int rnti, const uint8_t *sdu, sdu_size_t sdu_len, void *data)
void send_msg3_rrc_request(module_id_t mod_id, int rnti)
{
nr_rlc_activate_srb0(rnti, NULL, send_srb0_rrc);
nr_rlc_activate_srb0(mod_id, NULL, send_srb0_rrc);
nr_mac_rrc_msg3_ind(mod_id, rnti);
}
......
......@@ -620,7 +620,7 @@ void nr_get_msg3_payload(module_id_t mod_id, uint8_t *buf, int TBS_max)
// if RRC has called nr_rlc_srb_recv_sdu(),
// we are good even if the name is misleading (we send a ssrb msg, not receive if)
tbs_size_t len = mac_rlc_data_req(mod_id,
ra->t_crnti,
mac->ue_id,
0,
0,
ENB_FLAG_NO,
......
......@@ -3606,7 +3606,7 @@ void nr_ue_process_mac_pdu(nr_downlink_indication_t *dl_info,
}
mac_rlc_data_ind(module_idP,
mac->crnti,
mac->ue_id,
module_idP,
frameP,
ENB_FLAG_NO,
......@@ -3744,7 +3744,7 @@ void nr_ue_process_mac_pdu(nr_downlink_indication_t *dl_info,
LOG_D(NR_MAC, "%4d.%2d : DLSCH -> LCID %d %d bytes\n", frameP, slot, rx_lcid, mac_len);
mac_rlc_data_ind(module_idP,
mac->crnti,
mac->ue_id,
gNB_index,
frameP,
ENB_FLAG_NO,
......
......@@ -1177,7 +1177,16 @@ bool nr_update_bsr(module_id_t module_idP, frame_t frameP, slot_t slotP, uint8_t
lcgid_buffer_remain[lcgid] += mac->scheduling_info.lc_sched_info[lcid - 1].LCID_buffer_remain;
}
mac_rlc_status_resp_t rlc_status = mac_rlc_status_ind(module_idP, mac->crnti,gNB_index,frameP,slotP,ENB_FLAG_NO,MBMS_FLAG_NO, lcid, 0, 0);
mac_rlc_status_resp_t rlc_status = mac_rlc_status_ind(module_idP,
mac->ue_id,
gNB_index,
frameP,
slotP,
ENB_FLAG_NO,
MBMS_FLAG_NO,
lcid,
0,
0);
lcid_bytes_in_buffer[lcid - 1] = rlc_status.bytes_in_buffer;
......@@ -2997,7 +3006,7 @@ static bool fill_mac_sdu(module_id_t module_idP,
get_num_bytes_to_reqlc(mac, count_same_priority_lcids, lcid, buflen_ep, *buflen_remain, *counter, lcids_bytes_tot, &target);
uint16_t sdu_length = mac_rlc_data_req(module_idP,
mac->crnti,
mac->ue_id,
gNB_index,
frameP,
ENB_FLAG_NO,
......
......@@ -136,13 +136,12 @@ static const char nr_nas_attach_req_imsi_dummy_NSA_case[] = {
static void nr_rrc_manage_rlc_bearers(const instance_t instance,
const NR_CellGroupConfig_t *cellGroupConfig,
rrcPerNB_t *rrc,
const rnti_t rnti);
rrcPerNB_t *rrc);
static void nr_rrc_ue_process_RadioBearerConfig(NR_UE_RRC_INST_t *ue_rrc,
rrcPerNB_t *rrcNB,
NR_RadioBearerConfig_t *const radioBearerConfig);
static void nr_rrc_ue_generate_RRCSetupRequest(NR_UE_RRC_INST_t *rrc, rnti_t rnti);
static void nr_rrc_ue_generate_RRCSetupRequest(NR_UE_RRC_INST_t *rrc);
static void nr_rrc_ue_generate_rrcReestablishmentComplete(NR_RRCReestablishment_t *rrcReestablishment);
static void process_lte_nsa_msg(NR_UE_RRC_INST_t *rrc, nsa_msg_t *msg, int msg_len);
static void nr_rrc_ue_process_rrcReconfiguration(const instance_t instance,
......@@ -566,12 +565,12 @@ static int nr_decode_SI(NR_UE_RRC_SI_INFO *SI_info, NR_SystemInformation_t *si)
return 0;
}
void nr_rrc_ue_generate_ra_msg(NR_UE_RRC_INST_t *rrc, RA_trigger_t trigger, rnti_t rnti)
void nr_rrc_ue_generate_ra_msg(NR_UE_RRC_INST_t *rrc, RA_trigger_t trigger)
{
switch (trigger) {
case INITIAL_ACCESS_FROM_RRC_IDLE:
// After SIB1 is received, prepare RRCConnectionRequest
nr_rrc_ue_generate_RRCSetupRequest(rrc, rnti);
nr_rrc_ue_generate_RRCSetupRequest(rrc);
break;
case RRC_CONNECTION_REESTABLISHMENT:
AssertFatal(1==0, "ra_trigger not implemented yet!\n");
......@@ -600,7 +599,7 @@ void nr_rrc_ue_generate_ra_msg(NR_UE_RRC_INST_t *rrc, RA_trigger_t trigger, rnti
}
}
static void nr_rrc_ue_generate_RRCSetupRequest(NR_UE_RRC_INST_t *rrc, rnti_t rnti)
static void nr_rrc_ue_generate_RRCSetupRequest(NR_UE_RRC_INST_t *rrc)
{
LOG_D(NR_RRC, "Generation of RRCSetupRequest\n");
uint8_t rv[6];
......@@ -623,7 +622,7 @@ static void nr_rrc_ue_generate_RRCSetupRequest(NR_UE_RRC_INST_t *rrc, rnti_t rnt
tac->T300_active = true;
/* convention: RNTI for SRB0 is zero, as it changes all the time */
nr_rlc_srb_recv_sdu(rnti, 0, buf, len);
nr_rlc_srb_recv_sdu(rrc->ue_id, 0, buf, len);
}
void nr_rrc_configure_default_SI(NR_UE_RRC_SI_INFO *SI_info,
......@@ -720,14 +719,13 @@ static int8_t nr_rrc_ue_decode_NR_BCCH_DL_SCH_Message(instance_t instance,
static void nr_rrc_manage_rlc_bearers(const instance_t instance,
const NR_CellGroupConfig_t *cellGroupConfig,
rrcPerNB_t *rrc,
const rnti_t rnti)
rrcPerNB_t *rrc)
{
if (cellGroupConfig->rlc_BearerToReleaseList != NULL) {
for (int i = 0; i < cellGroupConfig->rlc_BearerToReleaseList->list.count; i++) {
NR_LogicalChannelIdentity_t *lcid = cellGroupConfig->rlc_BearerToReleaseList->list.array[i];
AssertFatal(lcid, "LogicalChannelIdentity shouldn't be null here\n");
nr_rlc_release_entity(rnti, *lcid);
nr_rlc_release_entity(instance, *lcid);
}
}
......@@ -737,8 +735,8 @@ static void nr_rrc_manage_rlc_bearers(const instance_t instance,
NR_LogicalChannelIdentity_t lcid = rlc_bearer->logicalChannelIdentity;
if (rrc->active_RLC_entity[lcid]) {
if (rlc_bearer->reestablishRLC)
nr_rlc_reestablish_entity(rnti, lcid);
nr_rlc_reconfigure_entity(rnti, lcid, rlc_bearer->rlc_Config);
nr_rlc_reestablish_entity(instance, lcid);
nr_rlc_reconfigure_entity(instance, lcid, rlc_bearer->rlc_Config);
} else {
rrc->active_RLC_entity[lcid] = true;
AssertFatal(rlc_bearer->servedRadioBearer, "servedRadioBearer mandatory in case of setup\n");
......@@ -746,10 +744,10 @@ static void nr_rrc_manage_rlc_bearers(const instance_t instance,
"Invalid RB for RLC configuration\n");
if (rlc_bearer->servedRadioBearer->present == NR_RLC_BearerConfig__servedRadioBearer_PR_srb_Identity) {
NR_SRB_Identity_t srb_id = rlc_bearer->servedRadioBearer->choice.srb_Identity;
nr_rlc_add_srb(rnti, srb_id, rlc_bearer);
nr_rlc_add_srb(instance, srb_id, rlc_bearer);
} else { // DRB
NR_DRB_Identity_t drb_id = rlc_bearer->servedRadioBearer->choice.drb_Identity;
nr_rlc_add_drb(rnti, drb_id, rlc_bearer);
nr_rlc_add_drb(instance, drb_id, rlc_bearer);
}
}
}
......@@ -807,7 +805,7 @@ void nr_rrc_cellgroup_configuration(rrcPerNB_t *rrcNB,
// TODO verify why we need this limitation
if (get_softmodem_params()->sa || get_softmodem_params()->nsa)
nr_rrc_manage_rlc_bearers(instance, cellGroupConfig, rrcNB, rrc->rnti);
nr_rrc_manage_rlc_bearers(instance, cellGroupConfig, rrcNB);
AssertFatal(cellGroupConfig->sCellToReleaseList == NULL,
"Secondary serving cell release not implemented\n");
......@@ -1461,7 +1459,7 @@ void *rrc_nrue(void *notUsed)
break;
case NR_RRC_MAC_MSG3_IND:
nr_rrc_ue_generate_ra_msg(rrc, INITIAL_ACCESS_FROM_RRC_IDLE, NR_RRC_MAC_MSG3_IND(msg_p).rnti);
nr_rrc_ue_generate_ra_msg(rrc, INITIAL_ACCESS_FROM_RRC_IDLE);
break;
case NR_RRC_MAC_RA_IND:
......@@ -1931,7 +1929,7 @@ void nr_rrc_going_to_IDLE(instance_t instance,
for (int i = 0; i < NR_MAX_NUM_LCID; i++) {
if (nb->active_RLC_entity[i]) {
nb->active_RLC_entity[i] = false;
nr_rlc_release_entity(rrc->rnti, i);
nr_rlc_release_entity(instance, i);
}
}
}
......
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