Merge remote-tracking branch 'origin/develop' into NR_MIMO_memory
This commit is contained in:
@@ -3832,6 +3832,21 @@ int nr_ue_process_rar(nr_downlink_indication_t *dl_info, NR_UL_TIME_ALIGNMENT_t
|
||||
LOG_A(NR_MAC, "[UE %d][RAPROC][%d.%d] Found RAR with the intended RAPID %d\n", mod_id, frame, slot, rarh->RAPID);
|
||||
rar = (NR_MAC_RAR *) (dlsch_buffer + n_subheaders + (n_subPDUs - 1) * sizeof(NR_MAC_RAR));
|
||||
ra->RA_RAPID_found = 1;
|
||||
if (get_softmodem_params()->emulate_l1) {
|
||||
/* When we are emulating L1 with multiple UEs, the rx_indication will have
|
||||
multiple RAR PDUs. The code would previously handle each of these PDUs,
|
||||
but it should only be handling the single RAR that matches the current
|
||||
UE. */
|
||||
LOG_I(NR_MAC, "RAR PDU found for our UE with PDU index %d\n", pdu_id);
|
||||
dl_info->rx_ind->number_pdus = 1;
|
||||
if (pdu_id != 0) {
|
||||
memcpy(&dl_info->rx_ind->rx_indication_body[0],
|
||||
&dl_info->rx_ind->rx_indication_body[pdu_id],
|
||||
sizeof(fapi_nr_rx_indication_body_t));
|
||||
}
|
||||
mac->nr_ue_emul_l1.expected_rar = false;
|
||||
memset(mac->nr_ue_emul_l1.index_has_rar, 0, sizeof(mac->nr_ue_emul_l1.index_has_rar));
|
||||
}
|
||||
break;
|
||||
}
|
||||
if (rarh->E == 0) {
|
||||
|
||||
@@ -628,16 +628,10 @@ int rrc_mac_config_req_gNB(module_id_t Mod_idP,
|
||||
const NR_ServingCellConfig_t *servingCellConfig = CellGroup ? CellGroup->spCellConfig->spCellConfigDedicated : NULL;
|
||||
NR_UE_sched_ctrl_t *sched_ctrl = &UE_info->UE_sched_ctrl[UE_id];
|
||||
const NR_PDSCH_ServingCellConfig_t *pdsch = servingCellConfig ? servingCellConfig->pdsch_ServingCellConfig->choice.setup : NULL;
|
||||
if (sched_ctrl->available_dl_harq.len == 0) {
|
||||
if (get_softmodem_params()->sa) {
|
||||
// add all available DL HARQ processes for this UE in SA
|
||||
create_dl_harq_list(sched_ctrl, pdsch);
|
||||
}
|
||||
else {
|
||||
const int nrofHARQ = pdsch && pdsch->nrofHARQ_ProcessesForPDSCH ?
|
||||
get_nrofHARQ_ProcessesForPDSCH(*pdsch->nrofHARQ_ProcessesForPDSCH) : 8;
|
||||
AssertFatal(sched_ctrl->available_dl_harq.len==nrofHARQ,
|
||||
"Reconfiguration of available harq processes not yet supported\n");
|
||||
}
|
||||
// update coreset/searchspace
|
||||
void *bwpd = NULL;
|
||||
NR_BWP_t *genericParameters = NULL;
|
||||
|
||||
@@ -1942,14 +1942,46 @@ void dump_nr_list(NR_list_t *listP)
|
||||
void create_nr_list(NR_list_t *list, int len)
|
||||
{
|
||||
list->head = -1;
|
||||
list->next = calloc(len, sizeof(*list->next));
|
||||
AssertFatal(list, "cannot calloc() memory for NR_list_t->next\n");
|
||||
list->next = malloc(len * sizeof(*list->next));
|
||||
LOG_W(NR_MAC, "NR list->next %p\n", list->next);
|
||||
AssertFatal(list->next, "cannot malloc() memory for NR_list_t->next\n");
|
||||
for (int i = 0; i < len; ++i)
|
||||
list->next[i] = -1;
|
||||
list->tail = -1;
|
||||
list->len = len;
|
||||
}
|
||||
|
||||
/*
|
||||
* Resize an NR_list
|
||||
*/
|
||||
void resize_nr_list(NR_list_t *list, int new_len)
|
||||
{
|
||||
if (new_len == list->len)
|
||||
return;
|
||||
if (new_len > list->len) {
|
||||
/* list->head remains */
|
||||
const int old_len = list->len;
|
||||
int* n = realloc(list->next, new_len * sizeof(*list->next));
|
||||
AssertFatal(n, "cannot realloc() memory for NR_list_t->next\n");
|
||||
list->next = n;
|
||||
for (int i = old_len; i < new_len; ++i)
|
||||
list->next[i] = -1;
|
||||
/* list->tail remains */
|
||||
list->len = new_len;
|
||||
} else { /* new_len < len */
|
||||
AssertFatal(list->head < new_len, "shortened list head out of index %d (new len %d)\n", list->head, new_len);
|
||||
AssertFatal(list->tail < new_len, "shortened list tail out of index %d (new len %d)\n", list->head, new_len);
|
||||
for (int i = 0; i < list->len; ++i)
|
||||
AssertFatal(list->next[i] < new_len, "shortened list entry out of index %d (new len %d)\n", list->next[i], new_len);
|
||||
/* list->head remains */
|
||||
int *n = realloc(list->next, new_len * sizeof(*list->next));
|
||||
AssertFatal(n, "cannot realloc() memory for NR_list_t->next\n");
|
||||
list->next = n;
|
||||
/* list->tail remains */
|
||||
list->len = new_len;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
* Destroy an NR_list
|
||||
*/
|
||||
@@ -2205,10 +2237,8 @@ int add_new_nr_ue(module_id_t mod_idP, rnti_t rntiP, NR_CellGroupConfig_t *CellG
|
||||
"no pdsch-ServingCellConfig found for UE %d\n",
|
||||
UE_id);
|
||||
const NR_PDSCH_ServingCellConfig_t *pdsch = servingCellConfig ? servingCellConfig->pdsch_ServingCellConfig->choice.setup : NULL;
|
||||
// add DL HARQ processes for this UE only in NSA
|
||||
// (SA still doesn't have information on nrofHARQ_ProcessesForPDSCH at this stage)
|
||||
if (!get_softmodem_params()->sa)
|
||||
create_dl_harq_list(sched_ctrl,pdsch);
|
||||
// pdsch == NULL in SA -> will create default (8) number of HARQ processes
|
||||
create_dl_harq_list(sched_ctrl, pdsch);
|
||||
// add all available UL HARQ processes for this UE
|
||||
// nb of ul harq processes not configurable
|
||||
create_nr_list(&sched_ctrl->available_ul_harq, 16);
|
||||
@@ -2236,11 +2266,23 @@ void create_dl_harq_list(NR_UE_sched_ctrl_t *sched_ctrl,
|
||||
const int nrofHARQ = pdsch && pdsch->nrofHARQ_ProcessesForPDSCH ?
|
||||
get_nrofHARQ_ProcessesForPDSCH(*pdsch->nrofHARQ_ProcessesForPDSCH) : 8;
|
||||
// add all available DL HARQ processes for this UE
|
||||
create_nr_list(&sched_ctrl->available_dl_harq, nrofHARQ);
|
||||
for (int harq = 0; harq < nrofHARQ; harq++)
|
||||
add_tail_nr_list(&sched_ctrl->available_dl_harq, harq);
|
||||
create_nr_list(&sched_ctrl->feedback_dl_harq, nrofHARQ);
|
||||
create_nr_list(&sched_ctrl->retrans_dl_harq, nrofHARQ);
|
||||
AssertFatal(sched_ctrl->available_dl_harq.len == sched_ctrl->feedback_dl_harq.len
|
||||
&& sched_ctrl->available_dl_harq.len == sched_ctrl->retrans_dl_harq.len,
|
||||
"HARQ lists have different lengths (%d/%d/%d)\n",
|
||||
sched_ctrl->available_dl_harq.len,
|
||||
sched_ctrl->feedback_dl_harq.len,
|
||||
sched_ctrl->retrans_dl_harq.len);
|
||||
if (sched_ctrl->available_dl_harq.len == 0) {
|
||||
create_nr_list(&sched_ctrl->available_dl_harq, nrofHARQ);
|
||||
for (int harq = 0; harq < nrofHARQ; harq++)
|
||||
add_tail_nr_list(&sched_ctrl->available_dl_harq, harq);
|
||||
create_nr_list(&sched_ctrl->feedback_dl_harq, nrofHARQ);
|
||||
create_nr_list(&sched_ctrl->retrans_dl_harq, nrofHARQ);
|
||||
} else {
|
||||
resize_nr_list(&sched_ctrl->available_dl_harq, nrofHARQ);
|
||||
resize_nr_list(&sched_ctrl->feedback_dl_harq, nrofHARQ);
|
||||
resize_nr_list(&sched_ctrl->retrans_dl_harq, nrofHARQ);
|
||||
}
|
||||
}
|
||||
|
||||
/* hack data to remove UE in the phy */
|
||||
|
||||
@@ -351,6 +351,7 @@ int NRRIV2PRBOFFSET(int locationAndBandwidth,int N_RB);
|
||||
/* Functions to manage an NR_list_t */
|
||||
void dump_nr_list(NR_list_t *listP);
|
||||
void create_nr_list(NR_list_t *listP, int len);
|
||||
void resize_nr_list(NR_list_t *list, int new_len);
|
||||
void destroy_nr_list(NR_list_t *list);
|
||||
void add_nr_list(NR_list_t *listP, int id);
|
||||
void remove_nr_list(NR_list_t *listP, int id);
|
||||
|
||||
@@ -101,13 +101,6 @@ typedef struct {
|
||||
|
||||
static rlc_data_req_queue q;
|
||||
|
||||
extern rlc_op_status_t nr_rrc_rlc_config_asn1_req (const protocol_ctxt_t * const ctxt_pP,
|
||||
const NR_SRB_ToAddModList_t * const srb2add_listP,
|
||||
const NR_DRB_ToAddModList_t * const drb2add_listP,
|
||||
const NR_DRB_ToReleaseList_t * const drb2release_listP,
|
||||
const LTE_PMCH_InfoList_r9_t * const pmch_InfoList_r9_pP,
|
||||
struct NR_CellGroupConfig__rlc_BearerToAddModList *rlc_bearer2add_list);
|
||||
|
||||
static void *rlc_data_req_thread(void *_)
|
||||
{
|
||||
int i;
|
||||
|
||||
@@ -1044,7 +1044,7 @@ next_pdu:
|
||||
set_end_different_sdu:
|
||||
/* don't go more than rx_highest_status - 1 */
|
||||
if (sn_compare_rx(entity, entity->rx_highest_status, cur->sn) <= 0) {
|
||||
ret.so_end = (entity->rx_highest_status - 1 + entity->sn_modulus) %
|
||||
ret.sn_end = (entity->rx_highest_status - 1 + entity->sn_modulus) %
|
||||
entity->sn_modulus;
|
||||
ret.so_end = 0xffff;
|
||||
return ret;
|
||||
@@ -1305,9 +1305,8 @@ static int missing_size(nr_rlc_entity_am_t *entity, missing_data_t *m,
|
||||
missing_data_t m_nack;
|
||||
|
||||
/* be careful to limit a range to 255 SNs, that is: cut if needed */
|
||||
sn_count = m->sn_end - m->sn_start + 1;
|
||||
if (sn_count < 0)
|
||||
sn_count += entity->sn_modulus;
|
||||
sn_count = (m->sn_end - m->sn_start + entity->sn_modulus)
|
||||
% entity->sn_modulus + 1;
|
||||
|
||||
sn_start = m->sn_start;
|
||||
|
||||
|
||||
@@ -63,7 +63,7 @@ extern uint16_t sl_ahead;
|
||||
|
||||
void handle_nr_rach(NR_UL_IND_t *UL_info)
|
||||
{
|
||||
if(NFAPI_MODE == NFAPI_MODE_PNF) {
|
||||
if (NFAPI_MODE == NFAPI_MODE_PNF) {
|
||||
if (UL_info->rach_ind.number_of_pdus > 0) {
|
||||
LOG_D(PHY,"UL_info->UL_info->rach_ind.number_of_pdus:%d SFN/Slot:%d.%d \n", UL_info->rach_ind.number_of_pdus, UL_info->rach_ind.sfn,UL_info->rach_ind.slot);
|
||||
oai_nfapi_nr_rach_indication(&UL_info->rach_ind);
|
||||
@@ -71,69 +71,29 @@ void handle_nr_rach(NR_UL_IND_t *UL_info)
|
||||
}
|
||||
return;
|
||||
}
|
||||
NR_UL_IND_t UL_INFO;
|
||||
nfapi_nr_rach_indication_t *rach_ind = NULL;
|
||||
if (get_softmodem_params()->emulate_l1)
|
||||
{
|
||||
if (gnb_rach_ind_queue.num_items == 0)
|
||||
return;
|
||||
LOG_I(NR_MAC, "gnb_rach_ind_queue size = %zu\n", gnb_rach_ind_queue.num_items);
|
||||
rach_ind = get_queue(&gnb_rach_ind_queue);
|
||||
|
||||
UL_INFO.rach_ind = *rach_ind;
|
||||
UL_INFO.module_id = UL_info->module_id;
|
||||
UL_INFO.CC_id = UL_info->CC_id;
|
||||
}
|
||||
else
|
||||
{
|
||||
UL_INFO.rach_ind = UL_info->rach_ind;
|
||||
UL_INFO.module_id = UL_info->module_id;
|
||||
UL_INFO.CC_id = UL_info->CC_id;
|
||||
}
|
||||
|
||||
int frame_diff = UL_info->frame - UL_INFO.rach_ind.sfn;
|
||||
if (frame_diff < 0)
|
||||
{
|
||||
int frame_diff = UL_info->frame - UL_info->rach_ind.sfn;
|
||||
if (frame_diff < 0) {
|
||||
frame_diff += 1024;
|
||||
}
|
||||
bool in_timewindow = frame_diff == 0 || (frame_diff == 1 && UL_info->slot < 7);
|
||||
|
||||
if (UL_INFO.rach_ind.number_of_pdus>0 && in_timewindow) {
|
||||
if (UL_info->rach_ind.number_of_pdus > 0 && in_timewindow) {
|
||||
LOG_A(MAC,"UL_info[Frame %d, Slot %d] Calling initiate_ra_proc RACH:SFN/SLOT:%d/%d\n",
|
||||
UL_info->frame, UL_info->slot, UL_INFO.rach_ind.sfn, UL_INFO.rach_ind.slot);
|
||||
int npdus = UL_INFO.rach_ind.number_of_pdus;
|
||||
for(int i = 0; i < npdus; i++) {
|
||||
UL_INFO.rach_ind.number_of_pdus--;
|
||||
UL_info->frame, UL_info->slot, UL_info->rach_ind.sfn, UL_info->rach_ind.slot);
|
||||
for (int i = 0; i < UL_info->rach_ind.number_of_pdus; i++) {
|
||||
UL_info->rach_ind.number_of_pdus--;
|
||||
if (UL_INFO.rach_ind.pdu_list[i].num_preamble>0)
|
||||
AssertFatal(UL_INFO.rach_ind.pdu_list[i].num_preamble==1,
|
||||
"More than 1 preamble not supported\n");
|
||||
|
||||
nr_initiate_ra_proc(UL_INFO.module_id,
|
||||
UL_INFO.CC_id,
|
||||
UL_INFO.rach_ind.sfn,
|
||||
UL_INFO.rach_ind.slot,
|
||||
UL_INFO.rach_ind.pdu_list[i].preamble_list[0].preamble_index,
|
||||
UL_INFO.rach_ind.pdu_list[i].freq_index,
|
||||
UL_INFO.rach_ind.pdu_list[i].symbol_index,
|
||||
UL_INFO.rach_ind.pdu_list[i].preamble_list[0].timing_advance);
|
||||
AssertFatal(UL_info->rach_ind.pdu_list[i].num_preamble == 1, "More than 1 preamble not supported\n");
|
||||
nr_initiate_ra_proc(UL_info->module_id,
|
||||
UL_info->CC_id,
|
||||
UL_info->rach_ind.sfn,
|
||||
UL_info->rach_ind.slot,
|
||||
UL_info->rach_ind.pdu_list[i].preamble_list[0].preamble_index,
|
||||
UL_info->rach_ind.pdu_list[i].freq_index,
|
||||
UL_info->rach_ind.pdu_list[i].symbol_index,
|
||||
UL_info->rach_ind.pdu_list[i].preamble_list[0].timing_advance);
|
||||
}
|
||||
}
|
||||
if (get_softmodem_params()->emulate_l1)
|
||||
{
|
||||
if (rach_ind && rach_ind->number_of_pdus > 0)
|
||||
{
|
||||
for(int i = 0; i < rach_ind->number_of_pdus; i++)
|
||||
{
|
||||
free(rach_ind->pdu_list[i].preamble_list);
|
||||
rach_ind->pdu_list[i].preamble_list = NULL;
|
||||
}
|
||||
free(rach_ind->pdu_list);
|
||||
rach_ind->pdu_list = NULL;
|
||||
}
|
||||
free(rach_ind);
|
||||
rach_ind = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -148,26 +108,11 @@ void handle_nr_uci(NR_UL_IND_t *UL_info)
|
||||
return;
|
||||
}
|
||||
|
||||
NR_UL_IND_t UL_INFO;
|
||||
nfapi_nr_uci_indication_t *uci_ind = NULL;
|
||||
if (get_softmodem_params()->emulate_l1)
|
||||
{
|
||||
if (gnb_uci_ind_queue.num_items == 0)
|
||||
return;
|
||||
LOG_I(NR_MAC, "gnb_uci_ind_queue size = %zu\n", gnb_uci_ind_queue.num_items);
|
||||
uci_ind = get_queue(&gnb_uci_ind_queue);
|
||||
UL_INFO.uci_ind = *uci_ind;
|
||||
}
|
||||
else
|
||||
{
|
||||
UL_INFO.uci_ind = UL_info->uci_ind;
|
||||
}
|
||||
|
||||
const module_id_t mod_id = UL_info->module_id;
|
||||
const frame_t frame = UL_INFO.uci_ind.sfn;
|
||||
const sub_frame_t slot = UL_INFO.uci_ind.slot;
|
||||
int num_ucis = UL_INFO.uci_ind.num_ucis;
|
||||
nfapi_nr_uci_t *uci_list = UL_INFO.uci_ind.uci_list;
|
||||
const frame_t frame = UL_info->uci_ind.sfn;
|
||||
const sub_frame_t slot = UL_info->uci_ind.slot;
|
||||
int num_ucis = UL_info->uci_ind.num_ucis;
|
||||
nfapi_nr_uci_t *uci_list = UL_info->uci_ind.uci_list;
|
||||
|
||||
for (int i = 0; i < num_ucis; i++) {
|
||||
switch (uci_list[i].pdu_type) {
|
||||
@@ -178,7 +123,7 @@ void handle_nr_uci(NR_UL_IND_t *UL_info)
|
||||
case NFAPI_NR_UCI_FORMAT_0_1_PDU_TYPE: {
|
||||
const nfapi_nr_uci_pucch_pdu_format_0_1_t *uci_pdu = &uci_list[i].pucch_pdu_format_0_1;
|
||||
LOG_D(NR_MAC, "The received uci has sfn slot %d %d, num_ucis %d and pdu_size %d\n",
|
||||
UL_INFO.uci_ind.sfn, UL_INFO.uci_ind.slot, num_ucis, uci_list[i].pdu_size);
|
||||
UL_info->uci_ind.sfn, UL_info->uci_ind.slot, num_ucis, uci_list[i].pdu_size);
|
||||
handle_nr_uci_pucch_0_1(mod_id, frame, slot, uci_pdu);
|
||||
break;
|
||||
}
|
||||
@@ -192,39 +137,8 @@ void handle_nr_uci(NR_UL_IND_t *UL_info)
|
||||
}
|
||||
}
|
||||
|
||||
if (get_softmodem_params()->emulate_l1)
|
||||
{
|
||||
for (int i = 0; i < num_ucis; i++) {
|
||||
switch (uci_list[i].pdu_type) {
|
||||
case NFAPI_NR_UCI_FORMAT_0_1_PDU_TYPE:
|
||||
if (uci_list[i].pucch_pdu_format_0_1.harq) {
|
||||
free(uci_list[i].pucch_pdu_format_0_1.harq->harq_list);
|
||||
uci_list[i].pucch_pdu_format_0_1.harq->harq_list = NULL;
|
||||
}
|
||||
free(uci_list[i].pucch_pdu_format_0_1.harq);
|
||||
uci_list[i].pucch_pdu_format_0_1.harq = NULL;
|
||||
free(uci_list[i].pucch_pdu_format_0_1.sr);
|
||||
uci_list[i].pucch_pdu_format_0_1.sr = NULL;
|
||||
break;
|
||||
UL_info->uci_ind.num_ucis = 0;
|
||||
|
||||
case NFAPI_NR_UCI_FORMAT_2_3_4_PDU_TYPE:
|
||||
free(uci_list[i].pucch_pdu_format_2_3_4.harq.harq_payload);
|
||||
free(uci_list[i].pucch_pdu_format_2_3_4.csi_part1.csi_part1_payload);
|
||||
free(uci_list[i].pucch_pdu_format_2_3_4.csi_part2.csi_part2_payload);
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (uci_ind && num_ucis > 0) {
|
||||
free(uci_list);
|
||||
uci_list = NULL;
|
||||
}
|
||||
free(uci_ind);
|
||||
uci_ind = NULL;
|
||||
}
|
||||
else
|
||||
{
|
||||
UL_info->uci_ind.num_ucis = 0;
|
||||
}
|
||||
}
|
||||
|
||||
static bool crc_sfn_slot_matcher(void *wanted, void *candidate)
|
||||
@@ -264,173 +178,202 @@ void handle_nr_ulsch(NR_UL_IND_t *UL_info)
|
||||
return;
|
||||
}
|
||||
|
||||
NR_UL_IND_t UL_INFO;
|
||||
nfapi_nr_rx_data_indication_t *rx_ind = NULL;
|
||||
nfapi_nr_crc_indication_t *crc_ind = NULL;
|
||||
if (get_softmodem_params()->emulate_l1)
|
||||
{
|
||||
rx_ind = get_queue(&gnb_rx_ind_queue);
|
||||
if (!rx_ind)
|
||||
{
|
||||
LOG_D(NR_PHY, "No rx data indication (empty gnb_rx_ind_queue)\n");
|
||||
return;
|
||||
if (UL_info->rx_ind.number_of_pdus > 0 && UL_info->crc_ind.number_crcs > 0) {
|
||||
AssertFatal(UL_info->rx_ind.number_of_pdus == UL_info->crc_ind.number_crcs,
|
||||
"number_of_pdus %d, number_crcs %d\n",
|
||||
UL_info->rx_ind.number_of_pdus, UL_info->crc_ind.number_crcs);
|
||||
for (int i = 0; i < UL_info->rx_ind.number_of_pdus; i++) {
|
||||
const nfapi_nr_rx_data_pdu_t *rx = &UL_info->rx_ind.pdu_list[i];
|
||||
const nfapi_nr_crc_t *crc = &UL_info->crc_ind.crc_list[i];
|
||||
LOG_D(NR_PHY, "UL_info->crc_ind.pdu_list[%d].rnti:%04x "
|
||||
"UL_info->rx_ind.pdu_list[%d].rnti:%04x\n",
|
||||
i, crc->rnti, i, rx->rnti);
|
||||
|
||||
AssertFatal(crc->rnti == rx->rnti, "mis-match between CRC RNTI %04x and RX RNTI %04x\n",
|
||||
crc->rnti, rx->rnti);
|
||||
|
||||
LOG_D(NR_MAC,
|
||||
"%4d.%2d Calling rx_sdu (CRC %s/tb_crc_status %d)\n",
|
||||
UL_info->frame,
|
||||
UL_info->slot,
|
||||
crc->tb_crc_status ? "error" : "ok",
|
||||
crc->tb_crc_status);
|
||||
|
||||
/* if CRC passes, pass PDU, otherwise pass NULL as error indication */
|
||||
nr_rx_sdu(UL_info->module_id,
|
||||
UL_info->CC_id,
|
||||
UL_info->rx_ind.sfn,
|
||||
UL_info->rx_ind.slot,
|
||||
rx->rnti,
|
||||
crc->tb_crc_status ? NULL : rx->pdu,
|
||||
rx->pdu_length,
|
||||
rx->timing_advance,
|
||||
rx->ul_cqi,
|
||||
rx->rssi);
|
||||
handle_nr_ul_harq(UL_info->CC_id, UL_info->module_id, UL_info->frame, UL_info->slot, crc);
|
||||
}
|
||||
|
||||
int sfn_slot = NFAPI_SFNSLOT2HEX(rx_ind->sfn, rx_ind->slot);
|
||||
|
||||
crc_ind = unqueue_matching(&gnb_crc_ind_queue,
|
||||
MAX_QUEUE_SIZE,
|
||||
crc_sfn_slot_matcher,
|
||||
&sfn_slot);
|
||||
if (!crc_ind)
|
||||
{
|
||||
LOG_D(NR_PHY, "No crc indication with the same SFN SLOT of rx indication %u %u\n", rx_ind->sfn, rx_ind->slot);
|
||||
put_queue(&gnb_rx_ind_queue, rx_ind);
|
||||
return;
|
||||
}
|
||||
|
||||
UL_INFO.rx_ind = *rx_ind;
|
||||
UL_INFO.crc_ind = *crc_ind;
|
||||
UL_INFO.module_id = UL_info->module_id;
|
||||
UL_INFO.CC_id = UL_info->CC_id;
|
||||
}
|
||||
else
|
||||
UL_info->rx_ind.number_of_pdus = 0;
|
||||
UL_info->crc_ind.number_crcs = 0;
|
||||
}
|
||||
|
||||
static void free_unqueued_nfapi_indications(nfapi_nr_rach_indication_t *rach_ind,
|
||||
nfapi_nr_uci_indication_t *uci_ind,
|
||||
nfapi_nr_rx_data_indication_t *rx_ind,
|
||||
nfapi_nr_crc_indication_t *crc_ind) {
|
||||
if (rach_ind && rach_ind->number_of_pdus > 0)
|
||||
{
|
||||
UL_INFO.rx_ind = UL_info->rx_ind;
|
||||
UL_INFO.crc_ind = UL_info->crc_ind;
|
||||
UL_INFO.module_id = UL_info->module_id;
|
||||
UL_INFO.CC_id = UL_info->CC_id;
|
||||
for(int i = 0; i < rach_ind->number_of_pdus; i++)
|
||||
{
|
||||
free_and_zero(rach_ind->pdu_list[i].preamble_list);
|
||||
}
|
||||
free_and_zero(rach_ind->pdu_list);
|
||||
free_and_zero(rach_ind);
|
||||
}
|
||||
if (uci_ind && uci_ind->num_ucis > 0)
|
||||
{
|
||||
for (int i = 0; i < uci_ind->num_ucis; i++) {
|
||||
switch (uci_ind->uci_list[i].pdu_type) {
|
||||
case NFAPI_NR_UCI_FORMAT_0_1_PDU_TYPE:
|
||||
if (uci_ind->uci_list[i].pucch_pdu_format_0_1.harq) {
|
||||
free_and_zero(uci_ind->uci_list[i].pucch_pdu_format_0_1.harq->harq_list);
|
||||
}
|
||||
free_and_zero(uci_ind->uci_list[i].pucch_pdu_format_0_1.harq);
|
||||
free_and_zero(uci_ind->uci_list[i].pucch_pdu_format_0_1.sr);
|
||||
break;
|
||||
|
||||
UL_INFO.frame = UL_INFO.rx_ind.sfn;
|
||||
UL_INFO.slot = UL_INFO.rx_ind.slot;
|
||||
UL_INFO.module_id = UL_info->module_id;
|
||||
UL_INFO.CC_id = UL_info->CC_id;
|
||||
LOG_D(NR_MAC, " UL_info frame slot vs rx_ind frame slot vs crc_ind slot frame slot = %u %u vs %u %u vs %u %u\n",
|
||||
UL_info->frame, UL_info->slot,
|
||||
UL_INFO.rx_ind.sfn, UL_INFO.rx_ind.slot,
|
||||
UL_INFO.crc_ind.sfn, UL_INFO.crc_ind.slot
|
||||
);
|
||||
case NFAPI_NR_UCI_FORMAT_2_3_4_PDU_TYPE:
|
||||
free_and_zero(uci_ind->uci_list[i].pucch_pdu_format_2_3_4.harq.harq_payload);
|
||||
free_and_zero(uci_ind->uci_list[i].pucch_pdu_format_2_3_4.csi_part1.csi_part1_payload);
|
||||
free_and_zero(uci_ind->uci_list[i].pucch_pdu_format_2_3_4.csi_part2.csi_part2_payload);
|
||||
break;
|
||||
}
|
||||
}
|
||||
free_and_zero(uci_ind->uci_list);
|
||||
free_and_zero(uci_ind);
|
||||
}
|
||||
if (rx_ind && rx_ind->number_of_pdus > 0)
|
||||
{
|
||||
free_and_zero(rx_ind->pdu_list);
|
||||
free_and_zero(rx_ind);
|
||||
}
|
||||
if (crc_ind && crc_ind->number_crcs > 0)
|
||||
{
|
||||
free_and_zero(crc_ind->crc_list);
|
||||
free_and_zero(crc_ind);
|
||||
}
|
||||
}
|
||||
|
||||
if (UL_INFO.rx_ind.number_of_pdus > 0 && UL_INFO.crc_ind.number_crcs > 0) {
|
||||
for (int i = 0; i < UL_INFO.rx_ind.number_of_pdus; i++) {
|
||||
int j;
|
||||
for (j = 0; j < UL_INFO.crc_ind.number_crcs; j++) {
|
||||
// find crc_indication j corresponding rx_indication i
|
||||
const nfapi_nr_rx_data_pdu_t *rx = &UL_INFO.rx_ind.pdu_list[i];
|
||||
const nfapi_nr_crc_t *crc = &UL_INFO.crc_ind.crc_list[j];
|
||||
LOG_D(NR_PHY,
|
||||
"UL_INFO.crc_ind.pdu_list[%d].rnti:%04x "
|
||||
"UL_INFO.rx_ind.pdu_list[%d].rnti:%04x\n",
|
||||
j,
|
||||
crc->rnti,
|
||||
i,
|
||||
rx->rnti);
|
||||
static void remove_crc_pdu(nfapi_nr_crc_indication_t *crc_ind, int index) {
|
||||
AssertFatal(index >= 0, "Invalid index %d\n", index);
|
||||
AssertFatal(index < crc_ind->number_crcs, "Invalid index %d\n", index);
|
||||
AssertFatal(crc_ind->number_crcs > 0, "Invalid crc_ind->number_crcs %d\n", crc_ind->number_crcs);
|
||||
|
||||
if (crc->rnti != rx->rnti)
|
||||
{
|
||||
LOG_D(NR_MAC, "mis-match between CRC rnti %04x and RX rnit %04x\n", crc->rnti, rx->rnti);
|
||||
continue;
|
||||
}
|
||||
memmove(crc_ind->crc_list + index,
|
||||
crc_ind->crc_list + index + 1,
|
||||
sizeof(*crc_ind->crc_list) * (crc_ind->number_crcs - index - 1));
|
||||
crc_ind->number_crcs--;
|
||||
}
|
||||
|
||||
LOG_D(NR_MAC,
|
||||
"%4d.%2d Calling rx_sdu (CRC %s/tb_crc_status %d)\n",
|
||||
UL_INFO.frame,
|
||||
UL_INFO.slot,
|
||||
crc->tb_crc_status ? "error" : "ok",
|
||||
crc->tb_crc_status);
|
||||
static void remove_rx_pdu(nfapi_nr_rx_data_indication_t *rx_ind, int index) {
|
||||
AssertFatal(index >= 0, "Invalid index %d\n", index);
|
||||
AssertFatal(index < rx_ind->number_of_pdus, "Invalid index %d\n", index);
|
||||
AssertFatal(rx_ind->number_of_pdus > 0, "Invalid rx_ind->number_of_pdus %d\n", rx_ind->number_of_pdus);
|
||||
|
||||
/* if CRC passes, pass PDU, otherwise pass NULL as error indication */
|
||||
nr_rx_sdu(UL_INFO.module_id,
|
||||
UL_INFO.CC_id,
|
||||
UL_INFO.rx_ind.sfn,
|
||||
UL_INFO.rx_ind.slot,
|
||||
rx->rnti,
|
||||
crc->tb_crc_status ? NULL : rx->pdu,
|
||||
rx->pdu_length,
|
||||
rx->timing_advance,
|
||||
rx->ul_cqi,
|
||||
rx->rssi);
|
||||
handle_nr_ul_harq(UL_INFO.CC_id, UL_INFO.module_id, UL_INFO.frame, UL_INFO.slot, crc);
|
||||
memmove(rx_ind->pdu_list + index,
|
||||
rx_ind->pdu_list + index + 1,
|
||||
sizeof(*rx_ind->pdu_list) * (rx_ind->number_of_pdus - index - 1));
|
||||
rx_ind->number_of_pdus--;
|
||||
}
|
||||
|
||||
static bool crc_ind_has_rnti(nfapi_nr_crc_indication_t *crc_ind, uint16_t rnti) {
|
||||
for (int i = 0; i < crc_ind->number_crcs; i++) {
|
||||
if (rnti == crc_ind->crc_list[i].rnti) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
static bool rx_ind_has_rnti(nfapi_nr_rx_data_indication_t *rx_ind, uint16_t rnti) {
|
||||
for (int i = 0; i < rx_ind->number_of_pdus; i++) {
|
||||
if (rnti == rx_ind->pdu_list[i].rnti) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
static void match_crc_rx_pdu(nfapi_nr_rx_data_indication_t *rx_ind, nfapi_nr_crc_indication_t *crc_ind) {
|
||||
AssertFatal(crc_ind->number_crcs > 0 && rx_ind->number_of_pdus > 0,
|
||||
"Invalid number of crc_ind->number_crcs %d or rx_ind->number_of_pdus %d\n",
|
||||
crc_ind->number_crcs, rx_ind->number_of_pdus);
|
||||
if (crc_ind->number_crcs > rx_ind->number_of_pdus) {
|
||||
int num_unmatched_crcs = 0;
|
||||
nfapi_nr_crc_indication_t *crc_ind_unmatched = calloc(1, sizeof(*crc_ind_unmatched));
|
||||
crc_ind_unmatched->header = crc_ind->header;
|
||||
crc_ind_unmatched->sfn = crc_ind->sfn;
|
||||
crc_ind_unmatched->slot = crc_ind->slot;
|
||||
crc_ind_unmatched->number_crcs = crc_ind->number_crcs - rx_ind->number_of_pdus;
|
||||
crc_ind_unmatched->crc_list = calloc(crc_ind_unmatched->number_crcs, sizeof(nfapi_nr_crc_t));
|
||||
for (int i = 0; i < crc_ind->number_crcs; i++) {
|
||||
if (!rx_ind_has_rnti(rx_ind, crc_ind->crc_list[i].rnti)) {
|
||||
LOG_I(NR_MAC, "crc_ind->crc_list[%d].rnti %x does not match any rx_ind pdu rnti\n",
|
||||
i, crc_ind->crc_list[i].rnti);
|
||||
crc_ind_unmatched->crc_list[num_unmatched_crcs] = crc_ind->crc_list[i];
|
||||
num_unmatched_crcs++;
|
||||
remove_crc_pdu(crc_ind, i);
|
||||
}
|
||||
if (crc_ind->number_crcs == rx_ind->number_of_pdus) {
|
||||
break;
|
||||
} // for (j=0;j<UL_INFO.crc_ind.number_crcs;j++)
|
||||
if (get_softmodem_params()->emulate_l1)
|
||||
{
|
||||
int last = UL_INFO.crc_ind.number_crcs - 1;
|
||||
if (j < last)
|
||||
{
|
||||
crc_ind->crc_list[j] = crc_ind->crc_list[last];
|
||||
UL_INFO.crc_ind.number_crcs--;
|
||||
}
|
||||
else if (j == last)
|
||||
{
|
||||
UL_INFO.crc_ind.number_crcs--;
|
||||
}
|
||||
|
||||
last = UL_INFO.rx_ind.number_of_pdus - 1;
|
||||
if (i < last)
|
||||
{
|
||||
rx_ind->pdu_list[i] = rx_ind->pdu_list[last];
|
||||
UL_INFO.rx_ind.number_of_pdus--;
|
||||
i--;
|
||||
}
|
||||
else if (i == last)
|
||||
{
|
||||
UL_INFO.rx_ind.number_of_pdus--;
|
||||
}
|
||||
}
|
||||
} // for (i=0;i<UL_INFO.rx_ind.number_of_pdus;i++)
|
||||
if (get_softmodem_params()->emulate_l1)
|
||||
{
|
||||
if (UL_INFO.crc_ind.number_crcs > 0)
|
||||
{
|
||||
crc_ind->number_crcs = UL_INFO.crc_ind.number_crcs;
|
||||
requeue(&gnb_crc_ind_queue, crc_ind);
|
||||
}
|
||||
|
||||
if (UL_INFO.rx_ind.number_of_pdus > 0)
|
||||
{
|
||||
rx_ind->number_of_pdus = UL_INFO.rx_ind.number_of_pdus;
|
||||
requeue(&gnb_rx_ind_queue, rx_ind);
|
||||
}
|
||||
|
||||
if (UL_INFO.crc_ind.number_crcs == 0)
|
||||
{
|
||||
free(crc_ind->crc_list);
|
||||
crc_ind->crc_list = NULL;
|
||||
free(crc_ind);
|
||||
crc_ind = NULL;
|
||||
}
|
||||
if (UL_INFO.rx_ind.number_of_pdus == 0)
|
||||
{
|
||||
free(rx_ind->pdu_list);
|
||||
rx_ind->pdu_list = NULL;
|
||||
free(rx_ind);
|
||||
rx_ind = NULL;
|
||||
}
|
||||
}
|
||||
else
|
||||
AssertFatal(crc_ind_unmatched->number_crcs == num_unmatched_crcs, "crc_ind num_pdus %d doesnt match %d\n",
|
||||
crc_ind_unmatched->number_crcs, num_unmatched_crcs);
|
||||
if (!requeue(&gnb_crc_ind_queue, crc_ind_unmatched))
|
||||
{
|
||||
UL_info->crc_ind.number_crcs = 0;
|
||||
UL_info->rx_ind.number_of_pdus = 0;
|
||||
LOG_E(NR_PHY, "requeue failed for crc_ind_unmatched.\n");
|
||||
free_and_zero(crc_ind_unmatched->crc_list);
|
||||
free_and_zero(crc_ind_unmatched);
|
||||
}
|
||||
} else if ((UL_INFO.rx_ind.number_of_pdus != 0)
|
||||
|| (UL_INFO.crc_ind.number_crcs != 0)) {
|
||||
LOG_E(NR_PHY,
|
||||
"hoping not to have mis-match between CRC ind and RX ind - "
|
||||
"hopefully the missing message is coming shortly "
|
||||
"rx_ind:%d(SFN/SL:%d/%d) crc_ind:%d(SFN/SL:%d/%d) \n",
|
||||
UL_INFO.rx_ind.number_of_pdus,
|
||||
UL_INFO.rx_ind.sfn,
|
||||
UL_INFO.rx_ind.slot,
|
||||
UL_INFO.crc_ind.number_crcs,
|
||||
UL_INFO.crc_ind.sfn,
|
||||
UL_INFO.crc_ind.slot);
|
||||
}
|
||||
else if (crc_ind->number_crcs < rx_ind->number_of_pdus) {
|
||||
int num_unmatched_rxs = 0;
|
||||
nfapi_nr_rx_data_indication_t *rx_ind_unmatched = calloc(1, sizeof(*rx_ind_unmatched));
|
||||
rx_ind_unmatched->header = rx_ind->header;
|
||||
rx_ind_unmatched->sfn = rx_ind->sfn;
|
||||
rx_ind_unmatched->slot = rx_ind->slot;
|
||||
rx_ind_unmatched->number_of_pdus = rx_ind->number_of_pdus - crc_ind->number_crcs;
|
||||
rx_ind_unmatched->pdu_list = calloc(rx_ind_unmatched->number_of_pdus, sizeof(nfapi_nr_pdu_t));
|
||||
for (int i = 0; i < rx_ind->number_of_pdus; i++) {
|
||||
if (!crc_ind_has_rnti(crc_ind, rx_ind->pdu_list[i].rnti)) {
|
||||
LOG_I(NR_MAC, "rx_ind->pdu_list[%d].rnti %d does not match any crc_ind pdu rnti\n",
|
||||
i, rx_ind->pdu_list[i].rnti);
|
||||
rx_ind_unmatched->pdu_list[num_unmatched_rxs] = rx_ind->pdu_list[i];
|
||||
num_unmatched_rxs++;
|
||||
remove_rx_pdu(rx_ind, i);
|
||||
}
|
||||
if (rx_ind->number_of_pdus == crc_ind->number_crcs) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
AssertFatal(rx_ind_unmatched->number_of_pdus == num_unmatched_rxs, "rx_ind num_pdus %d doesnt match %d\n",
|
||||
rx_ind_unmatched->number_of_pdus, num_unmatched_rxs);
|
||||
if (!requeue(&gnb_rx_ind_queue, rx_ind_unmatched))
|
||||
{
|
||||
LOG_E(NR_PHY, "requeue failed for rx_ind_unmatched.\n");
|
||||
free_and_zero(rx_ind_unmatched->pdu_list);
|
||||
free_and_zero(rx_ind_unmatched);
|
||||
}
|
||||
}
|
||||
else {
|
||||
LOG_E(NR_MAC, "The number of crc pdus %d = the number of rx pdus %d\n",
|
||||
crc_ind->number_crcs, rx_ind->number_of_pdus);
|
||||
}
|
||||
}
|
||||
|
||||
void NR_UL_indication(NR_UL_IND_t *UL_info) {
|
||||
AssertFatal(UL_info!=NULL,"UL_INFO is null\n");
|
||||
AssertFatal(UL_info!=NULL,"UL_info is null\n");
|
||||
#ifdef DUMP_FAPI
|
||||
dump_ul(UL_info);
|
||||
#endif
|
||||
@@ -440,17 +383,63 @@ void NR_UL_indication(NR_UL_IND_t *UL_info) {
|
||||
NR_IF_Module_t *ifi = nr_if_inst[module_id];
|
||||
gNB_MAC_INST *mac = RC.nrmac[module_id];
|
||||
LOG_D(NR_PHY,"SFN/SLOT:%d.%d module_id:%d CC_id:%d UL_info[rach_pdus:%zu rx_ind:%zu crcs:%zu]\n",
|
||||
UL_info->frame,UL_info->slot,
|
||||
module_id,CC_id, gnb_rach_ind_queue.num_items,
|
||||
gnb_rx_ind_queue.num_items, gnb_crc_ind_queue.num_items);
|
||||
UL_info->frame, UL_info->slot,
|
||||
module_id, CC_id,
|
||||
gnb_rach_ind_queue.num_items,
|
||||
gnb_rx_ind_queue.num_items,
|
||||
gnb_crc_ind_queue.num_items);
|
||||
|
||||
nfapi_nr_rach_indication_t *rach_ind = NULL;
|
||||
nfapi_nr_uci_indication_t *uci_ind = NULL;
|
||||
nfapi_nr_rx_data_indication_t *rx_ind = NULL;
|
||||
nfapi_nr_crc_indication_t *crc_ind = NULL;
|
||||
if (get_softmodem_params()->emulate_l1)
|
||||
{
|
||||
if (gnb_rach_ind_queue.num_items > 0) {
|
||||
LOG_D(NR_MAC, "gnb_rach_ind_queue size = %zu\n", gnb_rach_ind_queue.num_items);
|
||||
rach_ind = get_queue(&gnb_rach_ind_queue);
|
||||
AssertFatal(rach_ind->number_of_pdus > 0, "Invalid number of PDUs\n");
|
||||
UL_info->rach_ind = *rach_ind;
|
||||
}
|
||||
if (gnb_uci_ind_queue.num_items > 0) {
|
||||
LOG_D(NR_MAC, "gnb_uci_ind_queue size = %zu\n", gnb_uci_ind_queue.num_items);
|
||||
uci_ind = get_queue(&gnb_uci_ind_queue);
|
||||
AssertFatal(uci_ind->num_ucis > 0, "Invalid number of PDUs\n");
|
||||
UL_info->uci_ind = *uci_ind;
|
||||
}
|
||||
if (gnb_rx_ind_queue.num_items > 0 && gnb_crc_ind_queue.num_items > 0) {
|
||||
LOG_D(NR_MAC, "gnb_rx_ind_queue size = %zu and gnb_crc_ind_queue size = %zu\n",
|
||||
gnb_rx_ind_queue.num_items, gnb_crc_ind_queue.num_items);
|
||||
rx_ind = get_queue(&gnb_rx_ind_queue);
|
||||
int sfn_slot = NFAPI_SFNSLOT2HEX(rx_ind->sfn, rx_ind->slot);
|
||||
crc_ind = unqueue_matching(&gnb_crc_ind_queue,
|
||||
MAX_QUEUE_SIZE,
|
||||
crc_sfn_slot_matcher,
|
||||
&sfn_slot);
|
||||
if (!crc_ind) {
|
||||
LOG_I(NR_PHY, "No crc indication with the same SFN SLOT of rx indication %u %u\n", rx_ind->sfn, rx_ind->slot);
|
||||
requeue(&gnb_rx_ind_queue, rx_ind);
|
||||
}
|
||||
else {
|
||||
AssertFatal(rx_ind->number_of_pdus > 0, "Invalid number of PDUs\n");
|
||||
AssertFatal(crc_ind->number_crcs > 0, "Invalid number of PDUs\n");
|
||||
if (crc_ind->number_crcs != rx_ind->number_of_pdus)
|
||||
match_crc_rx_pdu(rx_ind, crc_ind);
|
||||
UL_info->rx_ind = *rx_ind;
|
||||
UL_info->crc_ind = *crc_ind;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
handle_nr_rach(UL_info);
|
||||
|
||||
handle_nr_uci(UL_info);
|
||||
// clear UL DCI prior to handling ULSCH
|
||||
mac->UL_dci_req[CC_id].numPdus = 0;
|
||||
handle_nr_ulsch(UL_info);
|
||||
|
||||
if (get_softmodem_params()->emulate_l1) {
|
||||
free_unqueued_nfapi_indications(rach_ind, uci_ind, rx_ind, crc_ind);
|
||||
}
|
||||
if (NFAPI_MODE != NFAPI_MODE_PNF) {
|
||||
|
||||
if (ifi->CC_mask==0) {
|
||||
|
||||
@@ -296,11 +296,11 @@ static void copy_dl_tti_req_to_dl_info(nr_downlink_indication_t *dl_info, nfapi_
|
||||
{
|
||||
NR_UE_MAC_INST_t *mac = get_mac_inst(dl_info->module_id);
|
||||
mac->nr_ue_emul_l1.expected_sib = false;
|
||||
memset(mac->nr_ue_emul_l1.index_has_sib, 0, sizeof(*mac->nr_ue_emul_l1.index_has_sib));
|
||||
memset(mac->nr_ue_emul_l1.index_has_sib, 0, sizeof(mac->nr_ue_emul_l1.index_has_sib));
|
||||
mac->nr_ue_emul_l1.expected_rar = false;
|
||||
memset(mac->nr_ue_emul_l1.index_has_rar, 0, sizeof(*mac->nr_ue_emul_l1.index_has_rar));
|
||||
memset(mac->nr_ue_emul_l1.index_has_rar, 0, sizeof(mac->nr_ue_emul_l1.index_has_rar));
|
||||
mac->nr_ue_emul_l1.expected_dci = false;
|
||||
memset(mac->nr_ue_emul_l1.index_has_dci, 0, sizeof(*mac->nr_ue_emul_l1.index_has_dci));
|
||||
memset(mac->nr_ue_emul_l1.index_has_dci, 0, sizeof(mac->nr_ue_emul_l1.index_has_dci));
|
||||
int pdu_idx = 0;
|
||||
|
||||
int num_pdus = dl_tti_request->dl_tti_request_body.nPDUs;
|
||||
@@ -424,7 +424,7 @@ static void copy_tx_data_req_to_dl_info(nr_downlink_indication_t *dl_info, nfapi
|
||||
|
||||
if (!dl_info->rx_ind)
|
||||
{
|
||||
dl_info->rx_ind = CALLOC(1, sizeof(fapi_nr_rx_indication_t));
|
||||
dl_info->rx_ind = CALLOC(num_pdus, sizeof(fapi_nr_rx_indication_t));
|
||||
}
|
||||
AssertFatal(dl_info->rx_ind != NULL, "%s: Out of memory in calloc", __FUNCTION__);
|
||||
fapi_nr_rx_indication_t *rx_ind = dl_info->rx_ind;
|
||||
@@ -1038,7 +1038,8 @@ int handle_dci(module_id_t module_id, int cc_id, unsigned int gNB_index, frame_t
|
||||
// Note: sdu should always be processed because data and timing advance updates are transmitted by the UE
|
||||
int8_t handle_dlsch(nr_downlink_indication_t *dl_info, NR_UL_TIME_ALIGNMENT_t *ul_time_alignment, int pdu_id){
|
||||
|
||||
dl_info->rx_ind->rx_indication_body[pdu_id].pdsch_pdu.harq_pid = g_harq_pid;
|
||||
if (get_softmodem_params()->emulate_l1)
|
||||
dl_info->rx_ind->rx_indication_body[pdu_id].pdsch_pdu.harq_pid = g_harq_pid;
|
||||
|
||||
update_harq_status(dl_info->module_id,
|
||||
dl_info->rx_ind->rx_indication_body[pdu_id].pdsch_pdu.harq_pid,
|
||||
|
||||
@@ -4293,9 +4293,10 @@ ssize_t do_nrMeasurementReport(uint8_t *buffer,
|
||||
LTE_MeasResultListEUTRA_t *measResultListEUTRA2=&measResultNeighCells->choice.measResultListEUTRA;
|
||||
asn1cSequenceAdd(measResultListEUTRA2->list, struct LTE_MeasResultEUTRA, measresulteutra_list);
|
||||
measresulteutra_list->physCellId = phy_id;
|
||||
//asn1cCalloc(measresulteutra_list->cgi_Info, measresult_cgi2);
|
||||
//measresult_cgi2->cellGlobalId= {0};
|
||||
//measresult_cgi2->trackingAreaCode= {0};
|
||||
/* TODO: This asn1cCalloc leaks memory but also masks a bug.
|
||||
If we delete this asn1cCalloc statement, eNB will crash in NSA mode.
|
||||
Please don't delete the following line unless the bug has been found. */
|
||||
asn1cCalloc(measresulteutra_list->cgi_Info, measresult_cgi2);
|
||||
struct LTE_MeasResultEUTRA__measResult* measResult= &measresulteutra_list->measResult;
|
||||
asn1cCallocOne(measResult->rsrpResult, rsrp_tar);
|
||||
asn1cCallocOne(measResult->rsrqResult, rsrq_tar);
|
||||
|
||||
@@ -208,3 +208,24 @@ void
|
||||
rrc_gNB_generate_dedicatedRRCReconfiguration(
|
||||
const protocol_ctxt_t *const ctxt_pP,
|
||||
rrc_gNB_ue_context_t *ue_context_pP);
|
||||
|
||||
rlc_op_status_t nr_rrc_rlc_config_asn1_req (const protocol_ctxt_t * const ctxt_pP,
|
||||
const NR_SRB_ToAddModList_t * const srb2add_listP,
|
||||
const NR_DRB_ToAddModList_t * const drb2add_listP,
|
||||
const NR_DRB_ToReleaseList_t * const drb2release_listP,
|
||||
const LTE_PMCH_InfoList_r9_t * const pmch_InfoList_r9_pP,
|
||||
struct NR_CellGroupConfig__rlc_BearerToAddModList *rlc_bearer2add_list);
|
||||
|
||||
boolean_t nr_rrc_pdcp_config_asn1_req(
|
||||
const protocol_ctxt_t *const ctxt_pP,
|
||||
NR_SRB_ToAddModList_t *const srb2add_list,
|
||||
NR_DRB_ToAddModList_t *const drb2add_list,
|
||||
NR_DRB_ToReleaseList_t *const drb2release_list,
|
||||
const uint8_t security_modeP,
|
||||
uint8_t *const kRRCenc,
|
||||
uint8_t *const kRRCint,
|
||||
uint8_t *const kUPenc,
|
||||
uint8_t *const kUPint
|
||||
,LTE_PMCH_InfoList_r9_t *pmch_InfoList_r9
|
||||
,rb_id_t *const defaultDRB,
|
||||
struct NR_CellGroupConfig__rlc_BearerToAddModList *rlc_bearer2add_list);
|
||||
|
||||
@@ -98,6 +98,7 @@
|
||||
#include <openair2/RRC/NR/rrc_gNB_UE_context.h>
|
||||
#include <openair2/X2AP/x2ap_eNB.h>
|
||||
#include <openair3/ocp-gtpu/gtp_itf.h>
|
||||
#include <openair2/RRC/NR/nr_rrc_proto.h>
|
||||
|
||||
#include "BIT_STRING.h"
|
||||
#include "assertions.h"
|
||||
|
||||
@@ -42,27 +42,7 @@
|
||||
#include <openair2/RRC/NR/rrc_gNB_UE_context.h>
|
||||
#include <openair3/ocp-gtpu/gtp_itf.h>
|
||||
#include "UTIL/OSA/osa_defs.h"
|
||||
|
||||
extern boolean_t nr_rrc_pdcp_config_asn1_req(
|
||||
const protocol_ctxt_t *const ctxt_pP,
|
||||
NR_SRB_ToAddModList_t *const srb2add_list,
|
||||
NR_DRB_ToAddModList_t *const drb2add_list,
|
||||
NR_DRB_ToReleaseList_t *const drb2release_list,
|
||||
const uint8_t security_modeP,
|
||||
uint8_t *const kRRCenc,
|
||||
uint8_t *const kRRCint,
|
||||
uint8_t *const kUPenc,
|
||||
uint8_t *const kUPint
|
||||
,LTE_PMCH_InfoList_r9_t *pmch_InfoList_r9
|
||||
,rb_id_t *const defaultDRB,
|
||||
struct NR_CellGroupConfig__rlc_BearerToAddModList *rlc_bearer2add_list);
|
||||
|
||||
extern rlc_op_status_t nr_rrc_rlc_config_asn1_req (const protocol_ctxt_t * const ctxt_pP,
|
||||
const NR_SRB_ToAddModList_t * const srb2add_listP,
|
||||
const NR_DRB_ToAddModList_t * const drb2add_listP,
|
||||
const NR_DRB_ToReleaseList_t * const drb2release_listP,
|
||||
const LTE_PMCH_InfoList_r9_t * const pmch_InfoList_r9_pP,
|
||||
struct NR_CellGroupConfig__rlc_BearerToAddModList *rlc_bearer2add_list);
|
||||
#include <openair2/RRC/NR/nr_rrc_proto.h>
|
||||
|
||||
void rrc_parse_ue_capabilities(gNB_RRC_INST *rrc, NR_UE_CapabilityRAT_ContainerList_t *UE_CapabilityRAT_ContainerList, x2ap_ENDC_sgnb_addition_req_t *m, NR_CG_ConfigInfo_IEs_t *cg_config_info) {
|
||||
struct rrc_gNB_ue_context_s *ue_context_p = NULL;
|
||||
|
||||
@@ -72,6 +72,7 @@
|
||||
#include <executables/softmodem-common.h>
|
||||
|
||||
#include "nr_nas_msg_sim.h"
|
||||
#include <openair2/RRC/NR/nr_rrc_proto.h>
|
||||
|
||||
NR_UE_RRC_INST_t *NR_UE_rrc_inst;
|
||||
/* NAS Attach request with IMSI */
|
||||
@@ -178,27 +179,6 @@ static int nr_rrc_set_sub_state( module_id_t ue_mod_idP, Rrc_Sub_State_NR_t subS
|
||||
return (0);
|
||||
}
|
||||
|
||||
extern boolean_t nr_rrc_pdcp_config_asn1_req(
|
||||
const protocol_ctxt_t *const ctxt_pP,
|
||||
NR_SRB_ToAddModList_t *const srb2add_list,
|
||||
NR_DRB_ToAddModList_t *const drb2add_list,
|
||||
NR_DRB_ToReleaseList_t *const drb2release_list,
|
||||
const uint8_t security_modeP,
|
||||
uint8_t *const kRRCenc,
|
||||
uint8_t *const kRRCint,
|
||||
uint8_t *const kUPenc,
|
||||
uint8_t *const kUPint
|
||||
,LTE_PMCH_InfoList_r9_t *pmch_InfoList_r9
|
||||
,rb_id_t *const defaultDRB,
|
||||
struct NR_CellGroupConfig__rlc_BearerToAddModList *rlc_bearer2add_list);
|
||||
|
||||
extern rlc_op_status_t nr_rrc_rlc_config_asn1_req (const protocol_ctxt_t * const ctxt_pP,
|
||||
const NR_SRB_ToAddModList_t * const srb2add_listP,
|
||||
const NR_DRB_ToAddModList_t * const drb2add_listP,
|
||||
const NR_DRB_ToReleaseList_t * const drb2release_listP,
|
||||
const LTE_PMCH_InfoList_r9_t * const pmch_InfoList_r9_pP,
|
||||
struct NR_CellGroupConfig__rlc_BearerToAddModList *rlc_bearer2add_list);
|
||||
|
||||
// from LTE-RRC DL-DCCH RRCConnectionReconfiguration nr-secondary-cell-group-config (encoded)
|
||||
int8_t nr_rrc_ue_decode_secondary_cellgroup_config(const module_id_t module_id,
|
||||
const uint8_t *buffer,
|
||||
|
||||
Reference in New Issue
Block a user