Commit e8cfcbe6 authored by Melissa Elkadi's avatar Melissa Elkadi

CFRA Procedure success commit pt. 1

This commit contains the changes to the OAI code in
the NR UE and in nFAPI.
- Filling crc_ind for msg3
- Updating pack/unpack of CRC_ind
- Creating phy abstraction CRC_ind handling in VNF
- Removal of old comments
- Only sending on RACH in phy_stub
- Calling nr_msg3_transmitted in scheduler for NSA mode
parent 04ab6dba
......@@ -159,7 +159,7 @@ static void L1_nsa_prach_procedures(frame_t frame, int slot, fapi_nr_ul_config_p
rach_ind->pdu_list[pdu_index].phy_cell_id = prach_pdu->phys_cell_id;
rach_ind->pdu_list[pdu_index].symbol_index = prach_pdu->prach_start_symbol;
rach_ind->pdu_list[pdu_index].slot_index = prach_pdu->prach_slot;
rach_ind->pdu_list[pdu_index].freq_index = prach_pdu->num_ra; //Melissa Fill these things from the prach pdu
rach_ind->pdu_list[pdu_index].freq_index = prach_pdu->num_ra;
rach_ind->pdu_list[pdu_index].avg_rssi = 128;
rach_ind->pdu_list[pdu_index].avg_snr = 0xff; // invalid for now
......@@ -226,6 +226,8 @@ static void *NRUE_phy_stub_standalone_pnf_task(void *arg)
LOG_E(NR_MAC, "mac->ul_config is null! \n");
continue;
}
if (mac->ra.ra_state == RA_SUCCEEDED)
continue;
mac->ul_config_request[2].number_pdus = 0;
fapi_nr_ul_config_prach_pdu *prach_pdu = &ul_config->ul_config_list[ul_config->number_pdus].prach_config_pdu;
......
......@@ -797,6 +797,22 @@ int phy_crc_indication(struct nfapi_vnf_p7_config *config, nfapi_crc_indication_
return 1;
}
int phy_nr_crc_indication(struct nfapi_vnf_p7_config *config, nfapi_nr_crc_indication_t *ind) {
LOG_I(NR_MAC, "In %s() NFAPI SFN/SF: %d/%d number_of_pdus :%u\n",
__FUNCTION__,ind->sfn, ind->slot, ind->number_crcs);
if(NFAPI_MODE == NFAPI_MODE_VNF)
{
UL_INFO.crc_ind = *ind;
}
else
{
LOG_E(NR_MAC, "NFAPI_MODE = %d not NFAPI_MODE_VNF(2)\n", nfapi_getmode());
}
return 1;
}
int phy_rx_indication(struct nfapi_vnf_p7_config *config, nfapi_rx_indication_t *ind) {
struct PHY_VARS_eNB_s *eNB = RC.eNB[0][0];
......@@ -878,7 +894,7 @@ int phy_rx_indication(struct nfapi_vnf_p7_config *config, nfapi_rx_indication_t
int phy_nr_rx_indication(struct nfapi_vnf_p7_config *config, nfapi_nr_rx_data_indication_t *ind) {
LOG_I(MAC, "Melissa in %s() NFAPI SFN/SF: %d/%d number_of_pdus :%u, and pdu %p\n",
LOG_I(NR_MAC, "In %s() NFAPI SFN/SF: %d/%d number_of_pdus :%u, and pdu %p\n",
__FUNCTION__,ind->sfn, ind->slot, ind->number_of_pdus, ind->pdu_list[0].pdu);
if(NFAPI_MODE == NFAPI_MODE_VNF)
......@@ -1178,7 +1194,7 @@ void *vnf_nr_p7_thread_start(void *ptr) {
p7_vnf->config->sync_indication = &phy_sync_indication;
p7_vnf->config->slot_indication = &phy_slot_indication;
p7_vnf->config->harq_indication = &phy_harq_indication;
p7_vnf->config->crc_indication = &phy_crc_indication;
p7_vnf->config->nr_crc_indication = &phy_nr_crc_indication;
p7_vnf->config->nr_rx_indication = &phy_nr_rx_indication;
p7_vnf->config->nr_rach_indication = &phy_nr_rach_indication;
p7_vnf->config->srs_indication = &phy_srs_indication;
......
......@@ -3384,6 +3384,9 @@ static uint8_t pack_nr_rx_data_indication_body(void* tlv, uint8_t **ppWritePacke
))
return 0;
if(pusharray8(value->pdu, value->pdu_length, value->pdu_length, ppWritePackedMsg, end) == 0)
return 0;
return 1;
}
......@@ -3397,20 +3400,19 @@ static uint8_t pack_nr_rx_data_indication(void *msg, uint8_t **ppWritePackedMsg,
))
return 0;
for(int i = 0; i < pNfapiMsg->number_of_pdus; i++)
for (int i = 0; i < pNfapiMsg->number_of_pdus; i++)
{
if(!pack_nr_rx_data_indication_body(&(pNfapiMsg->pdu_list[i]), ppWritePackedMsg, end))
return 0;
}
return 1;
return 1;
}
//NR CRC INDICATION
static uint8_t pack_nr_crc_indication_body(void* tlv, uint8_t **ppWritePackedMsg, uint8_t *end)
static uint8_t pack_nr_crc_indication_body(nfapi_nr_crc_t* value, uint8_t **ppWritePackedMsg, uint8_t *end)
{
nfapi_nr_crc_t* value = (nfapi_nr_crc_t*)tlv;
if(!(push32(value->handle, ppWritePackedMsg, end) &&
push16(value->rnti, ppWritePackedMsg, end) &&
......@@ -3437,9 +3439,9 @@ static uint8_t pack_nr_crc_indication(void *msg, uint8_t **ppWritePackedMsg, uin
))
return 0;
for(int i=0; i<pNfapiMsg->number_crcs;i++)
for (int i = 0; i < pNfapiMsg->number_crcs; i++)
{
if(!pack_nr_crc_indication_body(pNfapiMsg->crc_list,ppWritePackedMsg,end))
if(!pack_nr_crc_indication_body(&pNfapiMsg->crc_list[i], ppWritePackedMsg, end))
return 0;
}
......@@ -6365,10 +6367,11 @@ static uint8_t unpack_tx_request(uint8_t **ppReadPackedMsg, uint8_t *end, void *
//RX DATA INDICATION
static uint8_t unpack_nr_rx_data_indication_body(void* tlv, uint8_t **ppReadPackedMsg, uint8_t *end)
static uint8_t unpack_nr_rx_data_indication_body(nfapi_nr_rx_data_pdu_t* value,
uint8_t **ppReadPackedMsg,
uint8_t *end,
nfapi_p7_codec_config_t* config)
{
nfapi_nr_rx_data_pdu_t* value = (nfapi_nr_rx_data_pdu_t*)tlv;
if(!(pull32(ppReadPackedMsg, &value->handle, end) &&
pull16(ppReadPackedMsg, &value->rnti, end) &&
pull8(ppReadPackedMsg, &value->harq_id, end) &&
......@@ -6378,6 +6381,15 @@ static uint8_t unpack_nr_rx_data_indication_body(void* tlv, uint8_t **ppReadPack
pull16(ppReadPackedMsg, &value->rssi, end)
))
return 0;
uint16_t length = value->pdu_length;
value->pdu = nfapi_p7_allocate(length, config);
if (pullarray8(ppReadPackedMsg, value->pdu, length, length, end) == 0)
{
NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s pullarray8 failure\n", __FUNCTION__);
return 0;
}
return 1;
}
......@@ -6391,13 +6403,14 @@ static uint8_t unpack_nr_rx_data_indication(uint8_t **ppReadPackedMsg, uint8_t *
pull16(ppReadPackedMsg, &pNfapiMsg->number_of_pdus, end)
))
return 0;
if (pNfapiMsg->number_of_pdus > 0) {
if (pNfapiMsg->number_of_pdus > 0)
{
pNfapiMsg->pdu_list = nfapi_p7_allocate(sizeof(*pNfapiMsg->pdu_list) * pNfapiMsg->number_of_pdus, config);
}
for(int i=0; i < pNfapiMsg->number_of_pdus; i++)
for (int i = 0; i < pNfapiMsg->number_of_pdus; i++)
{
if(!unpack_nr_rx_data_indication_body(&pNfapiMsg->pdu_list[i], ppReadPackedMsg, end))
if(!unpack_nr_rx_data_indication_body(&pNfapiMsg->pdu_list[i], ppReadPackedMsg, end, config))
return 0;
}
......@@ -6406,10 +6419,8 @@ return 1;
//NR CRC INDICATION
static uint8_t unpack_nr_crc_indication_body(void* tlv, uint8_t **ppReadPackedMsg, uint8_t *end)
static uint8_t unpack_nr_crc_indication_body(nfapi_nr_crc_t* value, uint8_t **ppReadPackedMsg, uint8_t *end)
{
nfapi_nr_crc_t* value = (nfapi_nr_crc_t*)tlv;
if(!(pull32(ppReadPackedMsg, &value->handle, end) &&
pull16(ppReadPackedMsg, &value->rnti, end) &&
pull8(ppReadPackedMsg, &value->harq_id, end) &&
......@@ -6427,13 +6438,6 @@ static uint8_t unpack_nr_crc_indication_body(void* tlv, uint8_t **ppReadPackedMs
static uint8_t unpack_nr_crc_indication(uint8_t **ppReadPackedMsg, uint8_t *end, void *msg, nfapi_p7_codec_config_t* config)
{
//uint8_t *ptr = *ppReadPackedMsg;
// printf("\n Read P7 message indication unpack: ");
// while(ptr < end){
// printf(" %d ", *ptr);
// ptr++;
// }
// printf("\n");
nfapi_nr_crc_indication_t *pNfapiMsg = (nfapi_nr_crc_indication_t*)msg;
if (!(pull16(ppReadPackedMsg, &pNfapiMsg->sfn , end) &&
......@@ -6442,9 +6446,14 @@ static uint8_t unpack_nr_crc_indication(uint8_t **ppReadPackedMsg, uint8_t *end,
))
return 0;
for(int i=0; i<pNfapiMsg->number_crcs;i++)
if (pNfapiMsg->number_crcs > 0)
{
pNfapiMsg->crc_list = nfapi_p7_allocate(sizeof(*pNfapiMsg->crc_list) * pNfapiMsg->number_crcs, config);
}
for (int i = 0; i < pNfapiMsg->number_crcs; i++)
{
if(!unpack_nr_crc_indication_body(&pNfapiMsg->crc_list,ppReadPackedMsg,end))
if(!unpack_nr_crc_indication_body(&pNfapiMsg->crc_list[i], ppReadPackedMsg, end))
return 0;
}
......
......@@ -729,6 +729,20 @@ typedef struct nfapi_vnf_p7_config
*/
int (*crc_indication)(struct nfapi_vnf_p7_config* config, nfapi_crc_indication_t* ind);
/*! A callback for the nrCRC.indication
* \param config A pointer to the vnf p7 configuration
* \param ind A data structure for the decoded nrCRC.indication This will
* have been allocated on the stack.
* \return not currently used.
*
* The ind may contain pointers to dyanmically allocated sub structures
* such as the pdu. The dyanmically allocated structure will
* be deallocated on return. If the client wishes to 'keep' the structures
* then the substructure pointers should be set to 0 and then the client should
* use the codec_config.deallocate function to release it at a future point
*/
int (*nr_crc_indication)(struct nfapi_vnf_p7_config* config, nfapi_nr_crc_indication_t* ind);
/*! A callback for the RX_ULSCH.indication
* \param config A pointer to the vnf p7 configuration
* \param ind A data structure for the decoded RX_ULSCH.indication This will
......@@ -746,9 +760,9 @@ typedef struct nfapi_vnf_p7_config
*/
int (*rx_indication)(struct nfapi_vnf_p7_config* config, nfapi_rx_indication_t* ind);
/*! A callback for the RACH.indication
/*! A callback for the nrRX.indication
* \param config A pointer to the vnf p7 configuration
* \param ind A data structure for the decoded nrRACH.indication This will
* \param ind A data structure for the decoded nrRX.indication This will
* have been allocated on the stack.
* \return not currently used.
*
......@@ -774,7 +788,7 @@ typedef struct nfapi_vnf_p7_config
*/
int (*rach_indication)(struct nfapi_vnf_p7_config* config, nfapi_rach_indication_t* ind);
/*! A callback for the RACH.indication
/*! A callback for the nrRACH.indication
* \param config A pointer to the vnf p7 configuration
* \param ind A data structure for the decoded nrRACH.indication This will
* have been allocated on the stack.
......
......@@ -1504,7 +1504,14 @@ void vnf_handle_nr_crc_indication(void *pRecvMsg, int recvMsgLen, vnf_p7_t* vnf_
{
NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s: Failed to unpack message\n", __FUNCTION__);
}
else
{
NFAPI_TRACE(NFAPI_TRACE_INFO, "%s: Handling CRC Indication\n", __FUNCTION__);
if(vnf_p7->_public.nr_crc_indication)
{
(vnf_p7->_public.nr_crc_indication)(&vnf_p7->_public, &ind);
}
}
}
}
......
......@@ -46,13 +46,7 @@ const char *dl_pdu_type[]={"DCI", "DLSCH", "RA_DLSCH"};
const char *ul_pdu_type[]={"PRACH", "PUCCH", "PUSCH", "SRS"};
int8_t nr_ue_scheduled_response_stub(nr_scheduled_response_t *scheduled_response) {
/* Melissa, this is a hack. We are not calling nr_ue_scheduled_response
because it requires PHY_vars_UE_g. We are basically not using layer
one here so we are calling a stub version of this scheduled response.
The original scheduled_response sends downlink information for the DCIs.
The physical layer provides this information. We dont need this yet.
if we have a tx req we need to fill it and may need to go into the ul_config
to get other information. Need rnti., Fill rx_ind that goes up on socket */
if(scheduled_response != NULL){
if (scheduled_response->ul_config != NULL){
......@@ -71,6 +65,7 @@ int8_t nr_ue_scheduled_response_stub(nr_scheduled_response_t *scheduled_response
{
NR_UL_IND_t UL_INFO;
nfapi_nr_rx_data_indication_t *rx_ind = &UL_INFO.rx_ind;
nfapi_nr_crc_indication_t *crc_ind = &UL_INFO.crc_ind;
nfapi_nr_ue_pusch_pdu_t *pusch_config_pdu = &ul_config->ul_config_list[i].pusch_config_pdu;
if (scheduled_response->tx_request)
{
......@@ -81,16 +76,41 @@ int8_t nr_ue_scheduled_response_stub(nr_scheduled_response_t *scheduled_response
fapi_nr_tx_request_body_t *tx_req_body = &scheduled_response->tx_request->tx_request_body[i];
rx_ind->pdu_list = CALLOC(1, sizeof(*rx_ind->pdu_list));
rx_ind->pdu_list[i].handle = pusch_config_pdu->handle;
rx_ind->pdu_list[i].harq_id = pusch_config_pdu->pusch_data.harq_process_id;
rx_ind->pdu_list[i].pdu = tx_req_body->pdu;
rx_ind->pdu_list[i].pdu_length = tx_req_body->pdu_length;
rx_ind->pdu_list[i].rnti = pusch_config_pdu->rnti;
rx_ind->pdu_list[i].handle = pusch_config_pdu->handle;
rx_ind->pdu_list[i].timing_advance = 0;
rx_ind->pdu_list[i].ul_cqi = 27;
LOG_I(PHY, "In %s: Filled rx_indwith tx_req \n", __FUNCTION__);
scheduled_response->tx_request->number_of_pdus = 0;
LOG_I(PHY, "Melissa In %s: Filled rx_indwith tx_req \n", __FUNCTION__);
send_nsa_standalone_msg(&UL_INFO, rx_ind->header.message_id);
free(rx_ind->pdu_list);
}
if (scheduled_response->ul_config)
{
crc_ind->header.message_id = NFAPI_NR_PHY_MSG_TYPE_CRC_INDICATION;
crc_ind->number_crcs = scheduled_response->ul_config->number_pdus;
crc_ind->sfn = scheduled_response->ul_config->sfn;
crc_ind->slot = scheduled_response->ul_config->slot;
crc_ind->crc_list = CALLOC(1, sizeof(*crc_ind->crc_list));
crc_ind->crc_list[i].handle = pusch_config_pdu->handle;
crc_ind->crc_list[i].harq_id = pusch_config_pdu->pusch_data.harq_process_id;
crc_ind->crc_list[i].num_cb = pusch_config_pdu->pusch_data.num_cb;
crc_ind->crc_list[i].rnti = pusch_config_pdu->rnti;
crc_ind->crc_list[i].tb_crc_status = 0;
crc_ind->crc_list[i].timing_advance = 0;
crc_ind->crc_list[i].ul_cqi = 27;
LOG_I(PHY, "In %s: Filled crc_indwith ulconfig\n", __FUNCTION__);
scheduled_response->ul_config->number_pdus = 0;
send_nsa_standalone_msg(&UL_INFO, crc_ind->header.message_id);
free(crc_ind->crc_list);
}
break;
}
......
......@@ -467,7 +467,7 @@ void nr_Msg3_transmitted(module_id_t mod_id, uint8_t CC_id, frame_t frameP, uint
NR_RACH_ConfigCommon_t *nr_rach_ConfigCommon = mac->scc->uplinkConfigCommon->initialUplinkBWP->rach_ConfigCommon->choice.setup;
RA_config_t *ra = &mac->ra;
LOG_I(MAC,"Melissa In %s: [UE %d] Frame %d, CB-RA: starting contention resolution timer\n", __FUNCTION__, mod_id, frameP);
LOG_I(MAC,"In %s: [UE %d] Frame %d, CB-RA: starting contention resolution timer\n", __FUNCTION__, mod_id, frameP);
// start contention resolution timer
ra->RA_contention_resolution_cnt = (nr_rach_ConfigCommon->ra_ContentionResolutionTimer + 1) * 8;
......
......@@ -941,7 +941,7 @@ NR_UE_L2_STATE_t nr_ue_scheduler(nr_downlink_indication_t *dl_info, nr_uplink_in
tx_req.tx_request_body[0].pdu_index = j;
tx_req.tx_request_body[0].pdu = ulsch_input_buffer;
if (ra->ra_state != RA_SUCCEEDED && !ra->cfra || get_softmodem_params()->nsa && ra->cfra && ra->ra_state==RA_SUCCEEDED){ //Melissa change this accordingly
if (ra->ra_state != RA_SUCCEEDED && !ra->cfra || get_softmodem_params()->nsa && ra->cfra && ra->ra_state==RA_SUCCEEDED){
nr_Msg3_transmitted(ul_info->module_id, ul_info->cc_id, ul_info->frame_tx, ul_info->gNB_index);
}
}
......@@ -1021,7 +1021,7 @@ int nr_ue_pusch_scheduler(NR_UE_MAC_INST_t *mac,
}
LOG_I(MAC, "Melissa Elkadi In %s: currently at [%d.%d] UL transmission in [%d.%d] (k2 %d delta %d)\n", __FUNCTION__, current_frame, current_slot, *frame_tx, *slot_tx, k2, delta);
LOG_I(MAC, "In %s: currently at [%d.%d] UL transmission in [%d.%d] (k2 %d delta %d)\n", __FUNCTION__, current_frame, current_slot, *frame_tx, *slot_tx, k2, delta);
return 0;
......
......@@ -117,15 +117,16 @@ void handle_nr_uci(NR_UL_IND_t *UL_info)
void handle_nr_ulsch(NR_UL_IND_t *UL_info)
{
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++) {
for (int j = 0; j < UL_info->crc_ind.number_crcs; j++) {
// Melissa: TODO come back and differentiate between global UL_info and passed in arg
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++) {
for (int 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_I(PHY,
"UL_info->crc_ind.pdu_list[%d].rnti:%04x "
"UL_info->rx_ind.pdu_list[%d].rnti:%04x\n",
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,
......@@ -134,60 +135,43 @@ void handle_nr_ulsch(NR_UL_IND_t *UL_info)
if (crc->rnti != rx->rnti)
continue;
LOG_D(MAC,
LOG_D(NR_MAC,
"%4d.%2d Calling rx_sdu (CRC %s/tb_crc_status %d)\n",
UL_info->frame,
UL_info->slot,
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 */
//Gokul
// 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->module_id, UL_info->frame, UL_info->slot, crc);
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.module_id, UL_INFO.frame, UL_INFO.slot, crc);
break;
} // for (j=0;j<UL_info->crc_ind.number_crcs;j++)
} // for (i=0;i<UL_info->rx_ind.number_of_pdus;i++)
UL_info->crc_ind.number_crcs = 0;
UL_info->rx_ind.number_of_pdus = 0;
} else if (UL_info->rx_ind.number_of_pdus != 0
|| UL_info->crc_ind.number_crcs != 0) {
LOG_E(PHY,
} // for (j=0;j<UL_INFO.crc_ind.number_crcs;j++)
} // for (i=0;i<UL_INFO.rx_ind.number_of_pdus;i++)
UL_INFO.crc_ind.number_crcs = 0;
UL_INFO.rx_ind.number_of_pdus = 0;
} 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->rx_ind.sfn,
UL_info->rx_ind.slot);
} else if (UL_INFO.rx_ind.number_of_pdus > 0) {
for (int i = 0; i < UL_INFO.rx_ind.number_of_pdus; i++)
{
nr_rx_sdu(UL_INFO.module_id,
UL_INFO.CC_id,
UL_INFO.frame,
UL_INFO.slot,
UL_INFO.rx_ind.pdu_list[i].rnti,
UL_INFO.rx_ind.pdu_list[i].pdu,
UL_INFO.rx_ind.pdu_list[i].pdu_length,
UL_INFO.rx_ind.pdu_list[i].timing_advance,
UL_INFO.rx_ind.pdu_list[i].ul_cqi,
UL_INFO.rx_ind.pdu_list[i].rssi);
}
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.rx_ind.sfn,
UL_INFO.rx_ind.slot);
}
}
......
......@@ -134,7 +134,7 @@ void send_nsa_standalone_msg(NR_UL_IND_t *UL_INFO, uint16_t msg_id)
case NFAPI_NR_PHY_MSG_TYPE_RACH_INDICATION:
{
char buffer[NFAPI_MAX_PACKED_MESSAGE_SIZE];
LOG_I(NR_MAC, "Melissa, this is RACH header id :%d", UL_INFO->rach_ind.header.message_id);
LOG_D(NR_MAC, "RACH header id :%d", UL_INFO->rach_ind.header.message_id);
int encoded_size = nfapi_nr_p7_message_pack(&UL_INFO->rach_ind, buffer, sizeof(buffer), NULL);
if (encoded_size <= 0)
{
......@@ -154,7 +154,7 @@ void send_nsa_standalone_msg(NR_UL_IND_t *UL_INFO, uint16_t msg_id)
case NFAPI_NR_PHY_MSG_TYPE_RX_DATA_INDICATION:
{
char buffer[NFAPI_MAX_PACKED_MESSAGE_SIZE];
LOG_I(NR_MAC, "Melissa, this is RX header id :%d", UL_INFO->rx_ind.header.message_id);
LOG_D(NR_MAC, "RX header id :%d", UL_INFO->rx_ind.header.message_id);
int encoded_size = nfapi_nr_p7_message_pack(&UL_INFO->rx_ind, buffer, sizeof(buffer), NULL);
if (encoded_size <= 0)
{
......@@ -172,7 +172,25 @@ void send_nsa_standalone_msg(NR_UL_IND_t *UL_INFO, uint16_t msg_id)
break;
}
case NFAPI_NR_PHY_MSG_TYPE_CRC_INDICATION:
{
char buffer[NFAPI_MAX_PACKED_MESSAGE_SIZE];
LOG_D(NR_MAC, "CRC header id :%d", UL_INFO->crc_ind.header.message_id);
int encoded_size = nfapi_nr_p7_message_pack(&UL_INFO->crc_ind, buffer, sizeof(buffer), NULL);
if (encoded_size <= 0)
{
LOG_E(NR_MAC, "nfapi_nr_p7_message_pack has failed. Encoded size = %d\n", encoded_size);
return;
}
LOG_I(NR_MAC, "NR_CRC_IND sent to Proxy, Size: %d Frame %d Slot %d Num PDUS %d\n", encoded_size,
UL_INFO->crc_ind.sfn, UL_INFO->crc_ind.slot, UL_INFO->crc_ind.number_crcs);
if (send(ue_tx_sock_descriptor, buffer, encoded_size, 0) < 0)
{
LOG_E(NR_MAC, "Send Proxy NR_UE failed\n");
return;
}
break;
}
case NFAPI_NR_PHY_MSG_TYPE_SRS_INDICATION:
break;
case NFAPI_NR_PHY_MSG_TYPE_UCI_INDICATION:
......
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