Commit 57144404 authored by Michael Cook's avatar Michael Cook

Cleanup

Revert unnecessary changes relative to origin/develop

Reviewed with Andrew
parent 5ed13908
......@@ -226,18 +226,18 @@ THREAD_STRUCT = (
log_config =
{
global_log_level ="debug";
global_log_level ="info";
global_log_verbosity ="medium";
hw_log_level ="info";
hw_log_verbosity ="medium";
phy_log_level ="info";
phy_log_verbosity ="medium";
mac_log_level ="debug";
mac_log_level ="info";
mac_log_verbosity ="high";
rlc_log_level ="info";
rlc_log_verbosity ="medium";
pdcp_log_level ="info";
pdcp_log_verbosity ="medium";
rrc_log_level ="debug";
rrc_log_level ="info";
rrc_log_verbosity ="medium";
};
......@@ -45,6 +45,7 @@
#include "common/config/config_userapi.h"
#include <time.h>
#include <sys/time.h>
// main log variables
log_mem_cnt_t log_mem_d[2];
......@@ -477,29 +478,28 @@ char *log_getthreadname(char *threadname,
}
static int log_header(char *log_buffer,
int buffsize,
int comp,
int level,
const char *format)
int buffsize,
int comp,
int level,
const char *format)
{
char threadname[PR_SET_NAME];
struct timeval tv;
gettimeofday(&tv, NULL);
struct tm tm;
localtime_r(&tv.tv_sec, &tm);
return snprintf(log_buffer, buffsize, "%02d:%02d:%02d.%06ld %s%s[%s]%c %s %s%s",
tm.tm_hour,
tm.tm_min,
tm.tm_sec,
tv.tv_usec,
log_level_highlight_end[level],
((g_log->flag & FLAG_NOCOLOR) ? "" : log_level_highlight_start[level]),
g_log->log_component[comp].name,
((g_log->flag & FLAG_LEVEL) ? g_log->level2string[level] : ' '),
((g_log->flag & FLAG_THREAD) ? log_getthreadname(threadname, PR_SET_NAME + 1) : ""),
format,
log_level_highlight_end[level]);
return snprintf(log_buffer, buffsize, "%02d:%02d:%02d.%06ld %s%s[%s]%c %s %s%s",
tm.tm_hour,
tm.tm_min,
tm.tm_sec,
tv.tv_usec,
log_level_highlight_end[level],
( (g_log->flag & FLAG_NOCOLOR)?"":log_level_highlight_start[level]),
g_log->log_component[comp].name,
( (g_log->flag & FLAG_LEVEL)?g_log->level2string[level]:' '),
( (g_log->flag & FLAG_THREAD)?log_getthreadname(threadname,PR_SET_NAME+1):""),
format,
log_level_highlight_end[level]);
}
void logRecord_mt(const char *file,
......
......@@ -106,14 +106,15 @@ extern "C" {
#define LOG_ORANGE "\033[93m" /*!< \brief VT100 sequence for orange foreground */
#define LOG_BLUE "\033[34m" /*!< \brief VT100 sequence for blue foreground */
#define LOG_CYBL "\033[40;36m" /*!< \brief VT100 sequence for cyan foreground on black background */
#define LOG_RESET "\033[0m" /*!< \brief VT100 sequence for reset (black) foreground */
#else
#define LOG_RED ""
#define LOG_GREEN ""
#define LOG_ORANGE ""
#define LOG_BLUE ""
#define LOG_CYBL ""
#define LOG_RESET ""
#endif
# define LOG_RED ""
# define LOG_GREEN ""
# define LOG_ORANGE ""
# define LOG_BLUE ""
# define LOG_CYBL ""
# define LOG_RESET ""
#endif // LOG_WITH_COLORS
/* @}*/
......
......@@ -423,7 +423,7 @@ int phy_subframe_indication(struct nfapi_vnf_p7_config *config, uint16_t phy_id,
if (RC.eNB && RC.eNB[0][0]->configured) {
uint16_t sfn = NFAPI_SFNSF2SFN(sfn_sf);
uint16_t sf = NFAPI_SFNSF2SF(sfn_sf);
LOG_D(PHY,"[VNF] subframe indication sfn_sf:%d sfn:%d sf:%d\n", sfn_sf, sfn, sf);
//LOG_D(PHY,"[VNF] subframe indication sfn_sf:%d sfn:%d sf:%d\n", sfn_sf, sfn, sf);
wake_eNB_rxtx(RC.eNB[0][0], sfn, sf);
} else {
printf("[VNF] %s() RC.eNB:%p\n", __FUNCTION__, RC.eNB);
......@@ -439,9 +439,6 @@ int phy_rach_indication(struct nfapi_vnf_p7_config *config, nfapi_rach_indicatio
struct PHY_VARS_eNB_s *eNB = RC.eNB[0][0];
printf("[VNF] RACH_IND eNB:%p sfn_sf:%d number_of_preambles:%d\n", eNB, NFAPI_SFNSF2DEC(ind->sfn_sf), ind->rach_indication_body.number_of_preambles);
pthread_mutex_lock(&eNB->UL_INFO_mutex);
LOG_E(MAC, "%s entered\n", __func__);
if(NFAPI_MODE == NFAPI_MODE_VNF){
int8_t index = -1;
for(uint8_t i= 0;i< NUM_NFPAI_SUBFRAME;i++){
......@@ -504,9 +501,7 @@ int phy_rach_indication(struct nfapi_vnf_p7_config *config, nfapi_rach_indicatio
int phy_harq_indication(struct nfapi_vnf_p7_config *config, nfapi_harq_indication_t *ind) {
struct PHY_VARS_eNB_s *eNB = RC.eNB[0][0];
LOG_D(MAC, "%s() NFAPI Frame: %d Subframe: %d number_of_harqs:%u\n", __FUNCTION__, NFAPI_SFNSF2SFN(ind->sfn_sf),
NFAPI_SFNSF2SF(ind->sfn_sf), ind->harq_indication_body.number_of_harqs);
LOG_E(MAC, "%s entered\n", __func__);
LOG_D(MAC, "%s() NFAPI SFN/SF:%d number_of_harqs:%u\n", __FUNCTION__, NFAPI_SFNSF2DEC(ind->sfn_sf), ind->harq_indication_body.number_of_harqs);
pthread_mutex_lock(&eNB->UL_INFO_mutex);
if(NFAPI_MODE == NFAPI_MODE_VNF){
int8_t index = -1;
......@@ -544,10 +539,6 @@ int phy_harq_indication(struct nfapi_vnf_p7_config *config, nfapi_harq_indicatio
int phy_crc_indication(struct nfapi_vnf_p7_config *config, nfapi_crc_indication_t *ind) {
struct PHY_VARS_eNB_s *eNB = RC.eNB[0][0];
pthread_mutex_lock(&eNB->UL_INFO_mutex);
LOG_E(MAC, "%s entered sfn: %u sf: %u\n", __func__, NFAPI_SFNSF2SFN(ind->sfn_sf),
NFAPI_SFNSF2SF(ind->sfn_sf));
if(NFAPI_MODE == NFAPI_MODE_VNF){
int8_t index = -1;
for(uint8_t i= 0;i< NUM_NFPAI_SUBFRAME;i++){
......@@ -612,8 +603,6 @@ int phy_rx_indication(struct nfapi_vnf_p7_config *config, nfapi_rx_indication_t
LOG_D(MAC, "%s() NFAPI SFN/SF:%d number_of_pdus:%u\n", __FUNCTION__, NFAPI_SFNSF2DEC(ind->sfn_sf), ind->rx_indication_body.number_of_pdus);
}
LOG_E(MAC, "%s entered sfn: %u sf: %u\n", __func__, NFAPI_SFNSF2SFN(ind->sfn_sf),
NFAPI_SFNSF2SF(ind->sfn_sf));
pthread_mutex_lock(&eNB->UL_INFO_mutex);
if(NFAPI_MODE == NFAPI_MODE_VNF){
int8_t index = -1;
......@@ -751,7 +740,6 @@ int phy_cqi_indication(struct nfapi_vnf_p7_config *config, nfapi_cqi_indication_
//mac_cqi_ind(p7_vnf->mac, ind);
struct PHY_VARS_eNB_s *eNB = RC.eNB[0][0];
LOG_D(MAC, "%s() NFAPI SFN/SF:%d number_of_cqis:%u\n", __FUNCTION__, NFAPI_SFNSF2DEC(ind->sfn_sf), ind->cqi_indication_body.number_of_cqis);
LOG_E(MAC, "%s entered\n", __func__);
pthread_mutex_lock(&eNB->UL_INFO_mutex);
if(NFAPI_MODE == NFAPI_MODE_VNF){
int8_t index = -1;
......
......@@ -2566,7 +2566,7 @@ typedef struct {
} nfapi_harq_indication_tdd_rel13_t;
#define NFAPI_HARQ_INDICATION_TDD_REL13_TAG 0x204F
typedef struct {
typedef struct {
nfapi_tl_t tl;
uint8_t harq_tb1;
uint8_t harq_tb2;
......
......@@ -1553,11 +1553,11 @@ static uint8_t pack_tx_request_body_value(void* tlv, uint8_t **ppWritePackedMsg,
if (pdu->segments[j].segment_length == 3)
{
// 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[1],
// pdu->segments[j].segment_data[2]
// );
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[1],
pdu->segments[j].segment_data[2]
);
}
//NFAPI_TRACE(NFAPI_TRACE_INFO, "%s() segment_data:%p segment_length:%u pusharray8()=%d\n", __FUNCTION__, pdu->segments[j].segment_data, pdu->segments[j].segment_length, push_ret);
......@@ -4502,11 +4502,11 @@ static uint8_t unpack_tx_request(uint8_t **ppReadPackedMsg, uint8_t *end, void *
return 0;
if (pdu->segments[0].segment_length == 3)
{
// 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[1],
// pdu->segments[0].segment_data[2]
// );
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[1],
pdu->segments[0].segment_data[2]
);
}
}
else
......
......@@ -49,10 +49,10 @@ void generate_sldch(PHY_VARS_UE *ue,SLDCH_t *sldch,int frame_tx,int subframe_tx)
(void*)sldch,
sizeof(SLDCH_t));
// LOG_I(PHY,"SLDCH configuration %zd bytes, TBS payload %d bytes => %zd bytes\n",
// sizeof(SLDCH_t)-sizeof(uint8_t*),
// sldch->payload_length,
// sldch_header_len+sizeof(SLDCH_t)-sizeof(uint8_t*)+sldch->payload_length);
LOG_I(PHY,"SLDCH configuration %zd bytes, TBS payload %d bytes => %zd bytes\n",
sizeof(SLDCH_t)-sizeof(uint8_t*),
sldch->payload_length,
sldch_header_len+sizeof(SLDCH_t)-sizeof(uint8_t*)+sldch->payload_length);
multicast_link_write_sock(0,
(char *)&pdu,
......
......@@ -242,9 +242,9 @@ multicast_link_write_sock(int groupP, char *dataP, uint32_t sizeP)
if ((num = sendto (group_list[groupP].socket, dataP, sizeP, 0,
(struct sockaddr *) &group_list[groupP].sock_remote_addr,
sizeof (group_list[groupP].sock_remote_addr))) < 0) {
// LOG_E(PHY, "[MULTICAST] sendto has failed (%d:%s)\n (%s:%d)\n",
// errno, strerror(errno),
// __FILE__, __LINE__);
LOG_E(PHY, "[MULTICAST] sendto has failed (%d:%s)\n (%s:%d)\n",
errno, strerror(errno),
__FILE__, __LINE__);
}
return num;
......
......@@ -200,7 +200,6 @@ get_prach_resources(module_id_t module_idP,
RA_prach_resources.ra_PREAMBLE_RECEIVED_TARGET_POWER =
get_Po_NOMINAL_PUSCH(module_idP, CC_id);
} else { // Msg3 is being retransmitted
LOG_E(MAC, "Didnt set UE Mode Correctly\n");
if (UE_mac_inst[module_idP].RA_usedGroupA == 1) {
if (rach_ConfigCommon->preambleInfo.preamblesGroupAConfig) {
UE_mac_inst[module_idP].RA_prach_resources.
......@@ -289,8 +288,6 @@ PRACH_RESOURCES_t *ue_get_rach(module_id_t module_idP, int CC_id,
uint8_t Size = 0;
UE_MODE_t UE_mode;
LOG_D(MAC, "got inside ue_get_rach\n");
// Modification for phy_stub_ue operation
if(NFAPI_MODE == NFAPI_UE_STUB_PNF || NFAPI_MODE == NFAPI_MODE_STANDALONE_PNF) { // phy_stub_ue mode
UE_mode = UE_mac_inst[module_idP].UE_mode[0];
......@@ -322,7 +319,7 @@ PRACH_RESOURCES_t *ue_get_rach(module_id_t module_idP, int CC_id,
}
if (UE_mac_inst[module_idP].RA_active == 0) {
LOG_D(MAC, "RA not active\n");
LOG_I(MAC, "RA not active\n");
// check if RRC is ready to initiate the RA procedure
Size = mac_rrc_data_req_ue(module_idP,
CC_id,
......@@ -335,10 +332,10 @@ PRACH_RESOURCES_t *ue_get_rach(module_id_t module_idP, int CC_id,
0);
Size16 = (uint16_t) Size;
// LOG_D(MAC,"[UE %d] Frame %d: Requested RRCConnectionRequest, got %d bytes\n",module_idP,frameP,Size);
LOG_D(RRC,
LOG_I(RRC,
"[MSC_MSG][FRAME %05d][RRC_UE][MOD %02d][][--- MAC_DATA_REQ (RRCConnectionRequest eNB %d) --->][MAC_UE][MOD %02d][]\n",
frameP, module_idP, eNB_indexP, module_idP);
LOG_D(MAC,
LOG_I(MAC,
"[UE %d] Frame %d: Requested RRCConnectionRequest, got %d bytes\n",
module_idP, frameP, Size);
......
......@@ -2468,11 +2468,11 @@ ue_scheduler(const module_id_t module_idP,
if (msg_p != NULL) {
switch (ITTI_MSG_ID(msg_p)) {
case RRC_MAC_CCCH_DATA_REQ:
// LOG_I(MAC,
// "Received %s from %s: instance %d, frameP %d, eNB_index %d\n",
// ITTI_MSG_NAME(msg_p), ITTI_MSG_ORIGIN_NAME(msg_p), ITTI_MSG_INSTANCE(msg_p),
// RRC_MAC_CCCH_DATA_REQ(msg_p).frame,
// RRC_MAC_CCCH_DATA_REQ(msg_p).enb_index);
LOG_I(MAC,
"Received %s from %s: instance %d, frameP %d, eNB_index %d\n",
ITTI_MSG_NAME(msg_p), ITTI_MSG_ORIGIN_NAME(msg_p), ITTI_MSG_INSTANCE(msg_p),
RRC_MAC_CCCH_DATA_REQ(msg_p).frame,
RRC_MAC_CCCH_DATA_REQ(msg_p).enb_index);
// TODO process CCCH data req.
break;
......@@ -3144,7 +3144,7 @@ SLDCH_t *ue_get_sldch(module_id_t Mod_id,int CC_id,frame_t frame_tx,sub_frame_t
0);
if (sldch->payload_length >0 ) {
// LOG_I(MAC,"Got %d bytes from RRC for SLDCH @ %p\n",sldch->payload_length,sldch);
LOG_I(MAC,"Got %d bytes from RRC for SLDCH @ %p\n",sldch->payload_length,sldch);
return (sldch);
} else
return((SLDCH_t *)NULL);
......
This diff is collapsed.
......@@ -261,7 +261,7 @@ static inline int rxtx(PHY_VARS_eNB *eNB,
eNB->UL_INFO.subframe = proc->subframe_rx;
eNB->UL_INFO.module_id = eNB->Mod_id;
eNB->UL_INFO.CC_id = eNB->CC_id;
eNB->if_inst->UL_indication(&eNB->UL_INFO, proc); // Andrew calling eNB maclayer check the UL_INFO structure
eNB->if_inst->UL_indication(&eNB->UL_INFO, proc);
AssertFatal((ret= pthread_mutex_unlock(&eNB->UL_INFO_mutex))==0,"error unlocking UL_INFO_mutex, return %d\n",ret);
/* this conflict resolution may be totally wrong, to be tested */
/* CONFLICT RESOLUTION: BEGIN */
......
......@@ -511,13 +511,18 @@ static void wait_nfapi_init(char *thread_name) {
int main ( int argc, char **argv )
{
struct sched_param param = {
struct sched_param param =
{
.sched_priority = sched_get_priority_max(SCHED_RR)
};
if (sched_setscheduler( 0, SCHED_RR, &param ) == -1 )
{
fprintf(stderr,"error setting scheduler ... are you root?\n");
}
else
{
fprintf(stderr,"selected rt scheduler\n");
}
int i;
int CC_id = 0;
......
......@@ -419,10 +419,11 @@ void init_UE_stub_single_thread(int nb_inst,
init_UE_single_thread_stub(nb_inst);
printf("UE threads created \n");
//LOG_I(PHY,"Starting multicast link on %s\n",emul_iface);
//if(NFAPI_MODE!=NFAPI_UE_STUB_PNF || NFAPI_MODE!=NFAPI_MODE_STANDALONE_PNF) // dont need this
//multicast_link_start(ue_stub_rx_handler,0,emul_iface);
if(NFAPI_MODE!=NFAPI_UE_STUB_PNF) {
LOG_I(PHY,"Starting multicast link on %s\n",emul_iface);
multicast_link_start(ue_stub_rx_handler,0,emul_iface);
}
}
void init_UE_standalone_thread()
......@@ -443,7 +444,7 @@ void init_UE_stub(int nb_inst,
int uecap_xer_in,
char *emul_iface)
{
int inst;
int inst;
LOG_I(PHY,"UE : Calling Layer 2 for initialization\n");
l2_init_ue(eMBMS_active,(uecap_xer_in==1)?uecap_xer:NULL,
0,// cba_group_active
......@@ -1064,33 +1065,6 @@ static void *UE_phy_stub_standalone_pnf_task(void *arg)
hi_dci0_req->hi_dci0_request_body.number_of_dci,
NFAPI_SFNSF2SFN(hi_dci0_req->sfn_sf), NFAPI_SFNSF2SF(hi_dci0_req->sfn_sf));
}
// if ((dl_config_req != NULL) != (tx_request_pdu_list != NULL)) {
// uint64_t start = clock_usec();
// uint64_t deadline = start + 10000;
// for (;;) {
// if (dl_config_req == NULL) {
// dl_config_req = get_queue(&dl_config_req_queue);
// }
// if (tx_request_pdu_list == NULL) {
// tx_request_pdu_list = get_queue(&tx_req_pdu_queue);
// }
// if (dl_config_req && tx_request_pdu_list) {
// uint64_t elapsed = clock_usec() - start;
// if (elapsed > 1000) {
// LOG_E(MAC, "Time difference between dl_config_req & tx_pdu is: %" PRIu64 "usec (%d %d)\n",
// elapsed, num_lone, num_pairs);
// }
// break;
// }
// if (clock_usec() > deadline) {
// LOG_E(MAC, "In behemoth dl_config_req: %p tx_req_pdu_list: %p (%d %d)\n", dl_config_req,
// tx_request_pdu_list, num_lone, num_pairs);
// break;
// }
// }
// }
if ((dl_config_req != NULL) != (tx_request_pdu_list != NULL)) {
num_lone++;
......@@ -1832,6 +1806,11 @@ static void *UE_phy_stub_thread_rxn_txnp4(void *arg)
phy_procedures_UE_SL_RX(UE,proc);
oai_subframe_ind(timer_frame, timer_subframe);
if(dl_config_req!= NULL) {
AssertFatal(0, "dl_config_req_UE_MAC() not handled\n");
//dl_config_req_UE_MAC(dl_config_req, Mod_id);
}
//if(UE_mac_inst[Mod_id].hi_dci0_req!= NULL){
if (hi_dci0_req!=NULL && hi_dci0_req->hi_dci0_request_body.hi_dci0_pdu_list!=NULL) {
AssertFatal(0, "hi_dci0_req_UE_MAC() not handled\n");
......
......@@ -543,13 +543,18 @@ void init_pdcp(void) {
}
int main( int argc, char **argv ) {
struct sched_param param = {
struct sched_param param =
{
.sched_priority = sched_get_priority_max(SCHED_RR)
};
if (sched_setscheduler( 0, SCHED_RR, &param ) == -1 )
{
fprintf(stderr,"error setting scheduler ... are you root?\n");
}
else
{
fprintf(stderr,"selected rt scheduler\n");
}
int CC_id;
uint8_t abstraction_flag=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