Commit 2b9d0f95 authored by rmagueta's avatar rmagueta

Fix develop merge conflicts in the RA-Msg3

parent 5b7ae122
...@@ -515,7 +515,7 @@ uint8_t nr_ue_get_rach(NR_PRACH_RESOURCES_t *prach_resources, ...@@ -515,7 +515,7 @@ uint8_t nr_ue_get_rach(NR_PRACH_RESOURCES_t *prach_resources,
uint8_t sdu_lcids[NB_RB_MAX] = {0}; uint8_t sdu_lcids[NB_RB_MAX] = {0};
uint16_t sdu_lengths[NB_RB_MAX] = {0}; uint16_t sdu_lengths[NB_RB_MAX] = {0};
int num_sdus, offset = 0, preambleTransMax; int num_sdus, offset = 0;
// Delay init RA procedure to allow the convergence of the IIR filter on PRACH noise measurements at gNB side // 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 (!prach_resources->init_msg1) {
...@@ -590,9 +590,9 @@ uint8_t nr_ue_get_rach(NR_PRACH_RESOURCES_t *prach_resources, ...@@ -590,9 +590,9 @@ uint8_t nr_ue_get_rach(NR_PRACH_RESOURCES_t *prach_resources,
LOG_D(MAC,"(%i): %i\n", k, prach_resources->Msg3[k]); LOG_D(MAC,"(%i): %i\n", k, prach_resources->Msg3[k]);
} }
// Msg3 was initialized with TBS_max bytes because the mac->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 mac->RA_Msg3_size bytes, removing unnecessary 0s. // Msg3 will be transmitted with RA_Msg3_size bytes, removing unnecessary 0s.
mac->ulsch_pdu.Pdu_size = TBS_max; mac->ulsch_pdu.Pdu_size = TBS_max;
memcpy(mac->ulsch_pdu.payload, prach_resources->Msg3, TBS_max); memcpy(mac->ulsch_pdu.payload, prach_resources->Msg3, TBS_max);
......
...@@ -889,32 +889,41 @@ NR_UE_L2_STATE_t nr_ue_scheduler(nr_downlink_indication_t *dl_info, nr_uplink_in ...@@ -889,32 +889,41 @@ NR_UE_L2_STATE_t nr_ue_scheduler(nr_downlink_indication_t *dl_info, nr_uplink_in
uint16_t TBS_bytes = ulcfg_pdu->pusch_config_pdu.pusch_data.tb_size; uint16_t TBS_bytes = ulcfg_pdu->pusch_config_pdu.pusch_data.tb_size;
if (IS_SOFTMODEM_NOS1){ if (ra->ra_state == WAIT_RAR){
// Getting IP traffic to be transmitted memcpy(ulsch_input_buffer, mac->ulsch_pdu.payload, TBS_bytes);
data_existing = nr_ue_get_sdu(mod_id, printf("\n");
cc_id, LOG_I(MAC,"[RAPROC] Msg3 to be transmitted:\n");
frame_tx, for (int k = 0; k < TBS_bytes; k++) {
slot_tx, LOG_I(MAC,"(%i): 0x%x\n",k,mac->ulsch_pdu.payload[k]);
0, }
ulsch_input_buffer, printf("\n");
TBS_bytes, } else {
&access_mode); if (IS_SOFTMODEM_NOS1){
} // Getting IP traffic to be transmitted
data_existing = nr_ue_get_sdu(mod_id,
cc_id,
frame_tx,
slot_tx,
0,
ulsch_input_buffer,
TBS_bytes,
&access_mode);
}
//Random traffic to be transmitted if there is no IP traffic available for this Tx opportunity //Random traffic to be transmitted if there is no IP traffic available for this Tx opportunity
if (!IS_SOFTMODEM_NOS1 || !data_existing) { if (!IS_SOFTMODEM_NOS1 || !data_existing) {
//Use zeros for the header bytes in noS1 mode, in order to make sure that the LCID is not valid //Use zeros for the header bytes in noS1 mode, in order to make sure that the LCID is not valid
//and block this traffic from being forwarded to the upper layers at the gNB //and block this traffic from being forwarded to the upper layers at the gNB
LOG_D(PHY, "In %s: Random data to be transmitted: TBS_bytes %d \n", __FUNCTION__, TBS_bytes); LOG_D(PHY, "In %s: Random data to be transmitted: TBS_bytes %d \n", __FUNCTION__, TBS_bytes);
//Give the first byte a dummy value (a value not corresponding to any valid LCID based on 38.321, Table 6.2.1-2) //Give the first byte a dummy value (a value not corresponding to any valid LCID based on 38.321, Table 6.2.1-2)
//in order to distinguish the PHY random packets at the MAC layer of the gNB receiver from the normal packets that should //in order to distinguish the PHY random packets at the MAC layer of the gNB receiver from the normal packets that should
//have a valid LCID (nr_process_mac_pdu function) //have a valid LCID (nr_process_mac_pdu function)
ulsch_input_buffer[0] = 0x31; ulsch_input_buffer[0] = 0x31;
for (int i = 1; i < TBS_bytes; i++) { for (int i = 1; i < TBS_bytes; i++) {
ulsch_input_buffer[i] = (unsigned char) rand(); ulsch_input_buffer[i] = (unsigned char) rand();
//printf(" input encoder a[%d]=0x%02x\n",i,harq_process_ul_ue->a[i]); }
} }
} }
......
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