Commit 818694ac authored by Mario Hudon's avatar Mario Hudon

-Code review: Use FAPI PRACH PDU instead of PRACH vars in nr_ue_get_rach/nr_get_prach_resources

parent dd573e89
...@@ -2144,7 +2144,7 @@ void nr_ue_prach_procedures(PHY_VARS_NR_UE *ue, UE_nr_rxtx_proc_t *proc, uint8_t ...@@ -2144,7 +2144,7 @@ void nr_ue_prach_procedures(PHY_VARS_NR_UE *ue, UE_nr_rxtx_proc_t *proc, uint8_t
ue->ulsch_Msg3_active[i] = 0; ue->ulsch_Msg3_active[i] = 0;
} }
} }
nr_prach = nr_ue_get_rach(ue->prach_resources[gNB_id], ue->prach_vars[0], mod_id, ue->CC_id, UE_mode, frame_tx, gNB_id, nr_tti_tx); nr_prach = nr_ue_get_rach(ue->prach_resources[gNB_id], &ue->prach_vars[0]->prach_pdu, mod_id, ue->CC_id, UE_mode, frame_tx, gNB_id, nr_tti_tx);
} }
} }
......
...@@ -267,7 +267,7 @@ andom-access to transmit a BSR along with the C-RNTI control element (see 5.1.4 ...@@ -267,7 +267,7 @@ andom-access to transmit a BSR along with the C-RNTI control element (see 5.1.4
@param nr_tti_tx slot for PRACH transmission @param nr_tti_tx slot for PRACH transmission
@returns indication to generate PRACH to phy */ @returns indication to generate PRACH to phy */
uint8_t nr_ue_get_rach(NR_PRACH_RESOURCES_t *prach_resources, uint8_t nr_ue_get_rach(NR_PRACH_RESOURCES_t *prach_resources,
NR_UE_PRACH *prach_vars, fapi_nr_ul_config_prach_pdu *prach_pdu,
module_id_t mod_id, module_id_t mod_id,
int CC_id, int CC_id,
UE_MODE_t UE_mode, UE_MODE_t UE_mode,
...@@ -279,7 +279,6 @@ uint8_t nr_ue_get_rach(NR_PRACH_RESOURCES_t *prach_resources, ...@@ -279,7 +279,6 @@ uint8_t nr_ue_get_rach(NR_PRACH_RESOURCES_t *prach_resources,
@param module_idP Index of UE instance @param module_idP Index of UE instance
@param CC_id Component Carrier Index @param CC_id Component Carrier Index
@param gNB_index gNB index @param gNB_index gNB index
@param t_id
@param rach_ConfigDedicated @param rach_ConfigDedicated
@returns void */ @returns void */
void nr_get_prach_resources(module_id_t mod_id, void nr_get_prach_resources(module_id_t mod_id,
...@@ -287,7 +286,7 @@ void nr_get_prach_resources(module_id_t mod_id, ...@@ -287,7 +286,7 @@ void nr_get_prach_resources(module_id_t mod_id,
uint8_t gNB_id, uint8_t gNB_id,
uint8_t first_Msg3, uint8_t first_Msg3,
NR_PRACH_RESOURCES_t *prach_resources, NR_PRACH_RESOURCES_t *prach_resources,
NR_UE_PRACH *prach_vars, fapi_nr_ul_config_prach_pdu *prach_pdu,
NR_RACH_ConfigDedicated_t * rach_ConfigDedicated); NR_RACH_ConfigDedicated_t * rach_ConfigDedicated);
void nr_Msg1_transmitted(module_id_t mod_id, uint8_t CC_id, frame_t frameP, uint8_t gNB_id); void nr_Msg1_transmitted(module_id_t mod_id, uint8_t CC_id, frame_t frameP, uint8_t gNB_id);
......
...@@ -77,7 +77,7 @@ void nr_get_prach_resources(module_id_t mod_id, ...@@ -77,7 +77,7 @@ void nr_get_prach_resources(module_id_t mod_id,
uint8_t gNB_id, uint8_t gNB_id,
uint8_t first_Msg3, uint8_t first_Msg3,
NR_PRACH_RESOURCES_t *prach_resources, NR_PRACH_RESOURCES_t *prach_resources,
NR_UE_PRACH *prach_vars, fapi_nr_ul_config_prach_pdu *prach_pdu,
NR_RACH_ConfigDedicated_t * rach_ConfigDedicated){ NR_RACH_ConfigDedicated_t * rach_ConfigDedicated){
NR_UE_MAC_INST_t *mac = get_mac_inst(mod_id); NR_UE_MAC_INST_t *mac = get_mac_inst(mod_id);
...@@ -197,7 +197,7 @@ void nr_get_prach_resources(module_id_t mod_id, ...@@ -197,7 +197,7 @@ void nr_get_prach_resources(module_id_t mod_id,
(ssb_rach_ratio > 1)) { (ssb_rach_ratio > 1)) {
total_preambles_per_ssb = numberOfRA_Preambles / ssb_rach_ratio; total_preambles_per_ssb = numberOfRA_Preambles / ssb_rach_ratio;
ssb_nb_in_ro = prach_vars->prach_pdu.ssb_nb_in_ro; ssb_nb_in_ro = prach_pdu->ssb_nb_in_ro;
starting_preamble_nb = total_preambles_per_ssb * ssb_nb_in_ro; starting_preamble_nb = total_preambles_per_ssb * ssb_nb_in_ro;
} }
else { else {
...@@ -345,9 +345,9 @@ void nr_get_prach_resources(module_id_t mod_id, ...@@ -345,9 +345,9 @@ void nr_get_prach_resources(module_id_t mod_id,
// - s_id is starting symbol of the PRACH occasion [0...14] // - s_id is starting symbol of the PRACH occasion [0...14]
// - t_id is the first slot of the PRACH occasion in a system frame [0...80] // - t_id is the first slot of the PRACH occasion in a system frame [0...80]
ul_carrier_id = 0; // NUL ul_carrier_id = 0; // NUL
f_id = prach_vars->prach_pdu.num_ra; f_id = prach_pdu->num_ra;
t_id = prach_vars->prach_pdu.prach_slot; t_id = prach_pdu->prach_slot;
s_id = prach_vars->prach_pdu.prach_start_symbol; s_id = prach_pdu->prach_start_symbol;
prach_resources->ra_RNTI = 1 + s_id + 14 * t_id + 1120 * f_id + 8960 * ul_carrier_id; prach_resources->ra_RNTI = 1 + s_id + 14 * t_id + 1120 * f_id + 8960 * ul_carrier_id;
mac->ra_rnti = prach_resources->ra_RNTI; mac->ra_rnti = prach_resources->ra_RNTI;
...@@ -395,7 +395,7 @@ void nr_Msg3_transmitted(module_id_t mod_id, uint8_t CC_id, frame_t frameP, uint ...@@ -395,7 +395,7 @@ void nr_Msg3_transmitted(module_id_t mod_id, uint8_t CC_id, frame_t frameP, uint
// - add the backoff condition here if we have it from a previous RA reponse which failed (i.e. backoff indicator) // - add the backoff condition here if we have it from a previous RA reponse which failed (i.e. backoff indicator)
uint8_t nr_ue_get_rach(NR_PRACH_RESOURCES_t *prach_resources, uint8_t nr_ue_get_rach(NR_PRACH_RESOURCES_t *prach_resources,
NR_UE_PRACH *prach_vars, fapi_nr_ul_config_prach_pdu *prach_pdu,
module_id_t mod_id, module_id_t mod_id,
int CC_id, int CC_id,
UE_MODE_t UE_mode, UE_MODE_t UE_mode,
...@@ -510,7 +510,7 @@ uint8_t nr_ue_get_rach(NR_PRACH_RESOURCES_t *prach_resources, ...@@ -510,7 +510,7 @@ uint8_t nr_ue_get_rach(NR_PRACH_RESOURCES_t *prach_resources,
// Fill in preamble and PRACH resources // Fill in preamble and PRACH resources
if (mac->generate_nr_prach == 1) if (mac->generate_nr_prach == 1)
nr_get_prach_resources(mod_id, CC_id, gNB_id, nr_tti_tx, prach_resources, prach_vars, rach_ConfigDedicated); nr_get_prach_resources(mod_id, CC_id, gNB_id, nr_tti_tx, prach_resources, prach_pdu, rach_ConfigDedicated);
offset = nr_generate_ulsch_pdu((uint8_t *) mac_sdus, // sdus buffer offset = nr_generate_ulsch_pdu((uint8_t *) mac_sdus, // sdus buffer
(uint8_t *) payload, // UL MAC pdu pointer (uint8_t *) payload, // UL MAC pdu pointer
...@@ -637,7 +637,7 @@ uint8_t nr_ue_get_rach(NR_PRACH_RESOURCES_t *prach_resources, ...@@ -637,7 +637,7 @@ uint8_t nr_ue_get_rach(NR_PRACH_RESOURCES_t *prach_resources,
// Fill in preamble and PRACH resources // Fill in preamble and PRACH resources
if (mac->generate_nr_prach == 1) if (mac->generate_nr_prach == 1)
nr_get_prach_resources(mod_id, CC_id, gNB_id, nr_tti_tx, prach_resources, prach_vars, rach_ConfigDedicated); nr_get_prach_resources(mod_id, CC_id, gNB_id, nr_tti_tx, prach_resources, prach_pdu, rach_ConfigDedicated);
} else { } else {
...@@ -651,7 +651,7 @@ uint8_t nr_ue_get_rach(NR_PRACH_RESOURCES_t *prach_resources, ...@@ -651,7 +651,7 @@ uint8_t nr_ue_get_rach(NR_PRACH_RESOURCES_t *prach_resources,
// Fill in preamble and PRACH resources // Fill in preamble and PRACH resources
if (mac->generate_nr_prach == 1) if (mac->generate_nr_prach == 1)
nr_get_prach_resources(mod_id, CC_id, gNB_id, nr_tti_tx, prach_resources, prach_vars, rach_ConfigDedicated); nr_get_prach_resources(mod_id, CC_id, gNB_id, nr_tti_tx, prach_resources, prach_pdu, rach_ConfigDedicated);
} }
} }
......
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