Simplify code through lookup of PDU name, delete commented code
This commit is contained in:
committed by
Robert Schmidt
parent
80223d36d5
commit
0d083d83fc
@@ -1481,7 +1481,10 @@ typedef enum {
|
|||||||
NFAPI_NR_UL_CONFIG_PUCCH_PDU_TYPE,
|
NFAPI_NR_UL_CONFIG_PUCCH_PDU_TYPE,
|
||||||
NFAPI_NR_UL_CONFIG_SRS_PDU_TYPE,
|
NFAPI_NR_UL_CONFIG_SRS_PDU_TYPE,
|
||||||
} nfapi_nr_ul_config_pdu_type_e;
|
} nfapi_nr_ul_config_pdu_type_e;
|
||||||
|
static const char* const txt_nfapi_nr_ul_config_pdu_type[] = {"NFAPI_NR_UL_CONFIG_PRACH_PDU_TYPE",
|
||||||
|
"NFAPI_NR_UL_CONFIG_PUSCH_PDU_TYPE",
|
||||||
|
"NFAPI_NR_UL_CONFIG_PUCCH_PDU_TYPE",
|
||||||
|
"NFAPI_NR_UL_CONFIG_SRS_PDU_TYPE"};
|
||||||
typedef struct
|
typedef struct
|
||||||
{
|
{
|
||||||
uint16_t pdu_type;//0: PRACH PDU, 1: PUSCH PDU, 2: PUCCH PDU, 3: SRS PDU
|
uint16_t pdu_type;//0: PRACH PDU, 1: PUSCH PDU, 2: PUCCH PDU, 3: SRS PDU
|
||||||
|
|||||||
@@ -127,49 +127,28 @@ void nr_schedule_ul_tti_req(PHY_VARS_gNB *gNB, nfapi_nr_ul_tti_request_t *UL_tti
|
|||||||
int slot = UL_tti_req->Slot;
|
int slot = UL_tti_req->Slot;
|
||||||
|
|
||||||
for (int i = 0; i < UL_tti_req->n_pdus; i++) {
|
for (int i = 0; i < UL_tti_req->n_pdus; i++) {
|
||||||
switch (UL_tti_req->pdus_list[i].pdu_type) {
|
int type = UL_tti_req->pdus_list[i].pdu_type;
|
||||||
|
LOG_D(NR_PHY,
|
||||||
|
"frame %d, slot %d got %s for %d.%d\n",
|
||||||
|
frame,
|
||||||
|
slot,
|
||||||
|
txt_nfapi_nr_ul_config_pdu_type[type],
|
||||||
|
UL_tti_req->SFN,
|
||||||
|
UL_tti_req->Slot);
|
||||||
|
switch (type) {
|
||||||
case NFAPI_NR_UL_CONFIG_PUSCH_PDU_TYPE:
|
case NFAPI_NR_UL_CONFIG_PUSCH_PDU_TYPE:
|
||||||
LOG_D(NR_PHY,
|
|
||||||
"frame %d, slot %d, Got NFAPI_NR_UL_TTI_PUSCH_PDU_TYPE for %d.%d\n",
|
|
||||||
frame,
|
|
||||||
slot,
|
|
||||||
UL_tti_req->SFN,
|
|
||||||
UL_tti_req->Slot);
|
|
||||||
nr_fill_ulsch(gNB, UL_tti_req->SFN, UL_tti_req->Slot, &UL_tti_req->pdus_list[i].pusch_pdu);
|
nr_fill_ulsch(gNB, UL_tti_req->SFN, UL_tti_req->Slot, &UL_tti_req->pdus_list[i].pusch_pdu);
|
||||||
break;
|
break;
|
||||||
case NFAPI_NR_UL_CONFIG_PUCCH_PDU_TYPE:
|
case NFAPI_NR_UL_CONFIG_PUCCH_PDU_TYPE:
|
||||||
LOG_D(NR_PHY,
|
|
||||||
"frame %d, slot %d, Got NFAPI_NR_UL_TTI_PUCCH_PDU_TYPE for %d.%d\n",
|
|
||||||
frame,
|
|
||||||
slot,
|
|
||||||
UL_tti_req->SFN,
|
|
||||||
UL_tti_req->Slot);
|
|
||||||
nr_fill_pucch(gNB, UL_tti_req->SFN, UL_tti_req->Slot, &UL_tti_req->pdus_list[i].pucch_pdu);
|
nr_fill_pucch(gNB, UL_tti_req->SFN, UL_tti_req->Slot, &UL_tti_req->pdus_list[i].pucch_pdu);
|
||||||
break;
|
break;
|
||||||
case NFAPI_NR_UL_CONFIG_PRACH_PDU_TYPE:
|
case NFAPI_NR_UL_CONFIG_PRACH_PDU_TYPE: {
|
||||||
LOG_D(NR_PHY,
|
|
||||||
"frame %d, slot %d, Got NFAPI_NR_UL_TTI_PRACH_PDU_TYPE for %d.%d\n",
|
|
||||||
frame,
|
|
||||||
slot,
|
|
||||||
UL_tti_req->SFN,
|
|
||||||
UL_tti_req->Slot);
|
|
||||||
nfapi_nr_prach_pdu_t *prach_pdu = &UL_tti_req->pdus_list[i].prach_pdu;
|
nfapi_nr_prach_pdu_t *prach_pdu = &UL_tti_req->pdus_list[i].prach_pdu;
|
||||||
LOG_D(NR_PHY_RACH, "Add prach decoding request for %d.%d\n", UL_tti_req->SFN, UL_tti_req->Slot);
|
|
||||||
prach_item_t *prach = nr_schedule_rx_prach(gNB, UL_tti_req->SFN, UL_tti_req->Slot, prach_pdu);
|
prach_item_t *prach = nr_schedule_rx_prach(gNB, UL_tti_req->SFN, UL_tti_req->Slot, prach_pdu);
|
||||||
if (!prach)
|
if (!prach)
|
||||||
LOG_W(NR_PHY_RACH, "Error in scheduling rach\n");
|
LOG_W(NR_PHY_RACH, "Error in scheduling rach\n");
|
||||||
/* the present design is not supporting multiple gNB in one RU
|
} break;
|
||||||
if (prach && (gNB->RU_list[0]->if_south == LOCAL_RF || gNB->RU_list[0]->if_south == REMOTE_IF5))
|
|
||||||
nr_fill_prach_ru(gNB->RU_list[0], prach);
|
|
||||||
*/
|
|
||||||
break;
|
|
||||||
case NFAPI_NR_UL_CONFIG_SRS_PDU_TYPE:
|
case NFAPI_NR_UL_CONFIG_SRS_PDU_TYPE:
|
||||||
LOG_D(NR_PHY,
|
|
||||||
"frame %d, slot %d, Got NFAPI_NR_UL_CONFIG_SRS_PDU_TYPE for %d.%d\n",
|
|
||||||
frame,
|
|
||||||
slot,
|
|
||||||
UL_tti_req->SFN,
|
|
||||||
UL_tti_req->Slot);
|
|
||||||
nr_fill_srs(gNB, UL_tti_req->SFN, UL_tti_req->Slot, &UL_tti_req->pdus_list[i].srs_pdu);
|
nr_fill_srs(gNB, UL_tti_req->SFN, UL_tti_req->Slot, &UL_tti_req->pdus_list[i].srs_pdu);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user