Commit 36250e72 authored by Melissa Elkadi's avatar Melissa Elkadi

Merge branch 'episys/david/nsa_integrated_RA' into eurecom-episys-merge-nsa

parents 04d0004e 01c2f79f
...@@ -2891,6 +2891,7 @@ add_executable(ocp-enb ...@@ -2891,6 +2891,7 @@ add_executable(ocp-enb
${OPENAIR_DIR}/common/utils/system.c ${OPENAIR_DIR}/common/utils/system.c
${OPENAIR_DIR}/common/utils/lte/ue_power.c ${OPENAIR_DIR}/common/utils/lte/ue_power.c
${OPENAIR_DIR}/common/utils/lte/prach_utils.c ${OPENAIR_DIR}/common/utils/lte/prach_utils.c
${PHY_INTERFACE_DIR}/queue.c
${XFORMSINTERFACE_SOURCE} ${XFORMSINTERFACE_SOURCE}
${T_SOURCE} ${T_SOURCE}
${CONFIG_SOURCES} ${CONFIG_SOURCES}
...@@ -3074,6 +3075,7 @@ add_executable(ocp-gnb ...@@ -3074,6 +3075,7 @@ add_executable(ocp-gnb
${OPENAIR_DIR}/common/utils/nr/nr_common.c ${OPENAIR_DIR}/common/utils/nr/nr_common.c
${OPENAIR_DIR}/common/utils/utils.c ${OPENAIR_DIR}/common/utils/utils.c
${OPENAIR_DIR}/common/utils/system.c ${OPENAIR_DIR}/common/utils/system.c
${PHY_INTERFACE_DIR}/queue.c
${XFORMS_SOURCE_NR} ${XFORMS_SOURCE_NR}
${T_SOURCE} ${T_SOURCE}
${CONFIG_SOURCES} ${CONFIG_SOURCES}
......
...@@ -553,7 +553,9 @@ void fill_rx_indication_from_split(uint8_t *bufferZone, PHY_VARS_eNB *eNB,int UE ...@@ -553,7 +553,9 @@ void fill_rx_indication_from_split(uint8_t *bufferZone, PHY_VARS_eNB *eNB,int UE
pdu->rx_indication_rel8.tl.tag = NFAPI_RX_INDICATION_REL8_TAG; pdu->rx_indication_rel8.tl.tag = NFAPI_RX_INDICATION_REL8_TAG;
pdu->rx_indication_rel8.length = eNB->ulsch[UE_id]->harq_processes[harq_pid]->TBS>>3; pdu->rx_indication_rel8.length = eNB->ulsch[UE_id]->harq_processes[harq_pid]->TBS>>3;
pdu->rx_indication_rel8.offset = 1; // DJP - I dont understand - but broken unless 1 ???? 0; // filled in at the end of the UL_INFO formation pdu->rx_indication_rel8.offset = 1; // DJP - I dont understand - but broken unless 1 ???? 0; // filled in at the end of the UL_INFO formation
pdu->data = eNB->ulsch[UE_id]->harq_processes[harq_pid]->decodedBytes; memcpy(pdu->rx_ind_data,
eNB->ulsch[UE_id]->harq_processes[harq_pid]->decodedBytes,
pdu->rx_indication_rel8.length);
// estimate timing advance for MAC // estimate timing advance for MAC
timing_advance_update = ul_propa[UE_id].ta; timing_advance_update = ul_propa[UE_id].ta;
......
...@@ -364,7 +364,6 @@ static void check_nr_prach(NR_UE_MAC_INST_t *mac, nr_uplink_indication_t *ul_inf ...@@ -364,7 +364,6 @@ static void check_nr_prach(NR_UE_MAC_INST_t *mac, nr_uplink_indication_t *ul_inf
if (nr_prach == 1) if (nr_prach == 1)
{ {
L1_nsa_prach_procedures(ul_info->frame_tx, ul_info->slot_tx, prach_pdu); L1_nsa_prach_procedures(ul_info->frame_tx, ul_info->slot_tx, prach_pdu);
mac->ra.generate_nr_prach = GENERATE_PREAMBLE;
ul_config->number_pdus = 0; ul_config->number_pdus = 0;
ul_info->ue_sched_mode = SCHED_ALL; ul_info->ue_sched_mode = SCHED_ALL;
} }
......
...@@ -155,7 +155,6 @@ char uecap_xer[1024]; ...@@ -155,7 +155,6 @@ char uecap_xer[1024];
*/ */
uint8_t abstraction_flag=0; uint8_t abstraction_flag=0;
uint16_t ue_idx_standalone = 0xFFFF;
/*---------------------BMC: timespec helpers -----------------------------*/ /*---------------------BMC: timespec helpers -----------------------------*/
......
...@@ -708,7 +708,6 @@ uint8_t nr_ue_get_rach(NR_PRACH_RESOURCES_t *prach_resources, ...@@ -708,7 +708,6 @@ uint8_t nr_ue_get_rach(NR_PRACH_RESOURCES_t *prach_resources,
uint8_t mac_ce[16] = {0}; uint8_t mac_ce[16] = {0};
uint8_t *pdu = get_softmodem_params()->sa ? mac->CCCH_pdu.payload : mac_ce; uint8_t *pdu = get_softmodem_params()->sa ? mac->CCCH_pdu.payload : mac_ce;
uint8_t *payload = pdu; uint8_t *payload = pdu;
unsigned short post_padding = 1;
// Concerning the C-RNTI MAC CE, it has to be included if the UL transmission (Msg3) is not being made for the CCCH logical channel. // Concerning the C-RNTI MAC CE, it has to be included if the UL transmission (Msg3) is not being made for the CCCH logical channel.
// Therefore it has been assumed that this event only occurs only when RA is done and it is not SA mode. // Therefore it has been assumed that this event only occurs only when RA is done and it is not SA mode.
...@@ -749,6 +748,7 @@ uint8_t nr_ue_get_rach(NR_PRACH_RESOURCES_t *prach_resources, ...@@ -749,6 +748,7 @@ uint8_t nr_ue_get_rach(NR_PRACH_RESOURCES_t *prach_resources,
int TBS_bytes = 848; int TBS_bytes = 848;
int mac_ce_len = 0; int mac_ce_len = 0;
int header_length_total=0; int header_length_total=0;
unsigned short post_padding = 1;
// fill ulsch_buffer with random data // fill ulsch_buffer with random data
for (int i = 0; i < TBS_bytes; i++){ for (int i = 0; i < TBS_bytes; i++){
...@@ -773,7 +773,7 @@ uint8_t nr_ue_get_rach(NR_PRACH_RESOURCES_t *prach_resources, ...@@ -773,7 +773,7 @@ uint8_t nr_ue_get_rach(NR_PRACH_RESOURCES_t *prach_resources,
} }
if (size_sdu > 0 && ra->generate_nr_prach == GENERATE_PREAMBLE) { if (size_sdu > 0 && (ra->generate_nr_prach == GENERATE_PREAMBLE || get_softmodem_params()->nsa)) {
LOG_D(NR_MAC, "In %s: [UE %d][%d.%d]: starting initialisation Random Access Procedure...\n", __FUNCTION__, mod_id, frame, nr_slot_tx); LOG_D(NR_MAC, "In %s: [UE %d][%d.%d]: starting initialisation Random Access Procedure...\n", __FUNCTION__, mod_id, frame, nr_slot_tx);
...@@ -781,10 +781,11 @@ uint8_t nr_ue_get_rach(NR_PRACH_RESOURCES_t *prach_resources, ...@@ -781,10 +781,11 @@ uint8_t nr_ue_get_rach(NR_PRACH_RESOURCES_t *prach_resources,
init_RA(mod_id, prach_resources, setup, rach_ConfigGeneric, rach_ConfigDedicated); init_RA(mod_id, prach_resources, setup, rach_ConfigGeneric, rach_ConfigDedicated);
nr_get_RA_window(mac); nr_get_RA_window(mac);
// Fill in preamble and PRACH resources // Fill in preamble and PRACH resources
if (ra->generate_nr_prach == GENERATE_PREAMBLE)
nr_get_prach_resources(mod_id, CC_id, gNB_id, prach_resources, prach_pdu, rach_ConfigDedicated); nr_get_prach_resources(mod_id, CC_id, gNB_id, prach_resources, prach_pdu, rach_ConfigDedicated);
// Padding: fill remainder with 0 // Padding: fill remainder with 0
if (TBS_max - ra->Msg3_size > 0 && get_softmodem_params()->sa) { if (TBS_max - ra->Msg3_size > 0) {
AssertFatal(TBS_max > ra->Msg3_size, "In %s: allocated resources are not enough for Msg3!\n", __FUNCTION__); AssertFatal(TBS_max > ra->Msg3_size, "In %s: allocated resources are not enough for Msg3!\n", __FUNCTION__);
LOG_D(NR_MAC, "In %s: remaining %d bytes, filling with padding\n", __FUNCTION__, TBS_max - ra->Msg3_size); LOG_D(NR_MAC, "In %s: remaining %d bytes, filling with padding\n", __FUNCTION__, TBS_max - ra->Msg3_size);
((NR_MAC_SUBHEADER_FIXED *) pdu)->R = 0; ((NR_MAC_SUBHEADER_FIXED *) pdu)->R = 0;
...@@ -804,9 +805,13 @@ uint8_t nr_ue_get_rach(NR_PRACH_RESOURCES_t *prach_resources, ...@@ -804,9 +805,13 @@ uint8_t nr_ue_get_rach(NR_PRACH_RESOURCES_t *prach_resources,
// Msg3 was initialized with TBS_max bytes because the RA_Msg3_size will only be known after // Msg3 was initialized with TBS_max bytes because the RA_Msg3_size will only be known after
// receiving Msg2 (which contains the Msg3 resource reserve). // receiving Msg2 (which contains the Msg3 resource reserve).
// Msg3 will be transmitted with RA_Msg3_size bytes, removing unnecessary 0s. // Msg3 will be transmitted with RA_Msg3_size bytes, removing unnecessary 0s.
if (!get_softmodem_params()->nsa) {
mac->ulsch_pdu.Pdu_size = TBS_max; mac->ulsch_pdu.Pdu_size = TBS_max;
memcpy(mac->ulsch_pdu.payload, payload, TBS_max); memcpy(mac->ulsch_pdu.payload, payload, TBS_max);
}
} else {
return 0;
} }
} else if (ra->RA_window_cnt != -1) { // RACH is active } else if (ra->RA_window_cnt != -1) { // RACH is active
......
...@@ -42,6 +42,8 @@ ...@@ -42,6 +42,8 @@
extern unsigned char NB_eNB_INST; extern unsigned char NB_eNB_INST;
extern uint16_t NB_UE_INST; extern uint16_t NB_UE_INST;
uint16_t ue_idx_standalone = 0xFFFF;
char *make_port_str_from_ueid(const char *base_port_str, int ueid); char *make_port_str_from_ueid(const char *base_port_str, int ueid);
static int nas_ue_process_events(nas_user_container_t *users, struct epoll_event *events, int nb_events) static int nas_ue_process_events(nas_user_container_t *users, struct epoll_event *events, int nb_events)
......
...@@ -181,7 +181,6 @@ eth_params_t *eth_params; ...@@ -181,7 +181,6 @@ eth_params_t *eth_params;
double cpuf; double cpuf;
int oaisim_flag=0; int oaisim_flag=0;
uint16_t ue_idx_standalone = 0xFFFF;
uint8_t proto_agent_flag = 0; uint8_t proto_agent_flag = 0;
......
...@@ -276,7 +276,6 @@ void exit_function(const char *file, const char *function, const int line, const ...@@ -276,7 +276,6 @@ void exit_function(const char *file, const char *function, const int line, const
} }
extern int16_t dlsch_demod_shift; extern int16_t dlsch_demod_shift;
uint16_t ue_idx_standalone = 0xFFFF;
uint16_t node_number; uint16_t node_number;
static void get_options(void) { static void get_options(void) {
int CC_id=0; int CC_id=0;
......
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