Prevent memory leak, use stack for slot indications
This commit is contained in:
@@ -2428,19 +2428,19 @@ void oai_subframe_ind(uint16_t sfn, uint16_t sf) {
|
||||
}
|
||||
}
|
||||
|
||||
void handle_nr_slot_ind(uint16_t sfn, uint16_t slot) {
|
||||
|
||||
void handle_nr_slot_ind(uint16_t sfn, uint16_t slot)
|
||||
{
|
||||
//send VNF slot indication, which is aligned with TX thread, so that it can call the scheduler
|
||||
nfapi_nr_slot_indication_scf_t *ind;
|
||||
ind = (nfapi_nr_slot_indication_scf_t *) malloc(sizeof(nfapi_nr_slot_indication_scf_t));
|
||||
int slot_ahead = 6;
|
||||
//we give four additional slots (2ms) which should be enough time for the VNF to
|
||||
//answer
|
||||
int slot_ahead = 4;
|
||||
uint32_t sfn_slot_tx = sfnslot_add_slot(sfn, slot, slot_ahead);
|
||||
uint16_t sfn_tx = NFAPI_SFNSLOT2SFN(sfn_slot_tx);
|
||||
uint8_t slot_tx = NFAPI_SFNSLOT2SLOT(sfn_slot_tx);
|
||||
|
||||
ind->sfn = sfn_tx;
|
||||
ind->slot = slot_tx;
|
||||
oai_nfapi_nr_slot_indication(ind);
|
||||
NFAPI_TRACE(NFAPI_TRACE_DEBUG, "send slot indication for sfn/slot:%4d.%2d current:%4d.%2d\n", sfn_tx, slot_tx, sfn, slot);
|
||||
nfapi_nr_slot_indication_scf_t ind = { .sfn = sfn_tx, .slot = slot_tx };
|
||||
oai_nfapi_nr_slot_indication(&ind);
|
||||
|
||||
//copy data from appropriate p7 slot buffers into channel structures for PHY processing
|
||||
nfapi_pnf_p7_slot_ind(p7_config_g, p7_config_g->phy_id, sfn, slot);
|
||||
|
||||
Reference in New Issue
Block a user