Commit 41ab20de authored by Vaibhav Shrivastava's avatar Vaibhav Shrivastava

gNB & nrUE Compilation Changes on Latest_3GPP_FRD_299 Branch

parent e9d79295
......@@ -1573,6 +1573,7 @@ set(L2_NR_SRC
${NR_RRC_DIR}/rrc_gNB_reconfig.c
${NR_RRC_DIR}/rrc_gNB_UE_context.c
${NR_RRC_DIR}/rrc_gNB_NGAP.c
${NR_RRC_DIR}/rrc_gNB_radio_bearers.c
)
set(L2_SRC_UE
......
......@@ -1711,10 +1711,7 @@ schedule_ulsch(module_id_t module_idP,
start_meas(&(mac->schedule_ulsch));
sched_subframe = (subframeP + 4) % 10;
sched_frame = frameP;
/* MultiCell: Common channels modify for multiple CC */
cc = &RC.mac[module_idP]->common_channels[CC_id];
cc = mac->common_channels;
/* For TDD: check subframes where we have to act and return if nothing should be done now */
if (cc->tdd_Config) { // Done only for CC_id = 0, assume tdd_Config for all CC_id
......@@ -1818,6 +1815,9 @@ schedule_ulsch(module_id_t module_idP,
/* Note: RC.nb_mac_CC[module_idP] should be lower than or equal to NFAPI_CC_MAX */
for (int CC_id = 0; CC_id < RC.nb_mac_CC[module_idP]; CC_id++, cc++) {
/* MultiCell: Common channels modify for multiple CC */
cc = &RC.mac[module_idP]->common_channels[CC_id];
if (is_prach_subframe0(cc->tdd_Config!=NULL ? cc->tdd_Config->subframeAssignment : 0,cc->tdd_Config!=NULL ? 1 : 0,
cc->radioResourceConfigCommon->prach_Config.prach_ConfigInfo.prach_ConfigIndex,
sched_frame, sched_subframe)) {
......
......@@ -321,23 +321,19 @@ void nr_store_dlsch_buffer(module_id_t module_id,
UE_iterator(RC.nrmac[module_id]->UE_info.list, UE) {
NR_UE_sched_ctrl_t *sched_ctrl = &UE->UE_sched_ctrl;
sched_ctrl->num_total_bytes = 0;
sched_ctrl->dl_pdus_total = 0;
int lcid;
const uint16_t rnti = UE_info->rnti[UE_id];
LOG_D(NR_MAC,"UE %d/%x : lcid_mask %x\n",UE_id,rnti,sched_ctrl->lcid_mask);
if ((sched_ctrl->lcid_mask&(1<<DL_SCH_LCID_DCCH1)) > 0)
sched_ctrl->rlc_status[DL_SCH_LCID_DCCH1] = mac_rlc_status_ind(module_id,
rnti,
module_id,
frame,
slot,
ENB_FLAG_YES,
MBMS_FLAG_NO,
DL_SCH_LCID_DCCH1,
0,
0);
if ((sched_ctrl->lcid_mask&(1<<DL_SCH_LCID_DCCH)) > 0)
sched_ctrl->rlc_status[DL_SCH_LCID_DCCH] = mac_rlc_status_ind(module_id,
/* loop over all activated logical channels */
// Note: DL_SCH_LCID_DCCH, DL_SCH_LCID_DCCH1, DL_SCH_LCID_DTCH
for (int i = 0; i < sched_ctrl->dl_lc_num; ++i) {
const int lcid = sched_ctrl->dl_lc_ids[i];
const uint16_t rnti = UE->rnti;
LOG_D(NR_MAC, "In %s: UE %x: LCID %d\n", __FUNCTION__, rnti, lcid);
if (lcid == DL_SCH_LCID_DTCH && sched_ctrl->rrc_processing_timer > 0) {
continue;
}
start_meas(&RC.nrmac[module_id]->rlc_status_ind);
sched_ctrl->rlc_status[lcid] = mac_rlc_status_ind(module_id,
rnti,
module_id,
frame,
......@@ -347,36 +343,7 @@ void nr_store_dlsch_buffer(module_id_t module_id,
lcid,
0,
0);
int dtch_id = -1;
for (int dtch_lcid = DL_SCH_LCID_DTCH; dtch_lcid <= DL_SCH_LCID_DTCH + 4; dtch_lcid++) {
if ((sched_ctrl->lcid_mask&(1<<dtch_lcid)) > 0) {
start_meas(&RC.nrmac[module_id]->rlc_status_ind);
sched_ctrl->rlc_status[dtch_lcid] = mac_rlc_status_ind(module_id,
rnti,
module_id,
frame,
slot,
ENB_FLAG_YES,
MBMS_FLAG_NO,
dtch_lcid,
0,
dtch_id = dtch_lcid;
}
}
}
if (sched_ctrl->rlc_status[DL_SCH_LCID_DCCH].bytes_in_buffer > 0) {
lcid = DL_SCH_LCID_DCCH;
} else if (sched_ctrl->rlc_status[DL_SCH_LCID_DCCH1].bytes_in_buffer > 0) {
lcid = DL_SCH_LCID_DCCH1;
} else if (dtch_id != -1) {
lcid = dtch_id;
} else {
lcid = DL_SCH_LCID_DTCH;
}
sched_ctrl->num_total_bytes += sched_ctrl->rlc_status[lcid].bytes_in_buffer;
//later multiplex here. Just select DCCH/SRB before DTCH/DRB
sched_ctrl->lcid_to_schedule = lcid;
stop_meas(&RC.nrmac[module_id]->rlc_status_ind);
if (sched_ctrl->rlc_status[lcid].bytes_in_buffer == 0)
continue;
......@@ -392,6 +359,7 @@ void nr_store_dlsch_buffer(module_id_t module_id,
lcid,
UE->rnti,
sched_ctrl->rlc_status[lcid].bytes_in_buffer,
sched_ctrl->num_total_bytes,
sched_ctrl->dl_pdus_total,
sched_ctrl->ta_apply ? "send":"do not send");
}
......
......@@ -286,27 +286,15 @@ int nr_process_mac_pdu(instance_t module_idP,
/* Extract MULTI ENTRY PHR elements from single octet bitmap for PHR calculation */
break;
// Check if it is a valid CCCH1 message, we get all 00's messages very often
if (pdu_len < mac_subheader_len + mac_sdu_len) {
LOG_E(NR_MAC, "pdu_len %d is invalid (prior to cast of size %d)\n",
pdu_len, mac_subheader_len + mac_sdu_len);
return 0;
}
int i = 0;
for(i=0; i<(mac_subheader_len+mac_sdu_len); i++) {
if(pduP[i] != 0) {
break;
}
}
if (i == (mac_subheader_len+mac_sdu_len)) {
LOG_D(NR_MAC, "%s() Invalid CCCH1 message!, pdu_len: %d\n", __func__, pdu_len);
case UL_SCH_LCID_MULTI_ENTRY_PHR_4_OCT:
LOG_E(NR_MAC, "Multi entry PHR not supported\n");
done = 1;
//38.321 section 6.1.3.9
// variable length
if (!get_mac_len(pduP, pdu_len, &mac_len, &mac_subheader_len))
return 0;
/* Extract MULTI ENTRY PHR elements from four octets bitmap for PHR calculation */
break;
}
} else {
// fixed length of 6 bytes
mac_sdu_len = 6;
}
case UL_SCH_LCID_PADDING:
done = 1;
......@@ -338,18 +326,10 @@ int nr_process_mac_pdu(instance_t module_idP,
}
}
LOG_D(NR_MAC, "In %s: [UE %d] %d.%d : ULSCH -> UL-%s %d (gNB %d, %d bytes)\n",
__func__,
module_idP,
frameP,
slot,
rx_lcid<4?"DCCH":"DTCH",
rx_lcid,
module_idP,
mac_sdu_len);
UE_info->mac_stats[UE_id].lc_bytes_rx[rx_lcid] += mac_sdu_len;
if (UE_idx->CellGroup) {
LOG_D(NR_MAC, "Frame %d : ULSCH -> UL-DCCH %d (gNB %ld, %d bytes), rnti: 0x%04x \n", frameP, rx_lcid, module_idP, mac_len, crnti);
if (pdu_len < mac_subheader_len + mac_ce_len + mac_sdu_len)
if (pdu_len < mac_subheader_len + mac_len)
return 0;
mac_rlc_data_ind(module_idP,
......
......@@ -572,7 +572,7 @@ static void enqueue_pdcp_data_req(
NR_DTCH_DATA_REQ (message_p).sdu_p = message_buffer;
NR_DTCH_DATA_REQ (message_p).mode = modeP;
NR_DTCH_DATA_REQ (message_p).module_id = ctxt_pP->module_id;
NR_DTCH_DATA_REQ (message_p).rnti = ctxt_pP->rnti;
NR_DTCH_DATA_REQ (message_p).rnti = ctxt_pP->rntiMaybeUEid;
NR_DTCH_DATA_REQ (message_p).gNB_index = ctxt_pP->eNB_index;
itti_send_msg_to_task(
ctxt_pP->enb_flag ? TASK_PDCP_ENB : TASK_PDCP_UE,
......@@ -698,7 +698,7 @@ static void deliver_sdu_drb(void *_ue, nr_pdcp_entity_t *entity,
&ctxt,
0,
entity->is_gnb,
ue->rnti,
ue->rntiMaybeUEid,
nr_pdcp_current_time_last_frame,
nr_pdcp_current_time_last_subframe,
0);
......@@ -755,7 +755,7 @@ rb_found:
PROTOCOL_CTXT_SET_BY_MODULE_ID(&ctxt,
0,
entity->is_gnb,
ue->rnti,
ue->rntiMaybeUEid,
nr_pdcp_current_time_last_frame,
nr_pdcp_current_time_last_subframe,
0);
......@@ -956,7 +956,7 @@ void pdcp_run(const protocol_ctxt_t *const ctxt_pP)
NR_DTCH_DATA_REQ(msg_p).gNB_index);
LOG_A(PDCP, "Sending packet to PDCP, Calling pdcp_data_req ue %x drb id %ld len %u\n",
ctxt.rnti, NR_DTCH_DATA_REQ(msg_p).rb_id, NR_DTCH_DATA_REQ(msg_p).sdu_size);
ctxt.rntiMaybeUEid, NR_DTCH_DATA_REQ(msg_p).rb_id, NR_DTCH_DATA_REQ(msg_p).sdu_size);
result = pdcp_data_req(&ctxt,
SRB_FLAG_NO,
NR_DTCH_DATA_REQ(msg_p).rb_id,
......@@ -966,7 +966,7 @@ void pdcp_run(const protocol_ctxt_t *const ctxt_pP)
NR_DTCH_DATA_REQ(msg_p).sdu_p,
NR_DTCH_DATA_REQ(msg_p).mode,
NULL, NULL);
if (result != TRUE)
if (result != true)
LOG_E(PDCP, "PDCP data request failed!\n");
result = itti_free(ITTI_MSG_ORIGIN_ID(msg_p), NR_DTCH_DATA_REQ(msg_p).sdu_p);
......
......@@ -161,7 +161,7 @@ void mac_rlc_data_ind (
T_INT(channel_idP), T_INT(tb_sizeP));
if (RC.ss.mode >= SS_SOFTMODEM) {
if ((tb_sizeP != 0) && (TRUE == enb_flagP) && (channel_idP >= 4)) {
if ((tb_sizeP != 0) && (true == enb_flagP) && (channel_idP >= 4)) {
int drb_id = channel_idP - 3;
int result;
LOG_A(RLC, "Sending packet to SS, Calling SS_DRB_PDU_IND ue %x drb id %ld size %u\n",
......
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