Commit 1ba2c7a5 authored by Laurent THOMAS's avatar Laurent THOMAS Committed by Robert Schmidt

nr_fill_rx_indication() increments itself, remove full memset for the related...

nr_fill_rx_indication() increments itself, remove full memset for the related struct (100 elements, one used)
Signed-off-by: default avatarLaurent THOMAS <laurent.thomas@open-cells.com>
parent 6cbeab62
...@@ -155,8 +155,6 @@ typedef struct { ...@@ -155,8 +155,6 @@ typedef struct {
/// ///
#define NFAPI_RX_IND_MAX_PDU 100 #define NFAPI_RX_IND_MAX_PDU 100
typedef struct { typedef struct {
uint16_t sfn;
uint16_t slot;
uint16_t number_pdus; uint16_t number_pdus;
fapi_nr_rx_indication_body_t rx_indication_body[NFAPI_RX_IND_MAX_PDU]; fapi_nr_rx_indication_body_t rx_indication_body[NFAPI_RX_IND_MAX_PDU];
} fapi_nr_rx_indication_t; } fapi_nr_rx_indication_t;
......
...@@ -162,7 +162,9 @@ static void send_ssb_rsrp_meas(PHY_VARS_NR_UE *ue, ...@@ -162,7 +162,9 @@ static void send_ssb_rsrp_meas(PHY_VARS_NR_UE *ue,
.sinr_dB = sinr_dB, .sinr_dB = sinr_dB,
}; };
fapi_nr_rx_indication_t rx_ind = {0}; fapi_nr_rx_indication_t rx_ind;
rx_ind.number_pdus = 0;
nr_fill_rx_indication(&rx_ind, FAPI_NR_MEAS_IND, ue, 0, 0, NULL, proc, &l1_measurements);
nr_downlink_indication_t dl_indication = (nr_downlink_indication_t){.gNB_index = proc->gNB_id, nr_downlink_indication_t dl_indication = (nr_downlink_indication_t){.gNB_index = proc->gNB_id,
.module_id = ue->Mod_id, .module_id = ue->Mod_id,
.cc_id = ue->CC_id, .cc_id = ue->CC_id,
...@@ -170,7 +172,6 @@ static void send_ssb_rsrp_meas(PHY_VARS_NR_UE *ue, ...@@ -170,7 +172,6 @@ static void send_ssb_rsrp_meas(PHY_VARS_NR_UE *ue,
.frame = proc->frame_rx, .frame = proc->frame_rx,
.slot = proc->nr_slot_rx, .slot = proc->nr_slot_rx,
.rx_ind = &rx_ind}; .rx_ind = &rx_ind};
nr_fill_rx_indication(&rx_ind, FAPI_NR_MEAS_IND, ue, 0, 0, NULL, proc, &l1_measurements);
ue->if_inst->dl_indication(&dl_indication); ue->if_inst->dl_indication(&dl_indication);
} }
......
...@@ -1050,7 +1050,8 @@ void nr_ue_csi_rs_procedures(PHY_VARS_NR_UE *ue, ...@@ -1050,7 +1050,8 @@ void nr_ue_csi_rs_procedures(PHY_VARS_NR_UE *ue,
.cqi = cqi, .cqi = cqi,
.radiolink_monitoring = RLM_no_monitoring, // TODO do be activated in case of RLM based on CSI-RS .radiolink_monitoring = RLM_no_monitoring, // TODO do be activated in case of RLM based on CSI-RS
}; };
fapi_nr_rx_indication_t rx_ind = {0}; fapi_nr_rx_indication_t rx_ind;
rx_ind.number_pdus = 0;
nr_fill_rx_indication(&rx_ind, FAPI_NR_MEAS_IND, ue, 0, 0, NULL, proc, (void *)&l1_measurements); nr_fill_rx_indication(&rx_ind, FAPI_NR_MEAS_IND, ue, 0, 0, NULL, proc, (void *)&l1_measurements);
nr_downlink_indication_t dl_indication = (nr_downlink_indication_t){ nr_downlink_indication_t dl_indication = (nr_downlink_indication_t){
.gNB_index = proc->gNB_id, .gNB_index = proc->gNB_id,
......
...@@ -453,7 +453,8 @@ nr_initial_sync_t nr_initial_sync(UE_nr_rxtx_proc_t *proc, ...@@ -453,7 +453,8 @@ nr_initial_sync_t nr_initial_sync(UE_nr_rxtx_proc_t *proc,
// In initial sync, we indicate PBCH to MAC after the scan is complete. // In initial sync, we indicate PBCH to MAC after the scan is complete.
if (ue->if_inst && ue->if_inst->dl_indication) { if (ue->if_inst && ue->if_inst->dl_indication) {
fapi_nr_rx_indication_t rx_ind = {0}; fapi_nr_rx_indication_t rx_ind;
rx_ind.number_pdus = 0;
nr_fill_rx_indication(&rx_ind, FAPI_NR_RX_PDU_TYPE_SSB, ue, 0, 0, NULL, proc, res ? (void *)&res->pbchResult : NULL); nr_fill_rx_indication(&rx_ind, FAPI_NR_RX_PDU_TYPE_SSB, ue, 0, 0, NULL, proc, res ? (void *)&res->pbchResult : NULL);
nr_downlink_indication_t dl_indication = (nr_downlink_indication_t){ nr_downlink_indication_t dl_indication = (nr_downlink_indication_t){
.gNB_index = proc->gNB_id, .gNB_index = proc->gNB_id,
......
...@@ -400,7 +400,8 @@ int nr_pbch_decode(PHY_VARS_NR_UE *ue, ...@@ -400,7 +400,8 @@ int nr_pbch_decode(PHY_VARS_NR_UE *ue,
if (decoderState) { if (decoderState) {
if (ue && ue->if_inst && ue->if_inst->dl_indication) { // decoding failed in synced state if (ue && ue->if_inst && ue->if_inst->dl_indication) { // decoding failed in synced state
fapi_nr_rx_indication_t rx_ind = {0}; fapi_nr_rx_indication_t rx_ind;
rx_ind.number_pdus = 0;
nr_fill_rx_indication(&rx_ind, FAPI_NR_RX_PDU_TYPE_SSB, ue, 0, 0, NULL, proc, NULL); nr_fill_rx_indication(&rx_ind, FAPI_NR_RX_PDU_TYPE_SSB, ue, 0, 0, NULL, proc, NULL);
nr_downlink_indication_t dl_indication = (nr_downlink_indication_t){.gNB_index = proc->gNB_id, nr_downlink_indication_t dl_indication = (nr_downlink_indication_t){.gNB_index = proc->gNB_id,
.module_id = ue->Mod_id, .module_id = ue->Mod_id,
...@@ -466,7 +467,8 @@ int nr_pbch_decode(PHY_VARS_NR_UE *ue, ...@@ -466,7 +467,8 @@ int nr_pbch_decode(PHY_VARS_NR_UE *ue,
#endif #endif
if (ue && ue->if_inst && ue->if_inst->dl_indication) { if (ue && ue->if_inst && ue->if_inst->dl_indication) {
fapi_nr_rx_indication_t rx_ind = {0}; fapi_nr_rx_indication_t rx_ind;
rx_ind.number_pdus = 0;
nr_fill_rx_indication(&rx_ind, FAPI_NR_RX_PDU_TYPE_SSB, ue, 0, 0, NULL, proc, (void *)result); nr_fill_rx_indication(&rx_ind, FAPI_NR_RX_PDU_TYPE_SSB, ue, 0, 0, NULL, proc, (void *)result);
nr_downlink_indication_t dl_indication = (nr_downlink_indication_t){ nr_downlink_indication_t dl_indication = (nr_downlink_indication_t){
.gNB_index = proc->gNB_id, .gNB_index = proc->gNB_id,
......
...@@ -70,7 +70,7 @@ void nr_fill_rx_indication(fapi_nr_rx_indication_t *rx_ind, ...@@ -70,7 +70,7 @@ void nr_fill_rx_indication(fapi_nr_rx_indication_t *rx_ind,
AssertFatal(rx_ind->number_pdus < NFAPI_RX_IND_MAX_PDU - 1, "Exceeded rx_ind array size\n"); AssertFatal(rx_ind->number_pdus < NFAPI_RX_IND_MAX_PDU - 1, "Exceeded rx_ind array size\n");
fapi_nr_rx_indication_body_t *rx = rx_ind->rx_indication_body + rx_ind->number_pdus; fapi_nr_rx_indication_body_t *rx = rx_ind->rx_indication_body + rx_ind->number_pdus;
rx_ind->number_pdus++; rx_ind->number_pdus++;
rx->pdu_type = pdu_type; *rx = (fapi_nr_rx_indication_body_t){.pdu_type = pdu_type};
switch (pdu_type){ switch (pdu_type){
case FAPI_NR_RX_PDU_TYPE_SIB: case FAPI_NR_RX_PDU_TYPE_SIB:
case FAPI_NR_RX_PDU_TYPE_RAR: case FAPI_NR_RX_PDU_TYPE_RAR:
...@@ -724,7 +724,8 @@ static void nr_ue_dlsch_procedures(PHY_VARS_NR_UE *ue, ...@@ -724,7 +724,8 @@ static void nr_ue_dlsch_procedures(PHY_VARS_NR_UE *ue,
// send to mac // send to mac
if (ue->if_inst && ue->if_inst->dl_indication) { if (ue->if_inst && ue->if_inst->dl_indication) {
fapi_nr_rx_indication_t rx_ind = {0}; fapi_nr_rx_indication_t rx_ind;
rx_ind.number_pdus = 0;
nr_fill_rx_indication(&rx_ind, ind_type, ue, cw_idx, harq_pid, dlsch, proc, dl_harq->b); nr_fill_rx_indication(&rx_ind, ind_type, ue, cw_idx, harq_pid, dlsch, proc, dl_harq->b);
nr_downlink_indication_t dl_indication = (nr_downlink_indication_t){ nr_downlink_indication_t dl_indication = (nr_downlink_indication_t){
.gNB_index = proc->gNB_id, .gNB_index = proc->gNB_id,
......
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