Commit 03394da3 authored by Michael Cook's avatar Michael Cook

Revert whitespace changes

parent 8204f3ea
...@@ -81,19 +81,19 @@ void* nfapi_p7_allocate(size_t size, nfapi_p7_codec_config_t* config) ...@@ -81,19 +81,19 @@ void* nfapi_p7_allocate(size_t size, nfapi_p7_codec_config_t* config)
if(size == 0) if(size == 0)
return 0; return 0;
void* buffer_p = NULL; void* buffer_p = NULL;
if(config && config->allocate) if(config && config->allocate)
{ {
buffer_p = (config->allocate)(size); buffer_p = (config->allocate)(size);
if(buffer_p != NULL){ if(buffer_p != NULL){
memset(buffer_p,0,size); memset(buffer_p,0,size);
} }
return buffer_p; return buffer_p;
} }
else else
{ {
buffer_p = calloc(1, size); buffer_p = calloc(1, size);
return buffer_p; return buffer_p;
} }
} }
...@@ -1551,7 +1551,7 @@ static uint8_t pack_tx_request_body_value(void* tlv, uint8_t **ppWritePackedMsg, ...@@ -1551,7 +1551,7 @@ static uint8_t pack_tx_request_body_value(void* tlv, uint8_t **ppWritePackedMsg,
// DJP - if(pusharray8(pdu->segments[j].segment_data, (uint32_t)(-1), pdu->segments[j].segment_length, ppWritePackedMsg, end) == 0) // DJP - if(pusharray8(pdu->segments[j].segment_data, (uint32_t)(-1), pdu->segments[j].segment_length, ppWritePackedMsg, end) == 0)
int push_ret = pusharray8(pdu->segments[j].segment_data, 65535, pdu->segments[j].segment_length, ppWritePackedMsg, end); int push_ret = pusharray8(pdu->segments[j].segment_data, 65535, pdu->segments[j].segment_length, ppWritePackedMsg, end);
if (pdu->segments[j].segment_length == 3) if (pdu->segments[j].segment_length == 3)
{ {
// NFAPI_TRACE(NFAPI_TRACE_INFO, "%s() BCH? segment_data:%x %x %x\n", __FUNCTION__, // NFAPI_TRACE(NFAPI_TRACE_INFO, "%s() BCH? segment_data:%x %x %x\n", __FUNCTION__,
// pdu->segments[j].segment_data[0], // pdu->segments[j].segment_data[0],
...@@ -1583,43 +1583,43 @@ static uint8_t pack_tx_request(void *msg, uint8_t **ppWritePackedMsg, uint8_t *e ...@@ -1583,43 +1583,43 @@ static uint8_t pack_tx_request(void *msg, uint8_t **ppWritePackedMsg, uint8_t *e
return x && y && z; return x && y && z;
} }
static uint8_t pack_release_request_body_value(void* tlv, uint8_t **ppWritePackedMsg, uint8_t *end) static uint8_t pack_release_request_body_value(void* tlv, uint8_t **ppWritePackedMsg, uint8_t *end)
{ {
nfapi_ue_release_request_body_t* value = (nfapi_ue_release_request_body_t*)tlv; nfapi_ue_release_request_body_t* value = (nfapi_ue_release_request_body_t*)tlv;
if(push16(value->number_of_TLVs, ppWritePackedMsg, end) == 0){ if(push16(value->number_of_TLVs, ppWritePackedMsg, end) == 0){
return 0; return 0;
} }
uint8_t j; uint8_t j;
uint16_t num = value->number_of_TLVs; uint16_t num = value->number_of_TLVs;
for(j = 0; j < num; ++j){ for(j = 0; j < num; ++j){
if(push16(value->ue_release_request_TLVs_list[j].rnti, ppWritePackedMsg, end) == 0){ if(push16(value->ue_release_request_TLVs_list[j].rnti, ppWritePackedMsg, end) == 0){
return 0; return 0;
} }
} }
return 1; return 1;
} }
static uint8_t pack_ue_release_request(void *msg, uint8_t **ppWritePackedMsg, uint8_t *end, nfapi_p7_codec_config_t* config) static uint8_t pack_ue_release_request(void *msg, uint8_t **ppWritePackedMsg, uint8_t *end, nfapi_p7_codec_config_t* config)
{ {
nfapi_ue_release_request_t *pNfapiMsg = (nfapi_ue_release_request_t*)msg; nfapi_ue_release_request_t *pNfapiMsg = (nfapi_ue_release_request_t*)msg;
int x = push16(pNfapiMsg->sfn_sf, ppWritePackedMsg, end); int x = push16(pNfapiMsg->sfn_sf, ppWritePackedMsg, end);
int y = pack_tlv(NFAPI_UE_RELEASE_BODY_TAG, &pNfapiMsg->ue_release_request_body, ppWritePackedMsg, end, &pack_release_request_body_value); int y = pack_tlv(NFAPI_UE_RELEASE_BODY_TAG, &pNfapiMsg->ue_release_request_body, ppWritePackedMsg, end, &pack_release_request_body_value);
int z = pack_p7_vendor_extension_tlv(pNfapiMsg->vendor_extension, ppWritePackedMsg, end, config); int z = pack_p7_vendor_extension_tlv(pNfapiMsg->vendor_extension, ppWritePackedMsg, end, config);
return x && y && z; return x && y && z;
} }
static uint8_t pack_ue_release_response(void *msg, uint8_t **ppWritePackedMsg, uint8_t *end, nfapi_p7_codec_config_t* config) static uint8_t pack_ue_release_response(void *msg, uint8_t **ppWritePackedMsg, uint8_t *end, nfapi_p7_codec_config_t* config)
{ {
nfapi_ue_release_response_t *pNfapiMsg = (nfapi_ue_release_response_t*)msg; nfapi_ue_release_response_t *pNfapiMsg = (nfapi_ue_release_response_t*)msg;
int x = push32(pNfapiMsg->error_code, ppWritePackedMsg, end); int x = push32(pNfapiMsg->error_code, ppWritePackedMsg, end);
int z = pack_p7_vendor_extension_tlv(pNfapiMsg->vendor_extension, ppWritePackedMsg, end, config); int z = pack_p7_vendor_extension_tlv(pNfapiMsg->vendor_extension, ppWritePackedMsg, end, config);
return x && z; return x && z;
} }
static uint8_t pack_rx_ue_information_value(void* tlv, uint8_t **ppWritePackedMsg, uint8_t *end) static uint8_t pack_rx_ue_information_value(void* tlv, uint8_t **ppWritePackedMsg, uint8_t *end)
{ {
nfapi_rx_ue_information* value = (nfapi_rx_ue_information*)tlv; nfapi_rx_ue_information* value = (nfapi_rx_ue_information*)tlv;
...@@ -2707,15 +2707,15 @@ int nfapi_p7_message_pack(void *pMessageBuf, void *pPackedBuf, uint32_t packedBu ...@@ -2707,15 +2707,15 @@ 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;
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);
break; break;
case NFAPI_UE_RELEASE_RESPONSE: case NFAPI_UE_RELEASE_RESPONSE:
result =pack_ue_release_response(pMessageHeader, &pWritePackedMessage, end, config); result =pack_ue_release_response(pMessageHeader, &pWritePackedMessage, end, config);
break; break;
case NFAPI_HARQ_INDICATION: case NFAPI_HARQ_INDICATION:
result = pack_harq_indication(pMessageHeader, &pWritePackedMessage, end, config); result = pack_harq_indication(pMessageHeader, &pWritePackedMessage, end, config);
break; break;
...@@ -4479,43 +4479,43 @@ static uint8_t unpack_tx_request(uint8_t **ppReadPackedMsg, uint8_t *end, void * ...@@ -4479,43 +4479,43 @@ static uint8_t unpack_tx_request(uint8_t **ppReadPackedMsg, uint8_t *end, void *
for(i = 0; i < totalNumPdus; ++i) for(i = 0; i < totalNumPdus; ++i)
{ {
nfapi_tx_request_pdu_t* pdu = &(pNfapiMsg->tx_request_body.tx_pdu_list[i]); nfapi_tx_request_pdu_t* pdu = &(pNfapiMsg->tx_request_body.tx_pdu_list[i]);
if (pdu) { if (pdu) {
uint16_t length = 0; uint16_t length = 0;
uint16_t index = 0; uint16_t index = 0;
if(!(pull16(ppReadPackedMsg, &length, end) && if(!(pull16(ppReadPackedMsg, &length, end) &&
pull16(ppReadPackedMsg, &index, end))) pull16(ppReadPackedMsg, &index, end)))
return 0; return 0;
pdu->pdu_length = length; pdu->pdu_length = length;
pdu->pdu_index = index; pdu->pdu_index = index;
// TODO : May need to rethink this bit // TODO : May need to rethink this bit
pdu->num_segments = 1; pdu->num_segments = 1;
pdu->segments[0].segment_length = pdu->pdu_length; pdu->segments[0].segment_length = pdu->pdu_length;
pdu->segments[0].segment_data = nfapi_p7_allocate(pdu->pdu_length, config); pdu->segments[0].segment_data = nfapi_p7_allocate(pdu->pdu_length, config);
if(pdu->segments[0].segment_data) if(pdu->segments[0].segment_data)
{ {
if(!pullarray8(ppReadPackedMsg, pdu->segments[0].segment_data, pdu->segments[0].segment_length, pdu->segments[0].segment_length, end)) if(!pullarray8(ppReadPackedMsg, pdu->segments[0].segment_data, pdu->segments[0].segment_length, pdu->segments[0].segment_length, end))
return 0; return 0;
if (pdu->segments[0].segment_length == 3) if (pdu->segments[0].segment_length == 3)
{ {
// NFAPI_TRACE(NFAPI_TRACE_INFO, "%s() BCH? segment_data:%x %x %x\n", __FUNCTION__, // NFAPI_TRACE(NFAPI_TRACE_INFO, "%s() BCH? segment_data:%x %x %x\n", __FUNCTION__,
// pdu->segments[0].segment_data[0], // pdu->segments[0].segment_data[0],
// pdu->segments[0].segment_data[1], // pdu->segments[0].segment_data[1],
// pdu->segments[0].segment_data[2] // pdu->segments[0].segment_data[2]
// ); // );
} }
} }
else else
{ {
NFAPI_TRACE(NFAPI_TRACE_ERROR, "unpack_tx_request: Failed to allocate pdu (len:%d) %d/%d %d\n", pdu->pdu_length, totalNumPdus, i, pdu->pdu_index); NFAPI_TRACE(NFAPI_TRACE_ERROR, "unpack_tx_request: Failed to allocate pdu (len:%d) %d/%d %d\n", pdu->pdu_length, totalNumPdus, i, pdu->pdu_index);
} }
} else { } else {
NFAPI_TRACE(NFAPI_TRACE_ERROR, "NULL pdu\n"); NFAPI_TRACE(NFAPI_TRACE_ERROR, "NULL pdu\n");
} }
} }
} }
break; break;
...@@ -4529,55 +4529,55 @@ static uint8_t unpack_tx_request(uint8_t **ppReadPackedMsg, uint8_t *end, void * ...@@ -4529,55 +4529,55 @@ static uint8_t unpack_tx_request(uint8_t **ppReadPackedMsg, uint8_t *end, void *
return 1; return 1;
} }
static uint8_t unpack_ue_release_request(uint8_t **ppReadPackedMsg, uint8_t *end, void *msg, nfapi_p7_codec_config_t* config) static uint8_t unpack_ue_release_request(uint8_t **ppReadPackedMsg, uint8_t *end, void *msg, nfapi_p7_codec_config_t* config)
{ {
uint8_t proceed = 1; uint8_t proceed = 1;
nfapi_ue_release_request_t *pNfapiMsg = (nfapi_ue_release_request_t*)msg; nfapi_ue_release_request_t *pNfapiMsg = (nfapi_ue_release_request_t*)msg;
if(pull16(ppReadPackedMsg, &pNfapiMsg->sfn_sf, end) == 0) if(pull16(ppReadPackedMsg, &pNfapiMsg->sfn_sf, end) == 0)
return 0; return 0;
while (((uint8_t*)(*ppReadPackedMsg) < end) && proceed) while (((uint8_t*)(*ppReadPackedMsg) < end) && proceed)
{ {
nfapi_tl_t generic_tl; nfapi_tl_t generic_tl;
if(unpack_tl(ppReadPackedMsg, &generic_tl, end) == 0) if(unpack_tl(ppReadPackedMsg, &generic_tl, end) == 0)
return 0; return 0;
switch(generic_tl.tag) switch(generic_tl.tag)
{ {
case NFAPI_UE_RELEASE_BODY_TAG: case NFAPI_UE_RELEASE_BODY_TAG:
{ {
pNfapiMsg->ue_release_request_body.tl = generic_tl; pNfapiMsg->ue_release_request_body.tl = generic_tl;
if( pull16(ppReadPackedMsg, &pNfapiMsg->ue_release_request_body.number_of_TLVs, end) == 0) if( pull16(ppReadPackedMsg, &pNfapiMsg->ue_release_request_body.number_of_TLVs, end) == 0)
return 0; return 0;
if(pNfapiMsg->ue_release_request_body.number_of_TLVs > NFAPI_RELEASE_MAX_RNTI) if(pNfapiMsg->ue_release_request_body.number_of_TLVs > NFAPI_RELEASE_MAX_RNTI)
{ {
NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s number of relese rnti's exceed maxium (count:%d max:%d)\n", __FUNCTION__, pNfapiMsg->ue_release_request_body.number_of_TLVs, NFAPI_RELEASE_MAX_RNTI); NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s number of relese rnti's exceed maxium (count:%d max:%d)\n", __FUNCTION__, pNfapiMsg->ue_release_request_body.number_of_TLVs, NFAPI_RELEASE_MAX_RNTI);
return 0; return 0;
} else { } else {
uint8_t j; uint8_t j;
uint16_t num = pNfapiMsg->ue_release_request_body.number_of_TLVs; uint16_t num = pNfapiMsg->ue_release_request_body.number_of_TLVs;
for(j = 0; j < num; ++j){ for(j = 0; j < num; ++j){
if(pull16(ppReadPackedMsg, &pNfapiMsg->ue_release_request_body.ue_release_request_TLVs_list[j].rnti, end) == 0){ if(pull16(ppReadPackedMsg, &pNfapiMsg->ue_release_request_body.ue_release_request_TLVs_list[j].rnti, end) == 0){
return 0; return 0;
} }
} }
} }
} }
break; break;
default: default:
{ {
NFAPI_TRACE(NFAPI_TRACE_ERROR, "unpack_ue_release_request FIXME : Invalid type %d \n", generic_tl.tag ); NFAPI_TRACE(NFAPI_TRACE_ERROR, "unpack_ue_release_request FIXME : Invalid type %d \n", generic_tl.tag );
} }
break; break;
}; };
} }
return 1; return 1;
} }
static uint8_t unpack_harq_indication_tdd_harq_data_bundling(void* tlv, uint8_t **ppReadPackedMsg, uint8_t *end) static uint8_t unpack_harq_indication_tdd_harq_data_bundling(void* tlv, uint8_t **ppReadPackedMsg, uint8_t *end)
{ {
nfapi_harq_indication_tdd_harq_data_bundling_t* value = (nfapi_harq_indication_tdd_harq_data_bundling_t*)tlv; nfapi_harq_indication_tdd_harq_data_bundling_t* value = (nfapi_harq_indication_tdd_harq_data_bundling_t*)tlv;
...@@ -5825,18 +5825,18 @@ static uint8_t unpack_nrach_indication_rel13_value(void *tlv, uint8_t **ppReadPa ...@@ -5825,18 +5825,18 @@ static uint8_t unpack_nrach_indication_rel13_value(void *tlv, uint8_t **ppReadPa
pull8(ppReadPackedMsg, &value->nrach_ce_level, end)); pull8(ppReadPackedMsg, &value->nrach_ce_level, end));
} }
static uint8_t unpack_ue_release_resp(uint8_t **ppReadPackedMsg, uint8_t *end, void *msg, nfapi_p7_codec_config_t* config) static uint8_t unpack_ue_release_resp(uint8_t **ppReadPackedMsg, uint8_t *end, void *msg, nfapi_p7_codec_config_t* config)
{ {
nfapi_ue_release_response_t *pNfapiMsg = (nfapi_ue_release_response_t*)msg; nfapi_ue_release_response_t *pNfapiMsg = (nfapi_ue_release_response_t*)msg;
if(pull32(ppReadPackedMsg, &pNfapiMsg->error_code, end) == 0){ if(pull32(ppReadPackedMsg, &pNfapiMsg->error_code, end) == 0){
return 0; return 0;
} }
else{ else{
NFAPI_TRACE(NFAPI_TRACE_INFO, "ue_release_response:error_code = %d\n", pNfapiMsg->error_code); NFAPI_TRACE(NFAPI_TRACE_INFO, "ue_release_response:error_code = %d\n", pNfapiMsg->error_code);
} }
return 1; return 1;
} }
static uint8_t unpack_nrach_indication_body_value(void* tlv, uint8_t **ppReadPackedMsg, uint8_t *end, nfapi_p7_codec_config_t* config) static uint8_t unpack_nrach_indication_body_value(void* tlv, uint8_t **ppReadPackedMsg, uint8_t *end, nfapi_p7_codec_config_t* config)
{ {
nfapi_nrach_indication_body_t* value = (nfapi_nrach_indication_body_t*)tlv; nfapi_nrach_indication_body_t* value = (nfapi_nrach_indication_body_t*)tlv;
...@@ -6049,17 +6049,17 @@ static int check_unpack_length(nfapi_message_id_e msgId, uint32_t unpackedBufLen ...@@ -6049,17 +6049,17 @@ static int check_unpack_length(nfapi_message_id_e msgId, uint32_t unpackedBufLen
if (unpackedBufLen >= sizeof(nfapi_timing_info_t)) if (unpackedBufLen >= sizeof(nfapi_timing_info_t))
retLen = sizeof(nfapi_timing_info_t); retLen = sizeof(nfapi_timing_info_t);
break; break;
case NFAPI_UE_RELEASE_REQUEST: case NFAPI_UE_RELEASE_REQUEST:
if (unpackedBufLen >= sizeof(nfapi_ue_release_request_t)) if (unpackedBufLen >= sizeof(nfapi_ue_release_request_t))
retLen = sizeof(nfapi_ue_release_request_t); retLen = sizeof(nfapi_ue_release_request_t);
break; break;
case NFAPI_UE_RELEASE_RESPONSE: case NFAPI_UE_RELEASE_RESPONSE:
if (unpackedBufLen >= sizeof(nfapi_ue_release_response_t)) if (unpackedBufLen >= sizeof(nfapi_ue_release_response_t))
retLen = sizeof(nfapi_ue_release_response_t); retLen = sizeof(nfapi_ue_release_response_t);
break; break;
default: default:
NFAPI_TRACE(NFAPI_TRACE_ERROR, "Unknown message ID %d\n", msgId); NFAPI_TRACE(NFAPI_TRACE_ERROR, "Unknown message ID %d\n", msgId);
break; break;
...@@ -6179,14 +6179,14 @@ int nfapi_p7_message_unpack(void *pMessageBuf, uint32_t messageBufLen, void *pUn ...@@ -6179,14 +6179,14 @@ int nfapi_p7_message_unpack(void *pMessageBuf, uint32_t messageBufLen, void *pUn
else else
return -1; return -1;
break; break;
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))
result = unpack_ue_release_request(&pReadPackedMessage, end, pMessageHeader, config); result = unpack_ue_release_request(&pReadPackedMessage, end, pMessageHeader, config);
else else
return -1; return -1;
break; break;
case NFAPI_HARQ_INDICATION: case NFAPI_HARQ_INDICATION:
if (check_unpack_length(NFAPI_HARQ_INDICATION, unpackedBufLen)) if (check_unpack_length(NFAPI_HARQ_INDICATION, unpackedBufLen))
result = unpack_harq_indication(&pReadPackedMessage, end, pMessageHeader, config); result = unpack_harq_indication(&pReadPackedMessage, end, pMessageHeader, config);
...@@ -6284,14 +6284,14 @@ int nfapi_p7_message_unpack(void *pMessageBuf, uint32_t messageBufLen, void *pUn ...@@ -6284,14 +6284,14 @@ int nfapi_p7_message_unpack(void *pMessageBuf, uint32_t messageBufLen, void *pUn
else else
return -1; return -1;
break; break;
case NFAPI_UE_RELEASE_RESPONSE: case NFAPI_UE_RELEASE_RESPONSE:
if (check_unpack_length(NFAPI_UE_RELEASE_RESPONSE, unpackedBufLen)) if (check_unpack_length(NFAPI_UE_RELEASE_RESPONSE, unpackedBufLen))
result = unpack_ue_release_resp(&pReadPackedMessage, end, pMessageHeader, config); result = unpack_ue_release_resp(&pReadPackedMessage, end, pMessageHeader, config);
else else
return -1; return -1;
break; break;
default: default:
if(pMessageHeader->message_id >= NFAPI_VENDOR_EXT_MSG_MIN && if(pMessageHeader->message_id >= NFAPI_VENDOR_EXT_MSG_MIN &&
......
...@@ -35,12 +35,12 @@ ...@@ -35,12 +35,12 @@
#include <errno.h> #include <errno.h>
extern int oai_nfapi_rach_ind(nfapi_rach_indication_t *rach_ind); extern int oai_nfapi_rach_ind(nfapi_rach_indication_t *rach_ind);
void configure_nfapi_pnf(char *vnf_ip_addr, void configure_nfapi_pnf(char *vnf_ip_addr,
int vnf_p5_port, int vnf_p5_port,
char *pnf_ip_addr, char *pnf_ip_addr,
int pnf_p7_port, int pnf_p7_port,
int vnf_p7_port); int vnf_p7_port);
UL_IND_t *UL_INFO = NULL; UL_IND_t *UL_INFO = NULL;
nfapi_ul_config_request_t* ul_config_req = NULL; nfapi_ul_config_request_t* ul_config_req = NULL;
...@@ -56,8 +56,8 @@ int current_sfn_sf; ...@@ -56,8 +56,8 @@ int current_sfn_sf;
static int ue_sock_descriptor = -1; static int ue_sock_descriptor = -1;
extern nfapi_tx_request_pdu_t* tx_request_pdu[1023][10][10]; extern nfapi_tx_request_pdu_t* tx_request_pdu[1023][10][10];
extern int timer_subframe; //extern int timer_subframe;
extern int timer_frame; //extern int timer_frame;
extern uint16_t sf_ahead; extern uint16_t sf_ahead;
...@@ -195,7 +195,7 @@ void fill_rach_indication_UE_MAC(int Mod_id, ...@@ -195,7 +195,7 @@ void fill_rach_indication_UE_MAC(int Mod_id,
UL_IND_t *UL_INFO, UL_IND_t *UL_INFO,
uint8_t ra_PreambleIndex, uint8_t ra_PreambleIndex,
uint16_t ra_RNTI) { uint16_t ra_RNTI) {
LOG_I(MAC, "fill_rach_indication_UE_MAC 1 \n"); LOG_D(MAC, "fill_rach_indication_UE_MAC 1 \n");
pthread_mutex_lock(&fill_ul_mutex.rach_mutex); pthread_mutex_lock(&fill_ul_mutex.rach_mutex);
...@@ -241,7 +241,7 @@ void fill_rach_indication_UE_MAC(int Mod_id, ...@@ -241,7 +241,7 @@ void fill_rach_indication_UE_MAC(int Mod_id,
// This function is currently defined only in the nfapi-RU-RAU-split so we // This function is currently defined only in the nfapi-RU-RAU-split so we
// should call it when we merge with that branch. // should call it when we merge with that branch.
// Andrew - send proxy specific socket instead of oai_nfapi_rach_ind Send the whole UL_INFO struct // TODO Andrew - send proxy specific socket instead of oai_nfapi_rach_ind Send the whole UL_INFO struct
// as soon as numberof preambles // as soon as numberof preambles
if (NFAPI_MODE == NFAPI_MODE_STANDALONE_PNF) { if (NFAPI_MODE == NFAPI_MODE_STANDALONE_PNF) {
send_standalone_msg(UL_INFO, UL_INFO->rach_ind.header.message_id); send_standalone_msg(UL_INFO, UL_INFO->rach_ind.header.message_id);
......
...@@ -1951,13 +1951,13 @@ void write_dummy(PHY_VARS_UE *UE, openair0_timestamp timestamp) { ...@@ -1951,13 +1951,13 @@ void write_dummy(PHY_VARS_UE *UE, openair0_timestamp timestamp) {
// //
struct complex16 v= {0}; struct complex16 v= {0};
void *samplesVoid[UE->frame_parms.nb_antennas_tx]; void *samplesVoid[UE->frame_parms.nb_antennas_tx];
for ( int i=0; i < UE->frame_parms.nb_antennas_tx; i++) for ( int i=0; i < UE->frame_parms.nb_antennas_tx; i++)
samplesVoid[i]=(void *)&v; samplesVoid[i]=(void *)&v;
AssertFatal( 1 == UE->rfdevice.trx_write_func(&UE->rfdevice, AssertFatal( 1 == UE->rfdevice.trx_write_func(&UE->rfdevice,
timestamp+2*UE->frame_parms.samples_per_tti, timestamp+2*UE->frame_parms.samples_per_tti,
samplesVoid, samplesVoid,
1, 1,
UE->frame_parms.nb_antennas_tx, UE->frame_parms.nb_antennas_tx,
1),""); 1),"");
...@@ -2011,7 +2011,7 @@ void *UE_thread(void *arg) ...@@ -2011,7 +2011,7 @@ void *UE_thread(void *arg)
int instance_cnt_synch = UE->proc.instance_cnt_synch; int instance_cnt_synch = UE->proc.instance_cnt_synch;
int is_synchronized = UE->is_synchronized; int is_synchronized = UE->is_synchronized;
AssertFatal ( 0== pthread_mutex_unlock(&UE->proc.mutex_synch), ""); AssertFatal ( 0== pthread_mutex_unlock(&UE->proc.mutex_synch), "");
if (is_synchronized == 0) { if (is_synchronized == 0) {
if (instance_cnt_synch < 0) { // we can invoke the synch if (instance_cnt_synch < 0) { // we can invoke the synch
// grab 10 ms of signal and wakeup synch thread // grab 10 ms of signal and wakeup synch thread
...@@ -2021,7 +2021,7 @@ void *UE_thread(void *arg) ...@@ -2021,7 +2021,7 @@ void *UE_thread(void *arg)
for(int sf=0; sf<10; sf++) { for(int sf=0; sf<10; sf++) {
for (int i=0; i<UE->frame_parms.nb_antennas_rx; i++) for (int i=0; i<UE->frame_parms.nb_antennas_rx; i++)
rxp[i] = (void *)&UE->common_vars.rxdata[i][UE->frame_parms.samples_per_tti*sf]; rxp[i] = (void *)&UE->common_vars.rxdata[i][UE->frame_parms.samples_per_tti*sf];
AssertFatal(UE->frame_parms.samples_per_tti == UE->rfdevice.trx_read_func(&UE->rfdevice, AssertFatal(UE->frame_parms.samples_per_tti == UE->rfdevice.trx_read_func(&UE->rfdevice,
&timestamp, &timestamp,
rxp, rxp,
...@@ -2032,7 +2032,7 @@ void *UE_thread(void *arg) ...@@ -2032,7 +2032,7 @@ void *UE_thread(void *arg)
} else { } else {
for (int i=0; i<UE->frame_parms.nb_antennas_rx; i++) for (int i=0; i<UE->frame_parms.nb_antennas_rx; i++)
rxp[i] = (void *)&UE->common_vars.rxdata[i][0]; rxp[i] = (void *)&UE->common_vars.rxdata[i][0];
AssertFatal( UE->frame_parms.samples_per_tti*10 == AssertFatal( UE->frame_parms.samples_per_tti*10 ==
UE->rfdevice.trx_read_func(&UE->rfdevice, UE->rfdevice.trx_read_func(&UE->rfdevice,
&timestamp, &timestamp,
......
...@@ -632,7 +632,7 @@ int main( int argc, char **argv ) { ...@@ -632,7 +632,7 @@ int main( int argc, char **argv ) {
NB_INST=1; NB_INST=1;
if(NFAPI_MODE==NFAPI_UE_STUB_PNF || NFAPI_MODE==NFAPI_MODE_STANDALONE_PNF) { // || NFAPI_MODE_STANDALONE_PNF if(NFAPI_MODE==NFAPI_UE_STUB_PNF || NFAPI_MODE==NFAPI_MODE_STANDALONE_PNF) {
PHY_vars_UE_g = malloc(sizeof(PHY_VARS_UE **)*NB_UE_INST); PHY_vars_UE_g = malloc(sizeof(PHY_VARS_UE **)*NB_UE_INST);
for (int i=0; i<NB_UE_INST; i++) { for (int i=0; i<NB_UE_INST; i++) {
...@@ -653,10 +653,10 @@ int main( int argc, char **argv ) { ...@@ -653,10 +653,10 @@ int main( int argc, char **argv ) {
} }
cpuf=get_cpu_freq_GHz(); cpuf=get_cpu_freq_GHz();
#if 0 // #ifndef DEADLINE_SCHEDULER #if 0 // #ifndef DEADLINE_SCHEDULER
printf("NO deadline scheduler\n"); printf("NO deadline scheduler\n");
/* Currently we set affinity for UHD to CPU 0 for eNB/UE and only if number of CPUS >2 */ /* Currently we set affinity for UHD to CPU 0 for eNB/UE and only if number of CPUS >2 */
cpu_set_t cpuset; cpu_set_t cpuset;
...@@ -668,7 +668,7 @@ int main( int argc, char **argv ) { ...@@ -668,7 +668,7 @@ int main( int argc, char **argv ) {
if (get_nprocs() > 2) { if (get_nprocs() > 2) {
for (j = 2; j < get_nprocs(); j++) for (j = 2; j < get_nprocs(); j++)
CPU_SET(j, &cpuset); CPU_SET(j, &cpuset);
s = pthread_setaffinity_np(pthread_self(), sizeof(cpu_set_t), &cpuset); s = pthread_setaffinity_np(pthread_self(), sizeof(cpu_set_t), &cpuset);
if (s != 0) { if (s != 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