Syncing our OAI merge branch with our internal NSA master branch

This commit is contained in:
Melissa
2021-09-30 23:16:46 +00:00
parent 622410db32
commit 3eafdff63a
59 changed files with 655 additions and 818 deletions
+1 -1
View File
@@ -220,7 +220,7 @@ typedef struct kenb_refresh_req_s {
} kenb_refresh_req_t;
typedef struct nsa_oai_tun_nsa_s {
uint8_t buffer[500]; //Melissa TODO
uint8_t buffer[500];
} nas_oai_tun_nsa_t;
/*
+2 -2
View File
@@ -206,8 +206,8 @@ void *gNB_app_task(void *args_p)
configure_nr_rrc(gnb_id);
}
if (RC.nb_nr_inst > 0) {
//init_pdcp();
if (RC.nb_nr_inst > 0 && !get_softmodem_params()->nsa) {
init_pdcp();
}
if (is_x2ap_enabled() ) { //&& !NODE_IS_DU(RC.rrc[0]->node_type)
+4 -11
View File
@@ -421,7 +421,6 @@ uint16_t set_ra_rnti(NR_UE_MAC_INST_t *mac, fapi_nr_ul_config_prach_pdu *prach_p
uint8_t s_id = prach_pdu->prach_start_symbol;
ra->ra_rnti = 1 + s_id + 14 * t_id + 1120 * f_id + 8960 * ul_carrier_id;
//gNB: ra_rnti = 1 + symbol + (slotP * 14) + (freq_index * 14 * 80) + (ul_carrier_id * 14 * 80 * 8);
LOG_D(MAC, "Computed ra_RNTI is %x \n", ra->ra_rnti);
@@ -543,7 +542,6 @@ uint8_t nr_ue_get_rach(NR_PRACH_RESOURCES_t *prach_resources,
NR_UE_MAC_INST_t *mac = get_mac_inst(mod_id);
RA_config_t *ra = &mac->ra;
uint8_t mac_sdus[MAX_NR_ULSCH_PAYLOAD_BYTES];
uint8_t lcid = UL_SCH_LCID_CCCH;
uint8_t *payload;
uint16_t size_sdu = 0;
unsigned short post_padding;
@@ -554,9 +552,7 @@ uint8_t nr_ue_get_rach(NR_PRACH_RESOURCES_t *prach_resources,
NR_RACH_ConfigGeneric_t *rach_ConfigGeneric = &setup->rach_ConfigGeneric;
NR_RACH_ConfigDedicated_t *rach_ConfigDedicated = ra->rach_ConfigDedicated;
uint8_t sdu_lcids[NB_RB_MAX] = {0};
uint16_t sdu_lengths[NB_RB_MAX] = {0};
int num_sdus = 0;
int offset = 0;
int TBS_bytes = 848;
int header_length_total=0;
@@ -564,8 +560,8 @@ uint8_t nr_ue_get_rach(NR_PRACH_RESOURCES_t *prach_resources,
// Delay init RA procedure to allow the convergence of the IIR filter on PRACH noise measurements at gNB side
if (!prach_resources->init_msg1) {
if ( (mac->common_configuration_complete>0 || get_softmodem_params()->do_ra==1 || get_softmodem_params()->nsa) &&
((MAX_FRAME_NUMBER + frame - prach_resources->sync_frame) % MAX_FRAME_NUMBER) > 150){
if ((mac->common_configuration_complete > 0 || get_softmodem_params()->do_ra || get_softmodem_params()->nsa) &&
((MAX_FRAME_NUMBER + frame - prach_resources->sync_frame) % MAX_FRAME_NUMBER) > 150) {
prach_resources->init_msg1 = 1;
} else {
LOG_D(NR_MAC,"PRACH Condition not met: frame %d, prach_resources->sync_frame %d\n",frame,prach_resources->sync_frame);
@@ -574,7 +570,7 @@ uint8_t nr_ue_get_rach(NR_PRACH_RESOURCES_t *prach_resources,
}
LOG_D(NR_MAC,"frame %d prach_resources->init_msg1 %d, ra->ra_state %d, ra->RA_active %d\n",
frame,prach_resources->init_msg1,ra->ra_state,ra->RA_active);
frame, prach_resources->init_msg1, ra->ra_state, ra->RA_active);
if (prach_resources->init_msg1 && ra->ra_state != RA_SUCCEEDED) {
@@ -586,9 +582,7 @@ uint8_t nr_ue_get_rach(NR_PRACH_RESOURCES_t *prach_resources,
int TBS_max = 848; //8 + sizeof(NR_MAC_SUBHEADER_SHORT) + sizeof(NR_MAC_SUBHEADER_SHORT);
payload = (uint8_t*) mac->CCCH_pdu.payload;
mac_ce_len = 0;
num_sdus = 1;
post_padding = 1;
sdu_lcids[0] = lcid;
// initialisation by RRC
@@ -605,8 +599,7 @@ uint8_t nr_ue_get_rach(NR_PRACH_RESOURCES_t *prach_resources,
mac_sdus[i] = (unsigned char) (lrand48()&0xff);
}
//Sending SDUs with size 1
//Initialize elements of sdu_lcids and sdu_lengths
sdu_lcids[0] = lcid;
//Initialize elements of sdu_lengths
sdu_lengths[0] = TBS_bytes - 3 - post_padding - mac_ce_len;
header_length_total += 2 + (sdu_lengths[0] >= 128);
size_sdu += sdu_lengths[0];
+2 -4
View File
@@ -539,7 +539,7 @@ int8_t nr_ue_process_dci(module_id_t module_id, int cc_id, uint8_t gNB_index, fr
else if (mac->scc_SIB) n_RB_DLBWP = NRRIV2BW(mac->scc_SIB->uplinkConfigCommon->initialUplinkBWP.genericParameters.locationAndBandwidth,MAX_BWP_SIZE);
else n_RB_DLBWP = mac->type0_PDCCH_CSS_config.num_rbs;
LOG_I(MAC, "In %s: Processing received DCI format %s (DL BWP %d)\n", __FUNCTION__, dci_formats[dci_format], n_RB_DLBWP);
LOG_D(MAC, "In %s: Processing received DCI format %s (DL BWP %d)\n", __FUNCTION__, dci_formats[dci_format], n_RB_DLBWP);
switch(dci_format){
case NR_UL_DCI_FORMAT_0_0: {
@@ -3379,7 +3379,7 @@ void nr_ue_process_mac_pdu(nr_downlink_indication_t *dl_info,
mac_subheader_len = 2;
}
LOG_I(MAC, "Melissa Elkadi [UE %d] Frame %d : DLSCH -> DL-DTCH %d (gNB %d, %d bytes)\n", module_idP, frameP, rx_lcid, gNB_index, mac_sdu_len);
LOG_D(NR_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);
@@ -3572,8 +3572,6 @@ int nr_ue_process_rar(nr_downlink_indication_t *dl_info, NR_UL_TIME_ALIGNMENT_t
return 0;
}
int cc_id = dl_info->cc_id;
uint8_t gNB_id = dl_info->gNB_index;
NR_UE_MAC_INST_t *mac = get_mac_inst(mod_id);
RA_config_t *ra = &mac->ra;
uint8_t n_subPDUs = 0; // number of RAR payloads
+1 -1
View File
@@ -1893,7 +1893,7 @@ void nr_ue_prach_scheduler(module_id_t module_idP, frame_t frameP, sub_frame_t s
prach_config_pdu = &ul_config->ul_config_list[ul_config->number_pdus].prach_config_pdu;
memset(prach_config_pdu, 0, sizeof(fapi_nr_ul_config_prach_pdu));
ul_config->number_pdus += 1; //Melissa Elkadi come back here!
ul_config->number_pdus += 1;
fill_ul_config(ul_config, frameP, slotP, FAPI_NR_UL_CONFIG_TYPE_PRACH);
LOG_D(PHY, "In %s: (%p) %d UL PDUs:\n", __FUNCTION__, ul_config, ul_config->number_pdus);
@@ -356,7 +356,6 @@ void gNB_dlsch_ulsch_scheduler(module_id_t module_idP,
const int bwp_id = 1;
gNB_MAC_INST *gNB = RC.nrmac[module_idP];
NR_COMMON_channels_t *cc = gNB->common_channels;
NR_ServingCellConfigCommon_t *scc = cc->ServingCellConfigCommon;
@@ -288,6 +288,7 @@ void schedule_nr_prach(module_id_t module_idP, frame_t frameP, sub_frame_t slotP
}else if (N_RA_slot <= 1) { //1 PRACH slot in a subframe
slot_index = 0;
}
UL_tti_req->SFN = frameP;
UL_tti_req->Slot = slotP;
for (int fdm_index=0; fdm_index < fdm; fdm_index++) { // one structure per frequency domain occasion
@@ -135,7 +135,6 @@ void calculate_preferred_dl_tda(module_id_t module_id, const NR_BWP_Downlink_t *
}
}
// Compute and write all MAC CEs and subheaders, and return number of written
// bytes
int nr_write_ce_dlsch_pdu(module_id_t module_idP,
@@ -883,7 +882,7 @@ void nr_schedule_ue_spec(module_id_t module_id,
const int coresetid = bwp ? sched_ctrl->coreset->controlResourceSetId : gNB_mac->sched_ctrlCommon->coreset->controlResourceSetId;
nfapi_nr_dl_tti_pdcch_pdu_rel15_t *pdcch_pdu = gNB_mac->pdcch_pdu_idx[CC_id][bwpid][coresetid];
if (!pdcch_pdu) {
LOG_I(NR_MAC, "creating pdcch pdu, pdcch_pdu = NULL. \n");
LOG_D(NR_MAC, "creating pdcch pdu, pdcch_pdu = NULL. \n");
nfapi_nr_dl_tti_request_pdu_t *dl_tti_pdcch_pdu = &dl_req->dl_tti_pdu_list[dl_req->nPDUs];
memset(dl_tti_pdcch_pdu, 0, sizeof(nfapi_nr_dl_tti_request_pdu_t));
dl_tti_pdcch_pdu->PDUType = NFAPI_NR_DL_TTI_PDCCH_PDU_TYPE;
@@ -1086,8 +1086,8 @@ void handle_nr_uci_pucch_0_1(module_id_t mod_id,
DevAssert(harq->is_waiting);
const int8_t pid = sched_ctrl->feedback_dl_harq.head;
remove_front_nr_list(&sched_ctrl->feedback_dl_harq);
/* Melissa: according to nfapi_nr_interface_scf.h, harq_value = 0 is a pass
(check below was for harq_value == 1 in develop branch) */
/* According to nfapi_nr_interface_scf.h, harq_value = 0 is a pass
(The check below was for harq_value == 1 in the develop branch) */
handle_dl_harq(mod_id, UE_id, pid, harq_value == 0 && harq_confidence == 0);
}
}
@@ -1273,7 +1273,6 @@ int nr_acknack_scheduling(int mod_id,
* scheduled a lot and used all AckNacks, pucch->frame might have been
* wrapped around to next frame */
if (frame != pucch->frame || pucch->ul_slot < first_ul_slot_tdd) {
AssertFatal(pucch->sr_flag + pucch->dai_c == 0,
"expected no SR/AckNack for UE %d in %4d.%2d, but has %d/%d for %4d.%2d\n",
UE_id, frame, slot, pucch->sr_flag, pucch->dai_c, pucch->frame, pucch->ul_slot);
@@ -812,6 +812,14 @@ void nr_rx_sdu(const module_id_t gnb_mod_idP,
if( (frameP!=ra->Msg3_frame) || (slotP!=ra->Msg3_slot))
continue;
// for CFRA (NSA) do not schedule retransmission of msg3
if (ra->cfra) {
LOG_W(NR_MAC, "Random Access %i failed at state %i (NSA msg3 reception failed)\n", i, ra->state);
nr_mac_remove_ra_rnti(gnb_mod_idP, ra->rnti);
nr_clear_ra_proc(gnb_mod_idP, CC_idP, frameP, ra);
return;
}
if (ra->msg3_round >= MAX_HARQ_ROUNDS - 1) {
LOG_W(NR_MAC, "Random Access %i failed at state %i (Reached msg3 max harq rounds)\n", i, ra->state);
nr_mac_remove_ra_rnti(gnb_mod_idP, ra->rnti);
@@ -1458,6 +1466,7 @@ void nr_schedule_ulsch(module_id_t module_id, frame_t frame, sub_frame_t slot)
sched_ctrl->sched_ul_bytes,
sched_ctrl->estimated_ul_buffer - sched_ctrl->sched_ul_bytes);
/* PUSCH in a later slot, but corresponding DCI now! */
nfapi_nr_ul_tti_request_t *future_ul_tti_req = &RC.nrmac[module_id]->UL_tti_req_ahead[0][sched_pusch->slot];
AssertFatal(future_ul_tti_req->SFN == sched_pusch->frame
+1 -3
View File
@@ -45,6 +45,7 @@
#include "LTE_MBMS-SessionInfoList-r9.h"
#include "LTE_PMCH-InfoList-r9.h"
typedef rlc_op_status_t (*send_rlc_data_req_func_t)(const protocol_ctxt_t *const,
const srb_flag_t, const MBMS_flag_t,
const rb_id_t, const mui_t,
@@ -91,9 +92,6 @@ extern int pdcp_instance_cnt;
int init_pdcp_thread(void);
void cleanup_pdcp_thread(void);
// Global variable to identify each UE. Updated in main() of lte-uesoftmodem.c
//extern uint16_t ue_id_g;
extern uint32_t Pdcp_stats_tx_window_ms[MAX_eNB][MAX_MOBILES_PER_ENB];
extern uint32_t Pdcp_stats_tx_bytes[MAX_eNB][MAX_MOBILES_PER_ENB][NB_RB_MAX];
extern uint32_t Pdcp_stats_tx_bytes_w[MAX_eNB][MAX_MOBILES_PER_ENB][NB_RB_MAX];
+7 -6
View File
@@ -89,7 +89,7 @@ extern struct msghdr nas_msg_rx;
extern int gtpv1u_new_data_req( uint8_t enb_module_idP, rnti_t ue_rntiP, uint8_t rab_idP, uint8_t *buffer_pP, uint32_t buf_lenP, uint32_t buf_offsetP);
uint16_t ue_id_g;// global variable to identify ue id for each ue. Change happens only in main function of lte-uesoftmodem.c
uint16_t ue_id_g; // Global variable to identify the ID for each UE. It is updated in main() of lte-uesoftmodem.c
void debug_pdcp_pc5s_sdu(sidelink_pc5s_element *sl_pc5s_msg, char *title) {
LOG_I(PDCP,"%s: \nPC5S message, header traffic_type: %d)\n", title, sl_pc5s_msg->pc5s_header.traffic_type);
@@ -147,7 +147,7 @@ int pdcp_fifo_flush_sdus(const protocol_ctxt_t *const ctxt_pP) {
nas_nlh_tx->nlmsg_len = sizeToWrite;
ret = sendmsg(nas_sock_fd[0],&nas_msg_tx,0);
} // PDCP_USE_NETLINK
AssertFatal(ret >= 0,"[PDCP_FIFOS] pdcp_fifo_flush_sdus (errno: %d %s), nas_sock_fd[0]: %d\n", errno, strerror(errno), nas_sock_fd[0]);
if( LOG_DEBUGFLAG(DEBUG_PDCP) )
@@ -562,8 +562,8 @@ int pdcp_fifo_read_input_sdus_fromnetlinksock (const protocol_ctxt_t *const ctx
pdcp_read_header_g.data_size,
(unsigned char *)NLMSG_DATA(nas_nlh_rx),
PDCP_TRANSMISSION_MODE_DATA,
(NFAPI_MODE == NFAPI_UE_STUB_PNF || NFAPI_MODE == NFAPI_MODE_STANDALONE_PNF)?NULL:&pdcp_read_header_g.sourceL2Id,
(NFAPI_MODE == NFAPI_UE_STUB_PNF || NFAPI_MODE == NFAPI_MODE_STANDALONE_PNF)?NULL:&pdcp_read_header_g.destinationL2Id
(NFAPI_MODE == NFAPI_UE_STUB_PNF || NFAPI_MODE == NFAPI_MODE_STANDALONE_PNF) ? NULL : &pdcp_read_header_g.sourceL2Id,
(NFAPI_MODE == NFAPI_UE_STUB_PNF || NFAPI_MODE == NFAPI_MODE_STANDALONE_PNF) ? NULL : &pdcp_read_header_g.destinationL2Id
);
} else { /* else of h_rc == HASH_TABLE_OK */
MSC_LOG_RX_DISCARDED_MESSAGE(
@@ -607,8 +607,8 @@ int pdcp_fifo_read_input_sdus_fromnetlinksock (const protocol_ctxt_t *const ctx
pdcp_read_header_g.data_size,
(unsigned char *)NLMSG_DATA(nas_nlh_rx),
PDCP_TRANSMISSION_MODE_DATA,
(NFAPI_MODE == NFAPI_UE_STUB_PNF|| NFAPI_MODE == NFAPI_MODE_STANDALONE_PNF) ? NULL :&pdcp_read_header_g.sourceL2Id,
(NFAPI_MODE == NFAPI_UE_STUB_PNF|| NFAPI_MODE == NFAPI_MODE_STANDALONE_PNF) ? NULL :&pdcp_read_header_g.destinationL2Id
(NFAPI_MODE == NFAPI_UE_STUB_PNF|| NFAPI_MODE == NFAPI_MODE_STANDALONE_PNF) ? NULL : &pdcp_read_header_g.sourceL2Id,
(NFAPI_MODE == NFAPI_UE_STUB_PNF|| NFAPI_MODE == NFAPI_MODE_STANDALONE_PNF) ? NULL : &pdcp_read_header_g.destinationL2Id
);
} /* rab_id == 0 */
} /*pdcp_read_state_g != 0 */
@@ -875,3 +875,4 @@ pdcp_pc5_socket_init() {
exit(1);
}
}
+1 -8
View File
@@ -42,10 +42,7 @@ void nr_pdcp_entity_srb_recv_sdu(nr_pdcp_entity_t *_entity, char *buffer, int si
nr_pdcp_entity_srb_t *entity = (nr_pdcp_entity_srb_t *)_entity;
int sn;
char buf[size+6];
char buf_mel[1024];
hexdump(buffer, size, buf_mel, sizeof(buf_mel));
LOG_I(PDCP, "Melissa Elkadi in %s, this is hexdump of pdu %s recevied in PDCP layer directly\n",
__FUNCTION__, buf_mel);
sn = entity->common.next_nr_pdcp_tx_sn;
entity->common.next_nr_pdcp_tx_sn++;
@@ -65,10 +62,6 @@ void nr_pdcp_entity_srb_recv_sdu(nr_pdcp_entity_t *_entity, char *buffer, int si
entity->common.deliver_pdu(entity->common.deliver_pdu_data,
(nr_pdcp_entity_t *)entity, buf, size+6, sdu_id);
char buf_meli[1024];
hexdump(buf, size + 3, buf_meli, sizeof(buf_meli));
LOG_I(PDCP, "Melissa Elkadi in %s, this is hexdump of pdu %s After delivering to RLC\n",
__FUNCTION__, buf_meli);
}
void nr_pdcp_entity_srb_set_integrity_key(nr_pdcp_entity_t *_entity, char *key)
+2 -12
View File
@@ -296,9 +296,6 @@ static void *ue_tun_read_thread(void *_)
}
LOG_D(PDCP, "%s(): nas_sock_fd read returns len %d\n", __func__, len);
char buffer[1024];
hexdump(rx_buf, len, buffer, sizeof(buffer));
LOG_I(MAC, "Melissa Elkadi, this is hexdump of pdu %s from tunnel interface\n", buffer);
nr_pdcp_manager_lock(nr_pdcp_ue_manager);
rnti = nr_pdcp_get_first_rnti(nr_pdcp_ue_manager);
@@ -416,9 +413,6 @@ uint64_t nr_pdcp_module_init(uint64_t _pdcp_optmask, int id)
nas_getparams();
if(UE_NAS_USE_TUN) {
/* Melissa TODO: Brute force changes made below to allow nr-UE to have unique tunnel interfaces.
When the NODE_NUMBER param is not used to determine functionality and LTE tunnel
interfaces, we should update the netlink_init_tun() and nas_config() calls below as well. */
int num_if = (NFAPI_MODE == NFAPI_UE_STUB_PNF || IS_SOFTMODEM_SIML1 || NFAPI_MODE == NFAPI_MODE_STANDALONE_PNF)? MAX_MOBILES_PER_ENB : 1;
netlink_init_tun("nrue", num_if, id);
//Add --nr-ip-over-lte option check for next line
@@ -836,10 +830,9 @@ static void add_drb_am(int is_gnb, int rnti, struct NR_DRB_ToAddMod *s,
nr_pdcp_manager_lock(nr_pdcp_ue_manager);
ue = nr_pdcp_manager_get_ue(nr_pdcp_ue_manager, rnti);
if (ue->drb[drb_id-1] != NULL) {
LOG_I(PDCP, "Melissa Elkadi %s:%d:%s: warning DRB %d already exist for ue %d, do nothing\n",
LOG_D(PDCP, "%s:%d:%s: warning DRB %d already exist for ue %d, do nothing\n",
__FILE__, __LINE__, __FUNCTION__, drb_id, rnti);
} else {
LOG_I(PDCP, "%s:%d:%s: Melissa Elkadi, we will call deliver_sdu_drb\n", __FILE__, __LINE__, __FUNCTION__);
pdcp_drb = new_nr_pdcp_entity(NR_PDCP_DRB_AM, is_gnb, drb_id,pdusession_id,has_sdap,
has_sdapULheader,has_sdapDLheader,
deliver_sdu_drb, ue, deliver_pdu_drb, ue,
@@ -1207,10 +1200,7 @@ static boolean_t pdcp_data_req_drb(
nr_pdcp_manager_unlock(nr_pdcp_ue_manager);
return 0;
}
char buffer[1024];
hexdump((char *)sdu_buffer, sdu_buffer_size, buffer, sizeof(buffer));
LOG_I(PDCP, "Melissa Elkadi in %s, this is hexdump of pdu %s from tunnel interface in PDCP layer\n",
__FUNCTION__, buffer);
rb->recv_sdu(rb, (char *)sdu_buffer, sdu_buffer_size, muiP);
nr_pdcp_manager_unlock(nr_pdcp_ue_manager);
+4 -30
View File
@@ -204,7 +204,6 @@ static void reassemble_and_deliver(nr_rlc_entity_am_t *entity, int sn)
int so = 0;
int bad_sdu = 0;
LOG_I(RLC, "Melissa Elkadi, we are in %s(): at %d\n", __FUNCTION__, __LINE__);
/* go to first segment of sn */
pdu = entity->rx_list;
while (pdu->sn != sn)
@@ -232,7 +231,6 @@ static void reassemble_and_deliver(nr_rlc_entity_am_t *entity, int sn)
return;
/* deliver */
LOG_I(RLC, "Melissa Elkadi, we are in %s(): at %d\n", __FUNCTION__, __LINE__);
entity->common.deliver_sdu(entity->common.deliver_sdu_data,
(nr_rlc_entity_t *)entity,
sdu, so);
@@ -246,16 +244,13 @@ static void reception_actions(nr_rlc_entity_am_t *entity, nr_rlc_pdu_t *pdu)
entity->rx_next_highest = (x + 1) % entity->sn_modulus;
/* todo: room for optimization: we can run through rx_list only once */
LOG_I(RLC, "Melissa Elkadi, checking if sdu_full is true %s()\n", __FUNCTION__);
if (sdu_full(entity, x)) {
LOG_I(RLC, "Melissa Elkadi, we are in %s(): at %d\n", __FUNCTION__, __LINE__);
reassemble_and_deliver(entity, x);
if (x == entity->rx_highest_status) {
int rx_highest_status = entity->rx_highest_status;
while (sdu_delivered(entity, rx_highest_status))
rx_highest_status = (rx_highest_status + 1) % entity->sn_modulus;
LOG_I(RLC, "Melissa Elkadi, we are in %s(): at %d\n", __FUNCTION__, __LINE__);
entity->rx_highest_status = rx_highest_status;
}
@@ -278,10 +273,8 @@ static void reception_actions(nr_rlc_entity_am_t *entity, nr_rlc_pdu_t *pdu)
entity->rx_next = rx_next;
}
}
LOG_I(RLC, "Melissa Elkadi, we are in %s(): at %d\n", __FUNCTION__, __LINE__);
if (entity->t_reassembly_start) {
LOG_I(RLC, "Melissa Elkadi, we are in %s(): at %d\n", __FUNCTION__, __LINE__);
if (entity->rx_next_status_trigger == entity->rx_next ||
(entity->rx_next_status_trigger == (entity->rx_next + 1)
% entity->sn_modulus &&
@@ -294,7 +287,6 @@ static void reception_actions(nr_rlc_entity_am_t *entity, nr_rlc_pdu_t *pdu)
}
if (entity->t_reassembly_start == 0) {
LOG_I(RLC, "Melissa Elkadi, we are in %s(): at %d\n", __FUNCTION__, __LINE__);
if (sn_compare_rx(entity, entity->rx_next_highest,
(entity->rx_next + 1) % entity->sn_modulus) > 0 ||
(entity->rx_next_highest == (entity->rx_next + 1)
@@ -552,13 +544,9 @@ void nr_rlc_entity_am_recv_pdu(nr_rlc_entity_t *_entity,
int control_e2;
int control_e3;
unsigned char sn_set[32768]; /* used to dec retx_count only once per sdu */
char buf_3[1024];
hexdump(buffer, size, buf_3, sizeof(buf_3));
LOG_I(MAC, "Melissa Elkadi, %s in %s():%d\n",
buf_3, __FUNCTION__, __LINE__);
nr_rlc_pdu_decoder_init(&decoder, buffer, size);
dc = nr_rlc_pdu_decoder_get_bits(&decoder, 1); R(decoder);
LOG_I(RLC, "Melissa Elkadi, we are here %s(): %d. dc = %d\n", __FUNCTION__, __LINE__, dc);
if (dc == 0) goto control;
/* data PDU */
@@ -622,7 +610,6 @@ void nr_rlc_entity_am_recv_pdu(nr_rlc_entity_t *_entity,
entity->rx_list, pdu);
/* do reception actions (38.322 5.2.3.2.3) */
LOG_I(RLC, "Melissa Elkadi, we are calling reception_actions from %s()\n", __FUNCTION__);
reception_actions(entity, pdu);
if (p) {
@@ -831,20 +818,9 @@ static int serialize_sdu(nr_rlc_entity_am_t *entity,
nr_rlc_pdu_encoder_put_bits(&encoder, 1, 1); /* D/C: 1 = data */
nr_rlc_pdu_encoder_put_bits(&encoder, 0, 1); /* P: reserve, set later */
char buf_1[1024];
hexdump(sdu->sdu->data, sdu->size, buf_1, sizeof(buf_1));
LOG_I(MAC, "Melissa Elkadi, %s in %s():%d\n",
buf_1, __FUNCTION__, __LINE__);
nr_rlc_pdu_encoder_put_bits(&encoder, 1-sdu->is_first,1);/* 1st bit of SI */
char buf_2[1024];
hexdump(sdu->sdu->data, sdu->size, buf_2, sizeof(buf_2));
LOG_I(MAC, "Melissa Elkadi, %s in %s():%d\n",
buf_2, __FUNCTION__, __LINE__);
nr_rlc_pdu_encoder_put_bits(&encoder, 1-sdu->is_last,1); /* 2nd bit of SI */
char buf_3[1024];
hexdump(sdu->sdu->data, sdu->size, buf_3, sizeof(buf_3));
LOG_I(MAC, "Melissa Elkadi, %s in %s():%d\n",
buf_3, __FUNCTION__, __LINE__);
if (entity->sn_field_length == 18)
nr_rlc_pdu_encoder_put_bits(&encoder, 0, 2); /* R */
@@ -860,10 +836,7 @@ static int serialize_sdu(nr_rlc_entity_am_t *entity,
if (p)
include_poll(entity, buffer);
char buf[1024];
hexdump(buffer + encoder.byte, sdu->size, buf, sizeof(buf));
LOG_I(MAC, "Melissa Elkadi, this is hexdump of pdu %s right after calling generate_pdu in %s\n",
buf, __FUNCTION__);
return encoder.byte + sdu->size;
}
@@ -1599,6 +1572,7 @@ int nr_rlc_entity_am_generate_pdu(nr_rlc_entity_t *_entity,
if (ret != 0)
return ret;
}
return generate_tx_pdu(entity, buffer, size);
}
@@ -104,7 +104,6 @@ int nr_rlc_entity_tm_generate_pdu(nr_rlc_entity_t *_entity,
char *buffer, int size)
{
nr_rlc_entity_tm_t *entity = (nr_rlc_entity_tm_t *)_entity;
LOG_I(MAC, "Melissa Elkadi, in %s(): %d\n", __FUNCTION__, __LINE__);
return generate_tx_pdu(entity, buffer, size);
}
+3 -35
View File
@@ -353,20 +353,9 @@ static int serialize_sdu(nr_rlc_entity_um_t *entity,
/* generate header */
nr_rlc_pdu_encoder_init(&encoder, buffer, bufsize);
char buf_1[1024];
hexdump(sdu->sdu->data, sdu->size, buf_1, sizeof(buf_1));
LOG_I(MAC, "Melissa Elkadi, %s in %s():%d\n",
buf_1, __FUNCTION__, __LINE__);
nr_rlc_pdu_encoder_put_bits(&encoder, 1-sdu->is_first,1);/* 1st bit of SI */
char buf_2[1024];
hexdump(sdu->sdu->data, sdu->size, buf_2, sizeof(buf_2));
LOG_I(MAC, "Melissa Elkadi, %s in %s():%d\n",
buf_2, __FUNCTION__, __LINE__);
nr_rlc_pdu_encoder_put_bits(&encoder, 1-sdu->is_last,1); /* 2nd bit of SI */
char buf_3[1024];
hexdump(sdu->sdu->data, sdu->size, buf_3, sizeof(buf_3));
LOG_I(MAC, "Melissa Elkadi, %s in %s():%d\n",
buf_3, __FUNCTION__, __LINE__);
/* SN, if required */
if (sdu->is_first == 1 && sdu->is_last == 1) {
nr_rlc_pdu_encoder_put_bits(&encoder, 0, 6); /* R */
@@ -380,23 +369,9 @@ static int serialize_sdu(nr_rlc_entity_um_t *entity,
if (!sdu->is_first)
nr_rlc_pdu_encoder_put_bits(&encoder, sdu->so, 16); /* SO */
char buf_sdu[1024];
hexdump(sdu->sdu->data, sdu->size, buf_sdu, sizeof(buf_sdu));
LOG_I(MAC, "Melissa Elkadi, this is hexdump of sdu->data %s in %s\n",
buf_sdu, __FUNCTION__);
/* data */
memcpy(buffer + encoder.byte, sdu->sdu->data + sdu->so, sdu->size);
char buf_5[1024];
hexdump(buffer, sdu->size, buf_5, sizeof(buf_5));
LOG_I(MAC, "Melissa Elkadi, this is hexdump of pdu %s right after memcpy of just buffer %s\n",
buf_5, __FUNCTION__);
char buf[1024];
hexdump(buffer + encoder.byte, sdu->size, buf, sizeof(buf));
LOG_I(MAC, "Melissa Elkadi, this is hexdump of pdu %s right after memcpy sdu into buffer in %s\n",
buf, __FUNCTION__);
return encoder.byte + sdu->size;
}
@@ -504,15 +479,9 @@ static int generate_tx_pdu(nr_rlc_entity_um_t *entity, char *buffer, int size)
/* update tx_next if the SDU is an SDU segment and is the last */
if (!sdu->is_first && sdu->is_last)
entity->tx_next = (entity->tx_next + 1) % entity->sn_modulus;
char buf[1024];
hexdump(buffer, sdu->size, buf, sizeof(buf));
LOG_I(MAC, "Melissa Elkadi, this is hexdump of pdu %s right before calling serialize_sdu in %s\n",
buf, __FUNCTION__);
ret = serialize_sdu(entity, sdu, buffer, size);
char buf_1[1024];
hexdump(buffer, size, buf_1, sizeof(buf_1));
LOG_I(MAC, "Melissa Elkadi, this is hexdump of pdu %s right after calling serialize_sdu in %s\n",
buf_1, __FUNCTION__);
entity->tx_size -= sdu->size;
nr_rlc_free_sdu_segment(sdu);
@@ -554,7 +523,6 @@ int nr_rlc_entity_um_generate_pdu(nr_rlc_entity_t *_entity,
char *buffer, int size)
{
nr_rlc_entity_um_t *entity = (nr_rlc_entity_um_t *)_entity;
LOG_I(MAC, "Melissa Elkadi, in %s(): %d\n", __FUNCTION__, __LINE__);
return generate_tx_pdu(entity, buffer, size);
}
+1 -5
View File
@@ -218,10 +218,6 @@ tbs_size_t mac_rlc_data_req(
rb->set_time(rb, nr_rlc_current_time);
maxsize = tb_sizeP;
ret = rb->generate_pdu(rb, buffer_pP, maxsize);
char buffer[1024];
hexdump(buffer_pP, ret, buffer, sizeof(buffer));
LOG_I(MAC, "Melissa Elkadi, this is hexdump of pdu %s right after calling generate_pdu in %s\n",
buffer, __FUNCTION__);
} else {
ret = 0;
}
@@ -508,7 +504,7 @@ rb_found:
return;
}
}
LOG_I(PDCP, "Melissa Elkadi we are calling PDCP layer from RLC in %s\n", __FUNCTION__);
LOG_D(PDCP, "Calling PDCP layer from RLC in %s\n", __FUNCTION__);
if (!pdcp_data_ind(&ctx, is_srb, 0, rb_id, size, memblock)) {
LOG_E(RLC, "%s:%d:%s: ERROR: pdcp_data_ind failed\n", __FILE__, __LINE__, __FUNCTION__);
/* what to do in case of failure? for the moment: nothing */
+1 -6
View File
@@ -106,16 +106,11 @@ void nr_rlc_pdu_decoder_init(nr_rlc_pdu_decoder_t *decoder,
static int get_bit(nr_rlc_pdu_decoder_t *decoder)
{
int ret;
LOG_I(RLC, "Melissa Elkadi, in %s():. bytes = %d size = %d, bit %d, shifted bit %d \n",
__FUNCTION__, decoder->byte, decoder->size, decoder->bit, (7-decoder->bit));
if (decoder->byte >= decoder->size) {
decoder->error = 1;
return 0;
}
LOG_I(RLC, "Melissa Elkadi, in %s():. (%d >> (7 - decoder->bit)) & 1 = %d (returned val) \n",
__FUNCTION__,
decoder->buffer[decoder->byte],
((decoder->buffer[decoder->byte] >> (7 - decoder->bit)) & 1));
ret = (decoder->buffer[decoder->byte] >> (7 - decoder->bit)) & 1;
+6 -6
View File
@@ -320,9 +320,9 @@ static void copy_tx_data_req_to_dl_info(nr_downlink_indication_t *dl_info, nfapi
memcpy(pdu, ptr, pdu_list->TLVs[j].length);
pdu += pdu_list->TLVs[j].length;
}
dl_info->rx_ind->rx_indication_body[i].pdsch_pdu.ack_nack = 1; // Melissa we will come back during channel modelling
dl_info->rx_ind->rx_indication_body[i].pdsch_pdu.ack_nack = 1;
dl_info->rx_ind->rx_indication_body[i].pdsch_pdu.pdu_length = length;
if (tx_data_request->Slot == 7 && mac->ra.ra_state <= WAIT_RAR) { //Melissa this means we have an RAR, sorta hacky though
if (tx_data_request->Slot == 7 && mac->ra.ra_state <= WAIT_RAR) {
dl_info->rx_ind->rx_indication_body[i].pdu_type = FAPI_NR_RX_PDU_TYPE_RAR;
}
else {
@@ -539,7 +539,7 @@ static void check_and_process_dci(nfapi_nr_dl_tti_request_t *dl_tti_request,
nr_uplink_indication_t ul_info;
memset(&ul_info, 0, sizeof(ul_info));
int slots_per_frame = 20; //30 kHZ subcarrier spacing
int slot_ahead = 2; // Melissa lets make this dynamic
int slot_ahead = 2; // TODO: Make this dynamic
ul_info.frame_rx = frame;
ul_info.slot_rx = slot;
ul_info.slot_tx = (slot + slot_ahead) % slots_per_frame;
@@ -551,7 +551,7 @@ static void check_and_process_dci(nfapi_nr_dl_tti_request_t *dl_tti_request,
}
#if 0 //Melissa may want to free this
#if 0 // TODO: Heap use after free caught by sanitizer
free(dl_info.dci_ind);
dl_info.dci_ind = NULL;
@@ -884,7 +884,7 @@ int nr_ue_dl_indication(nr_downlink_indication_t *dl_info, NR_UL_TIME_ALIGNMENT_
NR_UE_MAC_INST_t *mac = get_mac_inst(module_id);
fapi_nr_dl_config_request_t *dl_config = &mac->dl_config_request;
if ((!dl_info->dci_ind && !dl_info->rx_ind)) { //Melissa review this with Raymond|| !def_dci_pdu_rel15
if ((!dl_info->dci_ind && !dl_info->rx_ind)) {
// UL indication to schedule DCI reception
nr_ue_scheduler(dl_info, NULL);
} else {
@@ -980,7 +980,7 @@ nr_ue_if_module_t *nr_ue_if_module_init(uint32_t module_id){
nr_ue_if_module_inst[module_id]->current_frame = 0;
nr_ue_if_module_inst[module_id]->current_slot = 0;
nr_ue_if_module_inst[module_id]->phy_config_request = nr_ue_phy_config_request;
if (get_softmodem_params()->nsa) //Melissa, this is also a hack. Get a better flag.
if (get_softmodem_params()->nsa) //TODO: Get a better flag for using stub
nr_ue_if_module_inst[module_id]->scheduled_response = nr_ue_scheduled_response_stub;
else
nr_ue_if_module_inst[module_id]->scheduled_response = nr_ue_scheduled_response;
+23 -117
View File
@@ -2380,7 +2380,6 @@ uint8_t do_RRCConnectionSetupComplete(uint8_t Mod_id, uint8_t *buffer, const uin
static void assign_scg_ConfigResponseNR_r15(LTE_RRCConnectionReconfigurationComplete_t *rrc, OCTET_STRING_t *str)
{
/* Melissa TODO: Need to free this memory when we are done. */
LTE_RRCConnectionReconfigurationComplete_r8_IEs_t *rrc_r8 = &rrc->criticalExtensions.choice.
rrcConnectionReconfigurationComplete_r8;
typeof(rrc_r8->nonCriticalExtension) nce1;
@@ -2444,7 +2443,7 @@ do_RRCConnectionReconfigurationComplete(
buffer_size);
AssertFatal (enc_rval.encoded > 0, "ASN1 message encoding failed (%s, %lu)!\n",
enc_rval.failed_type->name, enc_rval.encoded);
LOG_I(RRC,"RRCConnectionReconfigurationComplete Encoded %zd bits (%zd bytes)\n",enc_rval.encoded,(enc_rval.encoded+7)/8);
LOG_D(RRC,"RRCConnectionReconfigurationComplete Encoded %zd bits (%zd bytes)\n",enc_rval.encoded,(enc_rval.encoded+7)/8);
return((enc_rval.encoded+7)/8);
}
@@ -4259,6 +4258,13 @@ uint8_t do_MeasurementReport(uint8_t Mod_id, uint8_t *buffer, size_t buffer_size
return((enc_rval.encoded+7)/8);
}
#define asn1cCallocOne(VaR, VaLue) \
VaR = calloc(1,sizeof(*VaR)); *VaR=VaLue;
#define asn1cCalloc(VaR, lOcPtr) \
typeof(VaR) lOcPtr = VaR = calloc(1,sizeof(*VaR));
#define asn1cSequenceAdd(VaR, TyPe, lOcPtr) \
TyPe *lOcPtr= calloc(1,sizeof(TyPe)); \
ASN_SEQUENCE_ADD(&VaR,lOcPtr);
ssize_t do_nrMeasurementReport(uint8_t *buffer,
size_t bufsize,
@@ -4269,8 +4275,7 @@ ssize_t do_nrMeasurementReport(uint8_t *buffer,
long rsrp_tar,
long rsrq_tar) {
LTE_UL_DCCH_Message_t ul_dcch_msg;
memset(&ul_dcch_msg, 0, sizeof(ul_dcch_msg));
LTE_UL_DCCH_Message_t ul_dcch_msg={0};
ul_dcch_msg.message.present = LTE_UL_DCCH_MessageType_PR_c1;
ul_dcch_msg.message.choice.c1.present = LTE_UL_DCCH_MessageType__c1_PR_measurementReport;
@@ -4282,98 +4287,20 @@ ssize_t do_nrMeasurementReport(uint8_t *buffer,
measurementReport->criticalExtensions.choice.c1.choice.measurementReport_r8.measResults.measId = measid;
measurementReport->criticalExtensions.choice.c1.choice.measurementReport_r8.measResults.measResultPCell.rsrpResult = rsrp_s;
measurementReport->criticalExtensions.choice.c1.choice.measurementReport_r8.measResults.measResultPCell.rsrqResult = rsrq_s;
measurementReport->criticalExtensions.choice.c1.choice.measurementReport_r8.measResults.measResultNeighCells =
calloc(1, sizeof(*measurementReport->criticalExtensions.choice.c1.choice.measurementReport_r8.measResults.measResultNeighCells));
measurementReport->criticalExtensions.choice.c1.choice.measurementReport_r8.measResults.measResultNeighCells->present =
LTE_MeasResults__measResultNeighCells_PR_measResultNeighCellListNR_r15;
LTE_MeasResultListEUTRA_t *measResultListEUTRA2;
measResultListEUTRA2 = CALLOC(1, sizeof(*measResultListEUTRA2));
struct LTE_MeasResultEUTRA *measresulteutra_list;
measresulteutra_list = CALLOC(1, sizeof(*measresulteutra_list));
asn1cCalloc(measurementReport->criticalExtensions.choice.c1.choice.measurementReport_r8.measResults.measResultNeighCells,
measResultNeighCells);
measResultNeighCells->present = LTE_MeasResults__measResultNeighCells_PR_measResultNeighCellListNR_r15;
LTE_MeasResultListEUTRA_t *measResultListEUTRA2=&measResultNeighCells->choice.measResultListEUTRA;
asn1cSequenceAdd(measResultListEUTRA2->list, struct LTE_MeasResultEUTRA, measresulteutra_list);
measresulteutra_list->physCellId = phy_id;
//struct LTE_MeasResultEUTRA *eutra_array;
//eutra_array = CALLOC(1, sizeof(*eutra_array));
struct LTE_MeasResultEUTRA__cgi_Info *measresult_cgi2;
measresult_cgi2 = CALLOC(1, sizeof(*measresult_cgi2));
memset(&measresult_cgi2->cellGlobalId, 0, sizeof(measresult_cgi2->cellGlobalId));
memset(&measresult_cgi2->trackingAreaCode, 0, sizeof(measresult_cgi2->trackingAreaCode));
struct LTE_PLMN_IdentityList2 *plmn_id_list;
plmn_id_list = CALLOC(1, sizeof(*plmn_id_list));
struct LTE_MeasResultEUTRA__measResult measResult;
//measResult = CALLOC(1, sizeof(*measResult));
//measResult->rsrpResult = CALLOC(1, sizeof(*measResult->rsrpResult));
measResult.rsrpResult = &rsrp_tar;
//measResult->rsrqResult = CALLOC(1, sizeof(*measResult->rsrqResult));
measResult.rsrqResult = &rsrq_tar;
measResult.ext1 = NULL;
//struct LTE_MeasResultEUTRA__measResult__ext1 *measResult_ext;
//measResult_ext = CALLOC(1, sizeof(*measResult_ext));
measresulteutra_list->measResult = measResult;
measresulteutra_list->cgi_Info = measresult_cgi2;
ASN_SEQUENCE_ADD(&measResultListEUTRA2->list, measresulteutra_list);
measurementReport->criticalExtensions.choice.c1.choice.measurementReport_r8.measResults.measResultNeighCells->choice.measResultListEUTRA=*(measResultListEUTRA2);
#if 0 //Melissa: This was a hack. Incomplete filling of ul_dcch_msg is done above
measurementReport->criticalExtensions.choice.c1.choice.measurementReport_r8.measResults.measResultNeighCells->choice.measResultListEUTRA.list.array =
calloc(1, sizeof(*measurementReport->criticalExtensions.choice.c1.choice.measurementReport_r8.measResults.measResultNeighCells->choice.measResultListEUTRA.list.array));
measurementReport->criticalExtensions.choice.c1.choice.measurementReport_r8.measResults.measResultNeighCells->choice.measResultListEUTRA.list.array[0] =
calloc(1, sizeof(*measurementReport->criticalExtensions.choice.c1.choice.measurementReport_r8.measResults.measResultNeighCells->choice.measResultListEUTRA.list.array[0]));
measurementReport->criticalExtensions.choice.c1.choice.measurementReport_r8.measResults.measResultNeighCells->choice.measResultListEUTRA.list.array[0]->measResult.rsrpResult =
calloc(1, sizeof(*measurementReport->criticalExtensions.choice.c1.choice.measurementReport_r8.measResults.measResultNeighCells->choice.measResultListEUTRA.list.array[0]->measResult.rsrpResult));
measurementReport->criticalExtensions.choice.c1.choice.measurementReport_r8.measResults.measResultNeighCells->choice.measResultListEUTRA.list.array[0]->measResult.rsrqResult =
calloc(1, sizeof(*measurementReport->criticalExtensions.choice.c1.choice.measurementReport_r8.measResults.measResultNeighCells->choice.measResultListEUTRA.list.array[0]->measResult.rsrqResult));
if (measurementReport->criticalExtensions.choice.c1.choice.measurementReport_r8.measResults.measResultNeighCells == NULL)
LOG_E(MAC, "Melissa, the calloc failed on neighcells.....!!\n");
LTE_MeasResults_t *mr_r8 = &measurementReport->criticalExtensions.choice.c1.choice.measurementReport_r8.measResults;
mr_r8->measId = measid;
mr_r8->measResultPCell.rsrpResult = rsrp_s;
mr_r8->measResultPCell.rsrqResult = rsrq_s;
mr_r8->measResultNeighCells = CALLOC(1, sizeof(*mr_r8->measResultNeighCells));
mr_r8->measResultNeighCells->present = LTE_MeasResults__measResultNeighCells_PR_measResultNeighCellListNR_r15;
mr_r8->measResultNeighCells->choice.measResultNeighCellListNR_r15.list.count = 1;
mr_r8->measResultNeighCells->choice.measResultNeighCellListNR_r15.list.array =
calloc(1, sizeof(*mr_r8->measResultNeighCells->choice.measResultNeighCellListNR_r15.list.array));
mr_r8->measResultNeighCells->choice.measResultNeighCellListNR_r15.list.array[0] =
calloc(1, sizeof(*mr_r8->measResultNeighCells->choice.measResultNeighCellListNR_r15.list.array[0]));
mr_r8->measResultNeighCells->choice.measResultNeighCellListNR_r15.list.array[0]->measResultCell_r15.rsrpResult_r15 =
calloc(1, sizeof(*mr_r8->measResultNeighCells->choice.measResultNeighCellListNR_r15.list.array[0]->measResultCell_r15.rsrpResult_r15));
mr_r8->measResultNeighCells->choice.measResultNeighCellListNR_r15.list.array[0]->measResultCell_r15.rsrqResult_r15 =
calloc(1, sizeof(*mr_r8->measResultNeighCells->choice.measResultNeighCellListNR_r15.list.array[0]->measResultCell_r15.rsrqResult_r15));
//mr_r8->measResultNeighCells->choice.measResultNeighCellListNR_r15.list.array[0]->measResultCell_r15.rsrpResult_r15 = rsrp_tar;
//mr_r8->measResultNeighCells->choice.measResultNeighCellListNR_r15.list.array[0]->measResultCell_r15.rsrqResult_r15 = rsrq_tar;
LOG_D(RRC, "Melissa Elkadi RSRQ of Target %ld\n",
*mr_r8->measResultNeighCells->choice.measResultNeighCellListNR_r15.list.array[0]->measResultCell_r15.rsrqResult_r15);
LOG_D(RRC, "Melissa Elkadi RSRP of Target %ld\n",
*mr_r8->measResultNeighCells->choice.measResultNeighCellListNR_r15.list.array[0]->measResultCell_r15.rsrpResult_r15);
//mr_r8->measResultNeighCells->choice.measResultListEUTRA.list.count = 1;
//mr_r8->measResultNeighCells->choice.measResultListEUTRA.list.array[0]->physCellId = 0;
mr_r8->measResultNeighCells->choice.measResultListEUTRA.list.array =
calloc(1, sizeof(*mr_r8->measResultNeighCells->choice.measResultListEUTRA.list.array));
mr_r8->measResultNeighCells->choice.measResultListEUTRA.list.array[0] =
calloc(1, sizeof(*mr_r8->measResultNeighCells->choice.measResultListEUTRA.list.array[0]));
mr_r8->measResultNeighCells->choice.measResultListEUTRA.list.array[0]->measResult.rsrpResult =
calloc(1, sizeof(*mr_r8->measResultNeighCells->choice.measResultListEUTRA.list.array[0]->measResult.rsrpResult));
mr_r8->measResultNeighCells->choice.measResultListEUTRA.list.array[0]->measResult.rsrqResult =
calloc(1, sizeof(*mr_r8->measResultNeighCells->choice.measResultListEUTRA.list.array[0]->measResult.rsrqResult));
LTE_MeasResultCellNR_r15_t *measResultCellNR_r15;
measResultCellNR_r15 = CALLOC(1, sizeof(*measResultCellNR_r15));
measResultCellNR_r15->ext1 //Melissa should be null
measResultCellNR_r15->pci_r15 = phy_id;
measResultCellNR_r15->measResultCell_r15.rsrpResult_r15 = &rsrp_tar;
measResultCellNR_r15->measResultCell_r15.rsrqResult_r15 = &rsrq_tar;
LTE_MeasResultCellListNR_r15_t *measResultListNR_r15;
measResultListNR_r15 = CALLOC(1, sizeof(*measResultListNR_r15));
ASN_SEQUENCE_ADD(&measResultListNR_r15->list, measResultCellNR_r15);
ASN_SEQUENCE_ADD(&mr_r8->measResultNeighCells->choice.measResultNeighCellListNR_r15.list, measResultListNR_r15);
//xer_fprint(stdout, &asn_DEF_LTE_UL_DCCH_Message, &ul_dcch_msg);
#endif
asn1cCalloc(measresulteutra_list->cgi_Info, measresult_cgi2);
//measresult_cgi2->cellGlobalId= {0};
//measresult_cgi2->trackingAreaCode= {0};
struct LTE_MeasResultEUTRA__measResult* measResult= &measresulteutra_list->measResult;
asn1cCallocOne(measResult->rsrpResult, rsrp_tar);
asn1cCallocOne(measResult->rsrqResult, rsrq_tar);
asn_enc_rval_t enc_rval = uper_encode_to_buffer(&asn_DEF_LTE_UL_DCCH_Message,
NULL,
&ul_dcch_msg,
@@ -4385,28 +4312,7 @@ ssize_t do_nrMeasurementReport(uint8_t *buffer,
SEQUENCE_free(&asn_DEF_LTE_UL_DCCH_Message, &ul_dcch_msg, ASFM_FREE_UNDERLYING_AND_RESET);
return -1;
}
#if 0
LTE_UL_DCCH_Message_t *ul_dcch_msg_dec = NULL;
asn_dec_rval_t dec_rval = uper_decode(
NULL,
&asn_DEF_LTE_UL_DCCH_Message,
(void **)&ul_dcch_msg_dec,
buffer,
bufsize,
0,
0);
if (1) {
xer_fprint(stdout, &asn_DEF_LTE_UL_DCCH_Message, (void *)&ul_dcch_msg_dec);
}
LOG_I(RRC, "Melissa, this is rsrp_result %ld\n",
*ul_dcch_msg_dec->message.choice.c1.choice.measurementReport.criticalExtensions.
choice.c1.choice.measurementReport_r8.measResults.measResultNeighCells->
choice.measResultNeighCellListNR_r15.list.array[0]->measResultCell_r15.rsrpResult_r15);
AssertFatal(ul_dcch_msg_dec->message.choice.c1.choice.measurementReport.criticalExtensions.
choice.c1.choice.measurementReport_r8.measResults.
measResultNeighCells->choice.measResultListEUTRA.list.array[0]->measResult.rsrqResult != NULL, "rsrq not allocated! and dec_val = %lu", dec_rval.consumed);
SEQUENCE_free(&asn_DEF_LTE_UL_DCCH_Message, &ul_dcch_msg, ASFM_FREE_UNDERLYING_AND_RESET); Melissa, might want to figure this out!
#endif
return((enc_rval.encoded+7)/8);
}
+5 -15
View File
@@ -788,6 +788,7 @@ rrc_ue_establish_drb(
return(0);
}
//-----------------------------------------------------------------------------
void
rrc_ue_process_measConfig(
@@ -1734,7 +1735,7 @@ rrc_ue_process_nrueCapabilityEnquiry(
OCTET_STRING_fromBuf(&ue_CapabilityRAT_Container.ue_CapabilityRAT_Container,
(const char *)nrue_cap_info->mesg,
nrue_cap_info->mesg_len);
# if(1) //Melissa: This is a hack. The MRDC capabilites should be filled in the NR UE
# if(1) // TODO: The MRDC capabilites should be filled in the NR UE
NR_UE_CapabilityRAT_Container_t ue_CapabilityRAT_Container_mrdc;
memset(&ue_CapabilityRAT_Container_mrdc, 0, sizeof(ue_CapabilityRAT_Container_mrdc));
uint8_t buffer_mrdc[RRC_BUF_SIZE];
@@ -1971,15 +1972,6 @@ rrc_ue_process_rrcConnectionReconfiguration(
nsa_sendmsg_to_nrue(&msg, sizeof(msg), RRC_CONFIG_COMPLETE_REQ);
LOG_A(RRC, "Sent RRC_CONFIG_COMPLETE_REQ to the NR UE\n");
#if 0 //Melissa, this is a hack. We need the transaction_id from latest dl_dcch_msg the LTE UE received. (Ln 6658)
LTE_RRCConnectionReconfiguration_t *rrc = &UE_rrc_inst[ctxt_pP->module_id].Info[eNB_index].dl_dcch_msg->message.
choice.c1.choice.rrcConnectionReconfiguration;
if (rrc != NULL) {
SEQUENCE_free(&asn_DEF_LTE_RRCConnectionReconfiguration, rrc, ASFM_FREE_EVERYTHING);
}
rrc->rrc_TransactionIdentifier = rrcConnectionReconfiguration->rrc_TransactionIdentifier;
rrcConnectionReconfiguration = NULL;
#endif
}
if (r_r8->mobilityControlInfo) {
@@ -2059,7 +2051,7 @@ rrc_ue_process_rrcConnectionReconfiguration(
NAS_CONN_ESTABLI_CNF(msg_p).nasMsg.data = pdu_buffer;
itti_send_msg_to_task(TASK_NAS_UE, ctxt_pP->instance, msg_p);
}
LOG_I(RRC, "Melissa Elkadi, we have sent NAS_CONN_ESTABLI_CNF to NAS layer via itti!\n");
LOG_D(RRC, "Sent NAS_CONN_ESTABLI_CNF to NAS layer via itti!\n");
free (r_r8->dedicatedInfoNASList);
}
@@ -2517,7 +2509,6 @@ rrc_ue_decode_dcch(
UE_RRC_INFO *info = &UE_rrc_inst[ctxt_pP->module_id].Info[eNB_indexP];
if (info->dl_dcch_msg != NULL) {
info->dl_dcch_msg = NULL;
//SEQUENCE_free(&asn_DEF_LTE_DL_DCCH_Message, info->dl_dcch_msg, ASFM_FREE_EVERYTHING); Melissa
}
info->dl_dcch_msg = dl_dcch_msg;
dl_dcch_msg = NULL;
@@ -2533,7 +2524,6 @@ rrc_ue_decode_dcch(
UE_RRC_INFO *info = &UE_rrc_inst[ctxt_pP->module_id].Info[eNB_indexP];
if (info->dl_dcch_msg != NULL) {
info->dl_dcch_msg = NULL;
//SEQUENCE_free(&asn_DEF_LTE_DL_DCCH_Message, info->dl_dcch_msg, ASFM_FREE_EVERYTHING); Melissa
}
info->dl_dcch_msg = dl_dcch_msg;
dl_dcch_msg = NULL;
@@ -2571,7 +2561,7 @@ rrc_ue_decode_dcch(
#ifndef NO_RRM
send_msg(&S_rrc,msg_rrc_end_scan_req(ctxt_pP->module_id,eNB_indexP));
#endif
if (0) //Melissa hack: Were not done with underlying members of dl_dcch_msg (Use after free)
if (0) //We're not done with underlying members of dl_dcch_msg (Use after free error when enabled)
{
SEQUENCE_free(&asn_DEF_LTE_DL_DCCH_Message, dl_dcch_msg, ASFM_FREE_EVERYTHING);
}
@@ -5067,7 +5057,7 @@ void *rrc_ue_task( void *args_p ) {
}
case NAS_OAI_TUN_NSA:
{
LOG_I(NAS, "Melissa Elkadi Received %s: length %lu. About to send this to the NR UE\n", ITTI_MSG_NAME (msg_p),
LOG_D(NAS, "Received %s: length %lu. About to send this to the NR UE\n", ITTI_MSG_NAME (msg_p),
sizeof(NAS_OAI_TUN_NSA (msg_p).buffer));
char buffer[RRC_BUF_SIZE];
memcpy(buffer, NAS_OAI_TUN_NSA(msg_p).buffer, sizeof(buffer));
+4 -3
View File
@@ -90,6 +90,7 @@
#include <openair3/ocp-gtpu/gtp_itf.h>
#include "intertask_interface.h"
#include "softmodem-common.h"
#if ENABLE_RAL
#include "rrc_eNB_ral.h"
@@ -4600,8 +4601,8 @@ rrc_eNB_process_MeasurementReport(
if(is_en_dc_supported(ue_context_pP->ue_context.UE_Capability)) {
//AssertFatal(measResults2->measResultNeighCells!=NULL,"no measResultNeighCells, shouldn't happen!\n");
//AssertFatal(measResults2->measResultNeighCells->present==LTE_MeasResults__measResultNeighCells_PR_measResultNeighCellListNR_r15,"field is not LTE_MeasResults__measResultNeighCells_PR_measResultNeighCellListNR_r15");
AssertFatal(measResults2->measResultNeighCells!=NULL,"no measResultNeighCells, shouldn't happen!\n");
AssertFatal(measResults2->measResultNeighCells->present==LTE_MeasResults__measResultNeighCells_PR_measResultNeighCellListNR_r15,"field is not LTE_MeasResults__measResultNeighCells_PR_measResultNeighCellListNR_r15");
/** to add gNB as Secondary node CG-ConfigInfo to be added as per 36.423 r15 **/
if(encode_CG_ConfigInfo(enc_buf,sizeof(enc_buf),ue_context_pP,&enc_size) == RRC_OK)
LOG_I(RRC,"CG-ConfigInfo encoded successfully\n");
@@ -7990,7 +7991,7 @@ rrc_eNB_decode_dcch(
/*FK: left the condition as is for the case MME is used (S1 mode) but setting dedicated_DRB = 1 otherwise (noS1 mode) so that no second RRCReconfiguration message activationg more DRB is sent as this causes problems with the nasmesh driver.*/
int flexran_agent_handover = 0;
if (1) { //Melissa: This is a hack. We are bypassing EPC mode here. if(EPC_MODE_ENABLED)
if (EPC_MODE_ENABLED || get_softmodem_params()->nsa) {
if (ue_context_p->ue_context.StatusRrc == RRC_RECONFIGURED) {
dedicated_DRB = 1;
LOG_I(RRC,
+1
View File
@@ -529,6 +529,7 @@ rrc_data_req_ue(
const pdcp_transmission_mode_t modeP
);
void
rrc_data_ind(
const protocol_ctxt_t *const ctxt_pP,
-1
View File
@@ -1031,7 +1031,6 @@ 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;
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;
+1
View File
@@ -59,6 +59,7 @@ int parse_CG_ConfigInfo(gNB_RRC_INST *rrc, NR_CG_ConfigInfo_t *CG_ConfigInfo, x2
AssertFatal(1==0,"[InterNode] Failed to decode NR_UE_CapabilityRAT_ContainerList (%zu bits), size of OCTET_STRING %lu\n",
dec_rval.consumed, cg_ConfigInfo->ue_CapabilityInfo->size);
}
rrc_parse_ue_capabilities(rrc,UE_CapabilityRAT_ContainerList, m,cg_ConfigInfo);
}
+2 -2
View File
@@ -297,7 +297,7 @@ void rrc_add_nsa_user(gNB_RRC_INST *rrc,struct rrc_gNB_ue_context_s *ue_context_
PROTOCOL_CTXT_SET_BY_MODULE_ID(&ctxt, rrc->module_id, GNB_FLAG_YES, ue_context_p->ue_id_rnti, 0, 0,rrc->module_id);
memset(&create_tunnel_resp, 0, sizeof(create_tunnel_resp));
if (!IS_SOFTMODEM_NOS1) {
LOG_I(RRC, "Melissa Elkadi calling gtpv1u_create_s1u_tunnel()\n");
LOG_D(RRC, "Calling gtpv1u_create_s1u_tunnel()\n");
gtpv1u_create_s1u_tunnel(
ctxt.instance,
&create_tunnel_req,
@@ -404,7 +404,7 @@ void rrc_add_nsa_user(gNB_RRC_INST *rrc,struct rrc_gNB_ue_context_s *ue_context_
(LTE_PMCH_InfoList_r9_t *) NULL,
ue_context_p->ue_context.secondaryCellGroup->rlc_BearerToAddModList);
LOG_I(RRC, "%s:%d: done RRC PDCP/RLC ASN1 request for UE rnti %x\n", __FUNCTION__, __LINE__, ctxt.rnti);
LOG_D(RRC, "%s:%d: done RRC PDCP/RLC ASN1 request for UE rnti %x\n", __FUNCTION__, __LINE__, ctxt.rnti);
}
+2 -43
View File
@@ -2025,15 +2025,6 @@ nr_rrc_ue_establish_srb2(
}
}
/*rrc_data_req_nr_ue (
ctxt_pP,
DCCH,
nr_rrc_mui++,
SDU_CONFIRM_NO,
size,
buffer,
PDCP_TRANSMISSION_MODE_CONTROL); Melissa Elkadi come back here!*/
if (measConfig->s_MeasureConfig->present == NR_MeasConfig__s_MeasureConfig_PR_ssb_RSRP) {
NR_UE_rrc_inst[ctxt_pP->module_id].s_measure = measConfig->s_MeasureConfig->choice.ssb_RSRP;
} else if (measConfig->s_MeasureConfig->present == NR_MeasConfig__s_MeasureConfig_PR_csi_RSRP) {
@@ -2699,38 +2690,6 @@ nr_rrc_ue_process_ueCapabilityEnquiry(
}
}
//-----------------------------------------------------------------------------
#if 0
static void nr_rrc_ue_generate_RRCReestablishmentRequest( const protocol_ctxt_t *const ctxt_pP, const uint8_t gNB_index )
{
NR_UE_rrc_inst[ctxt_pP->module_id].Srb0[gNB_index].Tx_buffer.payload_size =
do_RRCReestablishmentRequest(
ctxt_pP->module_id,
(uint8_t *)NR_UE_rrc_inst[ctxt_pP->module_id].Srb0[gNB_index].Tx_buffer.Payload, 1);
LOG_I(NR_RRC,"[UE %d] : Frame %d, Logical Channel UL-CCCH (SRB0), Generating RRCReestablishmentRequest (bytes %d, gNB %d)\n",
ctxt_pP->module_id, ctxt_pP->frame, NR_UE_rrc_inst[ctxt_pP->module_id].Srb0[gNB_index].Tx_buffer.payload_size, gNB_index);
for (int i=0; i<NR_UE_rrc_inst[ctxt_pP->module_id].Srb0[gNB_index].Tx_buffer.payload_size; i++) {
LOG_T(NR_RRC,"%x.",NR_UE_rrc_inst[ctxt_pP->module_id].Srb0[gNB_index].Tx_buffer.Payload[i]);
}
LOG_T(NR_RRC,"\n");
#ifdef ITTI_SIM
MessageDef *message_p;
uint8_t *message_buffer;
message_buffer = itti_malloc (TASK_RRC_NRUE,TASK_RRC_GNB_SIM,
NR_UE_rrc_inst[ctxt_pP->module_id].Srb0[gNB_index].Tx_buffer.payload_size);
memcpy (message_buffer, (uint8_t*)NR_UE_rrc_inst[ctxt_pP->module_id].Srb0[gNB_index].Tx_buffer.Payload,
NR_UE_rrc_inst[ctxt_pP->module_id].Srb0[gNB_index].Tx_buffer.payload_size);
message_p = itti_alloc_new_message (TASK_RRC_NRUE, 0, UE_RRC_CCCH_DATA_IND);
UE_RRC_CCCH_DATA_IND (message_p).sdu = message_buffer;
UE_RRC_CCCH_DATA_IND (message_p).size = NR_UE_rrc_inst[ctxt_pP->module_id].Srb0[gNB_index].Tx_buffer.payload_size;
itti_send_msg_to_task (TASK_RRC_GNB_SIM, ctxt_pP->instance, message_p);
#endif
}
#endif
void
nr_rrc_ue_generate_rrcReestablishmentComplete(
const protocol_ctxt_t *const ctxt_pP,
@@ -2890,7 +2849,7 @@ static void nsa_rrc_ue_process_ueCapabilityEnquiry(void)
UECap->sdu_size = (enc_rval.encoded + 7) / 8;
LOG_A(NR_RRC, "[NR_RRC] NRUE Capability encoded, %d bytes (%zd bits)\n",
UECap->sdu_size, enc_rval.encoded + 7);
/* Melissa: Hack. Need to add ctxt->mod_id as array indices */
NR_UE_rrc_inst[0].UECap = UECap;
NR_UE_rrc_inst[0].UECapability = UECap->sdu;
NR_UE_rrc_inst[0].UECapability_size = UECap->sdu_size;
@@ -3031,7 +2990,7 @@ void process_lte_nsa_msg(nsa_msg_t *msg, int msg_len)
LOG_I(NR_RRC, "We got an OAI_TUN_IFACE_NSA!!\n");
char cmd_line[RRC_BUF_SIZE];
memcpy(cmd_line, msg_buffer, sizeof(cmd_line));
LOG_I(NR_RRC, "Melissa Elkadi, this is the command line we got: %s\n", cmd_line);
LOG_D(NR_RRC, "Command line: %s\n", cmd_line);
if (background_system(cmd_line) != 0)
{
LOG_E(NR_RRC, "ESM-PROC - failed command '%s'", cmd_line);
+1 -1
View File
@@ -1734,7 +1734,7 @@ int x2ap_eNB_generate_ENDC_x2_SgNB_addition_request(
X2AP_ERROR("Failed to encode ENDC X2 SgNB_addition request message\n");
return -1;
}
# if 0 //Melissa: This is a hack becasue we are trying to access this after free.
# if 0 // TODO: Sanitizer complains we are trying to access this after free.
free(ie->value.choice.MeNBtoSgNBContainer.buf);
#endif
MSC_LOG_TX_MESSAGE (MSC_X2AP_SRC_ENB, MSC_X2AP_TARGET_ENB, NULL, 0, "0 X2Setup/initiatingMessage assoc_id %u", x2ap_eNB_data_p->assoc_id);