Commit 776c7abf authored by Swetank Srivastava's avatar Swetank Srivastava Committed by Vijay C

Code review comments incorporation

parent 2a8b891f
......@@ -477,12 +477,6 @@ bool pdcp_data_req(protocol_ctxt_t *ctxt_pP,
if ((pdcp_p->security_activated != 0) &&
(((pdcp_p->cipheringAlgorithm) != 0) ||
((pdcp_p->integrityProtAlgorithm) != 0))) {
printf("kRRCint in PDCP:\n");
for(int i=0;i<32;i++)
{
printf("%02x",pdcp_p->kRRCint);
}
printf("\n");
uint8_t ciphyeringAlgorithm = pdcp_p->cipheringAlgorithm;
if (ctxt_pP->enb_flag == ENB_FLAG_YES) {
......
......@@ -134,13 +134,6 @@ pdcp_apply_security(
encrypt_params.blength = (pdcp_header_len + sdu_buffer_size) << 3;
encrypt_params.key = pdcp_pP->kRRCint + 16; // + 128;
printf("kRRCint in PDCP:\n");
for(int i=0;i<32;i++)
{
printf("%02x",pdcp_pP->kRRCint);
}
printf("\n");
mac_i = &pdcp_pdu_buffer[pdcp_header_len + sdu_buffer_size];
/* Both header and data parts are integrity protected for
......
......@@ -9,7 +9,6 @@
static IF_Module_t *if_inst[MAX_IF_MODULES];
static Sched_Rsp_t Sched_INFO[MAX_IF_MODULES][MAX_NUM_CCs];
uint8_t sf_ahead_for_dl = 0;
extern uint16_t pdcch_order_table[16];
extern int cell_index;
extern uint8_t pdcchOrder_rcvd;
......@@ -785,7 +784,6 @@ void UL_indication(UL_IND_t *UL_info, void *proc) {
uint8_t sf_ahead_dl = ul_subframe2_k_phich(&mac->common_channels[CC_id], UL_info->subframe);
if(sf_ahead_dl!=255) {
sf_ahead_for_dl = sf_ahead_dl;
mac->HI_DCI0_req[CC_id][(UL_info->subframe+sf_ahead_dl)%10].hi_dci0_request_body.number_of_hi = 0;
LOG_D(MAC,"current (%d,%d) clear HI_DCI0_req[0][%d]\n",UL_info->frame,UL_info->subframe,(UL_info->subframe+sf_ahead_dl)%10);
}
......
......@@ -2516,7 +2516,7 @@ uint8_t do_SIB5(uint8_t Mod_id,
InterFreqCarrierInfo->ext1->threshX_Q_r9 = CALLOC(1,sizeof(struct LTE_InterFreqCarrierFreqInfo__ext1__threshX_Q_r9));
InterFreqCarrierInfo->ext1->threshX_Q_r9->threshX_HighQ_r9 = configuration->InterFreqCarrierFreqInfo[CC_id][i].threshX_Q_r9.threshX_HighQ_r9;
InterFreqCarrierInfo->ext1->threshX_Q_r9->threshX_LowQ_r9 = configuration->InterFreqCarrierFreqInfo[CC_id][i].threshX_Q_r9.threshX_LowQ_r9;
LOG_A(RRC,"add ext1 threshX_Q_r9 Low and high for CC_ID %d threshX_HighQ_r9 %d threshX_LowQ_r9 %d\n ",CC_id,
LOG_A(RRC,"add ext1 threshX_Q_r9 Low and high for CC_ID %d threshX_HighQ_r9 %ld threshX_LowQ_r9 %ld\n ",CC_id,
InterFreqCarrierInfo->ext1->threshX_Q_r9->threshX_HighQ_r9,
InterFreqCarrierInfo->ext1->threshX_Q_r9->threshX_LowQ_r9);
}
......@@ -3670,10 +3670,10 @@ uint8_t do_SecurityModeCommand(
return -1;
}
LOG_D(RRC, "[eNB %d] securityModeCommand for UE %x Encoded %zd bits (%zd bytes)\n", ctxt_pP->module_id, ctxt_pP->rntiMaybeUEid, enc_rval.encoded, (enc_rval.encoded + 7) / 8);
LOG_D(RRC, "[eNB %d] securityModeCommand for UE %ld Encoded %zd bits (%zd bytes)\n", ctxt_pP->module_id, ctxt_pP->rntiMaybeUEid, enc_rval.encoded, (enc_rval.encoded + 7) / 8);
if (enc_rval.encoded==-1) {
LOG_E(RRC, "[eNB %d] ASN1 : securityModeCommand encoding failed for UE %x\n", ctxt_pP->module_id, ctxt_pP->rntiMaybeUEid);
LOG_E(RRC, "[eNB %d] ASN1 : securityModeCommand encoding failed for UE %ld\n", ctxt_pP->module_id, ctxt_pP->rntiMaybeUEid);
return(-1);
}
......@@ -3787,10 +3787,10 @@ uint8_t do_UECapabilityEnquiry( const protocol_ctxt_t *const ctxt_pP,
return -1;
}
LOG_D(RRC, "[eNB %d] UECapabilityRequest for UE %x Encoded %zd bits (%zd bytes)\n", ctxt_pP->module_id, ctxt_pP->rntiMaybeUEid, enc_rval.encoded, (enc_rval.encoded + 7) / 8);
LOG_D(RRC, "[eNB %d] UECapabilityRequest for UE %ld Encoded %zd bits (%zd bytes)\n", ctxt_pP->module_id, ctxt_pP->rntiMaybeUEid, enc_rval.encoded, (enc_rval.encoded + 7) / 8);
if (enc_rval.encoded==-1) {
LOG_E(RRC, "[eNB %d] ASN1 : UECapabilityRequest encoding failed for UE %x\n", ctxt_pP->module_id, ctxt_pP->rntiMaybeUEid);
LOG_E(RRC, "[eNB %d] ASN1 : UECapabilityRequest encoding failed for UE %ld\n", ctxt_pP->module_id, ctxt_pP->rntiMaybeUEid);
return(-1);
}
......@@ -3902,10 +3902,10 @@ uint8_t do_NR_UECapabilityEnquiry( const protocol_ctxt_t *const ctxt_pP,
return -1;
}
LOG_D(RRC, "[eNB %d] NR UECapabilityRequest for UE %x Encoded %zd bits (%zd bytes)\n", ctxt_pP->module_id, ctxt_pP->rntiMaybeUEid, enc_rval.encoded, (enc_rval.encoded + 7) / 8);
LOG_D(RRC, "[eNB %d] NR UECapabilityRequest for UE %ld Encoded %zd bits (%zd bytes)\n", ctxt_pP->module_id, ctxt_pP->rntiMaybeUEid, enc_rval.encoded, (enc_rval.encoded + 7) / 8);
if (enc_rval.encoded==-1) {
LOG_E(RRC, "[eNB %d] ASN1 : NR UECapabilityRequest encoding failed for UE %x\n", ctxt_pP->module_id, ctxt_pP->rntiMaybeUEid);
LOG_E(RRC, "[eNB %d] ASN1 : NR UECapabilityRequest encoding failed for UE %ld\n", ctxt_pP->module_id, ctxt_pP->rntiMaybeUEid);
return(-1);
}
......
......@@ -4102,7 +4102,7 @@ void rrc_eNB_generate_defaultRRCConnectionReconfiguration(const protocol_ctxt_t
memcpy(kUPenc, pdcp_p->kUPenc, 16);
}
LOG_A(RRC, "OSA Reconfig for SRB2 %d rnti pdcp_p->integrityProtAlgorithm=%d pdcp_p->cipheringAlgorithm=%d \n",
LOG_A(RRC, "OSA Reconfig for SRB2 %ld rnti pdcp_p->integrityProtAlgorithm=%d pdcp_p->cipheringAlgorithm=%d \n",
ctxt_pP->rntiMaybeUEid, pdcp_p->integrityProtAlgorithm, pdcp_p->cipheringAlgorithm);
key = PDCP_COLL_KEY_VALUE(ctxt_pP->module_id, ctxt_pP->rntiMaybeUEid, ctxt_pP->enb_flag, DCCH1, SRB_FLAG_YES);
......@@ -4110,7 +4110,7 @@ void rrc_eNB_generate_defaultRRCConnectionReconfiguration(const protocol_ctxt_t
if (h_rc == HASH_TABLE_OK)
{
LOG_A(RRC, "OSA Setting security for SRB2 %d rnti \n", ctxt_pP->rntiMaybeUEid);
LOG_A(RRC, "OSA Setting security for SRB2 %ld rnti \n", ctxt_pP->rntiMaybeUEid);
pdcp_config_set_security(
ctxt_pP,
pdcp_p,
......@@ -4131,7 +4131,7 @@ void rrc_eNB_generate_defaultRRCConnectionReconfiguration(const protocol_ctxt_t
}
else
{
LOG_A(RRC, "OSA Setting security for SRB2 failed %d rnti as SRB1 is not enabled security yet \n", ctxt_pP->rntiMaybeUEid);
LOG_A(RRC, "OSA Setting security for SRB2 failed %ld rnti as SRB1 is not enabled security yet \n", ctxt_pP->rntiMaybeUEid);
}
}
else
......@@ -6259,7 +6259,7 @@ rrc_eNB_configure_rbs_handover(struct rrc_eNB_ue_context_s *ue_context_p, protoc
}
}
// Add a new user (called during the HO procedure)
LOG_I(RRC, "rrc_eNB_target_add_ue_handover module_id %d rnti %d, ciphering algo: %ld, integrity algo: %ld \n", ctxt_pP->module_id, ctxt_pP->rntiMaybeUEid, RC.ss.HOASSecurityCOnfig.Ciphering.ciphering_algorithm,RC.ss.HOASSecurityCOnfig.Integrity.integrity_algorithm);
LOG_I(RRC, "rrc_eNB_target_add_ue_handover module_id %d rnti %ld, ciphering algo: %ld, integrity algo: %ld \n", ctxt_pP->module_id, ctxt_pP->rntiMaybeUEid, RC.ss.HOASSecurityCOnfig.Ciphering.ciphering_algorithm,RC.ss.HOASSecurityCOnfig.Integrity.integrity_algorithm);
if(RC.ss.HOASSecurityCOnfig.isIntegrityInfoPresent && RC.ss.HOASSecurityCOnfig.Integrity.kRRCint)
{
for(int i=16;i<32;i++)
......@@ -7148,7 +7148,7 @@ void rrc_eNB_as_security_configuration_req(
if (NULL == ctxt_pP) {
LOG_A(RRC, "No context to get PdcpCount\n");
}
LOG_A (RRC, "Update PDCP context for RNTI %d integrityProtAlgorithm=%d cipheringAlgorithm=%d \n",
LOG_A (RRC, "Update PDCP context for RNTI %d integrityProtAlgorithm=%ld cipheringAlgorithm=%ld \n",
ASSecConfReq->rnti, ASSecConfReq->Integrity.integrity_algorithm,
ASSecConfReq->Ciphering.ciphering_algorithm);
AssertFatal(ASSecConfReq!=NULL,"AS Security Config Request is NULL \n");
......@@ -8429,13 +8429,13 @@ rrc_eNB_decode_dcch(
break;
case LTE_UL_DCCH_MessageType__c1_PR_ueCapabilityInformation:
LOG_A(RRC, "Processing ueCapabilityInformation UE %x, ue_context_p is NULL\n", ctxt_pP->rntiMaybeUEid);
LOG_A(RRC, "Processing ueCapabilityInformation UE %ld, ue_context_p is NULL\n", ctxt_pP->rntiMaybeUEid);
T(T_ENB_RRC_UE_CAPABILITY_INFORMATION, T_INT(ctxt_pP->module_id), T_INT(ctxt_pP->frame), T_INT(ctxt_pP->subframe), T_INT(ctxt_pP->rntiMaybeUEid));
// to avoid segmentation fault
if(!ue_context_p) {
LOG_I(RRC, "Processing ueCapabilityInformation UE %x, ue_context_p is NULL\n", ctxt_pP->rntiMaybeUEid);
LOG_I(RRC, "Processing ueCapabilityInformation UE %ld, ue_context_p is NULL\n", ctxt_pP->rntiMaybeUEid);
break;
}
......@@ -8456,13 +8456,13 @@ rrc_eNB_decode_dcch(
xer_fprint(stdout, &asn_DEF_LTE_UL_DCCH_Message, (void *)ul_dcch_msg);
}
LOG_A(RRC, "got UE capabilities for UE %x\n", ctxt_pP->rntiMaybeUEid);
LOG_A(RRC, "got UE capabilities for UE %ld\n", ctxt_pP->rntiMaybeUEid);
int eutra_index = -1;
for (i = 0; i < ul_dcch_msg->message.choice.c1.choice.ueCapabilityInformation.criticalExtensions.choice.c1.choice.ueCapabilityInformation_r8.ue_CapabilityRAT_ContainerList.list.count; i++) {
if (ul_dcch_msg->message.choice.c1.choice.ueCapabilityInformation.criticalExtensions.choice.c1.choice.ueCapabilityInformation_r8.ue_CapabilityRAT_ContainerList.list.array[i]->rat_Type ==
LTE_RAT_Type_nr) {
LOG_A(RRC, "got nrUE capabilities for UE %x\n", ctxt_pP->rntiMaybeUEid);
LOG_A(RRC, "got nrUE capabilities for UE %ld\n", ctxt_pP->rntiMaybeUEid);
if(ue_context_p->ue_context.UE_Capability_nr) {
ASN_STRUCT_FREE(asn_DEF_NR_UE_NR_Capability,ue_context_p->ue_context.UE_Capability_nr);
ue_context_p->ue_context.UE_Capability_nr = 0;
......@@ -8537,7 +8537,7 @@ rrc_eNB_decode_dcch(
break;
if (ue_context_p->ue_context.UE_Capability) {
LOG_I(RRC, "freeing old UE capabilities for UE %x\n", ctxt_pP->rntiMaybeUEid);
LOG_I(RRC, "freeing old UE capabilities for UE %ld\n", ctxt_pP->rntiMaybeUEid);
ASN_STRUCT_FREE(asn_DEF_LTE_UE_EUTRA_Capability,
ue_context_p->ue_context.UE_Capability);
ue_context_p->ue_context.UE_Capability = 0;
......@@ -8610,7 +8610,7 @@ rrc_eNB_decode_dcch(
// to avoid segmentation fault
if(!ue_context_p) {
LOG_I(RRC, "Processing ulInformationTransfer UE %x, ue_context_p is NULL\n", ctxt_pP->rntiMaybeUEid);
LOG_I(RRC, "Processing ulInformationTransfer UE %ld, ue_context_p is NULL\n", ctxt_pP->rntiMaybeUEid);
break;
}
......
......@@ -259,7 +259,7 @@ uint8_t do_MIB_NR(gNB_RRC_INST *rrc,uint32_t frame) {
ssb_subcarrier_offset >>= 1; // this assumes 120kHz SCS for SSB and subCarrierSpacingCommon (only option supported by OAI for now)
}
mib->message.choice.mib->ssb_SubcarrierOffset = (rrc->configuration.ssb_SubcarrierOffset)&15;
LOG_A(NR_RRC,"ssb_SubcarrierOffset: %d \n",mib->message.choice.mib->ssb_SubcarrierOffset);
LOG_A(NR_RRC,"ssb_SubcarrierOffset: %ld \n",mib->message.choice.mib->ssb_SubcarrierOffset);
/*
* The SIB1 will be sent in this allocation (Type0-PDCCH) : 38.213, 13-4 Table and 38.213 13-11 to 13-14 tables
......@@ -1427,11 +1427,9 @@ void fill_initial_cellGroupConfig(int uid,
const int CC_id)
{
NR_RLC_BearerConfig_t *rlc_BearerConfig = NULL;
NR_RLC_Config_t *rlc_Config = NULL;
NR_LogicalChannelConfig_t *logicalChannelConfig = NULL;
NR_MAC_CellGroupConfig_t *mac_CellGroupConfig = NULL;
NR_PhysicalCellGroupConfig_t *physicalCellGroupConfig = NULL;
long *logicalChannelGroup = NULL;
cellGroupConfig->cellGroupId = 0;
......@@ -1555,7 +1553,6 @@ int do_RRCSetup(rrc_gNB_ue_context_t *const ue_context_pP,
NR_SRB_ToAddMod_t *SRB1_config = NULL;
NR_PDCP_Config_t *pdcp_Config = NULL;
NR_CellGroupConfig_t *cellGroupConfig = NULL;
char masterCellGroup_buf[1000];
AssertFatal(ue_context_pP != NULL,"ue_context_p is null\n");
gNB_RRC_UE_t *ue_p = &ue_context_pP->ue_context;
......@@ -1949,14 +1946,14 @@ int16_t do_RRCReconfiguration(
return -1;
}
LOG_D(NR_RRC,"[gNB %d] RRCReconfiguration for UE %x Encoded %zd bits (%zd bytes)\n",
LOG_D(NR_RRC,"[gNB %d] RRCReconfiguration for UE %ld Encoded %zd bits (%zd bytes)\n",
ctxt_pP->module_id,
ctxt_pP->rntiMaybeUEid,
enc_rval.encoded,
(enc_rval.encoded+7)/8);
if (enc_rval.encoded == -1) {
LOG_E(NR_RRC,"[gNB %d] ASN1 : RRCReconfiguration encoding failed for UE %x\n",
LOG_E(NR_RRC,"[gNB %d] ASN1 : RRCReconfiguration encoding failed for UE %ld\n",
ctxt_pP->module_id,
ctxt_pP->rntiMaybeUEid);
return(-1);
......
......@@ -335,7 +335,6 @@ int sys_add_reconfig_cell(struct SYSTEM_CTRL_REQ *req)
cellConfig->header.preamble = 0xFEEDC0DE;
cellConfig->header.msg_id = SS_CELL_CONFIG;
cellConfig->header.length = sizeof(proxy_ss_header_t);
MessageDef *msg_p = NULL;
for (int enb_id = 0; enb_id < RC.nb_inst; enb_id++)
{
......@@ -694,7 +693,7 @@ int sys_add_reconfig_cell(struct SYSTEM_CTRL_REQ *req)
}
}
uint8_t msg_queued = 0;
ss_set_timinfo_t tinfo, timer_tinfo;
ss_set_timinfo_t timer_tinfo;
timer_tinfo.sfn = req->Common.TimingInfo.v.SubFrame.SFN.v.Number;
timer_tinfo.sf = req->Common.TimingInfo.v.SubFrame.Subframe.v.Number;
#if 0
......
......@@ -150,7 +150,7 @@ static void ss_send_drb_data(ss_drb_pdu_ind_t *pdu_ind)
bits_copy_to_array((char *)header->SegmentationInfo, 0, (const char *)pdu_ind->sdu, 2);
bits_copy_to_array((char *)header->Reserved, 2, (const char *)pdu_ind->sdu, 6);
data->d = pdu_ind->sdu_size - pdu_header_size;
LOG_A(GNB_APP, "[SS_DRB] Length of RLC PDU received in NR_DRB_COMMON_IND: %lu\n", pdu_ind->sdu_size);
LOG_A(GNB_APP, "[SS_DRB] Length of RLC PDU received in NR_DRB_COMMON_IND: %d\n", pdu_ind->sdu_size);
data->v = CALLOC(1, data->d);
DevAssert(data->v != NULL);
memcpy(data->v, pdu_ind->sdu + pdu_header_size, data->d);
......@@ -169,7 +169,7 @@ static void ss_send_drb_data(ss_drb_pdu_ind_t *pdu_ind)
bits_copy_to_array((char *)header->SegmentOffset.v, 8, (const char *)pdu_ind->sdu, 16);
}
data->d = pdu_ind->sdu_size - pdu_header_size;
LOG_A(GNB_APP, "[SS_DRB] Length of RLC PDU received in NR_DRB_COMMON_IND: %lu\n", pdu_ind->sdu_size);
LOG_A(GNB_APP, "[SS_DRB] Length of RLC PDU received in NR_DRB_COMMON_IND: %d\n", pdu_ind->sdu_size);
data->v = CALLOC(1, data->d);
DevAssert(data->v != NULL);
memcpy(data->v, pdu_ind->sdu + pdu_header_size, data->d);
......
......@@ -692,7 +692,6 @@ static void ss_task_sys_nr_handle_deltaValues(struct NR_SYSTEM_CTRL_REQ *req)
deltaSecondaryBand->DeltaNRf2 = 0;
deltaSecondaryBand->DeltaNRf3 = 0;
deltaSecondaryBand->DeltaNRf4 = 0;
uint16_t mac_inst = 0;
NR_UE_info_t *UE = NULL;
LOG_A(GNB_APP, "[SYS-GNB] absoluteFrequencySSB:%ld\n",
*RC.nrrrc[0]->configuration.scc->downlinkConfigCommon->frequencyInfoDL->absoluteFrequencySSB);
......@@ -1563,7 +1562,7 @@ bool ss_task_sys_nr_handle_pdcpCount(struct NR_SYSTEM_CTRL_REQ *req)
}
else
{
LOG_E(GNB_APP, "it's not an PdcpCount.v.Get for single-rb not all-rbs cmd\r\n", __PRETTY_FUNCTION__, __LINE__);
LOG_E(GNB_APP, "%s line:%d it's not an PdcpCount.v.Get for single-rb not all-rbs cmd\r\n", __PRETTY_FUNCTION__, __LINE__);
return false;
}
......@@ -1598,7 +1597,6 @@ static void sys_5G_send_proxy(void *msg, int msgLen)
IPV4_STR_ADDR_TO_INT_NWBO(local_5G_address,peerIpAddr, " BAD IP Address");
LOG_A(GNB_APP, "Sending CELL CONFIG 5G to Proxy\n");
int8_t *temp = msg;
/** Send to proxy */
sys_send_udp_msg((uint8_t *)msg, msgLen, 0, peerIpAddr, peerPort);
......
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