Commit 73cb183c authored by David Kim's avatar David Kim

Code cleanup

parent e7dd9230
......@@ -426,7 +426,7 @@ int32_t write_file_matlab(const char *fname, const char *vname, void *data, int
# define LOG_W(COMPONENT, ...) do if (1) logMinimal(COMPONENT, 'W', __VA_ARGS__); while (0)
# define LOG_A(COMPONENT, ...) do if (1) logMinimal(COMPONENT, 'A', __VA_ARGS__); while (0) /* logs intended for analysis */
# define LOG_I(COMPONENT, ...) do if (1) logMinimal(COMPONENT, 'I', __VA_ARGS__); while (0)
# define LOG_D(COMPONENT, ...) do if (1) logMinimal(COMPONENT, 'D', __VA_ARGS__); while (0)
# define LOG_D(COMPONENT, ...) do if (0) logMinimal(COMPONENT, 'D', __VA_ARGS__); while (0)
# define LOG_T(COMPONENT, ...) do if (0) logMinimal(COMPONENT, 'T', __VA_ARGS__); while (0)
# define LOG_M(FILE, VECTOR, DATA, LEN, DEC, FORMAT) ((void) 0)
......
......@@ -682,7 +682,6 @@ int phy_procedures_gNB_uespec_RX(PHY_VARS_gNB *gNB, int frame_rx, int slot_rx) {
offset = pucch_pdu->start_symbol_index*gNB->frame_parms.ofdm_symbol_size + (gNB->frame_parms.first_carrier_offset+pucch_pdu->prb_start*12);
power_rxF = signal_energy_nodc(&gNB->common_vars.rxdataF[0][offset],12);
LOG_D(PHY,"frame %d, slot %d: PUCCH signal energy %d\n",frame_rx,slot_rx,power_rxF);
LOG_D(PHY,"num_ucis = %d *expecting 0 since it is index in array also (case 0)\n",num_ucis);
nr_decode_pucch0(gNB,
frame_rx,
......@@ -692,11 +691,6 @@ int phy_procedures_gNB_uespec_RX(PHY_VARS_gNB *gNB, int frame_rx, int slot_rx) {
gNB->UL_INFO.uci_ind.num_ucis += 1;
pucch->active = 0;
if (((uci_pdu_format0->pduBitmap >> 1) & 0x01)){
LOG_I(NR_PHY, "uci_01->harq->num_harq with uci_pdu %p\n", uci_pdu_format0);
LOG_I(NR_PHY, "uci_01->harq->num_harq with uci_pdu %p harq %p\n", uci_pdu_format0, uci_pdu_format0->harq);
LOG_I(NR_PHY, "uci_01->harq->num_harq %u\n", uci_pdu_format0->harq->num_harq);
}
break;
case 2:
num_ucis = gNB->UL_INFO.uci_ind.num_ucis;
......@@ -706,7 +700,6 @@ int phy_procedures_gNB_uespec_RX(PHY_VARS_gNB *gNB, int frame_rx, int slot_rx) {
gNB->uci_pdu_list[num_ucis].pdu_type = NFAPI_NR_UCI_FORMAT_2_3_4_PDU_TYPE;
gNB->uci_pdu_list[num_ucis].pdu_size = sizeof(nfapi_nr_uci_pucch_pdu_format_2_3_4_t);
nfapi_nr_uci_pucch_pdu_format_2_3_4_t *uci_pdu_format2 = &gNB->uci_pdu_list[num_ucis].pucch_pdu_format_2_3_4;
LOG_D(PHY,"num_ucis = %d in case 1\n",num_ucis);
nr_decode_pucch2(gNB,
slot_rx,
......
......@@ -3422,7 +3422,7 @@ void nr_ue_process_mac_pdu(nr_downlink_indication_t *dl_info,
case DL_SCH_LCID_DCCH1:
// check if LCID is valid at current time.
default:
if (get_softmodem_params()->nsa) {
{
// check if LCID is valid at current time.
if (pdu_len < sizeof(NR_MAC_SUBHEADER_SHORT))
return;
......@@ -3472,50 +3472,6 @@ void nr_ue_process_mac_pdu(nr_downlink_indication_t *dl_info,
break;
}
else
{
// check if LCID is valid at current time.
if(((NR_MAC_SUBHEADER_SHORT *)pduP)->F){
//mac_sdu_len |= (uint16_t)(((NR_MAC_SUBHEADER_LONG *)pduP)->L2)<<8;
mac_subheader_len = 3;
mac_sdu_len = ((uint16_t)(((NR_MAC_SUBHEADER_LONG *) pduP)->L1 & 0x7f) << 8)
| ((uint16_t)((NR_MAC_SUBHEADER_LONG *) pduP)->L2 & 0xff);
} else {
mac_sdu_len = (uint16_t)((NR_MAC_SUBHEADER_SHORT *)pduP)->L;
mac_subheader_len = 2;
}
LOG_D(MAC, "[UE %d] Frame %d : DLSCH -> DL-DTCH %d (gNB %d, %d bytes)\n", module_idP, frameP, rx_lcid, gNB_index, mac_sdu_len);
#if defined(ENABLE_MAC_PAYLOAD_DEBUG)
LOG_T(MAC, "[UE %d] First 32 bytes of DLSCH : \n", module_idP);
for (i = 0; i < 32; i++)
LOG_T(MAC, "%x.", (pduP + mac_subheader_len)[i]);
LOG_T(MAC, "\n");
#endif
if (rx_lcid < NB_RB_MAX && rx_lcid >= DL_SCH_LCID_DCCH) {
mac_rlc_data_ind(module_idP,
mac->crnti,
gNB_index,
frameP,
ENB_FLAG_NO,
MBMS_FLAG_NO,
rx_lcid,
(char *) (pduP + mac_subheader_len),
mac_sdu_len,
1,
NULL);
} else {
LOG_E(MAC, "[UE %d] Frame %d : unknown LCID %d (gNB %d)\n", module_idP, frameP, rx_lcid, gNB_index);
}
break;
}
}
pduP += ( mac_subheader_len + mac_ce_len + mac_sdu_len );
pdu_len -= ( mac_subheader_len + mac_ce_len + mac_sdu_len );
......@@ -3695,7 +3651,7 @@ int nr_ue_process_rar(nr_downlink_indication_t *dl_info, NR_UL_TIME_ALIGNMENT_t
if ((mac->crnti == ra->t_crnti) && (get_softmodem_params()->nsa))
{
LOG_D(MAC, "Discarding the received RAR.\n");
LOG_I(MAC, "Discarding the received RAR.\n");
return -1;
}
while (1) {
......
......@@ -433,12 +433,7 @@ void NR_UL_indication(NR_UL_IND_t *UL_info) {
UL_info->frame,UL_info->slot,
module_id,CC_id, gnb_rach_ind_queue.num_items,
gnb_rx_ind_queue.num_items, gnb_crc_ind_queue.num_items);
/*
LOG_I(MAC, "uci_01->harq->num_harq %u with uci_pdu %p harq %p\n",
UL_info->uci_ind.uci_list->pucch_pdu_format_0_1.harq->num_harq,
&UL_info->uci_ind.uci_list->pucch_pdu_format_0_1,
UL_info->uci_ind.uci_list->pucch_pdu_format_0_1.harq);
*/
handle_nr_rach(UL_info);
handle_nr_uci(UL_info);
......
......@@ -148,7 +148,7 @@ typedef struct UE_RRC_INFO_NB_IoT_s {
//Measurement Report not supported in NB-IoT
#define PAYLOAD_SIZE_MAX 1024
#define RRC_BUF_SIZE 8192
#define RRC_BUF_SIZE 512
#define UNDEF_SECURITY_MODE 0xff
#define NO_SECURITY_MODE 0x20
......
......@@ -1033,8 +1033,7 @@ void fill_initial_SpCellConfig(rnti_t rnti,
// one symbol (13)
NR_PUCCH_Resource_t *pucchres0=calloc(1,sizeof(*pucchres0));
pucchres0->pucch_ResourceId=0;
pucchres0->startingPRB=0;//(8+rnti) % curr_bwp;
//pucchres0->startingPRB = (8+rnti) % curr_bwp;
pucchres0->startingPRB = (8+rnti) % curr_bwp;
LOG_D(NR_RRC, "pucchres0->startPRB %ld rnti %d curr_bwp %d\n", pucchres0->startingPRB, rnti, curr_bwp);
pucchres0->intraSlotFrequencyHopping=NULL;
pucchres0->secondHopPRB=NULL;
......
......@@ -945,7 +945,7 @@ void fill_default_secondaryCellGroup(NR_ServingCellConfigCommon_t *servingcellco
long *delay[8];
for (int i=0;i<8;i++) {
delay[i] = calloc(1,sizeof(*delay[i]));
*delay[i] = (i<6) ? (i+2) : 0;//TODO: Needs to check to use i + 6;
*delay[i] = (i<6) ? (i+2) : 0;
ASN_SEQUENCE_ADD(&pucch_Config->dl_DataToUL_ACK->list,delay[i]);
}
pucch_Config->spatialRelationInfoToAddModList = calloc(1,sizeof(*pucch_Config->spatialRelationInfoToAddModList));
......
......@@ -248,18 +248,8 @@ int8_t nr_rrc_ue_process_rrcReconfiguration(const module_id_t module_id, NR_RRCR
if(NR_UE_rrc_inst[module_id].radio_bearer_config == NULL){
NR_UE_rrc_inst[module_id].radio_bearer_config = rrcReconfiguration->criticalExtensions.choice.rrcReconfiguration->radioBearerConfig;
}else{
//protocol_ctxt_t ctxt;
//NR_UE_MAC_INST_t *mac = get_mac_inst(module_id);
//PROTOCOL_CTXT_SET_BY_MODULE_ID(&ctxt, module_id, ENB_FLAG_YES, mac->crnti, 0, 0, 0);
struct NR_RadioBearerConfig *RadioBearerConfig = rrcReconfiguration->criticalExtensions.choice.rrcReconfiguration->radioBearerConfig;
//xer_fprint(stdout, &asn_DEF_NR_RadioBearerConfig, (const void*)RadioBearerConfig);
LOG_D(NR_RRC, "Calling fill_default_rbconfig_ue at %d with: e_rab_id = %ld, drbID = %ld, cipher_algo = %ld, key = %ld \n",
__LINE__, RadioBearerConfig->drb_ToAddModList->list.array[0]->cnAssociation->choice.eps_BearerIdentity,
RadioBearerConfig->drb_ToAddModList->list.array[0]->drb_Identity,
RadioBearerConfig->securityConfig->securityAlgorithmConfig->cipheringAlgorithm,
*RadioBearerConfig->securityConfig->keyToUse);
//nr_rrc_ue_process_RadioBearerConfig(&ctxt, 0, RadioBearerConfig);
if ( LOG_DEBUGFLAG(DEBUG_ASN1) ) {
struct NR_RadioBearerConfig *RadioBearerConfig = rrcReconfiguration->criticalExtensions.choice.rrcReconfiguration->radioBearerConfig;
xer_fprint(stdout, &asn_DEF_NR_RadioBearerConfig, (const void *) RadioBearerConfig);
}
}
......@@ -414,18 +404,6 @@ void process_nsa_message(NR_UE_RRC_INST_t *rrc, nsa_message_t nsa_message_type,
if ( LOG_DEBUGFLAG(DEBUG_ASN1) ) {
xer_fprint(stdout, &asn_DEF_NR_RadioBearerConfig, (const void *) RadioBearerConfig);
}
#if 0
protocol_ctxt_t ctxt;
NR_UE_MAC_INST_t *mac = get_mac_inst(module_id);
PROTOCOL_CTXT_SET_BY_MODULE_ID(&ctxt, module_id, ENB_FLAG_YES, mac->crnti, 0, 0, 0);
xer_fprint(stdout, &asn_DEF_NR_RadioBearerConfig, (const void*)RadioBearerConfig);
LOG_D(NR_RRC, "Calling fill_default_rbconfig_ue at %d with: e_rab_id = %ld, drbID = %ld, cipher_algo = %ld, key = %ld \n",
__LINE__, RadioBearerConfig->drb_ToAddModList->list.array[0]->cnAssociation->choice.eps_BearerIdentity,
RadioBearerConfig->drb_ToAddModList->list.array[0]->drb_Identity,
RadioBearerConfig->securityConfig->securityAlgorithmConfig->cipheringAlgorithm,
*RadioBearerConfig->securityConfig->keyToUse);
nr_rrc_ue_process_RadioBearerConfig(&ctxt, 0, RadioBearerConfig);
#endif
}
break;
......
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