PBCH working

This commit is contained in:
Mahesh
2020-11-06 19:48:34 +05:30
parent 6f4e894318
commit 643fc632d6
33 changed files with 1754 additions and 500 deletions
@@ -1125,15 +1125,13 @@ typedef struct {
uint32_t error_code;
nfapi_pnf_param_general_t pnf_param_general;
nfapi_pnf_phy_t pnf_phy;
/*
nfapi_pnf_rf_t pnf_rf;
nfapi_pnf_phy_rel10_t pnf_phy_rel10;
nfapi_pnf_phy_rel11_t pnf_phy_rel11;
nfapi_pnf_phy_rel12_t pnf_phy_rel12;
nfapi_pnf_phy_rel13_t pnf_phy_rel13;
nfapi_pnf_phy_rel13_nb_iot_t pnf_phy_rel13_nb_iot;
// nfapi_pnf_rf_t pnf_rf;
// nfapi_pnf_phy_rel10_t pnf_phy_rel10;
// nfapi_pnf_phy_rel11_t pnf_phy_rel11;
// nfapi_pnf_phy_rel12_t pnf_phy_rel12;
// nfapi_pnf_phy_rel13_t pnf_phy_rel13;
// nfapi_pnf_phy_rel13_nb_iot_t pnf_phy_rel13_nb_iot;
nfapi_pnf_phy_rel15_t pnf_phy_rel15;
*/
nfapi_vendor_extension_tlv_t vendor_extension;
} nfapi_pnf_param_response_t;
@@ -3957,6 +3955,7 @@ int nfapi_p4_message_unpack(void *pMessageBuf, uint32_t messageBufLen, void *pUn
*
*/
int nfapi_p5_message_pack(void *pMessageBuf, uint32_t messageBufLen, void *pPackedBuf, uint32_t packedBufLen, nfapi_p4_p5_codec_config_t* config);
//int nfapi_nr_p5_message_pack(void *pMessageBuf, uint32_t messageBufLen, void *pPackedBuf, uint32_t packedBufLen, nfapi_p4_p5_codec_config_t* config);
/*! \brief Decodes an NFAPI P5 message header
* \param pMessageBuf A pointer to an encoded P5 message header
@@ -3980,6 +3979,7 @@ int nfapi_p5_message_header_unpack(void *pMessageBuf, uint32_t messageBufLen, vo
*
* The function will decode a byte stream pointed to by pMessageBuf into a nfapi p5 message structure pointer to by pUnpackedBuf
*/
//int nfapi_nr_p5_message_unpack(void *pMessageBuf, uint32_t messageBufLen, void *pUnpackedBuf, uint32_t unpackedBufLen, nfapi_p4_p5_codec_config_t* config);
int nfapi_p5_message_unpack(void *pMessageBuf, uint32_t messageBufLen, void *pUnpackedBuf, uint32_t unpackedBufLen, nfapi_p4_p5_codec_config_t* config);
/*! \brief Encodes an NFAPI P7 message to a buffer
@@ -69,8 +69,16 @@ typedef enum {
NFAPI_NR_PHY_MSG_TYPE_CRC_INDICATION= 0X86,
NFAPI_NR_PHY_MSG_TYPE_UCI_INDICATION= 0X87,
NFAPI_NR_PHY_MSG_TYPE_SRS_INDICATION= 0X88,
NFAPI_NR_PHY_MSG_TYPE_RACH_INDICATION= 0X89
NFAPI_NR_PHY_MSG_TYPE_RACH_INDICATION= 0X89,
//RESERVED 0X8a ~ 0xff
NFAPI_NR_PHY_MSG_TYPE_PNF_PARAM_REQUEST = 0x0100,
NFAPI_NR_PHY_MSG_TYPE_PNF_PARAM_RESPONSE = 0x0101,
NFAPI_NR_PHY_MSG_TYPE_PNF_CONFIG_REQUEST= 0x0102,
NFAPI_NR_PHY_MSG_TYPE_PNF_CONFIG_RESPONSE= 0x0103,
NFAPI_NR_PHY_MSG_TYPE_PNF_START_REQUEST= 0x0104,
NFAPI_NR_PHY_MSG_TYPE_PNF_START_RESPONSE= 0x0105,
NFAPI_NR_PHY_MSG_TYPE_PNF_STOP_REQUEST= 0x0106,
NFAPI_NR_PHY_MSG_TYPE_PNF_STOP_RESPONSE= 0x0107
} nfapi_nr_phy_msg_type_e;
// SCF222_5G-FAPI_PHY_SPI_Specificayion.pdf Section 3.3
@@ -454,6 +462,54 @@ typedef enum { // Table 2-27
NFAPI_NR_START_MSG_INVALID_STATE
} nfapi_nr_start_errors_e;
//PNF P5 NR
typedef struct {
nfapi_p4_p5_message_header_t header;
nfapi_vendor_extension_tlv_t vendor_extension;
} nfapi_nr_pnf_param_request_t;
typedef struct {
nfapi_p4_p5_message_header_t header;
uint32_t error_code;
nfapi_pnf_param_general_t pnf_param_general;
nfapi_pnf_phy_t pnf_phy;
nfapi_vendor_extension_tlv_t vendor_extension;
} nfapi_nr_pnf_param_response_t;
typedef struct {
nfapi_p4_p5_message_header_t header;
uint8_t num_tlvs;
nfapi_pnf_phy_rf_config_t pnf_phy_rf_config;
nfapi_vendor_extension_tlv_t vendor_extension;
} nfapi_nr_pnf_config_request_t;
typedef struct {
nfapi_p4_p5_message_header_t header;
uint32_t error_code;
nfapi_vendor_extension_tlv_t vendor_extension;
} nfapi_nr_pnf_config_response_t;
typedef struct {
nfapi_p4_p5_message_header_t header;
nfapi_vendor_extension_tlv_t vendor_extension;
} nfapi_nr_pnf_start_request_t;
typedef struct {
nfapi_p4_p5_message_header_t header;
uint32_t error_code;
nfapi_vendor_extension_tlv_t vendor_extension;
} nfapi_nr_pnf_start_response_t;
typedef struct {
nfapi_p4_p5_message_header_t header;
nfapi_vendor_extension_tlv_t vendor_extension;
} nfapi_nr_pnf_stop_request_t;
typedef struct {
nfapi_p4_p5_message_header_t header;
uint32_t error_code;
nfapi_vendor_extension_tlv_t vendor_extension;
} nfapi_nr_pnf_stop_response_t;
/* PARAM.REQUEST */
+364 -27
View File
@@ -40,6 +40,13 @@
// Pack routines
//TODO: Add pacl/unpack fns for uint32 and uint64
/*
static uint8_t pack_nr_pnf_param_request(void *msg, uint8_t **ppWritePackedMsg, uint8_t* end, nfapi_p4_p5_codec_config_t* config)
{
nfapi_nr_pnf_param_request_t* request = (nfapi_nr_pnf_param_request_t*)msg;
return pack_vendor_extension_tlv(request->vendor_extension, ppWritePackedMsg, end, config);
}
*/
static uint8_t pack_pnf_param_request(void *msg, uint8_t **ppWritePackedMsg, uint8_t* end, nfapi_p4_p5_codec_config_t* config)
{
nfapi_pnf_param_request_t* request = (nfapi_pnf_param_request_t*)msg;
@@ -235,8 +242,17 @@ static uint8_t pack_pnf_phy_rel13_nb_iot_value(void* tlv, uint8_t **ppWritePacke
return (push16(value->number_of_phys, ppWritePackedMsg, end) &&
packarray(value->phy, sizeof(nfapi_pnf_phy_rel13_nb_iot_info_t), NFAPI_MAX_PNF_PHY, value->number_of_phys, ppWritePackedMsg, end, &pack_pnf_phy_rel13_nb_iot_info));
}
/*
static uint8_t pack_nr_pnf_param_response(void *msg, uint8_t **ppWritePackedMsg, uint8_t *end, nfapi_p4_p5_codec_config_t* config)
{
nfapi_nr_pnf_param_response_t *pNfapiMsg = (nfapi_nr_pnf_param_response_t*)msg;
return (push32(pNfapiMsg->error_code, ppWritePackedMsg, end) &&
pack_tlv(NFAPI_PNF_PARAM_GENERAL_TAG, &pNfapiMsg->pnf_param_general, ppWritePackedMsg, end, &pack_pnf_param_general_value) &&
pack_tlv(NFAPI_PNF_PHY_TAG, &pNfapiMsg->pnf_phy, ppWritePackedMsg, end, &pack_pnf_phy_value) &&
pack_vendor_extension_tlv(pNfapiMsg->vendor_extension, ppWritePackedMsg, end, config));
}
*/
static uint8_t pack_pnf_param_response(void *msg, uint8_t **ppWritePackedMsg, uint8_t *end, nfapi_p4_p5_codec_config_t* config)
{
nfapi_pnf_param_response_t *pNfapiMsg = (nfapi_pnf_param_response_t*)msg;
@@ -244,15 +260,13 @@ static uint8_t pack_pnf_param_response(void *msg, uint8_t **ppWritePackedMsg, ui
return (push32(pNfapiMsg->error_code, ppWritePackedMsg, end) &&
pack_tlv(NFAPI_PNF_PARAM_GENERAL_TAG, &pNfapiMsg->pnf_param_general, ppWritePackedMsg, end, &pack_pnf_param_general_value) &&
pack_tlv(NFAPI_PNF_PHY_TAG, &pNfapiMsg->pnf_phy, ppWritePackedMsg, end, &pack_pnf_phy_value) &&
/*
pack_tlv(NFAPI_PNF_RF_TAG, &pNfapiMsg->pnf_rf, ppWritePackedMsg, end, &pack_pnf_rf_value) &&
pack_tlv(NFAPI_PNF_PHY_REL10_TAG, &pNfapiMsg->pnf_phy_rel10, ppWritePackedMsg, end, &pack_pnf_phy_rel10_value) &&
pack_tlv(NFAPI_PNF_PHY_REL11_TAG, &pNfapiMsg->pnf_phy_rel11, ppWritePackedMsg, end, &pack_pnf_phy_rel11_value) &&
pack_tlv(NFAPI_PNF_PHY_REL12_TAG, &pNfapiMsg->pnf_phy_rel12, ppWritePackedMsg, end, &pack_pnf_phy_rel12_value) &&
pack_tlv(NFAPI_PNF_PHY_REL13_TAG, &pNfapiMsg->pnf_phy_rel13, ppWritePackedMsg, end, &pack_pnf_phy_rel13_value) &&
pack_tlv(NFAPI_PNF_PHY_REL13_NB_IOT_TAG, &pNfapiMsg->pnf_phy_rel13_nb_iot, ppWritePackedMsg, end, &pack_pnf_phy_rel13_nb_iot_value) &&
*/
pack_vendor_extension_tlv(pNfapiMsg->vendor_extension, ppWritePackedMsg, end, config));
// pack_tlv(NFAPI_PNF_RF_TAG, &pNfapiMsg->pnf_rf, ppWritePackedMsg, end, &pack_pnf_rf_value) &&
// pack_tlv(NFAPI_PNF_PHY_REL10_TAG, &pNfapiMsg->pnf_phy_rel10, ppWritePackedMsg, end, &pack_pnf_phy_rel10_value) &&
// pack_tlv(NFAPI_PNF_PHY_REL11_TAG, &pNfapiMsg->pnf_phy_rel11, ppWritePackedMsg, end, &pack_pnf_phy_rel11_value) &&
// pack_tlv(NFAPI_PNF_PHY_REL12_TAG, &pNfapiMsg->pnf_phy_rel12, ppWritePackedMsg, end, &pack_pnf_phy_rel12_value) &&
// pack_tlv(NFAPI_PNF_PHY_REL13_TAG, &pNfapiMsg->pnf_phy_rel13, ppWritePackedMsg, end, &pack_pnf_phy_rel13_value) &&
// pack_tlv(NFAPI_PNF_PHY_REL13_NB_IOT_TAG, &pNfapiMsg->pnf_phy_rel13_nb_iot, ppWritePackedMsg, end, &pack_pnf_phy_rel13_nb_iot_value) &&
pack_vendor_extension_tlv(pNfapiMsg->vendor_extension, ppWritePackedMsg, end, config));
}
static uint8_t pack_phy_rf_config_info(void* elem, uint8_t **ppWritePackedMsg, uint8_t *end)
@@ -714,7 +728,6 @@ static uint8_t pack_config_request(void *msg, uint8_t **ppWritePackedMsg, uint8_
pack_tlv(NFAPI_NR_CONFIG_DL_FREQUENCY_TAG, &(pNfapiMsg->carrier_config.dl_frequency), ppWritePackedMsg, end, &pack_uint32_tlv_value) &&
pack_tlv(NFAPI_NR_CONFIG_DL_GRID_SIZE_TAG, &(pNfapiMsg->carrier_config.dl_grid_size[1]), ppWritePackedMsg, end, &pack_uint16_tlv_value) &&
pack_tlv(NFAPI_NR_CONFIG_DL_K0_TAG, &(pNfapiMsg->carrier_config.dl_k0[1]), ppWritePackedMsg, end, &pack_uint16_tlv_value) &&
pack_tlv(NFAPI_NR_CONFIG_FREQUENCY_SHIFT_7P5KHZ_TAG, &(pNfapiMsg->carrier_config.frequency_shift_7p5khz), ppWritePackedMsg, end, &pack_uint8_tlv_value) &&
pack_tlv(NFAPI_NR_CONFIG_NUM_RX_ANT_TAG, &(pNfapiMsg->carrier_config.num_rx_ant), ppWritePackedMsg, end, &pack_uint16_tlv_value) &&
pack_tlv(NFAPI_NR_CONFIG_NUM_TX_ANT_TAG, &(pNfapiMsg->carrier_config.num_tx_ant), ppWritePackedMsg, end, &pack_uint16_tlv_value) &&
pack_tlv(NFAPI_NR_CONFIG_UL_GRID_SIZE_TAG, &(pNfapiMsg->carrier_config.ul_grid_size[1]), ppWritePackedMsg, end, &pack_uint16_tlv_value) &&
@@ -725,24 +738,22 @@ static uint8_t pack_config_request(void *msg, uint8_t **ppWritePackedMsg, uint8_
pack_tlv(NFAPI_NR_CONFIG_FRAME_DUPLEX_TYPE_TAG, &(pNfapiMsg->cell_config.frame_duplex_type), ppWritePackedMsg, end, &pack_uint8_tlv_value) &&
pack_tlv(NFAPI_NR_CONFIG_PHY_CELL_ID_TAG, &(pNfapiMsg->cell_config.phy_cell_id), ppWritePackedMsg, end, &pack_uint8_tlv_value) &&
pack_tlv(NFAPI_NR_CONFIG_RSSI_MEASUREMENT_TAG, &(pNfapiMsg->measurement_config.rssi_measurement), ppWritePackedMsg, end, &pack_uint8_tlv_value) &&
pack_tlv(NFAPI_NR_CONFIG_NUM_PRACH_FD_OCCASIONS_TAG, &(pNfapiMsg->prach_config.num_prach_fd_occasions), ppWritePackedMsg, end, &pack_uint8_tlv_value) &&
pack_tlv(NFAPI_NR_CONFIG_PRACH_MULTIPLE_CARRIERS_IN_A_BAND_TAG, &(pNfapiMsg->prach_config.prach_multiple_carriers_in_a_band), ppWritePackedMsg, end, &pack_uint16_tlv_value) &&
pack_tlv(NFAPI_NR_CONFIG_PRACH_SEQUENCE_LENGTH_TAG, &(pNfapiMsg->prach_config.prach_sequence_length), ppWritePackedMsg, end, &pack_uint8_tlv_value) &&
pack_tlv(NFAPI_NR_CONFIG_RESTRICTED_SET_CONFIG_TAG, &(pNfapiMsg->prach_config.restricted_set_config), ppWritePackedMsg, end, &pack_uint8_tlv_value) &&
pack_tlv(NFAPI_NR_CONFIG_SSB_PER_RACH_TAG, &(pNfapiMsg->prach_config.ssb_per_rach), ppWritePackedMsg, end, &pack_uint8_tlv_value) &&
pack_tlv(NFAPI_NR_CONFIG_PRACH_SUB_C_SPACING_TAG, &(pNfapiMsg->prach_config.prach_sub_c_spacing), ppWritePackedMsg, end, &pack_uint8_tlv_value) &&
pack_tlv(NFAPI_NR_CONFIG_PRACH_ROOT_SEQUENCE_INDEX_TAG, &(pNfapiMsg->prach_config.num_prach_fd_occasions_list[0].prach_root_sequence_index), ppWritePackedMsg, end, &pack_uint16_tlv_value) &&
pack_tlv(NFAPI_NR_CONFIG_K1_TAG, &(pNfapiMsg->prach_config.num_prach_fd_occasions_list[0].k1), ppWritePackedMsg, end, &pack_uint16_tlv_value) &&
pack_tlv(NFAPI_NR_CONFIG_PRACH_ZERO_CORR_CONF_TAG, &(pNfapiMsg->prach_config.num_prach_fd_occasions_list[0].prach_zero_corr_conf), ppWritePackedMsg, end, &pack_uint8_tlv_value) &&
pack_tlv(NFAPI_NR_CONFIG_NUM_ROOT_SEQUENCES_TAG, &(pNfapiMsg->prach_config.num_prach_fd_occasions_list[0].num_root_sequences), ppWritePackedMsg, end, &pack_uint8_tlv_value) &&
pack_tlv(NFAPI_NR_CONFIG_BCH_PAYLOAD_TAG, &(pNfapiMsg->ssb_config.bch_payload), ppWritePackedMsg, end, &pack_uint8_tlv_value) &&
pack_tlv(NFAPI_NR_CONFIG_SCS_COMMON_TAG, &(pNfapiMsg->ssb_config.scs_common), ppWritePackedMsg, end, &pack_uint8_tlv_value) &&
pack_tlv(NFAPI_NR_CONFIG_SS_PBCH_POWER_TAG, &(pNfapiMsg->ssb_config.ss_pbch_power), ppWritePackedMsg, end, &pack_uint32_tlv_value) &&
pack_tlv(NFAPI_NR_CONFIG_BETA_PSS_TAG, &(pNfapiMsg->ssb_table.beta_pss), ppWritePackedMsg, end, &pack_uint8_tlv_value) &&
pack_tlv(NFAPI_NR_CONFIG_MIB_TAG, &(pNfapiMsg->ssb_table.MIB), ppWritePackedMsg, end, &pack_uint32_tlv_value) &&
pack_tlv(NFAPI_NR_CONFIG_MULTIPLE_CELLS_SS_PBCH_IN_A_CARRIER_TAG, &(pNfapiMsg->ssb_table.multiple_cells_ss_pbch_in_a_carrier), ppWritePackedMsg, end, &pack_uint8_tlv_value) &&
pack_tlv(NFAPI_NR_CONFIG_SS_PBCH_MULTIPLE_CARRIERS_IN_A_BAND_TAG, &(pNfapiMsg->ssb_table.ss_pbch_multiple_carriers_in_a_band), ppWritePackedMsg, end, &pack_uint8_tlv_value) &&
// pack_tlv(NFAPI_NR_CONFIG_BEAM_ID_TAG, &(pNfapiMsg->ssb_table.ssb_beam_id_list[0].beam_id), ppWritePackedMsg, end, &pack_uint16_tlv_value) &&
pack_tlv(NFAPI_NR_CONFIG_SSB_MASK_TAG, &(pNfapiMsg->ssb_table.ssb_mask_list[0].ssb_mask), ppWritePackedMsg, end, &pack_uint32_tlv_value) &&
pack_tlv(NFAPI_NR_CONFIG_SSB_MASK_TAG, &(pNfapiMsg->ssb_table.ssb_mask_list[1].ssb_mask), ppWritePackedMsg, end, &pack_uint32_tlv_value) &&
@@ -967,6 +978,111 @@ static uint8_t pack_measurement_response(void *msg, uint8_t **ppWritePackedMsg,
pack_tlv(NFAPI_MEASUREMENT_RESPONSE_THERMAL_NOISE_MEASUREMENT_TAG, &(pNfapiMsg->thermal_noise_power_measurement), ppWritePackedMsg, end, &pack_uint16_tlv_value) &&
pack_vendor_extension_tlv(pNfapiMsg->vendor_extension, ppWritePackedMsg, end, config));
}
/*
static uint8_t pack_nr_p5_message_body(nfapi_p4_p5_message_header_t *header, uint8_t **ppWritePackedMsg, uint8_t *end, nfapi_p4_p5_codec_config_t* config)
{
uint8_t result = 0;
// look for the specific message
switch (header->message_id)
{
case NFAPI_NR_PHY_MSG_TYPE_PNF_PARAM_REQUEST:
result = pack_nr_pnf_param_request(header, ppWritePackedMsg, end, config);
break;
case NFAPI_PNF_PARAM_RESPONSE:
result = pack_nr_pnf_param_response(header, ppWritePackedMsg, end, config);
break;
case NFAPI_PNF_CONFIG_REQUEST:
result = pack_pnf_config_request(header, ppWritePackedMsg, end, config);
break;
case NFAPI_PNF_CONFIG_RESPONSE:
result = pack_pnf_config_response(header, ppWritePackedMsg, end, config);
break;
case NFAPI_PNF_START_REQUEST:
result = pack_pnf_start_request(header, ppWritePackedMsg, end, config);
break;
case NFAPI_PNF_START_RESPONSE:
result = pack_pnf_start_response(header, ppWritePackedMsg, end, config);
break;
case NFAPI_PNF_STOP_REQUEST:
result = pack_pnf_stop_request(header, ppWritePackedMsg, end, config);
break;
case NFAPI_PNF_STOP_RESPONSE:
result = pack_pnf_stop_response(header, ppWritePackedMsg, end, config);
break;
case NFAPI_PARAM_REQUEST:
result = pack_param_request(header, ppWritePackedMsg, end, config);
break;
case NFAPI_PARAM_RESPONSE:
result = pack_param_response(header, ppWritePackedMsg, end, config);
break;
case NFAPI_CONFIG_REQUEST:
result = pack_config_request(header, ppWritePackedMsg, end, config);
break;
case NFAPI_CONFIG_RESPONSE:
result = pack_config_response(header, ppWritePackedMsg, end, config);
break;
case NFAPI_START_REQUEST:
result = pack_start_request(header, ppWritePackedMsg, end, config);
break;
case NFAPI_START_RESPONSE:
result = pack_start_response(header, ppWritePackedMsg, end, config);
break;
case NFAPI_STOP_REQUEST:
result = pack_stop_request(header, ppWritePackedMsg, end, config);
break;
case NFAPI_STOP_RESPONSE:
result = pack_stop_response(header, ppWritePackedMsg, end, config);
break;
case NFAPI_MEASUREMENT_REQUEST:
result = pack_measurement_request(header, ppWritePackedMsg, end, config);
break;
case NFAPI_MEASUREMENT_RESPONSE:
result = pack_measurement_response(header, ppWritePackedMsg, end, config);
break;
default:
{
if(header->message_id >= NFAPI_VENDOR_EXT_MSG_MIN &&
header->message_id <= NFAPI_VENDOR_EXT_MSG_MAX)
{
if(config && config->pack_p4_p5_vendor_extension)
{
result = (config->pack_p4_p5_vendor_extension)(header, ppWritePackedMsg, end, config);
}
else
{
NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s VE NFAPI message ID %d. No ve ecoder provided\n", __FUNCTION__, header->message_id);
}
}
else
{
NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s NFAPI Unknown message ID %d\n", __FUNCTION__, header->message_id);
}
}
break;
}
return result;
}
*/
static uint8_t pack_p5_message_body(nfapi_p4_p5_message_header_t *header, uint8_t **ppWritePackedMsg, uint8_t *end, nfapi_p4_p5_codec_config_t* config)
{
@@ -1087,7 +1203,57 @@ static uint32_t get_packed_msg_len(uintptr_t msgHead, uintptr_t msgEnd)
}
// Main pack function - public
/*
int nfapi_nr_p5_message_pack(void *pMessageBuf, uint32_t messageBufLen, void *pPackedBuf, uint32_t packedBufLen, nfapi_p4_p5_codec_config_t* config)
{
nfapi_p4_p5_message_header_t *pMessageHeader = pMessageBuf;
uint8_t *pWritePackedMessage = pPackedBuf;
uint8_t *pPackMessageEnd = pPackedBuf + packedBufLen;
uint8_t *pPackedLengthField = &pWritePackedMessage[4];
uint32_t packedMsgLen;
uint16_t packedMsgLen16;
if (pMessageBuf == NULL || pPackedBuf == NULL)
{
NFAPI_TRACE(NFAPI_TRACE_ERROR, "P5 Pack supplied pointers are null\n");
return -1;
}
// pack the message
if(push16(pMessageHeader->phy_id, &pWritePackedMessage, pPackMessageEnd) &&
push16(pMessageHeader->message_id, &pWritePackedMessage, pPackMessageEnd) &&
push16(0, &pWritePackedMessage, pPackMessageEnd) &&
push16(pMessageHeader->spare, &pWritePackedMessage, pPackMessageEnd) &&
pack_nr_p5_message_body(pMessageHeader, &pWritePackedMessage, pPackMessageEnd, config))
{
// check for a valid message length
packedMsgLen = get_packed_msg_len((uintptr_t)pPackedBuf, (uintptr_t)pWritePackedMessage);
if (packedMsgLen > 0xFFFF || packedMsgLen > packedBufLen)
{
NFAPI_TRACE(NFAPI_TRACE_ERROR, "Packed message length error %d, buffer supplied %d\n", packedMsgLen, packedBufLen);
return -1;
}
else
{
packedMsgLen16 = (uint16_t)packedMsgLen;
}
// Update the message length in the header
if(!push16(packedMsgLen16, &pPackedLengthField, pPackMessageEnd))
return -1;
// return the packed length
return (packedMsgLen);
}
else
{
// Failed to pack the meassage
NFAPI_TRACE(NFAPI_TRACE_ERROR, "P5 Failed to pack message\n");
return -1;
}
}
*/
int nfapi_p5_message_pack(void *pMessageBuf, uint32_t messageBufLen, void *pPackedBuf, uint32_t packedBufLen, nfapi_p4_p5_codec_config_t* config)
{
nfapi_p4_p5_message_header_t *pMessageHeader = pMessageBuf;
@@ -1141,6 +1307,20 @@ int nfapi_p5_message_pack(void *pMessageBuf, uint32_t messageBufLen, void *pPack
// Unpack routines
/*
static uint8_t unpack_nr_pnf_param_request(uint8_t **ppReadPackedMsg, uint8_t *end, void *msg, nfapi_p4_p5_codec_config_t* config)
{
nfapi_nr_pnf_param_request_t *pNfapiMsg = (nfapi_nr_pnf_param_request_t*)msg;
unpack_tlv_t unpack_fns[] =
{
};
return unpack_tlv_list(unpack_fns, sizeof(unpack_fns)/sizeof(unpack_tlv_t), ppReadPackedMsg, end, config, &(pNfapiMsg->vendor_extension));
}
*/
static uint8_t unpack_pnf_param_request(uint8_t **ppReadPackedMsg, uint8_t *end, void *msg, nfapi_p4_p5_codec_config_t* config)
{
nfapi_pnf_param_request_t *pNfapiMsg = (nfapi_pnf_param_request_t*)msg;
@@ -1342,9 +1522,21 @@ static uint8_t unpack_pnf_phy_rel13_nb_iot_value(void* tlv, uint8_t **ppReadPack
return ( pull16(ppReadPackedMsg, &value->number_of_phys, end) &&
unpackarray(ppReadPackedMsg, value->phy, sizeof(nfapi_pnf_phy_rel13_nb_iot_info_t), NFAPI_MAX_PNF_PHY, value->number_of_phys, end, &unpack_pnf_phy_rel13_nb_info_info));
}
/*
static uint8_t unpack_nr_pnf_param_response(uint8_t **ppReadPackedMsg, uint8_t *end, void *msg, nfapi_p4_p5_codec_config_t* config)
{
nfapi_nr_pnf_param_response_t *pNfapiMsg = (nfapi_nr_pnf_param_response_t*)msg;
unpack_tlv_t unpack_fns[] =
{
{ NFAPI_PNF_PARAM_GENERAL_TAG, &pNfapiMsg->pnf_param_general, &unpack_pnf_param_general_value},
{ NFAPI_PNF_PHY_TAG, &pNfapiMsg->pnf_phy, &unpack_pnf_phy_value}
};
return ( pull32(ppReadPackedMsg, &pNfapiMsg->error_code, end) &&
unpack_tlv_list(unpack_fns, sizeof(unpack_fns)/sizeof(unpack_tlv_t), ppReadPackedMsg, end, config, &pNfapiMsg->vendor_extension));
}
*/
static uint8_t unpack_pnf_param_response(uint8_t **ppReadPackedMsg, uint8_t *end, void *msg, nfapi_p4_p5_codec_config_t* config)
{
nfapi_pnf_param_response_t *pNfapiMsg = (nfapi_pnf_param_response_t*)msg;
@@ -1665,6 +1857,7 @@ static uint8_t unpack_config_request(uint8_t **ppReadPackedMsg, uint8_t *end, vo
for(int i=0;i<40;i++)
pNfapiMsg->tdd_table.max_tdd_periodicity_list[i].max_num_of_symbol_per_slot_list = (nfapi_nr_max_num_of_symbol_per_slot_t*) malloc(14*sizeof(nfapi_nr_max_num_of_symbol_per_slot_t));
pNfapiMsg->prach_config.num_prach_fd_occasions_list=(nfapi_nr_num_prach_fd_occasions_t *) malloc(sizeof(nfapi_nr_num_prach_fd_occasions_t));
unpack_tlv_t unpack_fns[] =
{
@@ -1672,7 +1865,6 @@ static uint8_t unpack_config_request(uint8_t **ppReadPackedMsg, uint8_t *end, vo
{ NFAPI_NR_CONFIG_DL_FREQUENCY_TAG, &(pNfapiMsg->carrier_config.dl_frequency), &unpack_uint32_tlv_value},
{ NFAPI_NR_CONFIG_DL_GRID_SIZE_TAG, &(pNfapiMsg->carrier_config.dl_grid_size[1]), &unpack_uint16_tlv_value},
{ NFAPI_NR_CONFIG_DL_K0_TAG, &(pNfapiMsg->carrier_config.dl_k0[1]), &unpack_uint16_tlv_value},
{ NFAPI_NR_CONFIG_FREQUENCY_SHIFT_7P5KHZ_TAG, &(pNfapiMsg->carrier_config.frequency_shift_7p5khz), &unpack_uint8_tlv_value},
{ NFAPI_NR_CONFIG_NUM_RX_ANT_TAG, &(pNfapiMsg->carrier_config.num_rx_ant), &unpack_uint16_tlv_value},
{ NFAPI_NR_CONFIG_NUM_TX_ANT_TAG, &(pNfapiMsg->carrier_config.num_tx_ant), &unpack_uint16_tlv_value},
{ NFAPI_NR_CONFIG_UL_GRID_SIZE_TAG, &(pNfapiMsg->carrier_config.ul_grid_size[1]), &unpack_uint16_tlv_value},
@@ -1681,21 +1873,20 @@ static uint8_t unpack_config_request(uint8_t **ppReadPackedMsg, uint8_t *end, vo
{ NFAPI_NR_CONFIG_UPLINK_FREQUENCY_TAG, &(pNfapiMsg->carrier_config.uplink_frequency), &unpack_uint32_tlv_value},
{ NFAPI_NR_CONFIG_FRAME_DUPLEX_TYPE_TAG, &(pNfapiMsg->cell_config.frame_duplex_type), &unpack_uint8_tlv_value},
{ NFAPI_NR_CONFIG_PHY_CELL_ID_TAG, &(pNfapiMsg->cell_config.phy_cell_id), &unpack_uint8_tlv_value},
{ NFAPI_NR_CONFIG_RSSI_MEASUREMENT_TAG, &(pNfapiMsg->measurement_config.rssi_measurement), &unpack_uint8_tlv_value},
{ NFAPI_NR_CONFIG_NUM_PRACH_FD_OCCASIONS_TAG, &(pNfapiMsg->prach_config.num_prach_fd_occasions), &unpack_uint8_tlv_value},
{ NFAPI_NR_CONFIG_PRACH_MULTIPLE_CARRIERS_IN_A_BAND_TAG, &(pNfapiMsg->prach_config.prach_multiple_carriers_in_a_band), &unpack_uint16_tlv_value},
{ NFAPI_NR_CONFIG_PRACH_SEQUENCE_LENGTH_TAG, &(pNfapiMsg->prach_config.prach_sequence_length), &unpack_uint8_tlv_value},
{ NFAPI_NR_CONFIG_RESTRICTED_SET_CONFIG_TAG, &(pNfapiMsg->prach_config.restricted_set_config), &unpack_uint8_tlv_value},
{ NFAPI_NR_CONFIG_SSB_PER_RACH_TAG, &(pNfapiMsg->prach_config.ssb_per_rach), &unpack_uint8_tlv_value},
{ NFAPI_NR_CONFIG_PRACH_SUB_C_SPACING_TAG, &(pNfapiMsg->prach_config.prach_sub_c_spacing), &unpack_uint8_tlv_value},
{ NFAPI_NR_CONFIG_BCH_PAYLOAD_TAG, &(pNfapiMsg->ssb_config.bch_payload), &unpack_uint8_tlv_value},
{ NFAPI_NR_CONFIG_PRACH_ROOT_SEQUENCE_INDEX_TAG, &(pNfapiMsg->prach_config.num_prach_fd_occasions_list[0].prach_root_sequence_index), &unpack_uint16_tlv_value},
{ NFAPI_NR_CONFIG_K1_TAG, &(pNfapiMsg->prach_config.num_prach_fd_occasions_list[0].k1), &unpack_uint16_tlv_value},
{ NFAPI_NR_CONFIG_PRACH_ZERO_CORR_CONF_TAG, &(pNfapiMsg->prach_config.num_prach_fd_occasions_list[0].prach_zero_corr_conf), &unpack_uint8_tlv_value},
{ NFAPI_NR_CONFIG_NUM_ROOT_SEQUENCES_TAG, &(pNfapiMsg->prach_config.num_prach_fd_occasions_list[0].num_root_sequences), &unpack_uint8_tlv_value},
{ NFAPI_NR_CONFIG_SCS_COMMON_TAG, &(pNfapiMsg->ssb_config.scs_common), &unpack_uint8_tlv_value},
{ NFAPI_NR_CONFIG_SS_PBCH_POWER_TAG, &(pNfapiMsg->ssb_config.ss_pbch_power), &unpack_uint32_tlv_value},
{ NFAPI_NR_CONFIG_BETA_PSS_TAG, &(pNfapiMsg->ssb_table.beta_pss), &unpack_uint8_tlv_value},
{ NFAPI_NR_CONFIG_MIB_TAG, &(pNfapiMsg->ssb_table.MIB), &unpack_uint32_tlv_value},
{ NFAPI_NR_CONFIG_MULTIPLE_CELLS_SS_PBCH_IN_A_CARRIER_TAG, &(pNfapiMsg->ssb_table.multiple_cells_ss_pbch_in_a_carrier), &unpack_uint8_tlv_value},
{ NFAPI_NR_CONFIG_SS_PBCH_MULTIPLE_CARRIERS_IN_A_BAND_TAG, &(pNfapiMsg->ssb_table.ss_pbch_multiple_carriers_in_a_band), &unpack_uint8_tlv_value},
// { NFAPI_NR_CONFIG_BEAM_ID_TAG, &(pNfapiMsg->ssb_table.ssb_beam_id_list[0].beam_id), &unpack_uint16_tlv_value},
{ NFAPI_NR_CONFIG_SSB_MASK_TAG, &(pNfapiMsg->ssb_table.ssb_mask_list[0].ssb_mask), &unpack_uint32_tlv_value},
{ NFAPI_NR_CONFIG_SSB_MASK_TAG, &(pNfapiMsg->ssb_table.ssb_mask_list[1].ssb_mask), &unpack_uint32_tlv_value},
@@ -2077,7 +2268,153 @@ int nfapi_p5_message_header_unpack(void *pMessageBuf, uint32_t messageBufLen, vo
pull16(&pReadPackedMessage, &pMessageHeader->spare, end) );
}
/*
int nfapi_nr_p5_message_unpack(void *pMessageBuf, uint32_t messageBufLen, void *pUnpackedBuf, uint32_t unpackedBufLen, nfapi_p4_p5_codec_config_t* config)
{
nfapi_p4_p5_message_header_t *pMessageHeader = pUnpackedBuf;
uint8_t *pReadPackedMessage = pMessageBuf;
uint8_t *end = pMessageBuf + messageBufLen;
if (pMessageBuf == NULL || pUnpackedBuf == NULL)
{
NFAPI_TRACE(NFAPI_TRACE_ERROR, "P5 unpack supplied pointers are null\n");
return -1;
}
if (messageBufLen < NFAPI_HEADER_LENGTH || unpackedBufLen < sizeof(nfapi_p4_p5_message_header_t))
{
NFAPI_TRACE(NFAPI_TRACE_ERROR, "P5 unpack supplied message buffer is too small %d, %d\n", messageBufLen, unpackedBufLen);
return -1;
}
uint8_t *ptr = pReadPackedMessage;
printf("\n Read message unpack: ");
while(ptr < end){
printf(" %d ", *ptr);
ptr++;
}
printf("\n");
// clean the supplied buffer for - tag value blanking
(void)memset(pUnpackedBuf, 0, unpackedBufLen);
// process the header
if( !(pull16(&pReadPackedMessage, &pMessageHeader->phy_id, end ) &&
pull16(&pReadPackedMessage, &pMessageHeader->message_id, end) &&
pull16(&pReadPackedMessage, &pMessageHeader->message_length, end) &&
pull16(&pReadPackedMessage, &pMessageHeader->spare, end)))
{
// failed to read the header
return -1;
}
int result = -1;
if(check_unpack_length(pMessageHeader->message_id, unpackedBufLen) == 0)
{
// the unpack buffer is not big enough for the struct
return -1;
}
// look for the specific message
switch (pMessageHeader->message_id)
{
case NFAPI_NR_PHY_MSG_TYPE_PNF_PARAM_REQUEST:
result = unpack_nr_pnf_param_request(&pReadPackedMessage, end, pMessageHeader, config);
break;
case NFAPI_PNF_PARAM_RESPONSE:
result = unpack_nr_pnf_param_response(&pReadPackedMessage, end, pMessageHeader, config);
break;
case NFAPI_PNF_CONFIG_REQUEST:
result = unpack_pnf_config_request(&pReadPackedMessage, end, pMessageHeader, config);
break;
case NFAPI_PNF_CONFIG_RESPONSE:
result = unpack_pnf_config_response(&pReadPackedMessage, end, pMessageHeader, config);
break;
case NFAPI_PNF_START_REQUEST:
result = unpack_pnf_start_request(&pReadPackedMessage, end, pMessageHeader, config);
break;
case NFAPI_PNF_START_RESPONSE:
result = unpack_pnf_start_response(&pReadPackedMessage, end, pMessageHeader, config);
break;
case NFAPI_PNF_STOP_REQUEST:
result = unpack_pnf_stop_request(&pReadPackedMessage, end, pMessageHeader, config);
break;
case NFAPI_PNF_STOP_RESPONSE:
result = unpack_pnf_stop_response(&pReadPackedMessage, end, pMessageHeader, config);
break;
case NFAPI_PARAM_REQUEST:
result = unpack_param_request(&pReadPackedMessage, end, pMessageHeader, config);
break;
case NFAPI_PARAM_RESPONSE:
result = unpack_param_response(&pReadPackedMessage, end, pMessageHeader, config);
break;
case NFAPI_CONFIG_REQUEST:
result = unpack_config_request(&pReadPackedMessage, end, pMessageHeader, config);
break;
case NFAPI_CONFIG_RESPONSE:
result = unpack_config_response(&pReadPackedMessage, end, pMessageHeader, config);
break;
case NFAPI_START_REQUEST:
result = unpack_start_request(&pReadPackedMessage, end, pMessageHeader, config);
break;
case NFAPI_START_RESPONSE:
result = unpack_start_response(&pReadPackedMessage, end, pMessageHeader, config);
break;
case NFAPI_STOP_REQUEST:
result = unpack_stop_request(&pReadPackedMessage, end, pMessageHeader, config);
break;
case NFAPI_STOP_RESPONSE:
result = unpack_stop_response(&pReadPackedMessage, end, pMessageHeader, config);
break;
case NFAPI_MEASUREMENT_REQUEST:
result = unpack_measurement_request(&pReadPackedMessage, end, pMessageHeader, config);
break;
case NFAPI_MEASUREMENT_RESPONSE:
result = unpack_measurement_response(&pReadPackedMessage, end, pMessageHeader, config);
break;
default:
if(pMessageHeader->message_id >= NFAPI_VENDOR_EXT_MSG_MIN &&
pMessageHeader->message_id <= NFAPI_VENDOR_EXT_MSG_MAX)
{
if(config && config->unpack_p4_p5_vendor_extension)
{
result = (config->unpack_p4_p5_vendor_extension)(pMessageHeader, &pReadPackedMessage, end, config);
}
else
{
NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s VE NFAPI message ID %d. No ve decoder provided\n", __FUNCTION__, pMessageHeader->message_id);
}
}
else
{
NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s NFAPI Unknown P5 message ID %d\n", __FUNCTION__, pMessageHeader->message_id);
}
break;
}
return result;
}
*/
int nfapi_p5_message_unpack(void *pMessageBuf, uint32_t messageBufLen, void *pUnpackedBuf, uint32_t unpackedBufLen, nfapi_p4_p5_codec_config_t* config)
{
nfapi_p4_p5_message_header_t *pMessageHeader = pUnpackedBuf;
+43 -42
View File
@@ -284,17 +284,17 @@ static uint8_t pack_dl_tti_pdcch_pdu_rel15_value(void* tlv, uint8_t **ppWritePac
push8(value->precoderGranularity, ppWritePackedMsg, end) &&
push16(value->numDlDci, ppWritePackedMsg, end) &&
pusharray16(value->RNTI, MAX_DCI_CORESET, value->numDlDci, ppWritePackedMsg, end) &&
pusharray16(value->ScramblingId, MAX_DCI_CORESET, value->numDlDci, ppWritePackedMsg, end) &&
pusharray16(value->dci_pdu.RNTI, MAX_DCI_CORESET, value->numDlDci, ppWritePackedMsg, end) &&
pusharray16(value->dci_pdu.ScramblingId, MAX_DCI_CORESET, value->numDlDci, ppWritePackedMsg, end) &&
pusharray16(value->ScramblingRNTI, MAX_DCI_CORESET, value->numDlDci, ppWritePackedMsg, end) &&
pusharray8(value->CceIndex, MAX_DCI_CORESET, value->numDlDci, ppWritePackedMsg, end) &&
pusharray8(value->AggregationLevel, MAX_DCI_CORESET, value->numDlDci, ppWritePackedMsg, end) &&
pusharray8(value->beta_PDCCH_1_0, MAX_DCI_CORESET, value->numDlDci, ppWritePackedMsg, end) &&
pusharray16(value->dci_pdu.ScramblingRNTI, MAX_DCI_CORESET, value->numDlDci, ppWritePackedMsg, end) &&
pusharray8(value->dci_pdu.CceIndex, MAX_DCI_CORESET, value->numDlDci, ppWritePackedMsg, end) &&
pusharray8(value->dci_pdu.AggregationLevel, MAX_DCI_CORESET, value->numDlDci, ppWritePackedMsg, end) &&
pusharray8(value->dci_pdu.beta_PDCCH_1_0, MAX_DCI_CORESET, value->numDlDci, ppWritePackedMsg, end) &&
pusharray8(value->powerControlOffsetSS, MAX_DCI_CORESET, value->numDlDci, ppWritePackedMsg, end) &&
pusharray16(value->PayloadSizeBits, MAX_DCI_CORESET, value->numDlDci, ppWritePackedMsg, end) &&
pusharray8(value->Payload[0], MAX_DCI_CORESET*DCI_PAYLOAD_BYTE_LEN, value->numDlDci, ppWritePackedMsg, end)
pusharray8(value->dci_pdu.powerControlOffsetSS, MAX_DCI_CORESET, value->numDlDci, ppWritePackedMsg, end) &&
pusharray16(value->dci_pdu.PayloadSizeBits, MAX_DCI_CORESET, value->numDlDci, ppWritePackedMsg, end) &&
pusharray8(value->dci_pdu.Payload[0], MAX_DCI_CORESET*DCI_PAYLOAD_BYTE_LEN, value->numDlDci, ppWritePackedMsg, end)
);
}
@@ -1085,7 +1085,7 @@ static uint8_t pack_ul_tti_request_pusch_pdu(nfapi_nr_pusch_pdu_t* pusch_pdu, ui
push8(pusch_pdu->num_dmrs_cdm_grps_no_data, ppWritePackedMsg, end) &&
push16(pusch_pdu->dmrs_ports, ppWritePackedMsg, end) &&
push8(pusch_pdu->resource_alloc, ppWritePackedMsg, end) &&
pusharray8(pusch_pdu->resource_alloc,36,36,ppWritePackedMsg, end) &&
push8(pusch_pdu->resource_alloc,ppWritePackedMsg, end) &&
push16(pusch_pdu->dmrs_ports, ppWritePackedMsg, end) &&
push16(pusch_pdu->rb_start, ppWritePackedMsg, end) &&
push16(pusch_pdu->rb_size, ppWritePackedMsg, end) &&
@@ -2054,17 +2054,17 @@ static uint8_t pack_ul_dci_pdu_list_value(void* tlv, uint8_t **ppWritePackedMsg,
push8(value->pdcch_pdu.pdcch_pdu_rel15.precoderGranularity, ppWritePackedMsg, end) &&
push16(value->pdcch_pdu.pdcch_pdu_rel15.numDlDci, ppWritePackedMsg, end) &&
pusharray16(value->pdcch_pdu.pdcch_pdu_rel15.RNTI, MAX_DCI_CORESET, 1, ppWritePackedMsg, end) &&
pusharray16(value->pdcch_pdu.pdcch_pdu_rel15.ScramblingId, MAX_DCI_CORESET, 1, ppWritePackedMsg, end) &&
pusharray16(value->pdcch_pdu.pdcch_pdu_rel15.dci_pdu.RNTI, MAX_DCI_CORESET, 1, ppWritePackedMsg, end) &&
pusharray16(value->pdcch_pdu.pdcch_pdu_rel15.dci_pdu.ScramblingId, MAX_DCI_CORESET, 1, ppWritePackedMsg, end) &&
pusharray16(value->pdcch_pdu.pdcch_pdu_rel15.ScramblingRNTI, MAX_DCI_CORESET, 1, ppWritePackedMsg, end) &&
pusharray8(value->pdcch_pdu.pdcch_pdu_rel15.CceIndex, MAX_DCI_CORESET, 1, ppWritePackedMsg, end) &&
pusharray8(value->pdcch_pdu.pdcch_pdu_rel15.AggregationLevel, MAX_DCI_CORESET, 1, ppWritePackedMsg, end) &&
pusharray8(value->pdcch_pdu.pdcch_pdu_rel15.beta_PDCCH_1_0, MAX_DCI_CORESET, 1, ppWritePackedMsg, end) &&
pusharray16(value->pdcch_pdu.pdcch_pdu_rel15.dci_pdu.ScramblingRNTI, MAX_DCI_CORESET, 1, ppWritePackedMsg, end) &&
pusharray8(value->pdcch_pdu.pdcch_pdu_rel15.dci_pdu.CceIndex, MAX_DCI_CORESET, 1, ppWritePackedMsg, end) &&
pusharray8(value->pdcch_pdu.pdcch_pdu_rel15.dci_pdu.AggregationLevel, MAX_DCI_CORESET, 1, ppWritePackedMsg, end) &&
pusharray8(value->pdcch_pdu.pdcch_pdu_rel15.dci_pdu.beta_PDCCH_1_0, MAX_DCI_CORESET, 1, ppWritePackedMsg, end) &&
pusharray8(value->pdcch_pdu.pdcch_pdu_rel15.powerControlOffsetSS, MAX_DCI_CORESET, 1, ppWritePackedMsg, end) &&
pusharray16(value->pdcch_pdu.pdcch_pdu_rel15.PayloadSizeBits, MAX_DCI_CORESET, 1, ppWritePackedMsg, end) &&
pusharray8(value->pdcch_pdu.pdcch_pdu_rel15.Payload[0], MAX_DCI_CORESET*DCI_PAYLOAD_BYTE_LEN, 1, ppWritePackedMsg, end)
pusharray8(value->pdcch_pdu.pdcch_pdu_rel15.dci_pdu.powerControlOffsetSS, MAX_DCI_CORESET, 1, ppWritePackedMsg, end) &&
pusharray16(value->pdcch_pdu.pdcch_pdu_rel15.dci_pdu.PayloadSizeBits, MAX_DCI_CORESET, 1, ppWritePackedMsg, end) &&
pusharray8(value->pdcch_pdu.pdcch_pdu_rel15.dci_pdu.Payload[0], MAX_DCI_CORESET*DCI_PAYLOAD_BYTE_LEN, 1, ppWritePackedMsg, end)
);
@@ -2123,7 +2123,8 @@ static uint8_t pack_tx_data_pdu_list_value(void* tlv, uint8_t **ppWritePackedMsg
push16(value->TLVs[i].tag, ppWritePackedMsg, end)))
return 0;
switch(value->TLVs[i].tag){
switch(value->TLVs[i].tag)
{
case 0:
{
if(!pusharray32(value->TLVs[i].value.direct, 16384, value->TLVs[i].length, ppWritePackedMsg, end))
@@ -3577,17 +3578,17 @@ static uint8_t unpack_dl_tti_pdcch_pdu_rel15_value(void* tlv, uint8_t **ppReadPa
pull8(ppReadPackedMsg, &value->precoderGranularity, end) &&
pull16(ppReadPackedMsg, &value->numDlDci, end) &&
pullarray16(ppReadPackedMsg, &value->RNTI, MAX_DCI_CORESET, value->numDlDci, end) &&
pullarray16(ppReadPackedMsg, &value->ScramblingId, MAX_DCI_CORESET, value->numDlDci, end) &&
pullarray16(ppReadPackedMsg, &value->dci_pdu.RNTI, MAX_DCI_CORESET, value->numDlDci, end) &&
pullarray16(ppReadPackedMsg, &value->dci_pdu.ScramblingId, MAX_DCI_CORESET, value->numDlDci, end) &&
pullarray16(ppReadPackedMsg, &value->ScramblingRNTI, MAX_DCI_CORESET, value->numDlDci, end) &&
pullarray8(ppReadPackedMsg, &value->CceIndex, MAX_DCI_CORESET, value->numDlDci, end) &&
pullarray8(ppReadPackedMsg, &value->AggregationLevel, MAX_DCI_CORESET,value->numDlDci, end) &&
pullarray8(ppReadPackedMsg, &value->beta_PDCCH_1_0, MAX_DCI_CORESET, value->numDlDci, end) &&
pullarray16(ppReadPackedMsg, &value->dci_pdu.ScramblingRNTI, MAX_DCI_CORESET, value->numDlDci, end) &&
pullarray8(ppReadPackedMsg, &value->dci_pdu.CceIndex, MAX_DCI_CORESET, value->numDlDci, end) &&
pullarray8(ppReadPackedMsg, &value->dci_pdu.AggregationLevel, MAX_DCI_CORESET,value->numDlDci, end) &&
pullarray8(ppReadPackedMsg, &value->dci_pdu.beta_PDCCH_1_0, MAX_DCI_CORESET, value->numDlDci, end) &&
pullarray8(ppReadPackedMsg, &value->powerControlOffsetSS, MAX_DCI_CORESET, value->numDlDci, end) &&
pullarray16(ppReadPackedMsg, &value->PayloadSizeBits, MAX_DCI_CORESET, value->numDlDci, end) &&
pullarray8(ppReadPackedMsg, &value->Payload[0], MAX_DCI_CORESET*DCI_PAYLOAD_BYTE_LEN, value->numDlDci, end)
pullarray8(ppReadPackedMsg, &value->dci_pdu.powerControlOffsetSS, MAX_DCI_CORESET, value->numDlDci, end) &&
pullarray16(ppReadPackedMsg, &value->dci_pdu.PayloadSizeBits, MAX_DCI_CORESET, value->numDlDci, end) &&
pullarray8(ppReadPackedMsg, &value->dci_pdu.Payload[0], MAX_DCI_CORESET*DCI_PAYLOAD_BYTE_LEN, value->numDlDci, end)
);
}
@@ -4375,9 +4376,9 @@ static uint8_t unpack_dl_tti_request(uint8_t **ppReadPackedMsg, uint8_t *end, vo
//pusharray8(pNfapiMsg->PduIdx[0] ,256,256, ppWritePackedMsg, end)
))
return 0;
if(pNfapiMsg->Slot % 2 != 0){
printf("\nEntering unpack_dl_tti_request Odd sfn=%d,slot=%d\n",pNfapiMsg->SFN,pNfapiMsg->Slot);
}
// if(pNfapiMsg->Slot % 2 != 0){
// printf("\nEntering unpack_dl_tti_request Odd sfn=%d,slot=%d\n",pNfapiMsg->SFN,pNfapiMsg->Slot);
// }
int arr[12];
for(int i=0;i<pNfapiMsg->nGroup;i++)
@@ -4481,7 +4482,7 @@ static uint8_t unpack_ul_tti_request_pusch_pdu(void *tlv, uint8_t **ppReadPacked
pull8(ppReadPackedMsg, &pusch_pdu->num_dmrs_cdm_grps_no_data, end) &&
pull16(ppReadPackedMsg, &pusch_pdu->dmrs_ports, end) &&
pull8(ppReadPackedMsg, &pusch_pdu->resource_alloc, end) &&
pullarray8(ppReadPackedMsg, &pusch_pdu->resource_alloc,36,36,end) &&
pull8(ppReadPackedMsg, &pusch_pdu->resource_alloc,end) &&
pull16(ppReadPackedMsg, &pusch_pdu->dmrs_ports, end) &&
pull16(ppReadPackedMsg, &pusch_pdu->rb_start, end) &&
pull16(ppReadPackedMsg, &pusch_pdu->rb_size, end) &&
@@ -5649,17 +5650,17 @@ static uint8_t unpack_ul_dci_pdu_list_value(uint8_t **ppReadPackedMsg, uint8_t *
pull8(ppReadPackedMsg, &value->pdcch_pdu.pdcch_pdu_rel15.precoderGranularity, end) &&
pull16(ppReadPackedMsg, &value->pdcch_pdu.pdcch_pdu_rel15.numDlDci, end) &&
pullarray16(ppReadPackedMsg, &value->pdcch_pdu.pdcch_pdu_rel15.RNTI, MAX_DCI_CORESET, 1, end) &&
pullarray16(ppReadPackedMsg, &value->pdcch_pdu.pdcch_pdu_rel15.ScramblingId, MAX_DCI_CORESET, 1, end) &&
pullarray16(ppReadPackedMsg, &value->pdcch_pdu.pdcch_pdu_rel15.dci_pdu.RNTI, MAX_DCI_CORESET, 1, end) &&
pullarray16(ppReadPackedMsg, &value->pdcch_pdu.pdcch_pdu_rel15.dci_pdu.ScramblingId, MAX_DCI_CORESET, 1, end) &&
pullarray16(ppReadPackedMsg, &value->pdcch_pdu.pdcch_pdu_rel15.ScramblingRNTI, MAX_DCI_CORESET, 1, end) &&
pullarray8(ppReadPackedMsg, &value->pdcch_pdu.pdcch_pdu_rel15.CceIndex, MAX_DCI_CORESET, 1, end) &&
pullarray8(ppReadPackedMsg, &value->pdcch_pdu.pdcch_pdu_rel15.AggregationLevel, MAX_DCI_CORESET, 1, end) &&
pullarray8(ppReadPackedMsg, &value->pdcch_pdu.pdcch_pdu_rel15.beta_PDCCH_1_0, MAX_DCI_CORESET, 1, end) &&
pullarray16(ppReadPackedMsg, &value->pdcch_pdu.pdcch_pdu_rel15.dci_pdu.ScramblingRNTI, MAX_DCI_CORESET, 1, end) &&
pullarray8(ppReadPackedMsg, &value->pdcch_pdu.pdcch_pdu_rel15.dci_pdu.CceIndex, MAX_DCI_CORESET, 1, end) &&
pullarray8(ppReadPackedMsg, &value->pdcch_pdu.pdcch_pdu_rel15.dci_pdu.AggregationLevel, MAX_DCI_CORESET, 1, end) &&
pullarray8(ppReadPackedMsg, &value->pdcch_pdu.pdcch_pdu_rel15.dci_pdu.beta_PDCCH_1_0, MAX_DCI_CORESET, 1, end) &&
pullarray8(ppReadPackedMsg, &value->pdcch_pdu.pdcch_pdu_rel15.powerControlOffsetSS, MAX_DCI_CORESET, 1, end) &&
pullarray16(ppReadPackedMsg, &value->pdcch_pdu.pdcch_pdu_rel15.PayloadSizeBits, MAX_DCI_CORESET, 1, end) &&
pullarray8(ppReadPackedMsg, &value->pdcch_pdu.pdcch_pdu_rel15.Payload[0], MAX_DCI_CORESET*DCI_PAYLOAD_BYTE_LEN, 1, end)
pullarray8(ppReadPackedMsg, &value->pdcch_pdu.pdcch_pdu_rel15.dci_pdu.powerControlOffsetSS, MAX_DCI_CORESET, 1, end) &&
pullarray16(ppReadPackedMsg, &value->pdcch_pdu.pdcch_pdu_rel15.dci_pdu.PayloadSizeBits, MAX_DCI_CORESET, 1, end) &&
pullarray8(ppReadPackedMsg, &value->pdcch_pdu.pdcch_pdu_rel15.dci_pdu.Payload[0], MAX_DCI_CORESET*DCI_PAYLOAD_BYTE_LEN, 1, end)
);
}