Commit 5406c167 authored by Aniq's avatar Aniq

Packing fns for tx_data_request added

parent 524b9e8b
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "gcc - Build and debug active file",
"type": "cppdbg",
"request": "launch",
"program": "${fileDirname}/${fileBasenameNoExtension}",
"args": [],
"stopAtEntry": false,
"cwd": "${workspaceFolder}",
"environment": [],
"externalConsole": false,
"MIMode": "gdb",
"setupCommands": [
{
"description": "Enable pretty-printing for gdb",
"text": "-enable-pretty-printing",
"ignoreFailures": true
}
],
"preLaunchTask": "gcc build active file",
"miDebuggerPath": "/usr/bin/gdb"
}
]
}
\ No newline at end of file
{
"version": "2.0.0",
"tasks": [
{
"type": "shell",
"label": "C/C++: gcc build active file",
"command": "/usr/bin/gcc",
"args": [
"-g",
"${file}",
"-o",
"${fileDirname}/${fileBasenameNoExtension}"
],
"options": {
"cwd": "/usr/bin"
},
"problemMatcher": [
"$gcc"
],
"group": "build"
}
]
}
\ No newline at end of file
...@@ -1320,6 +1320,23 @@ int oai_nfapi_nr_dl_config_req(nfapi_nr_dl_tti_request_t *dl_config_req) ...@@ -1320,6 +1320,23 @@ int oai_nfapi_nr_dl_config_req(nfapi_nr_dl_tti_request_t *dl_config_req)
return retval; return retval;
} }
int oai_nfapi_tx_data_req(nfapi_nr_tx_data_request_t *tx_data_req)
{
nfapi_vnf_p7_config_t *p7_config = vnf.p7_vnfs[0].config;
tx_data_req->header.phy_id = 1; // DJP HACK TODO FIXME - need to pass this around!!!!
tx_data_req->header.message_id = NFAPI_NR_PHY_MSG_TYPE_TX_DATA_REQUEST;
//LOG_D(PHY, "[VNF] %s() TX_REQ sfn_sf:%d number_of_pdus:%d\n", __FUNCTION__, NFAPI_SFNSF2DEC(tx_req->sfn_sf), tx_req->tx_request_body.number_of_pdus);
int retval = nfapi_vnf_p7_tx_data_req(p7_config, tx_data_req);
if (retval!=0) {
LOG_E(PHY, "%s() Problem sending retval:%d\n", __FUNCTION__, retval);
} else {
tx_data_req->Number_of_PDUs = 0;
}
return retval;
}
int oai_nfapi_tx_req(nfapi_tx_request_t *tx_req) int oai_nfapi_tx_req(nfapi_tx_request_t *tx_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;
......
...@@ -1414,6 +1414,7 @@ typedef struct ...@@ -1414,6 +1414,7 @@ typedef struct
#define NFAPI_NR_MAX_TX_REQUEST_PDUS 16 #define NFAPI_NR_MAX_TX_REQUEST_PDUS 16
typedef struct typedef struct
{ {
nfapi_p7_message_header_t header;
uint16_t SFN; uint16_t SFN;
uint16_t Slot; uint16_t Slot;
uint16_t Number_of_PDUs; uint16_t Number_of_PDUs;
......
...@@ -2094,6 +2094,55 @@ static uint8_t pack_hi_dci0_request(void *msg, uint8_t **ppWritePackedMsg, uint8 ...@@ -2094,6 +2094,55 @@ static uint8_t pack_hi_dci0_request(void *msg, uint8_t **ppWritePackedMsg, uint8
pack_p7_vendor_extension_tlv(pNfapiMsg->vendor_extension, ppWritePackedMsg, end, config)); pack_p7_vendor_extension_tlv(pNfapiMsg->vendor_extension, ppWritePackedMsg, end, config));
} }
//pack_tx_data_pdu_list_value
static uint8_t pack_tx_data_pdu_list_value(void* tlv, uint8_t **ppWritePackedMsg, uint8_t *end)
{
nfapi_nr_pdu_t* value = (nfapi_nr_pdu_t*)tlv;
if(!(push32(value->num_TLV, ppWritePackedMsg, end) &&
push16(value->PDU_index, ppWritePackedMsg, end) &&
push16(value->PDU_length, ppWritePackedMsg, end)
))
return 0;
uint16_t i = 0;
uint16_t total_number_of_tlvs = value->num_TLV;
for(; i < total_number_of_tlvs; ++i)
{
if (!(push16(value->TLVs[i].length, ppWritePackedMsg, end) &&
push16(value->TLVs[i].tag, ppWritePackedMsg, end)))
return 0;
switch(value->TLVs[i].tag){
case 0:
{
if(!pusharray32(value->TLVs[i].value.direct, 16384, value->TLVs[i].length, ppWritePackedMsg, end))
return 0;
break;
}
case 1:
{
if(!pusharray32(value->TLVs[i].value.ptr, value->TLVs[i].length , value->TLVs[i].length, ppWritePackedMsg, end))
return 0;
break;
}
default:
{
// NFAPI_TRACE
break;
}
}
}
return 1;
}
static uint8_t pack_tx_request_body_value(void* tlv, uint8_t **ppWritePackedMsg, uint8_t *end) static uint8_t pack_tx_request_body_value(void* tlv, uint8_t **ppWritePackedMsg, uint8_t *end)
{ {
nfapi_tx_request_body_t* value = (nfapi_tx_request_body_t*)tlv; nfapi_tx_request_body_t* value = (nfapi_tx_request_body_t*)tlv;
...@@ -2139,6 +2188,26 @@ static uint8_t pack_tx_request_body_value(void* tlv, uint8_t **ppWritePackedMsg, ...@@ -2139,6 +2188,26 @@ static uint8_t pack_tx_request_body_value(void* tlv, uint8_t **ppWritePackedMsg,
return 1; return 1;
} }
static uint8_t pack_tx_data_request(void *msg, uint8_t **ppWritePackedMsg, uint8_t *end, nfapi_p7_codec_config_t* config)
{
nfapi_nr_tx_data_request_t *pNfapiMsg = (nfapi_nr_tx_data_request_t*)msg;
if (!(
push16(pNfapiMsg->SFN, ppWritePackedMsg, end) &&
push16(pNfapiMsg->Slot, ppWritePackedMsg, end) &&
push16(pNfapiMsg->Number_of_PDUs, ppWritePackedMsg, end)
))
return 0;
for(int i=0; i<pNfapiMsg->Number_of_PDUs; i++)
{
if(!pack_tx_data_pdu_list_value(&pNfapiMsg->pdu_list[i], ppWritePackedMsg, end))
return 0;
}
return 1;
}
static uint8_t pack_tx_request(void *msg, uint8_t **ppWritePackedMsg, uint8_t *end, nfapi_p7_codec_config_t* config) static uint8_t pack_tx_request(void *msg, uint8_t **ppWritePackedMsg, uint8_t *end, nfapi_p7_codec_config_t* config)
{ {
nfapi_tx_request_t *pNfapiMsg = (nfapi_tx_request_t*)msg; nfapi_tx_request_t *pNfapiMsg = (nfapi_tx_request_t*)msg;
...@@ -3265,6 +3334,9 @@ int nfapi_p7_message_pack(void *pMessageBuf, void *pPackedBuf, uint32_t packedBu ...@@ -3265,6 +3334,9 @@ int nfapi_p7_message_pack(void *pMessageBuf, void *pPackedBuf, uint32_t packedBu
case NFAPI_NR_PHY_MSG_TYPE_UL_TTI_REQUEST: case NFAPI_NR_PHY_MSG_TYPE_UL_TTI_REQUEST:
result = pack_ul_tti_request(pMessageHeader, &pWritePackedMessage, end, config); result = pack_ul_tti_request(pMessageHeader, &pWritePackedMessage, end, config);
break; break;
case NFAPI_NR_PHY_MSG_TYPE_TX_DATA_REQUEST:
result = pack_tx_data_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__);
...@@ -3274,15 +3346,16 @@ int nfapi_p7_message_pack(void *pMessageBuf, void *pPackedBuf, uint32_t packedBu ...@@ -3274,15 +3346,16 @@ int nfapi_p7_message_pack(void *pMessageBuf, void *pPackedBuf, uint32_t packedBu
case NFAPI_UL_CONFIG_REQUEST: case NFAPI_UL_CONFIG_REQUEST:
result = pack_ul_config_request(pMessageHeader, &pWritePackedMessage, end, config); result = pack_ul_config_request(pMessageHeader, &pWritePackedMessage, end, config);
break; break;
case NFAPI_TX_REQUEST:
//NFAPI_TRACE(NFAPI_TRACE_INFO, "%s() NFAPI_TX_REQUEST\n", __FUNCTION__);
result = pack_tx_request(pMessageHeader, &pWritePackedMessage, end, config);
break;
#endif #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;
case NFAPI_TX_REQUEST:
//NFAPI_TRACE(NFAPI_TRACE_INFO, "%s() NFAPI_TX_REQUEST\n", __FUNCTION__);
result = pack_tx_request(pMessageHeader, &pWritePackedMessage, end, config);
break;
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);
......
...@@ -518,6 +518,14 @@ int nfapi_vnf_p7_hi_dci0_req(nfapi_vnf_p7_config_t* config, nfapi_hi_dci0_reques ...@@ -518,6 +518,14 @@ int nfapi_vnf_p7_hi_dci0_req(nfapi_vnf_p7_config_t* config, nfapi_hi_dci0_reques
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_tx_data_req(nfapi_vnf_p7_config_t* config, nfapi_nr_tx_data_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_tx_req(nfapi_vnf_p7_config_t* config, nfapi_tx_request_t* req) int nfapi_vnf_p7_tx_req(nfapi_vnf_p7_config_t* config, nfapi_tx_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