Commit 987363b8 authored by Melissa Elkadi's avatar Melissa Elkadi

Clean up for MR

parent df06a1e8
......@@ -201,11 +201,11 @@ static void process_queued_nr_nfapi_msgs(NR_UE_MAC_INST_t *mac, int sfn_slot)
nfapi_nr_dl_tti_request_t *dl_tti_request = get_queue(&nr_dl_tti_req_queue);
nfapi_nr_ul_dci_request_t *ul_dci_request = get_queue(&nr_ul_dci_req_queue);
for (int i = 0; i < 16; i++) {
for (int i = 0; i < NR_MAX_HARQ_PROCESSES; i++) {
LOG_D(NR_MAC, "Try to get a ul_tti_req by matching CRC active SFN %d/SLOT %d from queue with %lu items\n",
NFAPI_SFNSLOT2SFN(mac->nr_ue_emul_l1.harq[i].crc_rx_ind_sfn_slot),
NFAPI_SFNSLOT2SLOT(mac->nr_ue_emul_l1.harq[i].crc_rx_ind_sfn_slot), nr_ul_tti_req_queue.num_items);
nfapi_nr_ul_tti_request_t *ul_tti_request_crc = unqueue_matching(&nr_ul_tti_req_queue, MAX_QUEUE_SIZE, sfn_slot_matcher, &mac->nr_ue_emul_l1.harq[i].crc_rx_ind_sfn_slot);
NFAPI_SFNSLOT2SFN(mac->nr_ue_emul_l1.harq[i].active_ul_harq_sfn_slot),
NFAPI_SFNSLOT2SLOT(mac->nr_ue_emul_l1.harq[i].active_ul_harq_sfn_slot), nr_ul_tti_req_queue.num_items);
nfapi_nr_ul_tti_request_t *ul_tti_request_crc = unqueue_matching(&nr_ul_tti_req_queue, MAX_QUEUE_SIZE, sfn_slot_matcher, &mac->nr_ue_emul_l1.harq[i].active_ul_harq_sfn_slot);
if (ul_tti_request_crc && ul_tti_request_crc->n_pdus > 0)
{
check_and_process_dci(NULL, NULL, NULL, ul_tti_request_crc);
......
......@@ -104,8 +104,6 @@ int8_t nr_ue_scheduled_response_stub(nr_scheduled_response_t *scheduled_response
rx_ind->header.message_id = NFAPI_NR_PHY_MSG_TYPE_RX_DATA_INDICATION;
rx_ind->sfn = scheduled_response->ul_config->sfn;
rx_ind->slot = scheduled_response->ul_config->slot;
LOG_I(NR_MAC, "This is sched sfn/sl [%d %d] and rx sfn/sl [%d %d]\n",
scheduled_response->frame, scheduled_response->slot, rx_ind->sfn, rx_ind->slot);
rx_ind->number_of_pdus = scheduled_response->tx_request->number_of_pdus;
rx_ind->pdu_list = CALLOC(rx_ind->number_of_pdus, sizeof(*rx_ind->pdu_list));
for (int j = 0; j < rx_ind->number_of_pdus; j++)
......@@ -117,7 +115,7 @@ int8_t nr_ue_scheduled_response_stub(nr_scheduled_response_t *scheduled_response
rx_ind->pdu_list[j].pdu = CALLOC(tx_req_body->pdu_length, sizeof(*rx_ind->pdu_list[j].pdu));
memcpy(rx_ind->pdu_list[j].pdu, tx_req_body->pdu, tx_req_body->pdu_length * sizeof(*rx_ind->pdu_list[j].pdu));
rx_ind->pdu_list[j].rnti = pusch_config_pdu->rnti;
rx_ind->pdu_list[j].timing_advance = scheduled_response->tx_request->tx_config.timing_advance;
rx_ind->pdu_list[j].timing_advance = 31;
rx_ind->pdu_list[j].ul_cqi = scheduled_response->tx_request->tx_config.ul_cqi;
}
......@@ -130,15 +128,15 @@ int8_t nr_ue_scheduled_response_stub(nr_scheduled_response_t *scheduled_response
{
crc_ind->crc_list[j].handle = pusch_config_pdu->handle;
crc_ind->crc_list[j].harq_id = pusch_config_pdu->pusch_data.harq_process_id;
LOG_I(NR_MAC, "This is the harq pid %d for crc_list[%d]\n", crc_ind->crc_list[j].harq_id, j);
LOG_I(NR_MAC, "This is sched sfn/sl [%d %d] and crc sfn/sl [%d %d]\n",
LOG_D(NR_MAC, "This is the harq pid %d for crc_list[%d]\n", crc_ind->crc_list[j].harq_id, j);
LOG_D(NR_MAC, "This is sched sfn/sl [%d %d] and crc sfn/sl [%d %d]\n",
scheduled_response->frame, scheduled_response->slot, crc_ind->sfn, crc_ind->slot);
crc_ind->crc_list[j].num_cb = pusch_config_pdu->pusch_data.num_cb;
crc_ind->crc_list[j].rnti = pusch_config_pdu->rnti;
crc_ind->crc_list[j].tb_crc_status = 0;
crc_ind->crc_list[j].timing_advance = scheduled_response->tx_request->tx_config.timing_advance;
crc_ind->crc_list[j].timing_advance = 31;
crc_ind->crc_list[j].ul_cqi = 255;
mac->nr_ue_emul_l1.harq[crc_ind->crc_list[j].harq_id].crc_rx_ind_sfn_slot = NFAPI_SFNSLOT2HEX(crc_ind->sfn, crc_ind->slot);
mac->nr_ue_emul_l1.harq[crc_ind->crc_list[j].harq_id].active_ul_harq_sfn_slot = NFAPI_SFNSLOT2HEX(crc_ind->sfn, crc_ind->slot);
LOG_D(NR_MAC, "This is sched sfn/sl [%d %d] and crc sfn/sl [%d %d] with mcs_index in ul_cqi -> %d\n",
scheduled_response->frame, scheduled_response->slot, crc_ind->sfn, crc_ind->slot,pusch_config_pdu->mcs_index);
}
......@@ -166,8 +164,7 @@ int8_t nr_ue_scheduled_response_stub(nr_scheduled_response_t *scheduled_response
crc_ind = NULL;
}
LOG_I(PHY, "In %s: [%d, %d] Filled queue rx/crc_ind which was filled by ulconfig. \n", __FUNCTION__,
scheduled_response->frame, scheduled_response->slot);
LOG_D(PHY, "In %s: Filled queue rx/crc_ind which was filled by ulconfig. \n", __FUNCTION__);
scheduled_response->tx_request->number_of_pdus = 0;
}
......@@ -204,8 +201,7 @@ int8_t nr_ue_scheduled_response_stub(nr_scheduled_response_t *scheduled_response
pdu_0_1->ul_cqi = 255;
pdu_0_1->timing_advance = 0;
pdu_0_1->rssi = 0;
LOG_I(NR_PHY, "In %s: UCI SFN/SLOT: [%d, %d] and mac->nr_ue_emul_l1.num_harq %d\n",
__FUNCTION__, uci_ind->sfn, uci_ind->slot, mac->nr_ue_emul_l1.num_harqs);
if (mac->nr_ue_emul_l1.num_harqs > 0) {
int harq_index = 0;
pdu_0_1->pduBitmap = 2; // (value->pduBitmap >> 1) & 0x01) == HARQ and (value->pduBitmap) & 0x01) == SR
......@@ -214,29 +210,16 @@ int8_t nr_ue_scheduled_response_stub(nr_scheduled_response_t *scheduled_response
pdu_0_1->harq->harq_confidence_level = 0;
pdu_0_1->harq->harq_list = CALLOC(pdu_0_1->harq->num_harq, sizeof(*pdu_0_1->harq->harq_list));
int harq_pid = -1;
for (int k = 0; k < 16; k++)
for (int k = 0; k < NR_MAX_HARQ_PROCESSES; k++)
{
LOG_I(NR_MAC, "HARQ PID %d active = %d saved sfn_slot = %d.%d vs current sfn.slot %d.%d\n",
k, mac->nr_ue_emul_l1.harq[k].active,
mac->nr_ue_emul_l1.harq[k].active_harq_sfn,
mac->nr_ue_emul_l1.harq[k].active_harq_slot,
uci_ind->sfn,
uci_ind->slot);
if (mac->nr_ue_emul_l1.harq[k].active &&
mac->nr_ue_emul_l1.harq[k].active_harq_sfn == uci_ind->sfn &&
mac->nr_ue_emul_l1.harq[k].active_harq_slot == uci_ind->slot)
mac->nr_ue_emul_l1.harq[k].active_dl_harq_sfn == uci_ind->sfn &&
mac->nr_ue_emul_l1.harq[k].active_dl_harq_slot == uci_ind->slot)
{
mac->nr_ue_emul_l1.harq[k].active = false;
harq_pid = k;
LOG_I(NR_MAC, "Setting harq_pid = %d and num_harqs %d for %d.%d\n", k, pdu_0_1->harq->num_harq,
uci_ind->sfn, uci_ind->slot);
pdu_0_1->harq->harq_list[harq_index].harq_value = !mac->dl_harq_info[k].ack;
harq_index++;
LOG_I(NR_PHY, "In %s: Building uci_ind_%d with num_harqs %d and pdu_bitmap %d\n"
"uci_num %d, SFN/SLOT: [%d, %d]\n",
__FUNCTION__, uci_ind->uci_list[0].pdu_type,
pdu_0_1->harq->num_harq, pdu_0_1->pduBitmap,
uci_ind->num_ucis, uci_ind->sfn, uci_ind->slot);
}
}
AssertFatal(harq_pid != -1, "No active harq_pid, sfn_slot = %u.%u", uci_ind->sfn, uci_ind->slot);
......@@ -244,12 +227,7 @@ int8_t nr_ue_scheduled_response_stub(nr_scheduled_response_t *scheduled_response
}
}
LOG_I(NR_PHY, "In %s: Sending uci_ind_%d which was filled by ulconfig.\n"
"uci_num %d, SFN/SLOT: [%d, %d] and pdu_bitmap %d\n",
__FUNCTION__, uci_ind->uci_list[0].pdu_type,
uci_ind->num_ucis, uci_ind->sfn, uci_ind->slot,
uci_ind->uci_list[0].pucch_pdu_format_0_1.pduBitmap);
LOG_I(NR_MAC, "Sending UCI with %d PDUs in sfn.slot %d/%d\n",
LOG_I(NR_PHY, "Sending UCI with %d PDUs in sfn.slot %d/%d\n",
uci_ind->num_ucis, uci_ind->sfn, uci_ind->slot);
NR_UL_IND_t UL_INFO = {
.uci_ind = *uci_ind,
......
......@@ -269,20 +269,20 @@ typedef struct {
scheduled SFN/Slot transmission for the ACK/NAK. If we
do not save it, then we have to calculate it again as the
NRUE MAC layer already does in get_downlink_ack(). */
int active_harq_sfn;
int active_harq_slot;
int crc_rx_ind_sfn_slot;
int active_dl_harq_sfn;
int active_dl_harq_slot;
int active_ul_harq_sfn_slot;
bool active;
} emul_l1_harq_t;
typedef struct {
bool expected_sib;
bool index_has_sib[16];
bool index_has_sib[NR_MAX_HARQ_PROCESSES];
bool expected_rar;
bool index_has_rar[16];
bool index_has_rar[NR_MAX_HARQ_PROCESSES];
bool expected_dci;
bool index_has_dci[16];
emul_l1_harq_t harq[16];
bool index_has_dci[NR_MAX_HARQ_PROCESSES];
emul_l1_harq_t harq[NR_MAX_HARQ_PROCESSES];
int active_uci_sfn_slot;
int num_srs;
int num_harqs;
......
......@@ -432,7 +432,7 @@ typedef struct {
// Defined for abstracted mode
nr_downlink_indication_t dl_info;
NR_UE_HARQ_STATUS_t dl_harq_info[16];
NR_UE_HARQ_STATUS_t dl_harq_info[NR_MAX_HARQ_PROCESSES];
nr_emulated_l1_t nr_ue_emul_l1;
......
......@@ -599,19 +599,14 @@ int nr_ue_process_dci_indication_pdu(module_id_t module_id,int cc_id, int gNB_in
NR_UE_MAC_INST_t *mac = get_mac_inst(module_id);
dci_pdu_rel15_t *def_dci_pdu_rel15 = &mac->def_dci_pdu_rel15[dci->dci_format];
LOG_I(MAC,"Received dci indication (rnti %x,dci format %d,n_CCE %d,payloadSize %d,payload %llx, pid %d)\n",
dci->rnti, dci->dci_format,
dci->n_CCE, dci->payloadSize,
*(unsigned long long*)dci->payloadBits,
def_dci_pdu_rel15->harq_pid);
LOG_D(MAC,"Received dci indication (rnti %x,dci format %d,n_CCE %d,payloadSize %d,payload %llx)\n",
dci->rnti,dci->dci_format,dci->n_CCE,dci->payloadSize,*(unsigned long long*)dci->payloadBits);
int8_t ret = nr_extract_dci_info(mac, dci->dci_format, dci->payloadSize, dci->rnti, (uint64_t *)dci->payloadBits, def_dci_pdu_rel15);
if ((ret&1) == 1) return -1;
else if (ret == 2) {
dci->dci_format = NR_UL_DCI_FORMAT_0_0;
def_dci_pdu_rel15 = &mac->def_dci_pdu_rel15[dci->dci_format];
}
LOG_I(MAC,"After extracting dci info. dci format %d, pid %d\n",
dci->dci_format, def_dci_pdu_rel15->harq_pid);
int8_t ret_proc = nr_ue_process_dci(module_id, cc_id, gNB_index, frame, slot, def_dci_pdu_rel15, dci);
return ret_proc;
}
......@@ -636,8 +631,8 @@ int8_t nr_ue_process_dci(module_id_t module_id, int cc_id, uint8_t gNB_index, fr
else if (mac->scc_SIB) n_RB_DLBWP = NRRIV2BW(mac->scc_SIB->uplinkConfigCommon->initialUplinkBWP.genericParameters.locationAndBandwidth,MAX_BWP_SIZE);
else n_RB_DLBWP = mac->type0_PDCCH_CSS_config.num_rbs;
LOG_I(MAC, "In %s: Processing received DCI format %s (DL BWP %d) harq_pid %d\n",
__FUNCTION__, dci_formats[dci_format], n_RB_DLBWP, dci->harq_pid);
LOG_D(MAC, "In %s: Processing received DCI format %s (DL BWP %d)\n", __FUNCTION__, dci_formats[dci_format], n_RB_DLBWP);
switch(dci_format){
case NR_UL_DCI_FORMAT_0_0: {
......@@ -953,8 +948,6 @@ int8_t nr_ue_process_dci(module_id_t module_id, int cc_id, uint8_t gNB_index, fr
if(rnti != ra->ra_rnti && rnti != SI_RNTI)
AssertFatal(1+dci->pdsch_to_harq_feedback_timing_indicator.val>=DURATION_RX_TO_TX,"PDSCH to HARQ feedback time (%d) cannot be less than DURATION_RX_TO_TX (%d).\n",
1+dci->pdsch_to_harq_feedback_timing_indicator.val,DURATION_RX_TO_TX);
LOG_I(MAC,"(nr_ue_procedures.c) dci->pdsch_to_harq_feedback_timing_indicator.val=%d \n",
dci->pdsch_to_harq_feedback_timing_indicator.val);
// set the harq status at MAC for feedback
set_harq_status(mac,dci->pucch_resource_indicator,
......@@ -1126,9 +1119,6 @@ int8_t nr_ue_process_dci(module_id_t module_id, int cc_id, uint8_t gNB_index, fr
valid = 0;
pucch_res_set_cnt = ubwpd->pucch_Config->choice.setup->resourceSetToAddModList->list.count;
for (int id = 0; id < pucch_res_set_cnt; id++) {
LOG_I(NR_MAC, "pucch_resource_indicator %d, ubwpd[%d].resource.list.count %d\n",
dci->pucch_resource_indicator, id,
ubwpd->pucch_Config->choice.setup->resourceSetToAddModList->list.array[id]->resourceList.list.count);
if (dci->pucch_resource_indicator < ubwpd->pucch_Config->choice.setup->resourceSetToAddModList->list.array[id]->resourceList.list.count) {
valid = 1;
break;
......@@ -1246,9 +1236,6 @@ int8_t nr_ue_process_dci(module_id_t module_id, int cc_id, uint8_t gNB_index, fr
// according to TS 38.213 Table 9.2.3-1
uint8_t feedback_ti =
ubwpd->pucch_Config->choice.setup->dl_DataToUL_ACK->list.array[dci->pdsch_to_harq_feedback_timing_indicator.val][0];
LOG_I(MAC,"(nr_ue_procedures.c) 1237 feedback_ti=%d and dci->pdsch_to_harq_feedback_timing_indicator.val %d, pdsch_to_harq_feedback_time_ind %d\n",
feedback_ti, dci->pdsch_to_harq_feedback_timing_indicator.val,
dlsch_config_pdu_1_1->pdsch_to_harq_feedback_time_ind);
AssertFatal(feedback_ti>=DURATION_RX_TO_TX,"PDSCH to HARQ feedback time (%d) cannot be less than DURATION_RX_TO_TX (%d). Min feedback time set in config file (min_rxtxtime).\n",
feedback_ti,DURATION_RX_TO_TX);
......@@ -1347,8 +1334,7 @@ void set_harq_status(NR_UE_MAC_INST_t *mac,
// FIXME k0 != 0 currently not taken into consideration
current_harq->dl_frame = frame;
current_harq->dl_slot = slot;
// TODO: if (get_softmodem_params()->emaulte_l1)
// in downlink: 0-7, 10-17
if (get_softmodem_params()->emaulte_l1) {
if (data_toul_fb + slot > 19) {
if (frame + 1 < 1024)
frame++;
......@@ -1359,8 +1345,9 @@ void set_harq_status(NR_UE_MAC_INST_t *mac,
else {
slot = data_toul_fb + slot;
}
}
LOG_I(NR_PHY,"Setting harq_status for harq_id %d, dl %d.%d, sched ul %d.%d\n",
LOG_D(NR_PHY,"Setting harq_status for harq_id %d, dl %d.%d, sched ul %d.%d\n",
harq_id, current_harq->dl_frame, current_harq->dl_slot, frame, slot);
}
......@@ -1845,22 +1832,16 @@ int find_pucch_resource_set(NR_UE_MAC_INST_t *mac, int uci_size) {
mac->cg->spCellConfig->spCellConfigDedicated->uplinkConfig->initialUplinkBWP->pucch_Config->choice.setup->resourceSetToAddModList->list.array[pucch_resource_set_id] != NULL)) {
if (uci_size <= 3) {
pucch_resource_set_id = 0;
LOG_I(NR_MAC, "Melissa %s()%d, we are setting resource_set_id = %d",
__FUNCTION__, __LINE__, pucch_resource_set_id);
return (pucch_resource_set_id);
break;
}
else {
pucch_resource_set_id = 1;
LOG_I(NR_MAC, "Melissa %s()%d, we are setting resource_set_id = %d",
__FUNCTION__, __LINE__, pucch_resource_set_id);
return (pucch_resource_set_id);
break;
}
}
pucch_resource_set_id++;
LOG_I(NR_MAC, "Melissa %s()%d, we are setting resource_set_id = %d",
__FUNCTION__, __LINE__, pucch_resource_set_id);
}
pucch_resource_set_id = MAX_NB_OF_PUCCH_RESOURCE_SETS;
......@@ -1945,13 +1926,6 @@ void select_pucch_resource(NR_UE_MAC_INST_t *mac,
pucch->pucch_resource = NULL;
return;
}
LOG_I(MAC,"Melissa resourceSetToAddModList %p\n", resourceSetToAddModList);
LOG_I(MAC,"Melissa resourceSetToAddModList->list.array[0] %p\n", resourceSetToAddModList->list.array[0]);
LOG_I(MAC,"Melissa pucch->resource_set_id %d\n", pucch->resource_set_id);
LOG_I(MAC,"Melissa resourceSetToAddModList->list.array[pucch->resource_set_id] %p\n", resourceSetToAddModList->list.array[pucch->resource_set_id]);
LOG_I(MAC,"Melissa resourceSetToAddModList->list.array[pucch->resource_set_id]->resourceList %p\n", resourceSetToAddModList->list.array[pucch->resource_set_id]->resourceList);
LOG_I(MAC,"Melissa resourceSetToAddModList->list.array[pucch->resource_set_id]->resourceList.list.count %d\n", resourceSetToAddModList->list.array[pucch->resource_set_id]->resourceList.list.count);
n_list = resourceSetToAddModList->list.array[pucch->resource_set_id]->resourceList.list.count;
if (pucch->resource_indicator > n_list) {
LOG_E(MAC,"Invalid PUCCH resource id %d\n",pucch->resource_indicator);
......@@ -2063,21 +2037,13 @@ uint8_t get_downlink_ack(NR_UE_MAC_INST_t *mac,
else {
sched_slot = current_harq->feedback_to_ul + current_harq->dl_slot;
}
LOG_I(PHY,"HARQ pid %d is active for %d.%d and inputted %d.%d (dl_slot %d, feedback_to_ul %d, is_common %d active %d\n",
dl_harq_pid,
sched_frame,
sched_slot, frame, slot,
current_harq->dl_slot,
current_harq->feedback_to_ul,
current_harq->is_common,
current_harq->active);
LOG_D(PHY,"HARQ pid %d is active for %d.%d (dl_slot %d, feedback_to_ul %d, is_common %d\n",dl_harq_pid, sched_frame,sched_slot,current_harq->dl_slot,current_harq->feedback_to_ul,current_harq->is_common);
/* check if current tx slot should transmit downlink acknowlegment */
if (sched_frame == frame && sched_slot == slot) {
if (get_softmodem_params()->emulate_l1) {
mac->nr_ue_emul_l1.harq[dl_harq_pid].active = true;
mac->nr_ue_emul_l1.harq[dl_harq_pid].active_harq_sfn = frame;
mac->nr_ue_emul_l1.harq[dl_harq_pid].active_harq_slot = slot;
mac->nr_ue_emul_l1.harq[dl_harq_pid].active_dl_harq_sfn = frame;
mac->nr_ue_emul_l1.harq[dl_harq_pid].active_dl_harq_slot = slot;
}
if (current_harq->dai > NR_DL_MAX_DAI) {
......@@ -2099,7 +2065,6 @@ uint8_t get_downlink_ack(NR_UE_MAC_INST_t *mac,
}
number_harq_feedback++;
LOG_I(NR_MAC, "number_harq_feedback = %d\n", number_harq_feedback);
if (current_harq->ack_received)
ack_data[code_word][dai_current - 1] = current_harq->ack;
else
......@@ -2187,7 +2152,6 @@ uint8_t get_downlink_ack(NR_UE_MAC_INST_t *mac,
V_temp2 = dai[1][m]; /* second code word has been received */
O_bit_number_cw1 = (8 * j) + 2*(V_temp - 1) + 1;
o_ACK = o_ACK | (ack_data[1][m] << O_bit_number_cw1);
LOG_I(NR_MAC, "%s():%d o_ACK = %d\n", __FUNCTION__, __LINE__, o_ACK);
}
if (two_transport_blocks == TRUE) {
......@@ -2197,7 +2161,6 @@ uint8_t get_downlink_ack(NR_UE_MAC_INST_t *mac,
O_bit_number_cw0 = (4 * j) + (V_temp - 1);
}
LOG_I(NR_MAC, "%s():%d o_ACK = %d\n", __FUNCTION__, __LINE__, o_ACK);
o_ACK = o_ACK | (ack_data[0][m] << O_bit_number_cw0);
LOG_D(MAC,"m %d bit number %d o_ACK %d\n",m,O_bit_number_cw0,o_ACK);
}
......@@ -2211,16 +2174,14 @@ uint8_t get_downlink_ack(NR_UE_MAC_INST_t *mac,
}
else {
O_ACK = 4 * j + V_temp2; /* only one transport block */
LOG_I(NR_MAC, "%s():%d O_ACK = %d\n", __FUNCTION__, __LINE__, O_ACK);
}
if (number_harq_feedback != O_ACK) {
LOG_E(MAC,"PUCCH Error for number of bits for acknowledgment. number_harq_feedback %d, O_ACK %d \n",
number_harq_feedback, O_ACK);
number_harq_feedback = O_ACK; //return (0);
return (0);
}
LOG_I(NR_MAC, "%s():%d o_ACK = %d\n", __FUNCTION__, __LINE__, o_ACK);
pucch->ack_payload = o_ACK;
LOG_D(MAC,"frame %d slot %d pucch acknack payload %d\n",frame,slot,o_ACK);
......@@ -3896,8 +3857,6 @@ int nr_ue_process_rar(nr_downlink_indication_t *dl_info, NR_UL_TIME_ALIGNMENT_t
#endif
if (ra->RA_RAPID_found) {
// if (rarh->RAPID != preamble_index)
// return 0;
RAR_grant_t rar_grant;
......
......@@ -465,7 +465,7 @@ static void fill_rx_ind(nfapi_nr_pdu_t *pdu_list, fapi_nr_rx_indication_t *rx_in
{
length += pdu_list->TLVs[j].length;
}
LOG_I(NR_PHY, "Elkadi %s: num_tlv %d and length %d, pdu index %d\n",
LOG_I(NR_PHY, "%s: num_tlv %d and length %d, pdu index %d\n",
__FUNCTION__, pdu_list->num_TLV, length, pdu_idx);
uint8_t *pdu = malloc(length);
AssertFatal(pdu != NULL, "%s: Out of memory in malloc", __FUNCTION__);
......@@ -618,7 +618,6 @@ static void copy_ul_dci_data_req_to_dl_info(nr_downlink_indication_t *dl_info, n
static bool send_crc_ind_and_rx_ind(int sfn_slot)
{
bool sent_crc_rx = true;
LOG_I(NR_MAC, "Melissa, This is the num items in crc %d and rx %d\n", nr_crc_ind_queue.num_items, nr_rx_ind_queue.num_items);
nfapi_nr_rx_data_indication_t *rx_ind = unqueue_matching(&nr_rx_ind_queue, MAX_QUEUE_SIZE, sfn_slot_matcher, &sfn_slot);
nfapi_nr_crc_indication_t *crc_ind = unqueue_matching(&nr_crc_ind_queue, MAX_QUEUE_SIZE, sfn_slot_matcher, &sfn_slot);
......@@ -709,10 +708,8 @@ static void fill_dci_from_dl_config(nr_downlink_indication_t*dl_ind, fapi_nr_dl_
dl_ind->dci_ind->dci_list[k].dci_format = rel15_dci->dci_format_options[j];
LOG_I(NR_PHY, "format assigned dl_ind->dci_ind->dci_list[k].dci_format %d\n",
dl_ind->dci_ind->dci_list[k].dci_format);
int CCEind = rel15_dci->CCE[j];
int L = rel15_dci->L[j];
dl_ind->dci_ind->dci_list[k].n_CCE = CCEind;
dl_ind->dci_ind->dci_list[k].N_CCE = L;
dl_ind->dci_ind->dci_list[k].n_CCE = rel15_dci->CCE[j];
dl_ind->dci_ind->dci_list[k].N_CCE = rel15_dci->L[j];
}
}
}
......@@ -796,11 +793,9 @@ void check_and_process_dci(nfapi_nr_dl_tti_request_t *dl_tti_request,
mac->scc->tdd_UL_DL_ConfigurationCommon :
mac->scc_SIB->tdd_UL_DL_ConfigurationCommon,
ul_info.slot_tx,
mac->frame_type)) {
LOG_I(NR_MAC, "Slot %d. calling nr_ue_ul_ind() from %s\n", ul_info.slot_tx, __FUNCTION__);
mac->frame_type))
nr_ue_ul_indication(&ul_info);
}
}
}
void save_nr_measurement_info(nfapi_nr_dl_tti_request_t *dl_tti_request)
......@@ -918,16 +913,10 @@ static void enqueue_nr_nfapi_msg(void *buffer, ssize_t len, nfapi_p7_message_hea
LOG_E(NR_PHY, "Message ul_tti_request failed to unpack\n");
break;
}
LOG_I(NR_PHY, "Received an NFAPI_NR_PHY_MSG_TYPE_UL_TTI_REQUEST message in SFN/slot %d %d.\n",
ul_tti_request->SFN, ul_tti_request->Slot);
for (int i = 0; i < ul_tti_request->n_pdus; i++) {
LOG_I(NR_PHY, "Received an NFAPI_NR_PHY_MSG_TYPE_UL_TTI_REQUEST pdu_type %d, ra_state %d.\n",
ul_tti_request->pdus_list[i].pdu_type, mac->ra.ra_state);
if (ul_tti_request->pdus_list[i].pdu_type == 1 &&
if (ul_tti_request->pdus_list[i].pdu_type == NFAPI_NR_UL_CONFIG_PUSCH_PDU_TYPE &&
mac->ra.ra_state >= RA_SUCCEEDED) {
LOG_I(NR_PHY, "Received an NFAPI_NR_PHY_MSG_TYPE_UL_TTI_REQUEST that were queueing with rnti %x!\n",
ul_tti_request->pdus_list[i].pucch_pdu.rnti);
if (!put_queue(&nr_ul_tti_req_queue, ul_tti_request))
{
LOG_I(NR_PHY, "put_queue failed for ul_tti_request, calling put_queue_replace.\n");
......@@ -937,8 +926,6 @@ static void enqueue_nr_nfapi_msg(void *buffer, ssize_t len, nfapi_p7_message_hea
break;
}
else if (mac->ra.ra_state < RA_SUCCEEDED) {
LOG_I(NR_PHY, "Received an NFAPI_NR_PHY_MSG_TYPE_UL_TTI_REQUEST before RA_SUCEEDED that were queueing with rnti %x!\n",
ul_tti_request->pdus_list[i].pucch_pdu.rnti);
if (!put_queue(&nr_ul_tti_req_queue, ul_tti_request))
{
LOG_I(NR_PHY, "put_queue failed for ul_tti_request, calling put_queue_replace.\n");
......@@ -1098,7 +1085,7 @@ int handle_dci(module_id_t module_id, int cc_id, unsigned int gNB_index, frame_t
// L2 Abstraction Layer
// 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){
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,
......@@ -1147,8 +1134,6 @@ int nr_ue_ul_indication(nr_uplink_indication_t *ul_info){
if (is_nr_UL_slot(tdd_UL_DL_ConfigurationCommon, ul_info->slot_tx, mac->frame_type) && !get_softmodem_params()->phy_test)
nr_ue_prach_scheduler(module_id, ul_info->frame_tx, ul_info->slot_tx, ul_info->thread_id);
LOG_I(NR_MAC, "In %s():%d calling nr_ue_pucch_scheduler in %d.%d\n",
__FUNCTION__, __LINE__, ul_info->frame_tx, ul_info->slot_tx);
if (is_nr_UL_slot(tdd_UL_DL_ConfigurationCommon, ul_info->slot_tx, mac->frame_type) &&
!get_softmodem_params()->emulate_l1)
nr_ue_pucch_scheduler(module_id, ul_info->frame_tx, ul_info->slot_tx, ul_info->thread_id);
......@@ -1184,12 +1169,8 @@ int nr_ue_dl_indication(nr_downlink_indication_t *dl_info, NR_UL_TIME_ALIGNMENT_
if (dl_info && dl_info->dci_ind && dl_info->dci_ind->number_of_dcis) {
LOG_D(MAC,"[L2][IF MODULE][DL INDICATION][DCI_IND]\n");
for (int i = 0; i < dl_info->dci_ind->number_of_dcis; i++) {
LOG_D(MAC,">>>NR_IF_Module i=%d, dl_info->dci_ind->number_of_dcis=%d\n",i,dl_info->dci_ind->number_of_dcis);
fapi_nr_dci_indication_pdu_t *dci_index = dl_info->dci_ind->dci_list+i;
LOG_I(MAC,">>>NR_IF_Module i=%d, dl_info->dci_ind->number_of_dcis=%d, format %d, harq_pid %d\n",
i,
dl_info->dci_ind->number_of_dcis,
dci_index->dci_format,
mac->def_dci_pdu_rel15[dci_index->dci_format].harq_pid);
nr_scheduled_response_t scheduled_response;
int8_t ret = handle_dci(dl_info->module_id,
dl_info->cc_id,
......@@ -1200,7 +1181,7 @@ int nr_ue_dl_indication(nr_downlink_indication_t *dl_info, NR_UL_TIME_ALIGNMENT_
/* The check below filters out UL_DCIs (format 7) which are being processed as DL_DCIs. */
if (dci_index->dci_format == 7 && mac->ra.ra_state == RA_SUCCEEDED) {
LOG_I(NR_MAC, "We are filtering a UL_DCI to prevent it from being treated like a DL_DCI\n");
LOG_D(NR_MAC, "We are filtering a UL_DCI to prevent it from being treated like a DL_DCI\n");
break;
}
dci_pdu_rel15_t *def_dci_pdu_rel15 = &mac->def_dci_pdu_rel15[dci_index->dci_format];
......@@ -1214,7 +1195,8 @@ int nr_ue_dl_indication(nr_downlink_indication_t *dl_info, NR_UL_TIME_ALIGNMENT_
fill_scheduled_response(&scheduled_response, dl_config, NULL, NULL, dl_info->module_id, dl_info->cc_id, dl_info->frame, dl_info->slot, dl_info->thread_id);
nr_ue_if_module_inst[module_id]->scheduled_response(&scheduled_response);
}
//memset(def_dci_pdu_rel15, 0, sizeof(*def_dci_pdu_rel15));
if (!get_softmodem_params()->emulate_l1)
memset(def_dci_pdu_rel15, 0, sizeof(*def_dci_pdu_rel15));
}
free(dl_info->dci_ind);
dl_info->dci_ind = NULL;
......
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