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
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -3382,7 +3382,10 @@ static uint8_t pack_nr_rx_data_indication_body(void* tlv, uint8_t **ppWritePacke
|
||||
push16(value->timing_advance, ppWritePackedMsg, end) &&
|
||||
push16(value->rssi, ppWritePackedMsg, end)
|
||||
))
|
||||
return 0;
|
||||
return 0;
|
||||
|
||||
if(pusharray8(value->pdu, value->pdu_length, value->pdu_length, ppWritePackedMsg, end) == 0)
|
||||
return 0;
|
||||
|
||||
return 1;
|
||||
}
|
||||
@@ -3395,22 +3398,21 @@ static uint8_t pack_nr_rx_data_indication(void *msg, uint8_t **ppWritePackedMsg,
|
||||
push16(pNfapiMsg->slot , ppWritePackedMsg, end) &&
|
||||
push16(pNfapiMsg->number_of_pdus, ppWritePackedMsg, end)
|
||||
))
|
||||
return 0;
|
||||
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 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,19 +6367,29 @@ 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) &&
|
||||
pull16(ppReadPackedMsg, &value->pdu_length, end) &&
|
||||
pull8(ppReadPackedMsg, &value->ul_cqi, end) &&
|
||||
pull16(ppReadPackedMsg, &value->timing_advance, end) &&
|
||||
pull16(ppReadPackedMsg, &value->rssi, end)
|
||||
pull16(ppReadPackedMsg, &value->timing_advance, end) &&
|
||||
pull16(ppReadPackedMsg, &value->rssi, end)
|
||||
))
|
||||
return 0;
|
||||
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,14 +6403,15 @@ 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))
|
||||
return 0;
|
||||
if(!unpack_nr_rx_data_indication_body(&pNfapiMsg->pdu_list[i], ppReadPackedMsg, end, config))
|
||||
return 0;
|
||||
}
|
||||
|
||||
return 1;
|
||||
@@ -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)
|
||||
{
|
||||
nfapi_nr_crc_t* value = (nfapi_nr_crc_t*)tlv;
|
||||
|
||||
static uint8_t unpack_nr_crc_indication_body(nfapi_nr_crc_t* value, uint8_t **ppReadPackedMsg, uint8_t *end)
|
||||
{
|
||||
if(!(pull32(ppReadPackedMsg, &value->handle, end) &&
|
||||
pull16(ppReadPackedMsg, &value->rnti, end) &&
|
||||
pull8(ppReadPackedMsg, &value->harq_id, end) &&
|
||||
@@ -6420,20 +6431,13 @@ static uint8_t unpack_nr_crc_indication_body(void* tlv, uint8_t **ppReadPackedMs
|
||||
pull16(ppReadPackedMsg, &value->timing_advance, end) &&
|
||||
pull16(ppReadPackedMsg, &value->rssi, end)
|
||||
))
|
||||
return 0;
|
||||
return 0;
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
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,10 +6446,15 @@ 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))
|
||||
return 0;
|
||||
if(!unpack_nr_crc_indication_body(&pNfapiMsg->crc_list[i], ppReadPackedMsg, end))
|
||||
return 0;
|
||||
}
|
||||
|
||||
return 1;
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user