Commit 2ccabd54 authored by Aniq's avatar Aniq

UL_DCI Request Completed

parent fe7c416e
...@@ -36,7 +36,7 @@ sudo <oai_codebase>/cmake_targets/ran_build/build/nr-softmodem -O <oai_codebase> ...@@ -36,7 +36,7 @@ sudo <oai_codebase>/cmake_targets/ran_build/build/nr-softmodem -O <oai_codebase>
* `unpack_dl_tti_request` [x] * `unpack_dl_tti_request` [x]
* `unpack_ul_tti_request` [x] * `unpack_ul_tti_request` [x]
* `unpack_ul_dci_request` * `unpack_ul_dci_request`
* `unpack_tx_data_request` * `unpack_tx_data_request` [x]
* Similarly change all the `unpack` functions within the switch-case block. * Similarly change all the `unpack` functions within the switch-case block.
...@@ -45,7 +45,7 @@ sudo <oai_codebase>/cmake_targets/ran_build/build/nr-softmodem -O <oai_codebase> ...@@ -45,7 +45,7 @@ sudo <oai_codebase>/cmake_targets/ran_build/build/nr-softmodem -O <oai_codebase>
* `dl_tti_request` [x] * `dl_tti_request` [x]
* `ul_tti_request` [x] * `ul_tti_request` [x]
* `ul_dci_request` * `ul_dci_request`
* `tx_data_request` * `tx_data_request` [x]
### Task-C ### Task-C
* Write the `ul_tti` alternative for `nfapi_vnf_p7_ul_config_req()` in `vnf_p7_interface.c` and other such functions. * Write the `ul_tti` alternative for `nfapi_vnf_p7_ul_config_req()` in `vnf_p7_interface.c` and other such functions.
......
...@@ -1354,6 +1354,22 @@ int oai_nfapi_tx_req(nfapi_tx_request_t *tx_req) ...@@ -1354,6 +1354,22 @@ int oai_nfapi_tx_req(nfapi_tx_request_t *tx_req)
return retval; return retval;
} }
int oai_nfapi_ul_dci_req(nfapi_nr_ul_dci_request_t *ul_dci_req) {
nfapi_vnf_p7_config_t *p7_config = vnf.p7_vnfs[0].config;
ul_dci_req->header.phy_id = 1; // DJP HACK TODO FIXME - need to pass this around!!!!
ul_dci_req->header.message_id = NFAPI_NR_PHY_MSG_TYPE_UL_DCI_REQUEST;
//LOG_D(PHY, "[VNF] %s() HI_DCI0_REQ sfn_sf:%d dci:%d hi:%d\n", __FUNCTION__, NFAPI_SFNSF2DEC(hi_dci0_req->sfn_sf), hi_dci0_req->hi_dci0_request_body.number_of_dci, hi_dci0_req->hi_dci0_request_body.number_of_hi);
int retval = nfapi_vnf_p7_ul_dci_req(p7_config, ul_dci_req);
if (retval!=0) {
LOG_E(PHY, "%s() Problem sending retval:%d\n", __FUNCTION__, retval);
} else {
ul_dci_req->numPdus = 0;
}
return retval;
}
int oai_nfapi_hi_dci0_req(nfapi_hi_dci0_request_t *hi_dci0_req) { int oai_nfapi_hi_dci0_req(nfapi_hi_dci0_request_t *hi_dci0_req) {
nfapi_vnf_p7_config_t *p7_config = vnf.p7_vnfs[0].config; nfapi_vnf_p7_config_t *p7_config = vnf.p7_vnfs[0].config;
hi_dci0_req->header.phy_id = 1; // DJP HACK TODO FIXME - need to pass this around!!!! hi_dci0_req->header.phy_id = 1; // DJP HACK TODO FIXME - need to pass this around!!!!
......
...@@ -1369,6 +1369,7 @@ typedef struct { ...@@ -1369,6 +1369,7 @@ typedef struct {
} nfapi_nr_ul_dci_request_pdus_t; } nfapi_nr_ul_dci_request_pdus_t;
typedef struct { typedef struct {
nfapi_p7_message_header_t header;
uint16_t SFN; uint16_t SFN;
uint16_t Slot; uint16_t Slot;
uint8_t numPdus; uint8_t numPdus;
......
...@@ -2085,6 +2085,69 @@ static uint8_t pack_hi_dci0_request_body_value(void *tlv, uint8_t **ppWritePacke ...@@ -2085,6 +2085,69 @@ static uint8_t pack_hi_dci0_request_body_value(void *tlv, uint8_t **ppWritePacke
return 1; return 1;
} }
static uint8_t pack_ul_dci_pdu_list_value(void* tlv, uint8_t **ppWritePackedMsg, uint8_t *end)
{
nfapi_nr_ul_dci_request_pdus_t* value = (nfapi_nr_ul_dci_request_pdus_t*)tlv;
return (push32(value->PDUType, ppWritePackedMsg, end) &&
push16(value->PDUSize, ppWritePackedMsg, end) &&
push16(value->pdcch_pdu.pdcch_pdu_rel15.BWPSize, ppWritePackedMsg, end) &&
push16(value->pdcch_pdu.pdcch_pdu_rel15.BWPStart, ppWritePackedMsg, end) &&
push8(value->pdcch_pdu.pdcch_pdu_rel15.SubcarrierSpacing, ppWritePackedMsg, end) &&
push8(value->pdcch_pdu.pdcch_pdu_rel15.CyclicPrefix, ppWritePackedMsg, end) &&
push8(value->pdcch_pdu.pdcch_pdu_rel15.StartSymbolIndex, ppWritePackedMsg, end) &&
push8(value->pdcch_pdu.pdcch_pdu_rel15.DurationSymbols, ppWritePackedMsg, end) &&
pusharray16(value->pdcch_pdu.pdcch_pdu_rel15.FreqDomainResource, 6, 1, ppWritePackedMsg, end) &&
push8(value->pdcch_pdu.pdcch_pdu_rel15.CceRegMappingType, ppWritePackedMsg, end) &&
push8(value->pdcch_pdu.pdcch_pdu_rel15.RegBundleSize, ppWritePackedMsg, end) &&
push8(value->pdcch_pdu.pdcch_pdu_rel15.InterleaverSize, ppWritePackedMsg, end) &&
push8(value->pdcch_pdu.pdcch_pdu_rel15.CoreSetType, ppWritePackedMsg, end) &&
push16(value->pdcch_pdu.pdcch_pdu_rel15.ShiftIndex, ppWritePackedMsg, end) &&
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.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) &&
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)
);
}
static uint8_t pack_ul_dci_request(void *msg, uint8_t **ppWritePackedMsg, uint8_t *end, nfapi_p7_codec_config_t* config)
{
nfapi_nr_ul_dci_request_t *pNfapiMsg = (nfapi_nr_ul_dci_request_t*)msg;
if (!(push16(pNfapiMsg->SFN, ppWritePackedMsg, end) &&
push16(pNfapiMsg->Slot, ppWritePackedMsg, end) &&
push16(pNfapiMsg->numPdus, ppWritePackedMsg, end)
))
return 0;
for(int i=0; i<pNfapiMsg->numPdus; i++)
{
if(!pack_ul_dci_pdu_list_value(&pNfapiMsg->ul_dci_pdu_list[i], ppWritePackedMsg, end))
return 0;
}
return 1;
}
static uint8_t pack_hi_dci0_request(void *msg, uint8_t **ppWritePackedMsg, uint8_t *end, nfapi_p7_codec_config_t* config) static uint8_t pack_hi_dci0_request(void *msg, uint8_t **ppWritePackedMsg, uint8_t *end, nfapi_p7_codec_config_t* config)
{ {
nfapi_hi_dci0_request_t *pNfapiMsg = (nfapi_hi_dci0_request_t*)msg; nfapi_hi_dci0_request_t *pNfapiMsg = (nfapi_hi_dci0_request_t*)msg;
...@@ -3336,6 +3399,9 @@ int nfapi_p7_message_pack(void *pMessageBuf, void *pPackedBuf, uint32_t packedBu ...@@ -3336,6 +3399,9 @@ int nfapi_p7_message_pack(void *pMessageBuf, void *pPackedBuf, uint32_t packedBu
case NFAPI_NR_PHY_MSG_TYPE_TX_DATA_REQUEST: case NFAPI_NR_PHY_MSG_TYPE_TX_DATA_REQUEST:
result = pack_tx_data_request(pMessageHeader, &pWritePackedMessage, end, config); result = pack_tx_data_request(pMessageHeader, &pWritePackedMessage, end, config);
break; break;
case NFAPI_NR_PHY_MSG_TYPE_UL_DCI_REQUEST:
result = pack_ul_dci_request(pMessageHeader, &pWritePackedMessage, end, config);
break;
#if 0 #if 0
case NFAPI_DL_CONFIG_REQUEST: case NFAPI_DL_CONFIG_REQUEST:
//NFAPI_TRACE(NFAPI_TRACE_INFO, "%s() NFAPI_DL_CONFIG_REQUEST\n", __FUNCTION__); //NFAPI_TRACE(NFAPI_TRACE_INFO, "%s() NFAPI_DL_CONFIG_REQUEST\n", __FUNCTION__);
...@@ -3349,12 +3415,10 @@ int nfapi_p7_message_pack(void *pMessageBuf, void *pPackedBuf, uint32_t packedBu ...@@ -3349,12 +3415,10 @@ int nfapi_p7_message_pack(void *pMessageBuf, void *pPackedBuf, uint32_t packedBu
//NFAPI_TRACE(NFAPI_TRACE_INFO, "%s() NFAPI_TX_REQUEST\n", __FUNCTION__); //NFAPI_TRACE(NFAPI_TRACE_INFO, "%s() NFAPI_TX_REQUEST\n", __FUNCTION__);
result = pack_tx_request(pMessageHeader, &pWritePackedMessage, end, config); result = pack_tx_request(pMessageHeader, &pWritePackedMessage, end, config);
break; break;
#endif
case NFAPI_HI_DCI0_REQUEST: case NFAPI_HI_DCI0_REQUEST:
result = pack_hi_dci0_request(pMessageHeader, &pWritePackedMessage, end, config); result = pack_hi_dci0_request(pMessageHeader, &pWritePackedMessage, end, config);
break; break;
#endif
case NFAPI_UE_RELEASE_REQUEST: case NFAPI_UE_RELEASE_REQUEST:
result =pack_ue_release_request(pMessageHeader, &pWritePackedMessage, end, config); result =pack_ue_release_request(pMessageHeader, &pWritePackedMessage, end, config);
...@@ -5774,6 +5838,64 @@ static uint8_t unpack_hi_dci0_request_body_value(void *tlv, uint8_t **ppReadPack ...@@ -5774,6 +5838,64 @@ static uint8_t unpack_hi_dci0_request_body_value(void *tlv, uint8_t **ppReadPack
return 1; return 1;
} }
//unpack_ul_dci_pdu_list_value
static uint8_t unpack_ul_dci_pdu_list_value(uint8_t **ppReadPackedMsg, uint8_t *end, void *msg)
{
nfapi_nr_ul_dci_request_pdus_t* value = (nfapi_nr_ul_dci_request_pdus_t*)msg;
return (pull32(ppReadPackedMsg, &value->PDUType, end) &&
pull16(ppReadPackedMsg, &value->PDUSize, end) &&
pull16(ppReadPackedMsg, &value->pdcch_pdu.pdcch_pdu_rel15.BWPSize, end) &&
pull16(ppReadPackedMsg, &value->pdcch_pdu.pdcch_pdu_rel15.BWPStart, end) &&
pull8(ppReadPackedMsg, &value->pdcch_pdu.pdcch_pdu_rel15.SubcarrierSpacing, end) &&
pull8(ppReadPackedMsg, &value->pdcch_pdu.pdcch_pdu_rel15.CyclicPrefix, end) &&
pull8(ppReadPackedMsg, &value->pdcch_pdu.pdcch_pdu_rel15.StartSymbolIndex, end) &&
pull8(ppReadPackedMsg, &value->pdcch_pdu.pdcch_pdu_rel15.DurationSymbols, end) &&
pullarray16(ppReadPackedMsg, &value->pdcch_pdu.pdcch_pdu_rel15.FreqDomainResource, 6, 1, end) &&
pull8(ppReadPackedMsg, &value->pdcch_pdu.pdcch_pdu_rel15.CceRegMappingType, end) &&
pull8(ppReadPackedMsg, &value->pdcch_pdu.pdcch_pdu_rel15.RegBundleSize, end) &&
pull8(ppReadPackedMsg, &value->pdcch_pdu.pdcch_pdu_rel15.InterleaverSize, end) &&
pull8(ppReadPackedMsg, &value->pdcch_pdu.pdcch_pdu_rel15.CoreSetType, end) &&
pull16(ppReadPackedMsg, &value->pdcch_pdu.pdcch_pdu_rel15.ShiftIndex, end) &&
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.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) &&
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)
);
}
static uint8_t unpack_ul_dci_request(uint8_t **ppReadPackedMsg, uint8_t *end, void *msg, nfapi_p7_codec_config_t* config)
{
nfapi_nr_ul_dci_request_t *pNfapiMsg = (nfapi_nr_ul_dci_request_t*)msg;
if (!(pull16(ppReadPackedMsg, &pNfapiMsg->SFN, end) &&
pull16(ppReadPackedMsg, &pNfapiMsg->Slot, end) &&
pull16(ppReadPackedMsg, &pNfapiMsg->numPdus, end)
))
return 0;
for(int i=0; i< pNfapiMsg->numPdus; i++)
{
if (!unpack_ul_dci_pdu_list_value(ppReadPackedMsg, end, &pNfapiMsg->ul_dci_pdu_list[i]))
return 0;
}
return 1;
}
static uint8_t unpack_hi_dci0_request(uint8_t **ppReadPackedMsg, uint8_t *end, void *msg, nfapi_p7_codec_config_t* config) static uint8_t unpack_hi_dci0_request(uint8_t **ppReadPackedMsg, uint8_t *end, void *msg, nfapi_p7_codec_config_t* config)
{ {
...@@ -7596,6 +7718,12 @@ int nfapi_p7_message_unpack(void *pMessageBuf, uint32_t messageBufLen, void *pUn ...@@ -7596,6 +7718,12 @@ int nfapi_p7_message_unpack(void *pMessageBuf, uint32_t messageBufLen, void *pUn
else else
return -1; return -1;
break; break;
case NFAPI_NR_PHY_MSG_TYPE_UL_DCI_REQUEST:
if (check_unpack_length(NFAPI_NR_PHY_MSG_TYPE_UL_DCI_REQUEST, unpackedBufLen))
result = unpack_ul_dci_request(&pReadPackedMessage, end, pMessageHeader, config);
else
return -1;
break;
#if 0 #if 0
case NFAPI_DL_CONFIG_REQUEST: case NFAPI_DL_CONFIG_REQUEST:
if (check_unpack_length(NFAPI_DL_CONFIG_REQUEST, unpackedBufLen)) if (check_unpack_length(NFAPI_DL_CONFIG_REQUEST, unpackedBufLen))
...@@ -7616,13 +7744,14 @@ int nfapi_p7_message_unpack(void *pMessageBuf, uint32_t messageBufLen, void *pUn ...@@ -7616,13 +7744,14 @@ int nfapi_p7_message_unpack(void *pMessageBuf, uint32_t messageBufLen, void *pUn
else else
return -1; return -1;
break; break;
#endif
case NFAPI_HI_DCI0_REQUEST: case NFAPI_HI_DCI0_REQUEST:
if (check_unpack_length(NFAPI_HI_DCI0_REQUEST, unpackedBufLen)) if (check_unpack_length(NFAPI_HI_DCI0_REQUEST, unpackedBufLen))
result = unpack_hi_dci0_request(&pReadPackedMessage, end, pMessageHeader, config); result = unpack_hi_dci0_request(&pReadPackedMessage, end, pMessageHeader, config);
else else
return -1; return -1;
break; break;
#endif
case NFAPI_UE_RELEASE_REQUEST: case NFAPI_UE_RELEASE_REQUEST:
if (check_unpack_length(NFAPI_UE_RELEASE_REQUEST, unpackedBufLen)) if (check_unpack_length(NFAPI_UE_RELEASE_REQUEST, unpackedBufLen))
......
...@@ -510,6 +510,14 @@ int nfapi_vnf_p7_ul_config_req(nfapi_vnf_p7_config_t* config, nfapi_ul_config_re ...@@ -510,6 +510,14 @@ int nfapi_vnf_p7_ul_config_req(nfapi_vnf_p7_config_t* config, nfapi_ul_config_re
vnf_p7_t* vnf_p7 = (vnf_p7_t*)config; vnf_p7_t* vnf_p7 = (vnf_p7_t*)config;
return vnf_p7_pack_and_send_p7_msg(vnf_p7, &req->header); return vnf_p7_pack_and_send_p7_msg(vnf_p7, &req->header);
} }
int nfapi_vnf_p7_ul_dci_req(nfapi_vnf_p7_config_t* config, nfapi_nr_ul_dci_request_t* req)
{
if(config == 0 || req == 0)
return -1;
vnf_p7_t* vnf_p7 = (vnf_p7_t*)config;
return vnf_p7_pack_and_send_p7_msg(vnf_p7, &req->header);
}
int nfapi_vnf_p7_hi_dci0_req(nfapi_vnf_p7_config_t* config, nfapi_hi_dci0_request_t* req) int nfapi_vnf_p7_hi_dci0_req(nfapi_vnf_p7_config_t* config, nfapi_hi_dci0_request_t* req)
{ {
if(config == 0 || req == 0) if(config == 0 || req == 0)
......
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