Commit 7b6a9c44 authored by matzakos's avatar matzakos

Testing works up to the reception of SIB1/2/3 from the UE through nfapi, but...

Testing works up to the reception of SIB1/2/3 from the UE through nfapi, but there is an issue with missing some of the nfapi messages for some frames.
parent 93627a4c
...@@ -1946,7 +1946,7 @@ add_executable(lte-softmodem-stub ...@@ -1946,7 +1946,7 @@ add_executable(lte-softmodem-stub
${OPENAIR_TARGETS}/COMMON/create_tasks.c ${OPENAIR_TARGETS}/COMMON/create_tasks.c
${OPENAIR_TARGETS}/ARCH/COMMON/common_lib.c ${OPENAIR_TARGETS}/ARCH/COMMON/common_lib.c
${OPENAIR1_DIR}/SIMULATION/ETH_TRANSPORT/netlink_init.c ${OPENAIR1_DIR}/SIMULATION/ETH_TRANSPORT/netlink_init.c
${OPENAIR3_DIR}/NAS/UE/nas_ue_task.c #${OPENAIR3_DIR}/NAS/UE/nas_ue_task.c
${OPENAIR_DIR}/common/utils/utils.c ${OPENAIR_DIR}/common/utils/utils.c
${OPENAIR_DIR}/common/utils/system.c ${OPENAIR_DIR}/common/utils/system.c
${GTPU_need_ITTI} ${GTPU_need_ITTI}
......
...@@ -502,11 +502,12 @@ function main() { ...@@ -502,11 +502,12 @@ function main() {
DIR=$OPENAIR_DIR/cmake_targets DIR=$OPENAIR_DIR/cmake_targets
if [ "$NOS1" = "1" ] ; then if [ "$NOS1" = "1" ] ; then
lte_build_dir=lte_noS1_build_oai lte_build_dir=lte_noS1_build_oai
lte_exec=lte-softmodem-nos1 #lte_exec=lte-softmodem-nos1
lte_exec=lte-softmodem-stub
else else
lte_build_dir=lte_build_oai lte_build_dir=lte_build_oai
lte_exec=lte-softmodem #lte_exec=lte-softmodem
#lte_exec=lte-softmodem-stub lte_exec=lte-softmodem-stub
fi fi
# configuration module libraries, one currently available, using libconfig # configuration module libraries, one currently available, using libconfig
......
...@@ -1414,7 +1414,8 @@ int start_request(nfapi_pnf_config_t* config, nfapi_pnf_phy_config_t* phy, nfapi ...@@ -1414,7 +1414,8 @@ int start_request(nfapi_pnf_config_t* config, nfapi_pnf_phy_config_t* phy, nfapi
NFAPI_TRACE(NFAPI_TRACE_INFO, "[PNF] DJP - HACK - Set p7_config global ready for subframe ind%s\n", __FUNCTION__); NFAPI_TRACE(NFAPI_TRACE_INFO, "[PNF] DJP - HACK - Set p7_config global ready for subframe ind%s\n", __FUNCTION__);
p7_config_g = p7_config; p7_config_g = p7_config;
printf("Panos-D: start_request, bUFFER SIZE: %d", p7_config_g->subframe_buffer_size); NFAPI_TRACE(NFAPI_TRACE_INFO, "[PNF] Panos-D: start_request, BUFFER SIZE: %d", p7_config_g->subframe_buffer_size);
//printf("Panos-D: start_request, bUFFER SIZE: %d", p7_config_g->subframe_buffer_size);
// Need to wait for main thread to create RU structures // Need to wait for main thread to create RU structures
while(config_sync_var<0) while(config_sync_var<0)
...@@ -1841,7 +1842,8 @@ void oai_subframe_ind(uint16_t sfn, uint16_t sf) ...@@ -1841,7 +1842,8 @@ void oai_subframe_ind(uint16_t sfn, uint16_t sf)
if (p7_config_g != NULL && sync_var==0) if (p7_config_g != NULL && sync_var==0)
{ {
printf("Panos-D: oai_subframe_ind 1, buffer size:%d", p7_config_g->subframe_buffer_size); NFAPI_TRACE(NFAPI_TRACE_INFO, "[PNF] Panos-D: oai_subframe_ind 1, buffer size: %d", p7_config_g->subframe_buffer_size);
//printf("Panos-D: oai_subframe_ind 1, buffer size:%d", p7_config_g->subframe_buffer_size);
uint16_t sfn_sf_tx = sfn<<4 | sf; uint16_t sfn_sf_tx = sfn<<4 | sf;
......
...@@ -662,6 +662,7 @@ typedef struct{ ...@@ -662,6 +662,7 @@ typedef struct{
int ticking_var; int ticking_var;
/// condition variable for timer_thread; /// condition variable for timer_thread;
pthread_cond_t cond_ticking; pthread_cond_t cond_ticking;
//time_stats_t timer_stats;
}SF_ticking; }SF_ticking;
...@@ -1449,6 +1450,7 @@ typedef struct { ...@@ -1449,6 +1450,7 @@ typedef struct {
time_stats_t dlsch_tc_intl1_stats; time_stats_t dlsch_tc_intl1_stats;
time_stats_t dlsch_tc_intl2_stats; time_stats_t dlsch_tc_intl2_stats;
time_stats_t tx_prach; time_stats_t tx_prach;
time_stats_t timer_stats;
/// RF and Interface devices per CC /// RF and Interface devices per CC
......
...@@ -272,7 +272,7 @@ void UE_config_stub_pnf(void) { ...@@ -272,7 +272,7 @@ void UE_config_stub_pnf(void) {
UE_mac_inst[0].eth_params_n.remote_portd = *(L1_ParamList.paramarray[j][L1_REMOTE_N_PORTD_IDX].iptr); UE_mac_inst[0].eth_params_n.remote_portd = *(L1_ParamList.paramarray[j][L1_REMOTE_N_PORTD_IDX].iptr);
UE_mac_inst[0].eth_params_n.transp_preference = ETH_UDP_MODE;*/ UE_mac_inst[0].eth_params_n.transp_preference = ETH_UDP_MODE;*/
sf_ahead = 4; // Cannot cope with 4 subframes betweem RX and TX - set it to 2 sf_ahead = 2; // Cannot cope with 4 subframes betweem RX and TX - set it to 2
//configure_nfapi_pnf(UE_mac_inst[0].eth_params_n.remote_addr, UE_mac_inst[0].eth_params_n.remote_portc, UE_mac_inst[0].eth_params_n.my_addr, UE_mac_inst[0].eth_params_n.my_portd, UE_mac_inst[0].eth_params_n.remote_portd); //configure_nfapi_pnf(UE_mac_inst[0].eth_params_n.remote_addr, UE_mac_inst[0].eth_params_n.remote_portc, UE_mac_inst[0].eth_params_n.my_addr, UE_mac_inst[0].eth_params_n.my_portd, UE_mac_inst[0].eth_params_n.remote_portd);
configure_nfapi_pnf(stub_eth_params.remote_addr, stub_eth_params.remote_portc, stub_eth_params.my_addr, stub_eth_params.my_portd, stub_eth_params.remote_portd); configure_nfapi_pnf(stub_eth_params.remote_addr, stub_eth_params.remote_portc, stub_eth_params.my_addr, stub_eth_params.my_portd, stub_eth_params.remote_portd);
} }
...@@ -335,13 +335,13 @@ void RCconfig_L1(void) { ...@@ -335,13 +335,13 @@ void RCconfig_L1(void) {
RC.eNB[j] = (PHY_VARS_eNB **)malloc((1+MAX_NUM_CCs)*sizeof(PHY_VARS_eNB**)); RC.eNB[j] = (PHY_VARS_eNB **)malloc((1+MAX_NUM_CCs)*sizeof(PHY_VARS_eNB**));
LOG_I(PHY,"RC.eNB[%d] = %p\n",j,RC.eNB[j]); LOG_I(PHY,"RC.eNB[%d] = %p\n",j,RC.eNB[j]);
memset(RC.eNB[j],0,(1+MAX_NUM_CCs)*sizeof(PHY_VARS_eNB***)); memset(RC.eNB[j],0,(1+MAX_NUM_CCs)*sizeof(PHY_VARS_eNB***));
printf("Panos-D: RCconfig_L1 99"); //printf("Panos-D: RCconfig_L1 99");
} }
for (i=0;i<RC.nb_L1_CC[j];i++) { for (i=0;i<RC.nb_L1_CC[j];i++) {
printf("Panos-D: RCconfig_L1 9"); //printf("Panos-D: RCconfig_L1 9");
if (RC.eNB[j][i] == NULL) { if (RC.eNB[j][i] == NULL) {
printf("Panos-D: RCconfig_L1 10"); //printf("Panos-D: RCconfig_L1 10");
RC.eNB[j][i] = (PHY_VARS_eNB *)malloc(sizeof(PHY_VARS_eNB)); RC.eNB[j][i] = (PHY_VARS_eNB *)malloc(sizeof(PHY_VARS_eNB));
memset((void*)RC.eNB[j][i],0,sizeof(PHY_VARS_eNB)); memset((void*)RC.eNB[j][i],0,sizeof(PHY_VARS_eNB));
LOG_I(PHY,"RC.eNB[%d][%d] = %p\n",j,i,RC.eNB[j][i]); LOG_I(PHY,"RC.eNB[%d][%d] = %p\n",j,i,RC.eNB[j][i]);
...@@ -364,7 +364,7 @@ void RCconfig_L1(void) { ...@@ -364,7 +364,7 @@ void RCconfig_L1(void) {
RC.eNB[j][0]->eth_params_n.remote_portd = *(L1_ParamList.paramarray[j][L1_REMOTE_N_PORTD_IDX].iptr); RC.eNB[j][0]->eth_params_n.remote_portd = *(L1_ParamList.paramarray[j][L1_REMOTE_N_PORTD_IDX].iptr);
RC.eNB[j][0]->eth_params_n.transp_preference = ETH_UDP_MODE; RC.eNB[j][0]->eth_params_n.transp_preference = ETH_UDP_MODE;
printf("Panos-D: RCconfig_L1 11"); //printf("Panos-D: RCconfig_L1 11");
sf_ahead = 2; // Cannot cope with 4 subframes betweem RX and TX - set it to 2 sf_ahead = 2; // Cannot cope with 4 subframes betweem RX and TX - set it to 2
RC.nb_macrlc_inst = 1; // This is used by mac_top_init_eNB() RC.nb_macrlc_inst = 1; // This is used by mac_top_init_eNB()
...@@ -384,7 +384,7 @@ void RCconfig_L1(void) { ...@@ -384,7 +384,7 @@ void RCconfig_L1(void) {
configure_nfapi_pnf(RC.eNB[j][0]->eth_params_n.remote_addr, RC.eNB[j][0]->eth_params_n.remote_portc, RC.eNB[j][0]->eth_params_n.my_addr, RC.eNB[j][0]->eth_params_n.my_portd, RC.eNB[j][0]->eth_params_n .remote_portd); configure_nfapi_pnf(RC.eNB[j][0]->eth_params_n.remote_addr, RC.eNB[j][0]->eth_params_n.remote_portc, RC.eNB[j][0]->eth_params_n.my_addr, RC.eNB[j][0]->eth_params_n.my_portd, RC.eNB[j][0]->eth_params_n .remote_portd);
} }
else { // other midhaul else { // other midhaul
printf("Panos-D: RCconfig_L1 12 \n"); //printf("Panos-D: RCconfig_L1 12 \n");
} }
}// j=0..num_inst }// j=0..num_inst
printf("Initializing northbound interface for L1\n"); printf("Initializing northbound interface for L1\n");
...@@ -400,22 +400,22 @@ void RCconfig_L1(void) { ...@@ -400,22 +400,22 @@ void RCconfig_L1(void) {
RC.nb_L1_CC[j]=1; // DJP - hmmm RC.nb_L1_CC[j]=1; // DJP - hmmm
printf("Panos-D: RCconfig_L1 13 \n"); //printf("Panos-D: RCconfig_L1 13 \n");
if (RC.eNB[j] == NULL) { if (RC.eNB[j] == NULL) {
RC.eNB[j] = (PHY_VARS_eNB **)malloc((1+MAX_NUM_CCs)*sizeof(PHY_VARS_eNB*)); RC.eNB[j] = (PHY_VARS_eNB **)malloc((1+MAX_NUM_CCs)*sizeof(PHY_VARS_eNB*));
printf("Panos-D: RCconfig_L1 13 \n"); //printf("Panos-D: RCconfig_L1 13 \n");
LOG_I(PHY,"RC.eNB[%d] = %p\n",j,RC.eNB[j]); LOG_I(PHY,"RC.eNB[%d] = %p\n",j,RC.eNB[j]);
memset(RC.eNB[j],0,(1+MAX_NUM_CCs)*sizeof(PHY_VARS_eNB*)); memset(RC.eNB[j],0,(1+MAX_NUM_CCs)*sizeof(PHY_VARS_eNB*));
printf("Panos-D: RCconfig_L1 14 \n"); //printf("Panos-D: RCconfig_L1 14 \n");
} }
for (i=0;i<RC.nb_L1_CC[j];i++) { for (i=0;i<RC.nb_L1_CC[j];i++) {
if (RC.eNB[j][i] == NULL) { if (RC.eNB[j][i] == NULL) {
printf("Panos-D: RCconfig_L1 15 \n"); //printf("Panos-D: RCconfig_L1 15 \n");
RC.eNB[j][i] = (PHY_VARS_eNB *)malloc(sizeof(PHY_VARS_eNB)); RC.eNB[j][i] = (PHY_VARS_eNB *)malloc(sizeof(PHY_VARS_eNB));
printf("Panos-D: RCconfig_L1 16 \n"); //printf("Panos-D: RCconfig_L1 16 \n");
memset((void*)RC.eNB[j][i],0,sizeof(PHY_VARS_eNB)); memset((void*)RC.eNB[j][i],0,sizeof(PHY_VARS_eNB));
printf("Panos-D: RCconfig_L1 17 \n"); //printf("Panos-D: RCconfig_L1 17 \n");
LOG_I(PHY,"RC.eNB[%d][%d] = %p\n",j,i,RC.eNB[j][i]); LOG_I(PHY,"RC.eNB[%d][%d] = %p\n",j,i,RC.eNB[j][i]);
RC.eNB[j][i]->Mod_id = j; RC.eNB[j][i]->Mod_id = j;
RC.eNB[j][i]->CC_id = i; RC.eNB[j][i]->CC_id = i;
......
...@@ -9,6 +9,9 @@ ...@@ -9,6 +9,9 @@
#include "openair1/SCHED/defs.h" #include "openair1/SCHED/defs.h"
//#include "common/ran_context.h" //#include "common/ran_context.h"
#include "openair2/PHY_INTERFACE/phy_stub_UE.h" #include "openair2/PHY_INTERFACE/phy_stub_UE.h"
//#define DEADLINE_SCHEDULER 1
//#include "nfapi_pnf_interface.h" //#include "nfapi_pnf_interface.h"
//#include "nfapi.h" //#include "nfapi.h"
//#include "nfapi_pnf.h" //#include "nfapi_pnf.h"
...@@ -18,6 +21,7 @@ ...@@ -18,6 +21,7 @@
//extern uint8_t nfapi_pnf; //extern uint8_t nfapi_pnf;
//UL_IND_t *UL_INFO; //UL_IND_t *UL_INFO;
extern nfapi_tx_request_pdu_t* tx_request_pdu[1023][10][10];
void Msg1_transmitted(module_id_t module_idP,uint8_t CC_id,frame_t frameP, uint8_t eNB_id); void Msg1_transmitted(module_id_t module_idP,uint8_t CC_id,frame_t frameP, uint8_t eNB_id);
void Msg3_transmitted(module_id_t module_idP,uint8_t CC_id,frame_t frameP, uint8_t eNB_id); void Msg3_transmitted(module_id_t module_idP,uint8_t CC_id,frame_t frameP, uint8_t eNB_id);
...@@ -742,8 +746,11 @@ int tx_req_UE_MAC(nfapi_tx_request_t* req) ...@@ -742,8 +746,11 @@ int tx_req_UE_MAC(nfapi_tx_request_t* req)
LOG_D(PHY,"%s() SFN/SF:%d/%d PDUs:%d\n", __FUNCTION__, sfn, sf, req->tx_request_body.number_of_pdus); LOG_D(PHY,"%s() SFN/SF:%d/%d PDUs:%d\n", __FUNCTION__, sfn, sf, req->tx_request_body.number_of_pdus);
if (req->tx_request_body.tl.tag==NFAPI_TX_REQUEST_BODY_TAG) LOG_I(MAC, "Panos-D: tx_req_UE_MAC 1 \n");
{ //printf("Panos-D: tx_req_UE_MAC 1 \n");
//if (req->tx_request_body.tl.tag==NFAPI_TX_REQUEST_BODY_TAG)
//{
for (int i=0; i<req->tx_request_body.number_of_pdus; i++) for (int i=0; i<req->tx_request_body.number_of_pdus; i++)
{ {
LOG_D(PHY,"%s() SFN/SF:%d/%d number_of_pdus:%d [PDU:%d] pdu_length:%d pdu_index:%d num_segments:%d\n", LOG_D(PHY,"%s() SFN/SF:%d/%d number_of_pdus:%d [PDU:%d] pdu_length:%d pdu_index:%d num_segments:%d\n",
...@@ -756,10 +763,10 @@ int tx_req_UE_MAC(nfapi_tx_request_t* req) ...@@ -756,10 +763,10 @@ int tx_req_UE_MAC(nfapi_tx_request_t* req)
req->tx_request_body.tx_pdu_list[i].num_segments req->tx_request_body.tx_pdu_list[i].num_segments
); );
tx_request_pdu_list = req->tx_request_body.tx_pdu_list; //tx_request_pdu_list = req->tx_request_body.tx_pdu_list;
//tx_request_pdu_UE_MAC[sfn][sf][i] = &req->tx_request_body.tx_pdu_list[i]; //tx_request_pdu[sfn][sf][i] = &req->tx_request_body.tx_pdu_list[i];
} }
} //}
return 0; return 0;
} }
...@@ -767,7 +774,7 @@ int tx_req_UE_MAC(nfapi_tx_request_t* req) ...@@ -767,7 +774,7 @@ int tx_req_UE_MAC(nfapi_tx_request_t* req)
int dl_config_req_UE_MAC(nfapi_dl_config_request_t* req) int dl_config_req_UE_MAC(nfapi_dl_config_request_t* req)
{ {
LOG_I(MAC, "Panos-D: dl_config_req_UE_MAC 1 \n");
int sfn = NFAPI_SFNSF2SFN(req->sfn_sf); int sfn = NFAPI_SFNSF2SFN(req->sfn_sf);
int sf = NFAPI_SFNSF2SF(req->sfn_sf); int sf = NFAPI_SFNSF2SF(req->sfn_sf);
module_id_t Mod_id = 0; //Panos: Currently static (only for one UE) but this should change. module_id_t Mod_id = 0; //Panos: Currently static (only for one UE) but this should change.
...@@ -784,10 +791,15 @@ int dl_config_req_UE_MAC(nfapi_dl_config_request_t* req) ...@@ -784,10 +791,15 @@ int dl_config_req_UE_MAC(nfapi_dl_config_request_t* req)
//NFAPI_TRACE(NFAPI_TRACE_INFO, "%s() TX:%d/%d RX:%d/%d sfn_sf:%d DCI:%d PDU:%d\n", __FUNCTION__, proc->frame_tx, proc->subframe_tx, proc->frame_rx, proc->subframe_rx, NFAPI_SFNSF2DEC(req->sfn_sf), req->dl_config_request_body.number_dci, req->dl_config_request_body.number_pdu); //NFAPI_TRACE(NFAPI_TRACE_INFO, "%s() TX:%d/%d RX:%d/%d sfn_sf:%d DCI:%d PDU:%d\n", __FUNCTION__, proc->frame_tx, proc->subframe_tx, proc->frame_rx, proc->subframe_rx, NFAPI_SFNSF2DEC(req->sfn_sf), req->dl_config_request_body.number_dci, req->dl_config_request_body.number_pdu);
//LOG_D(PHY,"NFAPI: Sched_INFO:SFN/SF:%d%d dl_pdu:%d tx_req:%d hi_dci0:%d ul_cfg:%d num_pdcch_symbols:%d\n",
// frame,subframe,number_dl_pdu,TX_req->tx_request_body.number_of_pdus,number_hi_dci0_pdu,number_ul_pdu, eNB->pdcch_vars[subframe&1].num_pdcch_symbols);
for (int i=0;i<req->dl_config_request_body.number_pdu;i++) for (int i=0;i<req->dl_config_request_body.number_pdu;i++)
{ {
//NFAPI_TRACE(NFAPI_TRACE_INFO, "%s() sfn/sf:%d PDU[%d] size:%d\n", __FUNCTION__, NFAPI_SFNSF2DEC(req->sfn_sf), i, dl_config_pdu_list[i].pdu_size); //NFAPI_TRACE(NFAPI_TRACE_INFO, "%s() sfn/sf:%d PDU[%d] size:%d\n", __FUNCTION__, NFAPI_SFNSF2DEC(req->sfn_sf), i, dl_config_pdu_list[i].pdu_size);
LOG_E(MAC, "%s() sfn/sf:%d PDU[%d] size:%d\n", __FUNCTION__, NFAPI_SFNSF2DEC(req->sfn_sf), i, dl_config_pdu_list[i].pdu_size);
if (dl_config_pdu_list[i].pdu_type == NFAPI_DL_CONFIG_DCI_DL_PDU_TYPE) if (dl_config_pdu_list[i].pdu_type == NFAPI_DL_CONFIG_DCI_DL_PDU_TYPE)
{ {
if (dl_config_pdu_list[i].dci_dl_pdu.dci_dl_pdu_rel8.rnti_type == 1) { if (dl_config_pdu_list[i].dci_dl_pdu.dci_dl_pdu_rel8.rnti_type == 1) {
...@@ -810,6 +822,8 @@ int dl_config_req_UE_MAC(nfapi_dl_config_request_t* req) ...@@ -810,6 +822,8 @@ int dl_config_req_UE_MAC(nfapi_dl_config_request_t* req)
dl_config_pdu_tmp = &dl_config_pdu_list[i+1]; dl_config_pdu_tmp = &dl_config_pdu_list[i+1];
if(dl_config_pdu_tmp->pdu_type == NFAPI_DL_CONFIG_DLSCH_PDU_TYPE && dl_config_pdu_list[i].dci_dl_pdu.dci_dl_pdu_rel8.rnti == 0xFFFF){ if(dl_config_pdu_tmp->pdu_type == NFAPI_DL_CONFIG_DLSCH_PDU_TYPE && dl_config_pdu_list[i].dci_dl_pdu.dci_dl_pdu_rel8.rnti == 0xFFFF){
//pdu = Tx_req->tx_request_body.tx_pdu_list[dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.pdu_index].segments[0].segment_data; //pdu = Tx_req->tx_request_body.tx_pdu_list[dl_config_pdu->dlsch_pdu.dlsch_pdu_rel8.pdu_index].segments[0].segment_data;
LOG_D(PHY,"%s() [PDU:%d] NFAPI_DL_CONFIG_DLSCH_PDU_TYPE TX:%d/%d RX:%d/%d transport_blocks:%d pdu_index:%d sdu:%p\n",
__FUNCTION__, i, sfn, sf, sfn, sf, dl_config_pdu_tmp->dlsch_pdu.dlsch_pdu_rel8.transport_blocks, dl_config_pdu_tmp->dlsch_pdu.dlsch_pdu_rel8.pdu_index, tx_request_pdu_list[dl_config_pdu_tmp->dlsch_pdu.dlsch_pdu_rel8.pdu_index].segments[0].segment_data);
if(tx_request_pdu_list + dl_config_pdu_tmp->dlsch_pdu.dlsch_pdu_rel8.pdu_index!= NULL){ if(tx_request_pdu_list + dl_config_pdu_tmp->dlsch_pdu.dlsch_pdu_rel8.pdu_index!= NULL){
ue_decode_si(Mod_id, 0, sfn, 0, ue_decode_si(Mod_id, 0, sfn, 0,
tx_request_pdu_list[dl_config_pdu_tmp->dlsch_pdu.dlsch_pdu_rel8.pdu_index].segments[0].segment_data, tx_request_pdu_list[dl_config_pdu_tmp->dlsch_pdu.dlsch_pdu_rel8.pdu_index].segments[0].segment_data,
...@@ -868,14 +882,25 @@ int dl_config_req_UE_MAC(nfapi_dl_config_request_t* req) ...@@ -868,14 +882,25 @@ int dl_config_req_UE_MAC(nfapi_dl_config_request_t* req)
//NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s() UNKNOWN:%d\n", __FUNCTION__, dl_config_pdu_list[i].pdu_type); //NFAPI_TRACE(NFAPI_TRACE_ERROR, "%s() UNKNOWN:%d\n", __FUNCTION__, dl_config_pdu_list[i].pdu_type);
} }
} }
//deallocate_mem_nfapi_dl
if(req->vendor_extension) if(req->vendor_extension)
free(req->vendor_extension); free(req->vendor_extension);
/*if(tx_request_pdu_list)
free(tx_request_pdu_list);
free(req);*/
return 0; return 0;
} }
int deallocate_mem_nfapi_dl(nfapi_dl_config_request_t* req, nfapi_tx_request_pdu_t* tx_pdu_list){
}
int hi_dci0_req_UE_MAC(nfapi_hi_dci0_request_t* req) int hi_dci0_req_UE_MAC(nfapi_hi_dci0_request_t* req)
{ {
...@@ -919,13 +944,40 @@ int hi_dci0_req_UE_MAC(nfapi_hi_dci0_request_t* req) ...@@ -919,13 +944,40 @@ int hi_dci0_req_UE_MAC(nfapi_hi_dci0_request_t* req)
return 0; return 0;
} }
// The following set of memcpy functions should be getting called as callback functions from // The following set of memcpy functions should be getting called as callback functions from
// pnf_p7_subframe_ind. // pnf_p7_subframe_ind.
int memcpy_dl_config_req (nfapi_pnf_p7_config_t* pnf_p7, nfapi_dl_config_request_t* req) int memcpy_dl_config_req (nfapi_pnf_p7_config_t* pnf_p7, nfapi_dl_config_request_t* req)
{ {
module_id_t Mod_id = 0; //Panos: Currently static (only for one UE) but this should change. module_id_t Mod_id = 0; //Panos: Currently static (only for one UE) but this should change.
UE_mac_inst[Mod_id].dl_config_req = req; UE_mac_inst[Mod_id].dl_config_req = (nfapi_dl_config_request_t*)malloc(sizeof(nfapi_dl_config_request_t));
LOG_I(MAC, "Panos-D: memcpy_dl_config_req 1 \n");
/*if(req->header!=NULL){
UE_mac_inst[Mod_id].dl_config_req->header = req->header;
}*/
UE_mac_inst[Mod_id].dl_config_req->sfn_sf = req->sfn_sf;
UE_mac_inst[Mod_id].dl_config_req->vendor_extension = req->vendor_extension;
UE_mac_inst[Mod_id].dl_config_req->dl_config_request_body.number_dci = req->dl_config_request_body.number_dci;
UE_mac_inst[Mod_id].dl_config_req->dl_config_request_body.number_pdcch_ofdm_symbols = req->dl_config_request_body.number_pdcch_ofdm_symbols;
UE_mac_inst[Mod_id].dl_config_req->dl_config_request_body.number_pdsch_rnti = req->dl_config_request_body.number_pdsch_rnti;
UE_mac_inst[Mod_id].dl_config_req->dl_config_request_body.number_pdu = req->dl_config_request_body.number_pdu;
UE_mac_inst[Mod_id].dl_config_req->dl_config_request_body.tl = req->dl_config_request_body.tl;
UE_mac_inst[Mod_id].dl_config_req->dl_config_request_body.dl_config_pdu_list = (nfapi_dl_config_request_pdu_t*) malloc(req->dl_config_request_body.number_pdu*sizeof(nfapi_dl_config_request_pdu_t));
for(int i=0; i<UE_mac_inst[Mod_id].dl_config_req->dl_config_request_body.number_pdu; i++) {
UE_mac_inst[Mod_id].dl_config_req->dl_config_request_body.dl_config_pdu_list[i] = req->dl_config_request_body.dl_config_pdu_list[i];
}
//UE_mac_inst[Mod_id].dl_config_req = req;
return 0; return 0;
} }
int memcpy_ul_config_req (nfapi_pnf_p7_config_t* pnf_p7, nfapi_ul_config_request_t* req) int memcpy_ul_config_req (nfapi_pnf_p7_config_t* pnf_p7, nfapi_ul_config_request_t* req)
...@@ -937,8 +989,43 @@ int memcpy_ul_config_req (nfapi_pnf_p7_config_t* pnf_p7, nfapi_ul_config_request ...@@ -937,8 +989,43 @@ int memcpy_ul_config_req (nfapi_pnf_p7_config_t* pnf_p7, nfapi_ul_config_request
int memcpy_tx_req (nfapi_pnf_p7_config_t* pnf_p7, nfapi_tx_request_t* req) int memcpy_tx_req (nfapi_pnf_p7_config_t* pnf_p7, nfapi_tx_request_t* req)
{ {
LOG_I(MAC, "Panos-D: memcpy_tx_req 1, req->tx_request_body.number_of_pdus: %d \n", req->tx_request_body.number_of_pdus);
LOG_I(MAC, "Panos-D: memcpy_tx_req 1, req->tx_request_body.tx_pdu_list[i].pdu_length: %d \n", req->tx_request_body.tx_pdu_list[0].pdu_length);
LOG_I(MAC, "Panos-D: memcpy_tx_req 1, req->tx_request_body.tx_pdu_list[i].pdu_index: %d \n", req->tx_request_body.tx_pdu_list[0].pdu_index);
LOG_I(MAC, "Panos-D: memcpy_tx_req 1, req->tx_request_body.tx_pdu_list[i].num_segments: %d \n", req->tx_request_body.tx_pdu_list[0].num_segments);
LOG_I(MAC, "Panos-D: memcpy_tx_req 1, req->tx_request_body.tx_pdu_list[i].segments[j].segment_data: %d \n", *req->tx_request_body.tx_pdu_list[0].segments[0].segment_data);
//printf("Panos-D: memcpy_tx_req 1, req->tx_request_body.number_of_pdus: %d \n", req->tx_request_body.number_of_pdus);
//printf("Panos-D: memcpy_tx_req 1, req->tx_request_body.tx_pdu_list[i].pdu_length: %d \n", req->tx_request_body.tx_pdu_list[0].pdu_length);
//printf("Panos-D: memcpy_tx_req 1, req->tx_request_body.tx_pdu_list[i].pdu_index: %d \n", req->tx_request_body.tx_pdu_list[0].pdu_index);
//printf("Panos-D: memcpy_tx_req 1, req->tx_request_body.tx_pdu_list[i].num_segments: %d \n", req->tx_request_body.tx_pdu_list[0].num_segments);
//printf("Panos-D: memcpy_tx_req 1, req->tx_request_body.tx_pdu_list[i].segments[j].segment_data: %d \n", *req->tx_request_body.tx_pdu_list[0].segments[0].segment_data);
module_id_t Mod_id = 0; //Panos: Currently static (only for one UE) but this should change. module_id_t Mod_id = 0; //Panos: Currently static (only for one UE) but this should change.
UE_mac_inst[Mod_id].tx_req = req;
int num_elem = req->tx_request_body.number_of_pdus;
tx_request_pdu_list = (nfapi_tx_request_pdu_t*) malloc(num_elem*sizeof(nfapi_tx_request_pdu_t));
//UE_mac_inst[Mod_id].tx_req = (nfapi_tx_request_t*) malloc(sizeof(nfapi_tx_request_t));
//memcpy(UE_mac_inst[Mod_id].tx_req, req, sizeof(req));
for (int i=0; i<num_elem; i++) {
tx_request_pdu_list[i].num_segments = req->tx_request_body.tx_pdu_list[i].num_segments;
tx_request_pdu_list[i].pdu_index = req->tx_request_body.tx_pdu_list[i].pdu_index;
tx_request_pdu_list[i].pdu_length = req->tx_request_body.tx_pdu_list[i].pdu_length;
for (int j=0; j<req->tx_request_body.tx_pdu_list[i].num_segments; j++){
//*tx_request_pdu_list[i].segments[j].segment_data = *req->tx_request_body.tx_pdu_list[i].segments[j].segment_data;
tx_request_pdu_list[i].segments[j].segment_length = req->tx_request_body.tx_pdu_list[i].segments[j].segment_length;
if(tx_request_pdu_list[i].segments[j].segment_length > 0){
tx_request_pdu_list[i].segments[j].segment_data = (uint8_t*)malloc(tx_request_pdu_list[i].segments[j].segment_length*sizeof (uint8_t));
memcpy(tx_request_pdu_list[i].segments[j].segment_data, req->tx_request_body.tx_pdu_list[i].segments[j].segment_data, tx_request_pdu_list[i].segments[j].segment_length);
}
//tx_request_pdu_list[i].segments[j].segment_length = req->tx_request_body.tx_pdu_list[i].segments[j].segment_length;
}
//tx_request_pdu_list[i].segments = req->tx_request_body.tx_pdu_list[i].segments;
}
// Panos: Old way. Not possible to use because by the time we call tx_req_UE_MAC tx_req memory has been deallocated within nfapi.
//UE_mac_inst[Mod_id].tx_req = req;
return 0; return 0;
} }
......
...@@ -2742,6 +2742,9 @@ int decode_BCCH_DLSCH_Message( ...@@ -2742,6 +2742,9 @@ int decode_BCCH_DLSCH_Message(
(void*)&bcch_message->message.choice.c1.choice.systemInformationBlockType1, (void*)&bcch_message->message.choice.c1.choice.systemInformationBlockType1,
sizeof(SystemInformationBlockType1_t) ); sizeof(SystemInformationBlockType1_t) );
LOG_D( RRC, "[UE %"PRIu8"] Decoding First SIB1\n", ctxt_pP->module_id ); LOG_D( RRC, "[UE %"PRIu8"] Decoding First SIB1\n", ctxt_pP->module_id );
LOG_I( RRC, "Panos-D: decode_BCCH_DLSCH_Message1 BEFORE decode_SIB1");
//printf("Panos-D: decode_BCCH_DLSCH_Message1 BEFORE decode_SIB1");
decode_SIB1( ctxt_pP, eNB_index, rsrq, rsrp ); decode_SIB1( ctxt_pP, eNB_index, rsrq, rsrp );
} }
} }
...@@ -2760,7 +2763,8 @@ int decode_BCCH_DLSCH_Message( ...@@ -2760,7 +2763,8 @@ int decode_BCCH_DLSCH_Message(
LOG_D( RRC, "[UE %"PRIu8"] Decoding SI for frameP %"PRIu32"\n", LOG_D( RRC, "[UE %"PRIu8"] Decoding SI for frameP %"PRIu32"\n",
ctxt_pP->module_id, ctxt_pP->module_id,
ctxt_pP->frame ); ctxt_pP->frame );
LOG_I( RRC, "Panos-D: decode_BCCH_DLSCH_Message1 BEFORE OTHER decode_SI");
//printf("Panos-D: decode_BCCH_DLSCH_Message1 BEFORE OTHER decode_SI");
decode_SI( ctxt_pP, eNB_index ); decode_SI( ctxt_pP, eNB_index );
} }
...@@ -3581,25 +3585,31 @@ static void dump_sib19(SystemInformationBlockType19_r12_t *sib19){ ...@@ -3581,25 +3585,31 @@ static void dump_sib19(SystemInformationBlockType19_r12_t *sib19){
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
static int decode_SI( const protocol_ctxt_t* const ctxt_pP, const uint8_t eNB_index ) static int decode_SI( const protocol_ctxt_t* const ctxt_pP, const uint8_t eNB_index )
{ {
LOG_I( RRC, "Panos-D: decode_SI 1 \n");
//printf("Panos-D: decode_SI 1 \n");
SystemInformation_t** si = &UE_rrc_inst[ctxt_pP->module_id].si[eNB_index]; SystemInformation_t** si = &UE_rrc_inst[ctxt_pP->module_id].si[eNB_index];
int new_sib = 0; int new_sib = 0;
SystemInformationBlockType1_t* sib1 = UE_rrc_inst[ctxt_pP->module_id].sib1[eNB_index]; SystemInformationBlockType1_t* sib1 = UE_rrc_inst[ctxt_pP->module_id].sib1[eNB_index];
LOG_I( RRC, "Panos-D: decode_SI 2 \n");
VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_RRC_UE_DECODE_SI, VCD_FUNCTION_IN ); VCD_SIGNAL_DUMPER_DUMP_FUNCTION_BY_NAME( VCD_SIGNAL_DUMPER_FUNCTIONS_RRC_UE_DECODE_SI, VCD_FUNCTION_IN );
// Dump contents // Dump contents
//TTN - should be modified since we use SystemInformation__criticalExtensions_PR_criticalExtensionsFuture //TTN - should be modified since we use SystemInformation__criticalExtensions_PR_criticalExtensionsFuture
// instead of SystemInformation__criticalExtensions_PR_systemInformation_r8 // instead of SystemInformation__criticalExtensions_PR_systemInformation_r8
//if ((*si)->criticalExtensions.present == SystemInformation__criticalExtensions_PR_systemInformation_r8) { // Panos: I brought this if condition back to previous form in order to prevent crashing. Pending to
if ((*si)->criticalExtensions.present == SystemInformation__criticalExtensions_PR_criticalExtensionsFuture) { // modify for SystemInformation__criticalExtensions_PR_criticalExtensionsFuture
if ((*si)->criticalExtensions.present == SystemInformation__criticalExtensions_PR_systemInformation_r8) {
//if ((*si)->criticalExtensions.present == SystemInformation__criticalExtensions_PR_criticalExtensionsFuture) {
LOG_D( RRC, "[UE] (*si)->criticalExtensions.choice.systemInformation_r8.sib_TypeAndInfo.list.count %d\n", LOG_D( RRC, "[UE] (*si)->criticalExtensions.choice.systemInformation_r8.sib_TypeAndInfo.list.count %d\n",
(*si)->criticalExtensions.choice.systemInformation_r8.sib_TypeAndInfo.list.count ); (*si)->criticalExtensions.choice.systemInformation_r8.sib_TypeAndInfo.list.count );
} else { } else {
LOG_I( RRC, "Panos-D: decode_SI 2.3 \n");
LOG_D( RRC, "[UE] Unknown criticalExtension version (not Rel8)\n" ); LOG_D( RRC, "[UE] Unknown criticalExtension version (not Rel8)\n" );
return -1; return -1;
} }
LOG_I( RRC, "Panos-D: decode_SI 3 \n");
for (int i=0; i<(*si)->criticalExtensions.choice.systemInformation_r8.sib_TypeAndInfo.list.count; i++) { for (int i=0; i<(*si)->criticalExtensions.choice.systemInformation_r8.sib_TypeAndInfo.list.count; i++) {
LOG_D( RRC, "SI count %d\n", i ); LOG_D( RRC, "SI count %d\n", i );
struct SystemInformation_r8_IEs__sib_TypeAndInfo__Member *typeandinfo; struct SystemInformation_r8_IEs__sib_TypeAndInfo__Member *typeandinfo;
...@@ -3607,6 +3617,7 @@ static int decode_SI( const protocol_ctxt_t* const ctxt_pP, const uint8_t eNB_in ...@@ -3607,6 +3617,7 @@ static int decode_SI( const protocol_ctxt_t* const ctxt_pP, const uint8_t eNB_in
switch(typeandinfo->present) { switch(typeandinfo->present) {
case SystemInformation_r8_IEs__sib_TypeAndInfo__Member_PR_sib2: case SystemInformation_r8_IEs__sib_TypeAndInfo__Member_PR_sib2:
LOG_I( RRC, "Panos-D: decode_SI 4 \n");
if ((UE_rrc_inst[ctxt_pP->module_id].Info[eNB_index].SIStatus&2) == 0) { if ((UE_rrc_inst[ctxt_pP->module_id].Info[eNB_index].SIStatus&2) == 0) {
UE_rrc_inst[ctxt_pP->module_id].Info[eNB_index].SIStatus|=2; UE_rrc_inst[ctxt_pP->module_id].Info[eNB_index].SIStatus|=2;
new_sib=1; new_sib=1;
...@@ -3690,6 +3701,7 @@ static int decode_SI( const protocol_ctxt_t* const ctxt_pP, const uint8_t eNB_in ...@@ -3690,6 +3701,7 @@ static int decode_SI( const protocol_ctxt_t* const ctxt_pP, const uint8_t eNB_in
break; // case SystemInformation_r8_IEs__sib_TypeAndInfo__Member_PR_sib2 break; // case SystemInformation_r8_IEs__sib_TypeAndInfo__Member_PR_sib2
case SystemInformation_r8_IEs__sib_TypeAndInfo__Member_PR_sib3: case SystemInformation_r8_IEs__sib_TypeAndInfo__Member_PR_sib3:
LOG_I( RRC, "Panos-D: decode_SI 5 \n");
if ((UE_rrc_inst[ctxt_pP->module_id].Info[eNB_index].SIStatus&4) == 0) { if ((UE_rrc_inst[ctxt_pP->module_id].Info[eNB_index].SIStatus&4) == 0) {
UE_rrc_inst[ctxt_pP->module_id].Info[eNB_index].SIStatus|=4; UE_rrc_inst[ctxt_pP->module_id].Info[eNB_index].SIStatus|=4;
new_sib=1; new_sib=1;
......
...@@ -5,16 +5,32 @@ log_config = { ...@@ -5,16 +5,32 @@ log_config = {
hw_log_verbosity ="medium"; hw_log_verbosity ="medium";
phy_log_level ="info"; phy_log_level ="info";
phy_log_verbosity ="medium"; phy_log_verbosity ="medium";
mac_log_level ="info"; mac_log_level ="debug";
mac_log_verbosity ="medium"; mac_log_verbosity ="medium";
rlc_log_level ="info"; rlc_log_level ="info";
rlc_log_verbosity ="medium"; rlc_log_verbosity ="medium";
pdcp_log_level ="info"; pdcp_log_level ="info";
pdcp_log_verbosity ="medium"; pdcp_log_verbosity ="medium";
rrc_log_level ="info"; rrc_log_level ="debug";
rrc_log_verbosity ="medium"; rrc_log_verbosity ="full";
}; };
#L1s = (
# {
# num_cc = 1;
# tr_n_preference = "nfapi";
# local_n_if_name = "eno1";
# remote_n_address = "192.168.1.28";
# local_n_address = "192.168.1.74";
# local_n_portc = 50000;
# remote_n_portc = 50001;
# local_n_portd = 50010;
# remote_n_portd = 50011;
# }
#);
L1s = ( L1s = (
{ {
num_cc = 1; num_cc = 1;
......
...@@ -633,7 +633,6 @@ static void get_options(void) { ...@@ -633,7 +633,6 @@ static void get_options(void) {
uint32_t online_log_messages; uint32_t online_log_messages;
uint32_t glog_level, glog_verbosity; uint32_t glog_level, glog_verbosity;
uint32_t start_telnetsrv; uint32_t start_telnetsrv;
printf("Panos: get_options 1 \n");
paramdef_t cmdline_params[] =CMDLINE_PARAMS_DESC ; paramdef_t cmdline_params[] =CMDLINE_PARAMS_DESC ;
paramdef_t cmdline_logparams[] =CMDLINE_LOGPARAMS_DESC ; paramdef_t cmdline_logparams[] =CMDLINE_LOGPARAMS_DESC ;
...@@ -641,7 +640,6 @@ static void get_options(void) { ...@@ -641,7 +640,6 @@ static void get_options(void) {
config_process_cmdline( cmdline_params,sizeof(cmdline_params)/sizeof(paramdef_t),NULL); config_process_cmdline( cmdline_params,sizeof(cmdline_params)/sizeof(paramdef_t),NULL);
printf("get_options 0, UE_flag: %d", UE_flag); printf("get_options 0, UE_flag: %d", UE_flag);
printf("Panos: get_options 2 \n");
if (strlen(in_path) > 0) { if (strlen(in_path) > 0) {
opt_type = OPT_PCAP; opt_type = OPT_PCAP;
opt_enabled=1; opt_enabled=1;
...@@ -652,7 +650,6 @@ static void get_options(void) { ...@@ -652,7 +650,6 @@ static void get_options(void) {
opt_type = OPT_WIRESHARK; opt_type = OPT_WIRESHARK;
printf("Enabling OPT for wireshark for local interface"); printf("Enabling OPT for wireshark for local interface");
} }
printf("Panos: get_options 3 \n");
config_process_cmdline( cmdline_logparams,sizeof(cmdline_logparams)/sizeof(paramdef_t),NULL); config_process_cmdline( cmdline_logparams,sizeof(cmdline_logparams)/sizeof(paramdef_t),NULL);
if(config_isparamset(cmdline_logparams,CMDLINE_ONLINELOG_IDX)) { if(config_isparamset(cmdline_logparams,CMDLINE_ONLINELOG_IDX)) {
set_glog_onlinelog(online_log_messages); set_glog_onlinelog(online_log_messages);
...@@ -667,27 +664,23 @@ static void get_options(void) { ...@@ -667,27 +664,23 @@ static void get_options(void) {
load_module_shlib("telnetsrv",NULL,0); load_module_shlib("telnetsrv",NULL,0);
} }
printf("Panos: get_options 4 \n");
if (UE_flag > 0) { if (UE_flag > 0) {
// set default parameters // set default parameters
set_default_frame_parms(frame_parms); set_default_frame_parms(frame_parms);
paramdef_t cmdline_uemodeparams[] =CMDLINE_UEMODEPARAMS_DESC; paramdef_t cmdline_uemodeparams[] =CMDLINE_UEMODEPARAMS_DESC;
paramdef_t cmdline_ueparams[] =CMDLINE_UEPARAMS_DESC; paramdef_t cmdline_ueparams[] =CMDLINE_UEPARAMS_DESC;
printf("Panos: get_options 5 \n");
config_process_cmdline( cmdline_uemodeparams,sizeof(cmdline_uemodeparams)/sizeof(paramdef_t),NULL); config_process_cmdline( cmdline_uemodeparams,sizeof(cmdline_uemodeparams)/sizeof(paramdef_t),NULL);
config_process_cmdline( cmdline_ueparams,sizeof(cmdline_ueparams)/sizeof(paramdef_t),NULL); config_process_cmdline( cmdline_ueparams,sizeof(cmdline_ueparams)/sizeof(paramdef_t),NULL);
printf("Panos: get_options 6 \n");
if (loopfile != NULL) { if (loopfile != NULL) {
printf("Input file for hardware emulation: %s",loopfile); printf("Input file for hardware emulation: %s",loopfile);
mode=loop_through_memory; mode=loop_through_memory;
input_fd = fopen(loopfile,"r"); input_fd = fopen(loopfile,"r");
AssertFatal(input_fd != NULL,"Please provide a valid input file\n"); AssertFatal(input_fd != NULL,"Please provide a valid input file\n");
} }
printf("Panos: get_options 7 \n");
if ( (cmdline_uemodeparams[CMDLINE_CALIBUERX_IDX].paramflags & PARAMFLAG_PARAMSET) != 0) mode = rx_calib_ue; if ( (cmdline_uemodeparams[CMDLINE_CALIBUERX_IDX].paramflags & PARAMFLAG_PARAMSET) != 0) mode = rx_calib_ue;
printf("Panos: get_options 8 \n");
if ( (cmdline_uemodeparams[CMDLINE_CALIBUERXMED_IDX].paramflags & PARAMFLAG_PARAMSET) != 0) mode = rx_calib_ue_med; if ( (cmdline_uemodeparams[CMDLINE_CALIBUERXMED_IDX].paramflags & PARAMFLAG_PARAMSET) != 0) mode = rx_calib_ue_med;
printf("Panos: get_options 9 \n"); printf("Panos: get_options 9 \n");
if ( (cmdline_uemodeparams[CMDLINE_CALIBUERXBYP_IDX].paramflags & PARAMFLAG_PARAMSET) != 0) mode = rx_calib_ue_byp; if ( (cmdline_uemodeparams[CMDLINE_CALIBUERXBYP_IDX].paramflags & PARAMFLAG_PARAMSET) != 0) mode = rx_calib_ue_byp;
...@@ -1305,12 +1298,13 @@ int main( int argc, char **argv ) ...@@ -1305,12 +1298,13 @@ int main( int argc, char **argv )
rt_sleep_ns(10*100000000ULL); rt_sleep_ns(10*100000000ULL);